﻿//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.Animations');ESRI.ADF.Animations.ParallelAnimation = function(target, duration, fps, animations) {
ESRI.ADF.Animations.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]);}
ESRI.ADF.Animations.ParallelAnimation.prototype = {
_onTimerTick : function() {
ESRI.ADF.Animations.ParallelAnimation.callBaseMethod(this, '_onTimerTick');var handler = this.get_events().getHandler('tick');if (handler) { handler(this);}
},
add_tick : function(handler) {
this.get_events().addHandler('tick', handler);},
remove_tick : function(handler) { this.get_events().removeHandler('tick', handler);}
}
ESRI.ADF.Animations.ParallelAnimation.registerClass('ESRI.ADF.Animations.ParallelAnimation', AjaxControlToolkit.Animation.ParallelAnimation);ESRI.ADF.Animations.ZoomAnimation = function(target, duration, fps, scaleFactor, centerX, centerY) {
ESRI.ADF.Animations.ZoomAnimation.initializeBase(this, [target, duration, fps]);this._scaleFactor = (scaleFactor !== undefined) ? scaleFactor : 1;if(centerX!=null && centerX!=undefined) this._centerX = centerX;else this._centerX = parseInt(target.offsetWidth)*0.5;if(centerY!=null && centerY!=undefined) this._centerY = centerY;else this._centerY = parseInt(target.offsetHeight)*0.5;this._unit = 'px';this._element = null;this._initialHeight = null;this._initialWidth = null;this._initialTop = null;this._initialLeft = null;this._initialFontSize = null;}
ESRI.ADF.Animations.ZoomAnimation.prototype = {
getAnimatedValue : function(percentage) {
return this.interpolate(1.0, this._scaleFactor, percentage);},
onStart : function() {
ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'onStart');this._element = this.get_target();if (this._element) {
this._initialHeight = parseInt(this._element.offsetHeight);this._initialWidth = parseInt(this._element.offsetWidth);this._initialTop = parseInt(this._element.offsetTop);this._initialLeft = parseInt(this._element.offsetLeft);}
},
play : function() {
ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'play');this._timer.add_tick(this.raiseTick);},
setValue : function(scale) {
if (this._element) {
var width = Math.round(this._initialWidth * scale);var height = Math.round(this._initialHeight * scale);var style = this._element.style;style.width = width+1 + this._unit;style.height = height+1 + this._unit;style.left = this._centerX - Math.round((this._centerX-this._initialLeft)*scale) + this._unit;style.top = this._centerY - Math.round((this._centerY-this._initialTop)*scale) + this._unit;}
}, 
onEnd : function() {
this._element = null;this._initialHeight = null;this._initialWidth = null;this._initialTop = null;this._initialLeft = null;ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'onEnd');},
get_scaleFactor : function() {
return this._scaleFactor;},
set_scaleFactor : function(value) {
this._scaleFactor = value;},
get_centerX : function() {
return this._centerX;},
set_centerX : function(value) {
this._centerX = value;},
get_centerY : function() {
return this._centerY;},
set_centerY : function(value) {
this._centerY = value;}
}
ESRI.ADF.Animations.ZoomAnimation.registerClass('ESRI.ADF.Animations.ZoomAnimation', AjaxControlToolkit.Animation.Animation);AjaxControlToolkit.Animation.registerAnimation('scale', ESRI.ADF.Animations.ZoomAnimation);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();