// script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009

// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
//  Mark Pilgrim (http://diveintomark.org/)
//  Martin Bialasinki
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
String.prototype.parseColor=function(){
var _1="#";
if(this.slice(0,4)=="rgb("){
var _2=this.slice(4,this.length-1).split(",");
var i=0;
do{
_1+=parseInt(_2[i]).toColorPart();
}while(++i<3);
}else{
if(this.slice(0,1)=="#"){
if(this.length==4){
for(var i=1;i<4;i++){
_1+=(this.charAt(i)+this.charAt(i)).toLowerCase();
}
}
if(this.length==7){
_1=this.toLowerCase();
}
}
}
return (_1.length==7?_1:(arguments[0]||this));
};
Element.collectTextNodes=function(_3){
return $A($(_3).childNodes).collect(function(_4){
return (_4.nodeType==3?_4.nodeValue:(_4.hasChildNodes()?Element.collectTextNodes(_4):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_5,_6){
return $A($(_5).childNodes).collect(function(_7){
return (_7.nodeType==3?_7.nodeValue:((_7.hasChildNodes()&&!Element.hasClassName(_7,_6))?Element.collectTextNodesIgnoreClass(_7,_6):""));
}).flatten().join("");
};
Element.setContentZoom=function(_8,_9){
_8=$(_8);
_8.setStyle({fontSize:(_9/100)+"em"});
if(Prototype.Browser.WebKit){
window.scrollBy(0,0);
}
return _8;
};
Element.getInlineOpacity=function(_a){
return $(_a).style.opacity||"";
};
Element.forceRerendering=function(_b){
try{
_b=$(_b);
var n=document.createTextNode(" ");
_b.appendChild(n);
_b.removeChild(n);
}
catch(e){
}
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(_c){
return (-Math.cos(_c*Math.PI)/2)+0.5;
},reverse:function(_d){
return 1-_d;
},flicker:function(_e){
var _e=((-Math.cos(_e*Math.PI)/4)+0.75)+Math.random()/4;
return _e>1?1:_e;
},wobble:function(_f){
return (-Math.cos(_f*Math.PI*(9*_f))/2)+0.5;
},pulse:function(pos,_10){
return (-Math.cos((pos*((_10||5)-0.5)*2)*Math.PI)/2)+0.5;
},spring:function(pos){
return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6));
},none:function(pos){
return 0;
},full:function(pos){
return 1;
}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(_11){
var _12="position:relative";
if(Prototype.Browser.IE){
_12+=";zoom:1";
}
_11=$(_11);
$A(_11.childNodes).each(function(_13){
if(_13.nodeType==3){
_13.nodeValue.toArray().each(function(_14){
_11.insertBefore(new Element("span",{style:_12}).update(_14==" "?String.fromCharCode(160):_14),_13);
});
Element.remove(_13);
}
});
},multiple:function(_15,_16){
var _17;
if(((typeof _15=="object")||Object.isFunction(_15))&&(_15.length)){
_17=_15;
}else{
_17=$(_15).childNodes;
}
var _18=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _19=_18.delay;
$A(_17).each(function(_1a,_1b){
new _16(_1a,Object.extend(_18,{delay:_1b*_18.speed+_19}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_1c,_1d,_1e){
_1c=$(_1c);
_1d=(_1d||"appear").toLowerCase();
return Effect[Effect.PAIRS[_1d][_1c.visible()?1:0]](_1c,Object.extend({queue:{position:"end",scope:(_1c.id||"global"),limit:1}},_1e||{}));
}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_1f){
this.effects._each(_1f);
},add:function(_20){
var _21=new Date().getTime();
var _22=Object.isString(_20.options.queue)?_20.options.queue:_20.options.queue.position;
switch(_22){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_20.finishOn;
e.finishOn+=_20.finishOn;
});
break;
case "with-last":
_21=this.effects.pluck("startOn").max()||_21;
break;
case "end":
_21=this.effects.pluck("finishOn").max()||_21;
break;
}
_20.startOn+=_21;
_20.finishOn+=_21;
if(!_20.options.queue.limit||(this.effects.length<_20.options.queue.limit)){
this.effects.push(_20);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),15);
}
},remove:function(_23){
this.effects=this.effects.reject(function(e){
return e==_23;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _24=new Date().getTime();
for(var i=0,len=this.effects.length;i<len;i++){
this.effects[i]&&this.effects[i].loop(_24);
}
}});
Effect.Queues={instances:$H(),get:function(_25){
if(!Object.isString(_25)){
return _25;
}
return this.instances.get(_25)||this.instances.set(_25,new Effect.ScopedQueue());
}};
Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(_26){
if(_26&&_26.transition===false){
_26.transition=Effect.Transitions.linear;
}
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_26||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){
function _27(_28,_29){
if(_28.options[_29+"Internal"]){
_28.options[_29+"Internal"](_28);
}
if(_28.options[_29]){
_28.options[_29](_28);
}
};
return function(pos){
if(this.state==="idle"){
this.state="running";
_27(this,"beforeSetup");
if(this.setup){
this.setup();
}
_27(this,"afterSetup");
}
if(this.state==="running"){
pos=(this.options.transition(pos)*this.fromToDelta)+this.options.from;
this.position=pos;
_27(this,"beforeUpdate");
if(this.update){
this.update(pos);
}
_27(this,"afterUpdate");
}
};
})();
this.event("beforeStart");
if(!this.options.sync){
Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this);
}
},loop:function(_2a){
if(_2a>=this.startOn){
if(_2a>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_2a-this.startOn)/this.totalTime,_2b=(pos*this.totalFrames).round();
if(_2b>this.currentFrame){
this.render(pos);
this.currentFrame=_2b;
}
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_2c){
if(this.options[_2c+"Internal"]){
this.options[_2c+"Internal"](this);
}
if(this.options[_2c]){
this.options[_2c](this);
}
},inspect:function(){
var _2d=$H();
for(property in this){
if(!Object.isFunction(this[property])){
_2d.set(property,this[property]);
}
}
return "#<Effect:"+_2d.inspect()+",options:"+$H(this.options).inspect()+">";
}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(_2e){
this.effects=_2e||[];
this.start(arguments[1]);
},update:function(_2f){
this.effects.invoke("render",_2f);
},finish:function(_30){
this.effects.each(function(_31){
_31.render(1);
_31.cancel();
_31.event("beforeFinish");
if(_31.finish){
_31.finish(_30);
}
_31.event("afterFinish");
});
}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(_32,_33,to){
_32=Object.isString(_32)?$(_32):_32;
var _34=$A(arguments),_35=_34.last(),_36=_34.length==5?_34[3]:null;
this.method=Object.isFunction(_35)?_35.bind(_32):Object.isFunction(_32[_35])?_32[_35].bind(_32):function(_37){
_32[_35]=_37;
};
this.start(Object.extend({from:_33,to:to},_36||{}));
},update:function(_38){
this.method(_38);
}});
Effect.Event=Class.create(Effect.Base,{initialize:function(){
this.start(Object.extend({duration:0},arguments[0]||{}));
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(_39){
this.element=$(_39);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _3a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_3a);
},update:function(_3b){
this.element.setOpacity(_3b);
}});
Effect.Move=Class.create(Effect.Base,{initialize:function(_3c){
this.element=$(_3c);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _3d=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_3d);
},setup:function(){
this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){
this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop;
}
},update:function(_3e){
this.element.setStyle({left:(this.options.x*_3e+this.originalLeft).round()+"px",top:(this.options.y*_3e+this.originalTop).round()+"px"});
}});
Effect.MoveBy=function(_3f,_40,_41){
return new Effect.Move(_3f,Object.extend({x:_41,y:_40},arguments[3]||{}));
};
Effect.Scale=Class.create(Effect.Base,{initialize:function(_42,_43){
this.element=$(_42);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _44=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_43},arguments[2]||{});
this.start(_44);
},setup:function(){
this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(k){
this.originalStyle[k]=this.element.style[k];
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var _45=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_46){
if(_45.indexOf(_46)>0){
this.fontSize=parseFloat(_45);
this.fontSizeType=_46;
}
}.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(_47){
var _48=(this.options.scaleFrom/100)+(this.factor*_47);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_48+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_48,this.dims[1]*_48);
},finish:function(_49){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_4a,_4b){
var d={};
if(this.options.scaleX){
d.width=_4b.round()+"px";
}
if(this.options.scaleY){
d.height=_4a.round()+"px";
}
if(this.options.scaleFromCenter){
var _4c=(_4a-this.dims[0])/2;
var _4d=(_4b-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-_4c+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_4d+"px";
}
}else{
if(this.options.scaleY){
d.top=-_4c+"px";
}
if(this.options.scaleX){
d.left=-_4d+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(_4e){
this.element=$(_4e);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _4f=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_4f);
},setup:function(){
if(this.element.getStyle("display")=="none"){
this.cancel();
return;
}
this.oldStyle={};
if(!this.options.keepBackgroundImage){
this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"});
}
if(!this.options.endcolor){
this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");
}
if(!this.options.restorecolor){
this.options.restorecolor=this.element.getStyle("background-color");
}
this._base=$R(0,2).map(function(i){
return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
}.bind(this));
this._delta=$R(0,2).map(function(i){
return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
}.bind(this));
},update:function(_50){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+((this._base[i]+(this._delta[i]*_50)).round().toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=function(_51){
var _52=arguments[1]||{},_53=document.viewport.getScrollOffsets(),_54=$(_51).cumulativeOffset();
if(_52.offset){
_54[1]+=_52.offset;
}
return new Effect.Tween(null,_53.top,_54[1],_52,function(p){
scrollTo(_53.left,p.round());
});
};
Effect.Fade=function(_55){
_55=$(_55);
var _56=_55.getInlineOpacity();
var _57=Object.extend({from:_55.getOpacity()||1,to:0,afterFinishInternal:function(_58){
if(_58.options.to!=0){
return;
}
_58.element.hide().setStyle({opacity:_56});
}},arguments[1]||{});
return new Effect.Opacity(_55,_57);
};
Effect.Appear=function(_59){
_59=$(_59);
var _5a=Object.extend({from:(_59.getStyle("display")=="none"?0:_59.getOpacity()||0),to:1,afterFinishInternal:function(_5b){
_5b.element.forceRerendering();
},beforeSetup:function(_5c){
_5c.element.setOpacity(_5c.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_59,_5a);
};
Effect.Puff=function(_5d){
_5d=$(_5d);
var _5e={opacity:_5d.getInlineOpacity(),position:_5d.getStyle("position"),top:_5d.style.top,left:_5d.style.left,width:_5d.style.width,height:_5d.style.height};
return new Effect.Parallel([new Effect.Scale(_5d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_5d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_5f){
Position.absolutize(_5f.effects[0].element);
},afterFinishInternal:function(_60){
_60.effects[0].element.hide().setStyle(_5e);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_61){
_61=$(_61);
_61.makeClipping();
return new Effect.Scale(_61,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_62){
_62.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_63){
_63=$(_63);
var _64=_63.getDimensions();
return new Effect.Scale(_63,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_64.height,originalWidth:_64.width},restoreAfterFinish:true,afterSetup:function(_65){
_65.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_66){
_66.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_67){
_67=$(_67);
var _68=_67.getInlineOpacity();
return new Effect.Appear(_67,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_69){
new Effect.Scale(_69.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_6a){
_6a.element.makePositioned().makeClipping();
},afterFinishInternal:function(_6b){
_6b.element.hide().undoClipping().undoPositioned().setStyle({opacity:_68});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_6c){
_6c=$(_6c);
var _6d={top:_6c.getStyle("top"),left:_6c.getStyle("left"),opacity:_6c.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_6c,{x:0,y:100,sync:true}),new Effect.Opacity(_6c,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_6e){
_6e.effects[0].element.makePositioned();
},afterFinishInternal:function(_6f){
_6f.effects[0].element.hide().undoPositioned().setStyle(_6d);
}},arguments[1]||{}));
};
Effect.Shake=function(_70){
_70=$(_70);
var _71=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var _72=parseFloat(_71.distance);
var _73=parseFloat(_71.duration)/10;
var _74={top:_70.getStyle("top"),left:_70.getStyle("left")};
return new Effect.Move(_70,{x:_72,y:0,duration:_73,afterFinishInternal:function(_75){
new Effect.Move(_75.element,{x:-_72*2,y:0,duration:_73*2,afterFinishInternal:function(_76){
new Effect.Move(_76.element,{x:_72*2,y:0,duration:_73*2,afterFinishInternal:function(_77){
new Effect.Move(_77.element,{x:-_72*2,y:0,duration:_73*2,afterFinishInternal:function(_78){
new Effect.Move(_78.element,{x:_72*2,y:0,duration:_73*2,afterFinishInternal:function(_79){
new Effect.Move(_79.element,{x:-_72,y:0,duration:_73,afterFinishInternal:function(_7a){
_7a.element.undoPositioned().setStyle(_74);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_7b){
_7b=$(_7b).cleanWhitespace();
var _7c=_7b.down().getStyle("bottom");
var _7d=_7b.getDimensions();
return new Effect.Scale(_7b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_7d.height,originalWidth:_7d.width},restoreAfterFinish:true,afterSetup:function(_7e){
_7e.element.makePositioned();
_7e.element.down().makePositioned();
if(window.opera){
_7e.element.setStyle({top:""});
}
_7e.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_7f){
_7f.element.down().setStyle({bottom:(_7f.dims[0]-_7f.element.clientHeight)+"px"});
},afterFinishInternal:function(_80){
_80.element.undoClipping().undoPositioned();
_80.element.down().undoPositioned().setStyle({bottom:_7c});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_81){
_81=$(_81).cleanWhitespace();
var _82=_81.down().getStyle("bottom");
var _83=_81.getDimensions();
return new Effect.Scale(_81,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:_83.height,originalWidth:_83.width},restoreAfterFinish:true,afterSetup:function(_84){
_84.element.makePositioned();
_84.element.down().makePositioned();
if(window.opera){
_84.element.setStyle({top:""});
}
_84.element.makeClipping().show();
},afterUpdateInternal:function(_85){
_85.element.down().setStyle({bottom:(_85.dims[0]-_85.element.clientHeight)+"px"});
},afterFinishInternal:function(_86){
_86.element.hide().undoClipping().undoPositioned();
_86.element.down().undoPositioned().setStyle({bottom:_82});
}},arguments[1]||{}));
};
Effect.Squish=function(_87){
return new Effect.Scale(_87,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_88){
_88.element.makeClipping();
},afterFinishInternal:function(_89){
_89.element.hide().undoClipping();
}});
};
Effect.Grow=function(_8a){
_8a=$(_8a);
var _8b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _8c={top:_8a.style.top,left:_8a.style.left,height:_8a.style.height,width:_8a.style.width,opacity:_8a.getInlineOpacity()};
var _8d=_8a.getDimensions();
var _8e,_8f;
var _90,_91;
switch(_8b.direction){
case "top-left":
_8e=_8f=_90=_91=0;
break;
case "top-right":
_8e=_8d.width;
_8f=_91=0;
_90=-_8d.width;
break;
case "bottom-left":
_8e=_90=0;
_8f=_8d.height;
_91=-_8d.height;
break;
case "bottom-right":
_8e=_8d.width;
_8f=_8d.height;
_90=-_8d.width;
_91=-_8d.height;
break;
case "center":
_8e=_8d.width/2;
_8f=_8d.height/2;
_90=-_8d.width/2;
_91=-_8d.height/2;
break;
}
return new Effect.Move(_8a,{x:_8e,y:_8f,duration:0.01,beforeSetup:function(_92){
_92.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_93){
new Effect.Parallel([new Effect.Opacity(_93.element,{sync:true,to:1,from:0,transition:_8b.opacityTransition}),new Effect.Move(_93.element,{x:_90,y:_91,sync:true,transition:_8b.moveTransition}),new Effect.Scale(_93.element,100,{scaleMode:{originalHeight:_8d.height,originalWidth:_8d.width},sync:true,scaleFrom:window.opera?1:0,transition:_8b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_94){
_94.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_95){
_95.effects[0].element.undoClipping().undoPositioned().setStyle(_8c);
}},_8b));
}});
};
Effect.Shrink=function(_96){
_96=$(_96);
var _97=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _98={top:_96.style.top,left:_96.style.left,height:_96.style.height,width:_96.style.width,opacity:_96.getInlineOpacity()};
var _99=_96.getDimensions();
var _9a,_9b;
switch(_97.direction){
case "top-left":
_9a=_9b=0;
break;
case "top-right":
_9a=_99.width;
_9b=0;
break;
case "bottom-left":
_9a=0;
_9b=_99.height;
break;
case "bottom-right":
_9a=_99.width;
_9b=_99.height;
break;
case "center":
_9a=_99.width/2;
_9b=_99.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_96,{sync:true,to:0,from:1,transition:_97.opacityTransition}),new Effect.Scale(_96,window.opera?1:0,{sync:true,transition:_97.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_96,{x:_9a,y:_9b,sync:true,transition:_97.moveTransition})],Object.extend({beforeStartInternal:function(_9c){
_9c.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_9d){
_9d.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_98);
}},_97));
};
Effect.Pulsate=function(_9e){
_9e=$(_9e);
var _9f=arguments[1]||{},_a0=_9e.getInlineOpacity(),_a1=_9f.transition||Effect.Transitions.linear,_a2=function(pos){
return 1-_a1((-Math.cos((pos*(_9f.pulses||5)*2)*Math.PI)/2)+0.5);
};
return new Effect.Opacity(_9e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_a3){
_a3.element.setStyle({opacity:_a0});
}},_9f),{transition:_a2}));
};
Effect.Fold=function(_a4){
_a4=$(_a4);
var _a5={top:_a4.style.top,left:_a4.style.left,width:_a4.style.width,height:_a4.style.height};
_a4.makeClipping();
return new Effect.Scale(_a4,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_a6){
new Effect.Scale(_a4,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_a7){
_a7.element.hide().undoClipping().setStyle(_a5);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create(Effect.Base,{initialize:function(_a8){
this.element=$(_a8);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _a9=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(_a9.style)){
this.style=$H(_a9.style);
}else{
if(_a9.style.include(":")){
this.style=_a9.style.parseStyle();
}else{
this.element.addClassName(_a9.style);
this.style=$H(this.element.getStyles());
this.element.removeClassName(_a9.style);
var css=this.element.getStyles();
this.style=this.style.reject(function(_aa){
return _aa.value==css[_aa.key];
});
_a9.afterFinishInternal=function(_ab){
_ab.element.addClassName(_ab.options.style);
_ab.transforms.each(function(_ac){
_ab.element.style[_ac.style]="";
});
};
}
}
this.start(_a9);
},setup:function(){
function _ad(_ae){
if(!_ae||["rgba(0, 0, 0, 0)","transparent"].include(_ae)){
_ae="#ffffff";
}
_ae=_ae.parseColor();
return $R(0,2).map(function(i){
return parseInt(_ae.slice(i*2+1,i*2+3),16);
});
};
this.transforms=this.style.map(function(_af){
var _b0=_af[0],_b1=_af[1],_b2=null;
if(_b1.parseColor("#zzzzzz")!="#zzzzzz"){
_b1=_b1.parseColor();
_b2="color";
}else{
if(_b0=="opacity"){
_b1=parseFloat(_b1);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
}else{
if(Element.CSS_LENGTH.test(_b1)){
var _b3=_b1.match(/^([\+\-]?[0-9\.]+)(.*)$/);
_b1=parseFloat(_b3[1]);
_b2=(_b3.length==3)?_b3[2]:null;
}
}
}
var _b4=this.element.getStyle(_b0);
return {style:_b0.camelize(),originalValue:_b2=="color"?_ad(_b4):parseFloat(_b4||0),targetValue:_b2=="color"?_ad(_b1):_b1,unit:_b2};
}.bind(this)).reject(function(_b5){
return ((_b5.originalValue==_b5.targetValue)||(_b5.unit!="color"&&(isNaN(_b5.originalValue)||isNaN(_b5.targetValue))));
});
},update:function(_b6){
var _b7={},_b8,i=this.transforms.length;
while(i--){
_b7[(_b8=this.transforms[i]).style]=_b8.unit=="color"?"#"+(Math.round(_b8.originalValue[0]+(_b8.targetValue[0]-_b8.originalValue[0])*_b6)).toColorPart()+(Math.round(_b8.originalValue[1]+(_b8.targetValue[1]-_b8.originalValue[1])*_b6)).toColorPart()+(Math.round(_b8.originalValue[2]+(_b8.targetValue[2]-_b8.originalValue[2])*_b6)).toColorPart():(_b8.originalValue+(_b8.targetValue-_b8.originalValue)*_b6).toFixed(3)+(_b8.unit===null?"":_b8.unit);
}
this.element.setStyle(_b7,true);
}});
Effect.Transform=Class.create({initialize:function(_b9){
this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(_b9);
},addTracks:function(_ba){
_ba.each(function(_bb){
_bb=$H(_bb);
var _bc=_bb.values().first();
this.tracks.push($H({ids:_bb.keys().first(),effect:Effect.Morph,options:{style:_bc}}));
}.bind(this));
return this;
},play:function(){
return new Effect.Parallel(this.tracks.map(function(_bd){
var ids=_bd.get("ids"),_be=_bd.get("effect"),_bf=_bd.get("options");
var _c0=[$(ids)||$$(ids)].flatten();
return _c0.map(function(e){
return new _be(e,Object.extend({sync:true},_bf));
});
}).flatten(),this.options);
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle "+"borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth "+"borderRightColor borderRightStyle borderRightWidth borderSpacing "+"borderTopColor borderTopStyle borderTopWidth bottom clip color "+"fontSize fontWeight height left letterSpacing lineHeight "+"marginBottom marginLeft marginRight marginTop markerOffset maxHeight "+"maxWidth minHeight minWidth opacity outlineColor outlineOffset "+"outlineWidth paddingBottom paddingLeft paddingRight paddingTop "+"right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){
var _c1,_c2=$H();
if(Prototype.Browser.WebKit){
_c1=new Element("div",{style:this}).style;
}else{
String.__parseStyleElement.innerHTML="<div style=\""+this+"\"></div>";
_c1=String.__parseStyleElement.childNodes[0].style;
}
Element.CSS_PROPERTIES.each(function(_c3){
if(_c1[_c3]){
_c2.set(_c3,_c1[_c3]);
}
});
if(Prototype.Browser.IE&&this.include("opacity")){
_c2.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
}
return _c2;
};
if(document.defaultView&&document.defaultView.getComputedStyle){
Element.getStyles=function(_c4){
var css=document.defaultView.getComputedStyle($(_c4),null);
return Element.CSS_PROPERTIES.inject({},function(_c5,_c6){
_c5[_c6]=css[_c6];
return _c5;
});
};
}else{
Element.getStyles=function(_c7){
_c7=$(_c7);
var css=_c7.currentStyle,_c8;
_c8=Element.CSS_PROPERTIES.inject({},function(_c9,_ca){
_c9[_ca]=css[_ca];
return _c9;
});
if(!_c8.opacity){
_c8.opacity=_c7.getOpacity();
}
return _c8;
};
}
Effect.Methods={morph:function(_cb,_cc){
_cb=$(_cb);
new Effect.Morph(_cb,Object.extend({style:_cc},arguments[2]||{}));
return _cb;
},visualEffect:function(_cd,_ce,_cf){
_cd=$(_cd);
var s=_ce.dasherize().camelize(),_d0=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[_d0](_cd,_cf);
return _cd;
},highlight:function(_d1,_d2){
_d1=$(_d1);
new Effect.Highlight(_d1,_d2);
return _d1;
}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown "+"pulsate shake puff squish switchOff dropOut").each(function(_d3){
Effect.Methods[_d3]=function(_d4,_d5){
_d4=$(_d4);
Effect[_d3.charAt(0).toUpperCase()+_d3.substring(1)](_d4,_d5);
return _d4;
};
});
$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(f){
Effect.Methods[f]=Element[f];
});
Element.addMethods(Effect.Methods);

