window.onresize = checkPos;

function checkPos()
{
	var o = document.getElementById('navlayer'); 
	var x;
	
	if (self.innerHeight)
	{
		x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		x = document.documentElement.clientWidth; 
	}
	else if (document.body) 
	{
		x = document.body.clientWidth; 
	}
	
	if(x < 897)
	{
		o.style.marginLeft = '43px';
		o.style.left = '0px';
	}
	else
	{
		o.style.marginLeft = '-405px';
		o.style.left = '50%';
	}
}

