
  function formsend(){
  	return validateOnSubmit();
  }
  function writemail() {
  var recipient_name = 'info';
	var recipient_domain= 'uitgeverijappelmoes.nl';
	var recipient_mail = recipient_name + "@" + recipient_domain;
  document.getElementById('recipient').value= recipient_mail;
  document.getElementById('redirect').value=document.URL;
 }
  function validateOnSubmit() {
  
    var elem;
    var errs=0;
    var theform= document.forms.infoform;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
 
 	if (theform.telefoon)
 		{
    if (!validateTelnr(theform.telefoon, 'inf_telefoon', true)) errs += 1; 
  	}
 
  if (theform.woonplaats)
  	{     
    if(!validatePresent (theform.woonplaats, 'inf_postcode', true)) errs += 1;
  	} 
  if (theform.postcode)
  	{
  	if (!validateZipcode(theform.postcode, 'inf_postcode', true)) errs +=1;
  	}
  if (theform.adres)
  	{     
    if(!validatePresent (theform.adres, 'inf_adres', true)) errs += 1;
  	}

  if (!validateEmail  (theform.email, 'inf_email', true)) errs += 1; 
  if(!validatePresent (theform.naam, 'inf_naam', true)) errs += 1;

    if (errs>1) alert('Niet alle verplichte velden zijn (juist) ingevuld');
    if (errs==1) alert('U heeft een verplicht veld niet(juist) ingevuld ');
    		
    return (errs==0);
  };
  
  

