YAHOO.util.Event.onDOMReady(function(){var c=location.hash;var a=YAHOO.util.Dom.getElementsByClassName("expander");for(var b=0;b<a.length;b++){new Mozilla.Expander(a[b])}if(c){if((/safari/gi).test(navigator.userAgent)){location.hash="#nothing"}location.hash=c}});if(typeof Mozilla=="undefined"){function Mozilla(){}}Mozilla.Expander=function(a){if(typeof a=="String"){a=YAHOO.util.Dom.get(a)}var c=YAHOO.util.Dom.getFirstChild(a);this.content=YAHOO.util.Dom.getNextSibling(c);this.container=a;if(!this.container.id){YAHOO.util.Dom.generateId(this.container,"mozilla-expander-")}this.id=this.container.id;this.anchor=document.createElement("a");this.anchor.href="#";this.anchor.className="expander-anchor";while(c.firstChild){this.anchor.appendChild(c.firstChild)}c.appendChild(this.anchor);YAHOO.util.Event.on(this.anchor,"click",function(d){YAHOO.util.Event.preventDefault(d);this.toggleWithAnimation()},this,true);this.content_animation=document.createElement("div");this.content_animation.className="expander-animation";var b=document.createElement("div");b.className="expander-padding";while(this.content.firstChild){b.appendChild(this.content.firstChild)}this.content_animation.appendChild(b);this.content.appendChild(this.content_animation);this.semaphore=false;YAHOO.util.Dom.removeClass(this.container,"expander");if((location.hash.substring(1)==this.id)||this.loadState()==Mozilla.Expander.OPEN){this.open()}else{this.close()}};Mozilla.Expander.OPEN=true;Mozilla.Expander.CLOSED=false;Mozilla.Expander.OPEN_DURATION=0.25;Mozilla.Expander.CLOSE_DURATION=0.25;Mozilla.Expander.OPEN_TEXT="Show";Mozilla.Expander.CLOSE_TEXT="Hide";Mozilla.Expander.prototype.toggle=function(a){if(this.state==Mozilla.Expander.OPEN){this.close()}else{this.open()}};Mozilla.Expander.prototype.saveState=function(){if(typeof sessionStorage!="undefined"){var a=location.href.split("#")[0];var b=(this.state==Mozilla.Expander.OPEN)?"open":"closed";sessionStorage.setItem(a+"-"+this.id,b)}};Mozilla.Expander.prototype.loadState=function(){var c=Mozilla.Expander.CLOSED;if(typeof sessionStorage!="undefined"){var a=location.href.split("#")[0];var b=sessionStorage.getItem(a+"-"+this.id);if(b!==null){c=(b=="open")?Mozilla.Expander.OPEN:Mozilla.Expander.CLOSED}}return c};Mozilla.Expander.prototype.toggleWithAnimation=function(a){if(this.state==Mozilla.Expander.OPEN){this.closeWithAnimation()}else{this.openWithAnimation()}};Mozilla.Expander.prototype.openWithAnimation=function(){if(this.semaphore){return}YAHOO.util.Dom.removeClass(this.container,"expander-closed");YAHOO.util.Dom.addClass(this.container,"expander-open");this.content_animation.parentNode.style.overflow="hidden";this.content_animation.parentNode.style.height="0";this.content_animation.style.visibility="hidden";this.content_animation.style.overflow="hidden";this.content_animation.style.display="block";this.content_animation.style.height="auto";var a=this.content_animation.offsetHeight;this.content_animation.style.height="0";this.content_animation.style.visibility="visible";this.content_animation.parentNode.style.height="";this.content_animation.parentNode.style.overflow="visible";var b={height:{to:a,from:0}};var c=new YAHOO.util.Anim(this.content_animation,b,Mozilla.Expander.OPEN_DURATION,YAHOO.util.Easing.easeOut);this.semaphore=true;c.onComplete.subscribe(this.handleOpen,this,true);c.animate();this.state=Mozilla.Expander.OPEN};Mozilla.Expander.prototype.closeWithAnimation=function(){if(this.semaphore){return}this.content_animation.style.overflow="hidden";this.content_animation.style.height="auto";var a={height:{to:0}};var b=new YAHOO.util.Anim(this.content_animation,a,Mozilla.Expander.CLOSE_DURATION,YAHOO.util.Easing.easeOut);this.semaphore=true;b.onComplete.subscribe(this.handleClose,this,true);b.animate();this.state=Mozilla.Expander.CLOSED};Mozilla.Expander.prototype.open=function(){YAHOO.util.Dom.removeClass(this.container,"expander-closed");YAHOO.util.Dom.addClass(this.container,"expander-open");this.semaphore=false;this.state=Mozilla.Expander.OPEN;this.anchor.title=Mozilla.Expander.CLOSE_TEXT;this.saveState()};Mozilla.Expander.prototype.close=function(){YAHOO.util.Dom.removeClass(this.container,"expander-opened");YAHOO.util.Dom.addClass(this.container,"expander-closed");this.semaphore=false;this.state=Mozilla.Expander.CLOSED;this.anchor.title=Mozilla.Expander.OPEN_TEXT;this.saveState()};Mozilla.Expander.prototype.handleOpen=function(){this.content_animation.style.height="auto";this.content_animation.style.overflow="visible";this.anchor.title=Mozilla.Expander.CLOSE_TEXT;this.semaphore=false;this.saveState()};Mozilla.Expander.prototype.handleClose=function(){YAHOO.util.Dom.removeClass(this.container,"expander-open");YAHOO.util.Dom.addClass(this.container,"expander-closed");this.anchor.title=Mozilla.Expander.OPEN_TEXT;this.semaphore=false;this.saveState()};
