var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"");
function animatedcollapse(a,c,b,e){this.divId=a;this.divObj=document.getElementById(a);this.divObj.style.overflow="hidden";this.timelength=c;this.initstate=typeof e!="undefined"&&e=="block"?"block":"contract";this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+a);this.contentheight=parseInt(this.divObj.style.height);var d=this;if(isNaN(this.contentheight)){animatedcollapse.dotask(window,function(){d._getheight(b)},"load");if(!b&&this.initstate=="contract"||b&&this.isExpanded!="yes"&&this.isExpanded!=
"")this.divObj.style.visibility="hidden"}else if(!b&&this.initstate=="contract"||b&&this.isExpanded!="yes"&&this.isExpanded!="")this.divObj.style.height=0;b&&animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+d.divId,d.isExpanded)},"unload")}
animatedcollapse.prototype._getheight=function(a){this.contentheight=this.divObj.offsetHeight;if(!a&&this.initstate=="contract"||a&&this.isExpanded!="yes"){this.divObj.style.height=0;this.divObj.style.visibility="visible"}else this.divObj.style.height=this.contentheight+"px"};
animatedcollapse.prototype._slideengine=function(a){var c=(new Date).getTime()-this.startTime,b=this;if(c<this.timelength){this.divObj.style.height=(a=="down"?animatedcollapse.curveincrement(c/this.timelength):1-animatedcollapse.curveincrement(c/this.timelength))*this.contentheight+"px";this.runtimer=setTimeout(function(){b._slideengine(a)},10)}else{this.divObj.style.height=a=="down"?this.contentheight+"px":0;this.isExpanded=a=="down"?"yes":"no";this.runtimer=null}};
animatedcollapse.prototype.slidedown=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null)if(isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==0){this.startTime=(new Date).getTime();this._slideengine("down")}};
animatedcollapse.prototype.slideup=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null)if(isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==this.contentheight){this.startTime=(new Date).getTime();this._slideengine("up")}};
animatedcollapse.prototype.slideit=function(){if(isNaN(this.contentheight))alert("Please wait until document has fully loaded then click again");else if(parseInt(this.divObj.style.height)==0)this.slidedown();else parseInt(this.divObj.style.height)==this.contentheight&&this.slideup()};animatedcollapse.curveincrement=function(a){return(1-Math.cos(a*Math.PI))/2};
animatedcollapse.dotask=function(a,c,b){b=window.addEventListener?b:"on"+b;if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent(b,c)};animatedcollapse.getCookie=function(a){a=new RegExp(a+"=[^;]+","i");if(document.cookie.match(a))return document.cookie.match(a)[0].split("=")[1];return""};animatedcollapse.setCookie=function(a,c){document.cookie=a+"="+c};

