var slideShowBBY={createSlideShow:function(a,e,f,k,l){var i=new ui.slideshow;i.buildNavigation=slideShowBBY.buildNavigation;i.defaultTransition=slideShowBBY.defaultTransition;i.prepareBubbles=slideShowBBY.prepareBubbles;this.initNavButtons(i.init(a,e,f,k,l));$("#roller").css("opacity",0.5);i.progressBar.resume=slideShowBBY.progressBarResume;i.progressBar.reset=slideShowBBY.progressBarReset;i.progressBar.reset(i.getTimeout());return i},buildNavigation:function(){sh=this;this.isIE6=/MSIE 6/i.test(navigator.userAgent);
this.isIPad=/iPad/i.test(navigator.userAgent);this.isIPhone=/iPhone/i.test(navigator.userAgent);this.isIE6&&$("#"+this.divid).addClass("ie6");$(this.params.navigation).children().each(function(){$(this).click(function(){var f=sh.slides.length-1-$(this).index();sh.pause();sh.flip(f);return false});if(!sh.isIPad&&!sh.isIPhone){$(this).mouseenter(function(){$(this).index();if(sh.curr.currSlide!=sh.slides.length-1-$(this).index()){$(sh.params.navigation+" > li").eq(sh.slides.length-1-sh.curr.currSlide).children(".tooltip").hide();
$(this).find(".tooltip").show()}});$(this).mouseleave(function(){$(this).index();$(this).find(".tooltip").stop(true,true);if(sh.curr.currSlide!=sh.slides.length-1-$(this).index()){$(this).find(".tooltip").hide();$(sh.params.navigation+" > li").eq(sh.slides.length-1-sh.curr.currSlide).children(".tooltip").show()}})}});$(this.params.navigation+" > li").eq(this.slides.length-1).addClass("hover").children(".tooltip").show();var a=$(sh.params.navigation+" > li").eq(sh.slides.length-1).position().left-
315;$(".tooltip").css("left",a+"px");$("#homepage-slide ul.slides").css("display","block");a=$(this.params.navigation+" > li").eq(this.slides.length-1-this.curr.currSlide);var e=a.position();$("#"+this.params.progressBar.id).prependTo(a);$("#"+this.params.progressBar.id).css({left:e.left+4,top:e.top+7})},defaultTransition:function(a,e){sh=this;this.isIE6?$("#"+a+" ul.slides").css("left",e*-1):$("#"+this.divid+" ul.slides").fadeOut(sh.params.transitionSpeed/2,function(){$("#"+a+" ul.slides").css("left",
e*-1);$("#"+sh.divid+" ul.slides").fadeIn(sh.params.transitionSpeed/2)});var f=$(this.params.navigation+" > li").eq(this.slides.length-1-this.curr.currSlide),k=f.position();$("#"+this.params.progressBar.id).prependTo(f);$("#"+this.params.progressBar.id).css({left:k.left+4,top:k.top+7});this.curr.prevSlide!=this.curr.currSlide&&$(this.params.navigation+" > li").eq(this.slides.length-1-this.curr.prevSlide).removeClass("hover").children(".tooltip").hide();$(this.params.navigation+" > li").eq(this.slides.length-
1-this.curr.currSlide).addClass("hover").children(".tooltip").show()},prepareBubbles:function(){sh=this;$("#"+this.divid+" .bubble").each(function(){var a=null;$(this).wrapInner('<div class="bubbleInsert" />');$(this).wrapInner('<div class="bubbleContent" />');$(this).prepend('<div class="indicator"></div>');$(this).mouseenter(function(){var e=$(this).position().left,f=$(this).position().top,k=$("#"+sh.divid).width(),l=$("#"+sh.divid).height(),i=$(".bubbleContent",this).width(),m=$(".bubbleContent",
this).height();clearTimeout(a);$(this).css("z-index","150");e+i+50>k&&$(".bubbleContent",this).css("left",-1*i+"px");f+m+50>l&&$(".bubbleContent",this).css("top",-1*m+"px");$(".bubbleContent",this).fadeIn("fast");sh.pause()});$(this).mouseleave(function(){bubble=this;a=setTimeout(function(){$(".bubbleContent",bubble).fadeOut("fast",function(){$(bubble).css("z-index","100")})},sh.params.bubbleBuffer)})})},initNavButtons:function(a){a.isIE6&&$(".indicator").addClass("ie6");$("#"+a.params.next.id).click(function(){a.next();
return false}).andSelf().mouseover(function(){$(this).children("div").addClass("hoverRight")}).andSelf().mouseout(function(){$(this).children("div").removeClass("hoverRight")});$("#"+a.params.previous.id).click(function(){a.prev();return false}).andSelf().mouseover(function(){$(this).children("div").addClass("hoverLeft")}).andSelf().mouseout(function(){$(this).children("div").removeClass("hoverLeft")});$("#"+a.params.pause.id).click(function(){a.curr.paused==true?a.resume():a.pause();return false})},
progressBarReset:function(a){var e={width:this.rollerWidth,opacity:0.5};this.stop();this.time=a;$(this.divId+" #roller").css("width","0px");$(this.divId+" #roller").animate(e,this.time,"linear")},progressBarResume:function(a){var e={width:this.rollerWidth,opacity:0.5};$(this.divId+" #roller").animate(e,a,"linear")}},uiBBY={statusMsg:function(a){$("#globalStatusMsg").clearQueue().stop().html("").css("height","auto").hide().html(a).slideDown().animate({opacity:1},5E3,function(){$(this).slideUp()})},
accessoriesWidget:function(a,e,f,k,l,i,m,o){var b=$(e),n=$(l),j=a.substr(0,2).toUpperCase(),s=false,q=null,t=o?o:false,y=null,r=null;this.showNumProd=f;var p={alsoAddThisOn:{EN:"Also Add This",FR:"Ajoutez aussi ce produit"},alsoAddThisOff:{EN:"Remove",FR:"Retirer"},showMoreOn:{EN:'Show more <img src="/images/common/pictures/sortdescending.gif" width="12" height="10" />',FR:'Montrez-en plus <img src="/images/common/pictures/sortdescending.gif" width="12" height="10" />'},showMoreOff:{EN:'Hide <img src="/images/common/pictures/sortascending.gif" width="12" height="10" />',
FR:'Cacher <img src="/images/common/pictures/sortascending.gif" width="12" height="10" />'},accessories:{EN:"more item(s)<br/>selected",FR:"plus d'article(s)<br/>s&eacute;lectionn&eacute;s"}};this.init=function(){for(var d=this,c=0;c<m.length;c++)$(e+" "+m[c]).each(function(h,g){B($(g))});$(e+" "+k).each(function(h,g){C(g)});b.find(".removeAll").click(function(){D()});b.find(".tabLink").each(function(h,g){$(g).bind("click",function(){d.showItemsFromTab(h)})});b.find(i).toggle(function(){d.showMoreProd();
$(this).html(p.showMoreOff[j])},function(){d.hideMoreProd();$(this).html(p.showMoreOn[j])});b.find(".ui-tabcontrol-content").each(function(h,g){var z=$(this).find(k),A=$(g).find(i);z.length>d.showNumProd?A.show():A.hide();z.each(function(u,E){var v=$(E);if(u<d.showNumProd)v.css("display","block").addClass("noBottomBorder");else if(u>=d.showNumProd)return false;if((u+1)%d.showNumProd==0){v.addClass("noBorder");v.after('<div class="clear"></div>')}})});this.showItemsFromTab(0)};var B=function(d){$(d).click(function(){var c=
$(this).parentsUntil(k).parent(),h=c.find(".prodImageWrap"),g=c.find(".field-title");c=c.find(".accessoriesWidgetActionBtn");g=g.find("a").attr("href").match(/((m|M|b|B){1}[0-9]{7}|[0-9]{8})/)[0];if(w(g)==null){if(!w(g)){basket.GenericUpdateAccessories(g,true);x()}c.html(p.alsoAddThisOff[j]);h.find(".prodStatus").fadeIn()}else{if(w(g)>=0){basket.GenericUpdateAccessories(g,false);x()}h.find(".prodStatus").fadeOut();c.html(p.alsoAddThisOn[j])}varianceTest.entry("prodClick")})},D=function(){var d=b.find(".prodStatus");
basket.Accessories=Array(1);d.each(function(c,h){$(h).css("display","none")});b.find(".accessoriesWidgetActionBtn").each(function(c,h){$(h).html(p.alsoAddThisOn[j])});x()},w=function(d){for(var c=null,h=0;h<basket.Accessories.length;h++)if(d==basket.Accessories[h]){c=h;break}return c},x=function(){if(basket.Accessories.length>1){n.addClass("active").html('<span class="quantity">+'+(basket.Accessories.length-1)+"</span> "+p.accessories[j]+' <div class="thumbs"></div>');n.append('<div class="clear"></div>');
$("#accessoriesBoxStatusBottom").show()}else{n.removeClass("active").html("");$("#accessoriesBoxStatusBottom").hide()}return false},C=function(d){var c=$(d);$(d).mouseenter(function(){if(!s&&q==null){s=true;q=c;F(null,500,function(){if(q==c){c.css({"z-index":"10"}).find(".product").addClass("hover").find(".product-details").css({display:"block"});t&&c.find(".field-title").css("display","block")}})}}).mouseleave(function(){if(q==c){clearInterval(null);$(this).css({"z-index":"5"}).find(".product").removeClass("hover").find(".product-details").css({display:"none"});
t&&$(this).find(".field-title").css("display","none");s=false;q=null}})};this.showItemsFromTab=function(d){y=b.find(".ui-tabcontrol-content").eq(d);r=y.find(k)};this.showMoreProd=function(){var d=this;t&&r.removeClass("noBottomBorder");r.each(function(c,h){var g=$(h);if(c>=d.showNumProd){g.css("display","block");c+1>=Math.floor(r.length/d.showNumProd)*d.showNumProd+1&&g.addClass("noBottomBorder")}if((c+1)%d.showNumProd==0){g.addClass("noBorder");g.after('<div class="clear"></div>')}});varianceTest.entry("showMore")};
this.hideMoreProd=function(){var d=this;r.each(function(c,h){var g=$(h);c<d.showNumProd&&g.addClass("noBottomBorder");c>=d.showNumProd&&g.css("display","none")});varianceTest.entry("hideMore")};var F=function(d,c,h){(function g(){if(c<=0){h();clearInterval(d)}else{c-=30;d=setTimeout(g,30)}})()};this.init()},Variance:function(a,e,f,k){a=a?a:"";e=e?e:"";f=f?f:null;k=k?k:30;var l=null,i=null,m=0,o=false;this.entry=function(b){trackEvent.event("event.link",{lid:"GUI_Variance_"+a+"_"+e+"_"+l+"_"+b+"_entry"})};
this.goal=function(){o&&trackEvent.event("event.link",{lid:"GUI_Variance_"+a+"_"+e+"_"+l+"_goal"})};this.clearCookie=function(){var b=new Date;b.setTime(b.getTime()+-86400000);document.cookie="gui_v_"+a+"_"+e+"=; expires="+b.toGMTString()+"; path=/"};(function(){for(var b=document.cookie.split(";"),n=0;n<b.length;n++){for(var j=b[n];j.charAt(0)==" ";)j=j.substring(1,j.length);if(j.indexOf("gui_v_"+a+"_"+e+"=")==0){l=j.substring(6+a.length+1+e.length+1,j.length);o=true}}if(!o&&f!=null){if(m==0)for(b=
0;b<f.length;b++)m+=f[b].weight;n=Math.floor(Math.random()*m);for(b=j=0;b<f.length;b++)if(n<j+f[b].weight){i=f[b];l=f[b].variance;break}else j+=f[b].weight;b=new Date;b.setTime(b.getTime()+k*24*60*60*1E3);document.cookie="gui_v_"+a+"_"+e+"="+l+"; expires="+b.toGMTString()+"; path=/"}else if(f!=null)for(b=0;b<f.length;b++){if(f[b].variance==l){i=f[b];break}}else o||(l="unaffected");f!=null&&trackEvent.event("event.link",{lid:"GUI_Variance_"+a+"_"+e+"_"+l+"_pageLoad"});i!=null&&i.init()})()}};

