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

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

function toolTip(msg)
{
	if(toolTip.arguments.length < 1) // hide
	{
		if(ns4) toolTipSTYLE.visibility = "hidden";
		else toolTipSTYLE.display = "none";
	}
	else // show
	{
	    var content =  '<img src="'+urlimg+'/system/tip.gif" alt="tip" title="tip" class="toolTipoImg alt=""/><div id="toolTip">' +msg + '</div>';
		if(ns4)
		{
			toolTipSTYLE.document.write(content);
			toolTipSTYLE.document.close();
			toolTipSTYLE.visibility = "visible";
		}
		if(ns6)
		{
			elementToolTip = document.getElementById("toolTipLayer");
			if (elementToolTip) {
				elementToolTip.innerHTML = content;
				toolTipSTYLE.display='block'
				toolTipSTYLE.visibility = "visible";
			}
		}
		if(ie4)
		{
			if (document.all("toolTipLayer")) {
				document.all("toolTipLayer").innerHTML=content;
				toolTipSTYLE.display='block'
				toolTipSTYLE.visibility = "visible";
			}
		}
	}
}

function moveToMouseLoc(e)
{
	var xx = null;
	var xy = null;

	if(ns4||ns6)
	{
		xx = e.pageX;
		xy = e.pageY;
	}
	else
	{
		xx = event.x + document.body.scrollLeft;
		xy = event.y + document.body.scrollTop;
	}	
	newX = xx + offsetX;
	newY = xy + offsetY;
	if (toolTipSTYLE) {
		toolTipSTYLE.left = newX + 'px';
		toolTipSTYLE.top = newY + 'px'; 	
	}
	return true;
}

