if(typeof (AC)=="undefined"){AC={};}if(typeof (document.event)=="undefined"){document.event={};}if(Event.Publisher){Object.extend(document.event,Event.Publisher);}AC.SwapView=Class.create({_view:null,currentContent:null,delegate:null,initialize:function(c){if(typeof c==="string"){this._viewId=c;}else{this._view=$(c);}if(this._view){var X=this._view.childNodes,a;while(a=X[0]){this._view.removeChild(a);}this._view.addClassName("swapView");}},view:function(){if(!this._view){this._view=$(this._viewId);if(this._view){this._view.innerHTML="";this._view.addClassName("swapView");}}return this._view;},setDelegate:function(c){this.delegate=c;},setContent:function(c){if(c==this.currentContent){return ;}if(this.currentContent&&typeof (this.delegate.willClose)=="function"){this.delegate.willClose(this,this.currentContent);}if(c&&typeof (this.delegate.isContentLoaded)=="function"){if(!this.delegate.isContentLoaded(this,c)){if(typeof (this.delegate.loadContent)=="function"){this.delegate.loadContent(this,c);return ;}}}this.setLoadedContent(c);},setLoadedContent:function(a){if(typeof (this.delegate.willShow)=="function"){a=this.delegate.willShow(this,this.currentContent,a);}var c=true;if(typeof (this.delegate.shouldAnimateContentChange)=="function"){c=this.delegate.shouldAnimateContentChange(this,this.currentContent,a);}if(c&&typeof (this.delegate.willAnimate)=="function"){this.didAnimate=true;if(a&&this.currentContent!==a){this.view().appendChild(a);}if(typeof (this.delegate.didAppendContent)=="function"){this.delegate.didAppendContent(this,a);}var X=this.delegate.willAnimate(this,this.currentContent,a,this.didShow.bind(this,a));}else{this.didAnimate=false;if(this.currentContent!==a){if(this.currentContent&&this.currentContent.parentNode){this.currentContent.parentNode.removeChild(this.currentContent);}if(a){this.view().appendChild(a);}if(typeof (this.delegate.didAppendContent)=="function"){this.delegate.didAppendContent(this,a);}}if(a){$(a).setOpacity(1);}this.didShow(a);}},didShow:function(c){if(this.currentContent&&(this.currentContent!==c)&&this.currentContent.parentNode){this.currentContent.parentNode.removeChild(this.currentContent);}if(typeof (this.delegate.didShow)=="function"){this.delegate.didShow(this,this.currentContent,c);}this.currentContent=c;}});if(typeof (AC.ViewMaster)=="undefined"){AC.ViewMaster={};}AC.ViewMaster.Viewer=Class.create({view:null,triggerClassName:null,currentSection:null,requestedSection:null,sections:null,orderedSections:null,_locked:false,_didShowInitial:false,options:null,initialSectionFromId:function(c){return this.sectionWithId(c);},sectionWithId:function(Q){if(!Q){return null;}var X=null;if(Q&&this.sections.get(Q)){X=this.sections.get(Q);}if(!X){var a,c=null;a=document.getElementById(Q);if(a===this.view._view){a=null;}if(!a){c=document.getElementsByName(Q);}if(c&&c.length>0){a=c[0];}if(a===this.view._view){a=null;}if(a){if(a.tagName.toLowerCase()==="a"){if(Element.Methods.hasClassName(a,this.triggerClassName)){X=this.addSection(a);}}else{X=this.addSection(a);}}}return X;},indexOfSection:function(c){return this.orderedSections.indexOf(c.id);},initialize:function(H,c,O,a){this.triggerClassName=O;this.sections=$H();this.orderedSections=[];this.options=a||{};this.triggerEvent=this.options.triggerEvent||"click";var r=null;if(H){for(var Q=0;Q<H.length;Q++){section=this.addSection(H.item(Q));if(!r){r=section;}}}this.view=new AC.SwapView(c);this.view.setDelegate(this);var X=document.location.hash.replace(/#/,""),F;if(X!==this.view._viewId){F=this.sectionWithId(X);}if(F){r=F;}if(!r&&typeof this.options.initialId==="string"&&this.options.initialId.length>0){r=this.sectionWithId(this.options.initialId);}this.show(r);Event.observe(document,this.triggerEvent,this._triggerClicked.bindAsEventListener(this));if(AC.Detector.isIEStrict()){Event.observe(document,"mouseup",this._triggerClicked.bindAsEventListener(this));}if(typeof (this.listenForEvent)=="function"){this.selectSectionFromEventHandler=this.selectSectionFromEvent.bind(this);this.listenForEvent(AC.ViewMaster,"ViewMasterSelectSectionWithIdNotification",true,this.selectSectionFromEventHandler);if(this.options.parentSectionId){this.listenForEvent(AC.ViewMaster,"ViewMasterWillCloseNotification",false,function(Z){var l=Z.event_data.data;if(this===l.sender){return ;}if(l.outgoingView&&l.outgoingView.id===this.options.parentSectionId){this.willClose(this.view,this.currentSection);}});}}},selectSectionFromEvent:function(c){if(c.event_data.data.sender===this){return ;}if(c.event_data.data.parentTriggerClassName!==this.triggerClassName){return ;}this.selectSectionWithIdEvent(c.event_data.data.parentSectionId,c.event_data.data.event);},selectSectionWithIdEvent:function(H,F){var c=this.sectionWithId(H),Q=null,a,X,O=false;if(c){Q=c.triggers();if(Q&&Q.length>0){for(a=0;(X=Q[a]);a++){if(Element.Methods.hasClassName(X,this.triggerClassName)){O=true;break;}}}if(!O){X=document.createElement("a");X.className=this.triggerClassName;X.href="#"+H;X.style.display="none";document.body.appendChild(X);c._triggers.push(X);}this.triggerClicked(F,$(X));}},setDelegate:function(c){this.delegate=c;if(this.delegate&&typeof (this.delegate.didShow)==="function"&&this.currentSection&&this.currentSection.isContentLoaded()){this.delegate.didShow(this,this.previousSection,this.currentSection);}},addSection:function(c){var a=new AC.ViewMaster.Section(c,this);this.sections.set(a.id,a);this.orderedSections.push(a.id);return a;},triggerClicked:function(c,a){a.addClassName("active");if(c&&this.options.silentTriggers){Event.stop(c);}var Q=null;if(!!a.href.match(/#previous/)){Q=this.getPreviousSection();}else{if(!!a.href.match(/#next/)){Q=this.getNextSection();}else{if(!this.sectionRegExp){this.sectionRegExp=this.options.sectionRegExp||new RegExp(/#(.*)$/);}var X=a.href.match(this.sectionRegExp);if(X){var F=X[1];}else{F=a.name;}Q=this.sections.get(F);}}if(!Q){Q=this.addSection(a);}if(Q.isContentRemote()){if(Q.isContentLoaded()){Q.clearTrigger(a);}if(c){Event.stop(c);}}if(Q==this.currentSection){if(c){Event.stop(c);}if(typeof (AC.ViewMaster.dispatchEvent)=="function"){AC.ViewMaster.dispatchEvent("ViewMasterDidShowNotification",{sender:this,outgoingView:this.previousSection,incomingView:this.currentSection});}return ;}else{if(!Q){return ;}}this._didShowInitial=true;setTimeout(this.show.bind(this,Q),1);},_triggerClicked:function(c){if(this._locked){Event.stop(c);return ;}var X=c.element();if(AC.Detector.isIEStrict()&&c.type==="mouseup"){if(X&&X.nodeName.toUpperCase()==="A"){X=X.down("."+this.triggerClassName);}}else{while(X&&X.nodeName.toUpperCase()!="A"&&X.nodeName.toUpperCase()!="BODY"){X=X.parentNode;}}if(X&&X.href&&Element.Methods.hasClassName(X,this.triggerClassName)){if(this.options.parentSectionId&&(typeof (this.stopListeningForEvent)=="function")&&(typeof (this.listenForEvent)=="function")&&(typeof (AC.ViewMaster.dispatchEvent)=="function")){var a=this;Event.stop(c);this.stopListeningForEvent(AC.ViewMaster,"ViewMasterSelectSectionWithIdNotification",true,this.selectSectionFromEventHandler);this.listenForEvent(AC.ViewMaster,"ViewMasterDidShowNotification",false,function(Q){this.stopListeningForEvent(AC.ViewMaster,"ViewMasterDidShowNotification",false,arguments.callee);a.triggerClicked(Q,X);this.listenForEvent(AC.ViewMaster,"ViewMasterSelectSectionWithIdNotification",true,this.selectSectionFromEventHandler);});AC.ViewMaster.dispatchEvent("ViewMasterSelectSectionWithIdNotification",{sender:this,parentSectionId:this.options.parentSectionId,parentTriggerClassName:this.options.parentTriggerClassName,event:c});}else{this.triggerClicked(c,X);}}},isContentLoaded:function(a,c){return c.isContentLoaded();},loadContent:function(a,c){if(c){c.loadContent();}},_showContentDidLoad:false,contentDidLoad:function(X,a,c){if(a&&a.firstChild){this._showContentDidLoad=true;}this.view.setLoadedContent(X);AC.loadRemoteContent.insertScriptFragment(a);if(this._showContentDidLoad&&this.delegate&&typeof (this.delegate.didShow)=="function"){this.delegate.didShow(this,this.previousSection,this.currentSection);}this._showContentDidLoad=false;},show:function(a,c){if(this._locked||(!a&&!c)){return ;}if(!this.options.alwaysShowSection&&a==this.currentSection){return ;}this._locked=true;this.previousSection=this.currentSection;this.currentSection=a;this.view.setContent(a);if(typeof this.options.ensureInView==="boolean"&&this.options.ensureInView){if(this._didShowInitial){var X=a.content.viewportOffset()[1];if(X<0||X>(document.viewport.getHeight()*0.75)){new Effect.ScrollTo(a.content,{duration:0.3});}}else{$(document.body).scrollTo();}}},showFirst:function(){this.show(this.getFirstSection());},getFirstSection:function(){return this.sections.get(this.orderedSections[0]);},showNext:function(){this.show(this.getNextSection());},getNextSection:function(){var a=this.orderedSections.indexOf(this.currentSection.id);var c=(this.orderedSections.length-1)==a?0:a+1;return this.sections.get(this.orderedSections[c]);},showPrevious:function(){this.show(this.getPreviousSection());},getPreviousSection:function(){var c=this.orderedSections.indexOf(this.currentSection.id);var a=0==c?this.orderedSections.length-1:c-1;return this.sections.get(this.orderedSections[a]);},willShow:function(a,X,c){if(this.delegate&&typeof (this.delegate.willShow)=="function"){this.delegate.willShow(this,this.previousSection,this.currentSection);}if(typeof (AC.ViewMaster.dispatchEvent)=="function"){AC.ViewMaster.dispatchEvent("ViewMasterWillShowNotification",{sender:this,outgoingView:this.previousSection,incomingView:this.currentSection});}this._repaintTriggers(this.previousSection,this.currentSection);if(this._didShowInitial&&c&&c!=this.previousSection){$(c.content).setOpacity(0);$(c.content).removeClassName("hidden");}if(c){return c.willShow(this);}return null;},willClose:function(c,a){if(this.delegate&&typeof (this.delegate.willClose)=="function"){this.delegate.willClose(this,this.previousSection,this.currentSection);}if(typeof (AC.ViewMaster.dispatchEvent)=="function"){AC.ViewMaster.dispatchEvent("ViewMasterWillCloseNotification",{sender:this,outgoingView:a});}if(this.previousSection){this.previousSection.willClose(this);}},shouldAnimateContentChange:function(X,a,c){return (typeof this.options.shouldAnimateContentChange==="boolean")?this.options.shouldAnimateContentChange:true;},willAnimate:function(a,X,c,F){var H=this.options.animationDuration||0.4;var Q=Math.random()+"Queue";if(!this._didShowInitial&&typeof (F)=="function"){F();return ;}if(X){return new Effect.Parallel([new Effect.Opacity(X,{sync:true,from:1,to:0}),new Effect.Opacity(c,{sync:true,from:0,to:1})],{duration:H,afterFinish:F,queue:{scope:Q}});}else{return new Effect.Opacity(c,{from:0,to:1,duration:H,afterFinish:F,queue:{scope:Q}});}},didAppendContent:function(c,a){if(this.delegate&&typeof this.delegate.didAppendContent==="function"){this.delegate.didAppendContent(this,a);}},didShow:function(a,X,c){if(this.currentSection){this.currentSection.didShow(this);}this._didShowInitial=true;this._locked=false;if(!this._showContentDidLoad&&this.delegate&&typeof (this.delegate.didShow)=="function"){this.delegate.didShow(this,this.previousSection,this.currentSection);}if(typeof (AC.ViewMaster.dispatchEvent)=="function"){AC.ViewMaster.dispatchEvent("ViewMasterDidShowNotification",{sender:this,outgoingView:this.previousSection,incomingView:this.currentSection});}},_repaintTriggers:function(a,c){if(a){var H=a.triggers();for(var X=0,Q;(Q=H[X]);X++){Q.removeClassName("active");}H=a.relatedElements();for(var X=0,Q;(Q=H[X]);X++){Q.removeClassName("active");}}if(c){var F=c.triggers();for(var X=0,Q;(Q=F[X]);X++){Q.addClassName("active");}F=c.relatedElements();for(var X=0,Q;(Q=F[X]);X++){Q.addClassName("active");}}}});if(Event.Publisher){Object.extend(AC.ViewMaster,Event.Publisher);}if(Event.Listener){Object.extend(AC.ViewMaster.Viewer.prototype,Event.Listener);}AC.ViewMaster.Section=Class.create({content:null,moviePanel:null,controllerPanel:null,movie:null,_movieController:null,movieLink:null,endState:null,hasShown:false,_isContentRemote:false,isContentRemote:function(){return this._isContentRemote;},_isContentLoaded:true,isContentLoaded:function(){return this._isContentLoaded;},_onMoviePlayable:Prototype.EmptyFunction,_onMovieFinished:Prototype.EmptyFunction,id:null,triggers:function(){if(!this._triggers){this._triggers=[];var Q=new RegExp("#"+this.id+"$");if(this.viewMaster.sectionRegExp||this.viewMaster.options.sectionRegExp){Q=this.viewMaster.sectionRegExp||this.viewMaster.options.sectionRegExp;Q=Q.toString().replace(/^\//,"").replace(/\/$/,"");Q=new RegExp(Q.replace("(.*)",this.id));}var X=document.getElementsByClassName(this.viewMaster.triggerClassName);for(var c=0,a;(a=$(X[c]));c++){if(a.tagName.toLowerCase()!=="a"){continue;}if(a.href.match(Q)){this._triggers.push(a);}}}return this._triggers;},relatedElements:function(){if(!this._relatedElements){this._relatedElements=document.getElementsByClassName(this.id);}return this._relatedElements;},initialize:function(X,O){this.content=$(X);if(this.content.tagName.toLowerCase()==="a"){var c=this.content.href;var F=c.split("#");this._contentURL=F[0];var Q=window.location.href.split("#");var H=X.className;if(F.length===2){this.id=F[1];}if(this._contentURL.length>0&&(this._contentURL!==Q[0])&&(!this._contentURL.startsWith("#")||this._contentURL!==c)){this._isContentRemote=true;this._isContentLoaded=false;}else{var r=$(this.id)||$("MASKED-"+this.id);if(r){this.content=r;}}if(!this.id){this.id=this.content.name;}}else{this.id=X.id;}if(!this._isContentRemote||this._isContentLoaded){this.content.setAttribute("id","MASKED-"+this.id);}if(O){this.viewMaster=O;}if(!this._isContentRemote&&this._isContentLoaded&&!this.content.hasClassName("content")){var a=this.content.getElementsByClassName("content")[0];if(a){this.content=a;}}this.isMobile=AC.Detector.isMobile();},clearTrigger:function(c){if(c.href===("#"+this.id)){return ;}c.href="#"+this.id;c.removeAttribute("id");c.removeAttribute("name");},remoteContentDidLoad:function(c,a){this.clearTrigger(this.content);this.content=$(c);this.content.setAttribute("id","MASKED-"+this.id);this._isContentLoaded=true;this.viewMaster.contentDidLoad(this,a);},loadContent:function(){if(this._isContentLoaded){var a=this;a.viewMaster.contentDidLoad(a,null);}else{if(this.content.className.indexOf("imageLink")!==-1){var c=document.createElement("div");c.appendChild(this.content.cloneNode(true));this.remoteContentDidLoad(c);}else{if(this.content.className.indexOf("movieLink")!==-1){var c=document.createElement("div");c.appendChild(this.content.cloneNode(true));this.remoteContentDidLoad(c);}else{AC.loadRemoteContent(this._contentURL,true,true,this.remoteContentDidLoad.bind(this));}}}},willShow:function(){if(!this.hasShown){this.hasShown=true;var c=this.content.getElementsByClassName("imageLink");for(var a=0;a<c.length;a++){this._loadImage(c[a]);}if(!this.moviePanel){this.movieLink=this.content.getElementsByClassName("movieLink")[0];this.posterLink=this.content.getElementsByClassName("posterLink")[0];if(this.movieLink){this._loadMovie();}}}return this.content;},_loadImage:function(a){var c=document.createElement("img");c.setAttribute("src",a.href);c.setAttribute("alt",a.title);a.parentNode.replaceChild(c,a);},_loadMovie:function(){this.moviePanel=$(document.createElement("div"));this.moviePanel.addClassName("moviePanel");this.movieLink.parentNode.replaceChild(this.moviePanel,this.movieLink);this.controllerPanel=$(document.createElement("div"));this.controllerPanel.addClassName("controllerPanel");this.moviePanel.parentNode.insertBefore(this.controllerPanel,this.moviePanel.nextSibling);this.endState=$(this.content.getElementsByClassName("endState")[0]);if(this.endState){this.endState.parentNode.removeChild(this.endState);var c=$(this.endState.getElementsByClassName("replay")[0]);if(c){c.observe("click",function(a){Event.stop(a);this.replayMovie();}.bindAsEventListener(this));}}},didShow:function(a){var c=this.hasMovie()&&!this.isMobile;if(c){this._movieController=new AC.QuicktimeController();this.controllerPanel.innerHTML="";this.controllerPanel.appendChild(this._movieController.render());}this._playMovie();if(c){this._onMoviePlayable=this._movieController.monitorMovie.bind(this._movieController);this._onMovieFinished=this.didFinishMovie.bind(this);this._movieController.attachToMovie(this.movie,{onMoviePlayable:this._onMoviePlayable,onMovieFinished:this._onMovieFinished});}},willClose:function(c){this._closeController();this._closeMovie();},_closeMovie:function(){if(this.movie&&this.moviePanel){this.moviePanel.removeChild(this.movie);this.movie=null;this.moviePanel.innerHTML="";}},_closeController:function(){if(this._movieController&&this._movieController.movie&&this.hasMovie()&&!this.isMobile){this._movieController.Stop();this._movieController.detachFromMovie();this.controllerPanel.addClassName("inactive");this._movieController.replay=this.replayMovie.bind(this);this.controllerPanel.observe("click",this._movieController.replay);}},hasMovie:function(){return !!this.movieLink;},didFinishMovie:function(){if(!this.hasMovie()){return ;}this._closeController();this._closeMovie();if(this.endState){this.moviePanel.appendChild(this.endState);}if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("didFinishMovie",this);}},_playMovie:function(){if(this.movieLink&&this.moviePanel){this.moviePanel.innerHTML="";if(this.posterLink&&this.posterLink.href){var a=this.posterLink.href;}var F=this.movieLink.getAttribute("href",2).toQueryParams();var Q=F.width||640;var c=F.height||480;var X=F.bgcolor||"white";this.movie=AC.Quicktime.packageMovie(this.movieLink.id+"movieId",this.movieLink.getAttribute("href",2),{width:Q,height:c,controller:false,posterFrame:a,showlogo:false,autostart:true,cache:true,bgcolor:X,aggressiveCleanup:false});this.moviePanel.appendChild(this.movie);if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("didStart",this);}}},replayMovie:function(){if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("replayMovie",this);}this._playMovie();this.controllerPanel.removeClassName("inactive");this.controllerPanel.stopObserving("click",this._movieController.replay);this._movieController.replay=null;this._movieController.attachToMovie(this.movie,{onMoviePlayable:this._onMoviePlayable,onMovieFinished:this._onMovieFinished});}});AC.ViewMaster.SlideshowViewer=Class.create();Object.extend(AC.ViewMaster.SlideshowViewer.prototype,AC.ViewMaster.Viewer.prototype);Object.extend(AC.ViewMaster.SlideshowViewer.prototype,{_superInitialize:AC.ViewMaster.Viewer.prototype.initialize,initialize:function(Q,c,F,X,a){this._superInitialize(Q,c,F,a);this.slideshow=new AC.ViewMaster.Slideshow(this,X,a);},start:function(){this.slideshow.start();},stop:function(){this.slideshow.stop();},reset:function(){if(this._isLocked){this._needsReset=true;}else{this.slideshow.reset();}},superDidShow:AC.ViewMaster.Viewer.prototype.didShow,didShow:function(a,X,c){this.superDidShow(a,X,c);if(this._needsReset){this._needsReset=false;this.slideshow.reset();}},next:function(){this.slideshow.next();},previous:function(){this.slideshow.previous();}});AC.ViewMaster.Slideshow=Class.create();if(Event.Listener){Object.extend(AC.ViewMaster.Slideshow.prototype,Event.Listener);}if(Event.Publisher){Object.extend(AC.ViewMaster.Slideshow.prototype,Event.Publisher);}Object.extend(AC.ViewMaster.Slideshow.prototype,{contentController:null,animationTimeout:null,options:null,_playing:false,_active:false,_progress:0,setProgress:function(c){this._progress=c;},progress:function(){return this._progress;},initialize:function(c,X,a){this.contentController=c;this.triggerClassName=X;this.options=a||{};if(!a.addNoListeners){this.listenForEvent(AC.ViewMaster,"ViewMasterWillShowNotification",true,this.willShow);this.listenForEvent(AC.ViewMaster,"ViewMasterDidShowNotification",true,this.didShow);}if(this.options.autoplay){this.start();}if(this.triggerClassName){Event.observe(document,"click",this._triggerHandler.bindAsEventListener(this));}},start:function(){if(this._active){return ;}this._active=true;if(this.options.wipeProgress=="always"||this.options.wipeProgress=="on start"){this._progress=0;}this.play(true);this._repaintTriggers();if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("didStart",this);}},stop:function(){if(!this._active){return ;}this._active=false;this.pause();this._repaintTriggers();if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("didEnd",this);}},play:function(c){if(!this._active){return ;}if(this.options.wipeProgress=="always"||(this.options.wipeProgress=="on play"&&!c)){this._progress=0;}this.animationTimeout=setTimeout(this._update.bind(this),this._heartbeatDelay());this._playing=true;},_update:function(){if(typeof (this.options.onProgress)=="function"){this.options.onProgress(this._progress,this.delay());}if(this._progress>=this.delay()){this._progress=0;this.next();}else{this._progress+=this._heartbeatDelay();this.animationTimeout=setTimeout(this._update.bind(this),this._heartbeatDelay());}},delay:function(){return this.options.delay||5000;},_heartbeatDelay:function(){return this.options.heartbeatDelay||100;},pause:function(){clearTimeout(this.animationTimeout);this._playing=false;},next:function(){if(this.options.willEnd&&(this.contentController.getNextSection()==this.contentController.getFirstSection())){if(typeof (document.event.dispatchEvent)=="function"){document.event.dispatchEvent("didEnd",this);}return ;}this.contentController.showNext();},previous:function(){this.contentController.showPrevious();},reset:function(){this.contentController.showFirst();this.setProgress(0);},willShow:function(c){if(c.event_data.data.sender!=this.contentController){return ;}this.pause();},didShow:function(c){if(c.event_data.data.sender!=this.contentController){return ;}this.play();},_triggerHandler:function(c){var a=c.element();var X=null;if(a.hasClassName(this.triggerClassName)&&a.href.match(/#slideshow-toggle/)){Event.stop(c);if(this._active){this.stop();}else{this.start();}}},_repaintTriggers:function(){if(!this.triggerClassName){return ;}var a=document.getElementsByClassName(this.triggerClassName);for(var c=a.length-1;c>=0;c--){this._repaintTrigger(a[c]);}},_repaintTrigger:function(c){var a=$(c);if(this._active){a.addClassName("playing");}else{a.removeClassName("playing");}}});AC.loadRemoteContent=function(r,c,X,O,Q,H){if(typeof r!=="string"){return ;}if(typeof c!=="boolean"){c=true;}if(typeof X!=="boolean"){X=true;}var F=arguments.callee;var a=F._loadArgumentsByUrl[r];if(!a){F._loadArgumentsByUrl[r]={contentURL:r,importScripts:c,importCSS:X,callback:O,context:Q,delegate:H};new Ajax.Request(r,{method:"get",requestHeaders:{Accept:"text/xml"},onSuccess:arguments.callee.loadTemplateHTMLFromRequest,onFailure:arguments.callee.failedToadTemplateHTMLFromRequest,onException:function(Z,l){throw (l);},onCreate:function(Z){Z.request.overrideMimeType("text/xml");}});}};AC.loadRemoteContent._loadArgumentsByUrl={};AC.loadRemoteContent.loadTemplateHTMLFromRequest=function(a){var Q=a.request.url;var k=arguments.callee;var r=AC.loadRemoteContent._loadArgumentsByUrl[Q];var K=window.document;var l=a.responseXMLValue().documentElement;if(AC.Detector.isIEStrict()){l=l.ownerDocument;}var K=window.document;var o=document.createDocumentFragment();if(r.importScripts){AC.loadRemoteContent.importScriptsFromXMLDocument(l,o,r);}if(r.importCSS){AC.loadRemoteContent.importCssFromXMLDocumentAtLocation(l,Q,r);}var U=null;var c=null;var O=l.getElementsByTagName("body")[0];if(!O){return ;}O.normalize();var c=Element.Methods.childNodeWithNodeTypeAtIndex(O,Node.ELEMENT_NODE,0);var H=AC.Detector.isSafari2();if(c){if(H){U=K._importNode(c,true);}else{U=K.importNode(c,true);}if(U.cleanSpaces){U.cleanSpaces(true);}}else{if(O.cleanSpaces){O.cleanSpaces(true);}else{if(typeof O.normalize==="function"){O.normalize();}}var Z=O.childNodes;U=K.createDocumentFragment();var Y=/\S/;for(var F=0,X=0;(X=Z[F]);F++){var M=(H)?K._importNode(X,true):K.importNode(X,true);U.appendChild(M);}}var V=r.callback;V(U,o,r.context);};AC.loadRemoteContent.javascriptTypeValueRegExp=new RegExp("text/javascript","i");AC.loadRemoteContent.javascriptLanguageValueRegExp=new RegExp("javascript","i");AC.loadRemoteContent.documentScriptsBySrc=function(){if(!AC.loadRemoteContent._documentScriptsBySrc){AC.loadRemoteContent._documentScriptsBySrc={};var a=document.getElementsByTagName("script");if(!a||a.length===0){return AC.loadRemoteContent._documentScriptsBySrc;}for(var X=0,c=null;(c=a[X]);X++){var Q=c.getAttribute("type");var H=null;var O=c.getAttribute("language");if(!this.javascriptTypeValueRegExp.test(Q)&&!this.javascriptLanguageValueRegExp.test(O)){continue;}if(c.hasAttribute){var F=c.hasAttribute("src");}else{var F=Element.Methods.hasAttribute(c,"src");}if(F){var H=c.getAttribute("src");AC.loadRemoteContent._documentScriptsBySrc[H]=H;}}}return AC.loadRemoteContent._documentScriptsBySrc;};AC.loadRemoteContent.importScriptsFromXMLDocument=function(M,X,n){var H=M.getElementsByTagName("script"),O,Z,K,G,Q=n.contentURL,J=n.delegate,F=n.context,a=(J&&typeof J.shouldImportScript==="function"),l=true;if(!X){X=document.createDocumentFragment();}var k=AC.loadRemoteContent.documentScriptsBySrc();for(var u=0,Y=null;(Y=H[u]);u++){O=Y.getAttribute("type");Z=null;l=true;K=Y.getAttribute("language");if(!this.javascriptTypeValueRegExp.test(O)&&!this.javascriptLanguageValueRegExp.test(K)){continue;}if(Y.hasAttribute){G=Y.hasAttribute("src");Z=Y.getAttribute("src");}else{Z=Y.getAttribute("src");G=((Z!=null)&&(Z!==""));}if(Y.getAttribute("id")==="Redirect"||(a&&!J.shouldImportScriptForContentURL(Y,Q,F))){continue;}if(G){if(!k.hasOwnProperty(Z)){var V=document.createElement("script");V.setAttribute("type","text/javascript");V.src=Z;AC.loadRemoteContent._documentScriptsBySrc[Z]=Z;X.appendChild(V);}}else{var V=document.createElement("script");V.setAttribute("type","text/javascript");if(AC.Detector.isIEStrict()){var o=new Function(Y.text);V.onreadystatechange=function(){var g=window.event.srcElement;if(!g.isLoaded&&((g.readyState=="complete")||(g.readyState=="loaded"))){g.onreadystatechange=null;g.isLoaded=true;o();}};}else{var U=navigator.userAgent.toLowerCase();var c=(U.indexOf("applewebkit")!=-1);var r=parseInt(parseFloat(U.substring(U.lastIndexOf("safari/")+7)));var v=(c&&r>=419);if(v){V.innerHTML=Y.innerHTML;}else{V.text=Y.text;}}AC.loadRemoteContent._documentScriptsBySrc[Z]=Z;X.appendChild(V);}}return X;};AC.loadRemoteContent.insertScriptFragment=function(a){if(!a){return ;}var c=document.getElementsByTagName("head")[0];c.appendChild(a);c=null;};AC.loadRemoteContent.documentLinksByHref=function(){if(!AC.loadRemoteContent._documentLinksByHref){AC.loadRemoteContent._documentLinksByHref={};var a=document.getElementsByTagName("link");if(!a||a.length===0){return AC.loadRemoteContent._documentLinksByHref;}for(var X=0,F=null;(F=a[X]);X++){var Q=F.getAttribute("type");if(F.type.toLowerCase()!=="text/css"){continue;}var H=null;if(F.hasAttribute){var c=F.hasAttribute("href");}else{var c=Element.hasAttribute(F,"href");}if(c){var H=F.getAttribute("href");AC.loadRemoteContent._documentLinksByHref[H]=H;}}}return AC.loadRemoteContent._documentLinksByHref;};AC.loadRemoteContent.__importCssElementInHeadFromLocation=function(F,O,a){var Q=(F.tagName.toUpperCase()==="LINK");if(Q){var H=F.getAttribute("type");if(!H||H&&H.toLowerCase()!=="text/css"){return ;}var X=F.getAttribute("href");if(!X.startsWith("http")&&!X.startsWith("/")){var Z=X;if(a.pathExtension().length>0){a=a.stringByDeletingLastPathComponent();}X=a.stringByAppendingPathComponent(Z);}if(AC.Detector.isIEStrict()){var c=window.document.createStyleSheet(X,1);}else{var r=window.document.importNode(F,true);r.href=X;}AC.loadRemoteContent.documentLinksByHref()[X]=X;}if(!AC.Detector.isIEStrict()||(AC.Detector.isIEStrict()&&!Q)){O.insertBefore(r,O.firstChild);}};AC.loadRemoteContent.importCssFromXMLDocumentAtLocation=function(r,a,O){var Z=window.document.getElementsByTagName("head")[0];var X=[];X.addObjectsFromArray(r.getElementsByTagName("style"));X.addObjectsFromArray(r.getElementsByTagName("link"));if(X){var Q=AC.loadRemoteContent.documentLinksByHref();for(var F=0,H=null;(H=X[F]);F++){var c=H.getAttribute("href");if(Q.hasOwnProperty(c)){continue;}this.__importCssElementInHeadFromLocation(H,Z,a);}}};Ajax.Request.prototype._overrideMimeType=null;Ajax.Request.prototype.overrideMimeType=function(c){this._overrideMimeType=c;if(this.transport.overrideMimeType){this.transport.overrideMimeType(c);}};Ajax.Request.prototype._doesOverrideXMLMimeType=function(){return (this._overrideMimeType==="text/xml");};Ajax.Response.prototype.responseXMLValue=function(){if(AC.Detector.isIEStrict()){var c=this.transport.responseXML.documentElement;if(!c&&this.request._doesOverrideXMLMimeType()){this.transport.responseXML.loadXML(this.transport.responseText);}}return this.transport.responseXML;};