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 setFooter1() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('wrapper').offsetHeight;
			if (first) {firstHeight = contentHeight; first = false;}
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (firstHeight + footerHeight) >= 0) {
				document.getElementById('main').style.height = firstHeight + (windowHeight - (firstHeight + footerHeight)) - 459 + 'px';
				document.getElementById('right').style.height = firstHeight + (windowHeight - (firstHeight + footerHeight)) - 459 + 'px';
			}
			else {
				footerElement.style.top = '0px';
			}
		}
	}
}

function setFooter2() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('wrapper').offsetHeight;
			if (first) {firstHeight = contentHeight; first = false;}
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (firstHeight + footerHeight) >= 0) {
				document.getElementById('main2').style.height = firstHeight + (windowHeight - (firstHeight + footerHeight)) - 104 + 'px';
			}
			else {
				footerElement.style.top = '0px';
			}
		}
	}
}