var Effect={tagifyText:function(A){var B="position:relative";if(/MSIE/.test(navigator.userAgent)){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(Builder.node("span",{style:B},D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(C,D){var F;if(((typeof C=="object")||(typeof C=="function"))&&(C.length)){F=C}else{F=$(C).childNodes}var B=Object.extend({speed:0.1,delay:0},arguments[2]||{});var E=B.speed;var A=B.delay;$A(F).each(function(H,G){new D(H,Object.extend(B,{delay:A+G*E}))})}};var Effect2=Effect;Effect.Transitions={};Effect.Transitions.linear=function(A){return A};Effect.Transitions.sinoidal=function(A){return(-Math.cos(A*Math.PI)/2)+0.5};Effect.Transitions.reverse=function(A){return 1-A};Effect.Transitions.flicker=function(A){return((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4};Effect.Transitions.wobble=function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5};Effect.Transitions.pulse=function(A){return(Math.floor(A*10)%2==0?(A*10-Math.floor(A*10)):1-(A*10-Math.floor(A*10)))};Effect.Transitions.none=function(A){return 0};Effect.Transitions.full=function(A){return 1};Effect.Queue={effects:[],interval:null,add:function(A){var B=new Date().getTime();switch(A.options.queue){case"front":this.effects.findAll(function(C){return C.state=="idle"}).each(function(C){C.startOn+=A.finishOn;C.finishOn+=A.finishOn});break;case"end":B=this.effects.pluck("finishOn").max()||B;break}A.startOn+=B;A.finishOn+=B;this.effects.push(A);if(!this.interval){this.interval=setInterval(this.loop.bind(this),40)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var A=new Date().getTime();this.effects.invoke("loop",A)}};Effect.Base=function(){};Effect.Base.prototype={position:null,setOptions:function(A){this.options=Object.extend({transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"},A||{})},start:function(A){this.setOptions(A||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event("beforeStart");if(!this.options.sync){Effect.Queue.add(this)}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var B=(C-this.startOn)/(this.finishOn-this.startOn);var A=Math.round(B*this.options.fps*this.options.duration);if(A>this.currentFrame){this.render(B);this.currentFrame=A}}},render:function(A){if(this.state=="idle"){this.state="running";this.event("beforeSetup");if(this.setup){this.setup()}this.event("afterSetup")}if(this.options.transition){A=this.options.transition(A)}A*=(this.options.to-this.options.from);A+=this.options.from;this.position=A;this.event("beforeUpdate");if(this.update){this.update(A)}this.event("afterUpdate")},cancel:function(){if(!this.options.sync){Effect.Queue.remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}}};Effect.Parallel=Class.create();Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(B){this.element=$(B);if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout)){this.element.style.zoom=1}var A=Object.extend({from:Element.getOpacity(this.element)||0,to:1},arguments[1]||{});this.start(A)},update:function(A){Element.setOpacity(this.element,A)}});Effect.MoveBy=Class.create();Object.extend(Object.extend(Effect.MoveBy.prototype,Effect.Base.prototype),{initialize:function(B,A,C){this.element=$(B);this.toTop=A;this.toLeft=C;this.start(arguments[3])},setup:function(){Element.makePositioned(this.element);this.originalTop=parseFloat(Element.getStyle(this.element,"top")||"0");this.originalLeft=parseFloat(Element.getStyle(this.element,"left")||"0")},update:function(A){var C=this.toTop*A+this.originalTop;var B=this.toLeft*A+this.originalLeft;this.setPosition(C,B)},setPosition:function(B,A){this.element.style.top=B+"px";this.element.style.left=A+"px"}});Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(B,C){this.element=$(B);var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{});this.start(A)},setup:function(){var A=this;this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=Element.getStyle(this.element,"position");A.originalStyle={};["top","left","width","height","fontSize"].each(function(C){A.originalStyle[C]=A.element.style[C]});this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var B=Element.getStyle(this.element,"font-size")||"100%";["em","px","%"].each(function(C){if(B.indexOf(C)>0){A.fontSize=parseFloat(B);A.fontSizeType=C}});this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.clientHeight,this.element.clientWidth]}if(this.options.scaleMode=="content"){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.style.fontSize=this.fontSize*B+this.fontSizeType}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){var B=this;["top","left","width","height","fontSize"].each(function(C){B.element.style[C]=B.originalStyle[C]})}},setDimensions:function(A,E){var D=this.element.style;if(this.options.scaleX){D.width=E+"px"}if(this.options.scaleY){D.height=A+"px"}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2;var B=(E-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){D.top=this.originalTop-C+"px"}if(this.options.scaleX){D.left=this.originalLeft-B+"px"}}else{if(this.options.scaleY){D.top=-C+"px"}if(this.options.scaleX){D.left=-B+"px"}}}}});Effect.Highlight=Class.create();Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(B){this.element=$(B);var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(A)},setup:function(){this.oldBgImage=this.element.style.backgroundImage;this.element.style.backgroundImage="none";if(!this.options.endcolor){this.options.endcolor=Element.getStyle(this.element,"background-color").parseColor("#ffffff")}if(typeof this.options.restorecolor=="undefined"){this.options.restorecolor=this.element.style.backgroundColor}this.colors_base=[parseInt(this.options.startcolor.slice(1,3),16),parseInt(this.options.startcolor.slice(3,5),16),parseInt(this.options.startcolor.slice(5),16)];this.colors_delta=[parseInt(this.options.endcolor.slice(1,3),16)-this.colors_base[0],parseInt(this.options.endcolor.slice(3,5),16)-this.colors_base[1],parseInt(this.options.endcolor.slice(5),16)-this.colors_base[2]]},update:function(A){var C=this;var B=$R(0,2).map(function(D){return Math.round(C.colors_base[D]+(C.colors_delta[D]*A))});this.element.style.backgroundColor="#"+B[0].toColorPart()+B[1].toColorPart()+B[2].toColorPart()},finish:function(){this.element.style.backgroundColor=this.options.restorecolor;this.element.style.backgroundImage=this.oldBgImage}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(A){this.element=$(A);this.start(arguments[1]||{})},setup:function(){Position.prepare();var B=Position.cumulativeOffset(this.element);var A=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(B[1]>A?A:B[1])-this.scrollStart},update:function(A){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(A*this.delta))}});Effect.Fade=function(C){var A=Element.getInlineOpacity(C);var B=Object.extend({from:Element.getOpacity(C)||1,to:0,afterFinishInternal:function(D){if(D.options.to==0){Element.hide(D.element);Element.setInlineOpacity(D.element,A)}}},arguments[1]||{});return new Effect.Opacity(C,B)};Effect.Appear=function(B){var A=Object.extend({from:(Element.getStyle(B,"display")=="none"?0:Element.getOpacity(B)||0),to:1,beforeSetup:function(C){Element.setOpacity(C.element,C.options.from);Element.show(C.element)}},arguments[1]||{});return new Effect.Opacity(B,A)};Effect.Puff=function(B){B=$(B);var A=Element.getInlineOpacity(B);var C=B.style.position;return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(D){D.effects[0].element.style.position="absolute"},afterFinishInternal:function(D){Element.hide(D.effects[0].element);D.effects[0].element.style.position=C;Element.setInlineOpacity(D.effects[0].element,A)}},arguments[1]||{}))};Effect.BlindUp=function(A){A=$(A);Element.makeClipping(A);return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){Element.hide(B.element);Element.undoClipping(B.element)}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var C=B.style.height;var A=Element.getDimensions(B);return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(D){Element.makeClipping(D.element);D.element.style.height="0px";Element.show(D.element)},afterFinishInternal:function(D){Element.undoClipping(D.element);D.element.style.height=C}},arguments[1]||{}))};Effect.SwitchOff=function(B){B=$(B);var A=Element.getInlineOpacity(B);return new Effect.Appear(B,{duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){Element.makePositioned(D.element);Element.makeClipping(D.element)},afterFinishInternal:function(D){Element.hide(D.element);Element.undoClipping(D.element);Element.undoPositioned(D.element);Element.setInlineOpacity(D.element,A)}})}})};Effect.DropOut=function(C){C=$(C);var A=C.style.top;var D=C.style.left;var B=Element.getInlineOpacity(C);return new Effect.Parallel([new Effect.MoveBy(C,100,0,{sync:true}),new Effect.Opacity(C,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(E){Element.makePositioned(E.effects[0].element)},afterFinishInternal:function(E){Element.hide(E.effects[0].element);Element.undoPositioned(E.effects[0].element);E.effects[0].element.style.left=D;E.effects[0].element.style.top=A;Element.setInlineOpacity(E.effects[0].element,B)}},arguments[1]||{}))};Effect.Shake=function(B){B=$(B);var A=B.style.top;var C=B.style.left;return new Effect.MoveBy(B,0,20,{duration:0.05,afterFinishInternal:function(D){new Effect.MoveBy(D.element,0,-40,{duration:0.1,afterFinishInternal:function(E){new Effect.MoveBy(E.element,0,40,{duration:0.1,afterFinishInternal:function(F){new Effect.MoveBy(F.element,0,-40,{duration:0.1,afterFinishInternal:function(G){new Effect.MoveBy(G.element,0,40,{duration:0.1,afterFinishInternal:function(H){new Effect.MoveBy(H.element,0,-20,{duration:0.05,afterFinishInternal:function(I){Element.undoPositioned(I.element);I.element.style.left=C;I.element.style.top=A}})}})}})}})}})}})};Effect.SlideDown=function(C){C=$(C);Element.cleanWhitespace(C);var A=C.firstChild.style.bottom;var B=Element.getDimensions(C);return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){Element.makePositioned(D.element.firstChild);if(window.opera){D.element.firstChild.style.top=""}Element.makeClipping(D.element);C.style.height="0";Element.show(C)},afterUpdateInternal:function(D){D.element.firstChild.style.bottom=(D.originalHeight-D.element.clientHeight)+"px"},afterFinishInternal:function(D){Element.undoClipping(D.element);Element.undoPositioned(D.element.firstChild);D.element.firstChild.style.bottom=A}},arguments[1]||{}))};Effect.SlideUp=function(B){B=$(B);Element.cleanWhitespace(B);var A=B.firstChild.style.bottom;return new Effect.Scale(B,0,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(C){Element.makePositioned(C.element.firstChild);if(window.opera){C.element.firstChild.style.top=""}Element.makeClipping(C.element);Element.show(B)},afterUpdateInternal:function(C){C.element.firstChild.style.bottom=(C.originalHeight-C.element.clientHeight)+"px"},afterFinishInternal:function(C){Element.hide(C.element);Element.undoClipping(C.element);Element.undoPositioned(C.element.firstChild);C.element.firstChild.style.bottom=A}},arguments[1]||{}))};Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){Element.makeClipping(B.element)},afterFinishInternal:function(B){Element.hide(B.element);Element.undoClipping(B.element)}})};Effect.Grow=function(C){C=$(C);var F=arguments[1]||{};var L=Element.getDimensions(C);var R=L.width;var O=L.height;var B=C.style.top;var G=C.style.left;var I=C.style.height;var M=C.style.width;var A=Element.getInlineOpacity(C);var Q=F.direction||"center";var P=F.moveTransition||Effect.Transitions.sinoidal;var H=F.scaleTransition||Effect.Transitions.sinoidal;var J=F.opacityTransition||Effect.Transitions.full;var E,D;var N,K;switch(Q){case"top-left":E=D=N=K=0;break;case"top-right":E=R;D=K=0;N=-R;break;case"bottom-left":E=N=0;D=O;K=-O;break;case"bottom-right":E=R;D=O;N=-R;K=-O;break;case"center":E=R/2;D=O/2;N=-R/2;K=-O/2;break}return new Effect.MoveBy(C,D,E,{duration:0.01,beforeSetup:function(S){Element.hide(S.element);Element.makeClipping(S.element);Element.makePositioned(S.element)},afterFinishInternal:function(S){new Effect.Parallel([new Effect.Opacity(S.element,{sync:true,to:1,from:0,transition:J}),new Effect.MoveBy(S.element,K,N,{sync:true,transition:P}),new Effect.Scale(S.element,100,{scaleMode:{originalHeight:O,originalWidth:R},sync:true,scaleFrom:window.opera?1:0,transition:H,restoreAfterFinish:true})],Object.extend({beforeSetup:function(T){T.effects[0].element.style.height=0;Element.show(T.effects[0].element)},afterFinishInternal:function(V){var U=V.effects[0].element;var T=U.style;Element.undoClipping(U);Element.undoPositioned(U);T.top=B;T.left=G;T.height=I;T.width=R;Element.setInlineOpacity(U,A)}},F))}})};Effect.Shrink=function(J){J=$(J);var O=arguments[1]||{};var C=J.clientWidth;var I=J.clientHeight;var G=J.style.top;var F=J.style.left;var M=J.style.height;var H=J.style.width;var K=Element.getInlineOpacity(J);var L=O.direction||"center";var B=O.moveTransition||Effect.Transitions.sinoidal;var A=O.scaleTransition||Effect.Transitions.sinoidal;var N=O.opacityTransition||Effect.Transitions.none;var E,D;switch(L){case"top-left":E=D=0;break;case"top-right":E=C;D=0;break;case"bottom-left":E=0;D=I;break;case"bottom-right":E=C;D=I;break;case"center":E=C/2;D=I/2;break}return new Effect.Parallel([new Effect.Opacity(J,{sync:true,to:0,from:1,transition:N}),new Effect.Scale(J,window.opera?1:0,{sync:true,transition:A,restoreAfterFinish:true}),new Effect.MoveBy(J,D,E,{sync:true,transition:B})],Object.extend({beforeStartInternal:function(P){Element.makePositioned(P.effects[0].element);Element.makeClipping(P.effects[0].element)},afterFinishInternal:function(R){var Q=R.effects[0].element;var P=Q.style;Element.hide(Q);Element.undoClipping(Q);Element.undoPositioned(Q);P.top=G;P.left=F;P.height=M;P.width=H;Element.setInlineOpacity(Q,K)}},O))};Effect.Pulsate=function(C){C=$(C);var B=arguments[1]||{};var A=Element.getInlineOpacity(C);var E=B.transition||Effect.Transitions.sinoidal;var D=function(F){return E(1-Effect.Transitions.pulse(F))};D.bind(E);return new Effect.Opacity(C,Object.extend(Object.extend({duration:3,from:0,afterFinishInternal:function(F){Element.setInlineOpacity(F.element,A)}},B),{transition:D}))};Effect.Fold=function(A){A=$(A);var E=A.style.top;var C=A.style.left;var D=A.style.width;var B=A.style.height;Element.makeClipping(A);return new Effect.Scale(A,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(F){new Effect.Scale(A,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(G){Element.hide(G.element);Element.undoClipping(G.element);G.element.style.top=E;G.element.style.left=C;G.element.style.width=D;G.element.style.height=B}})}},arguments[1]||{}))};