﻿// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

Type.registerNamespace("Telerik.Web.UI.Animations");
Telerik.Web.UI.Animations.ShowHideAnimation=function(_1,_2,_3,_4,_5,_6){
this.controller=_1;
this._duration=(_2!=null)?_2:0.3;
this._fps=(_3!=null)?_3:50;
this._frames=_2*_3;
this._position=null!=_5?_5:32;
this._animatedElement=_4;
this._sourceElement=_6;
this._startBounds=null;
this._endBounds=null;
this._showAnimation=null;
this._hideAnimation=null;
};
Telerik.Web.UI.Animations.ShowHideAnimation.prototype={_getHorizontalPosition:function(){
return parseInt((this._position+"").charAt(1));
},_getVerticalPosition:function(){
return parseInt((this._position+"").charAt(0));
},_onBeforeShow:function(){
},_onBeforeHide:function(){
},_onAfterShow:function(){
},_onAfterHide:function(){
},onShowStart:function(){
},onHideStart:function(){
},onShowEnd:function(){
},onHideEnd:function(){
},play:function(_7){
var _8=(true==_7)?this._hideAnimation:this._showAnimation;
if(_8){
this.stop();
if(!_8.__isTelerikModified){
var _9=this;
_8.__isTelerikModified=true;
var _a=_8.onStart;
_8.onStart=function(){
if(_7){
_9.onHideStart();
}else{
_9.onShowStart();
}
if(true==_7){
_9._onBeforeHide();
}else{
_9._onBeforeShow();
}
if(_a){
_a.call(this);
}
};
var _b=_8.onEnd;
_8.onEnd=function(){
if(_b){
_b.call(this);
}
if(_9.onEnd){
_9.onEnd(_7);
}
if(true==_7){
_9._onAfterHide();
}else{
_9._onAfterShow();
}
if(_7){
_9.onHideEnd();
}else{
_9.onShowEnd();
}
};
}
_8.play();
}
this._runningAnimation=_8;
},set_startBounds:function(_c){
this._startBounds=_c;
},set_endBounds:function(_d){
this._endBounds=_d;
},dispose:function(){
this.stop();
if(this._showAnimation){
this._showAnimation.dispose();
}
if(this._hideAnimation){
this._hideAnimation.dispose();
}
},stop:function(){
if(this._runningAnimation){
this._runningAnimation.stop();
this._runningAnimation=null;
}
}};
$telerikCommon.makeCompatible(Telerik.Web.UI.Animations.ShowHideAnimation);
Telerik.Web.UI.Animations.ShowHideAnimation.registerClass("Telerik.Web.UI.Animations.ShowHideAnimation",null);
Telerik.Web.UI.Animations.ResizeAnimation=function(_e,_f,fps,_11,_12,_13){
Telerik.Web.UI.Animations.ResizeAnimation.initializeBase(this,[_e,_f,fps,_11,_12,_13]);
var _f=this._duration;
var fps=this._fps;
var _14=this._animatedElement;
var _15,_16,_17,_18,_19,_1a;
var _1b=new Telerik.Web.Animation.ResizeAnimation(_14,_f,fps,_15,_16,"px");
var _1c=new Telerik.Web.Animation.LengthAnimation(_14,_f,fps,"style","left",_19,_1a,"px");
var _1d=new Telerik.Web.Animation.LengthAnimation(_14,_f,fps,"style","top",_17,_18,"px");
var _1e=new Telerik.Web.Animation.FadeInAnimation(_14,_f,fps,0.3,0.9,false);
this._showAnimation=new Telerik.Web.Animation.ParallelAnimation(_14,_f,fps,[_1b,_1c,_1d,_1e]);
this._hideAnimation=new Telerik.Web.Animation.FadeInAnimation(this._animatedElement,this._duration,this._fps,1,0,false);
};
Telerik.Web.UI.Animations.ResizeAnimation.prototype={_configureAnimatedElement:function(){
var _1f=this._animatedElement;
_1f.style.overflow="hidden";
_1f.style.display="";
_1f.style.visibility="visible";
_1f.style.width="1px";
_1f.style.height="1px";
},_configureAnimation:function(_20){
var _21=this._showAnimation.get_animations();
var _22=_21[0];
_22.set_width(_20.width);
_22.set_height(_20.height);
var _23=_21[1];
_23.set_startValue(_20.startX);
_23.set_endValue(_20.endX);
var _24=_21[2];
_24.set_startValue(_20.startY);
_24.set_endValue(_20.endY);
},_getStartBounds:function(){
var _25=null;
if(this._startBounds){
_25=this._startBounds;
}else{
if(this._sourceElement){
_25=Telerik.Web.DomElement.getBounds(this._sourceElement);
}else{
_25=new Sys.UI.Bounds(1,1,1,1);
}
}
return _25;
},_getEndBounds:function(){
return this._endBounds;
},_modifyAnimationValues:function(_26){
var _27=this._animatedElement;
var _28=this._getStartBounds();
if(_28.width<_26.width){
_26.startX=_28.x;
_27.style.width=_28.width;
}
if(_28.height<_26.height){
_26.startY=_28.y;
_27.style.height=_28.height;
}
},_setHorizontalValues:function(_29){
var _2a=this._getHorizontalPosition();
var _2b=this._getEndBounds();
switch(_2a){
case 2:
_29.startX=_2b.x+Math.floor(_2b.width/2);
_29.endX=_2b.x;
break;
case 3:
_29.startX=_2b.x;
_29.endX=_2b.x;
break;
case 1:
_29.startX=_2b.x+_2b.width;
_29.endX=_2b.x;
}
},_setVerticalValues:function(_2c){
var _2d=this._getVerticalPosition();
var _2e=this._getEndBounds();
switch(_2d){
case 2:
_2c.startY=_2e.y+Math.floor(_2e.height/2);
_2c.endY=_2e.y;
break;
case 1:
_2c.startY=_2e.y+_2e.height;
_2c.endY=_2e.y;
break;
case 3:
_2c.startY=_2e.y;
_2c.endY=_2e.y;
}
},_setSizeValues:function(_2f){
var _30=this._endBounds;
_2f["width"]=_30.width;
_2f["height"]=_30.height;
},_onBeforeShow:function(){
var _31={};
this._setHorizontalValues(_31);
this._setVerticalValues(_31);
this._setSizeValues(_31);
this._configureAnimatedElement();
this._modifyAnimationValues(_31);
this._configureAnimation(_31);
},_onAfterShow:function(){
this._animatedElement.style.overflow="";
this._animatedElement.style.filter="";
}};
Telerik.Web.UI.Animations.ResizeAnimation.registerClass("Telerik.Web.UI.Animations.ResizeAnimation",Telerik.Web.UI.Animations.ShowHideAnimation);
Telerik.Web.UI.Animations.SlideAnimation=function(_32,_33,fps,_35,_36,_37){
Telerik.Web.UI.Animations.SlideAnimation.initializeBase(this,[_32,_33,fps,_35,_36,_37]);
};
Telerik.Web.UI.Animations.SlideAnimation.prototype={_modifyAnimationValues:function(_38){
},_configureAnimatedElement:function(){
var _39=this._animatedElement;
_39.style.overflow="hidden";
_39.style.display="";
_39.style.visibility="visible";
var _3a=this._getVerticalPosition();
if(_3a==2){
_39.style.width="1px";
}else{
_39.style.height="1px";
}
},_setHorizontalValues:function(_3b){
var _3c=this._getHorizontalPosition();
var _3d=this._getEndBounds();
switch(_3c){
case 2:
_3b.startX=_3d.x;
_3b.endX=_3d.x;
break;
case 3:
_3b.startX=_3d.x;
_3b.endX=_3d.x;
break;
case 1:
_3b.startX=_3d.x;
_3b.endX=_3d.x;
}
},_setVerticalValues:function(_3e){
var _3f=this._getVerticalPosition();
var _40=this._getEndBounds();
switch(_3f){
case 2:
_3e.startY=_40.y;
_3e.endY=_40.y;
break;
case 1:
_3e.startY=_40.y+_40.height;
_3e.endY=_40.y;
break;
case 3:
_3e.startY=_40.y;
_3e.endY=_40.y;
}
}};
Telerik.Web.UI.Animations.SlideAnimation.registerClass("Telerik.Web.UI.Animations.SlideAnimation",Telerik.Web.UI.Animations.ResizeAnimation);
Telerik.Web.UI.Animations.FlyInAnimation=function(_41,_42,fps,_44,_45,_46){
Telerik.Web.UI.Animations.FlyInAnimation.initializeBase(this,[_41,_42,fps,_44,_45,_46]);
};
Telerik.Web.UI.Animations.FlyInAnimation.prototype={_modifyAnimationValues:function(_47){
},_setHorizontalValues:function(_48){
var _49=this._getHorizontalPosition();
var _4a=this._getEndBounds();
var _4b=TelerikCommonScripts.getClientBounds();
switch(_49){
case 2:
_48.startX=_4a.x;
_48.endX=_4a.x;
break;
case 3:
_48.startX=_4b.width;
_48.endX=_4a.x;
break;
case 1:
_48.startX=_4b.x;
_48.endX=_4a.x;
}
},_setVerticalValues:function(_4c){
var _4d=this._getVerticalPosition();
var _4e=this._getEndBounds();
var _4f=TelerikCommonScripts.getClientBounds();
switch(_4d){
case 2:
_4c.startY=_4e.y;
_4c.endY=_4e.y;
break;
case 1:
_4c.startY=_4f.y-_4e.height;
_4c.endY=_4e.y;
break;
case 3:
_4c.startY=_4f.height;
_4c.endY=_4e.y;
}
}};
Telerik.Web.UI.Animations.FlyInAnimation.registerClass("Telerik.Web.UI.Animations.FlyInAnimation",Telerik.Web.UI.Animations.ResizeAnimation);
Telerik.Web.UI.Animations.FadeAnimation=function(_50,_51,fps,_53){
Telerik.Web.UI.Animations.FadeAnimation.initializeBase(this,[_50,_51,fps,_53]);
this._showAnimation=new Telerik.Web.Animation.FadeInAnimation(this._animatedElement,this._duration,this._fps,0.5,1,false);
this._hideAnimation=new Telerik.Web.Animation.FadeInAnimation(this._animatedElement,this._duration,this._fps,0.9,0,false);
};
Telerik.Web.UI.Animations.FadeAnimation.prototype={_onAfterShow:function(){
this._animatedElement.style.filter="";
}};
Telerik.Web.UI.Animations.FadeAnimation.registerClass("Telerik.Web.UI.Animations.FadeAnimation",Telerik.Web.UI.Animations.ShowHideAnimation);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();