Dock=new JS.Class({include:Ojay.Observable,extend:{SCALE_FACTOR:0.8,RANGE:4,TRANSITION_FRAMES:8,TRANSITION_TIME:0.05,Image:new JS.Class({extend:{PADDING:10},initialize:function(B,A){this._dock=B;this._img=Ojay(A);this._padding=this.klass.PADDING;this._link=this._img.ancestors("a");this._w=this._img.getWidth();this._h=this._img.getHeight()},getWidth:function(){return this._w+2*this._padding},getHeight:function(){return this._h+2*this._padding},getHTML:function(){if(this._html){return this._html}this._html=Ojay(Ojay.HTML.img({src:this._img.node.src}));this._html.setStyle({display:"inline",position:"relative",padding:this._padding+"px"});if(this._link.node){this._html.on("click",function(){this._dock.notifyObservers("click",this._link)},this)}return this._html},setHeight:function(A,D){var C=2*this._padding;var B={height:(A-C)+"px",width:(this._w*(A-C)/this._h)+"px"};switch(this._dock.getAlignment()){case"bottom":B.marginTop=(D-A)+"px";break;case"top":B.marginBottom=(D-A)+"px";break;case"center":B.marginTop=B.marginBottom=(D-A)/2+"px";break}this._html.setStyle(B)},padLeft:function(A){this._html.setStyle({marginLeft:A+"px"})}})},initialize:function(A,B){this._container=Ojay(A);this._elements={};this._options=B||{};this._container.insert(this.getHTML(),"after").hide();this._update(1);this._images.forEach(function(D,C){D.getHTML().on("mouseover",function(E){this.notifyObservers("mouseover",C);this._update(C/(this.size()-1),true)},this)},this)},getHTML:function(){var C=this,B=C._elements;if(B._container){return B._container}this._images=C._container.descendants("img").map(function(F){return new this.klass.Image(this,F)},this);var E=1+this.klass.SCALE_FACTOR,A=E*this.getMaxHeight(),D=this._getHorizontalRange();B._container=Ojay(Ojay.HTML.div({className:"dock"},function(F){C._images.forEach(function(G){F.concat(G.getHTML().node)})}));B._container.setStyle({width:(D+5)+"px",height:(A+5)+"px",position:"relative"});this._canvasWidth=D;this._canvasHeight=A;this._underrun=D-this._getHorizontalRange(0);return this.getHTML()},_update:function(G,B){var E,C,D,F=this.size()-1;if(G>=0&&G<=1){f=G}else{E=this._elements._container.getRegion();C=this.scale(0,0)*this._images[0].getWidth()/2;D=this.scale(F,F)*this._images[F].getWidth()/2;f=(G.left-(E.left+C+this._underrun/2))/(this._canvasWidth-(this._underrun+C+D));if(f<0){f=0}if(f>1){f=1}}if(B===true){return this._slideTo(f)}f=f*F;this._images.forEach(function(J,H){var I=Math.round(this.scale(H,f)*J.getHeight());J.setHeight(I,this._canvasHeight)},this);var A=this._getHorizontalRange(f);this._images[0].padLeft((this._canvasWidth-A)/2)},_slideTo:function(C){if(this._sequence){this._sequence.pause()}var A=this._oldF||0,F=this.klass.TRANSITION_FRAMES,D=[],E=this.method("_update");for(var B=0;B<F;B++){D.push(A+(C-A)*B/F)}this._sequence=D.sequence(this.method("_update"));this._sequence.loop(this.klass.TRANSITION_TIME);this._sequence.finish();this._oldF=C},forEach:function(B,A){return this._images.forEach(B,A)},getMaxWidth:function(){return this._images.reduce(function(A,B){return Math.max(B.getWidth(),A)},0)},getMaxHeight:function(){return this._images.reduce(function(A,B){return Math.max(B.getHeight(),A)},0)},getAlignment:function(){return this._options.alignment||"bottom"},size:function(){return this._images.length},scale:function(C,F){if(F===undefined){F=this.size()/2}var E=this.klass.RANGE,B=this.klass.SCALE_FACTOR,A=C-F,D=Math.abs(A)<=E?1+(B/2)*(Math.cos(Math.PI*A/E)+1):1;return D},_getHorizontalRange:function(A){return this._images.map(function(C,B){return this.scale(B,A)*C.getWidth()},this).reduce(function(C,B){return C+B})}});var Dropdown=new JS.Class({include:JS.State,initialize:function(A){this._wrapper=Ojay.byId(A);this._toggler=Ojay(this._wrapper.descendants(".dropdown-toggler").node);this._content=Ojay(this._wrapper.descendants(".dropdown-content").node);this._contentContent=Ojay(this._content.children("ol, ul").node);this._wrapper.addClass("activated");this._content.addClass(this.klass.COLLAPSED);this.setState("COLLAPSED");this._toggler.on("mouseover").addClass(this.klass.HOVERED);this._toggler.on("mouseout").removeClass(this.klass.HOVERED);this._toggler.on("click")._(this).toggle()},extend:{COLLAPSED:"collapsed",EXPANDED:"expanded",HOVERED:"hovered",DURATION:0.1,EASING:"easeOut"},states:{COLLAPSED:{expand:function(){this.setState("ANIMATING");var A={height:{from:0,to:this._contentContent.getHeight()}};return this._content.setStyle({overflow:"hidden"}).animate(A,this.klass.DURATION,{easing:this.klass.EASING}).setStyle({overflow:""}).replaceClass(this.klass.COLLAPSED,this.klass.EXPANDED)._(this).setState("EXPANDED")._(this)},toggle:function(){return this.expand()}},EXPANDED:{collapse:function(){this.setState("ANIMATING");var A={height:{to:0}};return this._content.setStyle({overflow:"hidden"}).animate(A,this.klass.DURATION,{easing:this.klass.EASING}).setStyle({overflow:""}).replaceClass(this.klass.EXPANDED,this.klass.COLLAPSED)._(this).setState("COLLAPSED")._(this)},toggle:function(){return this.collapse()}},ANIMATING:{}}});labelInField=function(B){B=Ojay(B);var C=Ojay.Forms.getLabel(B);C.hide();var A=function(){if(B.node.value==C.node.innerHTML){B.node.value=""}B.node.focus()},D=function(){if(B.node.value==""){B.node.value=C.node.innerHTML}};C.on("click",A);B.on("focus",A);B.on("blur",D);D()};Ojay.onDOMReady(function(){Ojay("input.submit").forEach(function(A){if(!A.parents().hasClass("submit-wrap")){A.parents().insert(Ojay.HTML.span({className:"submit-wrap"},A))}});ImageGallery.fromBlocks("p.photo-story","a.photo-gallery",".caption")});var ImageGallery=new JS.Class({extend:{OVERLAY_WIDTH:970,OVERLAY_HEIGHT:750,THUMBS_PER_PAGE:8,ASPECT_THRESH:4/3,fromHTML:function(A){return this.fromLinks(Ojay(A).descendants("a"))},fromBlocks:function(E,F,D){E=Ojay(E);var C=E.descendants(F),B=E.descendants(D);var A=this.fromLinks(C);A.forEach(function(H,G){H.caption=B[G].innerHTML});return A},fromLinks:function(B){var A=[];Ojay(B).forEach(function(D){var C=D.descendants("img");if(!C.node){return }var E=new this.Image(C.node.src,D.node.href,D,C.node.alt);E.aspect=C.getWidth()/C.getHeight();A.push(E)},this);return new this(A)},fromJSON:function(C,B){var A=YAHOO.lang.JSON.parse(C).images.map(function(D){return new this.Image(D.thumb,D.fullsize,B,D.caption)},this);return new this(A)},Image:new JS.Class({initialize:function(C,B,A,D){this._thumbPath=C;this._fullPath=B;this._trigger=Ojay(A);this._alt=D||""},getHTML:function(A){var B=this;var D=this.aspect?(this.aspect>ImageGallery.ASPECT_THRESH?"landscape":"portrait"):"";var C=Ojay(Ojay.HTML.div({className:"thumbnail "+D},function(E){E.img({src:B._thumbPath,alt:B._alt})}));C.on("click")._(A).setImage(this);this._trigger.on("click",Ojay.stopDefault)._(A).setImage(this);return C}})},initialize:function(A){this._images=A;this._elements={};this._overlay=new Ojay.ContentOverlay({className:"image-gallery",width:this.klass.OVERLAY_WIDTH,height:this.klass.OVERLAY_HEIGHT});var C=this;this._panel=new Panel("photo-story",function(D){C._elements._prev=Ojay(D.div({className:"image-previous"},"Previous"));C._elements._next=Ojay(D.div({className:"image-next"},"Next"));D.div({className:"display"},function(E){C._elements._display=E.img();C._elements._caption=Ojay(E.div({className:"caption"}))});C._elements._thumbs=Ojay(D.div({className:"thumbs"}))});this._overlay.insert(this._panel.getHTML());this.setImage(0,false);C._elements._prev.on("click")._(this).decrement();C._elements._prev.on("mouseover").addClass("hovered hovered-image-previous");C._elements._prev.on("mouseout").removeClass("hovered hovered-image-previous");C._elements._next.on("click")._(this).increment();C._elements._next.on("mouseover").addClass("hovered hovered-image-next");C._elements._next.on("mouseout").removeClass("hovered hovered-image-next");var B=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));B.on("click")._(this._overlay).hide("fade");this._overlay.getContainer().insert(B,"top");this._images.forEach(function(D){this._elements._thumbs.insert(D.getHTML(this))},this)},forEach:function(B,A){return this._images.forEach(B,A)},setImage:function(B,A){if(A!==false){this._overlay.center().show("fade")._(function(){if(this._pager){return }this._pager=new Ojay.Paginator(this._elements._thumbs,{direction:"horizontal",columns:this.klass.THUMBS_PER_PAGE,rows:1});this._pager.setup();var C=this._pager.addControls("before");C.getPreviousButton().on("mouseover").addClass("hovered-previous");C.getPreviousButton().on("mouseout").removeClass("hovered-previous");C.getNextButton().on("mouseover").addClass("hovered-next");C.getNextButton().on("mouseout").removeClass("hovered-next")}.bind(this))}if(B===null){return }if(typeof B=="number"){B=this._images[B]}this._index=this._images.indexOf(B);this._elements._display.src=B._fullPath;this._elements._display.alt=B._alt;if(B.caption){this._elements._caption.show().setContent(B.caption)}else{this._elements._caption.hide()}if(B.aspect>this.klass.ASPECT_THRESH){this._overlay.getContainer().removeClass("portrait").addClass("landscape")}else{this._overlay.getContainer().addClass("portrait").removeClass("landscape")}},increment:function(){if(this._index==this._images.length-1){return }this._index+=1;this.setImage(this._index)},decrement:function(){if(this._index==0){return }this._index-=1;this.setImage(this._index)}});var Panel=new JS.Class({initialize:function(A,C,B){this._classes=A;this._block=C;this._HTML=B;this.getHTML()},getHTML:function(){if(this._html){return this._html}var B=this,C=B._classes,E=B._block,D=B._HTML;var A=(typeof E=="function");D=D||Ojay.HTML;this._html=Ojay(D.div({className:"panel"+(C?" "+C:"")},function(F){F.div({className:"panel-c"},function(G){G.div({className:"panel-t"});B._content=Ojay(G.div(function(H){if(A){E(H)}}))});if(!A){B._content.insert(E,"bottom")}F.div({className:"panel-b"},function(G){G.div()})}));return this.getHTML()},setContent:function(){this._content.setContent.apply(this._content,arguments);return this},insert:function(){this._content.insert.apply(this._content,arguments);return this}});PanelOverlay=new JS.Class(Ojay.ContentOverlay,{initialize:function(B){this._panel=new Panel();var A=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));this.callSuper();this.getContainer().insert(A,"top");A.on("click")._(this).hide("fade");this.getContentElement().insert(this._panel.getHTML())},setContent:function(){this._panel.setContent.apply(this._panel,arguments);return this},insert:function(){this._panel.insert.apply(this._panel,arguments);return this}});if(typeof deconcept=="undefined"){var deconcept={}}if(typeof deconcept.util=="undefined"){deconcept.util={}}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={}}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return }this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(E){this.setAttribute("swf",E)}if(C){this.setAttribute("id",C)}if(K){this.setAttribute("width",K)}if(F){this.setAttribute("height",F)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(J){this.addParam("bgcolor",J)}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]||""},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]||""},getVariables:function(){return this.variables},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B]}return A},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var C=this.getParams();for(var A in C){D+=[A]+'="'+C[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"'}D+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+(this.getAttribute("style")||"")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var A in C){D+='<param name="'+A+'" value="'+C[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />'}D+="</object>"}return D},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var D=1;var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0])}catch(E){D=null}}}else{try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always"}catch(E){if(C.major==6){return C}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(D!=null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","))}}}return C};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){}}}}};if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var TextResizer=new JS.Class({initialize:function(B){this._container=Ojay.byId(B);this._label=Ojay(Ojay.HTML.p({className:"text-resize-label"},"Text size:"));this._list=Ojay(Ojay.HTML.ol({className:"text-resize-list"}));this._container.insert(this._label).insert(this._list);var A=this._getCookie();(A)?this.resize(A):this.resize("text-small");this._toggles={};this.klass.STATES.forEach(function(D){var C=Ojay(Ojay.HTML.li({className:"resize-"+D},function(E){E.span("A")}));if(D==this._current){C.addClass("current")}this._toggles[D]=C;this._list.insert(C);C.on("mouseover").addClass("hovered");C.on("mouseout").removeClass("hovered");C.on("click")._(this).resize(D)},this)},resize:function(A){if(this._current==A){return true}this._switchClass(A);this._setCookie(A);this._current=A},_switchClass:function(B){var A=Ojay(document.body);if(this._toggles){this._toggles[this._current].removeClass("current");this._toggles[B].addClass("current")}A.removeClass(this._current);A.addClass(B)},_getCookie:function(){return YAHOO.util.Cookie.get("text_size")},_setCookie:function(A){var B=new Date();B.setTime(B.getTime()+(1000*60*60*24*31));YAHOO.util.Cookie.set("text_size",A,{expires:B,path:"/"})},extend:{STATES:["text-small","text-medium","text-large"]}})