// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - Compressed

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(_4){
return $A($(_4).childNodes).collect(function(_5){
return (_5.nodeType==3?_5.nodeValue:(_5.hasChildNodes()?Element.collectTextNodes(_5):""));
}).flatten().join("");
};
Element.collectTextNodesIgnoreClass=function(_6,_7){
return $A($(_6).childNodes).collect(function(_8){
return (_8.nodeType==3?_8.nodeValue:((_8.hasChildNodes()&&!Element.hasClassName(_8,_7))?Element.collectTextNodesIgnoreClass(_8,_7):""));
}).flatten().join("");
};
Element.setContentZoom=function(_9,_a){
_9=$(_9);
_9.setStyle({fontSize:(_a/100)+"em"});
if(navigator.appVersion.indexOf("AppleWebKit")>0){
window.scrollBy(0,0);
}
return _9;
};
Element.getOpacity=function(_b){
return $(_b).getStyle("opacity");
};
Element.setOpacity=function(_c,_d){
return $(_c).setStyle({opacity:_d});
};
Element.getInlineOpacity=function(_e){
return $(_e).style.opacity||"";
};
Element.forceRerendering=function(_f){
try{
_f=$(_f);
var n=document.createTextNode(" ");
_f.appendChild(n);
_f.removeChild(n);
}
catch(e){
}
};
Array.prototype.call=function(){
var _11=arguments;
this.each(function(f){
f.apply(this,_11);
});
};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},tagifyText:function(_13){
if(typeof Builder=="undefined"){
throw ("Effect.tagifyText requires including script.aculo.us' builder.js library");
}
var _14="position:relative";
if(/MSIE/.test(navigator.userAgent)&&!window.opera){
_14+=";zoom:1";
}
_13=$(_13);
$A(_13.childNodes).each(function(_15){
if(_15.nodeType==3){
_15.nodeValue.toArray().each(function(_16){
_13.insertBefore(Builder.node("span",{style:_14},_16==" "?String.fromCharCode(160):_16),_15);
});
Element.remove(_15);
}
});
},multiple:function(_17,_18){
var _19;
if(((typeof _17=="object")||(typeof _17=="function"))&&(_17.length)){
_19=_17;
}else{
_19=$(_17).childNodes;
}
var _1a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var _1b=_1a.delay;
$A(_19).each(function(_1c,_1d){
new _18(_1c,Object.extend(_1a,{delay:_1d*_1a.speed+_1b}));
});
},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_1e,_1f){
_1e=$(_1e);
_1f=(_1f||"appear").toLowerCase();
var _20=Object.extend({queue:{position:"end",scope:(_1e.id||"global"),limit:1}},arguments[2]||{});
Effect[_1e.visible()?Effect.PAIRS[_1f][1]:Effect.PAIRS[_1f][0]](_1e,_20);
}};
var Effect2=Effect;
Effect.Transitions={linear:Prototype.K,sinoidal:function(pos){
return (-Math.cos(pos*Math.PI)/2)+0.5;
},reverse:function(pos){
return 1-pos;
},flicker:function(pos){
return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
},wobble:function(pos){
return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
},pulse:function(pos,_26){
_26=_26||5;
return (Math.round((pos%(1/_26))*_26)==0?((pos*_26*2)-Math.floor(pos*_26*2)):1-((pos*_26*2)-Math.floor(pos*_26*2)));
},none:function(pos){
return 0;
},full:function(pos){
return 1;
}};
Effect.ScopedQueue=Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype,Enumerable),{initialize:function(){
this.effects=[];
this.interval=null;
},_each:function(_29){
this.effects._each(_29);
},add:function(_2a){
var _2b=new Date().getTime();
var _2c=(typeof _2a.options.queue=="string")?_2a.options.queue:_2a.options.queue.position;
switch(_2c){
case "front":
this.effects.findAll(function(e){
return e.state=="idle";
}).each(function(e){
e.startOn+=_2a.finishOn;
e.finishOn+=_2a.finishOn;
});
break;
case "with-last":
_2b=this.effects.pluck("startOn").max()||_2b;
break;
case "end":
_2b=this.effects.pluck("finishOn").max()||_2b;
break;
}
_2a.startOn+=_2b;
_2a.finishOn+=_2b;
if(!_2a.options.queue.limit||(this.effects.length<_2a.options.queue.limit)){
this.effects.push(_2a);
}
if(!this.interval){
this.interval=setInterval(this.loop.bind(this),15);
}
},remove:function(_2f){
this.effects=this.effects.reject(function(e){
return e==_2f;
});
if(this.effects.length==0){
clearInterval(this.interval);
this.interval=null;
}
},loop:function(){
var _31=new Date().getTime();
for(var i=0,len=this.effects.length;i<len;i++){
if(this.effects[i]){
this.effects[i].loop(_31);
}
}
}});
Effect.Queues={instances:$H(),get:function(_33){
if(typeof _33!="string"){
return _33;
}
if(!this.instances[_33]){
this.instances[_33]=new Effect.ScopedQueue();
}
return this.instances[_33];
}};
Effect.Queue=Effect.Queues.get("global");
Effect.DefaultOptions={transition:Effect.Transitions.sinoidal,duration:1,fps:60,sync:false,from:0,to:1,delay:0,queue:"parallel"};
Effect.Base=function(){
};
Effect.Base.prototype={position:null,start:function(_34){
this.options=Object.extend(Object.extend({},Effect.DefaultOptions),_34||{});
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.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);
}
},loop:function(_35){
if(_35>=this.startOn){
if(_35>=this.finishOn){
this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){
this.finish();
}
this.event("afterFinish");
return;
}
var pos=(_35-this.startOn)/(this.finishOn-this.startOn);
var _37=Math.round(pos*this.options.fps*this.options.duration);
if(_37>this.currentFrame){
this.render(pos);
this.currentFrame=_37;
}
}
},render:function(pos){
if(this.state=="idle"){
this.state="running";
this.event("beforeSetup");
if(this.setup){
this.setup();
}
this.event("afterSetup");
}
if(this.state=="running"){
if(this.options.transition){
pos=this.options.transition(pos);
}
pos*=(this.options.to-this.options.from);
pos+=this.options.from;
this.position=pos;
this.event("beforeUpdate");
if(this.update){
this.update(pos);
}
this.event("afterUpdate");
}
},cancel:function(){
if(!this.options.sync){
Effect.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);
}
this.state="finished";
},event:function(_39){
if(this.options[_39+"Internal"]){
this.options[_39+"Internal"](this);
}
if(this.options[_39]){
this.options[_39](this);
}
},inspect:function(){
var _3a=$H();
for(property in this){
if(typeof this[property]!="function"){
_3a[property]=this[property];
}
}
return "#<Effect:"+_3a.inspect()+",options:"+$H(this.options).inspect()+">";
}};
Effect.Parallel=Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype,Effect.Base.prototype),{initialize:function(_3b){
this.effects=_3b||[];
this.start(arguments[1]);
},update:function(_3c){
this.effects.invoke("render",_3c);
},finish:function(_3d){
this.effects.each(function(_3e){
_3e.render(1);
_3e.cancel();
_3e.event("beforeFinish");
if(_3e.finish){
_3e.finish(_3d);
}
_3e.event("afterFinish");
});
}});
Effect.Event=Class.create();
Object.extend(Object.extend(Effect.Event.prototype,Effect.Base.prototype),{initialize:function(){
var _3f=Object.extend({duration:0},arguments[0]||{});
this.start(_3f);
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(_40){
this.element=$(_40);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
var _41=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(_41);
},update:function(_42){
this.element.setOpacity(_42);
}});
Effect.Move=Class.create();
Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(_43){
this.element=$(_43);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _44=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(_44);
},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(_45){
this.element.setStyle({left:Math.round(this.options.x*_45+this.originalLeft)+"px",top:Math.round(this.options.y*_45+this.originalTop)+"px"});
}});
Effect.MoveBy=function(_46,_47,_48){
return new Effect.Move(_46,Object.extend({x:_48,y:_47},arguments[3]||{}));
};
Effect.Scale=Class.create();
Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(_49,_4a){
this.element=$(_49);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _4b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_4a},arguments[2]||{});
this.start(_4b);
},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 _4d=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(_4e){
if(_4d.indexOf(_4e)>0){
this.fontSize=parseFloat(_4d);
this.fontSizeType=_4e;
}
}.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(_4f){
var _50=(this.options.scaleFrom/100)+(this.factor*_4f);
if(this.options.scaleContent&&this.fontSize){
this.element.setStyle({fontSize:this.fontSize*_50+this.fontSizeType});
}
this.setDimensions(this.dims[0]*_50,this.dims[1]*_50);
},finish:function(_51){
if(this.restoreAfterFinish){
this.element.setStyle(this.originalStyle);
}
},setDimensions:function(_52,_53){
var d={};
if(this.options.scaleX){
d.width=Math.round(_53)+"px";
}
if(this.options.scaleY){
d.height=Math.round(_52)+"px";
}
if(this.options.scaleFromCenter){
var _55=(_52-this.dims[0])/2;
var _56=(_53-this.dims[1])/2;
if(this.elementPositioning=="absolute"){
if(this.options.scaleY){
d.top=this.originalTop-_55+"px";
}
if(this.options.scaleX){
d.left=this.originalLeft-_56+"px";
}
}else{
if(this.options.scaleY){
d.top=-_55+"px";
}
if(this.options.scaleX){
d.left=-_56+"px";
}
}
}
this.element.setStyle(d);
}});
Effect.Highlight=Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype,Effect.Base.prototype),{initialize:function(_57){
this.element=$(_57);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _58=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(_58);
},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(_5b){
this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(this._base[i]+(this._delta[i]*_5b)).toColorPart());
}.bind(this))});
},finish:function(){
this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));
}});
Effect.ScrollTo=Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(_5f){
this.element=$(_5f);
this.start(arguments[1]||{});
},setup:function(){
Position.prepare();
var _60=Position.cumulativeOffset(this.element);
if(this.options.offset){
_60[1]+=this.options.offset;
}
var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
this.scrollStart=Position.deltaY;
this.delta=(_60[1]>max?max:_60[1])-this.scrollStart;
},update:function(_62){
Position.prepare();
window.scrollTo(Position.deltaX,this.scrollStart+(_62*this.delta));
}});
Effect.Fade=function(_63){
_63=$(_63);
var _64=_63.getInlineOpacity();
var _65=Object.extend({from:_63.getOpacity()||1,to:0,afterFinishInternal:function(_66){
if(_66.options.to!=0){
return;
}
_66.element.hide().setStyle({opacity:_64});
}},arguments[1]||{});
return new Effect.Opacity(_63,_65);
};
Effect.Appear=function(_67){
_67=$(_67);
var _68=Object.extend({from:(_67.getStyle("display")=="none"?0:_67.getOpacity()||0),to:1,afterFinishInternal:function(_69){
_69.element.forceRerendering();
},beforeSetup:function(_6a){
_6a.element.setOpacity(_6a.options.from).show();
}},arguments[1]||{});
return new Effect.Opacity(_67,_68);
};
Effect.Puff=function(_6b){
_6b=$(_6b);
var _6c={opacity:_6b.getInlineOpacity(),position:_6b.getStyle("position"),top:_6b.style.top,left:_6b.style.left,width:_6b.style.width,height:_6b.style.height};
return new Effect.Parallel([new Effect.Scale(_6b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_6b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_6d){
Position.absolutize(_6d.effects[0].element);
},afterFinishInternal:function(_6e){
_6e.effects[0].element.hide().setStyle(_6c);
}},arguments[1]||{}));
};
Effect.BlindUp=function(_6f){
_6f=$(_6f);
_6f.makeClipping();
return new Effect.Scale(_6f,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_70){
_70.element.hide().undoClipping();
}},arguments[1]||{}));
};
Effect.BlindDown=function(_71){
_71=$(_71);
var _72=_71.getDimensions();
return new Effect.Scale(_71,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_72.height,originalWidth:_72.width},restoreAfterFinish:true,afterSetup:function(_73){
_73.element.makeClipping().setStyle({height:"0px"}).show();
},afterFinishInternal:function(_74){
_74.element.undoClipping();
}},arguments[1]||{}));
};
Effect.SwitchOff=function(_75){
_75=$(_75);
var _76=_75.getInlineOpacity();
return new Effect.Appear(_75,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_77){
new Effect.Scale(_77.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_78){
_78.element.makePositioned().makeClipping();
},afterFinishInternal:function(_79){
_79.element.hide().undoClipping().undoPositioned().setStyle({opacity:_76});
}});
}},arguments[1]||{}));
};
Effect.DropOut=function(_7a){
_7a=$(_7a);
var _7b={top:_7a.getStyle("top"),left:_7a.getStyle("left"),opacity:_7a.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(_7a,{x:0,y:100,sync:true}),new Effect.Opacity(_7a,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_7c){
_7c.effects[0].element.makePositioned();
},afterFinishInternal:function(_7d){
_7d.effects[0].element.hide().undoPositioned().setStyle(_7b);
}},arguments[1]||{}));
};
Effect.Shake=function(_7e){
_7e=$(_7e);
var _7f={top:_7e.getStyle("top"),left:_7e.getStyle("left")};
return new Effect.Move(_7e,{x:20,y:0,duration:0.05,afterFinishInternal:function(_80){
new Effect.Move(_80.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_81){
new Effect.Move(_81.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_82){
new Effect.Move(_82.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_83){
new Effect.Move(_83.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_84){
new Effect.Move(_84.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_85){
_85.element.undoPositioned().setStyle(_7f);
}});
}});
}});
}});
}});
}});
};
Effect.SlideDown=function(_86){
_86=$(_86).cleanWhitespace();
var _87=_86.down().getStyle("bottom");
var _88=_86.getDimensions();
return new Effect.Scale(_86,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_88.height,originalWidth:_88.width},restoreAfterFinish:true,afterSetup:function(_89){
_89.element.makePositioned();
_89.element.down().makePositioned();
if(window.opera){
_89.element.setStyle({top:""});
}
_89.element.makeClipping().setStyle({height:"0px"}).show();
},afterUpdateInternal:function(_8a){
_8a.element.down().setStyle({bottom:(_8a.dims[0]-_8a.element.clientHeight)+"px"});
},afterFinishInternal:function(_8b){
_8b.element.undoClipping().undoPositioned();
_8b.element.down().undoPositioned().setStyle({bottom:_87});
}},arguments[1]||{}));
};
Effect.SlideUp=function(_8c){
_8c=$(_8c).cleanWhitespace();
var _8d=_8c.down().getStyle("bottom");
return new Effect.Scale(_8c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_8e){
_8e.element.makePositioned();
_8e.element.down().makePositioned();
if(window.opera){
_8e.element.setStyle({top:""});
}
_8e.element.makeClipping().show();
},afterUpdateInternal:function(_8f){
_8f.element.down().setStyle({bottom:(_8f.dims[0]-_8f.element.clientHeight)+"px"});
},afterFinishInternal:function(_90){
_90.element.hide().undoClipping().undoPositioned().setStyle({bottom:_8d});
_90.element.down().undoPositioned();
}},arguments[1]||{}));
};
Effect.Squish=function(_91){
return new Effect.Scale(_91,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_92){
_92.element.makeClipping();
},afterFinishInternal:function(_93){
_93.element.hide().undoClipping();
}});
};
Effect.Grow=function(_94){
_94=$(_94);
var _95=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var _96={top:_94.style.top,left:_94.style.left,height:_94.style.height,width:_94.style.width,opacity:_94.getInlineOpacity()};
var _97=_94.getDimensions();
var _98,initialMoveY;
var _99,moveY;
switch(_95.direction){
case "top-left":
_98=initialMoveY=_99=moveY=0;
break;
case "top-right":
_98=_97.width;
initialMoveY=moveY=0;
_99=-_97.width;
break;
case "bottom-left":
_98=_99=0;
initialMoveY=_97.height;
moveY=-_97.height;
break;
case "bottom-right":
_98=_97.width;
initialMoveY=_97.height;
_99=-_97.width;
moveY=-_97.height;
break;
case "center":
_98=_97.width/2;
initialMoveY=_97.height/2;
_99=-_97.width/2;
moveY=-_97.height/2;
break;
}
return new Effect.Move(_94,{x:_98,y:initialMoveY,duration:0.01,beforeSetup:function(_9a){
_9a.element.hide().makeClipping().makePositioned();
},afterFinishInternal:function(_9b){
new Effect.Parallel([new Effect.Opacity(_9b.element,{sync:true,to:1,from:0,transition:_95.opacityTransition}),new Effect.Move(_9b.element,{x:_99,y:moveY,sync:true,transition:_95.moveTransition}),new Effect.Scale(_9b.element,100,{scaleMode:{originalHeight:_97.height,originalWidth:_97.width},sync:true,scaleFrom:window.opera?1:0,transition:_95.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_9c){
_9c.effects[0].element.setStyle({height:"0px"}).show();
},afterFinishInternal:function(_9d){
_9d.effects[0].element.undoClipping().undoPositioned().setStyle(_96);
}},_95));
}});
};
Effect.Shrink=function(_9e){
_9e=$(_9e);
var _9f=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var _a0={top:_9e.style.top,left:_9e.style.left,height:_9e.style.height,width:_9e.style.width,opacity:_9e.getInlineOpacity()};
var _a1=_9e.getDimensions();
var _a2,moveY;
switch(_9f.direction){
case "top-left":
_a2=moveY=0;
break;
case "top-right":
_a2=_a1.width;
moveY=0;
break;
case "bottom-left":
_a2=0;
moveY=_a1.height;
break;
case "bottom-right":
_a2=_a1.width;
moveY=_a1.height;
break;
case "center":
_a2=_a1.width/2;
moveY=_a1.height/2;
break;
}
return new Effect.Parallel([new Effect.Opacity(_9e,{sync:true,to:0,from:1,transition:_9f.opacityTransition}),new Effect.Scale(_9e,window.opera?1:0,{sync:true,transition:_9f.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_9e,{x:_a2,y:moveY,sync:true,transition:_9f.moveTransition})],Object.extend({beforeStartInternal:function(_a3){
_a3.effects[0].element.makePositioned().makeClipping();
},afterFinishInternal:function(_a4){
_a4.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_a0);
}},_9f));
};
Effect.Pulsate=function(_a5){
_a5=$(_a5);
var _a6=arguments[1]||{};
var _a7=_a5.getInlineOpacity();
var _a8=_a6.transition||Effect.Transitions.sinoidal;
var _a9=function(pos){
return _a8(1-Effect.Transitions.pulse(pos,_a6.pulses));
};
_a9.bind(_a8);
return new Effect.Opacity(_a5,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_ab){
_ab.element.setStyle({opacity:_a7});
}},_a6),{transition:_a9}));
};
Effect.Fold=function(_ac){
_ac=$(_ac);
var _ad={top:_ac.style.top,left:_ac.style.left,width:_ac.style.width,height:_ac.style.height};
_ac.makeClipping();
return new Effect.Scale(_ac,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_ae){
new Effect.Scale(_ac,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_af){
_af.element.hide().undoClipping().setStyle(_ad);
}});
}},arguments[1]||{}));
};
Effect.Morph=Class.create();
Object.extend(Object.extend(Effect.Morph.prototype,Effect.Base.prototype),{initialize:function(_b0){
this.element=$(_b0);
if(!this.element){
throw (Effect._elementDoesNotExistError);
}
var _b1=Object.extend({style:{}},arguments[1]||{});
if(typeof _b1.style=="string"){
if(_b1.style.indexOf(":")==-1){
var _b2="",selector="."+_b1.style;
$A(document.styleSheets).reverse().each(function(_b3){
if(_b3.cssRules){
cssRules=_b3.cssRules;
}else{
if(_b3.rules){
cssRules=_b3.rules;
}
}
$A(cssRules).reverse().each(function(_b4){
if(selector==_b4.selectorText){
_b2=_b4.style.cssText;
throw $break;
}
});
if(_b2){
throw $break;
}
});
this.style=_b2.parseStyle();
_b1.afterFinishInternal=function(_b5){
_b5.element.addClassName(_b5.options.style);
_b5.transforms.each(function(_b6){
if(_b6.style!="opacity"){
_b5.element.style[_b6.style.camelize()]="";
}
});
};
}else{
this.style=_b1.style.parseStyle();
}
}else{
this.style=$H(_b1.style);
}
this.start(_b1);
},setup:function(){
function parseColor(_b7){
if(!_b7||["rgba(0, 0, 0, 0)","transparent"].include(_b7)){
_b7="#ffffff";
}
_b7=_b7.parseColor();
return $R(0,2).map(function(i){
return parseInt(_b7.slice(i*2+1,i*2+3),16);
});
}
this.transforms=this.style.map(function(_b9){
var _ba=_b9[0].underscore().dasherize(),value=_b9[1],unit=null;
if(value.parseColor("#zzzzzz")!="#zzzzzz"){
value=value.parseColor();
unit="color";
}else{
if(_ba=="opacity"){
value=parseFloat(value);
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&(!this.element.currentStyle.hasLayout)){
this.element.setStyle({zoom:1});
}
}else{
if(Element.CSS_LENGTH.test(value)){
var _bb=value.match(/^([\+\-]?[0-9\.]+)(.*)$/),value=parseFloat(_bb[1]),unit=(_bb.length==3)?_bb[2]:null;
}
}
}
var _bc=this.element.getStyle(_ba);
return $H({style:_ba,originalValue:unit=="color"?parseColor(_bc):parseFloat(_bc||0),targetValue:unit=="color"?parseColor(value):value,unit:unit});
}.bind(this)).reject(function(_bd){
return ((_bd.originalValue==_bd.targetValue)||(_bd.unit!="color"&&(isNaN(_bd.originalValue)||isNaN(_bd.targetValue))));
});
},update:function(_be){
var _bf=$H(),value=null;
this.transforms.each(function(_c0){
value=_c0.unit=="color"?$R(0,2).inject("#",function(m,v,i){
return m+(Math.round(_c0.originalValue[i]+(_c0.targetValue[i]-_c0.originalValue[i])*_be)).toColorPart();
}):_c0.originalValue+Math.round(((_c0.targetValue-_c0.originalValue)*_be)*1000)/1000+_c0.unit;
_bf[_c0.style]=value;
});
this.element.setStyle(_bf);
}});
Effect.Transform=Class.create();
Object.extend(Effect.Transform.prototype,{initialize:function(_c4){
this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(_c4);
},addTracks:function(_c5){
_c5.each(function(_c6){
var _c7=$H(_c6).values().first();
this.tracks.push($H({ids:$H(_c6).keys().first(),effect:Effect.Morph,options:{style:_c7}}));
}.bind(this));
return this;
},play:function(){
return new Effect.Parallel(this.tracks.map(function(_c8){
var _c9=[$(_c8.ids)||$$(_c8.ids)].flatten();
return _c9.map(function(e){
return new _c8.effect(e,Object.extend({sync:true},_c8.options));
});
}).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.prototype.parseStyle=function(){
var _cb=Element.extend(document.createElement("div"));
_cb.innerHTML="<div style=\""+this+"\"></div>";
var _cc=_cb.down().style,styleRules=$H();
Element.CSS_PROPERTIES.each(function(_cd){
if(_cc[_cd]){
styleRules[_cd]=_cc[_cd];
}
});
if(/MSIE/.test(navigator.userAgent)&&!window.opera&&this.indexOf("opacity")>-1){
styleRules.opacity=this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
}
return styleRules;
};
Element.morph=function(_ce,_cf){
new Effect.Morph(_ce,Object.extend({style:_cf},arguments[2]||{}));
return _ce;
};
["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","morph"].each(function(f){
Element.Methods[f]=Element[f];
});
Element.Methods.visualEffect=function(_d1,_d2,_d3){
s=_d2.gsub(/_/,"-").camelize();
effect_class=s.charAt(0).toUpperCase()+s.substring(1);
new Effect[effect_class](_d1,_d3);
return $(_d1);
};
Element.addMethods();

