﻿Type.registerNamespace("PhotoSite.Framework");PhotoSite.Framework.WaitControl=function(A){PhotoSite.Framework.WaitControl.initializeBase(this,[A]);this._waitSemaphore=0;this._targetElementID=null;this._delay=0;this._delayTimer=null;this._delayDelegate=null;};PhotoSite.Framework.WaitControl.prototype={addWait:function(){this._waitSemaphore++;if(this._waitSemaphore==1){if(this._delay){if(!this._delayDelegate){this._delayDelegate=Function.createDelegate(this,this._onDelay);}if(!this._delayTimer){this._delayTimer=window.setTimeout(this._delayDelegate,this._delay);}}else{this._showWait();}}},_onDelay:function(){if(this._waitSemaphore>0){this._showWait();}this._delayTimer=null;},subtractWait:function(){this._waitSemaphore--;if(this._waitSemaphore==0){this._hideWait();}},_findTargetElement:function(){if(this._targetElementID){var A=$find(this._targetElementID);if(!A){A=$get(this._targetElementID);}return A;}return null;},_callTargetElementFunction:function(A){var B=this._findTargetElement();if(B&&B[A]){B[A]();}},_showWait:function(){this._callTargetElementFunction("show");},_hideWait:function(){this._callTargetElementFunction("hide");},initialize:function(){PhotoSite.Framework.WaitControl.callBaseMethod(this,"initialize");},dispose:function(){if(this._delayTimer){window.clearTimeout(this._delayTimer);}delete this._delayDelegate;PhotoSite.Framework.WaitControl.callBaseMethod(this,"dispose");},get_targetElementID:function(){return this._targetElementID;},set_targetElementID:function(A){if(this._targetElementID!==A){this._targetElementID=A;this.raisePropertyChanged("targetElementID");}},get_delay:function(){return this._delay;},set_delay:function(A){this._delay=A;}};PhotoSite.Framework.WaitControl.registerClass("PhotoSite.Framework.WaitControl",Sys.UI.Behavior);if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded();}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();