function showLayer(whichdiv){
	if (document.getElementById(whichdiv.id+"_ov").style.display == ''){
		document.getElementById(whichdiv.id+"_ov").style.display = 'none';
	}else {
		document.getElementById(whichdiv.id+"_ov").style.display = '';
	}
	
}
function checkForm(){
	tel=0;
	var color= '#AA0000';
	var normalcolor='#656565';
	if (document.getElementById("naam").value =='') {				
		tel++;		
		document.getElementById("naam").className = 'txtInputLargeWrong';
	} else	{ 
		document.getElementById("naam").className = 'txtInputLarge';
	}
	if (document.getElementById("email").value =='' || !checkEmail(document.getElementById("email").value)) {
		tel++;		
		document.getElementById("email").className = 'txtInputLargeWrong';		
	} else	{ 
		document.getElementById("email").className = 'txtInputLarge';
	}
	if (document.getElementById("opmerkingen").value =='') {				
		tel++;		
		document.getElementById("opmerkingen").className = 'txtAreaWrong';
	} else	{ 
		document.getElementById("opmerkingen").className = 'txtArea';
	}
	if(tel==0){					
		return true;
	} else {
		document.getElementById("formMelding").innerHTML = '<b>* Vul aub. alle verplichte velden in [' + tel + ']</b>';
		document.getElementById("formMelding").style.display = '';
		return false;
	}	
}
function checkFormKlant(){
	tel=0;
	if (document.getElementById("naam").value =='') {				
		tel++;		
		document.getElementById("naam").className = 'txtInputMediumWrong';
	} else	{ 
		document.getElementById("naam").className = 'txtInputMedium';
	}
	if (document.getElementById("adres").value =='') {				
		tel++;		
		document.getElementById("adres").className = 'txtInputMediumWrong';
	} else	{ 
		document.getElementById("adres").className = 'txtInputMedium';
	}
	if (document.getElementById("postcode").value =='') {				
		tel++;		
		document.getElementById("postcode").className = 'txtInputMediumWrong';
	} else	{ 
		document.getElementById("postcode").className = 'txtInputMedium';
	}
	if (document.getElementById("plaats").value =='') {				
		tel++;		
		document.getElementById("plaats").className = 'txtInputMediumWrong';
	} else	{ 
		document.getElementById("plaats").className = 'txtInputMedium';
	}
	if(tel==0){					
		return true;
	} else {
		document.getElementById("formMelding").innerHTML = '<b>* Vul aub. alle verplichte velden in [' + tel + ']</b>';
		document.getElementById("formMelding").style.display = '';
		return false;
	}	
}
function checkNieuwsbrief(){
	tel=0;
	if (document.getElementById("voornaam").value =='') {				
		tel++;		
		document.getElementById("voornaam").className = 'txtInputNieuwsWrong';
	} else	{ 
		document.getElementById("voornaam").className = 'txtInputNieuws';
	}
	if (document.getElementById("achternaam").value =='') {				
		tel++;		
		document.getElementById("achternaam").className = 'txtInputNieuwsWrong';
	} else	{ 
		document.getElementById("achternaam").className = 'txtInputNieuws';
	}
	if (document.getElementById("mailadres").value =='' || !checkEmail(document.getElementById("mailadres").value)) {
		tel++;		
		document.getElementById("mailadres").className = 'txtInputNieuwsWrong';		
	} else	{ 
		document.getElementById("mailadres").className = 'txtInputNieuws';
	}
	if(tel==0){					
		return true;
	} else {
		document.getElementById("formMelding").innerHTML = '<b>* Vul aub. alle verplichte velden in [' + tel + ']</b>';
		document.getElementById("formMelding").style.display = '';
		return false;
	}	
}
function checkNieuwsbriefAfmelden(){
	tel=0;
	if (document.getElementById("mailadres").value =='' || !checkEmail(document.getElementById("mailadres").value)) {
		tel++;		
		document.getElementById("mailadres").className = 'txtInputNieuwsWrong';		
	} else	{ 
		document.getElementById("mailadres").className = 'txtInputNieuws';
	}
	if(tel==0){					
		return true;
	} else {
		document.getElementById("formMelding").innerHTML = '<b>* Vul aub. alle verplichte velden in [' + tel + ']</b>';
		document.getElementById("formMelding").style.display = '';
		return false;
	}	
}
function checkEmail(str){
	var testresults = false;
	//uitleg filter: minimaal 1 letter voor @ ; min 1 max 66 letters na @ ; min 2 max 6 letters na punt.
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str)){
		testresults=true;
	}else{
		testresults=false;
	}
	return (testresults);
}
function changeClass(whichbutton){
	if (document.getElementById(whichbutton).className == 'contactSubmitOver'){
		document.getElementById(whichbutton).className = 'contactSubmit';
	}else {
		document.getElementById(whichbutton).className = 'contactSubmitOver';
	}
}
function changeClassNieuws(whichbutton){
	if (document.getElementById(whichbutton).className == 'nieuwsSubmitOver'){
		document.getElementById(whichbutton).className = 'nieuwsSubmit';
	}else {
		document.getElementById(whichbutton).className = 'nieuwsSubmitOver';
	}
}
function changeClassKlant(whichbutton){
	if (document.getElementById(whichbutton).className == 'klantSubmitOver'){
		document.getElementById(whichbutton).className = 'klantSubmit';
	}else {
		document.getElementById(whichbutton).className = 'klantSubmitOver';
	}
}
function switchHeightPage(){
	if (document.getElementById("pageContainer").style.zIndex == 3){
		document.getElementById("pageContainer").style.zIndex = 6;
	} else {
		document.getElementById("pageContainer").style.zIndex = 3;
	}
}	
function switchHeightCollection(){
	if (document.getElementById("actueelMenuCollection").style.zIndex == 12){
		document.getElementById("actueelMenuCollection").style.zIndex = 10;
	} else {
		document.getElementById("actueelMenuCollection").style.zIndex = 12;
	}
}	
function switchCheck(which){
	if (which == "gesM"){
		thediv = document.getElementById(which);
		otherdiv = document.getElementById("gesV");
	} else {
		thediv = document.getElementById(which);
		otherdiv = document.getElementById("gesM");
	}
	if (thediv.className == "checkbox")	{
		thediv.className = "checkbox_on";
		otherdiv.className = "checkbox";
		document.getElementById("geslacht").value = which.substr(3,1);
	} 
}
function switchCheckFamily(which){
	if (which.substr(0,4) == "gesM"){
		thediv = document.getElementById(which);
		otherdiv = document.getElementById("gesV"+which.substr(4,1));
	} else {
		thediv = document.getElementById(which);
		otherdiv = document.getElementById("gesM"+which.substr(4,1));
	}
	if (thediv.className == "checkboxFam")	{
		thediv.className = "checkboxFam_on";
		otherdiv.className = "checkboxFam";
		document.getElementById("geslacht"+which.substr(4,1)).value = which.substr(3,1);
	} 
}
function switchCheckSingle(which){
		thediv = document.getElementById(which);
	if (thediv.className == "checkboxFam")	{
		thediv.className = "checkboxFam_on";
		document.getElementById("item"+which.substr(4,1)).value = which.substr(5,1);
	} else {
		thediv.className = "checkboxFam";
		document.getElementById("item"+which.substr(4,1)).value = '';
	}
}
function switchVestiging(which){
	//right afvangen voor andere kleur in styles
	for (i=1;i<=3;i++){
			if (document.getElementById("vest"+i).className == "checkbox_on_right"){
				document.getElementById("vest"+i).className = "checkbox_right";
			} else if (document.getElementById("vest"+i).className == "checkbox_right"){
				//do nothing
			} else {
				document.getElementById("vest"+i).className = "checkbox";
			}
		if(which == ("vest"+i)){
			if (document.getElementById("vest"+i).className == "checkbox_right"){
				document.getElementById("vest"+i).className = "checkbox_on_right";
			} else if (document.getElementById("vest"+i).className == "checkbox_on_right"){
				//do nothing
			} else {
				document.getElementById("vest"+i).className = "checkbox_on";
			}
			document.getElementById("vestiging").value = i;
		}
	}
}
