	function check_footer() {

		windowheight = window.innerHeight;
		contentheight = document.getElementById("content").offsetHeight;
		primarynav = document.getElementById("primary_navigation").offsetHeight;
		divextra = document.getElementById("extra").offsetHeight;

		if (!windowheight) {
			windowheight = document.documentElement.clientHeight;
		}

		if (!windowheight || windowheight == 0) {
			windowheight = document.body.clientHeight;
		}

		if(primarynav < contentheight) {
			document.getElementById("primary_navigation").style.height = contentheight + 20 + "px";
		}

		primarynavnew = document.getElementById("primary_navigation").offsetHeight;

		document.getElementById("extra").style.height = primarynavnew + 160 + "px";

		newheight = document.getElementById("primary_navigation").offsetHeight;
		newheight2 = document.getElementById("extra").offsetHeight;

		document.getElementById("extra").style.height = newheight2 + 20 + "px";
		document.getElementById("primary_navigation").style.height = newheight + 20 + "px";
	}
	
	if (window.addEventListener) {
		window.addEventListener('load', check_footer, true);
	} else if (document.attachEvent) {
		window.attachEvent("on" + 'load', check_footer);
	}