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 getDocumentHeight() {
	if (document.body.scrollHeight && navigator.appVersion.indexOf("Win") != -1) {
	// body.scrollHeight gets the correct value on WIN IE6, but non on MAC
		return document.body.scrollHeight;
	}
	else if (document.documentElement.scrollHeight)
		return document.documentElement.scrollHeight;
	else if (document.documentElement.offsetHeight)
		return document.documentElement.offsetHeight;
}
function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth)=='number') {
		windowWidth = window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
		windowWidth = document.documentElement.clientWidth;
	}
	else if (document.body && document.body.clientWidth) {
		windowWidth = document.body.clientWidth;
	}
	return windowWidth;
}
function adjustwh() {
	var wh = getWindowHeight();
	var clsh = document.getElementById("contentl").scrollHeight;
	if (clsh > (wh - 94)) {
		document.getElementById("contentl").style.height = clsh + "px"
	}
}
function getComputedCSSValue(daElement,daProperty) {
	if (document.defaultView && document.defaultView.getComputedStyle) {
		return document.defaultView.getComputedStyle(daElement,'').getPropertyValue(daProperty);
	}
	else if (document.all) {
		return daElement.currentStyle[daProperty];
	}
}
window.onload = function() {
	var posselected = $('#nav a.miselected').offset().left;
	var posnav = $('#nav').offset().left;
	var navwidth = $('#nav').width();
	var elwidth = $('#nav a.miselected').width();
	$('#subnav.subnavleft').css('margin-left', (posselected-posnav));
	// right-aligned: offsetleft + width + 20
	var rightpos = posnav + navwidth - posselected - elwidth + 10 + 16;
	$('#subnav.subnavright').css('right', rightpos);
	$('#subnav').css('visibility','visible');
}
window.onresize = function() {
	adjustwh();
}
function validatecontactform(theform) {
	if (theform.elements['f[naam]'].value == '') {
		alert("Naam is nog niet ingevuld!");
		theform.elements['f[naam]'].focus();
		return false;
	}
	if (theform.elements['f[email]'].value == '') {
		alert("E-mail-adres is nog niet ingevuld!");
		theform.elements['f[email]'].focus();
		return false;
	}
	if (theform.elements['f[message]'].value == '') {
		alert("Er is nog geen bericht ingevuld!");
		theform.elements['f[message]'].focus();
		return false;
	}
	theform.submit();
	alert("Dank voor uw bericht!");
}

