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