String.prototype.parseColor=function(a){var b="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(","),c=0;do b+=parseInt(d[c]).toColorPart();while(++c<3)}else if(this.slice(0,1)=="#"){if(this.length==4)for(c=1;c<4;c++)b+=(this.charAt(c)+this.charAt(c)).toLowerCase();if(this.length==7)b=this.toLowerCase()}return b.length==7?b:a||this};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return b.nodeType==3?b.nodeValue:b.hasChildNodes()?Element.collectTextNodes(b):""}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(d){return d.nodeType==3?d.nodeValue:d.hasChildNodes()&&!Element.hasClassName(d,b)?Element.collectTextNodes(d):""}).flatten().join("")};Element.setStyle=function(a,b){a=$(a);for(k in b)a.style[k.camelize()]=b[k]};
Element.setContentZoom=function(a,b){Element.setStyle(a,{fontSize:b/100+"em"});navigator.appVersion.indexOf("AppleWebKit")>0&&window.scrollBy(0,0)};Element.getOpacity=function(a){var b;if(b=Element.getStyle(a,"opacity"))return parseFloat(b);if(b=(Element.getStyle(a,"filter")||"").match(/alpha\(opacity=(.*)\)/))if(b[1])return parseFloat(b[1])/100;return 1};
Element.setOpacity=function(a,b){a=$(a);if(b==1){Element.setStyle(a,{opacity:/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent)?0.999999:null});/MSIE/.test(navigator.userAgent)&&Element.setStyle(a,{filter:Element.getStyle(a,"filter").replace(/alpha\([^\)]*\)/gi,"")})}else{if(b<1.0E-5)b=0;Element.setStyle(a,{opacity:b});/MSIE/.test(navigator.userAgent)&&Element.setStyle(a,{filter:Element.getStyle(a,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+b*100+
")"})}};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.childrenWithClassName=function(a,b){return $A($(a).getElementsByTagName("*")).select(function(d){return Element.hasClassName(d,b)})};Array.prototype.call=function(){var a=arguments;this.each(function(b){b.apply(this,a)})};
var Effect={tagifyText:function(a){var b="position:relative";if(/MSIE/.test(navigator.userAgent))b+=";zoom:1";a=$(a);$A(a.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(c){a.insertBefore(Builder.node("span",{style:b},c==" "?String.fromCharCode(160):c),d)});Element.remove(d)}})},multiple:function(a,b,d){a=(typeof a=="object"||typeof a=="function")&&a.length?a:$(a).childNodes;var c=Object.extend({speed:0.1,delay:0},d||{}),e=c.delay;$A(a).each(function(f,g){new b(f,
Object.extend(c,{delay:g*c.speed+e}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b,d){a=$(a);b=(b||"appear").toLowerCase();d=Object.extend({queue:{position:"end",scope:a.id||"global"}},d||{});Effect[Element.visible(a)?Effect.PAIRS[b][1]:Effect.PAIRS[b][0]](a,d)}},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(){return 0};Effect.Transitions.full=function(){return 1};Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime();switch(typeof a.options.queue=="string"?a.options.queue:a.options.queue.position){case "front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=a.finishOn;d.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(){this.effects.invoke("loop",(new Date).getTime())}});Effect.Queues={instances:$H(),get:function(a){if(typeof a!="string")return a;this.instances[a]||(this.instances[a]=new Effect.ScopedQueue);return this.instances[a]}};
Effect.Queue=Effect.Queues.get("global");Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};Effect.Base=function(){};
Effect.Base.prototype={position:null,start:function(a){this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1E3;this.finishOn=this.startOn+this.options.duration*1E3;this.event("beforeStart");this.options.sync||Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn)if(a>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");
this.finish&&this.finish();this.event("afterFinish")}else{a=(a-this.startOn)/(this.finishOn-this.startOn);var b=Math.round(a*this.options.fps*this.options.duration);if(b>this.currentFrame){this.render(a);this.currentFrame=b}}},render:function(a){if(this.state=="idle"){this.state="running";this.event("beforeSetup");this.setup&&this.setup();this.event("afterSetup")}if(this.state=="running"){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");this.update&&this.update(a);this.event("afterUpdate")}},cancel:function(){this.options.sync||Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);this.state="finished"},event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this);this.options[a]&&this.options[a](this)},inspect:function(){return"#<Effect:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">"}};Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(a,b){this.effects=a||[];this.start(b)},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");b.finish&&b.finish(a);b.event("afterFinish")})}});Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(a,b){this.element=$(a);/MSIE/.test(navigator.userAgent)&&!this.element.hasLayout&&Element.setStyle(this.element,{zoom:1});this.start(Object.extend({from:Element.getOpacity(this.element)||0,to:1},b||{}))},update:function(a){Element.setOpacity(this.element,a)}});Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(a,b){this.element=$(a);this.start(Object.extend({x:0,y:0,mode:"relative"},b||{}))},setup:function(){Element.makePositioned(this.element);this.originalLeft=parseFloat(Element.getStyle(this.element,"left")||"0");this.originalTop=parseFloat(Element.getStyle(this.element,"top")||"0");if(this.options.mode=="absolute"){this.options.x-=this.originalLeft;this.options.y-=this.originalTop}},update:function(a){Element.setStyle(this.element,
{left:this.options.x*a+this.originalLeft+"px",top:this.options.y*a+this.originalTop+"px"})}});Effect.MoveBy=function(a,b,d,c){return new Effect.Move(a,Object.extend({x:d,y:b},c||{}))};Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(a,b,d){this.element=$(a);this.start(Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:b},d||{}))},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=Element.getStyle(this.element,"position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=
this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=Element.getStyle(this.element,"font-size")||"100%";["em","px","%"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box")this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=
[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){a=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&Element.setStyle(this.element,{fontSize:this.fontSize*a+this.fontSizeType});this.setDimensions(this.dims[0]*a,this.dims[1]*a)},finish:function(){this.restoreAfterFinish&&Element.setStyle(this.element,this.originalStyle)},setDimensions:function(a,
b){var d={};if(this.options.scaleX)d.width=b+"px";if(this.options.scaleY)d.height=a+"px";if(this.options.scaleFromCenter){a=(a-this.dims[0])/2;b=(b-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY)d.top=this.originalTop-a+"px";if(this.options.scaleX)d.left=this.originalLeft-b+"px"}else{if(this.options.scaleY)d.top=-a+"px";if(this.options.scaleX)d.left=-b+"px"}}Element.setStyle(this.element,d)}});Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(a,b){this.element=$(a);this.start(Object.extend({startcolor:"#ffff99"},b||{}))},setup:function(){if(Element.getStyle(this.element,"display")=="none")this.cancel();else{this.oldStyle={backgroundImage:Element.getStyle(this.element,"background-image")};Element.setStyle(this.element,{backgroundImage:"none"});if(!this.options.endcolor)this.options.endcolor=Element.getStyle(this.element,"background-color").parseColor("#ffffff");
if(!this.options.restorecolor)this.options.restorecolor=Element.getStyle(this.element,"background-color");this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))}},update:function(a){Element.setStyle(this.element,{backgroundColor:$R(0,2).inject("#",function(b,d,c){return b+Math.round(this._base[c]+this._delta[c]*a).toColorPart()}.bind(this))})},
finish:function(){Element.setStyle(this.element,Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(a,b){this.element=$(a);this.start(b||{})},setup:function(){Position.prepare();var a=Position.cumulativeOffset(this.element);if(this.options.offset)a[1]+=this.options.offset;var b=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=
(a[1]>b?b:a[1])-this.scrollStart},update:function(a){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+a*this.delta)}});Effect.Fade=function(a,b){var d=Element.getInlineOpacity(a);b=Object.extend({from:Element.getOpacity(a)||1,to:0,afterFinishInternal:function(c){with(Element){if(c.options.to!=0)return;hide(c.element);setStyle(c.element,{opacity:d})}}},b||{});return new Effect.Opacity(a,b)};
Effect.Appear=function(a,b){b=Object.extend({from:Element.getStyle(a,"display")=="none"?0:Element.getOpacity(a)||0,to:1,beforeSetup:function(d){with(Element){setOpacity(d.element,d.options.from);show(d.element)}}},b||{});return new Effect.Opacity(a,b)};
Effect.Puff=function(a,b){a=$(a);var d={opacity:Element.getInlineOpacity(a),position:Element.getStyle(a,"position")};return new Effect.Parallel([new Effect.Scale(a,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){with(Element)setStyle(c.effects[0].element,{position:"absolute"})},afterFinishInternal:function(c){with(Element){hide(c.effects[0].element);setStyle(c.effects[0].element,
d)}}},b||{}))};Effect.BlindUp=function(a,b){a=$(a);Element.makeClipping(a);return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){with(Element)[hide,undoClipping].call(d.element)}},b||{}))};
Effect.BlindDown=function(a,b){a=$(a);var d=Element.getStyle(a,"height"),c=Element.getDimensions(a);return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(e){with(Element){makeClipping(e.element);setStyle(e.element,{height:"0px"});show(e.element)}},afterFinishInternal:function(e){with(Element){undoClipping(e.element);setStyle(e.element,{height:d})}}},b||{}))};
Effect.SwitchOff=function(a){a=$(a);var b=Element.getInlineOpacity(a);return new Effect.Appear(a,{duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(d){new Effect.Scale(d.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(c){with(Element)[makePositioned,makeClipping].call(c.element)},afterFinishInternal:function(c){with(Element){[hide,undoClipping,undoPositioned].call(c.element);setStyle(c.element,
{opacity:b})}}})}})};
Effect.DropOut=function(a,b){a=$(a);var d={top:Element.getStyle(a,"top"),left:Element.getStyle(a,"left"),opacity:Element.getInlineOpacity(a)};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:true}),new Effect.Opacity(a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){with(Element)makePositioned(c.effects[0].element)},afterFinishInternal:function(c){with(Element){[hide,undoPositioned].call(c.effects[0].element);setStyle(c.effects[0].element,d)}}},b||{}))};
Effect.Shake=function(a){a=$(a);var b={top:Element.getStyle(a,"top"),left:Element.getStyle(a,"left")};return new Effect.Move(a,{x:20,y:0,duration:0.05,afterFinishInternal:function(d){new Effect.Move(d.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(c){new Effect.Move(c.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(f){new Effect.Move(f.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(g){new Effect.Move(g.element,
{x:-20,y:0,duration:0.05,afterFinishInternal:function(h){with(Element){undoPositioned(h.element);setStyle(h.element,b)}}})}})}})}})}})}})};
Effect.SlideDown=function(a,b){a=$(a);Element.cleanWhitespace(a);var d=Element.getStyle(a.firstChild,"bottom"),c=Element.getDimensions(a);return new Effect.Scale(a,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(e){with(Element){makePositioned(e.element);makePositioned(e.element.firstChild);window.opera&&setStyle(e.element,{top:""});makeClipping(e.element);setStyle(e.element,{height:"0px"});
show(a)}},afterUpdateInternal:function(e){with(Element)setStyle(e.element.firstChild,{bottom:e.dims[0]-e.element.clientHeight+"px"})},afterFinishInternal:function(e){with(Element){undoClipping(e.element);undoPositioned(e.element.firstChild);undoPositioned(e.element);setStyle(e.element.firstChild,{bottom:d})}}},b||{}))};
Effect.SlideUp=function(a,b){a=$(a);Element.cleanWhitespace(a);var d=Element.getStyle(a.firstChild,"bottom");return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(c){with(Element){makePositioned(c.element);makePositioned(c.element.firstChild);window.opera&&setStyle(c.element,{top:""});makeClipping(c.element);show(a)}},afterUpdateInternal:function(c){with(Element)setStyle(c.element.firstChild,{bottom:c.dims[0]-
c.element.clientHeight+"px"})},afterFinishInternal:function(c){with(Element){[hide,undoClipping].call(c.element);undoPositioned(c.element.firstChild);undoPositioned(c.element);setStyle(c.element.firstChild,{bottom:d})}}},b||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){with(Element)makeClipping(b.element)},afterFinishInternal:function(b){with(Element){hide(b.element);undoClipping(b.element)}}})};
Effect.Grow=function(a,b){a=$(a);var d=Object.extend({direction:"center",moveTransistion:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},b||{}),c={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:Element.getInlineOpacity(a)},e=Element.getDimensions(a),f,g,h,j;switch(d.direction){case "top-left":f=g=h=j=0;break;case "top-right":f=e.width;g=j=0;h=-e.width;break;case "bottom-left":f=h=0;g=e.height;j=
-e.height;break;case "bottom-right":f=e.width;g=e.height;h=-e.width;j=-e.height;break;case "center":f=e.width/2;g=e.height/2;h=-e.width/2;j=-e.height/2;break}return new Effect.Move(a,{x:f,y:g,duration:0.01,beforeSetup:function(i){with(Element){hide(i.element);makeClipping(i.element);makePositioned(i.element)}},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(i.element,{x:h,y:j,sync:true,transition:d.moveTransition}),
new Effect.Scale(i.element,100,{scaleMode:{originalHeight:e.height,originalWidth:e.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(l){with(Element){setStyle(l.effects[0].element,{height:"0px"});show(l.effects[0].element)}},afterFinishInternal:function(l){with(Element){[undoClipping,undoPositioned].call(l.effects[0].element);setStyle(l.effects[0].element,c)}}},d))}})};
Effect.Shrink=function(a,b){a=$(a);b=Object.extend({direction:"center",moveTransistion:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},b||{});var d={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:Element.getInlineOpacity(a)},c=Element.getDimensions(a),e,f;switch(b.direction){case "top-left":e=f=0;break;case "top-right":e=c.width;f=0;break;case "bottom-left":e=0;f=c.height;break;case "bottom-right":e=
c.width;f=c.height;break;case "center":e=c.width/2;f=c.height/2;break}return new Effect.Parallel([new Effect.Opacity(a,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(a,{x:e,y:f,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){with(Element)[makePositioned,makeClipping].call(g.effects[0].element)},afterFinishInternal:function(g){with(Element){[hide,
undoClipping,undoPositioned].call(g.effects[0].element);setStyle(g.effects[0].element,d)}}},b))};Effect.Pulsate=function(a,b){a=$(a);b=b||{};var d=Element.getInlineOpacity(a),c=b.transition||Effect.Transitions.sinoidal,e=function(f){return c(1-Effect.Transitions.pulse(f))};e.bind(c);return new Effect.Opacity(a,Object.extend(Object.extend({duration:3,from:0,afterFinishInternal:function(f){Element.setStyle(f.element,{opacity:d})}},b),{transition:e}))};
Effect.Fold=function(a,b){a=$(a);var d={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};Element.makeClipping(a);return new Effect.Scale(a,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(c){with(Element){[hide,undoClipping].call(c.element);setStyle(c.element,d)}}})}},b||{}))};
Effect.SlideUpAndDown=function(a){a=$(a);if(a.style.display!="none")new Effect.SlideUp(a);else new Effect.SlideDown(a)};Effect.PhaseIn=function(a,b){a=$(a);new Effect.BlindDown(a,b||{});new Effect.Appear(a,b||{})};Effect.PhaseOut=function(a,b){a=$(a);new Effect.Fade(a,b||{});new Effect.BlindUp(a,b||{})};Effect.Phase=function(a,b){a=$(a);if(a.style.display=="none")new Effect.PhaseIn(a,b||{});else new Effect.PhaseOut(a,b||{})};Effect.Show=function(a){a=$(a);Element.show(a)};
Effect.Hide=function(a){a=$(a);Element.hide(a)};
