var MBP={};if(AC.Detector.isWebKit()){MBP.scrollbar=18;MBP.clipSmall=function(a,b){this.main.style.overflowX="visible";
document.body.style.width=this.width+"px";document.body.style.overflowX="";this.clippedLarge=false;
this.clippedSmall=true};MBP.clipLarge=function(a,b){this.main.style.overflowX="visible";
document.body.style.width="";document.body.style.overflowX="hidden";this.clippedSmall=false;
this.clippedLarge=true};MBP.clip=function(a){var b;if(!this.main){this.main=$("main")
}if(!this.width){this.width=(b=this.main.down(".content"))?b.getWidth():980}if(!this.compensate){this.compensate=this.width+this.scrollbar
}if(a.currentSection){if(window.innerWidth>this.compensate){this.clipLarge()}else{this.clipSmall()
}}else{if((this.clippedSmall||this.clippedLarge)&&a.type=="resize"){if(this.clippedSmall&&window.innerWidth>this.compensate){this.clipLarge()
}else{if(this.clippedLarge&&window.innerWidth<=this.compensate){this.clipSmall()
}}}else{if(!(AC.Detector.isMobile()||AC.Detector.isiPad())){this.main.style.overflowX="";
document.body.style.width="";document.body.style.overflowX="";this.clippedSmall=false;
this.clippedLarge=false}}}};MBP.didAppendContent=MBP.clip;Event.observe((document.onresize?document:window),"resize",function(a){MBP.clip(a)
})}MBP.bringGalleryTo=function(e,c,b,f){var a,d;if(e){if(a=e.up(".gallery")){a.style.zIndex=f
}if(d=e.up(".section")){d.style.zIndex=f}if(c&&c.content){c.content.style.zIndex=f
}if(b&&b.content){b.content.style.zIndex=f}}};MBP.willShow=function(b,c,a){var d=b.view.view();
this.bringGalleryTo(d,c,a,"10")};MBP.didShow=function(d,e,c){var f=d.view.view(),b,a;
this.bringGalleryTo(f,e,c,"");if(d.options.stickyHeight==true&&!d.heightStuck){if(c&&c.content){b=c.content
}if(!b){b=d.sectionWithId(d.orderedSections[0])}if(b&&b.content){b=b.content}if(!b){b=f
}if(b&&(a=b.getHeight())){f.style.height=a+"px";d.heightStuck=true}}};Event.onDOMReady(function(){var e,d,b,g,f,c,a={},h=$$(".gallery");
for(e=h.length-1;e>=0;e--){c={silentTriggers:true,showFirstOnStopMovie:true,stickyHeight:true};
b=h[e].down(".gallery-view");g=h[e].select("a."+b.id);f=h[e].down("a."+b.id+'[href^="#"]');
if(f){c.initialId=f.href.replace(/.*#/,"");c.useKeyboardNav=true;c.discontinuousPreviousNext=true
}else{g.unshift(b.down(".gallery-content"))}if(AC.Detector.isIEStrict()&&b.id=="gallery-performance"){c.shouldAnimateContentChange=false
}a[b.id]=new AC.ViewMaster.Viewer(g,b,b.id,c);a[b.id].setDelegate(MBP)}for(b in a){a[b].options.ensureInView=true
}});
