var isIe4=false, isDom=false, isMac=false, isWin=false, isNs=false, isFlash=-1, isLoaded=false, isIe=false, isIe50=false;

function init()
{
	if (isDom)
	{
		isLoaded=true;
		setContainerMargin();
	}
}
		
		
function getWindowHeight()
{
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number')
	{
		windowHeight = window.innerHeight;
	}
	else
	{
		if (document.documentElement && document.documentElement.clientHeight)
		{
			windowHeight = document.documentElement.clientHeight;
		}
		else
		{
			if (document.body && document.body.clientHeight)
			{
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
		
function setContainerMargin()
{
	if (isLoaded)
	{
		var windowHeight = getWindowHeight();
		heightString=((windowHeight-548)/2) +"px";
		if (windowHeight > 0)
		{
			document.getElementById('container').style.marginTop=heightString;
		}
	}
}
		
isMac=(navigator.platform=="MacPPC")? true:false;
isWin=(navigator.appVersion.indexOf("Win")!=-1)? true:false;
isIe=(navigator.appName=="Microsoft Internet Explorer")? true:false;
isNs=(navigator.appName.indexOf=="Netscape")? true:false;
isIe4=(document.all)? true:false;
isDom=(document.getElementById)? true:false;

if (isIe)
{
	if ((navigator.appVersion.charAt(0)=="5")&&(navigator.appVersion.charAt(2)=="0"))
	{
		isIe50=true;
	}
}

window.onresize = function()
{
	setContainerMargin();
}

window.onload=init;
