﻿var windowW = 630, windowH = 460;

function setWindowMetrics()
{
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  //windowW = document.body.offsetWidth-20;
  //windowH = document.body.offsetHeight-20;
  windowW = document.body.clientWidth-20;
  windowH = document.body.clientHeight-20;
 }
 else{
  windowW = window.innerWidth-16;
  windowH = window.innerHeight-16;
 }

}
}
//The windowW and windowH are now set to the visible height and width of the browser

function setVisible(objName,objWidth,objHeight)
{
    setWindowMetrics();
    
	obj = document.getElementById(objName);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	obj.style.width = objWidth;
	obj.style.height = objHeight;
	placeIt(objName,objWidth,objHeight);
}
function placeIt(objName,objWidth,objHeight)
{
	obj = document.getElementById(objName);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += (windowW - objWidth)/2;
	//theTop += (windowH - objHeight)/2;
	theTop += 30;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	//setTimeout("placeIt('" + objName + "'," + objWidth + "," + objHeight + ")",200); //This line automatically adust the popup if hte page has been scrolled

}







