var strWidth;
var strHeight;
var strTop;

function GetHeightWidthBrowser()
{
 var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
  
 	strWidth = viewportwidth + 50;
	strHeight = viewportheight + 180;
	if(window.document.body)
		strTop = window.document.body.scrollTop;
	else
		strTop = 0;

}

function GetHeightWidthForDetailBrowser()
{
 var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
  
 	strWidth = viewportwidth + 200;
	strHeight = viewportheight + 480;

	if(window.document.body)
		strTop = window.document.body.scrollTop;
	else
		strTop = 0;

}


function GetLoadingForDetail()
{
	GetHeightWidthForDetailBrowser();
	var newwidth = (strTop + strHeight/2)-100;
	var newheight = (strWidth/2-75);

	
	document.getElementById('ShowLoading').style.display = "";

	if(document.getElementById('MapFrame'))
		document.getElementById('MapFrame').style.display = "none";
		
	document.getElementById('ShowLoading').style.top = newwidth+"px";
	document.getElementById('ShowLoading').style.left = newheight+"px";
	document.getElementById('ShowLoading').style.position = "absolute";
	document.getElementById('ShowLoading').innerHTML = '<table border=0 cellpadding=0 cellspacing=0 width=160 bgcolor="#fffff" style="border:1px solid #ff0000"><tr><td width="10"></td><td width="25" align=center><img src="'+IMGROOT+'/rating/ajax-loader.gif"></td><td width="60" align="left"><span style="font-family:Arial;font-size:12px;text-decoration:none;text-transform:uppercase;letter-spacing:0px;font-weight:700;color:#FF0000;line-height:60px;padding-left:3px;">&nbsp;Loading...</span></td></tr></table>';
}


function GetLoading()
{
	GetHeightWidthBrowser();
	var newwidth = (strTop + strHeight/2)-100;
	var newheight = (strWidth/2-75);

	iepopupSelect_new();

	document.getElementById('ShowLoading').style.display = "";
	document.getElementById('ShowLoading').style.top = newwidth+"px";
	document.getElementById('ShowLoading').style.left = newheight+"px";
	document.getElementById('ShowLoading').style.position = "absolute";
	document.getElementById('ShowLoading').innerHTML = '<table border=0 cellpadding=0 cellspacing=0 width=160 bgcolor="#fffff" style="border:1px solid #ff0000"><tr><td width="10"></td><td width="25" align=center><img src="'+IMGROOT+'/rating/ajax-loader.gif"></td><td width="60" align="left"><span style="font-family:Arial;font-size:12px;text-decoration:none;text-transform:uppercase;letter-spacing:0px;font-weight:700;color:#FF0000;line-height:60px;padding-left:3px;">&nbsp;Loading...</span></td></tr></table>';
}

function GetLoadingOnload()
{
	document.write("<html><body><div id='ShowLoading'>Loading</div></body></html>");

	GetHeightWidthBrowser();
	var newwidth = (strTop + strHeight/2)-100;
	var newheight = (strWidth/2-75);

	document.getElementById('ShowLoading').style.top = newwidth+"px";
	document.getElementById('ShowLoading').style.left = newheight+"px";
	document.getElementById('ShowLoading').style.position = "absolute";
	document.getElementById('ShowLoading').innerHTML = '<table border=0 cellpadding=0 cellspacing=0 width=160 bgcolor="#fffff" style="border:1px solid #ff0000"><tr><td width="10"></td><td width="25" align=center><img src="'+IMGROOT+'/rating/ajax-loader.gif"></td><td width="60" align="left"><span style="font-family:Arial;font-size:12px;text-decoration:none;text-transform:uppercase;letter-spacing:0px;font-weight:700;color:#FF0000;line-height:60px;padding-left:3px;">&nbsp;Loading...</span></td></tr></table>';
}

function createDiv()
{	
	var divTag = document.createElement("div");
	divTag.id = "ShowLoading";
	document.body.appendChild(divTag); 
	GetHeightWidthBrowser();
	var newwidth = (strTop + strHeight/2)-100;
	var newheight = (strWidth/2-75);
	
	document.getElementById('ShowLoading').style.top = newwidth+"px";
	document.getElementById('ShowLoading').style.left = newheight+"px";
	document.getElementById('ShowLoading').style.position = "absolute";
	document.getElementById('ShowLoading').innerHTML = '<table border=0 cellpadding=0 cellspacing=0 width=110 bgcolor="#fffff" style="border:1px solid #ff0000"><tr><td width="25" align=center><img src="'+IMGROOT+'/rating/loading.gif"></td><td width="60" align="left"><span style="font-family:Arial;font-size:12px;text-decoration:none;text-transform:uppercase;letter-spacing:0px;font-weight:700;color:#FF0000;line-height:38px;padding-left:3px;">&nbsp;Loading...</span></td></tr></table>';
}

function createDiv2()
{	
	GetHeightWidthBrowser();
	var newwidth = (strTop + strHeight/2)-100;
	var newheight = (strWidth/2-75);

//	document.body.innerHTML = "<div id='ShowLoading'></div>"; 
	document.getElementById('ShowLoading').style.top = newwidth+"px";
	document.getElementById('ShowLoading').style.left = newheight+"px";
	document.getElementById('ShowLoading').style.position = "absolute";
	document.getElementById('ShowLoading').innerHTML = '<table border=0 cellpadding=0 cellspacing=0 width=110 bgcolor="#fffff" style="border:1px solid #ff0000"><tr><td width="25" align=center><img src="'+IMGROOT+'/rating/loading.gif"></td><td width="60" align="left"><span style="font-family:Arial;font-size:12px;text-decoration:none;text-transform:uppercase;letter-spacing:0px;font-weight:700;color:#FF0000;line-height:38px;padding-left:3px;">&nbsp;Loading...</span></td></tr></table>';
}

