﻿Type.registerNamespace("Sys.Extended.UI.Animation"),$AA=Sys.Extended.UI.Animation,$AA.registerAnimation=function(t,i){if(!i||!(i===$AA.Animation||i.inheritsFrom&&i.inheritsFrom($AA.Animation)))throw Error.argumentType("type",i,$AA.Animation,Sys.Extended.UI.Resources.Animation_InvalidBaseType);$AA.__animations||($AA.__animations={}),$AA.__animations[t.toLowerCase()]=i,i.play=function(){var t=new i;i.apply(t,arguments),t.initialize();var e=Function.createDelegate(t,function(){t.remove_ended(e),e=null,t.dispose()});t.add_ended(e),t.play()}},$AA.buildAnimation=function(t,i){if(!t||""===t)return null;var e;if(t="("+t+")",Sys.Debug.isDebug)e=Sys.Serialization.JavaScriptSerializer.deserialize(t);else try{e=Sys.Serialization.JavaScriptSerializer.deserialize(t)}catch(t){}return $AA.createAnimation(e,i)},$AA.createAnimation=function(t,i){if(!t||!t.AnimationName)throw Error.argument("obj",Sys.Extended.UI.Resources.Animation_MissingAnimationName);var e=$AA.__animations[t.AnimationName.toLowerCase()];if(!e)throw Error.argument("type",String.format(Sys.Extended.UI.Resources.Animation_UknownAnimationName,t.AnimationName));var n=new e;if(i&&n.set_target(i),t.AnimationChildren&&t.AnimationChildren.length){if(!$AA.ParentAnimation.isInstanceOfType(n))throw Error.argument("obj",String.format(Sys.Extended.UI.Resources.Animation_ChildrenNotAllowed,e.getName()));for(var a=0;a<t.AnimationChildren.length;a++){var s=$AA.createAnimation(t.AnimationChildren[a]);s&&n.add(s)}}var o=e.__animationProperties;if(!o){e.__animationProperties={},e.resolveInheritance();for(var r in e.prototype)r.startsWith("set_")&&(e.__animationProperties[r.substr(4).toLowerCase()]=r);delete e.__animationProperties.id,o=e.__animationProperties}for(var h in t){var A=h.toLowerCase();if("animationname"!=A&&"animationchildren"!=A){var l=t[h],_=o[A];if(_&&String.isInstanceOfType(_)&&n[_])if(Sys.Debug.isDebug)n[_](l);else try{n[_](l)}catch(t){}else if(A.endsWith("script")){if(_=o[A.substr(0,h.length-6)],_&&String.isInstanceOfType(_)&&n[_])n.DynamicProperties[_]=l;else if(Sys.Debug.isDebug)throw Error.argument("obj",String.format(Sys.Extended.UI.Resources.Animation_NoDynamicPropertyFound,h,h.substr(0,h.length-5)))}else if(Sys.Debug.isDebug)throw Error.argument("obj",String.format(Sys.Extended.UI.Resources.Animation_NoPropertyFound,h))}}return n},$AA.Animation=function(t,i,e){$AA.Animation.initializeBase(this),this._duration=1,this._fps=25,this._target=null,this._tickHandler=null,this._timer=null,this._percentComplete=0,this._percentDelta=null,this._owner=null,this._parentAnimation=null,this.DynamicProperties={},t&&this.set_target(t),i&&this.set_duration(i),e&&this.set_fps(e)},$AA.Animation.prototype={dispose:function(){this._timer&&(this._timer.dispose(),this._timer=null),this._tickHandler=null,this._target=null,$AA.Animation.callBaseMethod(this,"dispose")},play:function(){if(!this._owner){var t=!0;this._timer||(t=!1,this._tickHandler||(this._tickHandler=Function.createDelegate(this,this._onTimerTick)),this._timer=new Sys.Timer,this._timer.add_tick(this._tickHandler),this.onStart(),this._timer.set_interval(1e3/this._fps),this._percentDelta=100/(this._duration*this._fps),this._updatePercentComplete(0,!0)),this._timer.set_enabled(!0),this.raisePropertyChanged("isPlaying"),t||this.raisePropertyChanged("isActive")}},pause:function(){this._owner||this._timer&&(this._timer.set_enabled(!1),this.raisePropertyChanged("isPlaying"))},stop:function(t){if(!this._owner){var i=this._timer;this._timer=null,i&&(i.dispose(),100!==this._percentComplete&&(this._percentComplete=100,this.raisePropertyChanged("percentComplete"),(t||void 0===t)&&this.onStep(100)),this.onEnd(),this.raisePropertyChanged("isPlaying"),this.raisePropertyChanged("isActive"))}},onStart:function(){this.raise_started();for(var property in this.DynamicProperties)try{this[property](eval(this.DynamicProperties[property]))}catch(t){if(Sys.Debug.isDebug)throw t}},onStep:function(t){this.setValue(this.getAnimatedValue(t)),this.raise_step()},onEnd:function(){this.raise_ended()},getAnimatedValue:function(t){throw Error.notImplemented()},setValue:function(t){throw Error.notImplemented()},interpolate:function(t,i,e){return t+(i-t)*(e/100)},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,!0)},_updatePercentComplete:function(t,i){t>100&&(t=100),this._percentComplete=t,this.raisePropertyChanged("percentComplete"),i&&this.onStep(t),100===t&&this.stop(!1)},setOwner:function(t){this._owner=t},add_started:function(t){this.get_events().addHandler("started",t)},remove_started:function(t){this.get_events().removeHandler("started",t)},raise_started:function(){var t=this.get_events().getHandler("started");t&&t(this,Sys.EventArgs.Empty)},raiseStarted:function(){Sys.Extended.Deprecated("raiseStarted()","raise_started()"),this.raise_started()},add_ended:function(t){this.get_events().addHandler("ended",t)},remove_ended:function(t){this.get_events().removeHandler("ended",t)},raise_ended:function(){var t=this.get_events().getHandler("ended");t&&t(this,Sys.EventArgs.Empty)},raiseEnded:function(){Sys.Extended.Deprecated("raiseEnded()","raise_ended()"),this.raise_ended()},add_step:function(t){this.get_events().addHandler("step",t)},remove_step:function(t){this.get_events().removeHandler("step",t)},raise_step:function(){var t=this.get_events().getHandler("step");t&&t(this,Sys.EventArgs.Empty)},raiseStep:function(){Sys.Extended.Deprecated("raiseStep()","raise_step()"),this.raise_ended()},get_target:function(){return!this._target&&this._parentAnimation?this._parentAnimation.get_target():this._target},set_target:function(t){this._target!=t&&(this._target=t,this.raisePropertyChanged("target"))},setAnimationTarget:function(t){var i=null,e=$get(t);if(e)i=e;else{var n=$find(t);n&&(e=n.get_element(),e&&(i=e))}if(!i)throw Error.argument("id",String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound,t));this.set_target(i)},set_animationTarget:function(t){Sys.Extended.Deprecated("setAnimationTarget(id)","set_animationTarget(id)"),this.setAnimationTarget(t)},get_duration:function(){return this._duration},set_duration:function(t){t=this._getFloat(t),this._duration!=t&&(this._duration=t,this.raisePropertyChanged("duration"))},get_fps:function(){return this._fps},set_fps:function(t){t=this._getInteger(t),this.fps!=t&&(this._fps=t,this.raisePropertyChanged("fps"))},get_isActive:function(){return null!==this._timer},get_isPlaying:function(){return null!==this._timer&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(t){return String.isInstanceOfType(t)?Boolean.parse(t):t},_getInteger:function(t){return String.isInstanceOfType(t)?parseInt(t):t},_getFloat:function(t){return String.isInstanceOfType(t)?parseFloat(t):t},_getEnum:function(t,i){return String.isInstanceOfType(t)&&i&&i.parse?i.parse(t):t}},$AA.Animation.registerClass("Sys.Extended.UI.Animation.Animation",Sys.Component),$AA.registerAnimation("animation",$AA.Animation),$AA.ParentAnimation=function(t,i,e,n){if($AA.ParentAnimation.initializeBase(this,[t,i,e]),this._animations=[],n&&n.length)for(var a=0;a<n.length;a++)this.add(n[a])},$AA.ParentAnimation.prototype={initialize:function(){if($AA.ParentAnimation.callBaseMethod(this,"initialize"),this._animations)for(var t=0;t<this._animations.length;t++){var i=this._animations[t];i&&!i.get_isInitialized&&i.initialize()}},dispose:function(){this.clear(),this._animations=null,$AA.ParentAnimation.callBaseMethod(this,"dispose")},get_animations:function(){return this._animations},add:function(t){this._animations&&(t&&(t._parentAnimation=this),Array.add(this._animations,t),this.raisePropertyChanged("animations"))},remove:function(t){this._animations&&(t&&t.dispose(),Array.remove(this._animations,t),this.raisePropertyChanged("animations"))},removeAt:function(t){if(this._animations){var i=this._animations[t];i&&i.dispose(),Array.removeAt(this._animations,t),this.raisePropertyChanged("animations")}},clear:function(){if(this._animations){for(var t=this._animations.length-1;t>=0;t--)this._animations[t].dispose(),this._animations[t]=null;Array.clear(this._animations),this._animations=[],this.raisePropertyChanged("animations")}}},$AA.ParentAnimation.registerClass("Sys.Extended.UI.Animation.ParentAnimation",$AA.Animation),$AA.registerAnimation("parent",$AA.ParentAnimation),$AA.ParallelAnimation=function(t,i,e,n){$AA.ParallelAnimation.initializeBase(this,[t,i,e,n])},$AA.ParallelAnimation.prototype={add:function(t){$AA.ParallelAnimation.callBaseMethod(this,"add",[t]),t.setOwner(this)},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,"onStart");for(var t=this.get_animations(),i=0;i<t.length;i++)t[i].onStart()},onStep:function(t){for(var i=this.get_animations(),e=0;e<i.length;e++)i[e].onStep(t)},onEnd:function(){for(var t=this.get_animations(),i=0;i<t.length;i++)t[i].onEnd();$AA.ParallelAnimation.callBaseMethod(this,"onEnd")}},$AA.ParallelAnimation.registerClass("Sys.Extended.UI.Animation.ParallelAnimation",$AA.ParentAnimation),$AA.registerAnimation("parallel",$AA.ParallelAnimation),$AA.SequenceAnimation=function(t,i,e,n,a){$AA.SequenceAnimation.initializeBase(this,[t,i,e,n]),this._handler=null,this._paused=!1,this._playing=!1,this._index=0,this._remainingIterations=0,this._iterations=void 0!==a?a:1},$AA.SequenceAnimation.prototype={dispose:function(){this._handler=null,$AA.SequenceAnimation.callBaseMethod(this,"dispose")},stop:function(){if(this._playing){var t=this.get_animations();if(this._index<t.length){t[this._index].remove_ended(this._handler);for(var i=this._index;i<t.length;i++)t[i].stop()}this._playing=!1,this._paused=!1,this.raisePropertyChanged("isPlaying"),this.onEnd()}},pause:function(){if(this.get_isPlaying()){var t=this.get_animations()[this._index];null!=t&&t.pause(),this._paused=!0,this.raisePropertyChanged("isPlaying")}},play:function(){var t=this.get_animations();if(!this._playing)if(this._playing=!0,this._paused){this._paused=!1;var i=t[this._index];null!=i&&(i.play(),this.raisePropertyChanged("isPlaying"))}else{this.onStart(),this._index=0;var e=t[this._index];e?(e.add_ended(this._handler),e.play(),this.raisePropertyChanged("isPlaying")):this.stop()}},onStart:function(){$AA.SequenceAnimation.callBaseMethod(this,"onStart"),this._remainingIterations=this._iterations-1,this._handler||(this._handler=Function.createDelegate(this,this._onEndAnimation))},_onEndAnimation:function(){var t=this.get_animations(),i=t[this._index++];if(i&&i.remove_ended(this._handler),this._index<t.length){var e=t[this._index];e.add_ended(this._handler),e.play()}else if(this._remainingIterations>=1||this._iterations<=0){this._remainingIterations--,this._index=0;var n=t[0];n.add_ended(this._handler),n.play()}else this.stop()},onStep:function(t){throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence)},onEnd:function(){this._remainingIterations=0,$AA.SequenceAnimation.callBaseMethod(this,"onEnd")},get_isActive:function(){return!0},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(t){t=this._getInteger(t),this._iterations!=t&&(this._iterations=t,this.raisePropertyChanged("iterations"))},get_isInfinite:function(){return this._iterations<=0}},$AA.SequenceAnimation.registerClass("Sys.Extended.UI.Animation.SequenceAnimation",$AA.ParentAnimation),$AA.registerAnimation("sequence",$AA.SequenceAnimation),$AA.SelectionAnimation=function(t,i,e,n){$AA.SelectionAnimation.initializeBase(this,[t,i,e,n]),this._selectedIndex=-1,this._selected=null},$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented()},onStart:function(){$AA.SelectionAnimation.callBaseMethod(this,"onStart");var t=this.get_animations();this._selectedIndex=this.getSelectedIndex(),this._selectedIndex>=0&&this._selectedIndex<t.length&&(this._selected=t[this._selectedIndex],this._selected&&(this._selected.setOwner(this),this._selected.onStart()))},onStep:function(t){this._selected&&this._selected.onStep(t)},onEnd:function(){this._selected&&(this._selected.onEnd(),this._selected.setOwner(null)),this._selected=null,this._selectedIndex=null,$AA.SelectionAnimation.callBaseMethod(this,"onEnd")}},$AA.SelectionAnimation.registerClass("Sys.Extended.UI.Animation.SelectionAnimation",$AA.ParentAnimation),$AA.registerAnimation("selection",$AA.SelectionAnimation),$AA.ConditionAnimation=function(t,i,e,n,a){$AA.ConditionAnimation.initializeBase(this,[t,i,e,n]),this._conditionScript=a},$AA.ConditionAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._conditionScript&&this._conditionScript.length>0)try{selected=eval(this._conditionScript)?0:1}catch(t){}return selected},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(t){this._conditionScript!=t&&(this._conditionScript=t,this.raisePropertyChanged("conditionScript"))}},$AA.ConditionAnimation.registerClass("Sys.Extended.UI.Animation.ConditionAnimation",$AA.SelectionAnimation),$AA.registerAnimation("condition",$AA.ConditionAnimation),$AA.CaseAnimation=function(t,i,e,n,a){$AA.CaseAnimation.initializeBase(this,[t,i,e,n]),this._selectScript=a},$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._selectScript&&this._selectScript.length>0)try{var result=eval(this._selectScript);void 0!==result&&(selected=result)}catch(t){}return selected},get_selectScript:function(){return this._selectScript},set_selectScript:function(t){this._selectScript!=t&&(this._selectScript=t,this.raisePropertyChanged("selectScript"))}},$AA.CaseAnimation.registerClass("Sys.Extended.UI.Animation.CaseAnimation",$AA.SelectionAnimation),$AA.registerAnimation("case",$AA.CaseAnimation),$AA.FadeEffect=function(){throw Error.invalidOperation()},$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1},$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect",!1),$AA.FadeAnimation=function(t,i,e,n,a,s,o){$AA.FadeAnimation.initializeBase(this,[t,i,e]),this._effect=void 0!==n?n:$AA.FadeEffect.FadeIn,this._max=void 0!==s?s:1,this._min=void 0!==a?a:0,this._start=this._min,this._end=this._max,this._layoutCreated=!1,this._forceLayoutInIE=void 0===o||null===o||o,this._currentTarget=null,this._resetOpacities()},$AA.FadeAnimation.prototype={_resetOpacities:function(){this._effect==$AA.FadeEffect.FadeIn?(this._start=this._min,this._end=this._max):(this._start=this._max,this._end=this._min)},_createLayout:function(){var t=this._currentTarget;if(t){this._originalWidth=$common.getCurrentStyle(t,"width");var i=$common.getCurrentStyle(t,"height");this._originalBackColor=$common.getCurrentStyle(t,"backgroundColor"),this._originalWidth&&""!=this._originalWidth&&"auto"!=this._originalWidth||i&&""!=i&&"auto"!=i||(t.style.width=t.offsetWidth+"px"),this._originalBackColor&&""!=this._originalBackColor&&"transparent"!=this._originalBackColor&&"rgba(0, 0, 0, 0)"!=this._originalBackColor||(t.style.backgroundColor=$common.getInheritedBackgroundColor(t)),this._layoutCreated=!0}},onStart:function(){$AA.FadeAnimation.callBaseMethod(this,"onStart"),this._currentTarget=this.get_target(),this.setValue(this._start),this._forceLayoutInIE&&!this._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer&&this._createLayout()},getAnimatedValue:function(t){return this.interpolate(this._start,this._end,t)},setValue:function(t){this._currentTarget&&$common.setElementOpacity(this._currentTarget,t)},get_effect:function(){return this._effect},set_effect:function(t){t=this._getEnum(t,$AA.FadeEffect),this._effect!=t&&(this._effect=t,this._resetOpacities(),this.raisePropertyChanged("effect"))},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(t){t=this._getFloat(t),this._min!=t&&(this._min=t,this._resetOpacities(),this.raisePropertyChanged("minimumOpacity"))},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(t){t=this._getFloat(t),this._max!=t&&(this._max=t,this._resetOpacities(),this.raisePropertyChanged("maximumOpacity"))},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(t){t=this._getBoolean(t),this._forceLayoutInIE!=t&&(this._forceLayoutInIE=t,this.raisePropertyChanged("forceLayoutInIE"))},setStartValue:function(t){t=this._getFloat(t),this._start=t},set_startValue:function(t){Sys.Extended.Deprecated("setStartValue(value)","set_startValue(value)"),this.setStartValue(t)}},$AA.FadeAnimation.registerClass("Sys.Extended.UI.Animation.FadeAnimation",$AA.Animation),$AA.registerAnimation("fade",$AA.FadeAnimation),$AA.FadeInAnimation=function(t,i,e,n,a,s){$AA.FadeInAnimation.initializeBase(this,[t,i,e,$AA.FadeEffect.FadeIn,n,a,s])},$AA.FadeInAnimation.prototype={onStart:function(){$AA.FadeInAnimation.callBaseMethod(this,"onStart"),this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}},$AA.FadeInAnimation.registerClass("Sys.Extended.UI.Animation.FadeInAnimation",$AA.FadeAnimation),$AA.registerAnimation("fadeIn",$AA.FadeInAnimation),$AA.FadeOutAnimation=function(t,i,e,n,a,s){$AA.FadeOutAnimation.initializeBase(this,[t,i,e,$AA.FadeEffect.FadeOut,n,a,s])},$AA.FadeOutAnimation.prototype={onStart:function(){$AA.FadeOutAnimation.callBaseMethod(this,"onStart"),this._currentTarget&&this.set_startValue($common.getElementOpacity(this._currentTarget))}},$AA.FadeOutAnimation.registerClass("Sys.Extended.UI.Animation.FadeOutAnimation",$AA.FadeAnimation),$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation),$AA.PulseAnimation=function(t,i,e,n,a,s,o){$AA.PulseAnimation.initializeBase(this,[t,i,e,null,void 0!==n?n:3]),this._out=new $AA.FadeOutAnimation(t,i,e,a,s,o),this.add(this._out),this._in=new $AA.FadeInAnimation(t,i,e,a,s,o),this.add(this._in)},$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(t){t=this._getFloat(t),this._out.set_minimumOpacity(t),this._in.set_minimumOpacity(t),this.raisePropertyChanged("minimumOpacity")},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(t){t=this._getFloat(t),this._out.set_maximumOpacity(t),this._in.set_maximumOpacity(t),this.raisePropertyChanged("maximumOpacity")},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(t){t=this._getBoolean(t),this._out.set_forceLayoutInIE(t),this._in.set_forceLayoutInIE(t),this.raisePropertyChanged("forceLayoutInIE")},setDuration:function(t){t=this._getFloat(t),$AA.PulseAnimation.callBaseMethod(this,"set_duration",[t]),this._in.set_duration(t),this._out.set_duration(t)},set_duration:function(t){Sys.Extended.Deprecated("setDuration(value)","set_duration(value)"),this.setDuration(t)},setFps:function(t){t=this._getInteger(t),$AA.PulseAnimation.callBaseMethod(this,"set_fps",[t]),this._in.set_fps(t),this._out.set_fps(t)},set_fps:function(t){Sys.Extended.Deprecated("setFps(value)","set_fps(value)"),this.setFps(t)}},$AA.PulseAnimation.registerClass("Sys.Extended.UI.Animation.PulseAnimation",$AA.SequenceAnimation),$AA.registerAnimation("pulse",$AA.PulseAnimation),$AA.PropertyAnimation=function(t,i,e,n,a){$AA.PropertyAnimation.initializeBase(this,[t,i,e]),this._property=n,this._propertyKey=a,this._currentTarget=null},$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart"),this._currentTarget=this.get_target()},setValue:function(t){var i=this._currentTarget;i&&this._property&&this._property.length>0&&(this._propertyKey&&this._propertyKey.length>0&&i[this._property]?i[this._property][this._propertyKey]=t:i[this._property]=t)},getValue:function(){var t=this.get_target();if(t&&this._property&&this._property.length>0){var i=t[this._property];if(i)return this._propertyKey&&this._propertyKey.length>0?i[this._propertyKey]:i}return null},get_property:function(){return this._property},set_property:function(t){this._property!=t&&(this._property=t,this.raisePropertyChanged("property"))},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(t){this._propertyKey!=t&&(this._propertyKey=t,this.raisePropertyChanged("propertyKey"))}},$AA.PropertyAnimation.registerClass("Sys.Extended.UI.Animation.PropertyAnimation",$AA.Animation),$AA.registerAnimation("property",$AA.PropertyAnimation),$AA.DiscreteAnimation=function(t,i,e,n,a,s){$AA.DiscreteAnimation.initializeBase(this,[t,i,e,n,a]),this._values=s&&s.length?s:[]},$AA.DiscreteAnimation.prototype={getAnimatedValue:function(t){var i=Math.floor(this.interpolate(0,this._values.length-1,t));return this._values[i]},get_values:function(){return this._values},set_values:function(t){this._values!=t&&(this._values=t,this.raisePropertyChanged("values"))}},$AA.DiscreteAnimation.registerClass("Sys.Extended.UI.Animation.DiscreteAnimation",$AA.PropertyAnimation),$AA.registerAnimation("discrete",$AA.DiscreteAnimation),$AA.InterpolatedAnimation=function(t,i,e,n,a,s,o){$AA.InterpolatedAnimation.initializeBase(this,[t,i,e,void 0!==n?n:"style",a]),this._startValue=s,this._endValue=o},$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(t){t=this._getFloat(t),this._startValue!=t&&(this._startValue=t,this.raisePropertyChanged("startValue"))},get_endValue:function(){return this._endValue},set_endValue:function(t){t=this._getFloat(t),this._endValue!=t&&(this._endValue=t,this.raisePropertyChanged("endValue"))}},$AA.InterpolatedAnimation.registerClass("Sys.Extended.UI.Animation.InterpolatedAnimation",$AA.PropertyAnimation),$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation),$AA.ColorAnimation=function(t,i,e,n,a,s,o){$AA.ColorAnimation.initializeBase(this,[t,i,e,n,a,s,o]),this._start=null,this._end=null,this._interpolateRed=!1,this._interpolateGreen=!1,this._interpolateBlue=!1},$AA.ColorAnimation.prototype={onStart:function(){$AA.ColorAnimation.callBaseMethod(this,"onStart"),this._start=$AA.ColorAnimation.getRGB(this.get_startValue()),this._end=$AA.ColorAnimation.getRGB(this.get_endValue()),this._interpolateRed=this._start.Red!=this._end.Red,this._interpolateGreen=this._start.Green!=this._end.Green,this._interpolateBlue=this._start.Blue!=this._end.Blue},getAnimatedValue:function(t){var i=this._start.Red,e=this._start.Green,n=this._start.Blue;return this._interpolateRed&&(i=Math.round(this.interpolate(i,this._end.Red,t))),this._interpolateGreen&&(e=Math.round(this.interpolate(e,this._end.Green,t))),this._interpolateBlue&&(n=Math.round(this.interpolate(n,this._end.Blue,t))),$AA.ColorAnimation.toColor(i,e,n)},set_startValue:function(t){this._startValue!=t&&(this._startValue=t,this.raisePropertyChanged("startValue"))},set_endValue:function(t){this._endValue!=t&&(this._endValue=t,this.raisePropertyChanged("endValue"))}},$AA.ColorAnimation.getRGB=function(t){if(!t||7!=t.length)throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor,t);return{Red:parseInt(t.substr(1,2),16),Green:parseInt(t.substr(3,2),16),Blue:parseInt(t.substr(5,2),16)}},$AA.ColorAnimation.toColor=function(t,i,e){var n=t.toString(16),a=i.toString(16),s=e.toString(16);return 1==n.length&&(n="0"+n),1==a.length&&(a="0"+a),1==s.length&&(s="0"+s),"#"+n+a+s},$AA.ColorAnimation.registerClass("Sys.Extended.UI.Animation.ColorAnimation",$AA.InterpolatedAnimation),$AA.registerAnimation("color",$AA.ColorAnimation),$AA.LengthAnimation=function(t,i,e,n,a,s,o,r){$AA.LengthAnimation.initializeBase(this,[t,i,e,n,a,s,o]),this._unit=null!=r?r:"px"},$AA.LengthAnimation.prototype={getAnimatedValue:function(t){var i=this.interpolate(this.get_startValue(),this.get_endValue(),t);return Math.round(i)+this._unit},get_unit:function(){return this._unit},set_unit:function(t){this._unit!=t&&(this._unit=t,this.raisePropertyChanged("unit"))}},$AA.LengthAnimation.registerClass("Sys.Extended.UI.Animation.LengthAnimation",$AA.InterpolatedAnimation),$AA.registerAnimation("length",$AA.LengthAnimation),$AA.MoveAnimation=function(t,i,e,n,a,s,o){$AA.MoveAnimation.initializeBase(this,[t,i,e,null]),this._horizontal=n?n:0,this._vertical=a?a:0,this._relative=void 0===s||s,this._horizontalAnimation=new $AA.LengthAnimation(t,i,e,"style","left",null,null,o),this._verticalAnimation=new $AA.LengthAnimation(t,i,e,"style","top",null,null,o),this.add(this._verticalAnimation),this.add(this._horizontalAnimation)},$AA.MoveAnimation.prototype={onStart:function(){$AA.MoveAnimation.callBaseMethod(this,"onStart");var t=this.get_target();this._horizontalAnimation.set_startValue(t.offsetLeft),this._horizontalAnimation.set_endValue(this._relative?t.offsetLeft+this._horizontal:this._horizontal),this._verticalAnimation.set_startValue(t.offsetTop),this._verticalAnimation.set_endValue(this._relative?t.offsetTop+this._vertical:this._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(t){t=this._getFloat(t),this._horizontal!=t&&(this._horizontal=t,this.raisePropertyChanged("horizontal"))},get_vertical:function(){return this._vertical},set_vertical:function(t){t=this._getFloat(t),this._vertical!=t&&(this._vertical=t,this.raisePropertyChanged("vertical"))},get_relative:function(){return this._relative},set_relative:function(t){t=this._getBoolean(t),this._relative!=t&&(this._relative=t,this.raisePropertyChanged("relative"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(t){var i=this._horizontalAnimation.get_unit();i!=t&&(this._horizontalAnimation.set_unit(t),this._verticalAnimation.set_unit(t),this.raisePropertyChanged("unit"))}},$AA.MoveAnimation.registerClass("Sys.Extended.UI.Animation.MoveAnimation",$AA.ParallelAnimation),$AA.registerAnimation("move",$AA.MoveAnimation),$AA.ResizeAnimation=function(t,i,e,n,a,s){$AA.ResizeAnimation.initializeBase(this,[t,i,e,null]),this._width=n,this._height=a,this._horizontalAnimation=new $AA.LengthAnimation(t,i,e,"style","width",null,null,s),this._verticalAnimation=new $AA.LengthAnimation(t,i,e,"style","height",null,null,s),this.add(this._horizontalAnimation),this.add(this._verticalAnimation)},$AA.ResizeAnimation.prototype={onStart:function(){$AA.ResizeAnimation.callBaseMethod(this,"onStart");var t=this.get_target();this._horizontalAnimation.set_startValue(t.offsetWidth),this._verticalAnimation.set_startValue(t.offsetHeight),this._horizontalAnimation.set_endValue(null!==this._width&&void 0!==this._width?this._width:t.offsetWidth),this._verticalAnimation.set_endValue(null!==this._height&&void 0!==this._height?this._height:t.offsetHeight)},get_width:function(){return this._width},set_width:function(t){t=this._getFloat(t),this._width!=t&&(this._width=t,this.raisePropertyChanged("width"))},get_height:function(){return this._height},set_height:function(t){t=this._getFloat(t),this._height!=t&&(this._height=t,this.raisePropertyChanged("height"))},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(t){var i=this._horizontalAnimation.get_unit();i!=t&&(this._horizontalAnimation.set_unit(t),this._verticalAnimation.set_unit(t),this.raisePropertyChanged("unit"))}},$AA.ResizeAnimation.registerClass("Sys.Extended.UI.Animation.ResizeAnimation",$AA.ParallelAnimation),$AA.registerAnimation("resize",$AA.ResizeAnimation),$AA.ScaleAnimation=function(t,i,e,n,a,s,o,r){$AA.ScaleAnimation.initializeBase(this,[t,i,e]),this._scaleFactor=void 0!==n?n:1,this._unit=void 0!==a?a:"px",this._center=s,this._scaleFont=o,this._fontUnit=void 0!==r?r:"pt",this._element=null,this._initialHeight=null,this._initialWidth=null,this._initialTop=null,this._initialLeft=null,this._initialFontSize=null},$AA.ScaleAnimation.prototype={getAnimatedValue:function(t){return this.interpolate(1,this._scaleFactor,t)},onStart:function(){$AA.ScaleAnimation.callBaseMethod(this,"onStart"),this._element=this.get_target(),this._element&&(this._initialHeight=this._element.offsetHeight,this._initialWidth=this._element.offsetWidth,this._center&&(this._initialTop=this._element.offsetTop,this._initialLeft=this._element.offsetLeft),this._scaleFont&&(this._initialFontSize=parseFloat($common.getCurrentStyle(this._element,"fontSize"))))},setValue:function(t){if(this._element){var i=Math.round(this._initialWidth*t),e=Math.round(this._initialHeight*t);if(this._element.style.width=i+this._unit,this._element.style.height=e+this._unit,this._center&&(this._element.style.top=this._initialTop+Math.round((this._initialHeight-e)/2)+this._unit,this._element.style.left=this._initialLeft+Math.round((this._initialWidth-i)/2)+this._unit),this._scaleFont){var n=this._initialFontSize*t;"px"!=this._fontUnit&&"pt"!=this._fontUnit||(n=Math.round(n)),this._element.style.fontSize=n+this._fontUnit}}},onEnd:function(){this._element=null,this._initialHeight=null,this._initialWidth=null,this._initialTop=null,this._initialLeft=null,this._initialFontSize=null,$AA.ScaleAnimation.callBaseMethod(this,"onEnd")},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(t){t=this._getFloat(t),this._scaleFactor!=t&&(this._scaleFactor=t,this.raisePropertyChanged("scaleFactor"))},get_unit:function(){return this._unit},set_unit:function(t){this._unit!=t&&(this._unit=t,this.raisePropertyChanged("unit"))},get_center:function(){return this._center},set_center:function(t){t=this._getBoolean(t),this._center!=t&&(this._center=t,this.raisePropertyChanged("center"))},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(t){t=this._getBoolean(t),this._scaleFont!=t&&(this._scaleFont=t,this.raisePropertyChanged("scaleFont"))},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(t){this._fontUnit!=t&&(this._fontUnit=t,this.raisePropertyChanged("fontUnit"))}},$AA.ScaleAnimation.registerClass("Sys.Extended.UI.Animation.ScaleAnimation",$AA.Animation),$AA.registerAnimation("scale",$AA.ScaleAnimation),$AA.Action=function(t,i,e){$AA.Action.initializeBase(this,[t,i,e]),void 0===i&&this.set_duration(0)},$AA.Action.prototype={onEnd:function(){this.doAction(),$AA.Action.callBaseMethod(this,"onEnd")},doAction:function(){throw Error.notImplemented()},getAnimatedValue:function(){},setValue:function(){}},$AA.Action.registerClass("Sys.Extended.UI.Animation.Action",$AA.Animation),$AA.registerAnimation("action",$AA.Action),$AA.EnableAction=function(t,i,e,n){$AA.EnableAction.initializeBase(this,[t,i,e]),this._enabled=void 0===n||n},$AA.EnableAction.prototype={doAction:function(){var t=this.get_target();t&&(t.disabled=!this._enabled)},get_enabled:function(){return this._enabled},set_enabled:function(t){t=this._getBoolean(t),this._enabled!=t&&(this._enabled=t,this.raisePropertyChanged("enabled"))}},$AA.EnableAction.registerClass("Sys.Extended.UI.Animation.EnableAction",$AA.Action),$AA.registerAnimation("enableAction",$AA.EnableAction),$AA.HideAction=function(t,i,e,n){$AA.HideAction.initializeBase(this,[t,i,e]),this._visible=n},$AA.HideAction.prototype={doAction:function(){var t=this.get_target();t&&$common.setVisible(t,this._visible)},get_visible:function(){return this._visible},set_visible:function(t){this._visible!=t&&(this._visible=t,this.raisePropertyChanged("visible"))}},$AA.HideAction.registerClass("Sys.Extended.UI.Animation.HideAction",$AA.Action),$AA.registerAnimation("hideAction",$AA.HideAction),$AA.StyleAction=function(t,i,e,n,a){$AA.StyleAction.initializeBase(this,[t,i,e]),this._attribute=n,this._value=a},$AA.StyleAction.prototype={doAction:function(){var t=this.get_target();t&&(t.style[this._attribute]=this._value)},get_attribute:function(){return this._attribute},set_attribute:function(t){this._attribute!=t&&(this._attribute=t,this.raisePropertyChanged("attribute"))},get_value:function(){return this._value},set_value:function(t){this._value!=t&&(this._value=t,this.raisePropertyChanged("value"))}},$AA.StyleAction.registerClass("Sys.Extended.UI.Animation.StyleAction",$AA.Action),$AA.registerAnimation("styleAction",$AA.StyleAction),$AA.OpacityAction=function(t,i,e,n){$AA.OpacityAction.initializeBase(this,[t,i,e]),this._opacity=n},$AA.OpacityAction.prototype={doAction:function(){var t=this.get_target();
t&&$common.setElementOpacity(t,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(t){t=this._getFloat(t),this._opacity!=t&&(this._opacity=t,this.raisePropertyChanged("opacity"))}},$AA.OpacityAction.registerClass("Sys.Extended.UI.Animation.OpacityAction",$AA.Action),$AA.registerAnimation("opacityAction",$AA.OpacityAction),$AA.ScriptAction=function(t,i,e,n){$AA.ScriptAction.initializeBase(this,[t,i,e]),this._script=n},$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(t){}},get_script:function(){return this._script},set_script:function(t){this._script!=t&&(this._script=t,this.raisePropertyChanged("script"))}},$AA.ScriptAction.registerClass("Sys.Extended.UI.Animation.ScriptAction",$AA.Action),$AA.registerAnimation("scriptAction",$AA.ScriptAction);var $AA;