var d = document;

/* Called on page load to make the two layout columnes the same height */
function fixLayoutHeights() {
	var divs = new Array("side","main"); //list of DIV ids
	var h = 0;
	for (i = 0; i < divs.length; i++) {
		if (d.getElementById(divs[i]).offsetHeight > h) {
			h = d.getElementById(divs[i]).offsetHeight;
			//alert(h);
		}
	}
	
	for (i = 0; i < divs.length; i++) {
		d.getElementById(divs[i]).style.height = h +"px"; //set the height of all divs to the tallest
	}
}


/* Can be called to change the width of the main content div, for intstance if the left column is removed */
function setMainBoxWidth(width) {
	d.getElementById('main').style.width = width;
}


/* Since IE is utter shit and don't support li:hover, we need this to make the drowdown menu work. */
function fixMenu() {
	if (navigator.userAgent.indexOf('MSIE') == -1) { return; } /* It's only IE that is shit */
		
	var nav = document.getElementById('menuroot');
	for (i = 0; i < nav.childNodes.length; i++) {
		node = nav.childNodes[i];
		if (node.nodeName == 'LI') {
			node.onmouseover = function() {	this.className += ' hover'; }
			node.onmouseout = function() { this.className = this.className.replace(' hover', ''); }
		}
	}
}
