// JavaScript Document
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0

ns = (ie == 0) ? 1 : 0;

if(ns){doc = "document."; sty = ""}
if(ie){doc = "document.all."; sty = ".style"} 

var initialize = 0;
var Ex, Ey, topColor, subColor, ContentInfo;

topColor = "#808080";
subColor = "#CCCCCC";

if(ie){
	Ex = "event.x";
	Ey = "event.y";
} else if(document.layers){
	Ex = "e.pageX";
	Ey = "e.pageY";
	window.captureEvents(Event.MOUSEMOVE)
	window.onmousemove=overhere;
} else if(document.getElementById) {
	//Ex = "e.pageX";
	//Ey = "e.pageY";
	Ex = "e.clientX";
	Ey = "e.clientY";
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=overhere;
}


function MoveToolTip(layerName, FromTop, FromLeft, e){
	//alert('FromLeft = ' + eval(FromLeft));
	if(ie) {
		//alert("you are using ie");
		eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop));
		eval(doc + layerName + sty + ".left = " + (eval(FromLeft) - 155));
	} else if(document.layers) {
		eval(doc + layerName + sty + ".top = "  +  eval(FromTop) - 140);
	} else if (document.getElementById) {
		var newLeft = (eval(FromLeft) - 155) + 'px';
		var newTop = (eval(FromTop)) + 'px';
		document.getElementById('ToolTip').style.left = newLeft;
		document.getElementById('ToolTip').style.top = newTop;
	}
	
}


function ReplaceContent(layerName) {
	if (ie) {
		document.all[layerName].innerHTML = ContentInfo;
	} else if (document.layers) {
		with(document.layers[layerName].document) { 
			open(); 
			write(ContentInfo); 
			close(); 
		}
	} else if (document.getElementById) {
		document.getElementById(layerName).innerHTML=ContentInfo;
		//alert(document.getElementById(layerName).innerHTML);
	}
}


function Activate(){initialize=1}
function deActivate(){initialize=0}


function overhere(e){
	if(initialize){
		if (ie || document.layers) { 
		//alert(Ex);
			MoveToolTip("ToolTip", Ey, Ex, e);
			eval(doc + "ToolTip" + sty + ".visibility = 'visible'");
		} else {
			if( !e ) {
				if( window.Event ) {
					e = window.Event;
					//alert('typeof(e.clientX) = ' + typeof(e));
					if (typeof(e.pageX) == 'number') {
						//pos.x = evt.pageX;
						//pos.y = evt.pageY;
					}
					else {
						pos.x = evt.clientX;
						pos.y = evt.clientY;
					}
					//alert(Ey + ' = ' + window.Event.layerY + ', ' + Ex + ' = ' + window.Event.layerX);
				} else {
					return;
				}
			}
			//alert(Ey + ' = ' + eval(Ey) + ', ' + Ex + ' = ' + eval(Ex));
			MoveToolTip("ToolTip", Ey, Ex, e);
			document.getElementById('ToolTip').style.visibility = "visible";
			document.getElementById('ToolTip').style.display = 'block';
		}
	} else {
		MoveToolTip("ToolTip", 0, 0)
		if (ie || document.layers) { 
			eval(doc + "ToolTip" + sty + ".visibility = 'hidden'");
		} else {
			if( !e ) {
				if( window.Event ) {
					e = window.Event;
				} else {
					return;
				}
			}
			//alert(Ey + ' = ' + eval(Ey) + ', ' + Ex + ' = ' + eval(Ex));
			document.getElementById('ToolTip').style.visibility = "hidden";
			document.getElementById('ToolTip').style.display = "none";
		}
	}
}


function EnterContent(layerName, TTitle, TContent){

ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+

'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+

'<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+

'<tr><td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+

'<tr><td width="100%">'+

'<font class="tooltipcontent">'+TContent+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>';


ReplaceContent(layerName)

}
