function ress(){
	var winHeight = winH();
	var marginTop;
	if(!document.getElementById('container')) 
		return false;

	if(winHeight > 660){ 				
		marginTop = (winHeight - 660)/2;
		document.getElementById('container').style.marginTop = marginTop+"px";
	}
	else{
		document.getElementById('container').style.marginTop = "0px";
	}
}

function winH(){
	if(window.innerHeight)/* NN4 a kompatibilní prohlížeče */
		return parseInt(window.innerHeight);

	else if(document.documentElement && document.documentElement.clientHeight)/* MSIE6 v std. režimu - Opera a Mozilla již uspěly s window.innerHeight */
		return parseInt(document.documentElement.clientHeight);
	
	else if(document.body && document.body.clientHeight) /* starší MSIE + MSIE6 v quirk režimu */
		return parseInt(document.body.clientHeight);
	
	else 
		return 0;
}

window.onload = ress;
window.onresize = ress;