ContentInfo = "";

// Orange;
topColor = "#e1771e"
subColor = "#ffcc66"

// Gray;
topColor = "#505050"
subColor = "#DCDCDC"

// Blue;
topColor = "#404090"
subColor = "#CCCCFF"

// Border Color;
brdclr = "#000000";

var mouse_X;
var mouse_Y;

var tip_active = 0;

var box_width;
box_width = 300;
var tip_zone_X
tip_zone_X = self.screen.width - box_width;
var tip_zone_Y
tip_zone_Y = self.screen.height;

function update_tip_pos(){
//		if (mouse_X > (tip_zone_X)) mouse_X = mouse_X - 310;// PREVENT RUN OFF SCREEN;
//		if (mouse_X > (screen.width/2 - (box_width + 10))) mouse_X = mouse_X - (box_width/2);// PREVENT RUN OFF SCREEN;
		if (mouse_X > (screen.width/2 - (box_width/2 - 50))) mouse_X = (mouse_X - box_width/2 + 40);// PREVENT RUN OFF SCREEN;
		if (mouse_X < (120)) mouse_X = 120;// PREVENT RUN OFF SCREEN;
		document.getElementById('ToolTip').style.left = mouse_X - 120;
		document.getElementById('ToolTip').style.top  = mouse_Y + 40;
}


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){

ContentInfo = '<table border="0" width="' + box_width + '" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+brdclr+'>'+

'<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>';
}



function tip_it(which, TTitle, TContent){
	if(which && tip_active <1){
		update_tip_pos();
		tip_active = 1;
		document.getElementById('ToolTip').style.visibility = "visible";
		EnterContent(TTitle, TContent);
		document.getElementById('ToolTip').innerHTML = ContentInfo;
	} else {
		tip_active = 0;
		document.getElementById('ToolTip').style.visibility = "hidden";
	}

}