var cont = document.getElementById('content');
var foot = document.getElementById('footer_space');
var wrap = document.getElementById('wrapper');
var left = document.getElementById('columnLeft_space');
var right = document.getElementById('columnRight_space');
var edit = document.getElementById('superEdit');
var meny = document.getElementById('meny');
var hH = 352; //header height
var fH = 161; //footer height
var cSH = cont.offsetHeight; // window height

window.onresize = footer;

function footer() {
	if(document.documentElement.clientHeight < (cSH + hH + fH)) {
		foot.style.top = cSH + hH + "px";
		wrap.style.height = cSH + hH + fH + "px";
		left.style.height = cSH + "px";
		right.style.height = cSH + "px";
	} else {
		foot.style.top = document.documentElement.clientHeight - fH + "px";
		wrap.style.height = document.documentElement.clientHeight + "px";
		left.style.height = document.documentElement.clientHeight - fH - hH + "px";
		right.style.height = document.documentElement.clientHeight - fH - hH + "px";
	}
	foot.style.display = "block";
}

activateMenu = function(nav) {
/* THE FOLLOWING CODE IS A FIX FOR MIE */
/* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot = document.getElementById(nav).firstChild;

/* Get all the list items within the menu */
		var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {

/* If the LI has another menu level */
			if(lis[i].lastChild.tagName=="UL") {
/* assign the function to the LI */
				lis[i].onmouseover=function() {	
/* display the inner menu */
					this.lastChild.style.display="block";
				}
				lis[i].onmouseout=function() {                       
					this.lastChild.style.display="none";
				}
			}
		}
	}
}
window.onload = function() {
/* pass the function the id of the top level UL */
/* remove one, when only using one menu */
	activateMenu('meny');
//activateMenu('vertnav');
	javascript:footer();
}
