/* Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojo.fx"]){ dojo._hasResource["dojo.fx"]=true; dojo.provide("dojo.fx"); dojo.require("dojo.fx.Toggler"); (function(){ var d=dojo,_1={_fire:function(_2,_3){ if(this[_2]){ this[_2].apply(this,_3||[]); } return this; }}; var _4=function(_5){ this._index=-1; this._animations=_5||[]; this._current=this._onAnimateCtx=this._onEndCtx=null; this.duration=0; d.forEach(this._animations,function(a){ this.duration+=a.duration; if(a.delay){ this.duration+=a.delay; } },this); }; d.extend(_4,{_onAnimate:function(){ this._fire("onAnimate",arguments); },_onEnd:function(){ d.disconnect(this._onAnimateCtx); d.disconnect(this._onEndCtx); this._onAnimateCtx=this._onEndCtx=null; if(this._index+1==this._animations.length){ this._fire("onEnd"); }else{ this._current=this._animations[++this._index]; this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate"); this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd"); this._current.play(0,true); } },play:function(_6,_7){ if(!this._current){ this._current=this._animations[this._index=0]; } if(!_7&&this._current.status()=="playing"){ return this; } var _8=d.connect(this._current,"beforeBegin",this,function(){ this._fire("beforeBegin"); }),_9=d.connect(this._current,"onBegin",this,function(_a){ this._fire("onBegin",arguments); }),_b=d.connect(this._current,"onPlay",this,function(_c){ this._fire("onPlay",arguments); d.disconnect(_8); d.disconnect(_9); d.disconnect(_b); }); if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); } this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate"); if(this._onEndCtx){ d.disconnect(this._onEndCtx); } this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd"); this._current.play.apply(this._current,arguments); return this; },pause:function(){ if(this._current){ var e=d.connect(this._current,"onPause",this,function(_d){ this._fire("onPause",arguments); d.disconnect(e); }); this._current.pause(); } return this; },gotoPercent:function(_e,_f){ this.pause(); var _10=this.duration*_e; this._current=null; d.some(this._animations,function(a){ if(a.duration<=_10){ this._current=a; return true; } _10-=a.duration; return false; }); if(this._current){ this._current.gotoPercent(_10/this._current.duration,_f); } return this; },stop:function(_11){ if(this._current){ if(_11){ for(;this._index+1this._animations.length){ this._fire("onEnd"); } },_call:function(_19,_1a){ var t=this._pseudoAnimation; t[_19].apply(t,_1a); },play:function(_1b,_1c){ this._finished=0; this._doAction("play",arguments); this._call("play",arguments); return this; },pause:function(){ this._doAction("pause",arguments); this._call("pause",arguments); return this; },gotoPercent:function(_1d,_1e){ var ms=this.duration*_1d; d.forEach(this._animations,function(a){ a.gotoPercent(a.duration