<!-- Debut script
function carac_restants(texte,compt,carac_max)
{
carac_max += 1;
for (i = 0 ; i < document.myform.length ; i++)
{
if (document.myform.elements[i].name == texte)
{
sav_i = i;
for (j = 0 ; j < document.myform.length ; j++)
{
if (document.myform.elements[j].name == compt)
{
var result = carac_max - (document.myform.elements[i].value.length + 1);
document.myform.elements[j].value = result;
}
}
}
}
if (result <= 0)
{
str = document.myform.elements[sav_i].value;
n_str = str.substr(0,carac_max-2);
document.myform.elements[sav_i].value = n_str;
}
}
var msg_alert="";var delay1_alert=0;var delay2_alert=0;var alt_alert=0
var compt_alert=0;
function message_alert() {
var delay2=0
compt_alert++;
if (compt_alert < 6)
{
mon_span.style.display = "block";
if (alt_alert==0){
mon_span.innerText=msg_alert;
alt_alert=1;
delay2=delay1_alert;
} else {
mon_span.style.height = "10px";
mon_span.innerText ="\n ";
alt_alert=0;
delay2=delay2_alert;
}
setTimeout("message_alert()",delay2);
}
else
{
mon_span.style.display = "none";
mon_span = "";
msg_alert = "";
delay1_alert = 0;
delay2_alert = 0;
alt_alert = 0;
compt_alert=0;
}
}
function clignoter_message(thespan,texte_alert,tps1,tps2) {
mon_span = thespan;
msg_alert=texte_alert;
delay1_alert=tps1; delay2_alert=tps2;
message_alert();
}
function isDate(thechamp,valeur,thespan)
{
thedate = thechamp.value;
e = new RegExp("^[0-9]{1,2}\/[0-9]{1,2}\/([0-9]{2}|[0-9]{4})$");
if (e.test(thedate)==false)
{
valeur = ("Votre champ \""+valeur+"\" n\'est pas au bon format.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}else{
j = parseInt(thedate.split("/")[0],10);
m = parseInt(thedate.split("/")[1],10);
dta = thedate.split("/")[2];
var nb=dta.length
dta=parseInt(dta)
if(nb==4){
if (dta < 89)
{
dta+=2000;
}
else
{
dta+=1900;
}
}else{
valeur = ("Votre champ \""+valeur+"\" n\'est pas au bon format.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return(false);
}
fev=(dta%4 == 0 && dta%100 !=0 || dta%400 == 0)?29:28;
nbJours = new Array(31,fev,31,30,31,30,31,31,30,31,30,31);
if ((m >= 1 && m <=12) && (j >= 1 && j <= nbJours[m-1]))
{
return(true);
}
else
{
valeur = ("\nVotre champ \""+valeur+"\" n\'est pas au bon format.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return(false);
}
}
}
function verif_vide(thechamp,valeur,thespan)
{
var str = thechamp.value;
if (str=="" || str=="<P><FONT face=Verdana color=#000000 size=1></FONT></P>")
{
valeur=("\nVotre champ \""+valeur+"\" ne peut pas être vide.");
clignoter_message(thespan,valeur,1800,200);
if (thechamp.type != "hidden")
{
thechamp.focus();
}
return false;
}
else
{
return true;
}
}
function verif_mail(thechamp,valeur,thespan)
{
var str = thechamp.value;
if (str!="")
{
if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1)
{
valeur = ("\nVotre champ "+valeur+" necessite un \"@\" et un \".\" .");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
else
{
return true;
}
}
else
{
valeur = ("\nVotre champ "+valeur+" ne peut pas être vide.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
}
function verif_numeric(thechamp,valeur,thespan)
{
var str = thechamp.value;
if (str!="")
{
if (isNaN(str) == 1)
{
valeur = ("\nVotre champ "+valeur+" n\'est pas un nombre.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
else
{
return true;
}
}
else
{
valeur = ("\nVotre champ "+valeur+" doit ête rempli\npour faire une recherche.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
}
function verif_numeric2(thechamp,valeur)
{
var str = thechamp.value;
if (str!="")
{
if (isNaN(str) == 1)
{
alert("\nVotre champ "+valeur+" n\'est pas un nombre.");
thechamp.focus();
return false;
}
else
{
return true;
}
}
else
{
return true;
}
return true;
}
function verif_url(thechamp,valeur,thespan)
{
var str = thechamp.value;
if (str!="")
{
if (str.indexOf ('http://',0) == -1)
{
valeur=("\nVotre champ "+valeur+" nécessite http://");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
else
{
return true;
}
}
else
{
valeur = ("\nVotre champ "+valeur+" ne peut pas être vide.");
clignoter_message(thespan,valeur,1800,200);
thechamp.focus();
return false;
}
}
function bover(t) { t.className="buttonup"; }
function bout(t) { t.className="button"; }
function bcl(t) { t.className="buttondown"; }
-->
