function changeOrderBy(product_name, type, order,refinement, cat){ product_name = product_name.replace("\"",""); product_name = product_name.replace("&",""); product_name = product_name.replace("'",""); product_name = product_name.replace("*",""); product_name = product_name.replace("|",""); product_name = product_name.replace("/",""); product_name = product_name.replace("\/",""); product_name = product_name.replace("\\",""); if(order=="" && refinement=="") { if(cat==""){ window.location="/"+type+ "/1/" + product_name +".html"; }else{ window.location="/"+type+ "/1/" + cat + "/" +product_name +".html"; } }else if(order==""){ if(cat==""){ window.location="/"+type+ "/1/" + product_name +".html?reffinement="+refinement; }else{ window.location="/"+type+ "/1/" + cat + "/" +product_name +".html?reffinement="+refinement; } }else if(refinement==""){ if(cat==""){ window.location="/"+type+ "/1/" + product_name +".html?orderBy="+order; }else{ window.location="/"+type+ "/1/" + cat + "/" +product_name +".html?orderBy="+order; } }else{ if(cat==""){ window.location="/"+type+ "/1/" + product_name +".html?orderBy="+order+"&reffinement="+refinement; }else{ window.location="/"+type+ "/1/" + cat + "/" +product_name +".html?orderBy="+order+"&reffinement="+refinement; } } } function goToPage(product_name, type, page, idcat, sortKey){ product_name = product_name.replace("\"",""); product_name = product_name.replace("&",""); product_name = product_name.replace("'",""); product_name = product_name.replace("*",""); product_name = product_name.replace("|",""); product_name = product_name.replace("/",""); product_name = product_name.replace("\/",""); product_name = product_name.replace("\\",""); product_name = product_name.replace(":",""); if(idcat=="") { window.location="/"+type+"/" + page + "/" + product_name +".html?orderBy="+sortKey; }else{ window.location="/"+type+"/" + page + "/" + idcat + "/" + product_name +".html?orderBy="+sortKey; } } function favoris() { if ( navigator.appName != 'Microsoft Internet Explorer' ) { window.sidebar.addPanel("Votre Comparateur Easy-Prix.com","http://www.easy-prix.com/",""); } else{ window.external.AddFavorite("http://www.easy-prix.com/","Votre Comparateur Easy-prix.com"); } } function goToPageSimple(product_name, type, page, idcat, theme){ product_name = product_name.replace("\"",""); product_name = product_name.replace("&",""); product_name = product_name.replace("'",""); product_name = product_name.replace("*",""); product_name = product_name.replace("|",""); product_name = product_name.replace("/",""); product_name = product_name.replace("\/",""); product_name = product_name.replace("\\",""); product_name = product_name.replace(":",""); if(idcat=="") { window.location="" + theme + type+"/" + page + "/" + product_name +".html"; }else{ window.location="" + theme + type+"/" + page + "/" + idcat + "/" + product_name +".html"; } } function checkEnter(e){ var characterCode; if(e && e.which){ e = e; characterCode = e.which ; }else{ e = event; characterCode = e.keyCode ; } if(characterCode == 13){ return true; }else{ return false; } } function changeHover(elem){ //alert("fonction applé"); for(i=0; i<4; i++){ if(i==elem){ document.getElementById("icone"+i).style.borderBottom="1px solid #ffffff"; }else{ document.getElementById("icone"+i).style.borderBottom="1px solid #cccccc"; } } } function checkDate(d1,d2){ if(d1>d2) alert("La date de départ est après la date d'arivée !") } function goToPageV3(base){ var Marque; for(var i = 0; i < document.formsearch.Marque.length; i++) { if(document.formsearch.Marque[i].checked == true) { Marque = document.formsearch.Marque[i].value; } } var TypeVehicule; for(var i = 0; i < document.formsearch.TypeVehicule.length; i++) { if(document.formsearch.TypeVehicule[i].checked == true) { TypeVehicule = document.formsearch.TypeVehicule[i].value; } } var NbPorte; for(var i = 0; i < document.formsearch.NbPorte.length; i++) { if(document.formsearch.NbPorte[i].checked == true) { NbPorte = document.formsearch.NbPorte[i].value; } } var Carburant; for(var i = 0; i < document.formsearch.Carburant.length; i++) { if(document.formsearch.Carburant[i].checked == true) { Carburant = document.formsearch.Carburant[i].value; } } window.location=base + "auto/0/" + Marque +".html?filtre=_"+TypeVehicule+"_"+NbPorte+"_"+Carburant; //alert(base + "auto/0/" + Marque +".html?filtre=_"+TypeVehicule+"_"+NbPorte+"_"+Carburant); } function goToPageV2(base, Product){ var Modele = document.getElementById("Modele").value; var TypeVehicule = document.getElementById("TypeVehicule").value; var NbPorte = document.getElementById("NbPorte").value; var Carburant = document.getElementById("Carburant").value; window.location=base + "auto/0/" + Product +".html?filtre="+Modele+"_"+TypeVehicule+"_"+NbPorte+"_"+Carburant; } function showFormulaire(base, Marque, productid, Modele, title, img){ document.getElementById("FRMtitle").innerHTML = title; document.getElementById("FRMimgsite").innerHTML = ""; document.frm.action.value = base + "devisauto/" + Marque + "/" + productid + "/" + Modele + ".html"; document.getElementById("quickfrm").action = base + "devisauto/" + Marque + "/" + productid + "/" + Modele + ".html"; document.getElementById("MainQuickForm").style.display = "inline"; document.getElementById("SubMainQuickForm").style.display = "inline"; } function CloseFormulaire(){ document.getElementById("MainQuickForm").style.display = "none"; document.getElementById("SubMainQuickForm").style.display = "none"; } function goToPageAramis(base, Product, p, idProduct, name, type, filtre){ Product = Product.replace("\"",""); Product = Product.replace("&",""); Product = Product.replace("'",""); Product = Product.replace("*",""); Product = Product.replace("|",""); Product = Product.replace("/",""); Product = Product.replace("\/",""); Product = Product.replace("\\",""); window.location=base+type+"/" +p+ "/" + Product +".html?filtre="+filtre; } function isInt(x) { var y=parseInt(x); if (isNaN(y)) return false; return x==y && x.toString()==y.toString(); } function isEmail(str) { // are regular expressions supported? var supported = 0; if (window.RegExp) { var tempStr = "a"; var tempReg = new RegExp(tempStr); if (tempReg.test(tempStr)) supported = 1; } if (!supported) return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); return (!r1.test(str) && r2.test(str)); } //use a sign $(id) to get the html object function $(id) { var obj =false; obj = document.getElementById(id); if(obj) return obj; } function updateCookie(){ document.frm.nom.value = ""; } function isCodePostal(str) { var r1 = new RegExp("[0-9]{5}"); return ((r1.test(str)) && (str.length == 5)); } function isPhonNumber(str) { str = str.replace(/\./g, ""); str = str.replace(/-/g, ""); str = str.replace(/_/g, ""); str = str.replace(/\//g, ""); var r1 = new RegExp("[0-9]{10}"); return ((r1.test(str)) && (str.length == 10)); } function ObjIsMail(Obj) { var P='[\\w.-]+' return new RegExp('^('+P+')@('+ P+'[.]{1}[a-zA-Z]+)$').test(Obj.value) } function email_validator() { // checks email address var a = document.frm.email.value; testm = false; if(a != "") { for (var j=1 ; j<(a.length) ; j++) { if (a.charAt(j)=='@') { if (j<(a.length-4)) { for (var k=j ; k<(a.length-2) ; k++) { if (a.charAt(k)=='.') testm = true; } } } }//for }//if if (testm==false) { alert("Votre adresse e-mail est incorrecte, s’il vous plait."); document.frm.email.focus(); return false; }//if return true; } function jvalider(){ var ok = false; if((document.frm.nom && document.frm.nom.value == "") || document.frm.nom.value == "Votre nom" ) { alert("Veuillez renseigner votre nom."); document.frm.nom.value = ""; document.frm.nom.focus(); ok = false; }else if((document.frm.prenom && document.frm.prenom.value == "") || document.frm.prenom.value == "Votre prenom" ) { alert("Veuillez renseigner votre prenom."); document.frm.prenom.value = ""; document.frm.prenom.focus(); ok = false; }else if((document.frm.codepostal && document.frm.codepostal.value == "") || document.frm.codepostal.value == "Votre code postal" ) { alert("Veuillez renseigner votre code postal."); document.frm.codepostal.value = ""; document.frm.codepostal.focus(); ok = false; }else if(isCodePostal(document.frm.codepostal.value)==false) { alert("Veuillez renseigner un code postal à 5 chiffres."); document.frm.codepostal.focus(); ok = false; }else if((document.frm.email && document.frm.email.value == "") || document.frm.email.value == "Votre email" ) { alert("Veuillez renseigner votre adresse email."); document.frm.email.value = ""; document.frm.email.focus(); ok = false; }else if(document.frm.telephone && document.frm.telephone.value == "" || document.frm.telephone.value == "Votre telephone") { alert("Veuillez renseigner votre telephone."); document.frm.telephone.value = ""; document.frm.telephone.focus(); ok = false; }else if(isPhonNumber(document.frm.telephone.value)==false){ alert("Veuillez renseigner un telephone à 10 chiffres, exemple : 0102030405."); document.frm.telephone.focus(); ok = false; }else if(!ObjIsMail(document.frm.email)){ alert("Veuillez renseigner un email correct, exemple : email@fournisseur.com."); document.frm.email.focus(); ok = false; }else{ ok = true; } if(ok) document.frm.submit(); } function goToPageSearchAramis(base, Product, p, type){ Product = Product.replace("\"",""); Product = Product.replace("&",""); Product = Product.replace("'",""); Product = Product.replace("*",""); Product = Product.replace("|",""); Product = Product.replace("/",""); Product = Product.replace("\/",""); Product = Product.replace("\\",""); window.location=base+type+"/" +p+ "/" + Product +".html"; } function goToPageAuto(keyword){ keyword = keyword.replace("\"",""); keyword = keyword.replace("&",""); keyword = keyword.replace("'",""); keyword = keyword.replace("*",""); keyword = keyword.replace("|",""); keyword = keyword.replace("/",""); keyword = keyword.replace("\/",""); keyword = keyword.replace("\\",""); keyword = keyword.replace(":",""); window.location="/aramis.aspx?keyword=" + keyword; }