Advertisement
Guest User

MicrosoftAjaxWebForms

a guest
Jun 8th, 2016
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //----------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation. All rights reserved.
  3. //----------------------------------------------------------
  4. // MicrosoftAjaxWebForms.js
  5. Type._registerScript("MicrosoftAjaxWebForms.js", ["MicrosoftAjaxCore.js", "MicrosoftAjaxSerialization.js", "MicrosoftAjaxNetwork.js", "MicrosoftAjaxComponentModel.js"]);
  6. Type.registerNamespace("Sys.WebForms");
  7. Sys.WebForms.BeginRequestEventArgs = function(c, b, a) {
  8.     Sys.WebForms.BeginRequestEventArgs.initializeBase(this);
  9.     this._request = c;
  10.     this._postBackElement = b;
  11.     this._updatePanelsToUpdate = a
  12. }
  13. ;
  14. Sys.WebForms.BeginRequestEventArgs.prototype = {
  15.     get_postBackElement: function() {
  16.         return this._postBackElement
  17.     },
  18.     get_request: function() {
  19.         return this._request
  20.     },
  21.     get_updatePanelsToUpdate: function() {
  22.         return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
  23.     }
  24. };
  25. Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs", Sys.EventArgs);
  26. Sys.WebForms.EndRequestEventArgs = function(c, a, b) {
  27.     Sys.WebForms.EndRequestEventArgs.initializeBase(this);
  28.     this._errorHandled = false;
  29.     this._error = c;
  30.     this._dataItems = a || {};
  31.     this._response = b
  32. }
  33. ;
  34. Sys.WebForms.EndRequestEventArgs.prototype = {
  35.     get_dataItems: function() {
  36.         return this._dataItems
  37.     },
  38.     get_error: function() {
  39.         return this._error
  40.     },
  41.     get_errorHandled: function() {
  42.         return this._errorHandled
  43.     },
  44.     set_errorHandled: function(a) {
  45.         this._errorHandled = a
  46.     },
  47.     get_response: function() {
  48.         return this._response
  49.     }
  50. };
  51. Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs", Sys.EventArgs);
  52. Sys.WebForms.InitializeRequestEventArgs = function(c, b, a) {
  53.     Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);
  54.     this._request = c;
  55.     this._postBackElement = b;
  56.     this._updatePanelsToUpdate = a
  57. }
  58. ;
  59. Sys.WebForms.InitializeRequestEventArgs.prototype = {
  60.     get_postBackElement: function() {
  61.         return this._postBackElement
  62.     },
  63.     get_request: function() {
  64.         return this._request
  65.     },
  66.     get_updatePanelsToUpdate: function() {
  67.         return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
  68.     },
  69.     set_updatePanelsToUpdate: function(a) {
  70.         this._updated = true;
  71.         this._updatePanelsToUpdate = a
  72.     }
  73. };
  74. Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs", Sys.CancelEventArgs);
  75. Sys.WebForms.PageLoadedEventArgs = function(b, a, c) {
  76.     Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
  77.     this._panelsUpdated = b;
  78.     this._panelsCreated = a;
  79.     this._dataItems = c || {}
  80. }
  81. ;
  82. Sys.WebForms.PageLoadedEventArgs.prototype = {
  83.     get_dataItems: function() {
  84.         return this._dataItems
  85.     },
  86.     get_panelsCreated: function() {
  87.         return this._panelsCreated
  88.     },
  89.     get_panelsUpdated: function() {
  90.         return this._panelsUpdated
  91.     }
  92. };
  93. Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs", Sys.EventArgs);
  94. Sys.WebForms.PageLoadingEventArgs = function(b, a, c) {
  95.     Sys.WebForms.PageLoadingEventArgs.initializeBase(this);
  96.     this._panelsUpdating = b;
  97.     this._panelsDeleting = a;
  98.     this._dataItems = c || {}
  99. }
  100. ;
  101. Sys.WebForms.PageLoadingEventArgs.prototype = {
  102.     get_dataItems: function() {
  103.         return this._dataItems
  104.     },
  105.     get_panelsDeleting: function() {
  106.         return this._panelsDeleting
  107.     },
  108.     get_panelsUpdating: function() {
  109.         return this._panelsUpdating
  110.     }
  111. };
  112. Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs", Sys.EventArgs);
  113. Sys._ScriptLoader = function() {
  114.     this._scriptsToLoad = null ;
  115.     this._sessions = [];
  116.     this._scriptLoadedDelegate = Function.createDelegate(this, this._scriptLoadedHandler)
  117. }
  118. ;
  119. Sys._ScriptLoader.prototype = {
  120.     dispose: function() {
  121.         this._stopSession();
  122.         this._loading = false;
  123.         if (this._events)
  124.             delete this._events;
  125.         this._sessions = null ;
  126.         this._currentSession = null ;
  127.         this._scriptLoadedDelegate = null
  128.     },
  129.     loadScripts: function(d, b, c, a) {
  130.         var e = {
  131.             allScriptsLoadedCallback: b,
  132.             scriptLoadFailedCallback: c,
  133.             scriptLoadTimeoutCallback: a,
  134.             scriptsToLoad: this._scriptsToLoad,
  135.             scriptTimeout: d
  136.         };
  137.         this._scriptsToLoad = null ;
  138.         this._sessions[this._sessions.length] = e;
  139.         if (!this._loading)
  140.             this._nextSession()
  141.     },
  142.     queueCustomScriptTag: function(a) {
  143.         if (!this._scriptsToLoad)
  144.             this._scriptsToLoad = [];
  145.         Array.add(this._scriptsToLoad, a)
  146.     },
  147.     queueScriptBlock: function(a) {
  148.         if (!this._scriptsToLoad)
  149.             this._scriptsToLoad = [];
  150.         Array.add(this._scriptsToLoad, {
  151.             text: a
  152.         })
  153.     },
  154.     queueScriptReference: function(a, b) {
  155.         if (!this._scriptsToLoad)
  156.             this._scriptsToLoad = [];
  157.         Array.add(this._scriptsToLoad, {
  158.             src: a,
  159.             fallback: b
  160.         })
  161.     },
  162.     _createScriptElement: function(c) {
  163.         var a = document.createElement("script");
  164.         a.type = "text/javascript";
  165.         for (var b in c)
  166.             a[b] = c[b];
  167.         return a
  168.     },
  169.     _loadScriptsInternal: function() {
  170.         var c = this._currentSession;
  171.         if (c.scriptsToLoad && c.scriptsToLoad.length > 0) {
  172.             var b = Array.dequeue(c.scriptsToLoad)
  173.               , f = this._scriptLoadedDelegate;
  174.             if (b.fallback) {
  175.                 var g = b.fallback;
  176.                 delete b.fallback;
  177.                 var d = this;
  178.                 f = function(b, a) {
  179.                     a || function() {
  180.                         var a = d._createScriptElement({
  181.                             src: g
  182.                         });
  183.                         d._currentTask = new Sys._ScriptLoaderTask(a,d._scriptLoadedDelegate);
  184.                         d._currentTask.execute()
  185.                     }()
  186.                 }
  187.             }
  188.             var a = this._createScriptElement(b);
  189.             if (a.text && Sys.Browser.agent === Sys.Browser.Safari) {
  190.                 a.innerHTML = a.text;
  191.                 delete a.text
  192.             }
  193.             if (typeof b.src === "string") {
  194.                 this._currentTask = new Sys._ScriptLoaderTask(a,f);
  195.                 this._currentTask.execute()
  196.             } else {
  197.                 document.getElementsByTagName("head")[0].appendChild(a);
  198.                 Sys._ScriptLoaderTask._clearScript(a);
  199.                 this._loadScriptsInternal()
  200.             }
  201.         } else {
  202.             this._stopSession();
  203.             var e = c.allScriptsLoadedCallback;
  204.             if (e)
  205.                 e(this);
  206.             this._nextSession()
  207.         }
  208.     },
  209.     _nextSession: function() {
  210.         if (this._sessions.length === 0) {
  211.             this._loading = false;
  212.             this._currentSession = null ;
  213.             return
  214.         }
  215.         this._loading = true;
  216.         var a = Array.dequeue(this._sessions);
  217.         this._currentSession = a;
  218.         if (a.scriptTimeout > 0)
  219.             this._timeoutCookie = window.setTimeout(Function.createDelegate(this, this._scriptLoadTimeoutHandler), a.scriptTimeout * 1000);
  220.         this._loadScriptsInternal()
  221.     },
  222.     _raiseError: function() {
  223.         var b = this._currentSession.scriptLoadFailedCallback
  224.           , a = this._currentTask.get_scriptElement();
  225.         this._stopSession();
  226.         if (b) {
  227.             b(this, a);
  228.             this._nextSession()
  229.         } else {
  230.             this._loading = false;
  231.             throw Sys._ScriptLoader._errorScriptLoadFailed(a.src)
  232.         }
  233.     },
  234.     _scriptLoadedHandler: function(a, b) {
  235.         if (b) {
  236.             Array.add(Sys._ScriptLoader._getLoadedScripts(), a.src);
  237.             this._currentTask.dispose();
  238.             this._currentTask = null ;
  239.             this._loadScriptsInternal()
  240.         } else
  241.             this._raiseError()
  242.     },
  243.     _scriptLoadTimeoutHandler: function() {
  244.         var a = this._currentSession.scriptLoadTimeoutCallback;
  245.         this._stopSession();
  246.         if (a)
  247.             a(this);
  248.         this._nextSession()
  249.     },
  250.     _stopSession: function() {
  251.         if (this._timeoutCookie) {
  252.             window.clearTimeout(this._timeoutCookie);
  253.             this._timeoutCookie = null
  254.         }
  255.         if (this._currentTask) {
  256.             this._currentTask.dispose();
  257.             this._currentTask = null
  258.         }
  259.     }
  260. };
  261. Sys._ScriptLoader.registerClass("Sys._ScriptLoader", null , Sys.IDisposable);
  262. Sys._ScriptLoader.getInstance = function() {
  263.     var a = Sys._ScriptLoader._activeInstance;
  264.     if (!a)
  265.         a = Sys._ScriptLoader._activeInstance = new Sys._ScriptLoader;
  266.     return a
  267. }
  268. ;
  269. Sys._ScriptLoader.isScriptLoaded = function(b) {
  270.     var a = document.createElement("script");
  271.     a.src = b;
  272.     return Array.contains(Sys._ScriptLoader._getLoadedScripts(), a.src)
  273. }
  274. ;
  275. Sys._ScriptLoader.readLoadedScripts = function() {
  276.     if (!Sys._ScriptLoader._referencedScripts) {
  277.         var c = Sys._ScriptLoader._referencedScripts = []
  278.           , d = document.getElementsByTagName("script");
  279.         for (var b = d.length - 1; b >= 0; b--) {
  280.             var e = d[b]
  281.               , a = e.src;
  282.             if (a.length)
  283.                 if (!Array.contains(c, a))
  284.                     Array.add(c, a)
  285.         }
  286.     }
  287. }
  288. ;
  289. Sys._ScriptLoader._errorScriptLoadFailed = function(b) {
  290.     var a;
  291.     a = Sys.Res.scriptLoadFailed;
  292.     var d = "Sys.ScriptLoadFailedException: " + String.format(a, b)
  293.       , c = Error.create(d, {
  294.         name: "Sys.ScriptLoadFailedException",
  295.         "scriptUrl": b
  296.     });
  297.     c.popStackFrame();
  298.     return c
  299. }
  300. ;
  301. Sys._ScriptLoader._getLoadedScripts = function() {
  302.     if (!Sys._ScriptLoader._referencedScripts) {
  303.         Sys._ScriptLoader._referencedScripts = [];
  304.         Sys._ScriptLoader.readLoadedScripts()
  305.     }
  306.     return Sys._ScriptLoader._referencedScripts
  307. }
  308. ;
  309. Sys.WebForms.PageRequestManager = function() {
  310.     this._form = null ;
  311.     this._activeDefaultButton = null ;
  312.     this._activeDefaultButtonClicked = false;
  313.     this._updatePanelIDs = null ;
  314.     this._updatePanelClientIDs = null ;
  315.     this._updatePanelHasChildrenAsTriggers = null ;
  316.     this._asyncPostBackControlIDs = null ;
  317.     this._asyncPostBackControlClientIDs = null ;
  318.     this._postBackControlIDs = null ;
  319.     this._postBackControlClientIDs = null ;
  320.     this._scriptManagerID = null ;
  321.     this._pageLoadedHandler = null ;
  322.     this._additionalInput = null ;
  323.     this._onsubmit = null ;
  324.     this._onSubmitStatements = [];
  325.     this._originalDoPostBack = null ;
  326.     this._originalDoPostBackWithOptions = null ;
  327.     this._originalFireDefaultButton = null ;
  328.     this._originalDoCallback = null ;
  329.     this._isCrossPost = false;
  330.     this._postBackSettings = null ;
  331.     this._request = null ;
  332.     this._onFormSubmitHandler = null ;
  333.     this._onFormElementClickHandler = null ;
  334.     this._onWindowUnloadHandler = null ;
  335.     this._asyncPostBackTimeout = null ;
  336.     this._controlIDToFocus = null ;
  337.     this._scrollPosition = null ;
  338.     this._processingRequest = false;
  339.     this._scriptDisposes = {};
  340.     this._transientFields = ["__VIEWSTATEENCRYPTED", "__VIEWSTATEFIELDCOUNT"];
  341.     this._textTypes = /^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i
  342. }
  343. ;
  344. Sys.WebForms.PageRequestManager.prototype = {
  345.     _get_eventHandlerList: function() {
  346.         if (!this._events)
  347.             this._events = new Sys.EventHandlerList;
  348.         return this._events
  349.     },
  350.     get_isInAsyncPostBack: function() {
  351.         return this._request !== null
  352.     },
  353.     add_beginRequest: function(a) {
  354.         this._get_eventHandlerList().addHandler("beginRequest", a)
  355.     },
  356.     remove_beginRequest: function(a) {
  357.         this._get_eventHandlerList().removeHandler("beginRequest", a)
  358.     },
  359.     add_endRequest: function(a) {
  360.         this._get_eventHandlerList().addHandler("endRequest", a)
  361.     },
  362.     remove_endRequest: function(a) {
  363.         this._get_eventHandlerList().removeHandler("endRequest", a)
  364.     },
  365.     add_initializeRequest: function(a) {
  366.         this._get_eventHandlerList().addHandler("initializeRequest", a)
  367.     },
  368.     remove_initializeRequest: function(a) {
  369.         this._get_eventHandlerList().removeHandler("initializeRequest", a)
  370.     },
  371.     add_pageLoaded: function(a) {
  372.         this._get_eventHandlerList().addHandler("pageLoaded", a)
  373.     },
  374.     remove_pageLoaded: function(a) {
  375.         this._get_eventHandlerList().removeHandler("pageLoaded", a)
  376.     },
  377.     add_pageLoading: function(a) {
  378.         this._get_eventHandlerList().addHandler("pageLoading", a)
  379.     },
  380.     remove_pageLoading: function(a) {
  381.         this._get_eventHandlerList().removeHandler("pageLoading", a)
  382.     },
  383.     abortPostBack: function() {
  384.         if (!this._processingRequest && this._request) {
  385.             this._request.get_executor().abort();
  386.             this._request = null
  387.         }
  388.     },
  389.     beginAsyncPostBack: function(c, a, f, d, e) {
  390.         if (d && typeof Page_ClientValidate === "function" && !Page_ClientValidate(e || null ))
  391.             return;
  392.         this._postBackSettings = this._createPostBackSettings(true, c, a);
  393.         var b = this._form;
  394.         b.__EVENTTARGET.value = a || "";
  395.         b.__EVENTARGUMENT.value = f || "";
  396.         this._isCrossPost = false;
  397.         this._additionalInput = null ;
  398.         this._onFormSubmit()
  399.     },
  400.     _cancelPendingCallbacks: function() {
  401.         for (var a = 0, e = window.__pendingCallbacks.length; a < e; a++) {
  402.             var c = window.__pendingCallbacks[a];
  403.             if (c) {
  404.                 if (!c.async)
  405.                     window.__synchronousCallBackIndex = -1;
  406.                 window.__pendingCallbacks[a] = null ;
  407.                 var d = "__CALLBACKFRAME" + a
  408.                   , b = document.getElementById(d);
  409.                 if (b)
  410.                     b.parentNode.removeChild(b)
  411.             }
  412.         }
  413.     },
  414.     _commitControls: function(a, b) {
  415.         if (a) {
  416.             this._updatePanelIDs = a.updatePanelIDs;
  417.             this._updatePanelClientIDs = a.updatePanelClientIDs;
  418.             this._updatePanelHasChildrenAsTriggers = a.updatePanelHasChildrenAsTriggers;
  419.             this._asyncPostBackControlIDs = a.asyncPostBackControlIDs;
  420.             this._asyncPostBackControlClientIDs = a.asyncPostBackControlClientIDs;
  421.             this._postBackControlIDs = a.postBackControlIDs;
  422.             this._postBackControlClientIDs = a.postBackControlClientIDs
  423.         }
  424.         if (typeof b !== "undefined" && b !== null )
  425.             this._asyncPostBackTimeout = b * 1000
  426.     },
  427.     _createHiddenField: function(c, d) {
  428.         var b, a = document.getElementById(c);
  429.         if (a)
  430.             if (!a._isContained)
  431.                 a.parentNode.removeChild(a);
  432.             else
  433.                 b = a.parentNode;
  434.         if (!b) {
  435.             b = document.createElement("span");
  436.             b.style.cssText = "display:none !important";
  437.             this._form.appendChild(b)
  438.         }
  439.         b.innerHTML = "<input type='hidden' />";
  440.         a = b.childNodes[0];
  441.         a._isContained = true;
  442.         a.id = a.name = c;
  443.         a.value = d
  444.     },
  445.     _createPageRequestManagerTimeoutError: function() {
  446.         var b = "Sys.WebForms.PageRequestManagerTimeoutException: " + Sys.WebForms.Res.PRM_TimeoutError
  447.           , a = Error.create(b, {
  448.             name: "Sys.WebForms.PageRequestManagerTimeoutException"
  449.         });
  450.         a.popStackFrame();
  451.         return a
  452.     },
  453.     _createPageRequestManagerServerError: function(a, d) {
  454.         var c = "Sys.WebForms.PageRequestManagerServerErrorException: " + (d || String.format(Sys.WebForms.Res.PRM_ServerError, a))
  455.           , b = Error.create(c, {
  456.             name: "Sys.WebForms.PageRequestManagerServerErrorException",
  457.             httpStatusCode: a
  458.         });
  459.         b.popStackFrame();
  460.         return b
  461.     },
  462.     _createPageRequestManagerParserError: function(b) {
  463.         var c = "Sys.WebForms.PageRequestManagerParserErrorException: " + String.format(Sys.WebForms.Res.PRM_ParserError, b)
  464.           , a = Error.create(c, {
  465.             name: "Sys.WebForms.PageRequestManagerParserErrorException"
  466.         });
  467.         a.popStackFrame();
  468.         return a
  469.     },
  470.     _createPanelID: function(e, b) {
  471.         var c = b.asyncTarget
  472.           , a = this._ensureUniqueIds(e || b.panelsToUpdate)
  473.           , d = a instanceof Array ? a.join(",") : a || this._scriptManagerID;
  474.         if (c)
  475.             d += "|" + c;
  476.         return encodeURIComponent(this._scriptManagerID) + "=" + encodeURIComponent(d) + "&"
  477.     },
  478.     _createPostBackSettings: function(d, a, c, b) {
  479.         return {
  480.             async: d,
  481.             asyncTarget: c,
  482.             panelsToUpdate: a,
  483.             sourceElement: b
  484.         }
  485.     },
  486.     _convertToClientIDs: function(a, f, e, d) {
  487.         if (a)
  488.             for (var b = 0, h = a.length; b < h; b += d ? 2 : 1) {
  489.                 var c = a[b]
  490.                   , g = (d ? a[b + 1] : "") || this._uniqueIDToClientID(c);
  491.                 Array.add(f, c);
  492.                 Array.add(e, g)
  493.             }
  494.     },
  495.     dispose: function() {
  496.         if (this._form) {
  497.             Sys.UI.DomEvent.removeHandler(this._form, "submit", this._onFormSubmitHandler);
  498.             Sys.UI.DomEvent.removeHandler(this._form, "click", this._onFormElementClickHandler);
  499.             Sys.UI.DomEvent.removeHandler(window, "unload", this._onWindowUnloadHandler);
  500.             Sys.UI.DomEvent.removeHandler(window, "load", this._pageLoadedHandler)
  501.         }
  502.         if (this._originalDoPostBack) {
  503.             window.__doPostBack = this._originalDoPostBack;
  504.             this._originalDoPostBack = null
  505.         }
  506.         if (this._originalDoPostBackWithOptions) {
  507.             window.WebForm_DoPostBackWithOptions = this._originalDoPostBackWithOptions;
  508.             this._originalDoPostBackWithOptions = null
  509.         }
  510.         if (this._originalFireDefaultButton) {
  511.             window.WebForm_FireDefaultButton = this._originalFireDefaultButton;
  512.             this._originalFireDefaultButton = null
  513.         }
  514.         if (this._originalDoCallback) {
  515.             window.WebForm_DoCallback = this._originalDoCallback;
  516.             this._originalDoCallback = null
  517.         }
  518.         this._form = null ;
  519.         this._updatePanelIDs = null ;
  520.         this._updatePanelClientIDs = null ;
  521.         this._asyncPostBackControlIDs = null ;
  522.         this._asyncPostBackControlClientIDs = null ;
  523.         this._postBackControlIDs = null ;
  524.         this._postBackControlClientIDs = null ;
  525.         this._asyncPostBackTimeout = null ;
  526.         this._scrollPosition = null ;
  527.         this._activeElement = null
  528.     },
  529.     _doCallback: function(d, b, c, f, a, e) {
  530.         if (!this.get_isInAsyncPostBack())
  531.             this._originalDoCallback(d, b, c, f, a, e)
  532.     },
  533.     _doPostBack: function(a, k) {
  534.         var f = window.event;
  535.         if (!f) {
  536.             var d = arguments.callee ? arguments.callee.caller : null ;
  537.             if (d) {
  538.                 var j = 30;
  539.                 while (d.arguments.callee.caller && --j)
  540.                     d = d.arguments.callee.caller;
  541.                 f = j && d.arguments.length ? d.arguments[0] : null
  542.             }
  543.         }
  544.         this._additionalInput = null ;
  545.         var h = this._form;
  546.         if (a === null || typeof a === "undefined" || this._isCrossPost) {
  547.             this._postBackSettings = this._createPostBackSettings(false);
  548.             this._isCrossPost = false
  549.         } else {
  550.             var c = this._masterPageUniqueID
  551.               , l = this._uniqueIDToClientID(a)
  552.               , g = document.getElementById(l);
  553.             if (!g && c)
  554.                 if (a.indexOf(c + "$") === 0)
  555.                     g = document.getElementById(l.substr(c.length + 1));
  556.             if (!g)
  557.                 if (Array.contains(this._asyncPostBackControlIDs, a))
  558.                     this._postBackSettings = this._createPostBackSettings(true, null , a);
  559.                 else if (Array.contains(this._postBackControlIDs, a))
  560.                     this._postBackSettings = this._createPostBackSettings(false);
  561.                 else {
  562.                     var e = this._findNearestElement(a);
  563.                     if (e)
  564.                         this._postBackSettings = this._getPostBackSettings(e, a);
  565.                     else {
  566.                         if (c) {
  567.                             c += "$";
  568.                             if (a.indexOf(c) === 0)
  569.                                 e = this._findNearestElement(a.substr(c.length))
  570.                         }
  571.                         if (e)
  572.                             this._postBackSettings = this._getPostBackSettings(e, a);
  573.                         else {
  574.                             var b;
  575.                             try {
  576.                                 b = f ? f.target || f.srcElement : null
  577.                             } catch (n) {}
  578.                             b = b || this._activeElement;
  579.                             var m = /__doPostBack\(|WebForm_DoPostBackWithOptions\(/;
  580.                             function i(b) {
  581.                                 b = b ? b.toString() : "";
  582.                                 return m.test(b) && b.indexOf("'" + a + "'") !== -1 || b.indexOf('"' + a + '"') !== -1
  583.                             }
  584.                             if (b && (b.name === a || i(b.href) || i(b.onclick) || i(b.onchange)))
  585.                                 this._postBackSettings = this._getPostBackSettings(b, a);
  586.                             else
  587.                                 this._postBackSettings = this._createPostBackSettings(false)
  588.                         }
  589.                     }
  590.                 }
  591.             else
  592.                 this._postBackSettings = this._getPostBackSettings(g, a)
  593.         }
  594.         if (!this._postBackSettings.async) {
  595.             h.onsubmit = this._onsubmit;
  596.             this._originalDoPostBack(a, k);
  597.             h.onsubmit = null ;
  598.             return
  599.         }
  600.         h.__EVENTTARGET.value = a;
  601.         h.__EVENTARGUMENT.value = k;
  602.         this._onFormSubmit()
  603.     },
  604.     _doPostBackWithOptions: function(a) {
  605.         this._isCrossPost = a && a.actionUrl;
  606.         var d = true;
  607.         if (a.validation)
  608.             if (typeof Page_ClientValidate == "function")
  609.                 d = Page_ClientValidate(a.validationGroup);
  610.         if (d) {
  611.             if (typeof a.actionUrl != "undefined" && a.actionUrl != null && a.actionUrl.length > 0)
  612.                 theForm.action = a.actionUrl;
  613.             if (a.trackFocus) {
  614.                 var c = theForm.elements["__LASTFOCUS"];
  615.                 if (typeof c != "undefined" && c != null )
  616.                     if (typeof document.activeElement == "undefined")
  617.                         c.value = a.eventTarget;
  618.                     else {
  619.                         var b = document.activeElement;
  620.                         if (typeof b != "undefined" && b != null )
  621.                             if (typeof b.id != "undefined" && b.id != null && b.id.length > 0)
  622.                                 c.value = b.id;
  623.                             else if (typeof b.name != "undefined")
  624.                                 c.value = b.name
  625.                     }
  626.             }
  627.         }
  628.         if (a.clientSubmit)
  629.             this._doPostBack(a.eventTarget, a.eventArgument)
  630.     },
  631.     _elementContains: function(b, a) {
  632.         while (a) {
  633.             if (a === b)
  634.                 return true;
  635.             a = a.parentNode
  636.         }
  637.         return false
  638.     },
  639.     _endPostBack: function(a, d, f) {
  640.         if (this._request === d.get_webRequest()) {
  641.             this._processingRequest = false;
  642.             this._additionalInput = null ;
  643.             this._request = null
  644.         }
  645.         var e = this._get_eventHandlerList().getHandler("endRequest")
  646.           , b = false;
  647.         if (e) {
  648.             var c = new Sys.WebForms.EndRequestEventArgs(a,f ? f.dataItems : {},d);
  649.             e(this, c);
  650.             b = c.get_errorHandled()
  651.         }
  652.         if (a && !b)
  653.             throw a
  654.     },
  655.     _ensureUniqueIds: function(a) {
  656.         if (!a)
  657.             return a;
  658.         a = a instanceof Array ? a : [a];
  659.         var c = [];
  660.         for (var b = 0, f = a.length; b < f; b++) {
  661.             var e = a[b]
  662.               , d = Array.indexOf(this._updatePanelClientIDs, e);
  663.             c.push(d > -1 ? this._updatePanelIDs[d] : e)
  664.         }
  665.         return c
  666.     },
  667.     _findNearestElement: function(a) {
  668.         while (a.length > 0) {
  669.             var d = this._uniqueIDToClientID(a)
  670.               , c = document.getElementById(d);
  671.             if (c)
  672.                 return c;
  673.             var b = a.lastIndexOf("$");
  674.             if (b === -1)
  675.                 return null ;
  676.             a = a.substring(0, b)
  677.         }
  678.         return null
  679.     },
  680.     _findText: function(b, a) {
  681.         var c = Math.max(0, a - 20)
  682.           , d = Math.min(b.length, a + 20);
  683.         return b.substring(c, d)
  684.     },
  685.     _fireDefaultButton: function(a, d) {
  686.         if (a.keyCode === 13) {
  687.             var c = a.srcElement || a.target;
  688.             if (!c || c.tagName.toLowerCase() !== "textarea") {
  689.                 var b = document.getElementById(d);
  690.                 if (b && typeof b.click !== "undefined") {
  691.                     this._activeDefaultButton = b;
  692.                     this._activeDefaultButtonClicked = false;
  693.                     try {
  694.                         b.click()
  695.                     } finally {
  696.                         this._activeDefaultButton = null
  697.                     }
  698.                     a.cancelBubble = true;
  699.                     if (typeof a.stopPropagation === "function")
  700.                         a.stopPropagation();
  701.                     return false
  702.                 }
  703.             }
  704.         }
  705.         return true
  706.     },
  707.     _getPageLoadedEventArgs: function(n, c) {
  708.         var m = [], l = [], k = c ? c.version4 : false, d = c ? c.updatePanelData : null , e, g, h, b;
  709.         if (!d) {
  710.             e = this._updatePanelIDs;
  711.             g = this._updatePanelClientIDs;
  712.             h = null ;
  713.             b = null
  714.         } else {
  715.             e = d.updatePanelIDs;
  716.             g = d.updatePanelClientIDs;
  717.             h = d.childUpdatePanelIDs;
  718.             b = d.panelsToRefreshIDs
  719.         }
  720.         var a, f, j, i;
  721.         if (b)
  722.             for (a = 0,
  723.             f = b.length; a < f; a += k ? 2 : 1) {
  724.                 j = b[a];
  725.                 i = (k ? b[a + 1] : "") || this._uniqueIDToClientID(j);
  726.                 Array.add(m, document.getElementById(i))
  727.             }
  728.         for (a = 0,
  729.         f = e.length; a < f; a++)
  730.             if (n || Array.indexOf(h, e[a]) !== -1)
  731.                 Array.add(l, document.getElementById(g[a]));
  732.         return new Sys.WebForms.PageLoadedEventArgs(m,l,c ? c.dataItems : {})
  733.     },
  734.     _getPageLoadingEventArgs: function(f) {
  735.         var j = [], i = [], c = f.updatePanelData, k = c.oldUpdatePanelIDs, l = c.oldUpdatePanelClientIDs, n = c.updatePanelIDs, m = c.childUpdatePanelIDs, d = c.panelsToRefreshIDs, a, e, b, g, h = f.version4;
  736.         for (a = 0,
  737.         e = d.length; a < e; a += h ? 2 : 1) {
  738.             b = d[a];
  739.             g = (h ? d[a + 1] : "") || this._uniqueIDToClientID(b);
  740.             Array.add(j, document.getElementById(g))
  741.         }
  742.         for (a = 0,
  743.         e = k.length; a < e; a++) {
  744.             b = k[a];
  745.             if (Array.indexOf(d, b) === -1 && (Array.indexOf(n, b) === -1 || Array.indexOf(m, b) > -1))
  746.                 Array.add(i, document.getElementById(l[a]))
  747.         }
  748.         return new Sys.WebForms.PageLoadingEventArgs(j,i,f.dataItems)
  749.     },
  750.     _getPostBackSettings: function(a, c) {
  751.         var d = a
  752.           , b = null ;
  753.         while (a) {
  754.             if (a.id) {
  755.                 if (!b && Array.contains(this._asyncPostBackControlClientIDs, a.id))
  756.                     b = this._createPostBackSettings(true, null , c, d);
  757.                 else if (!b && Array.contains(this._postBackControlClientIDs, a.id))
  758.                     return this._createPostBackSettings(false);
  759.                 else {
  760.                     var e = Array.indexOf(this._updatePanelClientIDs, a.id);
  761.                     if (e !== -1)
  762.                         if (this._updatePanelHasChildrenAsTriggers[e])
  763.                             return this._createPostBackSettings(true, [this._updatePanelIDs[e]], c, d);
  764.                         else
  765.                             return this._createPostBackSettings(true, null , c, d)
  766.                 }
  767.                 if (!b && this._matchesParentIDInList(a.id, this._asyncPostBackControlClientIDs))
  768.                     b = this._createPostBackSettings(true, null , c, d);
  769.                 else if (!b && this._matchesParentIDInList(a.id, this._postBackControlClientIDs))
  770.                     return this._createPostBackSettings(false)
  771.             }
  772.             a = a.parentNode
  773.         }
  774.         if (!b)
  775.             return this._createPostBackSettings(false);
  776.         else
  777.             return b
  778.     },
  779.     _getScrollPosition: function() {
  780.         var a = document.documentElement;
  781.         if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))
  782.             return {
  783.                 x: a.scrollLeft,
  784.                 y: a.scrollTop
  785.             };
  786.         else {
  787.             a = document.body;
  788.             if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))
  789.                 return {
  790.                     x: a.scrollLeft,
  791.                     y: a.scrollTop
  792.                 };
  793.             else if (this._validPosition(window.pageXOffset) || this._validPosition(window.pageYOffset))
  794.                 return {
  795.                     x: window.pageXOffset,
  796.                     y: window.pageYOffset
  797.                 };
  798.             else
  799.                 return {
  800.                     x: 0,
  801.                     y: 0
  802.                 }
  803.         }
  804.     },
  805.     _initializeInternal: function(f, g, a, b, e, c, d) {
  806.         if (this._prmInitialized)
  807.             throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);
  808.         this._prmInitialized = true;
  809.         this._masterPageUniqueID = d;
  810.         this._scriptManagerID = f;
  811.         this._form = Sys.UI.DomElement.resolveElement(g);
  812.         this._onsubmit = this._form.onsubmit;
  813.         this._form.onsubmit = null ;
  814.         this._onFormSubmitHandler = Function.createDelegate(this, this._onFormSubmit);
  815.         this._onFormElementClickHandler = Function.createDelegate(this, this._onFormElementClick);
  816.         this._onWindowUnloadHandler = Function.createDelegate(this, this._onWindowUnload);
  817.         Sys.UI.DomEvent.addHandler(this._form, "submit", this._onFormSubmitHandler);
  818.         Sys.UI.DomEvent.addHandler(this._form, "click", this._onFormElementClickHandler);
  819.         Sys.UI.DomEvent.addHandler(window, "unload", this._onWindowUnloadHandler);
  820.         this._originalDoPostBack = window.__doPostBack;
  821.         if (this._originalDoPostBack)
  822.             window.__doPostBack = Function.createDelegate(this, this._doPostBack);
  823.         this._originalDoPostBackWithOptions = window.WebForm_DoPostBackWithOptions;
  824.         if (this._originalDoPostBackWithOptions)
  825.             window.WebForm_DoPostBackWithOptions = Function.createDelegate(this, this._doPostBackWithOptions);
  826.         this._originalFireDefaultButton = window.WebForm_FireDefaultButton;
  827.         if (this._originalFireDefaultButton)
  828.             window.WebForm_FireDefaultButton = Function.createDelegate(this, this._fireDefaultButton);
  829.         this._originalDoCallback = window.WebForm_DoCallback;
  830.         if (this._originalDoCallback)
  831.             window.WebForm_DoCallback = Function.createDelegate(this, this._doCallback);
  832.         this._pageLoadedHandler = Function.createDelegate(this, this._pageLoadedInitialLoad);
  833.         Sys.UI.DomEvent.addHandler(window, "load", this._pageLoadedHandler);
  834.         if (a)
  835.             this._updateControls(a, b, e, c, true)
  836.     },
  837.     _matchesParentIDInList: function(c, b) {
  838.         for (var a = 0, d = b.length; a < d; a++)
  839.             if (c.startsWith(b[a] + "_"))
  840.                 return true;
  841.         return false
  842.     },
  843.     _onFormElementActive: function(a, d, e) {
  844.         if (a.disabled)
  845.             return;
  846.         this._activeElement = a;
  847.         this._postBackSettings = this._getPostBackSettings(a, a.name);
  848.         if (a.name) {
  849.             var b = a.tagName.toUpperCase();
  850.             if (b === "INPUT") {
  851.                 var c = a.type;
  852.                 if (c === "submit")
  853.                     this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value);
  854.                 else if (c === "image")
  855.                     this._additionalInput = encodeURIComponent(a.name) + ".x=" + d + "&" + encodeURIComponent(a.name) + ".y=" + e
  856.             } else if (b === "BUTTON" && a.name.length !== 0 && a.type === "submit")
  857.                 this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value)
  858.         }
  859.     },
  860.     _onFormElementClick: function(a) {
  861.         this._activeDefaultButtonClicked = a.target === this._activeDefaultButton;
  862.         this._onFormElementActive(a.target, a.offsetX, a.offsetY)
  863.     },
  864.     _onFormSubmit: function(i) {
  865.         var f, x, h = true, z = this._isCrossPost;
  866.         this._isCrossPost = false;
  867.         if (this._onsubmit)
  868.             h = this._onsubmit();
  869.         if (h)
  870.             for (f = 0,
  871.             x = this._onSubmitStatements.length; f < x; f++)
  872.                 if (!this._onSubmitStatements[f]()) {
  873.                     h = false;
  874.                     break
  875.                 }
  876.         if (!h) {
  877.             if (i)
  878.                 i.preventDefault();
  879.             return
  880.         }
  881.         var w = this._form;
  882.         if (z)
  883.             return;
  884.         if (this._activeDefaultButton && !this._activeDefaultButtonClicked)
  885.             this._onFormElementActive(this._activeDefaultButton, 0, 0);
  886.         if (!this._postBackSettings || !this._postBackSettings.async)
  887.             return;
  888.         var b = new Sys.StringBuilder
  889.           , s = w.elements
  890.           , B = s.length
  891.           , t = this._createPanelID(null , this._postBackSettings);
  892.         b.append(t);
  893.         for (f = 0; f < B; f++) {
  894.             var e = s[f]
  895.               , g = e.name;
  896.             if (typeof g === "undefined" || g === null || g.length === 0 || g === this._scriptManagerID)
  897.                 continue;var n = e.tagName.toUpperCase();
  898.             if (n === "INPUT") {
  899.                 var p = e.type;
  900.                 if (this._textTypes.test(p) || (p === "checkbox" || p === "radio") && e.checked) {
  901.                     b.append(encodeURIComponent(g));
  902.                     b.append("=");
  903.                     b.append(encodeURIComponent(e.value));
  904.                     b.append("&")
  905.                 }
  906.             } else if (n === "SELECT") {
  907.                 var A = e.options.length;
  908.                 for (var q = 0; q < A; q++) {
  909.                     var u = e.options[q];
  910.                     if (u.selected) {
  911.                         b.append(encodeURIComponent(g));
  912.                         b.append("=");
  913.                         b.append(encodeURIComponent(u.value));
  914.                         b.append("&")
  915.                     }
  916.                 }
  917.             } else if (n === "TEXTAREA") {
  918.                 b.append(encodeURIComponent(g));
  919.                 b.append("=");
  920.                 b.append(encodeURIComponent(e.value));
  921.                 b.append("&")
  922.             }
  923.         }
  924.         b.append("__ASYNCPOST=true&");
  925.         if (this._additionalInput) {
  926.             b.append(this._additionalInput);
  927.             this._additionalInput = null
  928.         }
  929.         var c = new Sys.Net.WebRequest
  930.           , a = w.action;
  931.         if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
  932.             var r = a.indexOf("#");
  933.             if (r !== -1)
  934.                 a = a.substr(0, r);
  935.             var o = ""
  936.               , v = ""
  937.               , m = a.indexOf("?");
  938.             if (m !== -1) {
  939.                 v = a.substr(m);
  940.                 a = a.substr(0, m)
  941.             }
  942.             if (/^https?\:\/\/.*$/gi.test(a)) {
  943.                 var y = a.indexOf("//") + 2
  944.                   , l = a.indexOf("/", y);
  945.                 if (l === -1) {
  946.                     o = a;
  947.                     a = ""
  948.                 } else {
  949.                     o = a.substr(0, l);
  950.                     a = a.substr(l)
  951.                 }
  952.             }
  953.             a = o + encodeURI(decodeURI(a)) + v
  954.         }
  955.         c.set_url(a);
  956.         c.get_headers()["X-MicrosoftAjax"] = "Delta=true";
  957.         c.get_headers()["Cache-Control"] = "no-cache";
  958.         c.set_timeout(this._asyncPostBackTimeout);
  959.         c.add_completed(Function.createDelegate(this, this._onFormSubmitCompleted));
  960.         c.set_body(b.toString());
  961.         var j, d, k = this._get_eventHandlerList().getHandler("initializeRequest");
  962.         if (k) {
  963.             j = this._postBackSettings.panelsToUpdate;
  964.             d = new Sys.WebForms.InitializeRequestEventArgs(c,this._postBackSettings.sourceElement,j);
  965.             k(this, d);
  966.             h = !d.get_cancel()
  967.         }
  968.         if (!h) {
  969.             if (i)
  970.                 i.preventDefault();
  971.             return
  972.         }
  973.         if (d && d._updated) {
  974.             j = d.get_updatePanelsToUpdate();
  975.             c.set_body(c.get_body().replace(t, this._createPanelID(j, this._postBackSettings)))
  976.         }
  977.         this._scrollPosition = this._getScrollPosition();
  978.         this.abortPostBack();
  979.         k = this._get_eventHandlerList().getHandler("beginRequest");
  980.         if (k) {
  981.             d = new Sys.WebForms.BeginRequestEventArgs(c,this._postBackSettings.sourceElement,j || this._postBackSettings.panelsToUpdate);
  982.             k(this, d)
  983.         }
  984.         if (this._originalDoCallback)
  985.             this._cancelPendingCallbacks();
  986.         this._request = c;
  987.         this._processingRequest = false;
  988.         c.invoke();
  989.         if (i)
  990.             i.preventDefault()
  991.     },
  992.     _onFormSubmitCompleted: function(c) {
  993.         this._processingRequest = true;
  994.         if (c.get_timedOut()) {
  995.             this._endPostBack(this._createPageRequestManagerTimeoutError(), c, null );
  996.             return
  997.         }
  998.         if (c.get_aborted()) {
  999.             this._endPostBack(null , c, null );
  1000.             return
  1001.         }
  1002.         if (!this._request || c.get_webRequest() !== this._request)
  1003.             return;
  1004.         if (c.get_statusCode() !== 200) {
  1005.             this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()), c, null );
  1006.             return
  1007.         }
  1008.         var a = this._parseDelta(c);
  1009.         if (!a)
  1010.             return;
  1011.         var b, e;
  1012.         if (a.asyncPostBackControlIDsNode && a.postBackControlIDsNode && a.updatePanelIDsNode && a.panelsToRefreshNode && a.childUpdatePanelIDsNode) {
  1013.             var r = this._updatePanelIDs
  1014.               , n = this._updatePanelClientIDs
  1015.               , i = a.childUpdatePanelIDsNode.content
  1016.               , p = i.length ? i.split(",") : []
  1017.               , m = this._splitNodeIntoArray(a.asyncPostBackControlIDsNode)
  1018.               , o = this._splitNodeIntoArray(a.postBackControlIDsNode)
  1019.               , q = this._splitNodeIntoArray(a.updatePanelIDsNode)
  1020.               , g = this._splitNodeIntoArray(a.panelsToRefreshNode)
  1021.               , h = a.version4;
  1022.             for (b = 0,
  1023.             e = g.length; b < e; b += h ? 2 : 1) {
  1024.                 var j = (h ? g[b + 1] : "") || this._uniqueIDToClientID(g[b]);
  1025.                 if (!document.getElementById(j)) {
  1026.                     this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, j)), c, a);
  1027.                     return
  1028.                 }
  1029.             }
  1030.             var f = this._processUpdatePanelArrays(q, m, o, h);
  1031.             f.oldUpdatePanelIDs = r;
  1032.             f.oldUpdatePanelClientIDs = n;
  1033.             f.childUpdatePanelIDs = p;
  1034.             f.panelsToRefreshIDs = g;
  1035.             a.updatePanelData = f
  1036.         }
  1037.         a.dataItems = {};
  1038.         var d;
  1039.         for (b = 0,
  1040.         e = a.dataItemNodes.length; b < e; b++) {
  1041.             d = a.dataItemNodes[b];
  1042.             a.dataItems[d.id] = d.content
  1043.         }
  1044.         for (b = 0,
  1045.         e = a.dataItemJsonNodes.length; b < e; b++) {
  1046.             d = a.dataItemJsonNodes[b];
  1047.             a.dataItems[d.id] = Sys.Serialization.JavaScriptSerializer.deserialize(d.content)
  1048.         }
  1049.         var l = this._get_eventHandlerList().getHandler("pageLoading");
  1050.         if (l)
  1051.             l(this, this._getPageLoadingEventArgs(a));
  1052.         Sys._ScriptLoader.readLoadedScripts();
  1053.         Sys.Application.beginCreateComponents();
  1054.         var k = Sys._ScriptLoader.getInstance();
  1055.         this._queueScripts(k, a.scriptBlockNodes, true, false);
  1056.         this._processingRequest = true;
  1057.         k.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadComplete, a)), Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadFailed, a)), null )
  1058.     },
  1059.     _onWindowUnload: function() {
  1060.         this.dispose()
  1061.     },
  1062.     _pageLoaded: function(a, c) {
  1063.         var b = this._get_eventHandlerList().getHandler("pageLoaded");
  1064.         if (b)
  1065.             b(this, this._getPageLoadedEventArgs(a, c));
  1066.         if (!a)
  1067.             Sys.Application.raiseLoad()
  1068.     },
  1069.     _pageLoadedInitialLoad: function() {
  1070.         this._pageLoaded(true, null )
  1071.     },
  1072.     _parseDelta: function(h) {
  1073.         var c = h.get_responseData(), d, i, E, F, D, b = 0, e = null , k = [];
  1074.         while (b < c.length) {
  1075.             d = c.indexOf("|", b);
  1076.             if (d === -1) {
  1077.                 e = this._findText(c, b);
  1078.                 break
  1079.             }
  1080.             i = parseInt(c.substring(b, d), 10);
  1081.             if (i % 1 !== 0) {
  1082.                 e = this._findText(c, b);
  1083.                 break
  1084.             }
  1085.             b = d + 1;
  1086.             d = c.indexOf("|", b);
  1087.             if (d === -1) {
  1088.                 e = this._findText(c, b);
  1089.                 break
  1090.             }
  1091.             E = c.substring(b, d);
  1092.             b = d + 1;
  1093.             d = c.indexOf("|", b);
  1094.             if (d === -1) {
  1095.                 e = this._findText(c, b);
  1096.                 break
  1097.             }
  1098.             F = c.substring(b, d);
  1099.             b = d + 1;
  1100.             if (b + i >= c.length) {
  1101.                 e = this._findText(c, c.length);
  1102.                 break
  1103.             }
  1104.             D = c.substr(b, i);
  1105.             b += i;
  1106.             if (c.charAt(b) !== "|") {
  1107.                 e = this._findText(c, b);
  1108.                 break
  1109.             }
  1110.             b++;
  1111.             Array.add(k, {
  1112.                 type: E,
  1113.                 id: F,
  1114.                 content: D
  1115.             })
  1116.         }
  1117.         if (e) {
  1118.             this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails, e)), h, null );
  1119.             return null
  1120.         }
  1121.         var x = [], w = [], q = [], j = [], t = [], C = [], A = [], z = [], v = [], s = [], m, p, u, n, o, r, y, g;
  1122.         for (var l = 0, G = k.length; l < G; l++) {
  1123.             var a = k[l];
  1124.             switch (a.type) {
  1125.             case "#":
  1126.                 g = a;
  1127.                 break;
  1128.             case "updatePanel":
  1129.                 Array.add(x, a);
  1130.                 break;
  1131.             case "hiddenField":
  1132.                 Array.add(w, a);
  1133.                 break;
  1134.             case "arrayDeclaration":
  1135.                 Array.add(q, a);
  1136.                 break;
  1137.             case "scriptBlock":
  1138.                 Array.add(j, a);
  1139.                 break;
  1140.             case "fallbackScript":
  1141.                 j[j.length - 1].fallback = a.id;
  1142.             case "scriptStartupBlock":
  1143.                 Array.add(t, a);
  1144.                 break;
  1145.             case "expando":
  1146.                 Array.add(C, a);
  1147.                 break;
  1148.             case "onSubmit":
  1149.                 Array.add(A, a);
  1150.                 break;
  1151.             case "asyncPostBackControlIDs":
  1152.                 m = a;
  1153.                 break;
  1154.             case "postBackControlIDs":
  1155.                 p = a;
  1156.                 break;
  1157.             case "updatePanelIDs":
  1158.                 u = a;
  1159.                 break;
  1160.             case "asyncPostBackTimeout":
  1161.                 n = a;
  1162.                 break;
  1163.             case "childUpdatePanelIDs":
  1164.                 o = a;
  1165.                 break;
  1166.             case "panelsToRefreshIDs":
  1167.                 r = a;
  1168.                 break;
  1169.             case "formAction":
  1170.                 y = a;
  1171.                 break;
  1172.             case "dataItem":
  1173.                 Array.add(z, a);
  1174.                 break;
  1175.             case "dataItemJson":
  1176.                 Array.add(v, a);
  1177.                 break;
  1178.             case "scriptDispose":
  1179.                 Array.add(s, a);
  1180.                 break;
  1181.             case "pageRedirect":
  1182.                 if (g && parseFloat(g.content) >= 4)
  1183.                     a.content = unescape(a.content);
  1184.                 if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
  1185.                     var f = document.createElement("a");
  1186.                     f.style.display = "none";
  1187.                     f.attachEvent("onclick", B);
  1188.                     f.href = a.content;
  1189.                     this._form.parentNode.insertBefore(f, this._form);
  1190.                     f.click();
  1191.                     f.detachEvent("onclick", B);
  1192.                     this._form.parentNode.removeChild(f);
  1193.                     function B(a) {
  1194.                         a.cancelBubble = true
  1195.                     }
  1196.                 } else
  1197.                     window.location.href = a.content;
  1198.                 return null ;
  1199.             case "error":
  1200.                 this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id), a.content), h, null );
  1201.                 return null ;
  1202.             case "pageTitle":
  1203.                 document.title = a.content;
  1204.                 break;
  1205.             case "focus":
  1206.                 this._controlIDToFocus = a.content;
  1207.                 break;
  1208.             default:
  1209.                 this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken, a.type)), h, null );
  1210.                 return null
  1211.             }
  1212.         }
  1213.         return {
  1214.             version4: g ? parseFloat(g.content) >= 4 : false,
  1215.             executor: h,
  1216.             updatePanelNodes: x,
  1217.             hiddenFieldNodes: w,
  1218.             arrayDeclarationNodes: q,
  1219.             scriptBlockNodes: j,
  1220.             scriptStartupNodes: t,
  1221.             expandoNodes: C,
  1222.             onSubmitNodes: A,
  1223.             dataItemNodes: z,
  1224.             dataItemJsonNodes: v,
  1225.             scriptDisposeNodes: s,
  1226.             asyncPostBackControlIDsNode: m,
  1227.             postBackControlIDsNode: p,
  1228.             updatePanelIDsNode: u,
  1229.             asyncPostBackTimeoutNode: n,
  1230.             childUpdatePanelIDsNode: o,
  1231.             panelsToRefreshNode: r,
  1232.             formActionNode: y
  1233.         }
  1234.     },
  1235.     _processUpdatePanelArrays: function(e, q, r, f) {
  1236.         var d, c, b;
  1237.         if (e) {
  1238.             var i = e.length
  1239.               , j = f ? 2 : 1;
  1240.             d = new Array(i / j);
  1241.             c = new Array(i / j);
  1242.             b = new Array(i / j);
  1243.             for (var g = 0, h = 0; g < i; g += j,
  1244.             h++) {
  1245.                 var p, a = e[g], k = f ? e[g + 1] : "";
  1246.                 p = a.charAt(0) === "t";
  1247.                 a = a.substr(1);
  1248.                 if (!k)
  1249.                     k = this._uniqueIDToClientID(a);
  1250.                 b[h] = p;
  1251.                 d[h] = a;
  1252.                 c[h] = k
  1253.             }
  1254.         } else {
  1255.             d = [];
  1256.             c = [];
  1257.             b = []
  1258.         }
  1259.         var n = []
  1260.           , l = [];
  1261.         this._convertToClientIDs(q, n, l, f);
  1262.         var o = []
  1263.           , m = [];
  1264.         this._convertToClientIDs(r, o, m, f);
  1265.         return {
  1266.             updatePanelIDs: d,
  1267.             updatePanelClientIDs: c,
  1268.             updatePanelHasChildrenAsTriggers: b,
  1269.             asyncPostBackControlIDs: n,
  1270.             asyncPostBackControlClientIDs: l,
  1271.             postBackControlIDs: o,
  1272.             postBackControlClientIDs: m
  1273.         }
  1274.     },
  1275.     _queueScripts: function(scriptLoader, scriptBlockNodes, queueIncludes, queueBlocks) {
  1276.         for (var i = 0, l = scriptBlockNodes.length; i < l; i++) {
  1277.             var scriptBlockType = scriptBlockNodes[i].id;
  1278.             switch (scriptBlockType) {
  1279.             case "ScriptContentNoTags":
  1280.                 if (!queueBlocks)
  1281.                     continue;scriptLoader.queueScriptBlock(scriptBlockNodes[i].content);
  1282.                 break;
  1283.             case "ScriptContentWithTags":
  1284.                 var scriptTagAttributes;
  1285.                 eval("scriptTagAttributes = " + scriptBlockNodes[i].content);
  1286.                 if (scriptTagAttributes.src) {
  1287.                     if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(scriptTagAttributes.src))
  1288.                         continue
  1289.                 } else if (!queueBlocks)
  1290.                     continue;scriptLoader.queueCustomScriptTag(scriptTagAttributes);
  1291.                 break;
  1292.             case "ScriptPath":
  1293.                 var script = scriptBlockNodes[i];
  1294.                 if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(script.content))
  1295.                     continue;scriptLoader.queueScriptReference(script.content, script.fallback)
  1296.             }
  1297.         }
  1298.     },
  1299.     _registerDisposeScript: function(a, b) {
  1300.         if (!this._scriptDisposes[a])
  1301.             this._scriptDisposes[a] = [b];
  1302.         else
  1303.             Array.add(this._scriptDisposes[a], b)
  1304.     },
  1305.     _scriptIncludesLoadComplete: function(e, b) {
  1306.         if (b.executor.get_webRequest() !== this._request)
  1307.             return;
  1308.         this._commitControls(b.updatePanelData, b.asyncPostBackTimeoutNode ? b.asyncPostBackTimeoutNode.content : null );
  1309.         if (b.formActionNode)
  1310.             this._form.action = b.formActionNode.content;
  1311.         var a, d, c;
  1312.         for (a = 0,
  1313.         d = b.updatePanelNodes.length; a < d; a++) {
  1314.             c = b.updatePanelNodes[a];
  1315.             var j = document.getElementById(c.id);
  1316.             if (!j) {
  1317.                 this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, c.id)), b.executor, b);
  1318.                 return
  1319.             }
  1320.             this._updatePanel(j, c.content)
  1321.         }
  1322.         for (a = 0,
  1323.         d = b.scriptDisposeNodes.length; a < d; a++) {
  1324.             c = b.scriptDisposeNodes[a];
  1325.             this._registerDisposeScript(c.id, c.content)
  1326.         }
  1327.         for (a = 0,
  1328.         d = this._transientFields.length; a < d; a++) {
  1329.             var g = document.getElementById(this._transientFields[a]);
  1330.             if (g) {
  1331.                 var k = g._isContained ? g.parentNode : g;
  1332.                 k.parentNode.removeChild(k)
  1333.             }
  1334.         }
  1335.         for (a = 0,
  1336.         d = b.hiddenFieldNodes.length; a < d; a++) {
  1337.             c = b.hiddenFieldNodes[a];
  1338.             this._createHiddenField(c.id, c.content)
  1339.         }
  1340.         if (b.scriptsFailed)
  1341.             throw Sys._ScriptLoader._errorScriptLoadFailed(b.scriptsFailed.src, b.scriptsFailed.multipleCallbacks);
  1342.         this._queueScripts(e, b.scriptBlockNodes, false, true);
  1343.         var i = "";
  1344.         for (a = 0,
  1345.         d = b.arrayDeclarationNodes.length; a < d; a++) {
  1346.             c = b.arrayDeclarationNodes[a];
  1347.             i += "Sys.WebForms.PageRequestManager._addArrayElement('" + c.id + "', " + c.content + ");\r\n"
  1348.         }
  1349.         var h = "";
  1350.         for (a = 0,
  1351.         d = b.expandoNodes.length; a < d; a++) {
  1352.             c = b.expandoNodes[a];
  1353.             h += c.id + " = " + c.content + "\r\n"
  1354.         }
  1355.         if (i.length)
  1356.             e.queueScriptBlock(i);
  1357.         if (h.length)
  1358.             e.queueScriptBlock(h);
  1359.         this._queueScripts(e, b.scriptStartupNodes, true, true);
  1360.         var f = "";
  1361.         for (a = 0,
  1362.         d = b.onSubmitNodes.length; a < d; a++) {
  1363.             if (a === 0)
  1364.                 f = "Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";
  1365.             f += b.onSubmitNodes[a].content + "\r\n"
  1366.         }
  1367.         if (f.length) {
  1368.             f += "\r\nreturn true;\r\n});\r\n";
  1369.             e.queueScriptBlock(f)
  1370.         }
  1371.         e.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptsLoadComplete, b)), null , null )
  1372.     },
  1373.     _scriptIncludesLoadFailed: function(d, c, b, a) {
  1374.         a.scriptsFailed = {
  1375.             src: c.src,
  1376.             multipleCallbacks: b
  1377.         };
  1378.         this._scriptIncludesLoadComplete(d, a)
  1379.     },
  1380.     _scriptsLoadComplete: function(f, c) {
  1381.         var e = c.executor;
  1382.         if (window.__theFormPostData)
  1383.             window.__theFormPostData = "";
  1384.         if (window.__theFormPostCollection)
  1385.             window.__theFormPostCollection = [];
  1386.         if (window.WebForm_InitCallback)
  1387.             window.WebForm_InitCallback();
  1388.         if (this._scrollPosition) {
  1389.             if (window.scrollTo)
  1390.                 window.scrollTo(this._scrollPosition.x, this._scrollPosition.y);
  1391.             this._scrollPosition = null
  1392.         }
  1393.         Sys.Application.endCreateComponents();
  1394.         this._pageLoaded(false, c);
  1395.         this._endPostBack(null , e, c);
  1396.         if (this._controlIDToFocus) {
  1397.             var a, d;
  1398.             if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
  1399.                 var b = $get(this._controlIDToFocus);
  1400.                 a = b;
  1401.                 if (b && !WebForm_CanFocus(b))
  1402.                     a = WebForm_FindFirstFocusableChild(b);
  1403.                 if (a && typeof a.contentEditable !== "undefined") {
  1404.                     d = a.contentEditable;
  1405.                     a.contentEditable = false
  1406.                 } else
  1407.                     a = null
  1408.             }
  1409.             WebForm_AutoFocus(this._controlIDToFocus);
  1410.             if (a)
  1411.                 a.contentEditable = d;
  1412.             this._controlIDToFocus = null
  1413.         }
  1414.     },
  1415.     _splitNodeIntoArray: function(b) {
  1416.         var a = b.content
  1417.           , c = a.length ? a.split(",") : [];
  1418.         return c
  1419.     },
  1420.     _uniqueIDToClientID: function(a) {
  1421.         return a.replace(/\$/g, "_")
  1422.     },
  1423.     _updateControls: function(d, a, c, b, e) {
  1424.         this._commitControls(this._processUpdatePanelArrays(d, a, c, e), b)
  1425.     },
  1426.     _updatePanel: function(updatePanelElement, rendering) {
  1427.         for (var updatePanelID in this._scriptDisposes)
  1428.             if (this._elementContains(updatePanelElement, document.getElementById(updatePanelID))) {
  1429.                 var disposeScripts = this._scriptDisposes[updatePanelID];
  1430.                 for (var i = 0, l = disposeScripts.length; i < l; i++)
  1431.                     eval(disposeScripts[i]);
  1432.                 delete this._scriptDisposes[updatePanelID]
  1433.             }
  1434.         Sys.Application.disposeElement(updatePanelElement, true);
  1435.         updatePanelElement.innerHTML = rendering
  1436.     },
  1437.     _validPosition: function(a) {
  1438.         return typeof a !== "undefined" && a !== null && a !== 0
  1439.     }
  1440. };
  1441. Sys.WebForms.PageRequestManager.getInstance = function() {
  1442.     var a = Sys.WebForms.PageRequestManager._instance;
  1443.     if (!a)
  1444.         a = Sys.WebForms.PageRequestManager._instance = new Sys.WebForms.PageRequestManager;
  1445.     return a
  1446. }
  1447. ;
  1448. Sys.WebForms.PageRequestManager._addArrayElement = function(a) {
  1449.     if (!window[a])
  1450.         window[a] = [];
  1451.     for (var b = 1, c = arguments.length; b < c; b++)
  1452.         Array.add(window[a], arguments[b])
  1453. }
  1454. ;
  1455. Sys.WebForms.PageRequestManager._initialize = function() {
  1456.     var a = Sys.WebForms.PageRequestManager.getInstance();
  1457.     a._initializeInternal.apply(a, arguments)
  1458. }
  1459. ;
  1460. Sys.WebForms.PageRequestManager.registerClass("Sys.WebForms.PageRequestManager");
  1461. Sys.UI._UpdateProgress = function(a) {
  1462.     Sys.UI._UpdateProgress.initializeBase(this, [a]);
  1463.     this._displayAfter = 500;
  1464.     this._dynamicLayout = true;
  1465.     this._associatedUpdatePanelId = null ;
  1466.     this._beginRequestHandlerDelegate = null ;
  1467.     this._startDelegate = null ;
  1468.     this._endRequestHandlerDelegate = null ;
  1469.     this._pageRequestManager = null ;
  1470.     this._timerCookie = null
  1471. }
  1472. ;
  1473. Sys.UI._UpdateProgress.prototype = {
  1474.     get_displayAfter: function() {
  1475.         return this._displayAfter
  1476.     },
  1477.     set_displayAfter: function(a) {
  1478.         this._displayAfter = a
  1479.     },
  1480.     get_dynamicLayout: function() {
  1481.         return this._dynamicLayout
  1482.     },
  1483.     set_dynamicLayout: function(a) {
  1484.         this._dynamicLayout = a
  1485.     },
  1486.     get_associatedUpdatePanelId: function() {
  1487.         return this._associatedUpdatePanelId
  1488.     },
  1489.     set_associatedUpdatePanelId: function(a) {
  1490.         this._associatedUpdatePanelId = a
  1491.     },
  1492.     get_role: function() {
  1493.         return "status"
  1494.     },
  1495.     _clearTimeout: function() {
  1496.         if (this._timerCookie) {
  1497.             window.clearTimeout(this._timerCookie);
  1498.             this._timerCookie = null
  1499.         }
  1500.     },
  1501.     _getUniqueID: function(b) {
  1502.         var a = Array.indexOf(this._pageRequestManager._updatePanelClientIDs, b);
  1503.         return a === -1 ? null : this._pageRequestManager._updatePanelIDs[a]
  1504.     },
  1505.     _handleBeginRequest: function(f, e) {
  1506.         var b = e.get_postBackElement()
  1507.           , a = true
  1508.           , d = this._associatedUpdatePanelId;
  1509.         if (this._associatedUpdatePanelId) {
  1510.             var c = e.get_updatePanelsToUpdate();
  1511.             if (c && c.length)
  1512.                 a = Array.contains(c, d) || Array.contains(c, this._getUniqueID(d));
  1513.             else
  1514.                 a = false
  1515.         }
  1516.         while (!a && b) {
  1517.             if (b.id && this._associatedUpdatePanelId === b.id)
  1518.                 a = true;
  1519.             b = b.parentNode
  1520.         }
  1521.         if (a)
  1522.             this._timerCookie = window.setTimeout(this._startDelegate, this._displayAfter)
  1523.     },
  1524.     _startRequest: function() {
  1525.         if (this._pageRequestManager.get_isInAsyncPostBack()) {
  1526.             var a = this.get_element();
  1527.             if (this._dynamicLayout)
  1528.                 a.style.display = "block";
  1529.             else
  1530.                 a.style.visibility = "visible";
  1531.             if (this.get_role() === "status")
  1532.                 a.setAttribute("aria-hidden", "false")
  1533.         }
  1534.         this._timerCookie = null
  1535.     },
  1536.     _handleEndRequest: function() {
  1537.         var a = this.get_element();
  1538.         if (this._dynamicLayout)
  1539.             a.style.display = "none";
  1540.         else
  1541.             a.style.visibility = "hidden";
  1542.         if (this.get_role() === "status")
  1543.             a.setAttribute("aria-hidden", "true");
  1544.         this._clearTimeout()
  1545.     },
  1546.     dispose: function() {
  1547.         if (this._beginRequestHandlerDelegate !== null ) {
  1548.             this._pageRequestManager.remove_beginRequest(this._beginRequestHandlerDelegate);
  1549.             this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);
  1550.             this._beginRequestHandlerDelegate = null ;
  1551.             this._endRequestHandlerDelegate = null
  1552.         }
  1553.         this._clearTimeout();
  1554.         Sys.UI._UpdateProgress.callBaseMethod(this, "dispose")
  1555.     },
  1556.     initialize: function() {
  1557.         Sys.UI._UpdateProgress.callBaseMethod(this, "initialize");
  1558.         if (this.get_role() === "status")
  1559.             this.get_element().setAttribute("aria-hidden", "true");
  1560.         this._beginRequestHandlerDelegate = Function.createDelegate(this, this._handleBeginRequest);
  1561.         this._endRequestHandlerDelegate = Function.createDelegate(this, this._handleEndRequest);
  1562.         this._startDelegate = Function.createDelegate(this, this._startRequest);
  1563.         if (Sys.WebForms && Sys.WebForms.PageRequestManager)
  1564.             this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
  1565.         if (this._pageRequestManager !== null ) {
  1566.             this._pageRequestManager.add_beginRequest(this._beginRequestHandlerDelegate);
  1567.             this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate)
  1568.         }
  1569.     }
  1570. };
  1571. Sys.UI._UpdateProgress.registerClass("Sys.UI._UpdateProgress", Sys.UI.Control);
  1572. Type.registerNamespace('Sys.WebForms');
  1573. Sys.WebForms.Res = {
  1574.     "PRM_UnknownToken": "Unknown token: \u0027{0}\u0027.",
  1575.     "PRM_MissingPanel": "Could not find UpdatePanel with ID \u0027{0}\u0027. If it is being updated dynamically then it must be inside another UpdatePanel.",
  1576.     "PRM_ServerError": "An unknown error occurred while processing the request on the server. The status code returned from the server was: {0}",
  1577.     "PRM_ParserError": "The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\r\nDetails: {0}",
  1578.     "PRM_TimeoutError": "The server request timed out.",
  1579.     "PRM_ParserErrorDetails": "Error parsing near \u0027{0}\u0027.",
  1580.     "PRM_CannotRegisterTwice": "The PageRequestManager cannot be initialized more than once."
  1581. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement