var TOUCH_DEVICE=!!("ontouchstart" in window);$(document).ready(function(){var e=new PiiqHeader(),d,b={};if($("body").hasClass("team_detail")){setupTeamListDetail()}if($(".heroCarousel").length){var a=new PiiqHeroCarousel(".heroCarousel");$(".module.variable").each(function(){new VariableModule(this,a)})}$(".piiqModule").each(function(){new PiiqModule(this)});$(".cw_module").each(function(){new ColorwayModule(this)});$(".module.piiq_pairs").each(function(){new PiiqPairs(this)});$("#partners").children("li").each(function(){new PartnersModule(this)});$("#site_nav .dd").each(function(){new PiiqDropDown(this)});$("#site_nav #site_nav_prod .dd").each(function(){new ProductDD(this)});$("#site_nav #site_nav_team .dd").each(function(){new TeamDD(this)});$(".basicSlider").each(function(){new SliderModule(this)});$(".sportNav li a").each(function(){$(this).append($("span",this).clone().addClass("highlight"));$(this).hasClass("selected")&&$(this).addClass("hover")});if(!TOUCH_DEVICE){$(".sportNav li a").hover(function(){$(".sportNav li a.hover").removeClass("hover");$(this).addClass("hover")},function(){$(this).removeClass("hover");$(".sportNav li a.selected").addClass("hover")})}if($(".newsArchiveList").length){new PiiqNewsControl(".newsArchiveList",".newsDetailContent",".newsDetail")}if($(".productLandBox").length){$(".productLandBox").each(function(){var f=$(this).data("family");if(!!b[f]){b[f].push(this)}else{b[f]=[this]}});for(d in b){(new PiiqProductLandingFamily(b[d]))}}if($(".productCarousel").length){new PiiqProductDetail(".productCarousel")}});var GreyScaler=function(b,d){var a=this;a.$el=b;a.filter=d||"none";a.img=new Image();a.img.onload=function(){a.render()};a.img.src=b.attr("src")};GreyScaler.prototype.render=function(){var d=this;d.w=d.$el.width();d.h=d.$el.height();if(document.createElement("canvas").getContext&&d.canvas==null){var h,b,g,f,a,e;d.canvas=$("<canvas/>").attr({"class":"gs",width:d.w,height:d.h}).insertAfter(d.$el);h=d.canvas.get(0).getContext("2d");h.clearRect(0,0,this.w,this.h);h.drawImage(this.img,0,0,this.w,this.h);b=h.getImageData(0,0,this.w,this.h);for(g=0;g<b.height;g++){for(x=0;x<b.width;x++){a=(g*4)*b.width+x*4;e=((0.2989*b.data[a])+(0.587*b.data[a+1])+(0.114*b.data[a+2]));switch(d.filter){case"quad":e=(function(i){i/=127.5;return(i<1)?(127.5*i*i):(-127.5*((i-1)*(i-3)-1))})(e);break;case"circ":e=(function(i){i/=127.5;return(i<1)?(-127.5*(Math.sqrt(1-i*i)-1)):(127.5*(Math.sqrt(1-(i-2)*(i-2))+1))})(e);break;case"sine":e=(function(i){return -255/2*(Math.cos(Math.PI*i/255)-1)})(e);break}b.data[a]=e;b.data[a+1]=e;b.data[a+2]=e}}h.putImageData(b,0,0,0,0,b.width,b.height)}else{d.canvas=d.$el.clone();d.canvas.addClass("gs ie").insertAfter(d.$el).css("background","#fff");d.canvas.get(0).style.filter="progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)"}d.$el.css("visibility","hidden")};var SliderModule=function(d){var b=this;$.extend(b,{$el:$(d),lBtn:$("<div/>",{"class":"btn left"}),rBtn:$("<div/>",{"class":"btn right"}),curInd:0,dur:300,animating:false,hasThumbs:false,easingMethod:"easeOutExpo",thumbMods:[]});b.ul=b.$el.children("ul").eq(0);b.lis=b.ul.children("li");b.lw=b.lis.eq(0).width();b.btns=b.lBtn.add(b.rBtn);if(b.lis.length>1){b.ul.width(b.lw*b.lis.length);b.lBtn.appendTo(b.$el).bind("click",function(f){f.preventDefault();b.onBtnClick("left")});b.rBtn.appendTo(b.$el).bind("click",function(f){f.preventDefault();b.onBtnClick("right")});if(!TOUCH_DEVICE){b.btns.hide();if($.support.opacity){b.btns.bind({mouseenter:function(f){$(f.target).fadeTo(100,1)},mouseleave:function(f){$(f.target).fadeTo(100,0.7)}})}b.$el.hoverIntent({over:function(){b.onOver()},out:function(){b.onOut()},interval:0,timeout:200})}else{b.btns.show()}if(b.ul.find(".thumbnail").length){var a=$("<ul/>",{"class":"thumbList"});b.ul.find(".thumbnail").each(function(g){var e=$("<li/>");var f=$('<a class="piiqModule" data-linkStroke="#404142" data-notch="0" href="#'+g+'"/>');f.bind("click",function(h){h.preventDefault();h.stopPropagation();b.slideTo(g)}).append($(this));e.append(f).appendTo(a)});b.$el.append(a);a.find("li a").each(function(){b.thumbMods.push(new PiiqModule(this))});b.hasThumbs=true;b.thumbMods[0].showStroke();b.thumbMods[0].$el.addClass("selected")}}b.checkForVideo(false)};SliderModule.prototype.onBtnClick=function(a){var b=this,d;d=a==="left"?b.curInd-1:b.curInd+1;if(d!==b.currInd&&!b.animating){b.slideTo(d,a)}};SliderModule.prototype.onOver=function(){$.support.opacity?this.btns.fadeTo(100,0.7):this.btns.show()};SliderModule.prototype.onOut=function(){$.support.opacity?this.btns.fadeTo(100,0):this.btns.hide()};SliderModule.prototype.slideTo=function(f,d){var k=this,j=false,g=k.lis.length,h=(f-k.curInd)%g,b=g*k.lw,e,a;d=d==="left"||d==="right"?d:h<0?"left":"right";if(!k.animating){k.animating=true;k.clearVideo();if(d==="left"&&f<0){j=k.lis.clone();k.ul.append(j).css("marginLeft",b*-1).width(b*2)}if(d==="right"&&f>=g){j=k.lis.clone();k.ul.prepend(j).css("marginLeft",(b*-1)+k.lw).width(b*2)}k.ul.animate({marginLeft:"-="+(h*k.lw)},{duration:k.dur,easing:k.easingMethod});$.when(k.ul).always(function(){var i;k.curInd=(f+g)%g;if(!!(j)){j.remove();d==="right"&&k.ul.css("marginLeft","+="+b);k.ul.width(b)}k.checkForVideo(true);k.animating=false});if(k.hasThumbs){for(e=0;e<k.thumbMods.length;e++){a=k.thumbMods[e];if(e===(f+g)%g){a.showStroke();a.$el.addClass("selected")}else{if(a.$el.hasClass("selected")){a.hideStroke();a.$el.removeClass("selected")}}}}}};SliderModule.prototype.checkForVideo=function(d){var b=this,a=$(b.lis[b.curInd]),e=a.find("img");if(!(swfobject.hasFlashPlayerVersion("10.0.0"))){return false}e.each(function(f,g){var h=$(g);if(typeof(h.data("video"))!="undefined"){b.showVideo(h.data("video"),d,$(g).attr("src"))}})};SliderModule.prototype.showVideo=function(g,e,b){var d=this,a=$(d.lis[d.curInd]),f=$("<div />").attr("class","videoContainer"),h=$("<div />").attr("id","piiqVideo");a.append(f);f.append(h);new PiiqVideoPlayer("piiqVideo",g,e,b)};SliderModule.prototype.clearVideo=function(){var b=this,a=$(b.lis[b.curInd]);a.find(".videoContainer").each(function(d,e){$(e).detach()})};var PiiqHeroCarousel=function(b){var a=this;$.extend(a,{$el:$(b),stages:[],lBtn:$("<span />").attr("class","btn left"),rBtn:$("<span />").attr("class","btn right"),curInd:0,dur:300,easeType:"easeOutQuad",category:null,navItems:[]});a.lis=a.$el.children("ul").children("li");a.stageImgs=a.$el.find(".stageImage");a.btns=$(a.lBtn).add(a.rBtn);a.stageImgs.each(function(d){var e=$(this),f=$("<div/>").attr("class","stage");f.css("background-image","url("+e.attr("src")+")").appendTo(a.$el);a.stages.push(f);if(d!=0){f.hide()}}).detach();a.$el.append($("<div/>").attr("class","overlay"));if(a.stageImgs.length>1){a.$el.append(this.lBtn,this.rBtn);a.lBtn.bind("click",function(d){d.preventDefault();a.onButtonClick("left")});a.rBtn.bind("click",function(d){d.preventDefault();a.onButtonClick("right")});if(!TOUCH_DEVICE){a.$el.bind({mouseenter:function(){a.onOver()},mouseleave:function(){a.onOut()}});a.btns.hide().bind({mouseenter:function(){$(this).fadeTo(100,1)},mouseleave:function(){$(this).fadeTo(100,0.7)}})}a.createCarouselNav();a.slideTo(0,"right")}};PiiqHeroCarousel.prototype.createCarouselNav=function(){var d=this;var a=$("<div />",{"class":"carouselNavContainer"});d.$el.append(a);var b=$("<ul />",{"class":"carouselNav"});a.append(b);d.lis.each(function(h,i){var e=$("<li />");e.appendTo(b);var f=$("<a/>",{href:"#"}).appendTo(e);var g=$("<span />",{"class":$(i).data("icon")}).appendTo(f);f.bind("click",function(j){j.preventDefault();j.stopPropagation();d.navItemClick(h)});d.navItems.push(new PiiqModule(f,0))})};PiiqHeroCarousel.prototype.navItemClick=function(a){var b=this,d=b.curInd;b.curInd=a;(d!==b.curInd)&&b.slideTo(b.curInd,b.curInd<d?"left":"right")};PiiqHeroCarousel.prototype.onButtonClick=function(a){var b=this,d=b.curInd;a=a||"right";switch(a){case"left":b.curInd=b.curInd>0?b.curInd-1:b.lis.length-1;break;case"right":b.curInd=b.curInd<b.lis.length-1?b.curInd+1:b.curInd=0;break}(d!==b.curInd)&&this.slideTo(b.curInd,a)};PiiqHeroCarousel.prototype.onOver=function(){$(this.rBtn).add(this.lBtn).fadeTo(100,0.7)};PiiqHeroCarousel.prototype.onOut=function(){$(this.rBtn).add(this.lBtn).fadeTo(100,0)};PiiqHeroCarousel.prototype.slideTo=function(f,b){var e=this,d,a;b=b||"right";for(d=0;d<e.stages.length;d++){a=e.navItems[d];if(d==f){e._in(d,b);a.$el.addClass("selected");a.overColor="#989898";a.showStroke()}else{e._out(d,b);a.$el.removeClass("selected");a.overColor="#00bcd4";a.hideStroke()}}e.category=e.lis.eq(f).data("category");e.$el.trigger("carouselchanged")};PiiqHeroCarousel.prototype._out=function(d,a){var b=this,e=a==="left"?"120px":"-120px";b.stages[d].animate({"margin-left":e},{queue:false,easing:b.easeType}).fadeOut(b.dur);b.lis.eq(d).fadeOut(b.dur)};PiiqHeroCarousel.prototype._in=function(d,a){var b=this,e=a==="left"?"-120px":"120px";b.stages[d].css({marginLeft:e}).animate({"margin-left":0},{queue:false,easing:b.easeType}).fadeIn(b.dur);b.lis.eq(d).fadeIn(b.dur)};var VariableModule=function(b,d){var a=this;$.extend(a,{$el:$(b),master:d,dur:450,conts:$(b).find(".content")});a.master.$el.bind("carouselchanged",function(f){a.change(a.master.category)})};VariableModule.prototype.change=function(e){var h=this;var f=h.$el.width();var d=h.$el.height();var b=Math.ceil(f*Math.sqrt(2));var g=Math.ceil(d*Math.sqrt(2));var j=$("<div/>").attr("class","washHold");j.width(f).height(d).appendTo(h.$el);var a=Raphael(j.get(0),f,f);var i=a.image("assets/img/transition_diag_pattern_trans.png",0,0,f,d).attr({stroke:0,rotation:"45",translation:f+" "+(d*-1),scale:1.4}).animate({translation:(f*-2)+" "+(d*2)},h.dur,function(){j.remove()});h.conts.each(function(){var k=$(this);setTimeout((k.data("category")===e)?function(){k.show()}:function(){k.hide()},h.dur/2)})};var PiiqModule=function(e,f,k,i){var m=this,b,j=1,l,h=1,a;$.extend(m,{$el:$(e),ew:$(e).width(),eh:$(e).height(),dur:100});m.$el.data("piiqModuleRef",m);typeof f!=="undefined"&&m.$el.data("notch",f);typeof k!=="undefined"&&m.$el.data("notchStroke",k);typeof i!=="undefined"&&m.$el.data("icon",i);m.hasNotch=!(m.$el.data("notch")==null);m.hasNotchStroke=!(m.$el.data("notchStroke")===false);m.hasIcon=m.$el.data("icon");m.isLink=m.$el.is("a");if(m.hasNotch){m.rHold=$("<div>",{"class":"rHold"}).appendTo(m.$el);m.rh=m.rHold.height();m.rw=m.rHold.width();if(m.rw>=m.ew){m.isMini=true;m.rHold.addClass("mini")}m.triColor=m.$el.data("notch");if(m.triColor===0){b="#f9f9f9";j=0}else{b=m.triColor}m.tStrokeColor=!(m.$el.data("notchstroke")==null)?m.$el.data("notchstroke"):0;if(m.tStrokeColor===0){l="#f9f9f9";h=0}else{l=m.tStrokeColor}var g=m.isMini?"13":"60";a=Raphael(this.rHold.get(0));m.triangle=a.path("M0 0L"+g+" 0L"+g+" "+g+"L0 0").attr({fill:b,"fill-opacity":j,stroke:0});m.tStroke=a.path("M0 0L"+g+" "+g).attr({stroke:l,"stroke-opacity":h})}if(m.isLink){m.overColor=m.$el.data("linkStroke")==null?"#00bcd4":m.$el.data("linkStroke");m.sHold=$("<div>",{"class":"sHold"});if(!m.$el.children(".sHold").length){m.$el.append(m.sHold)}a=Raphael(m.sHold.get(0),m.ew,m.eh);if(!TOUCH_DEVICE){m.$el.bind({mouseenter:function(){m.onOver()},mouseleave:function(){m.onOut()}})}var d;if(m.ew<100){m.sWidth=8}else{if(m.ew<200){m.sWidth=12}else{m.sWidth=16}}m.stroke=a.path("M0 0L"+m.ew+" 0L"+m.ew+" "+m.eh+"L0 "+m.eh+"L0 0").attr({stroke:m.overColor,"stroke-width":0,"stroke-opacity":0})}if(m.hasIcon){m.iHold=$("<div>",{"class":"iHold"}).appendTo(m.$el);$("<span/>",{"class":!!m.$el.data("icon")?m.$el.data("icon"):""}).appendTo(m.iHold)}if(m.$el.hasClass("selected")){m.showStroke()}return this};PiiqModule.prototype.onOver=function(){!this.$el.hasClass("selected")&&this.showStroke()};PiiqModule.prototype.onOut=function(){!this.$el.hasClass("selected")&&this.hideStroke()};PiiqModule.prototype.showStroke=function(){var a=this;a.stroke.stop();a.stroke.attr("stroke-opacity",1);a.stroke.animate({stroke:a.overColor,"stroke-width":a.sWidth},a.dur);a.hasNotch&&a.changeNotchColor(a.overColor)};PiiqModule.prototype.hideStroke=function(){var a=this;a.stroke.stop();a.stroke.animate({stroke:a.overColor,"stroke-width":0},a.dur,function(){a.stroke.attr({"stroke-opacity":0})});a.hasNotch&&a.changeNotchColor(a.triColor,a.tStrokeColor)};PiiqModule.prototype.changeNotchColor=function(a,j){var i=this,h=1,f=1,d,e,g,b;switch(arguments.length){case 1:j=a;break;case 0:a=i.triColor;j=i.tStrokeColor;break}d=i.triangle.attr("fill");e=i.triangle.attr("fill-opacity");g=i.tStroke.attr("stroke");b=i.tStroke.attr("stroke-opacity");if(a===0){h=0;a=d}else{if(e===0){i.triangle.attr("fill",a)}}if(j===0){f=0;j=g}else{if(b===0){i.tStroke.attr("stroke",j)}}i.triangle.stop();i.tStroke.stop();i.triangle.animate({fill:a,"fill-opacity":h},i.dur);i.tStroke.animateWith(i.triangle,{stroke:j,"stroke-opacity":f},i.dur)};var ColorwayButton=function(d){var b=this,a=$(d),e;$.extend(b,{$el:a,ew:a.width(),eh:a.height(),color1:"#"+a.data("colorway").split(",")[0],color2:"#"+a.data("colorway").split(",")[1],downOffset:12,dur:200,ease:"<",selected:false},{bhString:"M0 10L17 0L35 10L35 30L17 40L0 30L0 10",flString:"M2 11L17 2L17 38L2 29L2 11",tlString:"M2 11L17 2L17 19L2 11",frString:"M17 19L35 11L35 30L17 40",bhStringOver:"M0 12L17 2L35 12L35 30L17 40L0 30L0 10",flStringOver:"M2 13L17 4L17 38L2 29L2 13",tlStringOver:"M2 14L17 4L17 21L2 13",frStringOver:"M17 21L35 13L35 30L17 40",bhStringDown:"M0 22L17 12L35 22L35 30L17 40L0 30L0 10",flStringDown:"M2 24L17 14L17 38L2 29L2 24",tlStringDown:"M2 24L17 14L17 31L2 23",frStringDown:"M17 32L35 23L35 30L17 40"});e=Raphael(d,b.ew,b.eh);b.baseHex=e.path(b.bhString).attr({fill:b.color2,stroke:0});b.frontLeft=e.path(b.flString).attr({fill:b.color1,stroke:0});b.topLeft=e.path(b.tlString).attr({fill:"#000",stroke:0,opacity:0.1});b.frontRight=e.path(b.frString).attr({fill:"#000",stroke:0,opacity:0.15});if(!TOUCH_DEVICE){b.$el.hover(function(){b.selected===false&&b.goOver()},function(){b.selected===false&&b.comeUp()})}};ColorwayButton.prototype.goOver=function(){var a=this;a.frontLeft.animate({path:a.flStringOver},a.dur/4);a.baseHex.animate({path:a.bhStringOver},a.dur/4);a.frontRight.animate({path:a.frStringOver},a.dur/4);a.topLeft.animate({path:a.tlStringOver},a.dur/4);a.$el.addClass("over")};ColorwayButton.prototype.goDown=function(){var a=this;a.frontLeft.animate({path:a.flStringDown},a.dur);a.baseHex.animate({path:a.bhStringDown},a.dur);a.frontRight.animate({path:a.frStringDown},a.dur);a.topLeft.animate({path:a.tlStringDown},a.dur);a.selected=true;a.$el.addClass("selected").removeClass("over")};ColorwayButton.prototype.comeUp=function(){var b=this;var a=b.$el.hasClass("over")?3:b.downOffset;b.frontLeft.animate({path:b.flString},b.dur);b.baseHex.animate({path:b.bhString},b.dur);b.frontRight.animate({path:b.frString},b.dur);b.topLeft.animate({path:b.tlString},b.dur);b.selected=false;b.$el.removeClass("selected").removeClass("over")};var ColorwayModule=function(b){var a=this;$.extend(a,{$el:$(b),images:$(b).find("ul.images li"),cwButtons:[],dur:200,easeOnScreen:"easeOutExpo",easeOffScreen:"easeInExpo",currentImage:0,animating:false});a.$el.find(".cw_buttons a").each(function(d){a.cwButtons.push(new ColorwayButton(this));$(this).bind("click",function(f){f.preventDefault();f.stopPropagation();if(!$(this).hasClass("selected")){a.buttonClicked(d)}})});a.buttonClicked(0)};ColorwayModule.prototype.buttonClicked=function(e){var d=this,b,a;if(!d.animating){d.animating=true;for(b=0;b<d.cwButtons.length;b++){a=d.cwButtons[b];if(b===e){a.goDown();d.switchImages(e);$("p.colorway span").text(a.$el.attr("href").substring(1))}else{if(a.selected===true){a.comeUp()}}}}};ColorwayModule.prototype.switchImages=function(b){var a=this;a.images.eq(a.currentImage).animate({top:440},a.dur,a.easeOffScreen);$.when(a.images.eq(a.currentImage)).always(function(){a.images.eq(b).animate({top:48},a.dur,a.easeOnScreen);$.when(a.images.eq(b)).always(function(){a.animating=false});a.currentImage=b})};var PiiqPairs=function(a){var b=this,d=0,e;$.extend(b,{$els:{module:$(a),buttons:{}},curCatIndex:0,curItemIndex:0,isAnimating:false,transitionDur:400,categories:[],categoryPages:[],itemPages:[]});b.$els.catWindow=$("<div/>",{"class":"catWindow"}).appendTo(b.$els.module);b.$els.catTray=$("<ul/>",{"class":"catTray"}).appendTo(b.$els.catWindow);b.$els.itemWindow=$("<div/>",{"class":"itemWindow"}).appendTo(b.$els.module);b.$els.itemTray=$("<ul/>",{"class":"itemTray"}).appendTo(b.$els.itemWindow);var e=b.$els.module.find(".pairs").children("li");e.each(function(){var f=$(this).find(".products").children("li");b.categories.push(new PiiqPairsCategory($(this),d));d+=f.length;f.find("*:not(img)").remove();f.appendTo(b.$els.itemTray)}).remove();e.find("*:not(img)").remove();e.appendTo(b.$els.catTray);b.catHt=b.$els.catTray.find("li").eq(0).outerHeight(true);b.itemHt=b.$els.itemTray.find("li").eq(0).outerHeight(true);b.$els.buttons.randomizeFake=$("<span/>",{"class":"randomButtonFake"}).appendTo(b.$els.module);(Raphael(b.$els.buttons.randomizeFake.get(0),108,108)).circle(54,54,53).attr({fill:"#edb122",stroke:0});b.$els.buttons.randomizeFake.append($("<span/>"));b.$els.buttons.randomize=$("<span/>",{"class":"randomButton",click:function(){b.randomize()}}).appendTo(b.$els.module);(Raphael(b.$els.buttons.randomize.get(0),108,108)).circle(54,54,54).attr({fill:"#00c7df",stroke:0});b.$els.buttons.randomize.append($("<span/>"));if(!TOUCH_DEVICE){b.$els.buttons.randomize.children().hide();b.$els.buttons.randomize.bind({mouseenter:function(){$(this).children().show()},mouseleave:function(){$(this).children().hide()}})}b.$els.buttons.categoryUp=$("<span/>",{"class":"button up",click:function(){!$(this).hasClass("disabled")&&b.turnTo(b.curCatIndex-1,0)}}).appendTo(b.$els.catWindow);b.$els.buttons.categoryDown=$("<span/>",{"class":"button down",click:function(){!$(this).hasClass("disabled")&&b.turnTo(b.curCatIndex+1,0)}}).appendTo(b.$els.catWindow);b.$els.buttons.itemUp=$("<span/>",{"class":"button up",click:function(){!$(this).hasClass("disabled")&&b.turnTo(b.curCatIndex,b.curItemIndex-1)}}).appendTo(b.$els.itemWindow);b.$els.buttons.itemDown=$("<span/>",{"class":"button down",click:function(){!$(this).hasClass("disabled")&&b.turnTo(b.curCatIndex,b.curItemIndex+1)}}).appendTo(b.$els.itemWindow);b.$els.categoryPages=$("<div/>",{"class":"pagination"}).appendTo(b.$els.catWindow);b.$els.itemPages=$("<div/>",{"class":"pagination"}).appendTo(b.$els.itemWindow);b.$els.categoryTitle=$("<h4/>").appendTo(b.$els.catWindow);b.$els.itemTitle=$("<h4/>").appendTo(b.$els.itemWindow);b.$els.itemLink=$("<a/>",{"class":"productLink",href:"#",text:"View Product Online",target:"_blank"}).appendTo(b.$els.itemWindow);b.$els.itemLogo=$("<img/>",{"class":"productLogo",src:""}).appendTo(b.$els.itemWindow);b.updateUI()};PiiqPairs.prototype.turnTo=function(a,d){var e=this,f,b;a=(a+e.categories.length)%e.categories.length;d=(d+e.categories[a].items.length)%e.categories[a].items.length;if(!e.isAnimating&&(a!==e.curCatIndex||d!==e.curItemIndex)){e.isAnimating=true;e.curCatIndex=a;e.curItemIndex=d;f=e.catHt*a*-1;b=e.itemHt*(e.categories[a].itemOffset+d)*-1;e.$els.catTray.animate({top:f},e.transitionDur,"easeInOutBack");e.$els.itemTray.animate({top:b},e.transitionDur,"easeInOutBack");$.when(e.$els.catTray,e.$els.itemTray).always(function(){e.isAnimating=false});e.updateUI()}};PiiqPairs.prototype.updateUI=function(){var a=this,g,f,k,h,b,e=a.transitionDur/2,l=a.curCatIndex,d=a.curItemIndex,j=a.categories;if(j.length<=1){a.$els.buttons.categoryUp.addClass("disabled").stop(true).fadeTo(300,0);a.$els.buttons.categoryDown.addClass("disabled").stop(true).fadeTo(300,0)}else{a.$els.buttons.categoryUp.removeClass("disabled").stop(true).fadeTo(300,1);a.$els.buttons.categoryDown.removeClass("disabled").stop(true).fadeTo(300,1)}if(j[l].items.length<=1){a.$els.buttons.itemUp.addClass("disabled").stop(true).fadeTo(300,0);a.$els.buttons.itemDown.addClass("disabled").stop(true).fadeTo(300,0)}else{a.$els.buttons.itemUp.removeClass("disabled").stop(true).fadeTo(300,1);a.$els.buttons.itemDown.removeClass("disabled").stop(true).fadeTo(300,1)}if(j.length<=1){a.$els.categoryPages.empty();a.categoryPages=[]}else{if(a.categoryPages.length!==j.length){a.$els.categoryPages.empty();a.categoryPages=[];for(g=0;g<j.length;g++){a.categoryPages.push((Raphael($("<div/>",{"class":"page",click:function(){a.turnTo(a.$els.categoryPages.find(".page").index(this),0)}}).appendTo(a.$els.categoryPages).get(0),6,10)).rect(0,0,6,6).attr({fill:g===l?"#00c7df":"#d9d9d3",stroke:0}))}}else{for(g=0;g<a.categoryPages.length;g++){a.categoryPages[g].attr("fill",g===l?"#00c7df":"#d9d9d3")}}}if(j[l].items.length<=1){a.$els.itemPages.empty();a.itemPages=[]}else{if(a.itemPages.length!==j[l].items.length){a.$els.itemPages.empty();a.itemPages=[];for(f=0;f<j[l].items.length;f++){a.itemPages.push((Raphael($("<div/>",{"class":"page",click:function(){a.turnTo(a.curCatIndex,a.$els.itemPages.find(".page").index(this))}}).appendTo(a.$els.itemPages).get(0),6,10)).rect(0,0,6,6).attr({fill:f===d?"#00c7df":"#d9d9d3",stroke:0}))}}else{for(f=0;f<a.itemPages.length;f++){a.itemPages[f].attr("fill",f===d?"#00c7df":"#d9d9d3")}}}k=a.$els.categoryTitle.fadeOut(e);h=a.$els.itemTitle.fadeOut(e);b=a.$els.itemLogo.fadeOut(e);$.when(k,h,b).always(function(){k.html(j[l].title);h.html(j[l].items[d].title);b.attr("src",j[l].items[d].logo).css({visibility:j[l].items[d].logo?true:false});a.$els.itemLink.attr("href",j[l].items[d].url).css({visibility:j[l].items[d].url?true:false});$(k).add(h).add(b).fadeIn(e)})};PiiqPairs.prototype.randomize=function(){var g=this,f=g.categories.length-1,d,a=g.$els.itemTray.find("li").length,i=(g.categories[g.curCatIndex].itemOffset+g.curItemIndex);var e=0,b=g.$els.buttons.randomize.get(0);!!((d=(Math.floor(Math.random()*(a-1))))+1)&&d>=i&&(d++);function h(){e=e>=360?0:e+12;b.style.MozTransform=b.style.WebkitTransform=b.style.OTransform="rotate("+e+"deg)";if(e>0){setTimeout(h,5)}}for(c=0;c<g.categories.length;c++){if(g.categories[c].itemOffset>d){f=c-1;break}}d-=g.categories[f].itemOffset;if(!TOUCH_DEVICE){h()}g.turnTo(f,d)};var PiiqPairsCategory=function(a,d){var b=this;$.extend(b,{$el:a,title:a.children("h4").eq(0).html(),items:[],itemOffset:d});b.$el.find(".products li").each(function(){b.items.push({logo:!!$(this).data("logo")?$(this).data("logo"):false,title:$(this).find("h4 a").eq(0).html(),url:$(this).find("a").length?$(this).find("a").eq(0).attr("href"):false})})};var PiiqHeader=function(){var a=this;$.extend(a,{$els:{header:$("#hd"),headerBar:$("#hd_bar"),overlay:$("<div/>",{id:"blackOverlay"}).fadeTo(0,0).hide().appendTo("body"),shaderStrip:$("<div/>",{"class":"shaderStrip checkedOverlay"}).appendTo("#hd"),shadow:$("<div/>",{"class":"shadow"}).appendTo("#hd_nav")}});$("#hd").find(".dd").each(function(){$("<div/>",{"class":"shadow"}).appendTo(this)})};var PiiqDropDown=function(d){var b=this,a=$(d);$.extend(b,{$el:a,wrapper:a.children(".sub_nav_wrapper").eq(0),master:a.parent(),ol:$("#blackOverlay")});b.$el.show();b.upMarg=(b.wrapper.children("ul").eq(0).height()*b.wrapper.children("ul").length*-1)-6;b.wrapper.css("margin-top",b.upMarg);if(!TOUCH_DEVICE){b.master.hoverIntent({over:function(){b.onOver()},out:function(){b.onOut()},interval:200,timeout:200})}};PiiqDropDown.prototype.onOver=function(){var d=this,a=$("body");d.wrapper.animate({"margin-top":0},{duration:250,easing:"easeOutCirc"});d.ol.stop(true).show().fadeTo(200,0.3);d.master.addClass("down")};PiiqDropDown.prototype.onOut=function(){var a=this;a.wrapper.animate({"margin-top":a.upMarg},{duration:250,easing:"easeOutCirc"});a.ol.stop(true).fadeTo(200,0,function(){$(this).hide()});a.master.removeClass("down")};var ProductDD=function(b){var a=this;a.$el=$(b);a.lis=a.$el.children(".sub_nav_wrapper").children("ul").children("li:not(.empty)");a.pdcs=[];a.lis.each(function(){a.pdcs.push(new ProductDDComponent(this))})};var ProductDDComponent=function(e){var d=this,b=3,a=3;$.extend(d,{$el:$(e),curInd:0,cwList:$(e).find(".colorWays"),easingType:"easeOutQuad",timer:null,dWrap:$("<div/>",{"class":"dWrap"}),dots:[],linkText:$("<span/>",{"class":"linkTxt",text:"Check it out"})});d.cws=d.cwList.children("li");d.iw=d.cws.eq(0).width();d.cwList.width(d.iw*d.cws.length);d.gs=new GreyScaler(d.cws.eq(0).find("img"),"quad");d.$el.children("a").eq(0).append(d.dWrap).append(d.linkText);if(!TOUCH_DEVICE){d.$el.hoverIntent({over:function(){d.onOver()},out:function(){d.onOut()},interval:0,timeout:50})}d.r=Raphael(d.dWrap.get(0));d.cws.each(function(f){var g=d.r.circle(b,a,2.5).attr({stroke:0,fill:"#adafb0"});$(g.node).bind("click",function(h){h.preventDefault();h.stopPropagation();d.curInd=f-1;d.moveCws(true)});d.dots.push(g);b+=7})};ProductDDComponent.prototype.onOver=function(){var a=this;a.gs.$el.css("visibility","visible");$.support.opacity?a.gs.canvas.stop(true).fadeTo(200,0):a.gs.canvas.css("visibility","hidden");a.timer=setTimeout(function(){a.moveCws()},1500);a.dots[a.curInd].attr({fill:"#00d8df"})};ProductDDComponent.prototype.onOut=function(){var b=this,a;clearTimeout(b.timer);b.curInd=-1;b.moveCws(true);if($.support.opacity){b.gs.canvas.stop(true).fadeTo(200,1,function(){b.gs.$el.css("visibility","hidden")})}else{b.gs.$el.css("visibility","hidden");b.gs.canvas.css("visibility","visible")}for(a=0;a<b.dots.length;a++){b.dots[a].attr({fill:"#adafb0"})}};ProductDDComponent.prototype.moveCws=function(g){var e=this,b=e.$el.find("a"),f,h,d;clearTimeout(e.timer);b.attr("href",b.attr("href").split("#")[0]+"#"+e.cws.eq((e.curInd+1)%e.cws.length).data("colorway"));if(e.cws.length>1){e.curInd++;if(e.curInd>=e.cws.length){f=e.cwList.find("li").clone().appendTo(e.cwList);e.cwList.width(e.iw*e.cws.length*2);h=e.curInd*e.iw*-1;e.curInd=0}else{h=e.curInd*this.iw*-1}e.cwList.animate({marginLeft:h},{duration:200,easing:this.easingType,complete:!f?$.noop:function(){var a=(e.iw*e.cws.length);f.remove();e.cwList.css({marginLeft:"+="+a,width:a})}})}else{e.curInd=0}for(d=0;d<e.dots.length;d++){e.dots[d].attr({fill:d===e.curInd?"#00d8df":"#adafb0"})}!!g||(e.timer=setTimeout(function(){e.moveCws()},1500))};var TeamDD=function(b){var a=this;a.$el=$(b);a.lis=a.$el.children(".sub_nav_wrapper").children("ul").children("li:not(.empty)");a.tdcs=[];a.lis.each(function(){a.tdcs.push(new TeamDDComponent(this))})};var TeamDDComponent=function(b){var a=this,d;a.$el=$(b);a.$np=a.$el.find(".nameplate").eq(0);a.easingType="easeOutExpo";a.gs=new GreyScaler(a.$el.find("img"),"none");a.rHold=$("<div>",{"class":"rHold"}).appendTo(a.$np);a.iHold=$("<div>",{"class":"iHold"}).appendTo(a.$np);a.rh=a.rHold.height();a.rw=a.rHold.width();a.r1=Raphael(a.rHold.get(0));a.triangle=a.r1.path("M0 0L60 60").attr({stroke:"#f9f9f9"});$("<span/>",{"class":!!a.$np.data("icon")?a.$np.data("icon"):"team"}).appendTo(a.iHold);if(!TOUCH_DEVICE){a.$el.hoverIntent({over:function(){a.onOver()},out:function(){a.onOut()},interval:0,timeout:50})}};TeamDDComponent.prototype.onOver=function(){var a=this;a.gs.$el.css("visibility","visible");$.support.opacity?a.gs.canvas.stop(true).fadeTo(200,0):a.gs.canvas.css("visibility","hidden")};TeamDDComponent.prototype.onOut=function(){var a=this;if($.support.opacity){a.gs.canvas.stop(true).fadeTo(200,1,function(){a.gs.$el.css("visibility","hidden")})}else{a.gs.$el.css("visibility","hidden");a.gs.canvas.css("visibility","visible")}};var setupTeamListDetail=function(){var a=$("body").attr("class").split(/\s+/);var d=$(".sportsMembersList li");var g;$.each(a,function(i,h){if(h.lastIndexOf("member_",0)===0){g=h.substring(h.lastIndexOf("_")+1)}});var e=d.filter("."+g);var b=e.find("img").eq(0);e.addClass("currentPage");e.children("a").data({notch:"#989898",linkStroke:"#989898"}).addClass("selected");var f=$("<div/>",{"class":"checkedOverlay"});f.width(b.width()).height(b.height()).css({top:0,left:0,"z-index":0}).insertAfter(b)};var PiiqTooltip=function(a,d){var b=this;a=!!a?a:$("body");b._$parent=a;b._view=$("<div />",{"class":"tooltip"}).appendTo(a);!!d&&b.setHTML(d);$(window).bind("resize",function(){b.calcSizes()});b.calcSizes()};PiiqTooltip.prototype.calcSizes=function(){var a=this;a._view.detach();a._parLeft=a._$parent.offset().left;a._parTop=a._$parent.offset().top;a._parWd=a._$parent.outerWidth(false);a._parHt=a._$parent.outerHeight(false);a._view.appendTo(a._$parent);a.resize()};PiiqTooltip.prototype.resize=function(){var d=this,b=d._view.css("display"),a=d._view.css("marginTop"),e=d._view.css("marginLeft");d._view.appendTo("body").css({display:"block",marginTop:0,marginLeft:0,visibility:"hidden"});d._view.css({width:"auto",height:"auto"});d._view.css({width:d._view.width()+1,height:d._view.height()});d._view.appendTo(d._$parent).css({display:!!b?b:"none",marginTop:a,marginLeft:e,visibility:"visible"});return this};PiiqTooltip.prototype.setHTML=function(b){var a=this;a._view.html(b);a.resize();return this};PiiqTooltip.prototype.show=function(b){var a=this;!!b&&a.setHTML(b);a._$parent.bind("mousemove",function(d){a.update(d)});a._view.show();if($.support.opacity){a._view.fadeTo(0,0).fadeTo(100,1)}};PiiqTooltip.prototype.hide=function(){var a=this;a._view.hide();a._$parent.unbind("mousemove")};PiiqTooltip.prototype.update=function(i){var k=this;var g=!!i?i.pageX:k._parLeft;var f=!!i?i.pageY:k._parTop;var b=k._view.outerHeight();var h=k._view.outerWidth();var l=12;var d=g-k._parLeft;var j=f-k._parTop;var a;k._view.detach();a=$("body").width();k._view.appendTo(k._$parent);if(d<0||d>=k._parWd||j<0||j>=k._parHt){k.hide()}else{k._view.css({marginLeft:(g+h>a)?d-((g+h)-a):d,marginTop:j-(b+l)})}};var PiiqVideoPlayer=function(a,i,h,l){var k=this;var g=PIIQ_ASSET_PATH+"swf/PiiqVideoPlayer.swf";var f=h===true?"1":"0";var j=l||null;var b={videoUrl:escape(i),posterUrl:escape(j),autoPlay:f};var d={allowfullscreen:true,wmode:"opaque"};var e={id:"piiqVideoPlayer",name:"piiqVideoPlayer"};swfobject.embedSWF(g,a,"100%","100%","10.0.0",null,b,d,e)};var PiiqNewsControl=function(f,b,a){var d=this;d._isOpen=true;d._isFirst=true;d._currentIndex=-1;d._newsList=$(f);d._detailContent=$(b);d._detailContainer=$(a);d._listItems=this._newsList.children("li");d._tooltip=new PiiqTooltip();d._thumbs=[];var h=$(d._detailContainer.find("img.bg"));h.detach();var g=$("<div />").attr("class","productCarouselBg").css("background-image","url("+h.attr("src")+")");g.prependTo(d._detailContainer);var e=d._listItems.find(".thumb a");e.each(function(){var j=$("<div />",{"class":"checkedOverlay"});var i=$("<div />",{"class":"over"});var k=$(this);j.appendTo(this);i.appendTo(this);k.data("tooltip",new PiiqTooltip(k,k.parent().parent().find(".detail h3").html()));d._thumbs.push(new PiiqModule(this))}).bind({click:function(i){i.preventDefault();i.stopPropagation();$(this).data("tooltip").hide();d.listItemClick(this)},mouseenter:function(i){$(this).data("tooltip").update(i);$(this).data("tooltip").show()},mouseleave:function(i){$(this).data("tooltip").hide()}});d.selectNewsItem(0);d._isFirst=false};PiiqNewsControl.prototype.selectNewsItem=function(h){var k=this;if(k._currentIndex===h){return}if(k._currentIndex!==-1){var a=$(k._listItems[k._currentIndex]).find(".thumb a");a.removeClass("selected");var i=k._thumbs[k._currentIndex];i.hideStroke();i.overColor="#00bcd4"}k._currentIndex=h;var l=$(k._listItems[h]);var j=l.find(".detail");var m=j.clone();k._detailContent.empty();k._detailContent.append(m);var d=m.find("img");if(typeof(d.data("video"))!="undefined"){if(swfobject.hasFlashPlayerVersion("10.0.0")){var f="videoContainer";var b=m.find(".media");b.empty();var e=$("<div />").attr("id",f);b.append(e);var g=k._isFirst?false:true;new PiiqVideoPlayer(f,d.data("video"),g,d.attr("src"))}}var a=$(k._listItems[k._currentIndex]).find(".thumb a");a.addClass("selected");var i=k._thumbs[k._currentIndex];i.overColor="#989898";i.showStroke();i.changeNotchColor(0);k._detailContent.hide();k._detailContent.fadeIn(300)};PiiqNewsControl.prototype.closeDetail=function(){var a=this;a._isOpen=false;a._currentIndex=-1;a._detailContainer.slideUp()};PiiqNewsControl.prototype.openDetail=function(){var a=this;a._isOpen=true;a._detailContainer.slideDown()};PiiqNewsControl.prototype.listItemClick=function(b){var d=this;var e=$(b).parent().parent();var a=d._listItems.index(e);d.selectNewsItem(a)};function PiiqProductLandingFamily(a){var b=this;$.extend(this,{enterTimer:null,enterWait:150,leaveTimer:null,leaveWait:150,$els:$(a),boxes:[]});b.$els.each(function(){var d=this;b.boxes.push(new PiiqProductLandingBox(this,b));if(!TOUCH_DEVICE){$(this).hover(function(f){clearTimeout(b.leaveTimer);b.enterTimer=setTimeout(function(){b.highlightAll(d)},b.enterWait)},function(){clearTimeout(b.enterTimer);b.leaveTimer=setTimeout(function(){b.unhighlightAll()},b.leaveWait)})}})}PiiqProductLandingFamily.prototype.highlightAll=function(d){var e=this,a,f;for(a=0,f=e.boxes.length;a<f;a++){if(!e.boxes[a].$el.is(d)){e.boxes[a].highlightAsRelated()}}return this};PiiqProductLandingFamily.prototype.unhighlightAll=function(){var d=this,a,e;for(a=0,e=d.boxes.length;a<e;a++){d.boxes[a].unhighlightAsRelated()}return this};function PiiqProductLandingBox(b,a){var d=this;$.extend(this,{family:a,$el:$(b),piiqModule:$(b).data("piiqModuleRef"),tooltip:new PiiqTooltip($(b),$(b).find("h6").html())});if(!TOUCH_DEVICE){d.$el.hover(function(f){d.tooltip.update(f);d.tooltip.show();d.$el.removeClass("related")},function(){d.tooltip.hide()})}}PiiqProductLandingBox.prototype.highlightAsRelated=function(){var a=this;a.$el.addClass("related")};PiiqProductLandingBox.prototype.unhighlightAsRelated=function(){var a=this;a.$el.removeClass("related")};var PiiqProductDetail=function(e){var b=this;b._carouselContainer=$(e);b._currentColor=null;b._currentView=null;b._currentColorContainer=null;b._currentColorCta=null;b._validColors=[];b._validViews=[];b._colorButtons=[];b._currentImage=null;b._previousImage=null;b._prevBtn=null;b._nextBtn=null;b._hotspotsContainer=null;b._tooltip=new PiiqTooltip();b._retailersOpen=false;b._thumbs=[];var h=$(b._carouselContainer.find("img.bg"));h.detach();var g=$("<div />").attr("class","productCarouselBg").css("background-image","url("+h.attr("src")+")");g.prependTo(b._carouselContainer);var a=$(".modelColors > li");a.each(function(i,j){b._validColors.push($(j).data("name"))});var f=$(a.get(0)).find(".colorThumbs a");f.each(function(i,j){b._validViews.push($(j).data("view"))});b._currentView=b._validViews[0];b._carouselContainer.find(".cw_buttons a").each(function(i,j){b._colorButtons.push(new ColorwayButton(this));$(this).bind("click",function(k){k.preventDefault();k.stopPropagation();b.selectColorway(b._validColors[i])})});b._carouselContainer.find(".colorThumbs a").each(function(i,j){b._thumbs.push(new PiiqModule(this,0));$(this).bind("click",function(k){k.preventDefault();k.stopPropagation();b.selectView($(this).data("view"),false)})});b._carouselContainer.find("a.retailers").each(function(i,j){$(this).bind("click",function(k){k.preventDefault();k.stopPropagation();b.toggleRetailersMenu()})});b._hotspotsContainer=$("<div />").attr("class","hotspotsContainer");b._prevBtn=$("<span />").attr("class","btn left");b._nextBtn=$("<span />").attr("class","btn right");var d=b._carouselContainer.find(".content");d.append(b._hotspotsContainer,b._prevBtn,b._nextBtn);b._prevBtn.bind("click",function(i){i.preventDefault();b.prevView()});b._nextBtn.bind("click",function(i){i.preventDefault();b.nextView()});if(b._validViews.length<2){b._prevBtn.hide();b._nextBtn.hide()}$(window).bind("hashchange",function(){var i;if(!!(i=b.hashCheck())){b.selectColorway(i)}});if(!!(hash=b.hashCheck())){b.selectColorway(hash);return}b.selectColorway(b._validColors[0])};PiiqProductDetail.prototype.hashCheck=function(){var a=location.hash.substr(1);return(a&&this.getIndexForColor(a)!==-1)?a:false};PiiqProductDetail.prototype.toggleRetailersMenu=function(){var a=this;if(a._retailersOpen){a.hideRetailersMenu()}else{a.showRetailersMenu()}};PiiqProductDetail.prototype.showRetailersMenu=function(){var a=this;a._retailersOpen=true;a._carouselContainer.find("a.retailers").each(function(b,d){$(d).addClass("open")});a._carouselContainer.find("div.retailersMenu").each(function(b,d){$(d).fadeIn(100)});$("body").bind("mousedown",function(d){var b=a._carouselContainer.find("div.retailersContainer");if(b.find(d.target).length){return}a.hideRetailersMenu()})};PiiqProductDetail.prototype.hideRetailersMenu=function(){var a=this;a._retailersOpen=false;a._carouselContainer.find("a.retailers").each(function(b,d){$(d).removeClass("open")});a._carouselContainer.find("div.retailersMenu").each(function(b,d){$(d).hide()});$("body").unbind("mousedown")};PiiqProductDetail.prototype.prevView=function(){var d=this;var a=d.getIndexForView(d._currentView);var b=a-1;if(b<0){b=d._validViews.length-1}d.selectView(d._validViews[b],false)};PiiqProductDetail.prototype.nextView=function(){var d=this;var a=d.getIndexForView(d._currentView);var b=a+1;if(b>=d._validViews.length){b=0}d.selectView(d._validViews[b],false)};PiiqProductDetail.prototype.selectColorway=function(a){var h=this;if(a===h._currentColor){return}if(h.getIndexForColor(a)===-1){return}h._currentColor=a;location.hash=h._currentColor;var j=h.getIndexForColor(h._currentColor);for(var g=0;g<h._colorButtons.length;g++){var f=h._colorButtons[g];if(g===j){f.goDown();$("p.colorway span").text(f.$el.attr("href").substring(1))}else{if(f.selected===true){f.comeUp()}}}var e=h._carouselContainer.find(".productModel");e.each(function(i,k){var l=$(k);if(l.hasClass(h._currentColor)){l.show()}else{l.hide()}});var d=h._carouselContainer.find(".colorLabel");d.each(function(i,k){var l=$(k);if(l.hasClass(h._currentColor)){l.show()}else{l.hide()}});var b=$(".modelColors > li");b.each(function(k,l){var m=$(l);var i=m.find("ul.colorThumbs");if(m.data("name")===h._currentColor){h._currentColorContainer=m;h._currentColorCta=m.data("cta");i.show()}else{i.hide()}});h.selectView(h._currentView,true)};PiiqProductDetail.prototype.selectView=function(o,h){var q=this;var p=q.getIndexForView(o);if(p===-1){return}if(o===q._currentView&&!h){return}q._hotspotsContainer.empty();var n;var b=200;var k=0;var g="easeInExpo";var m="easeOutExpo";var d=q.getIndexForView(q._currentView);var l=p-d;var f=l===-1||l===q._validViews.length-1?"left":"right";if(q._currentImage!==null){q._previousImage=q._currentImage;k=300;if(h){n={top:625};if($.support.opacity){n.opacity=0}}else{n={};if($.support.opacity){n.left=f==="left"?250:-250;n.opacity=0}else{n.top=625}}q._previousImage.animate(n,{duration:b,easing:g,queue:true,complete:function(){q.hidePreviousImageComplete()}})}q._currentView=o;q._currentImage=q._currentColorContainer.find(".colorViews li."+q._currentView);q._currentImage.css("top",0).css("left",0);if($.support.opacity){q._currentImage.css("opacity",1)}q._currentImage.show();if(h){n={top:0};if($.support.opacity){n.opacity=1}q._currentImage.css("top","625px");if($.support.opacity){q._currentImage.css("opacity","0")}}else{n={};if($.support.opacity){n.left=0;n.opacity=1;var e=f==="left"?"-500px":"500px";q._currentImage.css("left",e);q._currentImage.css("opacity","0")}else{n.top=0;q._currentImage.css("top","625px")}}q._currentImage.delay(k).animate(n,{duration:b,easing:m,queue:true,complete:function(){q.showCurrentImageComplete()}});for(var j=0;j<q._thumbs.length;j++){var a=q._thumbs[j];if(a.$el.data("view")===q._currentView){a.overColor="#989898";a.showStroke();a.$el.addClass("selected")}else{if(a.$el.hasClass("selected")){a.overColor="#00bcd4";a.hideStroke();a.$el.removeClass("selected")}}}};PiiqProductDetail.prototype.showCurrentImageComplete=function(){var a=this;a.updateHotspots()};PiiqProductDetail.prototype.hidePreviousImageComplete=function(){var a=this;a._previousImage.hide()};PiiqProductDetail.prototype.updateHotspots=function(){var d=this,a=d._carouselContainer.find("ul.viewsHotspots li."+d._currentView+" li"),b=0;a.each(function(f,i){var j=$(i),h=j.html(),g;g=$("<span />").attr("class","hotspot").attr("data-label",h).css("top",j.data("y")).css("left",j.data("x"));b+=80;g.hover(function(k){d._tooltip.update(k);d._tooltip.show($(this).data("label"))},function(k){d._tooltip.hide()});d._hotspotsContainer.append(g);if(jQuery.support.opacity){g.hide().delay(b).fadeIn(300)}else{g.show()}})};PiiqProductDetail.prototype.getIndexForColor=function(a){var d=this,b=d._validColors.length;while(b--){if(d._validColors[b]===a){return b}}return -1};PiiqProductDetail.prototype.getIndexForView=function(a){var d=this,b=d._validViews.length;while(b--){if(d._validViews[b]===a){return b}}return -1};
