window.embedFlash=function(A){Flash.embed(A)};Flash={INTERVAL:500,_counter:0,FLASH_ID:"container",FLASH_VERSION:9,checkFlashVersion:function(){var A=swfobject.getFlashPlayerVersion();if(A&&Number(A.major)>=this.FLASH_VERSION){return true}$("body").addClass("show-noflashmsg");return false},getCallbackName:function(){return"__flashCallback_"+(this._counter++)+"__"},embed:function(C){if(!this.checkFlashVersion()){return }swfobject.embedSWF("/static/site/flash/deploy/container.swf","website","100%","100%","9.0.45","swfobject/expressinstall.swf",{},{bgcolor:"#000000",menu:"false",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"},{id:this.FLASH_ID,name:this.FLASH_ID});swfobject.registerObject(this.FLASH_ID);var B=this.FLASH_ID,A=this.INTERVAL;this.embed=function(E){if(!E){return }var D=document.getElementById(B);if(!D||!D.recievedFromJavascript){return setTimeout(function(){embedFlash(E)},A)}E(D)};this.embed(C)},Message:new JS.Class({initialize:function(A){this._message=A;this._complete=false},send:function(){if(this._complete){return }var B=this._message,C=Flash.getCallbackName(),A=this;window[C]=function(){A._complete=true;window[C]=null;try{delete window[C]}catch(D){}};Flash.embed(function(D){var E=B+"&callback="+C;D.recievedFromJavascript(E);window.console&&console.info("Sent to Flash: "+E);setTimeout(A.method("send"),Flash.INTERVAL)})}})};Ojay.onDOMReady(function(){window.pageState=new PageState();window.navigate=pageState.method("goTo");var B=1;var C=new Ojay.PageMask({color:"#000000"}).setLayer(50);Router.preprocessor(function(F){if(F!=="/"||YAHOO.util.Cookie.get("splashed")){return F}return"/splash/"});var D=Ojay("#bd");var A=function(H){var G=Router.parse(H),F=Ojay("body");YAHOO.util.Cookie.set("splashed","true",{path:"/",expires:new Date(Number(new Date())+B*24*60*60*1000)});if(G===null||G.hideflash==="true"){Ojay("#container").addClass("hide-flash");C.hide("none");F.removeClass("hide-select");return }F.addClass("hide-select");G.module=G.module.replace("slideshow","gallery");window.console&&console.info(G);G=Router.serialize(G);Flash.embed(function(I){Ojay(I).removeClass("hide-flash");new Flash.Message(G).send()})};pageState.addObserver(A);Navigation.setup();pageState.addObserver(Navigation.update,Navigation);var E=function(F){F=Ojay.URI.parse(F).path;if(window.pageTracker){pageTracker._trackPageview(F)}};pageState.addObserver(E);Ojay("body").on("click",Ojay.delegateEvent({"a.flash-link, .flash-link a":function(F,H){H.stopDefault();Ojay(".footer .selected").removeClass("selected");var G=F.hasClass("transparent-flash");C.show("none").setOpacity(G?0.8:1);navigate(F.node.href)},".search-label":function(F,G){if(YAHOO.env.ua.ie==6){Ojay(".search-box").setStyle({marginRight:"-30px"})}else{Ojay(".search-box").animate({marginRight:{to:-30}},0.7,{easing:"easeOut"})}}},true));Ojay.onDOMReady(function(){Ojay.History.manage(pageState,"nav");Ojay.History.initialize()});Ojay("#searchField").on("blur",function(F){if(F.node.value==""){if(YAHOO.env.ua.ie==6){Ojay(".search-box").setStyle({marginRight:"-255px"})}else{Ojay(".search-box").animate({marginRight:{to:-255}},1.25,{easing:"easeOut"})}}})});Ojay.Paginator.include({pad:function(D,B,A,C){var E=this.getTotalOffset();this.extend({getTotalOffset:function(){return E}});this.getContainer().setStyle({paddingTop:D||0,paddingRight:B||0,paddingBottom:A||0,paddingLeft:C||0});this.getSubject().setStyle({paddingTop:D||0,paddingLeft:C||0});return this}});Navigation=new JS.Singleton({FULLSCREEN:["gallery","video","splash","scrapbook"],setup:function(){this._logo=Ojay(".logo");this._hidden=false;this._logo.on("mouseover")._(this).show()},update:function(L){this._initial=this._initial||L;if(/^\/null/.test(L)){L=this._initial}var D=Ojay(".navigation"),B=D.descendants("a"),E=Ojay(".sub-navigation"),G=Ojay(".header a");var I=Ojay.URI.parse(L).path.replace(/(\/[^\/]*)?$/,"/").replace(/\//g,"_"),A={},H=Ojay("a").filter({hasClass:I}),F=Router.parse(L),J=null;this._handleModule(F?F.module:null);if(!F){this.show()}G.removeClass("selected").ancestors(".sub-navigation").removeClass("selected");H.addClass("selected").ancestors(".sub-navigation").addClass("selected");while(I.length>0){J=B.filter(function(M){return Ojay.URI.parse(M.node.href).path==I.replace(/_/g,"/")});if(J.node){J.addClass("selected")}A=A.node?A:Ojay("ul."+I);I=I.replace(/[^_]*_$/g,"")}if(this._hidden){return }var K=A.parents(),C=E.filter(function(M){return M.node!==K.node});C.animate({opacity:{to:0},marginTop:{to:-30}},0.6,{easing:"easeOut"}).hide()._(K).show().animate({opacity:{to:1},marginTop:{to:0}},1.2,{easing:"easeOut"})},getBars:function(A){var B=Ojay(".navigation",".sub-navigation");if(A){B=B.filter(function(C){return C.matches(A)||C.matches(".navigation")})}return B},getFooter:function(){return Ojay(".footer")},hide:function(){if(this._hidden){return }this._hidden=true;this.getFooter().animate({opacity:{to:0}},1).hide();this.getBars().animate({opacity:{to:0},marginTop:{to:-30}},1).hide().wait(1)._(this._logo).animate({opacity:{to:1}},1)},show:function(){if(!this._hidden){return }this._hidden=false;if(this._scheduleToHide){clearInterval(this._scheduleToHide)}this.getFooter().show().setStyle({opacity:1});this.getBars(".selected").show().animate({opacity:{from:0,to:1},marginTop:{from:-30,to:0}},1);this._logo.animate({opacity:{to:1}},1);this._scheduleToHide=setTimeout(function(){if(this._fullscreen){this.hide()}}.bind(this),5000)},_handleModule:function(A){if(A===this._module){return }this._module=A;if(this.FULLSCREEN.indexOf(A)===-1){this.show();this._fullscreen=false}else{this.hide();this._fullscreen=true}}});Ojay.Keyboard.listen(document,"ESCAPE",function(){if(Navigation._module==="splash"){window.navigate("/?module=cards")}});var PageState=new JS.Class({include:JS.Observable,getInitialState:function(){return{path:window.location.pathname}},changeState:function(A){this.notifyObservers(A.path)},goTo:function(C){if(C instanceof Array){C=C[0]}if(!C){C="/"}window.console&&console.info("navigate()",C);var B=Ojay.URI.parse(C),A=B.getQueryString(),D=B.path+(A?"?"+A:"");this.changeState({path:D})}});Router=new JS.Singleton({FOLDERS:{},TYPES:{},_preprocessors:[],preprocessor:function(A){this._preprocessors.push(A)},getValidModules:function(){var B=[];for(var A in this.FOLDERS){B.push(this.FOLDERS[A])}for(var A in this.TYPES){B.push(this.TYPES[A])}return B},parse:function(M){this._preprocessors.forEach(function(N){M=N(M)});var D=Ojay.URI.parse(M),F=D.path.split("/"),E=F.pop(),G=E.match(/^.*?(?:~(\d+))?(?:,(\d+))?(?:,([a-z]+))?(?:\.[a-z]+)?$/i),A=G[1],I=G[3];output={};var L=this.getValidModules();var J,B;B=F.join("/").replace(/\/?$/,"/");J=this.FOLDERS[B];var C=[D.params.module,this.TYPES[I],J].reduce(function(N,O){if(typeof N=="string"){return N}return(!O||L.indexOf(O)===-1)?N:O},null);if(I&&!D.params.module){C=this.TYPES[I]}if(!C){return null}output.module=C;var H=Ojay.URI.parse(D.path);H.setParam("format","xml");H.setParam("module",C);output.xml=H.path+"?"+H.getQueryString();A=[D.params.state,D.params.id,A,].reduce(function(N,O){if(N!==null){return N}N=O&&O.replace(/\D/g,"");return N?parseInt(N):null},null);if(A){output.id=parseInt(A)}for(var K in D.params){if(!D.params.hasOwnProperty(K)){continue}if(K!=="module"&&K!=="state"&&K!=="id"){output[K]=D.params[K]}}return output},serialize:function(A){var C=new Ojay.URI();for(var B in A){if(A[B]!==undefined){C.setParam(B,A[B])}}return C.getQueryString()}})