function jsTrim(TXT) {
 return TXT.replace(/(^\s+)|(\s+$)/g,"");
}
function envoi(myForm) {
 var txt="";
 var msg="";
 if (myForm.prenom.value != "fc") {
  if (jsTrim(myForm.prenom.value) == '') txt += "\n  - votre prénom";
  if (jsTrim(myForm.nom.value) == '')    txt += "\n  - votre nom";
  if (jsTrim(myForm.adresse.value) == '')txt += "\n  - votre adresse";
  if (jsTrim(myForm.profession.value) == '')txt += "\n  - votre profession";
  if (jsTrim(myForm.domaine.value) == '0')txt += "\n  - votre domaine d'activité";
  if (myForm.email.value.length > 0) {
   if (!isvalidEmail(myForm.email))      txt += "\n  - votre email : la saisie n'est pas correcte";
  }
  if (jsTrim(myForm.code.value) != '') {
   if (!isNumber(myForm.code.value)) txt += "\n  - code postal : invalide";
  } else {
   txt += "\n  - votre code postal";
  }
  if (jsTrim(myForm.ville.value) == '')  txt += "\n  - votre ville";
  if (txt != "") msg = msg + "Vous devez préciser :" + txt;
 }
 if (msg != "") { alert(msg); return false; }
 else return true;
}
function isNumber(n) {
 var result = false;
 if ( isNaN(n) == false ) {
  result=true;
 }
 return result;
}
function isvalidEmail(obj) {
 var result = false;
 if (obj.value.length > 3) {
  if (isEmailAddr(obj.value)) result=true;
 }
 return result;
}
function isEmailAddr(email) {  // on cherche un @ puis un point
 var result=false;
 var theStr=new String(email);
 var index =theStr.indexOf("@");
 if (index > 0) {
  var pindex = theStr.indexOf(".",index);
  if ((pindex > index+1) && (theStr.length > pindex+1))
   result = true;
 }
 return result;
}

