function checkContact(windows){var form=EL("formContact");var email=EL("email");var name=EL("name");var theme=EL("theme");var message=EL("message");if(name.value==""){if(windows){affichePopUpContactUs("name-mandatory-error");}else{affichePopUp("name-mandatory-error");}}else{if(email.value==""){if(windows){affichePopUpContactUs("email-mandatory-error");}else{affichePopUp("email-mandatory-error");}}else{if(!Valraiso.util.checkEmail(email.value)){if(windows){affichePopUpContactUs("email-valide");}else{affichePopUp("email-valide");}}else{if(theme.value==""){if(windows){affichePopUpContactUs("theme-mandatory-error");}else{affichePopUp("theme-mandatory-error");}}else{if(message.value==""){if(windows){affichePopUpContactUs("message-mandatory-error");}else{affichePopUp("message-mandatory-error");}}else{form.submit();}}}}}return false;}function openForm(){var div=EL("form");div.style.display="block";return false;}function setThemeValue(id){var theme=EL("theme");var themeId=EL(id);theme.value=themeId.value;}function checkRadioButton(radioId){var inputRadioId=EL(radioId);var inputRadioChecked=inputRadioId.checked;if(!inputRadioChecked){inputRadioId.checked=true;}}function affichePopUp(nom){var popup=EL(nom);var pos=getDocumentScroll();popup.style.display="block";popup.style.top=(pos.y+100)+"px";toggleCurtain();return false;}function affichePopUpContactUs(nom){var popup=EL(nom);var pos=getDocumentScroll();popup.style.display="block";popup.style.top=(pos.y+220)+"px";popup.style.left=(pos.x-150)+"px";toggleCurtain();return false;}function masquePopUp(nom){var popup=EL(nom);popup.style.display="none";return false;}function getDocumentScroll(){var scroll={};scroll.x=0;scroll.y=0;if(typeof window.pageYOffset=="number"){scroll.y=window.pageYOffset;scroll.x=window.pageXOffset;}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scroll.y=document.body.scrollTop;scroll.x=document.body.scrollLeft;}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scroll.y=document.documentElement.scrollTop;scroll.x=document.documentElement.scrollLeft;}}}return scroll;}function addWindowOnUnload(func){var windowonbeforeunload=window.onbeforeunload;window.onbeforeunload=function(){if(windowonbeforeunload!=null){windowonbeforeunload();}func();};}function trim(val){var retour="";for(var i=0;i<val.length;i++){if(val.charAt(i)!=" "){retour+=val.charAt(i);}}return retour;}function initBaseLine(){var baselineTop=EL("baselineTop");var parent=baselineTop.parentNode;var baselineBottom=EL("baselineBottom");with(baselineTop.style){position="static";top="0";}baselineBottom.innerHTML=baselineTop.innerHTML;parent.removeChild(baselineTop);return true;}function buildFlash(src,id,width,height,url){if(url!=null){AC_FL_RunContent("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0","width",width,"height",height,"src",src,"quality","high","pluginspage","http://www.adobe.com/go/getflashplayer_fr","align","middle","play","true","loop","true","scale","showall","wmode","transparent","devicefont","false","id",id,"bgcolor","#ffffff","name",id,"menu","true","allowFullScreen","false","allowScriptAccess","sameDomain","movie",src,"salign","","flashVars","url="+url);}else{AC_FL_RunContent("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0","width",width,"height",height,"src",src,"quality","high","pluginspage","http://www.adobe.com/go/getflashplayer_fr","align","middle","play","true","loop","true","scale","showall","wmode","transparent","devicefont","false","id",id,"bgcolor","#ffffff","name",id,"menu","true","allowFullScreen","false","allowScriptAccess","sameDomain","movie",src,"salign","");}}function selectDeliveryChoice(){var validerChoice=EL("validerChoice");var fitterDelivery=EL("fitterDelivery");var homeDelivery=EL("homeDelivery");var isFitterDelivery=fitterDelivery.checked;var isHomeDelivery=homeDelivery.checked;if(isFitterDelivery){validerChoice.href="/fitterDelivery";}else{if(isHomeDelivery){validerChoice.href="/homeDelivery";}else{showAlert("delivery");return false;}}return true;}function checkDeliveryChoice(radioId){var inputRadioId=EL(radioId);var inputRadioChecked=inputRadioId.checked;if(!inputRadioChecked){inputRadioId.checked=true;}}function startOpen(){var div1=EL("warning-message");div1.style.display="block";actif=window.setInterval("decreaseOpen()",1);}function decreaseOpen(){var div1=EL("warning-message");var height=div1.style.height.substring(0,div1.style.height.length-2);if(height<120){height=(height*1)+1;div1.style.height=height+"px";}else{window.clearInterval(actif);}}function startClose(){actif=window.setInterval("decreaseClose()",1);}function decreaseClose(){var div1=EL("warning-message");var height=div1.style.height.substring(0,div1.style.height.length-2);if(height>0){height=(height*1)-1;div1.style.height=height+"px";}else{div1.style.display="none";window.clearInterval(actif);}}function startDecrease(heightAsk){div1=EL("warning-message");div1.style.display="block";var speed=0.3;if(navigator.appName=="Microsoft Internet Explorer"){speed=1;}actif=window.setInterval("decrease("+heightAsk+")",speed);}function decrease(heightAsk){div1=EL("warning-message");height=div1.style.height.substring(0,div1.style.height.length-2);if(height<heightAsk){height=(height*1)+1;div1.style.height=height+"px";}else{if(height>heightAsk){height=(height*1)-1;div1.style.height=height+"px";}else{window.clearInterval(actif);if(heightAsk==0){div1.style.display="none";}}}}function isFlashPlugin(){var isFlashPlugin=navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;return isFlashPlugin;}function detectFlash(flash){if(!flash){actif=window.setInterval("displayImgCalendar()",100);}}function displayImgCalendar(){var flashCalendar=EL("flashCalendar");var imgCalendar=EL("imgCalendar");if(flashCalendar!=null&&imgCalendar!=null){flashCalendar.style.display="none";imgCalendar.style.display="block";}window.clearInterval(actif);}function showAlert(alertDiv){var div=EL(alertDiv);var pos=getDocumentScroll();div.style.display="block";div.style.top=(pos.y+100)+"px";toggleCurtain();return false;}function hideMessages(alertDiv){var div=EL(alertDiv);div.style.display="none";}function setCookie(article1,quantity1,article2,quantity2){var value=article1+"_"+quantity1;if(article2){value+=article2+"_"+quantity2;}document.cookie="basket="+escape(value)+";path=/;expires="+new Date("January 1, 3000").toGMTString();showAlert("basketSaved");}function submitLieuForm(){var form=EL("lieuForm");var postalCodeField=EL("postalCodeField");var cityField=EL("cityField");if(postalCodeField.value.length<=0&&cityField.value.length<=0){showAlert("fitterSearch");return false;}form.submit();return true;}function checkKey(e){if(curtainVisible){return;}var touche;if(window.event){touche=e.keyCode;}else{if(e.which){touche=e.which;}}if(touche==13){if(!submitLieuForm()){EL("fitterSearch").focus();}}}var sending=false;function sendMail(mode){var suffix="";var popup=EL("envoyerAmiProductSheet");if(popup!=null&&popup.style.display=="block"){suffix="-fp";}var nom=EL("nom-prenom"+suffix);var email=EL("email"+suffix);if(!sending&&check(nom.value,email.value,suffix)){var texte=EL("texteComp"+suffix);var article1=EL("article_1");var quantity1=EL("quantity_1");var article2=EL("article_2");var quantity2=EL("quantity_2");sending=true;if(mode=="proposition"){var checkedIds=getCheckedIds();sendPropositionMail(nom.value,email.value,texte.value,article1.value,quantity1.value,article2.value,quantity2.value,mode,checkedIds);}else{sendBasketAndProductSheetMail(nom.value,email.value,texte.value,article1.value,quantity1.value,article2.value,quantity2.value,mode);}}}function check(nom,email,suffix){var errorDiv=null;var errorName=EL("message-error-name"+suffix);var errorEmail=EL("message-error-email"+suffix);var errorValidEmail=EL("message-error-valid-email"+suffix);errorName.style.display="none";errorEmail.style.display="none";errorValidEmail.style.display="none";if(nom==""){errorDiv=errorName;}else{if(email==""){errorDiv=errorEmail;}else{if(!Valraiso.util.checkEmail(email)){errorDiv=errorValidEmail;}}}if(errorDiv!=null){errorDiv.style.display="block";return false;}return true;}function sendBasketAndProductSheetMail(nom,email,texte,article1,quantity1,article2,quantity2,mode){var query=Bw.IO.Query.create();var url="/SendMailAjax?article1=";url+=article1;url+="&quantity1=";url+=quantity1;url+="&article2=";url+=article2;url+="&quantity2=";url+=quantity2;url+="&nom=";url+=Url.encode(nom);url+="&email=";url+=email;url+="&mode=";url+=mode;url+="&texte=";if(texte!=null&&texte!=""){url+=Url.encode(texte);}query.setNoCache();query.get(url,function(){mailSent(query,mode);});}function sendPropositionMail(nom,email,texte,article1,quantity1,article2,quantity2,mode,checkedIds){var query=Bw.IO.Query.create();var url="/SendMailAjax?article1=";url+=article1;url+="&quantity1=";url+=quantity1;url+="&article2=";url+=article2;url+="&quantity2=";url+=quantity2;url+="&nom=";url+=Url.encode(nom);url+="&email=";url+=email;url+="&mode=";url+=mode;url+="&checkedIds=";url+=checkedIds;url+="&texte=";if(texte!=null&&texte!=""){url+=Url.encode(texte);}query.setNoCache();query.get(url,function(){mailSent(query);});}function showProductSheetPopUp(){var popup=EL("envoyerAmiProductSheet");var pos=getDocumentScroll();popup.style.display="block";popup.style.top=(pos.y+100)+"px";popup.style.left="-100px";toggleProductSheetCurtain();return false;}function masqueEnvoyerAmi(){if(!sending){var popup2=EL("envoyerAmiProductSheet");if(popup2!=null&&popup2.style.display=="block"){masquePopUp("envoyerAmiProductSheet");}else{masquePopUp("envoyerAmi");}toggleCurtain();}}function masqueEnvoyerAmiFP(){if(!sending){var popup2=EL("envoyerAmiProductSheet");if(popup2!=null&&popup2.style.display=="block"){masquePopUp("envoyerAmiProductSheet");}else{masquePopUp("envoyerAmi");}toggleProductSheetCurtain();showProductSheetSelect();}}function mailSent(query,mode){var popup;var suffix="";var texte=query.getText();var popup2=EL("envoyerAmiProductSheet");if(popup2!=null&&popup2.style.display=="block"){masquePopUp("envoyerAmiProductSheet");suffix="-fp";}else{masquePopUp("envoyerAmi");}if(texte.indexOf("error")!=-1){affichePopUp("mailError"+suffix);popup=EL("mailError"+suffix);}else{var nom=EL("nom-prenom"+suffix);var email=EL("email"+suffix);var texteComp=EL("texteComp"+suffix);nom.value="";email.value="";texteComp.value="";affichePopUp("mailEnvoye"+suffix);popup=EL("mailEnvoye"+suffix);var extraText=EL("extraText");extraText.innerHTML=texte;}sending=false;toggleCurtain();if(mode=="productSheet"){popup.style.left="-100px";}}function URLEncode(clearString){var regex=/(^[a-zA-Z0-9_.]*)/;var output="";var x=0;clearString=clearString.toString();while(x<clearString.length){var match=regex.exec(clearString.substr(x));if(match!=null&&match.length>1&&match[1]!=""){output+=match[1];x+=match[1].length;}else{if(clearString[x]==" "){output+="+";}else{var charCode=clearString.charCodeAt(x);var hexVal=charCode.toString(16);output+="%"+(hexVal.length<2?"0":"")+hexVal.toUpperCase();}x++;}}return output;}var Url={encode:function(string){return escape(this._utf8_encode(string));},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}}return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else{if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}}return string;}};function protectQuotesForTranslations(translation){translation.replace("'","'");}var productSheetCurtainVisible=false;function showProductSheetCurtain(){var curtain=document.getElementById("masqueFicheProduit");if(curtain==null){var fp=EL("fp");var fpHeight=fp.offsetHeight;var fpWidth=fp.width;if(typeof fpWidth=="undefined"){fpWidth=fp.offsetWidth;}curtain=document.createElement("div");curtain.id="masqueFicheProduit";with(curtain.style){width=fpWidth+"px";height=fpHeight+"px";display="none";backgroundColor="black";position="absolute";top=0;left=0;opacity=0.7;MozOpacity=0.7;filter="alpha(opacity=70)";zIndex=12;}fp.appendChild(curtain);}productSheetCurtainVisible=true;curtain.style.display="block";Valraiso.CSS.events.hideSelect();}function hideProductSheetCurtain(){var curtain=document.getElementById("masqueFicheProduit");if(curtain!=null){curtain.style.display="none";productSheetCurtainVisible=false;}}function toggleProductSheetCurtain(){if(productSheetCurtainVisible){hideProductSheetCurtain();}else{showProductSheetCurtain();}}function showProductSheetSelect(){var qte1=EL("_quantity1");var qte2=EL("_quantity2");qte1.style.visibility="visible";if(qte2!=null){qte2.style.visibility="visible";}}function loadFitter(url,id){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotFitter(query,id);});}function gotFitter(query,id){var sheet=query.getText();var sep0=sheet.indexOf(";");sheet=sheet.substring(sep0+1,sheet.length);var sep1=sheet.indexOf(";");var network=sheet.substring(1,sep1);sheet=sheet.substring(sep1+1,sheet.length);var sep2=sheet.indexOf(";");var name=sheet.substring(0,sep2);sheet=sheet.substring(sep2+1,sheet.length);var sep3=sheet.indexOf(";");var address1=sheet.substring(0,sep3);sheet=sheet.substring(sep3+1,sheet.length);var sep4=sheet.indexOf(";");var address2=sheet.substring(0,sep4);sheet=sheet.substring(sep4+1,sheet.length);var sep5=sheet.indexOf(";");var postalCode=sheet.substring(0,sep5);sheet=sheet.substring(sep5+1,sheet.length);var sep6=sheet.indexOf(";");var city=sheet.substring(0,sep6);sheet=sheet.substring(sep6+1,sheet.length);var reg=new RegExp(network,"gi");var test=reg.test(name);if(test){network="";}var fitterUp=EL("fitterup_"+id);var fitterDown=EL("fitterdown_"+id);fitterUp.firstChild.data=network+" "+name;fitterDown.firstChild.data=address1+address2+" "+postalCode+" "+city;}function trim(val){var retour="";for(var i=0;i<val.length;i++){if(val.charAt(i)!=" "){retour+=val.charAt(i);}}return retour;}function checkSearchFittersHome(){var itemPostalCode=EL("postalCode");var postalCode=itemPostalCode.value;var defaultText=itemPostalCode.defaultText;if(postalCode==defaultText){postalCode="";}else{postalCode=trim(postalCode);}if(postalCode!=""){EL("searchFitters").submit();}else{return;}}function checkNewCustomer(){var form=EL("newCustomerForm");var email=EL("email_new");var address=email.value;if(address==""){affichePopUp("mail-mandatory");}else{if(!Valraiso.util.checkEmail(address)){affichePopUp("mail-format-error");}else{form.submit();}}return false;}function checkCustomer(){var form=EL("loginForm");var email=EL("email_log");var password=EL("pwd_log");var address=email.value;var pass=password.value;if(address==""||pass==""){affichePopUp("password-mandatory");}else{if(!Valraiso.util.checkEmail(address)){affichePopUp("mail-format-error");}else{form.submit();}}return false;}function passwordForgotten(){var form=EL("loginForm");var mdpOublie=EL("mdpOublie");mdpOublie.value="true";form.submit();return false;}function declareFieldAsDefault(fieldName,defaultText){var field=EL(fieldName);field.defaultText=defaultText;setFieldModified(field,false);}function modifyField(field){if(field.isDeclaredAsDefault){setFieldModified(field,true);}}function isFieldModified(field){if(field.value==""){setFieldModified(field,false);
}}function setFieldModified(field,modified){var value=field.value;if(modified||(value!=""&&value!=field.defaultText)){if(modified){field.value="";field.style.color="black";}field.isDeclaredAsDefault=false;}else{field.value=field.defaultText;field.style.color="#666666";field.isDeclaredAsDefault=true;}}function duplicateAddress(){var checkbox=EL("duplicate");var address1_b=EL("address1_b");var postalcode_b=EL("postalcode_b");var city_b=EL("city_b");var address1_s=EL("address1_s");var postalcode_s=EL("postalcode_s");var city_s=EL("city_s");if(checkbox.checked){address1_s.value=address1_b.value;postalcode_s.value=postalcode_b.value;city_s.value=city_b.value;}else{address1_s.value="";postalcode_s.value="";city_s.value="";}}function checkDuplicateAddress(){var checkbox=EL("duplicate");var address1_b=EL("address1_b");var postalcode_b=EL("postalcode_b");var city_b=EL("city_b");var address1_s=EL("address1_s");var postalcode_s=EL("postalcode_s");var city_s=EL("city_s");var address1_bValue=address1_b.value;var postalcode_bValue=postalcode_b.value;var city_bValue=city_b.value;var address1_sValue=address1_s.value;var postalcode_sValue=postalcode_s.value;var city_sValue=city_s.value;if(address1_bValue==address1_sValue&&postalcode_bValue==postalcode_sValue&&city_bValue==city_sValue){checkbox.checked=true;}}function duplicateInput(element){var checkbox=EL("duplicate");if(checkbox!=null&&checkbox.checked){var element_b=EL(element);var name_b=element_b.name;var name_s=name_b.replace("_b","_s");var element_s=EL(name_s);element_s.value=element_b.value;}}function passwordForgotten(){var form=EL("loginForm");var mdpOublie=EL("mdpOublie");mdpOublie.value="true";form.submit();}function checkFormInfoPerso(){var form=EL("subscribe");var mail=EL("email_1");if(Valraiso.util.checkEmail(mail.value)){form.submit();}else{affichePopUp("error-mail");}}function checkFormSponsorship(){var form=EL("subscribe");var mail=EL("emailNewSponsored");var firstName=EL("firstNameNewSponsored");var lastName=EL("lastNameNewSponsored");if(mail.value==""||firstName.value==""||lastName.value==""){fillFieldsTitlesSponsorship();affichePopUp("info-mandatory");}else{if(!Valraiso.util.checkEmail(mail.value)){fillFieldsTitlesSponsorship();affichePopUp("error-mail-sponsorship");}else{form.submit();}}}function checkNewCustomer(){var form=EL("newCustomerForm");var email=EL("email_new");var address=email.value;if(address==""){affichePopUp("mail-mandatory");}else{if(!Valraiso.util.checkEmail(address)){affichePopUp("mail-format-error");}else{form.submit();}}return false;}function checkCustomer(){var form=EL("loginForm");var email=EL("email_log");var password=EL("pwd_log");var address=email.value;var pass=password.value;if(address==""||pass==""){affichePopUp("password-mandatory");}else{if(!Valraiso.util.checkEmail(address)){affichePopUp("mail-format-error");}else{form.submit();}}return false;}function checkKeyNewCustomer(e){if(curtainVisible){return false;}var touche;if(window.event){touche=e.keyCode;}else{if(e.which){touche=e.which;}}if(touche==13){var result=checkNewCustomer();return result;}return true;}function checkKeyCustomer(e){if(curtainVisible){return;}var touche;if(window.event){touche=e.keyCode;}else{if(e.which){touche=e.which;}}if(touche==13){checkCustomer();}}function displayChooseCinema(){var checkInfo=EL("checkInfo");var chooseInfo=EL("chooseInfo");if(checkInfo!=null&&chooseInfo!=null){checkInfo.style.display="none";chooseInfo.style.display="block";}}function selectCinema(cinema){var form=EL("winningsInfoSponsorship");var winningsInfo=EL("winningsInfo");if(form!=null&&winningsInfo!=null){winningsInfo.value=cinema;form.submit();}}function checkPassordForgotten(suffix){var form=EL("mpd-oublie-form");var mdpOublie=EL("mdpOublieValid");var errorDiv=null;var errorEmail=EL("message-error-email"+suffix);var errorValidEmail=EL("message-error-valid-email"+suffix);var email=EL("mpd-oublie-email");errorEmail.style.display="none";errorValidEmail.style.display="none";if(email==""){errorDiv=errorEmail;}else{if(!Valraiso.util.checkEmail(email.value)){errorDiv=errorValidEmail;}}if(errorDiv!=null){errorDiv.style.display="block";return false;}else{mdpOublie.value="true";form.submit();}return true;}function checkFormCustomerInit(dniMandatory){var email=EL("email_1");var pwd1=EL("pwd_1");var pwd2=EL("pwd_2");var firstName=EL("firstname");var lastName=EL("lastname");var phoneHome=EL("telhome");var phone=EL("telmobile");var addressB=EL("address1_b");var postalCodeB=EL("postalcode_b");var cityB=EL("city_b");if(dniMandatory!=null&&dniMandatory=="true"){var dniCode=EL("dniCode");}var duplicate=EL("duplicate");var addressS=EL("address1_s");var postalCodeS=EL("postalcode_s");var cityS=EL("city_s");var validationOk="/img/pictos/ok.gif";var validationError="/img/pictos/error.gif";var emailValidation=EL("email-validation");var pwd1Validation=EL("pwd1-validation");var pwd2Validation=EL("pwd2-validation");var firstNameValidation=EL("firstname-validation");var lastNameValidation=EL("lastname-validation");var phoneHomeValidation=EL("phoneHome-validation");var phoneValidation=EL("phone-validation");var addressBValidation=EL("addressB-validation");var postalCodeBValidation=EL("postalCodeB-validation");var cityBValidation=EL("cityB-validation");var addressSValidation=EL("addressS-validation");var postalCodeSValidation=EL("postalCodeS-validation");var citySValidation=EL("cityS-validation");if(dniMandatory!=null&&dniMandatory=="true"){var dniCodeValidation=EL("dniCode-validation");}if(email!=null&&emailValidation!=null){if(trim(email.value)==""){emailValidation.src=validationError;}else{if(!Valraiso.util.checkEmail(email.value)){emailValidation.src=validationError;}else{emailValidation.src=validationOk;}}}if(pwd1!=null&&pwd1Validation!=null&&pwd2!=null&&pwd2Validation!=null){if((pwd1.value!=pwd2.value)||trim(pwd1.value)==""||trim(pwd2.value)==""){pwd1Validation.src=validationError;pwd2Validation.src=validationError;}else{pwd1Validation.src=validationOk;pwd2Validation.src=validationOk;}var modifyPass=EL("modify-pass");if(modifyPass!=null){pwd1Validation.src=validationError;pwd2Validation.src=validationError;}}if(firstName!=null&&firstNameValidation!=null){if(trim(firstName.value)==""){firstNameValidation.src=validationError;}else{firstNameValidation.src=validationOk;}}if(lastName!=null&&lastNameValidation!=null){if(trim(lastName.value)==""){lastNameValidation.src=validationError;}else{lastNameValidation.src=validationOk;}}if(phoneHome!=null&&phoneHomeValidation!=null&&phone!=null&&phoneValidation!=null){if(trim(phoneHome.value)==""&&trim(phone.value)==""){phoneHomeValidation.src=validationError;phoneValidation.src=validationError;}else{phoneHomeValidation.src=validationOk;phoneValidation.src=validationOk;}}if(dniMandatory!=null&&dniMandatory=="true"){if(dniCode!=null&&dniCodeValidation!=null){if(trim(dniCode.value)==""){dniCodeValidation.src=validationError;}else{dniCodeValidation.src=validationOk;}}}if(addressB!=null&&addressBValidation!=null){if(trim(addressB.value)==""){addressBValidation.src=validationError;}else{addressBValidation.src=validationOk;}}if(postalCodeB!=null&&postalCodeBValidation!=null){if(trim(postalCodeB.value)==""||!checkPostalCode(postalCodeB.value)){postalCodeBValidation.src=validationError;}else{postalCodeBValidation.src=validationOk;}}if(cityB!=null&&cityBValidation!=null){if(trim(cityB.value)==""){cityBValidation.src=validationError;}else{cityBValidation.src=validationOk;}}if(addressS!=null&&addressSValidation!=null){if(trim(addressS.value)==""){addressSValidation.src=validationError;}else{addressSValidation.src=validationOk;}}if(postalCodeS!=null&&postalCodeSValidation!=null){if(trim(postalCodeS.value)==""||!checkPostalCode(postalCodeS.value)){postalCodeSValidation.src=validationError;}else{postalCodeSValidation.src=validationOk;}}if(cityS!=null&&citySValidation!=null){if(trim(cityS.value)==""){citySValidation.src=validationError;}else{citySValidation.src=validationOk;}}}function checkField(field,errorField,txtErrorField,labelField){var itemField=EL(field);var itemErrorField=EL(errorField);var itemTxtErrorField=EL(txtErrorField);var itemLabelField=EL(labelField);var validationOk="/img/pictos/ok.gif";var validationError="/img/pictos/error.gif";var duplicate=EL("duplicate");if(itemField!=null&&itemErrorField!=null&&itemTxtErrorField!=null){var fieldValue=itemField.value;if(field=="telhome"||field=="telmobile"){var phoneHome=EL("telhome");var phone=EL("telmobile");var phoneValidation=EL("phone-validation");var phoneHomeValidation=EL("phoneHome-validation");var phoneError=EL("phone-error");var badTelFormat=EL("bad-tel-format");var phoneHomeLabel=EL("label-telhome");var phoneLabel=EL("label-telmobile");if(trim(phoneHome.value)==""&&trim(phone.value)==""){phoneHomeValidation.src=validationError;phoneValidation.src=validationError;phoneHome.style.borderColor="red";phone.style.borderColor="red";phoneError.style.display="block";badTelFormat.style.display="none";phoneHomeLabel.style.color="red";phoneLabel.style.color="red";}else{if(phoneHome.value.length>0||phone.value.length>0){var error=false;if(phoneHome.value.length>0){var phoneHomeValue=phoneHome.value;phoneHomeValue=phoneHomeValue.replace("-"," ");phoneHomeValue=phoneHomeValue.replace("."," ");phoneHomeValue=phoneHomeValue.replace(","," ");phoneHomeValue=phoneHomeValue.replace(";"," ");for(var i=0;i<phoneHomeValue.length;i++){var carCodePhoneHome=phoneHomeValue.charCodeAt(i);if(!((carCodePhoneHome>46&&carCodePhoneHome<58)||carCodePhoneHome==43||(carCodePhoneHome>39&&carCodePhoneHome<42)||carCodePhoneHome==47||carCodePhoneHome==32)){error=true;}}if(error){phoneHomeValidation.src=validationError;phoneHome.style.borderColor="red";phoneHomeLabel.style.color="red";}else{phoneHomeValidation.src=validationOk;phoneHome.style.borderColor="#BBBBBB";phoneHomeLabel.style.color="black";}}else{if(phone.value.length>0){phoneHomeValidation.src=validationOk;phoneHome.style.borderColor="#BBBBBB";phoneHomeLabel.style.color="black";}}if(phone.value.length>0){var phoneValue=phone.value;phoneValue=phoneValue.replace("-"," ");phoneValue=phoneValue.replace("."," ");phoneValue=phoneValue.replace(","," ");phoneValue=phoneValue.replace(";"," ");for(var i=0;i<phoneValue.length;i++){var carCodePhone=phoneValue.charCodeAt(i);if(!((carCodePhone>46&&carCodePhone<58)||carCodePhone==43||(carCodePhone>39&&carCodePhone<42)||carCodePhone==47||carCodePhone==32)){error=true;}}if(error){phoneValidation.src=validationError;phone.style.borderColor="red";phoneLabel.style.color="red";}else{phoneValidation.src=validationOk;phone.style.borderColor="#BBBBBB";phoneLabel.style.color="black";}}else{if(phoneHome.value.length>0){phoneValidation.src=validationOk;phone.style.borderColor="#BBBBBB";phoneLabel.style.color="black";}}if(error){phoneError.style.display="none";badTelFormat.style.display="block";}else{phoneError.style.display="none";badTelFormat.style.display="none";}}}}else{if(field=="pwd_1"||field=="pwd_2"){var pwd1=EL("pwd_1");var pwd2=EL("pwd_2");var pwd1Validation=EL("pwd1-validation");var pwd2Validation=EL("pwd2-validation");var pwdError=EL("pwd2-error");var pwdNotEquals=EL("pwd-not-equals");var pwdLessThanSix=EL("pwd-less-than-six");var pwd1Label=EL("label-pwd1");var pwd2Label=EL("label-pwd2");if(pwd1.value.length<6){pwd1Validation.src=validationError;pwd2Validation.src=validationError;pwd1.style.borderColor="red";pwd2.style.borderColor="red";pwdNotEquals.style.display="none";pwdError.style.display="none";pwdLessThanSix.style.display="block";pwd1Label.style.color="red";pwd2Label.style.color="red";}else{if(trim(pwd2.value)==""){pwd1Validation.src=validationOk;pwd2Validation.src=validationError;pwd1.style.borderColor="#BBBBBB";pwd2.style.borderColor="red";pwdNotEquals.style.display="none";pwdError.style.display="block";pwdLessThanSix.style.display="none";pwd1Label.style.color="black";pwd2Label.style.color="red";}else{if(pwd1.value!=pwd2.value){pwd1Validation.src=validationError;pwd2Validation.src=validationError;pwd1.style.borderColor="red";pwd2.style.borderColor="red";pwdNotEquals.style.display="block";pwdError.style.display="none";pwdLessThanSix.style.display="none";pwd1Label.style.color="red";pwd2Label.style.color="red";}else{pwd1Validation.src=validationOk;pwd2Validation.src=validationOk;pwd1.style.borderColor="#BBBBBB";pwd2.style.borderColor="#BBBBBB";pwdNotEquals.style.display="none";pwdError.style.display="none";pwdLessThanSix.style.display="none";pwd1Label.style.color="black";pwd2Label.style.color="black";}}}}else{if(trim(fieldValue)==""){itemErrorField.src=validationError;itemTxtErrorField.style.display="block";itemField.style.borderColor="red";itemLabelField.style.color="red";if(field=="postalcode_b"){var itemTxtErrorFieldCode=EL("postalCodeB-error-code");itemTxtErrorFieldCode.style.display="none";}else{if(field=="postalcode_s"){itemTxtErrorFieldCode=EL("postalCodeS-error-code");itemTxtErrorFieldCode.style.display="none";}}if(duplicate!=null){var duplicateChecked=duplicate.checked;if(duplicateChecked){if(field=="address1_b"){var itemAddressS=EL("address1_s");var labelAddressS=EL("label-addressS");var errorAddressS=EL("addressS-validation");var txtErrorAddressS=EL("addressS-error");errorAddressS.src=validationError;txtErrorAddressS.style.display="block";itemAddressS.style.borderColor="red";labelAddressS.style.color="red";}else{if(field=="postalcode_b"){var itemPostalCodeS=EL("postalcode_s");var labelPostalCodeS=EL("label-postalCodeS");var errorPostalCodeS=EL("postalCodeS-validation");var txtErrorPostalCodeS=EL("postalCodeS-error");var txtErrorPostalCodeSBis=EL("postalCodeS-error-code");errorPostalCodeS.src=validationError;txtErrorPostalCodeS.style.display="block";txtErrorPostalCodeSBis.style.display="none";itemPostalCodeS.style.borderColor="red";labelPostalCodeS.style.color="red";}else{if(field=="city_b"){var itemCityS=EL("city_s");var labelCityS=EL("label-cityS");var errorCityS=EL("cityS-validation");var txtErrorCityS=EL("cityS-error");errorCityS.src=validationError;txtErrorCityS.style.display="block";itemCityS.style.borderColor="red";labelCityS.style.color="red";}}}}}}else{if(field=="email_1"){if(!Valraiso.util.checkEmail(fieldValue)){itemErrorField.src=validationError;itemTxtErrorField.style.display="block";itemField.style.borderColor="red";itemLabelField.style.color="red";}else{itemErrorField.src=validationOk;itemTxtErrorField.style.display="none";itemField.style.borderColor="#BBBBBB";itemLabelField.style.color="black";}}else{if(field=="postalcode_b"){var validPostalCode=checkPostalCode(fieldValue);itemTxtErrorFieldCode=EL("postalCodeB-error-code");if(!validPostalCode){itemErrorField.src=validationError;itemTxtErrorFieldCode.style.display="block";itemTxtErrorField.style.display="none";itemField.style.borderColor="red";itemLabelField.style.color="red";if(duplicate!=null){duplicateChecked=duplicate.checked;if(duplicateChecked){txtErrorPostalCodeSBis=EL("postalCodeS-error-code");txtErrorPostalCodeS=EL("postalCodeS-error");itemPostalCodeS=EL("postalcode_s");labelPostalCodeS=EL("label-postalCodeS");errorPostalCodeS=EL("postalCodeS-validation");errorPostalCodeS.src=validationError;txtErrorPostalCodeSBis.style.display="block";txtErrorPostalCodeS.style.display="none";itemPostalCodeS.style.borderColor="red";labelPostalCodeS.style.color="red";}}}else{itemErrorField.src=validationOk;itemTxtErrorFieldCode.style.display="none";itemTxtErrorField.style.display="none";itemField.style.borderColor="#BBBBBB";itemLabelField.style.color="black";if(duplicate!=null){duplicateChecked=duplicate.checked;if(duplicateChecked){txtErrorPostalCodeSBis=EL("postalCodeS-error-code");txtErrorPostalCodeS=EL("postalCodeS-error");itemPostalCodeS=EL("postalcode_s");labelPostalCodeS=EL("label-postalCodeS");errorPostalCodeS=EL("postalCodeS-validation");errorPostalCodeS.src=validationOk;txtErrorPostalCodeSBis.style.display="none";txtErrorPostalCodeS.style.display="none";itemPostalCodeS.style.borderColor="#BBBBBB";labelPostalCodeS.style.color="black";}}}}else{if(field=="postalcode_s"){validPostalCode=checkPostalCode(fieldValue);
itemTxtErrorFieldCode=EL("postalCodeS-error-code");if(!validPostalCode){itemErrorField.src=validationError;itemTxtErrorFieldCode.style.display="block";itemTxtErrorField.style.display="none";itemField.style.borderColor="red";itemLabelField.style.color="red";}else{itemErrorField.src=validationOk;itemTxtErrorFieldCode.style.display="none";itemTxtErrorField.style.display="none";itemField.style.borderColor="#BBBBBB";itemLabelField.style.color="black";}}else{itemErrorField.src=validationOk;itemTxtErrorField.style.display="none";itemField.style.borderColor="#BBBBBB";itemLabelField.style.color="black";if(duplicate!=null){duplicateChecked=duplicate.checked;if(duplicateChecked){if(field=="address1_b"){itemAddressS=EL("address1_s");labelAddressS=EL("label-addressS");errorAddressS=EL("addressS-validation");txtErrorAddressS=EL("addressS-error");errorAddressS.src=validationOk;txtErrorAddressS.style.display="none";itemAddressS.style.borderColor="#BBBBBB";labelAddressS.style.color="black";}else{if(field=="postalcode_b"){itemPostalCodeS=EL("postalcode_s");labelPostalCodeS=EL("label-postalCodeS");errorPostalCodeS=EL("postalCodeS-validation");txtErrorPostalCodeS=EL("postalCodeS-error");errorPostalCodeS.src=validationOk;txtErrorPostalCodeS.style.display="none";itemPostalCodeS.style.borderColor="#BBBBBB";labelPostalCodeS.style.color="black";}else{if(field=="city_b"){itemCityS=EL("city_s");labelCityS=EL("label-cityS");errorCityS=EL("cityS-validation");txtErrorCityS=EL("cityS-error");errorCityS.src=validationOk;txtErrorCityS.style.display="none";itemCityS.style.borderColor="#BBBBBB";labelCityS.style.color="black";}}}}}}}}}}}}}function checkHomeDeliveryAddress(){var itemAddressS=EL("address1_s");var labelAddressS=EL("label-addressS");var errorAddressS=EL("addressS-validation");var txtErrorAddressS=EL("addressS-error");var itemPostalCodeS=EL("postalcode_s");var labelPostalCodeS=EL("label-postalCodeS");var errorPostalCodeS=EL("postalCodeS-validation");var txtErrorPostalCodeS=EL("postalCodeS-error");var txtErrorPostalCodeBis=EL("postalCodeS-error-code");var itemCityS=EL("city_s");var labelCityS=EL("label-cityS");var errorCityS=EL("cityS-validation");var txtErrorCityS=EL("cityS-error");var validationOk="/img/pictos/ok.gif";var validationError="/img/pictos/error.gif";if(trim(itemAddressS.value)==""){errorAddressS.src=validationError;txtErrorAddressS.style.display="block";itemAddressS.style.borderColor="red";labelAddressS.style.color="red";}else{errorAddressS.src=validationOk;txtErrorAddressS.style.display="none";itemAddressS.style.borderColor="#BBBBBB";labelAddressS.style.color="black";}if(trim(itemPostalCodeS.value)==""){errorPostalCodeS.src=validationError;txtErrorPostalCodeS.style.display="block";txtErrorPostalCodeBis.style.display="none";itemPostalCodeS.style.borderColor="red";labelPostalCodeS.style.color="red";}else{if(!checkPostalCode(itemPostalCodeS.value)){errorPostalCodeS.src=validationError;txtErrorPostalCodeS.style.display="none";txtErrorPostalCodeBis.style.display="block";itemPostalCodeS.style.borderColor="red";labelPostalCodeS.style.color="red";}else{errorPostalCodeS.src=validationOk;txtErrorPostalCodeS.style.display="none";itemPostalCodeS.style.borderColor="#BBBBBB";labelPostalCodeS.style.color="black";}}if(trim(itemCityS.value)==""){errorCityS.src=validationError;txtErrorCityS.style.display="block";itemCityS.style.borderColor="red";labelCityS.style.color="red";}else{errorCityS.src=validationOk;txtErrorCityS.style.display="none";itemCityS.style.borderColor="#BBBBBB";labelCityS.style.color="black";}}function checkFormCustomer(dniMandatory){var form=EL("subscribe");var email=EL("email_1");var pwd1=EL("pwd_1");var pwd2=EL("pwd_2");var firstName=EL("firstname");var lastName=EL("lastname");var phoneHome=EL("telhome");var phone=EL("telmobile");var addressB=EL("address1_b");var postalCodeB=EL("postalcode_b");var cityB=EL("city_b");if(dniMandatory!=null&&dniMandatory=="true"){var dniCode=EL("dniCode");}var addressS=EL("address1_s");var postalCodeS=EL("postalcode_s");var cityS=EL("city_s");var error=false;var textErrorIdent="";var textErrorFactu="";var textErrorLivr="";var emailLabel=EL("label-email");var pwd1Label=EL("label-pwd1");var pwd2Label=EL("label-pwd2");var firstNameLabel=EL("label-firstname");var lastNameLabel=EL("label-lastname");var phoneHomeLabel=EL("label-telhome");var phoneLabel=EL("label-telmobile");var addressBLabel=EL("label-addressB");var postalCodeBLabel=EL("label-postalCodeB");var cityBLabel=EL("label-cityB");if(dniMandatory!=null&&dniMandatory=="true"){var dniCodeLabel=EL("label-dniCode");}var textError="\n";var addressSLabel=EL("label-addressS");var postalCodeSLabel=EL("label-postalCodeS");var citySLabel=EL("label-cityS");if(email!=null){if(trim(email.value)==""){error=true;textError+="<p>- "+emailLabel.firstChild.data+"</p>";}else{if(!Valraiso.util.checkEmail(email.value)){error=true;textError+="<p>- "+emailLabel.firstChild.data+"</p>";}}}if(pwd1!=null!=null&&pwd2!=null){if((pwd1.value!=pwd2.value)||trim(pwd1.value)==""||trim(pwd2.value)==""){error=true;textError+="<p>- "+pwd1Label.firstChild.data+"</p>";textError+="<p>- "+pwd2Label.firstChild.data+"</p>";}}if(firstName!=null){if(trim(firstName.value)==""){error=true;textError+="<p>- "+firstNameLabel.firstChild.data+"</p>";}}if(lastName!=null){if(trim(lastName.value)==""){error=true;textError+="<p>- "+lastNameLabel.firstChild.data+"</p>";}}if(phoneHome!=null&&phone!=null){if(trim(phoneHome.value)==""&&trim(phone.value)==""){error=true;textError+="<p>- "+phoneHomeLabel.firstChild.data+"</p>";textError+="<p>- "+phoneLabel.firstChild.data+"</p>";}if(phoneHome.value.length>0||phone.value.length>0){if(phoneHome.value.length>0){var phoneHomeValue=phoneHome.value;var errorPhoneHone=false;phoneHomeValue=phoneHomeValue.replace("-"," ");phoneHomeValue=phoneHomeValue.replace("."," ");phoneHomeValue=phoneHomeValue.replace(","," ");phoneHomeValue=phoneHomeValue.replace(";"," ");for(var i=0;i<phoneHomeValue.length;i++){var carCodePhoneHome=phoneHomeValue.charCodeAt(i);if(!((carCodePhoneHome>46&&carCodePhoneHome<58)||carCodePhoneHome==43||(carCodePhoneHome>39&&carCodePhoneHome<42)||carCodePhoneHome==47||carCodePhoneHome==32)){errorPhoneHone=true;}}if(errorPhoneHone){error=true;textError+="<p>- "+phoneHomeLabel.firstChild.data+"</p>";}}if(phone.value.length>0){var phoneValue=phone.value;var errorPhone=false;phoneValue=phoneValue.replace("-"," ");phoneValue=phoneValue.replace("."," ");phoneValue=phoneValue.replace(","," ");phoneValue=phoneValue.replace(";"," ");for(var i=0;i<phoneValue.length;i++){var carCodePhone=phoneValue.charCodeAt(i);if(!((carCodePhone>46&&carCodePhone<58)||carCodePhone==43||(carCodePhone>39&&carCodePhone<42)||carCodePhone==47||carCodePhone==32)){errorPhone=true;}}if(errorPhone){error=true;textError+="<p>- "+phoneLabel.firstChild.data+"</p>";}}}}if(dniMandatory!=null&&dniMandatory=="true"){if(dniCode!=null){if(trim(dniCode.value)==""){error=true;textError+="<p>- "+dniCodeLabel.firstChild.data+"</p>";}}}if(addressB!=null){if(trim(addressB.value)==""){error=true;textErrorFactu+='<p style="margin-left:50px;">- '+addressBLabel.firstChild.data+"</p>";}}if(postalCodeB!=null){if(trim(postalCodeB.value)==""||!checkPostalCode(postalCodeB.value)){error=true;textErrorFactu+='<p style="margin-left:50px;">- '+postalCodeBLabel.firstChild.data+"</p>";}}if(cityB!=null){if(trim(cityB.value)==""){error=true;textErrorFactu+='<p style="margin-left:50px;">- '+cityBLabel.firstChild.data+"</p>";}}if(addressS!=null){if(trim(addressS.value)==""){error=true;textErrorLivr+='<p style="margin-left:50px;">- '+addressSLabel.firstChild.data+"</p>";}}if(postalCodeS!=null){if(trim(postalCodeS.value)==""||!checkPostalCode(postalCodeS.value)){error=true;textErrorLivr+='<p style="margin-left:50px;">- '+postalCodeSLabel.firstChild.data+"</p>";}}if(cityS!=null){if(trim(cityS.value)==""){error=true;textErrorLivr+='<p style="margin-left:50px;">- '+citySLabel.firstChild.data+"</p>";}}if(!error){var cgv=EL("cgv");if(cgv!=null){if(cgv.checked){form.submit();}else{var cgvValidationImg=EL("cgv-validation-img");var cgvValidationText=EL("cgv-validation-text");if(cgvValidationImg!=null){cgvValidationImg.style.display="block";}if(cgvValidationText!=null){cgvValidationText.style.display="block";}}}else{form.submit();}}else{if(textErrorFactu!=""){var addressFactu=EL("adresse-factu");var addressFactuItem=addressFactu.childNodes[1].firstChild;if(addressFactuItem==null){addressFactuItem=addressFactu.childNodes[0].firstChild;}textError+='<p></p><p style="margin-top:10px;">&nbsp;&nbsp;'+addressFactuItem.data+"</p>";textError+=textErrorFactu;}if(textErrorLivr!=""){var addressLivr=EL("addresse-livr");var addressLivrItem=addressLivr.childNodes[1].firstChild;if(addressLivrItem==null){addressLivrItem=addressLivr.childNodes[0].firstChild;}textError+='<p></p><p style="margin-top:10px;">&nbsp;&nbsp;'+addressLivrItem.data+"</p>";textError+=textErrorLivr;}var identificationErrorText=EL("identificationErrorText");identificationErrorText.innerHTML=textError;affichePopUp("info-error");}}function checkDeleteSponsored(sponsoredId){var sponsoredForm=EL("sponsoredForm");var sponsoredFormMode=EL("sponsoredFormMode");var sponsoredChoose=EL("sponsoredChoose");sponsoredFormMode.value="deleteSponsorship";sponsoredChoose.value=sponsoredId;sponsoredForm.submit();}function checkReviveSponsored(sponsoredId){var sponsoredForm=EL("sponsoredForm");var sponsoredFormMode=EL("sponsoredFormMode");var sponsoredChoose=EL("sponsoredChoose");sponsoredFormMode.value="reviveSponsorship";sponsoredChoose.value=sponsoredId;sponsoredForm.submit();}function checkedCgv(){var cgv=EL("cgv");if(cgv!=null){if(cgv.checked){var cgvValidationImg=EL("cgv-validation-img");var cgvValidationText=EL("cgv-validation-text");if(cgvValidationImg!=null){cgvValidationImg.style.display="none";}if(cgvValidationText!=null){cgvValidationText.style.display="none";}}}}function trim(val){var retour="";for(var i=0;i<val.length;i++){if(val.charAt(i)!=" "){retour+=val.charAt(i);}}return retour;}function checkPostalCode(strPostalCode){var postalCode=trim(strPostalCode);var notNumeric=isNaN(postalCode);if(!notNumeric){var postalCodeLength=postalCode.length;if(postalCodeLength==5||postalCodeLength==4){return true;}}return false;}var slideDelay=6000;var slideImageList=[];var slideFirstImage=[];var slideTimer=null;var slideGlobalId=0;var tmpUrl="http://www.popgom.fr";function preloadImages(imagesPath,imgList,parentNode){slideImageList[parentNode]=[];for(var i=0;i<imgList.length;i++){var img=new Image();if(typeof imagesPath!="undefined"&&imgList[i].indexOf(imagesPath)!=0){imgList[i]=imagesPath+imgList[i];}img.src=imgList[i];slideImageList[parentNode].push(img);}}function removeImages(parentNode){parentNode=EL(parentNode);while(parentNode.firstChild!=null){parentNode.removeChild(parentNode.firstChild);}}function renderImages(imagesPath,imgList,parentNode,noRandom){preloadImages(imagesPath,imgList,parentNode);if(noRandom){slideFirstImage[parentNode]=0;}else{slideFirstImage[parentNode]=Math.round(Math.random()*(imgList.length-1));}for(var i=0;i<imgList.length;i++){renderImage(imgList[i],parentNode,parentNode+"slideimage"+i,(slideFirstImage[parentNode]!=i));}}function renderImage(img,parentNode,id,hidden){parentNode=document.getElementById(parentNode);var d=document.createElement("div");d.id=id;d.style.position="absolute";var im=document.createElement("img");im.src=img;with(im.style){width=parentNode.style.width;height=parentNode.style.height;}d.appendChild(im);if(hidden){Valraiso.util.changeOpacity(d,0);}parentNode.appendChild(d);}function renderImagesWithUrl(imagesPath,imgList,imgUrls,parentNode,noRandom,urlTargets,altImages){preloadImages(imagesPath,imgList,parentNode);if(noRandom){slideFirstImage[parentNode]=0;}else{slideFirstImage[parentNode]=Math.round(Math.random()*(imgList.length-1));}for(var i=0;i<imgList.length;i++){renderImageWithUrl(imgList[i],imgUrls[i],parentNode,parentNode+"slideimage"+i,(slideFirstImage[parentNode]!=i),urlTargets[i],altImages[i]);}}function renderImageWithUrl(img,url,parentNode,id,hidden,urlTarget,altImage){parentNode=document.getElementById(parentNode);var d=document.createElement("div");d.id=id;d.style.zIndex="1";d.style.position="absolute";d.style.opacity="1";var a=document.createElement("a");a.href=url;a.style.color="white";if(urlTarget){if(navigator.appVersion.indexOf("MSIE 6")==-1&&navigator.appVersion.indexOf("MSIE 7")==-1){a.setAttribute("onclick","openNavigatorIframe('"+url+"','popgom','890','500', 'menubar=no,  status=no, scrollbars=yes, location=no');return false;");}else{a.target="_blank";}}var im=document.createElement("img");im.src=img;im.style.borderColor="transparent";im.alt=altImage;with(im.style){width=parentNode.style.width;height=parentNode.style.height;}a.appendChild(im);d.appendChild(a);if(hidden){Valraiso.util.changeOpacity(d,0);}parentNode.appendChild(d);}function slideImages(imgList,parentNode,delay,fromIdx,slideId){if(slideId<slideGlobalId){return;}if(imgList.length<2){return;}if(typeof parentNode=="string"){parentNode=document.getElementById(parentNode);}if(delay==null){delay=slideDelay;}if(fromIdx==null){fromIdx=slideFirstImage[parentNode.id];}var nextIdx=fromIdx+1;if(nextIdx>imgList.length-1){nextIdx=0;}if(slideImageList[parentNode.id]==null||!slideImageList[parentNode.id][nextIdx].complete){setTimeout(function(){slideImages(imgList,parentNode,delay,fromIdx,slideId);},200);return;}Valraiso.util.fading(parentNode.id+"slideimage"+fromIdx,100,0,1000);Valraiso.util.fading(parentNode.id+"slideimage"+nextIdx,0,100,1000);if(slideTimer!=null){clearTimeout(slideTimer);}slideTimer=setTimeout(function(){slideImages(imgList,parentNode,delay,nextIdx,slideId);},delay+1500);}function slideToPreviousImages(imgList,parentNode,delay,fromIdx,slideId){if(slideId<slideGlobalId){return;}if(imgList.length<2){return;}if(typeof parentNode=="string"){parentNode=document.getElementById(parentNode);}if(delay==null){delay=slideDelay;}if(fromIdx==null){fromIdx=slideFirstImage[parentNode.id];}var nextIdx=fromIdx-1;if(nextIdx<0){nextIdx=imgList.length-1;}if(slideImageList[parentNode.id]==null||!slideImageList[parentNode.id][nextIdx].complete){setTimeout(function(){slideImages(imgList,parentNode,delay,fromIdx,slideId);},200);return;}Valraiso.util.fading(parentNode.id+"slideimage"+fromIdx,100,0,1000);Valraiso.util.fading(parentNode.id+"slideimage"+nextIdx,0,100,1000);if(slideTimer!=null){clearTimeout(slideTimer);}slideTimer=setTimeout(function(){slideImages(imgList,parentNode,delay,nextIdx,slideId);},delay+1500);}function previousHighlight(imgList,delay){parentNode=document.getElementById("highlightCampaigns");var currentIndex=0;for(var i=0;i<imgList.length;i++){child=document.getElementById("highlightCampaignsslideimage"+i);if(child.style.opacity>=0.5){currentIndex=i;}}slideToPreviousImages(imgList,parentNode,delay,currentIndex,"highlightCampaignsslideimage"+currentIndex);}function nextHighlight(imgList,delay){parentNode=document.getElementById("highlightCampaigns");var currentIndex=0;for(var i=0;i<imgList.length;i++){child=document.getElementById("highlightCampaignsslideimage"+i);if(child.style.opacity>=0.5){currentIndex=i;}}slideImages(imgList,parentNode,delay,currentIndex,"highlightCampaignsslideimage"+currentIndex);}function checkMail(mailId,errorId,formId){var form=EL(formId);var mail=EL(mailId);var error=EL(errorId);if(mail!=null&&form!=null){var mailValue=mail.value;if(Valraiso.util.checkEmail(mailValue)){if(error!=null){error.style.display="none";}form.submit();}else{if(error!=null){error.style.display="block";}}}}function navigate(id){var bpNavLeft=EL("bp-nav-left");var imgBpNavLeft="";var colorBpNavLeft="";var bpNavMiddle=EL("bp-nav-middle");var imgBpNavMiddle="";var colorBpNavMiddle="";var bpNavRight=EL("bp-nav-right");var imgBpNavRight="";var colorBpNavRight="";var imgContent=EL("img-content");var imgContentSrc="";if(id=="bp-nav-left"){imgContentSrc="pneu.jpg";imgBpNavLeft="onglet-actif.jpg";imgBpNavMiddle="onglet-inactif.jpg";imgBpNavRight="onglet-inactif.jpg";
colorBpNavLeft="white";colorBpNavMiddle="#555555";colorBpNavRight="#555555";}else{if(id=="bp-nav-middle"){imgContentSrc="new-carte-grise.jpg";imgBpNavLeft="onglet-inactif.jpg";imgBpNavMiddle="onglet-actif.jpg";imgBpNavRight="onglet-inactif.jpg";colorBpNavLeft="#555555";colorBpNavMiddle="white";colorBpNavRight="#555555";}else{if(id=="bp-nav-right"){imgContentSrc="old-carte-grise.jpg";imgBpNavLeft="onglet-inactif.jpg";imgBpNavMiddle="onglet-inactif.jpg";imgBpNavRight="onglet-actif.jpg";colorBpNavLeft="#555555";colorBpNavMiddle="#555555";colorBpNavRight="white";}}}if(imgContentSrc!=""){bpNavLeft.style.background="transparent url('/img/lireDimension/de_DE/"+imgBpNavLeft+"') no-repeat left top";bpNavMiddle.style.background="transparent url('/img/lireDimension/de_DE/"+imgBpNavMiddle+"') no-repeat left top";bpNavRight.style.background="transparent url('/img/lireDimension/de_DE/"+imgBpNavRight+"') no-repeat left top";bpNavLeft.style.color=colorBpNavLeft;bpNavMiddle.style.color=colorBpNavMiddle;bpNavRight.style.color=colorBpNavRight;imgContent.src="/img/lireDimension/de_DE/"+imgContentSrc;}}function displayNewsLetter(){var newsLetter=EL("newsLetter");var imgNewsLetter=EL("img-newsLetter");if(newsLetter!=null&&imgNewsLetter!=null){var displayNewsLetter=newsLetter.style.display;if(displayNewsLetter=="none"){loadNewsLetter("/newsletter","newsLetter");newsLetter.style.display="block";imgNewsLetter.src="/img/header/newsletter-opened.gif";}else{newsLetter.style.display="none";imgNewsLetter.src="/img/header/newsletter-close.gif";}}return false;}function validateNewsLetter(){var emailNewsLetter=EL("emailnewsLetter");var partners=EL("partners");var url="/newsletter?from=popup&email="+emailNewsLetter.value;if(partners!=null){if(partners.checked){url+="&partners=checked";}}loadProspect(url,false,"popupNewsLetter","contenunewsLetter");}function reloadNewsLetter(){loadNewsLetter("/newsletter","newsLetter");}function loadNewsLetter(url,idDiv){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotNewsLetter(query,idDiv);});}function gotNewsLetter(query,idDiv){var sheet=query.getText();var div=EL(idDiv);div.innerHTML=sheet;}function displayPromesseHeader(locale){var promesseHeader=EL("promesseheader");var newsLetter=EL("newsLetter");if(locale=="fr_FR"){newsLetter.style.marginLeft="168px";}else{if(locale=="es_ES"){newsLetter.style.marginLeft="155px";}else{if(locale=="de_DE"){newsLetter.style.marginLeft="265px";}else{if(locale=="de_CH"){newsLetter.style.marginLeft="210px";}else{if(locale=="fr_CH"){newsLetter.style.marginLeft="168px";}else{if(locale=="de_AT"){newsLetter.style.marginLeft="210px";newsLetter.style.width="200px";}}}}}}var displayStyle=promesseHeader.style.display;if(displayStyle=="none"){promesseHeader.style.display="";}else{promesseHeader.style.display="none";}}function checkKeyNewletter(e){if(curtainVisible){return false;}var touche;if(window.event){touche=e.keyCode;}else{if(e.which){touche=e.which;}}if(touche==13){var result=checkNewsLetter();return result;}return true;}function checkNewsLetter(trad){var newsLetter=EL("newsLetter");var emailNewsLetter=EL("email-newsLetter");if(emailNewsLetter.value==""||!Valraiso.util.checkEmail(emailNewsLetter.value)){affichePopUp("newsletter-error");}else{var form=EL("encartNewsletterForm");form.submit();}return false;}function gotMultiPopupCarModelNewsletter(query,type){var pop=query.getText();var selectBeginPosition=pop.indexOf("<select");var selectEndPosition=pop.indexOf("</select>");while(selectBeginPosition!=-1&&selectEndPosition!=-1){if(selectBeginPosition!=-1&&selectEndPosition!=-1){var selectContent=pop.substring(selectBeginPosition,selectEndPosition+9);pop=pop.substring(selectEndPosition+9,pop.length-1);var idBeginPosition=selectContent.indexOf("id=");var idEndPosition=selectContent.indexOf("onchange=");type=selectContent.substring(idBeginPosition+4,idEndPosition-7);var div=EL(type+"Newsletter");if(div!=null){div.innerHTML=selectContent;}selectBeginPosition=pop.indexOf("<select");selectEndPosition=pop.indexOf("</select>");}}}function loadCarMakerNewsletter(){var url="/carModelAjax?newsletter=nef";var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotMultiPopupCarModelNewsletter(query,"");});}function loadCarModelNewsletter(){var carMaker=EL("carMakerField");var carMakerValue=Valraiso.form.select.getSelectedValue(carMaker);var url="/carModelAjax?newsletter=nef&carMaker="+carMakerValue;var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotMultiPopupCarModelNewsletter(query,"");});}function checkVehicleForm(){var form=EL("subscribeNewsletter");form.submit();}function checkPaiementDataFormat(){var cardNumberField=EL("cardNumberField");var monthField=EL("monthField");var yearField=EL("yearField");var complementaryCodeField=EL("complementaryCodeField");var cardNumber=cardNumberField.value;var month=Valraiso.form.select.getSelectedText(monthField);var year=Valraiso.form.select.getSelectedText(yearField);var complementaryCode=complementaryCodeField.value;var now=new Date();var currentMonth=now.getMonth().toString();var currentYear=now.getFullYear();if(currentMonth.length==1){currentMonth="0"+currentMonth;}if(isNaN(cardNumber)||cardNumber.length>16){return affichePopUp("numeroCbInvalide");}else{if(currentYear==year&&currentMonth>=month){return affichePopUp("expirationCbAtteinte");}else{if(isNaN(complementaryCode)||complementaryCode.length!=3){return affichePopUp("codeSecuriteCbInvalide");}}}return true;}function showPopup(){showWaitingPopup();var curtain=EL("curtain");var body=document.body;var bodyHeight=body.offsetHeight+20;var bodyWidth=document.width;if(typeof bodyWidth=="undefined"){bodyWidth=body.offsetWidth;}with(curtain.style){width=bodyWidth+"px";height=bodyHeight+"px";display="none";backgroundColor="black";position="absolute";top=0;left=0;opacity=0.7;MozOpacity=0.7;filter="alpha(opacity=70)";zIndex=12;}curtainVisible=true;curtain.style.display="block";Valraiso.CSS.events.hideSelect();setTimeout(function(){hidePopup();},5500);}function hidePopup(){toggleCurtain();hideWaitingPopup();return false;}function showWaitingPopup(){var popup=EL("waitingPopup");if(popup!=null){with(popup.style){display="block";top="100px";}}return false;}function hideWaitingPopup(){var popup=EL("waitingPopup");if(popup!=null){popup.style.display="none";}return false;}function setCarModelInformation(metaOrder){var carMaker=EL("carMakerField");var carMakerValue=null;if(carMaker!=null){carMakerValue=Valraiso.form.getFieldValue(carMaker);}var carModel=EL("carModelField");var carModelValue=null;if(carModel!=null){carModelValue=Valraiso.form.getFieldValue(carModel);}var url="/carModelAjax?metaOrder="+metaOrder;if(carMakerValue!=null){if(carMakerValue=="#other"){var otherField=EL("otherField");if(otherField!=null){var otherFieldValue=otherField.value;url+="&otherField="+otherFieldValue;}}else{url+="&carMaker="+carMakerValue;}}if(carModelValue!=null){if(carModelValue=="#other"){otherField=EL("otherField");if(otherField!=null){otherFieldValue=otherField.value;url+="&otherField="+otherFieldValue;}}else{url+="&carModel="+carModelValue;}}var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){displayMessage(query);});}function gotMultiPopupCarModel(query,type){var pop=query.getText();var selectBeginPosition=pop.indexOf("<select");var selectEndPosition=pop.indexOf("</select>");while(selectBeginPosition!=-1&&selectEndPosition!=-1){if(selectBeginPosition!=-1&&selectEndPosition!=-1){var selectContent=pop.substring(selectBeginPosition,selectEndPosition+9);pop=pop.substring(selectEndPosition+9,pop.length-1);var idBeginPosition=selectContent.indexOf("id=");var idEndPosition=selectContent.indexOf("onchange=");type=selectContent.substring(idBeginPosition+4,idEndPosition-7);var div=EL(type+"Container");if(div!=null){div.innerHTML=selectContent;}selectBeginPosition=pop.indexOf("<select");selectEndPosition=pop.indexOf("</select>");}}}function loadCarMaker(){var url="/carModelAjax";var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotMultiPopupCarModel(query,"");});}function setRegistrationNumber(metaOrder){var url="/confirmPaymentAjax?metaOrder="+metaOrder;var registration=EL("immatriculation");if(registration!=null){var registrationValue=registration.value;if(registrationValue!="N° d'immatriculation"){url+="&registration="+registrationValue;}}var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){displayMessage(query);});}function displayMessage(query){var result=query.getText();if(result=="ok"){affichePopUp("save-info");}}function loadProspect(url,zoom,idDivParent,idDivChild){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotProspect(query,zoom,idDivParent,idDivChild);});}function gotProspect(query,zoom,idDivParent,idDivChild){var sheet=query.getText();var div=EL(idDivParent);div.innerHTML=sheet;window.scrollTo(0,0);switchZoomDataProspect(zoom,idDivChild);}function switchZoomDataProspect(zoom,idDivChild){var divinfo=EL(idDivChild);if(zoom){divinfo.style.display="none";}else{var pos=getDocumentScroll();divinfo.style.display="block";divinfo.style.top=(pos.y+100)+"px";if(navigator.appName=="Microsoft Internet Explorer"){if(navigator.appVersion.indexOf("MSIE 8")!=-1){}else{}}else{}}return false;}function afficheProspect(nom){var popup=EL(nom);var pos=getDocumentScroll();popup.style.display="block";popup.style.top=(pos.y+100)+"px";if(navigator.appName=="Microsoft Internet Explorer"){popup.style.left=(pos.x-80)+"px";}else{popup.style.left=(pos.x+350)+"px";}toggleCurtain();return false;}function checkProspectEtape1(){var email=EL("email");var emailMandatoryError=EL("email-mandatory-error");var emailValide=EL("email-valide");if(email.value==""){alert(emailMandatoryError.value);}else{if(!Valraiso.util.checkEmail(email.value)){alert(emailValide.value);}else{url="/prospectAjax?formStatut=inscription&email="+email.value;loadProspect(url,false,"popupprospect","contenuprospect");}}return false;}function checkProspectEtape2(){var firstname=EL("firstname");var lastname=EL("lastname");var tel=EL("tel");var city=EL("city");var age=EL("age");var km=EL("km");var nbVehicule=EL("nbvehicule");var prospectId=EL("prospectid");var nameMandatoryError=EL("name-mandatory-error");var prenomMandatoryError=EL("prenom-mandatory-error");if(firstname.value==""){alert(nameMandatoryError.value);}else{if(lastname.value==""){alert(prenomMandatoryError.value);}else{url="/prospectAjax?formStatut=details&firstname="+firstname.value+"&lastname="+lastname.value+"&tel="+tel.value+"&city="+city.value+"&age="+age.value+"&km="+km.value+"&nbvehicule="+nbVehicule.value+"&prospectid="+prospectId.value;loadProspect(url,false,"popupprospect","contenuprospect");}}return false;}function checkProspectWithoutPromoEtape1(urlLabel,locale){var email=EL("email");var firstname=EL("firstname");var lastname=EL("lastname");var tel=EL("tel");var city=EL("city");var dayField=EL("dayField");var monthField=EL("monthField");var yearField=EL("yearField");var dayValue="";var monthValue="";var yearValue="";var errorChamps=EL("errorChamps");var errorMail=EL("errorMail");if(locale=="es_ES"||locale=="fr_FR"){dayValue=Valraiso.form.select.getSelectedText(dayField);monthValue=Valraiso.form.select.getSelectedText(monthField);yearValue=Valraiso.form.select.getSelectedText(yearField);}if(firstname.value==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if(lastname.value==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if((locale=="es_ES"||locale=="fr_FR")&&tel.value==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if((locale=="es_ES"||locale=="fr_FR")&&city.value==""){errorChamps.style.display="block";errorMail.style.display="none";}}}}if((locale=="es_ES"||locale=="fr_FR")&&dayValue==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if((locale=="es_ES"||locale=="fr_FR")&&monthValue==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if((locale=="es_ES"||locale=="fr_FR")&&yearValue==""){errorChamps.style.display="block";errorMail.style.display="none";}else{if(!Valraiso.util.checkEmail(email.value)){errorChamps.style.display="none";errorMail.style.display="block";}else{errorChamps.style.display="none";errorMail.style.display="none";var url=urlLabel+"?formStatut=details&email="+email.value+"&firstname="+firstname.value+"&lastname="+lastname.value;if(locale=="es_ES"||locale=="fr_FR"){url+="&tel="+tel.value+"&city="+city.value+"&day="+dayValue+"&month="+monthValue+"&year="+yearValue;}loadProspect(url,false,"popupprospect","contenuprospect");}}}}return false;}function validAppointment(){if(!testDateHour()){return;}EL("appointmentForm").submit();}function areArticleCompatibleWithModelResponse(compatible){if(!compatible){affichePopUp("carModelAlert");return;}else{EL("appointmentForm").submit();}}function testDateHour(){var datesField=EL("datesField");var hoursField=EL("hoursFieldExt");if(!Valraiso.form.select.getSelectedValue(hoursField)||!Valraiso.form.select.getSelectedValue(datesField)){affichePopUp("dateHeureAlert");return false;}return true;}function validAppointmentSubstitution(){if(!testDateHour()){return;}validationSubstitution("validation");}function validationSubstitution(value){var mode=EL("mode");mode.value=value;EL("appointmentForm").submit();}function measuresClick(element){var obj=EL(element);if(obj.className=="deplie"){obj.className="plie";}else{if(obj.className=="plie"){obj.className="deplie";}}return false;}function ddlChange(){var form=EL("quantityForm");form.submit();}function setQuantity(idQuantity){var quantitySelect=document.getElementById(idQuantity);var quantityValue=Valraiso.form.select.getSelectedText(quantitySelect);var isQuantity2=idQuantity.substr(8,1);var idArticle=idQuantity.substring(10);var posidArticle=idArticle.indexOf("_");idArticle=idArticle.substring(0,posidArticle);var buttonWrapper=EL("boutonwrapper-"+idArticle);if(buttonWrapper!=null){var href=buttonWrapper.href;var posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){var substr=href.substring(posBegin+11);var posEnd=substr.indexOf("&");var hrefBegin=href.substring(0,posBegin+11);var hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}buttonWrapper.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheet=EL("linkProductSheet-"+idArticle);if(linkProductSheet!=null){href=linkProductSheet.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheet.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheetInfo=EL("linkProductSheetInfo-"+idArticle);if(linkProductSheetInfo!=null){href=linkProductSheetInfo.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheetInfo.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheetVignette=EL("linkProductSheetVignette-"+idArticle);if(linkProductSheetVignette!=null){href=linkProductSheetVignette.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheetVignette.href=hrefBegin+quantityValue+hrefEnd;}}}function getUrltoLoadSheet(linkid){var link=EL(linkid);var href=link.href;var posBegin=href.indexOf("/product");var url=href.substring(posBegin);loadSheet(url,false);}function measuresClick(element){var obj=EL(element);
if(obj.className=="deplie"){obj.className="plie";}else{if(obj.className=="plie"){obj.className="deplie";}}return false;}function ddlChange(currentElem){var form=EL("comparison");disabledDefaultSelect(currentElem);form.submit();}function disabledDefaultSelect(currentElem){var selects=document.getElementsByTagName("select");var length=selects.length;for(i=0;i<length;i++){if(currentElem!=selects[i].name&&startsWith(selects[i].name,"quantity")&&selects[i].value=="2"){selects[i].disabled=true;}}}function startsWith(testString,startString){return(testString.substring(0,startString.length)==startString);}function testCheckBoxes(){var elements=document.getElementsByName("selectedArticle");var length=elements.length;var isOverChecked=false;var nbChecked=0;for(i=0;i<length;i++){if(elements[i].checked){if(++nbChecked==5){elements[i].checked=false;isOverChecked=true;break;}}}if(isOverChecked){return showUnderOverChecked();}return true;}function clickBox(id,check){var checkBox=EL(check);var i=0;var backgroundUrl="";if(checkBox.checked){backgroundUrl="url(../img/selecproduits/bg_pneu_selectionne.jpg) repeat-x";}while(true){var cell=EL("cell_"+i+"_"+id);if(cell==null){break;}cell.style.background=backgroundUrl;i++;}}function testCompare(link,strLink){var elements=document.getElementsByName("selectedArticle");var length=elements.length;var nbChecked=0;var additionnalParams="?";for(i=0;i<length;i++){if(elements[i].checked){nbChecked++;additionnalParams+="selected"+nbChecked+"="+elements[i].value+"&";}}if(nbChecked<2){return showUnderOverChecked();}link.href=strLink+additionnalParams;return true;}function showUnderOverChecked(){var div=EL("underOverChecked");var pos=getDocumentScroll();div.style.display="block";div.style.top=(pos.y+100)+"px";toggleCurtain();return false;}function hideMessages(){var div=EL("underOverChecked");div.style.display="none";}function getDocumentScroll(){var scroll={};scroll.x=0;scroll.y=0;if(typeof window.pageYOffset=="number"){scroll.y=window.pageYOffset;scroll.x=window.pageXOffset;}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scroll.y=document.body.scrollTop;scroll.x=document.body.scrollLeft;}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scroll.y=document.documentElement.scrollTop;scroll.x=document.documentElement.scrollLeft;}}}return scroll;}function doSort(sortMode,ascendingMode){var form=EL("comparison");var sortInput=EL("sortInput");var ascending=EL("ascending");var elements=document.getElementsByName("selectedArticle");var length=elements.length;var nbChecked=0;for(i=0;i<length;i++){if(elements[i].checked){nbChecked++;var input=document.createElement("input");input.id="selected"+nbChecked;input.name="selected"+nbChecked;input.value=elements[i].value;form.appendChild(input);}}disabledDefaultSelect("");sortInput.value=sortMode;ascending.value=ascendingMode;form.submit();return false;}function sortSelect_changed(){var sortSelect=EL("sortSelect");var value=Valraiso.form.select.getSelectedValue(sortSelect);if(value==""){return;}var values=value.split("_");doSort(values[0],values[1]);}function setPage(page){return false;}function setQuantity(idQuantity,articleId,selection){var quantitySelect=document.getElementById(idQuantity);var quantityValue=Valraiso.form.select.getSelectedText(quantitySelect);var isQuantity2=idQuantity.substr(8,1);var selectionLabel="";if(selection!=null){selectionLabel="Selection-";}var buttonWrapper=EL("boutonwrapper-"+selectionLabel+articleId);if(buttonWrapper!=null){var href=buttonWrapper.href;var posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){var substr=href.substring(posBegin+11);var posEnd=substr.indexOf("&");var hrefBegin=href.substring(0,posBegin+11);var hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}buttonWrapper.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheet=EL("linkProductSheet-"+selectionLabel+articleId);if(linkProductSheet!=null){href=linkProductSheet.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheet.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheetInfo=EL("linkProductSheetInfo-"+selectionLabel+articleId);if(linkProductSheetInfo!=null){href=linkProductSheetInfo.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheetInfo.href=hrefBegin+quantityValue+hrefEnd;}}var linkProductSheetVignette=EL("linkProductSheetVignette-"+selectionLabel+articleId);if(linkProductSheetVignette!=null){href=linkProductSheetVignette.href;posBegin=href.indexOf("&quantity1=");if(isQuantity2=="2"){posBegin=href.indexOf("&quantity2=");}if(posBegin!=-1){substr=href.substring(posBegin+11);posEnd=substr.indexOf("&");hrefBegin=href.substring(0,posBegin+11);hrefEnd="";if(posEnd!=-1){hrefEnd=substr.substring(posEnd);}linkProductSheetVignette.href=hrefBegin+quantityValue+hrefEnd;}}}function getUrltoLoadSheet(linkid){var link=EL(linkid);var href=link.href;var posBegin=href.indexOf("/product");var url=href.substring(posBegin);loadSheet(url,false);}function displayStockInfo(quantityInStock,idQuantity,noStock,articleId,selection){var selectionLabel="";if(selection!=null){selectionLabel="Selection-";}var displayStockImg=EL("displayStockImg_"+selectionLabel+articleId);var displayStockSpan=EL("displayStockSpan_"+selectionLabel+articleId);var quantitySelect=EL(idQuantity);var quantityValue=Valraiso.form.select.getSelectedText(quantitySelect);if(quantityInStock>=quantityValue){var trad1=EL("en-stock");displayStockImg.src="/img/resultatsRecherche/icon-enstock.gif";displayStockSpan.firstChild.data=trad1.value;}else{var trad2=EL("en-reappro");displayStockImg.src="/img/resultatsRecherche/icon-enreappro.gif";displayStockSpan.firstChild.data=trad2.value;}}function sortHeaderColumn(currentSortMode,currentAscendingMode,sortModeAsked){if(currentSortMode==sortModeAsked&&currentAscendingMode=="true"){doSort(sortModeAsked,"false");}else{doSort(sortModeAsked,"true");}}function setHelpPositionForElement(elementName,helpElementName,absolute){var element=EL(elementName);var helpElement=EL(helpElementName);var elementPosition;if(absolute){elementPosition=getAbsoluteElementPosition(element);}else{elementPosition=getElementPosition(element);}var rightPosition=elementPosition.x+element.width;helpElement.style.left=(rightPosition-helpElement.offsetWidth)+"px";helpElement.style.top=(elementPosition.y+25)+"px";}function getAbsoluteElementPosition(e){var isMSIE=(navigator.userAgent.indexOf("MSIE")>=0);var p={};p.x=e.offsetLeft;p.y=e.offsetTop;if(isMSIE){p.x+=460;p.y+=25;}return p;}function getElementPosition(e){var p={};p.x=e.offsetLeft;p.y=e.offsetTop;var c=e.offsetParent;while(c){p.x+=c.offsetLeft;p.y+=c.offsetTop;c=c.offsetParent;}return p;}function hideSelectElement(elementName,show){var isMSIE6=(navigator.userAgent.indexOf("MSIE 6")>=0);if(isMSIE6){var select=EL(elementName);if(show){select.style.visibility="visible";}else{select.style.visibility="hidden";}}}function displayButtonsForMSIE6(){if(navigator.userAgent.indexOf("Safari")>=0){var previousDivOut=EL("prevButtonOutId");var previousDivOn=EL("prevButtonOnId");var nextDivOut=EL("nextButtonOutId");var nextDivOn=EL("nextButtonOnId");if(previousDivOut!=null){previousDivOut.style.marginLeft="-5px";}if(previousDivOn!=null){previousDivOn.style.marginLeft="-5px";}if(nextDivOut!=null){nextDivOut.style.marginLeft="310px";}if(nextDivOn!=null){nextDivOn.style.marginLeft="310px";}}}function ddlChange(currentElem){var form=EL("comparison");form.submit();}function disabledDefaultSelect(currentElem){var selects=document.getElementsByTagName("select");var length=selects.length;for(i=0;i<length;i++){if(currentElem!=selects[i].name&&startsWith(selects[i].name,"quantity")&&selects[i].value=="2"){selects[i].disabled=true;}}}function startsWith(testString,startString){return(testString.substring(0,startString.length)==startString);}function doSearch(mode){var ok=doFormSearch(mode);if(ok){var form=EL("searchForm");form.submit();}return false;}function doPartnerSearch(){var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");var speed=EL("speed");var isError=(width.value==""||ratio.value==""||diameter.value==""||speed.value=="");if(isError){alert(error);}else{var form=EL("searchForm");form.submit();}return false;}function doPartnerSearchVehicle(){var carMaker=EL("carMaker");var carModel=EL("carModel");var carMotorPower=EL("carMotorPower");var carYear=EL("carYear");var carDimension=EL("carDimension");var isError=(carMaker.value==""||carModel.value==""||carMotorPower.value==""||carYear.value==""||carDimension.value=="");if(isError){alert(error);}else{var form=EL("searchForm");form.submit();}return false;}function doFormSearch(mode){var width;var ratio;var diameter;var speed;var carMaker;var carModel;var carMotorPower;var carYear;var carDimension;var shifted;var isError=false;var nbErrorLeftColumn=0;var nbErrorRightColumn=0;var leftColumn=false;var labelError="";var colorError=EL("color-error").value;var colorStand="white";var colorStandItem=EL("color-stand");if(colorStandItem!=null){colorStand=colorStandItem.value;}var callCenterDimension=EL("callCenterDimension");if(callCenterDimension!=null){var value=callCenterDimension.value;value=Valraiso.util.trim(value);if(value!=""){return true;}}if(mode==""||mode=="size"||mode=="brand"){shifted=EL("shifted");width=EL("width");ratio=EL("ratio");diameter=EL("diameter");speed=EL("speed");if(width.value==""){EL("label-width").style.color=colorError;var labelWidth=EL("label-width").firstChild.nodeValue;labelError+=labelWidth;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-width").style.color=colorStand;}if(ratio.value==""){EL("label-ratio").style.color=colorError;var labelRatio=EL("label-ratio").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelRatio;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-ratio").style.color=colorStand;}if(diameter.value==""){EL("label-diameter").style.color=colorError;var labelDiameter=EL("label-diameter").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelDiameter;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-diameter").style.color=colorStand;}if(speed.value==""){EL("label-speed").style.color=colorError;var labelSpeed=EL("label-speed").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelSpeed;isError=true;nbErrorRightColumn++;}else{EL("label-speed").style.color=colorStand;}var shiftedChecked=false;if(shifted!=null){shiftedChecked=shifted.checked;}if(!isError&&shiftedChecked){startDecrease(0);callAjax();return false;}}else{if(mode=="vehicle"){carMaker=EL("carMaker");carModel=EL("carModel");carMotorPower=EL("carMotorPower");carYear=EL("carYear");carDimension=EL("carDimension");if(carMaker.value==""){EL("label-carMaker").style.color=colorError;var labelCarMaker=EL("label-carMaker").firstChild.nodeValue;labelError+=labelCarMaker;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carMaker").style.color="white";}if(carModel.value==""){EL("label-carModel").style.color=colorError;var labelCarModel=EL("label-carModel").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarModel;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carModel").style.color="white";}if(carMotorPower.value==""){EL("label-carMotorPower").style.color=colorError;var labelCarMotorPower=EL("label-carMotorPower").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarMotorPower;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carMotorPower").style.color="white";}if(carYear.value==""){EL("label-carYear").style.color=colorError;var labelCarYear=EL("label-carYear").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarYear;isError=true;nbErrorRightColumn++;}else{EL("label-carYear").style.color="white";}if(carDimension.value==""){EL("label-carDimension").style.color=colorError;var labelCarDimension=EL("label-carDimension").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarDimension;isError=true;nbErrorRightColumn++;}else{EL("label-carDimension").style.color="white";}}}if(isError){EL("warning-message").style.display="block";var heightError=96;EL("label-error").firstChild.nodeValue=labelError;startDecrease(heightError);}else{return true;}return false;}function callAjax(){var url;var load=EL("load");var speed=EL("speed");var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");url="/shifteddimensionajax?width=";url+=width.value;url+="&ratio=";url+=ratio.value;url+="&diameter=";url+=diameter.value;if(load!=null){url+="&load=";url+=load.value;}if(speed!=null){url+="&speed=";url+=speed.value;}loadShiftedPopUp(url,true);}function loadPopup(url,type,extension){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotPopup(query,type,extension);});}function loadMultiPopup(url,type,extension){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotMultiPopup(query,type,extension);});}function gotPopup(query,type,extension){var pop=query.getText();if(extension!=null){type+=extension;}var div=EL(type+"Container");if(div==null){return;}div.innerHTML=pop;}function gotMultiPopup(query,type,extension){var pop=query.getText();var firstType=type;var selectBeginPosition=pop.indexOf("<select");var selectEndPosition=pop.indexOf("</select>");while(selectBeginPosition!=-1&&selectEndPosition!=-1){if(selectBeginPosition!=-1&&selectEndPosition!=-1){var selectContent=pop.substring(selectBeginPosition,selectEndPosition+9);pop=pop.substring(selectEndPosition+9,pop.length-1);var idBeginPosition=selectContent.indexOf("id=");var idEndPosition=selectContent.indexOf("class=");type=selectContent.substring(idBeginPosition+4,idEndPosition-2);var div=EL(type+"Container");if(div!=null){div.innerHTML=selectContent;}selectBeginPosition=pop.indexOf("<select");selectEndPosition=pop.indexOf("</select>");}}displaySelectFocus();saveMultiFindDimension(firstType);}function loadArticlePromoImage(url){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotPopup(query,type);});}function popupChanged(pop,uri,extension){var id=pop.id;var url="?type=";var params="";var type="";var widthName="width";var ratioName="ratio";var diameterName="diameter";var loadName="load";var speedName="speed";if(extension!=null){widthName+=extension;ratioName+=extension;diameterName+=extension;loadName+=extension;speedName+=extension;}if(id==widthName){invalidateDimension(speedName,loadName,diameterName,ratioName);}else{if(id==ratioName){invalidateDimension(speedName,loadName,diameterName);}else{if(id=="carMaker"){invalidateVehicle("carDimension","carYear","carMotorPower","carModel");}else{if(id=="carModel"){invalidateVehicle("carDimension","carYear","carMotorPower");}else{if(id=="carMotorPower"){invalidateVehicle("carDimension","carYear");}else{if(id=="carYear"){invalidateVehicle("carDimension");}else{if(id==diameterName){invalidateDimension(speedName,loadName);}}}}}}}var el=EL(widthName);var value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&width="+value;type="ratio";}el=EL(ratioName);value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&ratio="+value;type="diameter";}el=EL("carMaker");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carMaker="+value;type="carModel";}el=EL("carModel");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carModel="+value;type="carMotorPower";}el=EL("carMotorPower");value=Valraiso.form.getFieldValue(el);
if(value!=null){params+="&carMotorPower="+value;type="carYear";}el=EL("carYear");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carYear="+value;type="carDimension";}el=EL(diameterName);value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&diameter="+value;type="load";url+=type+params;if(extension!=null){url+="&manufacturerSearch="+extension;}loadMultiPopup(uri+url,type,extension);type="speed";url="?type=";}if(type==""){return;}url+=type+params;if(extension!=null){url+="&manufacturerSearch="+extension;}loadMultiPopup(uri+url,type,extension);}function invalidateDimension(speed,load,diameter,ratio){var pop;if(ratio!=null){pop=EL(ratio);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",ratio);}}if(diameter!=null){pop=EL(diameter);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",diameter);}}if(load!=null){pop=EL(load);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",load);}}if(speed!=null){pop=EL(speed);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",speed);}}}function cleanPopUp(value,type){var html;var container=EL(type+"Container");html='<select name="';html+=type;html+='" id="';html+=type;html+='">';html+='   <option value="';html+=value;if(type=="load"){var loadLabel=EL("loadLabel");var loadLabelValue="...";if(loadLabel!=null){loadLabelValue=loadLabel.value;}html+='">'+loadLabelValue+"</option>";}else{html+='">...</option>';}html+="</select>";container.innerHTML=html;}function invalidateVehicle(carDimension,carYear,carMotorPower,carModel){var pop;if(carModel!=null){pop=EL(carModel);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carModel");}}if(carMotorPower!=null){pop=EL(carMotorPower);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carMotorPower");}}if(carYear!=null){pop=EL(carYear);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carYear");}}if(carDimension!=null){pop=EL(carDimension);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carDimension");}}}function createManufacturers(){var manufacturer=EL("manufacturer");var elements=document.getElementsByName("chkManufacturer");var length=elements.length;manufacturer.value="";for(i=0;i<length;i++){if(elements[i].checked){manufacturer.value+=elements[i].value;manufacturer.value+=",";}}length=manufacturer.value.length;if(manufacturer.value.charAt(length-1)==","){manufacturer.value=manufacturer.value.substring(0,length-1);}}function getPriceByArticle(idArticle,url,idContainer){url+="?idArticle="+idArticle;loadPopup(url,idContainer);}function getPriceByArticleAndQte(Sqte,idContainer){var Sarticle=document.getElementById("Article");var url;url="/searchPriceAjax";url+="?idArticle="+Sarticle.options[Sarticle.selectedIndex].value;url+="&qte="+Sqte.options[Sqte.selectedIndex].value;loadPopup(url,idContainer);}function getAnnee(carModel,carMotor,container){var url;url="/refCarSearchAjax?type=carYear";url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;loadPopup(url,container);}function getDimensions(carModel,carMotor,carYear,container){if(carYear==null||carYear==""){getAnnee(carModel,carMotor,"annee");cleanPopUp("",container);return;}var url;url="/refCarSearchAjax?type=width";url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;url+="&carYear="+carYear;loadPopup(url,container);}function doSearchRef(carMaker,carModel,carMotor){var SelectAnnee=EL("sAnnee");var SelectDimensions=EL("sDimmension");var buyButtonLink=EL("buyButtonLink");var url;url="/find?mode=vehicle";url+="&carMaker="+carMaker;url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;url+="&carYear="+SelectAnnee.options[SelectAnnee.selectedIndex].value;url+="&carDimension="+SelectDimensions.options[SelectDimensions.selectedIndex].value;url+="&manufacturer=";url+="&season=toutes";buyButtonLink.href=url;}function showBuyButton(){var el=EL("buyButton");var SelectDimensions=EL("sDimmension");if(SelectDimensions.options[SelectDimensions.selectedIndex].value!=""){el.style.display="";}else{el.style.display="none";}}function saveFindDimension(pop){var id=pop.id;var el=EL(id);var value=Valraiso.form.getFieldValue(el);if(value==null){value="";}if(id=="season1"||id=="season2"){id="season";}var url="/saveFindDimension?"+id+"="+value;var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){var result=query.getText();});}function saveMultiFindDimension(firstType){var params="";var el=EL("carMaker");var value=Valraiso.form.getFieldValue(el);if(value!=null){params+="carMaker="+value;}if(firstType=="carMaker"&&value==null){params+="carMaker=";}el=EL("carModel");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carModel="+value;}el=EL("carMotorPower");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carMotorPower="+value;}el=EL("carYear");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carYear="+value;}el=EL("carDimension");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carDimension="+value;}el=EL("width");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="width="+value;}if(firstType=="width"&&value==null){params+="width=";}el=EL("ratio");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&ratio="+value;}el=EL("diameter");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&diameter="+value;}el=EL("load");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&load="+value;}el=EL("speed");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&speed="+value;}var url="/saveFindDimension?"+params;var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){var result=query.getText();});}function displaySelectFocus(){var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");var load=EL("load");var speed=EL("speed");var loadLabel=EL("loadLabel");var carMaker=EL("carMaker");var carModel=EL("carModel");var carMotorPower=EL("carMotorPower");var carYear=EL("carYear");var carDimension=EL("carDimension");if(width!=null){if(width.options[width.selectedIndex].value!=""){EL("direction-width").style.display="none";if(ratio!=null){if(ratio.options[ratio.selectedIndex].value!=""){EL("direction-ratio").style.display="none";if(diameter!=null){if(diameter.options[diameter.selectedIndex].value!=""){EL("direction-diameter").style.display="none";if(load!=null){if(load.options[load.selectedIndex].value!=""||load.options[load.selectedIndex].text==loadLabel.value){EL("direction-load").style.display="none";}else{EL("direction-load").style.display="block";}}if(speed!=null){if(speed.options[speed.selectedIndex].value!=""){EL("direction-speed").style.display="none";}else{EL("direction-speed").style.display="block";}}}else{EL("direction-diameter").style.display="block";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}}else{EL("direction-ratio").style.display="block";EL("direction-diameter").style.display="none";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}}else{EL("direction-width").style.display="block";EL("direction-ratio").style.display="none";EL("direction-diameter").style.display="none";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}else{if(carMaker!=null){if(carMaker.options[carMaker.selectedIndex].value!=""){EL("direction-carMaker").style.display="none";if(carModel.options[carModel.selectedIndex].value!=""){EL("direction-carModel").style.display="none";if(carMotorPower.options[carMotorPower.selectedIndex].value!=""){EL("direction-carMotorPower").style.display="none";if(carYear.options[carYear.selectedIndex].value!=""){EL("direction-carYear").style.display="none";if(carDimension.options[carDimension.selectedIndex].value!=""){EL("direction-carDimension").style.display="none";}else{EL("direction-carDimension").style.display="block";}}else{EL("direction-carYear").style.display="block";EL("direction-carDimension").style.display="none";}}else{EL("direction-carMotorPower").style.display="block";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}else{EL("direction-carModel").style.display="block";EL("direction-carMotorPower").style.display="none";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}else{EL("direction-carMaker").style.display="block";EL("direction-carModel").style.display="none";EL("direction-carMotorPower").style.display="none";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}}}function measuresClick(element){var obj=EL(element);if(obj.className=="deplie"){obj.className="plie";}else{if(obj.className=="plie"){obj.className="deplie";}}return false;}function loadSheet(url,zoom){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotProductSheet(query,zoom);});}function gotProductSheet(query,zoom){var sheet=query.getText();var div=EL("popupficheproduit");div.innerHTML=sheet;window.scrollTo(0,0);switchZoomData(zoom);}function switchZoomData(zoom){var divImg=EL("imagefp");var divinfo=EL("contenufp");var fp=EL("fp");var img=EL("imgfp");var popup=EL("popupficheproduit");var fermer=EL("fermerPopup");var bottomFp1=EL("bottom-contenufp1");var bottomFp2=EL("bottom-contenufp2");var retour=EL("retour");var fluxLizeo=EL("fluxLizeo");if(zoom){popup.style.width="300px";fp.style.width="300px";popup.style.marginLeft="341px";fermer.style.marginLeft="120px";img.src=img.getAttribute("source");divinfo.style.display="none";retour.style.display="none";divImg.style.display="block";if(fluxLizeo!=null){fluxLizeo.style.display="none";}}else{divinfo.className="contenufp";fp.style.width="780px";popup.style.width="780px";popup.style.marginLeft="100px";fermer.style.marginLeft="350px";divinfo.style.display="block";bottomFp1.style.display="block";bottomFp2.style.display="block";divImg.style.display="none";}}function changeQuantityProductSheet(url){var quantity1=null;var quantity2=null;var elements=document.getElementsByTagName("select");var length=elements.length;for(i=0;i<length;i++){var pop=elements[i];var idx=pop.selectedIndex;var opt=pop.options[idx];if(elements[i].name=="_quantity1"){quantity1=opt.value;}else{if(elements[i].name=="_quantity2"){quantity2=opt.value;}}}if(quantity1!=null){url+="&quantity1="+quantity1;}if(quantity2!=null){url+="&quantity2="+quantity2;}loadSheet(url,false);}function switchFluxLizeo(display){var bottomFp1=EL("bottom-contenufp1");var bottomFp2=EL("bottom-contenufp2");var retour=EL("retour");var fluxLizeo=EL("fluxLizeo");if(fluxLizeo!=null){if(display){bottomFp1.style.display="none";bottomFp2.style.display="none";retour.style.display="block";fluxLizeo.style.display="block";}else{bottomFp1.style.display="block";bottomFp2.style.display="block";retour.style.display="none";fluxLizeo.style.display="none";}}}function displayCadreForMSIE6(){var version=navigator.appVersion.substring(17,23);if(version=="MSIE 6"){var firstInterLigne=EL("inter-ligne-first");var secondInterLigne=EL("inter-ligne-second");if(firstInterLigne!=null){firstInterLigne.innerHTML="";firstInterLigne.style.borderBottom="1px solid #B2B2B2";firstInterLigne.style.width="938px";firstInterLigne.style.height="5px";firstInterLigne.style.marginBottom="15px";}if(secondInterLigne!=null){secondInterLigne.innerHTML="";secondInterLigne.style.borderBottom="1px solid #B2B2B2";secondInterLigne.style.width="938px";secondInterLigne.style.height="5px";secondInterLigne.style.marginBottom="15px";}}}function displayQuantityForProductSheetWithoutAjax(){var selectQuantity1=EL("_quantity1");var selectQuantity2=EL("_quantity2");if(selectQuantity1!=null){selectQuantity1.style.visibility="visible";}if(selectQuantity2!=null){selectQuantity2.style.visibility="visible";}}function doSearch(mode){var ok=doFormSearch(mode);if(ok){var form=EL("searchForm");form.submit();}return false;}function doPartnerSearch(){var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");var speed=EL("speed");var isError=(width.value==""||ratio.value==""||diameter.value==""||speed.value=="");if(isError){alert(error);}else{var form=EL("searchForm");form.submit();}return false;}function doPartnerSearchVehicle(){var carMaker=EL("carMaker");var carModel=EL("carModel");var carMotorPower=EL("carMotorPower");var carYear=EL("carYear");var carDimension=EL("carDimension");var isError=(carMaker.value==""||carModel.value==""||carMotorPower.value==""||carYear.value==""||carDimension.value=="");if(isError){alert(error);}else{var form=EL("searchForm");form.submit();}return false;}function doFormSearch(mode){var width;var ratio;var diameter;var speed;var carMaker;var carModel;var carMotorPower;var carYear;var carDimension;var shifted;var isError=false;var nbErrorLeftColumn=0;var nbErrorRightColumn=0;var leftColumn=false;var labelError="";var colorError=EL("color-error").value;var colorStand="white";var colorStandItem=EL("color-stand");if(colorStandItem!=null){colorStand=colorStandItem.value;}var callCenterDimension=EL("callCenterDimension");if(callCenterDimension!=null){var value=callCenterDimension.value;value=Valraiso.util.trim(value);if(value!=""){return true;}}if(mode==""||mode=="size"||mode=="brand"){shifted=EL("shifted");width=EL("width");ratio=EL("ratio");diameter=EL("diameter");speed=EL("speed");if(width.value==""){EL("label-width").style.color=colorError;var labelWidth=EL("label-width").firstChild.nodeValue;labelError+=labelWidth;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-width").style.color=colorStand;}if(ratio.value==""){EL("label-ratio").style.color=colorError;var labelRatio=EL("label-ratio").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelRatio;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-ratio").style.color=colorStand;}if(diameter.value==""){EL("label-diameter").style.color=colorError;var labelDiameter=EL("label-diameter").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelDiameter;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-diameter").style.color=colorStand;}if(speed.value==""){EL("label-speed").style.color=colorError;var labelSpeed=EL("label-speed").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelSpeed;isError=true;nbErrorRightColumn++;}else{EL("label-speed").style.color=colorStand;}var shiftedChecked=false;if(shifted!=null){shiftedChecked=shifted.checked;}if(!isError&&shiftedChecked){startDecrease(0);callAjax();return false;}}else{if(mode=="vehicle"){carMaker=EL("carMaker");carModel=EL("carModel");carMotorPower=EL("carMotorPower");carYear=EL("carYear");carDimension=EL("carDimension");if(carMaker.value==""){EL("label-carMaker").style.color=colorError;var labelCarMaker=EL("label-carMaker").firstChild.nodeValue;labelError+=labelCarMaker;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carMaker").style.color="white";}if(carModel.value==""){EL("label-carModel").style.color=colorError;var labelCarModel=EL("label-carModel").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarModel;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carModel").style.color="white";}if(carMotorPower.value==""){EL("label-carMotorPower").style.color=colorError;var labelCarMotorPower=EL("label-carMotorPower").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarMotorPower;isError=true;leftColumn=true;nbErrorLeftColumn++;}else{EL("label-carMotorPower").style.color="white";}if(carYear.value==""){EL("label-carYear").style.color=colorError;var labelCarYear=EL("label-carYear").firstChild.nodeValue;if(isError){labelError+=", ";}labelError+=labelCarYear;isError=true;nbErrorRightColumn++;}else{EL("label-carYear").style.color="white";}if(carDimension.value==""){EL("label-carDimension").style.color=colorError;var labelCarDimension=EL("label-carDimension").firstChild.nodeValue;if(isError){labelError+=", ";
}labelError+=labelCarDimension;isError=true;nbErrorRightColumn++;}else{EL("label-carDimension").style.color="white";}}}if(isError){EL("warning-message").style.display="block";var heightError=96;EL("label-error").firstChild.nodeValue=labelError;startDecrease(heightError);}else{return true;}return false;}function callAjax(){var url;var load=EL("load");var speed=EL("speed");var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");url="/shifteddimensionajax?width=";url+=width.value;url+="&ratio=";url+=ratio.value;url+="&diameter=";url+=diameter.value;if(load!=null){url+="&load=";url+=load.value;}if(speed!=null){url+="&speed=";url+=speed.value;}loadShiftedPopUp(url,true);}function loadPopup(url,type,extension){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotPopup(query,type,extension);});}function loadMultiPopup(url,type,extension){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotMultiPopup(query,type,extension);});}function gotPopup(query,type,extension){var pop=query.getText();if(extension!=null){type+=extension;}var div=EL(type+"Container");if(div==null){return;}div.innerHTML=pop;}function gotMultiPopup(query,type,extension){var pop=query.getText();var firstType=type;var selectBeginPosition=pop.indexOf("<select");var selectEndPosition=pop.indexOf("</select>");while(selectBeginPosition!=-1&&selectEndPosition!=-1){if(selectBeginPosition!=-1&&selectEndPosition!=-1){var selectContent=pop.substring(selectBeginPosition,selectEndPosition+9);pop=pop.substring(selectEndPosition+9,pop.length-1);var idBeginPosition=selectContent.indexOf("id=");var idEndPosition=selectContent.indexOf("class=");type=selectContent.substring(idBeginPosition+4,idEndPosition-2);var div=EL(type+"Container");if(div!=null){div.innerHTML=selectContent;}selectBeginPosition=pop.indexOf("<select");selectEndPosition=pop.indexOf("</select>");}}displaySelectFocus();saveMultiFindDimension(firstType);}function loadArticlePromoImage(url){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotPopup(query,type);});}function popupChanged(pop,uri,extension){var id=pop.id;var url="?type=";var params="";var type="";var widthName="width";var ratioName="ratio";var diameterName="diameter";var loadName="load";var speedName="speed";if(extension!=null){widthName+=extension;ratioName+=extension;diameterName+=extension;loadName+=extension;speedName+=extension;}if(id==widthName){invalidateDimension(speedName,loadName,diameterName,ratioName);}else{if(id==ratioName){invalidateDimension(speedName,loadName,diameterName);}else{if(id=="carMaker"){invalidateVehicle("carDimension","carYear","carMotorPower","carModel");}else{if(id=="carModel"){invalidateVehicle("carDimension","carYear","carMotorPower");}else{if(id=="carMotorPower"){invalidateVehicle("carDimension","carYear");}else{if(id=="carYear"){invalidateVehicle("carDimension");}else{if(id==diameterName){invalidateDimension(speedName,loadName);}}}}}}}var el=EL(widthName);var value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&width="+value;type="ratio";}el=EL(ratioName);value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&ratio="+value;type="diameter";}el=EL("carMaker");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carMaker="+value;type="carModel";}el=EL("carModel");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carModel="+value;type="carMotorPower";}el=EL("carMotorPower");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carMotorPower="+value;type="carYear";}el=EL("carYear");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carYear="+value;type="carDimension";}el=EL(diameterName);value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&diameter="+value;type="load";url+=type+params;if(extension!=null){url+="&manufacturerSearch="+extension;}loadMultiPopup(uri+url,type,extension);type="speed";url="?type=";}if(type==""){return;}url+=type+params;if(extension!=null){url+="&manufacturerSearch="+extension;}loadMultiPopup(uri+url,type,extension);}function invalidateDimension(speed,load,diameter,ratio){var pop;if(ratio!=null){pop=EL(ratio);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",ratio);}}if(diameter!=null){pop=EL(diameter);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",diameter);}}if(load!=null){pop=EL(load);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",load);}}if(speed!=null){pop=EL(speed);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("",speed);}}}function cleanPopUp(value,type){var html;var container=EL(type+"Container");html='<select name="';html+=type;html+='" id="';html+=type;html+='">';html+='   <option value="';html+=value;if(type=="load"){var loadLabel=EL("loadLabel");var loadLabelValue="...";if(loadLabel!=null){loadLabelValue=loadLabel.value;}html+='">'+loadLabelValue+"</option>";}else{html+='">...</option>';}html+="</select>";container.innerHTML=html;}function invalidateVehicle(carDimension,carYear,carMotorPower,carModel){var pop;if(carModel!=null){pop=EL(carModel);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carModel");}}if(carMotorPower!=null){pop=EL(carMotorPower);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carMotorPower");}}if(carYear!=null){pop=EL(carYear);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carYear");}}if(carDimension!=null){pop=EL(carDimension);if(pop!=null){Valraiso.form.select.setSelectedValue(pop,"");cleanPopUp("","carDimension");}}}function createManufacturers(){var manufacturer=EL("manufacturer");var elements=document.getElementsByName("chkManufacturer");var length=elements.length;manufacturer.value="";for(i=0;i<length;i++){if(elements[i].checked){manufacturer.value+=elements[i].value;manufacturer.value+=",";}}length=manufacturer.value.length;if(manufacturer.value.charAt(length-1)==","){manufacturer.value=manufacturer.value.substring(0,length-1);}}function getPriceByArticle(idArticle,url,idContainer){url+="?idArticle="+idArticle;loadPopup(url,idContainer);}function getPriceByArticleAndQte(Sqte,idContainer){var Sarticle=document.getElementById("Article");var url;url="/searchPriceAjax";url+="?idArticle="+Sarticle.options[Sarticle.selectedIndex].value;url+="&qte="+Sqte.options[Sqte.selectedIndex].value;loadPopup(url,idContainer);}function getAnnee(carModel,carMotor,container){var url;url="/refCarSearchAjax?type=carYear";url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;loadPopup(url,container);}function getDimensions(carModel,carMotor,carYear,container){if(carYear==null||carYear==""){getAnnee(carModel,carMotor,"annee");cleanPopUp("",container);return;}var url;url="/refCarSearchAjax?type=width";url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;url+="&carYear="+carYear;loadPopup(url,container);}function doSearchRef(carMaker,carModel,carMotor){var SelectAnnee=EL("sAnnee");var SelectDimensions=EL("sDimmension");var buyButtonLink=EL("buyButtonLink");var url;url="/find?mode=vehicle";url+="&carMaker="+carMaker;url+="&carModel="+carModel;url+="&carMotorPower="+carMotor;url+="&carYear="+SelectAnnee.options[SelectAnnee.selectedIndex].value;url+="&carDimension="+SelectDimensions.options[SelectDimensions.selectedIndex].value;url+="&manufacturer=";url+="&season=toutes";buyButtonLink.href=url;}function showBuyButton(){var el=EL("buyButton");var SelectDimensions=EL("sDimmension");if(SelectDimensions.options[SelectDimensions.selectedIndex].value!=""){el.style.display="";}else{el.style.display="none";}}function saveFindDimension(pop){var id=pop.id;var el=EL(id);var value=Valraiso.form.getFieldValue(el);if(value==null){value="";}if(id=="season1"||id=="season2"){id="season";}var url="/saveFindDimension?"+id+"="+value;var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){var result=query.getText();});}function saveMultiFindDimension(firstType){var params="";var el=EL("carMaker");var value=Valraiso.form.getFieldValue(el);if(value!=null){params+="carMaker="+value;}if(firstType=="carMaker"&&value==null){params+="carMaker=";}el=EL("carModel");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carModel="+value;}el=EL("carMotorPower");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carMotorPower="+value;}el=EL("carYear");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carYear="+value;}el=EL("carDimension");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&carDimension="+value;}el=EL("width");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="width="+value;}if(firstType=="width"&&value==null){params+="width=";}el=EL("ratio");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&ratio="+value;}el=EL("diameter");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&diameter="+value;}el=EL("load");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&load="+value;}el=EL("speed");value=Valraiso.form.getFieldValue(el);if(value!=null){params+="&speed="+value;}var url="/saveFindDimension?"+params;var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){var result=query.getText();});}function displaySelectFocus(){var width=EL("width");var ratio=EL("ratio");var diameter=EL("diameter");var load=EL("load");var speed=EL("speed");var loadLabel=EL("loadLabel");var carMaker=EL("carMaker");var carModel=EL("carModel");var carMotorPower=EL("carMotorPower");var carYear=EL("carYear");var carDimension=EL("carDimension");if(width!=null){if(width.options[width.selectedIndex].value!=""){EL("direction-width").style.display="none";if(ratio!=null){if(ratio.options[ratio.selectedIndex].value!=""){EL("direction-ratio").style.display="none";if(diameter!=null){if(diameter.options[diameter.selectedIndex].value!=""){EL("direction-diameter").style.display="none";if(load!=null){if(load.options[load.selectedIndex].value!=""||load.options[load.selectedIndex].text==loadLabel.value){EL("direction-load").style.display="none";}else{EL("direction-load").style.display="block";}}if(speed!=null){if(speed.options[speed.selectedIndex].value!=""){EL("direction-speed").style.display="none";}else{EL("direction-speed").style.display="block";}}}else{EL("direction-diameter").style.display="block";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}}else{EL("direction-ratio").style.display="block";EL("direction-diameter").style.display="none";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}}else{EL("direction-width").style.display="block";EL("direction-ratio").style.display="none";EL("direction-diameter").style.display="none";EL("direction-load").style.display="none";EL("direction-speed").style.display="none";}}else{if(carMaker!=null){if(carMaker.options[carMaker.selectedIndex].value!=""){EL("direction-carMaker").style.display="none";if(carModel.options[carModel.selectedIndex].value!=""){EL("direction-carModel").style.display="none";if(carMotorPower.options[carMotorPower.selectedIndex].value!=""){EL("direction-carMotorPower").style.display="none";if(carYear.options[carYear.selectedIndex].value!=""){EL("direction-carYear").style.display="none";if(carDimension.options[carDimension.selectedIndex].value!=""){EL("direction-carDimension").style.display="none";}else{EL("direction-carDimension").style.display="block";}}else{EL("direction-carYear").style.display="block";EL("direction-carDimension").style.display="none";}}else{EL("direction-carMotorPower").style.display="block";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}else{EL("direction-carModel").style.display="block";EL("direction-carMotorPower").style.display="none";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}else{EL("direction-carMaker").style.display="block";EL("direction-carModel").style.display="none";EL("direction-carMotorPower").style.display="none";EL("direction-carYear").style.display="none";EL("direction-carDimension").style.display="none";}}}}function loadPrice(url){var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){gotPrice(query);});}var totalLinePrice;function gotPrice(query){var pop=query.getText();if(pop.substring(0,5)=="error"){document.location.href="/nobasket";return;}var tr=EL("totalLine");tr.innerHTML=pop;}function showSimulateurCetelem(){window.open("http://www.popgom.fr/cetelemprestosimulator?montant="+totalLinePrice+"","cetelem","directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=600,height=550");}function additionalServiceCheck(checkid){var url;var checkedIds="";var form=EL("selectionForm");var elements=form.getElementsByTagName("input");var length=elements.length;if(checkid!=null){var price=EL("price_"+checkid);var promo=EL("promo_"+checkid);if(price.style.display=="none"){price.style.display="block";if(promo!=null){promo.style.display="block";}}else{price.style.display="none";if(promo!=null){promo.style.display="none";}}}for(i=0;i<length;i++){if(elements[i].checked){checkedIds+=elements[i].id;checkedIds+=",";}}length=checkedIds.length;if(length>0){checkedIds=checkedIds.substring(0,length-1);}var expressAppointment=EL("expressAppointment");if(expressAppointment!=null){if(length>0){checkedIds+=",";}checkedIds+=expressAppointment.value;}url="/validateAjax?services="+checkedIds;loadPrice(url);}function checkChangeQuantity(){var form=EL("selectionForm");var services=EL("services");services.value=getCheckedIds();form.action="?";form.submit();return false;}function checkForm(param){var form=EL("selectionForm");var services=EL("services");var actionCustomer=EL("actionCustomer");var urlCustomer=actionCustomer.value;services.value=getCheckedIds();form.action=urlCustomer+param;form.submit();}function checkFormForPromo(){var form=EL("promoForm");var codeVisu=EL("promoCodeVisu");var codeSubmit=EL("promoCode");setCheckedIds();codeSubmit.value=codeVisu.value;form.submit();}function setCheckedIds(){var checkedIds=getCheckedIds();var checkedForPromo=EL("checkedForPromo");checkedForPromo.value=checkedIds;}function getCheckedIds(){var checkedIds="";var form=EL("selectionForm");var elements=form.getElementsByTagName("input");var length=elements.length;for(i=0;i<length;i++){if(elements[i].checked){checkedIds+=elements[i].id;checkedIds+=",";}}length=checkedIds.length;if(length>0){checkedIds=checkedIds.substring(0,length-1);}var expressAppointment=EL("expressAppointment");if(expressAppointment!=null){if(length>0){checkedIds+=",";}checkedIds+=expressAppointment.value;}return checkedIds;}function unCheckDefaultSelection(serviceId,defaultSelection){var checkServiceItem=EL(serviceId);if(checkServiceItem!=null&&defaultSelection){var checkService=checkServiceItem.checked;if(!checkService){var paramUnChecked="unCheckDefaultSelection_"+serviceId;var url="/sessionAjax?"+paramUnChecked+"=df";var query=Bw.IO.Query.create();query.setNoCache();query.get(url,function(){var pop=query.getText();});}}}function checkAdacNumber(){EL("promoCode").value="";EL("loginADACForm").submit();}function disconnectCustomer(){var query=Bw.IO.Query.create();query.setNoCache();query.get("/pneus-POPGOM/mon-compte?disconnect=true",function(){var sheet=query.getText();document.location="/";});}function checkKeyNewletterPopup(e){var touche;if(window.event){touche=e.keyCode;}else{if(e.which){touche=e.which;}}if(touche==13){var result=checkNewsletterPopup();return result;}return true;}function checkNewsletterPopup(){var emailNewsLetter=EL("email-newsLetter");var newsletterPopUpError=EL("newsletter-popup-error");if(emailNewsLetter.value==""||!Valraiso.util.checkEmail(emailNewsLetter.value)){newsletterPopUpError.style.display="block";}else{newsletterPopUpError.style.display="none";var form=EL("encartNewsletterForm");form.submit();}return false;}function setPopUpCookie(){document.cookie="POPUP_HOME_PAGE=true;path=/;expires="+new Date("January 1, 3000").toGMTString();
}