﻿Type.registerNamespace("PhotoSite.Framework");PhotoSite.Framework.Interpolator=function(B,E,D,C,A){this._startValue=B;this._endValue=E;this._totalTime=D;this._currentTime=0;this._callback=C;this._step=25;this._easeIn=A&&A.EaseIn?A.EaseIn:false;this._easeOut=A&&A.EaseOut?A.EaseOut:false;this._intervalID=setInterval(function(F){return function(){F._tick();};}(this),this._step);this._lastValue=this.update(0);};PhotoSite.Framework.Interpolator.prototype={_callback:null,_intervalID:null,_step:0,_totalTime:0,_currentTime:0,_startValue:0,_endValue:0,_lastValue:null,_easeIn:true,_easeOut:false,_tick:function(){this._currentTime=Math.min(this._currentTime+this._step,this._totalTime);if(this._currentTime===this._totalTime){clearInterval(this._intervalID);this._intervalID=null;}var A=this._currentTime/this._totalTime;if(this._easeOut&&this._easeIn){A=(A<=0.5)?this.update(2*A)/2:(2-this.update(2*(1-A)))/2;}else{if(this._easeOut){A=1-this.update(1-A);}else{A=this.update(A);}}this._lastValue=(this._startValue*(1-A))+(this._endValue*A);if(this._callback){this._callback(this,this._lastValue);}},getValue:function(){return this._lastValue;},isFinished:function(){return this._intervalID===null;},update:function(A){throw Error.notImplemented();}};PhotoSite.Framework.Interpolator.registerClass("PhotoSite.Framework.Interpolator");PhotoSite.Framework.LinearInterpolator=function(B,E,D,C,A){PhotoSite.Framework.LinearInterpolator.initializeBase(this,[B,E,D,C,A]);};PhotoSite.Framework.LinearInterpolator.prototype={update:function(A){return Math.min(A,1);}};PhotoSite.Framework.LinearInterpolator.registerClass("PhotoSite.Framework.LinearInterpolator",PhotoSite.Framework.Interpolator);PhotoSite.Framework.QuadraticInterpolator=function(B,E,D,C,A){PhotoSite.Framework.QuadraticInterpolator.initializeBase(this,[B,E,D,C,A]);};PhotoSite.Framework.QuadraticInterpolator.prototype={update:function(A){return Math.pow(Math.min(A,1),2);}};PhotoSite.Framework.QuadraticInterpolator.registerClass("PhotoSite.Framework.QuadraticInterpolator",PhotoSite.Framework.Interpolator);PhotoSite.Framework.CubicInterpolator=function(B,E,D,C,A){PhotoSite.Framework.CubicInterpolator.initializeBase(this,[B,E,D,C,A]);};PhotoSite.Framework.CubicInterpolator.prototype={update:function(A){return Math.pow(Math.min(A,1),3);}};PhotoSite.Framework.CubicInterpolator.registerClass("PhotoSite.Framework.CubicInterpolator",PhotoSite.Framework.Interpolator);PhotoSite.Framework.BounceInterpolator=function(B,E,D,C,A){this._bounce=A&&A["Bounce"]?A["Bounce"]:1.618;PhotoSite.Framework.BounceInterpolator.initializeBase(this,[B,E,D,C,A]);};PhotoSite.Framework.BounceInterpolator.prototype={_bounce:0,update:function(A){return Math.pow(A,2)*((this._bounce+1)*A-this._bounce);}};PhotoSite.Framework.BounceInterpolator.registerClass("PhotoSite.Framework.BounceInterpolator",PhotoSite.Framework.Interpolator);Type.registerNamespace("PhotoSite.Framework.Effects");PhotoSite.Framework.Effects.FadeOut=function(D,B,C,A){C=C?C:PhotoSite.Framework.LinearInterpolator;new C(100,0,B,function(E){return function(F,G){E.style.opacity=G/100;E.style.filter="alpha(opacity="+G+")";};}(D),A);};PhotoSite.Framework.Effects.FadeIn=function(D,B,C,A){C=C?C:PhotoSite.Framework.LinearInterpolator;new C(0,100,B,function(E){return function(F,G){E.style.opacity=G/100;E.style.filter="alpha(opacity="+G+")";};}(D),A);};PhotoSite.Framework.Effects.TransitionBoxDimension=function(B,G,F,A,H,D,C){if(typeof(this._updateDimension)==="undefined"){new PhotoSite.Framework.Effects.TransitionBoxDimension(B,G,F,A,H,D,C);return;}D=D?D:PhotoSite.Framework.LinearInterpolator;var E=B.style[G]&&B.style[G].length>0?B.style[G].substring(B.style[G].length-1):"x";if(E!="%"){E="px";}this._element=B;this._suffix=E;this._dimension=G;this._oldValue=null;new D(F,A,H,Function.createDelegate(this,this._updateDimension),C);};PhotoSite.Framework.Effects.TransitionBoxDimension.prototype={_element:null,_suffix:null,_dimension:null,_oldValue:null,_updateDimension:function(A,B){B=parseInt(B);if(B!=this._oldValue){this._element.style[this._dimension]=B+this._suffix;this._oldValue=B;}}};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();