function fixContentDiv() {
	var browserHeight, divHeight, contentDiv;
	var bottomMargin = 127;
	
	browserHeight = getBrowserHeight();
	
	if (browserHeight>500) {
		contentDiv = document.getElementById('content');
		divHeight = browserHeight - getPosY(contentDiv) - bottomMargin;
		if (contentDiv) contentDiv.style.height = (divHeight+10)+"px";
		return true;
	}
	return false;
}

function getPosY(obj) {
	var curtop = 0;
	if ((obj) && (obj.offsetParent))
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if ((obj) && (obj.y))
		curtop += obj.y;
	return curtop;
}

function getBrowserHeight() {
	var browserHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
    	//Non-IE
    	browserHeight = window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
    	//IE 6+ in 'standards compliant mode'
    	browserHeight = document.documentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
    	//IE 4 compatible
    	browserHeight = document.body.clientHeight;
	}
	return browserHeight;
}
window.onresize = fixContentDiv;
window.onload = fixContentDiv;