
offsetX = -20;
offsetY = 20;
var toolTipSTYLE="";

function initToolTips()
{
	if(ns4||ns6||ie4)
	{
		if(ns4) toolTipSTYLE = document.toolTipLayer;
		else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
		else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
		
		if(ns4) 
			document.captureEvents(Event.MOUSEMOVE);
		else
		{
			toolTipSTYLE.visibility = "hidden";
			toolTipSTYLE.display = "none";
		}
		document.onmousemove = moveToMouseLoc;
		
	}
}

function toolTipOver(obj,msg) {
	if (obj.src) {
		var extAnt = obj.src.substr((obj.src.length-4),obj.src.length);
	}
	if (msg) {	
		if (obj.src) {
			var nameAnt = obj.src.substr(0,(obj.src.length-4));
			var nameNew = nameAnt+'_hover'+extAnt;
			obj.src = nameNew;
		}
		toolTip(msg);	
	} else {
		if (obj.src) {
			var nameAnt = obj.src.substr(0,(obj.src.length-10));
			var nameNew = nameAnt+extAnt;
			obj.src = nameNew;
		}
		toolTip();
	}
}

function toolTip(msg)
{
	if(toolTip.arguments.length < 1) // hide
	{
		if(ns4) toolTipSTYLE.visibility = "hidden";
		else toolTipSTYLE.display = "none";
	}
	else // show
	{
	    var content =  '<div id="toolTip"><table border=0 width=100%  cellpadding="3" cellspacing="0"><tr><td>' +msg + '</td></tr></table></div>';
		if(ns4)
		{
			toolTipSTYLE.document.write(content);
			toolTipSTYLE.document.close();
			toolTipSTYLE.visibility = "visible";
		}
		if(ns6)
		{
			document.getElementById("toolTipLayer").innerHTML = content;
			toolTipSTYLE.display='block'
			toolTipSTYLE.visibility = "visible";
		}
		if(ie4)
		{
			document.all("toolTipLayer").innerHTML=content;
			toolTipSTYLE.display='block'
			toolTipSTYLE.visibility = "visible";
		}
	}
}

function moveToMouseLoc(e)
{
	if(ns4||ns6)
	{
		x = e.pageX;
		y = e.pageY;
	}
	else
	{
		x = event.x + document.body.scrollLeft;
		y = event.y + document.body.scrollTop;
	}
	//alert(e);

	if(x > 700){
	x = x - 310;
	}

	newX = x + offsetX;
	newY = y + offsetY;
	

	
	
	
	toolTipSTYLE.left = newX + 'px';
	toolTipSTYLE.top = newY + 'px';
	return true;
}
