function getPageSize()
{
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) 
	{ 
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight)
	{ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else 
	{ // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) 
	{ // all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) 
	{ // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) 
	{ // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	} 

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){ 
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function showScreen(msgStr,bgStr,ifrStr,objWidth,objHeight)
{
	window.scrollTo(0, 0);
 	document.body.style.overflow = 'hidden';
    var Msg = document.getElementById(msgStr);
    var Bg = document.getElementById(bgStr);
	var Ifr = document.getElementById(ifrStr);
	var pos = getPageSize();
	var pageW = pos[0];
	var pageH = pos[1];
	//alert(pos);
   	Msg.style.left=(pageW - objWidth)/2 + 'px'; 
    Msg.style.top= (pos[3] - objHeight)/2 + 'px';
    Msg.style.display = 'block';	
    Bg.style.display = 'block';
	Ifr.style.display = 'block';
	Bg.style.width = pageW + 'px';
	Ifr.style.width = pageW + 'px';
    Bg.style.height = pageH + 'px';
	Ifr.style.height = pageH + 'px';
	//alert([Msg.style.width, Msg.style.height]);
	
}
//½âÆÁ
function hideScreen(msgStr,bgStr,ifrStr)
{
	var os=getOs();
	if(os==2){
		document.body.style.overflowY  = 'auto';
	}
	if(os==1){document.body.style.overflowY = "visible";}
	function getOs()
	{
	   if(navigator.userAgent.indexOf("MSIE")>0)return 1;
	   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
	   if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;   
	   if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;
	   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;
	   return 0;
	}
    var Msg = document.getElementById(msgStr);
    var Bg = document.getElementById(bgStr);
	var Ifr = document.getElementById(ifrStr);
    Msg.style.display = 'none';
    Bg.style.display = 'none';
	Ifr.style.display = 'none';
}