var MAC  = navigator.userAgent.indexOf("Mac") != -1;

if (MAC) {
		document.write('<link href="/js-css/menu_mac.css" rel="stylesheet" type="text/css" />');
	} else {
		document.write('<link href="/js-css/menu_pc.css" rel="stylesheet" type="text/css" />');
}


// bepaalt hoogte contentcontainer

window.onresize = setContentHeight;
window.onload = setContentHeight;

function setContentHeight() {
	if (document.getElementById) {
		var windowHeight=getWindowHeight();
		if (windowHeight>0) {
			document.getElementById('scrolldiv').style.height=(windowHeight-165)+'px';  // offset from top 
		}
	}
}

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;
}


// E-mail Form - Validator
function checkData(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.form.email.value; // value to compare
	if (document.form.naam.value == '') {correct = false; alert("Vul a.u.b. uw naam in.");document.form.naam.focus(); return correct}
	if (document.form.bedrijf.value == '') {correct = false; alert("Vul a.u.b. de naam van uw bedrijf in.");document.form.bedrijf.focus(); return correct}
	if (document.form.adres.value == '') {correct = false; alert("Vul a.u.b. uw adres in.");document.form.adres.focus(); return correct}
	if (document.form.postcode.value == '') {correct = false; alert("Vul a.u.b. uw postcode in.");document.form.postcode.focus(); return correct}
	if (document.form.plaatsnaam.value == '') {correct = false; alert("Vul a.u.b. een plaatsnaam in.");document.form.plaatsnaam.focus(); return correct}
	if (document.form.telefoonnummer.value == '') {correct = false; alert("Vul a.u.b. uw telefoonnummer in.");document.form.telefoonnummer.focus(); return correct}
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul s.v.p een geldig e-mail adres in.");document.form.email.focus(); return correct}
	if (document.form.opmerking.value == '') {correct = false; alert("Vul s.v.p. uw vraag of opmerking in.");document.form.opmerking.focus(); return correct}
	return correct;
}
