/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/


window[(typeof (djConfig)!="undefined"&&djConfig.scopeMap&&djConfig.scopeMap[0][1])||"dojo"]._xdResourceLoaded({depends:[["provide","dojo.fx"],["provide","dojo.fx.Toggler"]],defineResource:function(_1,_2,_3){if(!_1._hasResource["dojo.fx"]){_1._hasResource["dojo.fx"]=true;_1.provide("dojo.fx");_1.provide("dojo.fx.Toggler");(function(){var _4={_fire:function(_5,_6){if(this[_5]){this[_5].apply(this,_6||[]);}return this;}};var _7=function(_8){this._index=-1;this._animations=_8||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;_1.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};_1.extend(_7,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){_1.disconnect(this._onAnimateCtx);_1.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=_1.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=_1.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_a,_b){if(!this._current){this._current=this._animations[this._index=0];}if(!_b&&this._current.status()=="playing"){return this;}var _c=_1.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_d=_1.connect(this._current,"onBegin",this,function(_e){this._fire("onBegin",arguments);}),_f=_1.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);_1.disconnect(_c);_1.disconnect(_d);_1.disconnect(_f);});if(this._onAnimateCtx){_1.disconnect(this._onAnimateCtx);}this._onAnimateCtx=_1.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){_1.disconnect(this._onEndCtx);}this._onEndCtx=_1.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=_1.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);_1.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_13,_14){this.pause();var _15=this.duration*_13;this._current=null;_1.some(this._animations,function(a){if(a.duration<=_15){this._current=a;return true;}_15-=a.duration;return false;});if(this._current){this._current.gotoPercent(_15/_current.duration,_14);}return this;},stop:function(_17){if(this._current){if(_17){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=_1.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);_1.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){_1.disconnect(this._onAnimateCtx);}if(this._onEndCtx){_1.disconnect(this._onEndCtx);}}});_1.extend(_7,_4);_1.fx.chain=function(_1a){return new _7(_1a);};var _1b=function(_1c){this._animations=_1c||[];this._connects=[];this._finished=0;this.duration=0;_1.forEach(_1c,function(a){var _1e=a.duration;if(a.delay){_1e+=a.delay;}if(this.duration<_1e){this.duration=_1e;}this._connects.push(_1.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new _1._Animation({curve:[0,1],duration:this.duration});_1.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop"],function(evt){this._connects.push(_1.connect(this._pseudoAnimation,evt,_1.hitch(this,"_fire",evt)));},this);};_1.extend(_1b,{_doAction:function(_20,_21){_1.forEach(this._animations,function(a){a[_20].apply(a,_21);});return this;},_onEnd:function(){if(++this._finished==this._animations.length){this._fire("onEnd");}},_call:function(_23,_24){var t=this._pseudoAnimation;t[_23].apply(t,_24);},play:function(_26,_27){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(_28,_29){var ms=this.duration*_28;_1.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_29);});this._call("gotoProcent",arguments);return this;},stop:function(_2c){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){_1.forEach(this._connects,_1.disconnect);}});_1.extend(_1b,_4);_1.fx.combine=function(_2d){return new _1b(_2d);};})();_1.declare("dojo.fx.Toggler",null,{constructor:function(_2e){var _t=this;_1.mixin(_t,_2e);_t.node=_2e.node;_t._showArgs=_1.mixin({},_2e);_t._showArgs.node=_t.node;_t._showArgs.duration=_t.showDuration;_t.showAnim=_t.showFunc(_t._showArgs);_t._hideArgs=_1.mixin({},_2e);_t._hideArgs.node=_t.node;_t._hideArgs.duration=_t.hideDuration;_t.hideAnim=_t.hideFunc(_t._hideArgs);_1.connect(_t.showAnim,"beforeBegin",_1.hitch(_t.hideAnim,"stop",true));_1.connect(_t.hideAnim,"beforeBegin",_1.hitch(_t.showAnim,"stop",true));},node:null,showFunc:_1.fadeIn,hideFunc:_1.fadeOut,showDuration:200,hideDuration:200,show:function(_30){return this.showAnim.play(_30||0);},hide:function(_31){return this.hideAnim.play(_31||0);}});_1.fx.wipeIn=function(_32){_32.node=_1.byId(_32.node);var _33=_32.node,s=_33.style;var _35=_1.animateProperty(_1.mixin({properties:{height:{start:function(){s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _36=_1.style(_33,"height");return Math.max(_36,1);}},end:function(){return _33.scrollHeight;}}}},_32));_1.connect(_35,"onEnd",function(){s.height="auto";});return _35;};_1.fx.wipeOut=function(_37){var _38=_37.node=_1.byId(_37.node);var s=_38.style;var _3a=_1.animateProperty(_1.mixin({properties:{height:{end:1}}},_37));_1.connect(_3a,"beforeBegin",function(){s.overflow="hidden";s.display="";});_1.connect(_3a,"onEnd",function(){s.height="auto";s.display="none";});return _3a;};_1.fx.slideTo=function(_3b){var _3c=(_3b.node=_1.byId(_3b.node));var top=null;var _3e=null;var _3f=(function(n){return function(){var cs=_1.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_3e=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=_1.coords(n,true);top=ret.y;_3e=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_3e+"px";}};})(_3c);_3f();var _44=_1.animateProperty(_1.mixin({properties:{top:{end:_3b.top||0},left:{end:_3b.left||0}}},_3b));_1.connect(_44,"beforeBegin",_44,_3f);return _44;};}}});
