... AnimatedImageRotator.AnimatedImageRotatorBehavior = function(element) { ...this._fadeAnimation = null; this._timer = null; this._onImageLoadHandler = null; } AnimatedImageRotator.AnimatedImageRotatorBehavior.prototype = { initialize : function() { ... if(this._fadeAnimation == null){this._fadeAnimation = new AjaxControlToolkit.Animation.FadeAnimation( element, this._rotationInterval/20, 150, AjaxControlToolkit.Animation.FadeEffect.FadeIn, 0, 1, true); }if (element) { this._onImageLoadHandler = Function.createDelegate(this,this._onImageLoad);$addHandler(element, 'load', this._onImageLoadHandler);} ...}, dispose : function() {...var element = this.get_element(); if (element) {if (this._onImageLoadHandler) {$removeHandler(element, 'load',this._onImageLoadHandler);this._onImageLoadHandler = null;}} ... if (this._fadeAnimation) {this._fadeAnimation.dispose();this._fadeAnimation = null; } ... }, _onImageLoad: function(){ if(this._fadeAnimation) this._fadeAnimation.play(); }, ... } ...