function validateLH() {
	if (document.login.name.value.length == 0)
	{
		alert("Achternaam invullen a.u.b");
		document.login.name.focus();
		return false;
	}
	if (!isDate())
	{
		alert("Een geldige geboortedatum invullen a.u.b");
		document.login.dag.focus();
		return false;
	}
	if ((document.login.licnr_1.value.length != 2) || (document.login.licnr_2.value.length != 4) || (document.login.licnr_3.value.length != 7))	{
		alert("Een geldige licentienummer invullen a.u.b");
		document.login.licnr_1.focus();
		return false;
	}
}

function isDate() {
  strday = document.login.dag.value;
  strmonth = document.login.maand.value;
  stryear = document.login.jaar.value;
	 
  if( isNaN(strday) || (strday < 0) || isNaN(stryear) || (stryear < 0)) {
    return false;
  } 

  if( (strmonth == "01") || (strmonth == "03") || (strmonth == "05") || 
      (strmonth == "07") || (strmonth == "08") || (strmonth == "10") || 
      (strmonth == "12") ) { monthdays = 31 }
  else if( (strmonth == "04") || (strmonth == "06") || (strmonth == "09") ||
           (strmonth == "11") ) { monthdays = 30 }
  else if(strmonth == "02") { 
    monthdays = ((stryear % 4) == 0) ? 29 : 28; 
  }
  else {
    return false;
  }
  if(strday > monthdays) {
    return false;
  }
  return true;
}
