// JavaScript Document
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return false");
function whatomatic(){
	var rnav = document.getElementById('rightnav');
	var x = rnav.offsetHeight;
	
	var lnav = document.getElementById('leftnav');
	var z = lnav.offsetHeight;
		if(z > x){
		x=z;
		}
	var pcontent = document.getElementById('content');
	//pcontent.style.height = 'auto';
	var xt = pcontent.offsetHeight;
		if(xt > x){
		x=xt;
		}
		
		//rnav.style.height = x + "px";
		//alert(z+"px"+":"+xt + "px" + ":" + x + "px");
	var ptop = document.getElementById('top');
	var t = ptop.offsetHeight;
	var pfoot = document.getElementById('footer');
	var f = pfoot.offsetHeight;
	var ptotal = t+f+x;
	var b = document.body.clientHeight;
	//alert(t+":"+f+":"+x+":"+ptotal+":"+b);	
		if(b > ptotal){
		x = b-t-f;
		//alert("b is larger");
		}
		var pcont = document.getElementById('container');
		var c = pcont.offsetHeight;
		//firefox hack
		pcont.style.height = "2500px";
		pcontent.style.height = x + "px";
		pcont.style.height = "auto";
		//alert(t+":"+f+":"+x+":"+ptotal+":"+b+":"+c);
		// IE 6 hack to allow copy/paste
		// thanks to Tom Gilder 
		//http://blog.tom.me.uk/2003/07/23/boie6selecta.php
		if (window.createPopup && document.compatMode && document.compatMode=="CSS1Compat"){
			document.onreadystatechange = onresize = function fixIE6AbsPos(){
				if (!document.body) return;
				if (document.body.style.margin != "0px") document.body.style.margin = 0;
				onresize = null;
				document.body.style.height = 0;
				setTimeout(function(){ document.body.style.height = document.documentElement.scrollHeight+"px"; }, 1);
				setTimeout(function(){ onresize = fixIE6AbsPos; }, 100); 
			}
		}
}
window.onresize=whatomatic;