function checkform(theform)
{
   var s = '';
   if (theform.companyName.value == '') {
      s += 'vul a.u.b. uw bedrijfsnaam in.\n';
   }
   if (theform.username.value == '') {
      s += 'vul a.u.b. uw naam in.\n';
   }
   if (!isEmailValid(theform.email.value)) {
      s += 'vul a.u.b. een geldig email adres in.\n';
   }
   if (theform.street_1.value == '') {
      s += 'vul a.u.b. uw adres in.\n';
   }
   if (theform.postcode_1.value == '') {
      s += 'vul a.u.b. uw postcode in.\n';
   }
   if (theform.city_1.value == '') {
      s += 'vul a.u.b. uw adres in.\n';
   }
    if (theform.tel_1.value == '') {
      s += 'vul a.u.b. uw telefoonnummer in.\n';
   }
   if ((theform.companytype[0].checked == false) && (theform.companytype[1].checked == false) && (theform.companytype[2].checked == false))
   {
      s += 'kies a.u.b. een bedrijfssoort.';
   }
   if ((theform.companytype[0].checked == true) && (theform.kManagingCompID.selectedIndex == 0 && theform.kClusterID.selectedIndex == 0)) {
      s += 'Kies een ondernemingsvereniging en\/of een cluster.\n';
   }
   theform.loginName.value = theform.email.value;

   if (s != '') {
      alert(s);
      return false;
   }
   theform.submitbutton.disabled = true;

   return true;
}

function isEmailValid(sEmail){
   var r = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
   return r.test(sEmail);
}

function setCompanyType(control)
{
   var disabled = (control.value != 'ondernemersvereniging');
   document.getElementById('kManagingCompID').disabled = disabled;
   document.getElementById('kClusterID').disabled = disabled;
   // alert(control.value);
}
// -->
