﻿Type.registerNamespace("PhotoSite.Framework");PhotoSite.Framework.ComponentBase=function(){PhotoSite.Framework.ComponentBase.initializeBase(this);PhotoSite.Framework.DecorateDescribedObject(this);PhotoSite.Framework.DecorateBaseClass(this);};PhotoSite.Framework.ComponentBase.registerClass("PhotoSite.Framework.ComponentBase",Sys.Component);PhotoSite.Framework.ControlBase=function(A){PhotoSite.Framework.ControlBase.initializeBase(this,[A]);PhotoSite.Framework.DecorateDescribedObject(this);PhotoSite.Framework.DecorateBaseClass(this);};PhotoSite.Framework.ControlBase.registerClass("PhotoSite.Framework.ControlBase",Sys.UI.Control);PhotoSite.Framework.BehaviourBase=function(A){PhotoSite.Framework.BehaviourBase.initializeBase(this,[A]);PhotoSite.Framework.DecorateDescribedObject(this);PhotoSite.Framework.DecorateBaseClass(this);};PhotoSite.Framework.BehaviourBase.registerClass("PhotoSite.Framework.BehaviourBase",Sys.UI.Behavior);PhotoSite.Framework.DecorateBaseClass=function(A){A.raiseEvent=function(B,C){var D=this.get_events().getHandler(B);if(D){D(this,C);return true;}return false;};};PhotoSite.Framework.DecorateDescribedObject=function(E){var B=E.constructor;var D=E.constructor.descriptor;while(D){A(D);C(D);B=B.getBaseType();D=B?B.descriptor:null;}function C(J){if(!J.properties){return;}var H=J.properties;for(var I=0;I<H.length;I++){var G=H[I];var F="_"+G.name;if(!E["set"+F]&&!E["get"+F]&&typeof(E[F])==="undefined"){E[F]=null;E["set"+F]=function(K){return function(L){if(E[K]!==L){E[K]=L;E.raisePropertyChanged(K);}};}(F);E["get"+F]=function(K){return function(){return E[K];};}(F);}}}function A(J){if(!J.events){return;}var G=J.events;for(var I=0;I<G.length;I++){var H=G[I];var F=H.name;if(!E["add_"+F]){E["add_"+F]=function(K){return function(L){E.get_events().addHandler(K,L);};}(F);}if(!E["remove_"+F]){E["remove_"+F]=function(K){return function(L){E.get_events().removeHandler(K,L);};}(F);}}}};PhotoSite.Framework.Utils=function(){};PhotoSite.Framework.Utils.defineObjectAutoProperties=function(G,D){for(var E=0,A=D.length;E<A;E++){var C=D[E];var B="_"+C.name;var F=C.eventName||C.name;if(!G["set"+B]&&!G["get"+B]&&typeof(G[B])==="undefined"){G[B]=typeof(C.defaultValue)!=="undefined"?C.defaultValue:null;G["set"+B]=function(H,I){return function(J){if(this[H]!==J){this[H]=J;var K=this.get_events().getHandler(I);if(K){K(this,Sys.EventArgs.Empty);}this.raisePropertyChanged(H);}};}(B,F);G["get"+B]=function(H){return function(){return this[H];};}(B);PhotoSite.Framework.Utils.defineObjectAutoEvents(G,[{name:F}]);}}};PhotoSite.Framework.Utils.defineObjectAutoEvents=function(F,C){for(var E=0,A=C.length;E<A;E++){var D=C[E];var B=D.name;if(!F["add_"+B]){F["add_"+B]=function(G){return function(H){this.get_events().addHandler(G,H);};}(B);}if(!F["remove_"+B]){F["remove_"+B]=function(G){return function(H){this.get_events().removeHandler(G,H);};}(B);}}};PhotoSite.Framework.Utils._oldDisableTabFunc=null;PhotoSite.Framework.Utils._disableTabPatched=false;PhotoSite.Framework.Utils.patchModalPopup=function(){if(this._disableTabPatched){return;}else{this._disableTabPatched=true;this._oldDisableTabFunc=AjaxControlToolkit.ModalPopupBehavior.prototype.disableTab;AjaxControlToolkit.ModalPopupBehavior.prototype.disableTab=function(){};}};PhotoSite.Framework.Utils.restoreModalPopup=function(){if(this._disableTabPatched){AjaxControlToolkit.ModalPopupBehavior.prototype.disableTab=this._oldDisableTabFunc;this._oldDisableTabFunc=null;this._disableTabPatched=false;}};PhotoSite.Framework.Utils.evaluateScript=function(script,scope){var $this=scope;script=script.replace(/this/g,"$this");if(script.indexOf("return",0)===-1){return function(script){return eval(script);}.apply(scope,[script]);}else{return function(script){return eval("(function(){"+script+"}).apply(this)");}.apply(scope,[script]);}};Type.registerNamespace("PhotoSite.Framework.Format");PhotoSite.Framework.Format.fileSize=function(B,A){A=A?A:2;if(B>=1073741824){return(B/1073741824).toFixed(A)+" GB";}else{if(B>=1048576){return(B/1048576).toFixed(A)+" MB";}else{if(B>=1024){return(B/1024).toFixed(A)+" KB";}else{return(B).toFixed(A)+" bytes";}}}};PhotoSite.Framework.Utils.formatFileSize=PhotoSite.Framework.Format.fileSize;function Page_ResetValidation(A){if(typeof(Page_ValidationSummaries)!="undefined"){for(var B=0;B<Page_ValidationSummaries.length;B++){if(!A||(Page_ValidationSummaries[B].validationGroup&&A==Page_ValidationSummaries[B].validationGroup)){Page_ValidationSummaries[B].style.display="none";}}}if(typeof(Page_Validators)!="undefined"){for(var C=0;C<Page_Validators.length;C++){if(!A||(Page_Validators[C].validationGroup&&A==Page_Validators[C].validationGroup)){if(Page_Validators[C].display=="Dynamic"){Page_Validators[C].style.display="none";}else{Page_Validators[C].style.visibility="hidden";}}}}return true;}function isNumberKey(B){var A=(B.which)?B.which:event.keyCode;if(A>31&&(A<48||A>57)){return false;}return true;}if(typeof($log)==="undefined"){var traceFunction=function(A,C){try{if(C){Sys.Debug.trace(A+" exception: "+C);}else{Sys.Debug.trace(A);}}catch(B){}};$log=function(A){return{debug:traceFunction,info:traceFunction,warn:traceFunction,error:traceFunction,fatal:traceFunction};};}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();