var tabSliders={};var quotationForm="quotationForm";isExplorer=function(){if(navigator.appName.indexOf("Explorer")>-1){return true}return false};changeTotalClaims=function(a,d,f){a=parseInt(a,10);if(a>4){return a}for(var e=1;e<=3;e++){$(d+e).style.display="none"}for(var c=1;c<=a;c++){$(d+c).style.display="block"}if(f){for(var b=1;b<4;b++){if(b>a){$(f+"_claimDate"+(b)).value="";$(f+"_claimNature"+(b)).selectedIndex=0}}}return a};secondDriverForm=function(a){if(a){toggleQuotationSection("sectionPrincipalInsurance","close");toggleQuotationSection("sectionPrincipalClaims","close");$("sectionPrincipalInsuranceModifyLink").removeClass("quotation_close");toggleQuotationSection("sectionSecondDriver","open");$("sectionSecondInsurance").style.display="block"}else{toggleQuotationSection("sectionSecondDriver","close");$("sectionSecondInsurance").style.display="none";$("sectionSecondClaims").style.display="none"}};buildAccordion=function(a,c){var b;if(!c){b=$("quotation_right_pane")}else{b=$("content_right_pane")}if(typeof(a)=="number"){_tmp=a;a=$A([]);a.push(_tmp)}else{a=$A(a)}if(b){$ES("div.quotationService",$(b)).each(function(e,d){e.openerCloser=e.getElement("div.quotationServiceHead h4");e.content=e.getElement("div.quotationServiceBody");e.content.fx=new Fx.Slide(e.content,{duration:500,wait:true,onComplete:function(){if(window.ie&&!this.element.isOpen){this.wrapper.setStyle("height","0")}else{this.wrapper.setStyle("height","auto")}}});e.toggleSlide=_toggleSlide;e.slideIn=_slideIn;e.slideOut=_slideOut;e.openerCloser.getParent().addEvent("click",_toggleSlide.bind(e,[]));if(!a.contains(d)){e.slideIn()}else{e.slideOut()}})}};function _toggleSlide(){if(this.content.isOpen){this.slideIn()}else{this.slideOut()}}function _slideOut(){this.content.fx.slideIn();if(this.openerCloser.img){this.openerCloser.img.src=js_contextPath+"/img/arrow_service_small_on.gif"}this.content.isOpen=true;this.openerCloser.removeClass("close").addClass("open")}function _slideIn(){this.content.fx.slideOut();this.content.isOpen=false;if(this.openerCloser.img){this.openerCloser.img.src=js_contextPath+"/img/arrow_service_small_off.gif"}this.openerCloser.removeClass("open").addClass("close")}changeSection=function(c){var b=true;var a=false;var d=new Event(c);var g=$(d.target);if(g.getParent().id=="main_claims3Years"||g.getParent().id=="second_claims3Years"){return}if(this.id=="sectionQuotationPrice"||this.id=="sectionCustomQuotation"||this.id=="sectionRecommendations"){b=false}if(this.id=="sectionInfosCar"||this.id=="sectionInfosPrincipalDriver"||this.id=="sectionLoginInfos"){b=false;a=true;$ES(".quotation_section_title",$(quotationForm)).each(function(i){i.addClass("quotation_section_open");i.removeClass("quotation_section_active")});$ES(".quotation_section_title",$(this.id)).each(function(i){i.addClass("quotation_section_active")})}if($("sectionSecondDriverTitle")){if($("sectionSecondDriverTitle").hasClass("quotation_section_active")||$("sectionSecondDriverTitle").hasClass("quotation_section_open")&&$("sectionSecondDriverContent").hasClass("quotation_close")){return}}if(!a){var e=$$("div.quotation_section, div.quotation_section_middle, div.quotation_section_orange");var h=e.length;var f;for(f=0;f<h;f++){if(this.id!=e[f].id){if(e[f].getFirst().hasClass("quotation_section_active")){toggleQuotationSection(e[f].id,"open",b)}}}if(this.getFirst().hasClass("quotation_section_open")){toggleQuotationSection(this.id,"active",b)}}};toggleQuotationSection=function(d,c,b,g,f){throw"toggleQuotationSection";g=g||500;var e=$(d);if(!e){return}if(e.getFirst().hasClass("quotation_section_"+c)&&!f){return}if(!$defined(b)){b=true}e.getFirst().removeClass("quotation_section_close");e.getFirst().removeClass("quotation_section_active");e.getFirst().removeClass("quotation_section_open");if(c=="close"){e.getFirst().addClass("quotation_section_"+c)}else{e.getFirst().addClass("quotation_section_active").addClass("quotation_section_open")}if(!e.fxSlide){e.fxSlide=new Fx.Slide(e.getElement(".quotation_section_content"),{duration:g,onComplete:function(i){if(e.getElement(".quotation_section_content").hasClass("slideOut")){e.getElement(".quotation_section_footer").removeClass("quotation_open");e.getElement(".quotation_section_footer").setStyle("visibility","hidden")}else{e.getElement(".quotation_section_footer").removeClass("quotation_close");e.getElement(".quotation_section_footer").setStyle("visibility","visible");$ES(".help",e).setStyle("display","block");if(window.firefox){var h=e.getElement(".quotation_section_content");var k=h.getParent().scrollTop-h.scrollTop;if(k>0){var j=h.getStyle("marginTop").toInt();h.setStyle("margin-top",(k+j))}}}}})}var a=e.fxSlide.wrapper.style.height;if(c=="open"||c=="active"){e.removeClass("js_closed");e.addClass("js_opened");e.getElement(".quotation_section_content").removeClass("slideOut");e.getElement(".quotation_section_content").removeClass("quotation_close");if(e.getElement(".quotationModifyLink")){e.getElement(".quotationModifyLink").addClass("quotation_close")}if(!b){e.getElement(".quotation_section_footer").removeClass("quotation_close");e.getElement(".quotation_section_footer").addClass("quotation_open");e.getElement(".quotation_section_footer").setStyle("visibility","visible");$ES(".help",e).setStyle("display","block")}else{e.fxSlide.slideIn(null,g)}}else{e.addClass("js_closed");e.removeClass("js_opened");e.getElement(".quotation_section_content").addClass("slideOut");if(e.getElement(".quotationModifyLink")){e.getElement(".quotationModifyLink").removeClass("quotation_close")}$ES(".help",e).setStyle("display","none");if(!b){e.getElement(".quotation_section_content").getParent().setStyle("height","0");e.getElement(".quotation_section_footer").removeClass("quotation_open");e.getElement(".quotation_section_footer").setStyle("visibility","hidden")}else{e.fxSlide.slideOut(null,g)}}};function favoris(){if(navigator.appName!="Microsoft Internet Explorer"){window.sidebar.addPanel(document.title,document.location,"")}else{window.external.AddFavorite(document.location,document.title)}}function searchLocality(d,b,c,a){this.cmb=d;this.errorMessage=b;if(this.oldPostCode){if(this.oldPostCode.toLowerCase()==this.value.toLowerCase()){return}}this.cmb.empty();this.oldPostCode=this.value;if(this.value.trim().length==0){return}onCmpl=(function(e){if(!e){manageErrorLoadListLocality(this,true);return}manageErrorLoadListLocality(this,false);loadListLocality.apply(this,[e,this.cmb,this.errorMessage]);if(a&&typeof(a)=="function"){a.apply(this,arguments)}}).bind(this);this.onComplete=onCmpl;if(c){c="&prefix="+c}else{c=""}if(js_frameDialogue=="change"){new Json.Remote(js_contextPath+"/do/"+js_frameDialogue+"/searchAjax",{method:"post",onComplete:this.onComplete.bind(this)}).send("method=searchPostCode&postCode="+this.value+c)}else{if(js_frameDialogue=="personalData"){new Json.Remote(js_contextPath+"/do/"+js_frameDialogue+"/searchAjax",{method:"post",onComplete:this.onComplete.bind(this)}).send("method=searchPostCode&postCode="+this.value+c)}else{new Json.Remote(js_contextPath+"/do/"+js_staticDialogue+"/searchAjax",{method:"post",onComplete:this.onComplete.bind(this)}).send("method=searchPostCode&postCode="+this.value+c)}}}function loadListLocality(a,c,b){c=c||this.cmb;b=b||this.errorMessage;if($type(a)=="array"){a.each(function(e){if(e.title){var d=new Element("option",{value:e.value,title:e.title}).setHTML(e.label);d.inject(c)}});this.removeClass("error_field");c.removeProperty("disabled")}else{this.addClass("error_field");errors_params={error_message:b}}}function manageErrorLoadListLocality(c,a){var b=$("error_loadListLocality_"+c.id);if(b){if(a){if(c.next){c.next.disabled=true;if(c.next._error){c.next._error.addClass("hidden")}}b.removeClass("hidden")}else{if(c.next){c.next.disabled=false;if(c.next._error){c.next._error.removeClass("hidden")}}b.addClass("hidden")}if(c.section){c.section.resize()}}}function setHidden(b,a){if(b.checked){a.value=1}else{a.value=0}};