function tstForm() {
  if(tstNom()&&tstPrenom()&&tstMail()&&tstSujet()&&tstMessage()&&tstCode()) return true;
  return false;
}
function tstNom() {
  if(document.contact.nom.value.length!=0) return true;
  alert("Il n'y a aucun nom !");
  document.contact.nom.focus();
  return false;
}
function tstPrenom() {
  if(document.contact.prenom.value.length!=0) return true;
  alert("Il n'y a aucun prénom !");
  document.contact.prenom.focus();
  return false;
}
function tstMail() {
  var i,x=""+document.contact.email.value;
  for(i=0;i<x.length;i++) {
    if((x.charAt(i)=="@")&&(i>1)) {
      for(i=i+3;i<x.length;i++) {
        if((x.charAt(i)==".")&&(i<x.length-2)) return true;
      }
    }
  }
  alert("L'e-mail est incorrect !");
  document.contact.email.focus();
  return false;
}
function tstSujet() {
  if(document.contact.sujet.value.length!=0) return true;
  alert("Il n'y a aucun sujet !");
  document.contact.sujet.focus();
  return false;
}
function tstMessage() {
  if(document.contact.message.value.length!=0) return true;
  alert("Il n'y a aucun message !");
  document.contact.message.focus();
  return false;
}
function tstCode() {
  if(document.contact.code.value.length==4) return true;
  alert("Le code est incorrect !");
  document.contact.code.focus();
  return false;
}
