var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"");function animatedcollapse(a,d,c,e){this.divId=a;this.divObj=document.getElementById(a);this.divObj.style.overflow="hidden";this.timelength=d;this.initstate=(typeof e!="undefined"&&e=="block")?"block":"contract";this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+a);this.contentheight=parseInt(this.divObj.style.height);var b=this;if(isNaN(this.contentheight)){animatedcollapse.dotask(window,function(){b._getheight(c)},"load");if(!c&&this.initstate=="contract"||c&&this.isExpanded!="yes"){this.divObj.style.visibility="hidden"}}else{if(!c&&this.initstate=="contract"||c&&this.isExpanded!="yes"){this.divObj.style.height=0}}if(c){animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+b.divId,b.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(d){var b=new Date().getTime()-this.startTime;var c=this;if(b<this.timelength){var a=(d=="down")?animatedcollapse.curveincrement(b/this.timelength):1-animatedcollapse.curveincrement(b/this.timelength);this.divObj.style.height=a*this.contentheight+"px";this.runtimer=setTimeout(function(){c._slideengine(d)},10)}else{this.divObj.style.height=(d=="down")?this.contentheight+"px":0;this.isExpanded=(d=="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{if(parseInt(this.divObj.style.height)==this.contentheight){this.slideup()}}}};animatedcollapse.curveincrement=function(a){return(1-Math.cos(a*Math.PI))/2};animatedcollapse.dotask=function(b,c,a){var a=(window.addEventListener)?a:"on"+a;if(b.addEventListener){b.addEventListener(a,c,false)}else{if(b.attachEvent){b.attachEvent(a,c)}}};animatedcollapse.getCookie=function(a){var b=new RegExp(a+"=[^;]+","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return""};animatedcollapse.setCookie=function(b,c,e){if(typeof e!="undefined"){var a=new Date();var d=a.setDate(a.getDate()+e);document.cookie=b+"="+c+"; expires="+a.toGMTString()}else{document.cookie=b+"="+c}};