YUI.add("anim-base",function(_,t){var e,i="running",s="startTime",r="elapsedTime",n="paused",a="reverse",o="iterationCount",m=Number,u={};_.Anim=function(){_.Anim.superclass.constructor.apply(this,arguments),_.Anim._instances[_.stamp(this)]=this},_.Anim.NAME="anim",_.Anim._instances={},_.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,_.Anim.DEFAULT_UNIT="px",_.Anim.DEFAULT_EASING=function(t,e,i,n){return i*t/n+e},_.Anim._intervalTime=20,_.Anim.behaviors={left:{get:function(t,e){return t._getOffset(e)}}},_.Anim.behaviors.top=_.Anim.behaviors.left,_.Anim.DEFAULT_SETTER=function(t,e,i,n,s,r,a,o){var t=t._node,u=t._node,s=a(s,m(i),m(n)-m(i),r);u?"style"in u&&(e in u.style||e in _.DOM.CUSTOM_STYLES)?t.setStyle(e,s+(o=o||"")):"attributes"in u&&e in u.attributes?t.setAttribute(e,s):e in u&&(u[e]=s):t.set?t.set(e,s):e in t&&(t[e]=s)},_.Anim.DEFAULT_GETTER=function(t,e){var t=t._node,i=t._node,n="";return i?"style"in i&&(e in i.style||e in _.DOM.CUSTOM_STYLES)?n=t.getComputedStyle(e):"attributes"in i&&e in i.attributes?n=t.getAttribute(e):e in i&&(n=i[e]):t.get?n=t.get(e):e in t&&(n=t[e]),n},_.Anim.ATTRS={node:{setter:function(t){return t&&("string"==typeof t||t.nodeType)&&(t=_.one(t)),this._node=t}},duration:{value:1},easing:{value:_.Anim.DEFAULT_EASING,setter:function(t){if("string"==typeof t&&_.Easing)return _.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!u[_.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},_.Anim.run=function(){var t,e=_.Anim._instances;for(t in e)e[t].run&&e[t].run()},_.Anim.pause=function(){for(var t in u)u[t].pause&&u[t].pause();_.Anim._stopTimer()},_.Anim.stop=function(){for(var t in u)u[t].stop&&u[t].stop();_.Anim._stopTimer()},_.Anim._startTimer=function(){e=e||setInterval(_.Anim._runFrame,_.Anim._intervalTime)},_.Anim._stopTimer=function(){clearInterval(e),e=0},_.Anim._runFrame=function(){var t,e=!0;for(t in u)u[t]._runFrame&&(e=!1,u[t]._runFrame());e&&_.Anim._stopTimer()},_.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/,_.extend(_.Anim,_.Base,{run:function(){return this.get(n)?this._resume():this.get(i)||this._start(),this},pause:function(){return this.get(i)&&this._pause(),this},stop:function(t){return(this.get(i)||this.get(n))&&this._end(t),this},_added:!1,_start:function(){this._set(s,new Date-this.get(r)),this._actualFrames=0,this.get(n)||this._initAnimAttr(),u[_.stamp(this)]=this,_.Anim._startTimer(),this.fire("start")},_pause:function(){this._set(s,null),this._set(n,!0),delete u[_.stamp(this)],this.fire("pause")},_resume:function(){this._set(n,!1),(u[_.stamp(this)]=this)._set(s,new Date-this.get(r)),_.Anim._startTimer(),this.fire("resume")},_end:function(t){var e=1e3*this.get("duration");t&&this._runAttrs(e,e,this.get(a)),this._set(s,null),this._set(r,0),this._set(n,!1),delete u[_.stamp(this)],this.fire("end",{elapsed:this.get(r)})},_runFrame:function(){var t=this._runtimeAttr.duration,e=new Date-this.get(s),i=this.get(a),n=t<=e;this._runAttrs(e,t,i),this._actualFrames+=1,this._set(r,e),this.fire("tween"),n&&this._lastFrame()},_runAttrs:function(t,e,i){var n,s,r=this._runtimeAttr,a=_.Anim.behaviors,o=r.easing,u=e,m=e<=t?!0:!1;for(s in i&&(t=e-t,u=0),r)r[s].to&&(n=r[s],(s in a&&"set"in a[s]?a[s].set:_.Anim.DEFAULT_SETTER)(this,s,n.from,n.to,m?u:t,e,o,n.unit))},_lastFrame:function(){var t=this.get("iterations"),e=this.get(o);e+=1,"infinite"===t||e<t?("alternate"===this.get("direction")&&this.set(a,!this.get(a)),this.fire("iteration")):(e=0,this._end()),this._set(s,new Date),this._set(o,e)},_initAnimAttr:function(){var s,r,a,o=this.get("from")||{},t=this.get("to")||{},u={duration:1e3*this.get("duration"),easing:this.get("easing")},m=_.Anim.behaviors,h=this.get("node");_.each(t,function(t,e){"function"==typeof t&&(t=t.call(this,h)),(r=o[e])===undefined?r=e in m&&"get"in m[e]?m[e].get(this,e):_.Anim.DEFAULT_GETTER(this,e):"function"==typeof r&&(r=r.call(this,h));var i=_.Anim.RE_UNITS.exec(r),n=_.Anim.RE_UNITS.exec(t);r=i?i[1]:r,a=n?n[1]:t,!(s=n?n[2]:i?i[2]:"")&&_.Anim.RE_DEFAULT_UNIT.test(e)&&(s=_.Anim.DEFAULT_UNIT),r&&a?u[e]={from:_.Lang.isObject(r)?_.clone(r):r,to:a,unit:s}:_.error('invalid "from" or "to" for "'+e+'"',"Anim")},this),this._runtimeAttr=u},_getOffset:function(t){var e,i=this._node,n=i.getComputedStyle(t),s="left"===t?"getX":"getY",t="left"===t?"setX":"setY";return"auto"===n&&("absolute"===(e=i.getStyle("position"))||"fixed"===e?(n=i[s](),i[t](n)):n=0),n},destructor:function(){delete _.Anim._instances[_.stamp(this)]}})},"patched-v3.18.7",{requires:["base-base","node-style","color-base"]});