function Is () { var agt=navigator.userAgent.toLowerCase() this.major = parseInt(navigator.appVersion) this.minor = parseFloat(navigator.appVersion) this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1))) this.nav2 = (this.nav && (this.major == 2)) this.nav3 = (this.nav && (this.major == 3)) this.nav4 = (this.nav && (this.major == 4)) this.ie = (agt.indexOf("msie") != -1) this.ie3 = (this.ie && (this.major == 2)) this.ie4 = (this.ie && (this.major == 4)) this.opera = (agt.indexOf("opera") != -1) this.nav4up = this.nav && (this.major >= 4) this.ie4up = this.ie && (this.major >= 4) } var is = new Is() // Ouvre une nouvelle fenêtre function openPopUp (theURL, winName, aheight, awidth, opt) { var hW; aleft = Math.round((screen.width-awidth)/2) atop = Math.round((screen.height-aheight)/2) var winOptions = "location=no,menubar=no,resizable=no,status=no,titlebar=no,toolbar=no,scrollbars=yes"; if (is.nav4up) winOptions += ",screenX="+aleft+",screenY="+atop+",outerHeight=" + aheight + ",outerWidth=" + awidth; if (is.ie4up) winOptions += ",left="+aleft+",top="+atop+",height=" +(aheight-28) + ",width=" + awidth; if (is.major >= 4) { hW = window.open(theURL, winName, winOptions); // hW.moveTo(aleft,atop) if (is.nav) hW.focus(); } else { location.href =(altNav3URL) } return hW; } function valide(champ,valid) { var ok = "yes"; var x; var temp; var mot; mot = ""; for (var i=0; i31) { alert("Jour incorrect"); champ.focus(); champ.select(); } } } if (mode=="mois") { if (champ.value != "" && (valide(champ," 0123456789")==true)) { if (champ.value<1 || champ.value>12) { alert("Mois incorrect"); champ.focus(); champ.select(); } } } if (mode=="annee") { if (champ.value != "" && (valide(champ," 0123456789")==true)) { if ((parseInt(champ.value)!=champ.value) || (champ.value<1900) || (champ.value>2100)) { alert("Année incorrecte"); champ.focus(); champ.select(); } } } if (mode=="entier") { if (champ.value != "" && (valide(champ," 0123456789")==true)) { if (parseInt(champ.value)!=champ.value || champ.value<0) { alert("Donnée incorrecte"); champ.focus(); champ.select(); } } } if (mode=="montant") { if (champ.value != "" && (valide(champ," 0123456789.")==true)) { if ((champ.value<0) || (champ.value.indexOf(".") != champ.value.lastIndexOf("."))) { alert("Montant incorrect"); champ.focus(); champ.select(); return false; } champ.value=formatmontant(champ.value); } } } function formatmontant(valeur) { var temp1; var temp2; var temp3; var temp4; var temp5; var formatmontant; temp1 =valeur.replace(/ /g,""); temp2=temp1.indexOf("."); if (temp2==-1) { temp3=temp1.length; } else { temp3=temp2; } temp4=temp3%3; temp5=Math.floor(temp3/3); formatmontant = temp1.substring(0,temp4); for (i=0; i29) return false if (d==29 && ((f/4)!=parseInt(f/4))) return false } return true; } function compare_date(jouri,moisi,anneei,jour,mois,annee,jourf,moisf,anneef) { if (anneef