var height = pageHeight();

window.onresize = function(){
	if(pageHeight() !== height){
		resizeh();
	}
};

function resizeh() {
	height = pageHeight();

	if(height > document.getElementById('container').offsetHeight) {
		ltop = (height - document.getElementById('container').offsetHeight -1) / 2;
		document.getElementById('container').style.top = ltop + "px";
		document.getElementById('footer').style.top = (height - 20) + "px";
		}
	else {
		pheight = 0;
		document.getElementById('container').style.top = "0px";
		document.getElementById('footer').style.top = (document.getElementById('container').offsetHeight - 20) + "px";
	}
}

function pageHeight() {
	return window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
}
