
  function formsend(){
  	return validateOnSubmit();
  }
  function writemail() {
	var recipient_name = 'coulonlaurensac';
	var recipient_domain= 'wanadoo.fr';
	//var recipient_name = 'willem';
	//var recipient_domain= 'exclamo.nl';
	var recipient_mail = recipient_name + "@" + recipient_domain;
  document.getElementById('recipient').value= recipient_mail;
   	var msg_language = getCookie('sitelanguage');
   	  if (msg_language == 'en') {
  var redirectpage = 'http://www.clbx.com/en/bordeaux/66/85/Thank_you.html';
  }
  if (msg_language == 'fr') {
  var redirectpage = 'http://www.clbx.com/fr/bordeaux/58/74/Merci_pour_votre_question.html';
  }
  if (msg_language == 'nl') {
   var redirectpage = 'http://www.clbx.com/nl/bordeaux/64/75/Bedankt_voor_uw_vraag.html';
  }
  if (msg_language == 'de') {
   var redirectpage = 'http://www.clbx.com/de/bordeaux/69/101/Vielen_Dank.html';
   }
  document.getElementById('redirect').value=  redirectpage; //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.
 	var msg_language = getCookie('sitelanguage');
 	if (theform.telefoon)
 		{
    //if (!validateTelnr(theform.telefoon, 'inf_telefoon', true)) errs += 1; 
	if (!validatePresent(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 (!validatePresent(theform.postcode, 'inf_postcode', true)) errs +=1;
  	}
  if (theform.adres)
  	{     
    if(!validatePresent (theform.adres, 'inf_adres', true)) errs += 1;
  	}
  if (!validateEmailConfirmation(theform.email_confirm, theform.email_confirm.value, theform.email.value, 'inf_email_confirmation', true)) errs +=1
	
  if (!validateEmail  (theform.email, 'inf_email', true)) errs += 1; 
  if(!validatePresent (theform.firstname, 'inf_voornaam', true)) errs += 1;
	 if(!validatePresent (theform.lastname, 'inf_achternaam', true)) errs += 1;		
		if (msg_language == 'nl') {
			msg_single = 'U heeft een verplicht veld niet (juist) ingevuld ';
			msg_multiple = 'Niet alle verplichte velden zijn (juist) ingevuld';
		}
		if (msg_language == 'en') {
			msg_single = 'You did not correctly fill out a mandatory field';
			msg_multiple = 'Not all mandatory fields were filled correct';
		}
		if (msg_language == 'fr') {
			msg_single = 'Vous n\'avez pas saisie une champ obligatoire';
			msg_multiple = 'Vous n\'avez pas saisie toutes champs obligatoires';
		}
		if (msg_language == 'de') {
			msg_single = 'Sie haben ein verpflichtes Feld nicht richtig ausgefühlt';
			msg_multiple = 'Sie haben nicht alle verpflichtete Feldern richtig ausgefühlt';
		}
		
    if (errs>1) alert(msg_multiple);
    if (errs==1) alert(msg_single);
		
	return (errs==0);

  };
  
  

