// JavaScript Document
<!--
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setfot() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var huvudElement = document.getElementById('huvud');
			var huvudHeight = huvudElement.offsetHeight;
			var menyElement = document.getElementById('meny');
			var menyHeight = menyElement.offsetHeight;
			var innehallElement = document.getElementById('innehall');
			var innehallHeight = innehallElement.offsetHeight;
			var fotElement = document.getElementById('fot');
			var fotHeight  = fotElement.offsetHeight;
			if (menyHeight > innehallHeight){
				if (windowHeight - (huvudHeight + menyHeight + fotHeight) >= 0) {
					fotElement.style.position = 'relative';
					fotElement.style.top = (windowHeight - (huvudHeight + menyHeight + fotHeight)) + 'px';
				} else {
					fotElement.style.position = 'static';
				}
			} else {
				if (windowHeight - (huvudHeight + innehallHeight + fotHeight) >= 0) {
					fotElement.style.position = 'relative';
					fotElement.style.top = (windowHeight - (huvudHeight + innehallHeight + fotHeight)) + 'px';
				} else {
					fotElement.style.position = 'static';
				}
			}
		}
	}
}
window.onload = function() {
	setfot();
}
window.onresize = function() {
	setfot();
}
//-->