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(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 switchIt(what){
	document.getElementById('digital').style.display='none';
	document.getElementById('solTable').style.display='none';
	document.getElementById(what).style.display='';
}
function checkInput(input, was, wordt){
	if(input.value==was){
		input.value=wordt;
	}
}
function openMenu(divId) {
		cancelClose();
		closeAll();
		document.getElementById(divId).style.display='';	
}

function closeAll(){
		document.getElementById('organisatie').style.display='none';
		document.getElementById('producten').style.display='none';
		document.getElementById('acties').style.display='none';
		document.getElementById('nieuws').style.display='none';
		document.getElementById('trainingen').style.display='none';
}
function closeMenu(divId){
	t = setTimeout(function(){closeAll()},600);
}

function cancelClose(){
	if(typeof(t) != "undefined") {
	clearTimeout(t);
	}
}
function openInfo(){
	document.getElementById('infosmall').style.display = 'none';
	document.getElementById('infolarge').style.display = '';
}
function closeInfo(){
	document.getElementById('infolarge').style.display = 'none';
	document.getElementById('infosmall').style.display = '';
}
