
/*
for this to work properly the target div style should be:

{
	background: #FFFFE1;
	width: 450px;
	border: solid 1px;
	font-family: Trebuchet MS,sans-serif;
	display: none;
	z-index: 10;
	position:absolute
}

you can use styles from global.css

	<div class="g_tooltip" id="the_id" >
		<div class="message_text">The text</div>											
	</div>

calling the tooltip:

onmouseover="ShowToolTipDIV(event,'the_id')" onmouseout="HideToolTipDIV('the_id')"

*/


//displayes the tooltip div next to mouse pointer
function ShowToolTipDIV(e,divID, h, w)
{
	var ih = (h != null)? parseInt(h): 0;
	var iw = (w != null)? parseInt(w): 0;
	iw += getMouseXY(e).x;
	ih += getMouseXY(e).y;

	var tooltipDiv = document.getElementById(divID);
	tooltipDiv.style.display = "block";

	
	tooltipDiv.style.top = (ih + 5) + "px";
	tooltipDiv.style.left = (iw + 10) + "px";	
	
	window.focus();
}

//displayes the tooltip div next to mouse pointer
function ShowToolTipDIVWithPos(divID, h, w)
{
	var ih = (h != null)? parseInt(h): 0;
	var iw = (w != null)? parseInt(w): 0;

	var tooltipDiv = document.getElementById(divID);
	tooltipDiv.style.display = "block";

	
	tooltipDiv.style.top = (ih + 5) + "px";
	tooltipDiv.style.left = (iw + 10) + "px";	
	
	window.focus();
}



//displayes the centered alert div - gets optional div height and width for better preformance
function ShowCenteredAlertDIV(divID,h,w)
{
	var ih = (h != null)? parseInt(h): 220;
	var iw = (w != null)? parseInt(w): 500;

	var alertDiv = document.getElementById(divID);
	alertDiv.style.display = "block";
	var itop = _gtop(ih/2);

	var ileft = _gleft(iw/2);
	
	alertDiv.style.top = itop + "px";
	alertDiv.style.left = ileft + "px";	
	
	window.focus();
}

//displayes the centered alert div
function ShowCenteredAlertDIV2(divID,h,w)
{
	var ih = (h != null)? parseInt(h): 0;
	var iw = (w != null)? parseInt(w): 0;

	var alertDiv = document.getElementById(divID);
	alertDiv.style.display = "block";
	var itop = _gtop(110) + ih;

	var ileft = _gleft(250) + iw;
	
	alertDiv.style.top = itop + "px";
	alertDiv.style.left = ileft + "px";	
	
	window.focus();
}



//gets l=left position: dif from left tutorial border, t=top position: from page top.

//returns client width 
function ctt_wwidth()
{
	
	if(document.documentElement && document.documentElement.clientWidth)
	{
		return document.documentElement.clientWidth;
	}
	if(document.documentElement.clientWidth)
	{
		return document.body.clientWidth;
	}
	return window.innerWidth;
}
function ctt_gleft(delta)
{
	var iww = ctt_wwidth();

	var t = (iww / 2) - delta;

	return t + getIeScrollLeft();
}

function showCttHint(l, t, title, body)
{
	var h = $('ctt_hint');
	var ht = $('ctt_hint_ttl');
	var hb = $('ctt_hint_body');

	if(h == null || ht == null || hb == null) return;
	
	h.style.left = (ctt_gleft(272) + l) + 'px';
	h.style.top = "" + t + "px";		

	ht.innerHTML = title;
	hb.innerHTML = body;

	h.style.display = "block";
}
	  
function hideCttHint()
{
	var h = $('ctt_hint');
	if(h != null)
	{
		h.style.display = "none";
	}
}

/* This indicated tooltipDiv.js was loaded - Do not delete! */
var TOOLTIPDIV_LOADED = true;
/*****************************************************/
