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}};