/*
	TalkShoe Confidential Information
	Copyright (c) 2005 - 2009 
*/
var Image1= new Image(60,12);
Image1.src = "/resources/talkshoe/images/tooltip/toolTipBubbleTM.gif";

var Image2= new Image(15,45);
Image2.src = "/resources/talkshoe/images/tooltip/toolTipBubbleTL.gif";

var Image3= new Image(15,45);
Image3.src = "/resources/talkshoe/images/tooltip/toolTipBubbleTR.gif";

var Image4= new Image(15,45);
Image4.src = "/resources/talkshoe/images/tooltip/toolTipBubbleBL.gif";

var Image5= new Image(15,45);
Image5.src = "/resources/talkshoe/images/tooltip/toolTipBubbleBR.gif";

var Image6= new Image(700,45);
Image6.src = "/resources/talkshoe/images/tooltip/toolTipBubbleET.gif";

var Image7= new Image(15,30);
Image7.src = "/resources/talkshoe/images/tooltip/toolTipBubbleEL.gif";

var Image8= new Image(15,30);
Image8.src = "/resources/talkshoe/images/tooltip/toolTipBubbleER.gif";

var Image9= new Image(15,45);
Image9.src = "/resources/talkshoe/images/tooltip/toolTipBubbleEB.gif";

var topColor; 
var subColor;
var ContentInfo;

ContentInfo = "";
topColor = "#FFFFFF";
subColor = "#FFFFFF";

var mouse_X=0;
var mouse_Y=0;

var tip_active = 0;
var defCharLength = 300;
var ie = document.all?true:false;

function update_tip_pos(){
		document.getElementById('ToolTipDiv').style.left = mouse_X + "px";
		document.getElementById('ToolTipDiv').style.top  = mouse_Y + 10 + "px";
		return true;
}

function getMouseXY(evt) {
	mouse_X=0, mouse_Y=0;
	if (browser == "InternetExplorer") { // grab the x-y pos.s if browser is IE
		mouse_X = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		mouse_Y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		mouse_X += window.event.clientX;
		mouse_Y += window.event.clientY;
	}
	else { // grab the x-y pos.s if browser is NS
		mouse_X = evt.pageX;
		mouse_Y = evt.pageY;
	}
	
	if (mouse_X < 0){
		mouse_X = 0;
	}
	if (mouse_Y < 0){
		mouse_Y = 0;
	}

	if(tip_active){
		update_tip_pos();
	}
}

function checkMouseCoord(){
	document.onmousemove = getMouseXY;
}

//if (!ie) document.captureEvents(Event.MOUSEMOVE)
if (browser != "InternetExplorer"){
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = getMouseXY;
	}else{
		setTimeout("checkMouseCoord();", 800);
		//Adding the setTimeout because IE may randowmly screw up order of operations.
	}	

function EnterContent(TTitle, TContent, TWidth, CharLength){

if(CharLength==''){
	CharLength=defCharLength;
}

	if(TContent.length>CharLength){
		TContent=TContent.substring(0,CharLength) + '...';
	}


ContentInfo = '<table border="0" cellspacing="0" cellpadding="0" class="MainToolTipDivTable" width="'+TWidth+'" style="padding:0px;">'+
'<tr>'+
'<td width="100%" class="MainToolTipDivTableTD">'+

'<table border="0" width="100%" cellspacing="0" cellpadding="0">'+
'<tr>'+
'<td width="17" height="12" >&nbsp;</td>'+
'<td height="12" valign="bottom" align="left" class="toolTipBubbleTM">&nbsp;</td>'+
'<td width="17" height="12" >&nbsp;</td>'+
'</tr>'+
'<tr>'+
'<td width="17" valign="top" align="left" class="toolTipBubbleTL">&nbsp;</td>'+
'<td width="100%" bgcolor='+topColor+' class="toolTipBubbleET">'+

	'<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" align="left">'+
	'<tr><th width="100%" align="left">'+
	'<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+
	'</th></tr>'+
	'</table>'+

'</td>'+
'<td width="17" valign="top" align="right" class="toolTipBubbleTR">&nbsp;</td>'+
'</tr>'+
'<tr>'+
'<td width="17" bgcolor='+subColor+' class="toolTipBubbleEL">&nbsp;</td>'+
'<td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" class="TContent">'+
'<tr><td>'+
'<font class="tooltipcontent">'+TContent+'</font>'+
'</td></tr>'+
'</table>'+

'</td>'+
'<td width="17" bgcolor='+subColor+' class="toolTipBubbleER">&nbsp;</td>'+
'</tr>'+
'<tr>'+
'<td width="17" height="12" valign="bottom" align="left" class="toolTipBubbleBL">&nbsp;</td>'+
'<td height="12" bgcolor='+subColor+' class="toolTipBubbleEB">&nbsp;</td>'+
'<td width="17" height="12" valign="bottom" align="right" class="toolTipBubbleBR">&nbsp;</td>'+
'</tr>'+
'</table>'+

'</td></tr>'+
'</table>';
}

function tip_it(which, TTitle, TContent, TWidth, CharLength){
		
	if(which){
		update_tip_pos();
		tip_active = 1;
		document.getElementById('ToolTipDiv').style.visibility = "visible";
		EnterContent(TTitle, TContent, TWidth, CharLength);
		document.getElementById('ToolTipDiv').innerHTML = ContentInfo;
	}else{
		tip_active = 0;
		document.getElementById('ToolTipDiv').style.visibility = "hidden";
	}

}
