<!-- Scripts Des Trucsweb www.trucsweb.com -->
<!-- Veuillez s.v.p. laisser cette mention -->
<!-- 
function valpresent(champ) {
var pass=true;
if (document.images) {
for (i=0;i<champ.length;i++) {
var tempobj=champ.elements[i];
if (tempobj.name.substring(0,3)=="obl") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
champnom=tempobj.name.substring(3,30).toUpperCase();
alert("Et alors on oubli de renseigner le champ "+champnom+" , c'est pas BIEN  :-)");
return false;
}
else
return true;
}
//  Fin -->
<!-- 
function valchar(champ,valid) {
var ok = "yes";
var temp;
for (var i=0; i<champ.value.length; i++) {
temp = "" + champ.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Saisie invalide! Seul les caractères " + valid + " sont acceptés.");
champ.focus();
champ.select();
   }
}
//  End -->
<!-- Début
function valcourriel(champ) {
var ok = "yes";
txt=champ.value;
if (txt.indexOf("@")<3) ok = "no";
if ((txt.indexOf(".com")<5)&&(txt.indexOf(".org")<5)
&&(txt.indexOf(".fr")<5)&&(txt.indexOf(".net")<5)
&&(txt.indexOf(".gov")<5)&&(txt.indexOf(".qc.ca")<5)
&&(txt.indexOf(".ca")<5)&&(txt.indexOf(".edu")<5))ok = "no";
if (ok == "no") {
alert("Désolé. Votre adresse de courrier électronique est invalide.");
champ.focus();
champ.select();
   }
}
// Fin -->
<!-- Début
function valmax(champ,max) {
if (champ.value.length > max) {
alert("S.V.P. ne pas entrer plus de 20 caractères.  Essayez de nouveau!");
champ.focus();
champ.select();
   }
}
// Fin -->
function valdate(champ) {
var err = 0
string = champ.value;
var valid = "0123456789/"
var ok = "yes";
var temp;
for (var i=0; i< string.length; i++) {
temp = "" + string.substring(i, i+1);
if (valid.indexOf(temp) == "-1") err = 1;
}
if (string.length != 8) err=1
b = string.substring(0, 2) // day
c = string.substring(2, 3)// '/'
d = string.substring(3, 5) // month
e = string.substring(5, 6)// '/'
f = string.substring(6, 8) // year
if (b<1 || b>31) err = 1
if (c != '/') err = 1
if (d<1 || d>12) err = 1
if (e != '/') err = 1
if (f<0 || f>99) err = 1
if (b==4 || b==6 || b==9 || b==11){
if (d==31) err=1
}
if (b==2){
var g=parseInt(f/4)
if (isNaN(g)) {
err=1
}
if (d>29) err=1
if (d==29 && ((f/4)!=parseInt(f/4))) err=1
}
if (err==1) {
alert('La date est illégal');
champ.focus();
champ.select();
}
}
//-->
