// version : 29/02/2008 //====================== // Validation //------------ function validation(){ var x=1; // Connexion //----------- if(c0c1==0){ if (document.frm.lgt.value == "" && x==1){ x=0; document.frm.lgt.focus(); alert (txjs[0]); return false; } if (document.frm.pwt.value == "" && x==1){ x=0; document.frm.pwt.focus(); alert (txjs[1]); return false; } } // Remplissage de l'input pan //---------------------------- if(x==1){ actu_somme(); document.frm.pan.value = ""; for(i=1; i<=nbr_art; i++){ eval("if(document.frm.nbr"+i+".value>0) document.frm.pan.value += '('+array_ref["+i+"]+','+document.frm.nbr"+i+".value+')';"); } } // Formulaire OK //--------------- if(x==1){ if(c0c1==0){ if(document.frm.lgts.checked==true && document.frm.lgt.value!="") SetCookie("c0",t2c(document.frm.lgt.value),exp); else SetCookie("c0","",exp); if(document.frm.pwts.checked==true && document.frm.pwt.value!="") SetCookie("c1",t2c(document.frm.pwt.value),exp); else SetCookie("c1","",exp); } document.frm.ok.value = txjs[2]; document.frm.ok.disabled = true; document.frm.submit(); } } // Fin de chargement //------------------- function onl(){ // Login //------- var lgt = GetCookie("c0"); if(lgt!=null && lgt!=""){ SetCookie("c0",lgt,exp); if (c0c1==0){ document.frm.lgt.value = c2t(lgt); document.frm.lgts.checked = true; } } // Mot de passe //-------------- var pwt = GetCookie("c1"); if(pwt!=null && pwt!=""){ SetCookie("c1",pwt,exp); if (c0c1==0){ document.frm.pwt.value = c2t(pwt); document.frm.pwts.checked = true; } } actu_somme(); } // Plus un //--------- function plus_un(num_inp){ eval("document.frm.nbr"+num_inp+".value++;"); actu_somme(); } // Moins un //---------- function moins_un(num_inp){ eval("if(document.frm.nbr"+num_inp+".value>0) document.frm.nbr"+num_inp+".value--;"); actu_somme(); } // Supprimer un article //---------------------- function suppr_art(num_inp,id_art){ eval("document.frm.nbr"+num_inp+".value=0;"); actu_somme(); var x = "_"+GetCookie("c7"); var y = x.indexOf("("+id_art+",",0); if(y>0){ //OK } else{ y = x.indexOf("("+id_art+"m",0); } var z = x.indexOf(")",y); if(y>0 && z>y){ x = x.substring(1,y) + x.substring(z+1,x.length); SetCookie("c7",x,exp); var x = location.href; location.href = x; } } // Actualisation du total //------------------------ function actu_somme(){ document.frm.total.value = 0; for (i=1; i<=nbr_art; i++){ eval("if(document.frm.nbr"+i+".value>0){/*OK*/}else{document.frm.nbr"+i+".value = 0}; document.frm.total"+i+".value = fnv(Math.round(100*document.frm.nbr"+i+".value*array_pri["+i+"])/100,2); document.frm.total.value = fnv(Math.round(document.frm.total.value*100 + document.frm.total"+i+".value*100)/100,2);"); } }