function oter_blancs(chaine)
  {
    var i=0;

    while(i<chaine.value.length && chaine.value.charAt(i)==" ") i++;
    var j=chaine.value.length-1;
    while(j>=0 && chaine.value.charAt(j)==" ") j--;
    if(i<=j) chaine.value=chaine.value.substring(i, j+1);
    else chaine.value="";
    return;
  }
  
function Form_Validator(theForm)
{
  if (theForm.nom == "")
  {
    alert("Entrez une valeur dans le champ \"Nom\" SVP.");
    theForm.nom.focus();
    return (false);
  }
  if (theForm.nom.value.length < 3)
  {
    alert("Entrez au moins 3 caractères dans le champ \"Nom\" SVP.");
    theForm.nom.focus();
    return (false);
  }
  if (theForm.nom.value.length > 256)
  {
    alert("Entrez moins de 256 caractères dans le champ \"Nom\" SVP.");
    theForm.nom.focus();
    return (false);
  }
  if (theForm.societe.value == "")
  {
    alert("Entrez une valeur dans le champ \"Societe\" SVP.");
    theForm.societe.focus();
    return (false);
  }
  if (theForm.societe.value.length < 3)
  {
    alert("Entrez au moins 3 caractères dans le champ \"Societe\" SVP.");
    theForm.societe.focus();
    return (false);
  }
  if (theForm.societe.value.length > 256)
  {
    alert("Entrez moins de 256 caractères dans le champ \"Societe\" SVP.");
    theForm.societe.focus();
    return (false);
  }
  if (theForm.adresse.value == "")
  {alert("Entrez une valeur dans le champ \"Addresse Ligne 1\" SVP.");
    theForm.adresse.focus();
    return (false);
  }
  if (theForm.adresse.value.length < 3)
  {alert("Entrez au moins 3 caractères dans le champ \"Addresse Ligne 1\" SVP.");
    theForm.adresse.focus();
    return (false);
  }
  if (theForm.adresse.value.length > 256)
  {alert("Entrez moins de 256 caractères dans le champ \"Addresse Ligne 1\" SVP.");
    theForm.adresse.focus();
    return (false);
  }
  if (theForm.ville.value == "")
  {alert("Entrez une valeur dans le champ \"Ville\" SVP.");
    theForm.ville.focus();
    return (false);
  }
  if (theForm.ville.value.length < 3)
  {
    alert("Entrez au moins 3 caractères dans le champ \"Ville\" SVP.");
    theForm.ville.focus();
    return (false);
  }
  if (theForm.ville.value.length > 256)
  {
    alert("Entrez moins de 256 caractères dans le champ \"Ville\" SVP.");
    theForm.ville.focus();
    return (false);
  }
  if (theForm.CP.value == "")
  {
    alert("Entrez une valeur dans le champ \"Code Postal\" SVP.");
    theForm.CP.focus();
    return (false);
  }
  if (theForm.CP.value.length < 5)
  {
    alert("Entrez au moins 5 caractères dans le champ \"Code Postal\" SVP.");
    theForm.CP.focus();
    return (false);
  }
  if (theForm.CP.value.length > 256)
  {
    alert("Entrez moins de 256 caractères dans le champ \"Code Postal\" SVP.");
    theForm.CP.focus();
    return (false);
  }
  if (theForm.tel.value == "")
  {
    alert("Entrez une valeur dans le champ \"Numero de telephone\" SVP.");
    theForm.tel.focus();
    return (false);
  }
  if (theForm.tel.value.length < 10)
  {
    alert("Entrez au moins 10 caractères dans le champ \"Numero de telephone\" SVP.");
    theForm.tel.focus();
    return (false);
  }
  if (theForm.tel.value.length > 25)
  {
  	alert("Entrez moins de 25 caractères dans le champ \"Numéro de telephone\" SVP.");
    theForm.tel.focus();
    return (false);
  }
oter_blancs(theForm.e_mail);

var retval = true;
 if (theForm.e_mail.value == "") retval = false;
   else
     {
        var pos=theForm.e_mail.value.indexOf('@', 0);
        if (pos == -1) retval = false;
        else if (theForm.e_mail.value.indexOf('@', pos+1) != -1) retval = false;
     }
   if(retval == false)
     {
       	window.alert( "Adresse e-mail incorrecte ...");
       	theForm.e_mail.select();
       	theForm.e_mail.focus();
		return (false);

     }
return (true);
}