ContentInfo = "";
borderColor="#000000";
topColor = "#D0D0FF";
subColor = "#E5E5E0";
ttDefWidth=400;
ttMargin=6;
delayInt=600;

var mouse_X;
var mouse_Y;

var timerID = null; 
var timerRunning = false;

var tip_active = 0;

function update_tip_pos()
{
	document.getElementById('ToolTip').style.left = mouse_X + 20;
	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 = event.clientX + document.body.scrollLeft;
		mouse_Y = event.clientY + document.body.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, ttWidth)
{
	ContentInfo = '<table border="0" width="'+ttWidth+'" cellspacing="0" cellpadding="0">'+
		'<tr><td width="100%" bgcolor="'+borderColor+'">'+
		'<table border="0" width="100%" cellspacing="1" cellpadding="0">';

	if (TTitle!='')
	{
		ContentInfo +=
		'<tr><td width="100%" bgcolor='+topColor+'>'+
		' <table border="0" width="'+(ttWidth-ttMargin)+'" cellspacing="0" cellpadding="0" align="center">'+
		' <tr><td width="100%"><font class="tooltiptitle">'+deConvert(TTitle)+'</font></td></tr>'+
		' </table>'+
		'</td></tr>';
	}

	ContentInfo +='<tr><td width="100%" bgcolor='+subColor+'>'+

	'<table border="0" width="'+(ttWidth-ttMargin)+'" cellpadding="0" cellspacing="1" align="center">'+

	'<tr><td width="100%">'+

	'<font class="tooltipcontent">'+deConvert(TContent)+'</font>'+

	'</td></tr>'+
	'</table>'+

	'</td></tr>'+
	'</table>'+

	'</td></tr>'+
	'</table>';
}

function tip_it(which, TTitle, TContent,ttwidth)
{
	if(which){
		st="tip_init("+which+", '"+TTitle+"', '"+TContent+"', "+ttwidth+")";
		timerRunning = true;
		timerID=setTimeout(st,delayInt);
	}else{
		tip_init(which, TTitle, TContent,ttwidth);
		if(timerRunning)      
			clearTimeout(timerID);
		timerRunning = false;
	}
}

function tip_init(which, TTitle, TContent,ttwidth)
{
	if(which){
		update_tip_pos();
		tip_active = 1;
		if (ttwidth=='')
		{
			ttwidth=ttDefWidth;
		}
		document.getElementById('ToolTip').style.visibility = "visible";
		EnterContent(TTitle, TContent,ttwidth);
		document.getElementById('ToolTip').innerHTML = ContentInfo;
	}else{
		tip_active = 0;
		document.getElementById('ToolTip').style.visibility = "hidden";
	}
}

function deConvert(st)
{
	st2=st;
	st2=st2.replace(/\"/gi, '\'');
	return st2;
}