function month_date(){var d=new Date();JQ("#date_area").append('<img src="/nikeplus/us/v2/en_US/images/redesign_2011/dates/'+d.getDate()+'.gif" alt="'+d.getDate()+'" width="80" height="60"/>')}function editorialRollout(icon,id){JQ("#"+id+"_iconcopy").hide()}function editorialRollover(icon,id){JQ("#"+id+"_iconcopy").css({opacity:1});JQ("#"+id+"_iconcopy").show();switch(id){case"1a":JQ("#"+id+"_iconcopy").css("width","515px");JQ("#"+id+"_icon").css("width","599px");break;case"1b":JQ("#"+id+"_iconcopy").css("width","515px");JQ("#"+id+"_icon").css("width","599px");break;case"1c":JQ("#"+id+"_iconcopy").css("width","515px");JQ("#"+id+"_icon").css("width","599px");break;case"1d":JQ("#"+id+"_iconcopy").css("width","515px");JQ("#"+id+"_icon").css("width","599px");break;case"2a":JQ("#"+id+"_iconcopy").css("width","220px");JQ("#"+id+"_icon").css("width","305px");break;case"2b":JQ("#"+id+"_iconcopy").css("width","220px");JQ("#"+id+"_icon").css("width","305px");break;case"2c":JQ("#"+id+"_iconcopy").css("width","220px");JQ("#"+id+"_icon").css("width","300px");break;case"2d":JQ("#"+id+"_iconcopy").css("width","220px");JQ("#"+id+"_icon").css("width","300px");break;case"3a":JQ("#"+id+"_iconcopy").css("width","216px");JQ("#"+id+"_icon").css("width","300px");break;case"3b":JQ("#"+id+"_iconcopy").css("width","216px");JQ("#"+id+"_icon").css("width","300px");break;case"3c":JQ("#"+id+"_iconcopy").css("width","515px");JQ("#"+id+"_icon").css("width","599px");break}}function setupFacebook(){if(cufondisabled==false){Cufon(".futura",{fontFamily:"Futura"});JQ("#editorial .type-1 .facebook_box .title a").hover(function(){Cufon(JQ(this),{hover:true});Cufon(JQ(this),{color:"#57a0d7",fontFamily:"Futura"})},function(){Cufon(JQ(this),{hover:true});Cufon(JQ(this),{color:"#7E8B90",fontFamily:"Futura"})})}JQ("#editorial .facebook_box .stats a").attr("target","_blank");if(JQ("#editorial .type-1 .facebook_box")||JQ("#editorial_blocks .type-1 .facebook_box")){JQ("#editorial .type-1 .facebook_box").each(function(){JQ(this).hide()});var first=JQ("#editorial .type-1 .facebook_box")[0];if(first){JQ(first).show()}if(JQ(first).find(".img").length==0||JQ(first).find(".link").length==0){JQ("#editorial .type-1 .facebook_box").css("top","120px");JQ("#editorial .type-1 .facebook_box .stats").css("top","170px")}if(JQ(first).find(".img").length>0){JQ("#editorial .type-1 .facebook_box").css("top","185px");JQ("#editorial .type-1 .facebook_box .stats").css("top","105px")}if(JQ(first).find(".link").length>0){JQ("#editorial .type-1 .facebook_box").css("top","92px");JQ("#editorial .type-1 .facebook_box .stats").css("top","198px")}var type_1counter=0;JQ(".type-1 .left_arrow, .type-1 .right_arrow, .type-1 .left_arrow_album, .type-1 .right_arrow_album").click(function(e){switch(JQ(this).attr("class")){case"right_arrow":type_1counter++;if(type_1counter>=JQ("#editorial .type-1 .facebook_box").length){type_1counter=0}JQ("#editorial .type-1 .facebook_box").each(function(){JQ(this).hide()});var next_post=JQ("#editorial .type-1 .facebook_box")[type_1counter];JQ(next_post).show();if(JQ(next_post).find(".img").length==0||JQ(next_post).find(".link").length==0){JQ("#editorial .type-1 .facebook_box").css("top","120px");JQ("#editorial .type-1 .facebook_box .stats").css("top","170px")}if(JQ(next_post).find(".img").length>0){JQ("#editorial .type-1 .facebook_box").css("top","185px");JQ("#editorial .type-1 .facebook_box .stats").css("top","105px")}if(JQ(next_post).find(".link").length>0){JQ("#editorial .type-1 .facebook_box").css("top","92px");JQ("#editorial .type-1 .facebook_box .stats").css("top","198px")}break;case"left_arrow":type_1counter--;if(type_1counter<0){type_1counter=(JQ("#editorial .type-1 .facebook_box").length)-1}JQ("#editorial .type-1 .facebook_box").each(function(){JQ(this).hide()});var prev_post=JQ("#editorial .type-1 .facebook_box")[type_1counter];JQ(prev_post).show();if(JQ(prev_post).find(".img").length==0||JQ(prev_post).find(".link").length==0){JQ("#editorial .type-1 .facebook_box").css("top","120px");JQ("#editorial .type-1 .facebook_box .stats").css("top","170px")}if(JQ(prev_post).find(".img").length>0){JQ("#editorial .type-1 .facebook_box").css("top","185px");JQ("#editorial .type-1 .facebook_box .stats").css("top","105px")}if(JQ(prev_post).find(".link").length>0){JQ("#editorial .type-1 .facebook_box").css("top","92px");JQ("#editorial .type-1 .facebook_box .stats").css("top","198px")}break;case"right_arrow_album":tracking.trackClick({pageName:track_site+">home>features>vaporflash_jacket>P8>art_of_running>scroll",prop18:"home",eVar12:"tout",prop19:"vaporflash_jacket",eVar15:"vaporflash_jacket"});type_1counter++;if(type_1counter>=JQ("#editorial_blocks .type-1 .facebook_box_album").length){type_1counter=0}JQ("#editorial_blocks .type-1 .facebook_box_album").each(function(){JQ(this).hide()});var next_post=JQ("#editorial_blocks .type-1 .facebook_box_album")[type_1counter];JQ(next_post).show();if(JQ(next_post).find(".img").length==0||JQ(next_post).find(".link").length==0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","140px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","170px")}if(JQ(next_post).find(".img").length>0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","185px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","105px")}if(JQ(next_post).find(".link").length>0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","92px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","198px")}break;case"left_arrow_album":tracking.trackClick({pageName:track_site+">home>features>vaporflash_jacket>P8>art_of_running>scroll",prop18:"home",eVar12:"tout",prop19:"vaporflash_jacket",eVar15:"vaporflash_jacket"});type_1counter--;if(type_1counter<0){type_1counter=(JQ("#editorial_blocks .type-1 .facebook_box_album").length)-1}JQ("#editorial_blocks .type-1 .facebook_box_album").each(function(){JQ(this).hide()});var prev_post=JQ("#editorial_blocks .type-1 .facebook_box_album")[type_1counter];JQ(prev_post).show();if(JQ(prev_post).find(".img").length==0||JQ(prev_post).find(".link").length==0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","140px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","170px")}if(JQ(prev_post).find(".img").length>0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","185px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","105px")}if(JQ(prev_post).find(".link").length>0){JQ("#editorial_blocks .type-1 .facebook_box_album").css("top","92px");JQ("#editorial_blocks .type-1 .facebook_box_album .stats").css("top","198px")}break}})}}function goToURL(url,trackstr){tracking.trackClick({pageName:track_site+trackstr,prop18:"home"});window.location=url}function setUpInstagram(){if(cufondisabled==false){Cufon(".futura",{fontFamily:"Futura"})}if(JQ(".type-3 .messageBox").length>0){JQ(".type-3 .messageBox").each(function(){JQ(this).hide()});var first=JQ(".type-3 .messageBox")[0];JQ(first).show();var type_3counter=0;JQ(".type-3 .left_arrow, .type-3 .right_arrow").click(function(e){switch(JQ(this).attr("class")){case"right_arrow":type_3counter++;if(type_3counter==JQ(".type-3 .messageBox").length){type_3counter=0}JQ(".type-3 .messageBox").each(function(){JQ(this).hide()});var next_tweet=JQ(".type-3 .messageBox")[type_3counter];JQ(next_tweet).show();break;case"left_arrow":type_3counter--;if(type_3counter<0){type_3counter=(JQ(".type-3 .messageBox").length)-1}JQ(".type-3 .messageBox").each(function(){JQ(this).hide()});var prev_tweet=JQ(".type-3 .messageBox")[type_3counter];JQ(prev_tweet).show();break}})}if(JQ(".type-2 .messageBox").length>0){JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var first2=JQ(".type-2 .messageBox")[0];JQ(first2).show();var type_2counter=0;if(JQ(first2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(first2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(first2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}JQ(".type-2 .left_arrow, .type-2 .right_arrow").click(function(event){switch(JQ(event.currentTarget).attr("class")){case"right_arrow":type_2counter++;if(type_2counter==JQ(".type-2 .messageBox").length){type_2counter=0}JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var next_tweet_2=JQ(".type-2 .messageBox")[type_2counter];JQ(next_tweet_2).show();if(JQ(next_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(next_tweet_2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(next_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}break;case"left_arrow":type_2counter--;if(type_2counter<0){type_2counter=(JQ(".type-2 .messageBox").length)-1}JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var prev_tweet_2=JQ(".type-2 .messageBox")[type_2counter];JQ(prev_tweet_2).show();if(JQ(prev_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(prev_tweet_2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(prev_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}break}})}}function setUpEditorialOverlay(){if(cufondisabled==false){Cufon(".futura",{fontFamily:"Futura"})}}function setupTwitter(){if(cufondisabled==false){Cufon(".futura",{fontFamily:"Futura"})}var boxes;if(JQ("html").hasClass("night")){boxes="#editorial_blocks .type-2 .messageBox"}else{boxes="#editorial .type-3 .messageBox"}if(JQ(boxes).length>0){JQ(boxes).each(function(){JQ(this).hide()});var first=JQ(boxes)[0];JQ(first).show();var type_3counter=0;JQ(".type-3 .left_arrow, .type-3 .right_arrow, .type-2 .left_arrow, .type-2 .right_arrow").click(function(e){switch(JQ(this).attr("class")){case"right_arrow":type_3counter++;if(type_3counter==JQ(boxes).length){type_3counter=0}JQ(boxes).each(function(){JQ(this).hide()});var next_tweet=JQ(boxes)[type_3counter];JQ(next_tweet).show();break;case"left_arrow":type_3counter--;if(type_3counter<0){type_3counter=(JQ(boxes).length)-1}JQ(boxes).each(function(){JQ(this).hide()});var prev_tweet=JQ(boxes)[type_3counter];JQ(prev_tweet).show();break}})}if(JQ(".type-2 .messageBox").length>0){JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var first2=JQ(".type-2 .messageBox")[0];JQ(first2).show();var type_2counter=0;if(JQ(first2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(first2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(first2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}JQ(".type-2 .left_arrow, .type-2 .right_arrow").click(function(event){switch(JQ(event.currentTarget).attr("class")){case"right_arrow":type_2counter++;if(type_2counter==JQ(".type-2 .messageBox").length){type_2counter=0}JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var next_tweet_2=JQ(".type-2 .messageBox")[type_2counter];JQ(next_tweet_2).show();if(JQ(next_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(next_tweet_2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(next_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}break;case"left_arrow":type_2counter--;if(type_2counter<0){type_2counter=(JQ(".type-2 .messageBox").length)-1}JQ(".type-2 .messageBox").each(function(){JQ(this).hide()});var prev_tweet_2=JQ(".type-2 .messageBox")[type_2counter];JQ(prev_tweet_2).show();if(JQ(prev_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .tweet_container").css("top","85px")}else{JQ("#editorial .type-2 .tweet_container").css("top","0px")}if(JQ(prev_tweet_2).find(".text img").length>0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-272px")}if(JQ(prev_tweet_2).find(".text img").length==0){JQ("#editorial .type-2 .messageBox .actions").css("bottom","-185px")}break}})}}function launchGalleryUsingNikePlayer(e){e.preventDefault();JQ("#overlay_gallery").css("width","900px");JQ("#overlay_gallery").css("padding-left","10px");JQ("#overlay_gallery").css("left","0");var t=JQ(this);var guid=t.attr("id");JQ("#overlay").appendTo("body");JQ("#overlay").show();VC.create_player({videoId:guid,"@videoId":guid,locale:site_data.settings.platypus_lang_locale,width:"910",autoStart:true,labels:"http://assets.nikevideo.nike.com/video_player/xml/translate/2.0/"+site_data.settings.platypus_lang_locale+"_Labels.xml"});var num=getNumberForVideo(guid);JQ("#overlay_gallery_hi").animate({marginLeft:num+"px"});JQ("#overlay_gallery_close").click(function(e){JQ("#overlay").hide();VC.bc_video_stop();e.preventDefault()});e.preventDefault()}function thumbClickSubtitlePlayer(e){e.preventDefault();var guid=JQ(this).attr("id").split("_")[1];var num=getNumberForVideo(guid);VC.create_player({videoId:guid,"@videoId":guid,width:"910",autoStart:true,locale:site_data.settings.platypus_lang_locale,labels:"http://assets.nikevideo.nike.com/video_player/xml/translate/2.0/"+site_data.settings.platypus_lang_locale+"_Labels.xml"});JQ("#overlay_gallery_hi").animate({marginLeft:num+"px"})}function getNumberForVideo(guid){var list=JQ(".thumb_gallery");for(var i=0;i<list.length;i++){if(JQ(list[i]).attr("id").split("_")[1]==guid){return(i*112)+1}}return 1}function setupVideos(){if(cufondisabled==false){Cufon(".futura",{fontFamily:"Futura"})}JQ("ul.playlist").ytplaylist({addThumbs:true,autoPlay:true,holderId:"video_player",showRelated:false,playerWidth:300,playerHeight:180});JQ("#video_player").children("object").children("embed").attr("height","205");JQ("#video_player").children("object").children("embed").click(function(){JQ(this).attr("height","180")});JQ("ul.playlist").children("li").each(function(index,value){var img_src=JQ(this).children("a").children("img").attr("src");JQ(this).children("a").prepend('<div class="vid_thumb" style="background-image:url(\''+img_src+"');\"></div>");var img_src=JQ(this).children("a").children("img").remove()});if(JQ("ul.playlist").children("li").length>3){JQ("ul.playlist").children("li").each(function(index,value){if(index>2){JQ(this).hide()}else{JQ(this).fadeTo(300,1)}});JQ(".block #mini_arrow_right").show()}else{JQ("ul.playlist").children("li").each(function(index,value){JQ(this).fadeTo(300,1)})}var begin=0;var amount=3;var end=begin+2;var num=Math.ceil((JQ("ul.playlist").children("li").length)/3);var counter=0;JQ(".block #mini_arrow_left, .block #mini_arrow_right").click(function(e){switch(JQ(this).attr("id")){case"mini_arrow_right":counter++;begin=begin+amount;end=end+amount;JQ("ul.playlist").children("li").each(function(index,value){JQ(this).fadeTo(300,0.1);JQ(this).hide();if(index>=begin&&index<=end){JQ(this).show();JQ(this).fadeTo(300,1)}});break;case"mini_arrow_left":counter--;begin=begin-amount;end=end-amount;JQ("ul.playlist").children("li").each(function(index,value){JQ(this).fadeTo(300,0.1);JQ(this).hide();if(index>=begin&&index<=end){JQ(this).show();JQ(this).fadeTo(300,1)}});break}JQ(".block #mini_arrow_left, .block #mini_arrow_right").show();if(counter==num-1){JQ(this).hide()}if(counter==0){JQ(this).hide()}});JQ("ul.playlist").css("visibility","visible")};
