//adapted from code at http://www.bobbyvandersluis.com

function getWindowHeight() {
	var windowHeight = 0;
	//ns syntax:
	if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
	}
	else {  //IE syntax:
if (document.documentElement && document.documentElement.clientHeight) {
	windowHeight = document.documentElement.clientHeight;
}
else {
	if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
	}
}
	}
	return windowHeight;
}

function setContent() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentElement = document.getElementById('divcontent');
			var contentHeight = contentElement.offsetHeight;
		//if the contentHeight is shorter than the browser win height: 
			if (windowHeight - contentHeight >= 0) {
				contentHeight = screen.height + 300;
				contentElement.style.height = contentHeight + 'px';
//				alert(windowHeight - contentHeight);
			}
			else {
				contentElement.style.height = 'auto';
			}
		}
	}
} //end setContent function

/*
window.onload = function() {
	setContent();
}


window.onresize = function() {
	setContent();
}

window.onscroll = function() {
	setContent();
}
*/
