
(function($){$.fn.extend({styleGuideSlideshow:function(options){var defaults={slideDuration:600}
options=$.extend({},defaults,options);return this.each(function(){var o=options,obj=$(this),container=$('.slides',obj),items=$('.slide',obj),lastSlide=items.size()-1,itemWidth=$('.slide:first',obj).width(),currentItem=0;function gotoItem(item){if(currentItem!=item){$('#logo, #prev-item, #next-item').hide();var dir=item>currentItem?-1:1,n=Math.abs(currentItem-item),left=itemWidth*dir*n;container.filter(':not(:animated)').animate({left:'+='+left},o.slideDuration,function(){currentItem=item;var prevItem=parseInt(currentItem)-1,nextItem=parseInt(currentItem)+1,prevItemAddress=currentItem==1?'#/0':'#/'+prevItem,nextItemAddress='#/'+nextItem;if(currentItem==0){$('#logo').addClass('inverted');$('#prev-item').addClass('hidden').hide();$('#next-item:hidden').removeClass('hidden').show();prevItemAddress='#/0';}else if(currentItem==lastSlide){$('#logo').removeClass('inverted');$('#next-item').addClass('hidden').hide();$('#prev-item:hidden').removeClass('hidden').show();nextItemAddress='#/0';}else{$('#logo').removeClass('inverted');$('#prev-item:hidden, #next-item:hidden').removeClass('hidden').show();}
$('#logo').show();$('#prev-item').attr('href',prevItemAddress);$('#next-item').attr('href',nextItemAddress);items.removeClass('active').eq(currentItem).addClass('active');if(currentItem==1){cmCreatePageviewTag('pageview_racksplash1',null,'');}else if(currentItem==2){cmCreatePageviewTag('pageview_racksplash2',null,'');}});}}
function verifyBounds(){slide=parseFloat($.address.pathNames()[0]);if($.address.pathNames().length!=1||slide>lastSlide){$.address.value('0');return false;}else{return true;}}
verifyBounds();$.address.change(function(event){if(verifyBounds()){gotoItem(slide);}});$.address.autoplay=setTimeout(function(){var current=$.address.pathNames(),next=[0],$slide=obj.find('.slide:eq('+current[0]+')').next('.slide');current[0]=parseFloat(current[0]||0);next[0]=current[0]+1;if(!$slide.length){next=[0];}else{$.address.autoplay=setTimeout(arguments.callee,6000);}
$.address.value(next.join('/'));},6000);obj.find('a').bind('click',function(){clearTimeout($.address.autoplay);if(container.is(':animated')){return false;}});obj.find('div.popper').bind('mouseenter mouseleave',function(){$(this).next('div.callout').toggle();if(container.is(':animated')){return false;}});});}});})(jQuery);$(document).ready(function(){$('#cover').styleGuideSlideshow();clearTimeout($.address.autoplay);if($.address.value()!="/0"){clearTimeout($.address.autoplay);}
$('#intro a.pop').hover(function(){$(this).addClass('hovering');},function(){$(this).removeClass('hovering');});$('#cover div.pop .trigger').hover(function(){$(this).parent().addClass('hovering');},function(){$(this).parent().removeClass('hovering');});});
