function IsNumeric(sText)
{
   var ValidChars = "0123456789- ";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


function form_validator(theForm)
{

  if (!theForm.sekse[0].checked && 
      !theForm.sekse[1].checked )
  {
    alert("Geef aan of u man of vrouw bent a.u.b.");
    theForm.sekse[0].focus();
    return (false);
  }
  
  if (theForm.voorletter.value == "")
  {
    alert("Vul uw voorletter(s) in.");
    theForm.voorletter.focus();
    return (false);
  }
  
  if (theForm.voornaam.value == "")
  {
    alert("Vul uw voorletter(s) in.");
    theForm.voornaam.focus();
    return (false);
  }

  if (theForm.achternaam.value == "")
  {
    alert("Vul uw achternaam in.");
    theForm.achternaam.focus();
    return (false);
  }

  if (theForm.straat.value == "")
  {
    alert("Vul uw straatnaam in a.u.b.");
    theForm.straat.focus();
    return (false);
  }

  if (theForm.huisnr.value == "")
  {
    alert("Vul uw huisnummer in a.u.b.");
    theForm.huisnr.focus();
    return (false);
  }
  
  if (theForm.postcode.value == "")
  {
    alert("Vul uw postcode in a.u.b.");
    theForm.postcode.focus();
    return (false);
  }

  if (theForm.postcode.value.length < 6)
  {
    alert("Vul en juiste postcode in a.u.b.");
    theForm.postcode.focus();
    return (false);
  }

  if (theForm.woonplaats.value == "")
  {
    alert("Vul uw woonplaats a.u.b.");
    theForm.woonplaats.focus();
    return (false);
  }
  
  if (theForm.kengetal.value.length < 2)
  {
    alert("Vul een juist kengetal in a.u.b.");
    theForm.kengetal.focus();
    return (false);
  }
  
  if (theForm.kengetal.value.length > 4)
  {
    alert("Vul een juist kengetal in a.u.b.");
    theForm.kengetal.focus();
    return (false);
  }
  
  if (theForm.kengetal.value == "")
  {
    alert("Vul uw kengetal in a.u.b.");
    theForm.kengetal.focus();
    return (false);
  }
  
   if (!IsNumeric(theForm.kengetal.value)) 
  {
    alert("Vul een juist kengetal in a.u.b.");
    theForm.kengetal.focus();
    return (false);
  }

  if (theForm.telefoonnr.value == "")
  {
    alert("Vul uw telefoonnummer in a.u.b.");
    theForm.telefoonnr.focus();
    return (false);
  }

   if (!IsNumeric(theForm.telefoonnr.value)) 
  {
    alert("Vul een juist telefoonnummer in a.u.b.");
    theForm.telefoonnr.focus();
    return (false);
  }

  if (theForm.telefoonnr.value.length < 6)
  {
    alert("Vul een juist telefoonnummer in a.u.b.");
    theForm.telefoonnr.focus();
    return (false);
  }

  if (theForm.telefoonnr.value.length > 9)
  {
    alert("Vul een juist telefoonnummer in a.u.b.");
    theForm.telefoonnr.focus();
    return (false);
  }
  
  if (theForm.email.value == "")
  {
    alert("Vul uw e-mailadres in a.u.b.");
    theForm.email.focus();
    return (false);
  }


return(true)
}
