xAddEventListener(window,"load",btnInit,false);xAddEventListener(window,"load",trgInit,false);xAddEventListener(window,"resize",animBoxesResize,false);function btnInit(){var B,A=xGetElementsByClassName("jsButton");for(B=0;B<A.length;++B){A[B].onclick=btnOnClick}}function trgInit(){var B,A=xGetElementsByClassName("jsTrigger");for(B=0;B<A.length;++B){A[B].onmouseover=trgOnOver;A[B].onmouseout=trgOnOut}A=xGetElementsByClassName("jsContainer");for(B=0;B<A.length;++B){A[B].onmouseover=trgOnOver;A[B].onmouseout=trgOnOut}}function btnOnClick(){var A,B=animBox.instances;for(A=0;A<B.length;++A){if("btn_"+B[A].eid==this.id){if(B[A].st==1){B[A].expand()}else{if(B[A].st==2){B[A].collapse()}else{B[A].animate()}}}}}function trgOnOver(){var A,B=animBox.instances;for(A=0;A<B.length;++A){if("btn_"+B[A].eid==this.id||B[A].eid==this.id){if(B[A].out_tmr){clearTimeout(B[A].out_tmr);B[A].out_tmr=null}if(B[A].st==1){B[A].expand();B[A].act=1}else{B[A].act=1}}}}function trgOnOut(){var A,B=animBox.instances;for(A=0;A<B.length;++A){if("btn_"+B[A].eid==this.id||B[A].eid==this.id){B[A].act=0;if(!B[A].out_tmr){B[A].out_tmr=setTimeout("trgOnTimer("+B[A].idx+")",400)}}}}function trgOnTimer(A){var B=animBox.instances;B[A].out_tmr=null;if(B[A].act==0){B[A].collapse()}}function animBoxesResize(){var B,A=animBox.instances;for(B=0;B<A.length;++B){if(A[B].pe){A[B].reposition()}}}function animBox(G,L,B,D,H,A,C,I,K,F){this.init(G,L,B,D,H,A,C,I,K,F);var J=animBox.instances;var E;for(E=0;E<J.length;++E){if(!J[E]){break}}J[E]=this;this.idx=E;return this}animBox.instances=[];animBox.prototype.init=function(F,J,B,D,G,A,C,H,I,E){this.e=xGetElementById(F);this.pe="bababah";this.xs=null;this.ys=null;this.eid=F;this.act=0;this.st=J||2;this.at=B||2;this.qc=D||1;this.tt=G||2000;this.orf=A;this.otf=C;this.oed=H;this.oea=I;this.oef=E;this.to=20;this.as=false;this.x=xPageX(this.e);this.y=xPageY(this.e);this.w=xWidth(this.e);this.h=xHeight(this.e);if(J==1){xHide(this.e);xResizeTo(F,this.w,2)}return this};animBox.prototype.reposition=function(C,A,J){var G,D,F=animBox.instances[this.idx];if(!C){C=F.pe;A=F.xs;J=F.ys}if(!xGetElementById(C)){return}var H=xPageX(C);var E=xPageY(C);var I=xWidth(C);var B=xHeight(C);F.pe=C;F.xs=A;F.ys=J;if(A=="+"){G=H+I}else{if(A=="-"){G=H-F.w+I}else{G=H}}if(J=="+"){D=E+B}else{if(J=="-"){D=E-F.h}else{D=E}}xMoveTo(F.eid,G,D)};animBox.prototype.animate=function(){var A=animBox.instances[this.idx];if(A.st==1){alert("expanding");A.expand()}else{if(A.st==2){alert("collapsing");A.collapse()}else{return}}};animBox.prototype.expand=function(){var B=animBox.instances[this.idx];B.x1=xWidth(B.e);B.y1=xHeight(B.e);B.x2=B.w;B.y2=B.h;B.orf=D;B.otf=A;B.oea=0;B.oef=C;xShow(B.e);B.start();function D(E){xResizeTo(E.e,Math.round(E.x),Math.round(E.y))}function A(E){}function C(E){xResizeTo(E.e,E.w,E.h);E.st=2}};animBox.prototype.collapse=function(){var B=animBox.instances[this.idx];B.x1=xWidth(B.e);B.y1=xHeight(B.e);B.x2=B.w;B.y2=2;B.orf=D;B.otf=A;B.oea=0;B.oef=C;B.start();return B;function D(E){xResizeTo(E.e,Math.round(E.x),Math.round(E.y))}function A(E){}function C(E){xHide(E.e);xResizeTo(E.e,E.w,2);E.st=1}};animBox.prototype.start=function(){var A=this;if(A.at==1){A.ap=1/A.tt}else{A.ap=A.qc*(Math.PI/(2*A.tt))}if(xDef(A.x1)){A.xm=A.x2-A.x1}if(xDef(A.y1)){A.ym=A.y2-A.y1}if(!(A.qc%2)){if(xDef(A.x1)){A.x2=A.x1}if(xDef(A.y1)){A.y2=A.y1}}if(!A.tmr){var B=new Date();A.t1=B.getTime();A.tmr=setTimeout("animBox.run("+A.idx+")",1)}};animBox.run=function(i){var a=animBox.instances[i];if(!a){return}var d=new Date();a.et=d.getTime()-a.t1;if(a.et<a.tt){a.tmr=setTimeout("animBox.run("+i+")",a.to);a.af=a.ap*a.et;if(a.at==2){a.af=Math.abs(Math.sin(a.af))}else{if(a.at==3){a.af=1-Math.abs(Math.cos(a.af))}}if(xDef(a.x1)){a.x=a.xm*a.af+a.x1}if(xDef(a.y1)){a.y=a.ym*a.af+a.y1}a.orf(a)}else{var rep=false;if(xDef(a.x2)){a.x=a.x2}if(xDef(a.y2)){a.y=a.y2}a.tmr=null;a.otf(a);if(xDef(a.oef)){if(a.oed){setTimeout(a.oef,a.oed)}else{if(xStr(a.oef)){rep=eval(a.oef)}else{rep=a.oef(a,a.oea)}}}if(rep){a.resume(true)}}};animBox.prototype.kill=function(){animBox.instances[this.idx]=null};
