function validate_form() {
  validity = true; 
  if (!check_empty(document.form.naam.value))
        { validity = false; alert('U heeft geen naam ingevuld!'); }
  else if (!check_email(document.form.email.value))
        { validity = false; alert('Het E-mail adres is ongeldig!'); }
  else if (!check_empty(document.form.datum.value))
        { validity = false; alert('U heeft geen datum ingevuld!'); }
  else if (!check_empty(document.form.tijd.value))
        { validity = false; alert('U heeft geen tijd ingevuld!'); }
  else if (!check_empty(document.form.aantal.value))
        { validity = false; alert('U heeft geen aantal personen ingevuld!'); }
	return validity;
}

function validate_form_2() {
  validity = true; 
  if (!check_empty(document.form.naam.value))
        { validity = false; alert('U heeft geen naam ingevuld!'); }
  else if (!check_email(document.form.email.value))
        { validity = false; alert('Het E-mail adres is ongeldig!'); }
return validity;
}

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

function check_email(adres) {
  if ((adres == "")
    || (adres.indexOf ('@') == -1)
    || (adres.indexOf ('.') == -1))
      return false;
  return true;
}
