function valid(champ,nomchamp,langue)
{
   str=champ.value;
   if (str == "")
   {
      if (langue=='f')
         alert("Merci de saisir une valeur pour le champ \""+ nomchamp +"\"");
      if (langue=='e')         
         alert("Please fill the field \""+ nomchamp +"\"");
      if (langue=='d')         
         alert("Bitte das Feld \""+ nomchamp +"\" erfüllen");
      champ.focus();
      return(false);
   }
   return true;
}

function validemail(champ,langue)
{
  str= champ.value;
  if (str != "")
  {
     if (str.indexOf('@',0) == -1)
     {      
        if (langue=='f')
           alert("Adresse email invalide.");
        if (langue=='e')         
           alert("Invalid email address");
        if (langue=='d')         
           alert("Ungültige Email-Adresse");        
        champ.focus();
        return(false);
     }
     if (str.indexOf('.',0) == -1)
     { 
        if (langue=='f')
           alert("Adresse email invalide.");
        if (langue=='e')         
           alert("Invalid email address");
        if (langue=='d')         
           alert("Ungültige Email-Adresse");   
        champ.focus();
        return(false);
     }
  }
  return true;
}

function validation_contact(theform,langue)
{
   if (langue=='f')
   {
      champ_nom = "Nom"
      champ_prenom ="Prenom"
      champ_adresse ="Adresse"
      champ_cp ="Code postal"
      champ_ville ="Ville"
      champ_pays = "Pays"
   }
   if (langue=='e')         
   {
      champ_nom = "Lastname"
      champ_prenom ="Firstname"
      champ_adresse ="Address"
      champ_cp ="Zipcode"
      champ_ville ="City"
      champ_pays="Country"
   }
   if (langue=='d')      
   {   
      champ_nom = "Name"
      champ_prenom ="Vorname"
      champ_adresse ="Anschrift"
      champ_cp ="Postleitzahl"
      champ_ville ="Stadt"
      champ_pays="Land"
   }
   return (
      valid(theform.nom,champ_nom,langue) &&
      valid(theform.prenom,champ_prenom,langue) &&
      valid(theform.adresse,champ_adresse,langue) &&
      valid(theform.codepostal,champ_cp,langue) &&
      valid(theform.ville,champ_ville,langue) &&
      valid(theform.pays,champ_pays,langue) &&
      valid(theform.email,"E-mail",langue) &&
      validemail(theform.email,langue)
   )
}
