function HeaderShowNavigationHistory(){Effect.Appear("header_history");new Ajax.Updater($("header_history"),"/HeaderShowNavigationHistory.ashx",{method:"get"});}var HeaderDropDownMenu={CurrentIdCounter:0,IsOnNode:false,MenusIds:new Array(),CurrentlyDisplayedId:null,CurrentHandler:null,LoadContent:function(B){HeaderDropDownMenu.CurrentHandler=$(B).readAttribute("handler");var A=$(B).readAttribute("childLayers");if(A!=null){$w(A).each(function(C){new Ajax.Updater($(C),HeaderDropDownMenu.CurrentHandler,{method:"get"});});}},ToggleChildren:function(C,B){var A=HeaderDropDownMenu.IsAlreadyDisplayed(C);HeaderDropDownMenu.Initialize($(C));if(!A){HeaderDropDownMenu.CurrentlyDisplayedId=$(C).readAttribute("id");$(HeaderDropDownMenu.MenusIds).each(function(D){try{if(HeaderDropDownMenu.CurrentlyDisplayedId!=D){HeaderDropDownMenu.HideAll($(D));}}catch(E){}});HeaderDropDownMenu.ShowAll($(C));}else{HeaderDropDownMenu.HideAll($(C));HeaderDropDownMenu.CurrentlyDisplayedId=null;}HeaderDropDownMenu.PreventBubbling(B);return false;},PreventBubbling:function(A){if((navigator.userAgent.indexOf("MSIE")>-1&&navigator.userAgent.indexOf("compatible")>1&&!(navigator.userAgent.indexOf("opera")>-1))){if(!A){A=window.event;}A.cancelBubble=true;}else{A.stopPropagation();}},MouseOver:function(B){var A=$(B).readAttribute("isInitialized");if(A==null||A!="true"){HeaderDropDownMenu.Initialize($(B));}},Initialize:function(C){var B=$(C).readAttribute("isInitialized");if(B==null||B!="true"){var A=HeaderDropDownMenu.NewRandomId();$(C).writeAttribute("id",A);$(C).writeAttribute("baseId",A);$(C).writeAttribute("isInitialized","true");HeaderDropDownMenu.MenusIds.push(A);}},MouseOut:function(B){var C=Event.element(B);var A=HeaderDropDownMenu.GetBaseId(C);if(A==null){return ;}if(!HeaderDropDownMenu.IsAlreadyDisplayed(C)){return ;}setTimeout("HeaderDropDownMenu.TriggerHideAll('"+A+"')",700);},NewRandomId:function(){HeaderDropDownMenu.CurrentIdCounter++;return"header-id-"+HeaderDropDownMenu.CurrentIdCounter;},TriggerHideAll:function(A){$(A).fire("hideall");},HideAllMenus:function(){$(HeaderDropDownMenu.MenusIds).each(function(A){try{HeaderDropDownMenu.HideAll($(A));}catch(B){}});},HideAll:function(C){var A=$(C).readAttribute("baseId");var B=$(A).readAttribute("childLayers");if(B!=null){HeaderDropDownMenu.SetNotDisplayed(C);$w(B).each(function(D){Effect.Fade($(D),{duration:0.2});});}HeaderDropDownMenu.SetNotDisplayed(C);},ShowAll:function(C){if(HeaderDropDownMenu.IsAlreadyDisplayed(C)){return ;}var A=HeaderDropDownMenu.GetBaseId(C);var B=$(A).readAttribute("childLayers");if(B!=null){$w(B).each(function(D){Effect.Appear($(D),{duration:0.2});});}HeaderDropDownMenu.SetDisplayed(C);},IsMouseOnNodeFamily:function(F,A,E){var B=$(F).readAttribute("baseId");var C=$(B).readAttribute("childLayers");var D=$(B).descendants();this.IsOnNode=false;if(C!=null){$w(C).each(function(G){HeaderDropDownMenu.IsOnNode=Position.within($(G),A,E);if(HeaderDropDownMenu.IsOnNode){return ;}});}if(!this.IsOnNode){this.IsOnNode=Position.within($(B),A,E);}if(!this.IsOnNode){if(D!=null){$w(D).each(function(G){HeaderDropDownMenu.IsOnNode=Position.within($(G),A,E);if(HeaderDropDownMenu.IsOnNode){return ;}});}}return this.IsOnNode;},IsAlreadyDisplayed:function(C){var A=HeaderDropDownMenu.GetBaseId(C);if(A==null){return false;}var B=$(A).readAttribute("isDisplayed");if(B=="false"||B==null){return false;}else{if(B=="true"){return true;}}},SetNotDisplayed:function(B){var A=HeaderDropDownMenu.GetBaseId(B);$(A).writeAttribute("isDisplayed","false");},SetDisplayed:function(B){var A=HeaderDropDownMenu.GetBaseId(B);$(A).writeAttribute("isDisplayed","true");},GetBaseId:function(B){var A=$(B).readAttribute("baseId");return A;}};var Header={IsConnectDisplayed:false,LoadMiniCart:function(){new Ajax.Request("/HeaderMiniCart.ashx",{onSuccess:function(A){$("header_mini_cart_preview").update(A.responseText);}});},Search:function(B){if(!$F(B)){return ;}var A=config.portalUrl+"/recherche/produit/"+$F(B);window.location=A;return false;},ClearTextBox:function(A){if(A.value!="Mon mot de passe"&&A.value!="Mon email"&&A.value!="Rechercher"){return ;}A.value="";},SearchKeyPress:function(B){var A=B.charCode?B.charCode:B.keyCode;if(A==13){Header.Search(B.target);return false;}else{return true;}},SetTextBox:function(B,A){if(B.value==""){B.value=A;}},LoadTabs:function(){car1=new SCarousel("carousel-tabs",{next:"carousel-tab-next",previous:"carousel-tab-pre",loading:"carousel-tab-loading"});Object.extend(car1,CarouselModuleLink);new Ajax.Request("/portal.ashx",{method:"get",parameters:{action:"tabs"},onSuccess:function(B){var A=B.responseText.evalJSON();car1.setData(A);$(car1.options.next).observe("click",car1.next.bind(car1));$(car1.options.previous).observe("click",car1.previous.bind(car1));}});},InsertNewTab:function(C,D){var B=$("carousel-tabs").select("li").last().previousSiblings().size();var A="after";$("carousel-tabs").fire("insert:item",{index:C,title:D,insert:{"location":B,"position":A}});$("carousel-tabs").fire("select:item",{innerIndex:C});bpc.execute('<s:task b:action="select" b:target="//b:tab[@id='+C+']" />');},DisplayLoginInputsOrSubmit:function(){if(!Header.IsConnectDisplayed){$("div_input_connectaccount").insert('<input id="login_login" value="Mon email" type="text" onblur="SetTextBox(this, \'Mon email\');SetLoginInputBlur(this);" onfocus="ClearTextBox(this);SetLoginInputFocus(this)"/><input id="login_password" type="password"  value="Mon mot de passe" onblur="SetTextBox(this, \'Mon mot de passe\');SetLoginInputBlur(this);" onfocus="ClearTextBox(this);SetLoginInputFocus(this)"/>');Effect.Appear("div_input_connectaccount");Effect.Fade("span_errormessage");Header.IsConnectDisplayed=true;}else{new Ajax.Request("/Login.ashx",{method:"get",parameters:{login:$F("login_login"),password:$F("login_password")},onSuccess:function(B){var A=B.responseText.evalJSON();if(A.status=="OK"){window.location.reload(true);}else{new Effect.Appear("span_errormessage");}}});}return false;},do_encrypt:function(E,B){var C=new RSAKey();var D="3";var B="ABC30681295774F7CECA691EC17F4E762DA6DE70F198EAEE3CCE3A435FC006B971DC24E55904F1D2705758C041C2B0B18E8BFAE2C9CD96B50082D7D8C7342CBAB7F6E0622DA53B8B56DBDB24174F00173263CFECAE604795CDA2A037BC3A69B7C0090AA2DE1568998BCD6D70CC2E0574755B9F7986AE01CE8714A26144279CDB";C.setPublic(B,D);var A=C.encrypt(E);return linebrk(A,64);},Signout:function(){new Ajax.Request("/Signout.ashx",{method:"get",onSuccess:function(B){var A=B.responseText.evalJSON();if(A.status=="OK"){window.location.reload(true);}}});}};Event.observe(window,"load",function(){Header.LoadMiniCart();if(location.href.lastIndexOf("monespace")==-1){Header.LoadTabs();}});Event.observe(window,"click",function(){HeaderDropDownMenu.HideAllMenus();});