function wmInteract(elmnt,wmText)
{
	if(elmnt.value == '')
		elmnt.value = wmText;
	else if(elmnt.value == wmText)
		elmnt.value = '';
}

function postcodecheck(myfield, e, dec)
{
	//alert(myfield.value.length);
	var key;
	var keychar;

	if (window.event)
   	key = window.event.keyCode;
	else if (e)
   	key = e.which;
	else
   	return true;
	keychar = String.fromCharCode(key);

	// control keys
	if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
   	return true;

	// numbers
	else if ((myfield.value.length<4) && (("0123456789").indexOf(keychar) > -1))
		return true;
	else if ((myfield.value.length>3) && (("QWERTYUIOPASDFGHJKLZXCVBNM").indexOf(keychar) > -1))
   	return true;
	else if ((myfield.value.length>3) && (("qwertyuiopasdfghjklzxcvbnm").indexOf(keychar) > -1)){
		myfield.value = myfield.value+String.fromCharCode(key-32);
		return false;
	}	
	else
   	return false;
}

function CheckForm(){
	da = false;
	str = "U dient de volgende velden correct in te vullen:\n\n";
	geslacht = document.getElementById("geslacht").value;
	titel = document.getElementById("titel").value;
	voorletters = document.getElementById("voorletters").value;
	tussenvoegsel = document.getElementById("tussenvoegsel").value;
	achternaam = document.getElementById("achternaam").value;
	kantoornaam = document.getElementById("kantoornaam").value;
	adres = document.getElementById("adres").value;
	postcode = document.getElementById("postcode").value;
	woonplaats = document.getElementById("achternaam").value;
	telefoon = document.getElementById("telefoon").value;
	email = document.getElementById("email").value;
	categorie = document.getElementById("categorie").value;
	bericht = document.getElementById("bericht").value;

	if(geslacht==""){
		da = true;
		str = str+"- Geslacht\n";
	}
	if(titel==""){
		da = true;
		str = str+"- Titel\n";
	}
	if(voorletters==""){
		da = true;
		str = str+"- Voorletters\n";
	}
	if(achternaam==""){
		da = true;
		str = str+"- Achternaam\n";
	}
	if(kantoornaam==""){
		da = true;
		str = str+"- Kantoornaam\n";
	}
	if(adres==""){
		da = true;
		str = str+"- Adres\n";
	}
	if(postcode=="" || postcode.length!="6"){
		da = true;
		str = str+"- Postcode dient uit 6 tekens te bestaan (1234AB)\n";
	}
	if(woonplaats==""){
		da = true;
		str = str+"- Woonplaats\n";
	}
	if(telefoon==""){
		da = true;
		str = str+"- Telefoon\n";
	}
	if(email==""){
		da = true;
		str = str+"- E-mail\n";
	} else{
		if(!isValidEmail(email)){
		da = true;
		str = str+"- Uw email adres lijkt ongeldig\n";
		}
	}
	if(categorie==""){
		da = true;
		str = str+"- Categorie\n";
	}
	if(bericht==""){
		da = true;
		str = str+"- Bericht\n";
	}
	if(da==true){
		alert(str);
		return false;
	} else {
		document.contactform.submit();
		//return true;
	}
}
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	if (strEmail.search(validRegExp) == -1) 
   {
	  return false;
	} 
	return true; 
}