function gimmieWindowHeight() {
	var windowHeight = 0;
	if( typeof( window.innerHeight ) == 'number' ) {
		windowHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		windowHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}
function addEventSimple(obj, evt, fn) {
	if(obj.addEventListener) {
		obj.addEventListener(evt,fn,false);
	} else if (obj.attachEvent) {
		obj.attachEvent('on'+evt,fn);
	}
}
function contentResize() {
	var main = document.getElementById("main");
	var footer = document.getElementById("footer");
	if (main && footer) {
		main.style.height = gimmieWindowHeight() - footer.offsetHeight + "px";
	}
}
addEventSimple(window, "load", contentResize);
addEventSimple(window, "resize", contentResize);