ContentInfo = "";
topColor = "#808080"
subColor = "#C0C0C0"
var mouse_X;
var mouse_Y;
var ToolTipWidth = 100;
var tip_active = 0;

function update_tip_pos()
{
		document.getElementById('ToolTip').style.left = mouse_X + 10;
		if((mouse_X+10)+ToolTipWidth > document.body.clientWidth) { document.getElementById('ToolTip').style.left = (mouse_X - (ToolTipWidth+10)); }
		document.getElementById('ToolTip').style.top  = mouse_Y;
}

var ie = document.all?true:false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e)
{
	if (ie)
	{ // grab the x-y pos.s if browser is IE
	mouse_X = window.event.x + document.documentElement.scrollLeft;
	mouse_Y = window.event.y + document.documentElement.scrollTop;
	}
	else
	{ // grab the x-y pos.s if browser is NS
		mouse_X = e.pageX;
		mouse_Y = e.pageY;
	}
	if (mouse_X < 0){mouse_X = 0;}
	if (mouse_Y < 0){mouse_Y = 0;}

	if(tip_active)
	{
	update_tip_pos();
	}
}

function EnterContent(TTitle, TContent, TWidth)
{
ToolTipWidth = TWidth;
ContentInfo = '<table border="0" width="'+TWidth+'" cellspacing="0" cellpadding="0">'+
			  '<tr>'+
			  '<td class="ToolTipinputHeader" style="border-top: solid 1px #e7e7e7;">'+TTitle+'</td>'+
			  '</tr>'+
			  '<tr>'+
			  '<td class="standardText" style="padding: 3px;background-color: #fff">'+TContent+'</td>'+
			  '</td>'+
			  '</table>'+
			  ''
}

function ToolTip(which, TWidth, TTitle, TContent)
{
	if(which){
		update_tip_pos();
		tip_active = 1;
		document.getElementById('ToolTip').style.display = "block";
		document.getElementById('ToolTip').style.visibility = "visible";
		EnterContent(TTitle, TContent, TWidth);
		document.getElementById('ToolTip').innerHTML = ContentInfo;
	}else{
		tip_active = 0;
		document.getElementById('ToolTip').style.display = "none";
		document.getElementById('ToolTip').style.visibility = "hidden";
	}
}

