function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

//BEGIN FORM VALIDATION CONTACT


function CheckAll(theForm) {
   if (theForm.naam.value == "") {
      alert("Vul a.u.b. uw naam in.");
      theForm.naam.focus();
      return (false);
   }
   if (!(isNaN(theForm.naam.value))) {
      alert("U kunt geen numerieke waardes bij uw naam invullen.");
      theForm.naam.focus();
      return (false);
   }
   if (theForm.email.value == "") {
      alert("Vul a.u.b. een e-mailadres in");
      theForm.email.focus();
      return (false);
   }
  if ((!(theForm.email.value == "")) && (!isEmailAddr(theForm.email.value)))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.email.focus();
    return (false);
  }
   if (theForm.onderwerp.value == "00") {
      alert("Selecteer a.u.b. een onderwerp.");
      theForm.onderwerp.focus();
      return (false);
   }
   if (theForm.info.value == "") {
      alert("Wat is uw boodschap?");
      theForm.info.focus();
      return (false);
   }
   return (true);
}


//EIND FORM VALIDATION CONTACT

//BEGIN FORM VALIDATION BEL MIJ


function CheckCall(theForm) {
   if (theForm.nummer.value == "") {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   if (isNaN(theForm.nummer.value)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   if ((!(theForm.nummer.value == "")) && (theForm.nummer.value.length < 10)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   return (true);
}


//EIND FORM VALIDATION BEL MIJ


//BEGIN FORM VALIDATION LID WORDEN


function CheckLid(theForm) {
   if (theForm.vletter.value == "") {
      alert("Vul a.u.b. uw voorletter in.");
      theForm.vletter.focus();
      return (false);
   }
   if (!(isNaN(theForm.vletter.value))) {
      alert("U kunt geen numerieke waardes bij uw voorletter invullen.");
      theForm.vletter.focus();
      return (false);
   }
   if ((!(isNaN(theForm.voegsel.value))) && (theForm.voegsel.value.length > 0)) {
      alert("U kunt geen numerieke waardes bij uw tussenvoegsel invullen.");
      theForm.voegsel.focus();
      return (false);
   }
   if (theForm.anaam.value == "") {
      alert("Vul a.u.b. uw achternaam in.");
      theForm.anaam.focus();
      return (false);
   }
   if (!(isNaN(theForm.anaam.value))) {
      alert("U kunt geen numerieke waardes bij uw achternaam invullen.");
      theForm.anaam.focus();
      return (false);
   }
   if (theForm.dag.value == "00") {
      alert("Vul a.u.b. uw geboortedag in.");
      theForm.dag.focus();
      return (false);
   }
   if (theForm.maand.value == "00") {
      alert("Vul a.u.b. uw geboortemaand in.");
      theForm.maand.focus();
      return (false);
   }
   if (theForm.jaar.value == "0000") {
      alert("Vul a.u.b. uw geboortejaar in.");
      theForm.jaar.focus();
      return (false);
   }
   if (theForm.straat.value == "") {
      alert("Vul a.u.b. uw straatnaam in.");
      theForm.straat.focus();
      return (false);
   }
   if (theForm.hnummer.value == "") {
      alert("Vul a.u.b. uw huisnummer in.");
      theForm.hnummer.focus();
      return (false);
   }
   if (theForm.pcode.value == "") {
      alert("Vul a.u.b. uw postcode in.");
      theForm.pcode.focus();
      return (false);
   }
var rExp = /^[1-9]\d{3}[A-Z]{2}$/;
OK = rExp.exec(theForm.pcode.value); 
if (!OK) 
{ 
alert("U heeft het veld postcode niet juist ingevuld. Vul de postcode in met notatie 1234AB"); 
theForm.pcode.focus();
return false; 
} 
   if (theForm.plaats.value == "") {
      alert("Vul a.u.b. uw woonplaats in.");
      theForm.plaats.focus();
      return (false);
   }
   if (!(isNaN(theForm.plaats.value))) {
      alert("U kunt geen numerieke waardes bij uw woonplaats invullen.");
      theForm.plaats.focus();
      return (false);
   }
   if ((isNaN(theForm.nummer.value)) && (theForm.nummer.value.length < 10)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   if ((!(theForm.nummer.value == "")) && (theForm.nummer.value.length < 10)) {
      alert("Vul a.u.b. een geldig telefoonnummer in.");
      theForm.nummer.focus();
      return (false);
   }
  if ((!(theForm.email.value == "")) && (!isEmailAddr(theForm.email.value)))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.email.focus();
    return (false);
  }
   if (theForm.bank.value == "") {
      alert("Vul a.u.b. een geldig rekeningnummer in.");
      theForm.bank.focus();
      return (false);
   }
   if (((theForm.bank.value.length < 7) || (theForm.bank.value.length > 9)) || (isNaN(theForm.bank.value))) {
      alert("Vul a.u.b. een geldig rekeningnummer in.");
      theForm.bank.focus();
      return (false);
   }
   if (theForm.machtig.checked == false) {
      alert("U dient akkoord te gaan met de machtiging.");
      theForm.machtig.focus();
      return (false);
   }
   return (true);
}


//EIND FORM VALIDATION LID WORDEN


//BEGIN FORM VALIDATION DONATIE


function CheckDon(theForm) {
   if (theForm.vletter.value == "") {
      alert("Vul a.u.b. uw voorletter(s) in.");
      theForm.vletter.focus();
      return (false);
   }
   if (!(isNaN(theForm.vletter.value))) {
      alert("U kunt geen numerieke waardes bij uw voorletter(s) invullen.");
      theForm.vletter.focus();
      return (false);
   }
   if (theForm.naam.value == "") {
      alert("Vul a.u.b. uw achternaam in.");
      theForm.naam.focus();
      return (false);
   }
   if (!(isNaN(theForm.naam.value))) {
      alert("U kunt geen numerieke waardes bij uw achternaam invullen.");
      theForm.naam.focus();
      return (false);
   }
   if (theForm.straat.value == "") {
      alert("Vul a.u.b. uw straatnaam in.");
      theForm.straat.focus();
      return (false);
   }
   if (theForm.hnummer.value == "") {
      alert("Vul a.u.b. uw huisnummer in.");
      theForm.hnummer.focus();
      return (false);
   }
   if (theForm.pcode.value == "") {
      alert("Vul a.u.b. uw postcode in.");
      theForm.pcode.focus();
      return (false);
   }
var rExp = /^[1-9]\d{3}[A-Z]{2}$/;
OK = rExp.exec(theForm.pcode.value); 
if (!OK) 
{ 
alert("U heeft het veld postcode niet juist ingevuld. Vul de postcode in met notatie 1234AB"); 
theForm.pcode.focus();
return false; 
} 
   if (theForm.plaats.value == "") {
      alert("Vul a.u.b. uw woonplaats in.");
      theForm.plaats.focus();
      return (false);
   }
   if (!(isNaN(theForm.plaats.value))) {
      alert("U kunt geen numerieke waardes bij uw woonplaats invullen.");
      theForm.plaats.focus();
      return (false);
   }
  if ((!(theForm.email.value == "")) && (!isEmailAddr(theForm.email.value)))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.email.focus();
    return (false);
  }
   if (theForm.nummer.value == "") {
      alert("Vul a.u.b. een geldig rekeningnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   if (((theForm.nummer.value.length < 7) || (theForm.nummer.value.length > 9)) || (isNaN(theForm.nummer.value))) {
      alert("Vul a.u.b. een geldig rekeningnummer in.");
      theForm.nummer.focus();
      return (false);
   }
   if (theForm.bedrag.value == "") {
      alert("Vul a.u.b. een bedrag in.");
      theForm.bedrag.focus();
      return (false);
   }
   if ((isNaN(theForm.bedrag.value))) {
      alert("Vul a.u.b. een geldig bedrag in.");
      theForm.bedrag.focus();
      return (false);
   }
   return (true);
}

//EIND FORM VALIDATION DONATIE



//BEGIN FORM VALIDATION MEIER VOOR MOKUM


function CheckMeier(theForm) {
   if (theForm.vletter.value == "") {
      alert("Vul a.u.b. uw voorletter(s) in.");
      theForm.vletter.focus();
      return (false);
   }
   if (!(isNaN(theForm.vletter.value))) {
      alert("U kunt geen numerieke waardes bij uw voorletter(s) invullen.");
      theForm.vletter.focus();
      return (false);
   }
   if (theForm.naam.value == "") {
      alert("Vul a.u.b. uw achternaam in.");
      theForm.naam.focus();
      return (false);
   }
   if (!(isNaN(theForm.naam.value))) {
      alert("U kunt geen numerieke waardes bij uw achternaam invullen.");
      theForm.naam.focus();
      return (false);
   }
   if ((isNaN(theForm.tel.value)) || (theForm.tel.value.length < 10)) {
      alert("Vul a.u.b. een geldig 10 cijferig telefoonnummer in.");
      theForm.tel.focus();
      return (false);
   }
   if (theForm.tel.value == "")  {
      alert("Vul a.u.b. een telefoonnummer in.");
      theForm.tel.focus();
      return (false);
   }
  if ((!isEmailAddr(theForm.email.value)) || (theForm.email.value == ""))
  {
    alert("Vult u a.u.b. een geldig e-mailadres in in de vorm : uwnaam@uwdomein.com");
    theForm.email.focus();
    return (false);
  }
   return (true);
}


//EIND FORM VALIDATION MEIER VOOR MOKUM