var currentHeight;

function getHeight() {
	var height;
	var castHeight;
	
	if (window.innerHeight) {
		height = window.innerHeight;
	}
	else if (document.documentElement.clientHeight) {
		height = document.documentElement.clientHeight - 6;
		if (navigator.appVersion.substring(22,23) == "7") {
			height = document.documentElement.clientHeight -2;
		}
		/*alert(navigator.appVersion.substring(0,1));*/
	}
	else {
		height = 0;
	}
	return height;
}

function setHeight() {
	var height = getHeight();
	
	currentHeight = height;
	castHeight = height - 100 - 150 - 21;
	if (castHeight < 466) {
		castHeight = 466;
	}
	document.getElementById("page").style.height = castHeight + "px";
}

function setHeightIE() {
	if (currentHeight != getHeight())
		location.href = location.href;
}

window.onload = setHeight;
/* window.onresize = setHeight; */

/* for IE */
if (!window.currentHeight && document.body && document.body.clientHeight) {
	window.onresize = setHeightIE;
}

/* for the rest */
if (!window.currentHeight && window.innerHeight) {
	window.onresize = setHeight;
}