var viewer;var slideshow;Event.onDOMReady(function(){var d=$$("a.herolink");viewer=new AC.ViewMaster.Viewer($$("div#herocontent div"),"herocontent","herolink",{silentTriggers:true}),galleryCount=5,activeId=1;
viewer.setDelegate({willShow:function(f,g,e){var i=e.id.match(/\d+/)[0];if(i<=galleryCount){var h=-parseInt($("heroimage"+i).getStyle("left"));
if(activeId<=galleryCount){if(AC.Detector._isWebKit){$("herogallery").style.webkitTransform="translate3d("+h+"px, 0, 0)"
}else{new Effect.Move("herogallery",{x:h,duration:0.4,mode:"absolute"})}}else{$("herogallery").setStyle({left:+h+"px"}).appear({duration:0.4})
}}else{if(activeId<=galleryCount){$("herogallery").fade({duration:0.4})}}activeId=i
}});slideshow=new AC.ViewMaster.Slideshow(viewer,null,{autoplay:true,delay:6400});
d.each(function(e){e.observe("mousedown",function(f){slideshow.stop()})});$("main").removeClassName("loading");
var c=new Image();c.src="http://images.apple.com/global/elements/quicktime/loading.gif";
if(typeof(tracker)!="undefined"){tracker.setDelegate({sectionDidChange:function(h,f,e,i,g){if(navigator.platform.match(/(iphone|ipod)/i)){platform="iphone"
}else{if(navigator.platform.match(/ipad/i)){platform="ipad"}else{platform="non-mobile"
}}if(f._currentTrigger.id!=""){g.prop8=platform;g.prop25=AC.Tracking.pageName()+" - arrow nav"
}else{g.prop8=platform;g.prop25=AC.Tracking.pageName()+" - bubble nav"}return g
}})}section=$("hero").down("div.video-content");var a=section.getHeight();$("hero").style.height=a+"px";
var b=new AC.ViewMaster.Viewer([section],"hero","video-link",{silentTriggers:true,animationDuration:0.4});
b.setDelegate({didAppendContent:function(g){var h=g.currentSection;var f=g.view.view();
var e=h.content.getHeight();var j=g.view.view().getHeight();var i=(e/j)*100;new Effect.Scale(f,i,{scaleX:false,scaleContent:false,duration:g.options.animationDuration})
},didShow:function(f,g,e){if(e.id=="video-content"){slideshow.start()}else{slideshow.stop()
}}});b.didAppendContent(b,section)});

