var activeLink;

window.onresize = init;


function init() {
	var size = getWindowSize();
	sizeto = size.y - gElm("Header").offsetHeight - gElm("Footer").offsetHeight;
	gElm("MainBody").style.height = sizeto + "px";
}

function getWindowSize () {
	ret = new Object;
	if (self.innerHeight) { // !ie
		ret.x = self.innerWidth;
		ret.y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { //ie6 strict
		ret.x = document.documentElement.clientWidth;
		ret.y = document.documentElement.clientHeight;
	}
	else if (document.body) { // ie
		ret.x = document.body.clientWidth;
		ret.y = document.body.clientHeight;
	}
	return ret;
}

function gElm(who) {
	return document.getElementById(who);
}

function highlight(elm) {
	if (activeLink != undefined) {
		activeLink.parentNode.style.backgroundColor = "#FFF";
	}
	elm.parentNode.style.backgroundColor = "#EEF";
	activeLink = elm;
}

function var_dump(obj) {
	var ret="";
	for (property in obj)
		ret += property + "=" + obj[property] + "\n";
	alert(ret);
}