
var contentDivId

function hideDiv(id1,id2)
{
	document.getElementById(id1).style.display="none";
	document.getElementById(id2).style.display="none";
}
function showDivs(id1,id2)
{	
	document.getElementById(id1).style.display="";
	document.getElementById(id2).style.display="";
}

function getBrowserSize()
{
	var bodyWidth = document.documentElement.clientWidth;
    	var bodyHeight = document.documentElement.clientHeight;
    			
		var bodyWidth, bodyHeight; 
		if (self.innerHeight)
		{ // all except Explorer 
		 
		   bodyWidth = self.innerWidth; 
		   bodyHeight = self.innerHeight; 
		}  else if (document.documentElement && document.documentElement.clientHeight) 
		{
		   // Explorer 6 Strict Mode 		 
		   bodyWidth = document.documentElement.clientWidth; 
		   bodyHeight = document.documentElement.clientHeight; 
		} 
		else if (document.body) 
		{// other Explorers 		 
		   bodyWidth = document.body.clientWidth; 
		   bodyHeight = document.body.clientHeight; 
		} 
		
		
		var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		  }
		  //return [ scrOfX, scrOfY ];
		document.getElementById('blackDiv').style.height=bodyHeight + scrOfY  + "px";
		document.getElementById('blackDiv').style.width=bodyWidth  + "px";

		var contentW=document.getElementById(contentDivId).style.width;
		var contentH=document.getElementById(contentDivId).style.height;
		var actW=bodyWidth - contentW.replace('px','');
		var actH=((bodyHeight - contentH.replace('px',''))/2) + scrOfY;
		
		document.getElementById(contentDivId).style.left=actW/2 +"px";
		
		if(!isNaN(actH))
		{
		document.getElementById(contentDivId).style.top=actH +"px";
		}
		
		//document.getElementById(contentDivId).style.display="";
		//document.getElementById('blackDiv').style.display="";
}
function getContentDivId(contentDivIdParam)
{
contentDivId=contentDivIdParam;
}
function openGrayDiv(contentDivIdParam)
{
	getContentDivId(contentDivIdParam);
	
	window.onresize=getBrowserSize;
	
	window.onscroll=getBrowserSize;
	getBrowserSize();
}