Advertisement
Guest User

MicrosoftAjax.js

a guest
Jun 8th, 2016
216
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. // MicrosoftAjax.js
  5. Function.__typeName = "Function";
  6. Function.__class = true;
  7. Function.createCallback = function(b, a) {
  8.     return function() {
  9.         var e = arguments.length;
  10.         if (e > 0) {
  11.             var d = [];
  12.             for (var c = 0; c < e; c++)
  13.                 d[c] = arguments[c];
  14.             d[e] = a;
  15.             return b.apply(this, d)
  16.         }
  17.         return b.call(this, a)
  18.     }
  19. }
  20. ;
  21. Function.createDelegate = function(a, b) {
  22.     return function() {
  23.         return b.apply(a, arguments)
  24.     }
  25. }
  26. ;
  27. Function.emptyFunction = Function.emptyMethod = function() {}
  28. ;
  29. Function.validateParameters = function(c, b, a) {
  30.     return Function._validateParams(c, b, a)
  31. }
  32. ;
  33. Function._validateParams = function(g, e, c) {
  34.     var a, d = e.length;
  35.     c = c || typeof c === "undefined";
  36.     a = Function._validateParameterCount(g, e, c);
  37.     if (a) {
  38.         a.popStackFrame();
  39.         return a
  40.     }
  41.     for (var b = 0, i = g.length; b < i; b++) {
  42.         var f = e[Math.min(b, d - 1)]
  43.           , h = f.name;
  44.         if (f.parameterArray)
  45.             h += "[" + (b - d + 1) + "]";
  46.         else if (!c && b >= d)
  47.             break;
  48.         a = Function._validateParameter(g[b], f, h);
  49.         if (a) {
  50.             a.popStackFrame();
  51.             return a
  52.         }
  53.     }
  54.     return null
  55. }
  56. ;
  57. Function._validateParameterCount = function(j, d, i) {
  58.     var a, c, b = d.length, e = j.length;
  59.     if (e < b) {
  60.         var f = b;
  61.         for (a = 0; a < b; a++) {
  62.             var g = d[a];
  63.             if (g.optional || g.parameterArray)
  64.                 f--
  65.         }
  66.         if (e < f)
  67.             c = true
  68.     } else if (i && e > b) {
  69.         c = true;
  70.         for (a = 0; a < b; a++)
  71.             if (d[a].parameterArray) {
  72.                 c = false;
  73.                 break
  74.             }
  75.     }
  76.     if (c) {
  77.         var h = Error.parameterCount();
  78.         h.popStackFrame();
  79.         return h
  80.     }
  81.     return null
  82. }
  83. ;
  84. Function._validateParameter = function(c, a, h) {
  85.     var b, g = a.type, l = !!a.integer, k = !!a.domElement, m = !!a.mayBeNull;
  86.     b = Function._validateParameterType(c, g, l, k, m, h);
  87.     if (b) {
  88.         b.popStackFrame();
  89.         return b
  90.     }
  91.     var e = a.elementType
  92.       , f = !!a.elementMayBeNull;
  93.     if (g === Array && typeof c !== "undefined" && c !== null && (e || !f)) {
  94.         var j = !!a.elementInteger
  95.           , i = !!a.elementDomElement;
  96.         for (var d = 0; d < c.length; d++) {
  97.             var n = c[d];
  98.             b = Function._validateParameterType(n, e, j, i, f, h + "[" + d + "]");
  99.             if (b) {
  100.                 b.popStackFrame();
  101.                 return b
  102.             }
  103.         }
  104.     }
  105.     return null
  106. }
  107. ;
  108. Function._validateParameterType = function(b, c, k, j, h, d) {
  109.     var a, g;
  110.     if (typeof b === "undefined")
  111.         if (h)
  112.             return null ;
  113.         else {
  114.             a = Error.argumentUndefined(d);
  115.             a.popStackFrame();
  116.             return a
  117.         }
  118.     if (b === null )
  119.         if (h)
  120.             return null ;
  121.         else {
  122.             a = Error.argumentNull(d);
  123.             a.popStackFrame();
  124.             return a
  125.         }
  126.     if (c && c.__enum) {
  127.         if (typeof b !== "number") {
  128.             a = Error.argumentType(d, Object.getType(b), c);
  129.             a.popStackFrame();
  130.             return a
  131.         }
  132.         if (b % 1 === 0) {
  133.             var e = c.prototype;
  134.             if (!c.__flags || b === 0) {
  135.                 for (g in e)
  136.                     if (e[g] === b)
  137.                         return null
  138.             } else {
  139.                 var i = b;
  140.                 for (g in e) {
  141.                     var f = e[g];
  142.                     if (f === 0)
  143.                         continue;if ((f & b) === f)
  144.                         i -= f;
  145.                     if (i === 0)
  146.                         return null
  147.                 }
  148.             }
  149.         }
  150.         a = Error.argumentOutOfRange(d, b, String.format(Sys.Res.enumInvalidValue, b, c.getName()));
  151.         a.popStackFrame();
  152.         return a
  153.     }
  154.     if (j && (!Sys._isDomElement(b) || b.nodeType === 3)) {
  155.         a = Error.argument(d, Sys.Res.argumentDomElement);
  156.         a.popStackFrame();
  157.         return a
  158.     }
  159.     if (c && !Sys._isInstanceOfType(c, b)) {
  160.         a = Error.argumentType(d, Object.getType(b), c);
  161.         a.popStackFrame();
  162.         return a
  163.     }
  164.     if (c === Number && k)
  165.         if (b % 1 !== 0) {
  166.             a = Error.argumentOutOfRange(d, b, Sys.Res.argumentInteger);
  167.             a.popStackFrame();
  168.             return a
  169.         }
  170.     return null
  171. }
  172. ;
  173. Error.__typeName = "Error";
  174. Error.__class = true;
  175. Error.create = function(d, b) {
  176.     var a = new Error(d);
  177.     a.message = d;
  178.     if (b)
  179.         for (var c in b)
  180.             a[c] = b[c];
  181.     a.popStackFrame();
  182.     return a
  183. }
  184. ;
  185. Error.argument = function(a, c) {
  186.     var b = "Sys.ArgumentException: " + (c ? c : Sys.Res.argument);
  187.     if (a)
  188.         b += "\n" + String.format(Sys.Res.paramName, a);
  189.     var d = Error.create(b, {
  190.         name: "Sys.ArgumentException",
  191.         paramName: a
  192.     });
  193.     d.popStackFrame();
  194.     return d
  195. }
  196. ;
  197. Error.argumentNull = function(a, c) {
  198.     var b = "Sys.ArgumentNullException: " + (c ? c : Sys.Res.argumentNull);
  199.     if (a)
  200.         b += "\n" + String.format(Sys.Res.paramName, a);
  201.     var d = Error.create(b, {
  202.         name: "Sys.ArgumentNullException",
  203.         paramName: a
  204.     });
  205.     d.popStackFrame();
  206.     return d
  207. }
  208. ;
  209. Error.argumentOutOfRange = function(c, a, d) {
  210.     var b = "Sys.ArgumentOutOfRangeException: " + (d ? d : Sys.Res.argumentOutOfRange);
  211.     if (c)
  212.         b += "\n" + String.format(Sys.Res.paramName, c);
  213.     if (typeof a !== "undefined" && a !== null )
  214.         b += "\n" + String.format(Sys.Res.actualValue, a);
  215.     var e = Error.create(b, {
  216.         name: "Sys.ArgumentOutOfRangeException",
  217.         paramName: c,
  218.         actualValue: a
  219.     });
  220.     e.popStackFrame();
  221.     return e
  222. }
  223. ;
  224. Error.argumentType = function(d, c, b, e) {
  225.     var a = "Sys.ArgumentTypeException: ";
  226.     if (e)
  227.         a += e;
  228.     else if (c && b)
  229.         a += String.format(Sys.Res.argumentTypeWithTypes, c.getName(), b.getName());
  230.     else
  231.         a += Sys.Res.argumentType;
  232.     if (d)
  233.         a += "\n" + String.format(Sys.Res.paramName, d);
  234.     var f = Error.create(a, {
  235.         name: "Sys.ArgumentTypeException",
  236.         paramName: d,
  237.         actualType: c,
  238.         expectedType: b
  239.     });
  240.     f.popStackFrame();
  241.     return f
  242. }
  243. ;
  244. Error.argumentUndefined = function(a, c) {
  245.     var b = "Sys.ArgumentUndefinedException: " + (c ? c : Sys.Res.argumentUndefined);
  246.     if (a)
  247.         b += "\n" + String.format(Sys.Res.paramName, a);
  248.     var d = Error.create(b, {
  249.         name: "Sys.ArgumentUndefinedException",
  250.         paramName: a
  251.     });
  252.     d.popStackFrame();
  253.     return d
  254. }
  255. ;
  256. Error.format = function(a) {
  257.     var c = "Sys.FormatException: " + (a ? a : Sys.Res.format)
  258.       , b = Error.create(c, {
  259.         name: "Sys.FormatException"
  260.     });
  261.     b.popStackFrame();
  262.     return b
  263. }
  264. ;
  265. Error.invalidOperation = function(a) {
  266.     var c = "Sys.InvalidOperationException: " + (a ? a : Sys.Res.invalidOperation)
  267.       , b = Error.create(c, {
  268.         name: "Sys.InvalidOperationException"
  269.     });
  270.     b.popStackFrame();
  271.     return b
  272. }
  273. ;
  274. Error.notImplemented = function(a) {
  275.     var c = "Sys.NotImplementedException: " + (a ? a : Sys.Res.notImplemented)
  276.       , b = Error.create(c, {
  277.         name: "Sys.NotImplementedException"
  278.     });
  279.     b.popStackFrame();
  280.     return b
  281. }
  282. ;
  283. Error.parameterCount = function(a) {
  284.     var c = "Sys.ParameterCountException: " + (a ? a : Sys.Res.parameterCount)
  285.       , b = Error.create(c, {
  286.         name: "Sys.ParameterCountException"
  287.     });
  288.     b.popStackFrame();
  289.     return b
  290. }
  291. ;
  292. Error.prototype.popStackFrame = function() {
  293.     if (typeof this.stack === "undefined" || this.stack === null || typeof this.fileName === "undefined" || this.fileName === null || typeof this.lineNumber === "undefined" || this.lineNumber === null )
  294.         return;
  295.     var a = this.stack.split("\n")
  296.       , c = a[0]
  297.       , e = this.fileName + ":" + this.lineNumber;
  298.     while (typeof c !== "undefined" && c !== null && c.indexOf(e) === -1) {
  299.         a.shift();
  300.         c = a[0]
  301.     }
  302.     var d = a[1];
  303.     if (typeof d === "undefined" || d === null )
  304.         return;
  305.     var b = d.match(/@(.*):(\d+)$/);
  306.     if (typeof b === "undefined" || b === null )
  307.         return;
  308.     this.fileName = b[1];
  309.     this.lineNumber = parseInt(b[2]);
  310.     a.shift();
  311.     this.stack = a.join("\n")
  312. }
  313. ;
  314. Object.__typeName = "Object";
  315. Object.__class = true;
  316. Object.getType = function(b) {
  317.     var a = b.constructor;
  318.     if (!a || typeof a !== "function" || !a.__typeName || a.__typeName === "Object")
  319.         return Object;
  320.     return a
  321. }
  322. ;
  323. Object.getTypeName = function(a) {
  324.     return Object.getType(a).getName()
  325. }
  326. ;
  327. String.__typeName = "String";
  328. String.__class = true;
  329. String.prototype.endsWith = function(a) {
  330.     return this.substr(this.length - a.length) === a
  331. }
  332. ;
  333. String.prototype.startsWith = function(a) {
  334.     return this.substr(0, a.length) === a
  335. }
  336. ;
  337. String.prototype.trim = function() {
  338.     return this.replace(/^\s+|\s+$/g, "")
  339. }
  340. ;
  341. String.prototype.trimEnd = function() {
  342.     return this.replace(/\s+$/, "")
  343. }
  344. ;
  345. String.prototype.trimStart = function() {
  346.     return this.replace(/^\s+/, "")
  347. }
  348. ;
  349. String.format = function() {
  350.     return String._toFormattedString(false, arguments)
  351. }
  352. ;
  353. String._toFormattedString = function(l, j) {
  354.     var c = ""
  355.       , e = j[0];
  356.     for (var a = 0; true; ) {
  357.         var f = e.indexOf("{", a)
  358.           , d = e.indexOf("}", a);
  359.         if (f < 0 && d < 0) {
  360.             c += e.slice(a);
  361.             break
  362.         }
  363.         if (d > 0 && (d < f || f < 0)) {
  364.             c += e.slice(a, d + 1);
  365.             a = d + 2;
  366.             continue
  367.         }
  368.         c += e.slice(a, f);
  369.         a = f + 1;
  370.         if (e.charAt(a) === "{") {
  371.             c += "{";
  372.             a++;
  373.             continue
  374.         }
  375.         if (d < 0)
  376.             break;
  377.         var h = e.substring(a, d)
  378.           , g = h.indexOf(":")
  379.           , k = parseInt(g < 0 ? h : h.substring(0, g), 10) + 1
  380.           , i = g < 0 ? "" : h.substring(g + 1)
  381.           , b = j[k];
  382.         if (typeof b === "undefined" || b === null )
  383.             b = "";
  384.         if (b.toFormattedString)
  385.             c += b.toFormattedString(i);
  386.         else if (l && b.localeFormat)
  387.             c += b.localeFormat(i);
  388.         else if (b.format)
  389.             c += b.format(i);
  390.         else
  391.             c += b.toString();
  392.         a = d + 1
  393.     }
  394.     return c
  395. }
  396. ;
  397. Boolean.__typeName = "Boolean";
  398. Boolean.__class = true;
  399. Boolean.parse = function(b) {
  400.     var a = b.trim().toLowerCase();
  401.     if (a === "false")
  402.         return false;
  403.     if (a === "true")
  404.         return true
  405. }
  406. ;
  407. Date.__typeName = "Date";
  408. Date.__class = true;
  409. Number.__typeName = "Number";
  410. Number.__class = true;
  411. RegExp.__typeName = "RegExp";
  412. RegExp.__class = true;
  413. if (!window)
  414.     this.window = this;
  415. window.Type = Function;
  416. Type.prototype.callBaseMethod = function(a, d, b) {
  417.     var c = Sys._getBaseMethod(this, a, d);
  418.     if (!b)
  419.         return c.apply(a);
  420.     else
  421.         return c.apply(a, b)
  422. }
  423. ;
  424. Type.prototype.getBaseMethod = function(a, b) {
  425.     return Sys._getBaseMethod(this, a, b)
  426. }
  427. ;
  428. Type.prototype.getBaseType = function() {
  429.     return typeof this.__baseType === "undefined" ? null : this.__baseType
  430. }
  431. ;
  432. Type.prototype.getInterfaces = function() {
  433.     var a = []
  434.       , b = this;
  435.     while (b) {
  436.         var c = b.__interfaces;
  437.         if (c)
  438.             for (var d = 0, f = c.length; d < f; d++) {
  439.                 var e = c[d];
  440.                 if (!Array.contains(a, e))
  441.                     a[a.length] = e
  442.             }
  443.         b = b.__baseType
  444.     }
  445.     return a
  446. }
  447. ;
  448. Type.prototype.getName = function() {
  449.     return typeof this.__typeName === "undefined" ? "" : this.__typeName
  450. }
  451. ;
  452. Type.prototype.implementsInterface = function(d) {
  453.     this.resolveInheritance();
  454.     var c = d.getName()
  455.       , a = this.__interfaceCache;
  456.     if (a) {
  457.         var e = a[c];
  458.         if (typeof e !== "undefined")
  459.             return e
  460.     } else
  461.         a = this.__interfaceCache = {};
  462.     var b = this;
  463.     while (b) {
  464.         var f = b.__interfaces;
  465.         if (f)
  466.             if (Array.indexOf(f, d) !== -1)
  467.                 return a[c] = true;
  468.         b = b.__baseType
  469.     }
  470.     return a[c] = false
  471. }
  472. ;
  473. Type.prototype.inheritsFrom = function(b) {
  474.     this.resolveInheritance();
  475.     var a = this.__baseType;
  476.     while (a) {
  477.         if (a === b)
  478.             return true;
  479.         a = a.__baseType
  480.     }
  481.     return false
  482. }
  483. ;
  484. Type.prototype.initializeBase = function(a, b) {
  485.     this.resolveInheritance();
  486.     if (this.__baseType)
  487.         if (!b)
  488.             this.__baseType.apply(a);
  489.         else
  490.             this.__baseType.apply(a, b);
  491.     return a
  492. }
  493. ;
  494. Type.prototype.isImplementedBy = function(a) {
  495.     if (typeof a === "undefined" || a === null )
  496.         return false;
  497.     var b = Object.getType(a);
  498.     return !!(b.implementsInterface && b.implementsInterface(this))
  499. }
  500. ;
  501. Type.prototype.isInstanceOfType = function(a) {
  502.     return Sys._isInstanceOfType(this, a)
  503. }
  504. ;
  505. Type.prototype.registerClass = function(c, b, d) {
  506.     this.prototype.constructor = this;
  507.     this.__typeName = c;
  508.     this.__class = true;
  509.     if (b) {
  510.         this.__baseType = b;
  511.         this.__basePrototypePending = true
  512.     }
  513.     Sys.__upperCaseTypes[c.toUpperCase()] = this;
  514.     if (d) {
  515.         this.__interfaces = [];
  516.         for (var a = 2, f = arguments.length; a < f; a++) {
  517.             var e = arguments[a];
  518.             this.__interfaces.push(e)
  519.         }
  520.     }
  521.     return this
  522. }
  523. ;
  524. Type.prototype.registerInterface = function(a) {
  525.     Sys.__upperCaseTypes[a.toUpperCase()] = this;
  526.     this.prototype.constructor = this;
  527.     this.__typeName = a;
  528.     this.__interface = true;
  529.     return this
  530. }
  531. ;
  532. Type.prototype.resolveInheritance = function() {
  533.     if (this.__basePrototypePending) {
  534.         var b = this.__baseType;
  535.         b.resolveInheritance();
  536.         for (var a in b.prototype) {
  537.             var c = b.prototype[a];
  538.             if (!this.prototype[a])
  539.                 this.prototype[a] = c
  540.         }
  541.         delete this.__basePrototypePending
  542.     }
  543. }
  544. ;
  545. Type.getRootNamespaces = function() {
  546.     return Array.clone(Sys.__rootNamespaces)
  547. }
  548. ;
  549. Type.isClass = function(a) {
  550.     if (typeof a === "undefined" || a === null )
  551.         return false;
  552.     return !!a.__class
  553. }
  554. ;
  555. Type.isInterface = function(a) {
  556.     if (typeof a === "undefined" || a === null )
  557.         return false;
  558.     return !!a.__interface
  559. }
  560. ;
  561. Type.isNamespace = function(a) {
  562.     if (typeof a === "undefined" || a === null )
  563.         return false;
  564.     return !!a.__namespace
  565. }
  566. ;
  567. Type.parse = function(typeName, ns) {
  568.     var fn;
  569.     if (ns) {
  570.         fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + "." + typeName.toUpperCase()];
  571.         return fn || null
  572.     }
  573.     if (!typeName)
  574.         return null ;
  575.     if (!Type.__htClasses)
  576.         Type.__htClasses = {};
  577.     fn = Type.__htClasses[typeName];
  578.     if (!fn) {
  579.         fn = eval(typeName);
  580.         Type.__htClasses[typeName] = fn
  581.     }
  582.     return fn
  583. }
  584. ;
  585. Type.registerNamespace = function(e) {
  586.     var d = window
  587.       , c = e.split(".");
  588.     for (var b = 0; b < c.length; b++) {
  589.         var f = c[b]
  590.           , a = d[f];
  591.         if (!a)
  592.             a = d[f] = {};
  593.         if (!a.__namespace) {
  594.             if (b === 0 && e !== "Sys")
  595.                 Sys.__rootNamespaces[Sys.__rootNamespaces.length] = a;
  596.             a.__namespace = true;
  597.             a.__typeName = c.slice(0, b + 1).join(".");
  598.             a.getName = function() {
  599.                 return this.__typeName
  600.             }
  601.         }
  602.         d = a
  603.     }
  604. }
  605. ;
  606. Type._checkDependency = function(c, a) {
  607.     var d = Type._registerScript._scripts
  608.       , b = d ? !!d[c] : false;
  609.     if (typeof a !== "undefined" && !b)
  610.         throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, a, c));
  611.     return b
  612. }
  613. ;
  614. Type._registerScript = function(a, c) {
  615.     var b = Type._registerScript._scripts;
  616.     if (!b)
  617.         Type._registerScript._scripts = b = {};
  618.     if (b[a])
  619.         throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, a));
  620.     b[a] = true;
  621.     if (c)
  622.         for (var d = 0, f = c.length; d < f; d++) {
  623.             var e = c[d];
  624.             if (!Type._checkDependency(e))
  625.                 throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, a, e))
  626.         }
  627. }
  628. ;
  629. Type.registerNamespace("Sys");
  630. Sys.__upperCaseTypes = {};
  631. Sys.__rootNamespaces = [Sys];
  632. Sys._isInstanceOfType = function(c, b) {
  633.     if (typeof b === "undefined" || b === null )
  634.         return false;
  635.     if (b instanceof c)
  636.         return true;
  637.     var a = Object.getType(b);
  638.     return !!(a === c) || a.inheritsFrom && a.inheritsFrom(c) || a.implementsInterface && a.implementsInterface(c)
  639. }
  640. ;
  641. Sys._getBaseMethod = function(d, e, c) {
  642.     var b = d.getBaseType();
  643.     if (b) {
  644.         var a = b.prototype[c];
  645.         return a instanceof Function ? a : null
  646.     }
  647.     return null
  648. }
  649. ;
  650. Sys._isDomElement = function(a) {
  651.     var c = false;
  652.     if (typeof a.nodeType !== "number") {
  653.         var b = a.ownerDocument || a.document || a;
  654.         if (b != a) {
  655.             var d = b.defaultView || b.parentWindow;
  656.             c = d != a
  657.         } else
  658.             c = typeof b.body === "undefined"
  659.     }
  660.     return !c
  661. }
  662. ;
  663. Array.__typeName = "Array";
  664. Array.__class = true;
  665. Array.add = Array.enqueue = function(a, b) {
  666.     a[a.length] = b
  667. }
  668. ;
  669. Array.addRange = function(a, b) {
  670.     a.push.apply(a, b)
  671. }
  672. ;
  673. Array.clear = function(a) {
  674.     a.length = 0
  675. }
  676. ;
  677. Array.clone = function(a) {
  678.     if (a.length === 1)
  679.         return [a[0]];
  680.     else
  681.         return Array.apply(null , a)
  682. }
  683. ;
  684. Array.contains = function(a, b) {
  685.     return Sys._indexOf(a, b) >= 0
  686. }
  687. ;
  688. Array.dequeue = function(a) {
  689.     return a.shift()
  690. }
  691. ;
  692. Array.forEach = function(b, e, d) {
  693.     for (var a = 0, f = b.length; a < f; a++) {
  694.         var c = b[a];
  695.         if (typeof c !== "undefined")
  696.             e.call(d, c, a, b)
  697.     }
  698. }
  699. ;
  700. Array.indexOf = function(a, c, b) {
  701.     return Sys._indexOf(a, c, b)
  702. }
  703. ;
  704. Array.insert = function(a, b, c) {
  705.     a.splice(b, 0, c)
  706. }
  707. ;
  708. Array.parse = function(value) {
  709.     if (!value)
  710.         return [];
  711.     return eval(value)
  712. }
  713. ;
  714. Array.remove = function(b, c) {
  715.     var a = Sys._indexOf(b, c);
  716.     if (a >= 0)
  717.         b.splice(a, 1);
  718.     return a >= 0
  719. }
  720. ;
  721. Array.removeAt = function(a, b) {
  722.     a.splice(b, 1)
  723. }
  724. ;
  725. Sys._indexOf = function(d, e, a) {
  726.     if (typeof e === "undefined")
  727.         return -1;
  728.     var c = d.length;
  729.     if (c !== 0) {
  730.         a = a - 0;
  731.         if (isNaN(a))
  732.             a = 0;
  733.         else {
  734.             if (isFinite(a))
  735.                 a = a - a % 1;
  736.             if (a < 0)
  737.                 a = Math.max(0, c + a)
  738.         }
  739.         for (var b = a; b < c; b++)
  740.             if (typeof d[b] !== "undefined" && d[b] === e)
  741.                 return b
  742.     }
  743.     return -1
  744. }
  745. ;
  746. Type._registerScript._scripts = {
  747.     "MicrosoftAjaxCore.js": true,
  748.     "MicrosoftAjaxGlobalization.js": true,
  749.     "MicrosoftAjaxSerialization.js": true,
  750.     "MicrosoftAjaxComponentModel.js": true,
  751.     "MicrosoftAjaxHistory.js": true,
  752.     "MicrosoftAjaxNetwork.js": true,
  753.     "MicrosoftAjaxWebServices.js": true
  754. };
  755. Sys.IDisposable = function() {}
  756. ;
  757. Sys.IDisposable.prototype = {};
  758. Sys.IDisposable.registerInterface("Sys.IDisposable");
  759. Sys.StringBuilder = function(a) {
  760.     this._parts = typeof a !== "undefined" && a !== null && a !== "" ? [a.toString()] : [];
  761.     this._value = {};
  762.     this._len = 0
  763. }
  764. ;
  765. Sys.StringBuilder.prototype = {
  766.     append: function(a) {
  767.         this._parts[this._parts.length] = a
  768.     },
  769.     appendLine: function(a) {
  770.         this._parts[this._parts.length] = typeof a === "undefined" || a === null || a === "" ? "\r\n" : a + "\r\n"
  771.     },
  772.     clear: function() {
  773.         this._parts = [];
  774.         this._value = {};
  775.         this._len = 0
  776.     },
  777.     isEmpty: function() {
  778.         if (this._parts.length === 0)
  779.             return true;
  780.         return this.toString() === ""
  781.     },
  782.     toString: function(a) {
  783.         a = a || "";
  784.         var b = this._parts;
  785.         if (this._len !== b.length) {
  786.             this._value = {};
  787.             this._len = b.length
  788.         }
  789.         var d = this._value;
  790.         if (typeof d[a] === "undefined") {
  791.             if (a !== "")
  792.                 for (var c = 0; c < b.length; )
  793.                     if (typeof b[c] === "undefined" || b[c] === "" || b[c] === null )
  794.                         b.splice(c, 1);
  795.                     else
  796.                         c++;
  797.             d[a] = this._parts.join(a)
  798.         }
  799.         return d[a]
  800.     }
  801. };
  802. Sys.StringBuilder.registerClass("Sys.StringBuilder");
  803. Sys.Browser = {};
  804. Sys.Browser.InternetExplorer = {};
  805. Sys.Browser.Firefox = {};
  806. Sys.Browser.Safari = {};
  807. Sys.Browser.Opera = {};
  808. Sys.Browser.agent = null ;
  809. Sys.Browser.hasDebuggerStatement = false;
  810. Sys.Browser.name = navigator.appName;
  811. Sys.Browser.version = parseFloat(navigator.appVersion);
  812. Sys.Browser.documentMode = 0;
  813. if (navigator.userAgent.indexOf(" MSIE ") > -1) {
  814.     Sys.Browser.agent = Sys.Browser.InternetExplorer;
  815.     Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);
  816.     if (Sys.Browser.version >= 8)
  817.         if (document.documentMode >= 7)
  818.             Sys.Browser.documentMode = document.documentMode;
  819.     Sys.Browser.hasDebuggerStatement = true
  820. } else if (navigator.userAgent.indexOf(" Firefox/") > -1) {
  821.     Sys.Browser.agent = Sys.Browser.Firefox;
  822.     Sys.Browser.version = parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);
  823.     Sys.Browser.name = "Firefox";
  824.     Sys.Browser.hasDebuggerStatement = true
  825. } else if (navigator.userAgent.indexOf(" AppleWebKit/") > -1) {
  826.     Sys.Browser.agent = Sys.Browser.Safari;
  827.     Sys.Browser.version = parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);
  828.     Sys.Browser.name = "Safari"
  829. } else if (navigator.userAgent.indexOf("Opera/") > -1)
  830.     Sys.Browser.agent = Sys.Browser.Opera;
  831. Sys.EventArgs = function() {}
  832. ;
  833. Sys.EventArgs.registerClass("Sys.EventArgs");
  834. Sys.EventArgs.Empty = new Sys.EventArgs;
  835. Sys.CancelEventArgs = function() {
  836.     Sys.CancelEventArgs.initializeBase(this);
  837.     this._cancel = false
  838. }
  839. ;
  840. Sys.CancelEventArgs.prototype = {
  841.     get_cancel: function() {
  842.         return this._cancel
  843.     },
  844.     set_cancel: function(a) {
  845.         this._cancel = a
  846.     }
  847. };
  848. Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs", Sys.EventArgs);
  849. Type.registerNamespace("Sys.UI");
  850. Sys._Debug = function() {}
  851. ;
  852. Sys._Debug.prototype = {
  853.     _appendConsole: function(a) {
  854.         if (typeof Debug !== "undefined" && Debug.writeln)
  855.             Debug.writeln(a);
  856.         if (window.console && window.console.log)
  857.             window.console.log(a);
  858.         if (window.opera)
  859.             window.opera.postError(a);
  860.         if (window.debugService)
  861.             window.debugService.trace(a)
  862.     },
  863.     _appendTrace: function(b) {
  864.         var a = document.getElementById("TraceConsole");
  865.         if (a && a.tagName.toUpperCase() === "TEXTAREA")
  866.             a.value += b + "\n"
  867.     },
  868.     assert: function(c, a, b) {
  869.         if (!c) {
  870.             a = b && this.assert.caller ? String.format(Sys.Res.assertFailedCaller, a, this.assert.caller) : String.format(Sys.Res.assertFailed, a);
  871.             if (confirm(String.format(Sys.Res.breakIntoDebugger, a)))
  872.                 this.fail(a)
  873.         }
  874.     },
  875.     clearTrace: function() {
  876.         var a = document.getElementById("TraceConsole");
  877.         if (a && a.tagName.toUpperCase() === "TEXTAREA")
  878.             a.value = ""
  879.     },
  880.     fail: function(message) {
  881.         this._appendConsole(message);
  882.         if (Sys.Browser.hasDebuggerStatement)
  883.             eval("debugger")
  884.     },
  885.     trace: function(a) {
  886.         this._appendConsole(a);
  887.         this._appendTrace(a)
  888.     },
  889.     traceDump: function(a, b) {
  890.         var c = this._traceDump(a, b, true)
  891.     },
  892.     _traceDump: function(a, c, f, b, d) {
  893.         c = c ? c : "traceDump";
  894.         b = b ? b : "";
  895.         if (a === null ) {
  896.             this.trace(b + c + ": null");
  897.             return
  898.         }
  899.         switch (typeof a) {
  900.         case "undefined":
  901.             this.trace(b + c + ": Undefined");
  902.             break;
  903.         case "number":
  904.         case "string":
  905.         case "boolean":
  906.             this.trace(b + c + ": " + a);
  907.             break;
  908.         default:
  909.             if (Date.isInstanceOfType(a) || RegExp.isInstanceOfType(a)) {
  910.                 this.trace(b + c + ": " + a.toString());
  911.                 break
  912.             }
  913.             if (!d)
  914.                 d = [];
  915.             else if (Array.contains(d, a)) {
  916.                 this.trace(b + c + ": ...");
  917.                 return
  918.             }
  919.             Array.add(d, a);
  920.             if (a == window || a === document || window.HTMLElement && a instanceof HTMLElement || typeof a.nodeName === "string") {
  921.                 var k = a.tagName ? a.tagName : "DomElement";
  922.                 if (a.id)
  923.                     k += " - " + a.id;
  924.                 this.trace(b + c + " {" + k + "}")
  925.             } else {
  926.                 var i = Object.getTypeName(a);
  927.                 this.trace(b + c + (typeof i === "string" ? " {" + i + "}" : ""));
  928.                 if (b === "" || f) {
  929.                     b += "    ";
  930.                     var e, j, l, g, h;
  931.                     if (Array.isInstanceOfType(a)) {
  932.                         j = a.length;
  933.                         for (e = 0; e < j; e++)
  934.                             this._traceDump(a[e], "[" + e + "]", f, b, d)
  935.                     } else
  936.                         for (g in a) {
  937.                             h = a[g];
  938.                             if (!Function.isInstanceOfType(h))
  939.                                 this._traceDump(h, g, f, b, d)
  940.                         }
  941.                 }
  942.             }
  943.             Array.remove(d, a)
  944.         }
  945.     }
  946. };
  947. Sys._Debug.registerClass("Sys._Debug");
  948. Sys.Debug = new Sys._Debug;
  949. Sys.Debug.isDebug = false;
  950. function Sys$Enum$parse(c, e) {
  951.     var a, b, i;
  952.     if (e) {
  953.         a = this.__lowerCaseValues;
  954.         if (!a) {
  955.             this.__lowerCaseValues = a = {};
  956.             var g = this.prototype;
  957.             for (var f in g)
  958.                 a[f.toLowerCase()] = g[f]
  959.         }
  960.     } else
  961.         a = this.prototype;
  962.     if (!this.__flags) {
  963.         i = e ? c.toLowerCase() : c;
  964.         b = a[i.trim()];
  965.         if (typeof b !== "number")
  966.             throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c, this.__typeName));
  967.         return b
  968.     } else {
  969.         var h = (e ? c.toLowerCase() : c).split(",")
  970.           , j = 0;
  971.         for (var d = h.length - 1; d >= 0; d--) {
  972.             var k = h[d].trim();
  973.             b = a[k];
  974.             if (typeof b !== "number")
  975.                 throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c.split(",")[d].trim(), this.__typeName));
  976.             j |= b
  977.         }
  978.         return j
  979.     }
  980. }
  981. function Sys$Enum$toString(c) {
  982.     if (typeof c === "undefined" || c === null )
  983.         return this.__string;
  984.     var d = this.prototype, a;
  985.     if (!this.__flags || c === 0) {
  986.         for (a in d)
  987.             if (d[a] === c)
  988.                 return a
  989.     } else {
  990.         var b = this.__sortedValues;
  991.         if (!b) {
  992.             b = [];
  993.             for (a in d)
  994.                 b[b.length] = {
  995.                     key: a,
  996.                     value: d[a]
  997.                 };
  998.             b.sort(function(a, b) {
  999.                 return a.value - b.value
  1000.             });
  1001.             this.__sortedValues = b
  1002.         }
  1003.         var e = []
  1004.           , g = c;
  1005.         for (a = b.length - 1; a >= 0; a--) {
  1006.             var h = b[a]
  1007.               , f = h.value;
  1008.             if (f === 0)
  1009.                 continue;if ((f & c) === f) {
  1010.                 e[e.length] = h.key;
  1011.                 g -= f;
  1012.                 if (g === 0)
  1013.                     break
  1014.             }
  1015.         }
  1016.         if (e.length && g === 0)
  1017.             return e.reverse().join(", ")
  1018.     }
  1019.     return ""
  1020. }
  1021. Type.prototype.registerEnum = function(b, c) {
  1022.     Sys.__upperCaseTypes[b.toUpperCase()] = this;
  1023.     for (var a in this.prototype)
  1024.         this[a] = this.prototype[a];
  1025.     this.__typeName = b;
  1026.     this.parse = Sys$Enum$parse;
  1027.     this.__string = this.toString();
  1028.     this.toString = Sys$Enum$toString;
  1029.     this.__flags = c;
  1030.     this.__enum = true
  1031. }
  1032. ;
  1033. Type.isEnum = function(a) {
  1034.     if (typeof a === "undefined" || a === null )
  1035.         return false;
  1036.     return !!a.__enum
  1037. }
  1038. ;
  1039. Type.isFlags = function(a) {
  1040.     if (typeof a === "undefined" || a === null )
  1041.         return false;
  1042.     return !!a.__flags
  1043. }
  1044. ;
  1045. Sys.CollectionChange = function(e, a, c, b, d) {
  1046.     this.action = e;
  1047.     if (a)
  1048.         if (!(a instanceof Array))
  1049.             a = [a];
  1050.     this.newItems = a || null ;
  1051.     if (typeof c !== "number")
  1052.         c = -1;
  1053.     this.newStartingIndex = c;
  1054.     if (b)
  1055.         if (!(b instanceof Array))
  1056.             b = [b];
  1057.     this.oldItems = b || null ;
  1058.     if (typeof d !== "number")
  1059.         d = -1;
  1060.     this.oldStartingIndex = d
  1061. }
  1062. ;
  1063. Sys.CollectionChange.registerClass("Sys.CollectionChange");
  1064. Sys.NotifyCollectionChangedAction = function() {
  1065.     throw Error.notImplemented()
  1066. }
  1067. ;
  1068. Sys.NotifyCollectionChangedAction.prototype = {
  1069.     add: 0,
  1070.     remove: 1,
  1071.     reset: 2
  1072. };
  1073. Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");
  1074. Sys.NotifyCollectionChangedEventArgs = function(a) {
  1075.     this._changes = a;
  1076.     Sys.NotifyCollectionChangedEventArgs.initializeBase(this)
  1077. }
  1078. ;
  1079. Sys.NotifyCollectionChangedEventArgs.prototype = {
  1080.     get_changes: function() {
  1081.         return this._changes || []
  1082.     }
  1083. };
  1084. Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs);
  1085. Sys.Observer = function() {}
  1086. ;
  1087. Sys.Observer.registerClass("Sys.Observer");
  1088. Sys.Observer.makeObservable = function(a) {
  1089.     var c = a instanceof Array
  1090.       , b = Sys.Observer;
  1091.     if (a.setValue === b._observeMethods.setValue)
  1092.         return a;
  1093.     b._addMethods(a, b._observeMethods);
  1094.     if (c)
  1095.         b._addMethods(a, b._arrayMethods);
  1096.     return a
  1097. }
  1098. ;
  1099. Sys.Observer._addMethods = function(c, b) {
  1100.     for (var a in b)
  1101.         c[a] = b[a]
  1102. }
  1103. ;
  1104. Sys.Observer._addEventHandler = function(c, a, b) {
  1105.     Sys.Observer._getContext(c, true).events._addHandler(a, b)
  1106. }
  1107. ;
  1108. Sys.Observer.addEventHandler = function(c, a, b) {
  1109.     Sys.Observer._addEventHandler(c, a, b)
  1110. }
  1111. ;
  1112. Sys.Observer._removeEventHandler = function(c, a, b) {
  1113.     Sys.Observer._getContext(c, true).events._removeHandler(a, b)
  1114. }
  1115. ;
  1116. Sys.Observer.removeEventHandler = function(c, a, b) {
  1117.     Sys.Observer._removeEventHandler(c, a, b)
  1118. }
  1119. ;
  1120. Sys.Observer.raiseEvent = function(b, e, d) {
  1121.     var c = Sys.Observer._getContext(b);
  1122.     if (!c)
  1123.         return;
  1124.     var a = c.events.getHandler(e);
  1125.     if (a)
  1126.         a(b, d)
  1127. }
  1128. ;
  1129. Sys.Observer.addPropertyChanged = function(b, a) {
  1130.     Sys.Observer._addEventHandler(b, "propertyChanged", a)
  1131. }
  1132. ;
  1133. Sys.Observer.removePropertyChanged = function(b, a) {
  1134.     Sys.Observer._removeEventHandler(b, "propertyChanged", a)
  1135. }
  1136. ;
  1137. Sys.Observer.beginUpdate = function(a) {
  1138.     Sys.Observer._getContext(a, true).updating = true
  1139. }
  1140. ;
  1141. Sys.Observer.endUpdate = function(b) {
  1142.     var a = Sys.Observer._getContext(b);
  1143.     if (!a || !a.updating)
  1144.         return;
  1145.     a.updating = false;
  1146.     var d = a.dirty;
  1147.     a.dirty = false;
  1148.     if (d) {
  1149.         if (b instanceof Array) {
  1150.             var c = a.changes;
  1151.             a.changes = null ;
  1152.             Sys.Observer.raiseCollectionChanged(b, c)
  1153.         }
  1154.         Sys.Observer.raisePropertyChanged(b, "")
  1155.     }
  1156. }
  1157. ;
  1158. Sys.Observer.isUpdating = function(b) {
  1159.     var a = Sys.Observer._getContext(b);
  1160.     return a ? a.updating : false
  1161. }
  1162. ;
  1163. Sys.Observer._setValue = function(a, j, g) {
  1164.     var b, f, k = a, d = j.split(".");
  1165.     for (var i = 0, m = d.length - 1; i < m; i++) {
  1166.         var l = d[i];
  1167.         b = a["get_" + l];
  1168.         if (typeof b === "function")
  1169.             a = b.call(a);
  1170.         else
  1171.             a = a[l];
  1172.         var n = typeof a;
  1173.         if (a === null || n === "undefined")
  1174.             throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, j))
  1175.     }
  1176.     var e, c = d[m];
  1177.     b = a["get_" + c];
  1178.     f = a["set_" + c];
  1179.     if (typeof b === "function")
  1180.         e = b.call(a);
  1181.     else
  1182.         e = a[c];
  1183.     if (typeof f === "function")
  1184.         f.call(a, g);
  1185.     else
  1186.         a[c] = g;
  1187.     if (e !== g) {
  1188.         var h = Sys.Observer._getContext(k);
  1189.         if (h && h.updating) {
  1190.             h.dirty = true;
  1191.             return
  1192.         }
  1193.         Sys.Observer.raisePropertyChanged(k, d[0])
  1194.     }
  1195. }
  1196. ;
  1197. Sys.Observer.setValue = function(b, a, c) {
  1198.     Sys.Observer._setValue(b, a, c)
  1199. }
  1200. ;
  1201. Sys.Observer.raisePropertyChanged = function(b, a) {
  1202.     Sys.Observer.raiseEvent(b, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
  1203. }
  1204. ;
  1205. Sys.Observer.addCollectionChanged = function(b, a) {
  1206.     Sys.Observer._addEventHandler(b, "collectionChanged", a)
  1207. }
  1208. ;
  1209. Sys.Observer.removeCollectionChanged = function(b, a) {
  1210.     Sys.Observer._removeEventHandler(b, "collectionChanged", a)
  1211. }
  1212. ;
  1213. Sys.Observer._collectionChange = function(d, c) {
  1214.     var a = Sys.Observer._getContext(d);
  1215.     if (a && a.updating) {
  1216.         a.dirty = true;
  1217.         var b = a.changes;
  1218.         if (!b)
  1219.             a.changes = b = [c];
  1220.         else
  1221.             b.push(c)
  1222.     } else {
  1223.         Sys.Observer.raiseCollectionChanged(d, [c]);
  1224.         Sys.Observer.raisePropertyChanged(d, "length")
  1225.     }
  1226. }
  1227. ;
  1228. Sys.Observer.add = function(a, b) {
  1229.     var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,[b],a.length);
  1230.     Array.add(a, b);
  1231.     Sys.Observer._collectionChange(a, c)
  1232. }
  1233. ;
  1234. Sys.Observer.addRange = function(a, b) {
  1235.     var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,b,a.length);
  1236.     Array.addRange(a, b);
  1237.     Sys.Observer._collectionChange(a, c)
  1238. }
  1239. ;
  1240. Sys.Observer.clear = function(a) {
  1241.     var b = Array.clone(a);
  1242.     Array.clear(a);
  1243.     Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset,null ,-1,b,0))
  1244. }
  1245. ;
  1246. Sys.Observer.insert = function(a, b, c) {
  1247.     Array.insert(a, b, c);
  1248.     Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add,[c],b))
  1249. }
  1250. ;
  1251. Sys.Observer.remove = function(a, b) {
  1252.     var c = Array.indexOf(a, b);
  1253.     if (c !== -1) {
  1254.         Array.remove(a, b);
  1255.         Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove,null ,-1,[b],c));
  1256.         return true
  1257.     }
  1258.     return false
  1259. }
  1260. ;
  1261. Sys.Observer.removeAt = function(b, a) {
  1262.     if (a > -1 && a < b.length) {
  1263.         var c = b[a];
  1264.         Array.removeAt(b, a);
  1265.         Sys.Observer._collectionChange(b, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove,null ,-1,[c],a))
  1266.     }
  1267. }
  1268. ;
  1269. Sys.Observer.raiseCollectionChanged = function(b, a) {
  1270.     Sys.Observer.raiseEvent(b, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
  1271. }
  1272. ;
  1273. Sys.Observer._observeMethods = {
  1274.     add_propertyChanged: function(a) {
  1275.         Sys.Observer._addEventHandler(this, "propertyChanged", a)
  1276.     },
  1277.     remove_propertyChanged: function(a) {
  1278.         Sys.Observer._removeEventHandler(this, "propertyChanged", a)
  1279.     },
  1280.     addEventHandler: function(a, b) {
  1281.         Sys.Observer._addEventHandler(this, a, b)
  1282.     },
  1283.     removeEventHandler: function(a, b) {
  1284.         Sys.Observer._removeEventHandler(this, a, b)
  1285.     },
  1286.     get_isUpdating: function() {
  1287.         return Sys.Observer.isUpdating(this)
  1288.     },
  1289.     beginUpdate: function() {
  1290.         Sys.Observer.beginUpdate(this)
  1291.     },
  1292.     endUpdate: function() {
  1293.         Sys.Observer.endUpdate(this)
  1294.     },
  1295.     setValue: function(b, a) {
  1296.         Sys.Observer._setValue(this, b, a)
  1297.     },
  1298.     raiseEvent: function(b, a) {
  1299.         Sys.Observer.raiseEvent(this, b, a)
  1300.     },
  1301.     raisePropertyChanged: function(a) {
  1302.         Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
  1303.     }
  1304. };
  1305. Sys.Observer._arrayMethods = {
  1306.     add_collectionChanged: function(a) {
  1307.         Sys.Observer._addEventHandler(this, "collectionChanged", a)
  1308.     },
  1309.     remove_collectionChanged: function(a) {
  1310.         Sys.Observer._removeEventHandler(this, "collectionChanged", a)
  1311.     },
  1312.     add: function(a) {
  1313.         Sys.Observer.add(this, a)
  1314.     },
  1315.     addRange: function(a) {
  1316.         Sys.Observer.addRange(this, a)
  1317.     },
  1318.     clear: function() {
  1319.         Sys.Observer.clear(this)
  1320.     },
  1321.     insert: function(a, b) {
  1322.         Sys.Observer.insert(this, a, b)
  1323.     },
  1324.     remove: function(a) {
  1325.         return Sys.Observer.remove(this, a)
  1326.     },
  1327.     removeAt: function(a) {
  1328.         Sys.Observer.removeAt(this, a)
  1329.     },
  1330.     raiseCollectionChanged: function(a) {
  1331.         Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
  1332.     }
  1333. };
  1334. Sys.Observer._getContext = function(b, c) {
  1335.     var a = b._observerContext;
  1336.     if (a)
  1337.         return a();
  1338.     if (c)
  1339.         return (b._observerContext = Sys.Observer._createContext())();
  1340.     return null
  1341. }
  1342. ;
  1343. Sys.Observer._createContext = function() {
  1344.     var a = {
  1345.         events: new Sys.EventHandlerList
  1346.     };
  1347.     return function() {
  1348.         return a
  1349.     }
  1350. }
  1351. ;
  1352. Date._appendPreOrPostMatch = function(e, b) {
  1353.     var d = 0
  1354.       , a = false;
  1355.     for (var c = 0, g = e.length; c < g; c++) {
  1356.         var f = e.charAt(c);
  1357.         switch (f) {
  1358.         case "'":
  1359.             if (a)
  1360.                 b.append("'");
  1361.             else
  1362.                 d++;
  1363.             a = false;
  1364.             break;
  1365.         case "\\":
  1366.             if (a)
  1367.                 b.append("\\");
  1368.             a = !a;
  1369.             break;
  1370.         default:
  1371.             b.append(f);
  1372.             a = false
  1373.         }
  1374.     }
  1375.     return d
  1376. }
  1377. ;
  1378. Date._expandFormat = function(a, b) {
  1379.     if (!b)
  1380.         b = "F";
  1381.     var c = b.length;
  1382.     if (c === 1)
  1383.         switch (b) {
  1384.         case "d":
  1385.             return a.ShortDatePattern;
  1386.         case "D":
  1387.             return a.LongDatePattern;
  1388.         case "t":
  1389.             return a.ShortTimePattern;
  1390.         case "T":
  1391.             return a.LongTimePattern;
  1392.         case "f":
  1393.             return a.LongDatePattern + " " + a.ShortTimePattern;
  1394.         case "F":
  1395.             return a.FullDateTimePattern;
  1396.         case "M":
  1397.         case "m":
  1398.             return a.MonthDayPattern;
  1399.         case "s":
  1400.             return a.SortableDateTimePattern;
  1401.         case "Y":
  1402.         case "y":
  1403.             return a.YearMonthPattern;
  1404.         default:
  1405.             throw Error.format(Sys.Res.formatInvalidString)
  1406.         }
  1407.     else if (c === 2 && b.charAt(0) === "%")
  1408.         b = b.charAt(1);
  1409.     return b
  1410. }
  1411. ;
  1412. Date._expandYear = function(c, a) {
  1413.     var d = new Date
  1414.       , e = Date._getEra(d);
  1415.     if (a < 100) {
  1416.         var b = Date._getEraYear(d, c, e);
  1417.         a += b - b % 100;
  1418.         if (a > c.Calendar.TwoDigitYearMax)
  1419.             a -= 100
  1420.     }
  1421.     return a
  1422. }
  1423. ;
  1424. Date._getEra = function(e, c) {
  1425.     if (!c)
  1426.         return 0;
  1427.     var b, d = e.getTime();
  1428.     for (var a = 0, f = c.length; a < f; a += 4) {
  1429.         b = c[a + 2];
  1430.         if (b === null || d >= b)
  1431.             return a
  1432.     }
  1433.     return 0
  1434. }
  1435. ;
  1436. Date._getEraYear = function(d, b, e, c) {
  1437.     var a = d.getFullYear();
  1438.     if (!c && b.eras)
  1439.         a -= b.eras[e + 3];
  1440.     return a
  1441. }
  1442. ;
  1443. Date._getParseRegExp = function(b, e) {
  1444.     if (!b._parseRegExp)
  1445.         b._parseRegExp = {};
  1446.     else if (b._parseRegExp[e])
  1447.         return b._parseRegExp[e];
  1448.     var c = Date._expandFormat(b, e);
  1449.     c = c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1");
  1450.     var a = new Sys.StringBuilder("^"), j = [], f = 0, i = 0, h = Date._getTokenRegExp(), d;
  1451.     while ((d = h.exec(c)) !== null ) {
  1452.         var l = c.slice(f, d.index);
  1453.         f = h.lastIndex;
  1454.         i += Date._appendPreOrPostMatch(l, a);
  1455.         if (i % 2 === 1) {
  1456.             a.append(d[0]);
  1457.             continue
  1458.         }
  1459.         switch (d[0]) {
  1460.         case "dddd":
  1461.         case "ddd":
  1462.         case "MMMM":
  1463.         case "MMM":
  1464.         case "gg":
  1465.         case "g":
  1466.             a.append("(\\D+)");
  1467.             break;
  1468.         case "tt":
  1469.         case "t":
  1470.             a.append("(\\D*)");
  1471.             break;
  1472.         case "yyyy":
  1473.             a.append("(\\d{4})");
  1474.             break;
  1475.         case "fff":
  1476.             a.append("(\\d{3})");
  1477.             break;
  1478.         case "ff":
  1479.             a.append("(\\d{2})");
  1480.             break;
  1481.         case "f":
  1482.             a.append("(\\d)");
  1483.             break;
  1484.         case "dd":
  1485.         case "d":
  1486.         case "MM":
  1487.         case "M":
  1488.         case "yy":
  1489.         case "y":
  1490.         case "HH":
  1491.         case "H":
  1492.         case "hh":
  1493.         case "h":
  1494.         case "mm":
  1495.         case "m":
  1496.         case "ss":
  1497.         case "s":
  1498.             a.append("(\\d\\d?)");
  1499.             break;
  1500.         case "zzz":
  1501.             a.append("([+-]?\\d\\d?:\\d{2})");
  1502.             break;
  1503.         case "zz":
  1504.         case "z":
  1505.             a.append("([+-]?\\d\\d?)");
  1506.             break;
  1507.         case "/":
  1508.             a.append("(\\" + b.DateSeparator + ")")
  1509.         }
  1510.         Array.add(j, d[0])
  1511.     }
  1512.     Date._appendPreOrPostMatch(c.slice(f), a);
  1513.     a.append("$");
  1514.     var k = a.toString().replace(/\s+/g, "\\s+")
  1515.       , g = {
  1516.         "regExp": k,
  1517.         "groups": j
  1518.     };
  1519.     b._parseRegExp[e] = g;
  1520.     return g
  1521. }
  1522. ;
  1523. Date._getTokenRegExp = function() {
  1524.     return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g
  1525. }
  1526. ;
  1527. Date.parseLocale = function(a) {
  1528.     return Date._parse(a, Sys.CultureInfo.CurrentCulture, arguments)
  1529. }
  1530. ;
  1531. Date.parseInvariant = function(a) {
  1532.     return Date._parse(a, Sys.CultureInfo.InvariantCulture, arguments)
  1533. }
  1534. ;
  1535. Date._parse = function(h, d, i) {
  1536.     var a, c, b, f, e, g = false;
  1537.     for (a = 1,
  1538.     c = i.length; a < c; a++) {
  1539.         f = i[a];
  1540.         if (f) {
  1541.             g = true;
  1542.             b = Date._parseExact(h, f, d);
  1543.             if (b)
  1544.                 return b
  1545.         }
  1546.     }
  1547.     if (!g) {
  1548.         e = d._getDateTimeFormats();
  1549.         for (a = 0,
  1550.         c = e.length; a < c; a++) {
  1551.             b = Date._parseExact(h, e[a], d);
  1552.             if (b)
  1553.                 return b
  1554.         }
  1555.     }
  1556.     return null
  1557. }
  1558. ;
  1559. Date._parseExact = function(w, D, k) {
  1560.     w = w.trim();
  1561.     var g = k.dateTimeFormat
  1562.       , A = Date._getParseRegExp(g, D)
  1563.       , C = (new RegExp(A.regExp)).exec(w);
  1564.     if (C === null )
  1565.         return null ;
  1566.     var B = A.groups, x = null , e = null , c = null , j = null , i = null , d = 0, h, p = 0, q = 0, f = 0, l = null , v = false;
  1567.     for (var s = 0, E = B.length; s < E; s++) {
  1568.         var a = C[s + 1];
  1569.         if (a)
  1570.             switch (B[s]) {
  1571.             case "dd":
  1572.             case "d":
  1573.                 j = parseInt(a, 10);
  1574.                 if (j < 1 || j > 31)
  1575.                     return null ;
  1576.                 break;
  1577.             case "MMMM":
  1578.                 c = k._getMonthIndex(a);
  1579.                 if (c < 0 || c > 11)
  1580.                     return null ;
  1581.                 break;
  1582.             case "MMM":
  1583.                 c = k._getAbbrMonthIndex(a);
  1584.                 if (c < 0 || c > 11)
  1585.                     return null ;
  1586.                 break;
  1587.             case "M":
  1588.             case "MM":
  1589.                 c = parseInt(a, 10) - 1;
  1590.                 if (c < 0 || c > 11)
  1591.                     return null ;
  1592.                 break;
  1593.             case "y":
  1594.             case "yy":
  1595.                 e = Date._expandYear(g, parseInt(a, 10));
  1596.                 if (e < 0 || e > 9999)
  1597.                     return null ;
  1598.                 break;
  1599.             case "yyyy":
  1600.                 e = parseInt(a, 10);
  1601.                 if (e < 0 || e > 9999)
  1602.                     return null ;
  1603.                 break;
  1604.             case "h":
  1605.             case "hh":
  1606.                 d = parseInt(a, 10);
  1607.                 if (d === 12)
  1608.                     d = 0;
  1609.                 if (d < 0 || d > 11)
  1610.                     return null ;
  1611.                 break;
  1612.             case "H":
  1613.             case "HH":
  1614.                 d = parseInt(a, 10);
  1615.                 if (d < 0 || d > 23)
  1616.                     return null ;
  1617.                 break;
  1618.             case "m":
  1619.             case "mm":
  1620.                 p = parseInt(a, 10);
  1621.                 if (p < 0 || p > 59)
  1622.                     return null ;
  1623.                 break;
  1624.             case "s":
  1625.             case "ss":
  1626.                 q = parseInt(a, 10);
  1627.                 if (q < 0 || q > 59)
  1628.                     return null ;
  1629.                 break;
  1630.             case "tt":
  1631.             case "t":
  1632.                 var z = a.toUpperCase();
  1633.                 v = z === g.PMDesignator.toUpperCase();
  1634.                 if (!v && z !== g.AMDesignator.toUpperCase())
  1635.                     return null ;
  1636.                 break;
  1637.             case "f":
  1638.                 f = parseInt(a, 10) * 100;
  1639.                 if (f < 0 || f > 999)
  1640.                     return null ;
  1641.                 break;
  1642.             case "ff":
  1643.                 f = parseInt(a, 10) * 10;
  1644.                 if (f < 0 || f > 999)
  1645.                     return null ;
  1646.                 break;
  1647.             case "fff":
  1648.                 f = parseInt(a, 10);
  1649.                 if (f < 0 || f > 999)
  1650.                     return null ;
  1651.                 break;
  1652.             case "dddd":
  1653.                 i = k._getDayIndex(a);
  1654.                 if (i < 0 || i > 6)
  1655.                     return null ;
  1656.                 break;
  1657.             case "ddd":
  1658.                 i = k._getAbbrDayIndex(a);
  1659.                 if (i < 0 || i > 6)
  1660.                     return null ;
  1661.                 break;
  1662.             case "zzz":
  1663.                 var u = a.split(/:/);
  1664.                 if (u.length !== 2)
  1665.                     return null ;
  1666.                 h = parseInt(u[0], 10);
  1667.                 if (h < -12 || h > 13)
  1668.                     return null ;
  1669.                 var m = parseInt(u[1], 10);
  1670.                 if (m < 0 || m > 59)
  1671.                     return null ;
  1672.                 l = h * 60 + (a.startsWith("-") ? -m : m);
  1673.                 break;
  1674.             case "z":
  1675.             case "zz":
  1676.                 h = parseInt(a, 10);
  1677.                 if (h < -12 || h > 13)
  1678.                     return null ;
  1679.                 l = h * 60;
  1680.                 break;
  1681.             case "g":
  1682.             case "gg":
  1683.                 var o = a;
  1684.                 if (!o || !g.eras)
  1685.                     return null ;
  1686.                 o = o.toLowerCase().trim();
  1687.                 for (var r = 0, F = g.eras.length; r < F; r += 4)
  1688.                     if (o === g.eras[r + 1].toLowerCase()) {
  1689.                         x = r;
  1690.                         break
  1691.                     }
  1692.                 if (x === null )
  1693.                     return null
  1694.             }
  1695.     }
  1696.     var b = new Date, t, n = g.Calendar.convert;
  1697.     if (n)
  1698.         t = n.fromGregorian(b)[0];
  1699.     else
  1700.         t = b.getFullYear();
  1701.     if (e === null )
  1702.         e = t;
  1703.     else if (g.eras)
  1704.         e += g.eras[(x || 0) + 3];
  1705.     if (c === null )
  1706.         c = 0;
  1707.     if (j === null )
  1708.         j = 1;
  1709.     if (n) {
  1710.         b = n.toGregorian(e, c, j);
  1711.         if (b === null )
  1712.             return null
  1713.     } else {
  1714.         b.setFullYear(e, c, j);
  1715.         if (b.getDate() !== j)
  1716.             return null ;
  1717.         if (i !== null && b.getDay() !== i)
  1718.             return null
  1719.     }
  1720.     if (v && d < 12)
  1721.         d += 12;
  1722.     b.setHours(d, p, q, f);
  1723.     if (l !== null ) {
  1724.         var y = b.getMinutes() - (l + b.getTimezoneOffset());
  1725.         b.setHours(b.getHours() + parseInt(y / 60, 10), y % 60)
  1726.     }
  1727.     return b
  1728. }
  1729. ;
  1730. Date.prototype.format = function(a) {
  1731.     return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
  1732. }
  1733. ;
  1734. Date.prototype.localeFormat = function(a) {
  1735.     return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
  1736. }
  1737. ;
  1738. Date.prototype._toFormattedString = function(e, j) {
  1739.     var b = j.dateTimeFormat
  1740.       , n = b.Calendar.convert;
  1741.     if (!e || !e.length || e === "i")
  1742.         if (j && j.name.length)
  1743.             if (n)
  1744.                 return this._toFormattedString(b.FullDateTimePattern, j);
  1745.             else {
  1746.                 var r = new Date(this.getTime())
  1747.                   , x = Date._getEra(this, b.eras);
  1748.                 r.setFullYear(Date._getEraYear(this, b, x));
  1749.                 return r.toLocaleString()
  1750.             }
  1751.         else
  1752.             return this.toString();
  1753.     var l = b.eras
  1754.       , k = e === "s";
  1755.     e = Date._expandFormat(b, e);
  1756.     var a = new Sys.StringBuilder, c;
  1757.     function d(a) {
  1758.         if (a < 10)
  1759.             return "0" + a;
  1760.         return a.toString()
  1761.     }
  1762.     function m(a) {
  1763.         if (a < 10)
  1764.             return "00" + a;
  1765.         if (a < 100)
  1766.             return "0" + a;
  1767.         return a.toString()
  1768.     }
  1769.     function v(a) {
  1770.         if (a < 10)
  1771.             return "000" + a;
  1772.         else if (a < 100)
  1773.             return "00" + a;
  1774.         else if (a < 1000)
  1775.             return "0" + a;
  1776.         return a.toString()
  1777.     }
  1778.     var h, p, t = /([^d]|^)(d|dd)([^d]|$)/g;
  1779.     function s() {
  1780.         if (h || p)
  1781.             return h;
  1782.         h = t.test(e);
  1783.         p = true;
  1784.         return h
  1785.     }
  1786.     var q = 0, o = Date._getTokenRegExp(), f;
  1787.     if (!k && n)
  1788.         f = n.fromGregorian(this);
  1789.     for (; true; ) {
  1790.         var w = o.lastIndex
  1791.           , i = o.exec(e)
  1792.           , u = e.slice(w, i ? i.index : e.length);
  1793.         q += Date._appendPreOrPostMatch(u, a);
  1794.         if (!i)
  1795.             break;
  1796.         if (q % 2 === 1) {
  1797.             a.append(i[0]);
  1798.             continue
  1799.         }
  1800.         function g(a, b) {
  1801.             if (f)
  1802.                 return f[b];
  1803.             switch (b) {
  1804.             case 0:
  1805.                 return a.getFullYear();
  1806.             case 1:
  1807.                 return a.getMonth();
  1808.             case 2:
  1809.                 return a.getDate()
  1810.             }
  1811.         }
  1812.         switch (i[0]) {
  1813.         case "dddd":
  1814.             a.append(b.DayNames[this.getDay()]);
  1815.             break;
  1816.         case "ddd":
  1817.             a.append(b.AbbreviatedDayNames[this.getDay()]);
  1818.             break;
  1819.         case "dd":
  1820.             h = true;
  1821.             a.append(d(g(this, 2)));
  1822.             break;
  1823.         case "d":
  1824.             h = true;
  1825.             a.append(g(this, 2));
  1826.             break;
  1827.         case "MMMM":
  1828.             a.append(b.MonthGenitiveNames && s() ? b.MonthGenitiveNames[g(this, 1)] : b.MonthNames[g(this, 1)]);
  1829.             break;
  1830.         case "MMM":
  1831.             a.append(b.AbbreviatedMonthGenitiveNames && s() ? b.AbbreviatedMonthGenitiveNames[g(this, 1)] : b.AbbreviatedMonthNames[g(this, 1)]);
  1832.             break;
  1833.         case "MM":
  1834.             a.append(d(g(this, 1) + 1));
  1835.             break;
  1836.         case "M":
  1837.             a.append(g(this, 1) + 1);
  1838.             break;
  1839.         case "yyyy":
  1840.             a.append(v(f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)));
  1841.             break;
  1842.         case "yy":
  1843.             a.append(d((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100));
  1844.             break;
  1845.         case "y":
  1846.             a.append((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100);
  1847.             break;
  1848.         case "hh":
  1849.             c = this.getHours() % 12;
  1850.             if (c === 0)
  1851.                 c = 12;
  1852.             a.append(d(c));
  1853.             break;
  1854.         case "h":
  1855.             c = this.getHours() % 12;
  1856.             if (c === 0)
  1857.                 c = 12;
  1858.             a.append(c);
  1859.             break;
  1860.         case "HH":
  1861.             a.append(d(this.getHours()));
  1862.             break;
  1863.         case "H":
  1864.             a.append(this.getHours());
  1865.             break;
  1866.         case "mm":
  1867.             a.append(d(this.getMinutes()));
  1868.             break;
  1869.         case "m":
  1870.             a.append(this.getMinutes());
  1871.             break;
  1872.         case "ss":
  1873.             a.append(d(this.getSeconds()));
  1874.             break;
  1875.         case "s":
  1876.             a.append(this.getSeconds());
  1877.             break;
  1878.         case "tt":
  1879.             a.append(this.getHours() < 12 ? b.AMDesignator : b.PMDesignator);
  1880.             break;
  1881.         case "t":
  1882.             a.append((this.getHours() < 12 ? b.AMDesignator : b.PMDesignator).charAt(0));
  1883.             break;
  1884.         case "f":
  1885.             a.append(m(this.getMilliseconds()).charAt(0));
  1886.             break;
  1887.         case "ff":
  1888.             a.append(m(this.getMilliseconds()).substr(0, 2));
  1889.             break;
  1890.         case "fff":
  1891.             a.append(m(this.getMilliseconds()));
  1892.             break;
  1893.         case "z":
  1894.             c = this.getTimezoneOffset() / 60;
  1895.             a.append((c <= 0 ? "+" : "-") + Math.floor(Math.abs(c)));
  1896.             break;
  1897.         case "zz":
  1898.             c = this.getTimezoneOffset() / 60;
  1899.             a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))));
  1900.             break;
  1901.         case "zzz":
  1902.             c = this.getTimezoneOffset() / 60;
  1903.             a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))) + ":" + d(Math.abs(this.getTimezoneOffset() % 60)));
  1904.             break;
  1905.         case "g":
  1906.         case "gg":
  1907.             if (b.eras)
  1908.                 a.append(b.eras[Date._getEra(this, l) + 1]);
  1909.             break;
  1910.         case "/":
  1911.             a.append(b.DateSeparator)
  1912.         }
  1913.     }
  1914.     return a.toString()
  1915. }
  1916. ;
  1917. String.localeFormat = function() {
  1918.     return String._toFormattedString(true, arguments)
  1919. }
  1920. ;
  1921. Number.parseLocale = function(a) {
  1922.     return Number._parse(a, Sys.CultureInfo.CurrentCulture)
  1923. }
  1924. ;
  1925. Number.parseInvariant = function(a) {
  1926.     return Number._parse(a, Sys.CultureInfo.InvariantCulture)
  1927. }
  1928. ;
  1929. Number._parse = function(b, o) {
  1930.     b = b.trim();
  1931.     if (b.match(/^[+-]?infinity$/i))
  1932.         return parseFloat(b);
  1933.     if (b.match(/^0x[a-f0-9]+$/i))
  1934.         return parseInt(b);
  1935.     var a = o.numberFormat
  1936.       , g = Number._parseNumberNegativePattern(b, a, a.NumberNegativePattern)
  1937.       , h = g[0]
  1938.       , e = g[1];
  1939.     if (h === "" && a.NumberNegativePattern !== 1) {
  1940.         g = Number._parseNumberNegativePattern(b, a, 1);
  1941.         h = g[0];
  1942.         e = g[1]
  1943.     }
  1944.     if (h === "")
  1945.         h = "+";
  1946.     var j, d, f = e.indexOf("e");
  1947.     if (f < 0)
  1948.         f = e.indexOf("E");
  1949.     if (f < 0) {
  1950.         d = e;
  1951.         j = null
  1952.     } else {
  1953.         d = e.substr(0, f);
  1954.         j = e.substr(f + 1)
  1955.     }
  1956.     var c, k, m = d.indexOf(a.NumberDecimalSeparator);
  1957.     if (m < 0) {
  1958.         c = d;
  1959.         k = null
  1960.     } else {
  1961.         c = d.substr(0, m);
  1962.         k = d.substr(m + a.NumberDecimalSeparator.length)
  1963.     }
  1964.     c = c.split(a.NumberGroupSeparator).join("");
  1965.     var n = a.NumberGroupSeparator.replace(/\u00A0/g, " ");
  1966.     if (a.NumberGroupSeparator !== n)
  1967.         c = c.split(n).join("");
  1968.     var l = h + c;
  1969.     if (k !== null )
  1970.         l += "." + k;
  1971.     if (j !== null ) {
  1972.         var i = Number._parseNumberNegativePattern(j, a, 1);
  1973.         if (i[0] === "")
  1974.             i[0] = "+";
  1975.         l += "e" + i[0] + i[1]
  1976.     }
  1977.     if (l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))
  1978.         return parseFloat(l);
  1979.     return Number.NaN
  1980. }
  1981. ;
  1982. Number._parseNumberNegativePattern = function(a, d, e) {
  1983.     var b = d.NegativeSign
  1984.       , c = d.PositiveSign;
  1985.     switch (e) {
  1986.     case 4:
  1987.         b = " " + b;
  1988.         c = " " + c;
  1989.     case 3:
  1990.         if (a.endsWith(b))
  1991.             return ["-", a.substr(0, a.length - b.length)];
  1992.         else if (a.endsWith(c))
  1993.             return ["+", a.substr(0, a.length - c.length)];
  1994.         break;
  1995.     case 2:
  1996.         b += " ";
  1997.         c += " ";
  1998.     case 1:
  1999.         if (a.startsWith(b))
  2000.             return ["-", a.substr(b.length)];
  2001.         else if (a.startsWith(c))
  2002.             return ["+", a.substr(c.length)];
  2003.         break;
  2004.     case 0:
  2005.         if (a.startsWith("(") && a.endsWith(")"))
  2006.             return ["-", a.substr(1, a.length - 2)]
  2007.     }
  2008.     return ["", a]
  2009. }
  2010. ;
  2011. Number.prototype.format = function(a) {
  2012.     return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
  2013. }
  2014. ;
  2015. Number.prototype.localeFormat = function(a) {
  2016.     return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
  2017. }
  2018. ;
  2019. Number.prototype._toFormattedString = function(e, j) {
  2020.     if (!e || e.length === 0 || e === "i")
  2021.         if (j && j.name.length > 0)
  2022.             return this.toLocaleString();
  2023.         else
  2024.             return this.toString();
  2025.     var o = ["n %", "n%", "%n"]
  2026.       , n = ["-n %", "-n%", "-%n"]
  2027.       , p = ["(n)", "-n", "- n", "n-", "n -"]
  2028.       , m = ["$n", "n$", "$ n", "n $"]
  2029.       , l = ["($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", "(n $)"];
  2030.     function g(a, c, d) {
  2031.         for (var b = a.length; b < c; b++)
  2032.             a = d ? "0" + a : a + "0";
  2033.         return a
  2034.     }
  2035.     function i(j, i, l, n, p) {
  2036.         var h = l[0]
  2037.           , k = 1
  2038.           , o = Math.pow(10, i)
  2039.           , m = Math.round(j * o) / o;
  2040.         if (!isFinite(m))
  2041.             m = j;
  2042.         j = m;
  2043.         var b = j.toString(), a = "", c, e = b.split(/e/i);
  2044.         b = e[0];
  2045.         c = e.length > 1 ? parseInt(e[1]) : 0;
  2046.         e = b.split(".");
  2047.         b = e[0];
  2048.         a = e.length > 1 ? e[1] : "";
  2049.         var q;
  2050.         if (c > 0) {
  2051.             a = g(a, c, false);
  2052.             b += a.slice(0, c);
  2053.             a = a.substr(c)
  2054.         } else if (c < 0) {
  2055.             c = -c;
  2056.             b = g(b, c + 1, true);
  2057.             a = b.slice(-c, b.length) + a;
  2058.             b = b.slice(0, -c)
  2059.         }
  2060.         if (i > 0) {
  2061.             if (a.length > i)
  2062.                 a = a.slice(0, i);
  2063.             else
  2064.                 a = g(a, i, false);
  2065.             a = p + a
  2066.         } else
  2067.             a = "";
  2068.         var d = b.length - 1
  2069.           , f = "";
  2070.         while (d >= 0) {
  2071.             if (h === 0 || h > d)
  2072.                 if (f.length > 0)
  2073.                     return b.slice(0, d + 1) + n + f + a;
  2074.                 else
  2075.                     return b.slice(0, d + 1) + a;
  2076.             if (f.length > 0)
  2077.                 f = b.slice(d - h + 1, d + 1) + n + f;
  2078.             else
  2079.                 f = b.slice(d - h + 1, d + 1);
  2080.             d -= h;
  2081.             if (k < l.length) {
  2082.                 h = l[k];
  2083.                 k++
  2084.             }
  2085.         }
  2086.         return b.slice(0, d + 1) + n + f + a
  2087.     }
  2088.     var a = j.numberFormat
  2089.       , d = Math.abs(this);
  2090.     if (!e)
  2091.         e = "D";
  2092.     var b = -1;
  2093.     if (e.length > 1)
  2094.         b = parseInt(e.slice(1), 10);
  2095.     var c;
  2096.     switch (e.charAt(0)) {
  2097.     case "d":
  2098.     case "D":
  2099.         c = "n";
  2100.         if (b !== -1)
  2101.             d = g("" + d, b, true);
  2102.         if (this < 0)
  2103.             d = -d;
  2104.         break;
  2105.     case "c":
  2106.     case "C":
  2107.         if (this < 0)
  2108.             c = l[a.CurrencyNegativePattern];
  2109.         else
  2110.             c = m[a.CurrencyPositivePattern];
  2111.         if (b === -1)
  2112.             b = a.CurrencyDecimalDigits;
  2113.         d = i(Math.abs(this), b, a.CurrencyGroupSizes, a.CurrencyGroupSeparator, a.CurrencyDecimalSeparator);
  2114.         break;
  2115.     case "n":
  2116.     case "N":
  2117.         if (this < 0)
  2118.             c = p[a.NumberNegativePattern];
  2119.         else
  2120.             c = "n";
  2121.         if (b === -1)
  2122.             b = a.NumberDecimalDigits;
  2123.         d = i(Math.abs(this), b, a.NumberGroupSizes, a.NumberGroupSeparator, a.NumberDecimalSeparator);
  2124.         break;
  2125.     case "p":
  2126.     case "P":
  2127.         if (this < 0)
  2128.             c = n[a.PercentNegativePattern];
  2129.         else
  2130.             c = o[a.PercentPositivePattern];
  2131.         if (b === -1)
  2132.             b = a.PercentDecimalDigits;
  2133.         d = i(Math.abs(this) * 100, b, a.PercentGroupSizes, a.PercentGroupSeparator, a.PercentDecimalSeparator);
  2134.         break;
  2135.     default:
  2136.         throw Error.format(Sys.Res.formatBadFormatSpecifier)
  2137.     }
  2138.     var k = /n|\$|-|%/g
  2139.       , f = "";
  2140.     for (; true; ) {
  2141.         var q = k.lastIndex
  2142.           , h = k.exec(c);
  2143.         f += c.slice(q, h ? h.index : c.length);
  2144.         if (!h)
  2145.             break;
  2146.         switch (h[0]) {
  2147.         case "n":
  2148.             f += d;
  2149.             break;
  2150.         case "$":
  2151.             f += a.CurrencySymbol;
  2152.             break;
  2153.         case "-":
  2154.             if (/[1-9]/.test(d))
  2155.                 f += a.NegativeSign;
  2156.             break;
  2157.         case "%":
  2158.             f += a.PercentSymbol
  2159.         }
  2160.     }
  2161.     return f
  2162. }
  2163. ;
  2164. Sys.CultureInfo = function(c, b, a) {
  2165.     this.name = c;
  2166.     this.numberFormat = b;
  2167.     this.dateTimeFormat = a
  2168. }
  2169. ;
  2170. Sys.CultureInfo.prototype = {
  2171.     _getDateTimeFormats: function() {
  2172.         if (!this._dateTimeFormats) {
  2173.             var a = this.dateTimeFormat;
  2174.             this._dateTimeFormats = [a.MonthDayPattern, a.YearMonthPattern, a.ShortDatePattern, a.ShortTimePattern, a.LongDatePattern, a.LongTimePattern, a.FullDateTimePattern, a.RFC1123Pattern, a.SortableDateTimePattern, a.UniversalSortableDateTimePattern]
  2175.         }
  2176.         return this._dateTimeFormats
  2177.     },
  2178.     _getIndex: function(c, d, e) {
  2179.         var b = this._toUpper(c)
  2180.           , a = Array.indexOf(d, b);
  2181.         if (a === -1)
  2182.             a = Array.indexOf(e, b);
  2183.         return a
  2184.     },
  2185.     _getMonthIndex: function(a) {
  2186.         if (!this._upperMonths) {
  2187.             this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames);
  2188.             this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)
  2189.         }
  2190.         return this._getIndex(a, this._upperMonths, this._upperMonthsGenitive)
  2191.     },
  2192.     _getAbbrMonthIndex: function(a) {
  2193.         if (!this._upperAbbrMonths) {
  2194.             this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
  2195.             this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)
  2196.         }
  2197.         return this._getIndex(a, this._upperAbbrMonths, this._upperAbbrMonthsGenitive)
  2198.     },
  2199.     _getDayIndex: function(a) {
  2200.         if (!this._upperDays)
  2201.             this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames);
  2202.         return Array.indexOf(this._upperDays, this._toUpper(a))
  2203.     },
  2204.     _getAbbrDayIndex: function(a) {
  2205.         if (!this._upperAbbrDays)
  2206.             this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);
  2207.         return Array.indexOf(this._upperAbbrDays, this._toUpper(a))
  2208.     },
  2209.     _toUpperArray: function(c) {
  2210.         var b = [];
  2211.         for (var a = 0, d = c.length; a < d; a++)
  2212.             b[a] = this._toUpper(c[a]);
  2213.         return b
  2214.     },
  2215.     _toUpper: function(a) {
  2216.         return a.split("\u00a0").join(" ").toUpperCase()
  2217.     }
  2218. };
  2219. Sys.CultureInfo.registerClass("Sys.CultureInfo");
  2220. Sys.CultureInfo._parse = function(a) {
  2221.     var b = a.dateTimeFormat;
  2222.     if (b && !b.eras)
  2223.         b.eras = a.eras;
  2224.     return new Sys.CultureInfo(a.name,a.numberFormat,b)
  2225. }
  2226. ;
  2227. Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({
  2228.     "name": "",
  2229.     "numberFormat": {
  2230.         "CurrencyDecimalDigits": 2,
  2231.         "CurrencyDecimalSeparator": ".",
  2232.         "IsReadOnly": true,
  2233.         "CurrencyGroupSizes": [3],
  2234.         "NumberGroupSizes": [3],
  2235.         "PercentGroupSizes": [3],
  2236.         "CurrencyGroupSeparator": ",",
  2237.         "CurrencySymbol": "\u00a4",
  2238.         "NaNSymbol": "NaN",
  2239.         "CurrencyNegativePattern": 0,
  2240.         "NumberNegativePattern": 1,
  2241.         "PercentPositivePattern": 0,
  2242.         "PercentNegativePattern": 0,
  2243.         "NegativeInfinitySymbol": "-Infinity",
  2244.         "NegativeSign": "-",
  2245.         "NumberDecimalDigits": 2,
  2246.         "NumberDecimalSeparator": ".",
  2247.         "NumberGroupSeparator": ",",
  2248.         "CurrencyPositivePattern": 0,
  2249.         "PositiveInfinitySymbol": "Infinity",
  2250.         "PositiveSign": "+",
  2251.         "PercentDecimalDigits": 2,
  2252.         "PercentDecimalSeparator": ".",
  2253.         "PercentGroupSeparator": ",",
  2254.         "PercentSymbol": "%",
  2255.         "PerMilleSymbol": "\u2030",
  2256.         "NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  2257.         "DigitSubstitution": 1
  2258.     },
  2259.     "dateTimeFormat": {
  2260.         "AMDesignator": "AM",
  2261.         "Calendar": {
  2262.             "MinSupportedDateTime": "@-62135568000000@",
  2263.             "MaxSupportedDateTime": "@253402300799999@",
  2264.             "AlgorithmType": 1,
  2265.             "CalendarType": 1,
  2266.             "Eras": [1],
  2267.             "TwoDigitYearMax": 2029,
  2268.             "IsReadOnly": true
  2269.         },
  2270.         "DateSeparator": "/",
  2271.         "FirstDayOfWeek": 0,
  2272.         "CalendarWeekRule": 0,
  2273.         "FullDateTimePattern": "dddd, dd MMMM yyyy HH:mm:ss",
  2274.         "LongDatePattern": "dddd, dd MMMM yyyy",
  2275.         "LongTimePattern": "HH:mm:ss",
  2276.         "MonthDayPattern": "MMMM dd",
  2277.         "PMDesignator": "PM",
  2278.         "RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
  2279.         "ShortDatePattern": "MM/dd/yyyy",
  2280.         "ShortTimePattern": "HH:mm",
  2281.         "SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
  2282.         "TimeSeparator": ":",
  2283.         "UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
  2284.         "YearMonthPattern": "yyyy MMMM",
  2285.         "AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  2286.         "ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  2287.         "DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  2288.         "AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
  2289.         "MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
  2290.         "IsReadOnly": true,
  2291.         "NativeCalendarName": "Gregorian Calendar",
  2292.         "AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
  2293.         "MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
  2294.     },
  2295.     "eras": [1, "A.D.", null , 0]
  2296. });
  2297. if (typeof __cultureInfo === "object") {
  2298.     Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
  2299.     delete __cultureInfo
  2300. } else
  2301.     Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({
  2302.         "name": "en-US",
  2303.         "numberFormat": {
  2304.             "CurrencyDecimalDigits": 2,
  2305.             "CurrencyDecimalSeparator": ".",
  2306.             "IsReadOnly": false,
  2307.             "CurrencyGroupSizes": [3],
  2308.             "NumberGroupSizes": [3],
  2309.             "PercentGroupSizes": [3],
  2310.             "CurrencyGroupSeparator": ",",
  2311.             "CurrencySymbol": "$",
  2312.             "NaNSymbol": "NaN",
  2313.             "CurrencyNegativePattern": 0,
  2314.             "NumberNegativePattern": 1,
  2315.             "PercentPositivePattern": 0,
  2316.             "PercentNegativePattern": 0,
  2317.             "NegativeInfinitySymbol": "-Infinity",
  2318.             "NegativeSign": "-",
  2319.             "NumberDecimalDigits": 2,
  2320.             "NumberDecimalSeparator": ".",
  2321.             "NumberGroupSeparator": ",",
  2322.             "CurrencyPositivePattern": 0,
  2323.             "PositiveInfinitySymbol": "Infinity",
  2324.             "PositiveSign": "+",
  2325.             "PercentDecimalDigits": 2,
  2326.             "PercentDecimalSeparator": ".",
  2327.             "PercentGroupSeparator": ",",
  2328.             "PercentSymbol": "%",
  2329.             "PerMilleSymbol": "\u2030",
  2330.             "NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
  2331.             "DigitSubstitution": 1
  2332.         },
  2333.         "dateTimeFormat": {
  2334.             "AMDesignator": "AM",
  2335.             "Calendar": {
  2336.                 "MinSupportedDateTime": "@-62135568000000@",
  2337.                 "MaxSupportedDateTime": "@253402300799999@",
  2338.                 "AlgorithmType": 1,
  2339.                 "CalendarType": 1,
  2340.                 "Eras": [1],
  2341.                 "TwoDigitYearMax": 2029,
  2342.                 "IsReadOnly": false
  2343.             },
  2344.             "DateSeparator": "/",
  2345.             "FirstDayOfWeek": 0,
  2346.             "CalendarWeekRule": 0,
  2347.             "FullDateTimePattern": "dddd, MMMM dd, yyyy h:mm:ss tt",
  2348.             "LongDatePattern": "dddd, MMMM dd, yyyy",
  2349.             "LongTimePattern": "h:mm:ss tt",
  2350.             "MonthDayPattern": "MMMM dd",
  2351.             "PMDesignator": "PM",
  2352.             "RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
  2353.             "ShortDatePattern": "M/d/yyyy",
  2354.             "ShortTimePattern": "h:mm tt",
  2355.             "SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
  2356.             "TimeSeparator": ":",
  2357.             "UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
  2358.             "YearMonthPattern": "MMMM, yyyy",
  2359.             "AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  2360.             "ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  2361.             "DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  2362.             "AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
  2363.             "MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
  2364.             "IsReadOnly": false,
  2365.             "NativeCalendarName": "Gregorian Calendar",
  2366.             "AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
  2367.             "MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
  2368.         },
  2369.         "eras": [1, "A.D.", null , 0]
  2370.     });
  2371. Type.registerNamespace("Sys.Serialization");
  2372. Sys.Serialization.JavaScriptSerializer = function() {}
  2373. ;
  2374. Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");
  2375. Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = [];
  2376. Sys.Serialization.JavaScriptSerializer._charsToEscape = [];
  2377. Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");
  2378. Sys.Serialization.JavaScriptSerializer._escapeChars = {};
  2379. Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]',"i");
  2380. Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]',"g");
  2381. Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");
  2382. Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"',"g");
  2383. Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = "__type";
  2384. Sys.Serialization.JavaScriptSerializer._init = function() {
  2385.     var c = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000b", "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"];
  2386.     Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = "\\";
  2387.     Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"] = new RegExp("\\\\","g");
  2388.     Sys.Serialization.JavaScriptSerializer._escapeChars["\\"] = "\\\\";
  2389.     Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"';
  2390.     Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"',"g");
  2391.     Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"';
  2392.     for (var a = 0; a < 32; a++) {
  2393.         var b = String.fromCharCode(a);
  2394.         Sys.Serialization.JavaScriptSerializer._charsToEscape[a + 2] = b;
  2395.         Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b] = new RegExp(b,"g");
  2396.         Sys.Serialization.JavaScriptSerializer._escapeChars[b] = c[a]
  2397.     }
  2398. }
  2399. ;
  2400. Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function(b, a) {
  2401.     a.append(b.toString())
  2402. }
  2403. ;
  2404. Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function(a, b) {
  2405.     if (isFinite(a))
  2406.         b.append(String(a));
  2407.     else
  2408.         throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)
  2409. }
  2410. ;
  2411. Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function(a, c) {
  2412.     c.append('"');
  2413.     if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)) {
  2414.         if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0)
  2415.             Sys.Serialization.JavaScriptSerializer._init();
  2416.         if (a.length < 128)
  2417.             a = a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, function(a) {
  2418.                 return Sys.Serialization.JavaScriptSerializer._escapeChars[a]
  2419.             });
  2420.         else
  2421.             for (var d = 0; d < 34; d++) {
  2422.                 var b = Sys.Serialization.JavaScriptSerializer._charsToEscape[d];
  2423.                 if (a.indexOf(b) !== -1)
  2424.                     if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox)
  2425.                         a = a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);
  2426.                     else
  2427.                         a = a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b], Sys.Serialization.JavaScriptSerializer._escapeChars[b])
  2428.             }
  2429.     }
  2430.     c.append(a);
  2431.     c.append('"')
  2432. }
  2433. ;
  2434. Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function(b, a, i, g) {
  2435.     var c;
  2436.     switch (typeof b) {
  2437.     case "object":
  2438.         if (b)
  2439.             if (Number.isInstanceOfType(b))
  2440.                 Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a);
  2441.             else if (Boolean.isInstanceOfType(b))
  2442.                 Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a);
  2443.             else if (String.isInstanceOfType(b))
  2444.                 Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a);
  2445.             else if (Array.isInstanceOfType(b)) {
  2446.                 a.append("[");
  2447.                 for (c = 0; c < b.length; ++c) {
  2448.                     if (c > 0)
  2449.                         a.append(",");
  2450.                     Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c], a, false, g)
  2451.                 }
  2452.                 a.append("]")
  2453.             } else {
  2454.                 if (Date.isInstanceOfType(b)) {
  2455.                     a.append('"\\/Date(');
  2456.                     a.append(b.getTime());
  2457.                     a.append(')\\/"');
  2458.                     break
  2459.                 }
  2460.                 var d = []
  2461.                   , f = 0;
  2462.                 for (var e in b) {
  2463.                     if (e.startsWith("$"))
  2464.                         continue;if (e === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && f !== 0) {
  2465.                         d[f++] = d[0];
  2466.                         d[0] = e
  2467.                     } else
  2468.                         d[f++] = e
  2469.                 }
  2470.                 if (i)
  2471.                     d.sort();
  2472.                 a.append("{");
  2473.                 var j = false;
  2474.                 for (c = 0; c < f; c++) {
  2475.                     var h = b[d[c]];
  2476.                     if (typeof h !== "undefined" && typeof h !== "function") {
  2477.                         if (j)
  2478.                             a.append(",");
  2479.                         else
  2480.                             j = true;
  2481.                         Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c], a, i, g);
  2482.                         a.append(":");
  2483.                         Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h, a, i, g)
  2484.                     }
  2485.                 }
  2486.                 a.append("}")
  2487.             }
  2488.         else
  2489.             a.append("null");
  2490.         break;
  2491.     case "number":
  2492.         Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a);
  2493.         break;
  2494.     case "string":
  2495.         Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a);
  2496.         break;
  2497.     case "boolean":
  2498.         Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a);
  2499.         break;
  2500.     default:
  2501.         a.append("null")
  2502.     }
  2503. }
  2504. ;
  2505. Sys.Serialization.JavaScriptSerializer.serialize = function(b) {
  2506.     var a = new Sys.StringBuilder;
  2507.     Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b, a, false);
  2508.     return a.toString()
  2509. }
  2510. ;
  2511. Sys.Serialization.JavaScriptSerializer.deserialize = function(data, secure) {
  2512.     if (data.length === 0)
  2513.         throw Error.argument("data", Sys.Res.cannotDeserializeEmptyString);
  2514.     try {
  2515.         var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)");
  2516.         if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, "")))
  2517.             throw null ;
  2518.         return eval("(" + exp + ")")
  2519.     } catch (a) {
  2520.         throw Error.argument("data", Sys.Res.cannotDeserializeInvalidJson)
  2521.     }
  2522. }
  2523. ;
  2524. Type.registerNamespace("Sys.UI");
  2525. Sys.EventHandlerList = function() {
  2526.     this._list = {}
  2527. }
  2528. ;
  2529. Sys.EventHandlerList.prototype = {
  2530.     _addHandler: function(b, a) {
  2531.         Array.add(this._getEvent(b, true), a)
  2532.     },
  2533.     addHandler: function(b, a) {
  2534.         this._addHandler(b, a)
  2535.     },
  2536.     _removeHandler: function(c, b) {
  2537.         var a = this._getEvent(c);
  2538.         if (!a)
  2539.             return;
  2540.         Array.remove(a, b)
  2541.     },
  2542.     removeHandler: function(b, a) {
  2543.         this._removeHandler(b, a)
  2544.     },
  2545.     getHandler: function(b) {
  2546.         var a = this._getEvent(b);
  2547.         if (!a || a.length === 0)
  2548.             return null ;
  2549.         a = Array.clone(a);
  2550.         return function(c, d) {
  2551.             for (var b = 0, e = a.length; b < e; b++)
  2552.                 a[b](c, d)
  2553.         }
  2554.     },
  2555.     _getEvent: function(a, b) {
  2556.         if (!this._list[a]) {
  2557.             if (!b)
  2558.                 return null ;
  2559.             this._list[a] = []
  2560.         }
  2561.         return this._list[a]
  2562.     }
  2563. };
  2564. Sys.EventHandlerList.registerClass("Sys.EventHandlerList");
  2565. Sys.CommandEventArgs = function(c, a, b) {
  2566.     Sys.CommandEventArgs.initializeBase(this);
  2567.     this._commandName = c;
  2568.     this._commandArgument = a;
  2569.     this._commandSource = b
  2570. }
  2571. ;
  2572. Sys.CommandEventArgs.prototype = {
  2573.     _commandName: null ,
  2574.     _commandArgument: null ,
  2575.     _commandSource: null ,
  2576.     get_commandName: function() {
  2577.         return this._commandName
  2578.     },
  2579.     get_commandArgument: function() {
  2580.         return this._commandArgument
  2581.     },
  2582.     get_commandSource: function() {
  2583.         return this._commandSource
  2584.     }
  2585. };
  2586. Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
  2587. Sys.INotifyPropertyChange = function() {}
  2588. ;
  2589. Sys.INotifyPropertyChange.prototype = {};
  2590. Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");
  2591. Sys.PropertyChangedEventArgs = function(a) {
  2592.     Sys.PropertyChangedEventArgs.initializeBase(this);
  2593.     this._propertyName = a
  2594. }
  2595. ;
  2596. Sys.PropertyChangedEventArgs.prototype = {
  2597.     get_propertyName: function() {
  2598.         return this._propertyName
  2599.     }
  2600. };
  2601. Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs", Sys.EventArgs);
  2602. Sys.INotifyDisposing = function() {}
  2603. ;
  2604. Sys.INotifyDisposing.prototype = {};
  2605. Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");
  2606. Sys.Component = function() {
  2607.     if (Sys.Application)
  2608.         Sys.Application.registerDisposableObject(this)
  2609. }
  2610. ;
  2611. Sys.Component.prototype = {
  2612.     _id: null ,
  2613.     _initialized: false,
  2614.     _updating: false,
  2615.     get_events: function() {
  2616.         if (!this._events)
  2617.             this._events = new Sys.EventHandlerList;
  2618.         return this._events
  2619.     },
  2620.     get_id: function() {
  2621.         return this._id
  2622.     },
  2623.     set_id: function(a) {
  2624.         this._id = a
  2625.     },
  2626.     get_isInitialized: function() {
  2627.         return this._initialized
  2628.     },
  2629.     get_isUpdating: function() {
  2630.         return this._updating
  2631.     },
  2632.     add_disposing: function(a) {
  2633.         this.get_events().addHandler("disposing", a)
  2634.     },
  2635.     remove_disposing: function(a) {
  2636.         this.get_events().removeHandler("disposing", a)
  2637.     },
  2638.     add_propertyChanged: function(a) {
  2639.         this.get_events().addHandler("propertyChanged", a)
  2640.     },
  2641.     remove_propertyChanged: function(a) {
  2642.         this.get_events().removeHandler("propertyChanged", a)
  2643.     },
  2644.     beginUpdate: function() {
  2645.         this._updating = true
  2646.     },
  2647.     dispose: function() {
  2648.         if (this._events) {
  2649.             var a = this._events.getHandler("disposing");
  2650.             if (a)
  2651.                 a(this, Sys.EventArgs.Empty)
  2652.         }
  2653.         delete this._events;
  2654.         Sys.Application.unregisterDisposableObject(this);
  2655.         Sys.Application.removeComponent(this)
  2656.     },
  2657.     endUpdate: function() {
  2658.         this._updating = false;
  2659.         if (!this._initialized)
  2660.             this.initialize();
  2661.         this.updated()
  2662.     },
  2663.     initialize: function() {
  2664.         this._initialized = true
  2665.     },
  2666.     raisePropertyChanged: function(b) {
  2667.         if (!this._events)
  2668.             return;
  2669.         var a = this._events.getHandler("propertyChanged");
  2670.         if (a)
  2671.             a(this, new Sys.PropertyChangedEventArgs(b))
  2672.     },
  2673.     updated: function() {}
  2674. };
  2675. Sys.Component.registerClass("Sys.Component", null , Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing);
  2676. function Sys$Component$_setProperties(a, i) {
  2677.     var d, j = Object.getType(a), e = j === Object || j === Sys.UI.DomElement, h = Sys.Component.isInstanceOfType(a) && !a.get_isUpdating();
  2678.     if (h)
  2679.         a.beginUpdate();
  2680.     for (var c in i) {
  2681.         var b = i[c]
  2682.           , f = e ? null : a["get_" + c];
  2683.         if (e || typeof f !== "function") {
  2684.             var k = a[c];
  2685.             if (!b || typeof b !== "object" || e && !k)
  2686.                 a[c] = b;
  2687.             else
  2688.                 Sys$Component$_setProperties(k, b)
  2689.         } else {
  2690.             var l = a["set_" + c];
  2691.             if (typeof l === "function")
  2692.                 l.apply(a, [b]);
  2693.             else if (b instanceof Array) {
  2694.                 d = f.apply(a);
  2695.                 for (var g = 0, m = d.length, n = b.length; g < n; g++,
  2696.                 m++)
  2697.                     d[m] = b[g]
  2698.             } else if (typeof b === "object" && Object.getType(b) === Object) {
  2699.                 d = f.apply(a);
  2700.                 Sys$Component$_setProperties(d, b)
  2701.             }
  2702.         }
  2703.     }
  2704.     if (h)
  2705.         a.endUpdate()
  2706. }
  2707. function Sys$Component$_setReferences(c, b) {
  2708.     for (var a in b) {
  2709.         var e = c["set_" + a]
  2710.           , d = $find(b[a]);
  2711.         e.apply(c, [d])
  2712.     }
  2713. }
  2714. var $create = Sys.Component.create = function(h, f, d, c, g) {
  2715.     var a = g ? new h(g) : new h
  2716.       , b = Sys.Application
  2717.       , i = b.get_isCreatingComponents();
  2718.     a.beginUpdate();
  2719.     if (f)
  2720.         Sys$Component$_setProperties(a, f);
  2721.     if (d)
  2722.         for (var e in d)
  2723.             a["add_" + e](d[e]);
  2724.     if (a.get_id())
  2725.         b.addComponent(a);
  2726.     if (i) {
  2727.         b._createdComponents[b._createdComponents.length] = a;
  2728.         if (c)
  2729.             b._addComponentToSecondPass(a, c);
  2730.         else
  2731.             a.endUpdate()
  2732.     } else {
  2733.         if (c)
  2734.             Sys$Component$_setReferences(a, c);
  2735.         a.endUpdate()
  2736.     }
  2737.     return a
  2738. }
  2739. ;
  2740. Sys.UI.MouseButton = function() {
  2741.     throw Error.notImplemented()
  2742. }
  2743. ;
  2744. Sys.UI.MouseButton.prototype = {
  2745.     leftButton: 0,
  2746.     middleButton: 1,
  2747.     rightButton: 2
  2748. };
  2749. Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
  2750. Sys.UI.Key = function() {
  2751.     throw Error.notImplemented()
  2752. }
  2753. ;
  2754. Sys.UI.Key.prototype = {
  2755.     backspace: 8,
  2756.     tab: 9,
  2757.     enter: 13,
  2758.     esc: 27,
  2759.     space: 32,
  2760.     pageUp: 33,
  2761.     pageDown: 34,
  2762.     end: 35,
  2763.     home: 36,
  2764.     left: 37,
  2765.     up: 38,
  2766.     right: 39,
  2767.     down: 40,
  2768.     del: 127
  2769. };
  2770. Sys.UI.Key.registerEnum("Sys.UI.Key");
  2771. Sys.UI.Point = function(a, b) {
  2772.     this.rawX = a;
  2773.     this.rawY = b;
  2774.     this.x = Math.round(a);
  2775.     this.y = Math.round(b)
  2776. }
  2777. ;
  2778. Sys.UI.Point.registerClass("Sys.UI.Point");
  2779. Sys.UI.Bounds = function(c, d, b, a) {
  2780.     this.x = c;
  2781.     this.y = d;
  2782.     this.height = a;
  2783.     this.width = b
  2784. }
  2785. ;
  2786. Sys.UI.Bounds.registerClass("Sys.UI.Bounds");
  2787. Sys.UI.DomEvent = function(e) {
  2788.     var a = e
  2789.       , b = this.type = a.type.toLowerCase();
  2790.     this.rawEvent = a;
  2791.     this.altKey = a.altKey;
  2792.     if (typeof a.button !== "undefined")
  2793.         this.button = typeof a.which !== "undefined" ? a.button : a.button === 4 ? Sys.UI.MouseButton.middleButton : a.button === 2 ? Sys.UI.MouseButton.rightButton : Sys.UI.MouseButton.leftButton;
  2794.     if (b === "keypress")
  2795.         this.charCode = a.charCode || a.keyCode;
  2796.     else if (a.keyCode && a.keyCode === 46)
  2797.         this.keyCode = 127;
  2798.     else
  2799.         this.keyCode = a.keyCode;
  2800.     this.clientX = a.clientX;
  2801.     this.clientY = a.clientY;
  2802.     this.ctrlKey = a.ctrlKey;
  2803.     this.target = a.target ? a.target : a.srcElement;
  2804.     if (!b.startsWith("key"))
  2805.         if (typeof a.offsetX !== "undefined" && typeof a.offsetY !== "undefined") {
  2806.             this.offsetX = a.offsetX;
  2807.             this.offsetY = a.offsetY
  2808.         } else if (this.target && this.target.nodeType !== 3 && typeof a.clientX === "number") {
  2809.             var c = Sys.UI.DomElement.getLocation(this.target)
  2810.               , d = Sys.UI.DomElement._getWindow(this.target);
  2811.             this.offsetX = (d.pageXOffset || 0) + a.clientX - c.x;
  2812.             this.offsetY = (d.pageYOffset || 0) + a.clientY - c.y
  2813.         }
  2814.     this.screenX = a.screenX;
  2815.     this.screenY = a.screenY;
  2816.     this.shiftKey = a.shiftKey
  2817. }
  2818. ;
  2819. Sys.UI.DomEvent.prototype = {
  2820.     preventDefault: function() {
  2821.         if (this.rawEvent.preventDefault)
  2822.             this.rawEvent.preventDefault();
  2823.         else if (window.event)
  2824.             this.rawEvent.returnValue = false
  2825.     },
  2826.     stopPropagation: function() {
  2827.         if (this.rawEvent.stopPropagation)
  2828.             this.rawEvent.stopPropagation();
  2829.         else if (window.event)
  2830.             this.rawEvent.cancelBubble = true
  2831.     }
  2832. };
  2833. Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");
  2834. var $addHandler = Sys.UI.DomEvent.addHandler = function(a, d, e, g) {
  2835.     if (!a._events)
  2836.         a._events = {};
  2837.     var c = a._events[d];
  2838.     if (!c)
  2839.         a._events[d] = c = [];
  2840.     var b;
  2841.     if (a.addEventListener) {
  2842.         b = function(b) {
  2843.             return e.call(a, new Sys.UI.DomEvent(b))
  2844.         }
  2845.         ;
  2846.         a.addEventListener(d, b, false)
  2847.     } else if (a.attachEvent) {
  2848.         b = function() {
  2849.             var b = {};
  2850.             try {
  2851.                 b = Sys.UI.DomElement._getWindow(a).event
  2852.             } catch (c) {}
  2853.             return e.call(a, new Sys.UI.DomEvent(b))
  2854.         }
  2855.         ;
  2856.         a.attachEvent("on" + d, b)
  2857.     }
  2858.     c[c.length] = {
  2859.         handler: e,
  2860.         browserHandler: b,
  2861.         autoRemove: g
  2862.     };
  2863.     if (g) {
  2864.         var f = a.dispose;
  2865.         if (f !== Sys.UI.DomEvent._disposeHandlers) {
  2866.             a.dispose = Sys.UI.DomEvent._disposeHandlers;
  2867.             if (typeof f !== "undefined")
  2868.                 a._chainDispose = f
  2869.         }
  2870.     }
  2871. }
  2872.   , $addHandlers = Sys.UI.DomEvent.addHandlers = function(f, d, c, e) {
  2873.     for (var b in d) {
  2874.         var a = d[b];
  2875.         if (c)
  2876.             a = Function.createDelegate(c, a);
  2877.         $addHandler(f, b, a, e || false)
  2878.     }
  2879. }
  2880.   , $clearHandlers = Sys.UI.DomEvent.clearHandlers = function(a) {
  2881.     Sys.UI.DomEvent._clearHandlers(a, false)
  2882. }
  2883. ;
  2884. Sys.UI.DomEvent._clearHandlers = function(a, g) {
  2885.     if (a._events) {
  2886.         var e = a._events;
  2887.         for (var b in e) {
  2888.             var d = e[b];
  2889.             for (var c = d.length - 1; c >= 0; c--) {
  2890.                 var f = d[c];
  2891.                 if (!g || f.autoRemove)
  2892.                     $removeHandler(a, b, f.handler)
  2893.             }
  2894.         }
  2895.         a._events = null
  2896.     }
  2897. }
  2898. ;
  2899. Sys.UI.DomEvent._disposeHandlers = function() {
  2900.     Sys.UI.DomEvent._clearHandlers(this, true);
  2901.     var b = this._chainDispose
  2902.       , a = typeof b;
  2903.     if (a !== "undefined") {
  2904.         this.dispose = b;
  2905.         this._chainDispose = null ;
  2906.         if (a === "function")
  2907.             this.dispose()
  2908.     }
  2909. }
  2910. ;
  2911. var $removeHandler = Sys.UI.DomEvent.removeHandler = function(b, a, c) {
  2912.     Sys.UI.DomEvent._removeHandler(b, a, c)
  2913. }
  2914. ;
  2915. Sys.UI.DomEvent._removeHandler = function(a, e, f) {
  2916.     var d = null
  2917.       , c = a._events[e];
  2918.     for (var b = 0, g = c.length; b < g; b++)
  2919.         if (c[b].handler === f) {
  2920.             d = c[b].browserHandler;
  2921.             break
  2922.         }
  2923.     if (a.removeEventListener)
  2924.         a.removeEventListener(e, d, false);
  2925.     else if (a.detachEvent)
  2926.         a.detachEvent("on" + e, d);
  2927.     c.splice(b, 1)
  2928. }
  2929. ;
  2930. Sys.UI.DomElement = function() {}
  2931. ;
  2932. Sys.UI.DomElement.registerClass("Sys.UI.DomElement");
  2933. Sys.UI.DomElement.addCssClass = function(a, b) {
  2934.     if (!Sys.UI.DomElement.containsCssClass(a, b))
  2935.         if (a.className === "")
  2936.             a.className = b;
  2937.         else
  2938.             a.className += " " + b
  2939. }
  2940. ;
  2941. Sys.UI.DomElement.containsCssClass = function(b, a) {
  2942.     return Array.contains(b.className.split(" "), a)
  2943. }
  2944. ;
  2945. Sys.UI.DomElement.getBounds = function(a) {
  2946.     var b = Sys.UI.DomElement.getLocation(a);
  2947.     return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth || 0,a.offsetHeight || 0)
  2948. }
  2949. ;
  2950. var $get = Sys.UI.DomElement.getElementById = function(f, e) {
  2951.     if (!e)
  2952.         return document.getElementById(f);
  2953.     if (e.getElementById)
  2954.         return e.getElementById(f);
  2955.     var c = []
  2956.       , d = e.childNodes;
  2957.     for (var b = 0; b < d.length; b++) {
  2958.         var a = d[b];
  2959.         if (a.nodeType == 1)
  2960.             c[c.length] = a
  2961.     }
  2962.     while (c.length) {
  2963.         a = c.shift();
  2964.         if (a.id == f)
  2965.             return a;
  2966.         d = a.childNodes;
  2967.         for (b = 0; b < d.length; b++) {
  2968.             a = d[b];
  2969.             if (a.nodeType == 1)
  2970.                 c[c.length] = a
  2971.         }
  2972.     }
  2973.     return null
  2974. }
  2975. ;
  2976. if (document.documentElement.getBoundingClientRect)
  2977.     Sys.UI.DomElement.getLocation = function(a) {
  2978.         if (a.self || a.nodeType === 9 || a === document.documentElement || a.parentNode === a.ownerDocument.documentElement)
  2979.             return new Sys.UI.Point(0,0);
  2980.         var f = a.getBoundingClientRect();
  2981.         if (!f)
  2982.             return new Sys.UI.Point(0,0);
  2983.         var e = a.ownerDocument.documentElement, h = a.ownerDocument.body, l, c = Math.round(f.left) + (e.scrollLeft || h.scrollLeft), d = Math.round(f.top) + (e.scrollTop || h.scrollTop);
  2984.         if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
  2985.             try {
  2986.                 var g = a.ownerDocument.parentWindow.frameElement || null ;
  2987.                 if (g) {
  2988.                     var i = g.frameBorder === "0" || g.frameBorder === "no" ? 2 : 0;
  2989.                     c += i;
  2990.                     d += i
  2991.                 }
  2992.             } catch (m) {}
  2993.             if (Sys.Browser.version === 7 && !document.documentMode) {
  2994.                 var j = document.body
  2995.                   , k = j.getBoundingClientRect()
  2996.                   , b = (k.right - k.left) / j.clientWidth;
  2997.                 b = Math.round(b * 100);
  2998.                 b = (b - b % 5) / 100;
  2999.                 if (!isNaN(b) && b !== 1) {
  3000.                     c = Math.round(c / b);
  3001.                     d = Math.round(d / b)
  3002.                 }
  3003.             }
  3004.             if ((document.documentMode || 0) < 8) {
  3005.                 c -= e.clientLeft;
  3006.                 d -= e.clientTop
  3007.             }
  3008.         }
  3009.         return new Sys.UI.Point(c,d)
  3010.     }
  3011.     ;
  3012. else if (Sys.Browser.agent === Sys.Browser.Safari)
  3013.     Sys.UI.DomElement.getLocation = function(c) {
  3014.         if (c.window && c.window === c || c.nodeType === 9)
  3015.             return new Sys.UI.Point(0,0);
  3016.         var d = 0, e = 0, a, j = null , g = null , b;
  3017.         for (a = c; a; j = a,
  3018.         (g = b,
  3019.         a = a.offsetParent)) {
  3020.             b = Sys.UI.DomElement._getCurrentStyle(a);
  3021.             var f = a.tagName ? a.tagName.toUpperCase() : null ;
  3022.             if ((a.offsetLeft || a.offsetTop) && (f !== "BODY" || (!g || g.position !== "absolute"))) {
  3023.                 d += a.offsetLeft;
  3024.                 e += a.offsetTop
  3025.             }
  3026.             if (j && Sys.Browser.version >= 3) {
  3027.                 d += parseInt(b.borderLeftWidth);
  3028.                 e += parseInt(b.borderTopWidth)
  3029.             }
  3030.         }
  3031.         b = Sys.UI.DomElement._getCurrentStyle(c);
  3032.         var h = b ? b.position : null ;
  3033.         if (!h || h !== "absolute")
  3034.             for (a = c.parentNode; a; a = a.parentNode) {
  3035.                 f = a.tagName ? a.tagName.toUpperCase() : null ;
  3036.                 if (f !== "BODY" && f !== "HTML" && (a.scrollLeft || a.scrollTop)) {
  3037.                     d -= a.scrollLeft || 0;
  3038.                     e -= a.scrollTop || 0
  3039.                 }
  3040.                 b = Sys.UI.DomElement._getCurrentStyle(a);
  3041.                 var i = b ? b.position : null ;
  3042.                 if (i && i === "absolute")
  3043.                     break
  3044.             }
  3045.         return new Sys.UI.Point(d,e)
  3046.     }
  3047.     ;
  3048. else
  3049.     Sys.UI.DomElement.getLocation = function(d) {
  3050.         if (d.window && d.window === d || d.nodeType === 9)
  3051.             return new Sys.UI.Point(0,0);
  3052.         var e = 0, f = 0, a, i = null , g = null , b = null ;
  3053.         for (a = d; a; i = a,
  3054.         (g = b,
  3055.         a = a.offsetParent)) {
  3056.             var c = a.tagName ? a.tagName.toUpperCase() : null ;
  3057.             b = Sys.UI.DomElement._getCurrentStyle(a);
  3058.             if ((a.offsetLeft || a.offsetTop) && !(c === "BODY" && (!g || g.position !== "absolute"))) {
  3059.                 e += a.offsetLeft;
  3060.                 f += a.offsetTop
  3061.             }
  3062.             if (i !== null && b) {
  3063.                 if (c !== "TABLE" && c !== "TD" && c !== "HTML") {
  3064.                     e += parseInt(b.borderLeftWidth) || 0;
  3065.                     f += parseInt(b.borderTopWidth) || 0
  3066.                 }
  3067.                 if (c === "TABLE" && (b.position === "relative" || b.position === "absolute")) {
  3068.                     e += parseInt(b.marginLeft) || 0;
  3069.                     f += parseInt(b.marginTop) || 0
  3070.                 }
  3071.             }
  3072.         }
  3073.         b = Sys.UI.DomElement._getCurrentStyle(d);
  3074.         var h = b ? b.position : null ;
  3075.         if (!h || h !== "absolute")
  3076.             for (a = d.parentNode; a; a = a.parentNode) {
  3077.                 c = a.tagName ? a.tagName.toUpperCase() : null ;
  3078.                 if (c !== "BODY" && c !== "HTML" && (a.scrollLeft || a.scrollTop)) {
  3079.                     e -= a.scrollLeft || 0;
  3080.                     f -= a.scrollTop || 0;
  3081.                     b = Sys.UI.DomElement._getCurrentStyle(a);
  3082.                     if (b) {
  3083.                         e += parseInt(b.borderLeftWidth) || 0;
  3084.                         f += parseInt(b.borderTopWidth) || 0
  3085.                     }
  3086.                 }
  3087.             }
  3088.         return new Sys.UI.Point(e,f)
  3089.     }
  3090.     ;
  3091. Sys.UI.DomElement.isDomElement = function(a) {
  3092.     return Sys._isDomElement(a)
  3093. }
  3094. ;
  3095. Sys.UI.DomElement.removeCssClass = function(d, c) {
  3096.     var a = " " + d.className + " "
  3097.       , b = a.indexOf(" " + c + " ");
  3098.     if (b >= 0)
  3099.         d.className = (a.substr(0, b) + " " + a.substring(b + c.length + 1, a.length)).trim()
  3100. }
  3101. ;
  3102. Sys.UI.DomElement.resolveElement = function(b, c) {
  3103.     var a = b;
  3104.     if (!a)
  3105.         return null ;
  3106.     if (typeof a === "string")
  3107.         a = Sys.UI.DomElement.getElementById(a, c);
  3108.     return a
  3109. }
  3110. ;
  3111. Sys.UI.DomElement.raiseBubbleEvent = function(c, d) {
  3112.     var b = c;
  3113.     while (b) {
  3114.         var a = b.control;
  3115.         if (a && a.onBubbleEvent && a.raiseBubbleEvent) {
  3116.             Sys.UI.DomElement._raiseBubbleEventFromControl(a, c, d);
  3117.             return
  3118.         }
  3119.         b = b.parentNode
  3120.     }
  3121. }
  3122. ;
  3123. Sys.UI.DomElement._raiseBubbleEventFromControl = function(a, b, c) {
  3124.     if (!a.onBubbleEvent(b, c))
  3125.         a._raiseBubbleEvent(b, c)
  3126. }
  3127. ;
  3128. Sys.UI.DomElement.setLocation = function(b, c, d) {
  3129.     var a = b.style;
  3130.     a.position = "absolute";
  3131.     a.left = c + "px";
  3132.     a.top = d + "px"
  3133. }
  3134. ;
  3135. Sys.UI.DomElement.toggleCssClass = function(b, a) {
  3136.     if (Sys.UI.DomElement.containsCssClass(b, a))
  3137.         Sys.UI.DomElement.removeCssClass(b, a);
  3138.     else
  3139.         Sys.UI.DomElement.addCssClass(b, a)
  3140. }
  3141. ;
  3142. Sys.UI.DomElement.getVisibilityMode = function(a) {
  3143.     return a._visibilityMode === Sys.UI.VisibilityMode.hide ? Sys.UI.VisibilityMode.hide : Sys.UI.VisibilityMode.collapse
  3144. }
  3145. ;
  3146. Sys.UI.DomElement.setVisibilityMode = function(a, b) {
  3147.     Sys.UI.DomElement._ensureOldDisplayMode(a);
  3148.     if (a._visibilityMode !== b) {
  3149.         a._visibilityMode = b;
  3150.         if (Sys.UI.DomElement.getVisible(a) === false)
  3151.             if (a._visibilityMode === Sys.UI.VisibilityMode.hide)
  3152.                 a.style.display = a._oldDisplayMode;
  3153.             else
  3154.                 a.style.display = "none";
  3155.         a._visibilityMode = b
  3156.     }
  3157. }
  3158. ;
  3159. Sys.UI.DomElement.getVisible = function(b) {
  3160.     var a = b.currentStyle || Sys.UI.DomElement._getCurrentStyle(b);
  3161.     if (!a)
  3162.         return true;
  3163.     return a.visibility !== "hidden" && a.display !== "none"
  3164. }
  3165. ;
  3166. Sys.UI.DomElement.setVisible = function(a, b) {
  3167.     if (b !== Sys.UI.DomElement.getVisible(a)) {
  3168.         Sys.UI.DomElement._ensureOldDisplayMode(a);
  3169.         a.style.visibility = b ? "visible" : "hidden";
  3170.         if (b || a._visibilityMode === Sys.UI.VisibilityMode.hide)
  3171.             a.style.display = a._oldDisplayMode;
  3172.         else
  3173.             a.style.display = "none"
  3174.     }
  3175. }
  3176. ;
  3177. Sys.UI.DomElement._ensureOldDisplayMode = function(a) {
  3178.     if (!a._oldDisplayMode) {
  3179.         var b = a.currentStyle || Sys.UI.DomElement._getCurrentStyle(a);
  3180.         a._oldDisplayMode = b ? b.display : null ;
  3181.         if (!a._oldDisplayMode || a._oldDisplayMode === "none")
  3182.             switch (a.tagName.toUpperCase()) {
  3183.             case "DIV":
  3184.             case "P":
  3185.             case "ADDRESS":
  3186.             case "BLOCKQUOTE":
  3187.             case "BODY":
  3188.             case "COL":
  3189.             case "COLGROUP":
  3190.             case "DD":
  3191.             case "DL":
  3192.             case "DT":
  3193.             case "FIELDSET":
  3194.             case "FORM":
  3195.             case "H1":
  3196.             case "H2":
  3197.             case "H3":
  3198.             case "H4":
  3199.             case "H5":
  3200.             case "H6":
  3201.             case "HR":
  3202.             case "IFRAME":
  3203.             case "LEGEND":
  3204.             case "OL":
  3205.             case "PRE":
  3206.             case "TABLE":
  3207.             case "TD":
  3208.             case "TH":
  3209.             case "TR":
  3210.             case "UL":
  3211.                 a._oldDisplayMode = "block";
  3212.                 break;
  3213.             case "LI":
  3214.                 a._oldDisplayMode = "list-item";
  3215.                 break;
  3216.             default:
  3217.                 a._oldDisplayMode = "inline"
  3218.             }
  3219.     }
  3220. }
  3221. ;
  3222. Sys.UI.DomElement._getWindow = function(a) {
  3223.     var b = a.ownerDocument || a.document || a;
  3224.     return b.defaultView || b.parentWindow
  3225. }
  3226. ;
  3227. Sys.UI.DomElement._getCurrentStyle = function(a) {
  3228.     if (a.nodeType === 3)
  3229.         return null ;
  3230.     var c = Sys.UI.DomElement._getWindow(a);
  3231.     if (a.documentElement)
  3232.         a = a.documentElement;
  3233.     var b = c && a !== c && c.getComputedStyle ? c.getComputedStyle(a, null ) : a.currentStyle || a.style;
  3234.     if (!b && Sys.Browser.agent === Sys.Browser.Safari && a.style) {
  3235.         var g = a.style.display
  3236.           , f = a.style.position;
  3237.         a.style.position = "absolute";
  3238.         a.style.display = "block";
  3239.         var e = c.getComputedStyle(a, null );
  3240.         a.style.display = g;
  3241.         a.style.position = f;
  3242.         b = {};
  3243.         for (var d in e)
  3244.             b[d] = e[d];
  3245.         b.display = "none"
  3246.     }
  3247.     return b
  3248. }
  3249. ;
  3250. Sys.IContainer = function() {}
  3251. ;
  3252. Sys.IContainer.prototype = {};
  3253. Sys.IContainer.registerInterface("Sys.IContainer");
  3254. Sys.ApplicationLoadEventArgs = function(b, a) {
  3255.     Sys.ApplicationLoadEventArgs.initializeBase(this);
  3256.     this._components = b;
  3257.     this._isPartialLoad = a
  3258. }
  3259. ;
  3260. Sys.ApplicationLoadEventArgs.prototype = {
  3261.     get_components: function() {
  3262.         return this._components
  3263.     },
  3264.     get_isPartialLoad: function() {
  3265.         return this._isPartialLoad
  3266.     }
  3267. };
  3268. Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs", Sys.EventArgs);
  3269. Sys._Application = function() {
  3270.     Sys._Application.initializeBase(this);
  3271.     this._disposableObjects = [];
  3272.     this._components = {};
  3273.     this._createdComponents = [];
  3274.     this._secondPassComponents = [];
  3275.     this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler);
  3276.     Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
  3277.     this._domReady()
  3278. }
  3279. ;
  3280. Sys._Application.prototype = {
  3281.     _creatingComponents: false,
  3282.     _disposing: false,
  3283.     _deleteCount: 0,
  3284.     get_isCreatingComponents: function() {
  3285.         return this._creatingComponents
  3286.     },
  3287.     get_isDisposing: function() {
  3288.         return this._disposing
  3289.     },
  3290.     add_init: function(a) {
  3291.         if (this._initialized)
  3292.             a(this, Sys.EventArgs.Empty);
  3293.         else
  3294.             this.get_events().addHandler("init", a)
  3295.     },
  3296.     remove_init: function(a) {
  3297.         this.get_events().removeHandler("init", a)
  3298.     },
  3299.     add_load: function(a) {
  3300.         this.get_events().addHandler("load", a)
  3301.     },
  3302.     remove_load: function(a) {
  3303.         this.get_events().removeHandler("load", a)
  3304.     },
  3305.     add_unload: function(a) {
  3306.         this.get_events().addHandler("unload", a)
  3307.     },
  3308.     remove_unload: function(a) {
  3309.         this.get_events().removeHandler("unload", a)
  3310.     },
  3311.     addComponent: function(a) {
  3312.         this._components[a.get_id()] = a
  3313.     },
  3314.     beginCreateComponents: function() {
  3315.         this._creatingComponents = true
  3316.     },
  3317.     dispose: function() {
  3318.         if (!this._disposing) {
  3319.             this._disposing = true;
  3320.             if (this._timerCookie) {
  3321.                 window.clearTimeout(this._timerCookie);
  3322.                 delete this._timerCookie
  3323.             }
  3324.             if (this._endRequestHandler) {
  3325.                 Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);
  3326.                 delete this._endRequestHandler
  3327.             }
  3328.             if (this._beginRequestHandler) {
  3329.                 Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);
  3330.                 delete this._beginRequestHandler
  3331.             }
  3332.             if (window.pageUnload)
  3333.                 window.pageUnload(this, Sys.EventArgs.Empty);
  3334.             var c = this.get_events().getHandler("unload");
  3335.             if (c)
  3336.                 c(this, Sys.EventArgs.Empty);
  3337.             var b = Array.clone(this._disposableObjects);
  3338.             for (var a = 0, f = b.length; a < f; a++) {
  3339.                 var d = b[a];
  3340.                 if (typeof d !== "undefined")
  3341.                     d.dispose()
  3342.             }
  3343.             Array.clear(this._disposableObjects);
  3344.             Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate);
  3345.             if (Sys._ScriptLoader) {
  3346.                 var e = Sys._ScriptLoader.getInstance();
  3347.                 if (e)
  3348.                     e.dispose()
  3349.             }
  3350.             Sys._Application.callBaseMethod(this, "dispose")
  3351.         }
  3352.     },
  3353.     disposeElement: function(c, j) {
  3354.         if (c.nodeType === 1) {
  3355.             var b, h = c.getElementsByTagName("*"), g = h.length, i = new Array(g);
  3356.             for (b = 0; b < g; b++)
  3357.                 i[b] = h[b];
  3358.             for (b = g - 1; b >= 0; b--) {
  3359.                 var d = i[b]
  3360.                   , f = d.dispose;
  3361.                 if (f && typeof f === "function")
  3362.                     d.dispose();
  3363.                 else {
  3364.                     var e = d.control;
  3365.                     if (e && typeof e.dispose === "function")
  3366.                         e.dispose()
  3367.                 }
  3368.                 var a = d._behaviors;
  3369.                 if (a)
  3370.                     this._disposeComponents(a);
  3371.                 a = d._components;
  3372.                 if (a) {
  3373.                     this._disposeComponents(a);
  3374.                     d._components = null
  3375.                 }
  3376.             }
  3377.             if (!j) {
  3378.                 var f = c.dispose;
  3379.                 if (f && typeof f === "function")
  3380.                     c.dispose();
  3381.                 else {
  3382.                     var e = c.control;
  3383.                     if (e && typeof e.dispose === "function")
  3384.                         e.dispose()
  3385.                 }
  3386.                 var a = c._behaviors;
  3387.                 if (a)
  3388.                     this._disposeComponents(a);
  3389.                 a = c._components;
  3390.                 if (a) {
  3391.                     this._disposeComponents(a);
  3392.                     c._components = null
  3393.                 }
  3394.             }
  3395.         }
  3396.     },
  3397.     endCreateComponents: function() {
  3398.         var b = this._secondPassComponents;
  3399.         for (var a = 0, d = b.length; a < d; a++) {
  3400.             var c = b[a].component;
  3401.             Sys$Component$_setReferences(c, b[a].references);
  3402.             c.endUpdate()
  3403.         }
  3404.         this._secondPassComponents = [];
  3405.         this._creatingComponents = false
  3406.     },
  3407.     findComponent: function(b, a) {
  3408.         return a ? Sys.IContainer.isInstanceOfType(a) ? a.findComponent(b) : a[b] || null : Sys.Application._components[b] || null
  3409.     },
  3410.     getComponents: function() {
  3411.         var a = []
  3412.           , b = this._components;
  3413.         for (var c in b)
  3414.             a[a.length] = b[c];
  3415.         return a
  3416.     },
  3417.     initialize: function() {
  3418.         if (!this.get_isInitialized() && !this._disposing) {
  3419.             Sys._Application.callBaseMethod(this, "initialize");
  3420.             this._raiseInit();
  3421.             if (this.get_stateString) {
  3422.                 if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
  3423.                     this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest);
  3424.                     Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);
  3425.                     this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest);
  3426.                     Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)
  3427.                 }
  3428.                 var a = this.get_stateString();
  3429.                 if (a !== this._currentEntry)
  3430.                     this._navigate(a);
  3431.                 else
  3432.                     this._ensureHistory()
  3433.             }
  3434.             this.raiseLoad()
  3435.         }
  3436.     },
  3437.     notifyScriptLoaded: function() {},
  3438.     registerDisposableObject: function(b) {
  3439.         if (!this._disposing) {
  3440.             var a = this._disposableObjects
  3441.               , c = a.length;
  3442.             a[c] = b;
  3443.             b.__msdisposeindex = c
  3444.         }
  3445.     },
  3446.     raiseLoad: function() {
  3447.         var b = this.get_events().getHandler("load")
  3448.           , a = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!!this._loaded);
  3449.         this._loaded = true;
  3450.         if (b)
  3451.             b(this, a);
  3452.         if (window.pageLoad)
  3453.             window.pageLoad(this, a);
  3454.         this._createdComponents = []
  3455.     },
  3456.     removeComponent: function(b) {
  3457.         var a = b.get_id();
  3458.         if (a)
  3459.             delete this._components[a]
  3460.     },
  3461.     unregisterDisposableObject: function(a) {
  3462.         if (!this._disposing) {
  3463.             var e = a.__msdisposeindex;
  3464.             if (typeof e === "number") {
  3465.                 var b = this._disposableObjects;
  3466.                 delete b[e];
  3467.                 delete a.__msdisposeindex;
  3468.                 if (++this._deleteCount > 1000) {
  3469.                     var c = [];
  3470.                     for (var d = 0, f = b.length; d < f; d++) {
  3471.                         a = b[d];
  3472.                         if (typeof a !== "undefined") {
  3473.                             a.__msdisposeindex = c.length;
  3474.                             c.push(a)
  3475.                         }
  3476.                     }
  3477.                     this._disposableObjects = c;
  3478.                     this._deleteCount = 0
  3479.                 }
  3480.             }
  3481.         }
  3482.     },
  3483.     _addComponentToSecondPass: function(b, a) {
  3484.         this._secondPassComponents[this._secondPassComponents.length] = {
  3485.             component: b,
  3486.             references: a
  3487.         }
  3488.     },
  3489.     _disposeComponents: function(a) {
  3490.         if (a)
  3491.             for (var b = a.length - 1; b >= 0; b--) {
  3492.                 var c = a[b];
  3493.                 if (typeof c.dispose === "function")
  3494.                     c.dispose()
  3495.             }
  3496.     },
  3497.     _domReady: function() {
  3498.         var a, g, f = this;
  3499.         function b() {
  3500.             f.initialize()
  3501.         }
  3502.         var c = function() {
  3503.             Sys.UI.DomEvent.removeHandler(window, "load", c);
  3504.             b()
  3505.         }
  3506.         ;
  3507.         Sys.UI.DomEvent.addHandler(window, "load", c);
  3508.         if (document.addEventListener)
  3509.             try {
  3510.                 document.addEventListener("DOMContentLoaded", a = function() {
  3511.                     document.removeEventListener("DOMContentLoaded", a, false);
  3512.                     b()
  3513.                 }
  3514.                 , false)
  3515.             } catch (h) {}
  3516.         else if (document.attachEvent)
  3517.             if (window == window.top && document.documentElement.doScroll) {
  3518.                 var e, d = document.createElement("div");
  3519.                 a = function() {
  3520.                     try {
  3521.                         d.doScroll("left")
  3522.                     } catch (c) {
  3523.                         e = window.setTimeout(a, 0);
  3524.                         return
  3525.                     }
  3526.                     d = null ;
  3527.                     b()
  3528.                 }
  3529.                 ;
  3530.                 a()
  3531.             } else
  3532.                 document.attachEvent("onreadystatechange", a = function() {
  3533.                     if (document.readyState === "complete") {
  3534.                         document.detachEvent("onreadystatechange", a);
  3535.                         b()
  3536.                     }
  3537.                 }
  3538.                 )
  3539.     },
  3540.     _raiseInit: function() {
  3541.         var a = this.get_events().getHandler("init");
  3542.         if (a) {
  3543.             this.beginCreateComponents();
  3544.             a(this, Sys.EventArgs.Empty);
  3545.             this.endCreateComponents()
  3546.         }
  3547.     },
  3548.     _unloadHandler: function() {
  3549.         this.dispose()
  3550.     }
  3551. };
  3552. Sys._Application.registerClass("Sys._Application", Sys.Component, Sys.IContainer);
  3553. Sys.Application = new Sys._Application;
  3554. var $find = Sys.Application.findComponent;
  3555. Sys.UI.Behavior = function(b) {
  3556.     Sys.UI.Behavior.initializeBase(this);
  3557.     this._element = b;
  3558.     var a = b._behaviors;
  3559.     if (!a)
  3560.         b._behaviors = [this];
  3561.     else
  3562.         a[a.length] = this
  3563. }
  3564. ;
  3565. Sys.UI.Behavior.prototype = {
  3566.     _name: null ,
  3567.     get_element: function() {
  3568.         return this._element
  3569.     },
  3570.     get_id: function() {
  3571.         var a = Sys.UI.Behavior.callBaseMethod(this, "get_id");
  3572.         if (a)
  3573.             return a;
  3574.         if (!this._element || !this._element.id)
  3575.             return "";
  3576.         return this._element.id + "$" + this.get_name()
  3577.     },
  3578.     get_name: function() {
  3579.         if (this._name)
  3580.             return this._name;
  3581.         var a = Object.getTypeName(this)
  3582.           , b = a.lastIndexOf(".");
  3583.         if (b !== -1)
  3584.             a = a.substr(b + 1);
  3585.         if (!this.get_isInitialized())
  3586.             this._name = a;
  3587.         return a
  3588.     },
  3589.     set_name: function(a) {
  3590.         this._name = a
  3591.     },
  3592.     initialize: function() {
  3593.         Sys.UI.Behavior.callBaseMethod(this, "initialize");
  3594.         var a = this.get_name();
  3595.         if (a)
  3596.             this._element[a] = this
  3597.     },
  3598.     dispose: function() {
  3599.         Sys.UI.Behavior.callBaseMethod(this, "dispose");
  3600.         var a = this._element;
  3601.         if (a) {
  3602.             var c = this.get_name();
  3603.             if (c)
  3604.                 a[c] = null ;
  3605.             var b = a._behaviors;
  3606.             Array.remove(b, this);
  3607.             if (b.length === 0)
  3608.                 a._behaviors = null ;
  3609.             delete this._element
  3610.         }
  3611.     }
  3612. };
  3613. Sys.UI.Behavior.registerClass("Sys.UI.Behavior", Sys.Component);
  3614. Sys.UI.Behavior.getBehaviorByName = function(b, c) {
  3615.     var a = b[c];
  3616.     return a && Sys.UI.Behavior.isInstanceOfType(a) ? a : null
  3617. }
  3618. ;
  3619. Sys.UI.Behavior.getBehaviors = function(a) {
  3620.     if (!a._behaviors)
  3621.         return [];
  3622.     return Array.clone(a._behaviors)
  3623. }
  3624. ;
  3625. Sys.UI.Behavior.getBehaviorsByType = function(d, e) {
  3626.     var a = d._behaviors
  3627.       , c = [];
  3628.     if (a)
  3629.         for (var b = 0, f = a.length; b < f; b++)
  3630.             if (e.isInstanceOfType(a[b]))
  3631.                 c[c.length] = a[b];
  3632.     return c
  3633. }
  3634. ;
  3635. Sys.UI.VisibilityMode = function() {
  3636.     throw Error.notImplemented()
  3637. }
  3638. ;
  3639. Sys.UI.VisibilityMode.prototype = {
  3640.     hide: 0,
  3641.     collapse: 1
  3642. };
  3643. Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");
  3644. Sys.UI.Control = function(a) {
  3645.     Sys.UI.Control.initializeBase(this);
  3646.     this._element = a;
  3647.     a.control = this;
  3648.     var b = this.get_role();
  3649.     if (b)
  3650.         a.setAttribute("role", b)
  3651. }
  3652. ;
  3653. Sys.UI.Control.prototype = {
  3654.     _parent: null ,
  3655.     _visibilityMode: Sys.UI.VisibilityMode.hide,
  3656.     get_element: function() {
  3657.         return this._element
  3658.     },
  3659.     get_id: function() {
  3660.         if (!this._element)
  3661.             return "";
  3662.         return this._element.id
  3663.     },
  3664.     set_id: function() {
  3665.         throw Error.invalidOperation(Sys.Res.cantSetId)
  3666.     },
  3667.     get_parent: function() {
  3668.         if (this._parent)
  3669.             return this._parent;
  3670.         if (!this._element)
  3671.             return null ;
  3672.         var a = this._element.parentNode;
  3673.         while (a) {
  3674.             if (a.control)
  3675.                 return a.control;
  3676.             a = a.parentNode
  3677.         }
  3678.         return null
  3679.     },
  3680.     set_parent: function(a) {
  3681.         this._parent = a
  3682.     },
  3683.     get_role: function() {
  3684.         return null
  3685.     },
  3686.     get_visibilityMode: function() {
  3687.         return Sys.UI.DomElement.getVisibilityMode(this._element)
  3688.     },
  3689.     set_visibilityMode: function(a) {
  3690.         Sys.UI.DomElement.setVisibilityMode(this._element, a)
  3691.     },
  3692.     get_visible: function() {
  3693.         return Sys.UI.DomElement.getVisible(this._element)
  3694.     },
  3695.     set_visible: function(a) {
  3696.         Sys.UI.DomElement.setVisible(this._element, a)
  3697.     },
  3698.     addCssClass: function(a) {
  3699.         Sys.UI.DomElement.addCssClass(this._element, a)
  3700.     },
  3701.     dispose: function() {
  3702.         Sys.UI.Control.callBaseMethod(this, "dispose");
  3703.         if (this._element) {
  3704.             this._element.control = null ;
  3705.             delete this._element
  3706.         }
  3707.         if (this._parent)
  3708.             delete this._parent
  3709.     },
  3710.     onBubbleEvent: function() {
  3711.         return false
  3712.     },
  3713.     raiseBubbleEvent: function(a, b) {
  3714.         this._raiseBubbleEvent(a, b)
  3715.     },
  3716.     _raiseBubbleEvent: function(b, c) {
  3717.         var a = this.get_parent();
  3718.         while (a) {
  3719.             if (a.onBubbleEvent(b, c))
  3720.                 return;
  3721.             a = a.get_parent()
  3722.         }
  3723.     },
  3724.     removeCssClass: function(a) {
  3725.         Sys.UI.DomElement.removeCssClass(this._element, a)
  3726.     },
  3727.     toggleCssClass: function(a) {
  3728.         Sys.UI.DomElement.toggleCssClass(this._element, a)
  3729.     }
  3730. };
  3731. Sys.UI.Control.registerClass("Sys.UI.Control", Sys.Component);
  3732. Sys.HistoryEventArgs = function(a) {
  3733.     Sys.HistoryEventArgs.initializeBase(this);
  3734.     this._state = a
  3735. }
  3736. ;
  3737. Sys.HistoryEventArgs.prototype = {
  3738.     get_state: function() {
  3739.         return this._state
  3740.     }
  3741. };
  3742. Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs", Sys.EventArgs);
  3743. Sys.Application._appLoadHandler = null ;
  3744. Sys.Application._beginRequestHandler = null ;
  3745. Sys.Application._clientId = null ;
  3746. Sys.Application._currentEntry = "";
  3747. Sys.Application._endRequestHandler = null ;
  3748. Sys.Application._history = null ;
  3749. Sys.Application._enableHistory = false;
  3750. Sys.Application._historyFrame = null ;
  3751. Sys.Application._historyInitialized = false;
  3752. Sys.Application._historyPointIsNew = false;
  3753. Sys.Application._ignoreTimer = false;
  3754. Sys.Application._initialState = null ;
  3755. Sys.Application._state = {};
  3756. Sys.Application._timerCookie = 0;
  3757. Sys.Application._timerHandler = null ;
  3758. Sys.Application._uniqueId = null ;
  3759. Sys._Application.prototype.get_stateString = function() {
  3760.     var a = null ;
  3761.     if (Sys.Browser.agent === Sys.Browser.Firefox) {
  3762.         var c = window.location.href
  3763.           , b = c.indexOf("#");
  3764.         if (b !== -1)
  3765.             a = c.substring(b + 1);
  3766.         else
  3767.             a = "";
  3768.         return a
  3769.     } else
  3770.         a = window.location.hash;
  3771.     if (a.length > 0 && a.charAt(0) === "#")
  3772.         a = a.substring(1);
  3773.     return a
  3774. }
  3775. ;
  3776. Sys._Application.prototype.get_enableHistory = function() {
  3777.     return this._enableHistory
  3778. }
  3779. ;
  3780. Sys._Application.prototype.set_enableHistory = function(a) {
  3781.     this._enableHistory = a
  3782. }
  3783. ;
  3784. Sys._Application.prototype.add_navigate = function(a) {
  3785.     this.get_events().addHandler("navigate", a)
  3786. }
  3787. ;
  3788. Sys._Application.prototype.remove_navigate = function(a) {
  3789.     this.get_events().removeHandler("navigate", a)
  3790. }
  3791. ;
  3792. Sys._Application.prototype.addHistoryPoint = function(c, f) {
  3793.     this._ensureHistory();
  3794.     var b = this._state;
  3795.     for (var a in c) {
  3796.         var d = c[a];
  3797.         if (d === null ) {
  3798.             if (typeof b[a] !== "undefined")
  3799.                 delete b[a]
  3800.         } else
  3801.             b[a] = d
  3802.     }
  3803.     var e = this._serializeState(b);
  3804.     this._historyPointIsNew = true;
  3805.     this._setState(e, f);
  3806.     this._raiseNavigate()
  3807. }
  3808. ;
  3809. Sys._Application.prototype.setServerId = function(a, b) {
  3810.     this._clientId = a;
  3811.     this._uniqueId = b
  3812. }
  3813. ;
  3814. Sys._Application.prototype.setServerState = function(a) {
  3815.     this._ensureHistory();
  3816.     this._state.__s = a;
  3817.     this._updateHiddenField(a)
  3818. }
  3819. ;
  3820. Sys._Application.prototype._deserializeState = function(a) {
  3821.     var e = {};
  3822.     a = a || "";
  3823.     var b = a.indexOf("&&");
  3824.     if (b !== -1 && b + 2 < a.length) {
  3825.         e.__s = a.substr(b + 2);
  3826.         a = a.substr(0, b)
  3827.     }
  3828.     var g = a.split("&");
  3829.     for (var f = 0, j = g.length; f < j; f++) {
  3830.         var d = g[f]
  3831.           , c = d.indexOf("=");
  3832.         if (c !== -1 && c + 1 < d.length) {
  3833.             var i = d.substr(0, c)
  3834.               , h = d.substr(c + 1);
  3835.             e[i] = decodeURIComponent(h)
  3836.         }
  3837.     }
  3838.     return e
  3839. }
  3840. ;
  3841. Sys._Application.prototype._enableHistoryInScriptManager = function() {
  3842.     this._enableHistory = true
  3843. }
  3844. ;
  3845. Sys._Application.prototype._ensureHistory = function() {
  3846.     if (!this._historyInitialized && this._enableHistory) {
  3847.         if (Sys.Browser.agent === Sys.Browser.InternetExplorer && (!document.documentMode || document.documentMode < 8)) {
  3848.             this._historyFrame = document.getElementById("__historyFrame");
  3849.             this._ignoreIFrame = true
  3850.         }
  3851.         this._timerHandler = Function.createDelegate(this, this._onIdle);
  3852.         this._timerCookie = window.setTimeout(this._timerHandler, 100);
  3853.         try {
  3854.             this._initialState = this._deserializeState(this.get_stateString())
  3855.         } catch (a) {}
  3856.         this._historyInitialized = true
  3857.     }
  3858. }
  3859. ;
  3860. Sys._Application.prototype._navigate = function(c) {
  3861.     this._ensureHistory();
  3862.     var b = this._deserializeState(c);
  3863.     if (this._uniqueId) {
  3864.         var d = this._state.__s || ""
  3865.           , a = b.__s || "";
  3866.         if (a !== d) {
  3867.             this._updateHiddenField(a);
  3868.             __doPostBack(this._uniqueId, a);
  3869.             this._state = b;
  3870.             return
  3871.         }
  3872.     }
  3873.     this._setState(c);
  3874.     this._state = b;
  3875.     this._raiseNavigate()
  3876. }
  3877. ;
  3878. Sys._Application.prototype._onIdle = function() {
  3879.     delete this._timerCookie;
  3880.     var a = this.get_stateString();
  3881.     if (a !== this._currentEntry) {
  3882.         if (!this._ignoreTimer) {
  3883.             this._historyPointIsNew = false;
  3884.             this._navigate(a)
  3885.         }
  3886.     } else
  3887.         this._ignoreTimer = false;
  3888.     this._timerCookie = window.setTimeout(this._timerHandler, 100)
  3889. }
  3890. ;
  3891. Sys._Application.prototype._onIFrameLoad = function(a) {
  3892.     if (!document.documentMode || document.documentMode < 8) {
  3893.         this._ensureHistory();
  3894.         if (!this._ignoreIFrame) {
  3895.             this._historyPointIsNew = false;
  3896.             this._navigate(a)
  3897.         }
  3898.         this._ignoreIFrame = false
  3899.     }
  3900. }
  3901. ;
  3902. Sys._Application.prototype._onPageRequestManagerBeginRequest = function() {
  3903.     this._ignoreTimer = true;
  3904.     this._originalTitle = document.title
  3905. }
  3906. ;
  3907. Sys._Application.prototype._onPageRequestManagerEndRequest = function(g, f) {
  3908.     var d = f.get_dataItems()[this._clientId]
  3909.       , c = this._originalTitle;
  3910.     this._originalTitle = null ;
  3911.     var b = document.getElementById("__EVENTTARGET");
  3912.     if (b && b.value === this._uniqueId)
  3913.         b.value = "";
  3914.     if (typeof d !== "undefined") {
  3915.         this.setServerState(d);
  3916.         this._historyPointIsNew = true
  3917.     } else
  3918.         this._ignoreTimer = false;
  3919.     var a = this._serializeState(this._state);
  3920.     if (a !== this._currentEntry) {
  3921.         this._ignoreTimer = true;
  3922.         if (typeof c === "string") {
  3923.             if (Sys.Browser.agent !== Sys.Browser.InternetExplorer || Sys.Browser.version > 7) {
  3924.                 var e = document.title;
  3925.                 document.title = c;
  3926.                 this._setState(a);
  3927.                 document.title = e
  3928.             } else
  3929.                 this._setState(a);
  3930.             this._raiseNavigate()
  3931.         } else {
  3932.             this._setState(a);
  3933.             this._raiseNavigate()
  3934.         }
  3935.     }
  3936. }
  3937. ;
  3938. Sys._Application.prototype._raiseNavigate = function() {
  3939.     var d = this._historyPointIsNew
  3940.       , c = this.get_events().getHandler("navigate")
  3941.       , b = {};
  3942.     for (var a in this._state)
  3943.         if (a !== "__s")
  3944.             b[a] = this._state[a];
  3945.     var e = new Sys.HistoryEventArgs(b);
  3946.     if (c)
  3947.         c(this, e);
  3948.     if (!d) {
  3949.         var f;
  3950.         try {
  3951.             if (Sys.Browser.agent === Sys.Browser.Firefox && window.location.hash && (!window.frameElement || window.top.location.hash))
  3952.                 Sys.Browser.version < 3.5 ? window.history.go(0) : (location.hash = this.get_stateString())
  3953.         } catch (g) {}
  3954.     }
  3955. }
  3956. ;
  3957. Sys._Application.prototype._serializeState = function(d) {
  3958.     var b = [];
  3959.     for (var a in d) {
  3960.         var e = d[a];
  3961.         if (a === "__s")
  3962.             var c = e;
  3963.         else
  3964.             b[b.length] = a + "=" + encodeURIComponent(e)
  3965.     }
  3966.     return b.join("&") + (c ? "&&" + c : "")
  3967. }
  3968. ;
  3969. Sys._Application.prototype._setState = function(a, b) {
  3970.     if (this._enableHistory) {
  3971.         a = a || "";
  3972.         if (a !== this._currentEntry) {
  3973.             if (window.theForm) {
  3974.                 var d = window.theForm.action
  3975.                   , e = d.indexOf("#");
  3976.                 window.theForm.action = (e !== -1 ? d.substring(0, e) : d) + "#" + a
  3977.             }
  3978.             if (this._historyFrame && this._historyPointIsNew) {
  3979.                 var f = document.createElement("div");
  3980.                 f.appendChild(document.createTextNode(b || document.title));
  3981.                 var g = f.innerHTML;
  3982.                 this._ignoreIFrame = true;
  3983.                 var c = this._historyFrame.contentWindow.document;
  3984.                 c.open("javascript:'<html></html>'");
  3985.                 c.write("<html><head><title>" + g + "</title><scri" + 'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(' + Sys.Serialization.JavaScriptSerializer.serialize(a) + ");</scri" + "pt></head><body></body></html>");
  3986.                 c.close()
  3987.             }
  3988.             this._ignoreTimer = false;
  3989.             this._currentEntry = a;
  3990.             if (this._historyFrame || this._historyPointIsNew) {
  3991.                 var h = this.get_stateString();
  3992.                 if (a !== h) {
  3993.                     window.location.hash = a;
  3994.                     this._currentEntry = this.get_stateString();
  3995.                     if (typeof b !== "undefined" && b !== null )
  3996.                         document.title = b
  3997.                 }
  3998.             }
  3999.             this._historyPointIsNew = false
  4000.         }
  4001.     }
  4002. }
  4003. ;
  4004. Sys._Application.prototype._updateHiddenField = function(b) {
  4005.     if (this._clientId) {
  4006.         var a = document.getElementById(this._clientId);
  4007.         if (a)
  4008.             a.value = b
  4009.     }
  4010. }
  4011. ;
  4012. if (!window.XMLHttpRequest)
  4013.     window.XMLHttpRequest = function() {
  4014.         var b = ["Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP"];
  4015.         for (var a = 0, c = b.length; a < c; a++)
  4016.             try {
  4017.                 return new ActiveXObject(b[a])
  4018.             } catch (d) {}
  4019.         return null
  4020.     }
  4021.     ;
  4022. Type.registerNamespace("Sys.Net");
  4023. Sys.Net.WebRequestExecutor = function() {
  4024.     this._webRequest = null ;
  4025.     this._resultObject = null
  4026. }
  4027. ;
  4028. Sys.Net.WebRequestExecutor.prototype = {
  4029.     get_webRequest: function() {
  4030.         return this._webRequest
  4031.     },
  4032.     _set_webRequest: function(a) {
  4033.         this._webRequest = a
  4034.     },
  4035.     get_started: function() {
  4036.         throw Error.notImplemented()
  4037.     },
  4038.     get_responseAvailable: function() {
  4039.         throw Error.notImplemented()
  4040.     },
  4041.     get_timedOut: function() {
  4042.         throw Error.notImplemented()
  4043.     },
  4044.     get_aborted: function() {
  4045.         throw Error.notImplemented()
  4046.     },
  4047.     get_responseData: function() {
  4048.         throw Error.notImplemented()
  4049.     },
  4050.     get_statusCode: function() {
  4051.         throw Error.notImplemented()
  4052.     },
  4053.     get_statusText: function() {
  4054.         throw Error.notImplemented()
  4055.     },
  4056.     get_xml: function() {
  4057.         throw Error.notImplemented()
  4058.     },
  4059.     get_object: function() {
  4060.         if (!this._resultObject)
  4061.             this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
  4062.         return this._resultObject
  4063.     },
  4064.     executeRequest: function() {
  4065.         throw Error.notImplemented()
  4066.     },
  4067.     abort: function() {
  4068.         throw Error.notImplemented()
  4069.     },
  4070.     getResponseHeader: function() {
  4071.         throw Error.notImplemented()
  4072.     },
  4073.     getAllResponseHeaders: function() {
  4074.         throw Error.notImplemented()
  4075.     }
  4076. };
  4077. Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");
  4078. Sys.Net.XMLDOM = function(d) {
  4079.     if (!window.DOMParser) {
  4080.         var c = ["Msxml2.DOMDocument.3.0", "Msxml2.DOMDocument"];
  4081.         for (var b = 0, f = c.length; b < f; b++)
  4082.             try {
  4083.                 var a = new ActiveXObject(c[b]);
  4084.                 a.async = false;
  4085.                 a.loadXML(d);
  4086.                 a.setProperty("SelectionLanguage", "XPath");
  4087.                 return a
  4088.             } catch (g) {}
  4089.     } else
  4090.         try {
  4091.             var e = new window.DOMParser;
  4092.             return e.parseFromString(d, "text/xml")
  4093.         } catch (g) {}
  4094.     return null
  4095. }
  4096. ;
  4097. Sys.Net.XMLHttpExecutor = function() {
  4098.     Sys.Net.XMLHttpExecutor.initializeBase(this);
  4099.     var a = this;
  4100.     this._xmlHttpRequest = null ;
  4101.     this._webRequest = null ;
  4102.     this._responseAvailable = false;
  4103.     this._timedOut = false;
  4104.     this._timer = null ;
  4105.     this._aborted = false;
  4106.     this._started = false;
  4107.     this._onReadyStateChange = function() {
  4108.         if (a._xmlHttpRequest.readyState === 4) {
  4109.             try {
  4110.                 if (typeof a._xmlHttpRequest.status === "undefined" || a._xmlHttpRequest.status === 0)
  4111.                     return
  4112.             } catch (b) {
  4113.                 return
  4114.             }
  4115.             a._clearTimer();
  4116.             a._responseAvailable = true;
  4117.             try {
  4118.                 a._webRequest.completed(Sys.EventArgs.Empty)
  4119.             } finally {
  4120.                 if (a._xmlHttpRequest != null ) {
  4121.                     a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
  4122.                     a._xmlHttpRequest = null
  4123.                 }
  4124.             }
  4125.         }
  4126.     }
  4127.     ;
  4128.     this._clearTimer = function() {
  4129.         if (a._timer != null ) {
  4130.             window.clearTimeout(a._timer);
  4131.             a._timer = null
  4132.         }
  4133.     }
  4134.     ;
  4135.     this._onTimeout = function() {
  4136.         if (!a._responseAvailable) {
  4137.             a._clearTimer();
  4138.             a._timedOut = true;
  4139.             a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
  4140.             a._xmlHttpRequest.abort();
  4141.             a._webRequest.completed(Sys.EventArgs.Empty);
  4142.             a._xmlHttpRequest = null
  4143.         }
  4144.     }
  4145. }
  4146. ;
  4147. Sys.Net.XMLHttpExecutor.prototype = {
  4148.     get_timedOut: function() {
  4149.         return this._timedOut
  4150.     },
  4151.     get_started: function() {
  4152.         return this._started
  4153.     },
  4154.     get_responseAvailable: function() {
  4155.         return this._responseAvailable
  4156.     },
  4157.     get_aborted: function() {
  4158.         return this._aborted
  4159.     },
  4160.     executeRequest: function() {
  4161.         this._webRequest = this.get_webRequest();
  4162.         var c = this._webRequest.get_body()
  4163.           , a = this._webRequest.get_headers();
  4164.         this._xmlHttpRequest = new XMLHttpRequest;
  4165.         this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
  4166.         var e = this._webRequest.get_httpVerb();
  4167.         this._xmlHttpRequest.open(e, this._webRequest.getResolvedUrl(), true);
  4168.         this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  4169.         if (a)
  4170.             for (var b in a) {
  4171.                 var f = a[b];
  4172.                 if (typeof f !== "function")
  4173.                     this._xmlHttpRequest.setRequestHeader(b, f)
  4174.             }
  4175.         if (e.toLowerCase() === "post") {
  4176.             if (a === null || !a["Content-Type"])
  4177.                 this._xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
  4178.             if (!c)
  4179.                 c = ""
  4180.         }
  4181.         var d = this._webRequest.get_timeout();
  4182.         if (d > 0)
  4183.             this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), d);
  4184.         this._xmlHttpRequest.send(c);
  4185.         this._started = true
  4186.     },
  4187.     getResponseHeader: function(b) {
  4188.         var a;
  4189.         try {
  4190.             a = this._xmlHttpRequest.getResponseHeader(b)
  4191.         } catch (c) {}
  4192.         if (!a)
  4193.             a = "";
  4194.         return a
  4195.     },
  4196.     getAllResponseHeaders: function() {
  4197.         return this._xmlHttpRequest.getAllResponseHeaders()
  4198.     },
  4199.     get_responseData: function() {
  4200.         return this._xmlHttpRequest.responseText
  4201.     },
  4202.     get_statusCode: function() {
  4203.         var a = 0;
  4204.         try {
  4205.             a = this._xmlHttpRequest.status
  4206.         } catch (b) {}
  4207.         return a
  4208.     },
  4209.     get_statusText: function() {
  4210.         return this._xmlHttpRequest.statusText
  4211.     },
  4212.     get_xml: function() {
  4213.         var a = this._xmlHttpRequest.responseXML;
  4214.         if (!a || !a.documentElement) {
  4215.             a = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);
  4216.             if (!a || !a.documentElement)
  4217.                 return null
  4218.         } else if (navigator.userAgent.indexOf("MSIE") !== -1 && typeof a.setProperty != "undefined")
  4219.             a.setProperty("SelectionLanguage", "XPath");
  4220.         if (a.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && a.documentElement.tagName === "parsererror")
  4221.             return null ;
  4222.         if (a.documentElement.firstChild && a.documentElement.firstChild.tagName === "parsererror")
  4223.             return null ;
  4224.         return a
  4225.     },
  4226.     abort: function() {
  4227.         if (this._aborted || this._responseAvailable || this._timedOut)
  4228.             return;
  4229.         this._aborted = true;
  4230.         this._clearTimer();
  4231.         if (this._xmlHttpRequest && !this._responseAvailable) {
  4232.             this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
  4233.             this._xmlHttpRequest.abort();
  4234.             this._xmlHttpRequest = null ;
  4235.             this._webRequest.completed(Sys.EventArgs.Empty)
  4236.         }
  4237.     }
  4238. };
  4239. Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor", Sys.Net.WebRequestExecutor);
  4240. Sys.Net._WebRequestManager = function() {
  4241.     this._defaultTimeout = 0;
  4242.     this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"
  4243. }
  4244. ;
  4245. Sys.Net._WebRequestManager.prototype = {
  4246.     add_invokingRequest: function(a) {
  4247.         this._get_eventHandlerList().addHandler("invokingRequest", a)
  4248.     },
  4249.     remove_invokingRequest: function(a) {
  4250.         this._get_eventHandlerList().removeHandler("invokingRequest", a)
  4251.     },
  4252.     add_completedRequest: function(a) {
  4253.         this._get_eventHandlerList().addHandler("completedRequest", a)
  4254.     },
  4255.     remove_completedRequest: function(a) {
  4256.         this._get_eventHandlerList().removeHandler("completedRequest", a)
  4257.     },
  4258.     _get_eventHandlerList: function() {
  4259.         if (!this._events)
  4260.             this._events = new Sys.EventHandlerList;
  4261.         return this._events
  4262.     },
  4263.     get_defaultTimeout: function() {
  4264.         return this._defaultTimeout
  4265.     },
  4266.     set_defaultTimeout: function(a) {
  4267.         this._defaultTimeout = a
  4268.     },
  4269.     get_defaultExecutorType: function() {
  4270.         return this._defaultExecutorType
  4271.     },
  4272.     set_defaultExecutorType: function(a) {
  4273.         this._defaultExecutorType = a
  4274.     },
  4275.     executeRequest: function(webRequest) {
  4276.         var executor = webRequest.get_executor();
  4277.         if (!executor) {
  4278.             var failed = false;
  4279.             try {
  4280.                 var executorType = eval(this._defaultExecutorType);
  4281.                 executor = new executorType
  4282.             } catch (a) {
  4283.                 failed = true
  4284.             }
  4285.             webRequest.set_executor(executor)
  4286.         }
  4287.         if (executor.get_aborted())
  4288.             return;
  4289.         var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest)
  4290.           , handler = this._get_eventHandlerList().getHandler("invokingRequest");
  4291.         if (handler)
  4292.             handler(this, evArgs);
  4293.         if (!evArgs.get_cancel())
  4294.             executor.executeRequest()
  4295.     }
  4296. };
  4297. Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");
  4298. Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager;
  4299. Sys.Net.NetworkRequestEventArgs = function(a) {
  4300.     Sys.Net.NetworkRequestEventArgs.initializeBase(this);
  4301.     this._webRequest = a
  4302. }
  4303. ;
  4304. Sys.Net.NetworkRequestEventArgs.prototype = {
  4305.     get_webRequest: function() {
  4306.         return this._webRequest
  4307.     }
  4308. };
  4309. Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs", Sys.CancelEventArgs);
  4310. Sys.Net.WebRequest = function() {
  4311.     this._url = "";
  4312.     this._headers = {};
  4313.     this._body = null ;
  4314.     this._userContext = null ;
  4315.     this._httpVerb = null ;
  4316.     this._executor = null ;
  4317.     this._invokeCalled = false;
  4318.     this._timeout = 0
  4319. }
  4320. ;
  4321. Sys.Net.WebRequest.prototype = {
  4322.     add_completed: function(a) {
  4323.         this._get_eventHandlerList().addHandler("completed", a)
  4324.     },
  4325.     remove_completed: function(a) {
  4326.         this._get_eventHandlerList().removeHandler("completed", a)
  4327.     },
  4328.     completed: function(b) {
  4329.         var a = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");
  4330.         if (a)
  4331.             a(this._executor, b);
  4332.         a = this._get_eventHandlerList().getHandler("completed");
  4333.         if (a)
  4334.             a(this._executor, b)
  4335.     },
  4336.     _get_eventHandlerList: function() {
  4337.         if (!this._events)
  4338.             this._events = new Sys.EventHandlerList;
  4339.         return this._events
  4340.     },
  4341.     get_url: function() {
  4342.         return this._url
  4343.     },
  4344.     set_url: function(a) {
  4345.         this._url = a
  4346.     },
  4347.     get_headers: function() {
  4348.         return this._headers
  4349.     },
  4350.     get_httpVerb: function() {
  4351.         if (this._httpVerb === null ) {
  4352.             if (this._body === null )
  4353.                 return "GET";
  4354.             return "POST"
  4355.         }
  4356.         return this._httpVerb
  4357.     },
  4358.     set_httpVerb: function(a) {
  4359.         this._httpVerb = a
  4360.     },
  4361.     get_body: function() {
  4362.         return this._body
  4363.     },
  4364.     set_body: function(a) {
  4365.         this._body = a
  4366.     },
  4367.     get_userContext: function() {
  4368.         return this._userContext
  4369.     },
  4370.     set_userContext: function(a) {
  4371.         this._userContext = a
  4372.     },
  4373.     get_executor: function() {
  4374.         return this._executor
  4375.     },
  4376.     set_executor: function(a) {
  4377.         this._executor = a;
  4378.         this._executor._set_webRequest(this)
  4379.     },
  4380.     get_timeout: function() {
  4381.         if (this._timeout === 0)
  4382.             return Sys.Net.WebRequestManager.get_defaultTimeout();
  4383.         return this._timeout
  4384.     },
  4385.     set_timeout: function(a) {
  4386.         this._timeout = a
  4387.     },
  4388.     getResolvedUrl: function() {
  4389.         return Sys.Net.WebRequest._resolveUrl(this._url)
  4390.     },
  4391.     invoke: function() {
  4392.         Sys.Net.WebRequestManager.executeRequest(this);
  4393.         this._invokeCalled = true
  4394.     }
  4395. };
  4396. Sys.Net.WebRequest._resolveUrl = function(b, a) {
  4397.     if (b && b.indexOf("://") !== -1)
  4398.         return b;
  4399.     if (!a || a.length === 0) {
  4400.         var d = document.getElementsByTagName("base")[0];
  4401.         if (d && d.href && d.href.length > 0)
  4402.             a = d.href;
  4403.         else
  4404.             a = document.URL
  4405.     }
  4406.     var c = a.indexOf("?");
  4407.     if (c !== -1)
  4408.         a = a.substr(0, c);
  4409.     c = a.indexOf("#");
  4410.     if (c !== -1)
  4411.         a = a.substr(0, c);
  4412.     a = a.substr(0, a.lastIndexOf("/") + 1);
  4413.     if (!b || b.length === 0)
  4414.         return a;
  4415.     if (b.charAt(0) === "/") {
  4416.         var e = a.indexOf("://")
  4417.           , g = a.indexOf("/", e + 3);
  4418.         return a.substr(0, g) + b
  4419.     } else {
  4420.         var f = a.lastIndexOf("/");
  4421.         return a.substr(0, f + 1) + b
  4422.     }
  4423. }
  4424. ;
  4425. Sys.Net.WebRequest._createQueryString = function(c, b, f) {
  4426.     b = b || encodeURIComponent;
  4427.     var h = 0, e, g, d, a = new Sys.StringBuilder;
  4428.     if (c)
  4429.         for (d in c) {
  4430.             e = c[d];
  4431.             if (typeof e === "function")
  4432.                 continue;g = Sys.Serialization.JavaScriptSerializer.serialize(e);
  4433.             if (h++)
  4434.                 a.append("&");
  4435.             a.append(d);
  4436.             a.append("=");
  4437.             a.append(b(g))
  4438.         }
  4439.     if (f) {
  4440.         if (h)
  4441.             a.append("&");
  4442.         a.append(f)
  4443.     }
  4444.     return a.toString()
  4445. }
  4446. ;
  4447. Sys.Net.WebRequest._createUrl = function(a, b, c) {
  4448.     if (!b && !c)
  4449.         return a;
  4450.     var d = Sys.Net.WebRequest._createQueryString(b, null , c);
  4451.     return d.length ? a + (a && a.indexOf("?") >= 0 ? "&" : "?") + d : a
  4452. }
  4453. ;
  4454. Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");
  4455. Sys._ScriptLoaderTask = function(b, a) {
  4456.     this._scriptElement = b;
  4457.     this._completedCallback = a
  4458. }
  4459. ;
  4460. Sys._ScriptLoaderTask.prototype = {
  4461.     get_scriptElement: function() {
  4462.         return this._scriptElement
  4463.     },
  4464.     dispose: function() {
  4465.         if (this._disposed)
  4466.             return;
  4467.         this._disposed = true;
  4468.         this._removeScriptElementHandlers();
  4469.         Sys._ScriptLoaderTask._clearScript(this._scriptElement);
  4470.         this._scriptElement = null
  4471.     },
  4472.     execute: function() {
  4473.         if (this._ensureReadyStateLoaded())
  4474.             this._executeInternal()
  4475.     },
  4476.     _executeInternal: function() {
  4477.         this._addScriptElementHandlers();
  4478.         document.getElementsByTagName("head")[0].appendChild(this._scriptElement)
  4479.     },
  4480.     _ensureReadyStateLoaded: function() {
  4481.         if (this._useReadyState() && this._scriptElement.readyState !== "loaded" && this._scriptElement.readyState !== "complete") {
  4482.             this._scriptDownloadDelegate = Function.createDelegate(this, this._executeInternal);
  4483.             $addHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
  4484.             return false
  4485.         }
  4486.         return true
  4487.     },
  4488.     _addScriptElementHandlers: function() {
  4489.         if (this._scriptDownloadDelegate) {
  4490.             $removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
  4491.             this._scriptDownloadDelegate = null
  4492.         }
  4493.         this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler);
  4494.         if (this._useReadyState())
  4495.             $addHandler(this._scriptElement, "readystatechange", this._scriptLoadDelegate);
  4496.         else
  4497.             $addHandler(this._scriptElement, "load", this._scriptLoadDelegate);
  4498.         if (this._scriptElement.addEventListener) {
  4499.             this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler);
  4500.             this._scriptElement.addEventListener("error", this._scriptErrorDelegate, false)
  4501.         }
  4502.     },
  4503.     _removeScriptElementHandlers: function() {
  4504.         if (this._scriptLoadDelegate) {
  4505.             var a = this.get_scriptElement();
  4506.             if (this._scriptDownloadDelegate) {
  4507.                 $removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
  4508.                 this._scriptDownloadDelegate = null
  4509.             }
  4510.             if (this._useReadyState() && this._scriptLoadDelegate)
  4511.                 $removeHandler(a, "readystatechange", this._scriptLoadDelegate);
  4512.             else
  4513.                 $removeHandler(a, "load", this._scriptLoadDelegate);
  4514.             if (this._scriptErrorDelegate) {
  4515.                 this._scriptElement.removeEventListener("error", this._scriptErrorDelegate, false);
  4516.                 this._scriptErrorDelegate = null
  4517.             }
  4518.             this._scriptLoadDelegate = null
  4519.         }
  4520.     },
  4521.     _scriptErrorHandler: function() {
  4522.         if (this._disposed)
  4523.             return;
  4524.         this._completedCallback(this.get_scriptElement(), false)
  4525.     },
  4526.     _scriptLoadHandler: function() {
  4527.         if (this._disposed)
  4528.             return;
  4529.         var a = this.get_scriptElement();
  4530.         if (this._useReadyState() && a.readyState !== "complete")
  4531.             return;
  4532.         this._completedCallback(a, true)
  4533.     },
  4534.     _useReadyState: function() {
  4535.         return Sys.Browser.agent === Sys.Browser.InternetExplorer && (Sys.Browser.version < 9 || (document.documentMode || 0) < 9)
  4536.     }
  4537. };
  4538. Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null , Sys.IDisposable);
  4539. Sys._ScriptLoaderTask._clearScript = function(a) {
  4540.     if (!Sys.Debug.isDebug && a.parentNode)
  4541.         a.parentNode.removeChild(a)
  4542. }
  4543. ;
  4544. Type.registerNamespace("Sys.Net");
  4545. Sys.Net.WebServiceProxy = function() {}
  4546. ;
  4547. Sys.Net.WebServiceProxy.prototype = {
  4548.     get_timeout: function() {
  4549.         return this._timeout || 0
  4550.     },
  4551.     set_timeout: function(a) {
  4552.         if (a < 0)
  4553.             throw Error.argumentOutOfRange("value", a, Sys.Res.invalidTimeout);
  4554.         this._timeout = a
  4555.     },
  4556.     get_defaultUserContext: function() {
  4557.         return typeof this._userContext === "undefined" ? null : this._userContext
  4558.     },
  4559.     set_defaultUserContext: function(a) {
  4560.         this._userContext = a
  4561.     },
  4562.     get_defaultSucceededCallback: function() {
  4563.         return this._succeeded || null
  4564.     },
  4565.     set_defaultSucceededCallback: function(a) {
  4566.         this._succeeded = a
  4567.     },
  4568.     get_defaultFailedCallback: function() {
  4569.         return this._failed || null
  4570.     },
  4571.     set_defaultFailedCallback: function(a) {
  4572.         this._failed = a
  4573.     },
  4574.     get_enableJsonp: function() {
  4575.         return !!this._jsonp
  4576.     },
  4577.     set_enableJsonp: function(a) {
  4578.         this._jsonp = a
  4579.     },
  4580.     get_path: function() {
  4581.         return this._path || null
  4582.     },
  4583.     set_path: function(a) {
  4584.         this._path = a
  4585.     },
  4586.     get_jsonpCallbackParameter: function() {
  4587.         return this._callbackParameter || "callback"
  4588.     },
  4589.     set_jsonpCallbackParameter: function(a) {
  4590.         this._callbackParameter = a
  4591.     },
  4592.     _invoke: function(d, e, g, f, c, b, a) {
  4593.         c = c || this.get_defaultSucceededCallback();
  4594.         b = b || this.get_defaultFailedCallback();
  4595.         if (a === null || typeof a === "undefined")
  4596.             a = this.get_defaultUserContext();
  4597.         return Sys.Net.WebServiceProxy.invoke(d, e, g, f, c, b, a, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter())
  4598.     }
  4599. };
  4600. Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");
  4601. Sys.Net.WebServiceProxy.invoke = function(q, a, m, l, j, b, g, e, w, p) {
  4602.     var i = w !== false ? Sys.Net.WebServiceProxy._xdomain.exec(q) : null , c, n = i && i.length === 3 && (i[1] !== location.protocol || i[2] !== location.host);
  4603.     m = n || m;
  4604.     if (n) {
  4605.         p = p || "callback";
  4606.         c = "_jsonp" + Sys._jsonp++
  4607.     }
  4608.     if (!l)
  4609.         l = {};
  4610.     var r = l;
  4611.     if (!m || !r)
  4612.         r = {};
  4613.     var s, h, f = null , k, o = null , u = Sys.Net.WebRequest._createUrl(a ? q + "/" + encodeURIComponent(a) : q, r, n ? p + "=Sys." + c : null );
  4614.     if (n) {
  4615.         s = document.createElement("script");
  4616.         s.src = u;
  4617.         k = new Sys._ScriptLoaderTask(s,function(d, b) {
  4618.             if (!b || c)
  4619.                 t({
  4620.                     Message: String.format(Sys.Res.webServiceFailedNoMsg, a)
  4621.                 }, -1)
  4622.         }
  4623.         );
  4624.         function v() {
  4625.             if (f === null )
  4626.                 return;
  4627.             f = null ;
  4628.             h = new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut, a));
  4629.             k.dispose();
  4630.             delete Sys[c];
  4631.             if (b)
  4632.                 b(h, g, a)
  4633.         }
  4634.         function t(d, e) {
  4635.             if (f !== null ) {
  4636.                 window.clearTimeout(f);
  4637.                 f = null
  4638.             }
  4639.             k.dispose();
  4640.             delete Sys[c];
  4641.             c = null ;
  4642.             if (typeof e !== "undefined" && e !== 200) {
  4643.                 if (b) {
  4644.                     h = new Sys.Net.WebServiceError(false,d.Message || String.format(Sys.Res.webServiceFailedNoMsg, a),d.StackTrace || null ,d.ExceptionType || null ,d);
  4645.                     h._statusCode = e;
  4646.                     b(h, g, a)
  4647.                 }
  4648.             } else if (j)
  4649.                 j(d, g, a)
  4650.         }
  4651.         Sys[c] = t;
  4652.         e = e || Sys.Net.WebRequestManager.get_defaultTimeout();
  4653.         if (e > 0)
  4654.             f = window.setTimeout(v, e);
  4655.         k.execute();
  4656.         return null
  4657.     }
  4658.     var d = new Sys.Net.WebRequest;
  4659.     d.set_url(u);
  4660.     d.get_headers()["Content-Type"] = "application/json; charset=utf-8";
  4661.     if (!m) {
  4662.         o = Sys.Serialization.JavaScriptSerializer.serialize(l);
  4663.         if (o === "{}")
  4664.             o = ""
  4665.     }
  4666.     d.set_body(o);
  4667.     d.add_completed(x);
  4668.     if (e && e > 0)
  4669.         d.set_timeout(e);
  4670.     d.invoke();
  4671.     function x(d) {
  4672.         if (d.get_responseAvailable()) {
  4673.             var f = d.get_statusCode()
  4674.               , c = null ;
  4675.             try {
  4676.                 var e = d.getResponseHeader("Content-Type");
  4677.                 if (e.startsWith("application/json"))
  4678.                     c = d.get_object();
  4679.                 else if (e.startsWith("text/xml"))
  4680.                     c = d.get_xml();
  4681.                 else
  4682.                     c = d.get_responseData()
  4683.             } catch (m) {}
  4684.             var k = d.getResponseHeader("jsonerror")
  4685.               , h = k === "true";
  4686.             if (h) {
  4687.                 if (c)
  4688.                     c = new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)
  4689.             } else if (e.startsWith("application/json"))
  4690.                 c = !c || typeof c.d === "undefined" ? c : c.d;
  4691.             if (f < 200 || f >= 300 || h) {
  4692.                 if (b) {
  4693.                     if (!c || !h)
  4694.                         c = new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg, a));
  4695.                     c._statusCode = f;
  4696.                     b(c, g, a)
  4697.                 }
  4698.             } else if (j)
  4699.                 j(c, g, a)
  4700.         } else {
  4701.             var i;
  4702.             if (d.get_timedOut())
  4703.                 i = String.format(Sys.Res.webServiceTimedOut, a);
  4704.             else
  4705.                 i = String.format(Sys.Res.webServiceFailedNoMsg, a);
  4706.             if (b)
  4707.                 b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""), g, a)
  4708.         }
  4709.     }
  4710.     return d
  4711. }
  4712. ;
  4713. Sys.Net.WebServiceProxy._generateTypedConstructor = function(a) {
  4714.     return function(b) {
  4715.         if (b)
  4716.             for (var c in b)
  4717.                 this[c] = b[c];
  4718.         this.__type = a
  4719.     }
  4720. }
  4721. ;
  4722. Sys._jsonp = 0;
  4723. Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
  4724. Sys.Net.WebServiceError = function(d, e, c, a, b) {
  4725.     this._timedOut = d;
  4726.     this._message = e;
  4727.     this._stackTrace = c;
  4728.     this._exceptionType = a;
  4729.     this._errorObject = b;
  4730.     this._statusCode = -1
  4731. }
  4732. ;
  4733. Sys.Net.WebServiceError.prototype = {
  4734.     get_timedOut: function() {
  4735.         return this._timedOut
  4736.     },
  4737.     get_statusCode: function() {
  4738.         return this._statusCode
  4739.     },
  4740.     get_message: function() {
  4741.         return this._message
  4742.     },
  4743.     get_stackTrace: function() {
  4744.         return this._stackTrace || ""
  4745.     },
  4746.     get_exceptionType: function() {
  4747.         return this._exceptionType || ""
  4748.     },
  4749.     get_errorObject: function() {
  4750.         return this._errorObject || null
  4751.     }
  4752. };
  4753. Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");
  4754. Type.registerNamespace('Sys');
  4755. Sys.Res = {
  4756.     "argumentInteger": "Value must be an integer.",
  4757.     "invokeCalledTwice": "Cannot call invoke more than once.",
  4758.     "webServiceFailed": "The server method \u0027{0}\u0027 failed with the following error: {1}",
  4759.     "argumentType": "Object cannot be converted to the required type.",
  4760.     "argumentNull": "Value cannot be null.",
  4761.     "scriptAlreadyLoaded": "The script \u0027{0}\u0027 has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.",
  4762.     "scriptDependencyNotFound": "The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.",
  4763.     "formatBadFormatSpecifier": "Format specifier was invalid.",
  4764.     "requiredScriptReferenceNotIncluded": "\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.",
  4765.     "webServiceFailedNoMsg": "The server method \u0027{0}\u0027 failed.",
  4766.     "argumentDomElement": "Value must be a DOM element.",
  4767.     "invalidExecutorType": "Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",
  4768.     "cannotCallBeforeResponse": "Cannot call {0} when responseAvailable is false.",
  4769.     "actualValue": "Actual value was {0}.",
  4770.     "enumInvalidValue": "\u0027{0}\u0027 is not a valid value for enum {1}.",
  4771.     "scriptLoadFailed": "The script \u0027{0}\u0027 could not be loaded.",
  4772.     "parameterCount": "Parameter count mismatch.",
  4773.     "cannotDeserializeEmptyString": "Cannot deserialize empty string.",
  4774.     "formatInvalidString": "Input string was not in a correct format.",
  4775.     "invalidTimeout": "Value must be greater than or equal to zero.",
  4776.     "cannotAbortBeforeStart": "Cannot abort when executor has not started.",
  4777.     "argument": "Value does not fall within the expected range.",
  4778.     "cannotDeserializeInvalidJson": "Cannot deserialize. The data does not correspond to valid JSON.",
  4779.     "invalidHttpVerb": "httpVerb cannot be set to an empty or null string.",
  4780.     "nullWebRequest": "Cannot call executeRequest with a null webRequest.",
  4781.     "eventHandlerInvalid": "Handler was not added through the Sys.UI.DomEvent.addHandler method.",
  4782.     "cannotSerializeNonFiniteNumbers": "Cannot serialize non finite numbers.",
  4783.     "argumentUndefined": "Value cannot be undefined.",
  4784.     "webServiceInvalidReturnType": "The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}",
  4785.     "servicePathNotSet": "The path to the web service has not been set.",
  4786.     "argumentTypeWithTypes": "Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.",
  4787.     "cannotCallOnceStarted": "Cannot call {0} once started.",
  4788.     "badBaseUrl1": "Base URL does not contain ://.",
  4789.     "badBaseUrl2": "Base URL does not contain another /.",
  4790.     "badBaseUrl3": "Cannot find last / in base URL.",
  4791.     "setExecutorAfterActive": "Cannot set executor after it has become active.",
  4792.     "paramName": "Parameter name: {0}",
  4793.     "nullReferenceInPath": "Null reference while evaluating data path: \u0027{0}\u0027.",
  4794.     "cannotCallOutsideHandler": "Cannot call {0} outside of a completed event handler.",
  4795.     "cannotSerializeObjectWithCycle": "Cannot serialize object with cyclic reference within child properties.",
  4796.     "format": "One of the identified items was in an invalid format.",
  4797.     "assertFailedCaller": "Assertion Failed: {0}\r\nat {1}",
  4798.     "argumentOutOfRange": "Specified argument was out of the range of valid values.",
  4799.     "webServiceTimedOut": "The server method \u0027{0}\u0027 timed out.",
  4800.     "notImplemented": "The method or operation is not implemented.",
  4801.     "assertFailed": "Assertion Failed: {0}",
  4802.     "invalidOperation": "Operation is not valid due to the current state of the object.",
  4803.     "breakIntoDebugger": "{0}\r\n\r\nBreak into debugger?"
  4804. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement