Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Prettified
Function.__typeName = "Function";
Function.__class = true;
Function.createCallback = function(b, a) {
return function() {
var e = arguments.length;
if (e > 0) {
var d = [];
for (var c = 0; c < e; c++) d[c] = arguments[c];
d[e] = a;
return b.apply(this, d)
}
return b.call(this, a)
}
};
Function.createDelegate = function(a, b) {
return function() {
return b.apply(a, arguments)
}
};
Function.emptyFunction = Function.emptyMethod = function() {};
Function.validateParameters = function(c, b, a) {
return Function._validateParams(c, b, a)
};
Function._validateParams = function(g, e, c) {
var a, d = e.length;
c = c || typeof c === "undefined";
a = Function._validateParameterCount(g, e, c);
if (a) {
a.popStackFrame();
return a
}
for (var b = 0, i = g.length; b < i; b++) {
var f = e[Math.min(b, d - 1)],
h = f.name;
if (f.parameterArray) h += "[" + (b - d + 1) + "]";
else if (!c && b >= d) break;
a = Function._validateParameter(g[b], f, h);
if (a) {
a.popStackFrame();
return a
}
}
return null
};
Function._validateParameterCount = function(j, d, i) {
var a, c, b = d.length,
e = j.length;
if (e < b) {
var f = b;
for (a = 0; a < b; a++) {
var g = d[a];
if (g.optional || g.parameterArray) f--
}
if (e < f) c = true
} else if (i && e > b) {
c = true;
for (a = 0; a < b; a++)
if (d[a].parameterArray) {
c = false;
break
}
}
if (c) {
var h = Error.parameterCount();
h.popStackFrame();
return h
}
return null
};
Function._validateParameter = function(c, a, h) {
var b, g = a.type,
l = !!a.integer,
k = !!a.domElement,
m = !!a.mayBeNull;
b = Function._validateParameterType(c, g, l, k, m, h);
if (b) {
b.popStackFrame();
return b
}
var e = a.elementType,
f = !!a.elementMayBeNull;
if (g === Array && typeof c !== "undefined" && c !== null && (e || !f)) {
var j = !!a.elementInteger,
i = !!a.elementDomElement;
for (var d = 0; d < c.length; d++) {
var n = c[d];
b = Function._validateParameterType(n, e, j, i, f, h + "[" + d + "]");
if (b) {
b.popStackFrame();
return b
}
}
}
return null
};
Function._validateParameterType = function(b, c, k, j, h, d) {
var a, g;
if (typeof b === "undefined")
if (h) return null;
else {
a = Error.argumentUndefined(d);
a.popStackFrame();
return a
}
if (b === null)
if (h) return null;
else {
a = Error.argumentNull(d);
a.popStackFrame();
return a
}
if (c && c.__enum) {
if (typeof b !== "number") {
a = Error.argumentType(d, Object.getType(b), c);
a.popStackFrame();
return a
}
if (b % 1 === 0) {
var e = c.prototype;
if (!c.__flags || b === 0) {
for (g in e)
if (e[g] === b) return null
} else {
var i = b;
for (g in e) {
var f = e[g];
if (f === 0) continue;
if ((f & b) === f) i -= f;
if (i === 0) return null
}
}
}
a = Error.argumentOutOfRange(d, b, String.format(Sys.Res.enumInvalidValue, b, c.getName()));
a.popStackFrame();
return a
}
if (j && (!Sys._isDomElement(b) || b.nodeType === 3)) {
a = Error.argument(d, Sys.Res.argumentDomElement);
a.popStackFrame();
return a
}
if (c && !Sys._isInstanceOfType(c, b)) {
a = Error.argumentType(d, Object.getType(b), c);
a.popStackFrame();
return a
}
if (c === Number && k)
if (b % 1 !== 0) {
a = Error.argumentOutOfRange(d, b, Sys.Res.argumentInteger);
a.popStackFrame();
return a
}
return null
};
Error.__typeName = "Error";
Error.__class = true;
Error.create = function(d, b) {
var a = new Error(d);
a.message = d;
if (b)
for (var c in b) a[c] = b[c];
a.popStackFrame();
return a
};
Error.argument = function(a, c) {
var b = "Sys.ArgumentException: " + (c ? c : Sys.Res.argument);
if (a) b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {
name: "Sys.ArgumentException",
paramName: a
});
d.popStackFrame();
return d
};
Error.argumentNull = function(a, c) {
var b = "Sys.ArgumentNullException: " + (c ? c : Sys.Res.argumentNull);
if (a) b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {
name: "Sys.ArgumentNullException",
paramName: a
});
d.popStackFrame();
return d
};
Error.argumentOutOfRange = function(c, a, d) {
var b = "Sys.ArgumentOutOfRangeException: " + (d ? d : Sys.Res.argumentOutOfRange);
if (c) b += "\n" + String.format(Sys.Res.paramName, c);
if (typeof a !== "undefined" && a !== null) b += "\n" + String.format(Sys.Res.actualValue, a);
var e = Error.create(b, {
name: "Sys.ArgumentOutOfRangeException",
paramName: c,
actualValue: a
});
e.popStackFrame();
return e
};
Error.argumentType = function(d, c, b, e) {
var a = "Sys.ArgumentTypeException: ";
if (e) a += e;
else if (c && b) a += String.format(Sys.Res.argumentTypeWithTypes, c.getName(), b.getName());
else a += Sys.Res.argumentType;
if (d) a += "\n" + String.format(Sys.Res.paramName, d);
var f = Error.create(a, {
name: "Sys.ArgumentTypeException",
paramName: d,
actualType: c,
expectedType: b
});
f.popStackFrame();
return f
};
Error.argumentUndefined = function(a, c) {
var b = "Sys.ArgumentUndefinedException: " + (c ? c : Sys.Res.argumentUndefined);
if (a) b += "\n" + String.format(Sys.Res.paramName, a);
var d = Error.create(b, {
name: "Sys.ArgumentUndefinedException",
paramName: a
});
d.popStackFrame();
return d
};
Error.format = function(a) {
var c = "Sys.FormatException: " + (a ? a : Sys.Res.format),
b = Error.create(c, {
name: "Sys.FormatException"
});
b.popStackFrame();
return b
};
Error.invalidOperation = function(a) {
var c = "Sys.InvalidOperationException: " + (a ? a : Sys.Res.invalidOperation),
b = Error.create(c, {
name: "Sys.InvalidOperationException"
});
b.popStackFrame();
return b
};
Error.notImplemented = function(a) {
var c = "Sys.NotImplementedException: " + (a ? a : Sys.Res.notImplemented),
b = Error.create(c, {
name: "Sys.NotImplementedException"
});
b.popStackFrame();
return b
};
Error.parameterCount = function(a) {
var c = "Sys.ParameterCountException: " + (a ? a : Sys.Res.parameterCount),
b = Error.create(c, {
name: "Sys.ParameterCountException"
});
b.popStackFrame();
return b
};
Error.prototype.popStackFrame = function() {
if (typeof this.stack === "undefined" || this.stack === null || typeof this.fileName === "undefined" || this.fileName === null || typeof this.lineNumber === "undefined" || this.lineNumber === null) return;
var a = this.stack.split("\n"),
c = a[0],
e = this.fileName + ":" + this.lineNumber;
while (typeof c !== "undefined" && c !== null && c.indexOf(e) === -1) {
a.shift();
c = a[0]
}
var d = a[1];
if (typeof d === "undefined" || d === null) return;
var b = d.match(/@(.*):(\d+)$/);
if (typeof b === "undefined" || b === null) return;
this.fileName = b[1];
this.lineNumber = parseInt(b[2]);
a.shift();
this.stack = a.join("\n")
};
Object.__typeName = "Object";
Object.__class = true;
Object.getType = function(b) {
var a = b.constructor;
if (!a || typeof a !== "function" || !a.__typeName || a.__typeName === "Object") return Object;
return a
};
Object.getTypeName = function(a) {
return Object.getType(a).getName()
};
String.__typeName = "String";
String.__class = true;
String.prototype.endsWith = function(a) {
return this.substr(this.length - a.length) === a
};
String.prototype.startsWith = function(a) {
return this.substr(0, a.length) === a
};
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, "")
};
String.prototype.trimEnd = function() {
return this.replace(/\s+$/, "")
};
String.prototype.trimStart = function() {
return this.replace(/^\s+/, "")
};
String.format = function() {
return String._toFormattedString(false, arguments)
};
String._toFormattedString = function(l, j) {
var c = "",
e = j[0];
for (var a = 0; true;) {
var f = e.indexOf("{", a),
d = e.indexOf("}", a);
if (f < 0 && d < 0) {
c += e.slice(a);
break
}
if (d > 0 && (d < f || f < 0)) {
c += e.slice(a, d + 1);
a = d + 2;
continue
}
c += e.slice(a, f);
a = f + 1;
if (e.charAt(a) === "{") {
c += "{";
a++;
continue
}
if (d < 0) break;
var h = e.substring(a, d),
g = h.indexOf(":"),
k = parseInt(g < 0 ? h : h.substring(0, g), 10) + 1,
i = g < 0 ? "" : h.substring(g + 1),
b = j[k];
if (typeof b === "undefined" || b === null) b = "";
if (b.toFormattedString) c += b.toFormattedString(i);
else if (l && b.localeFormat) c += b.localeFormat(i);
else if (b.format) c += b.format(i);
else c += b.toString();
a = d + 1
}
return c
};
Boolean.__typeName = "Boolean";
Boolean.__class = true;
Boolean.parse = function(b) {
var a = b.trim().toLowerCase();
if (a === "false") return false;
if (a === "true") return true
};
Date.__typeName = "Date";
Date.__class = true;
Number.__typeName = "Number";
Number.__class = true;
RegExp.__typeName = "RegExp";
RegExp.__class = true;
if (!window) this.window = this;
window.Type = Function;
Type.prototype.callBaseMethod = function(a, d, b) {
var c = Sys._getBaseMethod(this, a, d);
if (!b) return c.apply(a);
else return c.apply(a, b)
};
Type.prototype.getBaseMethod = function(a, b) {
return Sys._getBaseMethod(this, a, b)
};
Type.prototype.getBaseType = function() {
return typeof this.__baseType === "undefined" ? null : this.__baseType
};
Type.prototype.getInterfaces = function() {
var a = [],
b = this;
while (b) {
var c = b.__interfaces;
if (c)
for (var d = 0, f = c.length; d < f; d++) {
var e = c[d];
if (!Array.contains(a, e)) a[a.length] = e
}
b = b.__baseType
}
return a
};
Type.prototype.getName = function() {
return typeof this.__typeName === "undefined" ? "" : this.__typeName
};
Type.prototype.implementsInterface = function(d) {
this.resolveInheritance();
var c = d.getName(),
a = this.__interfaceCache;
if (a) {
var e = a[c];
if (typeof e !== "undefined") return e
} else a = this.__interfaceCache = {};
var b = this;
while (b) {
var f = b.__interfaces;
if (f)
if (Array.indexOf(f, d) !== -1) return a[c] = true;
b = b.__baseType
}
return a[c] = false
};
Type.prototype.inheritsFrom = function(b) {
this.resolveInheritance();
var a = this.__baseType;
while (a) {
if (a === b) return true;
a = a.__baseType
}
return false
};
Type.prototype.initializeBase = function(a, b) {
this.resolveInheritance();
if (this.__baseType)
if (!b) this.__baseType.apply(a);
else this.__baseType.apply(a, b);
return a
};
Type.prototype.isImplementedBy = function(a) {
if (typeof a === "undefined" || a === null) return false;
var b = Object.getType(a);
return !!(b.implementsInterface && b.implementsInterface(this))
};
Type.prototype.isInstanceOfType = function(a) {
return Sys._isInstanceOfType(this, a)
};
Type.prototype.registerClass = function(c, b, d) {
this.prototype.constructor = this;
this.__typeName = c;
this.__class = true;
if (b) {
this.__baseType = b;
this.__basePrototypePending = true
}
Sys.__upperCaseTypes[c.toUpperCase()] = this;
if (d) {
this.__interfaces = [];
for (var a = 2, f = arguments.length; a < f; a++) {
var e = arguments[a];
this.__interfaces.push(e)
}
}
return this
};
Type.prototype.registerInterface = function(a) {
Sys.__upperCaseTypes[a.toUpperCase()] = this;
this.prototype.constructor = this;
this.__typeName = a;
this.__interface = true;
return this
};
Type.prototype.resolveInheritance = function() {
if (this.__basePrototypePending) {
var b = this.__baseType;
b.resolveInheritance();
for (var a in b.prototype) {
var c = b.prototype[a];
if (!this.prototype[a]) this.prototype[a] = c
}
delete this.__basePrototypePending
}
};
Type.getRootNamespaces = function() {
return Array.clone(Sys.__rootNamespaces)
};
Type.isClass = function(a) {
if (typeof a === "undefined" || a === null) return false;
return !!a.__class
};
Type.isInterface = function(a) {
if (typeof a === "undefined" || a === null) return false;
return !!a.__interface
};
Type.isNamespace = function(a) {
if (typeof a === "undefined" || a === null) return false;
return !!a.__namespace
};
Type.parse = function(typeName, ns) {
var fn;
if (ns) {
fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + "." + typeName.toUpperCase()];
return fn || null
}
if (!typeName) return null;
if (!Type.__htClasses) Type.__htClasses = {};
fn = Type.__htClasses[typeName];
if (!fn) {
fn = eval(typeName);
Type.__htClasses[typeName] = fn
}
return fn
};
Type.registerNamespace = function(e) {
var d = window,
c = e.split(".");
for (var b = 0; b < c.length; b++) {
var f = c[b],
a = d[f];
if (!a) a = d[f] = {};
if (!a.__namespace) {
if (b === 0 && e !== "Sys") Sys.__rootNamespaces[Sys.__rootNamespaces.length] = a;
a.__namespace = true;
a.__typeName = c.slice(0, b + 1).join(".");
a.getName = function() {
return this.__typeName
}
}
d = a
}
};
Type._checkDependency = function(c, a) {
var d = Type._registerScript._scripts,
b = d ? !!d[c] : false;
if (typeof a !== "undefined" && !b) throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, a, c));
return b
};
Type._registerScript = function(a, c) {
var b = Type._registerScript._scripts;
if (!b) Type._registerScript._scripts = b = {};
if (b[a]) throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, a));
b[a] = true;
if (c)
for (var d = 0, f = c.length; d < f; d++) {
var e = c[d];
if (!Type._checkDependency(e)) throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, a, e))
}
};
Type.registerNamespace("Sys");
Sys.__upperCaseTypes = {};
Sys.__rootNamespaces = [Sys];
Sys._isInstanceOfType = function(c, b) {
if (typeof b === "undefined" || b === null) return false;
if (b instanceof c) return true;
var a = Object.getType(b);
return !!(a === c) || a.inheritsFrom && a.inheritsFrom(c) || a.implementsInterface && a.implementsInterface(c)
};
Sys._getBaseMethod = function(d, e, c) {
var b = d.getBaseType();
if (b) {
var a = b.prototype[c];
return a instanceof Function ? a : null
}
return null
};
Sys._isDomElement = function(a) {
var c = false;
if (typeof a.nodeType !== "number") {
var b = a.ownerDocument || a.document || a;
if (b != a) {
var d = b.defaultView || b.parentWindow;
c = d != a
} else c = typeof b.body === "undefined"
}
return !c
};
Array.__typeName = "Array";
Array.__class = true;
Array.add = Array.enqueue = function(a, b) {
a[a.length] = b
};
Array.addRange = function(a, b) {
a.push.apply(a, b)
};
Array.clear = function(a) {
a.length = 0
};
Array.clone = function(a) {
if (a.length === 1) return [a[0]];
else return Array.apply(null, a)
};
Array.contains = function(a, b) {
return Sys._indexOf(a, b) >= 0
};
Array.dequeue = function(a) {
return a.shift()
};
Array.forEach = function(b, e, d) {
for (var a = 0, f = b.length; a < f; a++) {
var c = b[a];
if (typeof c !== "undefined") e.call(d, c, a, b)
}
};
Array.indexOf = function(a, c, b) {
return Sys._indexOf(a, c, b)
};
Array.insert = function(a, b, c) {
a.splice(b, 0, c)
};
Array.parse = function(value) {
if (!value) return [];
return eval(value)
};
Array.remove = function(b, c) {
var a = Sys._indexOf(b, c);
if (a >= 0) b.splice(a, 1);
return a >= 0
};
Array.removeAt = function(a, b) {
a.splice(b, 1)
};
Sys._indexOf = function(d, e, a) {
if (typeof e === "undefined") return -1;
var c = d.length;
if (c !== 0) {
a = a - 0;
if (isNaN(a)) a = 0;
else {
if (isFinite(a)) a = a - a % 1;
if (a < 0) a = Math.max(0, c + a)
}
for (var b = a; b < c; b++)
if (typeof d[b] !== "undefined" && d[b] === e) return b
}
return -1
};
Type._registerScript._scripts = {
"MicrosoftAjaxCore.js": true,
"MicrosoftAjaxGlobalization.js": true,
"MicrosoftAjaxSerialization.js": true,
"MicrosoftAjaxComponentModel.js": true,
"MicrosoftAjaxHistory.js": true,
"MicrosoftAjaxNetwork.js": true,
"MicrosoftAjaxWebServices.js": true
};
Sys.IDisposable = function() {};
Sys.IDisposable.prototype = {};
Sys.IDisposable.registerInterface("Sys.IDisposable");
Sys.StringBuilder = function(a) {
this._parts = typeof a !== "undefined" && a !== null && a !== "" ? [a.toString()] : [];
this._value = {};
this._len = 0
};
Sys.StringBuilder.prototype = {
append: function(a) {
this._parts[this._parts.length] = a
},
appendLine: function(a) {
this._parts[this._parts.length] = typeof a === "undefined" || a === null || a === "" ? "\r\n" : a + "\r\n"
},
clear: function() {
this._parts = [];
this._value = {};
this._len = 0
},
isEmpty: function() {
if (this._parts.length === 0) return true;
return this.toString() === ""
},
toString: function(a) {
a = a || "";
var b = this._parts;
if (this._len !== b.length) {
this._value = {};
this._len = b.length
}
var d = this._value;
if (typeof d[a] === "undefined") {
if (a !== "")
for (var c = 0; c < b.length;)
if (typeof b[c] === "undefined" || b[c] === "" || b[c] === null) b.splice(c, 1);
else c++;
d[a] = this._parts.join(a)
}
return d[a]
}
};
Sys.StringBuilder.registerClass("Sys.StringBuilder");
Sys.Browser = {};
Sys.Browser.InternetExplorer = {};
Sys.Browser.Firefox = {};
Sys.Browser.Safari = {};
Sys.Browser.Opera = {};
Sys.Browser.agent = null;
Sys.Browser.hasDebuggerStatement = false;
Sys.Browser.name = navigator.appName;
Sys.Browser.version = parseFloat(navigator.appVersion);
Sys.Browser.documentMode = 0;
if (navigator.userAgent.indexOf(" MSIE ") > -1) {
Sys.Browser.agent = Sys.Browser.InternetExplorer;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);
if (Sys.Browser.version >= 8)
if (document.documentMode >= 7) Sys.Browser.documentMode = document.documentMode;
Sys.Browser.hasDebuggerStatement = true
} else if (navigator.userAgent.indexOf(" Firefox/") > -1) {
Sys.Browser.agent = Sys.Browser.Firefox;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);
Sys.Browser.name = "Firefox";
Sys.Browser.hasDebuggerStatement = true
} else if (navigator.userAgent.indexOf(" AppleWebKit/") > -1) {
Sys.Browser.agent = Sys.Browser.Safari;
Sys.Browser.version = parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.name = "Safari"
} else if (navigator.userAgent.indexOf("Opera/") > -1) Sys.Browser.agent = Sys.Browser.Opera;
Sys.EventArgs = function() {};
Sys.EventArgs.registerClass("Sys.EventArgs");
Sys.EventArgs.Empty = new Sys.EventArgs;
Sys.CancelEventArgs = function() {
Sys.CancelEventArgs.initializeBase(this);
this._cancel = false
};
Sys.CancelEventArgs.prototype = {
get_cancel: function() {
return this._cancel
},
set_cancel: function(a) {
this._cancel = a
}
};
Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs", Sys.EventArgs);
Type.registerNamespace("Sys.UI");
Sys._Debug = function() {};
Sys._Debug.prototype = {
_appendConsole: function(a) {
if (typeof Debug !== "undefined" && Debug.writeln) Debug.writeln(a);
if (window.console && window.console.log) window.console.log(a);
if (window.opera) window.opera.postError(a);
if (window.debugService) window.debugService.trace(a)
},
_appendTrace: function(b) {
var a = document.getElementById("TraceConsole");
if (a && a.tagName.toUpperCase() === "TEXTAREA") a.value += b + "\n"
},
assert: function(c, a, b) {
if (!c) {
a = b && this.assert.caller ? String.format(Sys.Res.assertFailedCaller, a, this.assert.caller) : String.format(Sys.Res.assertFailed, a);
if (confirm(String.format(Sys.Res.breakIntoDebugger, a))) this.fail(a)
}
},
clearTrace: function() {
var a = document.getElementById("TraceConsole");
if (a && a.tagName.toUpperCase() === "TEXTAREA") a.value = ""
},
fail: function(message) {
this._appendConsole(message);
if (Sys.Browser.hasDebuggerStatement) eval("debugger")
},
trace: function(a) {
this._appendConsole(a);
this._appendTrace(a)
},
traceDump: function(a, b) {
var c = this._traceDump(a, b, true)
},
_traceDump: function(a, c, f, b, d) {
c = c ? c : "traceDump";
b = b ? b : "";
if (a === null) {
this.trace(b + c + ": null");
return
}
switch (typeof a) {
case "undefined":
this.trace(b + c + ": Undefined");
break;
case "number":
case "string":
case "boolean":
this.trace(b + c + ": " + a);
break;
default:
if (Date.isInstanceOfType(a) || RegExp.isInstanceOfType(a)) {
this.trace(b + c + ": " + a.toString());
break
}
if (!d) d = [];
else if (Array.contains(d, a)) {
this.trace(b + c + ": ...");
return
}
Array.add(d, a);
if (a == window || a === document || window.HTMLElement && a instanceof HTMLElement || typeof a.nodeName === "string") {
var k = a.tagName ? a.tagName : "DomElement";
if (a.id) k += " - " + a.id;
this.trace(b + c + " {" + k + "}")
} else {
var i = Object.getTypeName(a);
this.trace(b + c + (typeof i === "string" ? " {" + i + "}" : ""));
if (b === "" || f) {
b += " ";
var e, j, l, g, h;
if (Array.isInstanceOfType(a)) {
j = a.length;
for (e = 0; e < j; e++) this._traceDump(a[e], "[" + e + "]", f, b, d)
} else
for (g in a) {
h = a[g];
if (!Function.isInstanceOfType(h)) this._traceDump(h, g, f, b, d)
}
}
}
Array.remove(d, a)
}
}
};
Sys._Debug.registerClass("Sys._Debug");
Sys.Debug = new Sys._Debug;
Sys.Debug.isDebug = false;
function Sys$Enum$parse(c, e) {
var a, b, i;
if (e) {
a = this.__lowerCaseValues;
if (!a) {
this.__lowerCaseValues = a = {};
var g = this.prototype;
for (var f in g) a[f.toLowerCase()] = g[f]
}
} else a = this.prototype;
if (!this.__flags) {
i = e ? c.toLowerCase() : c;
b = a[i.trim()];
if (typeof b !== "number") throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c, this.__typeName));
return b
} else {
var h = (e ? c.toLowerCase() : c).split(","),
j = 0;
for (var d = h.length - 1; d >= 0; d--) {
var k = h[d].trim();
b = a[k];
if (typeof b !== "number") throw Error.argument("value", String.format(Sys.Res.enumInvalidValue, c.split(",")[d].trim(), this.__typeName));
j |= b
}
return j
}
}
function Sys$Enum$toString(c) {
if (typeof c === "undefined" || c === null) return this.__string;
var d = this.prototype,
a;
if (!this.__flags || c === 0) {
for (a in d)
if (d[a] === c) return a
} else {
var b = this.__sortedValues;
if (!b) {
b = [];
for (a in d) b[b.length] = {
key: a,
value: d[a]
};
b.sort(function(a, b) {
return a.value - b.value
});
this.__sortedValues = b
}
var e = [],
g = c;
for (a = b.length - 1; a >= 0; a--) {
var h = b[a],
f = h.value;
if (f === 0) continue;
if ((f & c) === f) {
e[e.length] = h.key;
g -= f;
if (g === 0) break
}
}
if (e.length && g === 0) return e.reverse().join(", ")
}
return ""
}
Type.prototype.registerEnum = function(b, c) {
Sys.__upperCaseTypes[b.toUpperCase()] = this;
for (var a in this.prototype) this[a] = this.prototype[a];
this.__typeName = b;
this.parse = Sys$Enum$parse;
this.__string = this.toString();
this.toString = Sys$Enum$toString;
this.__flags = c;
this.__enum = true
};
Type.isEnum = function(a) {
if (typeof a === "undefined" || a === null) return false;
return !!a.__enum
};
Type.isFlags = function(a) {
if (typeof a === "undefined" || a === null) return false;
return !!a.__flags
};
Sys.CollectionChange = function(e, a, c, b, d) {
this.action = e;
if (a)
if (!(a instanceof Array)) a = [a];
this.newItems = a || null;
if (typeof c !== "number") c = -1;
this.newStartingIndex = c;
if (b)
if (!(b instanceof Array)) b = [b];
this.oldItems = b || null;
if (typeof d !== "number") d = -1;
this.oldStartingIndex = d
};
Sys.CollectionChange.registerClass("Sys.CollectionChange");
Sys.NotifyCollectionChangedAction = function() {
throw Error.notImplemented()
};
Sys.NotifyCollectionChangedAction.prototype = {
add: 0,
remove: 1,
reset: 2
};
Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");
Sys.NotifyCollectionChangedEventArgs = function(a) {
this._changes = a;
Sys.NotifyCollectionChangedEventArgs.initializeBase(this)
};
Sys.NotifyCollectionChangedEventArgs.prototype = {
get_changes: function() {
return this._changes || []
}
};
Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs);
Sys.Observer = function() {};
Sys.Observer.registerClass("Sys.Observer");
Sys.Observer.makeObservable = function(a) {
var c = a instanceof Array,
b = Sys.Observer;
if (a.setValue === b._observeMethods.setValue) return a;
b._addMethods(a, b._observeMethods);
if (c) b._addMethods(a, b._arrayMethods);
return a
};
Sys.Observer._addMethods = function(c, b) {
for (var a in b) c[a] = b[a]
};
Sys.Observer._addEventHandler = function(c, a, b) {
Sys.Observer._getContext(c, true).events._addHandler(a, b)
};
Sys.Observer.addEventHandler = function(c, a, b) {
Sys.Observer._addEventHandler(c, a, b)
};
Sys.Observer._removeEventHandler = function(c, a, b) {
Sys.Observer._getContext(c, true).events._removeHandler(a, b)
};
Sys.Observer.removeEventHandler = function(c, a, b) {
Sys.Observer._removeEventHandler(c, a, b)
};
Sys.Observer.raiseEvent = function(b, e, d) {
var c = Sys.Observer._getContext(b);
if (!c) return;
var a = c.events.getHandler(e);
if (a) a(b, d)
};
Sys.Observer.addPropertyChanged = function(b, a) {
Sys.Observer._addEventHandler(b, "propertyChanged", a)
};
Sys.Observer.removePropertyChanged = function(b, a) {
Sys.Observer._removeEventHandler(b, "propertyChanged", a)
};
Sys.Observer.beginUpdate = function(a) {
Sys.Observer._getContext(a, true).updating = true
};
Sys.Observer.endUpdate = function(b) {
var a = Sys.Observer._getContext(b);
if (!a || !a.updating) return;
a.updating = false;
var d = a.dirty;
a.dirty = false;
if (d) {
if (b instanceof Array) {
var c = a.changes;
a.changes = null;
Sys.Observer.raiseCollectionChanged(b, c)
}
Sys.Observer.raisePropertyChanged(b, "")
}
};
Sys.Observer.isUpdating = function(b) {
var a = Sys.Observer._getContext(b);
return a ? a.updating : false
};
Sys.Observer._setValue = function(a, j, g) {
var b, f, k = a,
d = j.split(".");
for (var i = 0, m = d.length - 1; i < m; i++) {
var l = d[i];
b = a["get_" + l];
if (typeof b === "function") a = b.call(a);
else a = a[l];
var n = typeof a;
if (a === null || n === "undefined") throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, j))
}
var e, c = d[m];
b = a["get_" + c];
f = a["set_" + c];
if (typeof b === "function") e = b.call(a);
else e = a[c];
if (typeof f === "function") f.call(a, g);
else a[c] = g;
if (e !== g) {
var h = Sys.Observer._getContext(k);
if (h && h.updating) {
h.dirty = true;
return
}
Sys.Observer.raisePropertyChanged(k, d[0])
}
};
Sys.Observer.setValue = function(b, a, c) {
Sys.Observer._setValue(b, a, c)
};
Sys.Observer.raisePropertyChanged = function(b, a) {
Sys.Observer.raiseEvent(b, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
};
Sys.Observer.addCollectionChanged = function(b, a) {
Sys.Observer._addEventHandler(b, "collectionChanged", a)
};
Sys.Observer.removeCollectionChanged = function(b, a) {
Sys.Observer._removeEventHandler(b, "collectionChanged", a)
};
Sys.Observer._collectionChange = function(d, c) {
var a = Sys.Observer._getContext(d);
if (a && a.updating) {
a.dirty = true;
var b = a.changes;
if (!b) a.changes = b = [c];
else b.push(c)
} else {
Sys.Observer.raiseCollectionChanged(d, [c]);
Sys.Observer.raisePropertyChanged(d, "length")
}
};
Sys.Observer.add = function(a, b) {
var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [b], a.length);
Array.add(a, b);
Sys.Observer._collectionChange(a, c)
};
Sys.Observer.addRange = function(a, b) {
var c = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, b, a.length);
Array.addRange(a, b);
Sys.Observer._collectionChange(a, c)
};
Sys.Observer.clear = function(a) {
var b = Array.clone(a);
Array.clear(a);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, b, 0))
};
Sys.Observer.insert = function(a, b, c) {
Array.insert(a, b, c);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [c], b))
};
Sys.Observer.remove = function(a, b) {
var c = Array.indexOf(a, b);
if (c !== -1) {
Array.remove(a, b);
Sys.Observer._collectionChange(a, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [b], c));
return true
}
return false
};
Sys.Observer.removeAt = function(b, a) {
if (a > -1 && a < b.length) {
var c = b[a];
Array.removeAt(b, a);
Sys.Observer._collectionChange(b, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [c], a))
}
};
Sys.Observer.raiseCollectionChanged = function(b, a) {
Sys.Observer.raiseEvent(b, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
};
Sys.Observer._observeMethods = {
add_propertyChanged: function(a) {
Sys.Observer._addEventHandler(this, "propertyChanged", a)
},
remove_propertyChanged: function(a) {
Sys.Observer._removeEventHandler(this, "propertyChanged", a)
},
addEventHandler: function(a, b) {
Sys.Observer._addEventHandler(this, a, b)
},
removeEventHandler: function(a, b) {
Sys.Observer._removeEventHandler(this, a, b)
},
get_isUpdating: function() {
return Sys.Observer.isUpdating(this)
},
beginUpdate: function() {
Sys.Observer.beginUpdate(this)
},
endUpdate: function() {
Sys.Observer.endUpdate(this)
},
setValue: function(b, a) {
Sys.Observer._setValue(this, b, a)
},
raiseEvent: function(b, a) {
Sys.Observer.raiseEvent(this, b, a)
},
raisePropertyChanged: function(a) {
Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(a))
}
};
Sys.Observer._arrayMethods = {
add_collectionChanged: function(a) {
Sys.Observer._addEventHandler(this, "collectionChanged", a)
},
remove_collectionChanged: function(a) {
Sys.Observer._removeEventHandler(this, "collectionChanged", a)
},
add: function(a) {
Sys.Observer.add(this, a)
},
addRange: function(a) {
Sys.Observer.addRange(this, a)
},
clear: function() {
Sys.Observer.clear(this)
},
insert: function(a, b) {
Sys.Observer.insert(this, a, b)
},
remove: function(a) {
return Sys.Observer.remove(this, a)
},
removeAt: function(a) {
Sys.Observer.removeAt(this, a)
},
raiseCollectionChanged: function(a) {
Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(a))
}
};
Sys.Observer._getContext = function(b, c) {
var a = b._observerContext;
if (a) return a();
if (c) return (b._observerContext = Sys.Observer._createContext())();
return null
};
Sys.Observer._createContext = function() {
var a = {
events: new Sys.EventHandlerList
};
return function() {
return a
}
};
Date._appendPreOrPostMatch = function(e, b) {
var d = 0,
a = false;
for (var c = 0, g = e.length; c < g; c++) {
var f = e.charAt(c);
switch (f) {
case "'":
if (a) b.append("'");
else d++;
a = false;
break;
case "\\":
if (a) b.append("\\");
a = !a;
break;
default:
b.append(f);
a = false
}
}
return d
};
Date._expandFormat = function(a, b) {
if (!b) b = "F";
var c = b.length;
if (c === 1) switch (b) {
case "d":
return a.ShortDatePattern;
case "D":
return a.LongDatePattern;
case "t":
return a.ShortTimePattern;
case "T":
return a.LongTimePattern;
case "f":
return a.LongDatePattern + " " + a.ShortTimePattern;
case "F":
return a.FullDateTimePattern;
case "M":
case "m":
return a.MonthDayPattern;
case "s":
return a.SortableDateTimePattern;
case "Y":
case "y":
return a.YearMonthPattern;
default:
throw Error.format(Sys.Res.formatInvalidString)
} else if (c === 2 && b.charAt(0) === "%") b = b.charAt(1);
return b
};
Date._expandYear = function(c, a) {
var d = new Date,
e = Date._getEra(d);
if (a < 100) {
var b = Date._getEraYear(d, c, e);
a += b - b % 100;
if (a > c.Calendar.TwoDigitYearMax) a -= 100
}
return a
};
Date._getEra = function(e, c) {
if (!c) return 0;
var b, d = e.getTime();
for (var a = 0, f = c.length; a < f; a += 4) {
b = c[a + 2];
if (b === null || d >= b) return a
}
return 0
};
Date._getEraYear = function(d, b, e, c) {
var a = d.getFullYear();
if (!c && b.eras) a -= b.eras[e + 3];
return a
};
Date._getParseRegExp = function(b, e) {
if (!b._parseRegExp) b._parseRegExp = {};
else if (b._parseRegExp[e]) return b._parseRegExp[e];
var c = Date._expandFormat(b, e);
c = c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1");
var a = new Sys.StringBuilder("^"),
j = [],
f = 0,
i = 0,
h = Date._getTokenRegExp(),
d;
while ((d = h.exec(c)) !== null) {
var l = c.slice(f, d.index);
f = h.lastIndex;
i += Date._appendPreOrPostMatch(l, a);
if (i % 2 === 1) {
a.append(d[0]);
continue
}
switch (d[0]) {
case "dddd":
case "ddd":
case "MMMM":
case "MMM":
case "gg":
case "g":
a.append("(\\D+)");
break;
case "tt":
case "t":
a.append("(\\D*)");
break;
case "yyyy":
a.append("(\\d{4})");
break;
case "fff":
a.append("(\\d{3})");
break;
case "ff":
a.append("(\\d{2})");
break;
case "f":
a.append("(\\d)");
break;
case "dd":
case "d":
case "MM":
case "M":
case "yy":
case "y":
case "HH":
case "H":
case "hh":
case "h":
case "mm":
case "m":
case "ss":
case "s":
a.append("(\\d\\d?)");
break;
case "zzz":
a.append("([+-]?\\d\\d?:\\d{2})");
break;
case "zz":
case "z":
a.append("([+-]?\\d\\d?)");
break;
case "/":
a.append("(\\" + b.DateSeparator + ")")
}
Array.add(j, d[0])
}
Date._appendPreOrPostMatch(c.slice(f), a);
a.append("$");
var k = a.toString().replace(/\s+/g, "\\s+"),
g = {
"regExp": k,
"groups": j
};
b._parseRegExp[e] = g;
return g
};
Date._getTokenRegExp = function() {
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
};
Date.parseLocale = function(a) {
return Date._parse(a, Sys.CultureInfo.CurrentCulture, arguments)
};
Date.parseInvariant = function(a) {
return Date._parse(a, Sys.CultureInfo.InvariantCulture, arguments)
};
Date._parse = function(h, d, i) {
var a, c, b, f, e, g = false;
for (a = 1, c = i.length; a < c; a++) {
f = i[a];
if (f) {
g = true;
b = Date._parseExact(h, f, d);
if (b) return b
}
}
if (!g) {
e = d._getDateTimeFormats();
for (a = 0, c = e.length; a < c; a++) {
b = Date._parseExact(h, e[a], d);
if (b) return b
}
}
return null
};
Date._parseExact = function(w, D, k) {
w = w.trim();
var g = k.dateTimeFormat,
A = Date._getParseRegExp(g, D),
C = (new RegExp(A.regExp)).exec(w);
if (C === null) return null;
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;
for (var s = 0, E = B.length; s < E; s++) {
var a = C[s + 1];
if (a) switch (B[s]) {
case "dd":
case "d":
j = parseInt(a, 10);
if (j < 1 || j > 31) return null;
break;
case "MMMM":
c = k._getMonthIndex(a);
if (c < 0 || c > 11) return null;
break;
case "MMM":
c = k._getAbbrMonthIndex(a);
if (c < 0 || c > 11) return null;
break;
case "M":
case "MM":
c = parseInt(a, 10) - 1;
if (c < 0 || c > 11) return null;
break;
case "y":
case "yy":
e = Date._expandYear(g, parseInt(a, 10));
if (e < 0 || e > 9999) return null;
break;
case "yyyy":
e = parseInt(a, 10);
if (e < 0 || e > 9999) return null;
break;
case "h":
case "hh":
d = parseInt(a, 10);
if (d === 12) d = 0;
if (d < 0 || d > 11) return null;
break;
case "H":
case "HH":
d = parseInt(a, 10);
if (d < 0 || d > 23) return null;
break;
case "m":
case "mm":
p = parseInt(a, 10);
if (p < 0 || p > 59) return null;
break;
case "s":
case "ss":
q = parseInt(a, 10);
if (q < 0 || q > 59) return null;
break;
case "tt":
case "t":
var z = a.toUpperCase();
v = z === g.PMDesignator.toUpperCase();
if (!v && z !== g.AMDesignator.toUpperCase()) return null;
break;
case "f":
f = parseInt(a, 10) * 100;
if (f < 0 || f > 999) return null;
break;
case "ff":
f = parseInt(a, 10) * 10;
if (f < 0 || f > 999) return null;
break;
case "fff":
f = parseInt(a, 10);
if (f < 0 || f > 999) return null;
break;
case "dddd":
i = k._getDayIndex(a);
if (i < 0 || i > 6) return null;
break;
case "ddd":
i = k._getAbbrDayIndex(a);
if (i < 0 || i > 6) return null;
break;
case "zzz":
var u = a.split(/:/);
if (u.length !== 2) return null;
h = parseInt(u[0], 10);
if (h < -12 || h > 13) return null;
var m = parseInt(u[1], 10);
if (m < 0 || m > 59) return null;
l = h * 60 + (a.startsWith("-") ? -m : m);
break;
case "z":
case "zz":
h = parseInt(a, 10);
if (h < -12 || h > 13) return null;
l = h * 60;
break;
case "g":
case "gg":
var o = a;
if (!o || !g.eras) return null;
o = o.toLowerCase().trim();
for (var r = 0, F = g.eras.length; r < F; r += 4)
if (o === g.eras[r + 1].toLowerCase()) {
x = r;
break
}
if (x === null) return null
}
}
var b = new Date,
t, n = g.Calendar.convert;
if (n) t = n.fromGregorian(b)[0];
else t = b.getFullYear();
if (e === null) e = t;
else if (g.eras) e += g.eras[(x || 0) + 3];
if (c === null) c = 0;
if (j === null) j = 1;
if (n) {
b = n.toGregorian(e, c, j);
if (b === null) return null
} else {
b.setFullYear(e, c, j);
if (b.getDate() !== j) return null;
if (i !== null && b.getDay() !== i) return null
}
if (v && d < 12) d += 12;
b.setHours(d, p, q, f);
if (l !== null) {
var y = b.getMinutes() - (l + b.getTimezoneOffset());
b.setHours(b.getHours() + parseInt(y / 60, 10), y % 60)
}
return b
};
Date.prototype.format = function(a) {
return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
};
Date.prototype.localeFormat = function(a) {
return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
};
Date.prototype._toFormattedString = function(e, j) {
var b = j.dateTimeFormat,
n = b.Calendar.convert;
if (!e || !e.length || e === "i")
if (j && j.name.length)
if (n) return this._toFormattedString(b.FullDateTimePattern, j);
else {
var r = new Date(this.getTime()),
x = Date._getEra(this, b.eras);
r.setFullYear(Date._getEraYear(this, b, x));
return r.toLocaleString()
}
else return this.toString();
var l = b.eras,
k = e === "s";
e = Date._expandFormat(b, e);
var a = new Sys.StringBuilder,
c;
function d(a) {
if (a < 10) return "0" + a;
return a.toString()
}
function m(a) {
if (a < 10) return "00" + a;
if (a < 100) return "0" + a;
return a.toString()
}
function v(a) {
if (a < 10) return "000" + a;
else if (a < 100) return "00" + a;
else if (a < 1000) return "0" + a;
return a.toString()
}
var h, p, t = /([^d]|^)(d|dd)([^d]|$)/g;
function s() {
if (h || p) return h;
h = t.test(e);
p = true;
return h
}
var q = 0,
o = Date._getTokenRegExp(),
f;
if (!k && n) f = n.fromGregorian(this);
for (; true;) {
var w = o.lastIndex,
i = o.exec(e),
u = e.slice(w, i ? i.index : e.length);
q += Date._appendPreOrPostMatch(u, a);
if (!i) break;
if (q % 2 === 1) {
a.append(i[0]);
continue
}
function g(a, b) {
if (f) return f[b];
switch (b) {
case 0:
return a.getFullYear();
case 1:
return a.getMonth();
case 2:
return a.getDate()
}
}
switch (i[0]) {
case "dddd":
a.append(b.DayNames[this.getDay()]);
break;
case "ddd":
a.append(b.AbbreviatedDayNames[this.getDay()]);
break;
case "dd":
h = true;
a.append(d(g(this, 2)));
break;
case "d":
h = true;
a.append(g(this, 2));
break;
case "MMMM":
a.append(b.MonthGenitiveNames && s() ? b.MonthGenitiveNames[g(this, 1)] : b.MonthNames[g(this, 1)]);
break;
case "MMM":
a.append(b.AbbreviatedMonthGenitiveNames && s() ? b.AbbreviatedMonthGenitiveNames[g(this, 1)] : b.AbbreviatedMonthNames[g(this, 1)]);
break;
case "MM":
a.append(d(g(this, 1) + 1));
break;
case "M":
a.append(g(this, 1) + 1);
break;
case "yyyy":
a.append(v(f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)));
break;
case "yy":
a.append(d((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100));
break;
case "y":
a.append((f ? f[0] : Date._getEraYear(this, b, Date._getEra(this, l), k)) % 100);
break;
case "hh":
c = this.getHours() % 12;
if (c === 0) c = 12;
a.append(d(c));
break;
case "h":
c = this.getHours() % 12;
if (c === 0) c = 12;
a.append(c);
break;
case "HH":
a.append(d(this.getHours()));
break;
case "H":
a.append(this.getHours());
break;
case "mm":
a.append(d(this.getMinutes()));
break;
case "m":
a.append(this.getMinutes());
break;
case "ss":
a.append(d(this.getSeconds()));
break;
case "s":
a.append(this.getSeconds());
break;
case "tt":
a.append(this.getHours() < 12 ? b.AMDesignator : b.PMDesignator);
break;
case "t":
a.append((this.getHours() < 12 ? b.AMDesignator : b.PMDesignator).charAt(0));
break;
case "f":
a.append(m(this.getMilliseconds()).charAt(0));
break;
case "ff":
a.append(m(this.getMilliseconds()).substr(0, 2));
break;
case "fff":
a.append(m(this.getMilliseconds()));
break;
case "z":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + Math.floor(Math.abs(c)));
break;
case "zz":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))));
break;
case "zzz":
c = this.getTimezoneOffset() / 60;
a.append((c <= 0 ? "+" : "-") + d(Math.floor(Math.abs(c))) + ":" + d(Math.abs(this.getTimezoneOffset() % 60)));
break;
case "g":
case "gg":
if (b.eras) a.append(b.eras[Date._getEra(this, l) + 1]);
break;
case "/":
a.append(b.DateSeparator)
}
}
return a.toString()
};
String.localeFormat = function() {
return String._toFormattedString(true, arguments)
};
Number.parseLocale = function(a) {
return Number._parse(a, Sys.CultureInfo.CurrentCulture)
};
Number.parseInvariant = function(a) {
return Number._parse(a, Sys.CultureInfo.InvariantCulture)
};
Number._parse = function(b, o) {
b = b.trim();
if (b.match(/^[+-]?infinity$/i)) return parseFloat(b);
if (b.match(/^0x[a-f0-9]+$/i)) return parseInt(b);
var a = o.numberFormat,
g = Number._parseNumberNegativePattern(b, a, a.NumberNegativePattern),
h = g[0],
e = g[1];
if (h === "" && a.NumberNegativePattern !== 1) {
g = Number._parseNumberNegativePattern(b, a, 1);
h = g[0];
e = g[1]
}
if (h === "") h = "+";
var j, d, f = e.indexOf("e");
if (f < 0) f = e.indexOf("E");
if (f < 0) {
d = e;
j = null
} else {
d = e.substr(0, f);
j = e.substr(f + 1)
}
var c, k, m = d.indexOf(a.NumberDecimalSeparator);
if (m < 0) {
c = d;
k = null
} else {
c = d.substr(0, m);
k = d.substr(m + a.NumberDecimalSeparator.length)
}
c = c.split(a.NumberGroupSeparator).join("");
var n = a.NumberGroupSeparator.replace(/\u00A0/g, " ");
if (a.NumberGroupSeparator !== n) c = c.split(n).join("");
var l = h + c;
if (k !== null) l += "." + k;
if (j !== null) {
var i = Number._parseNumberNegativePattern(j, a, 1);
if (i[0] === "") i[0] = "+";
l += "e" + i[0] + i[1]
}
if (l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) return parseFloat(l);
return Number.NaN
};
Number._parseNumberNegativePattern = function(a, d, e) {
var b = d.NegativeSign,
c = d.PositiveSign;
switch (e) {
case 4:
b = " " + b;
c = " " + c;
case 3:
if (a.endsWith(b)) return ["-", a.substr(0, a.length - b.length)];
else if (a.endsWith(c)) return ["+", a.substr(0, a.length - c.length)];
break;
case 2:
b += " ";
c += " ";
case 1:
if (a.startsWith(b)) return ["-", a.substr(b.length)];
else if (a.startsWith(c)) return ["+", a.substr(c.length)];
break;
case 0:
if (a.startsWith("(") && a.endsWith(")")) return ["-", a.substr(1, a.length - 2)]
}
return ["", a]
};
Number.prototype.format = function(a) {
return this._toFormattedString(a, Sys.CultureInfo.InvariantCulture)
};
Number.prototype.localeFormat = function(a) {
return this._toFormattedString(a, Sys.CultureInfo.CurrentCulture)
};
Number.prototype._toFormattedString = function(e, j) {
if (!e || e.length === 0 || e === "i")
if (j && j.name.length > 0) return this.toLocaleString();
else return this.toString();
var o = ["n %", "n%", "%n"],
n = ["-n %", "-n%", "-%n"],
p = ["(n)", "-n", "- n", "n-", "n -"],
m = ["$n", "n$", "$ n", "n $"],
l = ["($n)", "-$n", "$-n", "$n-", "(n$)", "-n$", "n-$", "n$-", "-n $", "-$ n", "n $-", "$ n-", "$ -n", "n- $", "($ n)", "(n $)"];
function g(a, c, d) {
for (var b = a.length; b < c; b++) a = d ? "0" + a : a + "0";
return a
}
function i(j, i, l, n, p) {
var h = l[0],
k = 1,
o = Math.pow(10, i),
m = Math.round(j * o) / o;
if (!isFinite(m)) m = j;
j = m;
var b = j.toString(),
a = "",
c, e = b.split(/e/i);
b = e[0];
c = e.length > 1 ? parseInt(e[1]) : 0;
e = b.split(".");
b = e[0];
a = e.length > 1 ? e[1] : "";
var q;
if (c > 0) {
a = g(a, c, false);
b += a.slice(0, c);
a = a.substr(c)
} else if (c < 0) {
c = -c;
b = g(b, c + 1, true);
a = b.slice(-c, b.length) + a;
b = b.slice(0, -c)
}
if (i > 0) {
if (a.length > i) a = a.slice(0, i);
else a = g(a, i, false);
a = p + a
} else a = "";
var d = b.length - 1,
f = "";
while (d >= 0) {
if (h === 0 || h > d)
if (f.length > 0) return b.slice(0, d + 1) + n + f + a;
else return b.slice(0, d + 1) + a;
if (f.length > 0) f = b.slice(d - h + 1, d + 1) + n + f;
else f = b.slice(d - h + 1, d + 1);
d -= h;
if (k < l.length) {
h = l[k];
k++
}
}
return b.slice(0, d + 1) + n + f + a
}
var a = j.numberFormat,
d = Math.abs(this);
if (!e) e = "D";
var b = -1;
if (e.length > 1) b = parseInt(e.slice(1), 10);
var c;
switch (e.charAt(0)) {
case "d":
case "D":
c = "n";
if (b !== -1) d = g("" + d, b, true);
if (this < 0) d = -d;
break;
case "c":
case "C":
if (this < 0) c = l[a.CurrencyNegativePattern];
else c = m[a.CurrencyPositivePattern];
if (b === -1) b = a.CurrencyDecimalDigits;
d = i(Math.abs(this), b, a.CurrencyGroupSizes, a.CurrencyGroupSeparator, a.CurrencyDecimalSeparator);
break;
case "n":
case "N":
if (this < 0) c = p[a.NumberNegativePattern];
else c = "n";
if (b === -1) b = a.NumberDecimalDigits;
d = i(Math.abs(this), b, a.NumberGroupSizes, a.NumberGroupSeparator, a.NumberDecimalSeparator);
break;
case "p":
case "P":
if (this < 0) c = n[a.PercentNegativePattern];
else c = o[a.PercentPositivePattern];
if (b === -1) b = a.PercentDecimalDigits;
d = i(Math.abs(this) * 100, b, a.PercentGroupSizes, a.PercentGroupSeparator, a.PercentDecimalSeparator);
break;
default:
throw Error.format(Sys.Res.formatBadFormatSpecifier)
}
var k = /n|\$|-|%/g,
f = "";
for (; true;) {
var q = k.lastIndex,
h = k.exec(c);
f += c.slice(q, h ? h.index : c.length);
if (!h) break;
switch (h[0]) {
case "n":
f += d;
break;
case "$":
f += a.CurrencySymbol;
break;
case "-":
if (/[1-9]/.test(d)) f += a.NegativeSign;
break;
case "%":
f += a.PercentSymbol
}
}
return f
};
Sys.CultureInfo = function(c, b, a) {
this.name = c;
this.numberFormat = b;
this.dateTimeFormat = a
};
Sys.CultureInfo.prototype = {
_getDateTimeFormats: function() {
if (!this._dateTimeFormats) {
var a = this.dateTimeFormat;
this._dateTimeFormats = [a.MonthDayPattern, a.YearMonthPattern, a.ShortDatePattern, a.ShortTimePattern, a.LongDatePattern, a.LongTimePattern, a.FullDateTimePattern, a.RFC1123Pattern, a.SortableDateTimePattern, a.UniversalSortableDateTimePattern]
}
return this._dateTimeFormats
},
_getIndex: function(c, d, e) {
var b = this._toUpper(c),
a = Array.indexOf(d, b);
if (a === -1) a = Array.indexOf(e, b);
return a
},
_getMonthIndex: function(a) {
if (!this._upperMonths) {
this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames);
this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)
}
return this._getIndex(a, this._upperMonths, this._upperMonthsGenitive)
},
_getAbbrMonthIndex: function(a) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)
}
return this._getIndex(a, this._upperAbbrMonths, this._upperAbbrMonthsGenitive)
},
_getDayIndex: function(a) {
if (!this._upperDays) this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames);
return Array.indexOf(this._upperDays, this._toUpper(a))
},
_getAbbrDayIndex: function(a) {
if (!this._upperAbbrDays) this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);
return Array.indexOf(this._upperAbbrDays, this._toUpper(a))
},
_toUpperArray: function(c) {
var b = [];
for (var a = 0, d = c.length; a < d; a++) b[a] = this._toUpper(c[a]);
return b
},
_toUpper: function(a) {
return a.split("\u00a0").join(" ").toUpperCase()
}
};
Sys.CultureInfo.registerClass("Sys.CultureInfo");
Sys.CultureInfo._parse = function(a) {
var b = a.dateTimeFormat;
if (b && !b.eras) b.eras = a.eras;
return new Sys.CultureInfo(a.name, a.numberFormat, b)
};
Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({
"name": "",
"numberFormat": {
"CurrencyDecimalDigits": 2,
"CurrencyDecimalSeparator": ".",
"IsReadOnly": true,
"CurrencyGroupSizes": [3],
"NumberGroupSizes": [3],
"PercentGroupSizes": [3],
"CurrencyGroupSeparator": ",",
"CurrencySymbol": "\u00a4",
"NaNSymbol": "NaN",
"CurrencyNegativePattern": 0,
"NumberNegativePattern": 1,
"PercentPositivePattern": 0,
"PercentNegativePattern": 0,
"NegativeInfinitySymbol": "-Infinity",
"NegativeSign": "-",
"NumberDecimalDigits": 2,
"NumberDecimalSeparator": ".",
"NumberGroupSeparator": ",",
"CurrencyPositivePattern": 0,
"PositiveInfinitySymbol": "Infinity",
"PositiveSign": "+",
"PercentDecimalDigits": 2,
"PercentDecimalSeparator": ".",
"PercentGroupSeparator": ",",
"PercentSymbol": "%",
"PerMilleSymbol": "\u2030",
"NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"DigitSubstitution": 1
},
"dateTimeFormat": {
"AMDesignator": "AM",
"Calendar": {
"MinSupportedDateTime": "@-62135568000000@",
"MaxSupportedDateTime": "@253402300799999@",
"AlgorithmType": 1,
"CalendarType": 1,
"Eras": [1],
"TwoDigitYearMax": 2029,
"IsReadOnly": true
},
"DateSeparator": "/",
"FirstDayOfWeek": 0,
"CalendarWeekRule": 0,
"FullDateTimePattern": "dddd, dd MMMM yyyy HH:mm:ss",
"LongDatePattern": "dddd, dd MMMM yyyy",
"LongTimePattern": "HH:mm:ss",
"MonthDayPattern": "MMMM dd",
"PMDesignator": "PM",
"RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
"ShortDatePattern": "MM/dd/yyyy",
"ShortTimePattern": "HH:mm",
"SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
"TimeSeparator": ":",
"UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
"YearMonthPattern": "yyyy MMMM",
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"IsReadOnly": true,
"NativeCalendarName": "Gregorian Calendar",
"AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
},
"eras": [1, "A.D.", null, 0]
});
if (typeof __cultureInfo === "object") {
Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
delete __cultureInfo
} else Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({
"name": "en-US",
"numberFormat": {
"CurrencyDecimalDigits": 2,
"CurrencyDecimalSeparator": ".",
"IsReadOnly": false,
"CurrencyGroupSizes": [3],
"NumberGroupSizes": [3],
"PercentGroupSizes": [3],
"CurrencyGroupSeparator": ",",
"CurrencySymbol": "$",
"NaNSymbol": "NaN",
"CurrencyNegativePattern": 0,
"NumberNegativePattern": 1,
"PercentPositivePattern": 0,
"PercentNegativePattern": 0,
"NegativeInfinitySymbol": "-Infinity",
"NegativeSign": "-",
"NumberDecimalDigits": 2,
"NumberDecimalSeparator": ".",
"NumberGroupSeparator": ",",
"CurrencyPositivePattern": 0,
"PositiveInfinitySymbol": "Infinity",
"PositiveSign": "+",
"PercentDecimalDigits": 2,
"PercentDecimalSeparator": ".",
"PercentGroupSeparator": ",",
"PercentSymbol": "%",
"PerMilleSymbol": "\u2030",
"NativeDigits": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"DigitSubstitution": 1
},
"dateTimeFormat": {
"AMDesignator": "AM",
"Calendar": {
"MinSupportedDateTime": "@-62135568000000@",
"MaxSupportedDateTime": "@253402300799999@",
"AlgorithmType": 1,
"CalendarType": 1,
"Eras": [1],
"TwoDigitYearMax": 2029,
"IsReadOnly": false
},
"DateSeparator": "/",
"FirstDayOfWeek": 0,
"CalendarWeekRule": 0,
"FullDateTimePattern": "dddd, MMMM dd, yyyy h:mm:ss tt",
"LongDatePattern": "dddd, MMMM dd, yyyy",
"LongTimePattern": "h:mm:ss tt",
"MonthDayPattern": "MMMM dd",
"PMDesignator": "PM",
"RFC1123Pattern": "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",
"ShortDatePattern": "M/d/yyyy",
"ShortTimePattern": "h:mm tt",
"SortableDateTimePattern": "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
"TimeSeparator": ":",
"UniversalSortableDateTimePattern": "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
"YearMonthPattern": "MMMM, yyyy",
"AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
"ShortestDayNames": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
"DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
"AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
"IsReadOnly": false,
"NativeCalendarName": "Gregorian Calendar",
"AbbreviatedMonthGenitiveNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""],
"MonthGenitiveNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""]
},
"eras": [1, "A.D.", null, 0]
});
Type.registerNamespace("Sys.Serialization");
Sys.Serialization.JavaScriptSerializer = function() {};
Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = [];
Sys.Serialization.JavaScriptSerializer._charsToEscape = [];
Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', "g");
Sys.Serialization.JavaScriptSerializer._escapeChars = {};
Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', "i");
Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', "g");
Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]", "g");
Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', "g");
Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = "__type";
Sys.Serialization.JavaScriptSerializer._init = function() {
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"];
Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = "\\";
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"] = new RegExp("\\\\", "g");
Sys.Serialization.JavaScriptSerializer._escapeChars["\\"] = "\\\\";
Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"';
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', "g");
Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"';
for (var a = 0; a < 32; a++) {
var b = String.fromCharCode(a);
Sys.Serialization.JavaScriptSerializer._charsToEscape[a + 2] = b;
Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b] = new RegExp(b, "g");
Sys.Serialization.JavaScriptSerializer._escapeChars[b] = c[a]
}
};
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function(b, a) {
a.append(b.toString())
};
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function(a, b) {
if (isFinite(a)) b.append(String(a));
else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)
};
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function(a, c) {
c.append('"');
if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)) {
if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) Sys.Serialization.JavaScriptSerializer._init();
if (a.length < 128) a = a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, function(a) {
return Sys.Serialization.JavaScriptSerializer._escapeChars[a]
});
else
for (var d = 0; d < 34; d++) {
var b = Sys.Serialization.JavaScriptSerializer._charsToEscape[d];
if (a.indexOf(b) !== -1)
if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) a = a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);
else a = a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b], Sys.Serialization.JavaScriptSerializer._escapeChars[b])
}
}
c.append(a);
c.append('"')
};
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function(b, a, i, g) {
var c;
switch (typeof b) {
case "object":
if (b)
if (Number.isInstanceOfType(b)) Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a);
else if (Boolean.isInstanceOfType(b)) Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a);
else if (String.isInstanceOfType(b)) Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a);
else if (Array.isInstanceOfType(b)) {
a.append("[");
for (c = 0; c < b.length; ++c) {
if (c > 0) a.append(",");
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c], a, false, g)
}
a.append("]")
} else {
if (Date.isInstanceOfType(b)) {
a.append('"\\/Date(');
a.append(b.getTime());
a.append(')\\/"');
break
}
var d = [],
f = 0;
for (var e in b) {
if (e.startsWith("$")) continue;
if (e === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && f !== 0) {
d[f++] = d[0];
d[0] = e
} else d[f++] = e
}
if (i) d.sort();
a.append("{");
var j = false;
for (c = 0; c < f; c++) {
var h = b[d[c]];
if (typeof h !== "undefined" && typeof h !== "function") {
if (j) a.append(",");
else j = true;
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c], a, i, g);
a.append(":");
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h, a, i, g)
}
}
a.append("}")
} else a.append("null");
break;
case "number":
Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b, a);
break;
case "string":
Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b, a);
break;
case "boolean":
Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b, a);
break;
default:
a.append("null")
}
};
Sys.Serialization.JavaScriptSerializer.serialize = function(b) {
var a = new Sys.StringBuilder;
Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b, a, false);
return a.toString()
};
Sys.Serialization.JavaScriptSerializer.deserialize = function(data, secure) {
if (data.length === 0) throw Error.argument("data", Sys.Res.cannotDeserializeEmptyString);
try {
var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)");
if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ""))) throw null;
return eval("(" + exp + ")")
} catch (a) {
throw Error.argument("data", Sys.Res.cannotDeserializeInvalidJson)
}
};
Type.registerNamespace("Sys.UI");
Sys.EventHandlerList = function() {
this._list = {}
};
Sys.EventHandlerList.prototype = {
_addHandler: function(b, a) {
Array.add(this._getEvent(b, true), a)
},
addHandler: function(b, a) {
this._addHandler(b, a)
},
_removeHandler: function(c, b) {
var a = this._getEvent(c);
if (!a) return;
Array.remove(a, b)
},
removeHandler: function(b, a) {
this._removeHandler(b, a)
},
getHandler: function(b) {
var a = this._getEvent(b);
if (!a || a.length === 0) return null;
a = Array.clone(a);
return function(c, d) {
for (var b = 0, e = a.length; b < e; b++) a[b](c, d)
}
},
_getEvent: function(a, b) {
if (!this._list[a]) {
if (!b) return null;
this._list[a] = []
}
return this._list[a]
}
};
Sys.EventHandlerList.registerClass("Sys.EventHandlerList");
Sys.CommandEventArgs = function(c, a, b) {
Sys.CommandEventArgs.initializeBase(this);
this._commandName = c;
this._commandArgument = a;
this._commandSource = b
};
Sys.CommandEventArgs.prototype = {
_commandName: null,
_commandArgument: null,
_commandSource: null,
get_commandName: function() {
return this._commandName
},
get_commandArgument: function() {
return this._commandArgument
},
get_commandSource: function() {
return this._commandSource
}
};
Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
Sys.INotifyPropertyChange = function() {};
Sys.INotifyPropertyChange.prototype = {};
Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");
Sys.PropertyChangedEventArgs = function(a) {
Sys.PropertyChangedEventArgs.initializeBase(this);
this._propertyName = a
};
Sys.PropertyChangedEventArgs.prototype = {
get_propertyName: function() {
return this._propertyName
}
};
Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs", Sys.EventArgs);
Sys.INotifyDisposing = function() {};
Sys.INotifyDisposing.prototype = {};
Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");
Sys.Component = function() {
if (Sys.Application) Sys.Application.registerDisposableObject(this)
};
Sys.Component.prototype = {
_id: null,
_initialized: false,
_updating: false,
get_events: function() {
if (!this._events) this._events = new Sys.EventHandlerList;
return this._events
},
get_id: function() {
return this._id
},
set_id: function(a) {
this._id = a
},
get_isInitialized: function() {
return this._initialized
},
get_isUpdating: function() {
return this._updating
},
add_disposing: function(a) {
this.get_events().addHandler("disposing", a)
},
remove_disposing: function(a) {
this.get_events().removeHandler("disposing", a)
},
add_propertyChanged: function(a) {
this.get_events().addHandler("propertyChanged", a)
},
remove_propertyChanged: function(a) {
this.get_events().removeHandler("propertyChanged", a)
},
beginUpdate: function() {
this._updating = true
},
dispose: function() {
if (this._events) {
var a = this._events.getHandler("disposing");
if (a) a(this, Sys.EventArgs.Empty)
}
delete this._events;
Sys.Application.unregisterDisposableObject(this);
Sys.Application.removeComponent(this)
},
endUpdate: function() {
this._updating = false;
if (!this._initialized) this.initialize();
this.updated()
},
initialize: function() {
this._initialized = true
},
raisePropertyChanged: function(b) {
if (!this._events) return;
var a = this._events.getHandler("propertyChanged");
if (a) a(this, new Sys.PropertyChangedEventArgs(b))
},
updated: function() {}
};
Sys.Component.registerClass("Sys.Component", null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing);
function Sys$Component$_setProperties(a, i) {
var d, j = Object.getType(a),
e = j === Object || j === Sys.UI.DomElement,
h = Sys.Component.isInstanceOfType(a) && !a.get_isUpdating();
if (h) a.beginUpdate();
for (var c in i) {
var b = i[c],
f = e ? null : a["get_" + c];
if (e || typeof f !== "function") {
var k = a[c];
if (!b || typeof b !== "object" || e && !k) a[c] = b;
else Sys$Component$_setProperties(k, b)
} else {
var l = a["set_" + c];
if (typeof l === "function") l.apply(a, [b]);
else if (b instanceof Array) {
d = f.apply(a);
for (var g = 0, m = d.length, n = b.length; g < n; g++, m++) d[m] = b[g]
} else if (typeof b === "object" && Object.getType(b) === Object) {
d = f.apply(a);
Sys$Component$_setProperties(d, b)
}
}
}
if (h) a.endUpdate()
}
function Sys$Component$_setReferences(c, b) {
for (var a in b) {
var e = c["set_" + a],
d = $find(b[a]);
e.apply(c, [d])
}
}
var $create = Sys.Component.create = function(h, f, d, c, g) {
var a = g ? new h(g) : new h,
b = Sys.Application,
i = b.get_isCreatingComponents();
a.beginUpdate();
if (f) Sys$Component$_setProperties(a, f);
if (d)
for (var e in d) a["add_" + e](d[e]);
if (a.get_id()) b.addComponent(a);
if (i) {
b._createdComponents[b._createdComponents.length] = a;
if (c) b._addComponentToSecondPass(a, c);
else a.endUpdate()
} else {
if (c) Sys$Component$_setReferences(a, c);
a.endUpdate()
}
return a
};
Sys.UI.MouseButton = function() {
throw Error.notImplemented()
};
Sys.UI.MouseButton.prototype = {
leftButton: 0,
middleButton: 1,
rightButton: 2
};
Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
Sys.UI.Key = function() {
throw Error.notImplemented()
};
Sys.UI.Key.prototype = {
backspace: 8,
tab: 9,
enter: 13,
esc: 27,
space: 32,
pageUp: 33,
pageDown: 34,
end: 35,
home: 36,
left: 37,
up: 38,
right: 39,
down: 40,
del: 127
};
Sys.UI.Key.registerEnum("Sys.UI.Key");
Sys.UI.Point = function(a, b) {
this.rawX = a;
this.rawY = b;
this.x = Math.round(a);
this.y = Math.round(b)
};
Sys.UI.Point.registerClass("Sys.UI.Point");
Sys.UI.Bounds = function(c, d, b, a) {
this.x = c;
this.y = d;
this.height = a;
this.width = b
};
Sys.UI.Bounds.registerClass("Sys.UI.Bounds");
Sys.UI.DomEvent = function(e) {
var a = e,
b = this.type = a.type.toLowerCase();
this.rawEvent = a;
this.altKey = a.altKey;
if (typeof a.button !== "undefined") 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;
if (b === "keypress") this.charCode = a.charCode || a.keyCode;
else if (a.keyCode && a.keyCode === 46) this.keyCode = 127;
else this.keyCode = a.keyCode;
this.clientX = a.clientX;
this.clientY = a.clientY;
this.ctrlKey = a.ctrlKey;
this.target = a.target ? a.target : a.srcElement;
if (!b.startsWith("key"))
if (typeof a.offsetX !== "undefined" && typeof a.offsetY !== "undefined") {
this.offsetX = a.offsetX;
this.offsetY = a.offsetY
} else if (this.target && this.target.nodeType !== 3 && typeof a.clientX === "number") {
var c = Sys.UI.DomElement.getLocation(this.target),
d = Sys.UI.DomElement._getWindow(this.target);
this.offsetX = (d.pageXOffset || 0) + a.clientX - c.x;
this.offsetY = (d.pageYOffset || 0) + a.clientY - c.y
}
this.screenX = a.screenX;
this.screenY = a.screenY;
this.shiftKey = a.shiftKey
};
Sys.UI.DomEvent.prototype = {
preventDefault: function() {
if (this.rawEvent.preventDefault) this.rawEvent.preventDefault();
else if (window.event) this.rawEvent.returnValue = false
},
stopPropagation: function() {
if (this.rawEvent.stopPropagation) this.rawEvent.stopPropagation();
else if (window.event) this.rawEvent.cancelBubble = true
}
};
Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");
var $addHandler = Sys.UI.DomEvent.addHandler = function(a, d, e, g) {
if (!a._events) a._events = {};
var c = a._events[d];
if (!c) a._events[d] = c = [];
var b;
if (a.addEventListener) {
b = function(b) {
return e.call(a, new Sys.UI.DomEvent(b))
};
a.addEventListener(d, b, false)
} else if (a.attachEvent) {
b = function() {
var b = {};
try {
b = Sys.UI.DomElement._getWindow(a).event
} catch (c) {}
return e.call(a, new Sys.UI.DomEvent(b))
};
a.attachEvent("on" + d, b)
}
c[c.length] = {
handler: e,
browserHandler: b,
autoRemove: g
};
if (g) {
var f = a.dispose;
if (f !== Sys.UI.DomEvent._disposeHandlers) {
a.dispose = Sys.UI.DomEvent._disposeHandlers;
if (typeof f !== "undefined") a._chainDispose = f
}
}
},
$addHandlers = Sys.UI.DomEvent.addHandlers = function(f, d, c, e) {
for (var b in d) {
var a = d[b];
if (c) a = Function.createDelegate(c, a);
$addHandler(f, b, a, e || false)
}
},
$clearHandlers = Sys.UI.DomEvent.clearHandlers = function(a) {
Sys.UI.DomEvent._clearHandlers(a, false)
};
Sys.UI.DomEvent._clearHandlers = function(a, g) {
if (a._events) {
var e = a._events;
for (var b in e) {
var d = e[b];
for (var c = d.length - 1; c >= 0; c--) {
var f = d[c];
if (!g || f.autoRemove) $removeHandler(a, b, f.handler)
}
}
a._events = null
}
};
Sys.UI.DomEvent._disposeHandlers = function() {
Sys.UI.DomEvent._clearHandlers(this, true);
var b = this._chainDispose,
a = typeof b;
if (a !== "undefined") {
this.dispose = b;
this._chainDispose = null;
if (a === "function") this.dispose()
}
};
var $removeHandler = Sys.UI.DomEvent.removeHandler = function(b, a, c) {
Sys.UI.DomEvent._removeHandler(b, a, c)
};
Sys.UI.DomEvent._removeHandler = function(a, e, f) {
var d = null,
c = a._events[e];
for (var b = 0, g = c.length; b < g; b++)
if (c[b].handler === f) {
d = c[b].browserHandler;
break
}
if (a.removeEventListener) a.removeEventListener(e, d, false);
else if (a.detachEvent) a.detachEvent("on" + e, d);
c.splice(b, 1)
};
Sys.UI.DomElement = function() {};
Sys.UI.DomElement.registerClass("Sys.UI.DomElement");
Sys.UI.DomElement.addCssClass = function(a, b) {
if (!Sys.UI.DomElement.containsCssClass(a, b))
if (a.className === "") a.className = b;
else a.className += " " + b
};
Sys.UI.DomElement.containsCssClass = function(b, a) {
return Array.contains(b.className.split(" "), a)
};
Sys.UI.DomElement.getBounds = function(a) {
var b = Sys.UI.DomElement.getLocation(a);
return new Sys.UI.Bounds(b.x, b.y, a.offsetWidth || 0, a.offsetHeight || 0)
};
var $get = Sys.UI.DomElement.getElementById = function(f, e) {
if (!e) return document.getElementById(f);
if (e.getElementById) return e.getElementById(f);
var c = [],
d = e.childNodes;
for (var b = 0; b < d.length; b++) {
var a = d[b];
if (a.nodeType == 1) c[c.length] = a
}
while (c.length) {
a = c.shift();
if (a.id == f) return a;
d = a.childNodes;
for (b = 0; b < d.length; b++) {
a = d[b];
if (a.nodeType == 1) c[c.length] = a
}
}
return null
};
if (document.documentElement.getBoundingClientRect) Sys.UI.DomElement.getLocation = function(a) {
if (a.self || a.nodeType === 9 || a === document.documentElement || a.parentNode === a.ownerDocument.documentElement) return new Sys.UI.Point(0, 0);
var f = a.getBoundingClientRect();
if (!f) return new Sys.UI.Point(0, 0);
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);
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
try {
var g = a.ownerDocument.parentWindow.frameElement || null;
if (g) {
var i = g.frameBorder === "0" || g.frameBorder === "no" ? 2 : 0;
c += i;
d += i
}
} catch (m) {}
if (Sys.Browser.version === 7 && !document.documentMode) {
var j = document.body,
k = j.getBoundingClientRect(),
b = (k.right - k.left) / j.clientWidth;
b = Math.round(b * 100);
b = (b - b % 5) / 100;
if (!isNaN(b) && b !== 1) {
c = Math.round(c / b);
d = Math.round(d / b)
}
}
if ((document.documentMode || 0) < 8) {
c -= e.clientLeft;
d -= e.clientTop
}
}
return new Sys.UI.Point(c, d)
};
else if (Sys.Browser.agent === Sys.Browser.Safari) Sys.UI.DomElement.getLocation = function(c) {
if (c.window && c.window === c || c.nodeType === 9) return new Sys.UI.Point(0, 0);
var d = 0,
e = 0,
a, j = null,
g = null,
b;
for (a = c; a; j = a, (g = b, a = a.offsetParent)) {
b = Sys.UI.DomElement._getCurrentStyle(a);
var f = a.tagName ? a.tagName.toUpperCase() : null;
if ((a.offsetLeft || a.offsetTop) && (f !== "BODY" || (!g || g.position !== "absolute"))) {
d += a.offsetLeft;
e += a.offsetTop
}
if (j && Sys.Browser.version >= 3) {
d += parseInt(b.borderLeftWidth);
e += parseInt(b.borderTopWidth)
}
}
b = Sys.UI.DomElement._getCurrentStyle(c);
var h = b ? b.position : null;
if (!h || h !== "absolute")
for (a = c.parentNode; a; a = a.parentNode) {
f = a.tagName ? a.tagName.toUpperCase() : null;
if (f !== "BODY" && f !== "HTML" && (a.scrollLeft || a.scrollTop)) {
d -= a.scrollLeft || 0;
e -= a.scrollTop || 0
}
b = Sys.UI.DomElement._getCurrentStyle(a);
var i = b ? b.position : null;
if (i && i === "absolute") break
}
return new Sys.UI.Point(d, e)
};
else Sys.UI.DomElement.getLocation = function(d) {
if (d.window && d.window === d || d.nodeType === 9) return new Sys.UI.Point(0, 0);
var e = 0,
f = 0,
a, i = null,
g = null,
b = null;
for (a = d; a; i = a, (g = b, a = a.offsetParent)) {
var c = a.tagName ? a.tagName.toUpperCase() : null;
b = Sys.UI.DomElement._getCurrentStyle(a);
if ((a.offsetLeft || a.offsetTop) && !(c === "BODY" && (!g || g.position !== "absolute"))) {
e += a.offsetLeft;
f += a.offsetTop
}
if (i !== null && b) {
if (c !== "TABLE" && c !== "TD" && c !== "HTML") {
e += parseInt(b.borderLeftWidth) || 0;
f += parseInt(b.borderTopWidth) || 0
}
if (c === "TABLE" && (b.position === "relative" || b.position === "absolute")) {
e += parseInt(b.marginLeft) || 0;
f += parseInt(b.marginTop) || 0
}
}
}
b = Sys.UI.DomElement._getCurrentStyle(d);
var h = b ? b.position : null;
if