// JavaScript Document
function show_div(divId)
{
	document.getElementById(divId).style.display = '';	
}

function GetTopLeft(elm)
{

var x, y = 0;

//set x to elm’s offsetLeft
x = elm.offsetLeft;

//set y to elm’s offsetTop
y = elm.offsetTop;

//set elm to its offsetParent
elm = elm.offsetParent;

//use while loop to check if elm is null
// if not then add current elm’s offsetLeft to x
//offsetTop to y and set elm to its offsetParent

while(elm != null)
{

x = parseInt(x) + parseInt(elm.offsetLeft);
y = parseInt(y) + parseInt(elm.offsetTop);
elm = elm.offsetParent;
}

//here is interesting thing
//it return Object with two properties
//Top and Left
alert(x); alert(y);
return {Top:y, Left: x};

}

function dataLoading(id,str){
	document.getElementById(id).innerHTML = '<table align="center"><tr><td style="font-family: Arial, Verdana, Helvetica; color:#000000; FONT-WEIGHT: bold; FONT-SIZE: 12px;" valign="middle" align="center" height="50">'+str+'</td></tr></table>';
}

function showLayer(id,div_id,wm,hm)
{
	var obj = document.getElementById(id);
	var cell = document.getElementById(div_id);
	cell.style.left = (getXCoord(obj)-wm)+"px";
	cell.style.top = (getYCoord(obj)-hm)+"px";
	cell.style.visibility = "visible";
}
function viewHelp(imgId,DivId)
{
	//var imgDir=ss+"images/";
//	GetTopLeft(document.getElementById('viewHelpMap2'));
	//alert(document.getElementById('viewHelpMap2').offsetLeft);
	//alert(document.getElementById('viewHelpMap2').offsetTop);
	showLayer(imgId,DivId, -60, -20);
//	dataLoading(DivId,"Loading....");
	document.getElementById(DivId).style.display="block";
/*//	alert(DivId);
	if(DivId=='divLayer1')
	{
		document.getElementById(DivId).innerHTML='<table  border="0" cellpadding="0" cellspacing="0" style="background-image:url(images/tooltip_bg.png);background-repeat:no-repeat;width:220px;height:200px;"><tr style="padding:15px;"><td colspan="2" style="color:#FFFFFF;padding-top:20px;padding-left:15px;text-align:left;" valign="top"  align="center"><strong>US LOCATION</strong><br><span style="font-size:15px"><strong>Chicago–Main Office</strong></span><br>425 N. Martingale Road<br>Suite 1540<br>Schaumburg, IL 60173<br>T +1 847.278.0333<br>T +1 866.942.9310<br>F +1 847.276.3390</td></tr></table>';
	}
*/	
}
function closeHelp(DivId)
{
	document.getElementById(DivId).style.display="none";
}

