var DEVELOPMENT=false;var MOBILE_SAFARI=(navigator.userAgent.toLocaleLowerCase().match(/(ipod|iphone|ipad|android)/)!==null);if(!DEVELOPMENT&&!MOBILE_SAFARI){$("body").append('<div id="loading"><div id="animation"></div></div>')}var SITE_LOADED=false;var GRID_MARGIN=10;var MENU_HEIGHT=51;var FOOTER_HEIGHT=66;var MIN_WIDTH=960;var BASE_WIDTH=1024;var RATIO;var WINDOW;var WINDOW_HEIGHT=0;var WINDOW_WIDTH=0;var SCROLL_TOP=0;var IS_WEBKIT=(navigator.userAgent.toLocaleLowerCase().match(/(webkit)/)!==null);var BODY;var HTML;var CSS_TRANSFORM_3D;var CURRENT_PAGE;var CURRENT_PAGE_CHAPTERS;var CURRENT_PAGE_LINES;$(function(){if(!DEVELOPMENT&&!MOBILE_SAFARI){Animator.animate($("#animation"),20,69,false,function(){Loader.complete=true;Loader.remove()})}jQuery.fx.interval=30;WINDOW=$(window);BODY=$("body");HTML=$("html");CSS_TRANSFORM_3D=HTML.hasClass("csstransforms3d");if(HTML.hasClass("ie6")){SITE_LOADED=true;HTML.css({overflow:"hidden"});return}PageNavigation.init();Header.init();Footer.init();Bind.live();WINDOW.resize(function(){getWindowHeight();WINDOW_WIDTH=WINDOW.width();SCROLL_TOP=WINDOW.scrollTop();Grid.refresh();Grid.animate();Header.resize()});WINDOW.scroll(function(){SCROLL_TOP=WINDOW.scrollTop();Header.mouseOut();Grid.animate();Blog.thumbnailBar.update();Lazyloader.update();MouseListener.scroll()})});function getWindowHeight(){if(typeof(window.innerWidth)==="number"){WINDOW_HEIGHT=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){WINDOW_HEIGHT=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){WINDOW_HEIGHT=document.body.clientHeight}}}}var Loader={complete:false,remove:function(){if(Loader.complete===true&&SITE_LOADED){Animator.stop($("#animation"));$("#loading").animate({left:-WINDOW_WIDTH},function(){$(this).remove()})}}};var Bind={all:function(){Tracker.init();MouseListener.init();Formhelper.placeholder();$(".current-page div.carousel").carousel({isMobile:MOBILE_SAFARI});PageNavigation.bindListeners($(".current-page"));if($("html").hasClass("ie8")){$("input.text,input.button").css({behavior:"url(/css/ie/PIE.htc)","z-index":100})}$("html, body").animate({scrollTop:0},100);if(IS_WEBKIT){if($(".fixed-line",CURRENT_PAGE).length>0||$(".fixed-block",CURRENT_PAGE).length>0){CURRENT_PAGE.addClass("no-perspective");CURRENT_PAGE.removeClass("perspective")}else{CURRENT_PAGE.removeClass("no-perspective");CURRENT_PAGE.addClass("perspective")}}if(MOBILE_SAFARI){$("img").css("webkit-transform","translateZ(0)")}},page:function(a){switch(a){case"home":if(!MOBILE_SAFARI){$(".auto-video-player-placeholder").remove()}else{$(".auto-video-player").remove()}TweetSlideshow.init(true);VideoPlayer.init();Storefinder.home.init();PageNavigation.internalNavigateTo();break;case"collection-item":Collection.init();Storefinder.collection.init();break;case"storefinder":Storefinder.page.init();break;case"team-rider":TweetSlideshow.init(false);break;case"contact":Formhelper.init();break;case"lookbook":break;case"blog":Blog.init();break}},live:function(){Social.init();$("a.deeplink").live("click",function(){if($(this).hasClass("same-window")){window.location.href=$(this).attr("href")}else{window.open(this.getAttribute("href"),"_blank")}return false});$("a.change").live("click",function(a){a.preventDefault();PageNavigation.change=true;PageNavigation.internal=false;$("a.change").removeClass("active");$(this).addClass("active");$.address.value($(this).attr("href"))});$("#ninja-hover").live("click",function(){$("a:first",$(this).data("currentBlock")).click();MouseListener.ninja.reset();MouseListener.overview.reset()})}};var MouseListener={disabledTimer:0,disabled:false,init:function(){if(!MOBILE_SAFARI){MouseListener.normalButton.init();MouseListener.diamondButton.init();MouseListener.overview.init();MouseListener.gridButton.init();MouseListener.View360.init();$(".current-page .line-inner .block.button").mouseenter(function(){if($("#ninja-hover").data("currentBlock")){$("#ninja-hover").data("currentBlock").data("hovering",false)}if($(this).data("hovering")===true||MouseListener.disabled){return}$(this).data("hovering",true);MouseListener.ninja.mouseOver($(this));MouseListener.overview.mouseOver($(this));$("#ninja-hover").data("currentBlock",$(this))});$("#ninja-hover").mouseleave(function(){$("#ninja-hover").data("currentBlock").data("hovering",false);MouseListener.ninja.mouseOut($(this));MouseListener.overview.mouseOut($(this))})}else{$(".buttontitle").remove()}},overview:{speed:200,init:function(){var a=$(".buttontitle",".current-page .line-inner > .button");a.each(function(){$(this).css({bottom:-$(this).outerHeight()-2})})},mouseOver:function(a){MouseListener.overview.reset();if($(".buttontitle",a).length===0){return}$(".buttontitle",a).animate({bottom:0},MouseListener.overview.speed)},mouseOut:function(b){var a=b.data("currentBlock");if($(".buttontitle",a).length===0){return}$(".buttontitle",a).stop().animate({bottom:-$(".buttontitle",$("#ninja-hover").data("currentBlock")).outerHeight()-2},MouseListener.overview.speed)},reset:function(){if(!$("#ninja-hover").data("currentBlock")){return}$(".buttontitle",$("#ninja-hover").data("currentBlock")).stop().css({bottom:-$(".buttontitle",$("#ninja-hover").data("currentBlock")).outerHeight()-2})}},View360:{init:function(){$("#enable360 a").click(function(a){a.preventDefault()});$("#enable360 a").mouseover(function(){MouseListener.View360.mouseOver($(this))});$("#enable360 a").mouseout(function(){MouseListener.View360.mouseOut($(this))});$("#collection-image").mousedown(function(a){a.preventDefault();if($("#view360 img").data("view360")!=""){MouseListener.View360.mouseOver($("#enable360 a"))}})},click:function(){},mouseOver:function(a){Animator.animate(a,30,36)},mouseOut:function(a){Animator.stop(a)}},ninja:{timeout:"",speed:200,mouseOver:function(e){MouseListener.ninja.reset();var f=e.offset().top,b=e.offset().left,a=e.width(),g=e.height(),d=0;if($(".buttontitle",e).length>0){d=200}MouseListener.ninja.timeout=setTimeout(function(){$("#ninja-hover").css({display:"block",top:f-20,left:b-20,height:g+30,width:a+30});$("#ninja-border").css({height:g,width:a});$("#ninja-inner").css({top:10,left:10}).stop().animate({top:0,left:0},MouseListener.ninja.speed);e.stop().animate({left:"-10px",top:"-10px"},MouseListener.ninja.speed)},d)},mouseOut:function(a){clearTimeout(MouseListener.ninja.timeout);$("#ninja-hover").data("currentBlock").stop().animate({left:"0px",top:"0px"},MouseListener.ninja.speed,function(){$("#ninja-hover").css("display","none");a.data("hovering",false)});$("#ninja-inner").stop().animate({top:10,left:10},MouseListener.ninja.speed)},reset:function(){clearTimeout(MouseListener.ninja.timeout);if(!$("#ninja-hover").data("currentBlock")){return}$("#ninja-hover").data("currentBlock").stop().css({left:"0px",top:"0px"});$("#ninja-hover").css("display","none");$("#ninja-inner").stop().css({top:10,left:10})}},disable:function(){MouseListener.disabled=true;MouseListener.reset()},enable:function(){MouseListener.disabled=false},scroll:function(){MouseListener.disable();clearTimeout(MouseListener.disabledTimer);MouseListener.disabledTimer=setTimeout(MouseListener.enable,200)},reset:function(){MouseListener.ninja.reset();MouseListener.overview.reset()},gridButton:{lastOutX:0,lastOutY:0,beginX:"-100%",beginY:0,outX:"100%",outY:"100%",currentLineY:0,init:function(a){if(!a){a=".current-page .grid-button"}var b=$(".buttontitle",a);b.css({left:"-100%"});b.each(function(){var d=$(this).css("background-color");d=d.replace("rgb(","rgba(").replace(")",", .9)");$(this).css("background-color",d)});$(a).hover(function(d){if(MouseListener.gridButton.currentLineY<$(this).offset().top){MouseListener.gridButton.beginY="-100%";MouseListener.gridButton.beginX=0}else{if(MouseListener.gridButton.currentLineY>$(this).offset().top){MouseListener.gridButton.beginY="100%";MouseListener.gridButton.beginX=0}else{MouseListener.gridButton.beginY=0;if(($(this).offset().left-MouseListener.gridButton.lastOutX)<0){MouseListener.gridButton.beginX="100%"}else{if(($(this).offset().left-MouseListener.gridButton.lastOutX)>0){MouseListener.gridButton.beginX="-100%"}else{if(MouseListener.gridButton.outX!==0){MouseListener.gridButton.beginX=MouseListener.gridButton.outX}else{if(MouseListener.gridButton.outY!==0){MouseListener.gridButton.beginY=MouseListener.gridButton.outY}}}}}}MouseListener.gridButton.currentLineY=$(this).offset().top;$(".buttontitle",this).stop().css({left:MouseListener.gridButton.beginX,top:MouseListener.gridButton.beginY}).animate({left:0,top:0},300,"easeOutQuad")},function(d){MouseListener.gridButton.lastOutX=$(this).offset().left;MouseListener.gridButton.lastOutY=$(this).offset().top;if(SCROLL_TOP+d.clientY<MouseListener.gridButton.currentLineY){MouseListener.gridButton.outY="-100%";MouseListener.gridButton.outX=0}else{if(SCROLL_TOP+d.clientY>MouseListener.gridButton.currentLineY+$(this).height()){MouseListener.gridButton.outY="100%";MouseListener.gridButton.outX=0}else{MouseListener.gridButton.outY=0;if((d.clientX-MouseListener.gridButton.lastOutX)<0){MouseListener.gridButton.outX="-100%"}else{if((d.clientX-MouseListener.gridButton.lastOutX)>0){MouseListener.gridButton.outX="100%"}else{MouseListener.gridButton.outX=0}}}}$(".buttontitle",this).stop().animate({left:MouseListener.gridButton.outX,top:MouseListener.gridButton.outY},300,"easeOutQuad")})}},normalButton:{init:function(){$("a.button,.shop-button,input.button").hover(function(){$(this).stop().animate({backgroundPosition:"("+($(this).width()+40)+"px 0px)"},200,"easeOutQuad")},function(){$(this).stop().animate({backgroundPosition:"(0px 0px)"},100,"easeOutQuad")});$("a.button").not(".social-button,.facebook").mousedown(function(){$(this).css({position:"relative",top:"+1px"})}).mouseup(function(){$(this).css({position:"static"})})}},diamondButton:{init:function(){if(MOBILE_SAFARI){return}$(".diamond").hover(function(){$(".diamond-hover",$(this)).stop().animate({width:274},400,"easeOutQuad")},function(){$(".diamond-hover",$(this)).stop().animate({width:0},200,"easeOutQuad")})}}};var Header={open:false,navigationItems:0,timeout:"",init:function(){$("a#open-menu-action").click(function(a){a.preventDefault();if(Header.open){Header.open=false;Header.mouseOut()}else{Header.open=true;Header.mouseOver()}});$(".action").click(function(b){b.preventDefault();var a=$(this).attr("href");if($(".main").hasClass("home")){PageNavigation.internalNavigateTo(a)}else{PageNavigation.internal=false;$.address.value(PageNavigation.stripURL(a))}});$("#open-menu").mouseover(function(){Header.mouseOver(true)});$("header").mouseleave(Header.mouseOut);$("#breadcrumbs").data("defaults",{backgroundColor:$("#breadcrumbs").css("background-color")});setTimeout(function(){Header.mouseOver()},2500);Header.timeout=setTimeout(function(){Header.mouseOut()},4500);$("#back").hover(function(){$("#breadcrumbs").stop().animate({backgroundPosition:"(-10px 0)"},200)},function(){if($("#back").css("display")=="block"){$("#breadcrumbs").stop().animate({backgroundPosition:"(-15px 0)"},200)}});if(!MOBILE_SAFARI){$("#navigation .text-link").textHover()}Header.navigationItems=$("#navigation ul li").length;if(IS_WEBKIT){$("#chapter-title,#open-menu-action").css({paddingTop:5})}},mouseOver:function(a){if(a){clearTimeout(Header.timeout)}$("header").stop(true).animate({top:"0"},300)},mouseOut:function(){Header.open=false;$("header").animate({top:"-115px"},300)},reset:function(){var a=CURRENT_PAGE_CHAPTERS.length,d=$("#breadcrumbs").data("defaults"),b;if(a===1){b=CSSHelper.getStyle("."+CURRENT_PAGE_CHAPTERS.data("chapter-color")+"-bg");if(b!==""&&b.backgroundColor){$("#breadcrumbs").stop().animate({"background-color":b.backgroundColor});if(!MOBILE_SAFARI){$("#navigation .text-hover").textHover("setColor",b.backgroundColor)}return}}$("#breadcrumbs").stop(true).animate({"background-color":d.backgroundColor});$("#navigation .text-hover").textHover("setColor",d.backgroundColor);$("#chapter-title").text(Header.limitText(d.title))},highlightChapter:function(){var b=CURRENT_PAGE_CHAPTERS.length;if(b===1){return}var f=0;for(f;f<b;f++){var e=$(CURRENT_PAGE_CHAPTERS[f]),d=e;if(e.hasClass("block")){d=e.parents(".line")}var a=d.position().top,h=d.height();if(SCROLL_TOP===0){Header.reset();return}if(SCROLL_TOP+MENU_HEIGHT-1>a&&SCROLL_TOP+MENU_HEIGHT<(a+h)){if(e.data("chapter-active")!==true){$("#chapter-title").text(Header.limitText(e.data("chapter-title")));var g=CSSHelper.getStyle("."+e.data("chapter-color")+"-bg");if(g!==""&&g.backgroundColor){$("#breadcrumbs").stop(true,true).animate({"background-color":g.backgroundColor});if(!MOBILE_SAFARI){$("#navigation .text-hover").textHover("setColor",g.backgroundColor)}}}e.data("chapter-active",true);return}else{CURRENT_PAGE_CHAPTERS.data("chapter-active",false)}}},resize:function(){var b=WINDOW_WIDTH-(2*GRID_MARGIN)-$("nav h1").width()-$("#like").width()-20;b-=70;$("#navigation ul").css("margin-left",35).width(b);var a=0,d=0;for(d;d<Header.navigationItems;d++){a+=$("#navigation ul li").eq(d).width()}var f=(b-a)/(Header.navigationItems);$("#navigation ul li").each(function(){$(this).width($(this).width()+f)});TextHelper.fitText($("#navigation ul li"));if(!MOBILE_SAFARI){$("#navigation .text-hover").textHover("update")}var e=($("#navigation").height()-$("#navigation ul li a").height())/2;$("#navigation ul li a").css({"padding-top":e,"padding-bottom":e})},showBackButton:function(){$("#breadcrumbs").stop(true,true).css("background-position","-15px 0px");$("#back").show();$("#chapter-title").css("padding-left",5)},hideBackButton:function(){$("#breadcrumbs").stop(true,true).css("background-position","-30px 0px");$("#back").hide();$("#chapter-title").css("padding-left",35)},setBreadcrumbsBar:function(d,a,b,e){if(d&&a&&b&&e){$("#breadcrumbs").data("defaults").title=d;$("#breadcrumbs").data("defaults").backgroundColor=CSSHelper.getStyle("."+a+"-bg").backgroundColor;$("#chapter-title").text(Header.limitText(d));$("#chapter-title").css({display:"block"});$("#back").attr("href",PageNavigation.stripURL(b));$("#back").text(e)}Header.reset()},stickToTop:function(){Header.open=false;$("header").animate({top:"-115px"},300)},limitText:function(a){if(a.length>35){return a.substr(0,35)+"..."}else{return a}}};var Footer={init:function(){Footer.languageSelect.init()},languageSelect:{timer:"",open:false,hovering:false,init:function(){$("#language-selector a").click(function(a){a.preventDefault();if(Footer.languageSelect.open){Footer.languageSelect.open=false;Footer.languageSelect.mouseOut()}else{Footer.languageSelectorOpen=true;Footer.languageSelect.mouseOver()}});$("#choose-country, #language-selector").mouseenter(function(){Footer.languageSelect.hovering=true;Footer.languageSelect.mouseOver()});$("#choose-country, #language-selector").mouseleave(function(){Footer.languageSelect.hovering=false;Footer.languageSelect.timer=setTimeout(function(){if(!Footer.languageSelect.hovering){Footer.languageSelect.mouseOut()}},500)})},mouseOver:function(){clearTimeout(Footer.languageSelect.timer);$("#choose-country").show();var a=0;$("#choose-country > *").each(function(){a+=$(this).outerHeight(true)});$("#choose-country").stop().animate({height:a+FOOTER_HEIGHT},500,function(){if(MOBILE_SAFARI&&navigator.userAgent.toLocaleLowerCase().indexOf("os 5_")===-1){$("#choose-country").css("top",($("body").height()-$("#choose-country").height())+"px")}})},mouseOut:function(){$("#choose-country").stop().animate({height:0},500,function(){$("#choose-country").hide()})}},resize:function(a){$("#choose-country").mouseleave();if(a>=WINDOW_HEIGHT-FOOTER_HEIGHT){$("footer").css({top:a,bottom:"auto"}).show()}else{$("footer").css({top:"auto",bottom:0}).show()}var b=Math.floor($("footer").width()/3);$("#language-selector").width(b-12);$("#choose-country").width(b-12);TextHelper.fitText($("#choose-country"))}};var PageNavigation={change:false,initialized:false,currentPage:"",lastPage:"",lastDepth:0,pageData:{},internal:false,pageSwitchTimeout:0,init:function(){$("#container").addClass("current-page");PageNavigation.currentPage=$(".current-page");$.address.crawlable(true);$.address.strict(true);$.address.tracker(function(){});$.address.change(function(b){if(PageNavigation.internal===true){Tracker.trackPageview("/"+window.location.pathname.split("/")[1]+b.value);PageNavigation.internal=false;return}PageNavigation.internal=false;if(b.value==="/"){var a="/home";if($(".main").data("homelink")){a=PageNavigation.stripURL($(".main").data("homelink"))}b.value=a;$.address.value(b.value);return}else{var d=b.value.split("/").length;if(PageNavigation.change){PageNavigation.actionTo("/"+window.location.pathname.split("/")[1]+b.value);Tracker.trackPageview("/"+window.location.pathname.split("/")[1]+b.value);PageNavigation.change=false}else{PageNavigation.navigateTo("/"+window.location.pathname.split("/")[1]+b.value)}PageNavigation.lastDepth=d}});PageNavigation.initialized=true;PageNavigation.bindListeners($("header,footer"))},bindListeners:function(a){var b="";var d="";$("a:not(.blog-action,.action,.deeplink,.social, #open-menu-action, #show-archive, #show-filters)",a).each(function(){b=$(this).attr("href");if(b!=="#"){$(this).attr("href",PageNavigation.stripURL(b))}});$("a:not(.blog-action,.change,.action,.deeplink,.social, #open-menu-action, #show-archive, #show-filters)").address()},stripURL:function(b){if(b==undefined){return""}var a="http://"+window.location.host;if(b.indexOf(a)>-1){b=b.substring(a.length)}var d=b.split("/");d.splice(1,1);return d.join("/")},navigateTo:function(b){b=b.split("&")[0];var a=WINDOW_WIDTH;var d=$('<div id="container-'+$(".page").length+'" class="page" />').css({position:"absolute",left:0,opacity:0});$(d).load(b+" #container > *",function(e){if(MOBILE_SAFARI){Header.stickToTop()}var f=$(".main",d).attr("class");if(f){f=f.split("main ")[1];if(f.split("standard-page ").length>1){f=f.split("standard-page ")[1]}}else{f="error"}TimeoutManager.clearTimeouts();Animator.cleanup(PageNavigation.currentPage);$(PageNavigation.currentPage).removeClass("current-page");$(d).addClass("current-page");Lazyloader.init(d);$("div.line",d).each(function(){if($(this).find(".line-inner").length===0){$(this).wrapInner('<div class="line-inner" />')}});CURRENT_PAGE=d;CURRENT_PAGE_LINES=$(".line",d);CURRENT_PAGE_CHAPTERS=$(".chapter",d);BODY.append(d);TextHelper.fitTextStoreSize();WINDOW_HEIGHT=WINDOW.height();WINDOW_WIDTH=WINDOW.width();SCROLL_TOP=WINDOW.scrollTop();Grid.refresh("false",function(){Bind.all();Bind.page(f);var g=$("#page-title",e).text();document.title=g;Tracker.trackPageview(b);var i=$("#page-title",e).data("color");var j=$("#back",e).text();var h=$("#back",e).attr("href");Header.setBreadcrumbsBar(g.split("|")[0],i,h,j);PageNavigation.pageSwitchTimeout=setTimeout(function(){clearTimeout(PageNavigation.pageSwitchTimeout);TransitionManager.switchPage(PageNavigation.currentPage,d);PageNavigation.currentPage=d},500)})})},setPageData:function(a){PageNavigation.data=a},clearPageData:function(){PageNavigation.data={}},actionTo:function(a){a=a.split("&")[0];$.get(a+" #container > *",function(b){var d=$(".main",$(b)).attr("class");if(d){d=d.split("main ")[1]}if(PageActions[d]){PageActions[d](b)}})},internalNavigateTo:function(a){if(!a){a=$(".home").data("subpage");$(".home").data("subpage","")}if(a===""){return}PageNavigation.internal=true;$.address.value(PageNavigation.stripURL(a));$(".current-page .line").each(function(){var b=$(this);if(b.data("link")&&b.data("link")===a){$("html,body").delay(500).animate({scrollTop:b.data("bounds").top-MENU_HEIGHT+5});PageNavigation.internal=false;return}})}};var PageActions={"collection-item":function(a){Collection.swapColors(a)},blog:function(a){Blog.changeFilter(a)}};var TransitionManager={switchPage:function(d,b){var e=parseInt($(".main",d).data("level"),10);var a=parseInt($(".main",b).data("level"),10);if(e>a){Transitions.slideRight(d,b)}else{if(a>e){Transitions.slideLeft(d,b)}else{Transitions.fadeIn(d,b)}}if(a>1){Header.showBackButton()}else{Header.hideBackButton()}},dispose:function(a){$(a).remove()}};var Transitions={start:function(){$(".fixed-block").css({opacity:0});Transitions.hideScrollbar();MouseListener.disable();MouseListener.reset()},complete:function(b,a){$(b).hide();Transitions.restoreScrollbar();MouseListener.enable();Lazyloader.update();$(a,b).removeClass("slide in out reverse");TransitionManager.dispose($(b));if(!SITE_LOADED){SITE_LOADED=true;Loader.remove()}$(".fixed-block").animate({opacity:1},300)},fadeIn:function(b,a){$(a).css({opacity:1}).fadeIn(400,function(){Transitions.complete($(b),$(a))});$(b).fadeOut(400)},slideRight:function(b,a){Transitions.start();if(CSS_TRANSFORM_3D){if(SITE_LOADED){$(a).css({opacity:1}).addClass("slide in reverse")}$(b).bind("animationend webkitAnimationEnd",function(d){Transitions.complete($(b),$(a));$(b).unbind("animationend webkitAnimationEnd")}).addClass("slide out reverse")}else{if(SITE_LOADED){$(a).css({left:-WINDOW_WIDTH,opacity:1}).show().animate({left:0},400)}$(b).animate({left:WINDOW_WIDTH},400,function(){Transitions.complete($(b),$(a))})}},slideLeft:function(b,a){Transitions.start();if(CSS_TRANSFORM_3D){$(a).css({opacity:1}).addClass("slide in");$(b).bind("animationend webkitAnimationEnd",function(d){Transitions.complete($(b),$(a));$(b).unbind("animationend webkitAnimationEnd")}).addClass("slide out")}else{$(b).animate({left:-WINDOW_WIDTH},400,function(){Transitions.complete($(b),$(a))});$(a).css({left:WINDOW_WIDTH,opacity:1}).show().animate({left:0},400)}},hideScrollbar:function(){$("html").css("overflow-x","hidden")},restoreScrollbar:function(){$("html").css("overflow-x",Grid.overflowX)}};var Grid={firstInit:true,scrollableBlocks:0,scrollableBlocksCount:0,newPageHeight:0,overflowX:"scroll",refresh:function(f,g){if(WINDOW_WIDTH<MIN_WIDTH){Grid.overflowX="scroll";$("html").css("overflow-x","scroll");if(!Grid.firstInit){return}else{WINDOW_WIDTH=MIN_WIDTH}}else{Grid.overflowX="auto";$("html").css("overflow-x","auto")}RATIO=WINDOW_WIDTH/BASE_WIDTH;var b=0,e=0,d=0;$(".current-page, header, .main, footer").width(WINDOW_WIDTH-(GRID_MARGIN*2));if(Grid.firstInit){Header.resize()}var a=false;$(".current-page div.line").each(function(){var o=$(this),m=WINDOW_WIDTH-GRID_MARGIN,j=0,n=0,i=0;o.find("div.block").each(function(){var q=$(this);if(q.data("weight")){var p=Math.floor(parseFloat(q.data("weight"))*m-GRID_MARGIN);q.width(p);n+=(p+GRID_MARGIN);if(q.parent(".carousel").length){i+=(p+GRID_MARGIN)}if(q.hasClass("fixed-block")){if(q.hasClass("right")){q.css("left",q.prev().width()+(GRID_MARGIN*2))}if(q.position().left<=GRID_MARGIN){q.next(".block").css("left",q.width()+GRID_MARGIN)}if(q.hasClass("block-window-fill")){q.height(WINDOW_HEIGHT-MENU_HEIGHT-GRID_MARGIN)}}if(q.data("yratio")&&q.data("yratio")!==0){q.css("height",((WINDOW_HEIGHT-MENU_HEIGHT-(FOOTER_HEIGHT-GRID_MARGIN))*q.data("yratio"))-GRID_MARGIN)}}TextHelper.fitText(q)});o.find(".line-inner").width(n);var l=o.find(".scrollable, .dynamic");if(l.length>0){l.width(i);l.data("line",$(this));l.data("scroll-limit",l.width()-l.parent(".block").width()-GRID_MARGIN)}if(o.data("ratio")&&o.data("ratio")!==0){o.height($(".current-page").width()*o.data("ratio"))}else{if(o.data("yratio")&&o.data("yratio")!==0){o.css("height",((WINDOW_HEIGHT-MENU_HEIGHT-(FOOTER_HEIGHT-GRID_MARGIN))*o.data("yratio"))-GRID_MARGIN)}else{if(o.hasClass("line-full")){o.height(WINDOW_HEIGHT-MENU_HEIGHT-FOOTER_HEIGHT)}else{if(o.hasClass("count-inner")){a=true}else{var h=0,k;k=$(".block",o).not(".fixed-block, .no-count");k.each(function(){$("> *",this).not(".no-count").each(function(){var p=$(this).css("margin-top");var q=$(this).css("margin-bottom");if(p.indexOf("%")>-1||q.indexOf("%")>-1){h+=$(this).height()+($(this).parent().width()*parseInt(p,10)/100)+($(this).parent().width()*parseInt(q,10)/100)}else{h+=$(this).height()+parseInt(p,10)+parseInt(q,10)}})});o.height(h)}}}}o.data("bounds",{top:Math.round(o.position().top),middle:Math.round(o.position().top+(o.height()/2)),bottom:Math.round(o.position().top+o.height())});if(o.hasClass("fixed-line")){d+=o.height()+GRID_MARGIN;o.next(".line").css("top",o.height()+GRID_MARGIN);$(".fixed-block",o.next(".line")).css("top",parseInt(o.next(".line").css("top"),10)+MENU_HEIGHT)}if(o.hasClass("min-full")){if($(".min-full").height()<WINDOW_HEIGHT-MENU_HEIGHT-FOOTER_HEIGHT-GRID_MARGIN-$(".fixed-line").height()){$(".min-full").height(WINDOW_HEIGHT-MENU_HEIGHT-FOOTER_HEIGHT-GRID_MARGIN-$(".fixed-line").height())}}if(o.parents(".line").length===0){if(!o.hasClass("floating-line")){b+=o.height()+GRID_MARGIN}}else{if(!o.hasClass("no-count")){e+=o.height()+GRID_MARGIN}}});if(!a){b=Math.max(b,e)}else{b=e}$(".count-inner").height(b);b-=GRID_MARGIN;$(".current-page").height(b+MENU_HEIGHT);BODY.height(b+MENU_HEIGHT+FOOTER_HEIGHT);Footer.resize(b+MENU_HEIGHT);Grid.scrollableBlocks=$(".current-page div.scrollable");Grid.scrollableBlocksCount=Grid.scrollableBlocks.length;Grid.imageResize();if(View360.started){View360.resize()}Storefinder.resize();Collection.resize();Blog.resize();if(typeof g==="function"){g()}Grid.firstInit=false;$(".fixed-block").each(function(){$(this).data("start-position",$(this).position().top)});Home.resize()},percentage:0,direction:0,scrollArea:0,scrollLimits:0,startOffset:0,scrollTop:0,delayer:0,animate:function(){if(!MOBILE_SAFARI){Grid.scrollTopViewport=SCROLL_TOP+WINDOW_HEIGHT;var g=0;for(g;g<Grid.scrollableBlocksCount;g++){var k=$(Grid.scrollableBlocks[g]),d=k.data("line"),n=d.data("bounds"),l=(Grid.scrollTopViewport>n.top&&SCROLL_TOP<n.bottom),m=d.find(".hover-block");if(k.hasClass("stop-dragging")){if(!l){k.removeClass("stop-dragging")}continue}if(l){if(k.data("trackingdata")!="Homepage/Blog"){var h=parseFloat(k.data("speed"))>0?parseFloat(k.data("speed")):0.15;Grid.percentage=SCROLL_TOP/(n.bottom-50)*h;Grid.direction=(k.data("direction")&&k.data("direction")==="r")?1:-1;Grid.scrollLimits=k.data("scroll-limit");Grid.startOffset=(Grid.direction===1)?Grid.scrollLimits:0;k.css({left:(Grid.percentage*(Grid.scrollLimits*Grid.direction))-Grid.startOffset});if(k.hasClass("carousel")){k.carousel("update")}}if(!Grid.hoverBlock.hidden&&m.length>0){clearTimeout(Grid.hoverBlock.timeout);Grid.hoverBlock.hide(m,n)}}else{if(Grid.hoverBlock.hidden&&m.length>0){Grid.hoverBlock.show(m)}}}AutomaticVideoPlayer.checkFocus()}Header.highlightChapter();VideoPlayer.checkFocus();if(MOBILE_SAFARI){var e="div.blog .hover-block:visible";if($(e).length>0){var b=$(window).scrollTop();var a=b+$(window).height();var j=$(e).offset().top;var f=j+$(e).height();if((f>=b)&&(j<=a)){$(e).stop().delay(800).fadeOut(400)}}$(".fixed-block").each(function(){})}},hoverBlock:{timeout:"",hidden:false,hide:function(b,d){var a=(SCROLL_TOP+MENU_HEIGHT+((WINDOW_HEIGHT/4)*3)>d.middle&&(SCROLL_TOP+(WINDOW_HEIGHT/4)<d.middle));if(a){Grid.hoverBlock.hidden=true;Grid.hoverBlock.timeout=setTimeout(function(){b.stop(true).animate({left:-b.width()-GRID_MARGIN})},2000)}},show:function(a){clearTimeout(Grid.hoverBlock.timeout);a.css({left:0});Grid.hoverBlock.hidden=false}},imageResize:function(h){var m;if(h){m=[h]}else{m=$(".current-page img.centered,.current-page img.window-fit,.current-page img.block-fit,.current-page img.page-fit")}var g=0;for(g;g<m.length;g++){var b=$(m[g]),e,a,d,n,f,o;if(b.hasClass("centered")){b.css("margin-top",-((b.height()/2)-(b.parent().height()/2)))}if(b.hasClass("window-fit")&&b.data("originalwidth")){n=b.parent().width()/b.data("originalwidth");e=(WINDOW_HEIGHT-MENU_HEIGHT)/b.data("originalheight");a=Math.min(n,e);b.width(b.data("originalwidth")*a*0.85);b.height(b.data("originalheight")*a*0.85);f=b.parent().width()/2-b.width()/2;o=b.parent().height()/2-b.height()/2;b.css("left",f);b.css("top",o)}if((b.hasClass("block-fit"))&&b.data("originalwidth")){var k=b.data("snappoint")?b.data("snappoint"):"C";var j=b.parents(".block").first();e=j.width()/b.data("originalwidth");d=j.height()/b.data("originalheight");a=Math.max(e,d);b.width(b.data("originalwidth")*a);b.height(b.data("originalheight")*a);b.css("position","absolute");switch(k){case"TL":f=0;o=0;break;case"TC":case"T":f=j.width()/2-b.width()/2;o=0;break;case"TR":f=j.width()-b.width();o=0;break;case"BL":f=0;o=j.height()-b.height();break;case"BC":case"B":f=j.width()/2-b.width()/2;o=j.height()-b.height();break;case"BR":f=j.width()-b.width();o=j.height()-b.height();break;case"L":f=0;o=j.height()/2-b.height()/2;break;case"R":f=j.width()-b.width();o=j.height()/2-b.height()/2;break;case"C":default:f=j.width()/2-b.width()/2;o=j.height()/2-b.height()/2;break}b.css("top",o);b.css("left",f)}if(b.hasClass("page-fit")){b.css({marginLeft:-(b.width()/2)})}}}};var Lazyloader={init:function(f){var a=$("img",f),d=a.length,b=0;for(b;b<d;b++){var g=a[b],e=$(g);if(e.data("imagesrc")&&e.data("imagesrc")!==""){if(MOBILE_SAFARI){}else{e.css({opacity:0})}e.wrap('<div class="loader"></div>');if(e.data("loaderclass")){e.parent().addClass(e.data("loaderclass"))}}}},appendLine:function(a){CURRENT_PAGE_LINES.push(a)},update:function(){var n=CURRENT_PAGE_LINES,l=0,h=0;if(n.length===0){return}for(h;h<n.length;h++){if(h<0){return}var o=n[h],m=$(o);if(m.offset().top<SCROLL_TOP+WINDOW_HEIGHT){var e=$("img",o),k=e.length,g=0;for(g;g<k;g++){var f=e[g],b=$(f),a=b.data("imagesrc");if(a&&a!==""){b.load(function(i){var d=$(i.currentTarget);d.parent(".loader").addClass("loaded");d.unbind("load");if(MOBILE_SAFARI){}else{d.stop().delay(l*20).animate({opacity:1})}Grid.imageResize(d);l++}).attr("src",a)}}CURRENT_PAGE_LINES.splice(h,1);h--}else{return}}},targetUpdate:function(d){var b=$("img",d),g=b.length,a=0;for(a;a<g;a++){var h=b[a],e=$(h),f=e.data("imagesrc");if(f&&f!==""){e.load(function(j){var i=$(j.currentTarget);i.parent(".loader").addClass("loaded");i.unbind("load");if(MOBILE_SAFARI){i.css({opacity:1,"-webkit-transition":"opacity 1s linear"})}else{i.stop().animate({opacity:1})}Grid.imageResize(i)}).attr("src",f)}}}};var CSSHelper={getStyle:function(f){var g,e=0,a=0;for(e;e<document.styleSheets.length;e++){if(document.styleSheets[e].href&&document.styleSheets[e].href.indexOf("style.css")>-1){g=document.styleSheets[e]}}if(typeof g==="undefined"){return""}var d=g.rules||g.cssRules,b=d.length;for(a;a<b;a++){if(d[a].selectorText===f){return(d[a].style)?d[a].style:""}}return""}};var TextHelper={fitText:function(a){$(".fittext, p:not(.nofit), h2:not(.nofit), dl:not(.nofit), h3:not(.nofit)",a).each(function(){$(this).css({"font-size":parseInt($(this).data("font-size"),10)*RATIO})})},fitTextStoreSize:function(){$(".fittext, p:not(.nofit), h2:not(.nofit), dl:not(.nofit), h3:not(.nofit)").each(function(){if(!$(this).data("font-size")){$(this).data("font-size",$(this).css("font-size"))}})}};var TimeoutManager={timers:[],clearTimeouts:function(){var a;for(a in TimeoutManager.timers){clearTimeout(TimeoutManager.timers[a])}TimeoutManager.timers=[];$(".carousel.autoanimate").each(function(){$(this).carousel("destroy")})}};var TweetSlideshow={tweets:[],teamRiderPicture:"",currentTweet:-1,withPhoto:false,init:function(a){TweetSlideshow.currentTweet=-1;if(typeof a!=="undefined"){TweetSlideshow.withPhoto=a}TweetSlideshow.tweets=$(".tweet ul li",".current-page");if(TweetSlideshow.withPhoto){TweetSlideshow.teamRiderPicture=$("#twitter-team-rider",".current-page")}TweetSlideshow.animate()},animate:function(){if(MOBILE_SAFARI){return}if(TweetSlideshow.currentTweet!==-1){$(TweetSlideshow.tweets[TweetSlideshow.currentTweet]).stop(true,true).slideUp()}if(TweetSlideshow.withPhoto){TweetSlideshow.teamRiderPicture.fadeOut(400,function(){TweetSlideshow.currentTweet=(TweetSlideshow.currentTweet===(TweetSlideshow.tweets.length-1))?0:TweetSlideshow.currentTweet+1;TweetSlideshow.teamRiderPicture.load(function(){$(this).fadeIn();Grid.imageResize($(this));TweetSlideshow.teamRiderPicture.unbind("load")}).attr("src",$("img",TweetSlideshow.tweets[TweetSlideshow.currentTweet]).data("riderimg")+"?r="+Math.round(Math.random()*123));$(TweetSlideshow.tweets[TweetSlideshow.currentTweet]).stop(true,true).slideDown()})}else{TweetSlideshow.currentTweet=(TweetSlideshow.currentTweet===(TweetSlideshow.tweets.length-1))?0:TweetSlideshow.currentTweet+1;$(TweetSlideshow.tweets[TweetSlideshow.currentTweet]).stop(true,true).delay(500).slideDown()}var a=setTimeout(TweetSlideshow.animate,6000);TimeoutManager.timers.push(a)}};var Formhelper={init:function(){$("form",CURRENT_PAGE).submit(function(a){a.preventDefault();$("input[type=submit]",this).after('<div class="loading" />');$.post(this.getAttribute("action"),$(this).serialize(),Formhelper.feedback)})},feedback:function(h,b){var a=$("#success > *",h),g=$("form",CURRENT_PAGE),e=a.length,f=0;if(e>0){g.animate({opacity:0},function(){a.css("opacity",0).addClass("success");g.before(a);TextHelper.fitTextStoreSize();TextHelper.fitText(g.parent());$(".success").animate({opacity:1});g.remove()})}else{a=$(".error",h);e=a.length;g=$("form",CURRENT_PAGE);for(f;f<e;f++){var d=$("[name="+$(a[f]).html()+"]",g);if(d.length>0){d.addClass("error")}}$(".loading",g).remove()}},placeholder:function(){var a=document.getElementsByTagName("input"),b=0;for(b;b<a.length;b++){if(a[b].getAttribute("type")==="text"){a[b].onclick=function(){if(this.value===this.getAttribute("value")){this.value=""}if($(this).hasClass("error")){$(this).removeClass("error")}return false};a[b].onblur=function(){if(this.value.length<1||this.value===this.getAttribute("value")){this.value=this.getAttribute("value")}}}}}};var Storefinder={map:"",markers:[],standardLatLng:0,mapInitialized:false,init:function(){},resize:function(){if($(".main.storefinder").length>0){$(".shop-button",".main.storefinder").each(function(){var a=$(this).parent().height()-$(this).height();$(this).css({paddingTop:(a/2)+"px",paddingBottom:(a/2)+"px"})})}},home:{init:function(){$("#storefinder").submit(function(a){a.preventDefault();PageNavigation.setPageData({searchValue:$(".text",$(this)).val()});$.address.value(PageNavigation.stripURL($(this).attr("action")))})}},collection:{init:function(){$("#storefinder").submit(function(a){a.preventDefault();$.post($(this).attr("action"),$(this).serialize(),Storefinder.collection.showresults)})},showresults:function(b,a){if($("#storefinder-results").length>0){$("#storefinder-results").remove()}$("#storefinder").parents(".storefinder").after($("#storefinder-results",b));$("html, body").animate({scrollTop:$(".storefinder").offset().top-MENU_HEIGHT},800,"easeInOutCubic");TextHelper.fitTextStoreSize();Grid.refresh()}},page:{init:function(){setTimeout(function(){Storefinder.resize()},500);$("#storefinder-search").submit(function(f){f.preventDefault();$.post($(this).attr("action"),$(this).serialize(),Storefinder.page.showresults)});if(!Storefinder.mapInitialized){if($(".ie7").length>0){$(".ie7 #storefinder-wrapper").css({position:"absolute",top:0,left:0}).removeClass("fixed-block");$(window).scroll(function(){$(".ie7 #storefinder-wrapper").css({top:SCROLL_TOP})})}var b=readCookie("ptt_language");var d;if(b==""){b="en"}if(MOBILE_SAFARI){d="true"}else{d="false"}var a=document.createElement("script");a.type="text/javascript";a.src="http://maps.googleapis.com/maps/api/js?v=3.5&sensor="+d+"&callback=googleMapsInitialized&language="+b;document.body.appendChild(a)}else{googleMapsInitialized()}$("li","#storefinder-results").live("click",function(){$("li","#storefinder-results").removeClass("active");$(this).addClass("active");Storefinder.page.showOnMap($(this).data("lat"),$(this).data("lng"))})},mapInit:function(){if(!document.getElementById("storefinder-map")){return}Storefinder.mapInitialized=true;Storefinder.standardLatLng=new google.maps.LatLng(35.746512,-6.679687);var a={center:Storefinder.standardLatLng,zoom:2,mapTypeId:google.maps.MapTypeId.ROADMAP};Storefinder.map=new google.maps.Map(document.getElementById("storefinder-map"),a);if(PageNavigation.data&&PageNavigation.data.searchValue!==""){$(".text","#storefinder-search").val(PageNavigation.data.searchValue);$("#storefinder-search").submit();PageNavigation.clearPageData()}},showresults:function(d){Storefinder.page.removeMarkers();var b=$(".results ul li",d).length;if(b===0){$("#storefinder-results").html($("#storefinder-results",d).html());$("#mapsLine").data("yratio",0.7);$(".count-inner").removeClass("count-inner").addClass("line-full");Storefinder.map.panTo(Storefinder.standardLatLng);Storefinder.map.setZoom(2);Storefinder.map.getStreetView().setVisible(false);Grid.refresh()}else{$("#storefinder-results").html($("#storefinder-results",d).html());TextHelper.fitTextStoreSize();$(".line-full").removeClass("line-full").addClass("count-inner");$("#mapsLine").data("yratio",0);Grid.refresh();var a=$("li","#storefinder-results").first();Storefinder.map.setCenter(new google.maps.LatLng(a.data("lat"),a.data("lng")));Storefinder.map.setZoom(14);$("li","#storefinder-results").each(function(){var g=new google.maps.LatLng($(this).data("lat"),$(this).data("lng"));var e=new google.maps.Marker({position:g,map:Storefinder.map,title:$("strong",this).text(),icon:"/img/layout/maps-marker.png"});var f=$(this);google.maps.event.addListener(e,"click",function(){f.click();$("html,body").animate({scrollTop:f.offset().top-($(".fixed-line").height()+100)})});Storefinder.markers.push(e)})}},removeMarkers:function(){var a=Storefinder.markers.length,b=0;for(b;b<a;b++){Storefinder.markers[b].setMap(null);google.maps.event.clearInstanceListeners(Storefinder.markers[b])}Storefinder.markers.length=0},showOnMap:function(b,a){Storefinder.map.getStreetView().setVisible(false);Storefinder.map.panTo(new google.maps.LatLng(b,a));Storefinder.map.setZoom(14)}}};function googleMapsInitialized(){Storefinder.page.mapInit()}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}var Home={resize:function(){$(".event-pagination, .blog-pagination",".current-page").each(function(){$(".pagination",$(this)).css("margin-top",(($(this).height()-$("li",$(this)).height())/2))})}};var Collection={init:function(){if($("select.size").length>0){Collection.sizeSelection.init()}if(!MOBILE_SAFARI){View360.checkAvailability($(".current-page #view360 img").data("view360"))}},swapColors:function(b){$("#collection-image").fadeOut(200,function(){$($("#collection-image").load(function(){$(this).unbind("load");$(this).fadeIn(200);View360.hide();if(!MOBILE_SAFARI){View360.checkAvailability($("#view360 img",b).data("view360"))}}).attr("src",$("#collection-image",b).data("imagesrc")))});if($(".line.outfit .block",b).length>0){var a=$(".line.outfit > .block",b);$(".line.outfit > .line-inner").empty().append(a);MouseListener.gridButton.init(".current-page .line.outfit .grid-button");PageNavigation.bindListeners($(".current-page .line.outfit"));Lazyloader.init($(".current-page .line.rider"));Lazyloader.appendLine($(".current-page .line.rider"));$(".line.outfit").removeClass("no-count").show()}else{$(".line.outfit").addClass("no-count").hide()}if($(".line.rider .block",b).length>0){var a=$(".line.rider > .block",b);$(".line.rider > .line-inner").empty().append(a);PageNavigation.bindListeners($(".current-page .line.rider"));Lazyloader.init($(".current-page .line.outfit"));Lazyloader.appendLine($(".current-page .line.outfit"));$(".line.rider").removeClass("no-count").show()}else{$(".line.rider").addClass("no-count").hide()}TextHelper.fitTextStoreSize();TextHelper.fitText($(".line.outfit"));TextHelper.fitText($(".line.rider"));Grid.refresh();Lazyloader.update()},sizeSelection:{selectBox:"",customSelectBox:"",init:function(){var a=Collection.sizeSelection.selectBox=$("select.size");a.css({display:"none"});a.parent(".block").css({overflow:"inherit"});Collection.sizeSelection.createCustomSelect();TextHelper.fitTextStoreSize();TextHelper.fitText(a.parent());$(".sizeSelect").css({cursor:"pointer"});$(".sizeSelect").mouseenter(function(){Collection.sizeSelection.mouseOver($(this))});$(".sizeSelect").mouseleave(function(){Collection.sizeSelection.mouseOut($(this))});$(".sizeSelect li").click(function(){Collection.sizeSelection.click($(this))})},createCustomSelect:function(){var a=Collection.sizeSelection.selectBox;var b='<div><span>Size<span class="arrow">&nbsp;</span></span><ul class="green-bg">';a.children().each(function(){b+="<li>"+$(this).html()+"</li>"});b+="</ul></div>";a.after(b).next().attr("class","sizeSelect fittext")},click:function(a){var b=Collection.sizeSelection.selectBox;$(".sizeSelect span:not(.arrow)").html("Size: "+a.html()+'<span class="arrow">&nbsp;</span>');$(".sizeSelect li").removeClass("active");$("option:selected",b).removeAttr("selected");$("option[value="+a.html().toLowerCase()+"]",b).attr("selected","selected");a.addClass("active")},mouseOver:function(a){$("span",a).css({height:a.height()-(parseInt($("span",a).css("padding-top"),10)*2)});a.stop().animate({height:a.children("ul").children().length*a.height()})},mouseOut:function(a){a.stop().animate({height:"100%"},300,function(){$("span",a).css({height:"100%"})})}},resize:function(){if($(".current-page .line.colors").length>0){var b=$("a.change",".current-page .line.colors").parent(".block").first();$(".current-page #active-color").width(b.width()-6);$(".current-page #active-color").height(b.height()-6);if($(".current-page a.change.active").parent(".block").length>0){var a=$(".current-page a.change.active").parent(".block").position().left;$(".current-page #active-color").show().stop(true,true).animate({left:a},400,"easeOutQuad")}else{$(".current-page #active-color").hide()}}}};var Social={windowOptions:"menubar=0,resizable=1,width=525,height=500",init:function(){$(".twitter-share").live("click",function(a){a.preventDefault();if($(this).attr("href")==="#"){Social.twitter($(this))}else{window.open($(this).attr("href"),"_blank",Social.windowOptions)}});$(".facebook-share").live("click",function(a){a.preventDefault();if($(this).attr("href")==="#"){Social.facebook($(this))}else{window.open($(this).attr("href"),"_blank",Social.windowOptions)}})},twitter:function(a){$.post("http://www.protest.eu/generator/bitly/twitter",{campaign:"collection",source:"twitter",product:a.attr("rel"),url:window.location.href},function(b){a.attr("href",b);a.click()})},facebook:function(a){$.post("http://www.protest.eu/generator/bitly/facebook",{campaign:"collection",source:"facebook",product:a.attr("rel"),url:window.location.href},function(b){a.attr("href",b);a.click()})}};var View360={container:"",containerWidth:0,started:false,image:"",resizedImageWidth:0,originalContainerWidth:0,originalContainerHeight:0,dragStartX:0,dragEndX:0,init:function(){View360.started=true;View360.container=$("#view360");originalContainerWidth=View360.container.width();originalContainerHeight=View360.container.height();View360.image=$("img",View360.container).first();View360.showLoader();var a=new Image();a.src=View360.image.data("view360");$(a).load(function(){View360.image.attr("src",a.src);View360.resize();View360.container.fadeIn();$("#collection-image").fadeOut();View360.hideLoader()});View360.container.mousedown(View360.handleMouseDown);View360.image.mousedown(function(b){b.preventDefault()})},showLoader:function(){$("#enable360").fadeOut(100);Animator.animate($("#view360-loader span"),30,36,true);$("#view360-loader").stop().show()},hideLoader:function(){$("#enable360").delay(3000).fadeIn(1000);$("#view360-loader").delay(3000).fadeOut(1000,function(){Animator.stop($("#view360-loader span"))})},hide:function(a){if(View360.image){View360.image.unbind("mousedown")}if(View360.container){View360.container.unbind("mousedown").fadeOut()}View360.started=false;$("#collection-image").fadeIn()},checkAvailability:function(a){if(a!==""){$(".current-page #enable360").fadeIn();$(".current-page #view360 img").data("view360",a);setTimeout(function(){View360.init()},2000)}else{$(".current-page #enable360").fadeOut();$(".current-page #view360 img").data("view360","")}},resize:function(f){var a=View360.container.parent().width()/originalContainerWidth,d=(WINDOW_HEIGHT-MENU_HEIGHT)/originalContainerHeight,b=Math.min(a,d);View360.container.width(originalContainerWidth*b*0.85);View360.container.height(originalContainerHeight*b*0.85);View360.container.css("left",View360.container.parent().width()/2-View360.container.width()/2);View360.container.css("top",View360.container.parent().height()/2-View360.container.height()/2);View360.image.css("left","0%")},handleMouseDown:function(a){View360.dragStartX=a.pageX;View360.container.bind("mousemove",View360.handleMouseMove);$(window).bind("mouseup",View360.handleMouseUp)},handleMouseUp:function(){View360.container.unbind("mousemove",View360.handleMouseMove);$(window).unbind("mouseup",View360.handleMouseUp);View360.dragEndX=parseInt(View360.image.css("left"),10)},handleMouseMove:function(b){var d=-Math.ceil((b.pageX-View360.dragStartX)/4),a=d*100%3600;a=(a>0)?a-3600:a;View360.image.css("left",a+"%")}};var Animator={intervals:[],animate:function(e,g,d,a,h){if(MOBILE_SAFARI){return}$(e).addClass("animator");if(!a){a=false}var f;if($(e).data("animator")){f=$(e).data("animator")}else{f=$(e).data("animator",{})}var b=setInterval(function(){if(!$(e).data("animator")){return}f=$(e).data("animator");var j=0;if(f.currentFrame>0){j=f.currentFrame}if(d>0&&j>d){if(a){j=0}else{if(typeof h==="function"){h()}clearInterval(f.interval);$(e).data("animator",{})}}if($("div",e).length>0){e=$("div",e)}var i=parseInt($(e).css("width"),10)*j;$(e).css({backgroundPosition:-i+"px 0"});j=j+1;e.data("animator",{interval:b,currentFrame:j})},g)},stop:function(a){if(MOBILE_SAFARI){return}if(a.length===0||a.data("animator")===undefined||!a.data("animator").interval){return}clearInterval(a.data("animator").interval);$(a).data("animator",{})},cleanup:function(d){if(MOBILE_SAFARI){return}var e=$(".animator",d),b=e.length;for(var a=0;a<b;a++){Animator.stop($(e[a]))}}};var VideoPlayer={init:function(){$(".video-player .play-button").click(function(b){b.preventDefault();var a=$(this).parent(".video-player");$(".player",a).attr("src",$(".player",a).data("player-src"));a.data("active",true);$(".placeholder",a).fadeOut();$(".player",a).fadeIn();$(".play-button",a).fadeOut()})},checkFocus:function(){$(".video-player").each(function(){var b=$(this),a=b.parents(".line").data("bounds");if(b.data("active")===true){var d=(SCROLL_TOP+WINDOW_HEIGHT>a.top&&SCROLL_TOP<a.bottom);if(d===false){b.data("active",false);$(".player",b).attr("src","");$(".placeholder",b).fadeIn();$(".player",b).fadeOut();$(".play-button",b).fadeIn();return}}})}};var Blog={open:false,category:"all",postId:0,update:function(a){if(a==undefined){a=0}WINDOW.scrollTop(0);Blog.carousel.create();Blog.thumbnailBar.update();Blog.thumbnailBar.navigateTo(a);Blog.changeColors();MouseListener.diamondButton.init()},init:function(){Blog.thumbnailBar.init();Blog.initFilterBar();Blog.carousel.init();$(".blog-cover").live("click",function(a){a.preventDefault();$(this).fadeOut();Blog.carousel.create();Blog.carousel.navigate()});$(".blog-action").live("click",function(b){b.preventDefault();var a=$(this).attr("href");PageNavigation.internal=true;$.address.value(PageNavigation.stripURL(a));$(".carousel").carousel("externalNavigation",$(".custom-pagination ul li a").index($(this)))})},changeColors:function(){var a=$(".blog-post.active");var b=CSSHelper.getStyle("."+a.data("color")+"-bg");if(b!==""&&b.backgroundColor){$("#breadcrumbs").stop(true,true).animate({"background-color":b.backgroundColor});$("#blog-controls .block").stop(true,true).animate({"background-color":b.backgroundColor});if(!MOBILE_SAFARI){$("#navigation .text-hover").textHover("setColor",b.backgroundColor)}}},changeFilter:function(a){$(".carousel > *").replaceWith($(".carousel > *",a));$(".custom-pagination > *").replaceWith($(".custom-pagination > *",a));$(".filter").html($(".filter",a).html());$("#filter-bar > *").html($("#filter-bar > *",a));$("#filter-bar a").each(function(){url=PageNavigation.stripURL($(this).attr("href"));$(this).attr("href",url)});TextHelper.fitTextStoreSize();TextHelper.fitText();Lazyloader.init($(".carousel"));Lazyloader.targetUpdate($(".carousel"));Grid.refresh();$(".carousel").carousel("reset");Blog.thumbnailBar.update();Blog.thumbnailBar.checkControls();Blog.changeColors()},resize:function(){if($(".main",CURRENT_PAGE).hasClass("blog")){Blog.thumbnailBar.inner=$(".bar-inner","#thumbnail-bar");Blog.thumbnailBar.outer=Blog.thumbnailBar.inner.parent();$("ul",Blog.thumbnailBar.outer).width(Blog.thumbnailBar.outer.width());Blog.thumbnailBar.width=Blog.thumbnailBar.outer.width();Blog.thumbnailBar.inner.width($("ul",Blog.thumbnailBar.outer).length*Blog.thumbnailBar.outer.width());var b=$(".inner-carousel"),d=b.children().not(".blog-cover"),a=$(d[Blog.carousel.index]);Blog.carousel.cleanup();$(".loader img",a).css({top:"50%",marginTop:-$(".loader img",a).height()/2-32})}},carousel:{index:0,amount:0,init:function(){$("a.inner-nav").live("click",function(a){a.preventDefault();if($(this).hasClass("prev")){Blog.carousel.prev()}if($(this).hasClass("next")){Blog.carousel.next()}});$("a.inner-nav").css({opacity:0});$(".inner-carousel, a.inner-nav").live("mouseenter",function(){$("a.inner-nav").stop(true).animate({opacity:1})});$(".inner-carousel").live("mouseout",function(){$("a.inner-nav").animate({opacity:0})})},create:function(){Blog.carousel.index=0;var d=$(".inner-carousel"),e=d.children().not(".blog-cover"),b=e.length,a=$(e[Blog.carousel.index]);Blog.carousel.amount=b;d.css({width:b*(e.width()+GRID_MARGIN)});$("a.inner-nav.prev").css({display:"none"});if(b==1){$("a.inner-nav.next").stop(true).css({display:"none"})}if(a.hasClass("youtube")||a.hasClass("vimeo")){Blog.carousel.video(a)}},next:function(){var a=Blog.carousel.index+1;if(a>Blog.carousel.amount-1){a=Blog.carousel.amount-1}if(Blog.carousel.index!=a){Blog.carousel.index=a;Blog.carousel.navigate()}},prev:function(){var a=Blog.carousel.index-1;if(a<0){a=0}if(Blog.carousel.index!=a){Blog.carousel.index=a;Blog.carousel.navigate()}},cleanup:function(){$("iframe").attr("src","")},navigate:function(){var b=$(".inner-carousel"),d=b.children().not(".blog-cover"),a=$(d[Blog.carousel.index]);Blog.carousel.cleanup();$(".loader img",a).css({top:"50%",marginTop:-$(".loader img",a).height()/2-32});$("a.inner-nav").css({display:"block"});if(Blog.carousel.index==0){$("a.inner-nav.prev").css({display:"none"})}if(Blog.carousel.index>=Blog.carousel.amount-1){$("a.inner-nav.next").stop(true,true).css({display:"none"})}b.animate({left:-Blog.carousel.index*(d.width()+GRID_MARGIN)},300,function(){if(a.hasClass("youtube")||a.hasClass("vimeo")){Blog.carousel.video(a)}})},video:function(a){$("iframe",a).css({marginTop:-$("iframe").height()/2});if(a.hasClass("youtube")){if($("iframe",a).attr("src")=="http://www.youtube.com/embed/"+a.data("identifier")+"?autoplay=0&wmode=transparent"){return}$("iframe",a).attr("src","http://www.youtube.com/embed/"+a.data("identifier")+"?autoplay=0&wmode=transparent")}if(a.hasClass("vimeo")){if($("iframe",a).attr("src")=="http://player.vimeo.com/video/"+a.data("identifier")+"?title=0&byline=0&portrait=0"){return}$("iframe",a).attr("src","http://player.vimeo.com/video/"+a.data("identifier")+"?title=0byline=0&portrait=0")}$("iframe",a).css({marginTop:-$(".loader iframe").height()/2-20})}},thumbnailBar:{open:true,lists:0,element:"",height:0,index:0,width:0,inner:"",init:function(){var a;Blog.thumbnailBar.element=$("#thumbnail-bar");Blog.thumbnailBar.lists=$("ul",$("#thumbnail-bar")).length;Blog.resize();Blog.thumbnailBar.checkControls();$("#thumbnail-bar").die();$("#show-archive").die();$("#thumbnail-bar").css({bottom:-200});$("#thumbnail-bar").live({mouseenter:function(){clearTimeout(a)},mouseleave:function(){a=setTimeout(function(){Blog.thumbnailBar.open=true;$("#thumbnail-bar").animate({bottom:0-$("#thumbnail-bar").height()+GRID_MARGIN})},1000)}});$("#show-archive").live({click:function(b){b.preventDefault();if(Blog.thumbnailBar.open){Blog.thumbnailBar.open=false;$("#thumbnail-bar").animate({bottom:0+$("#blog-controls").height()+GRID_MARGIN},1000)}else{Blog.thumbnailBar.open=true;$("#thumbnail-bar").animate({bottom:0-$("#thumbnail-bar").height()+GRID_MARGIN},1000)}},mouseenter:function(){clearTimeout(a);$("#thumbnail-bar").stop().animate({bottom:0+$("#blog-controls").height()+GRID_MARGIN})},mouseleave:function(){$("#thumbnail-bar").mouseleave()}});Blog.thumbnailBar.navigation();Blog.thumbnailBar.navigateTo(Blog.thumbnailBar.index)},navigation:function(){$(".navigation-button.forward").click(function(a){a.preventDefault();Blog.thumbnailBar.navigateTo(Blog.thumbnailBar.index+1)});$(".navigation-button.backward").click(function(a){a.preventDefault();Blog.thumbnailBar.navigateTo(Blog.thumbnailBar.index-1)})},deactivate:function(a){$("span",".navigation-button."+a).addClass("inactive")},activate:function(){$("span",".navigation-button").removeClass("inactive")},checkControls:function(){Blog.thumbnailBar.lists=$("ul",Blog.thumbnailBar.element).length;Blog.thumbnailBar.activate();if(Blog.thumbnailBar.lists<=1){Blog.thumbnailBar.deactivate("backward");Blog.thumbnailBar.deactivate("forward")}else{if(Blog.thumbnailBar.index<=0){Blog.thumbnailBar.deactivate("backward");Blog.thumbnailBar.index=0}else{if(Blog.thumbnailBar.index>=$("ul",Blog.thumbnailBar.inner).length-1){Blog.thumbnailBar.deactivate("forward");Blog.thumbnailBar.index=$("ul",Blog.thumbnailBar.inner).length-1}}}},update:function(){if($("footer").position().top<=SCROLL_TOP+WINDOW_HEIGHT-10){$("#blog-controls").css({position:"absolute",marginBottom:-10});$("#filter-bar").css({position:"absolute",marginBottom:0});$(Blog.thumbnailBar.element).css({position:"absolute",marginBottom:0})}else{$("#blog-controls").css({position:"fixed",marginBottom:0});$(Blog.thumbnailBar.element).css({position:"fixed",marginBottom:10});$("#filter-bar").css({position:"fixed",marginBottom:10})}},navigateTo:function(a){Blog.changeColors();Blog.thumbnailBar.index=a;Blog.thumbnailBar.checkControls();if(a<0||a>=Blog.thumbnailBar.lists){return}$(".bar-inner","#thumbnail-bar").animate({left:-Blog.thumbnailBar.index*Blog.thumbnailBar.width})}},filterbarOpen:true,initFilterBar:function(){var a=0;$("#filter-bar").die();$("#show-filters").die();$("#filter-bar").css({bottom:-200});$("#show-filters").live({click:function(b){b.preventDefault();if(Blog.filterbarOpen){Blog.filterbarOpen=false;$("#filter-bar").animate({bottom:0+$("#blog-controls").height()+(GRID_MARGIN*2)},1000)}else{Blog.filterbarOpen=true;$("#filter-bar").animate({bottom:0-$("#filter-bar").height()},1000)}},mouseenter:function(){clearTimeout(a);$("#filter-bar").animate({bottom:0+$("#blog-controls").height()+(GRID_MARGIN*2)})},mouseleave:function(){a=setTimeout(function(){$("#filter-bar").mouseleave()},1000)}});$("#filter-bar").live({mouseenter:function(){clearTimeout(a)},mouseleave:function(){$("#filter-bar").animate({bottom:0-$("#filter-bar").height()},200)}})}};var AutomaticVideoPlayer={checkFocus:function(){$(".auto-video-player").each(function(){var b=$(this),a=b.parents(".line").data("bounds"),d=(SCROLL_TOP+WINDOW_HEIGHT>(a.top+(b.height()/2))&&SCROLL_TOP<a.bottom-(b.height()/2));if(d===true&&b.data("active")!==true){b.show().data("active",true);$(".player",b).attr("src",$(".player",b).data("player-src"));return}if(b.data("active")===true&&d===false){b.data("active",false);b.fadeOut(function(){$(".player",b).attr("src","")});return}})}};var Tracker={init:function(){$("a.trackevent",CURRENT_PAGE).bind("click",function(){if($(this).data("trackingdata")){Tracker.trackEvent($(this).data("trackingdata"))}});$("form.trackevent",CURRENT_PAGE).bind("submit",function(){if($(this).data("trackingdata")){Tracker.trackEvent($(this).data("trackingdata"))}})},trackEvent:function(a){if(!a&&typeof _gat==="undefined"){return}var f=a.split("/");if(f.length<2){return}var d=(f[0]?f[0]:""),e=(f[1]?f[1]:""),b=(f[2]?f[2]:"");_gaq.push(["_trackEvent",d,e,b])},trackPageview:function(a){if(_gaq){_gaq.push(["_trackPageview",a])}}};function touchHandler(d){var e=d.changedTouches,f=e[0],a="";switch(d.type){case"touchstart":a="mousedown";break;case"touchmove":a="mousemove";break;case"touchend":a="mouseup";break;default:return}var b=document.createEvent("MouseEvent");b.initMouseEvent(a,true,true,window,1,f.screenX,f.screenY,f.clientX,f.clientY,false,false,false,false,0,null);f.target.dispatchEvent(b)}function touchEventsInit(){var b=document.getElementsByClassName("carousel");for(c in b){var a=b[c];if(typeof a=="object"){a.addEventListener("touchstart",touchHandler,true);a.addEventListener("touchmove",touchHandler,true);a.addEventListener("touchend",touchHandler,true);a.addEventListener("touchcancel",touchHandler,true)}}};
