
window.onscroll = function (e) {
	div = document.getElementById('divgroot');
	if( div.style.display == 'inline' )
	{
			if (document.compatMode && document.compatMode != "BackCompat")
			{
				theHeight = document.documentElement.clientHeight;
				theWidth = document.documentElement.clientWidth;
			}
			else
			{
				theHeight = document.body.clientHeight;
				theWidth = document.body.clientWidth;
			}
			
			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;
			}
		
			div.style.left = ((parseInt(theWidth)/2)-(parseInt(div.style.width)/2))+parseInt(scrOfX)+'px';
			div.style.top = ((parseInt(theHeight)/2)-(parseInt(div.style.height)/2))+parseInt(scrOfY)+'px';
		}
}

function view() {
	div = document.getElementById('divgroot');
	div.style.visible = 'visible';
	//div.style.display = 'inline';
	if(window.innerHeight)
	{
		theHeight = window.innerHeight;
		theWidth = window.innerWidth;
	}
	else if (document.compatMode && document.compatMode != "BackCompat")
	{
		theHeight = document.documentElement.clientHeight;
		theWidth = document.documentElement.clientWidth;
	}
	else
	{
		theHeight = document.body.clientHeight;
		theWidth = document.body.clientWidth;
	}
	
	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;
	}

	div.style.left = (((parseInt(theWidth)/2)-(parseInt(div.style.width)/2))+parseInt(scrOfX))+'px';
	div.style.top = (((parseInt(theHeight)/2)-(parseInt(div.style.height)/2))+parseInt(scrOfY))+'px';
	Effect.Appear(div);
}

function setDivGrootSize(width,height) {
	div = document.getElementById('divgroot');
	if(window.innerHeight)
	{
		theHeight = window.innerHeight;
		theWidth = window.innerWidth;
	}
	else if (document.compatMode && document.compatMode != "BackCompat")
	{
		theHeight = document.documentElement.clientHeight;
		theWidth = document.documentElement.clientWidth;
	}
	else
	{
		theHeight = document.body.clientHeight;
		theWidth = document.body.clientWidth;
	}
	
	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;
	}

	div.style.width = width+'px';
	div.style.height = height+'px';
	div.style.left = (((parseInt(theWidth)/2)-(parseInt(div.style.width)/2))+parseInt(scrOfX))+'px';
	div.style.top = (((parseInt(theHeight)/2)-(parseInt(div.style.height)/2))+parseInt(scrOfY))+'px';
}

function closediv() {
	div = document.getElementById('divgroot');
	Effect.Fade(div);
	//div.style.visible = 'hidden';
	//div.style.display = 'none';
}
