var W3CDOM = (document.createElement && document.getElementsByTagName);
window.onload = init;

function init() {
	if (!W3CDOM) return;
   	window.onresize=docResize;
   		docResize();
	}
function docResize() {
	var maindiv=document.getElementById('maindiv');
	// Mozilla Firefox understands this, IE doesn't :
	if (window.innerHeight) {
		var h=window.innerHeight-30;
		if (h<0) h=0;
		maindiv.style.minHeight=h+'px';
	} else {
	//IE understands this:
		var h=document.body.clientHeight-30;
		if (h<0) h=0;
		maindiv.style.height=h+'px';
	}
}
