function checkEmail(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}
function showLayer(whichdiv){
	if ($(whichdiv).style.display == ''){
		$(whichdiv).style.display = 'none';
	} else {
		$(whichdiv).style.display = '';
	}
}
function checkForm(){
	tel=0;
	if (checkAanhef==true){
		if (!$("#dhr").is(":checked") && !$("#mvr").is(":checked")) {
			tel++;
		}
	}
	for(var inputname in inputs)	{
		if ($(inputs[inputname]).val()=='') {				
			tel++;		
			$(inputs[inputname]).addClass('wrong');
		} else	{ 
			$(inputs[inputname]).removeClass('wrong');
		}
	}
	if (checkMailAddress==true){
		if ($("#email").val()=='' || !checkEmail($("#email").val())) {				
			tel++;		
			$("#email").addClass('wrong');
		} else	{ 
			$("#email").removeClass('wrong');
		}
	}
	if(tel==0){					
		return true;
	} else {
		if (formMelding==true){
			$("p.formMelding").html('<b>* Vul aub. alle verplichte velden in [' + tel + ']</b>');
		}
		return false;
	}	
}
function checkInput(input, was, wordt){
	if(input.value==was){
		input.value=wordt;
	}
}
function switchIt(what){
	document.getElementById('digital').style.display='none';
	document.getElementById('solTable').style.display='none';
	document.getElementById(what).style.display='';
}
function showLargePic(loc) {
	document.getElementById('grotefoto').innerHTML = '<img alt="" src="'+siteurl+'upload/large/'+loc+'"/>';
	return false;
}
