// JavaScript Document

handle = 0;
offset_top = 50;

function OffsetY() 
{
	return (((document.all)?document.documentElement.scrollTop:window.pageYOffset)+offset_top)+'px';
}

// =======================================================

function OffsetX($width)
{
	if(window.innerHeight)
	{
		return Math.floor((window.innerWidth-$width)/2)+'px';
	}
	else
	{
		return Math.floor((document.documentElement.clientWidth-$width)/2)+'px';
	}	
}

// =======================================================

function Show($div,$width)
{
	document.getElementById($div).style.display = 'inline';
	
	var Anim = function()
	{
		document.getElementById($div).style.top = OffsetY();
		document.getElementById($div).style.left = OffsetX($width);
	}
	
	handle = setInterval(Anim,1);

}

// =======================================================


function Hide($div)
{
	clearInterval(handle);	
	document.getElementById($div).style.display = 'none';
}

