function AlleenCijfers(evt){  //onkeypress="return AlleenCijfers(event)"
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		return false;
	}
	return true;
}

function Controleer(){
	var Foutmelding = '';
	submitOK = true;
	var email = document.contactformulier.Email.value;
	var emailFilter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	$('input[type=text]').css({'border-color': '#828282'});
	if (document.contactformulier.Naam != null && document.contactformulier.Naam.value.length==0){
		Foutmelding = Foutmelding + '- Uw naam.\n';
		document.contactformulier.Naam.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	
	if (!emailFilter.test(email)) {
		Foutmelding = Foutmelding + '- U dient een geldig emailadres in te voeren.\n';
		document.contactformulier.Email.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	
	if (submitOK== false ){
		alert('De volgende velden dient u in te vullen:\n' + Foutmelding);
		return false;
	}
}

function ControleerPersaccreditatie(){
	var Foutmelding = '';
	submitOK = true;
	var email = document.persaccreditatie_formulier.Email.value;
	var emailFilter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	$('input[type=text]').css({'border-color': '#828282'});
	if (document.persaccreditatie_formulier.NaamMedium != null && document.persaccreditatie_formulier.NaamMedium.value.length==0){
		Foutmelding = Foutmelding + '- Naam medium.\n';
		document.persaccreditatie_formulier.NaamMedium.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	if (document.persaccreditatie_formulier.NaamJournalist != null && document.persaccreditatie_formulier.NaamJournalist.value.length==0){
		Foutmelding = Foutmelding + '- Naam journalist.\n';
		document.persaccreditatie_formulier.NaamJournalist.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	if (document.persaccreditatie_formulier.NummerPerskaart != null && document.persaccreditatie_formulier.NummerPerskaart.value.length==0){
		Foutmelding = Foutmelding + '- Nummer perskaart.\n';
		document.persaccreditatie_formulier.NummerPerskaart.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	
	
	if (document.persaccreditatie_formulier.Adres != null && document.persaccreditatie_formulier.Adres.value.length==0){
		Foutmelding = Foutmelding + '- Adres.\n';
		document.persaccreditatie_formulier.Adres.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	if (document.persaccreditatie_formulier.Postcode != null && document.persaccreditatie_formulier.Postcode.value.length==0){
		Foutmelding = Foutmelding + '- Postcode.\n';
		document.persaccreditatie_formulier.Postcode.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	if (document.persaccreditatie_formulier.Woonplaats != null && document.persaccreditatie_formulier.Woonplaats.value.length==0){
		Foutmelding = Foutmelding + '- Woonplaats.\n';
		document.persaccreditatie_formulier.Woonplaats.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	
	
	if (document.persaccreditatie_formulier.Tel != null && document.persaccreditatie_formulier.Tel.value.length==0){
		Foutmelding = Foutmelding + '- Telefoonnummer.\n';
		document.persaccreditatie_formulier.Tel.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	if (!emailFilter.test(email)) {
		Foutmelding = Foutmelding + '- U dient een geldig emailadres in te voeren.\n';
		document.persaccreditatie_formulier.Email.style.border = '1px solid #ff0000';
		submitOK= false;
	}
	
	if (submitOK== false ){
		alert('De volgende velden dient u in te vullen:\n' + Foutmelding);
		return false;
	}
}