/* START MicrosoftAjax.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
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 (!h || h !== "absolute")for (a = d.parentNode; a; a = a.parentNode) {
c = a.tagName ? a.tagName.toUpperCase() : null;
if (c !== "BODY" && c !== "HTML" && (a.scrollLeft || a.scrollTop)) {
e -= a.scrollLeft || 0;
f -= a.scrollTop || 0;
b = Sys.UI.DomElement._getCurrentStyle(a);
if (b) {
e += parseInt(b.borderLeftWidth) || 0;
f += parseInt(b.borderTopWidth) || 0
}
}
}
return new Sys.UI.Point(e, f)
};
Sys.UI.DomElement.isDomElement = function (a) {
return Sys._isDomElement(a)
};
Sys.UI.DomElement.removeCssClass = function (d, c) {
var a = " " + d.className + " ", b = a.indexOf(" " + c + " ");
if (b >= 0)d.className = (a.substr(0, b) + " " + a.substring(b + c.length + 1, a.length)).trim()
};
Sys.UI.DomElement.resolveElement = function (b, c) {
var a = b;
if (!a)return null;
if (typeof a === "string")a = Sys.UI.DomElement.getElementById(a, c);
return a
};
Sys.UI.DomElement.raiseBubbleEvent = function (c, d) {
var b = c;
while (b) {
var a = b.control;
if (a && a.onBubbleEvent && a.raiseBubbleEvent) {
Sys.UI.DomElement._raiseBubbleEventFromControl(a, c, d);
return
}
b = b.parentNode
}
};
Sys.UI.DomElement._raiseBubbleEventFromControl = function (a, b, c) {
if (!a.onBubbleEvent(b, c))a._raiseBubbleEvent(b, c)
};
Sys.UI.DomElement.setLocation = function (b, c, d) {
var a = b.style;
a.position = "absolute";
a.left = c + "px";
a.top = d + "px"
};
Sys.UI.DomElement.toggleCssClass = function (b, a) {
if (Sys.UI.DomElement.containsCssClass(b, a))Sys.UI.DomElement.removeCssClass(b, a); else Sys.UI.DomElement.addCssClass(b, a)
};
Sys.UI.DomElement.getVisibilityMode = function (a) {
return a._visibilityMode === Sys.UI.VisibilityMode.hide ? Sys.UI.VisibilityMode.hide : Sys.UI.VisibilityMode.collapse
};
Sys.UI.DomElement.setVisibilityMode = function (a, b) {
Sys.UI.DomElement._ensureOldDisplayMode(a);
if (a._visibilityMode !== b) {
a._visibilityMode = b;
if (Sys.UI.DomElement.getVisible(a) === false)if (a._visibilityMode === Sys.UI.VisibilityMode.hide)a.style.display = a._oldDisplayMode; else a.style.display = "none";
a._visibilityMode = b
}
};
Sys.UI.DomElement.getVisible = function (b) {
var a = b.currentStyle || Sys.UI.DomElement._getCurrentStyle(b);
if (!a)return true;
return a.visibility !== "hidden" && a.display !== "none"
};
Sys.UI.DomElement.setVisible = function (a, b) {
if (b !== Sys.UI.DomElement.getVisible(a)) {
Sys.UI.DomElement._ensureOldDisplayMode(a);
a.style.visibility = b ? "visible" : "hidden";
if (b || a._visibilityMode === Sys.UI.VisibilityMode.hide)a.style.display = a._oldDisplayMode; else a.style.display = "none"
}
};
Sys.UI.DomElement._ensureOldDisplayMode = function (a) {
if (!a._oldDisplayMode) {
var b = a.currentStyle || Sys.UI.DomElement._getCurrentStyle(a);
a._oldDisplayMode = b ? b.display : null;
if (!a._oldDisplayMode || a._oldDisplayMode === "none")switch (a.tagName.toUpperCase()) {
case "DIV":
case "P":
case "ADDRESS":
case "BLOCKQUOTE":
case "BODY":
case "COL":
case "COLGROUP":
case "DD":
case "DL":
case "DT":
case "FIELDSET":
case "FORM":
case "H1":
case "H2":
case "H3":
case "H4":
case "H5":
case "H6":
case "HR":
case "IFRAME":
case "LEGEND":
case "OL":
case "PRE":
case "TABLE":
case "TD":
case "TH":
case "TR":
case "UL":
a._oldDisplayMode = "block";
break;
case "LI":
a._oldDisplayMode = "list-item";
break;
default:
a._oldDisplayMode = "inline"
}
}
};
Sys.UI.DomElement._getWindow = function (a) {
var b = a.ownerDocument || a.document || a;
return b.defaultView || b.parentWindow
};
Sys.UI.DomElement._getCurrentStyle = function (a) {
if (a.nodeType === 3)return null;
var c = Sys.UI.DomElement._getWindow(a);
if (a.documentElement)a = a.documentElement;
var b = c && a !== c && c.getComputedStyle ? c.getComputedStyle(a, null) : a.currentStyle || a.style;
if (!b && Sys.Browser.agent === Sys.Browser.Safari && a.style) {
var g = a.style.display, f = a.style.position;
a.style.position = "absolute";
a.style.display = "block";
var e = c.getComputedStyle(a, null);
a.style.display = g;
a.style.position = f;
b = {};
for (var d in e)b[d] = e[d];
b.display = "none"
}
return b
};
Sys.IContainer = function () {
};
Sys.IContainer.prototype = {};
Sys.IContainer.registerInterface("Sys.IContainer");
Sys.ApplicationLoadEventArgs = function (b, a) {
Sys.ApplicationLoadEventArgs.initializeBase(this);
this._components = b;
this._isPartialLoad = a
};
Sys.ApplicationLoadEventArgs.prototype = {
get_components: function () {
return this._components
}, get_isPartialLoad: function () {
return this._isPartialLoad
}
};
Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs", Sys.EventArgs);
Sys._Application = function () {
Sys._Application.initializeBase(this);
this._disposableObjects = [];
this._components = {};
this._createdComponents = [];
this._secondPassComponents = [];
this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
this._domReady()
};
Sys._Application.prototype = {
_creatingComponents: false,
_disposing: false,
_deleteCount: 0,
get_isCreatingComponents: function () {
return this._creatingComponents
},
get_isDisposing: function () {
return this._disposing
},
add_init: function (a) {
if (this._initialized)a(this, Sys.EventArgs.Empty); else this.get_events().addHandler("init", a)
},
remove_init: function (a) {
this.get_events().removeHandler("init", a)
},
add_load: function (a) {
this.get_events().addHandler("load", a)
},
remove_load: function (a) {
this.get_events().removeHandler("load", a)
},
add_unload: function (a) {
this.get_events().addHandler("unload", a)
},
remove_unload: function (a) {
this.get_events().removeHandler("unload", a)
},
addComponent: function (a) {
this._components[a.get_id()] = a
},
beginCreateComponents: function () {
this._creatingComponents = true
},
dispose: function () {
if (!this._disposing) {
this._disposing = true;
if (this._timerCookie) {
window.clearTimeout(this._timerCookie);
delete this._timerCookie
}
if (this._endRequestHandler) {
Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);
delete this._endRequestHandler
}
if (this._beginRequestHandler) {
Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);
delete this._beginRequestHandler
}
if (window.pageUnload)window.pageUnload(this, Sys.EventArgs.Empty);
var c = this.get_events().getHandler("unload");
if (c)c(this, Sys.EventArgs.Empty);
var b = Array.clone(this._disposableObjects);
for (var a = 0, f = b.length; a < f; a++) {
var d = b[a];
if (typeof d !== "undefined")d.dispose()
}
Array.clear(this._disposableObjects);
Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate);
if (Sys._ScriptLoader) {
var e = Sys._ScriptLoader.getInstance();
if (e)e.dispose()
}
Sys._Application.callBaseMethod(this, "dispose")
}
},
disposeElement: function (c, j) {
if (c.nodeType === 1) {
var b, h = c.getElementsByTagName("*"), g = h.length, i = new Array(g);
for (b = 0; b < g; b++)i[b] = h[b];
for (b = g - 1; b >= 0; b--) {
var d = i[b], f = d.dispose;
if (f && typeof f === "function")d.dispose(); else {
var e = d.control;
if (e && typeof e.dispose === "function")e.dispose()
}
var a = d._behaviors;
if (a)this._disposeComponents(a);
a = d._components;
if (a) {
this._disposeComponents(a);
d._components = null
}
}
if (!j) {
var f = c.dispose;
if (f && typeof f === "function")c.dispose(); else {
var e = c.control;
if (e && typeof e.dispose === "function")e.dispose()
}
var a = c._behaviors;
if (a)this._disposeComponents(a);
a = c._components;
if (a) {
this._disposeComponents(a);
c._components = null
}
}
}
},
endCreateComponents: function () {
var b = this._secondPassComponents;
for (var a = 0, d = b.length; a < d; a++) {
var c = b[a].component;
Sys$Component$_setReferences(c, b[a].references);
c.endUpdate()
}
this._secondPassComponents = [];
this._creatingComponents = false
},
findComponent: function (b, a) {
return a ? Sys.IContainer.isInstanceOfType(a) ? a.findComponent(b) : a[b] || null : Sys.Application._components[b] || null
},
getComponents: function () {
var a = [], b = this._components;
for (var c in b)a[a.length] = b[c];
return a
},
initialize: function () {
if (!this.get_isInitialized() && !this._disposing) {
Sys._Application.callBaseMethod(this, "initialize");
this._raiseInit();
if (this.get_stateString) {
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);
this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)
}
var a = this.get_stateString();
if (a !== this._currentEntry)this._navigate(a); else this._ensureHistory()
}
this.raiseLoad()
}
},
notifyScriptLoaded: function () {
},
registerDisposableObject: function (b) {
if (!this._disposing) {
var a = this._disposableObjects, c = a.length;
a[c] = b;
b.__msdisposeindex = c
}
},
raiseLoad: function () {
var b = this.get_events().getHandler("load"), a = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded);
this._loaded = true;
if (b)b(this, a);
if (window.pageLoad)window.pageLoad(this, a);
this._createdComponents = []
},
removeComponent: function (b) {
var a = b.get_id();
if (a)delete this._components[a]
},
unregisterDisposableObject: function (a) {
if (!this._disposing) {
var e = a.__msdisposeindex;
if (typeof e === "number") {
var b = this._disposableObjects;
delete b[e];
delete a.__msdisposeindex;
if (++this._deleteCount > 1000) {
var c = [];
for (var d = 0, f = b.length; d < f; d++) {
a = b[d];
if (typeof a !== "undefined") {
a.__msdisposeindex = c.length;
c.push(a)
}
}
this._disposableObjects = c;
this._deleteCount = 0
}
}
}
},
_addComponentToSecondPass: function (b, a) {
this._secondPassComponents[this._secondPassComponents.length] = {component: b, references: a}
},
_disposeComponents: function (a) {
if (a)for (var b = a.length - 1; b >= 0; b--) {
var c = a[b];
if (typeof c.dispose === "function")c.dispose()
}
},
_domReady: function () {
var a, g, f = this;
function b() {
f.initialize()
}
var c = function () {
Sys.UI.DomEvent.removeHandler(window, "load", c);
b()
};
Sys.UI.DomEvent.addHandler(window, "load", c);
if (document.addEventListener)try {
document.addEventListener("DOMContentLoaded", a = function () {
document.removeEventListener("DOMContentLoaded", a, false);
b()
}, false)
} catch (h) {
} else if (document.attachEvent)if (window == window.top && document.documentElement.doScroll) {
var e, d = document.createElement("div");
a = function () {
try {
d.doScroll("left")
} catch (c) {
e = window.setTimeout(a, 0);
return
}
d = null;
b()
};
a()
} else document.attachEvent("onreadystatechange", a = function () {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", a);
b()
}
})
},
_raiseInit: function () {
var a = this.get_events().getHandler("init");
if (a) {
this.beginCreateComponents();
a(this, Sys.EventArgs.Empty);
this.endCreateComponents()
}
},
_unloadHandler: function () {
this.dispose()
}
};
Sys._Application.registerClass("Sys._Application", Sys.Component, Sys.IContainer);
Sys.Application = new Sys._Application;
var $find = Sys.Application.findComponent;
Sys.UI.Behavior = function (b) {
Sys.UI.Behavior.initializeBase(this);
this._element = b;
var a = b._behaviors;
if (!a)b._behaviors = [this]; else a[a.length] = this
};
Sys.UI.Behavior.prototype = {
_name: null, get_element: function () {
return this._element
}, get_id: function () {
var a = Sys.UI.Behavior.callBaseMethod(this, "get_id");
if (a)return a;
if (!this._element || !this._element.id)return "";
return this._element.id + "$" + this.get_name()
}, get_name: function () {
if (this._name)return this._name;
var a = Object.getTypeName(this), b = a.lastIndexOf(".");
if (b !== -1)a = a.substr(b + 1);
if (!this.get_isInitialized())this._name = a;
return a
}, set_name: function (a) {
this._name = a
}, initialize: function () {
Sys.UI.Behavior.callBaseMethod(this, "initialize");
var a = this.get_name();
if (a)this._element[a] = this
}, dispose: function () {
Sys.UI.Behavior.callBaseMethod(this, "dispose");
var a = this._element;
if (a) {
var c = this.get_name();
if (c)a[c] = null;
var b = a._behaviors;
Array.remove(b, this);
if (b.length === 0)a._behaviors = null;
delete this._element
}
}
};
Sys.UI.Behavior.registerClass("Sys.UI.Behavior", Sys.Component);
Sys.UI.Behavior.getBehaviorByName = function (b, c) {
var a = b[c];
return a && Sys.UI.Behavior.isInstanceOfType(a) ? a : null
};
Sys.UI.Behavior.getBehaviors = function (a) {
if (!a._behaviors)return [];
return Array.clone(a._behaviors)
};
Sys.UI.Behavior.getBehaviorsByType = function (d, e) {
var a = d._behaviors, c = [];
if (a)for (var b = 0, f = a.length; b < f; b++)if (e.isInstanceOfType(a[b]))c[c.length] = a[b];
return c
};
Sys.UI.VisibilityMode = function () {
throw Error.notImplemented()
};
Sys.UI.VisibilityMode.prototype = {hide: 0, collapse: 1};
Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");
Sys.UI.Control = function (a) {
Sys.UI.Control.initializeBase(this);
this._element = a;
a.control = this;
var b = this.get_role();
if (b)a.setAttribute("role", b)
};
Sys.UI.Control.prototype = {
_parent: null, _visibilityMode: Sys.UI.VisibilityMode.hide, get_element: function () {
return this._element
}, get_id: function () {
if (!this._element)return "";
return this._element.id
}, set_id: function () {
throw Error.invalidOperation(Sys.Res.cantSetId)
}, get_parent: function () {
if (this._parent)return this._parent;
if (!this._element)return null;
var a = this._element.parentNode;
while (a) {
if (a.control)return a.control;
a = a.parentNode
}
return null
}, set_parent: function (a) {
this._parent = a
}, get_role: function () {
return null
}, get_visibilityMode: function () {
return Sys.UI.DomElement.getVisibilityMode(this._element)
}, set_visibilityMode: function (a) {
Sys.UI.DomElement.setVisibilityMode(this._element, a)
}, get_visible: function () {
return Sys.UI.DomElement.getVisible(this._element)
}, set_visible: function (a) {
Sys.UI.DomElement.setVisible(this._element, a)
}, addCssClass: function (a) {
Sys.UI.DomElement.addCssClass(this._element, a)
}, dispose: function () {
Sys.UI.Control.callBaseMethod(this, "dispose");
if (this._element) {
this._element.control = null;
delete this._element
}
if (this._parent)delete this._parent
}, onBubbleEvent: function () {
return false
}, raiseBubbleEvent: function (a, b) {
this._raiseBubbleEvent(a, b)
}, _raiseBubbleEvent: function (b, c) {
var a = this.get_parent();
while (a) {
if (a.onBubbleEvent(b, c))return;
a = a.get_parent()
}
}, removeCssClass: function (a) {
Sys.UI.DomElement.removeCssClass(this._element, a)
}, toggleCssClass: function (a) {
Sys.UI.DomElement.toggleCssClass(this._element, a)
}
};
Sys.UI.Control.registerClass("Sys.UI.Control", Sys.Component);
Sys.HistoryEventArgs = function (a) {
Sys.HistoryEventArgs.initializeBase(this);
this._state = a
};
Sys.HistoryEventArgs.prototype = {
get_state: function () {
return this._state
}
};
Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs", Sys.EventArgs);
Sys.Application._appLoadHandler = null;
Sys.Application._beginRequestHandler = null;
Sys.Application._clientId = null;
Sys.Application._currentEntry = "";
Sys.Application._endRequestHandler = null;
Sys.Application._history = null;
Sys.Application._enableHistory = false;
Sys.Application._historyFrame = null;
Sys.Application._historyInitialized = false;
Sys.Application._historyPointIsNew = false;
Sys.Application._ignoreTimer = false;
Sys.Application._initialState = null;
Sys.Application._state = {};
Sys.Application._timerCookie = 0;
Sys.Application._timerHandler = null;
Sys.Application._uniqueId = null;
Sys._Application.prototype.get_stateString = function () {
var a = null;
if (Sys.Browser.agent === Sys.Browser.Firefox) {
var c = window.location.href, b = c.indexOf("#");
if (b !== -1)a = c.substring(b + 1); else a = "";
return a
} else a = window.location.hash;
if (a.length > 0 && a.charAt(0) === "#")a = a.substring(1);
return a
};
Sys._Application.prototype.get_enableHistory = function () {
return this._enableHistory
};
Sys._Application.prototype.set_enableHistory = function (a) {
this._enableHistory = a
};
Sys._Application.prototype.add_navigate = function (a) {
this.get_events().addHandler("navigate", a)
};
Sys._Application.prototype.remove_navigate = function (a) {
this.get_events().removeHandler("navigate", a)
};
Sys._Application.prototype.addHistoryPoint = function (c, f) {
this._ensureHistory();
var b = this._state;
for (var a in c) {
var d = c[a];
if (d === null) {
if (typeof b[a] !== "undefined")delete b[a]
} else b[a] = d
}
var e = this._serializeState(b);
this._historyPointIsNew = true;
this._setState(e, f);
this._raiseNavigate()
};
Sys._Application.prototype.setServerId = function (a, b) {
this._clientId = a;
this._uniqueId = b
};
Sys._Application.prototype.setServerState = function (a) {
this._ensureHistory();
this._state.__s = a;
this._updateHiddenField(a)
};
Sys._Application.prototype._deserializeState = function (a) {
var e = {};
a = a || "";
var b = a.indexOf("&&");
if (b !== -1 && b + 2 < a.length) {
e.__s = a.substr(b + 2);
a = a.substr(0, b)
}
var g = a.split("&");
for (var f = 0, j = g.length; f < j; f++) {
var d = g[f], c = d.indexOf("=");
if (c !== -1 && c + 1 < d.length) {
var i = d.substr(0, c), h = d.substr(c + 1);
e[i] = decodeURIComponent(h)
}
}
return e
};
Sys._Application.prototype._enableHistoryInScriptManager = function () {
this._enableHistory = true
};
Sys._Application.prototype._ensureHistory = function () {
if (!this._historyInitialized && this._enableHistory) {
if (Sys.Browser.agent === Sys.Browser.InternetExplorer && (!document.documentMode || document.documentMode < 8)) {
this._historyFrame = document.getElementById("__historyFrame");
this._ignoreIFrame = true
}
this._timerHandler = Function.createDelegate(this, this._onIdle);
this._timerCookie = window.setTimeout(this._timerHandler, 100);
try {
this._initialState = this._deserializeState(this.get_stateString())
} catch (a) {
}
this._historyInitialized = true
}
};
Sys._Application.prototype._navigate = function (c) {
this._ensureHistory();
var b = this._deserializeState(c);
if (this._uniqueId) {
var d = this._state.__s || "", a = b.__s || "";
if (a !== d) {
this._updateHiddenField(a);
__doPostBack(this._uniqueId, a);
this._state = b;
return
}
}
this._setState(c);
this._state = b;
this._raiseNavigate()
};
Sys._Application.prototype._onIdle = function () {
delete this._timerCookie;
var a = this.get_stateString();
if (a !== this._currentEntry) {
if (!this._ignoreTimer) {
this._historyPointIsNew = false;
this._navigate(a)
}
} else this._ignoreTimer = false;
this._timerCookie = window.setTimeout(this._timerHandler, 100)
};
Sys._Application.prototype._onIFrameLoad = function (a) {
if (!document.documentMode || document.documentMode < 8) {
this._ensureHistory();
if (!this._ignoreIFrame) {
this._historyPointIsNew = false;
this._navigate(a)
}
this._ignoreIFrame = false
}
};
Sys._Application.prototype._onPageRequestManagerBeginRequest = function () {
this._ignoreTimer = true;
this._originalTitle = document.title
};
Sys._Application.prototype._onPageRequestManagerEndRequest = function (g, f) {
var d = f.get_dataItems()[this._clientId], c = this._originalTitle;
this._originalTitle = null;
var b = document.getElementById("__EVENTTARGET");
if (b && b.value === this._uniqueId)b.value = "";
if (typeof d !== "undefined") {
this.setServerState(d);
this._historyPointIsNew = true
} else this._ignoreTimer = false;
var a = this._serializeState(this._state);
if (a !== this._currentEntry) {
this._ignoreTimer = true;
if (typeof c === "string") {
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer || Sys.Browser.version > 7) {
var e = document.title;
document.title = c;
this._setState(a);
document.title = e
} else this._setState(a);
this._raiseNavigate()
} else {
this._setState(a);
this._raiseNavigate()
}
}
};
Sys._Application.prototype._raiseNavigate = function () {
var d = this._historyPointIsNew, c = this.get_events().getHandler("navigate"), b = {};
for (var a in this._state)if (a !== "__s")b[a] = this._state[a];
var e = new Sys.HistoryEventArgs(b);
if (c)c(this, e);
if (!d) {
var f;
try {
if (Sys.Browser.agent === Sys.Browser.Firefox && window.location.hash && (!window.frameElement || window.top.location.hash))Sys.Browser.version < 3.5 ? window.history.go(0) : (location.hash = this.get_stateString())
} catch (g) {
}
}
};
Sys._Application.prototype._serializeState = function (d) {
var b = [];
for (var a in d) {
var e = d[a];
if (a === "__s")var c = e; else b[b.length] = a + "=" + encodeURIComponent(e)
}
return b.join("&") + (c ? "&&" + c : "")
};
Sys._Application.prototype._setState = function (a, b) {
if (this._enableHistory) {
a = a || "";
if (a !== this._currentEntry) {
if (window.theForm) {
var d = window.theForm.action, e = d.indexOf("#");
window.theForm.action = (e !== -1 ? d.substring(0, e) : d) + "#" + a
}
if (this._historyFrame && this._historyPointIsNew) {
var f = document.createElement("div");
f.appendChild(document.createTextNode(b || document.title));
var g = f.innerHTML;
this._ignoreIFrame = true;
var c = this._historyFrame.contentWindow.document;
c.open("javascript:'<html></html>'");
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>");
c.close()
}
this._ignoreTimer = false;
this._currentEntry = a;
if (this._historyFrame || this._historyPointIsNew) {
var h = this.get_stateString();
if (a !== h) {
window.location.hash = a;
this._currentEntry = this.get_stateString();
if (typeof b !== "undefined" && b !== null)document.title = b
}
}
this._historyPointIsNew = false
}
}
};
Sys._Application.prototype._updateHiddenField = function (b) {
if (this._clientId) {
var a = document.getElementById(this._clientId);
if (a)a.value = b
}
};
if (!window.XMLHttpRequest)window.XMLHttpRequest = function () {
var b = ["Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP"];
for (var a = 0, c = b.length; a < c; a++)try {
return new ActiveXObject(b[a])
} catch (d) {
}
return null
};
Type.registerNamespace("Sys.Net");
Sys.Net.WebRequestExecutor = function () {
this._webRequest = null;
this._resultObject = null
};
Sys.Net.WebRequestExecutor.prototype = {
get_webRequest: function () {
return this._webRequest
}, _set_webRequest: function (a) {
this._webRequest = a
}, get_started: function () {
throw Error.notImplemented()
}, get_responseAvailable: function () {
throw Error.notImplemented()
}, get_timedOut: function () {
throw Error.notImplemented()
}, get_aborted: function () {
throw Error.notImplemented()
}, get_responseData: function () {
throw Error.notImplemented()
}, get_statusCode: function () {
throw Error.notImplemented()
}, get_statusText: function () {
throw Error.notImplemented()
}, get_xml: function () {
throw Error.notImplemented()
}, get_object: function () {
if (!this._resultObject)this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
return this._resultObject
}, executeRequest: function () {
throw Error.notImplemented()
}, abort: function () {
throw Error.notImplemented()
}, getResponseHeader: function () {
throw Error.notImplemented()
}, getAllResponseHeaders: function () {
throw Error.notImplemented()
}
};
Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");
Sys.Net.XMLDOM = function (d) {
if (!window.DOMParser) {
var c = ["Msxml2.DOMDocument.3.0", "Msxml2.DOMDocument"];
for (var b = 0, f = c.length; b < f; b++)try {
var a = new ActiveXObject(c[b]);
a.async = false;
a.loadXML(d);
a.setProperty("SelectionLanguage", "XPath");
return a
} catch (g) {
}
} else try {
var e = new window.DOMParser;
return e.parseFromString(d, "text/xml")
} catch (g) {
}
return null
};
Sys.Net.XMLHttpExecutor = function () {
Sys.Net.XMLHttpExecutor.initializeBase(this);
var a = this;
this._xmlHttpRequest = null;
this._webRequest = null;
this._responseAvailable = false;
this._timedOut = false;
this._timer = null;
this._aborted = false;
this._started = false;
this._onReadyStateChange = function () {
if (a._xmlHttpRequest.readyState === 4) {
try {
if (typeof a._xmlHttpRequest.status === "undefined")return
} catch (b) {
return
}
a._clearTimer();
a._responseAvailable = true;
try {
a._webRequest.completed(Sys.EventArgs.Empty)
} finally {
if (a._xmlHttpRequest != null) {
a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
a._xmlHttpRequest = null
}
}
}
};
this._clearTimer = function () {
if (a._timer != null) {
window.clearTimeout(a._timer);
a._timer = null
}
};
this._onTimeout = function () {
if (!a._responseAvailable) {
a._clearTimer();
a._timedOut = true;
a._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
a._xmlHttpRequest.abort();
a._webRequest.completed(Sys.EventArgs.Empty);
a._xmlHttpRequest = null
}
}
};
Sys.Net.XMLHttpExecutor.prototype = {
get_timedOut: function () {
return this._timedOut
}, get_started: function () {
return this._started
}, get_responseAvailable: function () {
return this._responseAvailable
}, get_aborted: function () {
return this._aborted
}, executeRequest: function () {
this._webRequest = this.get_webRequest();
var c = this._webRequest.get_body(), a = this._webRequest.get_headers();
this._xmlHttpRequest = new XMLHttpRequest;
this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
var e = this._webRequest.get_httpVerb();
this._xmlHttpRequest.open(e, this._webRequest.getResolvedUrl(), true);
this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
if (a)for (var b in a) {
var f = a[b];
if (typeof f !== "function")this._xmlHttpRequest.setRequestHeader(b, f)
}
if (e.toLowerCase() === "post") {
if (a === null || !a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
if (!c)c = ""
}
var d = this._webRequest.get_timeout();
if (d > 0)this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), d);
this._xmlHttpRequest.send(c);
this._started = true
}, getResponseHeader: function (b) {
var a;
try {
a = this._xmlHttpRequest.getResponseHeader(b)
} catch (c) {
}
if (!a)a = "";
return a
}, getAllResponseHeaders: function () {
return this._xmlHttpRequest.getAllResponseHeaders()
}, get_responseData: function () {
return this._xmlHttpRequest.responseText
}, get_statusCode: function () {
var a = 0;
try {
a = this._xmlHttpRequest.status
} catch (b) {
}
return a
}, get_statusText: function () {
return this._xmlHttpRequest.statusText
}, get_xml: function () {
var a = this._xmlHttpRequest.responseXML;
if (!a || !a.documentElement) {
a = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);
if (!a || !a.documentElement)return null
} else if (navigator.userAgent.indexOf("MSIE") !== -1 && typeof a.setProperty != "undefined")a.setProperty("SelectionLanguage", "XPath");
if (a.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && a.documentElement.tagName === "parsererror")return null;
if (a.documentElement.firstChild && a.documentElement.firstChild.tagName === "parsererror")return null;
return a
}, abort: function () {
if (this._aborted || this._responseAvailable || this._timedOut)return;
this._aborted = true;
this._clearTimer();
if (this._xmlHttpRequest && !this._responseAvailable) {
this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
this._xmlHttpRequest.abort();
this._xmlHttpRequest = null;
this._webRequest.completed(Sys.EventArgs.Empty)
}
}
};
Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor", Sys.Net.WebRequestExecutor);
Sys.Net._WebRequestManager = function () {
this._defaultTimeout = 0;
this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"
};
Sys.Net._WebRequestManager.prototype = {
add_invokingRequest: function (a) {
this._get_eventHandlerList().addHandler("invokingRequest", a)
}, remove_invokingRequest: function (a) {
this._get_eventHandlerList().removeHandler("invokingRequest", a)
}, add_completedRequest: function (a) {
this._get_eventHandlerList().addHandler("completedRequest", a)
}, remove_completedRequest: function (a) {
this._get_eventHandlerList().removeHandler("completedRequest", a)
}, _get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_defaultTimeout: function () {
return this._defaultTimeout
}, set_defaultTimeout: function (a) {
this._defaultTimeout = a
}, get_defaultExecutorType: function () {
return this._defaultExecutorType
}, set_defaultExecutorType: function (a) {
this._defaultExecutorType = a
}, executeRequest: function (webRequest) {
var executor = webRequest.get_executor();
if (!executor) {
var failed = false;
try {
var executorType = eval(this._defaultExecutorType);
executor = new executorType
} catch (a) {
failed = true
}
webRequest.set_executor(executor)
}
if (executor.get_aborted())return;
var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest), handler = this._get_eventHandlerList().getHandler("invokingRequest");
if (handler)handler(this, evArgs);
if (!evArgs.get_cancel())executor.executeRequest()
}
};
Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");
Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager;
Sys.Net.NetworkRequestEventArgs = function (a) {
Sys.Net.NetworkRequestEventArgs.initializeBase(this);
this._webRequest = a
};
Sys.Net.NetworkRequestEventArgs.prototype = {
get_webRequest: function () {
return this._webRequest
}
};
Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs", Sys.CancelEventArgs);
Sys.Net.WebRequest = function () {
this._url = "";
this._headers = {};
this._body = null;
this._userContext = null;
this._httpVerb = null;
this._executor = null;
this._invokeCalled = false;
this._timeout = 0
};
Sys.Net.WebRequest.prototype = {
add_completed: function (a) {
this._get_eventHandlerList().addHandler("completed", a)
}, remove_completed: function (a) {
this._get_eventHandlerList().removeHandler("completed", a)
}, completed: function (b) {
var a = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");
if (a)a(this._executor, b);
a = this._get_eventHandlerList().getHandler("completed");
if (a)a(this._executor, b)
}, _get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_url: function () {
return this._url
}, set_url: function (a) {
this._url = a
}, get_headers: function () {
return this._headers
}, get_httpVerb: function () {
if (this._httpVerb === null) {
if (this._body === null)return "GET";
return "POST"
}
return this._httpVerb
}, set_httpVerb: function (a) {
this._httpVerb = a
}, get_body: function () {
return this._body
}, set_body: function (a) {
this._body = a
}, get_userContext: function () {
return this._userContext
}, set_userContext: function (a) {
this._userContext = a
}, get_executor: function () {
return this._executor
}, set_executor: function (a) {
this._executor = a;
this._executor._set_webRequest(this)
}, get_timeout: function () {
if (this._timeout === 0)return Sys.Net.WebRequestManager.get_defaultTimeout();
return this._timeout
}, set_timeout: function (a) {
this._timeout = a
}, getResolvedUrl: function () {
return Sys.Net.WebRequest._resolveUrl(this._url)
}, invoke: function () {
Sys.Net.WebRequestManager.executeRequest(this);
this._invokeCalled = true
}
};
Sys.Net.WebRequest._resolveUrl = function (b, a) {
if (b && b.indexOf("://") !== -1)return b;
if (!a || a.length === 0) {
var d = document.getElementsByTagName("base")[0];
if (d && d.href && d.href.length > 0)a = d.href; else a = document.URL
}
var c = a.indexOf("?");
if (c !== -1)a = a.substr(0, c);
c = a.indexOf("#");
if (c !== -1)a = a.substr(0, c);
a = a.substr(0, a.lastIndexOf("/") + 1);
if (!b || b.length === 0)return a;
if (b.charAt(0) === "/") {
var e = a.indexOf("://"), g = a.indexOf("/", e + 3);
return a.substr(0, g) + b
} else {
var f = a.lastIndexOf("/");
return a.substr(0, f + 1) + b
}
};
Sys.Net.WebRequest._createQueryString = function (c, b, f) {
b = b || encodeURIComponent;
var h = 0, e, g, d, a = new Sys.StringBuilder;
if (c)for (d in c) {
e = c[d];
if (typeof e === "function")continue;
g = Sys.Serialization.JavaScriptSerializer.serialize(e);
if (h++)a.append("&");
a.append(d);
a.append("=");
a.append(b(g))
}
if (f) {
if (h)a.append("&");
a.append(f)
}
return a.toString()
};
Sys.Net.WebRequest._createUrl = function (a, b, c) {
if (!b && !c)return a;
var d = Sys.Net.WebRequest._createQueryString(b, null, c);
return d.length ? a + (a && a.indexOf("?") >= 0 ? "&" : "?") + d : a
};
Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");
Sys._ScriptLoaderTask = function (b, a) {
this._scriptElement = b;
this._completedCallback = a
};
Sys._ScriptLoaderTask.prototype = {
get_scriptElement: function () {
return this._scriptElement
}, dispose: function () {
if (this._disposed)return;
this._disposed = true;
this._removeScriptElementHandlers();
Sys._ScriptLoaderTask._clearScript(this._scriptElement);
this._scriptElement = null
}, execute: function () {
if (this._ensureReadyStateLoaded())this._executeInternal()
}, _executeInternal: function () {
this._addScriptElementHandlers();
document.getElementsByTagName("head")[0].appendChild(this._scriptElement)
}, _ensureReadyStateLoaded: function () {
if (this._useReadyState() && this._scriptElement.readyState !== "loaded" && this._scriptElement.readyState !== "complete") {
this._scriptDownloadDelegate = Function.createDelegate(this, this._executeInternal);
$addHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
return false
}
return true
}, _addScriptElementHandlers: function () {
if (this._scriptDownloadDelegate) {
$removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
this._scriptDownloadDelegate = null
}
this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler);
if (this._useReadyState())$addHandler(this._scriptElement, "readystatechange", this._scriptLoadDelegate); else $addHandler(this._scriptElement, "load", this._scriptLoadDelegate);
if (this._scriptElement.addEventListener) {
this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler);
this._scriptElement.addEventListener("error", this._scriptErrorDelegate, false)
}
}, _removeScriptElementHandlers: function () {
if (this._scriptLoadDelegate) {
var a = this.get_scriptElement();
if (this._scriptDownloadDelegate) {
$removeHandler(this._scriptElement, "readystatechange", this._scriptDownloadDelegate);
this._scriptDownloadDelegate = null
}
if (this._useReadyState() && this._scriptLoadDelegate)$removeHandler(a, "readystatechange", this._scriptLoadDelegate); else $removeHandler(a, "load", this._scriptLoadDelegate);
if (this._scriptErrorDelegate) {
this._scriptElement.removeEventListener("error", this._scriptErrorDelegate, false);
this._scriptErrorDelegate = null
}
this._scriptLoadDelegate = null
}
}, _scriptErrorHandler: function () {
if (this._disposed)return;
this._completedCallback(this.get_scriptElement(), false)
}, _scriptLoadHandler: function () {
if (this._disposed)return;
var a = this.get_scriptElement();
if (this._useReadyState() && a.readyState !== "complete")return;
this._completedCallback(a, true)
}, _useReadyState: function () {
return Sys.Browser.agent === Sys.Browser.InternetExplorer && (Sys.Browser.version < 9 || (document.documentMode || 0) < 9)
}
};
Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable);
Sys._ScriptLoaderTask._clearScript = function (a) {
if (!Sys.Debug.isDebug && a.parentNode)a.parentNode.removeChild(a)
};
Type.registerNamespace("Sys.Net");
Sys.Net.WebServiceProxy = function () {
};
Sys.Net.WebServiceProxy.prototype = {
get_timeout: function () {
return this._timeout || 0
}, set_timeout: function (a) {
if (a < 0)throw Error.argumentOutOfRange("value", a, Sys.Res.invalidTimeout);
this._timeout = a
}, get_defaultUserContext: function () {
return typeof this._userContext === "undefined" ? null : this._userContext
}, set_defaultUserContext: function (a) {
this._userContext = a
}, get_defaultSucceededCallback: function () {
return this._succeeded || null
}, set_defaultSucceededCallback: function (a) {
this._succeeded = a
}, get_defaultFailedCallback: function () {
return this._failed || null
}, set_defaultFailedCallback: function (a) {
this._failed = a
}, get_enableJsonp: function () {
return !!this._jsonp
}, set_enableJsonp: function (a) {
this._jsonp = a
}, get_path: function () {
return this._path || null
}, set_path: function (a) {
this._path = a
}, get_jsonpCallbackParameter: function () {
return this._callbackParameter || "callback"
}, set_jsonpCallbackParameter: function (a) {
this._callbackParameter = a
}, _invoke: function (d, e, g, f, c, b, a) {
c = c || this.get_defaultSucceededCallback();
b = b || this.get_defaultFailedCallback();
if (a === null || typeof a === "undefined")a = this.get_defaultUserContext();
return Sys.Net.WebServiceProxy.invoke(d, e, g, f, c, b, a, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter())
}
};
Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");
Sys.Net.WebServiceProxy.invoke = function (q, a, m, l, j, b, g, e, w, p) {
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);
m = n || m;
if (n) {
p = p || "callback";
c = "_jsonp" + Sys._jsonp++
}
if (!l)l = {};
var r = l;
if (!m || !r)r = {};
var s, h, f = null, k, o = null, u = Sys.Net.WebRequest._createUrl(a ? q + "/" + encodeURIComponent(a) : q, r, n ? p + "=Sys." + c : null);
if (n) {
s = document.createElement("script");
s.src = u;
k = new Sys._ScriptLoaderTask(s, function (d, b) {
if (!b || c)t({Message: String.format(Sys.Res.webServiceFailedNoMsg, a)}, -1)
});
function v() {
if (f === null)return;
f = null;
h = new Sys.Net.WebServiceError(true, String.format(Sys.Res.webServiceTimedOut, a));
k.dispose();
delete Sys[c];
if (b)b(h, g, a)
}
function t(d, e) {
if (f !== null) {
window.clearTimeout(f);
f = null
}
k.dispose();
delete Sys[c];
c = null;
if (typeof e !== "undefined" && e !== 200) {
if (b) {
h = new Sys.Net.WebServiceError(false, d.Message || String.format(Sys.Res.webServiceFailedNoMsg, a), d.StackTrace || null, d.ExceptionType || null, d);
h._statusCode = e;
b(h, g, a)
}
} else if (j)j(d, g, a)
}
Sys[c] = t;
e = e || Sys.Net.WebRequestManager.get_defaultTimeout();
if (e > 0)f = window.setTimeout(v, e);
k.execute();
return null
}
var d = new Sys.Net.WebRequest;
d.set_url(u);
d.get_headers()["Content-Type"] = "application/json; charset=utf-8";
if (!m) {
o = Sys.Serialization.JavaScriptSerializer.serialize(l);
if (o === "{}")o = ""
}
d.set_body(o);
d.add_completed(x);
if (e && e > 0)d.set_timeout(e);
d.invoke();
function x(d) {
if (d.get_responseAvailable()) {
var f = d.get_statusCode(), c = null;
try {
var e = d.getResponseHeader("Content-Type");
if (e.startsWith("application/json"))c = d.get_object(); else if (e.startsWith("text/xml"))c = d.get_xml(); else c = d.get_responseData()
} catch (m) {
}
var k = d.getResponseHeader("jsonerror"), h = k === "true";
if (h) {
if (c)c = new Sys.Net.WebServiceError(false, c.Message, c.StackTrace, c.ExceptionType, c)
} else if (e.startsWith("application/json"))c = !c || typeof c.d === "undefined" ? c : c.d;
if (f < 200 || f >= 300 || h) {
if (b) {
if (!c || !h)c = new Sys.Net.WebServiceError(false, String.format(Sys.Res.webServiceFailedNoMsg, a));
c._statusCode = f;
b(c, g, a)
}
} else if (j)j(c, g, a)
} else {
var i;
if (d.get_timedOut())i = String.format(Sys.Res.webServiceTimedOut, a); else i = String.format(Sys.Res.webServiceFailedNoMsg, a);
if (b)b(new Sys.Net.WebServiceError(d.get_timedOut(), i, "", ""), g, a)
}
}
return d
};
Sys.Net.WebServiceProxy._generateTypedConstructor = function (a) {
return function (b) {
if (b)for (var c in b)this[c] = b[c];
this.__type = a
}
};
Sys._jsonp = 0;
Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
Sys.Net.WebServiceError = function (d, e, c, a, b) {
this._timedOut = d;
this._message = e;
this._stackTrace = c;
this._exceptionType = a;
this._errorObject = b;
this._statusCode = -1
};
Sys.Net.WebServiceError.prototype = {
get_timedOut: function () {
return this._timedOut
}, get_statusCode: function () {
return this._statusCode
}, get_message: function () {
return this._message
}, get_stackTrace: function () {
return this._stackTrace || ""
}, get_exceptionType: function () {
return this._exceptionType || ""
}, get_errorObject: function () {
return this._errorObject || null
}
};
Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");
Type.registerNamespace('Sys');
Sys.Res = {
"argumentInteger": "Value must be an integer.",
"invokeCalledTwice": "Cannot call invoke more than once.",
"webServiceFailed": "The server method \u0027{0}\u0027 failed with the following error: {1}",
"argumentType": "Object cannot be converted to the required type.",
"argumentNull": "Value cannot be null.",
"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.",
"scriptDependencyNotFound": "The script \u0027{0}\u0027 failed to load because it is dependent on script \u0027{1}\u0027.",
"formatBadFormatSpecifier": "Format specifier was invalid.",
"requiredScriptReferenceNotIncluded": "\u0027{0}\u0027 requires that you have included a script reference to \u0027{1}\u0027.",
"webServiceFailedNoMsg": "The server method \u0027{0}\u0027 failed.",
"argumentDomElement": "Value must be a DOM element.",
"invalidExecutorType": "Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",
"cannotCallBeforeResponse": "Cannot call {0} when responseAvailable is false.",
"actualValue": "Actual value was {0}.",
"enumInvalidValue": "\u0027{0}\u0027 is not a valid value for enum {1}.",
"scriptLoadFailed": "The script \u0027{0}\u0027 could not be loaded.",
"parameterCount": "Parameter count mismatch.",
"cannotDeserializeEmptyString": "Cannot deserialize empty string.",
"formatInvalidString": "Input string was not in a correct format.",
"invalidTimeout": "Value must be greater than or equal to zero.",
"cannotAbortBeforeStart": "Cannot abort when executor has not started.",
"argument": "Value does not fall within the expected range.",
"cannotDeserializeInvalidJson": "Cannot deserialize. The data does not correspond to valid JSON.",
"invalidHttpVerb": "httpVerb cannot be set to an empty or null string.",
"nullWebRequest": "Cannot call executeRequest with a null webRequest.",
"eventHandlerInvalid": "Handler was not added through the Sys.UI.DomEvent.addHandler method.",
"cannotSerializeNonFiniteNumbers": "Cannot serialize non finite numbers.",
"argumentUndefined": "Value cannot be undefined.",
"webServiceInvalidReturnType": "The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}",
"servicePathNotSet": "The path to the web service has not been set.",
"argumentTypeWithTypes": "Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.",
"cannotCallOnceStarted": "Cannot call {0} once started.",
"badBaseUrl1": "Base URL does not contain ://.",
"badBaseUrl2": "Base URL does not contain another /.",
"badBaseUrl3": "Cannot find last / in base URL.",
"setExecutorAfterActive": "Cannot set executor after it has become active.",
"paramName": "Parameter name: {0}",
"nullReferenceInPath": "Null reference while evaluating data path: \u0027{0}\u0027.",
"cannotCallOutsideHandler": "Cannot call {0} outside of a completed event handler.",
"cannotSerializeObjectWithCycle": "Cannot serialize object with cyclic reference within child properties.",
"format": "One of the identified items was in an invalid format.",
"assertFailedCaller": "Assertion Failed: {0}\r\nat {1}",
"argumentOutOfRange": "Specified argument was out of the range of valid values.",
"webServiceTimedOut": "The server method \u0027{0}\u0027 timed out.",
"notImplemented": "The method or operation is not implemented.",
"assertFailed": "Assertion Failed: {0}",
"invalidOperation": "Operation is not valid due to the current state of the object.",
"breakIntoDebugger": "{0}\r\n\r\nBreak into debugger?"
};
/* END MicrosoftAjax.js */
/* START MicrosoftAjaxWebForms.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjaxWebForms.js
Type._registerScript("MicrosoftAjaxWebForms.js", ["MicrosoftAjaxCore.js", "MicrosoftAjaxSerialization.js", "MicrosoftAjaxNetwork.js", "MicrosoftAjaxComponentModel.js"]);
Type.registerNamespace("Sys.WebForms");
Sys.WebForms.BeginRequestEventArgs = function (c, b, a) {
Sys.WebForms.BeginRequestEventArgs.initializeBase(this);
this._request = c;
this._postBackElement = b;
this._updatePanelsToUpdate = a
};
Sys.WebForms.BeginRequestEventArgs.prototype = {
get_postBackElement: function () {
return this._postBackElement
}, get_request: function () {
return this._request
}, get_updatePanelsToUpdate: function () {
return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
}
};
Sys.WebForms.BeginRequestEventArgs.registerClass("Sys.WebForms.BeginRequestEventArgs", Sys.EventArgs);
Sys.WebForms.EndRequestEventArgs = function (c, a, b) {
Sys.WebForms.EndRequestEventArgs.initializeBase(this);
this._errorHandled = false;
this._error = c;
this._dataItems = a || {};
this._response = b
};
Sys.WebForms.EndRequestEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_error: function () {
return this._error
}, get_errorHandled: function () {
return this._errorHandled
}, set_errorHandled: function (a) {
this._errorHandled = a
}, get_response: function () {
return this._response
}
};
Sys.WebForms.EndRequestEventArgs.registerClass("Sys.WebForms.EndRequestEventArgs", Sys.EventArgs);
Sys.WebForms.InitializeRequestEventArgs = function (c, b, a) {
Sys.WebForms.InitializeRequestEventArgs.initializeBase(this);
this._request = c;
this._postBackElement = b;
this._updatePanelsToUpdate = a
};
Sys.WebForms.InitializeRequestEventArgs.prototype = {
get_postBackElement: function () {
return this._postBackElement
}, get_request: function () {
return this._request
}, get_updatePanelsToUpdate: function () {
return this._updatePanelsToUpdate ? Array.clone(this._updatePanelsToUpdate) : []
}, set_updatePanelsToUpdate: function (a) {
this._updated = true;
this._updatePanelsToUpdate = a
}
};
Sys.WebForms.InitializeRequestEventArgs.registerClass("Sys.WebForms.InitializeRequestEventArgs", Sys.CancelEventArgs);
Sys.WebForms.PageLoadedEventArgs = function (b, a, c) {
Sys.WebForms.PageLoadedEventArgs.initializeBase(this);
this._panelsUpdated = b;
this._panelsCreated = a;
this._dataItems = c || {}
};
Sys.WebForms.PageLoadedEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_panelsCreated: function () {
return this._panelsCreated
}, get_panelsUpdated: function () {
return this._panelsUpdated
}
};
Sys.WebForms.PageLoadedEventArgs.registerClass("Sys.WebForms.PageLoadedEventArgs", Sys.EventArgs);
Sys.WebForms.PageLoadingEventArgs = function (b, a, c) {
Sys.WebForms.PageLoadingEventArgs.initializeBase(this);
this._panelsUpdating = b;
this._panelsDeleting = a;
this._dataItems = c || {}
};
Sys.WebForms.PageLoadingEventArgs.prototype = {
get_dataItems: function () {
return this._dataItems
}, get_panelsDeleting: function () {
return this._panelsDeleting
}, get_panelsUpdating: function () {
return this._panelsUpdating
}
};
Sys.WebForms.PageLoadingEventArgs.registerClass("Sys.WebForms.PageLoadingEventArgs", Sys.EventArgs);
Sys._ScriptLoader = function () {
this._scriptsToLoad = null;
this._sessions = [];
this._scriptLoadedDelegate = Function.createDelegate(this, this._scriptLoadedHandler)
};
Sys._ScriptLoader.prototype = {
dispose: function () {
this._stopSession();
this._loading = false;
if (this._events)delete this._events;
this._sessions = null;
this._currentSession = null;
this._scriptLoadedDelegate = null
}, loadScripts: function (d, b, c, a) {
var e = {
allScriptsLoadedCallback: b,
scriptLoadFailedCallback: c,
scriptLoadTimeoutCallback: a,
scriptsToLoad: this._scriptsToLoad,
scriptTimeout: d
};
this._scriptsToLoad = null;
this._sessions[this._sessions.length] = e;
if (!this._loading)this._nextSession()
}, queueCustomScriptTag: function (a) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, a)
}, queueScriptBlock: function (a) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, {text: a})
}, queueScriptReference: function (a, b) {
if (!this._scriptsToLoad)this._scriptsToLoad = [];
Array.add(this._scriptsToLoad, {src: a, fallback: b})
}, _createScriptElement: function (c) {
var a = document.createElement("script");
a.type = "text/javascript";
for (var b in c)a[b] = c[b];
return a
}, _loadScriptsInternal: function () {
var c = this._currentSession;
if (c.scriptsToLoad && c.scriptsToLoad.length > 0) {
var b = Array.dequeue(c.scriptsToLoad), f = this._scriptLoadedDelegate;
if (b.fallback) {
var g = b.fallback;
delete b.fallback;
var d = this;
f = function (b, a) {
a || function () {
var a = d._createScriptElement({src: g});
d._currentTask = new Sys._ScriptLoaderTask(a, d._scriptLoadedDelegate);
d._currentTask.execute()
}()
}
}
var a = this._createScriptElement(b);
if (a.text && Sys.Browser.agent === Sys.Browser.Safari) {
a.innerHTML = a.text;
delete a.text
}
if (typeof b.src === "string") {
this._currentTask = new Sys._ScriptLoaderTask(a, f);
this._currentTask.execute()
} else {
document.getElementsByTagName("head")[0].appendChild(a);
Sys._ScriptLoaderTask._clearScript(a);
this._loadScriptsInternal()
}
} else {
this._stopSession();
var e = c.allScriptsLoadedCallback;
if (e)e(this);
this._nextSession()
}
}, _nextSession: function () {
if (this._sessions.length === 0) {
this._loading = false;
this._currentSession = null;
return
}
this._loading = true;
var a = Array.dequeue(this._sessions);
this._currentSession = a;
if (a.scriptTimeout > 0)this._timeoutCookie = window.setTimeout(Function.createDelegate(this, this._scriptLoadTimeoutHandler), a.scriptTimeout * 1000);
this._loadScriptsInternal()
}, _raiseError: function () {
var b = this._currentSession.scriptLoadFailedCallback, a = this._currentTask.get_scriptElement();
this._stopSession();
if (b) {
b(this, a);
this._nextSession()
} else {
this._loading = false;
throw Sys._ScriptLoader._errorScriptLoadFailed(a.src)
}
}, _scriptLoadedHandler: function (a, b) {
if (b) {
Array.add(Sys._ScriptLoader._getLoadedScripts(), a.src);
this._currentTask.dispose();
this._currentTask = null;
this._loadScriptsInternal()
} else this._raiseError()
}, _scriptLoadTimeoutHandler: function () {
var a = this._currentSession.scriptLoadTimeoutCallback;
this._stopSession();
if (a)a(this);
this._nextSession()
}, _stopSession: function () {
if (this._timeoutCookie) {
window.clearTimeout(this._timeoutCookie);
this._timeoutCookie = null
}
if (this._currentTask) {
this._currentTask.dispose();
this._currentTask = null
}
}
};
Sys._ScriptLoader.registerClass("Sys._ScriptLoader", null, Sys.IDisposable);
Sys._ScriptLoader.getInstance = function () {
var a = Sys._ScriptLoader._activeInstance;
if (!a)a = Sys._ScriptLoader._activeInstance = new Sys._ScriptLoader;
return a
};
Sys._ScriptLoader.isScriptLoaded = function (b) {
var a = document.createElement("script");
a.src = b;
return Array.contains(Sys._ScriptLoader._getLoadedScripts(), a.src)
};
Sys._ScriptLoader.readLoadedScripts = function () {
if (!Sys._ScriptLoader._referencedScripts) {
var c = Sys._ScriptLoader._referencedScripts = [], d = document.getElementsByTagName("script");
for (var b = d.length - 1; b >= 0; b--) {
var e = d[b], a = e.src;
if (a.length)if (!Array.contains(c, a))Array.add(c, a)
}
}
};
Sys._ScriptLoader._errorScriptLoadFailed = function (b) {
var a;
a = Sys.Res.scriptLoadFailed;
var d = "Sys.ScriptLoadFailedException: " + String.format(a, b), c = Error.create(d, {
name: "Sys.ScriptLoadFailedException",
"scriptUrl": b
});
c.popStackFrame();
return c
};
Sys._ScriptLoader._getLoadedScripts = function () {
if (!Sys._ScriptLoader._referencedScripts) {
Sys._ScriptLoader._referencedScripts = [];
Sys._ScriptLoader.readLoadedScripts()
}
return Sys._ScriptLoader._referencedScripts
};
Sys.WebForms.PageRequestManager = function () {
this._form = null;
this._activeDefaultButton = null;
this._activeDefaultButtonClicked = false;
this._updatePanelIDs = null;
this._updatePanelClientIDs = null;
this._updatePanelHasChildrenAsTriggers = null;
this._asyncPostBackControlIDs = null;
this._asyncPostBackControlClientIDs = null;
this._postBackControlIDs = null;
this._postBackControlClientIDs = null;
this._scriptManagerID = null;
this._pageLoadedHandler = null;
this._additionalInput = null;
this._onsubmit = null;
this._onSubmitStatements = [];
this._originalDoPostBack = null;
this._originalDoPostBackWithOptions = null;
this._originalFireDefaultButton = null;
this._originalDoCallback = null;
this._isCrossPost = false;
this._postBackSettings = null;
this._request = null;
this._onFormSubmitHandler = null;
this._onFormElementClickHandler = null;
this._onWindowUnloadHandler = null;
this._asyncPostBackTimeout = null;
this._controlIDToFocus = null;
this._scrollPosition = null;
this._processingRequest = false;
this._scriptDisposes = {};
this._transientFields = ["__VIEWSTATEENCRYPTED", "__VIEWSTATEFIELDCOUNT"];
this._textTypes = /^(text|password|hidden|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i
};
Sys.WebForms.PageRequestManager.prototype = {
_get_eventHandlerList: function () {
if (!this._events)this._events = new Sys.EventHandlerList;
return this._events
}, get_isInAsyncPostBack: function () {
return this._request !== null
}, add_beginRequest: function (a) {
this._get_eventHandlerList().addHandler("beginRequest", a)
}, remove_beginRequest: function (a) {
this._get_eventHandlerList().removeHandler("beginRequest", a)
}, add_endRequest: function (a) {
this._get_eventHandlerList().addHandler("endRequest", a)
}, remove_endRequest: function (a) {
this._get_eventHandlerList().removeHandler("endRequest", a)
}, add_initializeRequest: function (a) {
this._get_eventHandlerList().addHandler("initializeRequest", a)
}, remove_initializeRequest: function (a) {
this._get_eventHandlerList().removeHandler("initializeRequest", a)
}, add_pageLoaded: function (a) {
this._get_eventHandlerList().addHandler("pageLoaded", a)
}, remove_pageLoaded: function (a) {
this._get_eventHandlerList().removeHandler("pageLoaded", a)
}, add_pageLoading: function (a) {
this._get_eventHandlerList().addHandler("pageLoading", a)
}, remove_pageLoading: function (a) {
this._get_eventHandlerList().removeHandler("pageLoading", a)
}, abortPostBack: function () {
if (!this._processingRequest && this._request) {
this._request.get_executor().abort();
this._request = null
}
}, beginAsyncPostBack: function (c, a, f, d, e) {
if (d && typeof Page_ClientValidate === "function" && !Page_ClientValidate(e || null))return;
this._postBackSettings = this._createPostBackSettings(true, c, a);
var b = this._form;
b.__EVENTTARGET.value = a || "";
b.__EVENTARGUMENT.value = f || "";
this._isCrossPost = false;
this._additionalInput = null;
this._onFormSubmit()
}, _cancelPendingCallbacks: function () {
for (var a = 0, e = window.__pendingCallbacks.length; a < e; a++) {
var c = window.__pendingCallbacks[a];
if (c) {
if (!c.async)window.__synchronousCallBackIndex = -1;
window.__pendingCallbacks[a] = null;
var d = "__CALLBACKFRAME" + a, b = document.getElementById(d);
if (b)b.parentNode.removeChild(b)
}
}
}, _commitControls: function (a, b) {
if (a) {
this._updatePanelIDs = a.updatePanelIDs;
this._updatePanelClientIDs = a.updatePanelClientIDs;
this._updatePanelHasChildrenAsTriggers = a.updatePanelHasChildrenAsTriggers;
this._asyncPostBackControlIDs = a.asyncPostBackControlIDs;
this._asyncPostBackControlClientIDs = a.asyncPostBackControlClientIDs;
this._postBackControlIDs = a.postBackControlIDs;
this._postBackControlClientIDs = a.postBackControlClientIDs
}
if (typeof b !== "undefined" && b !== null)this._asyncPostBackTimeout = b * 1000
}, _createHiddenField: function (c, d) {
var b, a = document.getElementById(c);
if (a)if (!a._isContained)a.parentNode.removeChild(a); else b = a.parentNode;
if (!b) {
b = document.createElement("span");
b.style.cssText = "display:none !important";
this._form.appendChild(b)
}
b.innerHTML = "<input type='hidden' />";
a = b.childNodes[0];
a._isContained = true;
a.id = a.name = c;
a.value = d
}, _createPageRequestManagerTimeoutError: function () {
var b = "Sys.WebForms.PageRequestManagerTimeoutException: " + Sys.WebForms.Res.PRM_TimeoutError, a = Error.create(b, {name: "Sys.WebForms.PageRequestManagerTimeoutException"});
a.popStackFrame();
return a
}, _createPageRequestManagerServerError: function (a, d) {
var c = "Sys.WebForms.PageRequestManagerServerErrorException: " + (d || String.format(Sys.WebForms.Res.PRM_ServerError, a)), b = Error.create(c, {
name: "Sys.WebForms.PageRequestManagerServerErrorException",
httpStatusCode: a
});
b.popStackFrame();
return b
}, _createPageRequestManagerParserError: function (b) {
var c = "Sys.WebForms.PageRequestManagerParserErrorException: " + String.format(Sys.WebForms.Res.PRM_ParserError, b), a = Error.create(c, {name: "Sys.WebForms.PageRequestManagerParserErrorException"});
a.popStackFrame();
return a
}, _createPanelID: function (e, b) {
var c = b.asyncTarget, a = this._ensureUniqueIds(e || b.panelsToUpdate), d = a instanceof Array ? a.join(",") : a || this._scriptManagerID;
if (c)d += "|" + c;
return encodeURIComponent(this._scriptManagerID) + "=" + encodeURIComponent(d) + "&"
}, _createPostBackSettings: function (d, a, c, b) {
return {async: d, asyncTarget: c, panelsToUpdate: a, sourceElement: b}
}, _convertToClientIDs: function (a, f, e, d) {
if (a)for (var b = 0, h = a.length; b < h; b += d ? 2 : 1) {
var c = a[b], g = (d ? a[b + 1] : "") || this._uniqueIDToClientID(c);
Array.add(f, c);
Array.add(e, g)
}
}, dispose: function () {
if (this._form) {
Sys.UI.DomEvent.removeHandler(this._form, "submit", this._onFormSubmitHandler);
Sys.UI.DomEvent.removeHandler(this._form, "click", this._onFormElementClickHandler);
Sys.UI.DomEvent.removeHandler(window, "unload", this._onWindowUnloadHandler);
Sys.UI.DomEvent.removeHandler(window, "load", this._pageLoadedHandler)
}
if (this._originalDoPostBack) {
window.__doPostBack = this._originalDoPostBack;
this._originalDoPostBack = null
}
if (this._originalDoPostBackWithOptions) {
window.WebForm_DoPostBackWithOptions = this._originalDoPostBackWithOptions;
this._originalDoPostBackWithOptions = null
}
if (this._originalFireDefaultButton) {
window.WebForm_FireDefaultButton = this._originalFireDefaultButton;
this._originalFireDefaultButton = null
}
if (this._originalDoCallback) {
window.WebForm_DoCallback = this._originalDoCallback;
this._originalDoCallback = null
}
this._form = null;
this._updatePanelIDs = null;
this._updatePanelClientIDs = null;
this._asyncPostBackControlIDs = null;
this._asyncPostBackControlClientIDs = null;
this._postBackControlIDs = null;
this._postBackControlClientIDs = null;
this._asyncPostBackTimeout = null;
this._scrollPosition = null;
this._activeElement = null
}, _doCallback: function (d, b, c, f, a, e) {
if (!this.get_isInAsyncPostBack())this._originalDoCallback(d, b, c, f, a, e)
}, _doPostBack: function (a, k) {
var f = window.event;
if (!f) {
var d = arguments.callee ? arguments.callee.caller : null;
if (d) {
var j = 30;
while (d.arguments.callee.caller && --j)d = d.arguments.callee.caller;
f = j && d.arguments.length ? d.arguments[0] : null
}
}
this._additionalInput = null;
var h = this._form;
if (a === null || typeof a === "undefined" || this._isCrossPost) {
this._postBackSettings = this._createPostBackSettings(false);
this._isCrossPost = false
} else {
var c = this._masterPageUniqueID, l = this._uniqueIDToClientID(a), g = document.getElementById(l);
if (!g && c)if (a.indexOf(c + "$") === 0)g = document.getElementById(l.substr(c.length + 1));
if (!g)if (Array.contains(this._asyncPostBackControlIDs, a))this._postBackSettings = this._createPostBackSettings(true, null, a); else if (Array.contains(this._postBackControlIDs, a))this._postBackSettings = this._createPostBackSettings(false); else {
var e = this._findNearestElement(a);
if (e)this._postBackSettings = this._getPostBackSettings(e, a); else {
if (c) {
c += "$";
if (a.indexOf(c) === 0)e = this._findNearestElement(a.substr(c.length))
}
if (e)this._postBackSettings = this._getPostBackSettings(e, a); else {
var b;
try {
b = f ? f.target || f.srcElement : null
} catch (n) {
}
b = b || this._activeElement;
var m = /__doPostBack\(|WebForm_DoPostBackWithOptions\(/;
function i(b) {
b = b ? b.toString() : "";
return m.test(b) && b.indexOf("'" + a + "'") !== -1 || b.indexOf('"' + a + '"') !== -1
}
if (b && (b.name === a || i(b.href) || i(b.onclick) || i(b.onchange)))this._postBackSettings = this._getPostBackSettings(b, a); else this._postBackSettings = this._createPostBackSettings(false)
}
}
} else this._postBackSettings = this._getPostBackSettings(g, a)
}
if (!this._postBackSettings.async) {
h.onsubmit = this._onsubmit;
this._originalDoPostBack(a, k);
h.onsubmit = null;
return
}
h.__EVENTTARGET.value = a;
h.__EVENTARGUMENT.value = k;
this._onFormSubmit()
}, _doPostBackWithOptions: function (a) {
this._isCrossPost = a && a.actionUrl;
var d = true;
if (a.validation)if (typeof Page_ClientValidate == "function")d = Page_ClientValidate(a.validationGroup);
if (d) {
if (typeof a.actionUrl != "undefined" && a.actionUrl != null && a.actionUrl.length > 0)theForm.action = a.actionUrl;
if (a.trackFocus) {
var c = theForm.elements["__LASTFOCUS"];
if (typeof c != "undefined" && c != null)if (typeof document.activeElement == "undefined")c.value = a.eventTarget; else {
var b = document.activeElement;
if (typeof b != "undefined" && b != null)if (typeof b.id != "undefined" && b.id != null && b.id.length > 0)c.value = b.id; else if (typeof b.name != "undefined")c.value = b.name
}
}
}
if (a.clientSubmit)this._doPostBack(a.eventTarget, a.eventArgument)
}, _elementContains: function (b, a) {
while (a) {
if (a === b)return true;
a = a.parentNode
}
return false
}, _endPostBack: function (a, d, f) {
if (this._request === d.get_webRequest()) {
this._processingRequest = false;
this._additionalInput = null;
this._request = null
}
var e = this._get_eventHandlerList().getHandler("endRequest"), b = false;
if (e) {
var c = new Sys.WebForms.EndRequestEventArgs(a, f ? f.dataItems : {}, d);
e(this, c);
b = c.get_errorHandled()
}
if (a && !b)throw a
}, _ensureUniqueIds: function (a) {
if (!a)return a;
a = a instanceof Array ? a : [a];
var c = [];
for (var b = 0, f = a.length; b < f; b++) {
var e = a[b], d = Array.indexOf(this._updatePanelClientIDs, e);
c.push(d > -1 ? this._updatePanelIDs[d] : e)
}
return c
}, _findNearestElement: function (a) {
while (a.length > 0) {
var d = this._uniqueIDToClientID(a), c = document.getElementById(d);
if (c)return c;
var b = a.lastIndexOf("$");
if (b === -1)return null;
a = a.substring(0, b)
}
return null
}, _findText: function (b, a) {
var c = Math.max(0, a - 20), d = Math.min(b.length, a + 20);
return b.substring(c, d)
}, _fireDefaultButton: function (a, d) {
if (a.keyCode === 13) {
var c = a.srcElement || a.target;
if (!c || c.tagName.toLowerCase() !== "textarea") {
var b = document.getElementById(d);
if (b && typeof b.click !== "undefined") {
this._activeDefaultButton = b;
this._activeDefaultButtonClicked = false;
try {
b.click()
} finally {
this._activeDefaultButton = null
}
a.cancelBubble = true;
if (typeof a.stopPropagation === "function")a.stopPropagation();
return false
}
}
}
return true
}, _getPageLoadedEventArgs: function (n, c) {
var m = [], l = [], k = c ? c.version4 : false, d = c ? c.updatePanelData : null, e, g, h, b;
if (!d) {
e = this._updatePanelIDs;
g = this._updatePanelClientIDs;
h = null;
b = null
} else {
e = d.updatePanelIDs;
g = d.updatePanelClientIDs;
h = d.childUpdatePanelIDs;
b = d.panelsToRefreshIDs
}
var a, f, j, i;
if (b)for (a = 0, f = b.length; a < f; a += k ? 2 : 1) {
j = b[a];
i = (k ? b[a + 1] : "") || this._uniqueIDToClientID(j);
Array.add(m, document.getElementById(i))
}
for (a = 0, f = e.length; a < f; a++)if (n || Array.indexOf(h, e[a]) !== -1)Array.add(l, document.getElementById(g[a]));
return new Sys.WebForms.PageLoadedEventArgs(m, l, c ? c.dataItems : {})
}, _getPageLoadingEventArgs: function (f) {
var j = [], i = [], c = f.updatePanelData, k = c.oldUpdatePanelIDs, l = c.oldUpdatePanelClientIDs, n = c.updatePanelIDs, m = c.childUpdatePanelIDs, d = c.panelsToRefreshIDs, a, e, b, g, h = f.version4;
for (a = 0, e = d.length; a < e; a += h ? 2 : 1) {
b = d[a];
g = (h ? d[a + 1] : "") || this._uniqueIDToClientID(b);
Array.add(j, document.getElementById(g))
}
for (a = 0, e = k.length; a < e; a++) {
b = k[a];
if (Array.indexOf(d, b) === -1 && (Array.indexOf(n, b) === -1 || Array.indexOf(m, b) > -1))Array.add(i, document.getElementById(l[a]))
}
return new Sys.WebForms.PageLoadingEventArgs(j, i, f.dataItems)
}, _getPostBackSettings: function (a, c) {
var d = a, b = null;
while (a) {
if (a.id) {
if (!b && Array.contains(this._asyncPostBackControlClientIDs, a.id))b = this._createPostBackSettings(true, null, c, d); else if (!b && Array.contains(this._postBackControlClientIDs, a.id))return this._createPostBackSettings(false); else {
var e = Array.indexOf(this._updatePanelClientIDs, a.id);
if (e !== -1)if (this._updatePanelHasChildrenAsTriggers[e])return this._createPostBackSettings(true, [this._updatePanelIDs[e]], c, d); else return this._createPostBackSettings(true, null, c, d)
}
if (!b && this._matchesParentIDInList(a.id, this._asyncPostBackControlClientIDs))b = this._createPostBackSettings(true, null, c, d); else if (!b && this._matchesParentIDInList(a.id, this._postBackControlClientIDs))return this._createPostBackSettings(false)
}
a = a.parentNode
}
if (!b)return this._createPostBackSettings(false); else return b
}, _getScrollPosition: function () {
var a = document.documentElement;
if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))return {
x: a.scrollLeft,
y: a.scrollTop
}; else {
a = document.body;
if (a && (this._validPosition(a.scrollLeft) || this._validPosition(a.scrollTop)))return {
x: a.scrollLeft,
y: a.scrollTop
}; else if (this._validPosition(window.pageXOffset) || this._validPosition(window.pageYOffset))return {
x: window.pageXOffset,
y: window.pageYOffset
}; else return {x: 0, y: 0}
}
}, _initializeInternal: function (f, g, a, b, e, c, d) {
if (this._prmInitialized)throw Error.invalidOperation(Sys.WebForms.Res.PRM_CannotRegisterTwice);
this._prmInitialized = true;
this._masterPageUniqueID = d;
this._scriptManagerID = f;
this._form = Sys.UI.DomElement.resolveElement(g);
this._onsubmit = this._form.onsubmit;
this._form.onsubmit = null;
this._onFormSubmitHandler = Function.createDelegate(this, this._onFormSubmit);
this._onFormElementClickHandler = Function.createDelegate(this, this._onFormElementClick);
this._onWindowUnloadHandler = Function.createDelegate(this, this._onWindowUnload);
Sys.UI.DomEvent.addHandler(this._form, "submit", this._onFormSubmitHandler);
Sys.UI.DomEvent.addHandler(this._form, "click", this._onFormElementClickHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._onWindowUnloadHandler);
this._originalDoPostBack = window.__doPostBack;
if (this._originalDoPostBack)window.__doPostBack = Function.createDelegate(this, this._doPostBack);
this._originalDoPostBackWithOptions = window.WebForm_DoPostBackWithOptions;
if (this._originalDoPostBackWithOptions)window.WebForm_DoPostBackWithOptions = Function.createDelegate(this, this._doPostBackWithOptions);
this._originalFireDefaultButton = window.WebForm_FireDefaultButton;
if (this._originalFireDefaultButton)window.WebForm_FireDefaultButton = Function.createDelegate(this, this._fireDefaultButton);
this._originalDoCallback = window.WebForm_DoCallback;
if (this._originalDoCallback)window.WebForm_DoCallback = Function.createDelegate(this, this._doCallback);
this._pageLoadedHandler = Function.createDelegate(this, this._pageLoadedInitialLoad);
Sys.UI.DomEvent.addHandler(window, "load", this._pageLoadedHandler);
if (a)this._updateControls(a, b, e, c, true)
}, _matchesParentIDInList: function (c, b) {
for (var a = 0, d = b.length; a < d; a++)if (c.startsWith(b[a] + "_"))return true;
return false
}, _onFormElementActive: function (a, d, e) {
if (a.disabled)return;
this._activeElement = a;
this._postBackSettings = this._getPostBackSettings(a, a.name);
if (a.name) {
var b = a.tagName.toUpperCase();
if (b === "INPUT") {
var c = a.type;
if (c === "submit")this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value); else if (c === "image")this._additionalInput = encodeURIComponent(a.name) + ".x=" + d + "&" + encodeURIComponent(a.name) + ".y=" + e
} else if (b === "BUTTON" && a.name.length !== 0 && a.type === "submit")this._additionalInput = encodeURIComponent(a.name) + "=" + encodeURIComponent(a.value)
}
}, _onFormElementClick: function (a) {
this._activeDefaultButtonClicked = a.target === this._activeDefaultButton;
this._onFormElementActive(a.target, a.offsetX, a.offsetY)
}, _onFormSubmit: function (i) {
var f, x, h = true, z = this._isCrossPost;
this._isCrossPost = false;
if (this._onsubmit)h = this._onsubmit();
if (h)for (f = 0, x = this._onSubmitStatements.length; f < x; f++)if (!this._onSubmitStatements[f]()) {
h = false;
break
}
if (!h) {
if (i)i.preventDefault();
return
}
var w = this._form;
if (z)return;
if (this._activeDefaultButton && !this._activeDefaultButtonClicked)this._onFormElementActive(this._activeDefaultButton, 0, 0);
if (!this._postBackSettings || !this._postBackSettings.async)return;
var b = new Sys.StringBuilder, s = w.elements, B = s.length, t = this._createPanelID(null, this._postBackSettings);
b.append(t);
for (f = 0; f < B; f++) {
var e = s[f], g = e.name;
if (typeof g === "undefined" || g === null || g.length === 0 || g === this._scriptManagerID)continue;
var n = e.tagName.toUpperCase();
if (n === "INPUT") {
var p = e.type;
if (this._textTypes.test(p) || (p === "checkbox" || p === "radio") && e.checked) {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(e.value));
b.append("&")
}
} else if (n === "SELECT") {
var A = e.options.length;
for (var q = 0; q < A; q++) {
var u = e.options[q];
if (u.selected) {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(u.value));
b.append("&")
}
}
} else if (n === "TEXTAREA") {
b.append(encodeURIComponent(g));
b.append("=");
b.append(encodeURIComponent(e.value));
b.append("&")
}
}
b.append("__ASYNCPOST=true&");
if (this._additionalInput) {
b.append(this._additionalInput);
this._additionalInput = null
}
var c = new Sys.Net.WebRequest, a = w.action;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var r = a.indexOf("#");
if (r !== -1)a = a.substr(0, r);
var o = "", v = "", m = a.indexOf("?");
if (m !== -1) {
v = a.substr(m);
a = a.substr(0, m)
}
if (/^https?\:\/\/.*$/gi.test(a)) {
var y = a.indexOf("//") + 2, l = a.indexOf("/", y);
if (l === -1) {
o = a;
a = ""
} else {
o = a.substr(0, l);
a = a.substr(l)
}
}
a = o + encodeURI(decodeURI(a)) + v
}
c.set_url(a);
c.get_headers()["X-MicrosoftAjax"] = "Delta=true";
c.get_headers()["Cache-Control"] = "no-cache";
c.set_timeout(this._asyncPostBackTimeout);
c.add_completed(Function.createDelegate(this, this._onFormSubmitCompleted));
c.set_body(b.toString());
var j, d, k = this._get_eventHandlerList().getHandler("initializeRequest");
if (k) {
j = this._postBackSettings.panelsToUpdate;
d = new Sys.WebForms.InitializeRequestEventArgs(c, this._postBackSettings.sourceElement, j);
k(this, d);
h = !d.get_cancel()
}
if (!h) {
if (i)i.preventDefault();
return
}
if (d && d._updated) {
j = d.get_updatePanelsToUpdate();
c.set_body(c.get_body().replace(t, this._createPanelID(j, this._postBackSettings)))
}
this._scrollPosition = this._getScrollPosition();
this.abortPostBack();
k = this._get_eventHandlerList().getHandler("beginRequest");
if (k) {
d = new Sys.WebForms.BeginRequestEventArgs(c, this._postBackSettings.sourceElement, j || this._postBackSettings.panelsToUpdate);
k(this, d)
}
if (this._originalDoCallback)this._cancelPendingCallbacks();
this._request = c;
this._processingRequest = false;
c.invoke();
if (i)i.preventDefault()
}, _onFormSubmitCompleted: function (c) {
this._processingRequest = true;
if (c.get_timedOut()) {
this._endPostBack(this._createPageRequestManagerTimeoutError(), c, null);
return
}
if (c.get_aborted()) {
this._endPostBack(null, c, null);
return
}
if (!this._request || c.get_webRequest() !== this._request)return;
if (c.get_statusCode() !== 200) {
this._endPostBack(this._createPageRequestManagerServerError(c.get_statusCode()), c, null);
return
}
var a = this._parseDelta(c);
if (!a)return;
var b, e;
if (a.asyncPostBackControlIDsNode && a.postBackControlIDsNode && a.updatePanelIDsNode && a.panelsToRefreshNode && a.childUpdatePanelIDsNode) {
var r = this._updatePanelIDs, n = this._updatePanelClientIDs, i = a.childUpdatePanelIDsNode.content, p = i.length ? i.split(",") : [], m = this._splitNodeIntoArray(a.asyncPostBackControlIDsNode), o = this._splitNodeIntoArray(a.postBackControlIDsNode), q = this._splitNodeIntoArray(a.updatePanelIDsNode), g = this._splitNodeIntoArray(a.panelsToRefreshNode), h = a.version4;
for (b = 0, e = g.length; b < e; b += h ? 2 : 1) {
var j = (h ? g[b + 1] : "") || this._uniqueIDToClientID(g[b]);
if (!document.getElementById(j)) {
this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, j)), c, a);
return
}
}
var f = this._processUpdatePanelArrays(q, m, o, h);
f.oldUpdatePanelIDs = r;
f.oldUpdatePanelClientIDs = n;
f.childUpdatePanelIDs = p;
f.panelsToRefreshIDs = g;
a.updatePanelData = f
}
a.dataItems = {};
var d;
for (b = 0, e = a.dataItemNodes.length; b < e; b++) {
d = a.dataItemNodes[b];
a.dataItems[d.id] = d.content
}
for (b = 0, e = a.dataItemJsonNodes.length; b < e; b++) {
d = a.dataItemJsonNodes[b];
a.dataItems[d.id] = Sys.Serialization.JavaScriptSerializer.deserialize(d.content)
}
var l = this._get_eventHandlerList().getHandler("pageLoading");
if (l)l(this, this._getPageLoadingEventArgs(a));
Sys._ScriptLoader.readLoadedScripts();
Sys.Application.beginCreateComponents();
var k = Sys._ScriptLoader.getInstance();
this._queueScripts(k, a.scriptBlockNodes, true, false);
this._processingRequest = true;
k.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadComplete, a)), Function.createDelegate(this, Function.createCallback(this._scriptIncludesLoadFailed, a)), null)
}, _onWindowUnload: function () {
this.dispose()
}, _pageLoaded: function (a, c) {
var b = this._get_eventHandlerList().getHandler("pageLoaded");
if (b)b(this, this._getPageLoadedEventArgs(a, c));
if (!a)Sys.Application.raiseLoad()
}, _pageLoadedInitialLoad: function () {
this._pageLoaded(true, null)
}, _parseDelta: function (h) {
var c = h.get_responseData(), d, i, E, F, D, b = 0, e = null, k = [];
while (b < c.length) {
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
i = parseInt(c.substring(b, d), 10);
if (i % 1 !== 0) {
e = this._findText(c, b);
break
}
b = d + 1;
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
E = c.substring(b, d);
b = d + 1;
d = c.indexOf("|", b);
if (d === -1) {
e = this._findText(c, b);
break
}
F = c.substring(b, d);
b = d + 1;
if (b + i >= c.length) {
e = this._findText(c, c.length);
break
}
D = c.substr(b, i);
b += i;
if (c.charAt(b) !== "|") {
e = this._findText(c, b);
break
}
b++;
Array.add(k, {type: E, id: F, content: D})
}
if (e) {
this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_ParserErrorDetails, e)), h, null);
return null
}
var x = [], w = [], q = [], j = [], t = [], C = [], A = [], z = [], v = [], s = [], m, p, u, n, o, r, y, g;
for (var l = 0, G = k.length; l < G; l++) {
var a = k[l];
switch (a.type) {
case "#":
g = a;
break;
case "updatePanel":
Array.add(x, a);
break;
case "hiddenField":
Array.add(w, a);
break;
case "arrayDeclaration":
Array.add(q, a);
break;
case "scriptBlock":
Array.add(j, a);
break;
case "fallbackScript":
j[j.length - 1].fallback = a.id;
case "scriptStartupBlock":
Array.add(t, a);
break;
case "expando":
Array.add(C, a);
break;
case "onSubmit":
Array.add(A, a);
break;
case "asyncPostBackControlIDs":
m = a;
break;
case "postBackControlIDs":
p = a;
break;
case "updatePanelIDs":
u = a;
break;
case "asyncPostBackTimeout":
n = a;
break;
case "childUpdatePanelIDs":
o = a;
break;
case "panelsToRefreshIDs":
r = a;
break;
case "formAction":
y = a;
break;
case "dataItem":
Array.add(z, a);
break;
case "dataItemJson":
Array.add(v, a);
break;
case "scriptDispose":
Array.add(s, a);
break;
case "pageRedirect":
if (g && parseFloat(g.content) >= 4)a.content = unescape(a.content);
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var f = document.createElement("a");
f.style.display = "none";
f.attachEvent("onclick", B);
f.href = a.content;
this._form.parentNode.insertBefore(f, this._form);
f.click();
f.detachEvent("onclick", B);
this._form.parentNode.removeChild(f);
function B(a) {
a.cancelBubble = true
}
} else window.location.href = a.content;
return null;
case "error":
this._endPostBack(this._createPageRequestManagerServerError(Number.parseInvariant(a.id), a.content), h, null);
return null;
case "pageTitle":
document.title = a.content;
break;
case "focus":
this._controlIDToFocus = a.content;
break;
default:
this._endPostBack(this._createPageRequestManagerParserError(String.format(Sys.WebForms.Res.PRM_UnknownToken, a.type)), h, null);
return null
}
}
return {
version4: g ? parseFloat(g.content) >= 4 : false,
executor: h,
updatePanelNodes: x,
hiddenFieldNodes: w,
arrayDeclarationNodes: q,
scriptBlockNodes: j,
scriptStartupNodes: t,
expandoNodes: C,
onSubmitNodes: A,
dataItemNodes: z,
dataItemJsonNodes: v,
scriptDisposeNodes: s,
asyncPostBackControlIDsNode: m,
postBackControlIDsNode: p,
updatePanelIDsNode: u,
asyncPostBackTimeoutNode: n,
childUpdatePanelIDsNode: o,
panelsToRefreshNode: r,
formActionNode: y
}
}, _processUpdatePanelArrays: function (e, q, r, f) {
var d, c, b;
if (e) {
var i = e.length, j = f ? 2 : 1;
d = new Array(i / j);
c = new Array(i / j);
b = new Array(i / j);
for (var g = 0, h = 0; g < i; g += j, h++) {
var p, a = e[g], k = f ? e[g + 1] : "";
p = a.charAt(0) === "t";
a = a.substr(1);
if (!k)k = this._uniqueIDToClientID(a);
b[h] = p;
d[h] = a;
c[h] = k
}
} else {
d = [];
c = [];
b = []
}
var n = [], l = [];
this._convertToClientIDs(q, n, l, f);
var o = [], m = [];
this._convertToClientIDs(r, o, m, f);
return {
updatePanelIDs: d,
updatePanelClientIDs: c,
updatePanelHasChildrenAsTriggers: b,
asyncPostBackControlIDs: n,
asyncPostBackControlClientIDs: l,
postBackControlIDs: o,
postBackControlClientIDs: m
}
}, _queueScripts: function (scriptLoader, scriptBlockNodes, queueIncludes, queueBlocks) {
for (var i = 0, l = scriptBlockNodes.length; i < l; i++) {
var scriptBlockType = scriptBlockNodes[i].id;
switch (scriptBlockType) {
case "ScriptContentNoTags":
if (!queueBlocks)continue;
scriptLoader.queueScriptBlock(scriptBlockNodes[i].content);
break;
case "ScriptContentWithTags":
var scriptTagAttributes;
eval("scriptTagAttributes = " + scriptBlockNodes[i].content);
if (scriptTagAttributes.src) {
if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(scriptTagAttributes.src))continue
} else if (!queueBlocks)continue;
scriptLoader.queueCustomScriptTag(scriptTagAttributes);
break;
case "ScriptPath":
var script = scriptBlockNodes[i];
if (!queueIncludes || Sys._ScriptLoader.isScriptLoaded(script.content))continue;
scriptLoader.queueScriptReference(script.content, script.fallback)
}
}
}, _registerDisposeScript: function (a, b) {
if (!this._scriptDisposes[a])this._scriptDisposes[a] = [b]; else Array.add(this._scriptDisposes[a], b)
}, _scriptIncludesLoadComplete: function (e, b) {
if (b.executor.get_webRequest() !== this._request)return;
this._commitControls(b.updatePanelData, b.asyncPostBackTimeoutNode ? b.asyncPostBackTimeoutNode.content : null);
if (b.formActionNode)this._form.action = b.formActionNode.content;
var a, d, c;
for (a = 0, d = b.updatePanelNodes.length; a < d; a++) {
c = b.updatePanelNodes[a];
var j = document.getElementById(c.id);
if (!j) {
this._endPostBack(Error.invalidOperation(String.format(Sys.WebForms.Res.PRM_MissingPanel, c.id)), b.executor, b);
return
}
this._updatePanel(j, c.content)
}
for (a = 0, d = b.scriptDisposeNodes.length; a < d; a++) {
c = b.scriptDisposeNodes[a];
this._registerDisposeScript(c.id, c.content)
}
for (a = 0, d = this._transientFields.length; a < d; a++) {
var g = document.getElementById(this._transientFields[a]);
if (g) {
var k = g._isContained ? g.parentNode : g;
k.parentNode.removeChild(k)
}
}
for (a = 0, d = b.hiddenFieldNodes.length; a < d; a++) {
c = b.hiddenFieldNodes[a];
this._createHiddenField(c.id, c.content)
}
if (b.scriptsFailed)throw Sys._ScriptLoader._errorScriptLoadFailed(b.scriptsFailed.src, b.scriptsFailed.multipleCallbacks);
this._queueScripts(e, b.scriptBlockNodes, false, true);
var i = "";
for (a = 0, d = b.arrayDeclarationNodes.length; a < d; a++) {
c = b.arrayDeclarationNodes[a];
i += "Sys.WebForms.PageRequestManager._addArrayElement('" + c.id + "', " + c.content + ");\r\n"
}
var h = "";
for (a = 0, d = b.expandoNodes.length; a < d; a++) {
c = b.expandoNodes[a];
h += c.id + " = " + c.content + "\r\n"
}
if (i.length)e.queueScriptBlock(i);
if (h.length)e.queueScriptBlock(h);
this._queueScripts(e, b.scriptStartupNodes, true, true);
var f = "";
for (a = 0, d = b.onSubmitNodes.length; a < d; a++) {
if (a === 0)f = "Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, function() {\r\n";
f += b.onSubmitNodes[a].content + "\r\n"
}
if (f.length) {
f += "\r\nreturn true;\r\n});\r\n";
e.queueScriptBlock(f)
}
e.loadScripts(0, Function.createDelegate(this, Function.createCallback(this._scriptsLoadComplete, b)), null, null)
}, _scriptIncludesLoadFailed: function (d, c, b, a) {
a.scriptsFailed = {src: c.src, multipleCallbacks: b};
this._scriptIncludesLoadComplete(d, a)
}, _scriptsLoadComplete: function (f, c) {
var e = c.executor;
if (window.__theFormPostData)window.__theFormPostData = "";
if (window.__theFormPostCollection)window.__theFormPostCollection = [];
if (window.WebForm_InitCallback)window.WebForm_InitCallback();
if (this._scrollPosition) {
if (window.scrollTo)window.scrollTo(this._scrollPosition.x, this._scrollPosition.y);
this._scrollPosition = null
}
Sys.Application.endCreateComponents();
this._pageLoaded(false, c);
this._endPostBack(null, e, c);
if (this._controlIDToFocus) {
var a, d;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var b = $get(this._controlIDToFocus);
a = b;
if (b && !WebForm_CanFocus(b))a = WebForm_FindFirstFocusableChild(b);
if (a && typeof a.contentEditable !== "undefined") {
d = a.contentEditable;
a.contentEditable = false
} else a = null
}
WebForm_AutoFocus(this._controlIDToFocus);
if (a)a.contentEditable = d;
this._controlIDToFocus = null
}
}, _splitNodeIntoArray: function (b) {
var a = b.content, c = a.length ? a.split(",") : [];
return c
}, _uniqueIDToClientID: function (a) {
return a.replace(/\$/g, "_")
}, _updateControls: function (d, a, c, b, e) {
this._commitControls(this._processUpdatePanelArrays(d, a, c, e), b)
}, _updatePanel: function (updatePanelElement, rendering) {
for (var updatePanelID in this._scriptDisposes)if (this._elementContains(updatePanelElement, document.getElementById(updatePanelID))) {
var disposeScripts = this._scriptDisposes[updatePanelID];
for (var i = 0, l = disposeScripts.length; i < l; i++)eval(disposeScripts[i]);
delete this._scriptDisposes[updatePanelID]
}
Sys.Application.disposeElement(updatePanelElement, true);
updatePanelElement.innerHTML = rendering
}, _validPosition: function (a) {
return typeof a !== "undefined" && a !== null && a !== 0
}
};
Sys.WebForms.PageRequestManager.getInstance = function () {
var a = Sys.WebForms.PageRequestManager._instance;
if (!a)a = Sys.WebForms.PageRequestManager._instance = new Sys.WebForms.PageRequestManager;
return a
};
Sys.WebForms.PageRequestManager._addArrayElement = function (a) {
if (!window[a])window[a] = [];
for (var b = 1, c = arguments.length; b < c; b++)Array.add(window[a], arguments[b])
};
Sys.WebForms.PageRequestManager._initialize = function () {
var a = Sys.WebForms.PageRequestManager.getInstance();
a._initializeInternal.apply(a, arguments)
};
Sys.WebForms.PageRequestManager.registerClass("Sys.WebForms.PageRequestManager");
Sys.UI._UpdateProgress = function (a) {
Sys.UI._UpdateProgress.initializeBase(this, [a]);
this._displayAfter = 500;
this._dynamicLayout = true;
this._associatedUpdatePanelId = null;
this._beginRequestHandlerDelegate = null;
this._startDelegate = null;
this._endRequestHandlerDelegate = null;
this._pageRequestManager = null;
this._timerCookie = null
};
Sys.UI._UpdateProgress.prototype = {
get_displayAfter: function () {
return this._displayAfter
}, set_displayAfter: function (a) {
this._displayAfter = a
}, get_dynamicLayout: function () {
return this._dynamicLayout
}, set_dynamicLayout: function (a) {
this._dynamicLayout = a
}, get_associatedUpdatePanelId: function () {
return this._associatedUpdatePanelId
}, set_associatedUpdatePanelId: function (a) {
this._associatedUpdatePanelId = a
}, get_role: function () {
return "status"
}, _clearTimeout: function () {
if (this._timerCookie) {
window.clearTimeout(this._timerCookie);
this._timerCookie = null
}
}, _getUniqueID: function (b) {
var a = Array.indexOf(this._pageRequestManager._updatePanelClientIDs, b);
return a === -1 ? null : this._pageRequestManager._updatePanelIDs[a]
}, _handleBeginRequest: function (f, e) {
var b = e.get_postBackElement(), a = true, d = this._associatedUpdatePanelId;
if (this._associatedUpdatePanelId) {
var c = e.get_updatePanelsToUpdate();
if (c && c.length)a = Array.contains(c, d) || Array.contains(c, this._getUniqueID(d)); else a = false
}
while (!a && b) {
if (b.id && this._associatedUpdatePanelId === b.id)a = true;
b = b.parentNode
}
if (a)this._timerCookie = window.setTimeout(this._startDelegate, this._displayAfter)
}, _startRequest: function () {
if (this._pageRequestManager.get_isInAsyncPostBack()) {
var a = this.get_element();
if (this._dynamicLayout)a.style.display = "block"; else a.style.visibility = "visible";
if (this.get_role() === "status")a.setAttribute("aria-hidden", "false")
}
this._timerCookie = null
}, _handleEndRequest: function () {
var a = this.get_element();
if (this._dynamicLayout)a.style.display = "none"; else a.style.visibility = "hidden";
if (this.get_role() === "status")a.setAttribute("aria-hidden", "true");
this._clearTimeout()
}, dispose: function () {
if (this._beginRequestHandlerDelegate !== null) {
this._pageRequestManager.remove_beginRequest(this._beginRequestHandlerDelegate);
this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);
this._beginRequestHandlerDelegate = null;
this._endRequestHandlerDelegate = null
}
this._clearTimeout();
Sys.UI._UpdateProgress.callBaseMethod(this, "dispose")
}, initialize: function () {
Sys.UI._UpdateProgress.callBaseMethod(this, "initialize");
if (this.get_role() === "status")this.get_element().setAttribute("aria-hidden", "true");
this._beginRequestHandlerDelegate = Function.createDelegate(this, this._handleBeginRequest);
this._endRequestHandlerDelegate = Function.createDelegate(this, this._handleEndRequest);
this._startDelegate = Function.createDelegate(this, this._startRequest);
if (Sys.WebForms && Sys.WebForms.PageRequestManager)this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
if (this._pageRequestManager !== null) {
this._pageRequestManager.add_beginRequest(this._beginRequestHandlerDelegate);
this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate)
}
}
};
Sys.UI._UpdateProgress.registerClass("Sys.UI._UpdateProgress", Sys.UI.Control);
Type.registerNamespace('Sys.WebForms');
Sys.WebForms.Res = {
"PRM_UnknownToken": "Unknown token: \u0027{0}\u0027.",
"PRM_MissingPanel": "Could not find UpdatePanel with ID \u0027{0}\u0027. If it is being updated dynamically then it must be inside another UpdatePanel.",
"PRM_ServerError": "An unknown error occurred while processing the request on the server. The status code returned from the server was: {0}",
"PRM_ParserError": "The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\r\nDetails: {0}",
"PRM_TimeoutError": "The server request timed out.",
"PRM_ParserErrorDetails": "Error parsing near \u0027{0}\u0027.",
"PRM_CannotRegisterTwice": "The PageRequestManager cannot be initialized more than once."
};
/* END MicrosoftAjaxWebForms.js */
/* START Telerik.Web.UI.Common.Core.js */
(function (A, j, z) {
var s, t = Object.prototype, b = t.toString, l = "[object Function]", i = "div", n = "input", u = "ontouchstart", y = "touchEvents", w = "PointerEvent", x = "pointerEvents", q = "MSPointerEvent", r = "msPointerEvents";
function o(B) {
return b.call(B) === l;
}
function a(B, C) {
C();
}
function h(B) {
return j.createElement(B);
}
function m(C, B) {
return C.indexOf(B);
}
function p(B, C) {
return B.match(C);
}
var k = function () {
};
k.prototype = {
addTest: function d(B, E, D) {
var C = this;
D = D || C;
if (D[B] !== z) {
return;
}
E = o(E) ? E() : E;
D[B] = E;
}, addSuite: function c(D, E) {
var C = this;
D = C[D] = {};
for (var B in E) {
if (E.hasOwnProperty(B)) {
C.addTest(B, E[B], D);
}
}
}
};
var v = new k();
var e = new k();
var f = new k();
var g = new k();
a("Platform", function () {
var B = A.navigator, C = B.userAgent;
v.addTest("windows", function () {
return (m(C, "Windows") > -1);
});
v.addTest("mac", function () {
return (m(C, "Macintosh") > -1);
});
v.addTest("linux", function () {
return (m(C, "Linux") > -1 && m(C, "Android") == -1);
});
v.addTest("android", function () {
return (m(C, "Android") > -1);
});
v.addTest("ios", function () {
return (m(C, "iPad") > -1 || m(C, "iPhone") > -1);
});
v.addTest("ipad", function () {
return (m(C, "iPad") > -1);
});
v.addTest("iphone", function () {
return (m(C, "iPhone") > -1);
});
});
a("Browser", function () {
var B = A.navigator, C = B.userAgent;
e.addTest("ie", function () {
return (m(C, " MSIE ") > -1 || m(C, " IE ") > -1 || m(C, " Trident/") > -1);
});
e.addTest("ff", function () {
return (!e.ie && m(C, " Firefox/") > -1);
});
e.addTest("opera", function () {
return (m(C, " OPR/") > -1);
});
e.addTest("operaPresto", function () {
return (m(C, "Opera/") > -1);
});
e.addTest("operaMini", function () {
return (m(C, " Opera Mini/") > -1);
});
e.addTest("webkit", function () {
return (m(C, " AppleWebKit/") > -1);
});
e.addTest("safari", function () {
return (e.webkit && m(C, " Version/") > -1);
});
e.addTest("chrome", function () {
return (e.webkit && !e.opera && m(C, " Chrome/") > -1);
});
e.addTest("fullVersion", function () {
var D = null;
if (e.ie) {
D = m(C, " rv:") > -1 ? /rv:([\d\.]+)/ : /MSIE ([\d\.]+)/;
}
if (e.ff) {
D = /Firefox\/([\d\.]+)/;
}
if (e.opera) {
D = /OPR\/([\d\.]+)/;
}
if (e.operaPresto) {
D = /Version\/([\d\.]+)/;
}
if (e.safari) {
D = /Version\/([\d\.]+)/;
}
if (e.chrome) {
D = /Chrome\/([\d\.]+)/;
}
if (D === null) {
return null;
}
return p(C, D)[1];
});
e.addTest("version", function () {
var D = e.fullVersion;
if (D === null) {
return null;
}
return parseFloat(D);
});
e.addTest("documentMode", j.documentMode || null);
e.addTest("quirksMode", e.ie && j.compatMode !== "CSS1Compat");
e.addTest("standardsMode", !e.quirksMode);
});
a("Canvas", function () {
var B = h("canvas");
f.addTest("canvas", !!(B.getContext && B.getContext("2d")));
});
a("Input", function () {
var B = h(n);
f.addSuite("input", {
autocomplete: !!("autocomplete" in B),
autofocus: !!("autofocus" in B),
list: !!("list" in B),
max: !!("max" in B),
min: !!("min" in B),
multiple: !!("multiple" in B),
pattern: !!("pattern" in B),
placeholder: !!("placeholder" in B),
required: !!("required" in B),
step: !!("step" in B)
});
});
a("Input types", function () {
var B = h(n);
function C(D) {
B.setAttribute("type", D);
return B.type !== "text";
}
f.addSuite("inputTypes", {
color: C("color"),
date: C("date"),
datetime: C("datetime"),
"datetime-local": C("datetime-local"),
email: C("email"),
month: C("month"),
number: C("number"),
range: C("range"),
search: C("search"),
tel: C("tel"),
time: C("time"),
url: C("url"),
week: C("week")
});
});
a("Observers", function () {
f.addTest("propertychange", "onpropertychange" in j);
});
a("CSS Features", function () {
function B() {
var F = j.documentElement, E = j.createElement(i), C = j.body, D = C || j.createElement("body"), G;
E.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both";
E.innerHTML = " ";
D.appendChild(E);
if (!C) {
F.appendChild(D);
}
G = E.offsetWidth - E.scrollWidth;
E.parentNode.removeChild(E);
if (!C) {
D.parentNode.removeChild(D);
}
return G;
}
e.addTest("scrollBarWidth", B);
});
a("Events", function () {
f.addTest(y, function () {
return u in A;
});
f.addTest(x, function () {
return w in A;
});
f.addTest(r, function () {
return q in A;
});
});
Type.registerNamespace("Telerik.Web");
s = Telerik.Web;
s.Platform = v;
s.Browser = e;
s.BrowserFeatures = f;
s.BrowserPlugins = g;
})(window, document);
try {
if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
document.execCommand("BackgroundImageCache", false, true);
}
} catch (err) {
}
Type.registerNamespace("Telerik.Web.UI");
var commonScripts = {
cloneJsObject: function (c, d) {
if (!d) {
d = {};
}
for (var a in c) {
var b = c[a];
d[a] = (b instanceof Array) ? Array.clone(b) : b;
}
return d;
},
isCloned: function () {
return this._isCloned;
},
cloneControl: function (f, d, a) {
if (!f) {
return null;
}
if (!d) {
d = Object.getType(f);
}
var e = f.__clonedProperties__;
if (null == e) {
e = f.__clonedProperties__ = $telerik._getPropertiesParameter(f, d);
}
if (!a) {
a = f.get_element().cloneNode(true);
a.removeAttribute("control");
a.removeAttribute("id");
}
var c = $create(d, e, null, null, a);
if (f._observerContext) {
c._observerContext = f._observerContext;
}
var b = $telerik.cloneJsObject(f.get_events());
c._events = b;
c._events._list = $telerik.cloneJsObject(c._events._list);
c._isCloned = true;
c.isCloned = $telerik.isCloned;
return c;
},
_getPropertiesParameter: function (h, d) {
var c = {};
var f = d.prototype;
for (var b in f) {
var a = h[b];
if (typeof(a) == "function" && b.indexOf("get_") == 0) {
var e = b.substring(4);
if (null == h["set_" + e]) {
continue;
}
var g = a.call(h);
if (null == g) {
continue;
}
c[e] = g;
}
}
delete c.clientStateFieldID;
delete c.id;
return c;
},
getOuterSize: function (a) {
var c = $telerik.getSize(a);
var b = $telerik.getMarginBox(a);
return {width: c.width + b.left + b.right, height: c.height + b.top + b.bottom};
},
getOuterBounds: function (a) {
var c = $telerik.getBounds(a);
var b = $telerik.getMarginBox(a);
return {
x: c.x - b.left,
y: c.y - b.top,
width: c.width + b.left + b.right,
height: c.height + b.top + b.bottom
};
},
getInvisibleParent: function (a) {
while (a && a != document) {
if ("none" == $telerik.getCurrentStyle(a, "display", "")) {
return a;
}
a = a.parentNode;
}
return null;
},
isScrolledIntoView: function (d) {
var a = d.ownerDocument;
var g = (a.defaultView) ? a.defaultView : a.parentWindow;
var c = $telerik.$(g).scrollTop(), b = c + $telerik.$(g).height(), f = $telerik.$(d).offset().top, e = f + $telerik.$(d).height();
return ((f + ((e - f) / 4)) >= c && ((f + ((e - f) / 4)) <= b));
},
scrollIntoView: function (b) {
if (!b || !b.parentNode) {
return;
}
var g = null, c = b.offsetParent, h = b.offsetTop, f = 0;
var e = b.parentNode;
while (e != null) {
var d = $telerik.getCurrentStyle(e, "overflowY");
if (d == "scroll" || d == "auto") {
g = e;
break;
}
if (e == c) {
h += e.offsetTop;
c = e.offsetParent;
}
if (e.tagName == "BODY") {
var a = e.ownerDocument;
if (!$telerik.isIE && a.defaultView && a.defaultView.frameElement) {
f = a.defaultView.frameElement.offsetHeight;
}
g = e;
break;
}
e = e.parentNode;
}
if (!g) {
return;
}
if (!f) {
f = g.offsetHeight;
}
if ((g.scrollTop + f) < (h + b.offsetHeight)) {
g.scrollTop = (h + b.offsetHeight) - f;
} else {
if (h < (g.scrollTop)) {
g.scrollTop = h;
}
}
},
getScrollableParent: function (a) {
var c = a.parentNode, d = null, b;
while (c != null) {
b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d = c;
break;
}
c = c.parentNode;
}
return d;
},
getScrollableParents: function (a) {
var c = a.parentNode, d = [], b;
while (c != null && c.nodeType === 1) {
b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d.push(c);
}
c = c.parentNode;
}
return d;
},
fixScrollableParentBehavior_OldIE: function (a) {
if (!($telerik.isIE6 || $telerik.isIE7) || (!a || a.nodeType !== 1)) {
return;
}
var c = $telerik.getScrollableParent(a), b = $telerik.getComputedStyle(c, "position");
if (b == "static") {
c.style.position = "relative";
}
},
isRightToLeft: function (b) {
while (b && b.nodeType !== 9) {
var a = $telerik.getCurrentStyle(b, "direction");
if (b.dir == "rtl" || a == "rtl") {
return true;
}
if (b.dir == "ltr" || a == "ltr") {
return false;
}
b = b.parentNode;
}
return false;
},
getCorrectScrollLeft: function (a) {
if ($telerik.isRightToLeft(a)) {
return -(a.scrollWidth - a.offsetWidth - Math.abs(a.scrollLeft));
} else {
return a.scrollLeft;
}
},
_borderStyleNames: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
_borderWidthNames: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
_paddingWidthNames: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
_marginWidthNames: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
radControls: [],
registerControl: function (a) {
if (!Array.contains(this.radControls, a)) {
Array.add(this.radControls, a);
}
},
unregisterControl: function (a) {
Array.remove(this.radControls, a);
},
repaintChildren: function (d) {
var e = d.get_element ? d.get_element() : d;
for (var b = 0, c = this.radControls.length;
b < c;
b++) {
var a = this.radControls[b];
if (a.repaint && this.isDescendant(e, a.get_element())) {
a.repaint();
}
}
},
_borderThickness: function () {
$telerik._borderThicknesses = {};
var b = document.createElement("div");
var d = document.createElement("div");
b.style.visibility = "hidden";
b.style.position = "absolute";
b.style.top = "-9999px";
b.style.fontSize = "1px";
d.style.height = "0px";
d.style.overflow = "hidden";
document.body.appendChild(b).appendChild(d);
var a = b.offsetHeight;
d.style.borderTop = "solid black";
b.style.borderLeft = "1px solid red";
d.style.borderTopWidth = "thin";
$telerik._borderThicknesses.thin = b.offsetHeight - a;
d.style.borderTopWidth = "medium";
$telerik._borderThicknesses.medium = b.offsetHeight - a;
d.style.borderTopWidth = "thick";
$telerik._borderThicknesses.thick = b.offsetHeight - a;
var c = $telerik.getComputedStyle(b, "border-left-color", null);
var e = $telerik.getComputedStyle(d, "border-top-color", null);
if (c && e && c == e) {
document.documentElement.className += " _Telerik_a11y";
}
if (typeof(b.removeChild) !== "undefined") {
b.removeChild(d);
}
document.body.removeChild(b);
if (!$telerik.isSafari && !$telerik.isIE10Mode) {
d.outerHTML = null;
}
if (!$telerik.isSafari && !$telerik.isIE10Mode) {
b.outerHTML = null;
}
b = null;
d = null;
},
getCurrentStyle: function (d, a, c) {
var b = null;
if (d) {
if (d.currentStyle) {
b = d.currentStyle[a];
} else {
if (document.defaultView && document.defaultView.getComputedStyle) {
var e = document.defaultView.getComputedStyle(d, null);
if (e) {
b = e[a];
}
}
}
if (!b && d.style) {
if (d.style.getPropertyValue) {
b = d.style.getPropertyValue(a);
} else {
if (d.style.getAttribute) {
b = d.style.getAttribute(a);
}
}
}
}
if ((!b || b == "" || typeof(b) === "undefined")) {
if (typeof(c) != "undefined") {
b = c;
} else {
b = null;
}
}
return b;
},
getComputedStyle: function (d, a, c) {
var b = null;
if (d) {
if (d.currentStyle) {
b = d.currentStyle[a];
} else {
if (document.defaultView && document.defaultView.getComputedStyle) {
var e = document.defaultView.getComputedStyle(d, null);
if (e) {
if (e.getPropertyValue) {
b = e.getPropertyValue(a);
} else {
b = e[a];
}
}
}
}
if (!b && d.style) {
if (d.style.getPropertyValue) {
b = d.style.getPropertyValue(a);
} else {
if (d.style.getAttribute) {
b = d.style.getAttribute(a);
}
}
}
}
if ((!b || b == "" || typeof(b) === "undefined")) {
if (typeof(c) != "undefined") {
b = c;
} else {
b = null;
}
}
return b;
},
getLocation: function (g) {
var d = g && g.ownerDocument ? g.ownerDocument : document;
if (g === d.documentElement) {
return new Sys.UI.Point(0, 0);
}
var C;
if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
if (g.window === g || g.nodeType === 9 || !g.getClientRects || !g.getBoundingClientRect || g.parentElement == null) {
return new Sys.UI.Point(0, 0);
}
var H = g.getClientRects();
if (!H || !H.length) {
return new Sys.UI.Point(0, 0);
}
var k = H[0];
var c = 0;
var f = 0;
var p = false;
try {
p = d.parentWindow.frameElement;
} catch (j) {
p = true;
}
if (p) {
var b = g.getBoundingClientRect();
if (!b) {
return new Sys.UI.Point(0, 0);
}
var t = k.left;
var u = k.top;
for (var o = 1;
o < H.length;
o++) {
var F = H[o];
if (F.left < t) {
t = F.left;
}
if (F.top < u) {
u = F.top;
}
}
c = t - b.left;
f = u - b.top;
}
var I = 0;
if (($telerik.isIE6 || $telerik.isIE7) || $telerik.quirksMode) {
var n = 1;
if (p && p.getAttribute) {
var a = p.getAttribute("frameborder");
if (a != null) {
n = parseInt(a, 10);
if (isNaN(n)) {
n = a.toLowerCase() == "no" ? 0 : 1;
}
}
}
I = 2 * n;
}
var e = d.documentElement;
var D = k.left - I - c + $telerik.getCorrectScrollLeft(e);
var E = k.top - I - f + e.scrollTop;
C = new Sys.UI.Point(Math.round(D), Math.round(E));
if ($telerik.quirksMode) {
C.x += $telerik.getCorrectScrollLeft(d.body);
C.y += d.body.scrollTop;
}
return C;
}
C = $telerik.originalGetLocation(g);
if ($telerik.isOpera) {
var z = null;
var h = $telerik.getCurrentStyle(g, "display");
if (h != "inline") {
z = g.parentNode;
} else {
z = g.offsetParent;
}
while (z) {
var B = z.tagName.toUpperCase();
if (B == "BODY" || B == "HTML") {
break;
}
if (B == "TABLE" && z.parentNode && z.parentNode.style.display == "inline-block") {
var w = z.offsetLeft;
var v = z.style.display;
z.style.display = "inline-block";
if (z.offsetLeft > w) {
C.x += z.offsetLeft - w;
}
z.style.display = v;
}
C.x -= $telerik.getCorrectScrollLeft(z);
C.y -= z.scrollTop;
if (h != "inline") {
z = z.parentNode;
} else {
z = z.offsetParent;
}
}
}
var y = Math.max(d.documentElement.scrollTop, d.body.scrollTop);
var x = Math.max(d.documentElement.scrollLeft, d.body.scrollLeft);
if ($telerik.isSafari) {
if (y > 0 || x > 0) {
var m = d.documentElement.getElementsByTagName("form");
if (m && m.length > 0) {
var l = $telerik.originalGetLocation(m[0]);
if (l.y && l.y < 0) {
C.y += y;
}
if (l.x && l.x < 0) {
C.x += x;
}
} else {
var G = g.parentNode, s = false, q = false;
while (G && G.tagName) {
var A = $telerik.originalGetLocation(G);
if (A.y < 0) {
s = true;
}
if (A.x < 0) {
q = true;
}
G = G.parentNode;
}
if (s) {
C.y += y;
}
if (q) {
C.x += x;
}
}
}
}
return C;
},
setLocation: function (a, b) {
Sys.UI.DomElement.setLocation(a, b.x, b.y);
},
findControl: function (f, d) {
var b = f.getElementsByTagName("*");
for (var c = 0, e = b.length;
c < e;
c++) {
var a = b[c].id;
if (a && a.endsWith(d)) {
return $find(a);
}
}
return null;
},
findElement: function (f, d) {
var b = f.getElementsByTagName("*");
for (var c = 0, e = b.length;
c < e;
c++) {
var a = b[c].id;
if (a && a.endsWith(d)) {
return $get(a);
}
}
return null;
},
getContentSize: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var d = $telerik.getSize(b);
var a = $telerik.getBorderBox(b);
var c = $telerik.getPaddingBox(b);
return {width: d.width - a.horizontal - c.horizontal, height: d.height - a.vertical - c.vertical};
},
getSize: function (a) {
if (!a) {
throw Error.argumentNull("element");
}
return {width: a.offsetWidth, height: a.offsetHeight};
},
setContentSize: function (b, d) {
if (!b) {
throw Error.argumentNull("element");
}
if (!d) {
throw Error.argumentNull("size");
}
if ($telerik.getCurrentStyle(b, "MozBoxSizing") == "border-box" || $telerik.getCurrentStyle(b, "BoxSizing") == "border-box") {
var a = $telerik.getBorderBox(b);
var c = $telerik.getPaddingBox(b);
d = {width: d.width + a.horizontal + c.horizontal, height: d.height + a.vertical + c.vertical};
}
b.style.width = d.width.toString() + "px";
b.style.height = d.height.toString() + "px";
},
setSize: function (c, e) {
if (!c) {
throw Error.argumentNull("element");
}
if (!e) {
throw Error.argumentNull("size");
}
var a = $telerik.getBorderBox(c);
var d = $telerik.getPaddingBox(c);
var b = {width: e.width - a.horizontal - d.horizontal, height: e.height - a.vertical - d.vertical};
$telerik.setContentSize(c, b);
},
getBounds: function (a) {
var b = $telerik.getLocation(a);
return new Sys.UI.Bounds(b.x, b.y, a.offsetWidth || 0, a.offsetHeight || 0);
},
setBounds: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (!a) {
throw Error.argumentNull("bounds");
}
$telerik.setSize(b, a);
$telerik.setLocation(b, a);
},
getClientBounds: function () {
var b;
var a;
switch (Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
b = document.documentElement.clientWidth;
a = document.documentElement.clientHeight;
if (b == 0 && a == 0) {
b = document.body.clientWidth;
a = document.body.clientHeight;
}
break;
case Sys.Browser.Safari:
b = window.innerWidth;
a = window.innerHeight;
break;
case Sys.Browser.Opera:
if (Sys.Browser.version >= 9.5) {
b = Math.min(window.innerWidth, document.documentElement.clientWidth);
a = Math.min(window.innerHeight, document.documentElement.clientHeight);
} else {
b = Math.min(window.innerWidth, document.body.clientWidth);
a = Math.min(window.innerHeight, document.body.clientHeight);
}
break;
default:
b = Math.min(window.innerWidth, document.documentElement.clientWidth);
a = Math.min(window.innerHeight, document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0, 0, b, a);
},
getMarginBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getMargin(b, Telerik.Web.BoxSide.Top),
right: $telerik.getMargin(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getMargin(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getMargin(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
getPaddingBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getPadding(b, Telerik.Web.BoxSide.Top),
right: $telerik.getPadding(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getPadding(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getPadding(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
getBorderBox: function (b) {
if (!b) {
throw Error.argumentNull("element");
}
var a = {
top: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Top),
right: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Right),
bottom: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Bottom),
left: $telerik.getBorderWidth(b, Telerik.Web.BoxSide.Left)
};
a.horizontal = a.left + a.right;
a.vertical = a.top + a.bottom;
return a;
},
isBorderVisible: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var c = $telerik._borderStyleNames[a];
var d = $telerik.getCurrentStyle(b, c);
return d != "none";
},
getMargin: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var d = $telerik._marginWidthNames[a];
var e = $telerik.getCurrentStyle(b, d);
try {
return $telerik.parsePadding(e);
} catch (c) {
return 0;
}
},
getBorderWidth: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
if (!$telerik.isBorderVisible(b, a)) {
return 0;
}
var c = $telerik._borderWidthNames[a];
var d = $telerik.getCurrentStyle(b, c);
return $telerik.parseBorderWidth(d);
},
getPadding: function (b, a) {
if (!b) {
throw Error.argumentNull("element");
}
if (a < Telerik.Web.BoxSide.Top || a > Telerik.Web.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, a, "Telerik.Web.BoxSide"));
}
var c = $telerik._paddingWidthNames[a];
var d = $telerik.getCurrentStyle(b, c);
return $telerik.parsePadding(d);
},
parseBorderWidth: function (a) {
if (a) {
switch (a) {
case"thin":
case"medium":
case"thick":
return $telerik._borderThicknesses[a];
case"inherit":
return 0;
}
var b = $telerik.parseUnit(a);
return b.size;
}
return 0;
},
parsePadding: function (a) {
if (a) {
if (a == "auto" || a == "inherit") {
return 0;
}
var b = $telerik.parseUnit(a);
return b.size;
}
return 0;
},
parseUnit: function (g) {
if (!g) {
throw Error.argumentNull("value");
}
g = g.trim().toLowerCase();
var c = g.length;
var d = -1;
for (var b = 0;
b < c;
b++) {
var a = g.substr(b, 1);
if ((a < "0" || a > "9") && a != "-" && a != "." && a != ",") {
break;
}
d = b;
}
if (d == -1) {
throw Error.create("No digits");
}
var f;
var e;
if (d < (c - 1)) {
f = g.substring(d + 1).trim();
} else {
f = "px";
}
e = parseFloat(g.substr(0, d + 1));
if (f == "px") {
e = Math.floor(e);
}
return {size: e, type: f};
},
containsPoint: function (a, b, c) {
return b >= a.x && b <= (a.x + a.width) && c >= a.y && c <= (a.y + a.height);
},
isDescendant: function (a, b) {
try {
for (var d = b.parentNode;
d != null;
d = d.parentNode) {
if (d == a) {
return true;
}
}
} catch (c) {
}
return false;
},
isDescendantOrSelf: function (a, b) {
if (a === b) {
return true;
}
return $telerik.isDescendant(a, b);
},
addCssClasses: function (b, a) {
for (var c = 0;
c < a.length;
c++) {
Sys.UI.DomElement.addCssClass(b, a[c]);
}
},
removeCssClasses: function (b, a) {
for (var c = 0;
c < a.length;
c++) {
Sys.UI.DomElement.removeCssClass(b, a[c]);
}
},
getScrollOffset: function (b, e) {
var c = 0;
var f = 0;
var d = b;
var a = b && b.ownerDocument ? b.ownerDocument : document;
while (d != null && d.scrollLeft != null) {
c += $telerik.getCorrectScrollLeft(d);
f += d.scrollTop;
if (!e || (d == a.body && (d.scrollLeft != 0 || d.scrollTop != 0))) {
break;
}
d = d.parentNode;
}
return {x: c, y: f};
},
getElementByClassName: function (d, c, g) {
if (d.getElementsByClassName) {
return d.getElementsByClassName(c)[0];
}
var b = null;
if (g) {
b = d.getElementsByTagName(g);
} else {
b = d.getElementsByTagName("*");
}
for (var e = 0, f = b.length;
e < f;
e++) {
var a = b[e];
if (Sys.UI.DomElement.containsCssClass(a, c)) {
return a;
}
}
return null;
},
getElementsByClassName: function (b, a, c) {
b = b || document;
if (b.getElementsByClassName) {
getElementsByClassName = function (d, m, g) {
var f = g.getElementsByClassName(d), k = (m) ? new RegExp("\\b" + m + "\\b", "i") : null, l = [], e;
for (var h = 0, j = f.length;
h < j;
h += 1) {
e = f[h];
if (!k || k.test(e.nodeName)) {
l.push(e);
}
}
return l;
};
} else {
if (document.evaluate) {
getElementsByClassName = function (g, q, k) {
q = q || "*";
var d = g.split(" "), f = "", r = "http://www.w3.org/1999/xhtml", n = (document.documentElement.namespaceURI === r) ? r : null, p = [], i, o;
for (var l = 0, m = d.length;
l < m;
l += 1) {
f += "[contains(concat(' ', @class, ' '), ' " + d[l] + " ')]";
}
try {
i = document.evaluate(".//" + q + f, k, n, 0, null);
} catch (h) {
i = document.evaluate(".//" + q + f, k, null, 0, null);
}
while ((o = i.iterateNext())) {
p.push(o);
}
return p;
};
} else {
getElementsByClassName = function (f, u, i) {
u = u || "*";
var d = f.split(" "), e = [], h = (u === "*" && i.all) ? i.all : i.getElementsByTagName(u), g, t = [], r;
for (var j = 0, n = d.length;
j < n;
j += 1) {
e.push(new RegExp("(^|\\s)" + d[j] + "(\\s|$)"));
}
for (var o = 0, p = h.length;
o < p;
o += 1) {
g = h[o];
r = false;
for (var q = 0, s = e.length;
q < s;
q += 1) {
r = e[q].test(g.className);
if (!r) {
break;
}
}
if (r) {
t.push(g);
}
}
return t;
};
}
}
return getElementsByClassName(a, c, b);
},
nextElement: function (b) {
if (!b) {
return b;
}
var a = b.nextSibling;
while (a && a.nodeType != 1) {
a = a.nextSibling;
}
return a;
},
previousElement: function (b) {
if (!b) {
return b;
}
var a = b.previousSibling;
while (a && a.nodeType != 1) {
a = a.previousSibling;
}
return a;
},
_getWindow: function (b) {
var a = b.ownerDocument || b.document || b;
return a.defaultView || a.parentWindow;
},
useAttachEvent: function (a) {
return (a.attachEvent && !$telerik.isOpera);
},
useDetachEvent: function (a) {
return (a.detachEvent && !$telerik.isOpera);
},
addHandler: function (e, g, h, a) {
if (!e._events) {
e._events = {};
}
var f = e._events[g];
if (!f) {
e._events[g] = f = [];
}
var b;
if ($telerik.useAttachEvent(e)) {
b = function () {
var d = {};
try {
d = $telerik._getWindow(e).event;
} catch (i) {
}
return h.call(e, new Sys.UI.DomEvent(d));
};
e.attachEvent("on" + g, b);
} else {
if (e.addEventListener) {
b = function (d) {
return h.call(e, new Sys.UI.DomEvent(d));
};
e.addEventListener(g, b, false);
}
}
f[f.length] = {handler: h, browserHandler: b, autoRemove: a};
if (a) {
var c = e.dispose;
if (c !== $telerik._disposeHandlers) {
e.dispose = $telerik._disposeHandlers;
if (typeof(c) !== "undefined") {
e._chainDispose = c;
}
}
}
},
addHandlers: function (b, c, e, a) {
for (var f in c) {
var d = c[f];
if (e) {
d = Function.createDelegate(e, d);
}
$telerik.addHandler(b, f, d, a || false);
}
},
clearHandlers: function (a) {
$telerik._clearHandlers(a, false);
},
_clearHandlers: function (c, a) {
if (c._events) {
var b = c._events;
for (var g in b) {
var e = b[g];
for (var f = e.length - 1;
f >= 0;
f--) {
var d = e[f];
if (!a || d.autoRemove) {
$telerik.removeHandler(c, g, d.handler);
}
}
}
c._events = null;
}
},
_disposeHandlers: function () {
$telerik._clearHandlers(this, true);
var a = this._chainDispose, b = typeof(a);
if (b !== "undefined") {
this.dispose = a;
this._chainDispose = null;
if (b === "function") {
this.dispose();
}
}
},
removeHandler: function (a, b, c) {
$telerik._removeHandler(a, b, c);
},
_removeHandler: function (c, d, e) {
var a = null;
var b = c._events[d] || [];
for (var f = 0, g = b.length;
f < g;
f++) {
if (b[f].handler === e) {
a = b[f].browserHandler;
break;
}
}
if ($telerik.useDetachEvent(c)) {
c.detachEvent("on" + d, a);
} else {
if (c.removeEventListener) {
c.removeEventListener(d, a, false);
}
}
b.splice(f, 1);
},
_emptySrc: function () {
return "about:blank";
},
addExternalHandler: function (a, b, c) {
if (!a) {
return;
}
if ($telerik.useAttachEvent(a)) {
a.attachEvent("on" + b, c);
} else {
if (a.addEventListener) {
a.addEventListener(b, c, false);
}
}
},
removeExternalHandler: function (a, b, c) {
if (!a) {
return;
}
if ($telerik.useDetachEvent(a)) {
a.detachEvent("on" + b, c);
} else {
if (a.addEventListener) {
a.removeEventListener(b, c, false);
}
}
},
addMobileHandler: function (g, b, c, d, f, e) {
if (!b || !g) {
return;
}
var a = Function.createDelegate(g, $telerik.isTouchDevice ? (f || d) : d);
if ($telerik.isTouchDevice) {
if ($telerik.$) {
$telerik.$(b).bind($telerik.getMobileEventCounterpart(c), a);
} else {
$telerik.addExternalHandler(b, $telerik.getMobileEventCounterpart(c), a);
}
} else {
if (e) {
$telerik.addExternalHandler(b, c, a);
} else {
$addHandler(b, c, a);
}
}
return a;
},
removeMobileHandler: function (a, b, c, e, d) {
if (!a) {
return;
}
if ($telerik.isTouchDevice) {
if ($telerik.$) {
$telerik.$(a).unbind($telerik.getMobileEventCounterpart(b), (e || c));
} else {
$telerik.removeExternalHandler(a, $telerik.getMobileEventCounterpart(b), (e || c));
}
} else {
if (d) {
$telerik.removeExternalHandler(a, b, c);
} else {
$removeHandler(a, b, c);
}
}
},
getMobileEventCounterpart: function (a) {
switch (a) {
case"mousedown":
return $telerik.isMobileIE10 ? "MSPointerDown" : "touchstart";
case"mouseup":
return $telerik.isMobileIE10 ? "MSPointerUp" : "touchend";
case"mousemove":
return $telerik.isMobileIE10 ? "MSPointerMove" : "touchmove";
}
return a;
},
getTouchEventLocation: function (b) {
var d = arguments[1], f = d ? [d + "X"] : "pageX", g = d ? [d + "Y"] : "pageY", c = {
x: b[f],
y: b[g]
}, a = b.changedTouches || (b.originalEvent ? b.originalEvent.changedTouches : b.rawEvent ? b.rawEvent.changedTouches : false);
if ($telerik.isTouchDevice && a && a.length < 2) {
c.x = a[0][f];
c.y = a[0][g];
}
if ($telerik.isMobileIE10 && b.originalEvent) {
c.x = b.originalEvent[f];
c.y = b.originalEvent[g];
}
return c;
},
getTouchTarget: function (a) {
if ($telerik.isTouchDevice) {
var b = "originalEvent" in a ? a.originalEvent.changedTouches : "rawEvent" in a ? a.rawEvent.changedTouches : a.changedTouches;
return b ? document.elementFromPoint(b[0].clientX, b[0].clientY) : a.target;
} else {
return a.target;
}
},
cancelRawEvent: function (a) {
if (!a) {
return false;
}
if (a.preventDefault) {
a.preventDefault();
}
if (a.stopPropagation) {
a.stopPropagation();
}
a.cancelBubble = true;
a.returnValue = false;
return false;
},
preventDefault: function (a) {
if (a.preventDefault) {
a.preventDefault();
}
a.returnValue = false;
return false;
},
getOuterHtml: function (a) {
if (a.outerHTML) {
return a.outerHTML;
} else {
var b = a.cloneNode(true);
var c = a.ownerDocument.createElement("div");
c.appendChild(b);
return c.innerHTML;
}
},
setVisible: function (a, b) {
if (!a) {
return;
}
if (b != $telerik.getVisible(a)) {
if (b) {
if (a.style.removeAttribute) {
a.style.removeAttribute("display");
} else {
a.style.removeProperty("display");
}
} else {
a.style.display = "none";
}
a.style.visibility = b ? "visible" : "hidden";
}
},
getVisible: function (a) {
if (!a) {
return false;
}
return (("none" != $telerik.getCurrentStyle(a, "display")) && ("hidden" != $telerik.getCurrentStyle(a, "visibility")));
},
getViewPortSize: function () {
var c = 0;
var b = 0;
var a = document.body;
if (!$telerik.quirksMode && !$telerik.isSafari) {
a = document.documentElement;
}
if (window.innerWidth) {
c = Math.max(document.documentElement.clientWidth, document.body.clientWidth);
b = Math.max(document.documentElement.clientHeight, document.body.clientHeight);
if (c > window.innerWidth) {
c = document.documentElement.clientWidth;
}
if (b > window.innerHeight) {
b = document.documentElement.clientHeight;
}
} else {
c = a.clientWidth;
b = a.clientHeight;
}
c += a.scrollLeft;
b += a.scrollTop;
if ($telerik.isMobileSafari) {
c += window.pageXOffset;
b += window.pageYOffset;
}
return {width: c - 6, height: b - 6};
},
elementOverflowsTop: function (b, a) {
var c = a || $telerik.getLocation(b);
return c.y < 0;
},
elementOverflowsLeft: function (b, a) {
var c = a || $telerik.getLocation(b);
return c.x < 0;
},
elementOverflowsBottom: function (e, c, b) {
var d = b || $telerik.getLocation(c);
var a = d.y + c.offsetHeight;
return a > e.height;
},
elementOverflowsRight: function (e, b, a) {
var c = a || $telerik.getLocation(b);
var d = c.x + b.offsetWidth;
return d > e.width;
},
getDocumentRelativeCursorPosition: function (c) {
var b = document.documentElement, a = document.body, f = ($telerik.quirksMode || a.scrollLeft > b.scrollLeft) ? $telerik.getCorrectScrollLeft(a) : $telerik.getCorrectScrollLeft(b), d = c.clientX + f, g = c.clientY + $telerik.getDocumentElementScrollTop();
if ($telerik.isIE6 || $telerik.isIE7) {
d -= 2;
g -= 2;
}
return {left: d, top: g};
},
getDocumentElementScrollTop: function () {
var b = document.documentElement, a = document.body;
return ($telerik.quirksMode || a.scrollTop > b.scrollTop) ? a.scrollTop : b.scrollTop;
},
getDocumentElementScrollLeft: function () {
var b = document.documentElement, a = document.body;
return ($telerik.quirksMode || a.scrollLeft > b.scrollLeft) ? a.scrollLeft : b.scrollLeft;
},
evalScriptCode: function (b) {
if ($telerik.isSafari) {
b = b.replace(/^\s*<!--((.|\n)*)-->\s*$/mi, "$1");
}
var a = document.createElement("script");
a.setAttribute("type", "text/javascript");
a.text = b;
var c = document.getElementsByTagName("head")[0];
c.appendChild(a);
a.parentNode.removeChild(a);
},
isScriptRegistered: function (k, a) {
if (!k) {
return 0;
}
if (!a) {
a = document;
}
if ($telerik._uniqueScripts == null) {
$telerik._uniqueScripts = {};
}
var h = document.getElementsByTagName("script");
var f = 0;
var c = k.indexOf("?d=");
var d = k.indexOf("&");
var j = c > 0 && d > c ? k.substring(c + 3, d) : k;
if ($telerik._uniqueScripts[j] != null) {
return 2;
}
for (var b = 0, e = h.length;
b < e;
b++) {
var g = h[b];
if (g.src) {
if (g.getAttribute("src", 2).indexOf(j) != -1) {
$telerik._uniqueScripts[j] = true;
if (!$telerik.isDescendant(a, g)) {
f++;
}
}
}
}
return f;
},
evalScripts: function (b, a) {
$telerik.registerSkins(b);
var g = b.getElementsByTagName("script");
var j = 0, h = 0;
var e = function (n, o) {
if (n - h > 0 && ($telerik.isIE || $telerik.isSafari)) {
window.setTimeout(function () {
e(n, o);
}, 5);
} else {
var i = document.createElement("script");
i.setAttribute("type", "text/javascript");
document.getElementsByTagName("head")[0].appendChild(i);
i.loadFinished = false;
i.onload = function () {
if (!this.loadFinished) {
this.loadFinished = true;
h++;
}
};
i.onreadystatechange = function () {
if ("loaded" === this.readyState && !this.loadFinished) {
this.loadFinished = true;
h++;
}
};
i.setAttribute("src", o);
}
};
var k = [];
for (var c = 0, d = g.length;
c < d;
c++) {
var f = g[c];
if (f.src) {
var m = f.getAttribute("src", 2);
if (!$telerik.isScriptRegistered(m, b)) {
e(j++, m);
}
} else {
Array.add(k, f.innerHTML);
}
}
var l = function () {
if (j - h > 0) {
window.setTimeout(l, 20);
} else {
for (var i = 0;
i < k.length;
i++) {
$telerik.evalScriptCode(k[i]);
}
if (a) {
a();
}
}
};
l();
},
registerSkins: function (c) {
if (!c) {
c = document.body;
}
var h = c.getElementsByTagName("link");
if (h && h.length > 0) {
var a = document.getElementsByTagName("head")[0];
if (a) {
for (var d = 0, g = h.length;
d < g;
d++) {
var k = h[d];
if (k.className == "Telerik_stylesheet") {
var l = a.getElementsByTagName("link");
if (k.href.indexOf("ie7CacheFix") >= 0) {
try {
k.href = k.href.replace("&ie7CacheFix", "");
k.href = k.href.replace("?ie7CacheFix", "");
} catch (b) {
}
}
if (l && l.length > 0) {
var f = l.length - 1;
while (f >= 0 && l[f--].href != k.href) {
}
if (f >= 0) {
continue;
}
}
if ($telerik.isIE && !$telerik.isIE9Mode) {
k.parentNode.removeChild(k);
k = k.cloneNode(true);
}
a.appendChild(k);
if (g > h.length) {
g = h.length;
d--;
}
}
}
}
}
},
getFirstChildByTagName: function (b, d, c) {
if (!b || !b.childNodes) {
return null;
}
var a = b.childNodes[c] || b.firstChild;
while (a) {
if (a.nodeType == 1 && a.tagName.toLowerCase() == d) {
return a;
}
a = a.nextSibling;
}
return null;
},
getChildByClassName: function (c, a, d) {
var b = c.childNodes[d] || c.firstChild;
while (b) {
if (b.nodeType == 1 && b.className.indexOf(a) > -1) {
return b;
}
b = b.nextSibling;
}
return null;
},
getChildrenByTagName: function (d, g) {
var c = [];
var b = d.childNodes;
if ($telerik.isIE) {
b = d.children;
}
for (var e = 0, f = b.length;
e < f;
e++) {
var a = b[e];
if (a.nodeType == 1 && a.tagName.toLowerCase() == g) {
Array.add(c, a);
}
}
return c;
},
getChildrenByClassName: function (e, d) {
var c = [];
var b = e.childNodes;
if ($telerik.isIE) {
b = e.children;
}
for (var f = 0, g = b.length;
f < g;
f++) {
var a = b[f];
if (a.nodeType == 1 && a.className.indexOf(d) > -1) {
Array.add(c, a);
}
}
return c;
},
mergeElementAttributes: function (d, e, b) {
if (!d || !e) {
return;
}
if (d.mergeAttributes) {
e.mergeAttributes(d, b);
} else {
for (var a = 0;
a < d.attributes.length;
a++) {
var c = d.attributes[a].nodeValue;
e.setAttribute(d.attributes[a].nodeName, c);
}
if ("" == e.getAttribute("style")) {
e.removeAttribute("style");
}
}
},
isMouseOverElement: function (c, b) {
var d = $telerik.getBounds(c);
var a = $telerik.getDocumentRelativeCursorPosition(b);
return $telerik.containsPoint(d, a.left, a.top);
},
isMouseOverElementEx: function (b, a) {
var f = null;
try {
f = $telerik.getOuterBounds(b);
} catch (c) {
return false;
}
if (a && a.target) {
var g = a.target.tagName;
if (g == "SELECT" || g == "OPTION") {
return true;
}
if (a.clientX < 0 || a.clientY < 0) {
return true;
}
}
var d = $telerik.getDocumentRelativeCursorPosition(a);
f.x += 2;
f.y += 2;
f.width -= 4;
f.height -= 4;
return $telerik.containsPoint(f, d.left, d.top);
},
getPreviousHtmlNode: function (a) {
if (!a || !a.previousSibling) {
return null;
}
while (a.previousSibling) {
if (a.previousSibling.nodeType == 1) {
return a.previousSibling;
}
a = a.previousSibling;
}
},
getNextHtmlNode: function (a) {
if (!a || !a.nextSibling) {
return null;
}
while (a.nextSibling) {
if (a.nextSibling.nodeType == 1) {
return a.nextSibling;
}
a = a.nextSibling;
}
},
disposeElement: function (a) {
if (typeof(Sys.WebForms) == "undefined") {
return;
}
var b = Sys.WebForms.PageRequestManager.getInstance();
if (b && b._destroyTree) {
b._destroyTree(a);
} else {
if (Sys.Application.disposeElement) {
Sys.Application.disposeElement(a, true);
}
}
},
htmlEncode: function (d) {
var a = /&/g, c = /</g, b = />/g;
return ("" + d).replace(a, "&").replace(c, "<").replace(b, ">");
},
htmlDecode: function (d) {
var a = /&/g, c = /</g, b = />/g;
return ("" + d).replace(b, ">").replace(c, "<").replace(a, "&");
}
};
if (window.$telerik == undefined) {
window.$telerik = commonScripts;
} else {
if ($telerik.$ != undefined && $telerik.$.extend) {
$telerik.$.extend(window.$telerik, commonScripts);
}
}
window.TelerikCommonScripts = Telerik.Web.CommonScripts = window.$telerik;
(function (i, g) {
function b(k, j) {
return k.indexOf(j);
}
function c(j, k) {
return j.match(k);
}
var e = i.navigator, h = e.userAgent, f, d, a;
$telerik.isTrident = b(h, " Trident/") > -1;
$telerik.isIE = (b(h, " MSIE ") > -1 || $telerik.isTrident);
$telerik.isFirefox = b(h, " Firefox/") > -1 && !$telerik.isIE;
if ($telerik.isIE) {
f = /MSIE ([\d\.]+)/;
d = c(h, f);
if (d) {
a = d[1];
} else {
f = /rv:([\d\.]+)/;
d = c(h, f);
if (d) {
a = d[1];
}
}
$telerik.isIE6 = a < 7;
$telerik.isIE7 = a == 7 || (document.documentMode && document.documentMode == 7);
$telerik.isIE8 = document.documentMode && document.documentMode == 8;
$telerik.isIE9 = document.documentMode && document.documentMode == 9;
$telerik.isIE9Mode = document.documentMode && document.documentMode >= 9;
$telerik.isIE10 = document.documentMode && document.documentMode == 10;
$telerik.isIE10Mode = document.documentMode && document.documentMode >= 10;
}
})(window);
if (typeof(Sys.Browser.WebKit) == "undefined") {
Sys.Browser.WebKit = {};
}
if (typeof(Sys.Browser.Chrome) == "undefined") {
Sys.Browser.Chrome = {};
}
if (navigator.userAgent.indexOf("Chrome") > -1) {
Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.agent = Sys.Browser.Chrome;
Sys.Browser.name = "Chrome";
} else {
if (navigator.userAgent.indexOf("WebKit/") > -1) {
Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
if (Sys.Browser.version < 500) {
Sys.Browser.agent = Sys.Browser.Safari;
Sys.Browser.name = "Safari";
} else {
Sys.Browser.agent = Sys.Browser.WebKit;
Sys.Browser.name = "WebKit";
}
}
}
$telerik.isMobileSafari = (navigator.userAgent.search(/like\sMac\sOS\sX.*Mobile\/\S+/) != -1);
$telerik.isChrome = Sys.Browser.agent == Sys.Browser.Chrome;
$telerik.isSafari6 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 536;
$telerik.isSafari5 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 534 && Sys.Browser.version < 536;
$telerik.isSafari4 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version >= 526 && Sys.Browser.version < 534;
$telerik.isSafari3 = Sys.Browser.agent == Sys.Browser.WebKit && Sys.Browser.version < 526 && Sys.Browser.version > 500;
$telerik.isSafari2 = Sys.Browser.agent == Sys.Browser.Safari;
$telerik.isSafari = $telerik.isSafari2 || $telerik.isSafari3 || $telerik.isSafari4 || $telerik.isSafari5 || $telerik.isSafari6 || $telerik.isChrome;
$telerik.isAndroid = (navigator.userAgent.search(/Android/i) != -1);
$telerik.isBlackBerry4 = (navigator.userAgent.search(/BlackBerry\d+\/4[\d\.]+/i) != -1);
$telerik.isBlackBerry5 = (navigator.userAgent.search(/BlackBerry\d+\/5[\d\.]+/i) != -1);
$telerik.isBlackBerry6 = (navigator.userAgent.search(/BlackBerry.*Safari\/\S+/i) != -1);
$telerik.isBlackBerry = $telerik.isBlackBerry4 || $telerik.isBlackBerry5 || $telerik.isBlackBerry6;
$telerik.isOpera = Sys.Browser.agent == Sys.Browser.Opera;
$telerik.isFirefox2 = $telerik.isFirefox && Sys.Browser.version < 3;
$telerik.isFirefox3 = $telerik.isFirefox && Sys.Browser.version >= 3;
$telerik.quirksMode = $telerik.isIE && document.compatMode != "CSS1Compat";
$telerik.standardsMode = !$telerik.quirksMode;
$telerik.OperaEngine = 0;
$telerik.OperaVersionString = window.opera ? window.opera.version() : 0;
$telerik.OperaVersion = $telerik.OperaVersionString ? (parseInt($telerik.OperaVersionString * 10, 10) / 10) : 0;
if ($telerik.isOpera) {
$telerik._prestoVersion = navigator.userAgent.match(/Presto\/(\d+\.(\d+)?)/);
if ($telerik._prestoVersion) {
$telerik.OperaEngine = parseInt($telerik._prestoVersion[1], 10) + (parseInt($telerik._prestoVersion[2], 10) / 100);
}
}
$telerik.isOpera9 = $telerik.isOpera && $telerik.OperaVerNumber < 10;
$telerik.isOpera10 = $telerik.isOpera && $telerik.OperaVersion >= 10 && $telerik.OperaVersion < 10.5;
$telerik.isOpera105 = $telerik.isOpera && $telerik.OperaVersion >= 10.5;
$telerik.isOpera11 = $telerik.isOpera && $telerik.OperaVersion > 11;
$telerik.isMobileOpera = $telerik.isOpera && (navigator.userAgent.search(/opera (?:mobi|tablet)/i) != -1);
$telerik.isMobileIE10 = $telerik.isIE10 && (navigator.userAgent.search(/\bARM\b;|\bTouch\b/i) != -1);
$telerik.isTouchDevice = $telerik.isMobileSafari || $telerik.isAndroid || $telerik.isBlackBerry6 || $telerik.isMobileOpera;
if ($telerik.isIE9Mode) {
document.documentElement.className += " _Telerik_IE9";
}
if ($telerik.isOpera11) {
document.documentElement.className += " _Telerik_Opera11";
} else {
if ($telerik.isOpera105) {
document.documentElement.className += " _Telerik_Opera105";
}
}
if (document.documentElement.getBoundingClientRect) {
$telerik.originalGetLocation = function (g) {
var d = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (d) {
throw d;
}
if (g.self || g.nodeType === 9 || (g === document.documentElement) || (g.parentNode === g.ownerDocument.documentElement)) {
return new Sys.UI.Point(0, 0);
}
var b = g.getBoundingClientRect();
if (!b) {
return new Sys.UI.Point(0, 0);
}
var c = g.ownerDocument.documentElement, k = Math.round(b.left) + c.scrollLeft, l = Math.round(b.top) + c.scrollTop;
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
try {
var i = g.ownerDocument.parentWindow.frameElement || null;
if (i) {
var j = (i.frameBorder === "0" || i.frameBorder === "no") ? 2 : 0;
k += j;
l += j;
}
} catch (h) {
}
if (Sys.Browser.version === 7 && !document.documentMode) {
var a = document.body, m = a.getBoundingClientRect(), n = (m.right - m.left) / a.clientWidth;
n = Math.round(n * 100);
n = (n - n % 5) / 100;
if (!isNaN(n) && (n !== 1)) {
k = Math.round(k / n);
l = Math.round(l / n);
}
}
if ((document.documentMode || 0) < 8) {
k -= c.clientLeft;
l -= c.clientTop;
}
}
return new Sys.UI.Point(k, l);
};
} else {
if ($telerik.isSafari) {
$telerik.originalGetLocation = function (c) {
var b = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (b) {
throw b;
}
if ((c.window && (c.window === c)) || c.nodeType === 9) {
return new Sys.UI.Point(0, 0);
}
var f = 0, g = 0, h, j = null, k = null, a, l;
for (h = c;
h;
j = h, k = a, h = h.offsetParent) {
a = Sys.UI.DomElement._getCurrentStyle(h);
l = h.tagName ? h.tagName.toUpperCase() : null;
if ((h.offsetLeft || h.offsetTop) && ((l !== "BODY") || (!k || k.position !== "absolute"))) {
f += h.offsetLeft;
g += h.offsetTop;
}
if (j && Sys.Browser.version >= 3) {
f += parseInt(a.borderLeftWidth, 10);
g += parseInt(a.borderTopWidth, 10);
}
}
a = Sys.UI.DomElement._getCurrentStyle(c);
var d = a ? a.position : null;
if (!d || (d !== "absolute")) {
for (h = c.parentNode;
h;
h = h.parentNode) {
l = h.tagName ? h.tagName.toUpperCase() : null;
if ((l !== "BODY") && (l !== "HTML") && (h.scrollLeft || h.scrollTop)) {
f -= (h.scrollLeft || 0);
g -= (h.scrollTop || 0);
}
a = Sys.UI.DomElement._getCurrentStyle(h);
var i = a ? a.position : null;
if (i && (i === "absolute")) {
break;
}
}
}
return new Sys.UI.Point(f, g);
};
} else {
$telerik.originalGetLocation = function (c) {
var b = Function._validateParams(arguments, [{name: "element", domElement: true}]);
if (b) {
throw b;
}
if ((c.window && (c.window === c)) || c.nodeType === 9) {
return new Sys.UI.Point(0, 0);
}
var f = 0, g = 0, h, i = null, j = null, a = null, k;
for (h = c;
h;
i = h, j = a, h = h.offsetParent) {
k = h.tagName ? h.tagName.toUpperCase() : null;
a = Sys.UI.DomElement._getCurrentStyle(h);
if ((h.offsetLeft || h.offsetTop) && !((k === "BODY") && (!j || j.position !== "absolute"))) {
f += h.offsetLeft;
g += h.offsetTop;
}
if (i !== null && a) {
if ((k !== "TABLE") && (k !== "TD") && (k !== "HTML")) {
f += parseInt(a.borderLeftWidth, 10) || 0;
g += parseInt(a.borderTopWidth, 10) || 0;
}
if (k === "TABLE" && (a.position === "relative" || a.position === "absolute")) {
f += parseInt(a.marginLeft, 10) || 0;
g += parseInt(a.marginTop, 10) || 0;
}
}
}
a = Sys.UI.DomElement._getCurrentStyle(c);
var d = a ? a.position : null;
if (!d || (d !== "absolute")) {
for (h = c.parentNode;
h;
h = h.parentNode) {
k = h.tagName ? h.tagName.toUpperCase() : null;
if ((k !== "BODY") && (k !== "HTML") && (h.scrollLeft || h.scrollTop)) {
f -= (h.scrollLeft || 0);
g -= (h.scrollTop || 0);
a = Sys.UI.DomElement._getCurrentStyle(h);
if (a) {
f += parseInt(a.borderLeftWidth, 10) || 0;
g += parseInt(a.borderTopWidth, 10) || 0;
}
}
}
}
return new Sys.UI.Point(f, g);
};
}
}
Sys.Application.add_init(function () {
try {
$telerik._borderThickness();
} catch (a) {
}
});
Telerik.Web.UI.Orientation = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.Orientation.prototype = {Horizontal: 0, Vertical: 1};
Telerik.Web.UI.Orientation.registerEnum("Telerik.Web.UI.Orientation", false);
Telerik.Web.UI.RenderMode = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.RenderMode.prototype = {Auto: 0, Classic: 1, Lite: 2, Native: 3, Mobile: 4};
Telerik.Web.UI.RenderMode.registerEnum("Telerik.Web.UI.RenderMode", false);
Telerik.Web.UI.DayOfWeek = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.DayOfWeek.prototype = {
Sunday: 0,
Monday: 1,
Tuesday: 2,
Wednesday: 3,
Thursday: 4,
Friday: 5,
Saturday: 6
};
Telerik.Web.UI.DayOfWeek.registerEnum("Telerik.Web.UI.DayOfWeek", false);
Telerik.Web.UI.RadWebControl = function (a) {
Telerik.Web.UI.RadWebControl.initializeBase(this, [a]);
this._clientStateFieldID = null;
this._renderMode = Telerik.Web.UI.RenderMode.Classic;
this._shouldUpdateClientState = true;
this._invisibleParents = [];
};
Telerik.Web.UI.RadWebControl.prototype = {
initialize: function () {
Telerik.Web.UI.RadWebControl.callBaseMethod(this, "initialize");
$telerik.registerControl(this);
if (!this.get_clientStateFieldID()) {
return;
}
var a = $get(this.get_clientStateFieldID());
if (!a) {
return;
}
a.setAttribute("autocomplete", "off");
}, dispose: function () {
$telerik.unregisterControl(this);
var c = this.get_element();
this._clearParentShowHandlers();
Telerik.Web.UI.RadWebControl.callBaseMethod(this, "dispose");
if (c) {
c.control = null;
var a = true;
if (c._events) {
for (var b in c._events) {
if (c._events[b].length > 0) {
a = false;
break;
}
}
if (a) {
c._events = null;
}
}
}
}, raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
if (!a) {
a = Sys.EventArgs.Empty;
}
c(this, a);
}
}, updateClientState: function () {
if (this._shouldUpdateClientState) {
this.set_clientState(this.saveClientState());
}
}, saveClientState: function () {
return null;
}, get_clientStateFieldID: function () {
return this._clientStateFieldID;
}, set_clientStateFieldID: function (a) {
if (this._clientStateFieldID != a) {
this._clientStateFieldID = a;
this.raisePropertyChanged("ClientStateFieldID");
}
}, get_renderMode: function () {
return this._renderMode;
}, set_renderMode: function (a) {
if (this._renderMode != a) {
this._renderMode = a;
this.raisePropertyChanged("RenderMode");
}
}, get_clientState: function () {
if (this._clientStateFieldID) {
var a = document.getElementById(this._clientStateFieldID);
if (a) {
return a.value;
}
}
return null;
}, set_clientState: function (b) {
if (this._clientStateFieldID) {
var a = document.getElementById(this._clientStateFieldID);
if (a) {
a.value = b;
}
}
}, repaint: function () {
}, canRepaint: function () {
return this.get_element().offsetWidth > 0;
}, add_parentShown: function (a) {
var b = $telerik.getInvisibleParent(a);
if (!b) {
return;
}
if (!Array.contains(this._invisibleParents, b)) {
Array.add(this._invisibleParents, b);
this._handleHiddenParent(true, b);
}
}, remove_parentShown: function (a) {
Array.remove(this._invisibleParents, a);
this._handleHiddenParent(false, a);
}, _handleHiddenParent: function (e, d) {
if (!d) {
return;
}
if (!this._parentShowDelegate) {
this._parentShowDelegate = Function.createDelegate(this, this._parentShowHandler);
}
var a = this._parentShowDelegate;
if (typeof(MutationObserver) !== "undefined") {
if (e) {
if (!this.parentShownObserver) {
this.parentShownObserver = new Telerik.Web.UI.NodeMutationObserver(a);
}
this.parentShownObserver.observe(d, {
attributes: true,
attributeOldValue: true,
attributeFilter: ["style", "class"],
subtree: false
});
} else {
if (this.parentShownObserver) {
this.parentShownObserver.disconnect(d);
if (this.parentShownObserver.isEmpty()) {
this.parentShownObserver.dispose();
this.parentShownObserver = null;
}
}
}
return;
}
var b = "DOMAttrModified";
if ($telerik.isIE) {
b = "propertychange";
}
var c = e ? $telerik.addExternalHandler : $telerik.removeExternalHandler;
c(d, b, a);
}, _parentShowHandler: function (c) {
if (c.length !== null && !isNaN(c.length)) {
var a = this;
Array.forEach(c, function (g) {
if (g.attributeName == "style" || g.attributeName == "class") {
var e = g.target;
if ("none" != $telerik.getCurrentStyle(e, "display")) {
a._runWhenParentShows(g);
}
}
});
} else {
if ($telerik.isIE) {
if (c.rawEvent) {
var c = c.rawEvent;
}
if (!c || !c.srcElement || !c.propertyName) {
return;
}
var f = c.srcElement;
if (c.propertyName == "style.display" || c.propertyName == "className") {
var b = $telerik.getCurrentStyle(f, "display");
if (b != "none") {
c.target = f;
this._runWhenParentShows(c);
}
}
} else {
if (c.attrName == "style" || c.attrName == "class") {
var d = c.target;
if ((c.currentTarget == c.target) && ("none" != $telerik.getCurrentStyle(d, "display"))) {
window.setTimeout(Function.createDelegate(this, function () {
this._runWhenParentShows(c);
}), 0);
}
}
}
}
}, _runWhenParentShows: function (a) {
var b = a.target;
this.remove_parentShown(b);
this.repaint();
}, _clearParentShowHandlers: function () {
var a = this._invisibleParents;
for (var b = 0;
b < a.length;
b++) {
this.remove_parentShown(a[b]);
}
this._invisibleParents = [];
this._parentShowDelegate = null;
}, _getChildElement: function (a) {
return $get(this.get_id() + "_" + a);
}, _findChildControl: function (a) {
return $find(this.get_id() + "_" + a);
}
};
Telerik.Web.UI.RadWebControl.registerClass("Telerik.Web.UI.RadWebControl", Sys.UI.Control);
Telerik.Web.Timer = function () {
Telerik.Web.Timer.initializeBase(this);
this._interval = 1000;
this._enabled = false;
this._timer = null;
this._timerCallbackDelegate = Function.createDelegate(this, this._timerCallback);
};
Telerik.Web.Timer.prototype = {
get_interval: function () {
return this._interval;
}, set_interval: function (a) {
if (this._interval !== a) {
this._interval = a;
this.raisePropertyChanged("interval");
if (!this.get_isUpdating() && (this._timer !== null)) {
this._stopTimer();
this._startTimer();
}
}
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (a) {
if (a !== this.get_enabled()) {
this._enabled = a;
this.raisePropertyChanged("enabled");
if (!this.get_isUpdating()) {
if (a) {
this._startTimer();
} else {
this._stopTimer();
}
}
}
}, add_tick: function (a) {
this.get_events().addHandler("tick", a);
}, remove_tick: function (a) {
this.get_events().removeHandler("tick", a);
}, dispose: function () {
this.set_enabled(false);
this._stopTimer();
Telerik.Web.Timer.callBaseMethod(this, "dispose");
}, updated: function () {
Telerik.Web.Timer.callBaseMethod(this, "updated");
if (this._enabled) {
this._stopTimer();
this._startTimer();
}
}, _timerCallback: function () {
var a = this.get_events().getHandler("tick");
if (a) {
a(this, Sys.EventArgs.Empty);
}
}, _startTimer: function () {
this._timer = window.setInterval(this._timerCallbackDelegate, this._interval);
}, _stopTimer: function () {
window.clearInterval(this._timer);
this._timer = null;
}
};
Telerik.Web.Timer.registerClass("Telerik.Web.Timer", Sys.Component);
Telerik.Web.BoxSide = function () {
};
Telerik.Web.BoxSide.prototype = {Top: 0, Right: 1, Bottom: 2, Left: 3};
Telerik.Web.BoxSide.registerEnum("Telerik.Web.BoxSide", false);
Telerik.Web.UI.WebServiceLoaderEventArgs = function (a) {
Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context = a;
};
Telerik.Web.UI.WebServiceLoaderEventArgs.prototype = {
get_context: function () {
return this._context;
}
};
Telerik.Web.UI.WebServiceLoaderEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderEventArgs", Sys.EventArgs);
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs = function (b, a) {
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this, [a]);
this._data = b;
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.prototype = {
get_data: function () {
return this._data;
}
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderSuccessEventArgs", Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoaderErrorEventArgs = function (b, a) {
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this, [a]);
this._message = b;
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.prototype = {
get_message: function () {
return this._message;
}
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderErrorEventArgs", Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoader = function (a) {
this._webServiceSettings = a;
this._events = null;
this._onWebServiceSuccessDelegate = Function.createDelegate(this, this._onWebServiceSuccess);
this._onWebServiceErrorDelegate = Function.createDelegate(this, this._onWebServiceError);
this._currentRequest = null;
};
Telerik.Web.UI.WebServiceLoader.prototype = {
get_webServiceSettings: function () {
return this._webServiceSettings;
}, get_events: function () {
if (!this._events) {
this._events = new Sys.EventHandlerList();
}
return this._events;
}, loadData: function (b, a) {
var c = this.get_webServiceSettings();
this.invokeMethod(c.get_method(), b, a);
}, invokeMethod: function (d, b, a) {
var f = this.get_webServiceSettings();
if (f.get_isEmpty()) {
alert("Please, specify valid web service and method.");
return;
}
this._raiseEvent("loadingStarted", new Telerik.Web.UI.WebServiceLoaderEventArgs(a));
var e = f.get_path();
var c = f.get_useHttpGet();
this._currentRequest = Sys.Net.WebServiceProxy.invoke(e, d, c, b, this._onWebServiceSuccessDelegate, this._onWebServiceErrorDelegate, a);
}, add_loadingStarted: function (a) {
this.get_events().addHandler("loadingStarted", a);
}, add_loadingError: function (a) {
this.get_events().addHandler("loadingError", a);
}, add_loadingSuccess: function (a) {
this.get_events().addHandler("loadingSuccess", a);
}, _serializeDictionaryAsKeyValuePairs: function (a) {
var c = [];
for (var b in a) {
c[c.length] = {Key: b, Value: a[b]};
}
return c;
}, _onWebServiceSuccess: function (b, a) {
var c = new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(b, a);
this._raiseEvent("loadingSuccess", c);
}, _onWebServiceError: function (b, a) {
var c = new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(b.get_message(), a);
this._raiseEvent("loadingError", c);
}, _raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
if (!a) {
a = Sys.EventArgs.Empty;
}
c(this, a);
}
}
};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings = function (a) {
this._path = null;
this._method = null;
this._useHttpGet = false;
this._odata = false;
if (!a) {
a = {};
}
if (typeof(a.path) != "undefined") {
this._path = a.path;
}
if (typeof(a.method) != "undefined") {
this._method = a.method;
}
if (typeof(a.useHttpGet) != "undefined") {
this._useHttpGet = a.useHttpGet;
}
};
Telerik.Web.UI.WebServiceSettings.prototype = {
get_isWcf: function () {
return /\.svc($|\/)/.test(this._path) && !this.get_isOData();
}, get_isOData: function () {
return this._odata;
}, get_path: function () {
return this._path;
}, set_path: function (a) {
this._path = a;
}, get_method: function () {
return this._method;
}, set_method: function (a) {
this._method = a;
}, get_useHttpGet: function () {
return this._useHttpGet;
}, set_useHttpGet: function (a) {
this._useHttpGet = a;
}, get_isEmpty: function () {
var b = this.get_path();
var a = this.get_method();
return (!(b && a));
}
};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");
Telerik.Web.UI.CallbackLoader = function (a) {
this._callbackSettings = a;
};
Telerik.Web.UI.CallbackLoader.prototype = {
invokeCallbackMethod: function () {
WebForm_DoCallback(this._callbackSettings._id, this._callbackSettings._arguments, this._callbackSettings._onCallbackSuccess, this._callbackSettings._context, this._callbackSettings._onCallbackError, this._callbackSettings._isAsync);
}
};
Telerik.Web.UI.CallbackLoader.registerClass("Telerik.Web.UI.CallbackLoader");
Telerik.Web.UI.CallbackSettings = function (a) {
this._id = a.id;
this._arguments = a.arguments;
this._onCallbackSuccess = a.onCallbackSuccess;
this._context = a.context;
this._onCallbackError = a.onCallbackError;
this._isAsync = a.isAsync;
};
Telerik.Web.UI.CallbackSettings.registerClass("Telerik.Web.UI.CallbackSettings");
Telerik.Web.UI.ActionsManager = function (a) {
Telerik.Web.UI.ActionsManager.initializeBase(this);
this._actions = [];
this._currentActionIndex = -1;
};
Telerik.Web.UI.ActionsManager.prototype = {
get_actions: function () {
return this._actions;
}, shiftPointerLeft: function () {
this._currentActionIndex--;
}, shiftPointerRight: function () {
this._currentActionIndex++;
}, get_currentAction: function () {
return this.get_actions()[this._currentActionIndex];
}, get_nextAction: function () {
return this.get_actions()[this._currentActionIndex + 1];
}, addAction: function (a) {
if (a) {
var b = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("executeAction", b);
this._clearActionsToRedo();
Array.add(this._actions, a);
this._currentActionIndex = this._actions.length - 1;
return true;
}
return false;
}, undo: function (d) {
if (d == null) {
d = 1;
}
if (d > this._actions.length) {
d = this._actions.length;
}
var c = 0;
var a = null;
while (0 < d-- && 0 <= this._currentActionIndex && this._currentActionIndex < this._actions.length) {
a = this._actions[this._currentActionIndex--];
if (a) {
var b = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("undoAction", b);
c++;
}
}
}, redo: function (e) {
if (e == null) {
e = 1;
}
if (e > this._actions.length) {
e = this._actions.length;
}
var d = 0;
var a = null;
var b = this._currentActionIndex + 1;
while (0 < e-- && 0 <= b && b < this._actions.length) {
a = this._actions[b];
if (a) {
var c = new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("redoAction", c);
this._currentActionIndex = b;
d++;
}
b++;
}
}, removeActionAt: function (a) {
this._actions.splice(a, 1);
if (this._currentActionIndex >= a) {
this._currentActionIndex--;
}
}, canUndo: function () {
return (-1 < this._currentActionIndex);
}, canRedo: function () {
return (this._currentActionIndex < this._actions.length - 1);
}, getActionsToUndo: function () {
if (this.canUndo()) {
return (this._actions.slice(0, this._currentActionIndex + 1)).reverse();
}
return [];
}, getActionsToRedo: function () {
if (this.canRedo()) {
return this._actions.slice(this._currentActionIndex + 1);
}
return [];
}, _clearActionsToRedo: function () {
if (this.canRedo()) {
var a = this._currentActionIndex + 2;
if (a < this._actions.length) {
this._actions.splice(a, this._actions.length - a);
}
}
}, add_undoAction: function (a) {
this.get_events().addHandler("undoAction", a);
}, remove_undoAction: function (a) {
this.get_events().removeHandler("undoAction", a);
}, add_redoAction: function (a) {
this.get_events().addHandler("redoAction", a);
}, remove_redoAction: function (a) {
this.get_events().removeHandler("redoAction", a);
}, add_executeAction: function (a) {
this.get_events().addHandler("executeAction", a);
}, remove_executeAction: function (a) {
this.get_events().removeHandler("executeAction", a);
}, raiseEvent: function (b, a) {
var c = this.get_events().getHandler(b);
if (c) {
c(this, a);
}
}
};
Telerik.Web.UI.ActionsManager.registerClass("Telerik.Web.UI.ActionsManager", Sys.Component);
Telerik.Web.UI.ActionsManagerEventArgs = function (a) {
Telerik.Web.UI.ActionsManagerEventArgs.initializeBase(this);
this._action = a;
};
Telerik.Web.UI.ActionsManagerEventArgs.prototype = {
get_action: function () {
return this._action;
}
};
Telerik.Web.UI.ActionsManagerEventArgs.registerClass("Telerik.Web.UI.ActionsManagerEventArgs", Sys.CancelEventArgs);
Telerik.Web.StringBuilder = function (a) {
this._buffer = a || [];
};
Telerik.Web.StringBuilder.prototype = {
append: function (b) {
for (var a = 0;
a < arguments.length;
a++) {
this._buffer[this._buffer.length] = arguments[a];
}
return this;
}, toString: function () {
return this._buffer.join("");
}, get_buffer: function () {
return this._buffer;
}
};
Telerik.Web.UI.RadTemplateBoundEventArgs = function (a, c, b) {
Telerik.Web.UI.RadTemplateBoundEventArgs.initializeBase(this);
this._dataItem = a;
this._template = c;
this._html = b;
};
Telerik.Web.UI.RadTemplateBoundEventArgs.prototype = {
get_dataItem: function () {
return this._dataItem;
}, set_html: function (a) {
this._html = a;
}, get_html: function (a) {
return this._html;
}, get_template: function (a) {
return this._template;
}
};
Telerik.Web.UI.RadTemplateBoundEventArgs.registerClass("Telerik.Web.UI.RadTemplateBoundEventArgs", Sys.EventArgs);
(function () {
function g() {
if ($telerik.$) {
return $telerik.$.extend.apply($telerik.$, arguments);
}
var n = arguments[0] && typeof(arguments[0]) === "object" ? arguments[0] : {};
for (var k = 1;
k < arguments.length;
k++) {
var m = arguments[k];
if (m != null) {
for (var l in m) {
var j = m[l];
if (typeof(j) !== "undefined") {
n[l] = j;
}
}
}
}
return n;
}
function b(j, l) {
if (l) {
return "'" + j.split("'").join("\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") + "'";
} else {
var i = j.charAt(0), k = j.substring(1);
if (i === "=") {
return "+(" + k + ")+";
} else {
if (i === ":") {
return "+e(" + k + ")+";
} else {
return ";" + j + ";o+=";
}
}
}
}
var a = /^\w+/, d = /\${([^}]*)}/g, e = /\\}/g, c = /__CURLY__/g, f = /\\#/g, h = /__SHARP__/g;
Telerik.Web.UI.Template = {
paramName: "data", useWithBlock: true, render: function (m, i) {
var k, l, j = "";
for (k = 0, l = i.length;
k < l;
k++) {
j += m(i[k]);
}
return j;
}, compile: function (q, m) {
var p = g({}, this, m), n = p.paramName, i = n.match(a)[0], r = p.useWithBlock, k = "var o,e=$telerik.htmlEncode;", o, l;
if (typeof(q) === "function") {
if (q.length === 2) {
return function (s) {
return q($telerik.$ || jQuery, {data: s}).join("");
};
}
return q;
}
k += r ? "with(" + n + "){" : "";
k += "o=";
o = q.replace(e, "__CURLY__").replace(d, "#=e($1)#").replace(c, "}").replace(f, "__SHARP__").split("#");
for (l = 0;
l < o.length;
l++) {
k += b(o[l], l % 2 === 0);
}
k += r ? ";}" : ";";
k += "return o;";
k = k.replace(h, "#");
try {
return new Function(i, k);
} catch (j) {
throw new Error(String.format("Invalid template:'{0}' Generated code:'{1}'", q, k));
}
}
};
})();
(function () {
var a = $telerik;
var n = "touch";
var j = "pointer";
var f = "mouse";
var o = /touch/gi;
var k = /pointer/gi;
var g = /mouse/gi;
var d = 1;
var h = "pageX";
var i = "pageY";
var b = "clientX";
var c = "clientY";
var l = "screenX";
var m = "screenY";
var e = [h, i, b, c, l, m];
a.getEventLocation = function (q) {
var w = q.originalEvent || null;
var p = (w && w.changedTouches) ? w.changedTouches : [];
var s = w || q;
var r = {};
var u = e.length;
var t = null;
var v = null;
if (p && p.length === 1) {
s = p[0];
}
for (t = 0;
t < u;
t++) {
v = e[t];
r[v] = s[v] || q[v];
}
return r;
};
a.getTouchLocation = function (t) {
var q = {};
var s = null;
var r = e.length;
var p = null;
for (p = 0;
p < r;
p++) {
s = e[p];
q[s] = t[s];
}
return q;
};
a.getTouches = function (t) {
var w = t.type;
var v = null;
var u = t.currentTarget;
var y = t.originalEvent || null;
var z = [];
var p = null;
var s = null;
var q = (y && y.changedTouches) ? y.changedTouches : [];
var r = q.length;
var x = null;
v = a.getEventLocation(t);
if (w.match(o)) {
for (x = 0;
x < r;
x++) {
p = q[x];
s = a.getTouchLocation(p);
z.push({type: n, target: p.target, currentTarget: u, id: p.identifier, location: s, event: t});
}
} else {
if (w.match(k)) {
z.push({type: j, target: t.target, currentTarget: u, id: y.pointerId, location: v, event: t});
} else {
if (w.match(g)) {
z.push({type: f, target: t.target, currentTarget: u, id: d, location: v, event: t});
} else {
z.push({type: w, target: t.target, currentTarget: u, id: d, location: v, event: t});
}
}
}
return z;
};
})();
(function () {
if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) {
Sys.WebForms.PageRequestManager.prototype._onFormElementClick = function (a) {
if (window.navigator.msPointerEnabled) {
this._activeDefaultButtonClicked = (a.target === this._activeDefaultButton);
this._onFormElementActive(a.target, parseInt(a.offsetX, 10), parseInt(a.offsetY, 10));
} else {
this._activeDefaultButtonClicked = (a.target === this._activeDefaultButton);
this._onFormElementActive(a.target, a.offsetX, a.offsetY);
}
};
}
}());
(function (b) {
Type.registerNamespace("Telerik.Web.UI");
var a = Telerik.Web.UI;
a.NodeMutationObserver = function (c) {
this.callback = c;
this.mutations = [];
};
a.NodeMutationObserver.prototype = {
observe: function (d, e) {
if (typeof(MutationObserver) === "undefined") {
return;
}
var c = new MutationObserver(this.callback);
c.observe(d, e);
this.mutations.push({node: d, mutation: c});
}, disconnect: function (d) {
var c = this.findMutationIndex(d);
if (c == -1) {
return;
}
var e = this.mutations[c];
e.mutation.disconnect();
Array.removeAt(this.mutations, c);
}, findMutationIndex: function (e) {
var d = this.mutations;
for (var c = 0;
c < d.length;
c++) {
var f = d[c];
if (f.node === e) {
return c;
}
}
return -1;
}, isEmpty: function () {
return this.mutations.length === 0;
}, dispose: function () {
while (this.mutations.length) {
this.mutations.pop().mutation.disconnect();
}
this.callback = null;
}
};
})();
/* END Telerik.Web.UI.Common.Core.js */
/* START Telerik.Web.UI.Grid.RadGridScripts.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumn = function (a) {
Telerik.Web.UI.GridColumn.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._selected;
this._selectedCellsCount = 0;
this._resizeTolerance = $telerik.isTouchDevice ? 10 : 5;
this._onMouseUpDelegate = null;
this._columnResizer = null;
this._checkboxes = [];
this._onContextMenuItemClickingDelegate = null;
this._onContextMenuHiddenDelegate = null;
this._supportedStringAggregatesValues = {
"System.String": {
Count: true,
CountDistinct: true,
None: true,
Custom: true
},
"System.DateTime": {
None: true,
Min: true,
Max: true,
Last: true,
First: true,
Count: true,
CountDistinct: true,
Custom: true
}
};
this._supportedColumnTypesForAggregation = ["GridDateTimeColumn", "GridBoundColumn", "GridTemplateColumn", "GridMaskedColumn", "GridNumericColumn", "GridCalculatedColumn"];
this._oldTitle = null;
if (Sys.UI.DomElement.containsCssClass(a, "rgRotateHeader") && a.children.length == 0) {
var b = document.createElement("span");
b.innerHTML = a.innerHTML;
a.innerHTML = "";
a.appendChild(b);
}
};
Telerik.Web.UI.GridColumn.prototype = {
initialize: function () {
Telerik.Web.UI.GridColumn.callBaseMethod(this, "initialize");
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._onMouseDownHandler);
this.get_element().UniqueName = this.get_uniqueName();
this._onLocalMouseMoveDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousemove", this._onLocalMouseMoveHandler);
if (!$telerik.isTouchDevice) {
$addHandlers(this.get_element(), {click: Function.createDelegate(this, this._onClick)});
$addHandlers(this.get_element(), {dblclick: Function.createDelegate(this, this._onDblClick)});
$addHandlers(this.get_element(), {mouseover: Function.createDelegate(this, this._onMouseOver)});
$addHandlers(this.get_element(), {mouseout: Function.createDelegate(this, this._onMouseOut)});
}
var a = this._owner._owner;
var b = a.ClientSettings;
if ($telerik.isMobileIE10 && (b.AllowColumnsReorder || (b.Resizing && b.Resizing.AllowColumnResize))) {
this.get_element().style.msTouchAction = "none";
}
if ($telerik.isOpera) {
$addHandlers(this.get_element(), {mousedown: Function.createDelegate(this, this._onContextMenu)});
} else {
$addHandlers(this.get_element(), {contextmenu: Function.createDelegate(this, this._onContextMenu)});
}
this._selectedCellsCount = this._data.SelectedCellsCount;
this.Display = this._data.Display;
this._oldTitle = this.get_element().title;
if (this._data.ListOfFilterValues && this._data.ListOfFilterValues.length > 0) {
a._checkListFilterKeys[a._checkListFilterKeys.length] = this.get_owner()._data.UniqueID + "," + this.get_uniqueName();
a._checkListFilterValues[a._checkListFilterValues.length] = this._data.ListOfFilterValues;
}
this._initializeBindingMethods();
}, dispose: function () {
if (this._columnResizer) {
this._columnResizer.dispose();
}
this._owner._owner.raise_columnDestroying(Sys.EventArgs.Empty);
$clearHandlers(this.get_element());
this._checkboxes = [];
this._element.control = null;
this._owner = null;
Telerik.Web.UI.GridColumn.callBaseMethod(this, "dispose");
}, get_owner: function () {
return this._owner;
}, get_selected: function () {
var a = false;
if (this._owner._owner.get_allowColumnSelection() && this._selectedCellsCount > 0 && this._selectedCellsCount == this.get_realOwner().get_dataItems().length) {
a = true;
}
return a;
}, set_selected: function (a) {
if (this._owner._owner.get_allowColumnSelection()) {
if (a) {
if (!this._owner._owner.get_allowMultiColumnSelection()) {
this.get_realOwner().clearSelectedColumns();
}
this._owner._owner._cellSelection._selectColumnByHeaderElement(this.get_realOwner(), this.get_element());
this._selectedCellsCount = this._owner.get_dataItems().length;
} else {
this._owner._owner._cellSelection._deselectColumnByHeaderElement(this.get_realOwner(), this.get_element());
this._selectedCellsCount = 0;
}
}
}, get_realOwner: function () {
if (this._owner.get_id() == this._owner._owner.get_masterTableView().get_id() + "_Header") {
return this._owner._owner.get_masterTableView();
} else {
return $find(this._owner.get_id());
}
}, get_selectedCellsCount: function () {
return this._selectedCellsCount;
}, set_selectedCellsCount: function (a) {
this._selectedCellsCount = a;
}, _initializeBindingMethods: function () {
var a = Telerik.Web.UI.Grid[this._data.ColumnType] || Telerik.Web.UI.Grid.GridBoundColumn, c = (function () {
}), b;
if (a) {
for (b in a) {
this[b] = a[b];
}
this.initializeCell = this.initializeCell || c;
this.populateCell = this.populateCell || c;
this.populateEditCell = this.populateEditCell || c;
}
}, _onMouseDownHandler: function (a) {
if ((a.button != Sys.UI.MouseButton.leftButton || Telerik.Web.UI.Grid._moveHeaderDiv) && !($telerik.isTouchDevice)) {
return false;
}
var b = this.get_owner().get_owner();
var c = b._animation && b._animation.ColumnAnimation;
var f = $telerik.isTouchDevice && this._isTouchPointOverResizeHandle(a) && this._owner._owner.ClientSettings && this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable();
if (!c) {
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
}
if ($telerik.isTouchDevice) {
this._canDragDrop = true;
if (f) {
this._canResize = true;
}
}
if (b.ClientSettings.AllowDragToGroup || b.ClientSettings.AllowColumnsReorder) {
var d = b.ClientSettings.AllowColumnsReorder && c && b.ClientSettings.Animation.AllowColumnReorderAnimation && b.ClientSettings.ColumnsReorderMethod === 1;
if (!d) {
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._onMouseMoveHandler, null, true);
}
if (this._canDragDrop && !f && ((this._data.Reorderable && b.ClientSettings.AllowColumnsReorder) || (this._data.Groupable && b.ClientSettings.AllowDragToGroup))) {
if (c) {
b._animation.ColumnAnimation._mouseDown(a, this);
} else {
Telerik.Web.UI.Grid.CreateDragDrop(a, this, true);
}
}
}
if (this._canResize && (a.button == 0 || $telerik.isTouchDevice)) {
if (this._isMouseOverResizeHandle(a)) {
this._columnResizer = new Telerik.Web.UI.GridColumnResizer(this, b.ClientSettings.Resizing.EnableRealTimeResize);
this._columnResizer._position(a);
this._owner._owner._isResize = true;
}
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
}, _onMouseUpHandler: function (f) {
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
this._onMouseUpDelegate = null;
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(document, "mousemove", this._onMouseMoveDelegate, null, true);
this._onMouseMoveDelegate = null;
}
if (!Telerik.Web.UI.Grid) {
return;
}
var d;
if ($telerik.isTouchDevice) {
d = $telerik.getTouchTarget(f);
} else {
d = Telerik.Web.UI.Grid.GetCurrentElement(f);
}
var k = false;
var i = this._owner;
if (d != null && this._canDragDrop && !this._owner._owner._isResize) {
var j = this._owner._owner.ClientSettings.PostBackFunction;
j = j.replace("{0}", this._owner._owner.UniqueID);
if (i._owner.ClientSettings.AllowDragToGroup && i._owner._groupPanel) {
var h = false;
if ($telerik.isMouseOverElement(i._owner._groupPanel.get_element(), f)) {
h = true;
}
if ((Telerik.Web.UI.Grid.IsChildOf(d, this._owner._owner._groupPanel.get_element()) || ($telerik.isTouchDevice && d == this._owner._owner._groupPanel.get_element())) || h) {
if (this._data.Groupable) {
k = true;
this._owner.groupColumn(this.get_element().UniqueName);
}
}
}
if (this._owner._owner.ClientSettings.AllowColumnsReorder && Telerik.Web.UI.Grid.IsChildOf(d, this.get_element().parentNode) && d != this.get_element()) {
var g = d.parentNode;
while (g != null && (typeof(g.UniqueName) == "undefined")) {
g = g.parentNode;
}
if (g != null && typeof(g.UniqueName) != "undefined" && g.UniqueName != this.get_uniqueName()) {
d = g;
}
if (typeof(d.UniqueName) != "undefined" && this._canDropOnThisColumn(d.UniqueName) && this.get_reorderable()) {
if (!this._owner._owner.ClientSettings.ReorderColumnsOnClient) {
var b = this._owner.getColumnByUniqueName(this.get_element().UniqueName);
var c = this._owner.getColumnByUniqueName(d.UniqueName);
var a = new Sys.CancelEventArgs();
a.get_gridSourceColumn = function () {
return b;
};
a.get_gridTargetColumn = function () {
return c;
};
this._owner._owner.raise_columnSwapping(a);
if (a.get_cancel()) {
return false;
}
k = true;
j = j.replace("{1}", "ReorderColumns," + this._owner._data.UniqueID + "," + this.get_element().UniqueName + "," + d.UniqueName);
eval(j);
} else {
if (this._owner._owner.ClientSettings.ColumnsReorderMethod == 1) {
this._owner.reorderColumns(this.get_element().UniqueName, d.UniqueName);
} else {
this._owner.swapColumns(this.get_element().UniqueName, d.UniqueName);
}
k = true;
}
}
}
}
if (!this._owner._owner._animation || !this._owner._owner.ClientSettings.Animation || !this._owner._owner.ClientSettings.Animation.AllowColumnRevertAnimation || k) {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
this._owner._owner._isResize = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _onMouseMoveHandler: function (a) {
if (this._canDragDrop) {
if (!this.get_element()) {
return;
}
if ($telerik.isTouchDevice) {
a.preventDefault();
}
Telerik.Web.UI.Grid.MoveDragDrop(a, this, true);
}
}, _onLocalMouseMoveHandler: function (f) {
if (!Telerik.Web.UI.Grid || $telerik.isTouchDevice) {
return;
}
this._canDragDrop = true;
this._canResize = false;
if (this._owner._owner._isResize) {
return;
}
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
var g = Telerik.Web.UI.Grid.GetFirstParentByTagName(d, "th");
var h = Telerik.Web.UI.Grid.FindPosX(d);
var b = !!this._owner._owner.ClientSettings.AllowDragToGroup && this._data.Groupable;
var c = !!this._owner._owner.ClientSettings.AllowColumnsReorder && this.get_reorderable();
if (b || c) {
this.get_element().title = this._owner._owner.ClientSettings.ClientMessages.DragToGroupOrReorder;
this.get_element().style.cursor = "move";
}
if (this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable() && Telerik.Web.UI.Grid.GetEventPosX(f) >= (h + g.offsetWidth - 5) && !Telerik.Web.UI.Grid._moveHeaderDiv) {
this._canDragDrop = false;
}
if (this._owner._owner.ClientSettings && this._owner._owner.ClientSettings.Resizing.AllowColumnResize && this.get_resizable() && this.get_element().tagName.toLowerCase() == "th") {
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
if (this._owner._owner.GridDataDiv && !this._owner._owner.GridHeaderDiv && !window.netscape) {
var a = 0;
if (document.body.currentStyle && document.body.currentStyle.margin && document.body.currentStyle.marginLeft.indexOf("px") != -1 && !window.opera) {
a = parseInt(document.body.currentStyle.marginLeft);
}
this._resizeTolerance = 10;
}
if (this._isMouseOverResizeHandle(f) && !Telerik.Web.UI.Grid._moveHeaderDiv) {
this.get_element().style.cursor = "e-resize";
if (this.get_element().title !== this._owner._owner.ClientSettings.ClientMessages.DragToResize) {
this._oldTitle = this.get_element().title;
}
this.get_element().title = this._owner._owner.ClientSettings.ClientMessages.DragToResize;
this._canResize = true;
d.style.cursor = "e-resize";
} else {
if (this.get_element().style.cursor != "move") {
this.get_element().style.cursor = "";
d.style.cursor = "";
this.get_element().title = this._oldTitle;
}
if (d.style.cursor == "e-resize") {
d.style.cursor = "";
}
this._canResize = false;
}
}
}, _canDropOnThisColumn: function (c) {
if (typeof(this._owner._columns) == "undefined") {
this._owner._columns = {};
for (var a = 0;
a < this._owner._data._columnsData.length;
a++) {
this._owner._columns[this._owner._data._columnsData[a].UniqueName] = this._owner._data._columnsData[a];
}
}
var b = true;
if (this._owner._hasMultiHeaders) {
b = this.get_columnGroupName() == this._owner._columns[c].ColumnGroupName;
}
return this._owner._columns[c].Reorderable && b;
}, showHeaderMenu: function (a, b, c) {
if (this._owner._data.enableHeaderContextMenu) {
this._initHeaderContextMenu(a, true, b, c);
}
}, _shouldShowAggregatesMenuForColumn: function () {
return this.get_owner()._data.enableHeaderContextAggregatesMenu && Array.contains(this._supportedColumnTypesForAggregation, this._data.ColumnType);
}, _initHeaderContextAggregatesMenu: function (d) {
if (d.findItemByValue("AggregatesContainer")) {
var a = d.findItemByValue("AggregatesContainer");
if (this._shouldShowAggregatesMenuForColumn()) {
a.set_visible(true);
var c = a.get_items();
for (var e = 0, f = c.get_count();
e < f;
e++) {
var b = c.getItem(e);
b._column = this;
if (this._supportedStringAggregatesValues[this.get_dataType()] && !this._supportedStringAggregatesValues[this.get_dataType()][b.get_value()]) {
b.set_visible(false);
} else {
b.set_visible(true);
}
}
} else {
a.set_visible(false);
}
}
}, _initHeaderContextMenu: function (m, r, z, A) {
if (this._owner._owner._getHeaderContextMenu()) {
var h = this._owner._owner._getHeaderContextMenu();
var k = this;
if (h._shown) {
h.hide();
}
var l = k._data.DataField;
if (k._data.DataTextField) {
l = k._data.DataTextField;
} else {
if (k._data.DataAlternateTextField) {
l = k._data.DataAlternateTextField;
}
}
this._onContextMenuItemClickingDelegate = Function.createDelegate(h, this._onContextMenuItemClicking);
h.add_itemClicking(this._onContextMenuItemClickingDelegate);
this._onContextMenuHiddenDelegate = Function.createDelegate(this, this._onContextMenuHidden);
h.add_hidden(this._onContextMenuHiddenDelegate);
this._initHeaderContextAggregatesMenu(h);
if (h.findItemByValue("SortAsc")) {
h.findItemByValue("SortAsc")._column = k;
}
if (h.findItemByValue("SortDesc")) {
h.findItemByValue("SortDesc")._column = k;
}
if (h.findItemByValue("SortNone")) {
h.findItemByValue("SortNone")._column = k;
}
if (h.findItemByValue("GroupBy")) {
var s = h.findItemByValue("GroupBy");
if (k._data.Groupable) {
h.findItemByValue("GroupBy")._column = k;
s.set_visible(true);
} else {
s.set_visible(false);
}
}
if (h.findItemByValue("UnGroupBy")) {
var s = h.findItemByValue("UnGroupBy");
if (k._data.Groupable) {
h.findItemByValue("UnGroupBy")._column = k;
s.set_visible(true);
} else {
s.set_visible(false);
}
}
if (h.findItemByValue("topGroupSeperator")) {
h.findItemByValue("topGroupSeperator").set_visible(k._data.Groupable);
}
if (h.findItemByValue("bottomGroupSeperator")) {
h.findItemByValue("bottomGroupSeperator").set_visible(k._data.Groupable);
}
if (this._owner._data.enableHeaderContextFilterMenu && this._owner._data.AllowFilteringByColumn && k._data.AllowFiltering) {
if (h.findItemByValue("FilterMenuParent")) {
h.findItemByValue("FilterMenuParent").set_enabled(true);
h.findItemByValue("FilterMenuParent").set_visible(true);
}
if (h.findItemByValue("filterMenuSeparator")) {
h.findItemByValue("filterMenuSeparator").set_visible(true);
}
if (h.FilterControlsIDsHelper == null || typeof(h.FilterControlsIDsHelper) == "undefined") {
h.FilterControlsIDsHelper = {
IdPrefix: "HCFM",
IdSuffix: {FirstCond: "FirstCond", SecondCond: "SecondCond"},
FilterControl: {
CheckBox: "CB",
RadComboBox: "RCMB",
RadTextBox: "RTB",
RadDateInput: "RDI",
RadDatePicker: "RDP",
RadDateTimePicker: "RDTP",
RadTimePicker: "RTP",
RadNumericBox: "RNTB",
RadMaskedBox: "RMTB",
FilterButton: "FilterButton",
ClearFilterButton: "ClearFilterButton"
},
FirstFilterValueControl: null,
SecondFilterValueControl: null,
FilterControlsType: null,
getFilterControlID: function (i, e) {
return this.IdPrefix + i + e;
}
};
}
if (h.findItemByValue("FilterMenuParent") && h.findItemByValue("FilterMenuContainer") && k._data.AllowFiltering) {
h.trackChanges();
this._onContextMenuItemClosingDelegate = Function.createDelegate(h, this._onContextMenuItemClosing);
h.add_itemClosing(this._onContextMenuItemClosingDelegate);
var o = h.findItemByValue("FilterMenuContainer");
h.commitChanges();
this._updateDisplayHCMenuFilterControls(o.get_element(), h.FilterControlsIDsHelper);
this._updateFilterFunctionsForHCMenu(o.get_element(), h.FilterControlsIDsHelper);
this._updateFilterValuesForHCMenu(h.FilterControlsIDsHelper);
var n = $telerik.findElement(h.findItemByValue("FilterMenuContainer").get_element(), "HCFMFilterButton");
this._filterButtonClickDelegate = Function.createDelegate(this, this._filterButtonClickHandler);
$addHandler(n, "click", this._filterButtonClickDelegate);
var d = $telerik.findElement(h.findItemByValue("FilterMenuContainer").get_element(), "HCFMClearFilterButton");
d.onclick = "";
this._clearFilterButtonClickDelegate = Function.createDelegate(this, this._clearFilterButtonClickHandler);
$addHandler(d, "click", this._clearFilterButtonClickDelegate);
}
} else {
if (h.findItemByValue("FilterMenuParent") && this._owner._data.AllowFilteringByColumn) {
h.findItemByValue("FilterMenuParent").set_enabled(false);
} else {
if (h.findItemByValue("FilterMenuParent")) {
h.findItemByValue("FilterMenuParent").set_visible(false);
}
}
if (h.findItemByValue("filterMenuSeparator") && !this._owner._data.AllowFilteringByColumn) {
h.findItemByValue("filterMenuSeparator").set_visible(false);
}
}
var b = h.findItemByValue("BestFit");
if (b) {
b.set_visible(this.get_resizable());
b._column = this.get_resizable() ? this : null;
}
var c = h.findItemByValue("bestFitSeparator");
if (c) {
c.set_visible(b.get_visible());
}
if ($telerik.isIE6 && !h._detached) {
h._detach();
h._getContextMenuElement().style.visibility = "hidden";
h._getContextMenuElement().style.display = "block";
h.repaint();
}
var t = null;
var g = h.findItemByValue("ColumnsContainer");
if (g) {
t = h.findItemByValue("ColumnsContainer").get_items();
}
if (t) {
for (var p = 0, w = t.get_count();
p < w;
p++) {
var s = t.getItem(p);
s.set_visible(false);
for (var u = 0, x = k.get_owner().get_columns().length;
u < x;
u++) {
var f = k.get_owner().get_columns()[u];
if (s.get_value() == String.format("{0}|{1}", k.get_owner()._data.ClientID, f.get_uniqueName())) {
s.set_visible(true);
var q = s.get_element().getElementsByTagName("input");
if (q && q.length && q[0].type == "checkbox") {
$addHandler(q[0], "click", this._checkBoxClickHandler);
if (f.get_visible() && (f._data.Display == null || f._data.Display) && (f.Display == null || f.Display)) {
q[0].checked = true;
} else {
q[0].checked = false;
}
q[0]._column = f;
q[0]._index = u;
Array.add(this._checkboxes, q[0]);
break;
}
}
}
}
this._handleColumnsCheckboxesState();
}
var a = new Telerik.Web.UI.GridHeaderMenuCancelEventArgs(this, m, h);
this._owner._owner.raise_headerMenuShowing(a);
if (a.get_cancel()) {
return;
}
if (r) {
var y = $telerik.getLocation(this.get_element());
if (y) {
var v = y.x;
var B = y.y;
if (z) {
v = v + parseInt(z);
}
if (A) {
B = B + parseInt(A);
}
h.showAt(v, B);
$telerik.cancelRawEvent(m);
}
} else {
h.show(m);
}
}
}, _updateFilterValuesForHCMenu: function (g) {
var c = this._data.CurrentFilterValue;
var a = this._data.AndCurrentFilterValue;
if (g.FirstFilterValueControl) {
if (g.FilterControlsType == g.FilterControl.CheckBox) {
if (c.toString().toLowerCase() == "true") {
g.FirstFilterValueControl.checked = true;
} else {
g.FirstFilterValueControl.checked = false;
}
} else {
if (g.FilterControlsType == g.FilterControl.RadTextBox || g.FilterControlsType == g.FilterControl.RadMaskedBox || g.FilterControlsType == g.FilterControl.RadNumericBox) {
g.FirstFilterValueControl.set_value(c);
} else {
if (g.FilterControlsType == g.FilterControl.RadDateInput || g.FilterControlsType == g.FilterControl.RadDatePicker || g.FilterControlsType == g.FilterControl.RadDateTimePicker || g.FilterControlsType == g.FilterControl.RadTimePicker) {
var d = Date.parseLocale(c);
if (!d) {
try {
d = new Date(c);
} catch (f) {
}
}
if (!isNaN(d) && d != null && typeof(d) != "undefined") {
g.FirstFilterValueControl.set_selectedDate(d);
}
}
}
}
}
if (g.SecondFilterValueControl) {
if (g.FilterControlsType == g.FilterControl.CheckBox) {
if (a.toString().toLowerCase() == "true") {
g.SecondFilterValueControl.checked = true;
} else {
g.SecondFilterValueControl.checked = false;
}
} else {
if (g.FilterControlsType == g.FilterControl.RadTextBox || g.FilterControlsType == g.FilterControl.RadMaskedBox || g.FilterControlsType == g.FilterControl.RadNumericBox) {
g.SecondFilterValueControl.set_value(a);
} else {
if (g.FilterControlsType == g.FilterControl.RadDateInput || g.FilterControlsType == g.FilterControl.RadDatePicker || g.FilterControlsType == g.FilterControl.RadDateTimePicker || g.FilterControlsType == g.FilterControl.RadTimePicker) {
var b = Date.parseLocale(a);
if (!b) {
try {
b = new Date(a);
} catch (f) {
}
}
if (!isNaN(b) && b != null && typeof(b) != "undefined") {
g.SecondFilterValueControl.set_selectedDate(b);
}
}
}
}
}
}, _updateFilterFunctionsForHCMenu: function (e, f) {
var d = this._data.CurrentFilterFunctionName;
var a = this._data.AndCurrentFilterFunctionName;
var c = f.getFilterControlID(f.FilterControl.RadComboBox, f.IdSuffix.FirstCond);
var b = $telerik.findControl(e, c);
this._setUpHeaderContextMenuFilterControls(b, d, this._data.DataTypeName, this._data.FilterListOptions);
c = f.getFilterControlID(f.FilterControl.RadComboBox, f.IdSuffix.SecondCond);
b = $telerik.findControl(e, c);
this._setUpHeaderContextMenuFilterControls(b, a, this._data.DataTypeName, this._data.FilterListOptions);
}, _updateDisplayHCMenuFilterControls: function (a, b) {
this._updateDisplayHCFilterBoundColumnControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterBoundColumnControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterCheckBoxColumnControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterCheckBoxColumnControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDatePicker, "DatePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDatePicker, "DatePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateTimePicker, "DateTimePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateTimePicker, "DateTimePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadTimePicker, "TimePicker", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadTimePicker, "TimePicker", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateInput, "None", b.IdSuffix.FirstCond);
this._updateDisplayHCFilterPickerControls(a, b, b.FilterControl.RadDateInput, "None", b.IdSuffix.SecondCond);
this._updateDisplayHCFilterMaskedBoxControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterMaskedBoxControls(a, b, b.IdSuffix.SecondCond);
this._updateDisplayHCFilterNumericBoxControls(a, b, b.IdSuffix.FirstCond);
this._updateDisplayHCFilterNumericBoxControls(a, b, b.IdSuffix.SecondCond);
}, _updateDisplayHCFilterBoundColumnControls: function (b, c, d) {
var a = c.getFilterControlID(c.FilterControl.RadTextBox, d);
var e = $telerik.findControl(b, a);
if (e) {
if (this._data.ColumnType != "GridDateTimeColumn" && this._data.ColumnType != "GridMaskedColumn" && this._data.ColumnType != "GridNumericColumn" && this._data.ColumnType != "GridCheckBoxColumn" && this._data.DataTypeName != "System.Boolean" && this._data.ColumnType != "GridRatingColumn") {
if (d == c.IdSuffix.FirstCond) {
c.FirstFilterValueControl = e;
} else {
c.SecondFilterValueControl = e;
}
c.FilterControlsType = c.FilterControl.RadTextBox;
e.set_visible(true);
if (this._data.FilterControlWidth) {
e._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(e._originalTextBoxCssText, this._data.FilterControlWidth.Value);
}
} else {
e.set_visible(false);
}
}
}, _updateDisplayHCFilterPickerControls: function (d, e, c, g, f) {
var a = e.getFilterControlID(c, f);
var b = $telerik.findControl(d, a);
if (b) {
if (this._data.PickerType != g) {
b.set_visible(false);
} else {
if (f == e.IdSuffix.FirstCond) {
e.FirstFilterValueControl = b;
} else {
e.SecondFilterValueControl = b;
}
e.FilterControlsType = c;
b.set_visible(true);
if (this._data.FilterControlWidth) {
if (c == e.FilterControl.RadDateInput) {
b._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(b._originalTextBoxCssText, this._data.FilterControlWidth.Value);
} else {
this._adjustHCFilterMenuPickerControlsWidth(b, this._data.FilterControlWidth.Value);
}
}
if (this._data.MinDate) {
b.set_minDate(new Date(this._data.MinDate));
}
if (this._data.MaxDate) {
b.set_maxDate(new Date(this._data.MaxDate));
}
}
}
}, _updateDisplayHCFilterCheckBoxColumnControls: function (c, d, e) {
var b = d.getFilterControlID(d.FilterControl.CheckBox, e);
var a = $telerik.findElement(c, b);
if (a) {
if (this._data.ColumnType == "GridCheckBoxColumn" || this._data.DataTypeName == "System.Boolean") {
a.style.display = "block";
if (e == d.IdSuffix.FirstCond) {
d.FirstFilterValueControl = a;
d.FilterControlsType = d.FilterControl.CheckBox;
} else {
d.SecondFilterValueControl = a;
d.FilterControlsType = d.FilterControl.CheckBox;
}
} else {
a.style.display = "none";
}
}
}, _updateDisplayHCFilterMaskedBoxControls: function (c, e, f) {
var b = e.getFilterControlID(e.FilterControl.RadMaskedBox, f);
var a = $telerik.findControl(c, b);
if (a) {
if (this._data.ColumnType != "GridMaskedColumn") {
a.set_visible(false);
} else {
if (f == e.IdSuffix.FirstCond) {
e.FirstFilterValueControl = a;
} else {
e.SecondFilterValueControl = a;
}
e.FilterControlsType = e.FilterControl.RadMaskedBox;
a.set_visible(true);
if (this._data.Mask != null && typeof(this._data.Mask) != "undefined") {
var g = [];
var h = this._data.Mask.split(",");
for (var d = 0;
d < h.length;
d++) {
g.push(eval(h[d]));
}
a._length = 0;
a._setMask(g);
if (this._data.FilterControlWidth) {
a._originalTextBoxCssText = this._adjustHCFilterMenuInputControlsWidth(a._originalTextBoxCssText, this._data.FilterControlWidth.Value);
}
}
}
}
}, _updateDisplayHCFilterNumericBoxControls: function (c, d, e) {
var b = d.getFilterControlID(d.FilterControl.RadNumericBox, e);
var a = $telerik.findControl(c, b);
if (a) {
if (this._data.ColumnType != "GridNumericColumn" && this._data.ColumnType != "GridRatingColumn") {
a.set_visible(false);
} else {
d.FilterControlsType = d.FilterControl.RadNumericBox;
if (e == d.IdSuffix.FirstCond) {
d.FirstFilterValueControl = a;
} else {
d.SecondFilterValueControl = a;
}
var f = a.get_numberFormat();
if (this._data.NegativePattern != null && typeof(this._data.NegativePattern) != "undefined") {
f.NegativePattern = this._data.NegativePattern;
}
if (this._data.PositivePattern != null && typeof(this._data.PositivePattern) != "undefined") {
f.PositivePattern = this._data.PositivePattern;
}
if (this._data.AllowRounding != null && typeof(this._data.AllowRounding) != "undefined") {
f.AllowRounding = this._data.AllowRounding;
}
if (this._data.KeepNotRoundedValue != null && typeof(this._data.KeepNotRoundedValue) != "undefined") {
f.KeepNotRoundedValue = this._data.KeepNotRoundedValue;
}
a.set_numberFormat(f);
a.set_visible(true);
}
}
}, _adjustHCFilterMenuInputControlsWidth: function (a, b) {
if (a.search(/(^|[^-])width/i) != -1) {
a = a.replace(/(^|[^-])width(\s*):(\s*)([^;]+);/i, "$1WIDTH:" + b + "px;");
} else {
a += "WIDTH:" + b + "px;";
}
return a;
}, _adjustHCFilterMenuPickerControlsWidth: function (b, a) {
$get(b.get_id() + "_wrapper").style.width = a;
}, _setUpHeaderContextMenuFilterControls: function (c, d, b, e) {
var a = c.get_items().toArray();
for (var f = 0;
f < a.length;
f++) {
var g = a[f];
if (b == "System.Boolean") {
if ((g.get_value() == "GreaterThan") || (g.get_value() == "LessThan") || (g.get_value() == "GreaterThanOrEqualTo") || (g.get_value() == "LessThanOrEqualTo")) {
g.set_visible(false);
continue;
}
}
if (b != "System.String") {
if ((g.get_value() == "StartsWith") || (g.get_value() == "EndsWith") || (g.get_value() == "Contains") || (g.get_value() == "DoesNotContain") || (g.get_value() == "IsEmpty") || (g.get_value() == "NotIsEmpty")) {
g.set_visible(false);
continue;
}
}
if (e == 0) {
if (g.get_value() == "Custom") {
g.set_visible(false);
continue;
}
}
if (g.get_value() == d) {
g.select();
}
g.set_visible(true);
}
}, _filterButtonClickHandler: function (a) {
var c = this._owner._owner._getHeaderContextMenu();
var d = this;
var l = c.FilterControlsIDsHelper;
var e = d._data.DataField;
if (d._data.DataTextField) {
e = d._data.DataTextField;
} else {
if (d._data.DataAlternateTextField) {
e = d._data.DataAlternateTextField;
}
}
var i = l.getFilterControlID(l.FilterControl.RadComboBox, l.IdSuffix.FirstCond);
var j = c.findItemByValue("FilterMenuContainer").findControl(i).get_selectedItem().get_value();
var o = l.getFilterControlID(l.FilterControl.RadComboBox, l.IdSuffix.SecondCond);
var p = c.findItemByValue("FilterMenuContainer").findControl(o).get_selectedItem().get_value();
var k;
var q;
var r = true;
if (l.FilterControlsType == l.FilterControl.RadTextBox || l.FilterControlsType == l.FilterControl.RadMaskedBox || l.FilterControlsType == l.FilterControl.RadNumericBox) {
k = l.FirstFilterValueControl.get_value();
q = l.SecondFilterValueControl.get_value();
} else {
if (l.FilterControlsType == l.FilterControl.CheckBox) {
k = l.FirstFilterValueControl.checked;
q = l.SecondFilterValueControl.checked;
r = false;
} else {
var f = function (s) {
return function (t) {
return (s == l.FilterControl.RadDateInput) ? t._dateFormat : t._dateInput._dateFormat;
};
}(l.FilterControlsType);
var h = l.FirstFilterValueControl.get_selectedDate();
if (!!h) {
k = h.localeFormat(f(l.FirstFilterValueControl));
}
var n = l.SecondFilterValueControl.get_selectedDate();
if (!!n) {
q = n.localeFormat(f(l.SecondFilterValueControl));
}
}
}
if (r) {
if (typeof(k) == "undefined" || k == null) {
k = "";
} else {
k = k.toString();
}
if (typeof(q) == "undefined" || q == null) {
q = "";
} else {
q = q.toString();
}
}
a.preventDefault();
var m = this._owner;
var b = d._data.UniqueName + "|?" + j + "|" + k + "|?" + p + "|" + q;
if ($find(m.get_owner().get_id())._dataBindingWithSelectMethod) {
while (m._filterExpressions.get_count() != 0) {
var g = m._filterExpressions.getItem(0);
if (g.get_columnUniqueName() == d._data.UniqueName) {
m._filterExpressions.remove(g);
}
}
if (j != "NoFilter" && k !== "") {
m.filter(d._data.UniqueName, k, j, true, true);
}
if (p != "NoFilter" && q !== "") {
m.filter(d._data.UniqueName, q, p, false, true);
}
d._data.CurrentFilterFunction = j;
d._data.AndCurrentFilterFunction = p;
d._data.CurrentFilterValue = k;
d._data.AndCurrentFilterValue = q;
if (j == "NoFilter") {
d._data.CurrentFilterValue = "";
}
if (p == "NoFilter") {
d._data.AndCurrentFilterValue = "";
}
if (j == "NoFilter" || p == "NoFilter") {
var c = m._owner._getHeaderContextMenu();
this._updateFilterValuesForHCMenu(c.FilterControlsIDsHelper);
if (j == "NoFilter") {
m._updateFilterControlValue("", this._data.UniqueName, "NoFilter");
}
}
m.fireCommand("HeaderContextMenuFilter", b);
} else {
m.fireCommand("HeaderContextMenuFilter", b);
}
return false;
}, _clearFilterButtonClickHandler: function (a) {
var c = this._owner._owner._getHeaderContextMenu();
var b = this._data.UniqueName + "|?NoFilter||?NoFilter|";
a.preventDefault();
var f = this._owner;
if ($find(f.get_owner().get_id())._dataBindingWithSelectMethod) {
var c = f._owner._getHeaderContextMenu();
var d = this;
d._data.CurrentFilterFunction = "NoFilter";
d._data.AndCurrentFilterFunction = "NoFilter";
d._data.CurrentFilterValue = "";
d._data.AndCurrentFilterValue = "";
f._updateFilterControlValue("", d._data.UniqueName, "NoFilter");
this.set_filterFunction("NoFilter");
f._filterExpressions.clear();
var e = c.findItemByValue("FilterMenuContainer");
this._updateDisplayHCMenuFilterControls(e.get_element(), c.FilterControlsIDsHelper);
this._updateFilterFunctionsForHCMenu(e.get_element(), c.FilterControlsIDsHelper);
this._updateFilterValuesForHCMenu(c.FilterControlsIDsHelper);
}
f.fireCommand("HeaderContextMenuFilter", b);
return false;
}, _checkBoxClickHandler: function (a) {
var b = $find(this._column.get_owner().get_id());
if (!b) {
return;
}
if (!this.checked) {
b.hideColumn(this._index);
} else {
b.showColumn(this._index);
}
this._column._handleColumnsCheckboxesState();
}, _handleColumnsCheckboxesState: function () {
var d = this.get_owner().get_owner();
if (d) {
var f = d.get_headerMenu().findItemByValue("ColumnsContainer");
if (!f) {
return;
}
var c = f.get_items();
if (!c) {
return;
}
var b = null;
var a = null;
var g;
for (var e = 0;
len = c.get_count(), e < len;
e++) {
b = c.getItem(e);
if (!b.get_visible()) {
continue;
}
a = b.get_element().getElementsByTagName("input")[0];
a.removeAttribute("disabled");
if (a.checked) {
if (g) {
g = null;
break;
}
g = a;
}
}
if (g) {
g.disabled = "disabled";
}
}
}, _onContextMenuItemClosing: function (b, a) {
if (a.get_item().get_value() == "FilterMenuParent" && a.get_item()._popUpOpened) {
a.set_cancel(true);
}
}, _onContextMenuItemClicking: function (n, a) {
var k = a.get_item();
var j = !!n.get_parent()._clientDataSourceID;
if (k.get_value() == "FilterMenuContainer" || k.get_value() == "AggregatesContainer" || (Telerik.Web.UI.RadMenuItem.isInstanceOfType(k.get_parent()) && k.get_parent().get_value() == "ColumnsContainer")) {
a.set_cancel(true);
} else {
if (k.get_value() == "SortAsc" || k.get_value() == "SortDesc" || k.get_value() == "SortNone") {
var l = $find(k._column.get_owner().get_id()), m = l.get_owner(), a;
if ((typeof(m.ClientSettings.DataBinding.Location) != "undefined" && m.ClientSettings.DataBinding.Location != "") || j) {
var e = k._column._data.SortExpression;
if (k.get_value() == "SortNone") {
a = l._raiseAction("ClearSort", {sortExpression: e});
if (!a.get_cancel()) {
e = a.get_sortExpression();
l.clearSort(e);
}
} else {
e += k.get_value() == "SortAsc" ? " ASC" : " DESC";
a = l._raiseAction("Sort", {sortExpression: e});
if (!a.get_cancel()) {
e = a.get_sortExpression();
l.sort(e);
}
}
} else {
n.trackChanges();
var d = k._column._data.DataField;
if (k._column._data.DataTextField) {
d = k._column._data.DataTextField;
} else {
if (k._column._data.DataAlternateTextField) {
d = k._column._data.DataAlternateTextField;
}
}
k.get_attributes().setAttribute("ColumnName", d);
k.get_attributes().setAttribute("TableID", k._column.get_owner()._data.UniqueID);
n.commitChanges();
}
} else {
if (k.get_value() == "GroupBy") {
if (j) {
k._column.get_owner().fireCommand("GroupByColumn", k._column.get_uniqueName());
n.hide();
} else {
k._column.get_owner().groupColumn(k._column.get_uniqueName());
a.set_cancel(true);
}
} else {
if (k.get_value() == "UnGroupBy") {
if (j) {
var f = k._column.get_owner().get_owner()._groupPanel;
var g = f._items;
var b = k._column.get_dataField();
var c = null;
for (var h = 0;
h < g.length;
h++) {
if (g[h]._dataField == b) {
c = g[h];
}
}
if (c) {
f._ungroup(c.get_element().childNodes[0]);
}
n.hide();
} else {
k._column.get_owner().ungroupColumn(k._column.get_uniqueName());
a.set_cancel(true);
}
} else {
if (k.get_value() == "BestFit") {
k._column.resizeToFit();
} else {
if (k.get_isSeparator()) {
a.set_cancel(true);
} else {
if (k.get_parent() != null && k.get_parent().get_value && k.get_parent().get_value() == "AggregatesContainer") {
k._column.get_owner().fireCommand("SetColumnAggregate", String.format("{0}|{1}|{2}", k.get_value(), k._column.get_owner()._data.UniqueID, k._column.get_uniqueName()));
}
}
}
}
}
}
}
}, _onContextMenuHidden: function (g, a) {
var c = g;
if (this._checkboxes) {
for (var e = 0, f = this._checkboxes.length;
e < f;
e++) {
$removeHandler(this._checkboxes[e], "click", this._checkBoxClickHandler);
this._checkboxes[e]._column = null;
this._checkboxes[e]._index = null;
}
}
if (this._onContextMenuItemClickingDelegate) {
g.remove_itemClicking(this._onContextMenuItemClickingDelegate);
this._onContextMenuItemClickingDelegate = null;
}
if (this._onContextMenuItemClosingDelegate) {
g.remove_itemClosing(this._onContextMenuItemClosingDelegate);
this._onContextMenuItemClosingDelegate = null;
}
if (this._onContextMenuHiddenDelegate) {
g.remove_hidden(this._onContextMenuHiddenDelegate);
this._onContextMenuHiddenDelegate = null;
}
if (this._filterButtonClickDelegate) {
var d = $telerik.findElement(c.findItemByValue("FilterMenuContainer").get_element(), "HCFMFilterButton");
$removeHandler(d, "click", this._filterButtonClickDelegate);
this._filterButtonClickDelegate = null;
}
if (this._clearFilterButtonClickDelegate) {
var b = $telerik.findElement(c.findItemByValue("FilterMenuContainer").get_element(), "HCFMClearFilterButton");
$removeHandler(b, "click", this._clearFilterButtonClickDelegate);
this._clearFilterButtonClickDelegate = null;
}
this._checkboxes = [];
}, _onContextMenu: function (a) {
if ($telerik.isOpera && a.button != 2) {
return;
}
this._owner._owner.raise_columnContextMenu(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.get_events().getHandler("columnContextMenu") || this._owner._data.enableHeaderContextMenu) {
this._initHeaderContextMenu(a);
if (a.preventDefault) {
a.preventDefault();
} else {
a.returnValue = false;
return false;
}
}
}, resizeToFit: function (d, c) {
if (!this._canResizeToFit()) {
return;
}
if (typeof c != "undefined") {
this.get_realOwner()._includeAllHeaderRows = c;
}
var e = this._getItemContainerTableView();
var a = Array.indexOf(e.get_columns(), this);
if (this._cachedBestFitSize) {
this.get_owner().resizeColumn(a, this._cachedBestFitSize);
return;
}
var b = this._createFitTestContainer(e.get_element(), d);
this._cacheBestFitSizes(b);
this._removeFitTestContainer(e.get_element());
this.get_owner().resizeColumn(a, this._cachedBestFitSize || this.get_element().offsetWidth);
}, _isMouseOverResizeHandle: function (a) {
var c = Telerik.Web.UI.Grid.GetEventPosX(a);
var d = Telerik.Web.UI.Grid.FindPosX(this.get_element());
var b = d + this.get_element().offsetWidth;
if ((c >= b - this._resizeTolerance) && (c <= b + this._resizeTolerance)) {
return true;
}
return false;
}, _isTouchPointOverResizeHandle: function (a) {
var c = $telerik.getTouchEventLocation(a).x;
var d = Telerik.Web.UI.Grid.FindPosX(this.get_element());
var b = d + this.get_element().offsetWidth;
if (c >= b - this._resizeTolerance) {
return true;
}
return false;
}, _canResizeToFit: function () {
var a = this.get_visible() && (this._data.Display == null || this._data.Display) && (this.Display == null || this.Display);
var b = this.get_owner().get_owner().ClientSettings.Resizing;
return a && this.get_resizable() && b && b.AllowColumnResize && b.AllowResizeToFit;
}, _getItemContainerTableView: function () {
var a = this.get_owner();
if (a.get_id().endsWith("_Header")) {
return $find(a.get_owner().get_id()).get_masterTableView();
}
return a;
}, _cacheBestFitSizes: function (c) {
var f = c.tBodies[0].getElementsByTagName("tr")[0];
if (!f) {
return;
}
var b = this.get_owner().get_columns();
for (var d = 0, e = b.length;
d < e;
d++) {
if (b[d]._canResizeToFit()) {
var a = f.cells[d];
if (a) {
b[d]._cachedBestFitSize = a.offsetWidth;
if (($telerik.isIE && Sys.Browser.version >= 9) || ($telerik.isFirefox && Sys.Browser.version >= 6)) {
b[d]._cachedBestFitSize++;
}
}
}
}
}, _createFitTestContainer: function (n, m) {
var h = n.parentNode;
var b = h.id + "_FitTestContainer";
var d = b + "_FitTestTable";
var e = document.createDocumentFragment();
var a = document.createElement("div");
e.appendChild(a);
a.id = b;
a.style.position = "absolute";
a.style.visibility = "hidden";
if (n.tBodies.length > 0) {
a.innerHTML = "<table class='" + n.className + "' cellspacing='0' border='0' style='" + n.style.cssText + ";table-layout:auto;white-space:nowrap;width:auto;'><tbody>" + n.tBodies[n.tBodies.length - 1].innerHTML + "</tbody></table>";
}
var c = a.childNodes[0];
c.id = d;
var k = [];
for (var f = 0, g = c.rows.length;
f < g;
f++) {
var j = c.rows[f];
if (!(j.id && j.id.indexOf(n.id) > -1)) {
k.push(j);
}
}
var l = k.pop();
while (l) {
c.deleteRow(l.rowIndex);
l = k.pop();
}
if (!m) {
this._insertHeaderCells(c);
}
h.appendChild(e.childNodes[0]);
return document.getElementById(d);
}, _insertHeaderCells: function (b) {
var f = b.createTHead();
var c;
var e;
var a;
if (this._owner._hasMultiHeaders) {
this.get_realOwner()._includeAllHeaderRows = true;
}
if (!this.get_realOwner()._includeAllHeaderRows) {
c = f.insertRow(-1);
e = this.get_element().parentNode;
a = e.cells;
this._insertCellsInRows(a, c);
} else {
origRows = $telerik.$(">tr:not(.rgCommandRow)", this.get_element().parentNode.parentNode);
for (var d = 0;
d < origRows.length;
d++) {
e = origRows[d];
c = f.insertRow(-1);
c.className = e.className;
this._insertCellsInRows(e.cells, c);
}
}
}, _insertCellsInRows: function (a, c) {
var b;
for (var d = 0, e = a.length;
d < e;
d++) {
b = c.insertCell(d);
b.className = a[d].className;
b.colSpan = a[d].colSpan;
b.rowSpan = a[d].rowSpan;
b.style.cssText = a[d].style.cssText;
b.style.width = "auto";
if ($telerik.isIE && Sys.Browser.version <= 7) {
b.innerHTML = "<nobr>" + a[d].innerHTML + "</nobr>";
} else {
b.innerHTML = a[d].innerHTML;
}
}
}, _removeFitTestContainer: function (b) {
var a = document.getElementById(b.parentNode.id + "_FitTestContainer");
if (a) {
a.parentNode.removeChild(a);
}
}, _clearBestFitCache: function () {
var a = this.get_owner().get_columns();
for (var b = 0, c = a.length;
b < c;
b++) {
a[b]._cachedBestFitSize = null;
}
}, _onClick: function (a) {
this._owner._owner.raise_columnClick(new Telerik.Web.UI.GridColumnEventArgs(this, a));
}, _onDblClick: function (a) {
this._owner._owner.raise_columnDblClick(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._isMouseOverResizeHandle(a)) {
this.resizeToFit();
}
}, _onMouseOver: function (a) {
this._owner._owner.raise_columnMouseOver(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.Skin != "") {
Sys.UI.DomElement.addCssClass(this.get_element(), "rgHeaderOver");
}
}, _onMouseOut: function (a) {
this._owner._owner.raise_columnMouseOut(new Telerik.Web.UI.GridColumnEventArgs(this, a));
if (this._owner._owner.Skin != "") {
Sys.UI.DomElement.removeCssClass(this.get_element(), "rgHeaderOver");
}
}, get_resizable: function () {
return this._data.Resizable;
}, set_resizable: function (a) {
if (this._data.Resizable != a) {
this._data.Resizable = a;
}
}, get_reorderable: function () {
return this._data.Reorderable;
}, get_columnGroupName: function () {
return this._data.ColumnGroupName;
}, get_selectable: function () {
return this._data.Selectable;
}, set_reorderable: function (a) {
if (this._data.Reorderable != a) {
this._data.Reorderable = a;
}
}, get_uniqueName: function () {
return this._data.UniqueName;
}, get_dataField: function () {
return this._data.DataField;
}, get_readOnly: function () {
return (typeof(this._data.ReadOnly) != "undefined") ? true : false;
}, get_dataType: function () {
return this._data.DataTypeName;
}, get_filterFunction: function () {
return this._data.CurrentFilterFunctionName;
}, set_filterFunction: function (a) {
if (this._data.CurrentFilterFunctionName != a) {
this._data.CurrentFilterFunctionName = a;
}
}, get_filterDelay: function () {
return (typeof(this._data.FilterDelay) == "undefined") ? null : this._data.FilterDelay;
}, set_filterDelay: function (a) {
if (this._data.FilterDelay != a) {
this._data.FilterDelay = a;
}
}
};
Telerik.Web.UI.GridColumn.registerClass("Telerik.Web.UI.GridColumn", Sys.UI.Control);
Telerik.Web.UI.GridColumnEventArgs = function (b, a) {
Telerik.Web.UI.GridColumnEventArgs.initializeBase(this);
this._gridColumn = b;
this._domEvent = a;
};
Telerik.Web.UI.GridColumnEventArgs.prototype = {
get_gridColumn: function () {
return this._gridColumn;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.GridColumnEventArgs.registerClass("Telerik.Web.UI.GridColumnEventArgs", Sys.EventArgs);
Telerik.Web.UI.GridColumnCancelEventArgs = function (b, a) {
Telerik.Web.UI.GridColumnCancelEventArgs.initializeBase(this);
this._gridColumn = b;
this._domEvent = a;
};
Telerik.Web.UI.GridColumnCancelEventArgs.prototype = {
get_gridColumn: function () {
return this._gridColumn;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.GridColumnCancelEventArgs.registerClass("Telerik.Web.UI.GridColumnCancelEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridHeaderMenuCancelEventArgs = function (b, a, c) {
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.initializeBase(this, [b, a]);
this._menu = c;
};
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.prototype = {
get_menu: function () {
return this._menu;
}
};
Telerik.Web.UI.GridHeaderMenuCancelEventArgs.registerClass("Telerik.Web.UI.GridHeaderMenuCancelEventArgs", Telerik.Web.UI.GridColumnCancelEventArgs);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Grid");
(function (a) {
a.Grid.GridBoundColumn = {
populateCell: function (c, e, g) {
var f = this._owner._owner, d = this._data.DataFormatString;
if (typeof(d) != "undefined" && d != "") {
if (g.toString().indexOf("/Date(") != -1) {
g = new Date(parseInt(g.replace("/Date(", "").replace(")/", "")));
}
c.innerHTML = String.localeFormat(d, g) || " ";
} else {
if (g.toString().indexOf("/Date(") != -1) {
c.innerHTML = String.localeFormat("{0:" + f._defaultDateTimeFormat + "}", new Date(parseInt(g.replace("/Date(", "").replace(")/", ""))));
} else {
c.innerHTML = (g !== "") ? g : " ";
}
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillEditorsData(e, this, f);
}
};
a.Grid.GridTemplateColumn = {
populateCell: function (d, e, h, f) {
if (this._data.ClientItemTemplate) {
var c = this.get_realOwner()._getBindingContext(e, f.get_itemIndex()), g = Telerik.Web.UI.Template.compile(this._data.ClientItemTemplate);
if (g) {
d.innerHTML = g(c);
}
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillTemplateEditorsData(e, d, c);
}
};
a.Grid.GridCheckBoxColumn = {
initializeCell: function (c) {
c.innerHTML = '<span disabled="disabled"><input type="checkbox" disabled="disabled" /></span>';
}, populateCell: function (c, d, g) {
var f = c.getElementsByTagName("input"), e = f[0];
if (e && e.type == "checkbox") {
e.checked = g;
}
}, populateEditCell: function (c, d, f, e) {
this.get_realOwner()._fillTemplateEditorsData(e, d, c);
}
};
a.Grid.GridHyperLinkColumn = {
initializeCell: function (c) {
c.innerHTML = "<a />";
}, populateCell: function (c, e) {
if (!e) {
return;
}
var d = this._data, h = c.getElementsByTagName("a");
if (h.length > 0) {
var g = h[0];
if (d.NavigateUrl && d.NavigateUrl != "") {
g.href = d.NavigateUrl;
}
if (d.Target && d.Target != "") {
g.target = d.Target;
}
if (d.Text && d.Text != "") {
g.innerHTML = d.Text;
}
var f = d.DataTextFormatString;
var j = String.localeFormat((f == "") ? "{0}" : f, e[d.DataTextField]);
var l = b(d.DataNavigateUrlFields, e);
if (l && l.length > 0) {
var k = eval("String.format('" + d.DataNavigateUrlFormatString + "'," + l.join(",") + ")");
g.href = k;
}
if ((f && f != "") || (d.DataTextField && d.DataTextField != "")) {
g.innerHTML = j;
}
}
}
};
a.Grid.GridImageColumn = {
initializeCell: function (c) {
c.innerHTML = "<img />";
}, populateCell: function (c, e) {
if (!e) {
return;
}
var d = this._data, h = c.getElementsByTagName("img"), g = h[0];
if (g) {
if (d.ImageUrl && d.ImageUrl != "") {
g.src = d.ImageUrl;
}
if (d.AlternateText && d.AlternateText != "") {
g.alt = g.title = d.AlternateText;
}
var f = d.DataAlternateTextFormatString;
var j = String.localeFormat((f == "") ? "{0}" : f, e[d.DataAlternateTextField]);
var l = b(d.DataImageUrlFields, e);
if (l && l.length > 0) {
var k = eval("String.format('" + d.DataImageUrlFormatString + "'," + l.join(",") + ")");
g.src = k;
}
if (d.ImageHeight && d.ImageHeight != "") {
g.style.height = d.ImageHeight;
}
if (d.ImageWidth && d.ImageWidth != "") {
g.style.width = d.ImageWidth;
}
if ((f && f != "") || (d.DataAlternateTextField && d.DataAlternateTextField != "")) {
g.alt = g.title = j;
}
}
}
};
a.Grid.GridButtonColumn = {
initializeCell: function (d, h) {
var g = this._owner._owner, f = this._data, c;
switch (f.ButtonType) {
case"PushButton":
c = '<input type="submit" onclick="{0}"/>';
break;
case"LinkButton":
c = '<a href="#" onclick="{0}"></a>';
break;
case"ImageButton":
c = '<input type="image" src="' + f.ImageUrl + '" onclick="{0}"/>';
break;
}
var e = f.CommandArgument;
if (e == undefined || e == "") {
e = h._itemIndexHierarchical;
}
var j = String.format(this._getClickStatement(), g.get_id(), this.get_realOwner().get_id(), h.get_id(), f.CommandName, e);
d.innerHTML = String.format(c, j);
this.populateCell(d, {});
}, populateCell: function (d, e) {
var c = e[this._data.DataTextField];
if (c == undefined || c == "") {
c = this._data.Text;
}
switch (this._data.ButtonType) {
case"PushButton":
buttonControl = d.getElementsByTagName("input")[0];
buttonControl.value = c;
break;
case"LinkButton":
buttonControl = d.getElementsByTagName("a")[0];
buttonControl.innerHTML = c;
break;
case"ImageButton":
buttonControl = d.getElementsByTagName("input")[0];
buttonControl.title = c;
buttonControl.alt = c;
break;
}
}, _getClickStatement: function () {
return "if(!$find('{1}').fireCommand('{3}','{4}')) return false;";
}
};
a.Grid.GridEditCommandColumn = a.Grid.GridButtonColumn;
a.Grid.GridClientDeleteColumn = {
initializeCell: a.Grid.GridButtonColumn.initializeCell,
populateCell: a.Grid.GridButtonColumn.populateCell,
_getClickStatement: function () {
if (this.get_realOwner()._data.EditMode == "Batch") {
return "$find('{0}').get_batchEditingManager()._deleteRecord('{1}','{2}'); return false;";
} else {
return "$find('{1}')._clientDelete(event); return false;";
}
}
};
a.Grid.GridClientSelectColumn = {
initializeCell: function (c, e) {
var d = this._owner._owner;
c.innerHTML = String.format("<input type='checkbox' id='{0}_SelectCheckBox' />", d.get_id() + "__" + e._itemIndexHierarchical);
}
};
a.Grid.GridCalculatedColumn = {
populateCell: function () {
var d = this._data, c = "", h = [], g;
if (typeof(d.Expression) != "undefined" && d.Expression != "") {
h = [];
for (var l = 0;
l < d.DataFields.length;
l++) {
g = d.DataFields[l];
Array.add(h, this._dataSource[i][g]);
}
var m = eval("String.format('" + d.Expression + "'," + h.join(",") + ")");
var j = d.DataFormatString;
if (j == "") {
j = "{0}";
}
var e = "";
try {
e = eval(m);
} catch (f) {
}
c = String.localeFormat(j, e);
}
cell.innerHTML = (c !== "") ? c : " ";
}
};
a.Grid.GridAttachmentColumn = {
initializeCell: function (c) {
c.innerHTML = "<a></a>";
}, populateCell: function (c, e, g) {
var f = c.getElementsByTagName("a")[0], d;
if (!f) {
this.initializeCell(c);
f = c.getElementsByTagName("a")[0];
}
if (g !== "") {
f.innerHTML = g;
d = '{"ColumnUniqueName":"' + this.get_uniqueName() + '","FileName":"' + g + '"}';
f.setAttribute("onclick", "if (!$find('" + this.get_id() + "').fireCommand('DownloadAttachment','" + d + "')) return false;");
f.href = "#";
} else {
f.href = "";
f.innerHTML = " ";
f.onclick = function () {
};
}
}
};
a.Grid.GridRatingColumn = {
populateCell: function (c, d, g) {
var f = $telerik.getElementByClassName(c, "RadRating"), e = f ? $find(f.id) : null;
if (e) {
e.set_value(parseFloat(g));
}
}
};
a.Grid.GridGroupSplitterColumn = {
populateCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgGroupCol");
}, populateEditCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgGroupCol");
}
};
a.Grid.GridExpandColumn = {
initializeCell: function (c) {
Sys.UI.DomElement.addCssClass(c, "rgExpandCol");
}
};
function b(c, d) {
var g = [];
if (!c || !d) {
return g;
}
for (var f = 0;
f < c.length;
f++) {
var e = c[f];
if (typeof(d[e]) != "number") {
Array.add(g, String.format("'{0}'", d[e]));
} else {
Array.add(g, d[e]);
}
}
return g;
}
})(Telerik.Web.UI);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumnAnimation = function () {
Telerik.Web.UI.GridColumnAnimation.initializeBase(this);
this.$ = null;
this._owner = {};
this._mouseMoveDelegate = null;
this._moueUpDelegate = null;
this._$animatedContainer = null;
this._$innerContainer = null;
this._animatedHeaderOffset = 0;
this._dragToGroupColumn = null;
this._nextCellPosition = 0;
this._animatedHeaderCells = [];
this._revertPendingCells = [];
this._initialDraggedHeaderCellIndex = -1;
this._draggedHeaderCellIndex = -1;
this._reorderDuration = 300;
this._revertDuration = 300;
this._allowColumnsReorderAnimation = false;
this._allowColumnRevertAnimation = false;
this._allowDragToGroup = false;
this._allowFreeMove = false;
};
Telerik.Web.UI.GridColumnAnimation.prototype = {
initialize: function () {
Telerik.Web.UI.GridColumnAnimation.callBaseMethod(this, "initialize");
var a = this.get_owner().ClientSettings;
this._allowColumnsReorderAnimation = a.Animation.AllowColumnReorderAnimation && a.AllowColumnsReorder && a.ColumnsReorderMethod == 1;
this._allowColumnRevertAnimation = a.Animation.AllowColumnRevertAnimation;
this._allowDragToGroup = a.AllowDragToGroup;
this._allowFreeMove = this._allowDragToGroup;
this._mouseMoveDelegate = Function.createDelegate(this, this._mouseMove);
this._mouseUpDelegate = Function.createDelegate(this, this._mouseUp);
this.$ = $telerik.$;
(function (b) {
b.fn.outerHtml = function (d) {
if (!this[0]) {
return null;
}
var c = d ? this.eq(0).clone() : this.eq(0).clone().empty();
return b("<p>").append(c).html();
};
})(this.$);
}, _mouseDown: function (c, a) {
var d = c.target || c.srcElement, b = a.get_element();
if (!d) {
return;
}
if (d !== b && d.parentNode !== b) {
return;
}
this._dragToGroupColumn = a;
this._mouseDownPosition = [c.clientX, c.clientY];
if (this._allowColumnsReorderAnimation) {
this.$(document).mousemove(this._mouseMoveDelegate);
} else {
this._createDraggedHeaderCell(c);
}
this.$(document).mouseup(this._mouseUpDelegate);
Telerik.Web.UI.Grid.ClearDocumentEvents();
}, _createDraggedHeaderCell: function (a) {
Telerik.Web.UI.Grid.CreateDragDrop(a, this._dragToGroupColumn, true);
}, _createAnimatedContainer: function (d) {
var a = this.$(d);
var b = a.closest("table");
this._animatedHeaderOffset = b.offset();
this._animatedHeaderOffset.top = a.offset().top;
this._$innerContainer = this.$($("<div>", {id: b.attr("id"), "class": b.attr("class")})).css({
height: "100%",
overflow: this._allowFreeMove ? "visible" : "hidden",
padding: "0",
margin: "0",
position: "absolute",
border: "none",
width: "100%"
});
this._$animatedContainer = this.$(this.$(this.get_owner().get_element()).outerHtml()).append(this._$innerContainer).css({
left: this._animatedHeaderOffset.left + "px",
top: this._animatedHeaderOffset.top + "px",
width: b.parent().width() + "px",
height: a.outerHeight() - 1 + "px",
overflow: this._allowFreeMove ? "visible" : "hidden",
padding: "0",
margin: "0",
position: "absolute",
borderStyle: "none none solid none"
}).appendTo(document.body);
var c = this;
this.$("th", a.parent()).each(function (g) {
if (this.clientWidth === 0) {
return;
}
var e = c._createAnimatedCell(this);
if (this === d) {
e.addClass("rgDraggedHeader").attr("title", "").css({opacity: "0.8", zIndex: "9999"});
c._draggedHeaderCellIndex = c._animatedHeaderCells.length;
c._initialDraggedHeaderCellIndex = c._draggedHeaderCellIndex;
}
var f = this;
c._$innerContainer.append(e);
c._animatedHeaderCells.push(new Telerik.Web.UI.GridAnimatedHeaderCell(e, c.get_reorderDuration(), f.UniqueName));
});
}, _createAnimatedCell: function (b) {
var a = this.$(b);
return this._changeElementTag(b, "div").css({
position: "absolute",
left: this._getNextCellPosition(b),
width: a.width() + "px",
cursor: "default"
});
}, _getNextCellPosition: function (a) {
var b = this._nextCellPosition;
this._nextCellPosition += this.$(a).outerWidth();
return b;
}, _changeElementTag: function (a, e) {
a = a.jquery && a.length ? a[0] : a;
if (!a.tagName) {
return;
}
var c = this.$(a).html();
var b = this.$(a).outerHtml();
var d = a.tagName.toLowerCase();
b = b.replace("<" + a.tagName, "<" + d).replace(a.tagName + ">", d + ">");
return this.$(b.replace("<" + d, "<" + e).replace(d + ">", e + ">")).html(c);
}, _mouseMove: function (a) {
if (this._mouseDownPosition) {
if (Math.abs(this._mouseDownPosition[0] - a.clientX) > 0 || Math.abs(this._mouseDownPosition[1] - a.clientY) > 0) {
this._createAnimatedContainer(this._dragToGroupColumn.get_element());
this._mouseDownPosition = null;
} else {
return;
}
}
if ($telerik.isIE8) {
this._mouseMoveDelayed(a);
} else {
this._handleMouseMoveInternal(a);
}
}, _mouseMoveDelayed: function (b) {
if (!this._mouseMoveInProgress) {
this._mouseMoveInProgress = true;
var a = this;
this._mouseMoveTimeout = setTimeout(function () {
a._handleMouseMoveInternal(b);
a._mouseMoveInProgress = false;
}, 0);
}
}, _handleMouseMoveInternal: function (a) {
this._setMoveDirection(a);
this._getDraggedHeaderCell().moveWithCursor(a, this._allowFreeMove);
this._mouseTrackOrigin = this._getMouseTrackOrigin(a);
if (this._isTrackOriginOverHeader() && !this._getDraggedHeaderCell().isPointOverOrigin(this._mouseTrackOrigin)) {
this._reorderHeaderCells();
} else {
this._revertHeaderCellsToOrigin();
}
if (this._allowDragToGroup) {
this._updateGroupPanelIndicators(a);
}
}, _updateGroupPanelIndicators: function (a) {
if (this._isDraggedHeaderOverGroupPanel()) {
Telerik.Web.UI.Grid.CreateReorderIndicators(this.get_owner()._groupPanel.get_element(), this.get_owner().Skin, this.get_owner()._imagesPath, true, this.get_owner().get_id());
Telerik.Web.UI.Grid.MoveReorderIndicators(a, this.get_owner()._groupPanel.get_element(), true, this.get_owner().get_id());
} else {
this._hideReorderIndicators();
}
}, _hideReorderIndicators: function () {
if (Telerik.Web.UI.Grid.ReorderIndicator1) {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}, _getMoveDirection: function () {
return this._moveDirection || 0;
}, _setMoveDirection: function (a) {
var b = this._prevPageX || a.pageX;
this._moveDirection = a.pageX - b;
this._prevPageX = a.pageX;
}, _isTrackOriginOverHeader: function () {
var a = Telerik.Web.UI.Grid.Animation;
if (this._mouseTrackOrigin) {
return a.containsPoint(a.getBoundingRectangle(this._$animatedContainer), this._mouseTrackOrigin);
}
return false;
}, _getLastMovedHeaderWidth: function () {
if (!this._lastMovedCellWidth) {
this._lastMovedCellWidth = this._getDraggedHeaderCell().get_animationWidth();
}
return this._lastMovedCellWidth;
}, _updateLastMovedHeaderWidth: function (a) {
this._lastMovedCellWidth = Math.max(a.get_animationWidth(), this._getDraggedHeaderCell().get_animationWidth());
}, _reorderHeaderCells: function () {
var b = this._animatedHeaderOffset.left + this._getDraggedHeaderCell().get_draggedPosition();
var a = b;
var d = this._draggedHeaderCellIndex;
var c = null;
if (this._getMoveDirection() > 0 || a < this._mouseTrackOrigin.left) {
a += this._getLastMovedHeaderWidth();
while (a < this._mouseTrackOrigin.left && d < this._animatedHeaderCells.length - 1) {
d++;
c = this._animatedHeaderCells[d];
a += c.get_animationWidth();
if (c.canMove()) {
this._moveCell(d, "left");
}
}
} else {
if (this._getMoveDirection() < 0 || a >= this._mouseTrackOrigin.left) {
while (a > this._mouseTrackOrigin.left && d > 0) {
d--;
c = this._animatedHeaderCells[d];
a -= c.get_animationWidth();
if (c.canMove()) {
this._moveCell(d, "right");
}
}
}
}
}, _moveCell: function (c, a) {
var b = this._animatedHeaderCells[c];
if (b.isPointOver(this._mouseTrackOrigin)) {
this._updateLastMovedHeaderWidth(b);
this._getDraggedHeaderCell().set_draggedPosition(b.get_currentPosition());
} else {
if (b.isPointOverOrigin(this._mouseTrackOrigin)) {
this._updateLastMovedHeaderWidth(b);
this._getDraggedHeaderCell().set_draggedPosition(b.get_originalPosition());
}
}
this._exchangeCellPosition(c);
this._updateRevertState(b);
if (a === "left") {
b.moveLeft(this._getDraggedHeaderCell().get_animationWidth());
} else {
b.moveRight(this._getDraggedHeaderCell().get_animationWidth());
}
}, _updateRevertState: function (b) {
if (b.isAtOrigin()) {
this._revertPendingCells.push(b);
} else {
if (this._revertPendingCells.length > 0) {
var a = Array.indexOf(this._revertPendingCells, b);
if (a > -1) {
this._revertPendingCells.splice(a, 1);
}
}
}
}, _exchangeCellPosition: function (c) {
var b = this._draggedHeaderCellIndex;
var a = this._getDraggedHeaderCell();
this._animatedHeaderCells.splice(b, 1);
this._animatedHeaderCells.splice(c, 0, a);
this._draggedHeaderCellIndex = c;
}, _revertHeaderCellsToOrigin: function () {
if (this._revertPendingCells.length > 0) {
if (this._initialDraggedHeaderCellIndex !== this._draggedHeaderCellIndex) {
this._exchangeCellPosition(this._initialDraggedHeaderCellIndex);
}
var a = this._getDraggedHeaderCell();
if (a.get_draggedPosition() !== a.get_originalPosition()) {
this._updateLastMovedHeaderWidth(a);
a.set_draggedPosition(a.get_originalPosition());
}
while (this._revertPendingCells.length) {
this._revertPendingCells.pop().moveToOrigin();
}
}
}, _getMouseTrackOrigin: function (a) {
var b = {left: a.pageX, top: a.pageY};
var c = Telerik.Web.UI.Grid.Animation.getTrackedPoint();
if (!this._allowFreeMove && c) {
b.top = c.top;
}
return b;
}, _getDraggedHeaderCell: function () {
return this._animatedHeaderCells[this._draggedHeaderCellIndex];
}, _isDraggedHeaderOverGroupPanel: function () {
if (this._mouseTrackOrigin) {
return this._allowDragToGroup && this.get_owner()._groupPanel && Telerik.Web.UI.Grid.Animation.containsPoint(this._getGroupPanelBoundingRectangle(), this._mouseTrackOrigin);
}
return false;
}, _getGroupPanelBoundingRectangle: function () {
if (!this._cachedGroupPanelRect) {
this._cachedGroupPanelRect = Telerik.Web.UI.Grid.Animation.getBoundingRectangle(this.get_owner()._groupPanel.get_element());
}
return this._cachedGroupPanelRect;
}, _mouseUp: function (b) {
clearTimeout(this._mouseMoveTimeout);
if (!this._mouseDownPosition && this._allowColumnsReorderAnimation) {
var f = this._getDraggedHeaderCell().get_element().parent()[0].id;
var d = $find(f);
if (this.get_owner().ClientSettings.AllowColumnsReorder && this._isTrackOriginOverHeader()) {
var c = this._getReorderColumnNames();
if (c && d) {
d.reorderColumns(c.first, c.second);
}
this._clearAnimationData();
this._removeAnimatedContainer();
Telerik.Web.UI.Grid.RestoreDocumentEvents();
return;
}
this._revertHeaderCellsToOrigin();
if (this.get_owner().ClientSettings.AllowDragToGroup && this._isDraggedHeaderOverGroupPanel()) {
var a = d.getColumnByUniqueName(this._getDraggedHeaderCell().get_columnName());
if (a && a._data.Groupable) {
this._clearAnimationData();
this._removeAnimatedContainer();
this._hideReorderIndicators();
d.groupColumn(a.get_element().UniqueName);
}
} else {
this._moveDraggedCellToOrigin();
}
} else {
if (this._allowDragToGroup && this._dragToGroupColumn) {
this._dragToGroupColumn._onMouseUpHandler(b);
if (this._allowColumnRevertAnimation) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this._dragToGroupColumn, this.get_revertDuration());
}
} else {
this._dragToGroupColumn._onMouseUpHandler(b);
if (this._dragToGroupColumn && this._allowColumnRevertAnimation) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this._dragToGroupColumn, this.get_revertDuration());
} else {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
}
}
this._clearAnimationData();
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _getReorderColumnNames: function () {
var b = this._getDraggedHeaderCell().get_columnName();
var a = "";
for (var d = 0;
d < this._revertPendingCells.length;
d++) {
var c = this._revertPendingCells[d];
if (!c.isDragged() && c.get_originalPosition() === this._getDraggedHeaderCell().get_currentPosition()) {
a = c.get_columnName();
break;
}
}
if (b && a && b !== a) {
return {first: b, second: a};
}
return null;
}, _moveDraggedCellToOrigin: function () {
var b = this._getDraggedHeaderCell();
if (this._allowColumnRevertAnimation) {
var a = this;
b.get_element().animate({left: b.get_originalPosition(), top: 0}, this.get_revertDuration(), function () {
a._removeAnimatedContainer();
});
} else {
this._removeAnimatedContainer();
}
}, _clearAnimationData: function () {
this._mouseTrackOrigin = -1;
this._nextCellPosition = 0;
this._revertPendingCells = [];
this._animatedHeaderCells = [];
this._draggedHeaderCellIndex = -1;
this._initialDraggedHeaderCellIndex = -1;
this._lastMovedCellWidth = null;
this._moveDirection = 0;
this._prevPageX = 0;
this._mouseMoveInProgress = false;
this._dragToGroupColumn = null;
this._mouseDownPosition = null;
Telerik.Web.UI.Grid.Animation.clearElementRelativeMousePoint();
this._clearHandlers();
}, _clearHandlers: function () {
this.$(document).unbind("mousemove", this._mouseMoveDelegate);
this.$(document).unbind("mouseup", this._mouseUpDelegate);
}, _removeAnimatedContainer: function () {
this._$animatedContainer.remove();
}, get_reorderDuration: function () {
return this._reorderDuration;
}, set_reorderDuration: function (a) {
this._reorderDuration = a;
}, get_revertDuration: function () {
return this._revertDuration;
}, set_revertDuration: function (a) {
this._revertDuration = a;
}, get_owner: function () {
return this._owner;
}, set_owner: function (a) {
this._owner = a;
}
};
Telerik.Web.UI.GridColumnAnimation.registerClass("Telerik.Web.UI.GridColumnAnimation", Sys.Component);
Telerik.Web.UI.GridAnimatedHeaderCell = function (a, b, c) {
this._$element = a;
this._columnName = c;
this._originalPosition = parseInt(a.css("left"), 10);
this._currentPosition = this._originalPosition;
this.className = this._$element[0].className;
this._animated = false;
this._animationDuration = b;
this._originalOffset = this._$element.offset();
this._originalParentOffset = this._$element.parent().offset();
this._originBoundingRectangle = {
left: this._originalParentOffset.left + this.get_originalPosition(),
top: this._originalOffset.top,
width: this.get_animationWidth(),
height: this._$element.parent().height() - (this._$element.innerHeight() - this._$element.height())
};
this._$element[0].innerHTML = String.format("<span style='display:inline-block;vertical-align:middle;width:100%;'>{0}</span>", this._$element.html());
this._$element.prepend("<span style='display:inline-block;vertical-align:middle;height:100%;'></span>");
this._$element.height(this._originBoundingRectangle.height);
};
Telerik.Web.UI.GridAnimatedHeaderCell.prototype = {
isDragged: function () {
return this._$element[0].className.indexOf("rgDraggedHeader") > -1;
}, get_element: function () {
return this._$element;
}, get_columnName: function () {
return this._columnName;
}, isAtOrigin: function () {
return this.get_currentPosition() === this.get_originalPosition();
}, get_originalPosition: function () {
return this._originalPosition;
}, get_currentPosition: function () {
return this._currentPosition;
}, get_draggedPosition: function () {
return this._currentPosition;
}, set_draggedPosition: function (a) {
if (this.isDragged()) {
this._currentPosition = a;
}
}, get_animationWidth: function () {
return this._$element.outerWidth();
}, get_animationDuration: function () {
return this._animationDuration;
}, isPointOver: function (a) {
return Telerik.Web.UI.Grid.Animation.containsPoint(Telerik.Web.UI.Grid.Animation.getBoundingRectangle(this.get_element()), a);
}, isPointOverOrigin: function (a) {
return Telerik.Web.UI.Grid.Animation.containsPoint(this._originBoundingRectangle, a);
}, canMove: function () {
return this.className.indexOf("rgGroupCol") < 0 && this.className.indexOf("rgExpandCol") < 0;
}, canMoveLeft: function () {
return this.canMove() && this.get_currentPosition() > 0 && this.get_originalPosition() <= this.get_currentPosition();
}, canMoveRight: function () {
var a = this._$element.parent().width() - this._$element.outerWidth();
return this.canMove() && this.get_currentPosition() < a && this.get_originalPosition() >= this.get_currentPosition();
}, moveLeft: function (a) {
this.moveTo(a, "left");
}, moveRight: function (a) {
this.moveTo(a, "right");
}, moveToOrigin: function () {
this.moveTo(0, "origin");
}, moveTo: function (c, d) {
var b = {left: null};
switch (d) {
case"left":
if (this.canMoveLeft()) {
b.left = this.get_currentPosition() === this.get_originalPosition() ? this.get_originalPosition() - c : this.get_originalPosition();
}
break;
case"right":
if (this.canMoveRight()) {
b.left = this.get_currentPosition() === this.get_originalPosition() ? this.get_originalPosition() + c : this.get_originalPosition();
}
break;
case"origin":
if (this.get_currentPosition !== this.get_originalPosition()) {
b.left = this.get_originalPosition();
}
break;
}
if (b.left !== null) {
this._currentPosition = b.left;
var a = this;
setTimeout(function () {
a._$element.stop(false, false).animate(b, a.get_animationDuration());
}, 10);
}
}, moveWithCursor: function (c, a) {
if (this.isDragged()) {
var b = {};
if (a) {
b.left = c.pageX - this._originalParentOffset.left + "px";
b.top = c.pageY - this._originalParentOffset.top + "px";
} else {
if (!Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint()) {
Telerik.Web.UI.Grid.Animation.trackElementRelativeMousePoint(this.get_element(), c);
}
b.left = c.pageX - this._originalParentOffset.left - Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint().left + "px";
}
this.get_element().css(b);
}
}
};
Type.registerNamespace("Telerik.Web.UI.Grid");
Type.registerNamespace("Telerik.Web.UI.Grid.Animation");
Telerik.Web.UI.Grid.Animation.getBoundingRectangle = function (a) {
a = a.jquery ? a : $telerik.$(a);
var b = a.offset();
var c = {};
c.left = c.x = b.left;
c.width = a.outerWidth();
c.top = c.y = b.top;
c.height = a.outerHeight();
return c;
};
Telerik.Web.UI.Grid.Animation.containsPoint = function (b, a) {
if (typeof(b.x) === "undefined") {
b.x = b.left;
}
if (typeof(b.y) === "undefined") {
b.y = b.top;
}
if (typeof(a.x) === "undefined") {
a.x = a.left;
}
if (typeof(a.y) === "undefined") {
a.y = a.top;
}
return $telerik.containsPoint(b, a.x, a.y);
};
Telerik.Web.UI.Grid.Animation.trackElementRelativeMousePoint = function (b, a) {
if (!a.pageX) {
$telerik.$.event.fix(a);
}
b = b.jquery ? b : $telerik.$(b);
var c = b.offset();
Telerik.Web.UI.Grid.Animation._trackedElement = b;
var d = Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint = {};
d.left = d.x = a.pageX - c.left;
d.top = d.y = a.pageY - c.top;
};
Telerik.Web.UI.Grid.Animation.getTrackedPoint = function () {
var c = Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint();
if (!Telerik.Web.UI.Grid.Animation._trackedElement || !c) {
return null;
}
var a = Telerik.Web.UI.Grid.Animation._trackedElement.offset();
var b = {};
b.left = b.x = a.left + c.left;
b.top = b.y = a.top + c.top;
return b;
};
Telerik.Web.UI.Grid.Animation.getElementRelativeTrackedPoint = function () {
return Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint;
};
Telerik.Web.UI.Grid.Animation.clearElementRelativeMousePoint = function () {
Telerik.Web.UI.Grid.Animation._trackedElement = null;
Telerik.Web.UI.Grid.Animation._trackedElementRelativeMousePoint = null;
};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumnResizer = function (c, b) {
Telerik.Web.UI.GridColumnResizer.initializeBase(this);
this._isRealTimeResize = b;
this._column = c;
this._isRealTimeResize = b;
this._currentWidth = null;
this._leftResizer = document.createElement("span");
this._leftResizer.style.backgroundColor = "navy";
this._leftResizer.style.width = "1px";
this._leftResizer.style.position = "absolute";
this._leftResizer.style.cursor = "e-resize";
this._rightResizer = document.createElement("span");
this._rightResizer.style.backgroundColor = "navy";
this._rightResizer.style.width = "1px";
this._rightResizer.style.position = "absolute";
this._rightResizer.style.cursor = "e-resize";
this._resizerToolTip = document.createElement("span");
this._resizerToolTip.style.position = "absolute";
this._resizerToolTip.style.zIndex = 10000;
this._resizerToolTip.style.display = (this._column._owner._owner.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString == "") ? "none" : "";
this._resizerToolTipFormatString = this._column._owner._owner.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString;
if (this._column._owner._owner.Skin != "") {
this._resizerToolTip.className = String.format("GridToolTip GridToolTip_{0}", this._column._owner._owner.Skin);
this._leftResizer.className = String.format("GridLeftResizer GridLeftResizer_{0}", this._column._owner._owner.Skin);
this._rightResizer.className = String.format("GridRightResizer GridRightResizer_{0}", this._column._owner._owner.Skin);
}
if (!this._column._owner._owner._embeddedSkin || this._column._owner._owner.Skin == "") {
this._resizerToolTip.style.backgroundColor = "#F5F5DC";
this._resizerToolTip.style.border = "1px solid";
this._resizerToolTip.style.font = "icon";
this._resizerToolTip.style.padding = "2px";
}
var a = this._column.get_element().offsetWidth;
this._resizerToolTip.innerHTML = this._applyTooltipText(a);
document.body.appendChild(this._leftResizer);
document.body.appendChild(this._rightResizer);
document.body.appendChild(this._resizerToolTip);
this._resizerToolTip.style.width = this._resizerToolTip.clientWidth + (parseInt(a, 10).toString().length >= 3 ? 0 : 10) + "px";
this.CanDestroy = true;
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveHandler);
};
Telerik.Web.UI.GridColumnResizer.prototype = {
dispose: function () {
try {
this._destroy();
} catch (a) {
}
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveDelegate);
}
this._leftResizer = null;
this._rightResizer = null;
this._resizerToolTip = null;
}, _position: function (c) {
this._leftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
this._rightResizer.style.top = this._leftResizer.style.top;
this._rightResizer.style.left = parseInt(this._leftResizer.style.left) + this._column.get_element().offsetWidth + "px";
var h = parseInt(this._rightResizer.style.top) - this._resizerToolTip.offsetHeight - 2;
if (h < 0) {
h += (this._resizerToolTip.offsetHeight + this._column.get_element().offsetHeight + 2);
}
this._resizerToolTip.style.top = h + "px";
var g = parseInt(this._rightResizer.style.left) - 5;
this._resizerToolTip.style.left = g + "px";
if ($telerik.elementOverflowsRight($telerik.getViewPortSize(), this._resizerToolTip)) {
this._resizerToolTip.style.left = (g - this._resizerToolTip.offsetWidth) + "px";
}
if (parseInt(this._leftResizer.style.left) < Telerik.Web.UI.Grid.FindPosX(this._column._owner.get_element())) {
this._leftResizer.style.display = "none";
}
var a = this._column, j = a._owner, d = j._owner, i = d.ClientSettings.Scrolling, f = j._hasMultiHeaders ? a.get_element().offsetHeight : j.get_element().tHead.offsetHeight;
if (!i.AllowScroll) {
this._leftResizer.style.height = j.get_element().tBodies[0].offsetHeight + f + "px";
} else {
if (i.UseStaticHeaders) {
this._leftResizer.style.height = d._gridDataDiv.clientHeight + f + "px";
} else {
var b = d._gridDataDiv.clientHeight;
if (j._hasMultiHeaders) {
b = b - j.get_element().tHead.offsetHeight + a.get_element().offsetHeight;
}
this._leftResizer.style.height = b + "px";
}
}
this._rightResizer.style.height = this._leftResizer.style.height;
}, _onMouseUpHandler: function (a) {
this._destroy(a);
}, _onMouseMoveHandler: function (a) {
if ($telerik.isTouchDevice) {
a.preventDefault();
}
this._move(a);
}, _destroy: function (b) {
if (this.CanDestroy) {
if (this._onMouseUpDelegate) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
this._onMouseUpDelegate = null;
}
if (this._onMouseMoveDelegate) {
$telerik.removeMobileHandler(this._column._owner._owner.get_element(), "mousemove", this._onMouseMoveDelegate);
this._onMouseMoveDelegate = null;
}
if (this._currentWidth != null) {
if (this._currentWidth > 0) {
var a = this._column;
tableView = a._owner, columnIndex = null;
if (tableView._hasMultiHeaders) {
columnIndex = Array.indexOf(tableView.get_columns(), a);
} else {
if (!$telerik.isIE7) {
columnIndex = a.get_element().cellIndex;
} else {
var d = tableView.get_columns();
for (var c = 0;
c < d.length;
c++) {
if (d[c] == this._column) {
columnIndex = c;
break;
}
}
}
}
tableView.resizeColumn(columnIndex, this._currentWidth);
this._currentWidth = null;
}
}
this._column._owner._owner._isResize = null;
document.body.removeChild(this._leftResizer);
document.body.removeChild(this._rightResizer);
document.body.removeChild(this._resizerToolTip);
this.CanDestroy = false;
}
}, _move: function (f) {
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
this._rightResizer.style.left = parseInt(this._leftResizer.style.left) + (Telerik.Web.UI.Grid.GetEventPosX(f) - Telerik.Web.UI.Grid.FindPosX(this._column.get_element())) + "px";
var j = parseInt(this._rightResizer.style.left) - 5;
this._resizerToolTip.style.left = j + "px";
if ($telerik.elementOverflowsRight($telerik.getViewPortSize(), this._resizerToolTip)) {
this._resizerToolTip.style.left = (j - this._resizerToolTip.offsetWidth) + "px";
}
var m = parseInt(this._rightResizer.style.left) - parseInt(this._leftResizer.style.left);
var d = this._column.get_element().scrollWidth - m;
var i = this._resizerToolTip.offsetHeight;
this._resizerToolTip.innerHTML = this._applyTooltipText(m);
if (this._resizerToolTip.offsetHeight > i) {
this._resizerToolTip.style.width = parseInt(this._resizerToolTip.style.width) + 10 + "px";
}
if (!Telerik.Web.UI.Grid.FireEvent(this._column._owner, "OnColumnResizing", [this._column.Index, m])) {
return;
}
if (m <= 0) {
this._rightResizer.style.left = this._rightResizer.style.left;
this._destroy(f);
return;
}
this._currentWidth = m;
if (this._isRealTimeResize) {
var b = (navigator.userAgent.indexOf("Safari") != -1 || this._column._owner._hasMultiHeaders) ? Telerik.Web.UI.Grid.GetRealCellIndex(this._column._owner, this._column.get_element()) : this._column.get_element().cellIndex;
this._column._owner.resizeColumn(b, m);
} else {
this._currentWidth = m;
return;
}
if (Telerik.Web.UI.Grid.FindPosX(this._leftResizer) != Telerik.Web.UI.Grid.FindPosX(this._column.get_element())) {
this._leftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + "px";
}
if (Telerik.Web.UI.Grid.FindPosX(this._rightResizer) != (Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + this._column.get_element().offsetWidth)) {
this._rightResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._column.get_element()) + this._column.get_element().offsetWidth + "px";
}
if (Telerik.Web.UI.Grid.FindPosY(this._leftResizer) != Telerik.Web.UI.Grid.FindPosY(this._column.get_element())) {
this._leftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
this._rightResizer.style.top = Telerik.Web.UI.Grid.FindPosY(this._column.get_element()) + "px";
}
var a = this._column, l = a._owner, g = l._owner, k = g.ClientSettings.Scrolling, h = l._hasMultiHeaders ? a.get_element().offsetHeight : l.get_element().tHead.offsetHeight;
if (!k.AllowScroll) {
this._leftResizer.style.height = l.get_element().tBodies[0].offsetHeight + h + "px";
} else {
if (k.UseStaticHeaders) {
this._leftResizer.style.height = g._gridDataDiv.clientHeight + h + "px";
} else {
var c = g._gridDataDiv.clientHeight;
if (l._hasMultiHeaders) {
c = c - l.get_element().tHead.offsetHeight + a.get_element().offsetHeight;
}
this._leftResizer.style.height = c + "px";
}
}
this._rightResizer.style.height = this._leftResizer.style.height;
}, _applyTooltipText: function (b) {
var a = /\{0[^\}]*\}/g;
return this._resizerToolTipFormatString.replace(a, b);
}
};
Telerik.Web.UI.GridColumnResizer.registerClass("Telerik.Web.UI.GridColumnResizer", null, Sys.IDisposable);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Grid");
Telerik.Web.UI.Grid._uniqueIDToClientID = function (a) {
return a.replace(/[$:]/g, "_");
};
Telerik.Web.UI.Grid.getTableHeaderRow = function (c) {
var a = null;
if (c.tHead && c.tHead.style.display != "none") {
for (var b = 0;
b < c.tHead.rows.length;
b++) {
if (c.tHead.rows[b] != null) {
if (c.tHead.rows[b].cells[0] != null) {
if (c.tHead.rows[b].cells[0].tagName != null) {
if (c.tHead.rows[b].cells[0].tagName.toLowerCase() == "th") {
a = c.tHead.rows[b];
break;
}
}
}
}
}
}
return a;
};
Telerik.Web.UI.Grid.hasEventAttached = function (b, c, d) {
if ((typeof(b._events) !== "object") || (b._events == null)) {
return false;
}
var a = b._events[c];
if (!(a instanceof Array)) {
return false;
}
for (var e = 0, f = a.length;
e < f;
e++) {
if (a[e].handler === d) {
return true;
}
}
return false;
};
Telerik.Web.UI.Grid.ChangePageSize = function (c, b) {
if (c && c.PageSize != b) {
var a = c._raiseAction("PageSize", {newPageSize: parseInt(b, 10)});
if (!a.get_cancel()) {
c.set_pageSize(a.get_newPageSize());
}
}
};
Telerik.Web.UI.Grid.ChangingPageSizeComboHandler = function (f, b) {
var c;
if (b.get_item) {
c = b.get_item();
} else {
if (b.get_index) {
c = f.get_items().getItem(b.get_index());
}
}
if (c) {
var e = c.get_attributes().getAttribute("ownerTableViewId");
var d = null;
if (c.get_value()) {
d = c.get_value();
} else {
d = c.get_text();
}
if (e && d) {
var g = $find(e);
if (g && g.PageSize != d) {
var a = g._raiseAction("PageSize", {newPageSize: parseInt(d, 10)});
if (a.get_cancel()) {
b.set_cancel(true);
}
}
}
}
};
Telerik.Web.UI.Grid.ChangePageSizeComboHandler = function (e, a) {
var b;
if (a.get_item) {
b = a.get_item();
} else {
if (a.get_index) {
b = e.get_items().getItem(a.get_index());
}
}
if (b) {
var d = b.get_attributes().getAttribute("ownerTableViewId");
var c = null;
if (e.get_value) {
if (e.get_value()) {
c = e.get_value();
} else {
c = e.get_text();
}
} else {
if (b.get_value()) {
c = b.get_value();
} else {
c = b.get_text();
}
}
if (d && c) {
var h = parseInt(c);
var g = $find(d);
if (g) {
var f = b.get_attributes().getAttribute("seoRedirectUrl");
if (f) {
window.location.href = f;
return false;
}
g.set_pageSize(h);
}
}
}
};
Telerik.Web.UI.Grid.Sort = function (c, b) {
var a = c._raiseAction("Sort", {sortExpression: b});
if (!a.get_cancel()) {
b = a.get_sortExpression();
c.sort(b);
}
};
Telerik.Web.UI.Grid.GetRealCellIndex = function (c, a) {
for (var b = 0;
b < c.get_columns().length;
b++) {
if (c.get_columns()[b].get_element() == a) {
return b;
}
}
};
Telerik.Web.UI.Grid.CopyAttributes = function (d, c) {
for (var b = 0;
b < c.attributes.length;
b++) {
try {
if (c.attributes[b].name.toLowerCase() == "id") {
continue;
}
if (c.attributes[b].value != null && c.attributes[b].value != "null" && c.attributes[b].value != "") {
d.setAttribute(c.attributes[b].name, c.attributes[b].value);
}
} catch (a) {
continue;
}
}
};
Telerik.Web.UI.Grid.PositionDragElement = function (c, d) {
var a = $telerik.isTouchDevice ? $telerik.getTouchEventLocation(d).x : d.clientX;
var b = $telerik.isTouchDevice ? $telerik.getTouchEventLocation(d).y : d.clientY;
c.style.top = b + $telerik.getDocumentElementScrollTop() + 1 + "px";
c.style.left = a + $telerik.getDocumentElementScrollLeft() + 1 + "px";
if ($telerik.isOpera || ($telerik.isOpera || $telerik.isSafari2) || $telerik.isTouchDevice) {
c.style.top = parseInt(c.style.top) - document.body.scrollTop + "px";
}
};
Telerik.Web.UI.Grid.ClearDocumentEvents = function (a) {
if (!a) {
if (document.onmousedown != this.mouseDownHandler) {
this.documentOnMouseDown = document.onmousedown;
}
this.mouseDownHandler = function (b) {
return false;
};
document.onmousedown = this.mouseDownHandler;
}
if (document.onselectstart != this.selectStartHandler) {
this.documentOnSelectStart = document.onselectstart;
}
if (document.ondragstart != this.dragStartHandler) {
this.documentOnDragStart = document.ondragstart;
}
this.selectStartHandler = function () {
return false;
};
this.dragStartHandler = function () {
return false;
};
document.onselectstart = this.selectStartHandler;
document.ondragstart = this.dragStartHandler;
};
Telerik.Web.UI.Grid.RestoreDocumentEvents = function () {
if ((typeof(this.documentOnMouseDown) == "function") && (document.onmousedown != this.mouseDownHandler)) {
document.onmousedown = this.documentOnMouseDown;
} else {
document.onmousedown = "";
}
if ((typeof(this.documentOnSelectStart) == "function") && (document.onselectstart != this.selectStartHandler)) {
document.onselectstart = this.documentOnSelectStart;
} else {
document.onselectstart = "";
}
if ((typeof(this.documentOnDragStart) == "function") && (document.ondragstart != this.dragStartHandler)) {
document.ondragstart = this.documentOnDragStart;
} else {
document.ondragstart = "";
}
};
Telerik.Web.UI.Grid.IsChildOf = function (a, b) {
if (!a) {
return false;
}
while (a.parentNode) {
if (a.parentNode == b) {
return true;
}
a = a.parentNode;
}
return false;
};
Telerik.Web.UI.Grid.GetCurrentElement = function (b) {
if (!b) {
var b = window.event;
}
var a;
if (b.srcElement) {
a = b.srcElement;
} else {
a = b.target;
}
return Telerik.Web.UI.Grid.IsDomElement(a) ? a : null;
};
Telerik.Web.UI.Grid.IsDomElement = function (a) {
var b = typeof HTMLElement === "object";
if (b) {
return a instanceof HTMLElement;
} else {
return a && typeof a === "object" && a.nodeType === 1 && typeof a.nodeName === "string";
}
return false;
};
Telerik.Web.UI.Grid.GetCurrentTouchElement = function (a) {
if ($telerik.isTouchDevice) {
var b = $telerik.getTouchTarget(a);
return b;
}
};
Telerik.Web.UI.Grid.CreateReorderIndicators = function (c, i, h, a, g) {
if ((this.ReorderIndicator1 == null) && (this.ReorderIndicator2 == null)) {
this.ReorderIndicator1 = document.createElement("span");
this.ReorderIndicator2 = document.createElement("span");
if (h != "") {
var j = new Image();
j.src = h + "MoveDown.gif";
var b = new Image();
b.src = h + "MoveUp.gif";
this.ReorderIndicator1.innerHTML = '<img src="' + h + 'MoveDown.gif" alt="reorder indicator" />';
this.ReorderIndicator2.innerHTML = '<img src="' + h + 'MoveUp.gif" alt="reorder indicator" />';
this.ReorderIndicator1.className = "GridReorderTopImage_" + i;
this.ReorderIndicator2.className = "GridReorderBottomImage_" + i;
} else {
if (i == "") {
this.ReorderIndicator1.innerHTML = "↓";
this.ReorderIndicator2.innerHTML = "↑";
} else {
this.ReorderIndicator1.className = "GridReorderTop GridReorderTop_" + i;
this.ReorderIndicator2.className = "GridReorderBottom GridReorderBottom_" + i;
}
}
this.ReorderIndicator1.style.backgroundColor = "transparent";
this.ReorderIndicator1.style.color = "darkblue";
this.ReorderIndicator1.style.fontSize = "1px";
this.ReorderIndicator2.style.backgroundColor = this.ReorderIndicator1.style.backgroundColor;
this.ReorderIndicator2.style.color = this.ReorderIndicator1.style.color;
this.ReorderIndicator2.style.fontSize = this.ReorderIndicator1.style.fontSize;
var f = $find(g);
var d = 0;
var e = 0;
if (a && c.nodeName == "TH" && f && f.GridDataDiv) {
var d = f.GridDataDiv.scrollLeft;
if (!f.ClientSettings.Scrolling.UseStaticHeaders) {
var e = f.GridDataDiv.scrollTop;
}
}
this.ReorderIndicator1.style.top = Telerik.Web.UI.Grid.FindPosY(c) - this.ReorderIndicator1.offsetHeight + "px";
this.ReorderIndicator1.style.left = Telerik.Web.UI.Grid.FindPosX(c) + "px";
this.ReorderIndicator2.style.top = Telerik.Web.UI.Grid.FindPosY(c) + c.offsetHeight + "px";
this.ReorderIndicator2.style.left = this.ReorderIndicator1.style.left;
this.ReorderIndicator1.style.visibility = "hidden";
this.ReorderIndicator1.style.display = "none";
this.ReorderIndicator1.style.position = "absolute";
this.ReorderIndicator2.style.visibility = this.ReorderIndicator1.style.visibility;
this.ReorderIndicator2.style.display = this.ReorderIndicator1.style.display;
this.ReorderIndicator2.style.position = this.ReorderIndicator1.style.position;
document.body.appendChild(this.ReorderIndicator1);
document.body.appendChild(this.ReorderIndicator2);
if (h != "") {
this.ReorderIndicator1.style.marginLeft = -parseInt(j.width / 2) + "px";
this.ReorderIndicator2.style.marginLeft = -parseInt(b.width / 2) + "px";
j = null;
b = null;
}
}
};
Telerik.Web.UI.Grid.NavigateToPage = function (f, b) {
var e = $find(f), a;
if (e) {
var d = e.get_currentPageIndex();
var c = d;
if (b == "Next") {
c++;
} else {
if (b == "Prev") {
c--;
} else {
if (b == "First") {
c = 0;
} else {
if (b == "Last") {
c = e.get_pageCount() - 1;
} else {
c = parseInt(b) - 1;
}
}
}
}
if (c < 0 || c > (e.get_pageCount() - 1)) {
return false;
}
a = e._raiseAction("Page", {newPageIndex: c});
if (!a.get_cancel()) {
c = a.get_newPageIndex();
e.page(c + 1);
}
}
};
Telerik.Web.UI.Grid.DestroyReorderIndicators = function () {
if ((this.ReorderIndicator1 != null) && (this.ReorderIndicator2 != null)) {
document.body.removeChild(this.ReorderIndicator1);
document.body.removeChild(this.ReorderIndicator2);
this.ReorderIndicator1 = null;
this.ReorderIndicator2 = null;
}
};
Telerik.Web.UI.Grid.MoveReorderIndicators = function (f, b, a, h) {
if ((this.ReorderIndicator1 != null) && (this.ReorderIndicator2 != null)) {
this.ReorderIndicator1.style.visibility = "visible";
this.ReorderIndicator1.style.display = "";
this.ReorderIndicator2.style.visibility = "visible";
this.ReorderIndicator2.style.display = "";
var g = $find(h);
var c = 0;
var d = 0;
if (a && b.nodeName == "TH" && g && g.GridDataDiv) {
var c = g.GridDataDiv.scrollLeft;
if (!g.ClientSettings.Scrolling.UseStaticHeaders) {
var d = g.GridDataDiv.scrollTop;
}
}
var i = 0;
if (a && b.nodeName == "TH" && g && this._columnInitiatorIndex != null && this._columnOverIndex != null && this._columnInitiatorIndex < this._columnOverIndex) {
i = b.offsetWidth;
}
this.ReorderIndicator1.style.top = Telerik.Web.UI.Grid.FindPosY(b) - this.ReorderIndicator1.offsetHeight + "px";
this.ReorderIndicator1.style.left = Telerik.Web.UI.Grid.FindPosX(b) + i + "px";
this.ReorderIndicator2.style.top = Telerik.Web.UI.Grid.FindPosY(b) + b.offsetHeight + "px";
this.ReorderIndicator2.style.left = this.ReorderIndicator1.style.left;
}
};
Telerik.Web.UI.Grid.getVisibleCols = function (a) {
var b = 0;
for (var c = 0, d = a.length;
c < d;
c++) {
if (a[c].style.display == "none") {
continue;
}
b++;
}
return b;
};
Telerik.Web.UI.Grid.hideShowCells = function (x, m, f, c) {
var z = Telerik.Web.UI.Grid.getVisibleCols(c);
var y = $find(x.id);
var h = y._hasMultiHeaders;
var s = [];
var w = false;
var v = y._owner.ClientSettings.Scrolling;
var p = v && v.AllowScroll && v.UseStaticHeaders;
var e = y.get_columns()[m];
if (h && ((p && x.id.indexOf("Header") > -1) || (!p && y.get_owner().get_masterTableView().get_id() == x.id))) {
s = Telerik.Web.UI.Grid.getMultiHeaderCells(y);
}
for (var k = 0, r = x.rows.length;
k < r;
k++) {
var n = false;
var b = 0;
var a = null;
var o = h && !!x.rows[k].className && x.rows[k].className.indexOf("rgMultiHeaderRow") > -1;
if (o && w) {
continue;
}
if (!h) {
if (x.rows[k].cells.length != z) {
if (x.rows[k].cells.length == 1) {
x.rows[k].cells[0].colSpan = z || 1;
} else {
for (var q = 0;
q < x.rows[k].cells.length;
q++) {
a = x.rows[k].cells[q];
if (Telerik.Web.UI.Grid._trySetColSpanOnDetailTable(a)) {
if (y && !y._isHelperColumnType(y.get_columns()[m]._data.ColumnType)) {
n = true;
break;
}
break;
}
b = a.colSpan;
if (((b > 1 && q + b >= m) || (a.parentNode.className.indexOf("rgGroupHeader") != -1 && a.className.indexOf("rgGroupCol") == -1))) {
if (e && e._data.ColumnType === "GridGroupSplitterColumn") {
var g = x.rows[k].cells[e.get_element().cellIndex];
if (g && g.className.indexOf("rgGroupCol") !== -1) {
break;
}
}
if (!f) {
var d = x.rows[k].cells[q].colSpan - 1;
if (d <= 0) {
d = 1;
}
x.rows[k].cells[q].colSpan = d;
} else {
x.rows[k].cells[q].colSpan = x.rows[k].cells[q].colSpan + 1;
}
break;
}
}
}
} else {
for (var q = 0;
q < x.rows[k].cells.length;
q++) {
a = x.rows[k].cells[q];
if (Telerik.Web.UI.Grid._trySetColSpanOnDetailTable(a)) {
var y = $find(x.id);
if (y && !y._isHelperColumnType(y.get_columns()[m]._data.ColumnType)) {
n = true;
break;
}
}
}
}
}
a = o ? s[m] : x.rows[k].cells[m];
if (!n) {
if (a != null && a.colSpan == 1) {
if (a.style.display == "none" && f) {
a.style.display = (window.netscape) ? "table-cell" : "";
}
if ((a.style.display == "" || a.style.display == "table-cell") && !f) {
a.style.display = "none";
}
if (y._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", (a.style.display != "none").toString());
}
if (h && !w) {
var u = a.parentCell;
w = true;
while (u) {
if (a.style.display == "none") {
var t = u.colSpan - 1;
if (t == 0) {
u.style.display = "none";
} else {
u.colSpan = t;
}
} else {
if (u.style.display == "none") {
u.style.display = "";
} else {
u.colSpan++;
}
}
u = u.parentCell;
}
}
}
if ($telerik.isIE6) {
Telerik.Web.UI.Grid._hideShowSelect(a, f);
}
}
}
if (p) {
if ($telerik.isFirefox || $telerik.isIE9Mode) {
x.style.tableLayout = "auto";
setTimeout(function () {
x.style.tableLayout = "fixed";
}, 0);
}
}
Telerik.Web.UI.Grid.calculateRowSpan(x, f, p, h, s, m);
};
Telerik.Web.UI.Grid.calculateRowSpan = function (t, e, n, f, q, m) {
var s = t.parentNode;
if (n && s && s.id && s.id.indexOf("GridHeader") == -1) {
return;
}
if (f) {
var b = q[m];
var g = t.tHead.rows;
var h = 0;
for (var l = 0;
l < g.length;
l++) {
var k = g[l];
var d = k.cells;
isRowHidden = true;
for (var o = 0;
o < d.length;
o++) {
var a = d[o];
isRowHidden = isRowHidden && a.style.display == "none";
}
if (isRowHidden || k.className.indexOf("rgFilterRow") > -1) {
h++;
}
}
for (var l = 0, p = g.length;
l < p;
l++) {
var k = g[l];
var d = k.cells;
var r = p - l;
for (var o = 0;
o < d.length;
o++) {
var a = d[o];
if (a.id && a.id.indexOf("MultiHeader") > -1) {
a.rowSpan = r - h;
}
}
if (l == g.length - 1 - h) {
break;
}
}
}
};
Telerik.Web.UI.Grid._trySetColSpanOnDetailTable = function (a) {
var c = $telerik.getFirstChildByTagName(a, "table", 0);
var d;
if (c) {
d = $find(c.id);
}
if (d) {
var b = d.get_parentView()._getVisibleColumnsCount();
a.colSpan = b;
return true;
}
return false;
};
Telerik.Web.UI.Grid._hideShowSelect = function (c, a) {
if (!c) {
return;
}
var d = c.getElementsByTagName("select");
for (var b = 0;
b < d.length;
b++) {
d[b].style.display = (a) ? "" : "none";
}
};
Telerik.Web.UI.Grid.FindPosX = function (a) {
return Telerik.Web.UI.Grid.GetLocation(a).x;
};
Telerik.Web.UI.Grid.FindPosY = function (a) {
return Telerik.Web.UI.Grid.GetLocation(a).y;
};
Telerik.Web.UI.Grid.CreateDragDrop = function (c, b, a) {
if (a) {
var d = b.get_element().parentNode;
this._columnInitiatorIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d, b.get_element().UniqueName);
}
if (b._owner._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
Telerik.Web.UI.Grid.CreateReorderIndicators(b.get_element(), b._owner._owner.Skin, b._owner._owner._imagesPath, a, b._owner._owner.get_id());
}
this._moveHeaderDiv = document.createElement("div");
var f = document.createElement("table");
if (this._moveHeaderDiv.mergeAttributes) {
this._moveHeaderDiv.mergeAttributes(b._owner._owner.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(this._moveHeaderDiv, b.get_element());
}
this._moveHeaderDiv.style.margin = 0;
if (f.mergeAttributes) {
f.mergeAttributes(b._owner.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(f, b._owner.get_element());
}
f.style.margin = "0px";
f.style.height = b.get_element().offsetHeight + "px";
f.style.width = b.get_element().offsetWidth + "px";
f.style.border = "0px";
f.style.borderCollapse = "collapse";
f.style.padding = "0px";
var g = document.createElement("thead");
var h = document.createElement("tr");
f.appendChild(g);
g.appendChild(h);
h.appendChild(b.get_element().cloneNode(true));
this._moveHeaderDiv.appendChild(f);
if (!$telerik.isIE) {
this._moveHeaderDiv.className += " " + b._owner._owner.get_element().className;
}
if (b._owner._owner.get_enableAriaSupport()) {
this._moveHeaderDiv.removeAttribute("aria-dropeffect");
this._moveHeaderDiv.setAttribute("aria-grabbed", "true");
}
document.body.appendChild(this._moveHeaderDiv);
this._moveHeaderDiv.style.height = f.style.height;
this._moveHeaderDiv.style.width = f.style.width;
this._moveHeaderDiv.style.position = "absolute";
this._moveHeaderDiv.style.cursor = "move";
this._moveHeaderDiv.style.display = "none";
this._moveHeaderDiv.UniqueName = b.get_element().UniqueName;
Telerik.Web.UI.Grid.ClearDocumentEvents();
};
Telerik.Web.UI.Grid.MoveDragDrop = function (g, b, a) {
if (this._moveHeaderDiv != null) {
if (typeof(this._moveHeaderDiv.style.filter) != "undefined") {
this._moveHeaderDiv.style.filter = "alpha(opacity=80);";
} else {
if (typeof(this._moveHeaderDiv.style.MozOpacity) != "undefined") {
this._moveHeaderDiv.style.MozOpacity = 0.8;
} else {
if (typeof(this._moveHeaderDiv.style.opacity) != "undefined") {
this._moveHeaderDiv.style.opacity = 0.8;
}
}
}
this._moveHeaderDiv.style.visibility = "";
this._moveHeaderDiv.style.display = "";
Telerik.Web.UI.Grid.PositionDragElement(this._moveHeaderDiv, g);
var d;
if ($telerik.isTouchDevice) {
d = $telerik.getTouchTarget(g);
} else {
d = Telerik.Web.UI.Grid.GetCurrentElement(g);
}
if (b._owner._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
if (d != null) {
if (a && d.tagName.toLowerCase() == "th") {
this._columnOverIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d.parentNode, d.UniqueName);
} else {
if (a && d.parentNode && d.parentNode.tagName && d.parentNode.tagName.toLowerCase() == "th") {
this._columnOverIndex = b.get_owner()._getCellIndexByColumnUniqueNameFromTableRowElement(d.parentNode.parentNode, d.parentNode.UniqueName);
d = d.parentNode;
}
}
var j = b._owner._owner._groupPanel ? b._owner._owner._groupPanel.get_element() : null;
if (Telerik.Web.UI.Grid.IsChildOf(d, b._owner.get_element()) || (b._owner._owner.ClientSettings.AllowDragToGroup && b._owner._owner._groupPanel && (Telerik.Web.UI.Grid.IsChildOf(d, j) || ($telerik.isTouchDevice && d == j)))) {
if (d != b.get_element() && d.parentNode == b.get_element().parentNode) {
if (!b._hierarchicalIndex) {
var c = b._owner.getColumnByUniqueName(d.UniqueName);
var l = true;
if (b._owner._hasMultiHeaders) {
l = !!b && !!c && b.get_columnGroupName() == c.get_columnGroupName();
}
if (c && c._data.Reorderable && c._owner._owner.ClientSettings.AllowColumnsReorder && l) {
d.title = b._owner._owner.ClientSettings.ClientMessages.DropHereToReorder;
Telerik.Web.UI.Grid.MoveReorderIndicators(g, d, a, b._owner._owner.get_id());
}
} else {
if (d.parentNode.cells && d != d.parentNode.cells[d.parentNode.cells.length - 1]) {
d.title = b._owner._owner.ClientSettings.ClientMessages.DropHereToReorder;
Telerik.Web.UI.Grid.MoveReorderIndicators(g, d, a, b._owner._owner.get_id());
}
}
} else {
if (b._owner._owner.ClientSettings.AllowDragToGroup && b._owner._owner._groupPanel && (Telerik.Web.UI.Grid.IsChildOf(d, j) || ($telerik.isTouchDevice && d == j))) {
Telerik.Web.UI.Grid.MoveReorderIndicators(g, j, a, b._owner._owner.get_id());
} else {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}
if (b) {
var m = b._owner._owner;
}
if (m && m.ClientSettings.Scrolling.AllowScroll && m._gridDataDiv) {
Telerik.Web.UI.Grid.AutoScrollHorizontally(m, d);
}
} else {
if (Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility != "hidden") {
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
}
}
}
} else {
var f = this._moveHeaderDiv;
var h = b._owner._owner._groupPanel;
var i = b._owner._owner._groupPanel.cells[0];
var k = $telerik.isMouseOverElement(h, g);
f.className = f.className.replace("rgDropAllow", "");
f.className = f.className.replace("rgDropDisable", "");
f.className = f.className.trim();
i.className = i.className.replace("rgGroupPanelCellHover", "");
i.className = i.className.trim();
if (k) {
f.className += " rgDropAllow";
i.className += " rgGroupPanelCellHover";
} else {
f.className += " rgDropDisable";
}
if (i.children.length > 0 && i.children[0].tagName.toLowerCase() == "span") {
var n = i.children[0];
}
}
}
};
Telerik.Web.UI.Grid.AutoScrollHorizontally = function (g, a) {
if (!g || !this || g.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
return;
}
var d, h;
var c = g._gridDataDiv;
if (!c || !this._moveHeaderDiv) {
return;
}
var b = Telerik.Web.UI.Grid.GetLocation(this._moveHeaderDiv);
d = Telerik.Web.UI.Grid.GetLocation(c).x;
h = d + c.offsetWidth;
var j = c.scrollLeft <= 0;
var k = c.scrollLeft >= (c.scrollWidth - c.offsetWidth + 16);
var e = b.x - d;
var f = h - b.x;
if (e < (50 + Telerik.Web.UI.Grid.GetScrollBarWidth()) && !j) {
var i = (10 - (e / 5));
c.scrollLeft = c.scrollLeft - i;
window.setTimeout(function () {
Telerik.Web.UI.Grid.AutoScrollHorizontally(g, a);
}, 100);
Telerik.Web.UI.Grid.HideReorderIndicators();
} else {
if (f < (50 + Telerik.Web.UI.Grid.GetScrollBarWidth()) && !k) {
var i = (10 - (f / 5));
c.scrollLeft = c.scrollLeft + i;
window.setTimeout(function () {
Telerik.Web.UI.Grid.AutoScrollHorizontally(g, a);
}, 100);
Telerik.Web.UI.Grid.HideReorderIndicators();
}
}
};
Telerik.Web.UI.Grid.HideReorderIndicators = function () {
if (!Telerik.Web.UI.Grid.ReorderIndicator1 || !Telerik.Web.UI.Grid.ReorderIndicator2) {
return;
}
Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility = "hidden";
Telerik.Web.UI.Grid.ReorderIndicator1.style.display = "none";
Telerik.Web.UI.Grid.ReorderIndicator1.style.position = "absolute";
Telerik.Web.UI.Grid.ReorderIndicator2.style.visibility = Telerik.Web.UI.Grid.ReorderIndicator1.style.visibility;
Telerik.Web.UI.Grid.ReorderIndicator2.style.display = Telerik.Web.UI.Grid.ReorderIndicator1.style.display;
Telerik.Web.UI.Grid.ReorderIndicator2.style.position = Telerik.Web.UI.Grid.ReorderIndicator1.style.position;
};
Telerik.Web.UI.Grid.DestroyDragDrop = function (a) {
if (this._moveHeaderDiv != null) {
var b = this._moveHeaderDiv.parentNode;
b.removeChild(this._moveHeaderDiv);
this._moveHeaderDiv = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
this._columnInitiatorIndex = null;
this._columnOverIndex = null;
if (!a) {
Telerik.Web.UI.Grid.DestroyReorderIndicators();
}
};
Telerik.Web.UI.Grid.AnimateRevertDragDrop = function (a, b) {
if (!this._moveHeaderDiv) {
return;
}
b = b || 300;
var c = this._moveHeaderDiv;
if ($telerik.$) {
(function (d) {
var e = $telerik.getLocation(a.get_element());
d(c).clone().appendTo(c.parentNode).animate({left: e.x, top: e.y}, b, function () {
d(this).remove();
});
})($telerik.$);
}
Telerik.Web.UI.Grid.DestroyDragDrop();
};
Telerik.Web.UI.Grid.GetFirstParentByTagName = function (a, b) {
while (a && a.parentNode) {
if (a.tagName.toLowerCase() == b.toLowerCase()) {
return a;
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.GetFirstParentRowWithID = function (a) {
while (a && a.parentNode) {
if (a.tagName.toLowerCase() == "tr" && a.id != undefined && a.id != "") {
return a;
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.CreateColumnResizers = function (a, b) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
this.LeftResizer = document.createElement("span");
this.LeftResizer.style.backgroundColor = "navy";
this.LeftResizer.style.width = "1px";
this.LeftResizer.style.position = "absolute";
this.LeftResizer.style.cursor = "e-resize";
this.RightResizer = document.createElement("span");
this.RightResizer.style.backgroundColor = "navy";
this.RightResizer.style.width = "1px";
this.RightResizer.style.position = "absolute";
this.RightResizer.style.cursor = "e-resize";
this.ResizerToolTip = document.createElement("span");
this.ResizerToolTip.style.backgroundColor = "#F5F5DC";
this.ResizerToolTip.style.border = "1px solid";
this.ResizerToolTip.style.position = "absolute";
this.ResizerToolTip.style.font = "icon";
this.ResizerToolTip.style.padding = "2";
this.ResizerToolTip.innerHTML = "Width: <b>" + a.get_element().offsetWidth + "</b> <em>pixels</em>";
this.LeftResizer.style.display = this.ResizerToolTip.style.display = this.ResizerToolTip.style.display = "none";
document.body.appendChild(this.LeftResizer);
document.body.appendChild(this.RightResizer);
document.body.appendChild(this.ResizerToolTip);
Telerik.Web.UI.Grid.MoveColumnResizers(a, b);
};
Telerik.Web.UI.Grid.DestroyColumnResizers = function () {
Telerik.Web.UI.Grid.RestoreDocumentEvents();
if (this.LeftResizer && this.LeftResizer.parentNode) {
document.body.removeChild(this.LeftResizer);
this.LeftResizer = null;
}
if (this.RightResizer && this.RightResizer.parentNode) {
document.body.removeChild(this.RightResizer);
this.RightResizer = null;
}
if (this.ResizerToolTip && this.ResizerToolTip.parentNode) {
document.body.removeChild(this.ResizerToolTip);
this.ResizerToolTip = null;
}
};
Telerik.Web.UI.Grid.MoveColumnResizers = function (a, d) {
if (!this.LeftResizer || !this.RightResizer || !this.RightResizer) {
return;
}
this.LeftResizer.style.display = this.RightResizer.style.display = this.ResizerToolTip.style.display = "";
this.LeftResizer.style.top = Telerik.Web.UI.Grid.FindPosY(a.get_element()) + "px";
this.LeftResizer.style.left = Telerik.Web.UI.Grid.FindPosX(a.get_element()) + "px";
this.RightResizer.style.top = this.LeftResizer.style.top;
this.RightResizer.style.left = Telerik.Web.UI.Grid.GetEventPosX(d) - 5 + "px";
this.ResizerToolTip.style.top = parseInt(this.RightResizer.style.top) - 20 + "px";
this.ResizerToolTip.style.left = parseInt(this.RightResizer.style.left) - 5 + "px";
if (parseInt(this.LeftResizer.style.left) < Telerik.Web.UI.Grid.FindPosX(a._owner.get_element())) {
this.LeftResizer.style.display = "none";
}
if (!a._owner._owner.ClientSettings.Scrolling.AllowScroll) {
this.LeftResizer.style.height = a._owner.get_element().tBodies[0].offsetHeight + a._owner.get_element().tHead.offsetHeight + "px";
} else {
var b = $get(a._owner._owner.ClientID + "_GridData");
if (a._owner._owner.ClientSettings.Scrolling.UseStaticHeaders) {
this.LeftResizer.style.height = b.clientHeight + a._owner.get_element().tHead.offsetHeight + "px";
} else {
this.LeftResizer.style.height = b.clientHeight + "px";
}
}
this.RightResizer.style.height = this.LeftResizer.style.height;
var c = parseInt(this.RightResizer.style.left) - parseInt(this.LeftResizer.style.left);
this.ResizerToolTip.innerHTML = "Width: <b>" + c + "</b> <em>pixels</em>";
if (a._owner._owner.ClientSettings.Resizing.EnableRealTimeResize) {
if (c > 0) {
a.get_element().style.width = c + "px";
this.RightResizer.style.left = parseInt(this.LeftResizer.style.left) + a.get_element().offsetWidth + "px";
}
}
if (parseInt(this.RightResizer.style.left) <= parseInt(this.LeftResizer.style.left) - 1) {
Telerik.Web.UI.Grid.DestroyColumnResizers();
}
};
Telerik.Web.UI.Grid.FindScrollPosX = function (a) {
var b = 0;
while (a.parentNode) {
if (typeof(a.parentNode.scrollLeft) == "number") {
b += a.parentNode.scrollLeft;
}
a = a.parentNode;
}
if (document.body.currentStyle && document.body.currentStyle.marginLeft.indexOf("px") != -1 && !window.opera) {
b = parseInt(b) - parseInt(document.body.currentStyle.marginLeft);
}
return b;
};
Telerik.Web.UI.Grid.FindScrollPosY = function (a) {
var b = 0;
while (a.parentNode) {
if (typeof(a.parentNode.scrollTop) == "number") {
b += a.parentNode.scrollTop;
}
a = a.parentNode;
}
if (document.body.currentStyle && document.body.currentStyle.marginTop.indexOf("px") != -1 && !window.opera) {
b = parseInt(b) - parseInt(document.body.currentStyle.marginTop);
}
return b;
};
Telerik.Web.UI.Grid.GetEventPosX = function (a) {
if ($telerik.isTouchDevice) {
return $telerik.getTouchEventLocation(a).x;
} else {
return parseInt(a.clientX) + parseInt($telerik.getScrollOffset(document.body, true).x);
}
};
Telerik.Web.UI.Grid.GetEventPosY = function (a) {
if ($telerik.isTouchDevice) {
return $telerik.getTouchEventLocation(a).y;
} else {
return parseInt(a.clientY) + parseInt($telerik.getScrollOffset(document.body, true).y);
}
};
Telerik.Web.UI.Grid.IsScrollOnLeftSide = function () {
if (typeof(this._IsScrollOnLeftSide) == "undefined") {
Telerik.Web.UI.Grid.getScrollBarHeight();
}
return this._IsScrollOnLeftSide;
};
Telerik.Web.UI.Grid.getScrollBarHeight = function () {
try {
if (typeof(this.scrollbarHeight) == "undefined") {
var f, a = 0;
var b = document.createElement("div");
b.style.position = "absolute";
b.style.top = "-1000px";
b.style.left = "-1000px";
b.style.width = "100px";
b.style.height = "100px";
b.style.overflow = "auto";
var c = document.createElement("div");
c.style.width = "1000px";
c.style.height = "1000px";
b.appendChild(c);
document.body.appendChild(b);
f = b.offsetHeight;
a = b.clientHeight;
document.body.removeChild(document.body.lastChild);
this.scrollbarHeight = f - a;
if (this.scrollbarHeight <= 0 || a == 0) {
this.scrollbarHeight = 16;
}
b.dir = "rtl";
var d = document.createElement("div");
d.style.position = "absolute";
d.style.left = "0";
d.style.height = "100%";
d.style.width = "100%";
b.appendChild(d);
if ($telerik.isOpera) {
d.style.left = "";
d.style.width = "100px";
}
document.body.appendChild(b);
this._IsScrollOnLeftSide = false;
if ($telerik.$(b).offset().left != $telerik.$(d).offset().left || $telerik.isChrome) {
this._IsScrollOnLeftSide = true;
}
b.removeChild(c);
b.removeChild(d);
b.parentNode.removeChild(b);
b = null;
c = null;
d = null;
}
return this.scrollbarHeight;
} catch (e) {
this._IsScrollOnLeftSide = false;
return false;
}
};
Telerik.Web.UI.Grid.GetScrollBarWidth = function () {
try {
if (typeof(this.scrollbarWidth) == "undefined") {
var e, a = 0;
var b = document.createElement("div");
b.style.position = "absolute";
b.style.top = "-1000px";
b.style.left = "-1000px";
b.style.width = "100px";
b.style.overflow = "auto";
var c = document.createElement("div");
c.style.width = "1000px";
b.appendChild(c);
document.body.appendChild(b);
e = b.offsetWidth;
a = b.clientWidth;
document.body.removeChild(document.body.lastChild);
this.scrollbarWidth = e - a;
if (this.scrollbarWidth <= 0 || a == 0) {
this.scrollbarWidth = 16;
}
b.removeChild(c);
b.parentNode.removeChild(b);
b = null;
c = null;
}
return this.scrollbarWidth;
} catch (d) {
return false;
}
};
Telerik.Web.UI.Grid.IsRightToLeft = function (b) {
try {
while (b && b != document) {
if ($telerik.getCurrentStyle(b, "direction") == "rtl") {
return true;
}
b = b.parentNode;
}
return false;
} catch (a) {
return false;
}
};
Telerik.Web.UI.Grid.FireEvent = function (e, c, b) {
try {
var d = true;
if (typeof(e[c]) == "string") {
eval(e[c]);
} else {
if (typeof(e[c]) == "function") {
if (b) {
switch (b.length) {
case 1:
d = e[c](b[0]);
break;
case 2:
d = e[c](b[0], b[1]);
break;
}
} else {
d = e[c]();
}
}
}
if (typeof(d) != "boolean") {
return true;
} else {
return d;
}
} catch (a) {
throw a;
}
};
Telerik.Web.UI.Grid.GetTableColGroup = function (b) {
try {
return b.getElementsByTagName("colgroup")[0];
} catch (a) {
return false;
}
};
Telerik.Web.UI.Grid.RemoveHiddenColGroupCols = function (a) {
try {
var b = a.getElementsByTagName("col");
for (var d = 0;
d < b.length;
d++) {
if (b[d].style.display && b[d].style.display == "none") {
b[d].parentNode.removeChild(b[d]);
d--;
}
}
} catch (c) {
}
};
Telerik.Web.UI.Grid.GetTableColGroupCols = function (a) {
try {
var b = new Array();
var e = a.childNodes[0];
for (var d = 0;
d < a.childNodes.length;
d++) {
if ((a.childNodes[d].tagName) && (a.childNodes[d].tagName.toLowerCase() == "col")) {
b[b.length] = a.childNodes[d];
}
}
return b;
} catch (c) {
return false;
}
};
Telerik.Web.UI.Grid.ClearItemStyle = function (f, c, d) {
Sys.UI.DomElement.removeCssClass(f, d);
if (c) {
var b = f.style.cssText.toLowerCase().replace(/ /g, "");
var a = b.split(";");
for (var e = 0;
e < a.length;
e++) {
if (c.indexOf(a[e]) != -1) {
a[e] = "";
}
}
f.style.cssText = a.join(";");
}
};
Telerik.Web.UI.Grid.SetItemStyle = function (c, a, b) {
Sys.UI.DomElement.addCssClass(c, b);
if (a) {
c.style.cssText = c.style.cssText + ";" + a;
}
};
Telerik.Web.UI.Grid.ScrollIntoView = function (i) {
var a = Telerik.Web.UI.Grid.getScrollableContainer(i) || (document.body || document.documentElement);
var e = i;
var h = $telerik.getLocation(e).y - $telerik.getLocation(a).y, g = h + a.scrollTop, f = g + e.offsetHeight;
var c = a.clientHeight;
var d = parseInt(a.scrollTop, 10);
var b = d + c;
if (e.offsetHeight > c || g < d) {
a.scrollTop = g;
} else {
if (f > b) {
a.scrollTop = f - c;
}
}
a.scrollTop = a.scrollTop;
};
Telerik.Web.UI.Grid.getScrollableContainer = function (a) {
if (!a || !a.parentNode) {
return;
}
var d = null;
var c = a.parentNode;
while (c != null) {
if (c.tagName.toUpperCase() == "BODY") {
d = c;
break;
}
var b = $telerik.getCurrentStyle(c, "overflowY");
if (b == "scroll" || b == "auto") {
d = c;
break;
}
c = c.parentNode;
}
return d;
};
Telerik.Web.UI.Grid.GetNestedTableView = function (c) {
var b = null;
var a = Telerik.Web.UI.Grid.GetNestedTable(c);
if (a) {
b = $find(a.id.split("__")[0]);
}
return b;
};
Telerik.Web.UI.Grid.GetLastNestedTableView = function (c) {
var b = null;
var a = Telerik.Web.UI.Grid.GetLastNestedTable(c);
if (a) {
b = $find(a.id.split("__")[0]);
}
return b;
};
Telerik.Web.UI.Grid.GetPreviousNestedTableView = function (b) {
var a = null;
if (b.previousSibling && b.previousSibling.previousSibling) {
a = Telerik.Web.UI.Grid.GetNestedTableView(b.previousSibling);
}
return a;
};
Telerik.Web.UI.Grid.GetNestedTable = function (d) {
var b = null;
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(d, "tr");
if (c) {
var a = c.getElementsByTagName("table");
if (a.length > 0 && a[0].id.indexOf("Detail") != -1) {
b = a[0];
}
}
return b;
};
Telerik.Web.UI.Grid.GetLastNestedTable = function (f) {
var d = null;
var e = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(f, "tr");
if (e) {
var b = e.getElementsByTagName("table");
for (var c = b.length - 1;
c >= 0;
c--) {
var a = b[c];
if (a.id.indexOf("Detail") != -1 && a.id.indexOf("_mainTable") == -1) {
d = a;
break;
}
}
}
return d;
};
Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName = function (a, b) {
var a = a.nextSibling;
while (a != null && (a.nodeType == 3 || (a.tagName && a.tagName.toLowerCase() != b.toLowerCase()))) {
a = a.nextSibling;
}
return a;
};
Telerik.Web.UI.Grid.GetNodePreviousSiblingByTagName = function (a, b) {
var a = a.previousSibling;
while ((a != null) && (a.nodeType == 3 || (a.tagName && a.tagName.toLowerCase() != b.toLowerCase()))) {
a = a.previousSibling;
}
return a;
};
Telerik.Web.UI.Grid.ClearBestFitCache = function (a) {
for (var b = 0, c = a.length;
b < c;
b++) {
a[b]._cachedBestFitSize = null;
}
};
Telerik.Web.UI.Grid.LocationCache = {};
Telerik.Web.UI.Grid.GetLocation = function (a) {
if ($telerik.isOpera) {
return $telerik.originalGetLocation(a);
}
return $telerik.getLocation(a);
};
Telerik.Web.UI.Grid.GetGrid = function (a) {
while (!!a) {
if (a.tagName.toLowerCase() == "div" && a.id && $find(a.id)) {
return $find(a.id);
}
a = a.parentNode;
}
return null;
};
Telerik.Web.UI.Grid.ClientStateData = function ClientStateData() {
var a = {};
this.add = function (b, c) {
a[b] = c;
};
this.toString = function () {
var c = "";
var d = null;
for (var b in a) {
c += b;
d = a[b];
if (typeof(d) != "undefined" && d != null) {
c += ",";
c += a[b];
}
c += ";";
}
return c;
};
};
Telerik.Web.UI.Grid.getMultiHeaderCells = function (k) {
var c = "MultiHeader";
var h = k.get_element();
var d = h.tHead.rows;
var b = [];
for (var e = 0;
e < d.length;
e++) {
var g = d[e];
for (var f = 0;
f < g.cells.length;
f++) {
var a = g.cells[f];
if (a.id && a.id.indexOf(c) > -1) {
b.push(a);
}
}
}
b.sort(function (i, j) {
return i.id.split(c)[1] - j.id.split(c)[1];
});
return b;
};
Telerik.Web.UI.Grid.correctWidthForIE = function (a) {
return parseInt(a.currentStyle.borderLeftWidth) + parseInt(a.currentStyle.borderRightWidth) + parseInt(a.currentStyle.paddingLeft) + parseInt(a.currentStyle.paddingRight);
};
Telerik.Web.UI.Grid.IsEditableControl = function (a) {
var b = a.tagName ? a.tagName.toLowerCase() : null;
if (b && (b === "input" || b === "textarea" || b === "select" || b === "option" || b == "checkbox")) {
return true;
}
return false;
};
Telerik.Web.UI.Grid.IsActionControl = function (b) {
if (b.jquery) {
b = b[0];
}
var c = b.tagName ? b.tagName.toLowerCase() : null;
var a = $find(b.id);
if (c && (c == "button" || c == "a" || (a && Telerik.Web.UI.RadButton && Telerik.Web.UI.RadButton.isInstanceOfType(a)))) {
return true;
}
return Telerik.Web.UI.Grid.IsEditableControl(b);
};
Telerik.Web.UI.Grid.BuildEventArgs = function (a, b) {
for (var d in b) {
var c = d;
var e = b[d];
if (c.indexOf("et_") > 0) {
a[c] = e;
continue;
}
a["_" + c] = e;
a["get_" + c] = function (f) {
return function () {
return this["_" + f];
};
}(c);
}
return a;
};
Telerik.Web.UI.Grid.TouchPointDirection = {
None: -1,
N: 0,
NNE: 1,
NE: 2,
ENE: 3,
E: 4,
ESE: 5,
SE: 6,
SSE: 7,
S: 8,
SSW: 9,
SW: 10,
WSW: 11,
W: 12,
WNW: 13,
NW: 14,
NNW: 15
};
Telerik.Web.UI.Grid.TouchPointMovement = {Up: 0, Left: 1, Down: 2, Right: 3, None: 4, Inconsistent: 5};
Telerik.Web.UI.Grid.detectTouchPointDirection = function (c, b, a) {
if (b.x > c.x) {
if (b.y > c.y) {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SE;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.ESE;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SSE;
}
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.E;
} else {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NE;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.ENE;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NNE;
}
}
}
} else {
if (b.x == c.x) {
if (b.y > c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.S;
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.None;
} else {
return Telerik.Web.UI.Grid.TouchPointDirection.N;
}
}
} else {
if (b.y > c.y) {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SW;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.WSW;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.SSW;
}
} else {
if (b.y == c.y) {
return Telerik.Web.UI.Grid.TouchPointDirection.W;
} else {
if (a == 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NW;
}
if (a > 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.WNW;
}
if (a < 0) {
return Telerik.Web.UI.Grid.TouchPointDirection.NNW;
}
}
}
}
}
};
Telerik.Web.UI.Grid.detectTouchPointMovement = function (a) {
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.NE && a < Telerik.Web.UI.Grid.TouchPointDirection.SE) {
return Telerik.Web.UI.Grid.TouchPointMovement.Right;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.SE && a < Telerik.Web.UI.Grid.TouchPointDirection.SW) {
return Telerik.Web.UI.Grid.TouchPointMovement.Down;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.SW && a < Telerik.Web.UI.Grid.TouchPointDirection.NW) {
return Telerik.Web.UI.Grid.TouchPointMovement.Left;
}
if (a >= Telerik.Web.UI.Grid.TouchPointDirection.NW || (a >= Telerik.Web.UI.Grid.TouchPointDirection.N && a < Telerik.Web.UI.Grid.TouchPointDirection.NE)) {
return Telerik.Web.UI.Grid.TouchPointMovement.Up;
}
if (a == Telerik.Web.UI.Grid.TouchPointDirection.None) {
return Telerik.Web.UI.Grid.TouchPointMovement.None;
}
};
Telerik.Web.UI.Grid.reorderArray = function (a, e, f) {
var c = [];
for (var b = 0;
b < a.length;
b++) {
c[b] = a[b];
}
if (e > f) {
var d = c.splice(e, 1)[0];
c.splice(f, 0, d);
return c;
}
if (e < f) {
c.splice(f + 1, 0, c[e]);
c.splice(e, 1);
return c;
}
};
Telerik.Web.UI.Grid.Draggable = (function (a) {
function b(c) {
this._options = c;
this._isDragging = false;
this.init(c);
}
b.prototype = {
init: function (c) {
a(c.container).onEvent("down", a.proxy(this._down, this), {ns: "draggable"});
}, dispose: function () {
a(document).add(this._options.container).off(".draggable");
}, _positionDragElement: function (c) {
var d = $telerik.getEventLocation(c);
this._$dragElement.offset({top: d.pageY + 1, left: d.pageX + 1});
}, _down: function (c) {
var d = this._options;
var f;
if (d.canDrag.call(d.thisArg, c)) {
f = d.createDraggable.call(d.thisArg, c);
if (f === false) {
return;
}
a(document).onEvent("move", a.proxy(this._move, this), {ns: "draggable"});
a(document).onEvent("up", a.proxy(this._up, this), {ns: "draggable"});
this._$dragElement = a(f).appendTo(document.body);
if (d.createDropClue) {
this._$dropClue = a(d.createDropClue.call(d.thisArg, c)).css("position", "absolute").appendTo(document.body).hide();
}
this._positionDragElement(c);
this._isDragging = true;
}
}, _move: function (c) {
var d = this._options;
this._positionDragElement(c);
d.dragging.call(d.thisArg, c, {$dropClue: this._$dropClue, $dragElement: this._$dragElement});
c.preventDefault();
}, _up: function (c) {
var d = this._options;
if (this._isDragging) {
if (d.stopDragging) {
d.stopDragging.call(d.thisArg, c, {$dragElement: this._$dragElement});
}
this._$dragElement.remove();
if (this._$dropClue) {
this._$dropClue.remove();
}
a(document).off(".draggable");
this._isDragging = false;
}
}
};
return b;
})($telerik.$);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridItemResizer = function (a) {
Telerik.Web.UI.GridItemResizer.initializeBase(this);
this._owner = a;
this._onResizeMouseUpDelegate = null;
this._cellsWithEvents = [];
};
Telerik.Web.UI.GridItemResizer.prototype = {
dispose: function () {
for (var a = 0;
a < this._cellsWithEvents.length;
a++) {
$clearHandlers(this._cellsWithEvents[a]);
this._cellsWithEvents[a]._events = null;
this._cellsWithEvents[a]._onResizeMouseDownDelegate = null;
}
this._cellsWithEvents = null;
this._destroyRowResizer();
if (this._onResizeMouseUpDelegate) {
$telerik.removeExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
}
}, _detectResizeCursorsOnItems: function (d, a) {
var i = this;
if ((a != null) && (a.tagName.toLowerCase() == "td") && !this._owner.MoveHeaderDiv) {
var f = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
var h = false;
while (f && Telerik.Web.UI.Grid.IsChildOf(f, this._owner.get_element())) {
if (f.id && f.id.split("__").length == 2) {
h = true;
break;
}
f = Telerik.Web.UI.Grid.GetFirstParentByTagName(f.parentNode, "tr");
}
if (!h) {
return;
}
var b = a.parentNode.parentNode.parentNode;
var c = $find(b.id);
if (c != null) {
if (!c.get_element()) {
return;
}
if (!c.get_element().tBodies[0]) {
return;
}
var k = Telerik.Web.UI.Grid.GetEventPosY(d);
var l = $telerik.isSafari ? Telerik.Web.UI.Grid.FindPosY(f) : Telerik.Web.UI.Grid.FindPosY(a);
var g = l + a.offsetHeight;
this._resizeTolerance = 5;
var j = a.title;
if ((k > g - this._resizeTolerance) && (k < g + this._resizeTolerance)) {
a.style.cursor = "n-resize";
a.title = this._owner.ClientSettings.ClientMessages.DragToResize;
if (!a._onResizeMouseDownDelegate) {
a._onResizeMouseDownDelegate = Function.createDelegate(this, this._onResizeMouseDownHandler);
$addHandler(a, "mousedown", a._onResizeMouseDownDelegate);
this._cellsWithEvents[this._cellsWithEvents.length] = a;
}
} else {
a.style.cursor = "default";
a.title = "";
if (a._onResizeMouseDownDelegate) {
if (a._events != null) {
$removeHandler(a, "mousedown", a._onResizeMouseDownDelegate);
}
a._onResizeMouseDownDelegate = null;
a._events = null;
}
}
}
}
}, _moveItemResizer: function (a) {
if ((this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null) && (this._owner._rowResizer.parentNode != null)) {
this._owner._rowResizer.style.top = Telerik.Web.UI.Grid.GetEventPosY(a) + "px";
if (this._owner.ClientSettings.Resizing.EnableRealTimeResize) {
this._destroyRowResizerAndResizeRow(a, false);
this._updateRowResizerWidth(a);
}
}
}, _destroyRowResizerAndResizeRow: function (d, g) {
if ((this._owner._cellToResize != "undefined") && (this._owner._cellToResize != null) && (this._owner._cellToResize.tagName.toLowerCase() == "td") && (this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null)) {
var f;
var a = $telerik.isSafari ? Telerik.Web.UI.Grid.FindPosY(this._owner._cellToResize.parentNode) : Telerik.Web.UI.Grid.FindPosY(this._owner._cellToResize);
if (this._gridDataDiv) {
f = parseInt(this._owner._rowResizer.style.top) + this._gridDataDiv.scrollTop - (a);
} else {
f = parseInt(this._owner._rowResizer.style.top) - (a);
}
if (f > 0) {
var b = this._owner._cellToResize.parentNode.parentNode.parentNode;
var c = $find(b.id);
if (c != null) {
c.resizeItem(this._owner._cellToResize.parentNode.rowIndex, f);
}
}
}
if (g) {
this._destroyRowResizer();
}
}, _updateRowResizerWidth: function (c) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((a != null) && (a.tagName.toLowerCase() == "td")) {
var b = this._owner._rowResizerRefTable;
if (b != null) {
this._owner._rowResizer.style.width = this._owner.get_element().offsetWidth + "px";
}
}
}, _createRowResizer: function (d) {
this._destroyRowResizer();
var a = Telerik.Web.UI.Grid.GetCurrentElement(d);
if ((a != null) && (a.tagName.toLowerCase() == "td")) {
if (a.cellIndex > 0) {
var g = a.parentNode.rowIndex;
a = a.parentNode.parentNode.parentNode.rows[g].cells[0];
}
this._owner._rowResizer = null;
this._owner._cellToResize = a;
var b = a.parentNode.parentNode.parentNode;
var c = $find(b.id);
this._owner._rowResizer = document.createElement("div");
this._owner._rowResizer.style.backgroundColor = "navy";
this._owner._rowResizer.style.height = "1px";
this._owner._rowResizer.style.fontSize = "1";
this._owner._rowResizer.style.position = "absolute";
this._owner._rowResizer.style.cursor = "n-resize";
if (c != null) {
this._owner._rowResizerRefTable = c;
this._owner._rowResizer.style.width = this._owner.get_element().offsetWidth + "px";
this._owner._rowResizer.style.left = Telerik.Web.UI.Grid.FindPosX(this._owner.get_element()) + "px";
}
this._owner._rowResizer.style.top = Telerik.Web.UI.Grid.GetEventPosY(d) + "px";
var f = document.body;
f.appendChild(this._owner._rowResizer);
}
}, _destroyRowResizer: function () {
if ((this._owner._rowResizer != "undefined") && (this._owner._rowResizer != null) && (this._owner._rowResizer.parentNode != null)) {
var a = this._owner._rowResizer.parentNode;
a.removeChild(this._owner._rowResizer);
this._owner._rowResizer = null;
this._owner._rowResizerRefTable = null;
}
}, _onResizeMouseDownHandler: function (b) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (a) {
if (a.tagName.toLowerCase() != "td") {
return;
}
$clearHandlers(a);
}
this._createRowResizer(b);
Telerik.Web.UI.Grid.ClearDocumentEvents();
this._onResizeMouseUpDelegate = Function.createDelegate(this, this._onResizeMouseUpHandler);
$telerik.addExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
this._owner._isRowResize = true;
}, _onResizeMouseUpHandler: function (a) {
$telerik.removeExternalHandler(document, "mouseup", this._onResizeMouseUpDelegate);
this._owner._isRowResize = null;
this._destroyRowResizerAndResizeRow(a, true);
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
};
Telerik.Web.UI.GridItemResizer.registerClass("Telerik.Web.UI.GridItemResizer", null, Sys.IDisposable);
Telerik.Web.UI.GridDataItem = function (a) {
Telerik.Web.UI.GridDataItem.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._selected = false;
this._selectable = true;
this._expanded = false;
this._display = false;
this._dataKeyValue = null;
this._dataItem = null;
this._itemIndexHierarchical = "";
this._itemIndex = null;
this._editFormItem = "notSet";
this._nestedViews = null;
};
Telerik.Web.UI.GridDataItem.prototype = {
initialize: function () {
Telerik.Web.UI.GridDataItem.callBaseMethod(this, "initialize");
var b = this, a = b._element.id.split("_");
b._itemIndex = parseInt(a[a.length - 1]);
}, dispose: function () {
this._owner._owner.raise_rowDestroying(new Telerik.Web.UI.GridDataItemEventArgs(this.get_element(), null));
if (this.get_element()) {
$clearHandlers(this.get_element());
this._element.control = null;
}
Telerik.Web.UI.GridDataItem.callBaseMethod(this, "dispose");
}, get_itemIndex: function () {
return this._itemIndex;
}, get_itemIndexHierarchical: function () {
return this._itemIndexHierarchical;
}, get_owner: function () {
return this._owner;
}, get_cell: function (a) {
return this.get_parent().getCellByColumnUniqueName(this, a);
}, get_dataItem: function () {
return this._dataItem;
}, findControl: function (a) {
return $telerik.findControl(this.get_element(), a);
}, findElement: function (a) {
return $telerik.findElement(this.get_element(), a);
}, getDataKeyValue: function (c) {
var b = this.get_element().id.split("__")[1];
var a = null;
if (this._owner._owner._clientKeyValues && this._owner._owner._clientKeyValues[b]) {
a = this._owner._owner._clientKeyValues[b];
}
return (a) ? a[c] : null;
}, get_selected: function () {
return this._selected;
}, set_selected: function (b) {
if (this._selected != b) {
if (!this.get_selectable()) {
return;
}
var a = {ctrlKey: false};
if (!this._owner._owner._selection._selectRowInternal(this.get_element(), a, true, true, true)) {
return;
}
}
}, get_selectable: function () {
return this._selectable;
}, get_expanded: function () {
return this._expanded;
}, set_expanded: function (a) {
if (this._expanded != a) {
if (a && !this._owner.expandItem(this.get_element())) {
return;
}
if (!a && !this._owner.collapseItem(this.get_element())) {
return;
}
this._expanded = a;
}
}, get_nestedViews: function () {
var j = this, g = j._nestedViews, h = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(j.get_element(), "tr");
if (!g) {
j._nestedViews = g = [];
if (j.get_owner()._data.hasDetailItemTemplate) {
h = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(h, "tr");
}
if (h) {
var a = j.get_owner().get_element().id.split("Detail").length, c = h.getElementsByTagName("table"), b, f;
for (var d = 0, e = c.length;
d < e;
d++) {
b = c[d];
if (b.id.indexOf("Detail") != -1 && b.id.indexOf("_mainTable") == -1 && a + 1 == b.id.split("Detail").length) {
f = $find(b.id);
if (f && Telerik.Web.UI.GridTableView.isInstanceOfType(f)) {
Array.add(g, f);
}
}
}
}
}
return g;
}, get_display: function () {
return this._display;
}, set_display: function (a) {
if (this._display != a) {
this._display = a;
}
}, get_isInEditMode: function () {
return Array.indexOf(this.get_owner().get_owner()._editIndexes, this._itemIndexHierarchical) > -1;
}, get_editFormItem: function () {
if (this._editFormItem === "notSet") {
if ($telerik.$) {
var a = $telerik.$(this.get_element()).next();
if (a.children("td").children("div.rgEditForm").length) {
this._editFormItem = a.get(0);
}
}
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(this.get_element(), "tr");
if (c && c.cells) {
for (var b = 0;
b < c.cells.length;
b++) {
if ($telerik.getChildByClassName(c.cells[b], "rgEditForm")) {
this._editFormItem = c;
}
}
}
if (this._editFormItem === "notSet") {
this._editFormItem = null;
}
}
return this._editFormItem;
}
};
Telerik.Web.UI.GridDataItem.registerClass("Telerik.Web.UI.GridDataItem", Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridScrolling = function () {
Telerik.Web.UI.GridScrolling.initializeBase(this);
this._owner = {};
this._onGridScrollDelegate = null;
};
Telerik.Web.UI.GridScrolling.prototype = {
initialize: function () {
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "initialize");
this.AllowScroll = this._owner.ClientSettings.Scrolling.AllowScroll;
this.UseStaticHeaders = this._owner.ClientSettings.Scrolling.UseStaticHeaders;
if (!this._owner.canRepaint()) {
this._shouldInitializeLayoutAndScroll = true;
this._owner.add_parentShown(this._owner.get_element());
} else {
this._initializeDimensions();
this._initializeScroll();
}
if (Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender() && !this._dropDownTouchScroll) {
this._createTouchScrollExtender(true);
}
}, updated: function () {
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "updated");
}, dispose: function () {
if (this._onResizeDelegate) {
try {
$removeHandler(window, "resize", this._onResizeDelegate);
this._onResizeDelegate = null;
} catch (a) {
}
}
if (this._onGridFrozenScrollDelegate) {
$removeHandler(this._frozenScroll, "scroll", this._onGridFrozenScrollDelegate);
this._onGridFrozenScrollDelegate = null;
}
if (this._onGridScrollDelegate) {
if (this._owner.GridDataDiv) {
$removeHandler(this._owner.GridDataDiv, "scroll", this._onGridScrollDelegate);
}
if (this._owner.GridHeaderDiv) {
$removeHandler(this._owner.GridHeaderDiv, "scroll", this._onGridScrollDelegate);
}
this._onGridScrollDelegate = null;
}
if (this._frozenScroll) {
$clearHandlers(this._frozenScroll);
}
this._createTouchScrollExtender(false);
Telerik.Web.UI.GridScrolling.callBaseMethod(this, "dispose");
}, _initializeDimensions: function () {
var d = this;
this.onWindowResize();
this.initializeAutoLayout();
this.applyFrozenScroll();
var c = 0;
this._onResizeDelegate = Function.createDelegate(this._owner, function () {
var e = this;
clearInterval(c);
c = setTimeout(function () {
clearInterval(c);
e.repaint();
}, 200);
});
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
setTimeout(function () {
$addHandler(window, "resize", d._onResizeDelegate);
}, 0);
} else {
$addHandler(window, "resize", this._onResizeDelegate);
}
if (this._owner.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
if (this._owner.ClientSettings.Resizing.AllowRowResize) {
this._owner.ClientSettings.Scrolling.FrozenColumnsCount++;
}
if (this._owner.MasterTableViewHeader && this._owner.MasterTableViewHeader._data._columnsData) {
for (var a = 0, b = this._owner.MasterTableViewHeader._data._columnsData.length;
a < b;
a++) {
if (this._owner.MasterTableViewHeader._data._columnsData[a].ColumnType == "GridExpandColumn") {
this._owner.ClientSettings.Scrolling.FrozenColumnsCount++;
}
}
}
}
}, _createTouchScrollExtender: function (c) {
var a = this._owner.GridDataDiv;
if (a) {
var b = this._dropDownTouchScroll;
if (b) {
if (!c) {
b.dispose();
this._dropDownTouchScroll = null;
}
} else {
if (c) {
this._dropDownTouchScroll = new Telerik.Web.UI.TouchScrollExtender(a);
this._dropDownTouchScroll.initialize();
}
}
}
}, applyFrozenScroll: function () {
this._frozenScroll = $get(this._owner.ClientID + "_Frozen");
var b = Telerik.Web.UI.Grid.getScrollBarHeight();
if (this._frozenScroll) {
var a = $get(this._owner.ClientID + "_FrozenScroll");
this._onGridFrozenScrollDelegate = Function.createDelegate(this, this.onGridFrozenScroll);
$addHandler(this._frozenScroll, "scroll", this._onGridFrozenScrollDelegate);
this.gridMasterTableWidth = this._owner.get_masterTableView().get_element().offsetWidth;
a.style.width = this._owner.GridDataDiv.scrollWidth + "px";
a.style.height = b + "px";
if (this._owner.get_masterTableView().get_element().offsetWidth > this._owner.GridDataDiv.clientWidth) {
if ($telerik.isIE) {
b++;
}
this._frozenScroll.style.height = b + "px";
if (this._owner.ClientSettings.Scrolling.SaveScrollPosition && typeof this._owner.ClientSettings.Scrolling.ScrollLeft != "undefined") {
this._frozenScroll.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (this._owner.GridDataDiv.style.overflowX != null) {
this._owner.GridDataDiv.style.overflowX = "hidden";
} else {
this._frozenScroll.style.marginTop = "-" + b + "px";
this._frozenScroll.style.zIndex = 99999;
this._frozenScroll.style.position = "relative";
}
if ((window.netscape)) {
this._frozenScroll.style.width = this._owner.GridDataDiv.offsetWidth - b + "px";
}
if (Telerik.Web.UI.Grid.IsRightToLeft(this._owner.GridHeaderDiv) && Telerik.Web.UI.Grid.IsScrollOnLeftSide()) {
this._frozenScroll.style.marginLeft = b + "px";
} else {
if (!(Telerik.Web.UI.Grid.IsRightToLeft(this._owner.GridHeaderDiv) && $telerik.isSafari)) {
this._frozenScroll.style.marginRight = b + "px";
}
}
if (this._owner.GridHeaderDiv && this._owner.GridDataDiv) {
if ((this._owner.GridDataDiv.clientWidth == this._owner.GridDataDiv.offsetWidth)) {
if (typeof(this._frozenScroll.style.overflowX) != "undefined" && typeof(this._frozenScroll.style.overflowY) != "undefined") {
this._frozenScroll.style.overflowX = "auto";
this._frozenScroll.style.overflowY = "hidden";
if (window.netscape) {
this._frozenScroll.style.width = parseInt(this._frozenScroll.style.width) + b + "px";
}
}
}
}
if ($telerik.isIE8) {
this._frozenScroll.style.overflowX = "scroll";
}
} else {
this._frozenScroll.style.height = 0;
}
this.isFrozenScroll = true;
this.gridDataTableWidth = this._owner.GridDataDiv.clientWidth;
this.isFrozenScrollApplied = true;
}
}, onGridFrozenResized: function () {
var e = Telerik.Web.UI.Grid.getScrollBarHeight(), b = $get(this._owner.ClientID + "_FrozenScroll");
if ($telerik.isIE) {
++e;
}
if (this.gridDataTableWidth != this._owner.GridDataDiv.clientWidth) {
this.gridDataTableWidth = this._owner.GridDataDiv.clientWidth;
if (this.gridMasterTableWidth > this.gridDataTableWidth) {
this._frozenScroll.style.height = e + "px";
if (this._owner.GridDataDiv.style.overflowX != null) {
this._owner.GridDataDiv.style.overflowX = "hidden";
} else {
this._frozenScroll.style.marginTop = "-" + e + "px";
this._frozenScroll.style.zIndex = 99999;
this._frozenScroll.style.position = "relative";
}
if ((window.netscape)) {
this._frozenScroll.style.width = this._owner.GridDataDiv.offsetWidth - e + "px";
this._frozenScroll.style.marginRight = e + "px";
}
if (this._owner.GridHeaderDiv && this._owner.GridDataDiv) {
if ((this._owner.GridDataDiv.clientWidth == this._owner.GridDataDiv.offsetWidth)) {
if (typeof(this._frozenScroll.style.overflowX) != "undefined" && typeof(this._frozenScroll.style.overflowY) != "undefined") {
this._frozenScroll.style.overflowX = "auto";
this._frozenScroll.style.overflowY = "hidden";
if (window.netscape) {
this._frozenScroll.style.width = parseInt(this._frozenScroll.style.width) + e + "px";
this._frozenScroll.style.marginRight = 0;
}
}
}
}
if ($telerik.isIE8) {
this._frozenScroll.style.overflowX = "scroll";
}
} else {
this._frozenScroll.scrollLeft = 0;
this._frozenScroll.style.height = 0;
var a = this._owner.get_masterTableView().get_columns();
for (var c = 0, d = a.length;
c < d;
c++) {
if (!a[c].get_visible()) {
this._owner.get_masterTableView().showColumn(c);
}
}
}
}
}, onGridFrozenScroll: function (a) {
if (!this._frozenScrollCounter) {
this._frozenScrollCounter = 0;
}
this._frozenScrollCounter++;
var b = this;
b._currentElement = Telerik.Web.UI.Grid.GetCurrentElement(a);
Telerik.Web.UI.Grid.frozenScrollHanlder = function (e) {
var v = 10;
if ($telerik.isOpera) {
v = navigator.userAgent.substring(navigator.userAgent.indexOf("Version/") + "Version".length + 1) * 1;
}
if (b._frozenScrollCounter != e) {
return;
}
if (!b._lastScrollIndex) {
b._lastScrollIndex = 0;
}
var f = b._currentElement;
if (b._owner.ClientSettings.Scrolling.FrozenColumnsCount > b._owner.get_masterTableViewHeader().get_columns().length) {
b.isFrozenScroll = false;
}
if (b.isFrozenScroll) {
var s = [];
s._getPreviousNotFrozenColumnWidth = function (j) {
var A = 0;
for (var k = 0;
k < this.length - 1;
k++) {
if (this[k].Index < j) {
A += this[k].Width;
}
}
return A;
};
var h = b._owner.get_masterTableView()._getFirstDataRow();
for (var m = b._owner.ClientSettings.Scrolling.FrozenColumnsCount;
m < b._owner.get_masterTableView().get_columns().length;
m++) {
var c = b._owner.get_masterTableView().get_columns()[m];
var y = false;
if ((window.netscape || $telerik.isSafari || $telerik.isIE8 || ($telerik.isOpera && v > 10.1)) && c.get_element().style.display == "none") {
c.get_element().style.display = "table-cell";
y = true;
}
var u;
if ($telerik.isIE9Mode) {
u = b._owner.get_masterTableView().ColGroup.Cols[m].style.width.replace("px", "") * 1;
} else {
if (!($telerik.isIE6 || $telerik.isIE7) && b._owner.get_masterTableView().ColGroup.Cols[m].style.width.indexOf("px") > -1) {
if (typeof(h) != "undefined" && h.cells[m].offsetWidth > 0) {
u = h.cells[m].offsetWidth;
} else {
u = parseInt(b._owner.get_masterTableView().ColGroup.Cols[m].style.width, 10);
}
} else {
u = (c.get_element().offsetWidth > 0) ? c.get_element().offsetWidth : (typeof(h) == "undefined" ? 0 : h.cells[m].offsetWidth);
}
}
s[s.length] = {Index: m, Width: u, FrozenDisplay: true};
if (typeof(c.FrozenDisplay) == "boolean") {
s[s.length - 1].FrozenDisplay = c.FrozenDisplay;
}
if ((window.netscape || $telerik.isSafari || $telerik.isIE8 || ($telerik.isOpera && v > 10.1)) && y) {
c.get_element().style.display = "none";
y = false;
}
}
var z = 0;
var t = -1;
if ((f.scrollWidth - f.offsetWidth) != 0) {
t = f.scrollWidth - f.offsetWidth;
}
z = Math.floor((f.scrollLeft / t) * 100);
if (z < 0) {
z = -1 * z;
}
if (z > 100) {
z = 100;
}
if (Telerik.Web.UI.Grid.IsRightToLeft(b._owner.GridHeaderDiv) && ($telerik.isSafari || $telerik.isIE7)) {
z = 100 - z;
}
var l = b._owner.get_masterTableView().get_columns();
var m = 0, g = f.scrollLeft;
while (m < s.length) {
var c = s[m];
var w = s._getPreviousNotFrozenColumnWidth(c.Index);
if ((f.scrollWidth - f.offsetWidth) < 0) {
break;
}
var d = Math.floor(((c.Width + w) / t) * 100);
if (d <= z && g != 0) {
if (c.FrozenDisplay) {
b._owner.get_masterTableViewHeader()._hideNotFrozenColumn(c.Index);
}
} else {
if (!c.FrozenDisplay) {
b._owner.get_masterTableViewHeader()._showNotFrozenColumn(c.Index);
}
}
m++;
if (m == (s.length - 1) && z == 100) {
var x = 0;
var q = 0;
var o = 0;
for (var n = 0;
n < l.length - 1;
n++) {
if (typeof(l[n].FrozenDisplay) == "boolean" && !l[n].FrozenDisplay) {
x += s[o].Width;
o++;
q = n;
}
}
if ((x - t) < 0) {
var r = s[o];
b._owner.get_masterTableViewHeader()._hideNotFrozenColumn(r.Index);
}
}
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableView().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
b._owner.get_masterTableView().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableViewHeader().get_element().style.width = "100%";
b._owner.get_masterTableView().get_element().style.width = "100%";
if (z == 100 && ($telerik.isFirefox || $telerik.isIE7)) {
b._owner.get_masterTableViewHeader().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
b._owner.get_masterTableView().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "";
setTimeout(function () {
if ($telerik.isFirefox && Sys.Browser.version >= 4) {
b._owner.get_masterTableView().get_element().style.tableLayout = "fixed";
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
}, 100);
} else {
if ($telerik.isIE8) {
if (z == 100) {
var p = l.length - 1;
if (!b.lastColumnWidth) {
b.lastColumnWidth = b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width;
b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width = "";
b._owner.get_masterTableView().get_element().getElementsByTagName("col")[p].style.width = "";
}
b._owner.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
b._owner.get_masterTableView().get_element().style.tableLayout = "auto";
} else {
if (b.lastColumnWidth) {
var p = l.length - 1;
b._owner.get_masterTableView().get_element().getElementsByTagName("col")[p].style.width = b.lastColumnWidth;
b._owner.get_masterTableViewHeader().get_element().getElementsByTagName("col")[p].style.width = b.lastColumnWidth;
b.lastColumnWidth = null;
}
}
}
}
if (b._owner.get_masterTableViewFooter()) {
b._owner.get_masterTableViewFooter().get_element().style.width = b._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
b._owner.get_masterTableViewFooter().get_element().style.tableLayout = "auto";
b._owner.get_masterTableViewFooter().get_element().style.tableLayout = "fixed";
}
} else {
b._owner.GridDataDiv.scrollLeft = f.scrollLeft;
}
b._frozenScrollCounter = 0;
b._owner.updateClientState();
b._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(b._currentElement));
};
setTimeout("Telerik.Web.UI.Grid.frozenScrollHanlder(" + this._frozenScrollCounter + ")", 0);
}, onWindowResize: function () {
this.setDataDivHeight();
this.setHeaderAndFooterDivsWidth();
if (this.isFrozenScrollApplied) {
this.onGridFrozenResized();
}
}, setHeaderAndFooterDivsWidth: function () {
var c = this._owner, d = c.get_element(), i = c.get_masterTableView(), a = c.GridDataDiv, f = c.GridHeaderDiv;
if (!i || !a || !f) {
return;
}
var j = i.get_element(), l = Telerik.Web.UI.Grid.getScrollBarHeight(), g = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
if (g) {
if (a.offsetWidth > 0 && (j.offsetWidth >= d.offsetWidth - l || j.offsetHeight > a.offsetHeight) && (document.compatMode && document.compatMode != "BackCompat")) {
var n = a.offsetWidth - l;
if (n > 0) {
if ($telerik.isIE6 && this._onResizeDelegate) {
if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate)) {
$removeHandler(window, "resize", this._onResizeDelegate);
}
}
if ($telerik.isIE6 && this._onResizeDelegate) {
var m = this;
setTimeout(function () {
$addHandler(window, "resize", m._onResizeDelegate);
}, 0);
}
}
} else {
if (a.offsetWidth > 0) {
if ($telerik.isIE6 && this._onResizeDelegate) {
if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate)) {
$removeHandler(window, "resize", this._onResizeDelegate);
}
}
f.style.width = a.offsetWidth + "px";
if ($telerik.isIE6 && this._onResizeDelegate) {
var m = this;
setTimeout(function () {
$addHandler(window, "resize", m._onResizeDelegate);
}, 0);
}
}
}
}
var h = Telerik.Web.UI.Grid.IsRightToLeft(f) && Telerik.Web.UI.Grid.IsScrollOnLeftSide();
var b = this._owner.GridFooterDiv;
if (a.clientWidth === a.offsetWidth) {
if ($telerik.isIE7) {
f.style.width = "100%";
}
f.style.marginRight = f.style.paddingRight = "";
f.style.marginLeft = f.style.paddingLeft = "";
} else {
if (!h) {
if ($telerik.isIE7) {
f.style.width = "";
}
f.style.marginRight = l + "px";
f.style.marginLeft = f.style.paddingRight = "";
} else {
if (!$telerik.isChrome) {
f.style.marginLeft = l + "px";
f.style.marginRight = f.style.paddingRight = "";
}
}
}
if (b) {
b.style.paddingRight = f.style.paddingRight;
b.style.paddingLeft = f.style.paddingLeft;
b.style.width = f.style.width;
b.style.marginRight = f.style.marginRight;
b.style.marginLeft = f.style.marginLeft;
}
if (this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var e = this._owner._groupPanel, k = this._owner.get_masterTableViewHeader();
if (e && e._items.length > 0 && g && k) {
j.style.width = k.get_element().offsetWidth + "px";
}
}
}, setDataDivHeight: function () {
if (this._owner.GridDataDiv && this._owner.get_element().style.height != "") {
this._owner.GridDataDiv.style.height = "10px";
var b = 0;
if (this._owner._groupPanelClientID != "" && this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var a = $get(this._owner._groupPanelClientID);
if (a) {
b += a.offsetHeight;
}
}
if (this._owner.GridHeaderDiv) {
b += this._owner.GridHeaderDiv.parentNode.offsetHeight;
}
if (this._owner.GridFooterDiv) {
b += this._owner.GridFooterDiv.parentNode.offsetHeight;
}
if (this._owner.PagerControl) {
b += this._owner.PagerControl.offsetHeight;
}
if (this._owner.TopPagerControl) {
b += this._owner.TopPagerControl.offsetHeight;
}
if (this._owner.ClientSettings.Scrolling.FrozenColumnsCount > 0) {
b += Telerik.Web.UI.Grid.getScrollBarHeight();
}
var c = this._owner.get_element().clientHeight - b;
if (c > 0) {
var d = this._owner.get_element().style.position;
if (window.netscape) {
this._owner.get_element().style.position = "absolute";
}
this._owner.GridDataDiv.style.height = c + "px";
if (window.netscape) {
this._owner.get_element().style.position = d;
}
}
}
}, initializeAutoLayout: function () {
var r = this._owner.MasterTableView;
var l = this._owner.get_masterTableViewHeader();
if (this.AllowScroll && this.UseStaticHeaders && r && l) {
var s = r.get_element();
var n = l.get_element();
var f = r._getFirstDataRow();
var h = this._owner.get_masterTableViewFooter();
var k = h ? h.get_element() : null;
if (!f && $telerik.isIE7) {
s.style.width = "100%";
}
if (s.style.tableLayout != "auto") {
return;
}
n.style.tableLayout = "auto";
var o = l.HeaderRow;
var b = 0;
var m = null;
if (o) {
m = o.cells;
} else {
if (l.MultiHeaderCells) {
m = l.MultiHeaderCells;
}
}
if (m != null) {
b = m.length;
if (f && f.cells.length < m.length) {
b = f.cells.length;
}
}
var a = 0;
var q = $telerik.isIE6 || $telerik.isIE7;
if (q) {
var d = this._getColWidthCorrections(b, n, r.get_columns());
}
for (var p = 0;
p < b;
p++) {
var c = this._owner.get_masterTableViewHeader().ColGroup.Cols[p];
if (!c || (c.style.width != "" && !window.netscape)) {
continue;
}
var t = m[p].offsetWidth;
if (f && f.cells[p].offsetWidth > t) {
t = f.cells[p].offsetWidth;
}
if (k) {
var g = k.tBodies[0].rows[0];
var j = g ? g.cells[p] : null;
if (j && j.offsetWidth > t) {
t = j.offsetWidth;
}
}
a += t;
if (t <= 0) {
continue;
}
var e = 0;
if (q && d[p]) {
e = d[p];
}
c.style.width = (t + e) + "px";
r.ColGroup.Cols[p].style.width = t + "px";
if (h && h.ColGroup) {
h.ColGroup.Cols[p].style.width = t + "px";
}
}
s.style.tableLayout = n.style.tableLayout = "fixed";
if (k) {
k.style.tableLayout = "fixed";
}
}
}, initializeSaveScrollPosition: function () {
if (!this._owner.ClientSettings.Scrolling.SaveScrollPosition) {
return;
}
if (this._owner.ClientSettings.Scrolling.ScrollTop != "" && !this._owner.ClientSettings.Scrolling.EnableVirtualScrollPaging) {
var c = this, d = c._owner.get_masterTableView()._virtualization, b = c._owner.ClientSettings.Virtualization;
if (d) {
if (b.ItemAtTop) {
setTimeout(function () {
c._owner.add_dataBound(c._scrollToIndex);
d.select(b.StartIndex, true);
}, 100);
} else {
if (this._owner.ClientSettings.Scrolling.ScrollTop) {
d._shouldLoadState = false;
d._startScrollTop = this._owner.ClientSettings.Scrolling.ScrollTop;
}
}
}
this._owner.GridDataDiv.scrollTop = this._owner.ClientSettings.Scrolling.ScrollTop;
}
var a = $get(this._owner.ClientID + "_Frozen");
if (this._owner.ClientSettings.Scrolling.ScrollLeft && this._owner.ClientSettings.Scrolling.ScrollLeft != "") {
if (this._owner.GridHeaderDiv && !a) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (this._owner.GridFooterDiv && !a) {
this._owner.GridFooterDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
if (a) {
a.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
} else {
this._owner.GridDataDiv.scrollLeft = this._owner.ClientSettings.Scrolling.ScrollLeft;
}
}
}, _scrollToIndex: function (a) {
a.get_masterTableView()._virtualization.scrollToIndex(a.ClientSettings.Virtualization.ItemAtTop);
a.remove_dataBound(a._scrolling._scrollToIndex);
}, _initializeScroll: function () {
var b = this;
var a = function () {
b.initializeSaveScrollPosition();
};
if (window.netscape && !window.opera) {
window.setTimeout(a, 0);
} else {
a();
}
this._initializeVirtualScrollPaging();
if (this._owner.GridDataDiv || this._owner.GridHeaderDiv) {
this._onGridScrollDelegate = Function.createDelegate(this, this._onGridScroll);
if (this._owner.GridDataDiv) {
$addHandlers(this._owner.GridDataDiv, {scroll: this._onGridScrollDelegate});
}
if (this._owner.GridHeaderDiv) {
$addHandlers(this._owner.GridHeaderDiv, {scroll: this._onGridScrollDelegate});
}
}
}, _hideRadComboBoxes: function () {
if (Telerik.Web.UI.RadComboBox) {
var b = document.getElementsByTagName("div");
var e = [];
for (var f = 0, k = b.length;
f < k;
f++) {
var a = b[f];
if (Sys.UI.DomElement.containsCssClass(a, "rcbSlide")) {
Array.add(e, a);
}
}
for (var f = 0, k = e.length;
f < k;
f++) {
var g = e[f].getElementsByTagName("div");
if (g) {
for (var h = 0, l = g.length;
h < l;
h++) {
if (g[h].id.indexOf("_DropDown") > -1) {
var d = g[h].id.substr(0, g[h].id.indexOf("_DropDown"));
var c = $find(d);
if (c && c.get_dropDownVisible() && Telerik.Web.UI.Grid.IsChildOf(c.get_element(), this._owner.get_element())) {
c.hideDropDown();
}
}
}
}
}
}
}, _onGridScroll: function (b) {
if (this._owner._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
if (this._owner._getFilterMenu()) {
this._owner._getFilterMenu().hide();
}
}
this._hideRadComboBoxes();
var f = null;
if (Telerik.Web.UI.RadDatePicker) {
f = Telerik.Web.UI.RadDatePicker.PopupInstances;
} else {
if (Telerik.Web.UI.RadDateInputComponent) {
f = Telerik.Web.UI.RadDatePickerComponent.PopupInstances;
}
}
if (f) {
for (var d in f) {
if ($find(d) && (($find(d).get_id().indexOf(this._owner.ClientID + "_gdtcSharedCalendar") > -1) || ($find(d).get_id().indexOf(this._owner.ClientID + "_gdtcSharedTimeView") > -1))) {
f[d].Hide();
}
}
}
var a = (b.srcElement) ? b.srcElement : b.target;
if (window.opera && this.isFrozenScroll) {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft = 0;
return;
}
if (this.UseStaticHeaders) {
this._updateDataDivScrollPos(a);
}
if (!Telerik.Web.UI.GridSelection || (Telerik.Web.UI.GridSelection && this._owner.ClientSettings.EnablePostBackOnRowClick) || (this._owner._selectedItemsInternal.length > 0 && this._owner._selectedIndexes.length == 0)) {
var g = this._owner._selectedItemsInternal;
if (g.length > 0) {
for (var c = 0;
c < g.length;
c++) {
if (g != null && !Array.contains(this._owner._selectedIndexes, g[c].itemIndex)) {
Array.add(this._owner._selectedIndexes, g[c].itemIndex);
}
}
}
}
this._owner.updateClientState();
this._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(this._owner._gridDataDiv));
}, _updateDataDivScrollPos: function (a) {
if (!a) {
return;
}
if (!this.isFrozenScroll) {
if (this._owner.GridHeaderDiv) {
if (a == this._owner.GridHeaderDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft && this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft;
}
} else {
this._owner.GridDataDiv.scrollLeft = this._owner.GridHeaderDiv.scrollLeft;
}
}
if (a == this._owner.GridDataDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
}
if (this._owner.GridFooterDiv) {
this._owner.GridFooterDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
if (this._owner.GridHeaderDiv) {
if ($telerik.isSafari) {
if (this._owner.GridHeaderDiv.scrollLeft && this._owner.GridHeaderDiv.scrollLeft != this._owner.GridDataDiv.scrollLeft) {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
} else {
this._owner.GridHeaderDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
if (this._owner.GridFooterDiv) {
this._owner.GridFooterDiv.scrollLeft = this._owner.GridDataDiv.scrollLeft;
}
}
}, _initializeVirtualScrollPaging: function (d) {
if (!this._owner.ClientSettings.Scrolling.EnableVirtualScrollPaging) {
return;
}
this._scrollCounter = 0;
this._currentAJAXScrollTop = 0;
if (this._owner.ClientSettings.Scrolling.AJAXScrollTop != "" && typeof(this._owner.ClientSettings.Scrolling.AJAXScrollTop) != "undefined") {
this._currentAJAXScrollTop = this._owner.ClientSettings.Scrolling.AJAXScrollTop;
}
var h = this._owner.get_masterTableView().get_currentPageIndex() * this._owner.get_masterTableView().get_pageSize() * 20;
var k = this._owner.get_masterTableView().get_pageCount() * this._owner.get_masterTableView().get_pageSize() * 20;
var i = k - h;
var f = this._owner.get_masterTableView().get_element();
var c;
var a;
if (($telerik.isIE8 || $telerik.isSafari || $telerik.isOpera) && f) {
if (f.parentNode) {
c = $get("dummyDivTop", f.parentNode);
if (!c) {
c = document.createElement("div");
c.innerHTML = " ";
c.style.height = "1px";
c.id = "dummyDivTop";
c.style.marginTop = "-1px";
f.parentNode.insertBefore(c, f);
}
a = $get("dummyDivBottom", f.parentNode);
if (!a) {
a = document.createElement("div");
a.innerHTML = " ";
a.style.height = "1px";
a.id = "dummyDivBottom";
a.style.marginBottom = "-1px";
f.parentNode.appendChild(a);
}
}
}
var j = f.offsetHeight;
var e = $telerik.isOpera && +Sys.Browser.version < 9.800000000000001;
if (d && (e || ($telerik.isFirefox && !$telerik.isFirefox3))) {
if (f.style.marginBottom != "") {
j = j - parseInt(f.style.marginBottom);
}
if (f.style.marginTop != "") {
j = j - parseInt(f.style.marginTop);
}
}
var b = this._owner._gridDataDiv.offsetHeight;
if (!e) {
if (($telerik.isIE8 || $telerik.isOpera) && c && a) {
c.style.height = Math.max(h, 0) + "px";
if (i >= b) {
a.style.height = Math.max(i - j, 0) + "px";
} else {
a.style.height = Math.max(b - j, 0) + "px";
}
} else {
f.style.marginTop = h + "px";
if (i >= b) {
f.style.marginBottom = i - j + "px";
} else {
f.style.marginBottom = b - j + "px";
}
}
} else {
f.style.position = "relative";
f.style.top = h + "px";
f.style.marginBottom = k - j + "px";
}
this._owner._gridDataDiv.scrollTop = h;
this._currentAJAXScrollTop = h;
this._createScrollerToolTip();
var g = Function.createDelegate(this, this._onAjaxScrollHandler);
$addHandler(this._owner._gridDataDiv, "scroll", g);
}, _createScrollerToolTip: function () {
var a = $get(this._owner.get_id() + "ScrollerToolTip");
if (!a) {
this._scrollerToolTip = document.createElement("span");
this._scrollerToolTip.id = this._owner.get_id() + "ScrollerToolTip";
this._scrollerToolTip.style.position = "absolute";
this._scrollerToolTip.style.zIndex = 10000;
this._scrollerToolTip.style.display = "none";
if (this._owner.Skin != "") {
this._scrollerToolTip.className = String.format("GridToolTip_{0}", this._owner.Skin);
}
if (!this._owner._embeddedSkin || this._owner.Skin == "") {
this._scrollerToolTip.style.border = "1px solid";
this._scrollerToolTip.style.backgroundColor = "#F5F5DC";
this._scrollerToolTip.style.font = "icon";
this._scrollerToolTip.style.padding = "2px";
}
document.body.appendChild(this._scrollerToolTip);
}
}, _onAjaxScrollHandler: function (a) {
var b = this._owner._gridDataDiv;
if (b) {
this._currentScrollTop = b.scrollTop;
}
this._scrollCounter++;
var g = this;
Telerik.Web.UI.Grid.AjaxScrollInternal = function (e) {
if (g._scrollCounter != e) {
return;
}
var h = g._owner._gridDataDiv;
if (g._currentAJAXScrollTop != h.scrollTop) {
if (g._owner.get_masterTableView().get_currentPageIndex() == c) {
return;
}
g._owner.get_masterTableView().page(c + 1);
}
g._scrollCounter = 0;
g._hideScrollerToolTip();
};
this._owner.raise_scroll(new Telerik.Web.UI.GridScrollEventArgs(b));
var d = Telerik.Web.UI.Grid.getScrollBarHeight();
var f = b.scrollTop / (b.scrollHeight - b.offsetHeight + d);
var c = Math.round((this._owner.get_masterTableView().get_pageCount() - 1) * f);
window.setTimeout("Telerik.Web.UI.Grid.AjaxScrollInternal(" + this._scrollCounter + ")", 500);
this._showScrollerTooltip(f, c);
}, _showScrollerTooltip: function (e, b) {
var d = $get(this._owner.get_id() + "ScrollerToolTip");
if (d) {
var c = this._owner.get_masterTableView().get_pageCount();
this._applyPagerTooltipText(d, b, c);
var a = this._owner._gridDataDiv;
d.style.display = "";
d.style.top = parseInt(Telerik.Web.UI.Grid.FindPosY(a)) + Math.round(a.offsetHeight * e) + "px";
d.style.left = parseInt(Telerik.Web.UI.Grid.FindPosX(a)) + a.offsetWidth - (a.offsetWidth - a.clientWidth) - d.offsetWidth + "px";
}
}, _applyPagerTooltipText: function (g, e, d) {
if (this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString == "") {
g.style.display = "none";
} else {
var h = this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString;
var c = /\{0[^\}]*\}/g;
var b = /\{1[^\}]*\}/g;
var f = ((e == 0) ? 1 : e + 1);
var a = d;
h = h.replace(c, f).replace(b, a);
g.innerHTML = h;
}
}, _hideScrollerToolTip: function () {
var a = this;
setTimeout(function () {
var b = $get(a._owner.get_id() + "ScrollerToolTip");
if (b && b.parentNode) {
b.style.display = "none";
}
}, 200);
}, _getColWidthCorrections: function (b, h, c) {
var d = {};
if (h && h.tHead && h.tHead.rows.length > 0) {
var a = h.tHead.rows[0].cells;
var f = 0;
var g = 0;
for (var e = 0;
e < c.length;
e++) {
if (e == f && a[g]) {
f += a[g].colSpan;
g++;
} else {
if (c[e]) {
d[e] = Telerik.Web.UI.Grid.correctWidthForIE(c[e].get_element());
}
}
}
}
return d;
}
};
Telerik.Web.UI.GridScrolling.registerClass("Telerik.Web.UI.GridScrolling", Sys.Component);
Telerik.Web.UI.GridScrollEventArgs = function (a) {
Telerik.Web.UI.GridScrollEventArgs.initializeBase(this);
this.scrollTop = a.scrollTop;
this.scrollLeft = a.scrollLeft;
this.scrollControl = a;
this.isOnTop = (a.scrollTop == 0) ? true : false;
var b = Telerik.Web.UI.Grid.getScrollBarHeight();
if (a.clientHeight == a.offsetHeight) {
b = 0;
}
this.isOnBottom = ((a.scrollHeight - a.offsetHeight + b) == a.scrollTop) ? true : false;
};
Telerik.Web.UI.GridScrollEventArgs.prototype = {
get_scrollTop: function () {
return this.scrollTop;
}, get_scrollLeft: function () {
return this.scrollLeft;
}, get_scrollControl: function () {
return this.scrollControl;
}, get_isOnTop: function () {
return this.isOnTop;
}, get_isOnBottom: function () {
return this.isOnBottom;
}
};
Telerik.Web.UI.GridScrollEventArgs.registerClass("Telerik.Web.UI.GridScrollEventArgs", Sys.EventArgs);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridSelection = function () {
Telerik.Web.UI.GridSelection.initializeBase(this);
this._owner = {};
this._masterTable = null;
this._selectionInProgress = false;
this._lastSelectedItemIndex = null;
};
Telerik.Web.UI.GridSelection.prototype = {
initialize: function () {
var c = this;
Telerik.Web.UI.GridSelection.callBaseMethod(c, "initialize");
if (c._owner._masterClientID == null) {
return;
}
$addHandlers(c._owner.get_element(), {click: Function.createDelegate(c, c._click)});
c._masterTable = $get(c._owner._masterClientID).tBodies[0];
if (c._owner.AllowMultiRowSelection && !c._owner.ClientSettings.Selecting.UseClientSelectColumnOnly) {
if (c._owner.ClientSettings.Selecting.EnableDragToSelectRows) {
$addHandlers(c._masterTable, {mousedown: Function.createDelegate(c, c._mousedown)});
$addHandlers(c._masterTable, {mousemove: Function.createDelegate(c, c._mousemove)});
$addHandlers(c._masterTable, {mouseup: Function.createDelegate(c, c._mouseup)});
$telerik.addExternalHandler(document, "mouseup", Function.createDelegate(c, c._mouseup));
} else {
$addHandlers(c._masterTable, {
mousedown: c._mouseDownTryClearDocumentEvents,
mouseup: c._mouseUpRestoreDocumentEvents
}, c);
}
}
if (this._owner._selectedItemsInternal.length > 0) {
var a = null;
for (var b = 0;
b < this._owner._selectedItemsInternal.length;
b++) {
a = this._owner._selectedItemsInternal[b].itemIndex;
if (!Array.contains(this._owner._selectedIndexes, a)) {
Array.add(this._owner._selectedIndexes, a);
}
}
}
}, updated: function () {
Telerik.Web.UI.GridSelection.callBaseMethod(this, "updated");
}, dispose: function () {
if (this._masterTable) {
$clearHandlers(this._masterTable);
this._masterTable._events = null;
}
this._masterTable = null;
this._owner = null;
Telerik.Web.UI.GridSelection.callBaseMethod(this, "dispose");
}, get_owner: function () {
return this._owner;
}, set_owner: function (a) {
this._owner = a;
}, _mouseDownTryClearDocumentEvents: function (a) {
if (!a.shiftKey || this._shouldReturnOnMouseDown(a)) {
return;
}
Telerik.Web.UI.Grid.ClearDocumentEvents(true);
}, _mouseUpRestoreDocumentEvents: function (a) {
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _mousedown: function (a) {
if (this._owner.ClientSettings.Selecting.EnableDragToSelectRows && this._owner.AllowMultiRowSelection && !this._owner._rowResizer && a.rawEvent.button != 2) {
this._createRowSelectorArea(a);
}
}, _mousemove: function (a) {
if (this._owner._isRowDragged()) {
this._destroyRowSelectorArea(a);
return;
}
this._resizeRowSelectorArea(a);
}, _mouseup: function (a) {
this._destroyRowSelectorArea(a);
}, _shouldReturnOnMouseDown: function (b) {
if (b.ctrlKey) {
return true;
}
var a = null;
if (b.srcElement) {
a = b.srcElement;
} else {
if (b.target) {
a = b.target;
}
}
if (!a || a == null || !a.tagName) {
return true;
}
if (a.tagName.toLowerCase() == "input" || a.tagName.toLowerCase() == "textarea" || a.tagName.toLowerCase() == "select" || a.tagName.toLowerCase() == "option") {
return true;
}
if ((!this._owner.ClientSettings.Selecting.AllowRowSelect) || (!this._owner.AllowMultiRowSelection)) {
return true;
}
}, _createRowSelectorArea: function (c) {
if (this._shouldReturnOnMouseDown(c)) {
return;
}
var b = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((!b) || (!Telerik.Web.UI.Grid.IsChildOf(b, this._owner.get_element()))) {
return;
}
this._firstRow = Telerik.Web.UI.Grid.GetFirstParentByTagName(b, "tr");
if (this._firstRow.id == "") {
return;
}
if (!this._rowSelectorArea) {
this._rowSelectorArea = document.createElement("span");
this._rowSelectorArea.style.position = "absolute";
this._rowSelectorArea.style.zIndex = 1000100;
if (this._owner.Skin != "") {
this._rowSelectorArea.className = String.format("GridRowSelector_{0}", this._owner.Skin);
}
if (!this._owner._embeddedSkin || this._owner.Skin == "") {
this._rowSelectorArea.style.backgroundColor = "navy";
}
if ("opacity" in this._rowSelectorArea.style) {
this._rowSelectorArea.style.opacity = 0.1;
} else {
if ("MozOpacity" in this._rowSelectorArea.style) {
this._rowSelectorArea.style.MozOpacity = 1 / 10;
} else {
this._rowSelectorArea.style.filter = "alpha(opacity=10);";
}
}
if (this._owner._gridDataDiv) {
this._rowSelectorArea.style.top = Telerik.Web.UI.Grid.FindPosY(this._firstRow) + this._owner._gridDataDiv.scrollTop + "px";
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._firstRow) + this._owner._gridDataDiv.scrollLeft + "px";
if (parseInt(this._rowSelectorArea.style.left) < Telerik.Web.UI.Grid.FindPosX(this._owner.get_element())) {
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._owner.get_element()) + "px";
}
} else {
this._rowSelectorArea.style.top = Telerik.Web.UI.Grid.FindPosY(this._firstRow) + "px";
this._rowSelectorArea.style.left = Telerik.Web.UI.Grid.FindPosX(this._firstRow) + "px";
}
document.body.appendChild(this._rowSelectorArea);
Telerik.Web.UI.Grid.ClearDocumentEvents(true);
var a = document.activeElement;
if (a && a.tagName && a.tagName.toLowerCase() === "input") {
document.activeElement.blur();
}
}
}, _destroyRowSelectorArea: function (c) {
if (this._rowSelectorArea) {
var f = this._rowSelectorArea.style.height;
document.body.removeChild(this._rowSelectorArea);
this._rowSelectorArea = null;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
var j;
if ((!a) || (!Telerik.Web.UI.Grid.IsChildOf(a, this._owner.get_element()))) {
return;
}
var l = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "td");
if ((a.tagName.toLowerCase() == "td") || (a.tagName.toLowerCase() == "tr") || (l && l.tagName.toLowerCase() == "td")) {
if (a.tagName.toLowerCase() == "td") {
j = a.parentNode;
} else {
if (l.tagName.toLowerCase() == "td") {
j = l.parentNode;
} else {
if (a.tagName.toLowerCase() == "tr") {
j = a;
}
}
}
if (this._firstRow.parentNode.parentNode.id == j.parentNode.parentNode.id) {
var k = this._owner;
var m = (this._firstRow.rowIndex < j.rowIndex) ? this._firstRow.rowIndex : j.rowIndex;
var d = (m == this._firstRow.rowIndex) ? j.rowIndex : this._firstRow.rowIndex;
if (!c.ctrlKey && !c.shiftKey && m !== d) {
k.clearSelectedItems();
}
this._selectionInProgress = true;
k._keyboardNavigationProperties.lastClickSelectedItem = j;
for (var g = m;
g < d + 1;
g++) {
if (g == d) {
this._selectionInProgress = false;
}
var b = this._firstRow.parentNode.parentNode.rows[g];
if (b.id == "") {
continue;
}
if (b) {
if (f != "") {
var h = $find(b.id);
if (h) {
h.set_selected(true);
} else {
var n = $find(b.id.split("__")[0]);
n.selectItem(b);
}
}
}
}
} else {
}
}
}
}, _resizeRowSelectorArea: function (c) {
if ((this._rowSelectorArea) && (this._rowSelectorArea.parentNode)) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(c);
if ((!a) || (!Telerik.Web.UI.Grid.IsChildOf(a, this._owner.get_element()))) {
return;
}
var h = parseInt(this._rowSelectorArea.style.left);
var f = Telerik.Web.UI.Grid.GetEventPosX(c);
var i = parseInt(this._rowSelectorArea.style.top);
var g = Telerik.Web.UI.Grid.GetEventPosY(c);
if (g >= $telerik.getLocation(this._rowSelectorArea).y + this._rowSelectorArea.offsetHeight && this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.dragDirectionTop = null;
}
if ((f - h - 5) > 0) {
this._rowSelectorArea.style.width = f - h - 5 + "px";
}
if (this._rowSelectorArea.offsetWidth > this._owner.get_element().offsetWidth) {
this._rowSelectorArea.style.width = this._owner.get_element().offsetWidth + "px";
}
if (g > i && !this._rowSelectorArea.dragDirectionTop) {
if ((g - i - 5) > 0) {
this._rowSelectorArea.style.height = g - i - 5 + "px";
}
} else {
if (!this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.dragDirectionTop = true;
}
if ((i - g - 5) > 0 || this._rowSelectorArea.dragDirectionTop) {
this._rowSelectorArea.style.top = g - 5 + "px";
var d = Telerik.Web.UI.Grid.FindPosY(this._firstRow) - parseInt(this._rowSelectorArea.style.top) - 5;
if (d > 0) {
if (this._owner._gridDataDiv) {
if ((this._owner._gridDataDiv.offsetHeight + this._owner._gridDataDiv.offsetTop) > parseInt(this._rowSelectorArea.style.top) + d) {
this._rowSelectorArea.style.height = d + "px";
} else {
var b = (this._owner._gridDataDiv.offsetHeight + this._owner._gridDataDiv.offsetTop) - parseInt(this._rowSelectorArea.style.top) - 5;
this._rowSelectorArea.style.height = (b >= 0) ? b + "px" : 0 + "px";
}
} else {
this._rowSelectorArea.style.height = d + "px";
}
}
}
}
}
}, _shouldRaiseRowEvent: function (b) {
var d, a = $find(b.id);
if (!a && b.parentNode) {
a = $find(b.parentNode.id);
}
var c = (b.tagName.toLowerCase() == "input" && b.type.toLowerCase() == "checkbox" && (b.id && b.id.indexOf("SelectCheckBox") != -1));
if ((b.tagName.toLowerCase() == "input" && !c) || b.tagName.toLowerCase() == "select" || b.tagName.toLowerCase() == "option" || b.tagName.toLowerCase() == "button" || b.tagName.toLowerCase() == "a" || b.tagName.toLowerCase() == "textarea" || b.tagName.toLowerCase() == "img" || (a && Telerik.Web.UI.RadButton && Telerik.Web.UI.RadButton.isInstanceOfType(a))) {
d = false;
} else {
d = true;
}
return d;
}, _click: function (b) {
var c = (b.target) ? b.target : b.srcElement;
if ($telerik.isTouchDevice && c.nodeType == 3) {
c = c.parentNode;
}
if (!c.tagName) {
return;
}
if (c.tagName.toLowerCase() == "label" && c.htmlFor) {
return;
}
var g = c.id && c.id.indexOf("RowDragHandle") > -1;
if (!this._shouldRaiseRowEvent(c) && !g) {
return;
}
var f = (c.tagName.toLowerCase() == "input" && c.type.toLowerCase() == "checkbox" && (c.id && c.id.indexOf("SelectCheckBox") != -1));
var l = this._owner;
if (f && l.ClientSettings.AllowKeyboardNavigation) {
l.get_element().focus();
}
if (l.ClientSettings.Selecting && l.ClientSettings.Selecting.AllowRowSelect) {
if (b.ctrlKey) {
l._keyboardNavigationProperties.holdingCtrl = true;
}
if (c.tagName.toLowerCase() != "tr") {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
while (c && c.id.split("__").length !== 2 && c.parentNode) {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c.parentNode, "tr");
}
}
if (l.ClientSettings.Selecting.UseClientSelectColumnOnly && !f && this._findClientSelectColumn(c) && !g) {
} else {
var k = c;
var d = false;
while (c && Telerik.Web.UI.Grid.IsChildOf(c, l.get_element())) {
if (c.id && c.id.split("__").length == 2) {
d = true;
break;
}
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c.parentNode, "tr");
}
if (!d) {
c = k;
}
if (c && (c.parentNode.parentNode.parentNode == l.get_element() || c.parentNode.parentNode.parentNode == l._gridDataDiv || Array.contains(l.get_detailTables(), $find(c.parentNode.parentNode.id))) && c.id && c.id.split("__").length == 2) {
if (l.get_allowMultiRowSelection()) {
if (b.shiftKey) {
var a = l._searchRowIndex(c.id);
var j = this._lastSelectedItemIndex;
this._selectionInProgress = true;
if (!isNaN(parseInt(j))) {
if (j < a) {
if (!b.ctrlKey) {
l._clearSelectedItemsExcludingInterval(j, a);
}
l._selectItemsInInterval(j, a, 1);
} else {
if (j > a) {
if (!b.ctrlKey) {
l._clearSelectedItemsExcludingInterval(a, j);
}
l._selectItemsInInterval(a, j, 1);
} else {
l._clearSelectedItemsExcludingInterval(j, j);
}
}
} else {
this._lastSelectedItemIndex = a;
}
}
if (b.ctrlKey || (!b.ctrlKey && !b.shiftKey)) {
this._lastSelectedItemIndex = l._searchRowIndex(c.id);
}
this._selectionInProgress = false;
this._selectRowInternal(c, b, f, true, true);
} else {
if (f) {
var i = Array.contains(l._selectedIndexes, c.id.split("__")[1]);
this._selectRowInternal(c, b, i, i, true);
} else {
this._selectRowInternal(c, b, false, false, true);
}
}
l._keyboardNavigationProperties.lastClickSelectedItem = c;
}
}
}
if (l.ClientSettings && l.ClientSettings.EnablePostBackOnRowClick && c) {
if (c && c.tagName.toLowerCase() != "tr") {
c = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
}
if (c && c.id != "" && c.id.split("__").length == 2) {
var h = c.id.split("__")[1];
var m = l.ClientSettings.PostBackFunction;
m = m.replace("{0}", l.UniqueID);
m = m.replace("{1}", "RowClick;" + h);
setTimeout(function () {
eval(m);
}, 100);
}
}
}, _selectRowInternal: function (r, h, m, w, u, s) {
var t;
if (typeof(s) == "undefined") {
s = true;
t = false;
} else {
t = s;
}
var o = r.id.split("__")[1];
var v = $find(r.id.split("__")[0]);
v.get_dataItems();
var f = $find(r.id);
if (f && !f.get_selectable()) {
this._selectRowInternalSetActiveRow(r, h);
return;
}
if (!m) {
var q = (h.rawEvent && !h.rawEvent.metaKey) || $telerik.isTouchDevice;
if (!this._owner.AllowMultiRowSelection || (this._owner.AllowMultiRowSelection && (!(h.ctrlKey || h.shiftKey) && q))) {
if (!h.shiftKey) {
this._owner._keyboardNavigationProperties.lastSelectedRowIndex = this._owner._searchRowIndex(r.id);
}
if (this._owner._selectedItemsInternal.length > 0) {
var l = this._owner._selectedItemsInternal.length - 1;
while (l >= 0) {
var d = $get(this._owner._selectedItemsInternal[l].id);
if (d == null) {
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
l--;
continue;
}
var f = $find(d.id);
if (f && !f.get_selectable()) {
l--;
continue;
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, h);
this._owner.raise_rowDeselecting(a);
if (a.get_cancel()) {
l--;
continue;
}
Sys.UI.DomElement.removeCssClass(d, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle) {
var c = d.style.cssText.toLowerCase().replace(/ /g, "");
var b = c.split(";");
for (var p = 0;
p < b.length;
p++) {
if (v._data._selectedItemStyle.toLowerCase().indexOf(b[p]) != -1) {
b[p] = "";
}
}
d.style.cssText = b.join(";");
}
this._checkClientSelectColumn(d, false);
var n = $find(this._owner._selectedItemsInternal[l].id);
if (n) {
n._selected = false;
}
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
if (this._owner.get_enableAriaSupport()) {
d.setAttribute("aria-selected", "false");
}
this._owner.raise_rowDeselected(new Telerik.Web.UI.GridDataItemEventArgs(d, h));
l = Math.min(this._owner._selectedItemsInternal.length, l);
l--;
}
}
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
if (!Array.contains(this._owner._selectedIndexes, o)) {
if (!this._owner.AllowMultiRowSelection && this._owner._selectedIndexes.length > 0) {
this._checkClientSelectColumn(r, false);
} else {
if (!m || s) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(r, h);
this._owner.raise_rowSelecting(a);
if (a.get_cancel()) {
if (m) {
this._checkClientSelectColumn(r, false);
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
return false;
}
Sys.UI.DomElement.addCssClass(r, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle != "") {
r.style.cssText = r.style.cssText + ";" + v._data._selectedItemStyle;
}
Array.add(this._owner._selectedItemsInternal, {itemIndex: o, id: r.id});
Array.add(this._owner._selectedIndexes, o);
this._checkClientSelectColumn(r, true);
var n = $find(r.id);
if (n) {
n._selected = true;
}
if (this._owner.get_enableAriaSupport()) {
r.setAttribute("aria-selected", "true");
}
this._owner.raise_rowSelected(new Telerik.Web.UI.GridDataItemEventArgs(r, h));
var x = 0;
var g = v.get_dataItems();
for (var l = 0;
len = g.length, l < len;
l++) {
if (!g[l].get_selectable() && !g[l].get_selected()) {
x++;
}
}
if (!t && v.get_selectedItems().length == v.get_dataItems().length - x) {
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, true);
}
}
}
}
}
} else {
if ((w || (m && !s)) && !h.shiftKey) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(r, h);
this._owner.raise_rowDeselecting(a);
if (!a.get_cancel()) {
Sys.UI.DomElement.removeCssClass(r, v._data._selectedItemStyleClass);
if (v._data._selectedItemStyle) {
var c = r.style.cssText.toLowerCase().replace(/ /g, "");
var b = c.split(";");
for (var p = 0;
p < b.length;
p++) {
if (v._data._selectedItemStyle.toLowerCase().indexOf(b[p]) != -1) {
b[p] = "";
}
}
r.style.cssText = b.join(";");
}
for (var l = 0;
l < this._owner._selectedItemsInternal.length;
l++) {
if (this._owner._selectedItemsInternal[l].itemIndex == o) {
var n = $find(this._owner._selectedItemsInternal[l].id);
if (n) {
n._selected = false;
}
Array.remove(this._owner._selectedItemsInternal, this._owner._selectedItemsInternal[l]);
break;
}
}
for (var l = 0;
l < this._owner._selectedIndexes.length;
l++) {
if (this._owner._selectedIndexes[l] == o) {
Array.remove(this._owner._selectedIndexes, this._owner._selectedIndexes[l]);
break;
}
}
this._checkClientSelectColumn(r, false);
if (this._owner.get_enableAriaSupport()) {
r.setAttribute("aria-selected", "false");
}
this._owner.raise_rowDeselected(new Telerik.Web.UI.GridDataItemEventArgs(r, h));
if (r.parentNode != null && typeof(r.parentNode) != "undefined" && r.parentNode.parentNode != null && typeof(r.parentNode.parentNode) != "undefined") {
var k = this._getTableHeaderRow(r.parentNode.parentNode);
if (k) {
this._checkClientSelectColumn(k, false);
}
}
}
}
}
if (u) {
this._owner.updateClientState();
}
this._selectRowInternalSetActiveRow(r, h);
return true;
}, _selectRowInternalSetActiveRow: function (b, a) {
if (this._owner.ClientSettings.AllowKeyboardNavigation) {
if (this._selectionInProgress && this._owner.get_allowMultiRowSelection()) {
return true;
}
if (this._owner._activeRow && b.id != this._owner._activeRow.id) {
this._owner._setActiveRow(b, a);
}
}
}, _checkClientSelectColumn: function (e, d) {
var c = e.getElementsByTagName("input");
for (var a = 0;
a < c.length;
a++) {
var b = c[a];
if (b.type.toLowerCase() != "checkbox") {
continue;
}
if (b.id && b.id.indexOf("SelectCheckBox") != -1) {
b.checked = d;
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-checked", d.toString());
}
if ($telerik.isSafari) {
b.safarichecked = d;
}
}
}
}, _getTableHeaderRow: function (c) {
var b = Telerik.Web.UI.Grid.getTableHeaderRow(c);
var a = this._owner.get_masterTableView()._hasMultiHeaders;
if (b) {
if (a && b.parentNode.tagName.toLowerCase() == "thead") {
return b.parentNode;
}
return b;
}
b = $get(String.format("{0}_Header", this.get_owner().get_masterTableView().get_id()));
if (b) {
b = Telerik.Web.UI.Grid.getTableHeaderRow(b);
}
if (a && b.parentNode.tagName.toLowerCase() == "thead") {
return b.parentNode;
}
return b;
}, _findClientSelectColumn: function (d) {
if (!d) {
return;
}
var c = d.getElementsByTagName("input");
if (!c) {
return;
}
for (var a = 0;
a < c.length;
a++) {
var b = c[a];
if (b.type.toLowerCase() != "checkbox") {
continue;
}
if (b.id && b.id.indexOf("SelectCheckBox") != -1) {
return b;
}
}
}
};
Telerik.Web.UI.GridSelection.registerClass("Telerik.Web.UI.GridSelection", Sys.Component);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridTableView = function (a) {
Telerik.Web.UI.GridTableView.initializeBase(this, [a]);
this._owner = {};
this._data = {};
this._hiddenCols = {};
this._dataItemsCreated = false;
this._dataItems = [];
this._cachedItems = [];
this._columnsInternal = [];
this._sortExpressions = new Telerik.Web.UI.GridSortExpressions();
this._filterExpressions = new Telerik.Web.UI.GridFilterExpressions();
this._firstDataRow = null;
this._exapndedGroupItemsTemp;
this._enableGroupsExpandAll;
this._groupHeadersCount = [];
this._enableHierarchyExpandAll;
this._dataSource = null;
this._preventUpdatePager = false;
this._virtualItemCount = 0;
this._pageButtonCount = 10;
this._hasDetailTables = false;
this._hasMultiHeaders = false;
this._hierarchyLoadMode = "ServerOnDemand";
this.__shouldPerformFiltering = true;
this._shouldAutoPostBackOnFilter = true;
this._rangeValidationInProcess = false;
this._calculatedParentTableCells = false;
this._groupLevelsCount = 0;
this._groupColumnIndex = 1;
this._originalGroupLevel = null;
this._resizedColumnsData = new Telerik.Web.UI.Grid.ClientStateData();
this._hidedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._showedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._resizedItemsData = new Telerik.Web.UI.Grid.ClientStateData();
this._resizedControlData = new Telerik.Web.UI.Grid.ClientStateData();
this._includeAllHeaderRows;
};
Telerik.Web.UI.GridTableView.prototype = {
initialize: function () {
Telerik.Web.UI.GridTableView.callBaseMethod(this, "initialize");
if (this._element && this._owner && this._owner._element) {
var c = this._element.parentNode;
while (c) {
if ((this._owner._element == c) && c.control) {
this._owner = c.control;
break;
}
c = c.parentNode;
}
}
if (this._data._selectedItemStyleClass == "" && this._data._selectedItemStyle == "") {
this._data._selectedItemStyle = "background-color:navy;color:white;";
}
if (this._data._renderActiveItemStyleClass == "" && this._data._renderActiveItemStyle == "") {
this._data._renderActiveItemStyle = "background-color:navy;color:white;";
}
this.ColGroup = Telerik.Web.UI.Grid.GetTableColGroup(this.get_element());
if (this.ColGroup) {
this.ColGroup.Cols = Telerik.Web.UI.Grid.GetTableColGroupCols(this.ColGroup);
}
if ($telerik.quirksMode) {
for (var r = 0;
r < this.ColGroup.Cols.length;
r++) {
if (this.ColGroup.Cols[r].style.display == "none") {
this.ColGroup.Cols[r].style.display = "";
}
}
}
this.PageSize = this._data.PageSize;
this.PageCount = this._data.PageCount;
this.CurrentPageIndex = this._data.CurrentPageIndex;
this._virtualItemCount = this._data.VirtualItemCount;
this._pageButtonCount = this._data.PageButtonCount;
this._hasDetailTables = this._data.HasDetailTables;
this._hasMultiHeaders = this._data.HasMultiHeaders;
if (this._data.GroupLevelsCount) {
this._groupLevelsCount = this._data.GroupLevelsCount * 1;
this._exapndedGroupItemsTemp = new Array(this._groupLevelsCount);
}
if (this._data.GroupHeadersCount) {
this._groupHeadersCount = this._data.GroupHeadersCount;
}
if (this._data.HierarchyLoadMode) {
this._hierarchyLoadMode = this._data.HierarchyLoadMode;
}
if (this._data.EnableGroupsExpandAll) {
this._enableGroupsExpandAll = this._data.EnableGroupsExpandAll;
}
if (this._data.EnableHierarchyExpandAll) {
this._enableHierarchyExpandAll = this._data.EnableHierarchyExpandAll;
}
var q = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
if ((this.get_element().id.indexOf("_Header") != -1 && q) || (!q && this.get_element().id.indexOf("_Header") == -1) || (this.get_element().id.indexOf("_Detail") != -1)) {
var s = [];
if (this._hasMultiHeaders) {
s = Telerik.Web.UI.Grid.getMultiHeaderCells(this);
var w = this.get_element();
if ((w.id.indexOf("_Header") != -1 && q && ($telerik.isIE6 || $telerik.isIE7))) {
var n = w.tHead ? w.tHead.rows[0] : null;
if (n && n.className && n.className.indexOf("rgMultiHeaderRow") > -1) {
var f = n.cells;
var g = w.getElementsByTagName("colgroup")[0];
if (f && g) {
var h = g.getElementsByTagName("col");
var v = 0;
for (var p = 0;
p < f.length;
p++) {
var m = f[p];
if (m.colSpan > 1) {
for (var r = v + 1;
r < v + m.colSpan;
r++) {
if (h[r] && s[r] && h[r].style.width && h[r].style.width.indexOf("%") == -1) {
h[r].style.width = (h[r].offsetWidth + Telerik.Web.UI.Grid.correctWidthForIE(s[r])) + "px";
}
}
}
v += m.colSpan;
}
}
}
}
this.MultiHeaderCells = s;
} else {
var n = Telerik.Web.UI.Grid.getTableHeaderRow(this.get_element());
}
if (!n) {
var o = $get(this.get_element().id + "_Header");
if (o) {
n = Telerik.Web.UI.Grid.getTableHeaderRow(o);
}
}
this.HeaderRow = n;
var t = this._owner;
var u = t.ClientSettings;
if ($telerik.isMobileIE10 && (u.AllowRowsDragDrop || (u.Scrolling && u.Scrolling.AllowScroll))) {
this.get_element().style.msTouchAction = "none";
}
var b = this._data._columnsData;
for (var p = 0;
p < b.length;
p++) {
if (!n && (!s || !s[p])) {
continue;
}
var l = b[p];
var e = this._hasMultiHeaders ? s[p] : n.cells[p];
if (!e) {
continue;
}
this._owner.raise_columnCreating(new Sys.EventArgs());
var k = $create(Telerik.Web.UI.GridColumn, {_owner: this, _data: l}, null, null, e);
var d = new Sys.EventArgs();
d.get_column = function () {
return k;
};
Array.add(this._columnsInternal, k);
this._owner.raise_columnCreated(d);
}
this._setupHeaderRotations();
}
if ($telerik.isIE && document.documentMode && document.documentMode <= 7) {
this._setHeaderFooterSpan();
}
if (this._data.VirtualizationDataAsJSON && this.get_element().parentNode.id.indexOf("_GridData") !== -1) {
this._virtualization = $create(Telerik.Web.UI.GridVirtualization, null, null, {_tableView: this.get_id()}, null);
this._virtualization._tableView = this;
if (this._owner.ClientSettings.Virtualization.StartIndex) {
this._virtualization._startIndex = this._owner.ClientSettings.Virtualization.StartIndex;
}
this._virtualization.initialize();
} else {
if (this._owner.get_events().getHandler("rowCreating") || this._owner.get_events().getHandler("rowCreated")) {
this.get_dataItems();
}
}
if (this._owner.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
}, dispose: function () {
this._owner.raise_tableDestroying(Sys.EventArgs.Empty);
this._sortExpressions.dispose();
this._filterExpressions.dispose();
$clearHandlers(this.get_element());
if (this.get_element().tBodies[0]) {
$clearHandlers(this.get_element().tBodies[0]);
}
for (var a = 0;
a < this._dataItems.length;
a++) {
if (this._dataItems[a]) {
this._dataItems[a].dispose();
this._dataItems[a] = null;
}
}
if (this._cachedItems) {
for (var a = 0;
a < this._cachedItems.length;
a++) {
if (this._cachedItems[a]) {
this._cachedItems[a].dispose();
this._cachedItems[a] = null;
}
}
}
this._dataItems = [];
if (this.ColGroup != null && this.ColGroup.Cols != null) {
this.ColGroup.Cols = null;
}
if (this.ColGroup != null) {
this.ColGroup = null;
}
this._element.control = null;
this._owner = null;
this._data = null;
this._hiddenCols = null;
this._dataItems = null;
this._cachedItems = null;
this._columnsInternal = null;
this._groupHeadersCount = null;
Telerik.Web.UI.GridTableView.callBaseMethod(this, "dispose");
}, _setupHeaderRotations: function () {
var e = this, b = e.get_columns(), d = 0, a;
for (var c = 0;
c < b.length;
c++) {
a = b[c].get_element();
if (Sys.UI.DomElement.containsCssClass(a, "rgRotateHeader") && a.children[0].offsetWidth > d) {
d = a.children[0].offsetWidth;
}
}
if (parseInt($telerik.getComputedStyle(a, "height", 0), 10) > d) {
return;
}
if ($telerik.isOpera) {
d += ["paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth"].reduce(function (g, f) {
var h = parseInt($telerik.getCurrentStyle(a, f), 10);
return g + (isNaN(h) ? 0 : h);
}, 0);
}
if (d != 0) {
for (var c = 0;
c < b.length;
c++) {
if (b[c].get_element().style.height == "") {
b[c].get_element().style.height = d + "px";
}
}
}
}, _hideInvisibleColumns: function () {
if ($telerik.isIE7) {
var a = this.get_columns();
for (var b = 0;
b < a.length;
b++) {
if (!a[b].Display) {
this._hideShowColumn(b, false, true);
}
}
}
}, get_columns: function () {
return this._columnsInternal;
}, getColumnByUniqueName: function (b) {
var c = this, a = c._columnsByUniqueName = c._columnsByUniqueName || (function () {
var f = {}, d = tableView.get_columns();
for (var e = 0;
e < d.length;
e++) {
f[d[e].get_uniqueName()] = d[e];
}
return f;
})();
return a[b] || null;
}, showFilterItem: function () {
this._toggleFilterItemVisibility(true);
}, hideFilterItem: function () {
this._toggleFilterItemVisibility(false);
}, get_isFilterItemVisible: function () {
return this._data.isFilterItemExpanded;
}, _toggleFilterItemVisibility: function (a) {
var b = this._getTableFilterRow();
if (b && a != this._data.isFilterItemExpanded) {
if (a) {
b.style.display = "";
} else {
b.style.display = "none";
}
this._data.isFilterItemExpanded = a;
Array.add(this._owner._expandedFilterItems, this._data.UniqueID + "!");
this._owner.updateClientState();
}
}, get_tableFilterRow: function () {
return this._getTableFilterRow();
}, _getTableFilterRow: function () {
filterRow = null;
var d = this.get_element();
if (d.tHead && d.tHead.style.display != "none") {
if (this._hasMultiHeaders) {
for (var a = 0;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b.className && b.className.indexOf("rgFilterRow") > -1) {
return b;
}
}
}
if (!this.HeaderRow) {
return null;
}
var c = (this.HeaderRow) ? this.HeaderRow.rowIndex : 1;
for (var a = c;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b != null && b.cells[0] != null && b.cells[0].tagName != null && b.cells[0].tagName.toLowerCase() != "th" && b.className && b.className.indexOf("rgFilterRow") > -1) {
filterRow = b;
break;
}
}
} else {
if (this._owner.get_masterTableViewHeader() && this._owner.get_masterTableViewHeader().get_element()) {
d = this._owner.get_masterTableViewHeader().get_element();
if (d.tHead && this._hasMultiHeaders) {
for (var a = 0;
a < d.tHead.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b.className && b.className.indexOf("rgFilterRow") > -1) {
return b;
}
}
}
for (var a = 1;
a < d.rows.length;
a++) {
var b = d.tHead.rows[a];
if (b != null && b.cells[0] != null && b.cells[0].tagName != null && b.className && b.className.indexOf("rgFilterRow") > -1) {
filterRow = d.tHead.rows[a];
break;
}
}
}
}
return filterRow;
}, _initializeAriaSupport: function () {
var j = this.get_element();
if (j.id && j.id.indexOf("Detail") != -1) {
j.setAttribute("role", "listitem");
var h = j.parentNode;
if (h && h.tagName.toLowerCase() == "td") {
h.setAttribute("role", "group");
}
var f = this.get_dataItems();
if (f.length > 0) {
var g = f[0].get_element().id.split(":").length;
j.setAttribute("aria-level", g.toString());
}
}
var a = this.get_tableFilterRow();
if (a) {
var d = a.getElementsByTagName("input");
for (var b = 0;
b < d.length;
b++) {
var c = d[b];
var e = c.style.display != "none" && c.style.visibility != "hidden";
if (e) {
var k = c.type.toLowerCase();
if (k == "text") {
c.setAttribute("role", "textbox");
}
if (k == "submit" || k == "button") {
c.setAttribute("role", "button");
}
if (k == "checkbox") {
c.setAttribute("role", "checkbox");
}
}
}
}
}, _handleAutoPostBackOnFilterWithoutDelay: function (c, g, d) {
var b = $find(c);
var a = b.get_textBoxValue();
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
try {
var f = this.get_id();
this._currentFilterTimeoutID = setTimeout(function () {
var j = $find(f);
var h = b.get_textBoxValue();
var i = b.parseDate(h);
if (!j._shouldAutoPostBackOnFilter) {
return;
}
if (i != null) {
b.set_selectedDate(i);
if (b.get_selectedDate()) {
j.filter(g, j._getFilterControlValue(g));
}
} else {
if (h == "") {
if (j.__shouldPerformFiltering) {
j.filter(g, "");
} else {
this.__shouldPerformFiltering = true;
}
}
}
}, d);
} catch (e) {
}
}, _handleAutoPostBackOnFilterWithDelay: function (d, b, h, c) {
var a = $find(b);
var e = d ? d : window.event;
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
try {
var g = this.get_id();
if (e.keyCode == 13 || e.keyCode == 20) {
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
this._currentFilterTimeoutID = setTimeout(function () {
var k = $find(g);
var i = a.get_textBoxValue();
var j = a.parseDate(i);
if (j != null) {
a.set_selectedDate(j);
} else {
if (i == "") {
a.set_selectedDate(i);
}
}
}, 0);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
var k = $find(g);
var i = a.get_textBoxValue();
var j = a.parseDate(i);
if (j != null) {
a.set_selectedDate(j);
} else {
if (i == "") {
a.set_selectedDate(i);
}
}
}, c);
}
} catch (f) {
}
}, _filterOnKeyDownWithDelay: function (b, d, g, a, e) {
var c = b ? b : window.event;
if (c.keyCode == 8 || c.keyCode == 46) {
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
var f = this.get_id();
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, a);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, a);
}
}
}, _filterOnKeyPressWithDelay: function (b, d, g, a, e) {
var c = b ? b : window.event;
var f = this.get_id();
if ($telerik.isFirefox && ((c.keyCode >= 33 && c.keyCode <= 40) || (c.keyCode >= 112 && c.keyCode <= 123) || (c.keyCode >= 16 && c.keyCode <= 20) || (c.keyCode >= 144 && c.keyCode <= 145) || (c.keyCode >= 92 && c.keyCode <= 93))) {
return;
}
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
if (c.keyCode == 13) {
c.cancelBubble = true;
c.returnValue = false;
if ((c.preventDefault)) {
c.preventDefault();
c.stopPropagation();
}
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, 0);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, 0);
}
return false;
} else {
if (!$telerik.isOpera || e) {
this._currentFilterTimeoutID = setTimeout(function () {
$find(f).filter(g, $get(d).value);
}, a);
} else {
this._currentFilterTimeoutID = setTimeout(function () {
$get(d).blur();
}, a);
}
}
}, _filterNoDelay: function (a, c) {
var b = this.get_id();
if (this._currentFilterTimeoutID) {
clearTimeout(this._currentFilterTimeoutID);
}
this._currentFilterTimeoutID = setTimeout(function () {
var e = $get(a).value;
var d = $find(a);
if (d && d.get_value) {
e = d.get_value();
}
$find(b).filter(c, e);
}, 0);
}, get_clientDataKeyNames: function () {
var a = [];
if (this._data.clientDataKeyNames) {
a = this._data.clientDataKeyNames;
}
return a;
}, get_dataItems: function () {
if (this._dataItemsCreated || (this._cachedItems && this._cachedItems.length > 0)) {
return this._dataItems;
}
this._dataItemsCreated = true;
var o = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0];
var n = o.rows;
for (var c = 0, k = n.length;
c < k;
c++) {
var m = n[c];
if (!m.id) {
continue;
}
var b = $find(m.id);
var a = {};
this._owner.raise_rowCreating(new Sys.EventArgs());
var e = true;
var g = this._owner._unselectableItemsInternal;
for (var h = 0;
len = g.length, h < len;
h++) {
if (g[h].id == m.id) {
e = false;
break;
}
}
var f = false;
for (var h = 0;
h < this._owner._selectedItemsInternal.length;
h++) {
if (this._owner._selectedItemsInternal[h].id == m.id) {
f = true;
break;
}
}
var d = false;
if (this._owner._expandItems[m.id.split("__")[1]]) {
d = true;
}
for (var h = 0;
h < this._owner._expandedItems.length;
h++) {
if (this._owner._expandedItems[h] == m.id.split("__")[1]) {
d = !d;
break;
}
}
if (!b) {
b = $create(Telerik.Web.UI.GridDataItem, {_owner: this, _data: a}, null, null, m);
}
b._selectable = e;
b._selected = f;
b._expanded = d;
b._itemIndexHierarchical = m.id.split("__")[1];
if (this._virtualization) {
this._virtualization.updateItemState(b);
}
this._dataItems[this._dataItems.length] = b;
if (c == 0) {
this._saveCellAttributes(b);
}
this._owner.raise_rowCreated(new Telerik.Web.UI.GridDataItemEventArgs(m, null));
}
if (this._virtualization) {
this._virtualization.updateItemsCellSelectionState();
}
return this._dataItems;
}, get_owner: function () {
return this._owner;
}, get_name: function () {
return this._data.Name;
}, get_isItemInserted: function () {
return this._data.IsItemInserted;
}, get_insertItem: function () {
var b = $find(this._owner.get_id());
var c = null;
function a(j) {
for (var g = 0;
g < j.length;
g++) {
var h = j[g];
if (h.className.indexOf("rgEditRow") > -1) {
return h;
} else {
var f = h.getElementsByTagName("div")[0];
if (f && f.className.indexOf("rgEditForm") > -1) {
return h;
}
}
}
return null;
}
if (this === b.get_masterTableView() && b.ClientSettings.Scrolling.AllowScroll && b.ClientSettings.Scrolling.UseStaticHeaders) {
if (b.GridHeaderDiv) {
var e = b.GridHeaderDiv.getElementsByTagName("thead")[0];
if (e) {
c = a(e.rows);
}
if (!c && b.PagerControl) {
c = a(b.PagerControl.rows);
}
}
} else {
var d = this.get_element();
if (d.tHead) {
c = a(d.tHead.rows);
}
if (!c && d.tFoot) {
c = a(d.tFoot.rows);
}
}
return c;
}, get_editItems: function () {
var a = [];
var c = this.get_dataItems();
for (var b = 0;
b < c.length;
b++) {
if (c[b].get_isInEditMode()) {
a[a.length] = c[b];
}
}
return a;
}, _handlerKeyDownInInserItem: function (a) {
var d = a.keyCode || a.charCode;
var b = (d == this._owner.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey);
var c = (d == this._owner.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey);
if (!this._owner._canHandleKeyboardAction(a)) {
return;
}
if (b) {
this.cancelInsert();
a.cancelBubble = true;
a.returnValue = false;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
} else {
if (c) {
this.insertItem();
a.cancelBubble = true;
a.returnValue = false;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
}
}
return false;
}, _showNotFrozenColumn: function (a) {
this._hideShowNotFrozenColumn(a, true);
}, _hideNotFrozenColumn: function (a) {
this._hideShowNotFrozenColumn(a, false);
}, showColumn: function (c) {
if (this.get_columns()[c].Display) {
return;
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[c], null);
this._owner.raise_columnShowing(a);
if (a.get_cancel()) {
return false;
}
this._hideShowColumn(c, true);
var b = this._data.UniqueID + "," + this.get_columns()[c].get_uniqueName();
if (!Array.contains(this._owner._showedColumns, b)) {
Array.add(this._owner._showedColumns, b);
}
if (Array.contains(this._owner._hidedColumns, b)) {
Array.remove(this._owner._hidedColumns, b);
}
this._owner.updateClientState();
$find(this._owner.get_id()).repaint();
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[c], null);
this._owner.raise_columnShown(a);
}, hideColumn: function (d) {
if (!this.get_columns()[d].Display) {
return;
}
if (this._getVisibleColumnsCount() == 1) {
var c = this.get_columns()[d]._data.ColumnType;
if (!this._isHelperColumnType(c)) {
return;
}
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[d], null);
this._owner.raise_columnHiding(a);
if (a.get_cancel()) {
return false;
}
this._hideShowColumn(d, false);
var b = this._data.UniqueID + "," + this.get_columns()[d].get_uniqueName();
if (!Array.contains(this._owner._hidedColumns, b)) {
Array.add(this._owner._hidedColumns, b);
}
if (Array.contains(this._owner._showedColumns, b)) {
Array.remove(this._owner._showedColumns, b);
}
this._owner.updateClientState();
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[d], null);
this._owner.raise_columnHidden(a);
}, _getVisibleColumnsCount: function () {
var c = 0;
var b = this.get_columns();
var a = null;
var d = null;
for (var e = 0;
len = b.length, e < len;
e++) {
a = b[e];
d = a._data.ColumnType;
if (this._isHelperColumnType(d) || a.get_element().style.display == "none") {
continue;
}
c++;
}
return c;
}, _isHelperColumnType: function (a) {
if (a == "GridExpandColumn" || a == "GridGroupSplitterColumn" || a == "GridRowIndicatorColumn" || a == "GridDragDropColumn") {
return true;
}
return false;
}, _hideShowColumn: function (h, d, e) {
var d = this.get_columns()[h].Display = d;
if (this.get_columns()[h]._data) {
this.get_columns()[h]._data.Display = d;
}
var j = false;
if (this._owner.ClientSettings.Resizing && this._owner.ClientSettings.Resizing.EnableRealTimeResize) {
j = this._owner.ClientSettings.Resizing.EnableRealTimeResize;
}
if (this._hasMultiHeaders) {
var o = this.get_element().tHead;
var m = this._owner.ClientSettings.Scrolling;
if (m && m.AllowScroll && m.UseStaticHeaders) {
o = this.get_owner().GridHeaderDiv.getElementsByTagName("table")[0].tHead;
}
var f = [];
if (o && o.rows) {
for (var g = 0;
g < o.rows.length;
g++) {
var l = o.rows[g];
if (l.className && l.className.indexOf("rgMultiHeaderRow") > -1) {
f.push(l);
}
}
}
if (!this._calculatedParentTableCells) {
this._calculatedParentTableCells = true;
this._setParentTableCells(f);
}
}
if (this != this._owner.get_masterTableViewHeader() && this != this._owner.get_masterTableViewFooter() && this != this._owner.get_masterTableView()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this, h, d);
} else {
this._removeRestoreCol(this, h, d);
}
if (!e) {
Telerik.Web.UI.Grid.hideShowCells(this.get_element(), h, d, this.ColGroup.Cols);
}
this._setHeaderFooterSpan();
return;
}
if (this._owner.get_masterTableViewHeader()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableViewHeader(), h, d);
}
if ($telerik.isIE7 || $telerik.isIE6) {
this._removeRestoreCol(this._owner.get_masterTableViewHeader(), h, d);
var b = this._owner.get_masterTableViewHeader().get_element().getElementsByTagName("colgroup")[0];
var c = b.getElementsByTagName("col");
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), h, d, c);
} else {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), h, d, this._owner.get_masterTableView().ColGroup.Cols);
}
}
if (this._owner.get_masterTableView()) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableView(), h, d);
} else {
this._removeRestoreCol(this._owner.get_masterTableView(), h, d);
}
if (!e) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), h, d, this._owner.get_masterTableView().ColGroup.Cols);
}
}
if (this._owner.get_masterTableViewFooter() && !e) {
if (!$telerik.isIE7 && !$telerik.isIE6) {
this._hideShowCol(this._owner.get_masterTableViewFooter(), h, d);
}
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), h, d, this._owner.get_masterTableViewFooter().ColGroup.Cols);
}
if (!e) {
this._setHeaderFooterSpan();
if ($telerik.isIE7) {
var n = Math.max(this._getVisibleColumns().length, 1);
var k = $telerik.getElementByClassName(this._owner.get_masterTableView().get_element(), "rgNoRecords");
if (k && k.cells && k.cells.length > 0) {
var a = k.cells[0];
if (a.className.indexOf("rgExpandCol") == -1 && a.className.indexOf("rgGroupCol") == -1) {
k.cells[0].colSpan = n;
}
}
}
}
}, _setParentTableCells: function (g) {
var l = [];
for (var h = 0;
h < g.length;
h++) {
var m = g[h];
var a = 0;
var c = 0;
var e = null;
var f = 0;
var d = [];
if (l.length > 0) {
e = l[0];
c = e.colSpan;
}
for (var k = 0;
k < m.cells.length;
k++) {
var b = m.cells[k];
if (h == 0) {
b.parentCell = null;
a += b.colSpan;
} else {
b.parentCell = e;
if (b.colSpan < c) {
c -= b.colSpan;
} else {
if (b.colSpan == c) {
if (f < l.length - 1) {
e = l[++f];
c = e.colSpan;
}
}
}
}
if (!b.id || b.id.indexOf("MultiHeader") == -1) {
d.push(b);
}
}
l = d;
}
}, _removeRestoreCol: function (p, l, g) {
var h = p._hiddenCols;
var d = p.get_columns();
var c = p.get_columns()[l];
var e = c.get_uniqueName();
var o = p.get_element();
var a = o.getElementsByTagName("colgroup")[0];
var b = a.getElementsByTagName("col");
if (p && p.ColGroup && p.ColGroup.Cols && p.ColGroup.Cols[l]) {
if (!g) {
if (h[e] && h[e].columnIndex == l && h[e].position == l) {
return;
}
if (!h[e]) {
h[e] = {};
}
h[e].columnIndex = l;
h[e].position = l;
for (var m = 0;
m < d.length;
m++) {
var q = d[m].get_uniqueName();
var f = h[d[m].get_uniqueName()];
if (f != undefined) {
if (f.columnIndex < h[e].columnIndex) {
h[e].position--;
} else {
if (f.columnIndex > h[e].columnIndex) {
f.position--;
}
}
}
}
for (var j = 0;
j < b.length;
j++) {
if (j == h[e].position) {
h[e].col = b[h[e].position];
a.removeChild(b[h[e].position]);
break;
}
}
} else {
if (!h[e]) {
return;
}
var n = h[e].position;
for (var m = 0;
m < d.length;
m++) {
var q = d[m].get_uniqueName();
var f = h[d[m].get_uniqueName()];
if (f != undefined) {
if (f.columnIndex > h[e].columnIndex) {
f.position++;
}
}
}
h[e].col.style.display = "";
if (n >= b.length) {
a.appendChild(h[e].col);
} else {
a.insertBefore(h[e].col, b[h[e].position]);
}
h[e] = null;
}
}
}, _setHeaderFooterSpan: function () {
var a = function (i) {
if (!i) {
return 0;
}
var k = 0;
for (var l = 0, m = i.length;
l < m;
l++) {
k += i[l].colSpan;
}
return k;
};
var g = this.get_element().tFoot;
var h = this.get_element().tHead;
var e = Math.max(this._getVisibleColumns().length, 1);
if (g && g.rows) {
for (var c = 0, d = g.rows.length;
c < d;
c++) {
if (g.rows[c].cells && g.rows[c].cells[0]) {
var b = a(g.rows[c].cells);
if (e > b) {
g.rows[c].cells[0].colSpan = e;
}
}
}
}
if (h && h.rows) {
for (var c = 0, d = h.rows.length;
c < d;
c++) {
if (h.rows[c] && (h.rows[c] == this.get_element().HeaderRow || (h.rows[c].cells.length > 0 && h.rows[c].cells[0].tagName.toLowerCase() == "th"))) {
var f = (this.get_element().tBodies && this.get_element().tBodies[0]) ? this.get_element().tBodies[0] : null;
if (f && f.rows && f.style.display == "none" && f.rows[0].cells.length == 1 && f.rows[0].cells[0].colSpan) {
f.rows[0].cells[0].colSpan = e;
}
break;
}
if (h.rows[c] && h.rows[c].cells && h.rows[c].cells.length > 0 && h.rows[c].cells[0]) {
var b = a(h.rows[c].cells);
if (e > b) {
h.rows[c].cells[0].colSpan = e;
}
}
}
}
}, _getVisibleColumns: function () {
var e = [];
if (this.get_columns()) {
var b = this.get_columns();
for (var c = 0, d = b.length;
c < d;
c++) {
var a = b[c];
if (a.get_element().style.visibility != "hidden" && a.get_element().style.display != "none" && (a.Display == null || a.Display)) {
Array.add(e, a);
}
}
}
return e;
}, _hideShowCol: function (e, d, c) {
if (e && e.ColGroup && e.ColGroup.Cols && e.ColGroup.Cols[d]) {
var a = e.ColGroup.Cols[d];
var b = (a.style.display == "") ? true : false;
if (b != c) {
if (c) {
a.style.display = "";
if (this._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", "false");
}
} else {
a.style.display = "none";
if (this._owner.get_enableAriaSupport()) {
a.setAttribute("aria-hidden", "true");
}
}
this._tryAddRemoveColWidth(e, c);
}
}
}, _tryAddRemoveColWidth: function (e, c) {
if (!$telerik.isIE8 && !$telerik.isChrome && !$telerik.isSafari) {
return;
}
var f = e._getVisibleColumns();
if (f.length !== 1) {
return;
}
var a = e._getVisibleColumns()[0], d = a.get_element().cellIndex, b;
if (e && e.ColGroup && e.ColGroup.Cols && e.ColGroup.Cols[d]) {
b = e.ColGroup.Cols[d];
if (c) {
if (a._bufferWidth) {
b.style.width = a._bufferWidth;
a._bufferWidth = null;
}
} else {
a._bufferWidth = b.style.width;
b.style.width = "";
}
}
}, _hideShowNotFrozenColumn: function (b, a) {
var c = 10;
if ($telerik.isOpera) {
c = navigator.userAgent.substring(navigator.userAgent.indexOf("Version/") + "Version".length + 1) * 1;
}
if (this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader().get_columns()[b].FrozenDisplay = a;
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableViewHeader(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), b, a, this._owner.get_masterTableViewHeader().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableViewHeader().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableViewHeader().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableViewHeader(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewHeader().get_element(), b, a, this._owner.get_masterTableViewHeader().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
if (this._owner.get_masterTableView()) {
this._owner.get_masterTableView().get_columns()[b].FrozenDisplay = a;
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableView(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), b, a, this._owner.get_masterTableView().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableView().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableView().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableView(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableView().get_element(), b, a, this._owner.get_masterTableView().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
if (this._owner.get_masterTableViewFooter()) {
if (!window.netscape && navigator.userAgent.toLowerCase().indexOf("safari") == -1) {
this._hideShowCol(this._owner.get_masterTableViewFooter(), b, a);
if ($telerik.isIE8 || $telerik.isIE9Mode || ($telerik.isOpera && c > 10.1)) {
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), b, a, this._owner.get_masterTableViewFooter().ColGroup.Cols);
}
this._setHeaderFooterSpan();
if (!$telerik.isIE6) {
var d = this._owner.get_masterTableViewFooter().get_element().getElementsByTagName("select");
if (d.length > 0) {
var e = this._owner.get_masterTableViewFooter().get_element();
setTimeout(function () {
for (var g = 0, h = e.rows.length;
g < h;
g++) {
var f = e.rows[g].cells[b];
Telerik.Web.UI.Grid._hideShowSelect(f, a);
}
}, 0);
}
}
} else {
this._hideShowCol(this._owner.get_masterTableViewFooter(), b, a);
Telerik.Web.UI.Grid.hideShowCells(this._owner.get_masterTableViewFooter().get_element(), b, a, this._owner.get_masterTableViewFooter().ColGroup.Cols);
this._setHeaderFooterSpan();
}
}
}, hideItem: function (d) {
if (!this._canShowHideItem(d)) {
return false;
}
var e = null;
if (this.get_element() && this.get_element().tBodies.length > 1) {
var b = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (b && b.rows[d]) {
e = b.rows[d];
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[d]) {
e = this.get_element().tBodies[0].rows[d];
}
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(e, null);
this._owner.raise_rowHiding(a);
if (a.get_cancel()) {
return false;
}
if (e) {
e.style.display = "none";
}
if (e && e.id != "" && e.id.split("__").length == 2) {
var f = e.id.split("__")[1];
var c = this._hidedItemsData;
c.add(String.format("{0},{1}", this.get_id(), f));
this._owner._hidedItems = c.toString();
this._owner.updateClientState();
}
$find(this._owner.get_id())._getPositionedDataItems(true);
var a = new Telerik.Web.UI.GridDataItemEventArgs(e, null);
this._owner.raise_rowHidden(a);
}, showItem: function (c) {
if (!this._canShowHideItem(c)) {
return false;
}
var d = null;
if (this.get_element() && this.get_element().tBodies.length > 1) {
var b = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (b && b.rows[c]) {
d = b.rows[c];
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[c]) {
d = this.get_element().tBodies[0].rows[c];
}
}
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, null);
this._owner.raise_rowShowing(a);
if (a.get_cancel()) {
return false;
}
if (d) {
if (window.netscape) {
d.style.display = "table-row";
} else {
d.style.display = "";
}
}
if (d && d.id != "" && d.id.split("__").length == 2) {
var e = d.id.split("__")[1];
var f = this._showedItemsData;
f.add(String.format("{0},{1}", this.get_id(), e));
this._owner._showedItems = f.toString();
this._owner.updateClientState();
}
$find(this._owner.get_id())._getPositionedDataItems(true);
var a = new Telerik.Web.UI.GridDataItemEventArgs(d, null);
this._owner.raise_rowShown(a);
}, _canShowHideItem: function (b) {
if (isNaN(parseInt(b))) {
var c = 'Row index must be of type "Number"!';
alert(c);
return false;
}
if (b < 0) {
var c = "Row index must be non-negative!";
alert(c);
return false;
}
if (this.get_element() && this.get_element().tBodies.length > 1) {
var a = $telerik.getFirstChildByTagName(this.get_element(), "tbody", 0);
if (a && a.rows[b] && (b > a.rows[b].length - 1)) {
var c = "Row index must be less than rows count!";
alert(c);
return false;
}
} else {
if (this.get_element() && this.get_element().tBodies[0] && this.get_element().tBodies[0].rows[b] && (b > (this.get_element().tBodies[0].rows[b].length - 1))) {
var c = "Row index must be less than rows count!";
alert(c);
return false;
}
}
return true;
}, _getRowsFromBody: function (b) {
var d = b.length;
var c = new Array();
for (var a = 0;
a < d;
a++) {
if (b[a].parentNode.tagName.toUpperCase() == "TBODY") {
return b[a].parentNode.rows;
}
}
}, _getFirstDataRow: function () {
if (this._firstDataRow != null) {
return this._firstDataRow;
}
if (this._dataItems.length > 0) {
return this._dataItems[0].get_element();
}
var d = [];
if ($telerik.isOpera) {
d = this._getRowsFromBody(this.get_element().rows);
} else {
var e = this.get_element().tBodies;
if (e.length > 0) {
d = e[0].rows;
}
}
for (var a = 0, b = d.length;
a < b;
a++) {
var c = d[a];
if (c.id != "" && c.id.split("__").length == 2) {
this._firstRow = c;
break;
}
}
return this._firstRow;
}, _getNextDataRow: function (d) {
var c = null;
var e;
if ($telerik.isOpera) {
e = this._getRowsFromBody(this.get_element().rows);
} else {
e = this.get_element().tBodies[0].rows;
}
for (var a = d.sectionRowIndex + 1, b = e.length;
a < b;
a++) {
var d = e[a];
if (d.id != "" && d.id.split("__").length == 2) {
c = d;
break;
}
}
return c;
}, _getNestedTableWhenRowIsInEditMode: function (d) {
var b = null;
var c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(d, "tr");
if (this._data.hasDetailItemTemplate) {
c = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(c, "tr");
}
if (c) {
var a = c.nextSibling.getElementsByTagName("table");
if (a.length > 0 && a[0].id.indexOf("Detail") != -1) {
b = a[0];
}
}
return b;
}, _getNextNestedDataRow: function (g) {
var f = null;
var d = null;
var b = g.id;
var a = $find(b);
if (this._owner.ClientSettings.AllowKeyboardNavigation && a && a.get_isInEditMode()) {
d = this._getNestedTableWhenRowIsInEditMode(g);
} else {
if (this._data.hasDetailItemTemplate) {
var e = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(g, "tr");
d = Telerik.Web.UI.Grid.GetNestedTable(e);
} else {
d = Telerik.Web.UI.Grid.GetNestedTable(g);
}
}
if (d) {
var h;
if ($telerik.isOpera) {
h = this._getRowsFromBody(this.get_element().rows);
} else {
h = this.get_element().tBodies[0].rows;
}
for (var c = 0;
c < h.length;
c++) {
var g = h[c];
if (g.id != "" && g.id.split("__").length == 2) {
f = g;
break;
}
}
}
return f;
}, _getPreviousDataRow: function (c) {
var b = null;
var d;
if ($telerik.isOpera) {
d = this._getRowsFromBody(this.get_element().rows);
} else {
d = this.get_element().tBodies[0].rows;
}
for (var a = c.sectionRowIndex - 1;
a >= 0;
a--) {
var c = d[a];
if (c.id != "" && c.id.split("__").length == 2) {
b = c;
break;
}
}
return b;
}, _getPreviousNestedDataRow: function (d) {
var c = null;
var b = Telerik.Web.UI.Grid.GetNestedTable(d);
if (b) {
var e;
if ($telerik.isOpera) {
e = this._getRowsFromBody(this.get_element().rows);
} else {
e = this.get_element().tBodies[0].rows;
}
for (var a = d.sectionRowIndex - 1;
a >= 0;
a--) {
var d = e[a];
if (d.id != "" && d.id.split("__").length == 2) {
c = d;
break;
}
}
}
return c;
}, get_parentView: function () {
var a = null;
if (this.get_id() != this._owner.get_masterTableView().get_id()) {
a = $find(this.get_parentRow().id.split("__")[0]);
}
return a;
}, get_parentRow: function () {
var a = null;
if (this.get_id() != this._owner.get_masterTableView().get_id()) {
a = this.get_element().parentNode.parentNode.previousSibling;
}
return a;
}, get_selectedItems: function () {
var d = [];
for (var a = 0;
a < this._owner._selectedItemsInternal.length;
a++) {
var c = this._owner._selectedItemsInternal[a].id.split("__")[0];
if (c == this.get_id()) {
var b = $find(this._owner._selectedItemsInternal[a].id);
if (b == null) {
if ($get(this._owner._selectedItemsInternal[a].id)) {
b = $create(Telerik.Web.UI.GridDataItem, {
_owner: this,
_data: this._data,
_selected: true
}, null, null, $get(this._owner._selectedItemsInternal[a].id));
Array.add(d, b);
}
} else {
if (b && b._owner.get_element().id == this.get_element().id) {
Array.add(d, b);
}
}
}
}
return d;
}, selectAllItems: function () {
if (!this._owner.AllowMultiRowSelection) {
return;
}
var f = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0];
var e = f.rows;
if (!e) {
return;
}
for (var a = 0, c = e.length;
a < c;
a++) {
var d = e[a];
if (!d.id) {
continue;
}
var b = $find(d.id);
if (b) {
b.set_selected(true);
} else {
this.selectItem(d);
}
}
}, clearSelectedItems: function () {
var h = this, d = h._owner, a = h.get_element().id, g = d._selectedItemsInternal, e = d._selectedIndexes, b, c, f;
if (g.length > 0) {
b = g.length - 1;
while (b >= 0) {
f = g[b];
c = $find(f.id);
if (c) {
if (c._owner.get_element().id == a) {
c.set_selected(false);
}
} else {
c = $get(f.id);
if (c && c.parentNode && c.parentNode.parentNode.id == a) {
h.deselectItem($get(f.id));
} else {
Array.remove(g, f);
Array.remove(e, e[b]);
h._owner.updateClientState();
}
}
b = Math.min(g.length, b);
b--;
}
}
}, clearSelectedCells: function () {
if (this._owner._cellSelection != null) {
this._owner._cellSelection._deselectTableViewCells(this);
}
}, selectItem: function (a) {
a = this._getRowByIndexOrItemIndexHierarchical(a);
if (this._owner._selection && a && a.id) {
if (!this._owner.AllowMultiRowSelection) {
this.clearSelectedItems();
}
this._owner._keyboardNavigationProperties.lastClickSelectedItem = a;
this._owner._selection._selectRowInternal(a, {ctrlKey: false}, true, false, true);
}
}, deselectItem: function (a) {
var b = this;
a = b._getRowByIndexOrItemIndexHierarchical(a);
if (b._owner._selection && a && a.id && Array.contains(b._owner._selectedIndexes, a.id.split("__")[1])) {
b._owner._selection._selectRowInternal(a, {ctrlKey: false}, true, true, true);
}
}, _getRowByIndexOrItemIndexHierarchical: function (k) {
if (typeof(k) == "number") {
var j = null;
if (this.get_element().tBodies.length > 0) {
if (this.get_element().tBodies[0].rows[k]) {
j = this.get_element().tBodies[0].rows[k];
}
if (j && (j.id == "" || !j.id.endsWith(k.toString()))) {
while (j && !j.id.endsWith(k.toString())) {
j = this._getNextDataRow(j);
}
}
}
k = j;
}
if (typeof(k) == "string") {
var a = k;
k = $get(this.get_element().id + "__" + k);
if (!k) {
var f = a.split(":");
var b = f.length;
if (b > 1) {
var g = this;
var j = g.get_dataItems()[f[0]];
if (!j) {
if (g.get_dataItems().length == 1) {
j = g.get_dataItems()[0];
} else {
j = g.get_dataItems()[f[0].split("__")[1]];
}
}
for (var c = 1;
c < b;
c++) {
var h = f[c].split("_")[1];
g = j.get_nestedViews()[0];
if (!g) {
g = this;
}
if (g.get_dataItems().length == 1) {
j = g.get_dataItems()[0];
} else {
j = g.get_dataItems()[h];
}
}
k = j.get_element();
} else {
var d = parseInt(f[0].split("__")[1], 10);
var e = this.get_dataItems();
if (!isNaN(d) && d < e.length) {
k = e[d].get_element();
} else {
k = null;
}
}
}
}
return k;
}, reorderColumns: function (h, i) {
if (!this._owner.ClientSettings.AllowColumnsReorder) {
return;
}
if (this._owner.ClientSettings.ColumnsReorderMethod != 1) {
return;
}
var d = this.getColumnByUniqueName(h);
var e = this.getColumnByUniqueName(i);
if (!d || !e) {
return;
}
var m = d.get_element().parentNode;
var f = this._getCellIndexByColumnUniqueNameFromTableRowElement(m, h);
var g = this._getCellIndexByColumnUniqueNameFromTableRowElement(m, i);
if (this._hasMultiHeaders && m.className.indexOf("rgMultiHeaderRow") > -1) {
header1 = this._getMultiHeaderByColumnUniqueName(h);
if (header1) {
f = header1.index;
}
header2 = this._getMultiHeaderByColumnUniqueName(i);
if (header2) {
g = header2.index;
}
}
var k = this._owner.ClientSettings.ReorderColumnsOnClient;
this._owner.ClientSettings.ReorderColumnsOnClient = true;
var j = this._owner.ClientSettings.ColumnsReorderMethod;
this._owner.ClientSettings.ColumnsReorderMethod = 0;
if (g > f) {
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(d, null);
this._owner.raise_columnMovingToLeft(a);
if (a.get_cancel()) {
return false;
}
while (f < g) {
var b = this.getColumnUniqueNameByCellIndex(m, f + 1);
var c = this.getColumnUniqueNameByCellIndex(m, f);
this.swapColumns(b, c);
f++;
}
var a = new Telerik.Web.UI.GridColumnEventArgs(d, null);
this._owner.raise_columnMovedToLeft(a);
} else {
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(d, null);
this._owner.raise_columnMovingToRight(a);
if (a.get_cancel()) {
return false;
}
while (g < f) {
var b = this.getColumnUniqueNameByCellIndex(m, f - 1);
var c = this.getColumnUniqueNameByCellIndex(m, f);
this.swapColumns(b, c);
f--;
}
var a = new Telerik.Web.UI.GridColumnEventArgs(d, null);
this._owner.raise_columnMovedToRight(a);
}
this._owner.ClientSettings.ColumnsReorderMethod = j;
this._owner.ClientSettings.ReorderColumnsOnClient = k;
if (!this._owner.ClientSettings.ReorderColumnsOnClient) {
var l = this._owner.ClientSettings.PostBackFunction;
l = l.replace("{0}", this._owner.UniqueID);
eval(l);
return;
}
}, swapColumns: function (g, h) {
var e = this.getColumnByUniqueName(g);
var f = this.getColumnByUniqueName(h);
if (!e || !f) {
return;
}
if (!this._owner.ClientSettings.AllowColumnsReorder) {
return;
}
if (!e.get_reorderable() || !f.get_reorderable()) {
return;
}
if (!this._owner.ClientSettings.ReorderColumnsOnClient) {
var o = this._owner.ClientSettings.PostBackFunction;
o = o.replace("{0}", this._owner.UniqueID);
o = o.replace("{1}", "ReorderColumns," + this._data.UniqueID + "," + e.get_uniqueName() + "," + f.get_uniqueName());
eval(o);
return;
}
if (this._owner.ClientSettings.ColumnsReorderMethod != 0) {
return;
}
var l = this._getCellIndexByColumnUniqueNameFromTableRowElement(e.get_element().parentNode, g);
var m = this._getCellIndexByColumnUniqueNameFromTableRowElement(f.get_element().parentNode, h);
var b = new Sys.CancelEventArgs();
b.get_gridSourceColumn = function () {
return e;
};
b.get_gridTargetColumn = function () {
return f;
};
this._owner.raise_columnSwapping(b);
if (b.get_cancel()) {
return false;
}
if (this.get_id() && this.get_id().indexOf("Detail") != -1) {
this._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader()._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableView()) {
this._owner.get_masterTableView()._reorderColumnsInternal(g, h);
}
if (this._owner.get_masterTableViewFooter()) {
var n = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
if ((this.get_id() && this.get_id().indexOf("Detail") == -1) && n) {
this._owner.get_masterTableViewFooter()._reorderFooterInStaticHeaders(g, h);
} else {
this._owner.get_masterTableViewFooter()._reorderColumnsInternal(g, h);
}
}
var d = f.get_element().UniqueName;
var c = e.get_element().UniqueName;
e.get_element().UniqueName = d;
f.get_element().UniqueName = c;
var j = f._data;
f._data = e._data;
e._data = j;
this.get_columns()[m] = f;
this.get_columns()[l] = e;
if (this._owner.ClientSettings.AllowKeyboardNavigation && this._owner._cellSelection != null) {
var p = this.get_element().rows;
for (var k = 0;
k < p.length;
k++) {
if (p[k].id == "" || p[k].id == undefined) {
continue;
} else {
this._owner._cellSelection._setActiveCellElement(p[k].cells[m]);
break;
}
}
}
this._copyColAttributes(this._owner.get_masterTableView().ColGroup.Cols[l], this._owner.get_masterTableView().ColGroup.Cols[m]);
if (this._owner.get_masterTableViewHeader() && this._owner.get_masterTableViewHeader().ColGroup) {
this._copyColAttributes(this._owner.get_masterTableViewHeader().ColGroup.Cols[l], this._owner.get_masterTableViewHeader().ColGroup.Cols[m]);
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
this._copyColAttributes(this._owner.get_masterTableViewFooter().ColGroup.Cols[l], this._owner.get_masterTableViewFooter().ColGroup.Cols[m]);
}
var b = new Sys.EventArgs();
b.get_gridSourceColumn = function () {
return e;
};
b.get_gridTargetColumn = function () {
return f;
};
this._createColumnsByUniqueNameHash();
this._owner.raise_columnSwapped(b);
var a = this._data.UniqueID + "," + g + "," + h;
Array.add(this._owner._reorderedColumns, a);
this._owner.updateClientState();
if (this._owner.ClientSettings.Resizing.AllowColumnResize && this._owner.ClientSettings.Resizing.AllowResizeToFit) {
Telerik.Web.UI.Grid.ClearBestFitCache(this.get_columns());
}
}, _copyColAttributes: function (e, f) {
if (e && f) {
var z = document.createElement("col");
var h = false;
var j = false;
if (e.style.width == "" && f.style.width != "") {
j = true;
}
if (f.style.width == "" && e.style.width != "") {
h = true;
}
var c = e.style.display;
var d = f.style.display;
$telerik.mergeElementAttributes(e, z, false);
$telerik.mergeElementAttributes(f, e, false);
$telerik.mergeElementAttributes(z, f, false);
e.style.display = d;
f.style.display = c;
if (h) {
e.style.width = "";
}
if (j) {
f.style.width = "";
}
var p = ($telerik.isIE6 || $telerik.isIE7) && this._hasMultiHeaders;
var s = this._owner.ClientSettings.Scrolling;
var q = s && s.AllowScroll && s.UseStaticHeaders;
var r = e.parentNode;
if (!r) {
return;
}
var y = r.parentNode;
if (!y) {
return;
}
var a = $telerik.$, A, B;
var t = p && q && y.id.indexOf("_Header") != -1;
if (t) {
var l = y.tHead ? a(y.tHead).find("tr.rgMultiHeaderRow")[0] : null;
if (l) {
var b = l.cells;
var n = a(e).index();
var o = a(f).index();
var x = 0, g = 0;
var u = false;
for (var m = 0;
m < b.length;
m++) {
var k = b[m];
u = (x == n || x == o);
if (u) {
g = Telerik.Web.UI.Grid.correctWidthForIE(k);
var v = x == n ? -1 : 1, w = x == o ? -1 : 1;
if (e.style.width) {
e.style.width = (parseInt(e.style.width) + v * g) + "px";
}
if (f.style.width) {
f.style.width = (parseInt(f.style.width) + w * g) + "px";
}
break;
}
x += k.colSpan;
}
}
}
}
}, _reorderFooterInStaticHeaders: function (c, d) {
for (var e = 0;
e < this.get_element().rows.length;
e++) {
var f = this.get_element().rows[e];
var a = this._getCellByFooterColumnUniqueNameFromTableRowElement(f, c);
var b = this._getCellByFooterColumnUniqueNameFromTableRowElement(f, d);
if (!a || !b) {
continue;
}
this._reorderControls(a, b);
}
}, _getCellByFooterColumnUniqueNameFromTableRowElement: function (c, d) {
for (var a = 0, b = this._owner.get_masterTableView().get_columns().length;
a < b;
a++) {
if (this._owner.get_masterTableView().get_columns()[a].get_element().UniqueName.toUpperCase() == d.toUpperCase()) {
return c.cells[a];
}
}
return null;
}, _reorderColumnsInternal: function (c, d) {
var g = (this._owner.ClientSettings.Scrolling && this._owner.ClientSettings.Scrolling.AllowScroll && this._owner.ClientSettings.Scrolling.UseStaticHeaders);
var h = false;
for (var e = 0;
e < this.get_element().rows.length;
e++) {
var j = this.get_element().rows[e];
if (!j.id && j.parentNode.tagName.toLowerCase() == "tbody") {
continue;
}
var a = this._getCellByColumnUniqueNameFromTableRowElement(j, c);
var b = this._getCellByColumnUniqueNameFromTableRowElement(j, d);
var f = this._hasMultiHeaders && j.className.indexOf("rgMultiHeaderRow") > -1;
if (f) {
if (h) {
continue;
}
h = true;
header1 = this._getMultiHeaderByColumnUniqueName(c);
if (header1) {
a = header1.cell;
}
header2 = this._getMultiHeaderByColumnUniqueName(d);
if (header2) {
b = header2.cell;
}
}
if (!a || !b) {
continue;
}
this._reorderControls(a, b);
}
}, _reorderControls: function (e, h) {
var a = document.createElement("div");
var b = document.createElement("div");
document.body.appendChild(a);
document.body.appendChild(b);
this._moveNodes(e, b);
this._moveNodes(h, a);
var f = e.style.cssText;
var g = h.style.cssText;
var c = e.className;
var d = h.className;
e.innerHTML = h.innerHTML = "";
this._moveNodes(b, h);
this._moveNodes(a, e);
this._recreateControls(e);
this._recreateControls(h);
e.style.cssText = g;
h.style.cssText = f;
e.className = d;
h.className = c;
a.parentNode.removeChild(a);
b.parentNode.removeChild(b);
}, _moveNodes: function (b, c) {
var a = b.childNodes;
while (a.length > 0) {
c.appendChild(a[0]);
}
}, _recreateControls: function (f) {
var e = f.getElementsByTagName("*");
for (var b = 0, c = e.length;
b < c;
b++) {
var d = e[b];
if (typeof(d.id) != "undefined" && d.id != "") {
var a = $find(d.id);
if (!a) {
continue;
}
a._element = $get(d.id);
}
}
}, getColumnByUniqueName: function (b) {
for (var a = 0;
a < this.get_columns().length;
a++) {
if (this.get_columns()[a].get_element().UniqueName == b) {
return this.get_columns()[a];
}
}
return null;
}, getCellByColumnUniqueName: function (a, b) {
return this._getCellByColumnUniqueNameFromTableRowElement(a.get_element(), b);
}, _getCellByColumnUniqueNameFromTableRowElement: function (b, d) {
var c = this, a = c._cellsByUniqueName = c._cellsByUniqueName || c._createColumnsByUniqueNameHash();
return b.cells[a[d]] || null;
}, _createColumnsByUniqueNameHash: function () {
var j = this, g = {}, a = j._columnsInternal, f = j._owner, e = j.get_id(), h = f.get_masterTableView(), b = f.get_masterTableViewFooter(), c = f.get_masterTableViewHeader();
for (var d = 0;
d < a.length;
d++) {
g[a[d].get_uniqueName()] = d;
}
if (e == h.get_id() || (b && e == b.get_id()) || (c && e == c.get_id())) {
f.get_masterTableView()._cellsByUniqueName = g;
if (c) {
c._cellsByUniqueName = g;
}
if (b) {
b._cellsByUniqueName = g;
}
} else {
j._cellsByUniqueName = g;
}
return g;
}, _getCellIndexByColumnUniqueNameFromTableRowElement: function (b, c) {
if (!c || c == "") {
return null;
}
for (var a = 0;
a < this.get_columns().length;
a++) {
if (this.get_columns()[a].get_element().UniqueName.toUpperCase() == c.toUpperCase()) {
return a;
}
}
return null;
}, getColumnUniqueNameByCellIndex: function (d, c) {
var a = this._toArray(d.cells).sort(function (e, f) {
return e.cellIndex - f.cellIndex;
});
for (var b = 0;
b < a.length;
b++) {
if (a[b].UniqueName && b == c) {
return a[b].UniqueName;
}
}
return null;
}, _toArray: function (a) {
var c = Array(a.length);
for (var b = 0;
b < c.length;
b++) {
c[b] = a[b];
}
return c;
}, _getMultiHeaderByColumnUniqueName: function (f) {
if (this._hasMultiHeaders) {
var c = this.getColumnByUniqueName(f);
if (c) {
var e = c.get_element().parentNode;
var b = e.cells;
for (var d = 0;
d < b.length;
d++) {
var a = b[d];
if (a.UniqueName == f) {
return {index: d, cell: a};
}
}
}
}
return null;
}, _sliderClientValueChanged: function (c, g, e) {
var b = $get(c);
var f = $find(g);
var a = "-2147483648";
if (b && f) {
var d = f.get_value();
if (!e) {
this._applyPagerLabelText(b, d, this.get_pageCount());
}
}
if (e) {
window.location.href = e.replace(a, d + 1);
}
}, _applyPagerLabelText: function (d, f, e) {
var h = this._owner.ClientSettings.ClientMessages.PagerTooltipFormatString;
var c = /\{0[^\}]*\}/g;
var b = /\{1[^\}]*\}/g;
var g = ((f == 0) ? 1 : f + 1);
var a = e;
h = h.replace(c, g).replace(b, a);
d.innerHTML = h;
}, resizeItem: function (f, e, g) {
if (!this._owner.ClientSettings.Resizing.AllowRowResize) {
return;
}
var c = this.get_element().rows[f];
if (c && c.id != "" && c.id.split("__").length == 2) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(c, null);
this._owner.raise_rowResizing(a);
if (a.get_cancel()) {
return false;
}
}
var b = this.get_element().style.tableLayout;
this.get_element().style.tableLayout = "";
var i = this.get_element().parentNode.parentNode.parentNode.parentNode;
var d = $find(i.id);
var j;
if (d != null) {
j = d.get_element().style.tableLayout;
d.get_element().style.tableLayout = "";
}
if (!g) {
if (this.get_element()) {
if (this.get_element().rows[f]) {
if (this.get_element().rows[f].cells[0]) {
this.get_element().rows[f].cells[0].style.height = e + "px";
this.get_element().rows[f].style.height = e + "px";
}
}
}
} else {
if (this.get_element()) {
if (this.get_element().tBodies[0]) {
if (this.get_element().tBodies[0].rows[f]) {
if (this.get_element().tBodies[0].rows[f].cells[0]) {
this.get_element().tBodies[0].rows[f].cells[0].style.height = e + "px";
this.get_element().tBodies[0].rows[f].style.height = e + "px";
}
}
}
}
}
this.get_element().style.tableLayout = b;
if (d != null) {
d.get_element().style.tableLayout = j;
}
if (c && c.id != "" && c.id.split("__").length == 2) {
var h = c.id.split("__")[1];
var k = this._resizedItemsData;
k.add(String.format("{0},{1}", this.get_id(), h), e);
this._owner._resizedItems = k.toString();
this._owner.raise_rowResized(new Telerik.Web.UI.GridDataItemEventArgs(c, null));
}
this._owner.updateClientState();
}, resizeColumn: function (k, q) {
var r = false;
var f = this._hasMultiHeaders;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode) {
var g = this.get_columns()[k].get_element();
var o = parseInt($telerik.getCurrentStyle(g, "borderLeftWidth", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingLeft", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingRight", 0), 10) + parseInt($telerik.getCurrentStyle(g, "borderRightWidth", 0), 10);
if (q > o) {
q -= o;
r = true;
}
}
if (!this._validateResizeColumnParams(k, q)) {
return;
}
if (typeof(k) == "string") {
k = parseInt(k);
}
var a = new Telerik.Web.UI.GridColumnCancelEventArgs(this.get_columns()[k], null);
this._owner.raise_columnResizing(a);
if (a.get_cancel()) {
return false;
}
var n = this.get_element().offsetWidth;
var m = this._owner.get_element().offsetWidth - parseInt($telerik.getCurrentStyle(this._owner.get_element(), "borderLeftWidth", 0)) - parseInt($telerik.getCurrentStyle(this._owner.get_element(), "borderRightWidth", 0));
if (this == this._owner.get_masterTableView() && this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableViewHeader().resizeColumn(k, q);
}
if (this.HeaderRow || this.MultiHeaderCells) {
var b = k;
var h = f ? this.MultiHeaderCells : this.HeaderRow.cells;
if ($telerik.isIE7 || $telerik.isIE6) {
var i = 0;
var p = 0;
for (var l = 0;
l < h.length;
l++) {
if (h[l].style.display == "none") {
i++;
} else {
p++;
if (p == k + 1) {
break;
}
}
}
b = parseInt(i + p) - 1;
}
var c = h[b].offsetWidth - q;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode && r) {
c -= o;
}
}
if (($telerik.isFirefox2 && this.get_element().style.tableLayout == "fixed")) {
if (this.HeaderRow || this.MultiHeaderCells) {
var h = f ? this.MultiHeaderCells : this.HeaderRow.cells;
if (h[k]) {
h[k].style.width = q + "px";
}
}
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
var d = this._owner.get_masterTableView().get_element().tBodies[0].rows[this._owner.ClientSettings.FirstDataRowClientRowIndex];
if (d) {
if (d.cells[k]) {
d.cells[k].style.width = q + "px";
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().get_element()) {
if (this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0] && this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0].cells[k]) {
if (q > 0) {
this._owner.get_masterTableViewFooter().get_element().tBodies[0].rows[0].cells[k].style.width = q + "px";
}
}
}
}
}
if (this.ColGroup) {
if (this.ColGroup.Cols[k]) {
if (q > 0) {
this.ColGroup.Cols[k].style.width = q + "px";
}
}
}
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
if (this._owner.get_masterTableView().ColGroup) {
if (this._owner.get_masterTableView().ColGroup.Cols[k]) {
if (q > 0) {
this._owner.get_masterTableView().ColGroup.Cols[k].style.width = q + "px";
}
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
if (this._owner.get_masterTableViewFooter().ColGroup.Cols[k]) {
if (q > 0) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[k].style.width = q + "px";
}
}
}
}
if (q.toString().indexOf("px") != -1) {
q = q.replace("px", "");
}
if (q.toString().indexOf("%") == -1) {
q = q + "px";
}
this._resizedColumnsData.add(String.format("{0},{1}", this._data.UniqueID, this.get_columns()[k].get_uniqueName()), q);
if (this._owner.get_masterTableViewHeader()) {
this._owner.ClientSettings.Resizing.ResizeGridOnColumnResize = true;
}
if (this._owner.ClientSettings.Resizing.ResizeGridOnColumnResize) {
if (c != null) {
this._resizeGridOnColumnResize(k, c, n);
}
} else {
this._noResizeGridOnColumnResize(n, k, m);
}
this._owner._resizedColumns = this._resizedColumnsData.toString();
this._owner.updateClientState();
if (this._owner.GroupPanelObject && this._owner.GroupPanelObject.Items.length > 0 && navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
if (this._owner.get_masterTableView() && this._owner.get_masterTableViewHeader()) {
this._owner.get_masterTableView().get_element().style.width = this._owner.get_masterTableViewHeader().get_element().offsetWidth + "px";
}
}
var a = new Telerik.Web.UI.GridColumnEventArgs(this.get_columns()[k], null);
this._owner.raise_columnResized(a);
if (window.netscape) {
this.get_element().style.cssText = this.get_element().style.cssText;
}
if ($get(this._owner.ClientID + "_Frozen") && c != null) {
var e = $get(this._owner.ClientID + "_FrozenScroll");
e.style.width = e.offsetWidth - c + "px";
}
}, _resizeGridOnColumnResize: function (m, f, o) {
var a;
var c;
var b;
if (this._owner.get_masterTableViewHeader() && (this.get_id() == this._owner.get_masterTableViewHeader().get_id())) {
this.get_element().style.width = (o - f) + "px";
this._owner.get_masterTableView().get_element().style.width = this.get_element().style.width;
for (var l = 0;
l < this.ColGroup.Cols.length;
l++) {
if (l != m && this.ColGroup.Cols[l].style.width == "") {
var e = l;
var h = this._hasMultiHeaders ? this.MultiHeaderCells : this.HeaderRow.cells;
if ($telerik.isIE7 || $telerik.isIE6) {
var k = 0;
var s = 0;
for (var n = 0;
n < h.length;
n++) {
if (h[n].style.display == "none") {
k++;
} else {
s++;
if (s == l + 1) {
break;
}
}
}
e = parseInt(k + s) - 1;
}
if (h[e].style.display != "none") {
var t = h[e].offsetWidth;
if (($telerik.isIE7 || $telerik.isIE6) && !$telerik.quirksMode) {
var g = h[e];
var p = parseInt($telerik.getCurrentStyle(g, "borderLeftWidth", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingLeft", 0), 10) + parseInt($telerik.getCurrentStyle(g, "paddingRight", 0), 10) + parseInt($telerik.getCurrentStyle(g, "borderRightWidth", 0), 10);
if (t > p) {
t -= p;
}
}
this.ColGroup.Cols[l].style.width = t + "px";
this._owner.get_masterTableView().ColGroup.Cols[l].style.width = this.ColGroup.Cols[l].style.width;
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().ColGroup) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[l].style.width = this.ColGroup.Cols[l].style.width;
}
}
}
}
if (this._owner.get_masterTableViewFooter() && this._owner.get_masterTableViewFooter().get_element()) {
this._owner.get_masterTableViewFooter().get_element().style.width = this.get_element().style.width;
}
var d = this.get_element().offsetWidth;
var r = this._owner._gridDataDiv.offsetWidth;
a = d + "px";
c = r + "px";
b = this._owner.get_element().offsetHeight + "px";
} else {
if (this.get_element().offsetWidth <= this._owner.get_element().offsetWidth) {
if ((this.get_element().offsetWidth - f) > 0) {
this.get_element().style.width = (this.get_element().offsetWidth - f) + "px";
} else {
this.get_element().style.width = this.get_element().offsetWidth + "px";
}
} else {
this.get_element().style.width = this.get_element().offsetWidth + "px";
}
this._owner.get_element().style.width = this.get_element().style.width;
var d = this.get_element().offsetWidth;
a = d + "px";
c = this._owner.get_element().offsetWidth + "px";
b = this._owner.get_element().offsetHeight + "px";
}
var q = this._resizedControlData;
q.add(this._data.UniqueID, String.format("{0},{1},{2}", a, c, b));
this._owner._resizedControl = q.toString();
this._owner.updateClientState();
}, _noResizeGridOnColumnResize: function (e, c, d) {
var a = this._hasMultiHeaders ? this.MultiHeaderCells : this.HeaderRow.cells;
for (var b = c + 1;
b < this.ColGroup.Cols.length;
b++) {
a[b].style.width = "";
this.ColGroup.Cols[b].style.width = "";
if (this._owner.get_masterTableViewHeader() && this.get_id() == this._owner.get_masterTableViewHeader().get_id()) {
this._owner.get_masterTableView().ColGroup.Cols[b].style.width = "";
this._owner.get_masterTableViewHeader().get_element().cells[b].style.width = "";
}
if (this._owner.get_masterTableViewFooter()) {
this._owner.get_masterTableViewFooter().ColGroup.Cols[b].style.width = "";
this._owner.get_masterTableViewFooter().get_element().cells[b].style.width = "";
}
this._resizedColumnsData.add(String.format("{0},{1}", this._data.UniqueID, this.get_columns()[b].get_uniqueName()), "");
}
if (d > 0) {
this._owner.get_element().style.width = d + "px";
}
this.get_element().style.width = e + "px";
if (this._owner.get_masterTableViewHeader() && this.get_id() == this._owner.get_masterTableViewHeader().get_id()) {
this._owner.get_masterTableView().get_element().style.width = this.get_element().style.width;
}
if (this._owner.get_masterTableViewFooter()) {
this._owner.get_masterTableViewFooter().get_element().style.width = this.get_element().style.width;
}
}, _validateResizeColumnParams: function (a, c) {
if (isNaN(parseInt(a))) {
var b = 'Column index must be of type "Number"!';
alert(b);
return false;
}
if (isNaN(parseInt(c))) {
var b = 'Column width must be of type "Number"!';
alert(b);
return false;
}
if (a < 0) {
var b = "Column index must be non-negative!";
alert(b);
return false;
}
if (c < 0) {
var b = "Column width must be non-negative!";
alert(b);
return false;
}
if (a > (this.get_columns().length - 1)) {
var b = "Column index must be less than columns count!";
alert(b);
return false;
}
if (!this._owner.ClientSettings.Resizing.AllowColumnResize) {
return false;
}
if (!this.get_columns()) {
return false;
}
if (!this.get_columns()[a].get_resizable()) {
return false;
}
return true;
}, resizeColumnToFit: function (a) {
if (typeof(a) === "string") {
a = this.getColumnByUniqueName(a);
}
if (typeof(a) === "number") {
a = this.get_columns()[a];
}
if (typeof(a) === "object" && a.resizeToFit) {
a.resizeToFit();
}
}, get_allowPaging: function () {
return !!this._data.AllowPaging;
}, get_pageCount: function () {
return this.PageCount;
}, get_pageSize: function () {
return this.PageSize;
}, set_pageSize: function (b) {
var a = this.PageSize;
if (this.PageSize != b) {
this.PageSize = b;
this.set_currentPageIndex(0, true);
if (!this.fireCommand("PageSize", b) && this._preventUpdatePager) {
this.PageSize = a;
this._refreshPagerSlider();
this._refreshAdvancedPageTextBoxes();
this._refreshDropDownPager();
this._generateNumericPager();
this._preventUpdatePager = false;
} else {
this._updatePager();
}
}
}, get_virtualItemCount: function () {
return this._virtualItemCount;
}, set_virtualItemCount: function (a) {
if (this._virtualItemCount != a || a === 0) {
this._virtualItemCount = a;
if (a == 0 && (!this._dataSource || this._dataSource.length == 0)) {
this.set_currentPageIndex(0, true);
} else {
this.set_currentPageIndex(0, false);
}
this._updatePager();
this._initializeVirtualScrollPaging();
if (this._virtualization) {
this._virtualization.set_virtualItemCount(a);
}
}
}, set_pageButtonCount: function (a) {
this._pageButtonCount = a;
this._updatePager();
}, get_pageButtonCount: function () {
return this._pageButtonCount;
}, _initializeVirtualScrollPaging: function () {
var a = $find(this._owner.get_id());
if (a._scrolling) {
a._scrolling._initializeVirtualScrollPaging(true);
}
}, _updatePager: function () {
var a = Math.ceil(this.get_virtualItemCount() / this.get_pageSize());
this.PageCount = a;
var b = String.format("{0}PCN", this.get_id());
var c = String.format("{0}FIP", this.get_id());
var e = String.format("{0}DSC", this.get_id());
var d = String.format("{0}LIP", this.get_id());
var f = this._data.pageOfLabelClientID;
this._populatePagerStatsElements(b, c, d, e, f);
b = String.format("{0}PCNTop", this.get_id());
c = String.format("{0}FIPTop", this.get_id());
e = String.format("{0}DSCTop", this.get_id());
d = String.format("{0}LIPTop", this.get_id());
f = this._data.pageOfLabelTopClientID;
this._populatePagerStatsElements(b, c, d, e, f);
this._refreshPagerSlider();
this._refreshAdvancedPageTextBoxes();
this._refreshDropDownPager();
this._generateNumericPager();
this._setPagerVisibility(a > 1 || this._data.PagerAlwaysVisible);
}, _refreshPagerSlider: function () {
if (this._data.sliderClientID && this._data.sliderClientID != "") {
this._setSliderValue($find(this._data.sliderClientID), this.get_pageCount(), this._data.sliderLabelClientID);
}
if (this._data.sliderTopClientID && this._data.sliderTopClientID != "") {
this._setSliderValue($find(this._data.sliderTopClientID), this.get_pageCount(), this._data.sliderTopLabelClientID);
}
}, _refreshAdvancedPageTextBoxes: function () {
if (this._data.goToPageTextBoxClientID && this._data.goToPageTextBoxClientID != "") {
this._setTextBoxValue($find(this._data.goToPageTextBoxClientID), this.PageCount || 1);
}
if (this._data.goToPageTextBoxTopClientID && this._data.goToPageTextBoxTopClientID != "") {
this._setTextBoxValue($find(this._data.goToPageTextBoxTopClientID), this.PageCount || 1);
}
if (this._data.changePageSizeTextBoxClientID && this._data.changePageSizeTextBoxClientID != "") {
this._setTextBoxValue($find(this._data.changePageSizeTextBoxClientID), this.get_virtualItemCount() || 1, this.PageSize);
}
if (this._data.changePageSizeTextBoxTopClientID && this._data.changePageSizeTextBoxTopClientID != "") {
this._setTextBoxValue($find(this._data.changePageSizeTextBoxTopClientID), this.get_virtualItemCount() || 1, this.PageSize);
}
}, _refreshDropDownPager: function () {
if (this._data.changePageSizeComboBoxTopClientID && this._data.changePageSizeComboBoxTopClientID != "") {
this._setChangePageComboSelectedValue($find(this._data.changePageSizeComboBoxTopClientID), this.PageSize);
}
if (this._data.changePageSizeComboBoxClientID && this._data.changePageSizeComboBoxClientID != "") {
this._setChangePageComboSelectedValue($find(this._data.changePageSizeComboBoxClientID), this.PageSize);
}
}, _setChangePageComboSelectedValue: function (a, j) {
if (a != null) {
var e = a.findItemByValue(j);
if (e) {
a.trackChanges();
e.select();
a.commitChanges();
} else {
var f = a.get_items();
var d = f.get_count();
var h;
for (var c = 0, g = f.get_count();
c < g;
c++) {
if (f.getItem(c).get_value() > j) {
h = f.getItem(c).get_attributes().getAttribute("ownerTableViewId");
d = c;
break;
}
}
a.trackChanges();
var b;
if (a.get_id().indexOf("PageSizeCombo") > -1) {
b = new Telerik.Web.UI.RadComboBoxItem();
} else {
b = new Telerik.Web.UI.DropDownListItem();
}
b.set_text(j.toString());
b.set_value(j);
f.insert(d, b);
b.get_attributes().setAttribute("ownerTableViewId", h);
b.select();
a.commitChanges();
}
}
}, _setSliderValue: function (c, a, b) {
if (c != null) {
a = Math.max(a - 1, 0);
c.set_maximumValue(a);
this._applyPagerLabelText($get(b), 0, a + 1);
}
}, _setTextBoxValue: function (b, a, c) {
if (b != null) {
if (typeof(a) != "undefined") {
b.set_maxValue(a);
}
if (typeof(c) != "undefined") {
b.set_value(Math.min(c, a));
}
}
}, _populatePagerStatsElements: function (a, b, c, d, e) {
if ($get(a)) {
$get(a).innerHTML = this.PageCount;
}
if (e && e != "" && $get(e)) {
$get(e).innerHTML = String.format(" of {0}", this.PageCount || 1);
}
if ($get(b)) {
if (this.get_virtualItemCount() == 0) {
$get(b).innerHTML = 0;
} else {
$get(b).innerHTML = (this.get_currentPageIndex() + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
}
if ($get(d)) {
$get(d).innerHTML = this.get_virtualItemCount();
}
if ($get(c)) {
var g = this.get_virtualItemCount();
var f = (this.get_currentPageIndex() + 1) * this.get_pageSize();
if (f > g) {
f = g;
}
$get(c).innerHTML = f;
}
if ($get(c) && $get(d)) {
var h = parseInt($get(c).innerHTML);
var i = parseInt($get(d).innerHTML);
if (h > i) {
$get(c).innerHTML = i;
}
}
}, _generateNumericPager: function () {
this._populateNumericPagerDiv($get(String.format("{0}NPPHTop", this.get_id())));
this._populateNumericPagerDiv($get(String.format("{0}NPPH", this.get_id())));
}, _populateNumericPagerDiv: function (e) {
if (e) {
e.innerHTML = "";
var f = new Sys.StringBuilder();
var g = 1;
var a = this._pageButtonCount;
if (this.get_currentPageIndex() + 1 > a) {
g = (Math.floor(this.get_currentPageIndex() / a) * a) + 1;
}
var b = Math.min(this.PageCount, (g + a) - 1);
if (g > a) {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), Math.max(g - a, 0)));
f.append("><span>...</span></a>");
}
for (var c = g, d = b;
c <= d;
c++) {
if (c == (this.get_currentPageIndex() + 1)) {
f.append('<a href="#"');
f.append(' onclick="return false;" class="rgCurrentPage"');
f.append(String.format("><span>{0}</span></a>", c));
} else {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), c));
f.append(String.format("><span>{0}</span></a>", c));
}
}
if (b < this.PageCount) {
f.append('<a href="#"');
f.append(String.format(" onclick=\"Telerik.Web.UI.Grid.NavigateToPage('{0}',{1}); return false;\"", this.get_id(), b + 1));
f.append("><span>...</span></a>");
}
e.innerHTML = f.toString();
}
}, get_currentPageIndex: function () {
return this.CurrentPageIndex;
}, set_currentPageIndex: function (p, a) {
if (this.CurrentPageIndex != p) {
this.CurrentPageIndex = p;
var b = String.format("{0}CPI", this.get_id());
var d = String.format("{0}PCN", this.get_id());
var f = String.format("{0}FIP", this.get_id());
var h = String.format("{0}LIP", this.get_id());
var j = String.format("{0}DSC", this.get_id());
var c = String.format("{0}CPITop", this.get_id());
var e = String.format("{0}PCNTop", this.get_id());
var g = String.format("{0}FIPTop", this.get_id());
var i = String.format("{0}LIPTop", this.get_id());
var k = String.format("{0}DSCTop", this.get_id());
if ($get(b)) {
$get(b).innerHTML = p + 1;
}
if ($get(f)) {
$get(f).innerHTML = (p + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
var o = 0;
if ($get(j)) {
o = parseInt($get(j).innerHTML);
}
if ($get(h)) {
var l = (p + 1) * this.get_pageSize();
if (l > o) {
l = o;
}
$get(h).innerHTML = l;
}
if ($get(c)) {
$get(c).innerHTML = p + 1;
}
if ($get(g)) {
$get(g).innerHTML = (p + 1) * this.get_pageSize() - this.get_pageSize() + 1;
}
var o = 0;
if ($get(k)) {
o = parseInt($get(k).innerHTML);
}
if ($get(i)) {
var l = (p + 1) * this.get_pageSize();
if (l > o) {
l = o;
}
$get(i).innerHTML = l;
}
this._generateNumericPager();
if (this._data.sliderClientID && this._data.sliderClientID != "" && this._data.sliderTopClientID && this._data.sliderTopClientID != "") {
var m = $find(this._data.sliderClientID);
if (m) {
m.set_value(p);
}
m = $find(this._data.sliderTopClientID);
if (m) {
m.set_value(p);
}
}
if (this._data.goToPageTextBoxClientID && this._data.goToPageTextBoxClientID != "" && this._data.goToPageTextBoxTopClientID && this._data.goToPageTextBoxTopClientID != "") {
var n = $find(this._data.goToPageTextBoxClientID);
if (n != null) {
n.set_value(p + 1);
}
n = $find(this._data.goToPageTextBoxTopClientID);
if (n != null) {
n.set_value(p + 1);
}
}
if (!a) {
this.fireCommand("Page", p);
}
}
}, get_dataSource: function () {
return this._dataSource;
}, set_dataSource: function (a) {
if (this._dataSource != a) {
this._dataSource = a;
}
}, get_allowMultiColumnSorting: function () {
return this._data.AllowMultiColumnSorting;
}, set_allowMultiColumnSorting: function (a) {
if (this._data.AllowMultiColumnSorting != a) {
this._data.AllowMultiColumnSorting = a;
}
}, get_allowNaturalSort: function () {
return this._data.AllowNaturalSort;
}, set_allowNaturalSort: function (a) {
if (this._data.AllowNaturalSort != a) {
this._data.AllowNaturalSort = a;
}
}, _setPagerVisibility: function (j) {
var b = j ? "" : "none";
if (this.get_element().tFoot) {
var f = this.get_element().tFoot;
if (f.rows) {
for (var c = 0, d = f.rows.length;
c < d;
c++) {
if (f.rows[c].className.indexOf("rgPager") > -1) {
f.rows[c].style.display = b;
}
}
}
} else {
var a = $get(String.format("{0}_Pager", this.get_id()));
if (a) {
var e = a.rows || (a.tBodies && a.tBodies[0].rows);
if (e && e.length) {
for (var c = 0, d = e.length;
c < d;
c++) {
if (e[c].className.indexOf("rgPager") > -1) {
e[c].style.display = b;
}
}
}
}
}
var g = this.get_element().tHead;
if (g) {
for (var c = 0, d = g.rows.length;
c < d;
c++) {
if (g.rows[c].className.indexOf("rgPager") > -1) {
g.rows[c].style.display = b;
}
}
} else {
var h = $get(String.format("{0}_TopPager", this.get_id()));
if (h) {
var e = h.rows || (h.tBodies && h.tBodies[0].rows);
if (e && e.length) {
for (var c = 0, d = e.length;
c < d;
c++) {
if (e[c].className.indexOf("rgPager") > -1) {
e[c].style.display = b;
}
}
}
}
}
}, _fixRowsClassNames: function () {
var d = this.get_element().tBodies[0].rows, c = 0, b;
for (var a = 0;
a < d.length;
a++) {
b = d[a];
if ((b.className.indexOf("rgRow") !== -1 || b.className.indexOf("rgAltRow") !== -1) && b.style.display !== "none") {
if (c % 2 == 0 || this._owner.ClientSettings.EnableAlternatingItems == false) {
Sys.UI.DomElement.removeCssClass(b, "rgAltRow");
Sys.UI.DomElement.addCssClass(b, "rgRow");
} else {
Sys.UI.DomElement.removeCssClass(b, "rgRow");
Sys.UI.DomElement.addCssClass(b, "rgAltRow");
}
c++;
}
}
}, expandItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = this._getExpandButton(b);
this._ensureExpandCollapseButtons(a, false);
return this._expandRow(b);
}, _expandRow: function (l) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return false;
}
var b = l;
var f = b.id.split("__")[1];
var h = 1;
if (!$find(b.id)) {
var m = $find(b.id.split("__")[0]);
if (m) {
m.get_dataItems();
}
}
var d = $find(b.id);
if (d && d.get_isInEditMode() && this._data.EditMode != "InPlace") {
h = 2;
}
var c = this._data.hasDetailItemTemplate ? 1 : 0;
var g = b.parentNode.rows[b.sectionRowIndex + h + c];
if (g && g.style.display == "none") {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(b, null);
a.get_nestedViewItem = function () {
return g;
};
this._owner.raise_hierarchyExpanding(a);
if (a.get_cancel()) {
return false;
}
var e = $find(b.id);
if (e) {
e._expanded = true;
}
g.style.display = (window.netscape) ? "table-row" : "";
var a = new Telerik.Web.UI.GridDataItemEventArgs(b, null);
a.get_nestedViewItem = function () {
return g;
};
this._owner.raise_hierarchyExpanded(a);
Array.add(this._owner._expandedItems, f);
this._owner.updateClientState();
}
if (this.get_element().parentNode.parentNode.tagName.toLowerCase() == "tr") {
if (this.get_id() != this._owner._masterClientID) {
var k = this.get_element().parentNode.parentNode.parentNode.parentNode;
var j = $find(k.id);
var i = k.rows[this.get_element().parentNode.parentNode.rowIndex - 1];
if (i) {
j._expandRow(i);
}
}
}
return true;
}, collapseItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = this._getExpandButton(b);
this._ensureExpandCollapseButtons(a, true);
return this._collapseRow(b);
}, _performCollapseItem: function (c) {
c = this._getRowByIndexOrItemIndexHierarchical(c);
var b = 0;
if (this._data._columnsData && this._data._columnsData.length > 0 && this._data._columnsData[0].ColumnType == "GridGroupSplitterColumn") {
b = 1;
}
var a = c.cells[b].getElementsByTagName("input")[0];
if (a == undefined) {
a = c.cells[b].getElementsByTagName("img")[0];
}
this._ensureExpandCollapseButtons(a, true);
if (!$find(c.id)) {
var d = $find(c.id.split("__")[0]);
this._owner._ensureDataItemsCreated(d);
}
return this._collapseRow(c);
}, _collapseRow: function (j) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return false;
}
var d = j;
var h = d.id.split("__")[1];
var f = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var c = this.get_dataItems(), b = $find(d.id);
if (b && b.get_isInEditMode()) {
f += 1;
}
}
var e = this._data.hasDetailItemTemplate ? 1 : 0;
var i = d.parentNode.rows[d.sectionRowIndex + f + e];
if (i && i.style.display != "none") {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(d, null);
a.get_nestedViewItem = function () {
return i;
};
this._owner.raise_hierarchyCollapsing(a);
if (a.get_cancel()) {
return false;
}
var g = $find(d.id);
if (g) {
g._expanded = false;
}
i.style.display = "none";
var a = new Telerik.Web.UI.GridDataItemEventArgs(d, null);
a.get_nestedViewItem = function () {
return i;
};
this._owner.raise_hierarchyCollapsed(a);
Array.add(this._owner._expandedItems, h);
this._owner.updateClientState();
}
return true;
}, _ensureExpandCollapseButtons: function (b, c) {
if (!b) {
return;
}
if (c) {
if (b.title == this._owner._hierarchySettings.CollapseTooltip) {
b.title = this._owner._hierarchySettings.ExpandTooltip;
}
if (b.src) {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a) {
b.src = a._data.ExpandImageUrl;
}
} else {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a && b.className.indexOf("rgCollapse") !== -1) {
b.className = "rgExpand";
}
if (b.textContent && b.textContent == "-") {
b.textContent = "+";
}
}
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-expanded", "false");
b.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
} else {
if (b.title == this._owner._hierarchySettings.ExpandTooltip) {
b.title = this._owner._hierarchySettings.CollapseTooltip;
}
if (b.src) {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a) {
b.src = a._data.CollapseImageUrl;
}
} else {
var a = this.get_columns()[b.parentNode.cellIndex];
if (a && b.className.indexOf("rgExpand") !== -1) {
b.className = "rgCollapse";
}
if (b.textContent && b.textContent == "+") {
b.textContent = "-";
}
}
if (this._owner.get_enableAriaSupport()) {
b.setAttribute("aria-expanded", "true");
b.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
}
}, _toggleExpand: function (i, d) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var b = i.parentNode.parentNode;
var g = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var a = this.get_dataItems();
if ($find(b.id).get_isInEditMode()) {
g += 1;
}
}
var c = this._data.hasDetailItemTemplate ? 1 : 0;
var h = b.parentNode.rows[b.sectionRowIndex + g + c];
var f = $find(this._owner.get_id());
if (h.style.display != "none") {
if (!this._collapseRow(b)) {
return false;
}
this._ensureExpandCollapseButtons(i, true);
} else {
if (!this._expandRow(b)) {
return false;
}
this._ensureExpandCollapseButtons(i, false);
}
if (f.ClientSettings.AllowKeyboardNavigation) {
f.get_element().focus();
}
if (f.ClientSettings.AllowKeyboardNavigation || f.get_allowMultiRowSelection()) {
f._getPositionedDataItems(true);
}
if (this._enableHierarchyExpandAll) {
this._toggleHierarchyExpandAllHeaderButtons();
}
}, _toggleExpandByRowElement: function (c, a) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var h = 1;
if (this._owner._editIndexes.length > 0 && (this._hierarchyLoadMode == "Client" || this._hierarchyLoadMode == "Conditional") && this._data.EditMode != "InPlace") {
var b = this.get_dataItems();
if ($find(c.id).get_isInEditMode()) {
h += 1;
}
}
var d = this._data.hasDetailItemTemplate ? 1 : 0;
var i = c.parentNode.rows[c.sectionRowIndex + h + d];
var g = $find(this._owner.get_id());
var f = 0;
if (this._data._columnsData && this._data._columnsData.length > 0 && this._data._columnsData[0].ColumnType == "GridGroupSplitterColumn") {
f = 1;
}
var e = c.cells[f].getElementsByTagName("input")[0];
if (e == undefined) {
e = c.cells[f].getElementsByTagName("img")[0];
}
if (a) {
if (!this._collapseRow(c)) {
return false;
}
this._ensureExpandCollapseButtons(e, true);
} else {
if (!this._expandRow(c)) {
return false;
}
this._ensureExpandCollapseButtons(e, false);
}
if (g.ClientSettings.AllowKeyboardNavigation) {
g.get_element().focus();
}
if (g.ClientSettings.AllowKeyboardNavigation || g.get_allowMultiRowSelection()) {
g._getPositionedDataItems(true);
}
}, _expandAll: function (b) {
var c = b ? b : window.event;
var k = c.srcElement ? c.srcElement : c.target;
c.returnValue = false;
c.cancelBubble = true;
if (c.preventDefault) {
c.preventDefault();
c.stopPropagation();
}
var a = k.className.indexOf("rgCollapse") > -1 ? true : false;
var g = this.get_element();
var m = ($telerik.isOpera) ? g : g.tBodies[0];
var j = m.rows;
for (var d = 0, f = j.length;
d < f;
d++) {
var h = j[d];
if (!h.id) {
continue;
} else {
this._toggleExpandByRowElement(h, a);
}
}
if (a) {
k.className = "rgExpand";
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = false;
} else {
k.className = "rgCollapse";
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = true;
}
this._owner.updateClientState();
}, _toggleHierarchyExpandAllHeaderButtons: function () {
var b = this.get_dataItems();
var a = this._getHierarchyColExpButtons();
var c = b[0].get_expanded();
var e = true;
for (var d = 0;
d < b.length;
d++) {
if (c != b[d].get_expanded()) {
e = false;
break;
}
}
if (e) {
for (var d = 0;
d < a.length;
d++) {
if (c) {
a[d].className = "rgCollapse";
} else {
a[d].className = "rgExpand";
}
}
this._owner.get_hierarchyColsExpandedState()[this._data.UniqueID] = c;
this._owner.updateClientState();
}
}, _toggleDisplayHierarchyExpandAllButtons: function () {
var b = this._isLastLevelGroupAllButtonOpen() ? "" : "none";
var a = this._getHeaderHierarchyExpandAllButtons();
for (var c = 0;
c < a.length;
c++) {
a[c].style.display = b;
}
}, _getHeaderHierarchyExpandAllButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgExpandCol") > -1) {
var c = d.getElementsByTagName("input")[0];
if (c) {
Array.add(a, c);
continue;
}
c = d.getElementsByTagName("img")[0];
if (c) {
Array.add(a, c);
}
}
}
return a;
}, _isLastLevelGroupAllButtonOpen: function () {
var c = false;
var a = this._getGroupColExpButtons();
var b = a[a.length - 1];
if (b.style.display != "none" && b.className == "rgCollapse") {
c = true;
}
return c;
}, _expandAllGroups: function (a, c) {
var b = a ? a : window.event;
var d = b.target || b.srcElement;
this._groupExpandAll(d, c);
this._toggleDisplayHierarchyExpandAllButtons();
}, _createFakeElement: function (c, a) {
var b = document.createElement(c);
b.className = a;
return b;
}, _getGroupColExpButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgGroupCol") > -1) {
var c = d.getElementsByTagName("input")[0];
if (c) {
Array.add(a, c);
continue;
}
c = d.getElementsByTagName("img")[0];
if (!c) {
c = this._createFakeElement("input", "rgExpand");
}
if (c) {
Array.add(a, c);
}
}
}
return a;
}, _getHierarchyColExpButtons: function () {
var a = [];
var b = this.get_columns();
for (var e = 0;
e < b.length;
e++) {
var d = b[e].get_element();
if (d.className.indexOf("rgExpandCol") > -1) {
var c = d.getElementsByTagName("input")[0];
Array.add(a, c);
}
}
return a;
}, _showGroupColExpButtonsOnCollapse: function (d, b) {
var a = this._getGroupColExpButtons();
for (var c = b + 1;
c < a.length;
c++) {
if (d.className.indexOf("rgCollapse") > -1 && d.style.display != "none") {
a[c].style.display = "";
}
d = a[c];
}
}, _hideGroupColExpButtonsOnCollapse: function (d, b) {
var a = this._getGroupColExpButtons();
for (var c = b + 1;
c < a.length;
c++) {
a[c].style.display = "none";
}
}, _updateGroupsColState: function (a, b) {
if (this._owner._groupColsState[this._data.UniqueID]) {
this._owner._groupColsState[this._data.UniqueID][b] = a;
} else {
this._owner._groupColsState[this._data.UniqueID] = new Array(this._data.GroupLevelsCount * 1);
this._owner._groupColsState[this._data.UniqueID][b] = a;
}
}, _groupExpandAll: function (k, c) {
if (!this._owner.ClientSettings.AllowExpandCollapse) {
return;
}
var f = this.get_element();
var m = ($telerik.isOpera) ? f : f.tBodies[0];
var j = m.rows;
for (var d = 0, e = j.length;
d < e;
d++) {
var h = j[d];
if (h.id || h.className.indexOf("rgGroupHeader") !== -1) {
var a = this._getGroupExpandButton(h);
if (a) {
var g = k;
var b = a.id.split("__")[2];
if (b == c) {
if (k.className.indexOf("rgCollapse") == 0) {
this._toggleGroupsExpandAll(a, {}, true);
this._hideGroupColExpButtonsOnCollapse(a, c);
this._updateGroupsColState(false, c);
} else {
this._toggleGroupsExpandAll(a, {}, false);
this._showGroupColExpButtonsOnCollapse(a, c);
this._updateGroupsColState(true, c);
}
}
}
}
}
if (k.className.indexOf("rgCollapse") == 0) {
k.className = "rgExpand";
} else {
k.className = "rgCollapse";
}
this._owner.updateClientState();
}, _toggleGroupsExpandAll: function (E, n, v, A) {
var G = false;
if (!A) {
G = true;
}
var o = E;
var w = typeof(A) === "undefined" ? false : true;
if (typeof(A) === "undefined") {
A = o;
}
if (!this._owner.ClientSettings.AllowGroupExpandCollapse) {
return;
}
var K = o.id.split("__")[0];
var J = $find(K);
var F = o.id.split("__")[1];
var s = o.id.split("__")[2];
var t = false;
if (!this._originalGroupLevel) {
this._originalGroupLevel = s;
}
if (parseInt(s, 10) < parseInt(this._originalGroupLevel) || G) {
this._originalGroupLevel = s;
}
var g = o.parentNode.cellIndex;
var D = o.parentNode.parentNode.sectionRowIndex;
var I = J.get_element().tBodies[0];
var k = this.get_columns()[g];
var a = new Sys.CancelEventArgs();
if (!w) {
if (v) {
this._owner.raise_groupCollapsing(a);
} else {
this._owner.raise_groupExpanding(a);
}
}
if (a.get_cancel()) {
return false;
}
if (o === A) {
if (k) {
if (o.src) {
if (!v && o.src !== k._data.CollapseImageUrl) {
t = true;
o.src = k._data.CollapseImageUrl;
o.title = J._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.src !== k._data.ExpandImageUrl) {
t = true;
o.src = k._data.ExpandImageUrl;
o.title = J._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
} else {
if (!v && o.className.indexOf("rgCollapse") === -1) {
t = true;
o.className = "rgCollapse";
o.title = J._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.className.indexOf("rgExpand") === -1) {
t = true;
o.className = "rgExpand";
o.title = J._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
}
}
}
var m = "none";
if (!v && o.offsetHeight !== 0 && this._isGroupButtonCollapse(o)) {
m = (window.netscape) ? "table-row" : "";
}
if (this._owner._groupingSettings.RetainGroupFootersVisibility && !n.groupLevel) {
n.groupLevel = s;
}
var z = s;
var c = false;
var l = parseInt(this._groupLevelsCount) - parseInt(this._originalGroupLevel, 10);
var H = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
for (var u = D + 1;
u < I.rows.length;
u++) {
var C = I.rows[u];
var B = this._previousRow(I.rows[u]);
if (C.className.indexOf("rgRow") < 0 && C.className.indexOf("rgAltRow") < 0 && B && B.id) {
var q = this._getExpandButton(B);
if (q && !this._isGroupButtonCollapse(q) && C.className.indexOf("rgFooter") == -1) {
continue;
}
}
var f;
if (C.id || C.className.indexOf("rgGroupHeader") !== -1) {
f = this._getGroupExpandButton(C);
}
if (!f) {
if (z == s) {
if (l > 0) {
C.style.display = m;
}
if (C.className.indexOf("rgFooter") != -1) {
l--;
} else {
C.style.display = m;
}
}
if (m == "" || m == "table-row") {
if (C.className.indexOf("rgFooter") != -1) {
var d = 1;
if (this._owner._groupingSettings.RetainGroupFootersVisibility) {
d = 2;
}
if (H <= d) {
C.style.display = m;
}
H--;
}
}
} else {
z = f.id.split("__")[2];
if (z == s || (parseInt(z) < parseInt(s))) {
if (n.groupLevel && s == n.groupLevel && m == "none") {
var b = s - z + 1;
for (var x = 0;
x < b;
x++) {
var C = I.rows[u - x - 1];
if (!C.id) {
C.style.display = "";
}
}
}
break;
} else {
if (parseInt(z) - parseInt(s) == 1) {
if (f.src == o.src || (o.className == f.className)) {
if (f === A) {
if (m == "none") {
if (o.src) {
f.src = k._data.CollapseImageUrl;
} else {
f.className = "rgCollapse";
}
}
}
var h = false;
if (!v) {
if (!this._isGroupButtonCollapse(o)) {
h = true;
}
} else {
h = v;
}
C.style.display = m;
this._toggleGroupsExpand(f, n, o, h);
H = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
}
C.style.display = m;
}
}
}
if (u == I.rows.length - 1) {
c = true;
}
}
if (n.groupLevel && c && n.groupLevel == s && m == "none") {
var b = s * 1 + 1;
for (var x = 0;
x < b;
x++) {
var C = I.rows[I.rows.length - x - 1];
if (!C.id) {
C.style.display = "";
}
}
}
if (o === A && t) {
var p = this._owner._expandedGroupItems, y = J._data.UniqueID + "!" + F, l = 0;
for (var u = 0;
u < p.length;
u++) {
if (p[u] == y) {
l++;
}
}
if (l === 2) {
Array.remove(p, y);
} else {
Array.add(p, y);
}
}
this._owner.updateClientState();
var a = new Sys.EventArgs();
if (!w) {
if (v) {
this._owner.raise_groupCollapsed(a);
} else {
this._owner.raise_groupExpanded(a);
}
}
var r = $find(this._owner.get_id());
r._getPositionedDataItems(true);
}, _previousRow: function (b) {
var a = b.previousSibling;
if (this._data.hasDetailItemTemplate && a.className && (a.className.indexOf("rgRow") != -1 || a.className.indexOf("rgAltRow") != -1)) {
a = b.previousSibling;
}
return a;
}, _previousDataItemElement: function (a) {
var b = this;
if (b._isDataItemElement(a)) {
return a;
}
while (!b._isDataItemElement(a) && a) {
a = a.previousSibling;
}
if (!b._isDataItemElement(a)) {
return null;
}
return a;
}, _isDataItemElement: function (a) {
return (a && (a.className && ((a.className.indexOf("rgRow") != -1 || a.className.indexOf("rgAltRow") != -1) && a.id.indexOf("__") != -1)));
}, _expandCollapseGroup: function (k, j, h) {
var e = {
expandChildren: false,
expandParents: true,
collapseChildren: false,
collapseParents: false,
toggleChildren: false,
toggleParents: false,
findClosestGroup: true
}, n = this, j = j || {}, m = k.parentNode.parentNode.rows, l, f, d, g = !h, b = h === true ? "rgExpand" : h === false ? "rgCollapse" : undefined;
for (var i in e) {
if (typeof j[i] === "undefined") {
j[i] = e[i];
}
}
if (j.findClosestGroup) {
l = k.rowIndex;
while (m[l] && !Sys.UI.DomElement.containsCssClass(m[l], "rgGroupHeader")) {
l--;
}
k = m[l];
if (!k) {
return;
}
}
f = n._getGroupExpandButton(k);
if (!f) {
f = $telerik.getElementByClassName(k, "rgGroupCol");
if (f) {
f = $telerik.getElementByClassName(f, "rgExpand");
}
}
if (!f) {
f = $telerik.getElementByClassName(k, "rgGroupCol");
if (f) {
f = $telerik.getElementByClassName(f, "rgCollapse");
}
}
if (f) {
if (!b || Sys.UI.DomElement.containsCssClass(f, b)) {
if (!b) {
b = f.className;
}
n._toggleGroupsExpand(f, {});
} else {
return false;
}
if ((j.expandParents && h && h !== undefined) || (j.collapseParents && g && h !== undefined) || j.toggleParents) {
d = $telerik.getElementsByClassName(k, "rgGroupCol").length - 1;
l = k.rowIndex - 1;
while (d > 0 && m[l]) {
if ($telerik.getElementsByClassName(m[l], "rgGroupCol").length === d) {
n._expandCollapseGroup(m[l], {expandParents: false, findClosestGroup: false}, h);
d--;
}
l--;
}
}
if ((j.expandChildren && h) || (j.collapseChildren && g) || j.toggleChildren) {
d = $telerik.getElementsByClassName(k, "rgGroupCol").length;
l = k.rowIndex + 1;
while (m[l]) {
if ($telerik.getElementsByClassName(m[l], "rgGroupCol").length === d) {
break;
}
n._expandCollapseGroup(m[l], {expandParents: false, findClosestGroup: false}, h);
l++;
}
}
if (this._data.GroupLoadMode === "Server") {
var c = "", a = f.id.split("__");
if (j.expandChildren || (j.toggleChildren && b === "rgExpand")) {
c = "expandChildren;" + a[1] + ";" + a[2];
}
this.fireCommand("GroupsCustomExpandCollapse", c);
}
return true;
}
return false;
}, toggleGroup: function (b, a) {
return this._expandCollapseGroup(b, a);
}, expandGroup: function (b, a) {
return this._expandCollapseGroup(b, a, true);
}, collapseGroup: function (b, a) {
return this._expandCollapseGroup(b, a, false);
}, _expandCollapseAllGroups: function (f, b) {
f = parseInt(f);
var g = isNaN(f) || f === 0;
var d = this._getGroupColExpButtons();
var c = g ? b === "rgExpand" ? "expandToLevel" : "collapseToLevel" : b === "rgExpand" ? "expandLevel" : "collapseLevel";
var a;
if (g) {
for (var e = 0;
e < d.length;
e++) {
a = d[e];
a.className = b;
this._groupExpandAll(a, e);
f = e;
}
} else {
a = d[f];
if (!a) {
return false;
}
a.className = b;
this._groupExpandAll(a, f);
}
if (this._data.GroupLoadMode === "Server") {
this.fireCommand("GroupsCustomExpandCollapse", String.format("{0};{1}", c, f));
}
return true;
}, expandAllGroups: function (a) {
return this._expandCollapseAllGroups(a, "rgExpand");
}, collapseAllGroups: function (a) {
return this._expandCollapseAllGroups(a, "rgCollapse");
}, _toggleGroupsExpand: function (F, n, B, w) {
var H = false;
if (!B) {
H = true;
}
var o = F;
var x = typeof(B) === "undefined" ? false : true;
if (typeof(B) === "undefined") {
B = o;
}
if (!this._owner.ClientSettings.AllowGroupExpandCollapse) {
return;
}
var L = o.id.split("__")[0];
var K = $find(L);
var G = o.id.split("__")[1];
var s = o.id.split("__")[2];
var t = false;
if (!this._originalGroupLevel) {
this._originalGroupLevel = s;
}
if (parseInt(s, 10) < parseInt(this._originalGroupLevel) || H) {
this._originalGroupLevel = s;
}
var g = o.parentNode.cellIndex;
var E = o.parentNode.parentNode.sectionRowIndex;
var J = K.get_element().tBodies[0];
var k = this.get_columns()[g];
var a = new Sys.CancelEventArgs();
var v = false;
if (this._isGroupButtonCollapse(o)) {
v = true;
}
if (typeof(w) !== "undefined") {
v = w;
}
if (!x) {
if (v) {
this._owner.raise_groupCollapsing(a);
} else {
this._owner.raise_groupExpanding(a);
}
}
if (a.get_cancel()) {
return false;
}
if (o === B) {
if (k) {
if (o.src) {
if (!v && o.src !== k._data.CollapseImageUrl) {
t = true;
o.src = k._data.CollapseImageUrl;
o.title = K._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.src !== k._data.ExpandImageUrl) {
t = true;
o.src = k._data.ExpandImageUrl;
o.title = K._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
} else {
if (!v && o.className.indexOf("rgCollapse") === -1) {
t = true;
o.className = "rgCollapse";
o.title = K._owner._groupingSettings.CollapseTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "true");
o.parentNode.parentNode.setAttribute("aria-expanded", "true");
}
} else {
if (v && o.className.indexOf("rgExpand") === -1) {
t = true;
o.className = "rgExpand";
o.title = K._owner._groupingSettings.ExpandTooltip;
if (this._owner.get_enableAriaSupport()) {
o.setAttribute("aria-expanded", "false");
o.parentNode.parentNode.setAttribute("aria-expanded", "false");
}
}
}
}
}
}
var m = "none";
if (!v && o.offsetHeight !== 0 && this._isGroupButtonCollapse(o)) {
m = (window.netscape) ? "table-row" : "";
}
if (this._owner._groupingSettings.RetainGroupFootersVisibility && !n.groupLevel) {
n.groupLevel = s;
}
var A = s;
var c = false;
var l = parseInt(this._groupLevelsCount) - parseInt(this._originalGroupLevel, 10);
var I = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
for (var u = E + 1;
u < J.rows.length;
u++) {
var D = J.rows[u];
var C = this._previousRow(J.rows[u]);
if (D.className.indexOf("rgRow") < 0 && D.className.indexOf("rgAltRow") < 0 && C && C.id) {
var q = this._getExpandButton(C);
if (q && !this._isGroupButtonCollapse(q) && D.className.indexOf("rgFooter") == -1) {
continue;
}
}
var f;
if (D.id || D.className.indexOf("rgGroupHeader") !== -1) {
f = this._getGroupExpandButton(D);
}
if (!f) {
if (A == s) {
if (l > 0) {
D.style.display = m;
}
if (D.className.indexOf("rgFooter") != -1) {
l--;
} else {
D.style.display = m;
}
}
if (m == "" || m == "table-row") {
if (D.className.indexOf("rgFooter") != -1) {
var d = 1;
if (this._owner._groupingSettings.RetainGroupFootersVisibility) {
d = 2;
}
if (I <= d) {
D.style.display = m;
}
I--;
}
}
} else {
A = f.id.split("__")[2];
if (A == s || (parseInt(A) < parseInt(s))) {
if (n.groupLevel && s == n.groupLevel && m == "none") {
var b = s - A + 1;
for (var y = 0;
y < b;
y++) {
var D = J.rows[u - y - 1];
if (!D.id) {
D.style.display = "";
}
}
}
break;
} else {
if (parseInt(A) - parseInt(s) == 1) {
if (f.src == o.src || (o.className == f.className)) {
if (f === B) {
if (m == "none") {
if (o.src) {
f.src = k._data.CollapseImageUrl;
} else {
f.className = "rgCollapse";
}
}
}
var h = false;
if (!v) {
if (!this._isGroupButtonCollapse(o)) {
h = true;
}
} else {
h = v;
}
D.style.display = m;
this._toggleGroupsExpand(f, n, o, h);
I = parseInt(this._groupLevelsCount, 10) - parseInt(s, 10);
}
D.style.display = m;
}
}
}
if (u == J.rows.length - 1) {
c = true;
}
}
if (n.groupLevel && c && n.groupLevel == s && m == "none") {
var b = s * 1 + 1;
for (var y = 0;
y < b;
y++) {
var D = J.rows[J.rows.length - y - 1];
if (!D.id) {
D.style.display = "";
}
}
}
if (o === B && t) {
var p = this._owner._expandedGroupItems, z = K._data.UniqueID + "!" + G + "!" + s;
l = 0;
for (var u = 0;
u < p.length;
u++) {
if (p[u] == z) {
l++;
}
}
if (l === 2) {
Array.remove(p, z);
if (this._enableGroupsExpandAll) {
this._toggleGroupsExpandAllButton(s * 1);
}
} else {
Array.add(p, z);
if (this._enableGroupsExpandAll) {
this._toggleGroupsExpandAllButton(s * 1);
}
}
}
this._owner.updateClientState();
var a = new Sys.EventArgs();
if (!x) {
if (v) {
this._owner.raise_groupCollapsed(a);
} else {
this._owner.raise_groupExpanded(a);
}
}
var r = $find(this._owner.get_id());
r._getPositionedDataItems(true);
}, _arrayContains: function (b, d) {
var c = b.length;
while (c--) {
if (b[c] === d) {
return true;
}
}
return false;
}, _toggleGroupsExpandAllButton: function (c) {
var b = this._owner._expandedGroupItems;
var k = false;
var d = this._getGroupColExpButtons()[c];
var f = d.className == "rgCollapse";
var g = this._groupHeadersCount[c];
var h = g;
var j = [];
for (var e = 0;
e < b.length;
e++) {
var a = b[e].split("!")[2];
if (a == c) {
if (this._arrayContains(j, b[e])) {
h--;
}
Array.add(j, b[e]);
}
}
if (h == 0 && this._exapndedGroupItemsTemp[c] != j.length && (j.length == g || j.length == g * 2)) {
this._exapndedGroupItemsTemp[c] = j.length;
if (!f) {
d.className = "rgCollapse";
this._showGroupColExpButtonsOnCollapse(d, c * 1);
this._updateGroupsColState(true, c);
this._toggleDisplayHierarchyExpandAllButtons();
} else {
d.className = "rgExpand";
this._hideGroupColExpButtonsOnCollapse(d, c * 1);
this._updateGroupsColState(false, c);
this._toggleDisplayHierarchyExpandAllButtons();
}
}
}, _isGroupButtonCollapse: function (a) {
var b = a.parentNode.cellIndex;
var e = a.parentNode.parentNode.sectionRowIndex;
var d = this.get_columns()[b];
var c = d._data.CollapseImageUrl;
if ((a.className && a.className.indexOf("rgCollapse") !== -1) || (a.src && a.src.indexOf(c) !== -1)) {
return true;
}
return false;
}, _getGroupExpandButton: function (b) {
var a = this._findButtonByClickScript(b, "_toggleGroupsExpand");
if (!a && b.className.indexOf("rgGroupHeader") != -1) {
return $telerik.getElementByClassName(b, "rgCollapse") || $telerik.getElementByClassName(b, "rgExpand");
}
return a;
}, _getExpandButton: function (a) {
return this._findButtonByClickScript(a, "_toggleExpand");
}, _findButtonByClickScript: function (b, j) {
var a = null;
var d = b.getElementsByTagName("img");
for (var c = 0, h = d.length;
c < h;
c++) {
var e = d[c];
if (e.onclick != null && e.onclick.toString().indexOf(j) != -1) {
a = e;
break;
}
}
var g = b.getElementsByTagName("input");
for (var c = 0, h = g.length;
c < h;
c++) {
var f = g[c];
if (f.onclick != null && f.onclick.toString().indexOf(j) != -1) {
a = f;
break;
}
}
return a;
}, editItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Edit", a)) {
return false;
}
}, updateItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Update", a)) {
return false;
}
}, deleteItem: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("Delete", a)) {
return false;
}
}, rebind: function () {
this._forceRebind = true;
if (!this.fireCommand("RebindGrid", "")) {
return false;
}
}, insertItem: function () {
if (!this.fireCommand("PerformInsert", "")) {
return false;
}
}, showInsertItem: function () {
if (!this.fireCommand("InitInsert", "")) {
return false;
}
}, cancelInsert: function () {
if (!this.fireCommand("CancelInsert", "")) {
return false;
}
}, sort: function (b) {
var f = new Telerik.Web.UI.GridSortExpression();
var c = b.split(" ")[0];
var g = Telerik.Web.UI.GridSortOrder.Ascending;
var a = -1;
var d = this._sortExpressions.find(c);
if (d != null) {
a = d.get_sortOrder();
}
if (b.toUpperCase().indexOf(" ASC") != -1) {
g = Telerik.Web.UI.GridSortOrder.Ascending;
} else {
if (b.toUpperCase().indexOf(" DESC") != -1) {
g = Telerik.Web.UI.GridSortOrder.Descending;
} else {
if (d != null) {
if (a == Telerik.Web.UI.GridSortOrder.None) {
g = Telerik.Web.UI.GridSortOrder.Ascending;
} else {
if (a == Telerik.Web.UI.GridSortOrder.Ascending) {
g = Telerik.Web.UI.GridSortOrder.Descending;
} else {
if (this.get_allowNaturalSort()) {
g = Telerik.Web.UI.GridSortOrder.None;
} else {
g = Telerik.Web.UI.GridSortOrder.Ascending;
}
}
}
} else {
g = Telerik.Web.UI.GridSortOrder.Ascending;
}
}
}
if (d != null) {
this._sortExpressions.remove(d);
}
if (!this.get_allowMultiColumnSorting()) {
for (var e = 0;
e < this._sortExpressions._array.length;
e++) {
this._showSortIconForField(this._sortExpressions._array[e].get_fieldName(), Telerik.Web.UI.GridSortOrder.None);
}
this._sortExpressions.clear();
}
if (g != a) {
this._showSortIconForField(c, g);
}
if (g != Telerik.Web.UI.GridSortOrder.None) {
f.set_fieldName(c);
f.set_sortOrder(g);
this._sortExpressions.add(f);
}
if (!this.fireCommand("Sort", b)) {
return false;
}
}, _showSortIconForField: function (f, g) {
if (!f || f == "") {
return;
}
if (typeof g == "undefined") {
return;
}
var b = g == Telerik.Web.UI.GridSortOrder.Ascending ? "" : "none";
var e = g == Telerik.Web.UI.GridSortOrder.Descending ? "" : "none";
var d = this.get_columns();
for (var c = 0;
c < d.length;
c++) {
if (d[c]._data.SortExpression == f) {
var a = $telerik.getChildrenByClassName(d[c].get_element(), "rgSort");
if (a && a.length > 1) {
a[0].style.display = b;
a[1].style.display = e;
}
}
}
}, clearSort: function (b) {
if (!b) {
var a = this.get_sortExpressions();
for (var c = 0;
c < a.get_count();
c++) {
this._showSortIconForField(a.getItem(c).get_fieldName(), Telerik.Web.UI.GridSortOrder.None);
}
this.get_sortExpressions().clear();
return this.fireCommand("ClearSort", "");
}
var d = this.get_sortExpressions().find(b);
if (d) {
this._showSortIconForField(b, Telerik.Web.UI.GridSortOrder.None);
this.get_sortExpressions().remove(d);
}
return this.fireCommand("ClearSort", b);
}, get_sortExpressions: function () {
return this._sortExpressions;
}, filter: function (b, m, g, l, j) {
var f = new Telerik.Web.UI.GridFilterExpression(), e = "rgFiltered", d = $telerik.getElementByClassName(this._getFilterCellByColumnUniqueName(b), "rgFilter");
var a = this.getColumnByUniqueName(b);
if (!a) {
return;
}
this._owner._resetCheckListFilterOfColumn(a);
var i = false;
if (typeof(g) == "undefined") {
g = a.get_filterFunction();
i = true;
} else {
if (typeof(g) == "string") {
a.set_filterFunction(g);
}
}
if (((typeof(g) == "number" && Telerik.Web.UI.GridFilterFunction.NoFilter == g) || (typeof(g) == "string" && Telerik.Web.UI.GridFilterFunction.parse(g) == Telerik.Web.UI.GridFilterFunction.NoFilter)) && (a.get_filterDelay() != null || (m != null && m !== "" && i))) {
if (a._data.Acff && a._data.Acff != "NoFilter") {
g = a._data.Acff;
} else {
g = (a.get_dataType() == "System.String") ? "Contains" : "EqualTo";
}
if (a._data.EnableRangeFiltering) {
g = "Between";
}
}
if (d) {
if (g === "NoFilter" || m === "") {
Sys.UI.DomElement.removeCssClass(d, e);
} else {
if (d.className.indexOf(e) < 0) {
Sys.UI.DomElement.addCssClass(d, e);
}
}
}
var c = "";
switch (a._data.ColumnType) {
case"GridHyperLinkColumn":
c = a._data.DataTextField;
break;
case"GridImageColumn":
c = a._data.DataAlternateTextField;
break;
case"GridBinaryImageColumn":
c = a._data.DataAlternateTextField;
break;
case"GridCalculatedColumn":
c = String.format("{0}Result", a._data.UniqueName);
break;
case"GridAttachmentColumn":
c = a._data.DataTextField + "" != "" ? a._data.DataTextField : a._data.FileNameTextField;
break;
default:
c = a._data.DataField;
break;
}
if (l) {
this._updateFilterControlValue(m, b, g);
}
f.set_fieldName(c);
f.set_columnUniqueName(b);
f.set_dataTypeName(a._data.DataTypeName);
if (m && m.replace) {
m = m.replace(/'/g, "\\'");
}
var h = this._filterExpressions.find(f.get_columnUniqueName());
if (h != null && !j) {
if (Telerik.Web.UI.GridFilterFunction.parse(g) == Telerik.Web.UI.GridFilterFunction.NoFilter) {
this._filterExpressions.remove(h);
}
h.set_filterFunction(g);
h.set_fieldValue(m);
} else {
f.set_filterFunction(g);
f.set_fieldValue(m);
this._filterExpressions.add(f);
}
this.set_currentPageIndex(0, true);
if (m && m.indexOf && m.replace) {
if (m.indexOf(";") != -1) {
m = m.replace(/;/g, "^#");
}
if (m.indexOf("\\") != -1) {
m = m.replace(/\\/g, "\\\\");
}
}
if (!j) {
if (!this.fireCommand("Filter", b + "|?" + m + "|?" + g)) {
var k = ("NoFilter" == g);
if (k && a._data.ColumnType == "GridDateTimeColumn") {
this._updateFilterControlValue(m, b, g);
}
return false;
}
}
}, _updateFilterControlValue: function (i, b, f) {
var h = Array.contains(["NoFilter", "IsNull", "NotIsNull", "IsEmpty", "NotIsEmpty"], f);
var e = this._getFilterCellByColumnUniqueName(b);
var g = e.getElementsByTagName("input")[0];
if (!g) {
return;
}
var a = this.getColumnByUniqueName(b);
if (typeof i == "object" && i === null) {
i = "";
}
if (a && a._data.ColumnType == "GridDateTimeColumn") {
var d = $find(g.id);
if (d && (Object.getType(d).getName() == "Telerik.Web.UI.RadDateTimePicker" || Object.getType(d).getName() == "Telerik.Web.UI.RadDatePicker")) {
if (h) {
d.get_dateInput().clear();
} else {
if (typeof i == "string") {
d.set_selectedDate(new Date(i));
} else {
d.set_selectedDate(i);
}
}
} else {
if (!d) {
d = $find(g.id.replace("_text", ""));
if (d && Object.getType(d).getName() == "Telerik.Web.UI.RadDateInput") {
if (h) {
d.clear();
} else {
if (typeof i == "string") {
d.set_selectedDate(new Date(i));
} else {
d.set_selectedDate(i);
}
}
}
}
}
} else {
if (a && a._data.ColumnType == "GridNumericColumn") {
var c = $find(g.id.replace("_text", ""));
if (c && Object.getType(c).getName() == "Telerik.Web.UI.RadNumericTextBox") {
if (h) {
c.clear();
} else {
c.set_value(i);
}
}
} else {
if (g.type && g.type == "checkbox") {
g.checked = (h) ? false : !!i;
} else {
if (g.type && g.type == "text") {
g.value = (h) ? "" : i;
}
}
}
}
}, _getFilterControlValue: function (a) {
var d = this._getFilterControlValueByIndex(a, 0);
if (this.getColumnByUniqueName(a)._data.EnableRangeFiltering) {
var c = this._getFilterCellByColumnUniqueName(a);
var b;
var e = $telerik.findControl(c, String.format("RDIPF2{0}", a));
if (e) {
b = e.get_dateInput();
} else {
b = $telerik.findControl(c, String.format("RDIF2{0}", a));
}
var f = b.get_value();
if (d == null || d == "" || f == null || f == "") {
return null;
}
d = d.replace(/\s/g, ",");
f = f.replace(/\s/g, ",");
d += " " + f;
}
return d;
}, _getFilterControlValueByIndex: function (a, e, f) {
var c = this._getFilterCellByColumnUniqueName(a);
var d = c.getElementsByTagName("input")[e];
if (!d) {
return null;
}
if (d.type == "checkbox") {
return d.checked;
}
var b = d.id.endsWith("_text") ? $find(d.id.substr(0, d.id.length - 5)) : d.id.endsWith("_ClientState") ? $find(d.id.substr(0, d.id.length - 12)) : d.id.endsWith("_Input") ? $find(d.id.substr(0, d.id.length - 6)) : $find(d.id);
if (b) {
switch (Object.getType(b).getName()) {
case"Telerik.Web.UI.RadAutoCompleteBox":
return b.get_text();
case"Telerik.Web.UI.RadDatePicker":
case"Telerik.Web.UI.RadDateTimePicker":
case"Telerik.Web.UI.RadTimePicker":
return b.get_dateInput().get_value();
default:
if (typeof(b.get_value) === "function") {
return b.get_value();
}
}
}
if (f && !b) {
return null;
}
return d.value;
}, _rangeValidationHandler: function (i, e, b) {
if (this._rangeValidationInProcess) {
return;
}
this._rangeValidationInProcess = true;
var f = this._getFilterCellByColumnUniqueName(b);
var d = $telerik.findControl(f, String.format("RDIPF{0}", b));
var c;
var g;
if (d) {
c = d.get_dateInput();
var h = $telerik.findControl(f, String.format("RDIPF2{0}", b));
g = h.get_dateInput();
} else {
c = $telerik.findControl(f, String.format("RDIF{0}", b));
g = $telerik.findControl(f, String.format("RDIF2{0}", b));
}
if (Telerik.Web.UI.DatePickerPopupOpeningEventArgs.isInstanceOfType(e)) {
this._setControlsRangeValidation(i, d, h);
} else {
if (Telerik.Web.UI.DatePickerPopupClosingEventArgs.isInstanceOfType(e)) {
this._clearControlsRangeValidation(d, h);
} else {
if (Telerik.Web.UI.InputValueChangingEventArgs.isInstanceOfType(e)) {
var a = true;
if (d.get_dateInput && i.get_id() === d.get_dateInput().get_id()) {
if (!e.get_newValue() || !g.get_selectedDate()) {
a = false;
}
} else {
if (!d.get_selectedDate() || !e.get_newValue()) {
a = false;
}
}
this._shouldAutoPostBackOnFilter = a;
this._setControlsRangeValidation(i, c, g);
} else {
if (Telerik.Web.UI.DateInputValueChangedEventArgs.isInstanceOfType(e)) {
this._clearControlsRangeValidation(c, g);
}
}
}
}
this._rangeValidationInProcess = false;
}, _getFilterCellByColumnUniqueName: function (a) {
var b = this._getTableFilterRow();
if (!b) {
return null;
}
var c = this._getCellIndexByColumnUniqueNameFromTableRowElement(b, a);
if (c == null) {
return null;
}
return b.cells[c];
}, _setControlsRangeValidation: function (e, a, c) {
this._clearControlsRangeValidation(a, c);
if (e.get_id() === a.get_id()) {
var d = c.get_selectedDate();
if (d) {
e.set_maxDate(c.get_selectedDate());
} else {
if (c.set_value) {
c.set_value(c.get_textBoxValue());
}
}
} else {
if (e.get_id() === c.get_id()) {
var b = a.get_selectedDate();
if (b) {
c.set_minDate(b);
} else {
if (a.set_value) {
a.set_value(a.get_textBoxValue());
}
}
}
}
}, _clearControlsRangeValidation: function (a, d) {
var c = new Date(1900, 1, 1);
var b = new Date(2099, 12, 31);
a.set_maxDate(b);
d.set_minDate(c);
}, clearSelectedColumns: function () {
var a = this.get_columns();
for (var b = 0;
b < a.length;
b++) {
if (a[b].get_selected()) {
a[b].set_selected(false);
}
}
}, clearFilter: function (b) {
if (!b) {
for (var e = 0;
e < this._filterExpressions.get_count();
e++) {
var c = this._filterExpressions.getItem(e);
this._updateFilterControlValue(null, c.get_columnUniqueName(), Telerik.Web.UI.GridFilterFunction.NoFilter);
var a = this.getColumnByUniqueName(c.get_columnUniqueName());
if (a) {
a.set_filterFunction("NoFilter");
}
}
this._filterExpressions.clear();
return this.fireCommand("ClearFilter", "");
}
var a = this.getColumnByUniqueName(b);
if (!a) {
return false;
}
var d = this._filterExpressions.find(b);
if (!d) {
d = new Telerik.Web.UI.GridFilterExpression();
d.set_columnUniqueName(b);
d.set_filterFunction("NoFilter");
this._filterExpressions.add(d);
}
return this.filter(b, "", "NoFilter", true);
}, get_filterExpressions: function () {
return this._filterExpressions;
}, page: function (a) {
var c = this.get_currentPageIndex();
var b = c;
if (a == "Next") {
b++;
} else {
if (a == "Prev") {
b--;
} else {
if (a == "First") {
b = 0;
} else {
if (a == "Last") {
b = this.get_pageCount() - 1;
} else {
b = parseInt(a) - 1;
}
}
}
}
if (b < 0 || b > (this.get_pageCount() - 1)) {
return false;
}
this.set_currentPageIndex(b, true);
if (!this.fireCommand("Page", a)) {
if (this._preventUpdatePager) {
this.set_currentPageIndex(c, true);
this._preventUpdatePager = false;
}
return false;
}
}, exportToExcel: function () {
if (!this.fireCommand("ExportToExcel", "")) {
return false;
}
}, exportToWord: function () {
if (!this.fireCommand("ExportToWord", "")) {
return false;
}
}, exportToCsv: function () {
if (!this.fireCommand("ExportToCsv", "")) {
return false;
}
}, exportToPdf: function () {
if (!this.fireCommand("ExportToPdf", "")) {
return false;
}
}, editSelectedItems: function () {
if (!this.fireCommand("EditSelected", "")) {
return false;
}
}, updateEditedItems: function () {
if (!this.fireCommand("UpdateEdited", "")) {
return false;
}
}, deleteSelectedItems: function () {
if (!this.fireCommand("DeleteSelected", "")) {
return false;
}
}, editAllItems: function () {
if (!this.fireCommand("EditAll", "")) {
return false;
}
}, cancelAll: function () {
if (!this.fireCommand("CancelAll", "")) {
return false;
}
}, cancelUpdate: function (b) {
b = this._getRowByIndexOrItemIndexHierarchical(b);
var a = b.id.split("__")[1];
if (!this.fireCommand("CancelUpdate", a)) {
return false;
}
}, groupColumn: function (a) {
if (!this.fireCommand("GroupByColumn", a)) {
return false;
}
}, ungroupColumn: function (a) {
if (!this.fireCommand("UnGroupByColumn", a)) {
return false;
}
}, _ungroupByExpression: function (a) {
if (!this.fireCommand("UnGroupByExpression", a)) {
return false;
}
}, _deleteRow: function (d, c) {
var g = d.parentNode.parentNode, b = $find(d.id), e = d.rowIndex, a = d.cells.length, f;
g.deleteRow(e);
f = g.rows[e];
while (f && f.style.display !== "none" && f.cells.length !== a && !Sys.UI.DomElement.containsCssClass(f, "rgGroupHeader")) {
g.deleteRow(e);
e++;
f = g.rows[e];
}
if (g.tBodies[0].rows.length === 1 && g.tBodies[0].rows[0].style.display == "none") {
g.tBodies[0].rows[0].style.display = "";
}
this.deselectItem(d);
Array.add(this._owner._deletedItems, c);
if (b) {
b.dispose();
Array.remove(this._dataItems, b);
}
this._fixRowsClassNames();
}, _clientDelete: function (c) {
var b = Telerik.Web.UI.Grid.GetCurrentElement(c), f = b.parentNode.parentNode, d = f.id.split("__")[1], a = new Telerik.Web.UI.GridDataItemCancelEventArgs(f, c);
this._owner.raise_rowDeleting(a);
if (a.get_cancel()) {
return false;
}
if (this._owner.get_events().getHandler("command") != null) {
this.fireCommand("Delete", d);
}
this._deleteRow(f, d);
this._owner.raise_rowDeleted(new Telerik.Web.UI.GridDataItemEventArgs(f, c));
this._owner.updateClientState();
}, fireCommand: function (b, a) {
if (this._raiseCommandEvent(b, a)) {
this._executePostBackEvent("FireCommand:" + this._data.UniqueID + ";" + b + ";" + a);
}
}, _raiseCommandEvent: function (c, b) {
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
var d = this;
a.get_tableView = function () {
return d;
};
this._owner.raise_command(a);
if (a.get_cancel()) {
return false;
}
return true;
}, _executePostBackEvent: function (a) {
var b = this._owner.ClientSettings.PostBackFunction;
b = b.replace("{0}", this._owner.UniqueID);
b = b.replace("{1}", a);
eval(b);
}, _raiseAction: function (a, b) {
var e = this, c = new Sys.CancelEventArgs(), d;
if (b) {
for (d in b) {
(function (f) {
c["_" + f] = b[f];
c["get_" + f] = function () {
return b[f];
};
c["set_" + f] = function (g) {
b[f] = g;
};
})(d);
}
}
c.get_actionName = function () {
return a;
};
c.get_tableView = function () {
return e;
};
e._owner.raise_userAction(c);
return c;
}
};
Telerik.Web.UI.GridTableView.registerClass("Telerik.Web.UI.GridTableView", Sys.UI.Control);
Telerik.Web.UI.GridFilterFunction = function () {
};
Telerik.Web.UI.GridFilterFunction.prototype = {
NoFilter: 0,
Contains: 1,
DoesNotContain: 2,
StartsWith: 3,
EndsWith: 4,
EqualTo: 5,
NotEqualTo: 6,
GreaterThan: 7,
LessThan: 8,
GreaterThanOrEqualTo: 9,
LessThanOrEqualTo: 10,
Between: 11,
NotBetween: 12,
IsEmpty: 13,
NotIsEmpty: 14,
IsNull: 15,
NotIsNull: 16,
Custom: 17
};
Telerik.Web.UI.GridFilterFunction.registerEnum("Telerik.Web.UI.GridFilterFunction", false);
Telerik.Web.UI.GridFilterFunction._wrapMethod = function (a, c, d) {
var b = a[c];
a[c] = function () {
var e = Array.prototype.slice.call(arguments);
var f = function () {
return b.apply(a, e);
};
return d.apply(a, [f].concat(e));
};
};
Telerik.Web.UI.GridFilterFunction._enumParseMethod = function (b, c, a) {
return (typeof c == "number") ? resolvedValue = c : b(c, !!a);
};
Telerik.Web.UI.GridFilterFunction._wrapMethod(Telerik.Web.UI.GridFilterFunction, "parse", Telerik.Web.UI.GridFilterFunction._enumParseMethod);
Telerik.Web.UI.GridSortOrder = function () {
};
Telerik.Web.UI.GridSortOrder.prototype = {None: 0, Ascending: 1, Descending: 2};
Telerik.Web.UI.GridSortOrder.registerEnum("Telerik.Web.UI.GridSortOrder", false);
Telerik.Web.UI.GridSortExpression = function () {
this._fieldName = "";
this._sortOrder = null;
};
Telerik.Web.UI.GridSortExpression.prototype = {
get_fieldName: function () {
return this._fieldName;
}, set_fieldName: function (a) {
if (this._fieldName != a) {
this._fieldName = a;
this.FieldName = a;
}
}, get_sortOrder: function () {
return this._sortOrder;
}, set_sortOrder: function (a) {
if (this._sortOrder != a) {
this._sortOrder = a;
this.SortOrder = a;
}
}, dispose: function () {
this._fieldName = null;
this._sortOrder = null;
}
};
Telerik.Web.UI.GridSortExpression.registerClass("Telerik.Web.UI.GridSortExpression", null, Sys.IDisposable);
Telerik.Web.UI.GridFilterFunctionsOqlFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "{0} LIKE '*{1}*'";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "NOT ({0} LIKE '*{1}*'";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "{0} LIKE '{1}*'";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "{0} LIKE '*{1}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} = {1}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} <> {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} > {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} < {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} >= {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} <= {1}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} >= {1}) AND ({0} <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} < {1}) OR ({0} > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "{0} = ''";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "{0} <> ''";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} == nil";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "({0} != nil)";
return a;
};
Telerik.Web.UI.GridFilterFunctionsSqlFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "[{0}] LIKE '%{1}%'";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "[{0}] NOT LIKE '%{1}%'";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "[{0}] LIKE '{1}%'";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "[{0}] LIKE '%{1}'";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "[{0}] = {1}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "[{0}] <> {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "[{0}] > {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "[{0}] < {1}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "[{0}] >= {1}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "[{0}] <= {1}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "([{0}] >= {1}) AND ([{0}] <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "([{0}] < {1}) OR ([{0}] > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "[{0}] = ''";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "[{0}] <> ''";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "[{0}] IS NULL";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "NOT ([{0}] IS NULL)";
return a;
};
Telerik.Web.UI.GridFilterFunctionsDynamicLinqFormat = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "{0}.Contains({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "!{0}.Contains({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "{0}.StartsWith({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "{0}.EndsWith({1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} = {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} <> {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} > {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} < {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} >= {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} <= {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} >= {1}) AND ({0} <= {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} < {1}) OR ({0} > {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = '{0} = ""{1}{2}';
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = '{0} <> ""{1}{2}';
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} == null{1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "({0} != null){1}{2}";
return a;
};
Telerik.Web.UI.GridFilterFunctionsADONetDataServices = function () {
var a = {};
a[Telerik.Web.UI.GridFilterFunction.Contains] = "substringof({1},{0}){2}";
a[Telerik.Web.UI.GridFilterFunction.DoesNotContain] = "not substringof({1},{0}){2}";
a[Telerik.Web.UI.GridFilterFunction.StartsWith] = "startswith({0},{1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EndsWith] = "endswith({0},{1}){2}";
a[Telerik.Web.UI.GridFilterFunction.EqualTo] = "{0} eq {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.NotEqualTo] = "{0} ne {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThan] = "{0} gt {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThan] = "{0} lt {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo] = "{0} ge {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo] = "{0} le {1}{2}";
a[Telerik.Web.UI.GridFilterFunction.Between] = "({0} ge {1} and {0} le {2})";
a[Telerik.Web.UI.GridFilterFunction.NotBetween] = "({0} le {1} or {0} ge {2})";
a[Telerik.Web.UI.GridFilterFunction.IsEmpty] = "{0} eq ''{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsEmpty] = "{0} ne ''{2}";
a[Telerik.Web.UI.GridFilterFunction.IsNull] = "{0} eq null{2}";
a[Telerik.Web.UI.GridFilterFunction.NotIsNull] = "{0} ne null{2}";
return a;
};
Telerik.Web.UI.GridFilterExpression = function () {
this._fieldName = "";
this._fieldValue = null;
this._filterFunction = null;
this._columnUniqueName = null;
this._dataTypeName = null;
};
Telerik.Web.UI.GridFilterExpression.prototype = {
get_columnUniqueName: function () {
return this._columnUniqueName;
}, set_columnUniqueName: function (a) {
if (this._columnUniqueName != a) {
this._columnUniqueName = a;
this.ColumnUniqueName = a;
}
}, get_fieldName: function () {
return this._fieldName;
}, set_fieldName: function (a) {
if (this._fieldName != a) {
this._fieldName = a;
this.FieldName = a;
}
}, get_fieldValue: function () {
return this._fieldValue;
}, set_fieldValue: function (a) {
if (this._fieldValue != a) {
this._fieldValue = a;
this.FieldValue = a;
}
}, get_filterFunction: function () {
return this._filterFunction;
}, set_filterFunction: function (a) {
if (this._filterFunction != a) {
this._filterFunction = a;
this.FilterFunction = a;
}
}, get_dataTypeName: function () {
return this._dataTypeName;
}, set_dataTypeName: function (a) {
if (this._dataTypeName != a) {
this._dataTypeName = a;
this.DataTypeName = a;
}
}, toString: function (g) {
var e = "";
if (typeof(g) != "undefined") {
e = g;
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
var i = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsSqlFormat();
var h = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[h];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && h == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var i = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getQuotedValue(this._checkListFilterValues[a]);
i[i.length] = String.format(c, this._fieldName, f, "");
}
return "(" + i.join(" OR ") + ")";
} else {
if (h != Telerik.Web.UI.GridFilterFunction.Between && h != Telerik.Web.UI.GridFilterFunction.NotBetween) {
if ((this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") && h == Telerik.Web.UI.GridFilterFunction.Contains || h == Telerik.Web.UI.GridFilterFunction.DoesNotContain || h == Telerik.Web.UI.GridFilterFunction.StartsWith || h == Telerik.Web.UI.GridFilterFunction.EndsWith) {
i = String.format(c, b, this._fieldValue);
} else {
i = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
} else {
var j = this._fieldValue.split(" ")[0];
var k = (this._fieldValue.split(" ").length > 0) ? this._fieldValue.split(" ")[1] : "";
i = String.format(c, b, this.getQuotedValue(j), this.getQuotedValue(k));
}
}
}
}
return i;
}, toOql: function (g) {
var e = "";
if (typeof(g) != "undefined") {
e = g;
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
var i = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsOqlFormat();
var h = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[h];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && h == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var i = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getQuotedValue(this._checkListFilterValues[a]);
i[i.length] = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
return "(" + i.join(" OR ") + ")";
} else {
if (h != Telerik.Web.UI.GridFilterFunction.Between && h != Telerik.Web.UI.GridFilterFunction.NotBetween) {
if ((this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") && h == Telerik.Web.UI.GridFilterFunction.Contains || h == Telerik.Web.UI.GridFilterFunction.DoesNotContain || h == Telerik.Web.UI.GridFilterFunction.StartsWith || h == Telerik.Web.UI.GridFilterFunction.EndsWith) {
i = String.format(c, b, this._fieldValue);
} else {
i = String.format(c, b, this.getQuotedValue(this._fieldValue));
}
} else {
var j = this._fieldValue.split(" ")[0];
var k = (this._fieldValue.split(" ").length > 0) ? this._fieldValue.split(" ")[1] : "";
i = String.format(c, b, this.getQuotedValue(j), this.getQuotedValue(k));
}
}
}
}
return i;
}, getQuotedValue: function (a) {
if (this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char" || this.get_dataTypeName() == "System.DateTime" || this.get_dataTypeName() == "System.TimeSpan" || this.get_dataTypeName() == "System.Guid") {
return String.format("'{0}'", a);
}
return a;
}, getDataServiceValue: function (a) {
if (this.get_dataTypeName() == "System.String" || this.get_dataTypeName() == "System.Char") {
return String.format("'{0}'", a);
} else {
if (this.get_dataTypeName() == "System.DateTime") {
return String.format("datetime'{0}'", new Date(a).format("yyyy-MM-ddThh:mm:ss"));
} else {
if (this.get_dataTypeName() == "System.TimeSpan") {
return String.format("time'{0}'", a);
} else {
if (this.get_dataTypeName() == "System.Guid") {
return String.format("guid'{0}'", a);
}
}
}
}
return a;
}, getDynamicLinqValue: function (a) {
if (this.get_dataTypeName() == "System.String") {
return String.format('"{0}"', a);
} else {
if (this.get_dataTypeName().indexOf("DateTime") != -1) {
return String.format('DateTime.Parse("{0}")', a);
} else {
if (this.get_dataTypeName().indexOf("TimeSpan") != -1) {
return String.format('TimeSpan.Parse("{0}")', a);
} else {
if (this.get_dataTypeName().indexOf("Guid") != -1) {
return String.format('Guid({0}")', a);
}
}
}
}
return a;
}, toDynamicLinq: function (h) {
var e = "";
if (typeof(h) != "undefined") {
e = h;
}
var j = "";
if (this._filterFunction != null) {
var d = Telerik.Web.UI.GridFilterFunctionsDynamicLinqFormat();
var i = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var c = d[i];
if (c != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && i == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var j = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
var f = this.getDynamicLinqValue(this._checkListFilterValues[a]);
j[j.length] = String.format(c, this._fieldName, f, "");
}
return "(" + j.join(" OR ") + ")";
} else {
var f = "";
var g = "";
if (i == Telerik.Web.UI.GridFilterFunction.IsNull || i == Telerik.Web.UI.GridFilterFunction.NotIsNull) {
f = "";
} else {
if (i == Telerik.Web.UI.GridFilterFunction.Between || i == Telerik.Web.UI.GridFilterFunction.NotBetween) {
g = this.getDynamicLinqValue(this._fieldValue.split(" ")[1]);
f = this.getDynamicLinqValue(this._fieldValue.split(" ")[0]);
} else {
f = this.getDynamicLinqValue(this._fieldValue);
}
}
var b = this._fieldName;
if (e != "") {
b = String.format("{0}.{1}", e, b);
}
j = String.format(c, b, f, g);
}
}
}
return j;
}, toDataService: function () {
var g = "";
if (this._filterFunction != null) {
var c = Telerik.Web.UI.GridFilterFunctionsADONetDataServices();
var f = Telerik.Web.UI.GridFilterFunction.parse(this._filterFunction);
var b = c[f];
if (b != null) {
if (this._checkListFilterValues && this._checkListFilterValues.length > 0 && f == Telerik.Web.UI.GridFilterFunction.EqualTo) {
var g = [];
for (var a = 0;
a < this._checkListFilterValues.length;
a++) {
g[g.length] = String.format(b, this._fieldName, this.getDataServiceValue(this._checkListFilterValues[a]));
}
return "(" + g.join(" or ") + ")";
} else {
var d = "";
var e = "";
if (f == Telerik.Web.UI.GridFilterFunction.IsNull || f == Telerik.Web.UI.GridFilterFunction.NotIsNull) {
d = "";
} else {
if (f == Telerik.Web.UI.GridFilterFunction.Between || f == Telerik.Web.UI.GridFilterFunction.NotBetween) {
e = this._fieldValue.split(" ")[1];
d = this._fieldValue.split(" ")[0];
} else {
d = this._fieldValue;
}
}
g = String.format(b, this._fieldName, this.getDataServiceValue(d), (e != "") ? this.getDataServiceValue(e) : e);
}
}
}
return g;
}, dispose: function () {
this._fieldName = null;
this._fieldValue = null;
this._filterFunction = null;
this._columnUniqueName = null;
this._dataTypeName = null;
}
};
Telerik.Web.UI.GridFilterExpression.registerClass("Telerik.Web.UI.GridFilterExpression", null, Sys.IDisposable);
Telerik.Web.UI.Collection = function () {
this._array = new Array();
};
Telerik.Web.UI.Collection.prototype = {
add: function (b) {
var a = this._array.length;
this.insert(a, b);
}, insert: function (a, b) {
Array.insert(this._array, a, b);
}, remove: function (a) {
Array.remove(this._array, a);
}, removeAt: function (a) {
var b = this.getItem(a);
if (b) {
this.remove(b);
}
}, clear: function () {
this._array = new Array();
}, toList: function () {
return this._array;
}, get_count: function () {
return this._array.length;
}, getItem: function (a) {
return this._array[a];
}, indexOf: function (a) {
return Array.indexOf(this._array, a);
}, forEach: function (c) {
for (var b = 0, a = this.get_count();
b < a;
b++) {
c(this._array[b]);
}
}, dispose: function () {
this._array = null;
}
};
Telerik.Web.UI.Collection.registerClass("Telerik.Web.UI.Collection", null, Sys.IDisposable);
Telerik.Web.UI.GridSortExpressions = function () {
Telerik.Web.UI.GridSortExpressions.initializeBase(this);
};
Telerik.Web.UI.GridSortExpressions.prototype = {
find: function (b) {
for (var c = 0, a = this.get_count();
c < a;
c++) {
var d = this.getItem(c);
if (d.get_fieldName() == b) {
return d;
}
}
return null;
}, sortOrderAsString: function (a) {
if (a == 0) {
return "";
} else {
if (a == 1) {
return "ASC";
} else {
if (a == 2) {
return "DESC";
}
}
}
}, toString: function () {
var d = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var c = this.getItem(b);
d[d.length] = String.format("{0} {1}", c.get_fieldName(), this.sortOrderAsString(c.get_sortOrder()));
}
return d.join(",");
}, toClientDataSourceList: function () {
var a = [];
Array.forEach(this._array, function (c, b) {
a[b] = {fieldName: c.FieldName, sortOrder: c.SortOrder};
});
return a;
}
};
Telerik.Web.UI.GridSortExpressions.registerClass("Telerik.Web.UI.GridSortExpressions", Telerik.Web.UI.Collection);
Telerik.Web.UI.GridFilterExpressions = function () {
Telerik.Web.UI.GridFilterExpressions.initializeBase(this);
};
Telerik.Web.UI.GridFilterExpressions.prototype = {
find: function (a) {
for (var c = 0, b = this.get_count();
c < b;
c++) {
var d = this.getItem(c);
if (d.get_columnUniqueName() == a) {
return d;
}
}
return null;
}, toString: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toString(c);
}
return f.join(" AND ");
}, toOql: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toOql(c);
}
return f.join(" AND ");
}, toDynamicLinq: function (e) {
var c = "";
if (typeof(e) != "undefined") {
c = e;
}
var f = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var d = this.getItem(b);
f[f.length] = d.toDynamicLinq(c);
}
return f.join(" AND ");
}, toDataService: function () {
var d = [];
for (var b = 0, a = this.get_count();
b < a;
b++) {
var c = this.getItem(b);
d[d.length] = c.toDataService();
}
return d.join(" and ");
}, toClientDataSourceList: function () {
var a = [];
Array.forEach(this._array, function (c, b) {
if (c.FilterFunction != "NoFilter") {
a[b] = {
field: c.FieldName,
operator: Telerik.Web.UI.ClientDataSource.FilterOperator[c.FilterFunction],
value: c.FieldValue
};
}
});
return {logicOperator: Telerik.Web.UI.ClientDataSource.FilterLogicOperator.And, filters: a};
}
};
Telerik.Web.UI.GridFilterExpressions.registerClass("Telerik.Web.UI.GridFilterExpressions", Telerik.Web.UI.Collection);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridGroupPanel = function (a) {
Telerik.Web.UI.GridGroupPanel.initializeBase(this, [a]);
this._owner = {};
};
Telerik.Web.UI.GridGroupPanel.prototype = {
initialize: function () {
Telerik.Web.UI.GridGroupPanel.callBaseMethod(this, "initialize");
this.groupPanelItemCounter = 0;
this._createGroupPanelItems(this.get_element(), 0);
this._initializeEvents();
}, dispose: function () {
$clearHandlers(this.get_element());
this._element.control = null;
this._groupTouchItems = [];
Telerik.Web.UI.GridGroupPanel.callBaseMethod(this, "dispose");
}, _initializeEvents: function () {
if (this._owner._clientDataSourceID) {
$addHandler(this.get_element(), "click", Function.createDelegate(this, this._click));
}
}, _click: function (b) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (Sys.UI.DomElement.containsCssClass(d, "rgUngroup")) {
this._ungroup(d);
} else {
if (Sys.UI.DomElement.containsCssClass(d, "rgSortAsc") || Sys.UI.DomElement.containsCssClass(d, "rgSortDesc")) {
var a = d.parentNode;
var c = "";
c = this._getFieldNameFromTarget(a);
d.className = d.className.indexOf("rgSortAsc") > -1 ? "rgSortDesc" : "rgSortAsc";
d.title = d.className.indexOf("rgSortAsc") > -1 ? "Sorted asc" : "Sorted desc";
this._sort(c);
$telerik.preventDefault(b);
}
}
}, _getFieldNameFromTarget: function (g) {
var e = $telerik.getElementsByClassName(this.get_element(), "rgGroupItem");
var d = null;
var a = "";
for (var f = 0;
f < e.length;
f++) {
var c = e[f];
if (c == g) {
d = f;
}
}
var b = this._owner.get_masterTableView()._data.GroupByExpressions;
if (d != null && d < b.length) {
a = b[d].field;
}
return a;
}, _sort: function (a) {
this._owner.get_masterTableView().fireCommand("SortGroup", a);
}, _ungroup: function (g) {
var a = g.parentNode, f = a.parentNode, d = f.parentNode.parentNode.parentNode, b = this._getFieldNameFromTarget(a), e = $telerik.previousElement(a), c = $telerik.nextElement(a);
this._owner.get_masterTableView().ungroupColumn(b);
if (e) {
f.removeChild(e);
} else {
if (c) {
f.removeChild(c);
}
}
f.removeChild(a);
if (f.cells.length <= 1) {
d.removeChild(d.childNodes[0]);
d.innerHTML = this._owner._groupPanelText;
}
}, _create: function (c, b) {
var g = this.get_element().getElementsByTagName("table"), f = g[g.length - 1], e = f.tBodies[0].rows[0], d = Telerik.Web.UI.GridGroupPanelItem.Create(this._owner, c, g.length != 1, b), a;
if (g.length == 1) {
f = document.createElement("table");
f.cellPadding = 2;
f.style.cssText = "border-style:None;width:100%;border-spacing:0;";
f.appendChild(document.createElement("tbody"));
e.cells[0].innerHTML = "";
e.cells[0].appendChild(f);
e = f.tBodies[0].appendChild(document.createElement("tr"));
e.appendChild(d);
a = document.createElement("td");
a.style.width = "100%";
e.appendChild(a);
} else {
e.insertBefore(d, e.cells[e.cells.length - 1]);
}
}, _createGroupPanelItems: function (h) {
this._itemsInternal = eval(this._owner._groupPanelItems);
this._items = [];
var g = h.tBodies[0].rows;
for (var d = 0;
d < g.length;
d++) {
var b = false;
var f = g[d];
for (var e = 0;
e < f.cells.length;
e++) {
var a = f.cells[e];
if (a.tagName.toLowerCase() == "th") {
var c;
if (this._itemsInternal[this.groupPanelItemCounter]) {
c = this._itemsInternal[this.groupPanelItemCounter].HierarchicalIndex;
}
if (c) {
this._items[this._items.length] = $create(Telerik.Web.UI.GridGroupPanelItem, {
_hierarchicalIndex: c,
_owner: this
}, null, null, a);
b = true;
this.groupPanelItemCounter++;
}
}
if ((a.firstChild) && (a.firstChild.tagName)) {
if (a.firstChild.tagName.toLowerCase() == "table") {
this._createGroupPanelItems(a.firstChild);
}
}
}
}
}, _isItem: function (a) {
for (var b = 0;
b < this._items.length;
b++) {
if (this._items[b].get_element() == a) {
return this._items[b];
}
}
return null;
}
};
Telerik.Web.UI.GridGroupPanel.registerClass("Telerik.Web.UI.GridGroupPanel", Sys.UI.Control);
Telerik.Web.UI.GridGroupPanelItem = function (a) {
Telerik.Web.UI.GridGroupPanelItem.initializeBase(this, [a]);
this._hierarchicalIndex = null;
this._owner = {};
this._dataField = null;
};
Telerik.Web.UI.GridGroupPanelItem.Create = function (g, e, a, c) {
g = $find(g.get_id());
var f = document.createDocumentFragment();
var b = document.createElement("th");
b.setAttribute("scope", "col");
b.title = g._unGroupTooltip || "Drag out of the bar to ungroup";
b.className = "rgGroupItem";
b.style.cssText = "white-space: nowrap; cursor: move;";
b.appendChild(document.createTextNode(e + " "));
var h = document.createElement("input");
h.setAttribute("type", "submit");
h.value = " ";
h.title = "Sorted asc";
h.className = "rgSortAsc";
b.appendChild(h);
if (g._showUnGroupButton) {
var i = document.createElement("input");
i.setAttribute("type", "submit");
i.title = g._unGroupButtonTooltip || "Click here to ungroup";
i.value = " ";
i.className = "rgUngroup";
b.appendChild(i);
}
if (a) {
var d = document.createElement("td");
d.innerHTML = "-";
f.appendChild(d);
}
f.appendChild(b);
g._groupPanel._items[g._groupPanel._items.length] = $create(Telerik.Web.UI.GridGroupPanelItem, {
_hierarchicalIndex: "0:" + (g.get_masterTableView()._data.GroupByExpressions.length - 1),
_owner: g._groupPanel,
_dataField: c
}, null, null, b);
return f;
};
Telerik.Web.UI.GridGroupPanelItem.prototype = {
initialize: function () {
Telerik.Web.UI.GridGroupPanelItem.callBaseMethod(this, "initialize");
this.get_element().style.cursor = "move";
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._onMouseDownHandler);
}, dispose: function () {
$clearHandlers(this.get_element());
this._element.control = null;
Telerik.Web.UI.GridGroupPanelItem.callBaseMethod(this, "dispose");
}, _onMouseDownHandler: function (a) {
this._onMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._onMouseUpHandler, null, true);
this._onMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._onMouseMoveHandler, null, true);
Telerik.Web.UI.Grid.CreateDragDrop(a, this, false);
Telerik.Web.UI.Grid.CreateReorderIndicators(this.get_element(), this._owner._owner.Skin, this._owner._owner.ImagesPath, false, this._owner._owner.get_id());
}, _onMouseUpHandler: function (b) {
$telerik.removeMobileHandler(document, "mouseup", this._onMouseUpDelegate, null, true);
$telerik.removeMobileHandler(document, "mousemove", this._onMouseMoveDelegate, null, true);
var d = this._fireDropAction(b);
var c = this._owner._owner;
var a = c.ClientSettings.Animation && c.ClientSettings.Animation.AllowColumnRevertAnimation;
if (a && !d) {
Telerik.Web.UI.Grid.AnimateRevertDragDrop(this, c.ClientSettings.Animation.ColumnRevertAnimationDuration);
} else {
Telerik.Web.UI.Grid.DestroyDragDrop();
}
}, _onMouseMoveHandler: function (a) {
if ($telerik.isTouchDevice) {
a.preventDefault();
}
Telerik.Web.UI.Grid.MoveDragDrop(a, this, false);
}, _fireDropAction: function (d) {
if ($telerik.isTouchDevice) {
currentElement = $telerik.getTouchTarget(d);
} else {
currentElement = Telerik.Web.UI.Grid.GetCurrentElement(d);
}
if (currentElement != null) {
var f = this._owner._owner;
var g = null;
var k = false;
var h = $telerik.getElementsByClassName(f.get_element(), "rgGroupItem", "th");
for (var j = 0;
j < h.length;
j++) {
if ($telerik.isMouseOverElement(h[j], d)) {
k = true;
g = h[j];
break;
}
}
if ($telerik.isMouseOverElement(this._owner.get_element(), d)) {
k = true;
}
var m = this._owner._owner.ClientSettings.PostBackFunction;
m = m.replace("{0}", this._owner._owner.UniqueID);
if (!k && (!(Telerik.Web.UI.Grid.IsChildOf(currentElement, this._owner.get_element()) || $telerik.isTouchDevice && currentElement == this._owner.get_element()))) {
var c = "UnGroupByExpression";
var b = this._hierarchicalIndex;
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
if (this._owner._owner._clientDataSourceID) {
a.set_cancel(true);
} else {
this._owner._owner.raise_command(a);
}
if (a.get_cancel()) {
if (this._owner._owner._clientDataSourceID) {
this._owner._ungroup(this.get_element().childNodes[0]);
}
return false;
}
m = m.replace("{1}", "UnGroupByExpression," + this._hierarchicalIndex);
eval(m);
return true;
} else {
var l = this._owner._isItem(currentElement);
if (l == null && g != null) {
currentElement = g;
l = this._owner._isItem(currentElement);
}
if ((currentElement != this.get_element()) && (l != null) && (currentElement.parentNode == this.get_element().parentNode)) {
var c = "ReorderGroupByExpression";
var b = this._hierarchicalIndex + "," + l._hierarchicalIndex;
var a = new Sys.CancelEventArgs();
a.get_commandName = function () {
return c;
};
a.get_commandArgument = function () {
return b;
};
this._owner._owner.raise_command(a);
if (a.get_cancel()) {
return false;
}
m = m.replace("{1}", "ReorderGroupByExpression," + this._hierarchicalIndex + "," + l._hierarchicalIndex);
eval(m);
return true;
}
}
}
return false;
}
};
Telerik.Web.UI.GridGroupPanelItem.registerClass("Telerik.Web.UI.GridGroupPanelItem", Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
$telerik.findGrid = $find;
$telerik.toGrid = function (a) {
return a;
};
Telerik.Web.UI.RadGrid = function (a) {
var b = ["gridCreating", "gridCreated", "gridDestroying", "masterTableViewCreating", "masterTableViewCreated", "tableCreating", "tableCreated", "tableDestroying", "cellDeselected", "cellDeselecting", "cellSelected", "cellSelecting", "columnCreating", "columnCreated", "columnDestroying", "columnResizing", "columnResized", "columnSwapping", "columnSwapped", "columnMovingToLeft", "columnMovedToLeft", "columnMovingToRight", "columnMovedToRight", "columnHiding", "columnHidden", "columnShowing", "columnShown", "rowCreating", "rowCreated", "rowDestroying", "rowResizing", "rowResized", "rowHiding", "rowHidden", "rowShowing", "rowShown", "rowClick", "rowDblClick", "columnClick", "columnDblClick", "rowSelecting", "rowSelected", "rowDeselecting", "rowDeselected", "rowMouseOver", "rowMouseOut", "columnMouseOver", "columnMouseOut", "columnContextMenu", "rowContextMenu", "scroll", "keyPress", "hierarchyExpanding", "hierarchyExpanded", "hierarchyCollapsing", "hierarchyCollapsed", "groupExpanding", "groupExpanded", "groupCollapsing", "groupCollapsed", "activeRowChanging", "activeRowChanged", "rowDeleting", "rowDeleted", "filterMenuShowing", "rowDropping", "rowDropped", "rowDragStarted", "rowDragging", "popUpShowing", "command", "userAction", "rowDataBound", "dataBinding", "dataBound", "headerMenuShowing", "dataBindingFailed", "dataSourceResolved", "batchEditGetEditorValue", "batchEditSetEditorValue", "batchEditGetCellValue", "batchEditSetCellValue", "batchEditCellValueChanging", "batchEditCellValueChanged", "batchEditOpening", "batchEditOpened", "batchEditClosing", "batchEditClosed"];
this._initializeEvents(b);
Telerik.Web.UI.RadGrid.initializeBase(this, [a]);
this.Skin = "Default";
this._imagesPath = "";
this._embeddedSkin = true;
this.ClientID = null;
this.UniqueID = null;
this._clientDataSourceID = null;
this._activeRowIndex = "";
this._activeRow = null;
this.ShowGroupPanel = false;
this._groupPanel = null;
this._groupPanelClientID = "";
this._groupPanelItems = "";
this._groupPanelText = "";
this._showUnGroupButton = false;
this._unGroupTooltip = "";
this._unGroupButtonTooltip = "";
this._gridTableViewsData = "";
this._popUpIds = "";
this._popUpSettings = {};
this.ClientSettings = {};
this._selection = null;
this._cellSelection = null;
this._selectedCellsIndexes = [];
this._selectedCellsInternal = [];
this._selectedIndexes = [];
this._selectedItemsInternal = [];
this._unselectableItemsInternal = [];
this._unselectableItemsIndexes = [];
this._masterClientID = "";
this._scrolling = null;
this._gridItemResizer = null;
this._resizedItems = "";
this._resizedColumns = "";
this._resizedControl = "";
this._hidedItems = "";
this._showedItems = "";
this._hidedColumns = [];
this._showedColumns = [];
this._reorderedColumns = [];
this._groupColsState = {};
this._hierarchyColsExpandedState = {};
this._filterMenuData = {};
this._filterMenu = null;
this._headerContextMenu = null;
this._detailTables = [];
this._clientKeyValues = {};
this._onKeyDownDelegate = null;
this._onMouseMoveDelegate = null;
this._hierarchySettings = {};
this._groupingSettings = {};
this._currentPageIndex = null;
this._expandItems = {};
this._expandedItems = [];
this._expandedGroupItems = [];
this._deletedItems = [];
this._expandedFilterItems = [];
this._initializeRequestHandler = null;
this._endRequestHandler = null;
this._statusLabelID = null;
this._loadingText = null;
this._readyText = null;
this._onFilterMenuClick = null;
this._popUpLocations = {};
this._submitControls = [];
this._allowSubmitOnEnter = false;
this._validationGroup = "";
window[this.ClientID] = this;
this._canMoveRow = false;
this._originalDragItem = null;
this._dropClue = null;
this._draggedItems = [];
this._draggedItemsIndexes = [];
this._draggingPosition = "above";
this._editIndexes = null;
this._controlToFocus = null;
this._documentKeyDownDelegate = null;
this._dataDivMouseDownDelegate = null;
this._dataDivMouseUpDelegate = null;
this._dataDivMouseMoveDelegate = null;
this._swipeStartDelegate = null;
this._swipeUpDelegate = null;
this._swipeMoveDelegate = null;
this._isTouchScrollInProgress = false;
this._documentMouseUpDelegate = null;
this._documentMouseMoveDelegate = null;
this._shouldFocusOnPage = null;
this._lastSelectedItemIndex = null;
this._filterCheckListClientID = null;
this._checkListFilterActiveColumn = "";
this._checkListFilterKeys = [];
this._checkListFilterValues = [];
this._filterApplyButton = null;
this._invisibleParentsArray = [];
this._animation = null;
this.ValidationSettings = {};
this._enableAriaSupport = false;
this._positionedDataItems = null;
this._positionedDataItemsIndexes = null;
this._keyboardNavigationProperties = {
positionedDataItems: null,
positionedDataItemsIndexes: null,
lastClickSelectedItem: null,
currentSelectedIndex: 0,
initialRowIndex: 0,
directionIndex: 0,
lastSelectedRowIndex: null,
holdingCtrl: false,
firstSelection: true,
unselectableItemsCount: 0,
setInitialState: function () {
this.initialRowIndex = this.currentSelectedIndex;
this.directionIndex = 0;
}
};
this.odataClientSettings = null;
this._dataBindingWithSelectMethod = false;
this._isBatchEditingEnabled = false;
this._batchEditingOpenForEditEvents = {};
this._defaultDateTimeFormat = null;
this._startTouchPoints = {};
this._endTouchPoints = {};
this._currentTouchPoints = {};
this._currentMovement = null;
this._validSwipe = true;
this._swipeThreshold = 20;
};
Telerik.Web.UI.RadGrid.prototype = {
initialize: function () {
Telerik.Web.UI.RadGrid.callBaseMethod(this, "initialize");
if ((!this._masterClientID) || (!$get(this._masterClientID))) {
return;
}
this._applyCellSpacingIfRequired();
if (this.ClientSettings) {
if (!this.ClientSettings.PostBackFunction) {
this.ClientSettings.PostBackFunction = "__doPostBack('{0}','{1}')";
}
if (!this.ClientSettings.AllowExpandCollapse) {
this.ClientSettings.AllowExpandCollapse = true;
}
if (this.ClientSettings.AllowGroupExpandCollapse == null) {
this.ClientSettings.AllowGroupExpandCollapse = true;
}
if (typeof(this.ClientSettings.EnableAlternatingItems) == "undefined") {
this.ClientSettings.EnableAlternatingItems = true;
}
if (!this.ClientSettings.ColumnsReorderMethod) {
this.ClientSettings.ColumnsReorderMethod = 0;
}
if (this.ClientSettings.ClientMessages) {
if (typeof(this.ClientSettings.ClientMessages.DragToGroupOrReorder) == "undefined" || this.ClientSettings.ClientMessages.DragToGroupOrReorder == null) {
this.ClientSettings.ClientMessages.DragToGroupOrReorder = "Drag to group or reorder";
}
if (typeof(this.ClientSettings.ClientMessages.DragToResize) == "undefined" || this.ClientSettings.ClientMessages.DragToResize == null) {
this.ClientSettings.ClientMessages.DragToResize = "Drag to resize";
}
if (typeof(this.ClientSettings.ClientMessages.DropHereToReorder) == "undefined" || this.ClientSettings.ClientMessages.DropHereToReorder == null) {
this.ClientSettings.ClientMessages.DropHereToReorder = "Drop here to reorder";
}
if (typeof(this.ClientSettings.ClientMessages.PagerTooltipFormatString) == "undefined" || this.ClientSettings.ClientMessages.PagerTooltipFormatString == null) {
this.ClientSettings.ClientMessages.PagerTooltipFormatString = "Page <strong>{0}</strong> of <strong>{1}</strong>";
}
if (typeof(this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString) == "undefined" || this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString == null) {
this.ClientSettings.ClientMessages.ColumnResizeTooltipFormatString = "Width: <strong>{0}</strong> <em>pixels</em>";
}
}
if (this.ClientSettings.DataBinding) {
if (!this.ClientSettings.DataBinding.MaximumRowsParameterName) {
this.ClientSettings.DataBinding.MaximumRowsParameterName = "maximumRows";
}
if (!this.ClientSettings.DataBinding.StartRowIndexParameterName) {
this.ClientSettings.DataBinding.StartRowIndexParameterName = "startRowIndex";
}
if (!this.ClientSettings.DataBinding.SortParameterName) {
this.ClientSettings.DataBinding.SortParameterName = "sortExpression";
}
if (!this.ClientSettings.DataBinding.FilterParameterName) {
this.ClientSettings.DataBinding.FilterParameterName = "filterExpression";
}
}
if (this.ClientSettings.KeyboardNavigationSettings.AllowSubmitOnEnter) {
this._allowSubmitOnEnter = this.ClientSettings.KeyboardNavigationSettings.AllowSubmitOnEnter;
}
if (this.ClientSettings.KeyboardNavigationSettings.ValidationGroup) {
this._validationGroup = this.ClientSettings.KeyboardNavigationSettings.ValidationGroup;
}
}
if (this.ClientSettings.Animation && ((this.ClientSettings.Animation.AllowColumnReorderAnimation && this.ClientSettings.ColumnsReorderMethod === 1) || this.ClientSettings.Animation.AllowColumnRevertAnimation)) {
this._animation = {};
this._animation.ColumnAnimation = $create(Telerik.Web.UI.GridColumnAnimation, {
reorderDuration: this.ClientSettings.Animation.ColumnReorderAnimationDuration,
revertDuration: this.ClientSettings.Animation.ColumnRevertAnimationDuration
}, null, {owner: this.ClientID});
}
if (this._editIndexes != null) {
this._editIndexes = eval(this._editIndexes);
}
if (this.ClientSettings.AllowKeyboardNavigation) {
this._documentKeyDownDelegate = Function.createDelegate(this, this._documentKeyDown);
$telerik.addExternalHandler(document, "keydown", this._documentKeyDownDelegate);
}
if (this.ClientSettings.AllowRowsDragDrop || (this.get_events().getHandler("rowDblClick") && $telerik.isTouchDevice)) {
this._onMouseDownDelegate = $telerik.addMobileHandler(this, this.get_element(), "mousedown", this._mouseDown);
}
if (this.ClientSettings.AllowRowsDragDrop) {
this._documentMouseUpDelegate = $telerik.addMobileHandler(this, document, "mouseup", this._mouseUp, null, true);
this._documentMouseMoveDelegate = $telerik.addMobileHandler(this, document, "mousemove", this._mouseMove, null, true);
}
$addHandlers(this.get_element(), {click: Function.createDelegate(this, this._click)});
$addHandlers(this.get_element(), {dblclick: Function.createDelegate(this, this._dblclick)});
if ($telerik.isTouchDevice && $telerik.$ && $telerik.$.fn.doubletap) {
var a = $telerik.$;
var c = a.proxy(this._dblclick, this);
a(this.get_element()).doubletap(c);
}
if ($telerik.isOpera) {
$addHandlers(this.get_element(), {mousedown: Function.createDelegate(this, this._contextmenu)});
} else {
$addHandlers(this.get_element(), {contextmenu: Function.createDelegate(this, this._contextmenu)});
}
if (!$telerik.isTouchDevice) {
this._attachMouseHandlers();
}
this._initializeSubmitControls();
this.raise_gridCreating(new Sys.EventArgs());
this.Control = this.get_element();
this.get_element().tabIndex = 0;
if (this.ShowGroupPanel) {
var g = $get(this._groupPanelClientID);
if (g) {
this._groupPanel = $create(Telerik.Web.UI.GridGroupPanel, {_owner: this}, null, null, $get(this._groupPanelClientID));
}
}
this._gridDataDiv = $get(this.get_id() + "_GridData");
this._fillSelectedCellsIndexes();
this._fillUnselectableItemsIndexes();
if (this.ClientSettings && this.ClientSettings.Selecting && this.get_allowCellSelection()) {
this._cellSelection = $create(Telerik.Web.UI.GridCellSelection, {
_owner: this,
multiple: this.get_allowMutliCellSelection(),
columnSelect: this.get_allowColumnSelection(),
multiColumnSelect: this.get_allowMultiColumnSelection()
}, null, {owner: this.ClientID});
}
if (this.ClientSettings && (this.ClientSettings.Selecting && this.ClientSettings.Selecting.AllowRowSelect) || this.ClientSettings.EnablePostBackOnRowClick) {
this._selection = $create(Telerik.Web.UI.GridSelection, {_owner: this}, null, {owner: this.ClientID});
}
this._initializeTableViews();
this.GridDataDiv = $get(this.ClientID + "_GridData");
this.GridHeaderDiv = $get(this.ClientID + "_GridHeader");
this.GridFooterDiv = $get(this.ClientID + "_GridFooter");
this.PagerControl = $get(this._masterClientID + "_Pager");
this.TopPagerControl = $get(this._masterClientID + "_TopPager");
this._getFilterMenu();
if (this._filterMenu) {
this._filterApplyButton = $telerik.getElementByClassName(this._filterMenu.get_element(), "rgFilterApply");
if (this._filterApplyButton) {
this._checkListFilterApplyButtonDelegate = $telerik.addMobileHandler(this, this._filterApplyButton, "click", this._checkListFilterApplyButtonHandler);
this._filterCancelButton = $telerik.getElementByClassName(this._filterMenu.get_element(), "rgFilterCancel");
this._checkListFilterCancelButtonDelegate = $telerik.addMobileHandler(this, this._filterCancelButton, "click", this._checkListFilterCancelButtonHandler);
}
}
if (this._checkListFilterKeys && this._checkListFilterKeys.length > 0) {
this.updateClientState();
}
if (this._filterCheckListClientID) {
var f = $find(this._filterCheckListClientID);
this._checkListItemsRequestedDelegate = Function.createDelegate(this, this._checkListItemsRequestedHandler);
f.add_itemsRequested(this._checkListItemsRequestedDelegate);
}
if ($telerik.isMobileIE10) {
if (this.get_events().getHandler("rowDblClick")) {
this.get_element().style.msTouchAction = "none";
}
if (!!this._groupPanel) {
this._groupPanel.get_element().style.msTouchAction = "none";
}
}
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice) {
this._dataDivMouseDownDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mousedown", this._dataDivMouseDown);
this._dataDivMouseUpDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mouseup", this._dataDivMouseUp);
this._dataDivMouseMoveDelegate = $telerik.addMobileHandler(this, this.GridDataDiv, "mousemove", this._dataDivMouseMove);
}
if (this.get_masterTableView().get_allowPaging() && $telerik.isTouchDevice) {
var p = this.ClientSettings.Scrolling.AllowScroll ? this.GridDataDiv : $telerik.getChildrenByTagName(this.get_masterTableView().get_element(), "tbody")[0];
this._swipeStartDelegate = $telerik.addMobileHandler(this, p, "mousedown", this._swipeStart);
this._swipeEndDelegate = $telerik.addMobileHandler(this, p, "mouseup", this._swipeEnd);
this._swipeMoveDelegate = $telerik.addMobileHandler(this, p, "mousemove", this._swipeMove);
}
var j = Telerik.Web.UI.Grid.IsRightToLeft(this.get_masterTableView().get_element());
if (j) {
this.get_element().className = String.format("{0} RadGridRTL RadGridRTL_{1}", this.get_element().className, this.Skin);
}
if (this.ClientSettings && this.ClientSettings.Scrolling && (this.ClientSettings.Scrolling.AllowScroll || (this.ClientSettings.Scrolling.AllowScroll && (this.ClientSettings.Scrolling.UseStaticHeaders || this.ClientSettings.Scrolling.EnableVirtualScrollPaging)))) {
if (($telerik.isIE7 || $telerik.isIE6) && this.ClientSettings.Scrolling.UseStaticHeaders) {
var k = this.get_masterTableView().get_element();
k.removeChild(k.tHead);
if (this.get_masterTableViewFooter()) {
var l = this.get_masterTableViewFooter().get_element();
l.removeChild(l.tHead);
}
}
this._scrolling = $create(Telerik.Web.UI.GridScrolling, {_owner: this}, null, null);
} else {
this.repaint();
}
if (this._activeRowIndex) {
var n = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(this._activeRowIndex);
if (n) {
var o = this._selectedItemsInternal;
for (var h = 0;
h < o.length;
h++) {
Array.add(this._selectedIndexes, o[h].itemIndex);
}
this.set_activeRow(n);
}
}
if (this._lastSelectedItemIndex != null && this._selection) {
this._selection._lastSelectedItemIndex = this._lastSelectedItemIndex;
}
if (this._isBatchEditingEnabled) {
this._batchEditing = $create(Telerik.Web.UI.GridBatchEditing, null, null, {_owner: this.get_id()}, null);
}
this._attachDomEvents();
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
var m = Sys.WebForms.PageRequestManager.getInstance();
if (m) {
this._initializeRequestHandler = Function.createDelegate(this, this._initializeRequest);
m.add_initializeRequest(this._initializeRequestHandler);
}
}
if ($telerik.isIE7) {
this.get_masterTableView()._hideInvisibleColumns();
var b = $telerik.getElementsByClassName(this.get_masterTableView().get_element(), "rgDetailTable");
for (var h = 0;
h < b.length;
h++) {
var d = $find(b[h].id);
if (d._owner == this) {
d._hideInvisibleColumns();
}
}
}
if (this._clientDataSourceID) {
this._clientSideBinding = new Telerik.Web.UI.GridClientSideBinding(this);
}
this.raise_gridCreated(new Sys.EventArgs());
if (this._shouldFocusOnPage) {
try {
this._shouldFocusOnPage = false;
this.get_element().focus();
} catch (e) {
}
}
this._initializePopUpEditForm();
if (typeof(this.ClientSettings.DataBinding.Location) != "undefined" && this.ClientSettings.DataBinding.Location != "" && !this.get_masterTableView()._virtualization) {
this._onCommandDelegate = Function.createDelegate(this, this._onCommand);
this.add_command(this._onCommandDelegate);
if (!this._onSuccessDelegate && !this._onFailDelegate) {
this._onSuccessDelegate = Function.createDelegate(this, this._onSuccess);
this._onFailDelegate = Function.createDelegate(this, this._onFail);
}
if (typeof(this.ClientSettings.DataBinding.SelectMethod) != "undefined" && this.ClientSettings.DataBinding.SelectMethod != "") {
this._dataBindingWithSelectMethod = true;
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectMethod, this._getRequestData(), this._onSuccessDelegate, this._onFailDelegate);
} else {
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
this._getDataServiceData(this._onSuccessDelegate, this._onFailDelegate);
}
}
}
if (this.ClientSettings.Virtualization.EnableVirtualization) {
Telerik.Web.UI.GridVirtualization._handleRowHeightChangingEvents(this);
this._onVirtualizationCommandDelegate = Function.createDelegate(this, this._onVirtualizationCommand);
this.add_command(this._onVirtualizationCommandDelegate);
if (this.get_masterTableView()._virtualization) {
this.get_masterTableView()._virtualization.repaint();
}
}
if (this.get_isUsingODataSource()) {
this._initializeODataSourceBinder();
this._onCommandODataSourceDelegate = Function.createDelegate(this, this._onCommandODataSource);
this.add_command(this._onCommandODataSourceDelegate);
}
var q = this._controlToFocus;
if (this.ClientSettings.AllowKeyboardNavigation && q != null && q != "") {
setTimeout(function () {
try {
var s = false;
var i = $find(q);
if (i == null) {
i = $get(q);
} else {
s = true;
}
if (i == null) {
i = document.getElementsByName(q.replace(/_/ig, "$"))[0];
}
if (i != null) {
if (i.focus) {
i.focus();
} else {
if (s) {
if (i._focused != undefined) {
i._focused = true;
}
if (i.setFocus) {
i.setFocus();
}
}
}
if (i.select) {
i.select();
}
}
} catch (r) {
}
}, 0);
}
if (this.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
}, _initializePopUpEditForm: function () {
if (this._popUpIds && this._popUpIds != "") {
var m = eval(this._popUpIds);
var g, o = 20;
for (var f = 0;
f < m.length;
f++) {
var l = m[f];
var k = $get(l);
if (k) {
var a = new Sys.CancelEventArgs();
a.get_popUp = function () {
return k;
};
this.raise_popUpShowing(a);
if (a.get_cancel()) {
continue;
}
if (this._popUpSettings.Modal) {
var j = String.format("modalDivId_{0}", this.get_id());
if (!$get(j)) {
var h = document.createElement("div");
h.id = j;
h.style.width = document.documentElement.scrollWidth + "px";
h.style.height = document.documentElement.scrollHeight + "px";
h.className = String.format("GridModal_{0}", this.Skin);
this._onResizeDelegate = Function.createDelegate(this, this.onWindowResize);
var n = this;
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1) {
setTimeout(function () {
$addHandler(window, "resize", n._onResizeDelegate);
}, 0);
} else {
$addHandler(window, "resize", this._onResizeDelegate);
}
h.style.top = h.style.left = 0;
h.style.position = "absolute";
h.style.backgroundColor = "threedshadow";
h.style.zIndex = this._popUpSettings.ZIndex - 10;
try {
h.style.opacity = "0.5";
} catch (c) {
}
if (typeof(h.style.filter) != "undefined") {
h.style.filter = "alpha(opacity=50);";
} else {
if (typeof(h.style.MozOpacity) != "undefined") {
h.style.MozOpacity = 1 / 2;
}
}
var d = document.getElementsByTagName("form")[0];
d.appendChild(h);
}
}
k.style.zIndex = this._popUpSettings.ZIndex;
g = o += 20;
if (k.style.left == "") {
k.style.left = Telerik.Web.UI.Grid.FindPosX(this.get_element()) + g + "px";
}
if (k.style.top == "") {
k.style.top = Telerik.Web.UI.Grid.FindPosY(this.get_element()) + o + "px";
}
k.style.display = "";
k.tabIndex = 0;
var b = k.getElementsByTagName("div")[0];
if ($telerik.isIE6) {
b.style.width = k.offsetWidth + "px";
}
this.resizeModalBackground();
if (k.offsetHeight != 0) {
k.getElementsByTagName("div")[4].style.height = k.offsetHeight - b.offsetHeight + "px";
}
this._popUpLocations[b.id] = parseInt(k.style.left) + "px," + parseInt(k.style.top) + "px";
this.updateClientState();
$addHandlers(b, {mousedown: Function.createDelegate(k, this._popUpMouseDown)});
$addHandlers(document, {mouseup: Function.createDelegate(k, this._popUpMouseUp)});
$addHandlers(document, {mouseout: Function.createDelegate(k, this._popUpMouseOut)});
if (this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts) {
$addHandler(k, "keypress", Function.createDelegate({
popUpForm: k,
keyMappings: this.ClientSettings.KeyboardNavigationSettings
}, this._popUpKeyDown));
}
$telerik.addExternalHandler(document, "mousemove", Function.createDelegate(k, this._popUpMouseMove));
}
}
}
}, _initializeCallback: function (a, b) {
WebForm_DoCallback(this.UniqueID, a, b, "", null, false);
}, _dataDivMouseDown: function (a) {
this._isTouchScrollInProgress = false;
var c = $telerik.getTouchTarget(a);
if (this._scrolling) {
if (c) {
var b = c.tagName.toLowerCase() == "td" && Telerik.Web.UI.Grid.IsChildOf(c, this.GridDataDiv);
var d = a.changedTouches || (a.originalEvent ? a.originalEvent.touches : a.rawEvent ? a.rawEvent.touches : false);
if (!b || (d && d.length > 1)) {
this._scrolling._dropDownTouchScroll.disable();
}
}
if (this.get_allowCellSelection()) {
this._scrolling._dropDownTouchScroll.enable();
}
}
}, _dataDivMouseUp: function (a) {
if (this._scrolling) {
if (this.get_allowCellSelection() && !this._isTouchScrollInProgress) {
this._scrolling._dropDownTouchScroll.disable();
} else {
this._scrolling._dropDownTouchScroll.enable();
}
}
}, _dataDivMouseMove: function (a) {
if (this.get_allowCellSelection() && this._scrolling) {
this._isTouchScrollInProgress = true;
this._scrolling._dropDownTouchScroll.enable();
}
}, _swipeStart: function (a) {
this._startTouchPoints = {};
this._endTouchPoints = {};
this._currentTouchPoints = {};
this._currentMovement = null;
this._validSwipe = true;
var d = a.changedTouches || (a.originalEvent ? a.originalEvent.touches : a.rawEvent ? a.rawEvent.touches : false);
if (d && d.length > 1) {
for (var b = 0;
b < d.length;
b++) {
var c = d[b];
this._startTouchPoints[c.identifier] = {
x: c.clientX,
y: c.clientY,
direction: Telerik.Web.UI.Grid.TouchPointDirection.None,
movement: Telerik.Web.UI.Grid.TouchPointMovement.None
};
}
this._currentTouchPoints = $telerik.$.extend({}, this._startTouchPoints);
}
}, _swipeMove: function (f) {
var g = f.originalEvent || f.rawEvent || f;
var n = g.touches || g.changedTouches;
var c = false;
var h = null;
if (n && n.length > 1) {
for (var j = 0;
j < n.length;
j++) {
var d = n[j];
if (this._currentTouchPoints[d.identifier]) {
var m = this._currentTouchPoints[d.identifier];
if (!m || m.movement == Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent) {
continue;
}
d = {
identifier: n[j].identifier,
x: n[j].clientX,
y: n[j].clientY,
direction: Telerik.Web.UI.Grid.TouchPointDirection.None,
movement: Telerik.Web.UI.Grid.TouchPointMovement.None
};
var a = Math.abs(d.x - m.x);
var b = Math.abs(d.y - m.y);
if (a <= this._swipeThreshold && b <= this._swipeThreshold) {
continue;
}
var k = Telerik.Web.UI.Grid.detectTouchPointDirection(m, d, a - b);
var l = Telerik.Web.UI.Grid.detectTouchPointMovement(k);
d.movement = l;
if (m && m.movement != Telerik.Web.UI.Grid.TouchPointMovement.None) {
if (m.movement != l) {
d.movement = Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent;
}
}
d.direction = k;
this._currentTouchPoints[d.identifier] = d;
if (j == 0) {
h = d.movement;
} else {
if (h == d.movement) {
c = true;
}
}
}
}
}
if (c) {
$telerik.cancelRawEvent(f.originalEvent);
return false;
}
}, _swipeEnd: function (f) {
var h = f.originalEvent || f.rawEvent || f;
var k = h.changedTouches;
if (k && k.length > 0 && Object.keys(this._currentTouchPoints).length > 0) {
var d = k[0];
var c = d.identifier;
if (!this._currentMovement) {
this._currentMovement = this._currentTouchPoints[c].movement;
}
if (!this._validSwipe) {
return;
}
if (this._currentTouchPoints[c] && this._startTouchPoints[c]) {
var g = this._currentTouchPoints[c];
this._endTouchPoints[c] = g;
var j = this._startTouchPoints[c];
var a = Math.abs(g.x - j.x);
var b = Math.abs(g.y - j.y);
var i = (a > this._swipeThreshold || b > this._swipeThreshold) && g.movement != Telerik.Web.UI.Grid.TouchPointMovement.Inconsistent && g.movement == this._currentMovement;
this._validSwipe = this._validSwipe && i;
}
if (this._validSwipe && Object.keys(this._startTouchPoints).length == Object.keys(this._endTouchPoints).length) {
if (this._currentMovement == Telerik.Web.UI.Grid.TouchPointMovement.Left) {
this.get_masterTableView().page("Next");
}
if (this._currentMovement == Telerik.Web.UI.Grid.TouchPointMovement.Right) {
this.get_masterTableView().page("Prev");
}
}
}
}, _initializeSubmitControls: function () {
this._submitControls = [{Name: "input", Type: "text"}];
}, _shouldFocusGridOnDocumentKeyDown: function (a, b) {
var c = a.srcElement || a.explicitOriginalTarget;
if ((a.ctrlKey && b == this.ClientSettings.KeyboardNavigationSettings.FocusKey) || ((b == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey || b == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) && this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && c && c.id == this.get_element().id)) {
return true;
}
return false;
}, _shouldFocusGridOnDocKeyDownWithCellSelection: function (a, c) {
var b = false;
var d = a.srcElement || a.explicitOriginalTarget;
if (a.ctrlKey && c == this.ClientSettings.KeyboardNavigationSettings.FocusKey) {
b = true;
}
return b;
}, _documentKeyDown: function (b) {
b = b || window.event;
var c = b.keyCode || b.charCode;
if (this.get_allowCellSelection()) {
if (this._shouldFocusGridOnDocKeyDownWithCellSelection(b, c)) {
this.get_element().focus();
}
return;
}
if (this._shouldFocusGridOnDocumentKeyDown(b, c)) {
if (this.get_element().focus) {
this.get_element().focus();
if (this.ClientSettings.AllowKeyboardNavigation && !this._activeRow) {
if (this.get_masterTableView().get_dataItems().length > 0) {
var a = null;
if (this._selectedItemsInternal.length > 0) {
a = $find(this._selectedItemsInternal[0].id);
} else {
a = this.get_masterTableView().get_dataItems()[0];
}
if (a != null) {
this._setActiveRow(a.get_element(), b);
if (this.ClientSettings.Selecting && this.ClientSettings.Selecting.AllowRowSelect) {
this._selection._selectRowInternal(a.get_element(), b, false, true, true, false);
}
}
}
}
}
}
}, _attachMouseHandlers: function () {
$addHandlers(this.get_element(), {mouseover: Function.createDelegate(this, this._mouseover)});
$addHandlers(this.get_element(), {mouseout: Function.createDelegate(this, this._mouseout)});
}, _getDataServiceData: function (j, i, o) {
var b = new Sys.CancelEventArgs();
var h = this.ClientSettings.DataBinding.Location;
b.get_location = function () {
return h;
};
b.set_location = function (e) {
h = e;
};
var n = this.ClientSettings.DataBinding.DataService.TableName;
b.get_tableName = function () {
return n;
};
b.set_tableName = function (e) {
n = e;
};
var g = this.ClientSettings.DataBinding.DataService.FilterQueryOption;
b.get_filterQueryOption = function () {
return g;
};
b.set_filterQueryOption = function (e) {
g = e;
};
var m = this.ClientSettings.DataBinding.DataService.SortQueryOption;
b.get_sortQueryOption = function () {
return m;
};
b.set_sortQueryOption = function (e) {
m = e;
};
var k = this.get_masterTableView().getDataServiceQuery(b.get_tableName(), b.get_filterQueryOption(), b.get_sortQueryOption());
b.get_query = function () {
return k;
};
b.set_query = function (e) {
k = e;
};
var l = this._getDataResponseType();
b.get_responseType = function () {
return l;
};
b.set_responseType = function (e) {
l = e;
};
var c = this._isBoundToServiceType(Telerik.Web.UI.GridClientDataServiceType.OData) ? "$callback" : null;
b.get_callback = function () {
return c;
};
b.set_callback = function (e) {
c = e;
};
this.raise_dataBinding(b);
if (b.get_cancel()) {
return false;
}
var p = (typeof(o) != "undefined") ? o : String.format("{0}/{1}", b.get_location(), b.get_query());
try {
var d = function (e, q) {
return e.replace(/\\'/g, "'");
};
if (l === "jsonp") {
d = null;
}
var a = {
type: "GET",
url: p,
contentType: "application/json; charset=utf-8",
dataFilter: d,
dataType: l,
jsonp: c,
success: j,
error: i
};
$telerik.$.ajax(a);
} catch (f) {
throw new Error(f);
}
}, _getData: function (d, g, f, i, h) {
var b = Sys.Serialization.JavaScriptSerializer.deserialize(f);
var a = new Sys.CancelEventArgs();
a.get_location = function () {
return d;
};
a.set_location = function (e) {
d = e;
};
a.get_methodName = function () {
return g;
};
a.set_methodName = function (e) {
g = e;
};
a.get_methodArguments = function () {
return b;
};
a.set_methodArguments = function (e) {
b = e;
};
this.raise_dataBinding(a);
if (a.get_cancel()) {
return false;
}
try {
$telerik.$.ajax({
type: "POST",
url: a.get_location() + "/" + a.get_methodName(),
data: Sys.Serialization.JavaScriptSerializer.serialize(b),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: i,
error: h
});
} catch (c) {
throw new Error(c);
}
}, _getCacheKey: function (a) {
return String.format("{0}{1}{2}{3}", a.get_currentPageIndex(), a.get_pageSize(), a.get_sortExpressions().toString(), a.get_filterExpressions().toString());
}, _getRequestData: function (e, b) {
var f = this.get_masterTableView(), c = {};
if (typeof e !== "undefined" && typeof b !== "undefined") {
c[this.ClientSettings.DataBinding.StartRowIndexParameterName] = e;
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = b;
} else {
c[this.ClientSettings.DataBinding.StartRowIndexParameterName] = f.get_currentPageIndex() * f.get_pageSize();
if (f._data && f._data.AllowPaging) {
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = f.get_pageSize();
} else {
c[this.ClientSettings.DataBinding.MaximumRowsParameterName] = Math.pow(2, 31) - 1;
}
}
var d = null;
if (typeof(this.ClientSettings.DataBinding.SortParameterType) == "undefined") {
d = f.get_sortExpressions().toList();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.String) {
d = f.get_sortExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Linq) {
d = f.get_sortExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.SortParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Oql) {
d = f.get_sortExpressions().toString();
}
}
}
}
c[this.ClientSettings.DataBinding.SortParameterName] = d;
var a = null;
if (typeof(this.ClientSettings.DataBinding.FilterParameterType) == "undefined") {
a = f.get_filterExpressions().toList();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.String) {
a = f.get_filterExpressions().toString();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Linq) {
a = f.get_filterExpressions().toDynamicLinq();
} else {
if (this.ClientSettings.DataBinding.FilterParameterType == Telerik.Web.UI.GridClientDataBindingParameterType.Oql) {
a = f.get_filterExpressions().toOql();
}
}
}
}
c[this.ClientSettings.DataBinding.FilterParameterName] = a;
return Sys.Serialization.JavaScriptSerializer.serialize(c);
}, _isBoundToServiceType: function (a) {
if (this.ClientSettings && this.ClientSettings.DataBinding && this.ClientSettings.DataBinding.DataService) {
if (typeof(this.ClientSettings.DataBinding.DataService.Type) !== "undefined") {
return this.ClientSettings.DataBinding.DataService.Type === a;
} else {
return a === Telerik.Web.UI.GridClientDataServiceType.ADONet;
}
}
return false;
}, _getDataResponseType: function () {
if (this.ClientSettings && this.ClientSettings.DataBinding && this.ClientSettings.DataBinding.ResponseType) {
switch (this.ClientSettings.DataBinding.ResponseType) {
case Telerik.Web.UI.GridClientDataResponseType.JSONP:
return "jsonp";
default:
return "json";
}
}
return "json";
}, _onSuccess: function (f) {
if (typeof(f) != "object" || f == null) {
return;
}
if (typeof(f.d) != "undefined") {
f = f.d;
}
var i = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching && !i._virtualization) {
var h = this._getCacheKey(i);
if (!this._cache) {
this._cache = {};
}
if (!this._cache[h]) {
this._cache[h] = f;
}
}
var g = true;
var d = f;
if (d.get_data) {
d = d.get_data();
}
var b = 0;
var e;
var c;
if (typeof(this.ClientSettings.DataBinding.DataPropertyName) == "undefined") {
e = "Data";
} else {
e = this.ClientSettings.DataBinding.DataPropertyName;
}
if (typeof(this.ClientSettings.DataBinding.CountPropertyName) == "undefined") {
c = "Count";
} else {
c = this.ClientSettings.DataBinding.CountPropertyName;
}
if (this._isBoundToServiceType(Telerik.Web.UI.GridClientDataServiceType.OData) && f.results) {
d = f.results;
if (!isNaN(f.__count)) {
b = f.__count;
g = false;
} else {
if (!i.get_allowPaging()) {
b = 0;
g = false;
}
}
} else {
if (typeof(f[e]) != "undefined" && typeof(f[c]) != "undefined") {
g = false;
d = f[e];
b = f[c];
}
}
if (g) {
if (typeof(this.ClientSettings.DataBinding.SelectCountMethod) != "undefined" && this.ClientSettings.DataBinding.SelectCountMethod != "") {
this._onSelectCountSuccessDelegate = Function.createDelegate(this, this._onSelectCountSuccess);
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
var k = i.get_filterExpressions().toString("it").replace(/'/g, '"').replace(/\[/g, "").replace(/\]/g, "");
var j = String.format("{0}/{1}?where='{2}'", this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectCountMethod, k);
this._getDataServiceData(this._onSelectCountSuccessDelegate, this._onFailDelegate, j);
} else {
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectCountMethod, "{}", this._onSelectCountSuccessDelegate, this._onFailDelegate);
}
}
} else {
i.set_virtualItemCount(b);
}
var a = new Telerik.Web.UI.GridDataSourceResolvedEventArgs(d);
this.raise_dataSourceResolved(a);
d = a.get_data();
if (i.get_virtualItemCount() == 0) {
i._updatePager();
}
if (!i._virtualization) {
i.set_dataSource(d);
i.dataBind();
}
}, _onFail: function (g) {
if (typeof(g) != "undefined") {
var c = new Sys.EventArgs();
if (typeof(g.responseText) != "undefined") {
var f;
try {
f = Sys.Serialization.JavaScriptSerializer.deserialize(g.responseText);
} catch (a) {
f = null;
}
if (!f) {
return;
}
if (f.error) {
var b = f.error;
var d = (b.message && b.message.value) ? b.message.value : "";
c = this._constructErrorArgsObject(d, "", "");
} else {
c = this._constructErrorArgsObject(f.Message, f.ExceptionType, f.StackTrace);
}
}
}
this.raise_dataBindingFailed(c);
}, _constructErrorArgsObject: function (c, b, d) {
var a = new Sys.EventArgs();
a.get_message = function () {
return c;
};
a.get_exceptionType = function () {
return b;
};
a.get_stackTrace = function () {
return d;
};
return a;
}, _onSelectCountSuccess: function (a) {
if (typeof(a.d) != "undefined") {
a = a.d;
}
if (typeof(a[this.ClientSettings.DataBinding.SelectCountMethod]) != "undefined") {
a = a[this.ClientSettings.DataBinding.SelectCountMethod];
}
var b = this.get_masterTableView();
b.set_virtualItemCount(a);
}, _onCommandODataSource: function (b, a) {
a.set_cancel(true);
if (this.get_isUsingODataSource()) {
this._onDataNeeded();
}
}, _onCommand: function (c, a) {
a.set_cancel(true);
var e = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching) {
var d = this._getCacheKey(e);
if (!this._cache) {
this._cache = {};
}
if (this._cache[d]) {
this._onSuccess(this._cache[d]);
return;
}
}
if (typeof(this.ClientSettings.DataBinding.SelectMethod) != "undefined" && this.ClientSettings.DataBinding.SelectMethod != "") {
this._getData(this.ClientSettings.DataBinding.Location, this.ClientSettings.DataBinding.SelectMethod, this._getRequestData(), this._onSuccessDelegate, this._onFailDelegate);
} else {
if (typeof(this.ClientSettings.DataBinding.DataService) != "undefined" && typeof(this.ClientSettings.DataBinding.DataService.TableName) != "undefined" && this.ClientSettings.DataBinding.DataService.TableName != "") {
var b = e.getDataServiceQuery(this.ClientSettings.DataBinding.DataService.TableName, this.ClientSettings.DataBinding.DataService.FilterQueryOption, this.ClientSettings.DataBinding.DataService.SortQueryOption);
var f = String.format("{0}/{1}", this.ClientSettings.DataBinding.Location, b);
this._getDataServiceData(this._onSuccessDelegate, this._onFailDelegate);
}
}
}, _onVirtualizationCommand: function (d, a) {
var e = a.get_tableView(), f = e._virtualization, c = e.get_pageSize(), b = e.get_currentPageIndex();
if (f && a.get_commandName() === "Page") {
a.set_cancel(true);
f.scrollToIndex(c * b);
f.select(c * b);
}
}, repaint: function () {
if (!this.canRepaint()) {
this.add_parentShown(this.get_element());
return;
} else {
this._clearParentShowHandlers();
}
if (!this._scrolling && this.GridDataDiv) {
this._scrolling = $find(this.get_id())._scrolling;
}
if (Telerik.Web.UI.GridScrolling && this._scrolling) {
if (this._scrolling._shouldInitializeLayoutAndScroll) {
this._scrolling._shouldInitializeLayoutAndScroll = false;
this._scrolling._initializeDimensions();
this._scrolling._initializeScroll();
} else {
this._scrolling.onWindowResize();
}
} else {
if (this._repaintWidthFlag) {
this.get_element().style.width = "";
}
var a = 0;
if (!!this._masterClientID && this.get_masterTableView() != null) {
a = this.get_masterTableView().get_element().offsetWidth;
}
if (this.get_element().offsetWidth < a) {
this.get_element().style.width = a + "px";
this._repaintWidthFlag = true;
}
}
if (this._masterClientID && this.get_masterTableView() && this.get_masterTableView()._virtualization) {
this.get_masterTableView()._virtualization.repaint();
}
}, onWindowResize: function () {
this.resizeModalBackground();
}, resizeModalBackground: function () {
var d = String.format("modalDivId_{0}", this.get_id());
var c = $get(d);
if (c) {
c.style.width = "1px";
c.style.height = "1px";
var b = document.documentElement;
var a = document.body;
if ($telerik.isIE8 && ((b.scrollWidth < b.offsetWidth && b.scrollHeight > b.offsetHeight) || (b.scrollWidth < b.offsetWidth && b.scrollHeight < b.offsetHeight) || (b.scrollHeight < b.offsetHeight && b.scrollWidth > b.offsetWidth))) {
c.style.width = b.scrollWidth + "px";
c.style.height = b.scrollHeight + "px";
} else {
c.style.width = Math.max(Math.max(b.scrollWidth, a.scrollWidth), Math.max(b.offsetWidth, a.offsetWidth)) + "px";
c.style.height = Math.max(Math.max(b.scrollHeight, a.scrollHeight), Math.max(b.offsetHeight, a.offsetHeight)) + "px";
}
}
}, _popUpKeyDown: function (b) {
var d = b.keyCode || b.charCode;
var c = (d == this.keyMappings.ExitEditInsertModeKey);
var i = (d == this.keyMappings.UpdateInsertItemKey);
var h = Telerik.Web.UI.Grid.GetFirstParentByTagName(this.popUpForm, "tr").previousSibling;
if (h.id == "") {
return;
}
var g = h.id.split("__")[0];
var f = $find(g);
if (!f) {
return;
}
if (!f.get_owner()._canHandleKeyboardAction(b)) {
return;
}
if (c) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
f.get_owner().raise_keyPress(a);
if (!a.get_cancel()) {
f.cancelUpdate(h);
}
b.preventDefault();
b.stopPropagation();
} else {
if (i) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
f.get_owner().raise_keyPress(a);
if (!a.get_cancel()) {
f.updateItem(h);
}
b.preventDefault();
b.stopPropagation();
}
}
}, _popUpMouseDown: function (a) {
this.canMove = true;
this.originalLeft = this.offsetLeft - a.clientX;
this.originalTop = this.offsetTop - a.clientY;
if (!($telerik.isFirefox && a.button == 2 && navigator.userAgent.indexOf("Mac"))) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
return false;
}, _popUpMouseOut: function (a) {
if (!this.canMove) {
return;
}
var b;
if (a.rawEvent.relatedTarget) {
b = a.rawEvent.relatedTarget;
} else {
b = a.rawEvent.toElement;
}
if (!b) {
this.canMove = false;
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
return false;
}, _popUpMouseUp: function (b) {
if (!this.canMove) {
return;
}
this.canMove = false;
var a = this.getElementsByTagName("div")[0];
var d = a.id;
var g = d.split("__")[0];
var f = $find(g);
if (f) {
var c = f._owner;
c._popUpLocations[d] = this.style.left + "," + this.style.top;
c.updateClientState();
c.resizeModalBackground();
}
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _popUpMouseMove: function (a) {
if (this.canMove) {
this.style.left = a.clientX + this.originalLeft + "px";
this.style.top = a.clientY + this.originalTop + "px";
return false;
}
}, _isRowDragged: function (a) {
return $get(String.format("{0}_DraggedRows", this.get_id())) != null;
}, _mouseDown: function (d) {
if (!$telerik.isTouchDevice && d.rawEvent.button != Sys.UI.MouseButton.leftButton && this._draggedRow) {
if (!this.get_masterTableView()) {
this._clearDrag();
return;
}
this._draggedRow.parentNode.removeChild(this._draggedRow);
this._draggedRow = null;
this._clearDrag();
return;
}
var r;
if ($telerik.isTouchDevice) {
r = $telerik.getTouchTarget(d);
if (r.tagName && r.tagName.toLowerCase() == "td" && this.get_events().getHandler("rowDblClick")) {
$telerik.cancelRawEvent(d);
}
} else {
r = Telerik.Web.UI.Grid.GetCurrentElement(d);
}
var j = r.id && r.id.indexOf("RowDragHandle") > -1;
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice && this.ClientSettings.AllowRowsDragDrop && !j && r.tagName.toLowerCase() == "td" && Telerik.Web.UI.Grid.IsChildOf(r, this.GridDataDiv)) {
return $telerik.cancelRawEvent();
}
var o = Telerik.Web.UI.Grid.GetFirstParentByTagName(r, "tr");
if (!o || o.id == "") {
return;
}
var k = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(o);
var n = k.id.split("__")[0];
var m = $find(n);
if (!m || (m._data._useDragColumn && !j)) {
return;
}
if ((!this._canRiseRowEvent(d) && !j) || (this._isRowResize && this._isRowResize == true)) {
return;
}
if (this._selectedIndexes.length == 0 && this.get_allowMultiRowSelection() && this.ClientSettings.Selecting.EnableDragToSelectRows && !j) {
return;
}
if (this.get_allowMultiRowSelection() && (d.ctrlKey || (d.rawEvent && d.rawEvent.metaKey))) {
return;
}
if (this._draggedItems) {
this._draggedItems = [];
}
var g = false;
for (var h = 0;
h < this._selectedItemsInternal.length;
h++) {
if (this._selectedItemsInternal[h].id == o.id) {
g = true;
break;
}
}
if (!g) {
var l = this.get_allowMultiRowSelection() && !this.ClientSettings.Selecting.EnableDragToSelectRows;
if (Telerik.Web.UI.GridSelection && this._selection && (l || !this.get_allowMultiRowSelection() || j)) {
var f = this.ClientSettings.EnablePostBackOnRowClick;
this.ClientSettings.EnablePostBackOnRowClick = false;
this._selection._click(d);
this.ClientSettings.EnablePostBackOnRowClick = f;
if (this._selectedItemsInternal.length == 0 || this._selectedItemsInternal[0].id != o.id) {
return;
}
} else {
return;
}
}
this._canMoveRow = true;
this._originalDragItem = o;
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(o, d);
this.raise_rowDragStarted(a);
if (a.get_cancel()) {
return;
}
this._draggedRow = document.createElement("div");
this._draggedRow.id = String.format("{0}_DraggedRows", this.get_id());
this._draggedRow.style.position = "absolute";
this._draggedRow.className = this.get_element().className;
var b = [];
var p = m.get_selectedItems();
for (var h = 0;
h < p.length;
h++) {
if (Array.contains(m.get_dataItems(), p[h])) {
var c = p[h].get_element();
if (this.get_enableAriaSupport()) {
c.removeAttribute("aria-dropeffect");
c.setAttribute("aria-grabbed", "true");
}
b[b.length] = String.format("<tr class='{0}'>", c.className);
b[b.length] = c.innerHTML;
b[b.length] = "</tr>";
Array.add(this._draggedItems, p[h]);
}
}
this._draggedRow.innerHTML = String.format("<table class='{0}'><tbody>{1}</tbody></table>", o.parentNode.parentNode.className, b.join(""));
var q = this._draggedRow.getElementsByTagName("table")[0];
if (this._draggedRow.mergeAttributes) {
this._draggedRow.mergeAttributes(this.get_element());
} else {
Telerik.Web.UI.Grid.CopyAttributes(this._draggedRow, this.get_element());
}
this._draggedRow.className += String.format(" GridDraggedRows GridDraggedRows_{0}", this.Skin);
this._draggedRow.style.height = "";
if (q.mergeAttributes) {
q.mergeAttributes(o.parentNode.parentNode);
} else {
Telerik.Web.UI.Grid.CopyAttributes(q, o.parentNode.parentNode);
}
q.style.height = "";
q.style.margin = "";
this._draggedRow.style.zIndex = 99999;
this._draggedRow.style.display = "none";
this._draggedRow.style.width = this.get_element().offsetWidth + "px";
document.body.insertBefore(this._draggedRow, document.body.firstChild);
this._createDropClue();
if (!($telerik.isFirefox && d.button == 2 && navigator.userAgent.indexOf("Mac"))) {
Telerik.Web.UI.Grid.ClearDocumentEvents();
}
return false;
}, _createDropClue: function () {
this._dropClue = document.createElement("div");
document.body.appendChild(this._dropClue);
this._dropClue.style.position = "absolute";
this._dropClue.style.height = "5px";
}, _positionDropClue: function (c) {
if (this._dropClue == c.target) {
return;
}
if (!this.get_masterTableView()) {
return;
}
var a;
if ($telerik.isTouchDevice) {
a = $telerik.getTouchTarget(c);
} else {
a = Telerik.Web.UI.Grid.GetCurrentElement(c);
}
var b = null;
if (a) {
var i = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
if (i && i.id != "") {
var h = this._getParentRadGridControl(a);
if (Telerik.Web.UI.Grid.IsChildOf(a, this.get_element())) {
if (i != this._originalDragItem) {
b = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(i);
}
} else {
if (h) {
if (!h.get_masterTableView()) {
return;
}
var i = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "tr");
b = h.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(i);
}
}
} else {
if (i && i.className && i.className.indexOf("rgNoRecords") != -1) {
b = i;
}
}
}
if (!b) {
this._dropClue.style.visibility = "hidden";
return;
}
this._dropClue.row = b;
this._dropClue.style.width = b.offsetWidth + "px";
var g = b;
var d = $telerik.getLocation(g);
this._dropClue.style.left = d.x + "px";
var f;
if ($telerik.isTouchDevice) {
f = $telerik.getTouchEventLocation(c);
} else {
f = this._getMousePosition(c);
}
this._dropClue.style.display = "";
this._dropClue.style.visibility = "visible";
if (f.y < (d.y + (g.offsetHeight / 2))) {
this._dropClue.style.top = (d.y) + "px";
if (this.Skin != "") {
this._dropClue.className = String.format("GridItemDropIndicator GridItemDropIndicator_{0}", this.Skin);
} else {
this._dropClue.style.borderTop = "1px dotted black";
this._dropClue.style["font-size"] = "3px";
this._dropClue.style["line-height"] = "3px";
this._dropClue.style.height = "1px";
this._dropClue.className = "GridItemDropIndicator";
}
this._draggingPosition = "above";
} else {
this._dropClue.style.top = (d.y + g.offsetHeight) + "px";
if (this.Skin != "") {
this._dropClue.className = String.format("GridItemDropIndicator GridItemDropIndicator_{0}", this.Skin);
} else {
this._dropClue.style.borderTop = "1px dotted black";
this._dropClue.style["font-size"] = "3px";
this._dropClue.style["line-height"] = "3px";
this._dropClue.style.height = "1px";
this._dropClue.className = "GridItemDropIndicator";
}
this._draggingPosition = "below";
}
}, _getMousePosition: function (a) {
var d = $telerik.getScrollOffset(document.body, true);
var b = a.clientX;
var c = a.clientY;
b += d.x;
c += d.y;
return {x: b, y: c};
}, _mouseUp: function (m) {
this._canMoveRow = false;
if (this._draggedRow) {
if (!this.get_masterTableView()) {
this._clearDrag();
return;
}
this._draggedRow.parentNode.removeChild(this._draggedRow);
this._draggedRow = null;
var c;
if ($telerik.isTouchDevice) {
c = $telerik.getTouchTarget(m);
} else {
c = Telerik.Web.UI.Grid.GetCurrentElement(m);
}
if (c) {
if (c == this._dropClue) {
c = this._dropClue.row;
} else {
if (c.id && c.id.indexOf("_GridData") != -1) {
var F = $find(c.id.replace("_GridData", ""));
if (F && Object.getType(F).getName() == "Telerik.Web.UI.RadGrid") {
var x = F.get_masterTableView().get_element().rows;
if (x.length > 0) {
c = x[x.length - 1].cells[0];
this._draggingPosition = "below";
}
}
}
}
var h = this._draggedItems;
var C = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
if (C == this._originalDragItem) {
if (this.get_enableAriaSupport()) {
for (var t = 0;
t < h.length;
t++) {
var l = h[t].get_element();
l.removeAttribute("aria-grabbed");
l.setAttribute("aria-dropeffect", "move");
}
}
this._clearDrag();
return;
}
var B = this._draggingPosition;
if (C && C.id == "") {
C = null;
B = null;
}
var o = new Telerik.Web.UI.GridDragDropCancelEventArgs(C, m, h, c, null, B);
this.raise_rowDropping(o);
if (!o.get_cancel()) {
var A = this._getParentRadGridControl(c);
if (A) {
var D = Telerik.Web.UI.Grid.GetFirstParentByTagName(c, "tr");
if (!D || D == this._originalDragItem || !A.get_masterTableView()) {
this._clearDrag();
return;
}
var d = D;
var y = A.get_masterTableView()._data.UniqueID;
if (D.id != "") {
d = A.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(D);
var g = $find(d.id.split("__")[0]);
if (g) {
y = g._data.UniqueID;
}
} else {
var n = false;
if (A.get_masterTableView().get_element().tBodies.length > 0) {
for (var t = 0, w = A.get_masterTableView().get_element().tBodies[0].rows.length;
t < w;
t++) {
if (D == A.get_masterTableView().get_element().tBodies[0].rows[t]) {
n = true;
break;
}
var s = A.get_masterTableView().get_element().tBodies[0].rows[t].getElementsByTagName("table");
for (var u = 0, v = s.length;
u < v;
u++) {
if (s[u] && this._isChildRowElement(D, s[u])) {
var E = $find(s[u].id);
if (E) {
y = E._data.UniqueID;
}
n = true;
break;
}
}
if (n) {
break;
}
}
}
if (!n) {
return;
}
}
var h = this._draggedItems;
var a = null;
if (d.id != "") {
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(d, m, h, null, A, this._draggingPosition);
} else {
var z = Telerik.Web.UI.Grid.GetFirstParentRowWithID(d);
if (z != null && z.id != "") {
d = z;
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(d, m, h, null, A, this._draggingPosition);
} else {
a = new Telerik.Web.UI.GridDragDropCancelEventArgs(null, m, h, null, A, this._draggingPosition);
}
}
this.raise_rowDropped(a);
this._draggedItemsIndexes = [];
for (var q = 0;
q < h.length;
q++) {
Array.add(this._draggedItemsIndexes, h[q]._itemIndexHierarchical);
}
this.updateClientState();
var f = d.id.split("__")[1];
var b = String.format("{0},{1},{2},{3}", f, A.UniqueID, this._draggingPosition, y);
this.get_masterTableView().fireCommand("RowDropped", b);
} else {
var p = o.get_destinationHtmlElement();
var h = this._draggedItems;
var a = new Telerik.Web.UI.GridDragDropCancelEventArgs(null, m, h, p, null, null);
this.raise_rowDropped(a);
this._draggedItemsIndexes = [];
for (var q = 0;
q < h.length;
q++) {
Array.add(this._draggedItemsIndexes, h[q]._itemIndexHierarchical);
}
this.updateClientState();
if (p.id) {
var b = String.format("{0},{1},{2},{3}", p.id, "", "", "");
}
this.get_masterTableView().fireCommand("RowDroppedHtml", b);
}
}
}
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}
this._clearDrag();
}, _clearDrag: function () {
if (this._dropClue) {
document.body.removeChild(this._dropClue);
this._dropClue = null;
}
if (this._draggedItems) {
this._draggedItems = [];
}
this._draggingPosition = "above";
Telerik.Web.UI.Grid.RestoreDocumentEvents();
}, _isChildRowElement: function (c, d) {
for (var a = 0, b = d.tBodies[0].rows.length;
a < b;
a++) {
if (c == d.tBodies[0].rows[a]) {
return true;
}
}
return false;
}, _getParentRadGridControl: function (b) {
while (b) {
if (b.id && b.id != "") {
try {
var c = $find(b.id);
if (c && Object.getType(c).getName() == "Telerik.Web.UI.RadGrid") {
return c;
}
} catch (a) {
}
}
b = b.parentNode;
}
return null;
}, _cancelEvent: function (a) {
return false;
}, _mouseMove: function (b) {
if (this._canMoveRow && this._draggedRow) {
var a = new Sys.EventArgs();
a.get_domEvent = function () {
return b;
};
this.raise_rowDragging(a);
this._draggedRow.style.display = "";
this._draggedRow.style.position = "absolute";
Telerik.Web.UI.Grid.PositionDragElement(this._draggedRow, b);
this._positionDropClue(b);
if (this.ClientSettings.Scrolling.AllowScroll && this.GridDataDiv && this.ClientSettings.AllowAutoScrollOnDragDrop) {
this._autoScroll();
}
if ($telerik.isTouchDevice) {
$telerik.cancelRawEvent(b);
}
return false;
}
}, _autoScroll: function () {
var j, a;
var d = this.GridDataDiv;
if (!this._draggedRow || !this.GridDataDiv) {
return;
}
var b = $telerik.getLocation(this._draggedRow);
j = $telerik.getLocation(d).y;
a = j + d.offsetHeight;
var h = d.scrollTop <= 0;
var g = d.scrollTop >= (d.scrollHeight - d.offsetHeight + 16);
var f = b.y - j;
var e = a - b.y;
var c = this;
if (f < 50 && !h) {
var i = (10 - (f / 5));
d.scrollTop = d.scrollTop - i;
window.setTimeout(function () {
c._autoScroll();
}, 100);
} else {
if (e < 50 && !g) {
var i = (10 - (e / 5));
d.scrollTop = d.scrollTop + i;
window.setTimeout(function () {
c._autoScroll(this._mousePos);
}, 100);
}
}
}, _fillSelectedCellsIndexes: function () {
if (this._selectedCellsInternal.length > 0) {
var a = null;
for (var b = 0;
b < this._selectedCellsInternal.length;
b++) {
a = this._selectedCellsInternal[b].cellIndex;
if (!Array.contains(this._selectedCellsIndexes, a)) {
Array.add(this._selectedCellsIndexes, a);
}
}
}
}, _fillUnselectableItemsIndexes: function () {
var c = this._unselectableItemsInternal;
if (c.length > 0) {
var a = null;
for (var b = 0;
len = c.length, b < len;
b++) {
a = c[b].itemIndex;
if (!Array.contains(c, a)) {
Array.add(this._unselectableItemsIndexes, a);
}
}
}
}, dispose: function () {
var h = $get(String.format("modalDivId_{0}", this.get_id()));
if (h) {
h.parentNode.removeChild(h);
}
if (this._onResizeDelegate) {
try {
$removeHandler(window, "resize", this._onResizeDelegate);
this._onResizeDelegate = null;
} catch (c) {
}
}
if (this._gridItemResizer) {
this._gridItemResizer.dispose();
}
if (this._popUpIds && this._popUpIds != "") {
var a = eval(this._popUpIds);
for (var g = 0;
g < a.length;
g++) {
var d = $get(a[g]);
if (d) {
var b = d.getElementsByTagName("div");
if (b.length > 0) {
$clearHandlers(b[0]);
}
}
}
}
this.raise_gridDestroying(new Sys.EventArgs());
if (this._filterCheckListClientID && this._checkListItemsRequestedDelegate) {
var f = $find(this._filterCheckListClientID);
if (f) {
f.remove_itemsRequested(this._checkListItemsRequestedDelegate);
this._checkListItemsRequestedDelegate = null;
}
}
this._detachDomEvents();
$clearHandlers(this.get_element());
this._events = null;
if (this._batchEditing) {
this._batchEditing.dispose();
}
if (this._selection) {
this._selection.dispose();
}
if (this._scrolling) {
this._scrolling.dispose();
}
if (this._filterMenu) {
if (this._onFilterMenuClick) {
this._filterMenu.remove_itemClicked(this._onFilterMenuClicking);
this._filterMenu.remove_itemClicked(this._onFilterMenuClick);
this._filterMenu.remove_hidden(this._onFilterMenuHiddenDelegate);
this._onFilterMenuHiddenDelegate = null;
}
this._filterMenu = null;
}
if (this._headerContextMenu) {
this._headerContextMenu = null;
}
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
var j = Sys.WebForms.PageRequestManager.getInstance();
if (j && this._initializeRequestHandler) {
j.remove_initializeRequest(this._initializeRequestHandler);
}
}
this._initializeRequestHandler = null;
if (this.GridDataDiv) {
$clearHandlers(this.GridDataDiv);
}
if (this.GridHeaderDiv) {
$clearHandlers(this.GridHeaderDiv);
}
if (this.GridFooterDiv) {
$clearHandlers(this.GridFooterDiv);
}
if (this._groupPanel && this._groupPanel.get_element()) {
$clearHandlers(this._groupPanel.get_element());
}
this._draggedItems = null;
this.Control = null;
this.GridDataDiv = null;
this.GridHeaderDiv = null;
this.GridFooterDiv = null;
this.PagerControl = null;
this.TopPagerControl = null;
this.MasterTableView = null;
this.MasterTableViewHeader = null;
this.MasterTableViewFooter = null;
this._hidedColumns = [];
this._showedColumns = [];
if (this.get_isUsingODataSource()) {
this._flatBinder._source.remove_requestSucceeded(this._oDataRequestSucceededDelegate);
this._oDataRequestSucceededDelegate = null;
}
if (this.ClientSettings.AllowKeyboardNavigation && this._documentKeyDownDelegate) {
$telerik.removeExternalHandler(document, "keydown", this._documentKeyDownDelegate);
this._documentKeyDownDelegate = null;
}
if (this.ClientSettings.AllowRowsDragDrop) {
if ($telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.get_element(), "mousedown", this._onMouseDownDelegate);
this._onMouseDownDelegate = null;
}
$telerik.removeMobileHandler(document, "mouseup", this._documentMouseUpDelegate, null, true);
this._documentMouseUpDelegate = null;
$telerik.removeMobileHandler(document, "mousemove", this._documentMouseMoveDelegate, null, true);
this._documentMouseMoveDelegate = null;
}
if (this.ClientSettings.Scrolling.AllowScroll && $telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.GridDataDiv, "mousedown", this._dataDivMouseDownDelegate);
this._dataDivMouseDownDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mouseup", this._dataDivMouseUpDelegate);
this._dataDivMouseUpDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mousemove", this._dataDivMouseMoveDelegate);
this._dataDivMouseMoveDelegate = null;
}
if ($telerik.isTouchDevice) {
$telerik.removeMobileHandler(this.GridDataDiv, "mousedown", this._swipeStartDelegate);
this._swipeStartDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mouseup", this._swipeEndDelegate);
this._swipeEndDelegate = null;
$telerik.removeMobileHandler(this.GridDataDiv, "mousemove", this._swipeMoveDelegate);
this._swipeMoveDelegate = null;
}
window[this.ClientID] = null;
Telerik.Web.UI.RadGrid.callBaseMethod(this, "dispose");
}, _initializeRequest: function (f, a) {
var e = a.get_postBackElement();
if (a.get_postBackElement() == this.get_element() || Telerik.Web.UI.Grid.IsChildOf(e, this.get_element())) {
if (this._statusLabelID) {
var h = ["rgExpXLS", "rgExpDOC", "rgExpPDF", "rgExpCSV"];
var g = true;
var b = e.className;
for (var c = 0;
len = h.length, c < len;
c++) {
if (b.indexOf(h[c]) != -1) {
g = false;
break;
}
}
if (g) {
var d = $get(this._statusLabelID);
if (d) {
d.title = this._loadingText;
d.style.visibility = "visible";
}
}
}
this._isAjaxRequest = true;
}
}, _initializeODataSourceBinder: function () {
var d = this, b = d.get_odataClientSettings().ODataSourceID, a = $find(b);
if (!a) {
var c = String.format("DataSource with id {0} was not found on the page", b);
alert(c);
} else {
d._flatBinder = new Telerik.Web.UI.RadODataDataSource.Binder.Flat(a, d);
d._flatBinder.initialize();
d._oDataRequestSucceededDelegate = Function.createDelegate(d, d._onODataRequestSucceeded);
a.add_requestSucceeded(d._oDataRequestSucceededDelegate);
d._onDataNeeded();
}
}, _onDataNeeded: function (f) {
var e = {
events: {
fail: function (i) {
this._onFail(i);
}
}
};
var a = {};
a.filter = {};
a.filter.filters = [];
var c = this.get_masterTableView().get_filterExpressions();
for (var d = 0;
d < c.get_count();
d++) {
var b = c.getItem(d);
var h = b.get_fieldValue();
var j = [];
if (h.split) {
j = h.split(" ");
}
if (b.FilterFunction == "Between") {
b.set_filterFunction("GreaterThanOrEqualTo");
b.set_fieldValue(j[0]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
b.set_filterFunction("LessThanOrEqualTo");
b.set_fieldValue(j[1]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
} else {
if (b.FilterFunction == "NotBetween") {
b.set_filterFunction("LessThanOrEqualTo");
b.set_fieldValue(j[0]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
b.set_filterFunction("GreaterThanOrEqualTo");
b.set_fieldValue(j[1]);
a.filter.filters.push(this._convertToODataFilterExprJson(b));
a.filter.logic = "or";
} else {
if (b.FilterFunction == "DoesNotContain") {
return;
} else {
a.filter.filters.push(this._convertToODataFilterExprJson(b));
}
}
}
}
var g = this.get_masterTableView().get_sortExpressions();
a.sort = [];
for (var d = 0;
d < g.get_count();
d++) {
var b = g.getItem(d);
a.sort.push({field: b.FieldName, dir: b.SortOrder == 1 ? "asc" : "desc"});
}
a.page = this.get_masterTableView().get_currentPageIndex();
a.pageSize = this.get_masterTableView().get_pageSize();
if (e != undefined) {
e.data = a;
this._flatBinder.fetch(e);
} else {
this._flatBinder.fetch();
}
}, _onODataRequestSucceeded: function (e, b) {
var g = this.get_masterTableView();
if (this.ClientSettings.DataBinding.EnableCaching) {
var f = this._getCacheKey(g);
if (!this._cache) {
this._cache = {};
}
if (!this._cache[f]) {
this._cache[f] = b;
}
}
var d = b.get_data(), c = b.get_count(), a = new Telerik.Web.UI.GridDataSourceResolvedEventArgs(d);
g.set_virtualItemCount(c);
this.raise_dataSourceResolved(a);
if (g.get_virtualItemCount() == 0) {
g._updatePager();
}
g.set_dataSource(d);
g.dataBind();
}, _convertToODataFilterExprJson: function (a) {
var c = {}, b = a.get_fieldName();
switch (a.FilterFunction) {
case"EqualTo":
c = this._getODataFilterExpressionJson(b, "eq", a.FieldValue);
break;
case"NotEqualTo":
c = this._getODataFilterExpressionJson(b, "neq", a.FieldValue);
break;
case"GreaterThan":
c = this._getODataFilterExpressionJson(b, "gt", a.FieldValue);
break;
case"LessThan":
c = this._getODataFilterExpressionJson(b, "lt", a.FieldValue);
break;
case"GreaterThanOrEqualTo":
c = this._getODataFilterExpressionJson(b, "gte", a.FieldValue);
break;
case"LessThanOrEqualTo":
c = this._getODataFilterExpressionJson(b, "lte", a.FieldValue);
break;
case"StartsWith":
c = this._getODataFilterExpressionJson(b, "startswith", a.FieldValue);
break;
case"EndsWith":
c = this._getODataFilterExpressionJson(b, "endswith", a.FieldValue);
break;
case"Contains":
c = this._getODataFilterExpressionJson(b, "contains", a.FieldValue);
break;
case"Between":
c = this._getODataFilterExpressionJson(b, "contains", a.FieldValue);
break;
case"IsEmpty":
c = this._getODataFilterExpressionJson(b, "eq", "");
break;
case"NotIsEmpty":
c = this._getODataFilterExpressionJson(b, "neq", "");
break;
case"IsNull":
c = this._getODataFilterExpressionJson(b, "eq", null);
break;
case"NotIsNull":
c = this._getODataFilterExpressionJson(b, "neq", null);
break;
}
return c;
}, _getODataFilterExpressionJson: function (b, a, d) {
var c = {};
c = {field: b, operator: a, value: d};
return c;
}, get_flatModel: function () {
var b = this.get_odataClientSettings();
var a = Telerik.Web.UI.RadODataDataSource.Binder.Flat.Model(b);
a.parse = function (c) {
return c;
};
return a;
}, get_allowActiveRowCycle: function () {
return this.ClientSettings.KeyboardNavigationSettings.AllowActiveRowCycle;
}, set_allowActiveRowCycle: function (a) {
this.ClientSettings.KeyboardNavigationSettings.AllowActiveRowCycle = a;
}, get_odataClientSettings: function () {
return this._odataClientSettings;
}, set_odataClientSettings: function (a) {
this._odataClientSettings = a;
}, get_isUsingODataSource: function () {
return this._odataClientSettings != null;
}, get_selectedCellsIndexes: function () {
return this._selectedCellsIndexes;
}, get_selectedItemsInternal: function () {
return this._selectedItemsInternal;
}, set_selectedItemsInternal: function (a) {
if (this._selectedItemsInternal != a) {
this._selectedItemsInternal = a;
}
}, get_expandItems: function () {
return this._expandItems;
}, set_expandItems: function (a) {
if (this._expandItems != a) {
this._expandItems = a;
}
}, get_hidedColumns: function () {
return this._hidedColumns;
}, set_hidedColumns: function (a) {
if (this._hidedColumns != a) {
this._hidedColumns = a;
this.updateClientState();
}
}, get_showedColumns: function () {
return this._showedColumns;
}, set_showedColumns: function (a) {
if (this._showedColumns != a) {
this._showedColumns = a;
this.updateClientState();
}
}, get_groupColsState: function () {
return this._groupColsState;
}, set_groupColsState: function (a) {
if (this._groupColsState != a) {
this._groupColsState = a;
this.updateClientState();
}
}, get_hierarchyColsExpandedState: function () {
return this._hierarchyColsExpandedState;
}, set_hierarchyColsExpandedState: function (a) {
if (this._hierarchyColsExpandedState != a) {
this._hierarchyColsExpandedState = a;
this.updateClientState();
}
}, get_selectedCellsInternal: function () {
return this._selectedCellsInternal;
}, set_selectedCellsInternal: function (a) {
if (this._selectedCellsInternal != a) {
this._selectedCellsInternal = a;
}
}, get_unselectableItemsInternal: function () {
return this._unselectableItemsInternal;
}, set_unselectableItemsInternal: function (a) {
if (this._unselectableItemsInternal != a) {
this._unselectableItemsInternal = a;
}
}, get_allowCellSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.None;
}, get_allowMutliCellSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.SingleCell;
}, get_allowColumnSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.MultiCell;
}, get_allowMultiColumnSelection: function () {
return this.ClientSettings.Selecting.CellSelectionMode > Telerik.Web.UI.GridCellSelectionMode.Column;
}, get_allowMultiRowSelection: function () {
return this.AllowMultiRowSelection;
}, set_allowMultiRowSelection: function (a) {
if (this.AllowMultiRowSelection != a) {
this.AllowMultiRowSelection = a;
}
}, get_masterTableView: function () {
return $find(this._masterClientID);
}, get_masterTableViewHeader: function () {
return $find(this._masterClientID + "_Header");
}, get_masterTableViewFooter: function () {
return $find(this._masterClientID + "_Footer");
}, get_selectedItems: function () {
var b = [];
for (var a = 0;
a < this._selectedItemsInternal.length;
a++) {
Array.add(b, $find(this._selectedItemsInternal[a].id));
}
return b;
}, get_editIndexes: function () {
return this._editIndexes;
}, get_editItems: function () {
var a = [];
var h = this.get_masterTableView();
function b(k, i) {
var j = document.getElementById(k.get_id() + "__" + i);
if (j) {
k.get_dataItems();
return $find(j.id);
}
return null;
}
for (var c = 0, g = this._editIndexes.length;
c < g;
c++) {
var d = this._editIndexes[c];
if (d.indexOf(":") > -1) {
for (var f = 0;
f < this._detailTables.length;
f++) {
var e = b(this._detailTables[f], d);
if (e) {
a[a.length] = e;
break;
}
}
} else {
var e = b(h, d);
if (e) {
a[a.length] = e;
}
}
}
return a;
}, get_batchEditingManager: function () {
return this._batchEditing;
}, clearSelectedItems: function () {
var g = this, f = g._selectedItemsInternal, d = g._selectedIndexes;
if (f.length > 0) {
var a = f.length - 1;
while (a >= 0) {
var e = f[a], b = $find(e.id);
if (b) {
b.set_selected(false);
} else {
var c = $get(e.id);
if (c) {
g._selection._selectRowInternal(c, {ctrlKey: false}, true, true, true);
} else {
Array.remove(f, e);
Array.remove(d, d[a]);
g.updateClientState();
}
}
a--;
}
}
}, clearSelectedCells: function () {
if (this._cellSelection != null) {
this._cellSelection._clear();
}
}, _initializeTableViews: function () {
var a = eval(this._gridTableViewsData);
for (var e = 0;
e < a.length;
e++) {
var d = a[e];
if (!d.ClientID) {
continue;
}
if ($find(d.ClientID) != null) {
continue;
}
if ($get(d.ClientID) == null) {
continue;
}
if (this._masterClientID != d.ClientID) {
this.raise_tableCreating(new Sys.EventArgs());
}
var f = $create(Telerik.Web.UI.GridTableView, {_owner: this, _data: d}, null, null, $get(d.ClientID));
if (this._masterClientID != d.ClientID) {
var b = new Sys.EventArgs();
b.get_tableView = function () {
return f;
};
Array.add(this._detailTables, f);
this.raise_tableCreated(b);
}
if (this._masterClientID == d.ClientID) {
this.raise_masterTableViewCreating(new Sys.EventArgs());
this.MasterTableView = f;
this.raise_masterTableViewCreated(new Sys.EventArgs());
if ($get(d.ClientID + "_Header")) {
if ($telerik.isIE && document.documentMode && document.documentMode == 7) {
if (this.MasterTableView.get_element().style.width == "100%") {
this.MasterTableView.get_element().style.width = "auto";
}
}
this.MasterTableViewHeader = $create(Telerik.Web.UI.GridTableView, {
_owner: this,
_data: d
}, null, null, $get(d.ClientID + "_Header"));
if ($telerik.isIE && document.documentMode && document.documentMode == 7 && this.MasterTableViewHeader != null) {
var c = this.MasterTableViewHeader.get_element().getElementsByTagName("COL").length;
if (c > 0) {
$telerik.getChildrenByTagName(this.MasterTableViewHeader.get_element(), "tbody")[0].getElementsByTagName("TD")[0].colSpan = c;
}
}
this.MasterTableView._columnsInternal = this.MasterTableViewHeader._columnsInternal;
}
if ($get(d.ClientID + "_Footer")) {
this.MasterTableViewFooter = $create(Telerik.Web.UI.GridTableView, {
_owner: this,
_data: d
}, null, null, $get(d.ClientID + "_Footer"));
}
}
}
}, get_detailTables: function () {
return this._detailTables;
}, get_enableAriaSupport: function () {
return this._enableAriaSupport;
}, _initializeAriaSupport: function () {
var F = this.get_element();
F.setAttribute("aria-readonly", "true");
if (this.ClientSettings.Selecting.AllowRowSelect && this.get_allowMultiRowSelection()) {
F.setAttribute("aria-multiselectable", "true");
}
var y = this.get_masterTableView();
var k = y.get_columns();
var o = y._data.EditMode;
var C = y.get_dataItems();
for (var s = 0;
s < C.length;
s++) {
var z = C[s];
var f = this.ClientSettings;
if (f && f.AllowRowsDragDrop && f.Selecting && f.Selecting.AllowRowSelect) {
var B = z.get_element();
B.setAttribute("aria-dropeffect", "move");
}
for (var w = 0;
w < k.length;
w++) {
var g = k[w];
var n = null;
var h = g.get_element();
if (h.style.display == "none") {
h.setAttribute("aria-hidden", "true");
}
if (f.AllowColumnsReorder) {
h.setAttribute("aria-dropeffect", "move");
}
var E = g.get_uniqueName();
if (g._data.ColumnType == "GridEditCommandColumn" && o == "PopUp") {
n = E;
}
var a = z.get_cell(E);
if (g._data.ColumnType == "GridClientSelectColumn") {
var d = a.getElementsByTagName("input");
if (d.length > 0) {
var c = d[0];
if (c.id && c.id.indexOf("SelectCheckBox") != -1 && c.checked) {
c.setAttribute("aria-checked", c.checked);
}
}
}
if (a.style.display == "none") {
a.setAttribute("aria-hidden", "true");
}
if (g.get_readOnly()) {
a.setAttribute("aria-readonly", "true");
}
if (n && o == "PopUp") {
if (a && a.firstChild && (a.firstChild.tagName.toLowerCase() == "img" || a.firstChild.tagName.toLowerCase() == "a" || a.firstChild.tagName.toLowerCase() == "input")) {
a.firstChild.setAttribute("aria-haspopup", "true");
}
}
}
}
if (this._detailTables.length) {
F.setAttribute("role", "treegrid");
} else {
F.setAttribute("role", "grid");
}
var t = function (i) {
i.setAttribute("role", "columnheader");
if (!i.parentNode.getAttribute("role")) {
i.parentNode.setAttribute("role", "row");
}
var G = i.getElementsByTagName("a")[0];
if (G) {
var j = i.getElementsByTagName("input")[0];
if (j) {
if (j.className.indexOf("rgSortAsc") > -1) {
i.setAttribute("aria-sort", "ascending");
} else {
if (j.className.indexOf("rgSortDesc") > -1) {
i.setAttribute("aria-sort", "descending");
}
}
} else {
i.setAttribute("aria-sort", "none");
}
}
};
if (F.querySelectorAll) {
var r = F.querySelectorAll("th.rgHeader");
for (var s = 0, x = r.length;
s < x;
s++) {
t(r[s]);
}
} else {
var r = F.getElementsByTagName("th");
for (var s = 0, x = r.length;
s < x;
s++) {
var q = r[s];
if (q.className.indexOf("rgHeader") > -1) {
t(q);
}
}
}
var b = F.getElementsByTagName("td");
for (var s = 0, x = b.length;
s < x;
s++) {
var a = b[s];
var z = a.parentNode;
var A = z.className;
if (a.className.indexOf("rgExpandCol") > -1 || a.className.indexOf("rgGroupCol") > -1) {
a.setAttribute("role", "presentation");
if (A.indexOf("rgGroupHeader") > -1 || z.id) {
var p = a.getElementsByTagName("input")[0];
if (p) {
if (p.className.indexOf("rgCollapse") > -1) {
z.setAttribute("aria-expanded", "true");
p.setAttribute("aria-expanded", "true");
} else {
if (p.className.indexOf("rgExpand") > -1) {
z.setAttribute("aria-expanded", "false");
p.setAttribute("aria-expanded", "false");
}
}
}
if (A.indexOf("rgGroupHeader") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "rowgroup");
}
}
} else {
if (A.indexOf("rgRow") > -1 || A.indexOf("rgAltRow") > -1 || A.indexOf("rgFooter") > -1) {
a.setAttribute("role", "gridcell");
if (!z.getAttribute("role")) {
z.setAttribute("role", "row");
if (A.indexOf("rgSelectedRow") > -1) {
z.setAttribute("aria-selected", "true");
z.tabIndex = 1;
}
}
} else {
if (a.className.indexOf("rgCommandCell") > -1 && !z.getAttribute("role")) {
a.setAttribute("role", "presentation");
z.setAttribute("role", "presentation");
} else {
if (z.className.indexOf("rgPager") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "presentation");
var m = z.getElementsByTagName("div");
for (var s = 0;
s < m.length;
s++) {
var l = m[s];
if (l.className && l.className.indexOf("rgWrap") > -1) {
var v = l.getElementsByTagName("input");
for (var w = 0;
w < v.length;
w++) {
var u = v[w];
var e = u.className;
if (u.type == "submit" && e && (e.indexOf("PagePrev") > -1 || e.indexOf("PageFirst") > -1 || e.indexOf("PageNext") > -1 || e.indexOf("PageLast") > -1 || e.indexOf("PagerButton") > -1)) {
u.setAttribute("role", "button");
}
}
}
}
} else {
if (z.className.indexOf("rgEditRow") > -1 && !z.getAttribute("role")) {
z.setAttribute("role", "row");
z.setAttribute("aria-readonly", "false");
} else {
if (!z.id) {
var D = z.parentNode.tagName.toLowerCase() === "table" ? z.parentNode : z.parentNode.parentNode;
if (D && D.className.indexOf("rgMasterTable") > -1 || D.className.indexOf("rgDetailTable") > -1) {
if (!z.getAttribute("role")) {
z.setAttribute("role", "presentation");
}
}
}
}
}
}
}
}
}
if (this._groupPanel) {
this._groupPanel.get_element().setAttribute("role", "presentation");
}
}, _applyCellSpacingIfRequired: function () {
if ($telerik.isIE && document.documentMode && document.documentMode < 8) {
var d = this.get_element().getElementsByTagName("table");
for (var a = 0, b = d.length;
a < b;
a++) {
var c = d[a];
if (c.className.indexOf("rgMasterTable") > -1 || c.className.indexOf("rgDetailTable") > -1 || c.className.indexOf("rgGroupPanel") > -1 || parseInt(c.style.borderSpacing) === 0) {
if (c.getAttribute("cellSpacing") == "") {
c.setAttribute("cellSpacing", "0");
c.cellSpacing = 0;
}
}
}
}
}, _initializeEvents: function (a) {
if (a) {
var e = this;
for (var b = 0, c = a.length;
b < c;
b++) {
var d = a[b];
this["add_" + d] = function (f) {
return function (g) {
this.get_events().addHandler(f, g);
};
}(d);
this["remove_" + d] = function (f) {
return function (g) {
this.get_events().removeHandler(f, g);
};
}(d);
this["raise_" + d] = function (f) {
return function (g) {
this.raiseEvent(f, g);
};
}(d);
}
}
}, _selectAllRows: function (l, d, a) {
var b = (a.srcElement) ? a.srcElement : a.target;
var k = $find(l);
var j = k.get_element();
var h = (b.checked) ? true : false;
for (var c = 0, f = j.rows.length;
c < f;
c++) {
var g = j.rows[c];
if (!g.id || g.style.display == "none") {
continue;
}
this._selection._selectRowInternal(g, a, true, false, false, h);
}
if (j.rows.length > 0) {
this.updateClientState();
}
}, _showFilterMenu: function (l, n, c) {
var k = $find(l);
var b = k.getColumnByUniqueName(n);
var g = this._getFilterMenu();
if (this._filterMenu) {
this._filterMenu.hide();
var j = this._filterMenu;
var a = new Sys.CancelEventArgs();
a.get_menu = function () {
return j;
};
a.get_tableView = function () {
return k;
};
a.get_column = function () {
return b;
};
a.get_domEvent = function () {
return c;
};
this.raise_filterMenuShowing(a);
if (a.get_cancel()) {
return;
}
this._buildFilterMenuItemList(this._filterMenu, b._data.FilterListOptions, b._data.DataTypeName, b._data.CurrentFilterFunction, b);
this._onFilterMenuClicking = Function.createDelegate(this, this._filterMenuClickingHandler);
this._filterMenu.add_itemClicking(this._onFilterMenuClicking);
var d = Telerik.Web.UI.Grid.GetCurrentElement(c);
if (d) {
$telerik.addCssClasses(d, ["rgFilterActive"]);
}
this._onFilterMenuHiddenDelegate = Function.createDelegate({
opener: d,
context: this
}, this._onFilterMenuHidden);
this._filterMenu.add_hidden(this._onFilterMenuHiddenDelegate);
if ($telerik.isTouchDevice) {
var i = $telerik.getTouchEventLocation(c).x;
var m = $telerik.getTouchEventLocation(c).y;
this._filterMenu.showAt(i, m);
$telerik.cancelRawEvent(c);
} else {
var f = $telerik.getLocation(d);
this._filterMenu.showAt(f.x + (d.offsetWidth / 2), f.y + (d.offsetHeight / 2));
$telerik.cancelRawEvent(c);
var h = this._filterMenu.get_focusedItem() || this._filterMenu.get_items().getItem(0);
if (c.clientX == 0 && c.clientY == 0) {
if (h._linkElement) {
h._linkElement.focus();
} else {
if (h._templateElement) {
h._templateElement.focus();
}
}
}
}
}
}, _onFilterMenuHidden: function (b, a) {
if (this.opener) {
$telerik.removeCssClasses(this.opener, ["rgFilterActive"]);
this.opener = null;
}
if (this.context && this.context._filterMenu) {
if (this.context._onFilterMenuClicking) {
this.context._filterMenu.remove_itemClicking(this.context._onFilterMenuClicking);
}
if (this.context._onFilterMenuHiddenDelegate) {
this.context._filterMenu.remove_hidden(this.context._onFilterMenuHiddenDelegate);
}
this.context._onFilterMenuHiddenDelegate = null;
}
}, _getFilterMenu: function () {
if (Telerik.Web.UI.RadContextMenu && !this._filterMenu) {
this._filterMenu = $find(this.ClientID + "_rfltMenu");
}
return this._filterMenu;
}, get_headerMenu: function () {
return this._getHeaderContextMenu();
}, _getHeaderContextMenu: function () {
if (Telerik.Web.UI.RadContextMenu && !this._headerContextMenu) {
this._headerContextMenu = $find(this.ClientID + "_rghcMenu");
}
return this._headerContextMenu;
}, _filterMenuClickingHandler: function (g, c) {
var i = c.get_item()._filterMenu_tableID;
if (!i) {
c.set_cancel(true);
return;
}
var h = $find(i);
if (!h) {
c.set_cancel(true);
return;
}
var d = c.get_item().get_value();
var b = c.get_item()._filterMenu_column_uniqueName;
var e = h._getFilterControlValue(b);
var a = h._raiseAction("Filter", {filterFunction: d, columnUniqueName: b, filterValue: e});
if (a.get_cancel()) {
c.get_item().set_focused(false);
c.set_cancel(true);
return;
}
d = a.get_filterFunction();
b = a.get_columnUniqueName();
e = a.get_filterValue();
if (d == "NoFilter") {
h._updateFilterControlValue(e, b, d);
} else {
if ((e == null || e === "") && d != "IsEmpty" && d != "NotIsEmpty" && d != "IsNull" && d != "NotIsNull") {
g.hide();
return;
}
}
if (!h.filter(b, e, d)) {
var f = this.get_masterTableView();
if (f) {
f.__shouldPerformFiltering = false;
}
c.set_cancel(true);
this._filterMenu.remove_itemClicking(this._onFilterMenuClicking);
}
g.hide();
}, _checkListItemsRequestedHandler: function () {
if (this._checkListFilterActiveColumn && this._checkListFilterActiveColumn) {
var e = $find(this._filterCheckListClientID);
e.set_visible(true);
var c = this._checkListFilterActiveColumn.get_owner()._data.UniqueID + "," + this._checkListFilterActiveColumn.get_uniqueName();
var b = -1;
for (var f = 0;
f < this._checkListFilterKeys.length;
f++) {
if (this._checkListFilterKeys[f] == c) {
b = f;
break;
}
}
if (b >= 0 && b < this._checkListFilterValues.length && this._checkListFilterValues[b] && this._checkListFilterValues[b].length > 0) {
var j = {};
for (var f = 0;
f < this._checkListFilterValues[b].length;
f++) {
j[this._checkListFilterValues[b][f]] = true;
}
var d = e.get_items().get_count();
for (var g = 0;
g < d;
g++) {
var h = e.get_items().getItem(g);
if (j[h.get_text()]) {
h.check();
}
}
}
d = e.get_items().get_count();
for (g = 0;
g < d;
g++) {
h = e.get_items().getItem(g);
if (h.get_text() === "") {
h.set_text("(null)");
}
}
}
}, _checkListFilterCancelButtonHandler: function () {
this._filterMenu.hide();
}, _resetCheckListFilterOfColumn: function (b) {
var d = b.get_owner()._data.UniqueID + "," + b.get_uniqueName();
var c = this._checkListFilterKeys.length;
for (var a = 0;
a < this._checkListFilterKeys.length;
a++) {
if (this._checkListFilterKeys[a] == d) {
c = a;
break;
}
}
this._checkListFilterKeys[c] = d;
this._checkListFilterValues[c] = [];
return c;
}, _checkListFilterApplyButtonHandler: function () {
var e = $find(this._filterCheckListClientID);
var b = this._checkListFilterActiveColumn;
var c = this._resetCheckListFilterOfColumn(b);
var k = $find(b.get_owner().get_id().replace("_Header", ""));
var f = "rgFiltered", d = $telerik.getElementByClassName(k._getFilterCellByColumnUniqueName(b.get_uniqueName()), "rgFilter");
var a = e.get_items()._array;
if (!e._allChecked) {
for (var j = 0;
j < a.length;
j++) {
if (a[j].get_checkBoxElement().checked) {
var h = a[j].get_text();
if (h === "(null)") {
h = "";
}
this._checkListFilterValues[c][this._checkListFilterValues[c].length] = h;
}
}
}
var g = k._filterExpressions.find(b.get_uniqueName());
if (this._checkListFilterValues[c].length > 0) {
if (!g) {
g = new Telerik.Web.UI.GridFilterExpression();
g.set_fieldName(b._data.DataField);
g.set_dataTypeName(b._data.DataTypeName);
g.set_columnUniqueName(b.get_uniqueName());
k._filterExpressions.add(g);
}
Sys.UI.DomElement.addCssClass(d, f);
g.set_filterFunction(Telerik.Web.UI.GridFilterFunction.EqualTo);
g._checkListFilterValues = this._checkListFilterValues[c];
} else {
if (g) {
g.set_filterFunction(Telerik.Web.UI.GridFilterFunction.NoFilter);
g._checkListFilterValues = this._checkListFilterValues[c];
k._filterExpressions.remove(g);
}
Sys.UI.DomElement.removeCssClass(d, f);
}
this._filterMenu.hide();
this.updateClientState();
k.fireCommand("Filter", b.get_uniqueName() + "|?|?" + (g ? Telerik.Web.UI.GridFilterFunction.EqualTo : Telerik.Web.UI.GridFilterFunction.NoFilter));
}, _buildFilterMenuItemList: function (p, l, h, f, b) {
var c = b._data.ColumnType;
var j = b._data.EnableRangeFiltering;
var o = null;
if (this._filterCheckListClientID) {
var k = $find(this._filterCheckListClientID);
this._checkListFilterActiveColumn = b;
k.get_items().clear();
var a = "";
if (b._owner._data.CheckListWebServicePath && b._data.FilterCheckListWebServiceMethod) {
k.set_visible(true);
k.get_webServiceSettings().set_path(b._owner._data.CheckListWebServicePath);
k.get_webServiceSettings().set_method(b._data.FilterCheckListWebServiceMethod);
k.requestItems();
} else {
if (b._data.FilterCheckListEnableLoadOnDemand) {
k.set_visible(true);
var g = {startIndex: 0, count: 0};
var d = b.get_uniqueName();
var e = {columnUniqueName: d};
k._doLoadOnDemandWithCallBack(e, g);
} else {
k.set_visible(false);
a = "None";
}
}
this._filterApplyButton.style.display = a;
this._filterCancelButton.style.display = a;
}
if (p.get_items().get_count() > 0 && p.get_items().getItem(0).get_items().get_count() > 0) {
p = p.get_items().getItem(0);
}
for (var m = 0;
m < p.get_items().get_count();
m++) {
var n = p.get_items().getItem(m);
o = n.get_value();
n._filterMenu_column_uniqueName = b.get_uniqueName();
n._filterMenu_tableID = b._owner._data.ClientID;
if (this._clientSideBinding && this._clientSideBinding._clientDataSource) {
if (o == "DoesNotContain" || o == "IsEmpty" || o == "NotIsEmpty" || o == "IsNull" || o == "NotIsNull" || o == "Between" || o == "NotBetween") {
n.set_visible(false);
continue;
}
}
if (h == "System.Boolean") {
if ((o == "GreaterThan") || (o == "LessThan") || (o == "GreaterThanOrEqualTo") || (o == "LessThanOrEqualTo") || (o == "Between") || (o == "NotBetween")) {
n.set_visible(false);
continue;
}
}
if (h != "System.String") {
if ((o == "StartsWith") || (o == "EndsWith") || (o == "Contains") || (o == "DoesNotContain") || (o == "IsEmpty") || (o == "NotIsEmpty")) {
n.set_visible(false);
continue;
}
}
if (l == 0) {
if (o == "Custom") {
n.set_visible(false);
continue;
}
}
if (c == "GridDateTimeColumn" && j && (o == "EqualTo" || o == "GreaterThan" || o == "GreaterThanOrEqualTo" || o == "LessThan" || o == "LessThanOrEqualTo" || o == "NotEqualTo")) {
n.set_visible(false);
continue;
}
if (((c == "GridDateTimeColumn" && !j) || c == "GridMaskedColumn" || c == "GridNumericColumn" || c == "GridRatingColumn") && ((o == "Between") || (o == "NotBetween"))) {
n.set_visible(false);
continue;
}
if (o == b._data.CurrentFilterFunctionName) {
n._focused = true;
p._focusedItem = n;
n._updateLinkClass();
} else {
n._focused = false;
n._updateLinkClass();
}
n.set_visible(true);
}
}, saveClientState: function () {
var c = {};
c.selectedIndexes = this._selectedIndexes;
c.selectedCellsIndexes = this._selectedCellsIndexes;
c.unselectableItemsIndexes = this._unselectableItemsIndexes;
c.reorderedColumns = this._reorderedColumns;
c.expandedItems = this._expandedItems;
c.expandedGroupItems = this._expandedGroupItems;
if (this._expandedFilterItems) {
c.expandedFilterItems = this._expandedFilterItems;
}
c.deletedItems = this._deletedItems;
if (this._resizedColumns != "") {
c.resizedColumns = this._resizedColumns;
}
if (this._resizedControl != "") {
c.resizedControl = this._resizedControl;
}
if (this._resizedItems != "") {
c.resizedItems = this._resizedItems;
}
if (this._hidedItems != "") {
c.hidedItems = this._hidedItems;
}
if (this._showedItems != "") {
c.showedItems = this._showedItems;
}
if (this._hidedColumns) {
c.hidedColumns = this._hidedColumns;
}
if (this._showedColumns) {
c.showedColumns = this._showedColumns;
}
if (this._groupColsState) {
c.groupColsState = this._groupColsState;
}
if (this._hierarchyColsExpandedState) {
c.hierarchyState = this._hierarchyColsExpandedState;
}
if (this._activeRow) {
c.activeRowIndex = this._activeRow.id;
}
if (this._gridDataDiv) {
var a = this.get_masterTableView(), d = a._virtualization;
scrollTop = d && d._haveCustomScrollbar && d._scrollbar ? d._scrollbar.scrollTop : this._gridDataDiv.scrollTop;
if ($get(this.ClientID + "_Frozen")) {
c.scrolledPosition = scrollTop + "," + $get(this.ClientID + "_Frozen").scrollLeft;
} else {
c.scrolledPosition = scrollTop + "," + this._gridDataDiv.scrollLeft;
}
if (d && a.get_allowPaging() && a.get_currentPageIndex() > 0) {
c.currentPageIndex = a.get_currentPageIndex();
}
if (d && d._itemAtTop) {
c.itemAtTop = d._itemAtTop;
c.startIndex = d._startIndex;
}
}
if (this._popUpLocations) {
c.popUpLocations = this._popUpLocations;
}
if (this._draggedItemsIndexes) {
c.draggedItemsIndexes = this._draggedItemsIndexes;
}
if (this._shouldFocusOnPage) {
c.shouldFocusOnPage = this._shouldFocusOnPage;
}
var b = this._selection;
if (b && b._lastSelectedItemIndex != null) {
c.lastSelectedItemIndex = b._lastSelectedItemIndex;
}
if (this._checkListFilterKeys && this._checkListFilterKeys.length > 0) {
c.checkListFilterKeys = this._checkListFilterKeys;
c.checkListFilterValues = this._checkListFilterValues;
}
return Sys.Serialization.JavaScriptSerializer.serialize(c);
}, _attachDomEvents: function () {
this._onKeyDownDelegate = Function.createDelegate(this, this._onKeyDownHandler);
this._onKeyPressDelegate = Function.createDelegate(this, this._onKeyPressHandler);
this._onMouseMoveDelegate = Function.createDelegate(this, this._onMouseMoveHandler);
$addHandler(this.get_element(), "keydown", this._onKeyDownDelegate);
$addHandler(this.get_element(), "keypress", this._onKeyPressDelegate);
$addHandler(this.get_element(), "mousemove", this._onMouseMoveDelegate);
}, _detachDomEvents: function () {
if (this._onKeyDownDelegate) {
$removeHandler(this.get_element(), "keydown", this._onKeyDownDelegate);
this._onKeyDownDelegate = null;
}
if (this._onKeyPressDelegate) {
$removeHandler(this.get_element(), "keypress", this._onKeyPressDelegate);
this._onKeyPressDelegate = null;
}
if (this._onMouseMoveDelegate) {
$removeHandler(this.get_element(), "mousemove", this._onMouseMoveDelegate);
this._onMouseMoveDelegate = null;
}
}, _onMouseMoveHandler: function (b) {
var a = Telerik.Web.UI.Grid.GetCurrentElement(b);
if (this.ClientSettings && this.ClientSettings.Resizing.AllowRowResize) {
if (this._gridItemResizer == null) {
this._gridItemResizer = new Telerik.Web.UI.GridItemResizer(this);
}
this._gridItemResizer._detectResizeCursorsOnItems(b, a);
this._gridItemResizer._moveItemResizer(b);
}
}, _onKeyDownHandler: function (c) {
var d = c.keyCode || c.charCode;
if (this._isShortCutKeyPressed(c)) {
this._raiseKeyPressInternal(c);
}
var b = d == this.ClientSettings.KeyboardNavigationSettings.DeleteActiveRow;
if (b) {
this._raiseKeyPressInternal(c);
}
var a = (d >= 37 && d <= 40);
var f = (d == 33 || d == 34);
if ((($telerik.isIE || $telerik.isChrome || $telerik.isSafari || $telerik.isOpera) && (a || f)) || (($telerik.isChrome || $telerik.isSafari || $telerik.isOpera) && d == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey)) {
this._raiseKeyPressInternal(c);
}
if (this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && this.get_batchEditingManager()) {
this.get_batchEditingManager()._handleKeyboardNavigation(c);
}
}, _onKeyPressHandler: function (a) {
this._raiseKeyPressInternal(a);
}, _raiseKeyPressInternal: function (b) {
var a = new Telerik.Web.UI.GridKeyPressEventArgs(b);
this.raise_keyPress(a);
if (a.get_cancel()) {
return;
}
this._handleGridKeyboardAction(b);
}, _validateEditInsertForm: function (a) {
if (this.ValidationSettings.EnableValidation) {
var b = this.ValidationSettings.CommandsToValidate;
if (b.toString().indexOf(a) > -1) {
var c = this._validationGroup;
if (typeof(Page_ClientValidate) == "function") {
var d = Page_ClientValidate(c);
if (d != true) {
return false;
}
}
}
}
return true;
}, _getTableViewByControlIntoIt: function (a) {
var h = a.id.split("_");
var f = 0;
for (var e = 0;
e < h.length;
e++) {
if (h[e].indexOf("Detail") > -1) {
f = e;
}
}
var c = "";
var d = new Array();
if (f > 0) {
for (var e = 0;
e < f + 1;
e++) {
d.push(h[e]);
}
c = d.join("_");
}
if (!c) {
var g = Telerik.Web.UI.Grid.GetFirstParentByTagName(a, "table");
while (g && g.id.indexOf(this.ClientID) == -1) {
g = Telerik.Web.UI.Grid.GetFirstParentByTagName(g.parentNode, "table");
}
if (g) {
c = g.id;
}
}
var b = $find(c);
if (!b) {
b = this.get_masterTableView();
}
return b;
}, _cancelDefaultAction: function (a) {
if (a.preventDefault) {
a.preventDefault();
}
a.returnValue = false;
if (a.stopPropagation) {
a.stopPropagation();
a.cancelBubble = true;
}
}, _handleGridKeyboardAction: function (f) {
var m = f.keyCode || f.charCode;
if (this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.Selecting.CellSelectionMode == Telerik.Web.UI.GridCellSelectionMode.None) {
var a = this._allowSubmitOnEnter;
var b = this._canHandleKeyboardAction(f);
if (!b && !a) {
return;
} else {
if ((a) && (m == 13)) {
var q = Telerik.Web.UI.Grid.GetCurrentElement(f);
if (q.type && q.type.toLowerCase() == "textarea") {
return;
}
var k = false;
for (var l = 0;
l < this._submitControls.length;
l++) {
if ((q.tagName.toLowerCase() == this._submitControls[l].Name) && (q.type.toLowerCase() == this._submitControls[l].Type)) {
k = true;
}
}
if (q.type && !k && q.type.toLowerCase() == "checkbox") {
this._cancelDefaultAction(f);
return;
}
if (!k && (this._editIndexes.length > 0)) {
return;
}
var d = this._getTableViewByControlIntoIt(q);
if (k && d.get_isItemInserted()) {
if (this._validateEditInsertForm("PefrormInsert")) {
d.insertItem();
this._cancelDefaultAction(f);
return;
}
}
}
}
var o = (m == 38 || m == 40);
var p = this._shouldSelectOnSpace(f, m);
var g = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == 13);
var j = (m == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey || m == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey);
var n = (m == 33 || m == 34) && b;
var h = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey || m == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey);
var c = this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts && (m == this.ClientSettings.KeyboardNavigationSettings.DeleteActiveRow);
if (o) {
this._handleActiveRowNavigation(f);
} else {
if (j) {
if (this.get_id() === f.target.id) {
this._handleActiveRowExpandCollapse(f);
}
} else {
if (p) {
this._handleActiveRowSelection(f);
} else {
if (h) {
this._handleExitEditModeOrUpdateItem(f, m);
if ((typeof(f.rawEvent.returnValue) == "undefined" || (typeof(f.rawEvent.returnValue) == "boolean" && f.rawEvent.returnValue)) && m == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
this._handleActiveRowEdit(f);
this._cancelDefaultAction(f);
}
} else {
if (c) {
this._handleDeleteActiveRow();
} else {
if (n) {
this._handlePaging(f);
} else {
if (f.ctrlKey) {
this._handleShortCutKey(f);
}
}
}
}
}
}
}
}
}, _shouldSelectOnSpace: function (a, b) {
var d = a.target.tagName.toUpperCase();
var c = this.ClientSettings.Selecting;
if (b == 32 && c && c.AllowRowSelect && d != "INPUT" && d != "TEXTAREA") {
return true;
}
return false;
}, _canHandleKeyboardAction: function (a) {
var c = a.keyCode || a.charCode;
if ((c == 32 || c == 13 || c == 33 || c == 34 || c == 127) && this.ClientSettings.KeyboardNavigationSettings.EnableKeyboardShortcuts) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(a);
var b = (d.tagName.toLowerCase() == "input" && d.type.toLowerCase() == "checkbox" && (d.id && d.id.indexOf("SelectCheckBox") != -1));
if (c == 127 && d.tagName.toLowerCase() == "input" && d.type == "text") {
return false;
}
if (c == 33 || c == 34) {
if (d.tagName.toLowerCase() == "input" || d.tagName.toLowerCase() == "textarea") {
return false;
}
} else {
if ((d.tagName.toLowerCase() == "input" && !b) || d.tagName.toLowerCase() == "select" || d.tagName.toLowerCase() == "option" || d.tagName.toLowerCase() == "button" || d.tagName.toLowerCase() == "a" || d.tagName.toLowerCase() == "textarea" || d.tagName.toLowerCase() == "img") {
return false;
}
}
}
return true;
}, _handleShortCutKey: function (a) {
var b = a.keyCode || a.charCode;
switch (b) {
case this.ClientSettings.KeyboardNavigationSettings.InitInsertKey:
if (this._activeRow) {
this._getRow(this._activeRow.id).get_owner().showInsertItem();
a.preventDefault();
}
break;
case this.ClientSettings.KeyboardNavigationSettings.RebindKey:
if (this._activeRow) {
this._getRow(this._activeRow.id).get_owner().rebind();
a.preventDefault();
}
break;
default:
break;
}
}, _isShortCutKeyPressed: function (a) {
var b = a.keyCode || a.charCode;
if (a.ctrlKey) {
switch (b) {
case this.ClientSettings.KeyboardNavigationSettings.InitInsertKey:
return true;
break;
case this.ClientSettings.KeyboardNavigationSettings.RebindKey:
return true;
break;
default:
return false;
break;
}
}
}, _handleDeleteActiveRow: function () {
if (this._activeRow) {
var a = $find(this._activeRow.id.split("__")[0]);
if (a) {
a.deleteItem(this._activeRow);
}
}
}, _getRow: function (b) {
var a = $find(b);
if (!a) {
var d = b.split("__")[0];
var c = $find(d);
this._ensureDataItemsCreated(c);
a = $find(b);
}
return a;
}, _handlePaging: function (a) {
var c = null;
var d = null;
var b = a.keyCode || a.charCode;
var f = null;
if (this._activeRow) {
f = this._getRow(this._activeRow.id).get_owner();
c = f.get_currentPageIndex();
d = f.get_pageCount();
}
if (b == 33) {
c++;
if (c < d) {
this._shouldFocusOnPage = true;
this.updateClientState();
if (this._activeRow) {
f.page("Next");
}
}
} else {
c--;
if (c > -1) {
this._shouldFocusOnPage = true;
this.updateClientState();
if (this._activeRow) {
f.page("Prev");
}
}
}
a.rawEvent.returnValue = false;
a.rawEvent.cancelBubble = true;
if (a.stopPropagation) {
a.preventDefault();
a.stopPropagation();
}
}, _handleExitEditModeOrUpdateItem: function (f, h) {
var d = Telerik.Web.UI.Grid.GetCurrentElement(f);
var m = Telerik.Web.UI.Grid.GetFirstParentByTagName(d, "tr");
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey && this._activeRow && this._getRow(this._activeRow.id)._owner.get_isItemInserted()) {
this._getRow(this._activeRow.id)._owner.cancelInsert();
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
return false;
}
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
if (this._activeRow) {
var c = this._activeRow.id;
var a = $find(c);
if (!a) {
var o = $find(c.split("__")[0]);
this._owner._ensureDataItemsCreated(o);
a = $find(c);
}
if (a.get_isInEditMode()) {
var b = a.get_element();
var j = this.isGridDataRow(b);
j.cancelUpdate(b);
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
}
}
return false;
}
if (m == null || typeof(m) == "undefined") {
return false;
}
var n = this.isGridDataRow(m);
if (n != null && typeof(n) != "undefined") {
if (this.isInEditModeByHierarchicalIndex(m.id.split("__")[1])) {
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
n.cancelUpdate(m);
} else {
if (h == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
if (this._validateEditInsertForm("Update")) {
n.updateItem(m);
}
}
}
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
return false;
}
} else {
var k = $telerik.$(d).parents("tr");
var l;
for (var g = 0;
g < k.length;
g++) {
l = k[g].previousSibling;
if (l != null && typeof(l) != "undefined" && l.tagName == "TR") {
n = this.isGridDataRow(l);
if (n != null && typeof(n) != "undefined") {
if (h == this.ClientSettings.KeyboardNavigationSettings.ExitEditInsertModeKey) {
n.cancelUpdate(l);
} else {
if (h == this.ClientSettings.KeyboardNavigationSettings.UpdateInsertItemKey) {
if (this._validateEditInsertForm("Update")) {
n.updateItem(l);
}
}
}
f.rawEvent.returnValue = false;
f.rawEvent.cancelBubble = true;
if (f.stopPropagation) {
f.preventDefault();
f.stopPropagation();
}
break;
}
}
}
return false;
}
}, isGridDataRow: function (d) {
if (d.id == "") {
return;
}
var a = this.get_masterTableView()._getRowByIndexOrItemIndexHierarchical(d);
var c = a.id.split("__")[0];
var b = $find(c);
if (b != null && typeof(b) != "undefined") {
return b;
} else {
return;
}
}, isInEditModeByHierarchicalIndex: function (a) {
if (this._editIndexes != null && typeof(this._editIndexes) != "undefined") {
for (var b = 0;
b < this._editIndexes.length;
b++) {
if (this._editIndexes[b] == a) {
return true;
}
}
return false;
} else {
return false;
}
}, _shouldSkipNavigation: function (a) {
var b = (a.tagName.toLowerCase() == "input" && a.type.toLowerCase() == "checkbox" && (a.id && a.id.indexOf("SelectCheckBox") != -1));
var c = a && a.className && a.className.indexOf("RadDropDownList") != -1;
if (a != null && a.tagName && !b && (a.tagName.toLowerCase() == "input" || a.tagName.toLowerCase() == "textarea" || a.tagName.toLowerCase() == "select" || c)) {
return true;
}
return false;
}, _handleActiveRowNavigation: function (m) {
var q = m.keyCode || m.charCode;
var c = Telerik.Web.UI.Grid.GetCurrentElement(m);
if (this._shouldSkipNavigation(c)) {
return;
}
var A = this._getPositionedDataItems();
if (A.length <= 0) {
return;
}
var z = this._keyboardNavigationProperties;
var F = 38;
var k = 40;
var h = this.get_allowActiveRowCycle();
var a = this._activeRow;
var b = this.ClientSettings;
if (a && b.Selecting && !b.Selecting.AllowRowSelect) {
z.currentSelectedIndex = this._searchRowIndex(a.id);
}
if (b.Selecting && b.Selecting.AllowRowSelect) {
this._selection._selectionInProgress = true;
var D = this._selection;
var E = false;
var j = true;
var C = [];
for (var o = 0;
len = A.length, o < len;
o++) {
if (A[o].get_selected()) {
C[C.length] = A[o];
}
}
if (z.firstSelection) {
if (a) {
z.currentSelectedIndex = this._searchRowIndex(a.id);
this._clearSelectedItemsExcludingInterval(z.currentSelectedIndex, z.currentSelectedIndex);
z.lastSelectedRowIndex = z.currentSelectedIndex;
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
} else {
if (C.length > 0) {
z.currentSelectedIndex = this._searchRowIndex(C[0].get_id());
z.lastSelectedRowIndex = z.currentSelectedIndex;
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
}
}
z.setInitialState();
}
if (C.length > 1 && z.currentSelectedIndex !== undefined) {
if (z.lastClickSelectedItem) {
var s = this._searchRowIndex(z.lastClickSelectedItem.id);
if (s) {
z.currentSelectedIndex = s;
}
if (s && z.currentSelectedIndex === s && m.shiftKey) {
this._clearSelectedItemsExcludingInterval(s, s);
if (!A[z.currentSelectedIndex].get_selected()) {
D._selectRowInternal(A[z.currentSelectedIndex].get_element(), m, true, true, false);
}
E = true;
z.setInitialState();
}
}
} else {
if (C.length > 0 && z.lastClickSelectedItem) {
z.currentSelectedIndex = this._searchRowIndex(z.lastClickSelectedItem.id);
z.setInitialState();
} else {
if (!a) {
if (q == F) {
z.currentSelectedIndex = 1;
}
}
}
}
if (z.currentSelectedIndex == "undefined" || isNaN(z.currentSelectedIndex) || z.currentSelectedIndex == null) {
if (q == F) {
z.currentSelectedIndex = 1;
} else {
if (q == k) {
z.currentSelectedIndex = 0;
}
}
}
z.lastClickSelectedItem = null;
if ((z.holdingCtrl && m.shiftKey && !m.ctrlKey && !E)) {
z.setInitialState();
if (a && $find(a.id).get_selected() || C.length > 1 && !z.holdingCtrl) {
this._clearSelectedItemsExcludingInterval(z.initialRowIndex, z.initialRowIndex);
if (!A[z.initialRowIndex].get_selected()) {
D._selectRowInternal(A[z.initialRowIndex].get_element(), m, true, true, false);
}
} else {
var r = z.lastSelectedRowIndex;
z.initialRowIndex = r;
if ((z.currentSelectedIndex < r || h) && (q == F || !h && q == k)) {
if (r > z.currentSelectedIndex) {
this._clearSelectedItemsExcludingInterval(z.currentSelectedIndex, r);
} else {
this._clearSelectedItemsInInterval(r, z.currentSelectedIndex);
}
this._selectItemsInInterval(r, z.currentSelectedIndex, -1);
} else {
if (q == k || !h) {
if (z.currentSelectedIndex > r) {
this._clearSelectedItemsExcludingInterval(r, z.currentSelectedIndex);
} else {
this._clearSelectedItemsInInterval(z.currentSelectedIndex, r);
}
this._selectItemsInInterval(r, z.currentSelectedIndex, 1);
}
}
}
}
var v = z.currentSelectedIndex;
var y = A[z.currentSelectedIndex];
var w = z.directionIndex;
var x = z.currentSelectedIndex;
var f = q;
if (f == F) {
f = k;
} else {
f = F;
}
while (y && !y.get_selectable()) {
x = this._getNextIndex(f, false, x);
y = A[x];
}
var u = (z.directionIndex > 0 && q == k) || (z.directionIndex < 0 && q == F);
if (z.currentSelectedIndex === z.initialRowIndex && u && A.length - z.unselectableItemsCount === C.length) {
j = false;
}
}
z.currentSelectedIndex = this._getNextIndex(q, true);
if (b.Selecting && b.Selecting.AllowRowSelect) {
if ((!m.shiftKey || C.length === 0)) {
if (A[z.currentSelectedIndex].get_selectable()) {
z.setInitialState();
}
}
var G = z.directionIndex > 0 && q == F;
var l = z.directionIndex < 0 && q == k;
var t = z.currentSelectedIndex;
while (!A[t].get_selectable()) {
t = this._getNextIndex(q, false, t);
}
if (t === z.initialRowIndex && (G || l || (w !== 0 && z.directionIndex === 0))) {
if (A.length - z.unselectableItemsCount === C.length) {
j = false;
} else {
if (y.get_selected() && A[z.currentSelectedIndex].get_selectable() && !m.ctrlKey) {
var n = {ctrlKey: false};
D._selectRowInternal(y.get_element(), n, true, true, false);
}
var p = z.currentSelectedIndex;
z.currentSelectedIndex = t;
z.setInitialState();
z.currentSelectedIndex = p;
}
}
if (y && y.get_selected() && A[z.currentSelectedIndex].get_selected() && j) {
var d = z.currentSelectedIndex;
while (A[d] && !A[d].get_selectable()) {
d = this._getNextIndex(q, false, d);
}
if (!m.ctrlKey && m.shiftKey && A[d] && A[d].get_selected() && A[d].get_selectable()) {
if (y.get_selected()) {
var n = {ctrlKey: false};
D._selectRowInternal(y.get_element(), n, true, true, false);
}
}
} else {
if (y && !y.get_selected() && m.ctrlKey && m.shiftKey) {
var n = {ctrlKey: m.ctrlKey};
D._selectRowInternal(y.get_element(), n, true, true, false);
} else {
if (m.shiftKey && a && z.firstSelection) {
var g = z.currentSelectedIndex;
z.currentSelectedIndex = x;
z.setInitialState();
z.currentSelectedIndex = g;
if (!y.get_selected()) {
var n = {ctrlKey: false};
D._selectRowInternal(a, n, true, true, false);
}
}
}
}
if (m.ctrlKey) {
z.holdingCtrl = true;
} else {
z.holdingCtrl = false;
}
this._selection._selectionInProgress = false;
if (!m.shiftKey && !m.ctrlKey) {
this._selection._lastSelectedItemIndex = z.currentSelectedIndex;
}
}
this._setActiveRow(A[z.currentSelectedIndex].get_element(), m);
var B = false;
if (b.Selecting && b.Selecting.AllowRowSelect) {
if (!m.ctrlKey || m.ctrlKey && m.shiftKey) {
B = true;
D._selectRowInternal(A[z.currentSelectedIndex].get_element(), m, false, true, true, false);
}
if (!B) {
this.updateClientState();
}
if (a && $find(a.id) && $find(a.id).get_selected() && !m.shiftKey && m.ctrlKey && B) {
z.lastSelectedRowIndex = z.currentSelectedIndex;
}
}
z.firstSelection = false;
m.preventDefault();
}, _getNextIndex: function (g, b, f) {
var j = this._getPositionedDataItems(), i = this._keyboardNavigationProperties, d = this.get_allowActiveRowCycle(), l = 38, e = 40, c = i.currentSelectedIndex, h = this.get_masterTableView(), m = h._virtualization, k = m && m._haveCustomScrollbar ? m._getScrollInfo() : null, a = 0;
if (f) {
c = f;
}
if (g == l) {
c--;
if (c < 0) {
if (k) {
m.select(Math.max(m.get_startIndex() - j.length + Math.floor(k.itemAtBottom - k.itemAtTop), 0));
c = Math.floor(k.itemAtTop) - m.get_startIndex() - 1;
} else {
if (d) {
c = j.length - 1;
} else {
c = 0;
}
}
}
if (k && m.get_startIndex() + c < h.get_currentPageIndex() * h.get_pageSize()) {
c++;
} else {
if (k && m.get_startIndex() + c <= Math.floor(k.itemAtTop)) {
m.scrollToIndex(m.get_startIndex() + c);
}
}
if (b) {
i.directionIndex++;
}
} else {
if (g == e) {
c++;
if (c > j.length - 1) {
if (k) {
c = Math.min(Math.floor(k.itemAtBottom - k.itemAtTop), m.get_virtualItemCount());
a = j.length - Math.floor(k.itemAtBottom - k.itemAtTop);
} else {
if (d) {
c = 0;
} else {
c = j.length - 1;
}
}
}
if (k && m.get_startIndex() + c >= (h.get_currentPageIndex() + 1) * h.get_pageSize()) {
c--;
} else {
if (k && (m.get_startIndex() + c >= Math.floor(k.itemAtBottom) || a > 0)) {
m.scrollToIndex(m.get_startIndex() + c + a, true);
}
}
if (b) {
i.directionIndex--;
}
}
}
return c;
}, _clearSelectedItemsExcludingInterval: function (e, c) {
var a = 0;
var b = [];
for (var d = 0;
d < this._selectedItemsInternal.length;
d++) {
a = this._searchRowIndex(this._selectedItemsInternal[d].id);
if (a < e || a > c) {
b.push(a);
}
}
for (var d = 0;
d < b.length;
d++) {
this._positionedDataItems[b[d]].set_selected(false);
}
}, _clearSelectedItemsInInterval: function (e, c) {
var a = 0;
var b = [];
for (var d = 0;
d < this._selectedItemsInternal.length;
d++) {
a = this._searchRowIndex(this._selectedItemsInternal[d].id);
if (a > e && a < c) {
b.push(a);
}
}
for (var d = 0;
d < b.length;
d++) {
this._positionedDataItems[b[d]].set_selected(false);
}
}, _selectItemsInInterval: function (f, c, b) {
var e = this._getPositionedDataItems();
var a = f;
c += b;
do {
if (a < 0) {
a = e.length - 1;
} else {
if (a > e.length - 1) {
a = 0;
}
}
if (e[a] && !e[a].get_selected()) {
var d = {ctrlKey: false};
this._selection._selectRowInternal(e[a].get_element(), d, true, true, false);
}
a += b;
} while (a !== c);
}, _getPositionedDataItems: function (b) {
var a = this._positionedDataItems;
if (a && a.length > 0 && !b) {
return a;
}
this._keyboardNavigationProperties.unselectableItemsCount = 0;
a = this._getAllChildItemsRecursive(this.get_masterTableView());
this._positionedDataItemsIndexes = {};
for (var c = 0;
len = a.length, c < len;
c++) {
this._positionedDataItemsIndexes[a[c].get_id()] = c;
}
this._keyboardNavigationProperties.firstSelection = true;
this._positionedDataItems = a;
return a;
}, _getAllChildItemsRecursive: function (m) {
if (!m || (m && (m.get_element().parentNode.parentNode.style.display === "none"))) {
return [];
}
var a = [];
var f = m.get_dataItems();
for (var d = 0, h = f.length;
d < h;
d++) {
var e = f[d];
if (e.get_element().style.display === "none") {
continue;
}
if (!e.get_selectable() && !e.get_selected()) {
this._keyboardNavigationProperties.unselectableItemsCount++;
}
a[a.length] = e;
var l = e.get_nestedViews();
if (l.length) {
for (var g = 0, k = l.length;
g < k;
g++) {
var c = l[g];
var b = this._getAllChildItemsRecursive(c);
if (b.length) {
Array.addRange(a, b);
}
}
}
}
return a;
}, _searchRowIndex: function (a) {
this._getPositionedDataItems();
return this._positionedDataItemsIndexes[a];
}, _setActiveRow: function (e, b) {
if (e && this.ClientSettings && this.ClientSettings.AllowKeyboardNavigation) {
var a = new Telerik.Web.UI.GridDataItemCancelEventArgs(this._activeRow || e, b);
this.raise_activeRowChanging(a);
if (a.get_cancel()) {
return;
}
if (this._activeRow) {
var d = $find(this._activeRow.id.split("__")[0]);
Telerik.Web.UI.Grid.ClearItemStyle(this._activeRow, d._data._renderActiveItemStyle, d._data._renderActiveItemStyleClass);
}
this._activeRow = e;
var c = $find(e.id.split("__")[0]);
Telerik.Web.UI.Grid.SetItemStyle(e, c._data._renderActiveItemStyle, c._data._renderActiveItemStyleClass);
Telerik.Web.UI.Grid.ScrollIntoView(e);
this.updateClientState();
this.raise_activeRowChanged(new Telerik.Web.UI.GridDataItemEventArgs(this._activeRow, b));
}
}, clearActiveRow: function () {
if (this._activeRow) {
var a = $find(this._activeRow.id.split("__")[0]);
Telerik.Web.UI.Grid.ClearItemStyle(this._activeRow, a._data._renderActiveItemStyle, a._data._renderActiveItemStyleClass);
this._activeRow = null;
this.updateClientState();
}
}, set_activeRow: function (a) {
this._setActiveRow(a, null);
}, _ensureDataItemsCreated: function (a) {
if (a._dataItems.length == 0) {
a.get_dataItems();
}
}, _isClientSideExpandCollapse: function (g) {
var b = g.cells;
for (var d = 0, f = b.length;
d < f;
d++) {
var a = b[d], c = a.className;
if (c && c.indexOf("rgExpandCol") > -1) {
var e = a.getElementsByTagName("input")[0];
if (e && e.onclick && e.onclick.toString().indexOf("_toggleExpand") > -1) {
return true;
}
}
}
return false;
}, _handleActiveRowExpandCollapse: function (d) {
var j = d.keyCode || d.charCode;
if (!this._activeRow) {
return;
}
var o = $find(this._activeRow.id.split("__")[0]);
this._ensureDataItemsCreated(o);
var k = o._hierarchyLoadMode;
var i = k == "ServerOnDemand" || k == "ServerBind";
var g = k == "Conditional";
var f = g && this._isClientSideExpandCollapse(this._activeRow);
if (j == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) {
var l = o._getNextNestedDataRow(this._activeRow);
if (i && l || !f) {
this._shouldFocusOnPage = true;
var c = this._activeRow.id + "##";
o.fireCommand("ExpandCollapse", c);
}
if (l && l.parentNode.style.display != "none" || l && $find(this._activeRow.id).get_isInEditMode() && l.parentNode.style.display != "none") {
o._performCollapseItem(this._activeRow);
this._getPositionedDataItems(true);
}
} else {
if (j == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey) {
var n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(this._activeRow, "tr");
if ($find(this._activeRow.id).get_isInEditMode()) {
n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(n, "tr");
}
if (!o._isDataItemElement(n) && o._data.hasDetailItemTemplate) {
n = Telerik.Web.UI.Grid.GetNodeNextSiblingByTagName(n, "tr");
}
if (n && n.style.display == "none" && n.className.indexOf("rgNoRecords") === -1) {
o.expandItem(this._activeRow);
this._getPositionedDataItems(true);
this.get_element().focus();
} else {
if (o._hasDetailTables && (i || !f)) {
var a = $find(this._activeRow.id);
var m = a.get_nestedViews()[0];
var b = this._activeRow.id;
if (a) {
var o = $find(b.split("__")[0]);
this._ensureDataItemsCreated(o);
}
var h = $find(b).get_isInEditMode();
if ((m && j == this.ClientSettings.KeyboardNavigationSettings.CollapseDetailTableKey) || (!m && j == this.ClientSettings.KeyboardNavigationSettings.ExpandDetailTableKey)) {
this._shouldFocusOnPage = true;
var c = this._activeRow.id + "##";
o.fireCommand("ExpandCollapse", c);
}
}
}
}
}
}, _handleActiveRowSelection: function (b) {
if (this._activeRow) {
this._selection._selectRowInternal(this._activeRow, {ctrlKey: (this.get_allowMultiRowSelection() && b.ctrlKey)}, false, true, true);
if (this.ClientSettings.AllowKeyboardNavigation) {
var c = this._keyboardNavigationProperties;
var a = this._getPositionedDataItems()[c.currentSelectedIndex];
if (a && a.get_selected()) {
c.lastSelectedRowIndex = c.currentSelectedIndex;
}
c.lastClickSelectedItem = this._getPositionedDataItems()[c.currentSelectedIndex].get_element();
this._setActiveRow(this._activeRow, b);
}
b.preventDefault();
}
}, _handleActiveRowEdit: function (a) {
if (this._activeRow) {
a.preventDefault();
var b = $find(this._activeRow.id.split("__")[0]);
if (b) {
b.editItem(this._activeRow);
}
}
}, _getGridRow: function (a) {
var c = Telerik.Web.UI.Grid.GetFirstParentByTagName(Telerik.Web.UI.Grid.GetCurrentElement(a), "tr"), b = c;
if (c && c.id != "" && c.id.split("__").length == 2) {
do {
if (Telerik.Web.UI.RadGrid.isInstanceOfType($find(b.id))) {
break;
}
b = b.parentNode;
} while (b);
if (b && $find(b.id) === this) {
return c;
}
}
return false;
}, _click: function (a) {
if (!this._canRiseRowEvent(a)) {
return;
}
if (!this.get_enableAriaSupport() && (!!this.ClientSettings.AllowKeyboardNavigation && this.ClientSettings.Selecting.CellSelectionMode == Telerik.Web.UI.GridCellSelectionMode.None)) {
if ($telerik.isIE) {
if (this.get_element().setActive) {
try {
this.get_element().setActive();
} catch (b) {
}
}
} else {
if (this.get_element().focus) {
this.get_element().focus();
}
}
}
var c = this._getGridRow(a);
if (c) {
this.raise_rowClick(new Telerik.Web.UI.GridDataItemEventArgs(c, a));
}
}, _dblclick: function (a) {
if ($telerik.isTouchDevice) {
$telerik.cancelRawEvent(a);
}
if (!this._canRiseRowEvent(a)) {
return;
}
var b = this._getGridRow(a);
if (b) {
this.raise_rowDblClick(new Telerik.Web.UI.GridDataItemEventArgs(b, a));
}
}, _contextmenu: function (b) {
if ($telerik.isOpera && b.button != 2) {
return;
}
var c = this._getGridRow(b);
var a = null;
if (c) {
a = new Telerik.Web.UI.GridDataItemCancelEventArgs(c, b);
this.raise_rowContextMenu(a);
}
if ((a && !a.get_cancel()) && this.get_events().getHandler("rowContextMenu")) {
if (b.preventDefault) {
b.preventDefault();
} else {
b.returnValue = false;
return false;
}
}
}, _mouseover: function (a) {
if (this._overRow) {
this.raise_rowMouseOut(new Telerik.Web.UI.GridDataItemEventArgs(this._overRow, a));
if (this.Skin != "" && this.ClientSettings.EnableRowHoverStyle) {
Sys.UI.DomElement.removeCssClass(this._overRow, "rgHoveredRow");
}
}
var b = this._getGridRow(a);
if (b) {
this.raise_rowMouseOver(new Telerik.Web.UI.GridDataItemEventArgs(b, a));
if (this.Skin != "" && this.ClientSettings.EnableRowHoverStyle) {
Sys.UI.DomElement.addCssClass(b, "rgHoveredRow");
}
this._overRow = b;
}
}, _mouseout: function (a) {
if (this._overRow && ((!$telerik.isIE8 && !document.documentMode) || !$telerik.isMouseOverElement(this._overRow, a))) {
this.raise_rowMouseOut(new Telerik.Web.UI.GridDataItemEventArgs(this._overRow, a));
if (this.Skin != "" && this.ClientSettings.EnableRowHoverStyle) {
Sys.UI.DomElement.removeCssClass(this._overRow, "rgHoveredRow");
}
this._overRow = null;
}
}, _canRiseRowEvent: function (a) {
var b;
if ($telerik.isTouchDevice) {
b = $telerik.getTouchTarget(a);
} else {
b = Telerik.Web.UI.Grid.GetCurrentElement(a);
}
if (!b || !b.tagName || b.tagName.toLowerCase() == "input" || b.tagName.toLowerCase() == "select" || b.tagName.toLowerCase() == "option" || b.tagName.toLowerCase() == "button" || b.tagName.toLowerCase() == "a" || b.tagName.toLowerCase() == "textarea" || b.tagName.toLowerCase() == "img") {
return false;
}
if (this.get_masterTableView() && !Telerik.Web.UI.Grid.IsChildOf(b, this.get_masterTableView().get_element())) {
return false;
}
return true;
}, confirm: function (i, c, j, k, f) {
if (window.confirmResult) {
window.confirmResult = false;
return true;
}
if (typeof(GetRadWindowManager) == "undefined") {
return confirm(i);
}
var h = GetRadWindowManager();
if (!h) {
return confirm(i);
}
var d = c.srcElement ? c.srcElement : c.target;
var b = radconfirm(i, a, (typeof(k) != "undefined") ? k : 280, (typeof(f) != "undefined") ? f : 200, this, (typeof(j) != "undefined") ? j : "Confirm");
var g = this.get_masterTableView();
function a(e) {
if (e) {
if (!$telerik.isIE) {
if (d.onclick.toString().indexOf("_clientDelete(event)") > -1) {
g._clientDelete(c);
return false;
}
}
window.confirmResult = true;
if (d.href && (window.netscape || $telerik.isSafari)) {
eval(d.href);
window.confirmResult = false;
return;
}
if (window.netscape && d.type && (d.type.toLowerCase() == "image" || d.type.toLowerCase() == "submit" || d.type.toLowerCase() == "button") && !d.click) {
__doPostBack(d.name, "");
window.confirmResult = false;
return;
}
if (d.click) {
d.click(c);
}
}
return false;
}
return false;
}, _fixIndexOfUnderIE8AndLower: function () {
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (a) {
var c = this.length >>> 0;
var b = Number(arguments[1]) || 0;
b = (b < 0) ? Math.ceil(b) : Math.floor(b);
if (b < 0) {
b += c;
}
for (;
b < c;
b++) {
if (b in this && this[b] === a) {
return b;
}
}
return -1;
};
}
}
};
Telerik.Web.UI.RadGrid.registerClass("Telerik.Web.UI.RadGrid", Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.GridKeyPressEventArgs = function (a) {
Telerik.Web.UI.GridKeyPressEventArgs.initializeBase(this);
this._keyCode = a.keyCode || a.charCode;
this._isShiftPressed = a.shiftKey;
this._isCtrlPressed = a.ctrlKey;
this._isAltPressed = a.altKey;
this._domEvent = a;
};
Telerik.Web.UI.GridKeyPressEventArgs.prototype = {
get_keyCode: function () {
return this._keyCode;
}, get_isShiftPressed: function () {
return this._isShiftPressed;
}, get_isCtrlPressed: function () {
return this._isCtrlPressed;
}, get_isAltPressed: function () {
return this._isAltPressed;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.GridKeyPressEventArgs.registerClass("Telerik.Web.UI.GridKeyPressEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridDragDropCancelEventArgs = function (e, a, b, d, f, c) {
Telerik.Web.UI.GridDragDropCancelEventArgs.initializeBase(this);
this._targetItemId = "";
this._targetItemIndexHierarchical = "";
this._targetGridDataItem = null;
this._targetItemTableView = null;
this._targetItemDataKeyValues = null;
if (e) {
this._targetItemId = e.id;
this._targetItemIndexHierarchical = this._targetItemId.split("__")[1];
this._targetItemTableView = $find(this._targetItemId.split("__")[0]);
if (this._targetItemTableView && this._targetItemTableView._owner._clientKeyValues && this._targetItemTableView._owner._clientKeyValues[this._targetItemIndexHierarchical]) {
this._targetItemDataKeyValues = this._targetItemTableView._owner._clientKeyValues[this._targetItemIndexHierarchical];
}
}
this._domEvent = a;
this._dragedItems = b;
this._htmlElement = d;
this._targetRadGrid = f;
this._dropPosition = c;
};
Telerik.Web.UI.GridDragDropCancelEventArgs.prototype = {
get_targetGridDataItem: function () {
if (this._targetItemTableView && !this._targetGridDataItem) {
this._targetItemTableView.get_dataItems();
this._targetGridDataItem = $find(this._targetItemId);
}
return this._targetGridDataItem;
}, get_targetItemIndexHierarchical: function () {
return this._targetItemIndexHierarchical;
}, get_targetItemId: function () {
return this._targetItemId;
}, get_targetItemTableView: function () {
return this._targetItemTableView;
}, get_domEvent: function () {
return this._domEvent;
}, get_TargetDataKeyValue: function (a) {
return (this._targetItemDataKeyValues) ? this._targetItemDataKeyValues[a] : null;
}, get_draggedItems: function () {
return this._dragedItems;
}, get_destinationHtmlElement: function () {
return this._htmlElement;
}, set_destinationHtmlElement: function (a) {
this._htmlElement = a;
}, get_targetRadGrid: function () {
return this._targetRadGrid;
}, get_dropPosition: function () {
return this._dropPosition;
}
};
Telerik.Web.UI.GridDragDropCancelEventArgs.registerClass("Telerik.Web.UI.GridDragDropCancelEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridDataItemEventArgs = function (b, a) {
Telerik.Web.UI.GridDataItemEventArgs.initializeBase(this);
this._id = "";
this._itemIndexHierarchical = "";
this._gridDataItem = null;
this._tableView = null;
this._dataKeyValues = null;
if (b) {
this._id = b.id;
this._itemIndexHierarchical = this._id.split("__")[1];
this._tableView = $find(this._id.split("__")[0]);
if (this._tableView && this._tableView._owner._clientKeyValues && this._tableView._owner._clientKeyValues[this._itemIndexHierarchical]) {
this._dataKeyValues = this._tableView._owner._clientKeyValues[this._itemIndexHierarchical];
}
}
this._domEvent = a;
};
Telerik.Web.UI.GridDataItemEventArgs.prototype = {
get_item: function () {
return this.get_gridDataItem();
}, get_gridDataItem: function () {
if (this._tableView && !this._gridDataItem) {
this._gridDataItem = $find(this._id);
if (!this._gridDataItem) {
this._tableView.get_dataItems();
this._gridDataItem = $find(this._id);
}
}
return this._gridDataItem;
}, get_itemIndexHierarchical: function () {
return this._itemIndexHierarchical;
}, get_id: function () {
return this._id;
}, get_tableView: function () {
return this._tableView;
}, get_domEvent: function () {
return this._domEvent;
}, getDataKeyValue: function (a) {
return (this._dataKeyValues) ? this._dataKeyValues[a] : null;
}
};
Telerik.Web.UI.GridDataItemEventArgs.registerClass("Telerik.Web.UI.GridDataItemEventArgs", Sys.EventArgs);
Telerik.Web.UI.GridDataItemCancelEventArgs = function (b, a) {
Telerik.Web.UI.GridDataItemCancelEventArgs.initializeBase(this);
this._id = "";
this._itemIndexHierarchical = "";
this._gridDataItem = null;
this._tableView = null;
this._dataKeyValues = null;
if (b) {
this._id = b.id;
this._itemIndexHierarchical = this._id.split("__")[1];
this._tableView = $find(this._id.split("__")[0]);
if (this._tableView && this._tableView._owner._clientKeyValues && this._tableView._owner._clientKeyValues[this._itemIndexHierarchical]) {
this._dataKeyValues = this._tableView._owner._clientKeyValues[this._itemIndexHierarchical];
}
}
this._domEvent = a;
};
Telerik.Web.UI.GridDataItemCancelEventArgs.prototype = {
get_gridDataItem: function () {
if (this._tableView && !this._gridDataItem) {
this._tableView.get_dataItems();
this._gridDataItem = $find(this._id);
}
return this._gridDataItem;
}, get_itemIndexHierarchical: function () {
return this._itemIndexHierarchical;
}, get_id: function () {
return this._id;
}, get_tableView: function () {
return this._tableView;
}, get_domEvent: function () {
return this._domEvent;
}, getDataKeyValue: function (a) {
return (this._dataKeyValues) ? this._dataKeyValues[a] : null;
}
};
Telerik.Web.UI.GridDataItemCancelEventArgs.registerClass("Telerik.Web.UI.GridDataItemCancelEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridClientDataBindingParameterType = function () {
};
Telerik.Web.UI.GridClientDataBindingParameterType.prototype = {String: 0, List: 1, Linq: 2, Oql: 3};
Telerik.Web.UI.GridClientDataBindingParameterType.registerEnum("Telerik.Web.UI.GridClientDataBindingParameterType", false);
Telerik.Web.UI.GridClientDataResponseType = function () {
};
Telerik.Web.UI.GridClientDataResponseType.prototype = {JSON: 0, JSONP: 1};
Telerik.Web.UI.GridClientDataResponseType.registerEnum("Telerik.Web.UI.GridClientDataResponseType");
Telerik.Web.UI.GridClientDataServiceType = function () {
};
Telerik.Web.UI.GridClientDataServiceType.prototype = {ADONet: 0, OData: 1};
Telerik.Web.UI.GridClientDataServiceType.registerEnum("Telerik.Web.UI.GridClientDataServiceType");
Telerik.Web.UI.GridDataSourceResolvedEventArgs = function (a) {
Telerik.Web.UI.GridDataSourceResolvedEventArgs.initializeBase(this);
this._data = a;
};
Telerik.Web.UI.GridDataSourceResolvedEventArgs.prototype = {
get_data: function () {
return this._data;
}, set_data: function (a) {
this._data = a;
}
};
Telerik.Web.UI.GridDataSourceResolvedEventArgs.registerClass("Telerik.Web.UI.GridDataSourceResolvedEventArgs", Sys.EventArgs);
Telerik.Web.UI.GridCellSelectEventArgs = function (b, a) {
Telerik.Web.UI.GridCellSelectEventArgs.initializeBase(this);
this.row = a(b).parent("tr[id]");
this.rowElement = this.row[0];
this._id = "";
this._tableView = null;
this._col = null;
if (this.rowElement) {
this._itemIndexHierarchical = this.rowElement.id.split("__")[1];
this._id = this.rowElement.id;
this._tableView = $find(this._id.split("__")[0]);
}
var c = this._tableView.get_columns();
for (var d = 0, e = 0;
d < c.length;
d++) {
if (e == a(b).index()) {
this._col = c[d];
}
e++;
}
};
Telerik.Web.UI.GridCellSelectEventArgs.prototype = {
get_row: function () {
return this.rowElement;
}, get_column: function () {
return this._col;
}, get_gridDataItem: function () {
if (this._tableView && !this._gridDataItem) {
this._tableView.get_dataItems();
this._gridDataItem = $find(this._id);
}
return this._gridDataItem;
}, get_tableView: function () {
return this._tableView;
}, get_cellIndexHierarchical: function () {
return this._itemIndexHierarchical + "&" + this.get_column().get_uniqueName();
}
};
Telerik.Web.UI.GridCellSelectEventArgs.registerClass("Telerik.Web.UI.GridCellSelectEventArgs", Sys.EventArgs);
Telerik.Web.UI.GridCellSelectCancelEventArgs = function (b, a) {
Telerik.Web.UI.GridCellSelectCancelEventArgs.initializeBase(this);
this.row = a(b).parent("tr[id]");
this.rowElement = this.row[0];
this._id = "";
this._tableView = null;
this._col = null;
if (this.rowElement) {
this._id = this.rowElement.id;
this._tableView = $find(this._id.split("__")[0]);
}
var c = this._tableView.get_columns();
for (var d = 0, e = 0;
d < c.length;
d++) {
if (e == a(b).index()) {
this._col = c[d];
}
e++;
}
};
Telerik.Web.UI.GridCellSelectCancelEventArgs.prototype = {
get_row: function () {
return this.rowElement;
}, get_column: function () {
return this._col;
}, get_gridDataItem: function () {
if (this._tableView && !this._gridDataItem) {
this._tableView.get_dataItems();
this._gridDataItem = $find(this._id);
}
return this._gridDataItem;
}
};
Telerik.Web.UI.GridCellSelectCancelEventArgs.registerClass("Telerik.Web.UI.GridCellSelectCancelEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.GridCellSelectionMode = function () {
};
Telerik.Web.UI.GridCellSelectionMode.prototype = {None: 0, SingleCell: 1, MultiCell: 2, Column: 3, MultiColumn: 4};
Telerik.Web.UI.GridCellSelectionMode.registerEnum("Telerik.Web.UI.GridCellSelectionMode", false);
Type.registerNamespace("Telerik.Web.UI");
(function (a) {
a.GridClientSideBinding = function (d) {
this._grid = d;
this._masterTableView = d.get_masterTableView();
this._groupExpressions = this._masterTableView._data.GroupByExpressions;
this._dataFieldHeaderTextMap = this._masterTableView._data.DataFieldHeaderText;
this.initialize();
};
a.GridClientSideBinding.prototype = {
initialize: function () {
var d = this;
d._clientDataSource = $find(d._grid._clientDataSourceID);
if (d._clientDataSource) {
d._initDataSource();
} else {
Sys.Application.add_load(function () {
d._clientDataSource = $find(d._grid._clientDataSourceID);
d._initDataSource();
});
}
}, dispose: function () {
}, get_clientDataSource: function () {
return this._clientDataSource;
}, refresh: function () {
this._change();
}, _initDataSource: function () {
var d = this._grid.get_masterTableView();
this._grid.add_command(Function.createDelegate(this, this._onCommand));
this._clientDataSource.add_change(Function.createDelegate(this, this._change));
this._clientDataSource.add_sync(Function.createDelegate(this, this._change));
if (d._virtualization) {
d._virtualization.select();
} else {
this._clientDataSource.fetch();
}
}, _onCommand: function (s, d) {
var f = d.get_commandName();
var e = d.get_commandArgument();
var v = e.toString().split(":");
var k = parseInt(v[v.length - 1]);
var n = false;
switch (f) {
case"UnGroupByExpression":
this._updateGroupExpressions({type: "remove", index: k});
n = true;
break;
case"ReorderGroupByExpression":
var o = e.toString().split(",");
var u = parseInt(o[0].split(":")[1], 10);
var x = parseInt(o[1].split(":")[1], 10);
var r = Telerik.Web.UI.Grid.reorderArray(this._groupExpressions, u, x);
if (this._grid._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var q = this._groupExpressions.length;
var l = this._grid._groupPanel;
var m = this._grid._groupPanel._items;
for (var p = 0;
p < q;
p++) {
var h = m[0];
l._ungroup(h.get_element().childNodes[0]);
}
this._grid._groupPanel._items = [];
for (var w = 0;
w < q;
w++) {
var g = r[w];
this._updateGroupExpressions({type: "add", field: g.field});
}
}
this._groupExpressions = this._grid.get_masterTableView()._data.GroupByExpressions = r;
n = true;
break;
case"GroupByColumn":
this._updateGroupExpressions({type: "add", field: e});
n = true;
break;
case"UnGroupByColumn":
this._updateGroupExpressions({type: "remove", field: e});
n = true;
break;
case"SortGroup":
this._updateGroupExpressions({type: "sort", field: e});
n = true;
break;
case"Page":
case"Sort":
case"ClearSort":
case"Filter":
case"HeaderSort":
case"HeaderContextMenuFilter":
n = true;
break;
}
if (n) {
d.set_cancel(true);
this._change();
}
}, _updateGroupExpressions: function (q) {
var r = q.type, g = this._groupExpressions, p = g.length, m = 0, f, d = $telerik.$;
if (r == "add") {
for (var n = 0;
n < p;
n++) {
if (g[n].field == q.field) {
return;
}
}
g.push({field: q.field, dir: "asc", aggregates: this._masterTableView._data.Aggregates});
if (this._grid._renderMode == Telerik.Web.UI.RenderMode.Mobile) {
var e = d(this._grid._groupPanel.cells[0]);
if (e.find("label").length == 0) {
var l = e.find("span")[0];
l.innerHTML = "View Groups";
l.className = "rgGroupPanelCollapse";
this._masterTableView._initializeGroupPanelEvents();
}
var s = this._masterTableView._getViewByType(a.Grid.MobileViewType.Group);
s._groupFieldNames.push(q.field);
s._createGroupItem(this._dataFieldHeaderTextMap[q.field] || q.field);
s._$element.find(".rgUngroup").offEvent(a.EventNamesMap.up).onEvent(a.EventNamesMap.up, d.proxy(s._handleCloseUp, s)).on("click", $telerik.preventDefault);
s._$element.find("[class *= 'rgSort']").offEvent(a.EventNamesMap.up).onEvent(a.EventNamesMap.up, d.proxy(s._handleSortUp, s)).on("click", $telerik.preventDefault);
} else {
this._grid._groupPanel._create(this._dataFieldHeaderTextMap[q.field] || q.field, q.field);
}
}
for (;
m < p;
m++) {
f = g[m];
if (r == "remove" && (f.field == q.field || m === q.index)) {
this._masterTableView._removeGroupColumn();
g.splice(m, 1);
if (this._grid._renderMode != Telerik.Web.UI.RenderMode.Mobile) {
var h = this._grid._groupPanel._items;
h.splice(m, 1);
for (var o = 0;
o < h.length;
o++) {
h[o]._hierarchicalIndex = "0:" + o;
}
} else {
var e = d(this._grid._groupPanel.cells[0]);
if (e.find("label").length == 0) {
var l = e.find("span")[0];
l.className = "rgGroupPanelCollapse";
l.innerHTML = this._grid._groupPanelText;
l.className = "";
var s = this._masterTableView._getViewByType(a.Grid.MobileViewType.Group);
s.hide();
}
}
break;
} else {
if (r == "sort" && f.field == q.field) {
f.dir = f.dir == "asc" ? "desc" : "asc";
}
}
}
}, _setAggregatesToClientDataSource: function (f, j) {
var e = ["", "sum", "min", "max", "last", "first", "count", "average", "countDistinct", "custom"];
f.get_aggregates().clear();
var g = j.get_columns();
for (var h = 0;
h < g.length;
h++) {
if (g[h]._data.Aggregate) {
var d = new Telerik.Web.UI.ClientDataSource.Aggregate();
d.set_field(g[h]._data.DataField);
d.set_aggregate(e[g[h]._data.Aggregate]);
f.get_aggregates().add(d);
}
}
}, _change: function () {
var e = this._clientDataSource, g = this._masterTableView, d = g.get_owner().get_batchEditingManager();
var f = g._forceRebind || false;
g._forceRebind = null;
if (!g._virtualization || (g._virtualization && g._virtualization._isDataBinding)) {
if (!f) {
e.get_sortExpressions().clear();
e.get_sortExpressions().add(g.get_sortExpressions().toClientDataSourceList());
e.get_filterExpressions().clear();
e.get_filterExpressions().add(g.get_filterExpressions().toClientDataSourceList());
e.get_groupExpressions().clear();
e.set__groupExpressions(this._groupExpressions);
this._setAggregatesToClientDataSource(e, g);
if (!g._virtualization) {
e.set_allowPaging(g.get_allowPaging());
if (g.get_allowPaging()) {
if (g.get_pageSize() != e.get_pageSize()) {
e.set_pageSize(g.get_pageSize());
}
if (g.get_currentPageIndex() != e.get_currentPageIndex()) {
e.set_currentPageIndex(g.get_currentPageIndex());
}
}
}
}
g.set_dataSource(f ? e.recreateView() : e.view());
g.set_virtualItemCount(e.get_totalItemsCount());
g.dataBind();
g.updateAggregates(e._kendoDataSource.aggregates());
if (d) {
d._removeChanges();
}
}
}
};
a.GridClientSideBinding.registerClass("Telerik.Web.UI.GridClientSideBinding", null);
var b = {
updateAggregates: function (d) {
var e = null;
if (this.get_element().tFoot) {
e = this.get_element().tFoot.rows[0];
}
if (!e && this._owner.GridFooterDiv && this._owner.GridFooterDiv.children[0]) {
e = this._owner.GridFooterDiv.children[0].rows[1];
}
if (e && e.className == "rgFooter") {
this._updateAggregates(e, d);
}
}, dataBind: function () {
if (this._virtualization && !this._virtualization._isDataBinding && ((this.get_allowPaging() && this._dataSource.length > this.get_pageSize()) || (!this.get_allowPaging() && this._dataSource.length > this._virtualization._itemsPerView))) {
this._virtualization._startIndex = null;
this._virtualization.set_bindingType("Client");
this._virtualization.set_cachedData(this._dataSource);
this._virtualization.set_virtualItemCount(this._dataSource.length);
this._virtualization.select();
return;
}
Array.forEach($telerik.getElementsByClassName(this.get_element().tBodies[0], "rgGroupHeader"), function (p) {
p.parentNode.removeChild(p);
});
Array.forEach($telerik.getElementsByClassName(this.get_element().tBodies[0], "rgFooter"), function (p) {
p.parentNode.removeChild(p);
});
var m = $telerik.getElementByClassName(this.get_element(), "rgNoRecords");
if (m) {
if (this._dataSource.length > 0) {
m.style.display = "none";
} else {
m.style.display = "";
this._setPagerVisibility(this._data.PagerAlwaysVisible);
}
}
var e = this.get_dataItems();
var d = this.get_columns();
if (this._owner.ClientSettings.Resizing.AllowColumnResize && this._owner.ClientSettings.Resizing.AllowResizeToFit) {
Telerik.Web.UI.Grid.ClearBestFitCache(this.get_columns());
}
var o = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0];
if (this._dataSource.length < e.length || o.rows.length == 1) {
for (var h = 0, k = e.length;
h < k;
h++) {
e[h].set_visible(false);
e[h].get_element().style.display = "none";
}
this._cacheDataItems();
}
this._dataBind(this._dataSource);
var f = true;
if (this._owner._keyboardNavigationProperties) {
f = this._owner._keyboardNavigationProperties.firstSelection;
}
var n = $find(this._owner.get_id());
if (n._getPositionedDataItems) {
n._getPositionedDataItems(true);
}
if (this._owner._keyboardNavigationProperties) {
this._owner._keyboardNavigationProperties.firstSelection = f;
}
this._fixRowsClassNames();
this._owner.raise_dataBound(Sys.EventArgs.Empty);
for (var h = 0, l = d.length;
h < l;
h++) {
var j = false;
if (d[h].get_element().style.visibility != "hidden" && (d[h].Display == null || d[h].Display == true) && (d[h]._data.Display == null || d[h]._data.Display)) {
j = true;
}
if (!j) {
this.hideColumn(h);
}
}
if (this.get_id() == this._owner._masterClientID) {
var g = $find(this._owner.get_id());
if (g._scrolling) {
this._owner._scrolling.setHeaderAndFooterDivsWidth();
g._scrolling._initializeVirtualScrollPaging(true);
}
}
}, createItem: function (o, k, d) {
this._owner.raise_rowCreating(new Sys.EventArgs());
var t = this, j = t.get_dataItems(), o = o == 0 ? 0 : o || j.length, s = ($telerik.isOpera) ? this.get_element() : this.get_element().tBodies[0], r = s.insertRow(o), l = document.createDocumentFragment(), e, h, p, g, u;
if (j.length > 0) {
var n = o == 0 ? j[0].get_id() : j[o - 1].get_id();
p = n.split("__")[1];
if (p.indexOf("_") === -1) {
p = parseInt(n.split("__")[1]) + (o == 0 ? -1 : 1);
} else {
p = "-1";
}
if (k && parseInt(k, 10) < 0 && parseInt(p, 10) > parseInt(k, 10)) {
p = k;
}
r.id = String.format("{0}__{1}", n.split("__")[0], p);
} else {
p = typeof k === "undefined" ? "0" : k;
r.id = String.format("{0}__{1}", this.get_id(), p);
t._hideRgNoRecordsRow(s);
}
r.className = "rgRow";
if (j[j.length - 2]) {
var f = j[j.length - 2].get_element().className;
f = f.replace(" rgActiveRow", "").replace(" rgSelectedRow", "");
r.className = f;
}
h = $create(Telerik.Web.UI.GridDataItem, {
_owner: t,
_data: {},
_itemIndexHierarchical: "" + p
}, null, null, r);
for (var m = 0, q = t.get_columns().length;
m < q;
m++) {
g = t.get_columns()[m];
e = t._createCell(g);
l.appendChild(e);
if (!g.Display) {
e.style.display = "none";
}
if (t._data.EditMode == "Batch") {
if (t._isColumnEditable(g, r)) {
u = document.createElement("div");
u.innerHTML = g._data.DefaultInsertValue || " ";
e.appendChild(u);
e = u;
}
}
g.initializeCell(e, h);
if (e.childNodes.length == 0) {
e.innerHTML = " ";
}
}
r.appendChild(l);
t._clearRowClassStyles(h.get_element());
if (d) {
d(h);
}
t._owner.raise_rowCreated(new Telerik.Web.UI.GridDataItemEventArgs(r, null));
Array.insert(j, o, h);
return h;
}, _createCell: function (g) {
var h = this.get_dataItems()[0], e = document.createElement("td"), f = this._cellAttributes, d, j;
if (f && h) {
d = f[g.get_uniqueName()];
for (j in d) {
e.setAttribute(j, d[j]);
}
}
return e;
}, _saveCellAttributes: function (h) {
var f = this._cellAttributes = {}, g = this.get_columns(), n = g.length, l = 0, d, k, e;
for (;
l < n;
l++) {
d = f[g[l].get_uniqueName()] = {};
e = h.get_cell(g[l].get_uniqueName());
htmlAttributes = e.attributes;
for (var m = 0;
m < htmlAttributes.length;
m++) {
k = htmlAttributes[m];
if (k.nodeName !== "style" && ($telerik.isChrome || k.specified || (k.nodeName == "value" && k.nodeValue))) {
d[k.nodeName] = k.nodeValue;
}
}
if (e.style.cssText) {
d.style = e.style.cssText;
}
}
}, _isGroup: function (d) {
return !!(d && d.hasOwnProperty("hasSubgroups") && d.items && typeof d.items.length == "number");
}, _getGroupLevels: function (d) {
var e = 0;
while (this._isGroup(d[0])) {
e++;
d = d[0].items;
}
return e;
}, _dataBind: function (g, o) {
o = o || {dataItemIndex: 0, groupLevel: 0, groupRowIndex: 0, groupLevels: this._getGroupLevels(g)};
var e = this._isGroup(g[0]), f = this.get_dataItems(), n = g.length, l = 0;
if (e) {
var k = this._data.GroupByExpressions;
if (k) {
var d = {};
for (var m = 0;
m < k.length;
m++) {
var h = k[m];
d[h.field] = h.alias;
}
o.aliasFieldMap = d;
}
if (this.get_columns()[o.groupLevel]._data.ColumnType != "GridGroupSplitterColumn") {
this._createGroupColumn();
}
o.groupLevel++;
}
for (;
l < n;
l++) {
if (e) {
this._createGroup(g[l], o);
} else {
if (!o.isEmptyDataGroup) {
this._appendItem(f[o.dataItemIndex++], g[l], l);
}
}
}
if (e) {
o.groupLevel--;
}
}, _createGroup: function (d, e) {
this._createGroupRow(d, e);
this._dataBind(d.items, e);
if (this._data.ShowGroupFooter) {
for (i in d.aggregates) {
this._createAggregateRow(d, e);
break;
}
}
}, _createGroupRow: function (f, k) {
var o = this, l = document.createElement("tr"), h = k.groupLevel, j = 0, e, d;
k.groupRowIndex += 2;
l.className = "rgGroupHeader";
for (;
j < h;
j++) {
e = document.createElement("td");
e.className = "rgGroupCol";
l.appendChild(e);
}
if (this.get_owner()._renderMode == Telerik.Web.UI.RenderMode.Mobile) {
var d = document.createElement("button");
d.className = "rgActionButton ";
var m = document.createElement("span");
m.className = "rgIcon rgCollapseIcon";
var n = document.createElement("span");
n.className = "rgButtonText";
n.innerHTML = "Collapse";
d.appendChild(m);
d.appendChild(n);
} else {
d = document.createElement("input");
}
d.setAttribute("type", "submit");
d.setAttribute("title", this._owner._groupingSettings.CollapseTooltip);
d.id = this.get_id() + "__" + k.groupRowIndex + "__" + (k.groupLevel - 1);
d.className += "rgCollapse";
d.value = " ";
d.onclick = function (p) {
var p = p ? p : window.event;
o._toggleGroupsExpand(d, p);
return false;
};
e.appendChild(d);
e = document.createElement("td");
e.innerHTML = "<p><span class='rgGroupHeaderText'>" + (k.aliasFieldMap[f.field] || this._data.DataFieldHeaderText[f.field] || f.field) + ": <span>" + f.value + "</p>";
e.setAttribute("colSpan", this._getVisibleColumns().length - h);
l.appendChild(e);
if (k.isEmptyDataGroup) {
var g = $telerik.getElementsByClassName(this.get_element().tBodies[0], "rgGroupHeader");
if (g.length > 0) {
this.get_element().tBodies[0].insertBefore(l, g[k.groupLevel - 1]);
}
} else {
if (k.dataItemIndex < this.get_dataItems().concat(this._cachedItems).length) {
this.get_element().tBodies[0].insertBefore(l, this.get_dataItems().concat(this._cachedItems)[k.dataItemIndex].get_element());
}
}
}, _createAggregateRow: function (g, k) {
var f = this.get_columns(), d = g.aggregates, l = document.createElement("tr"), h = k.groupLevels, j = 0, e, m;
l.className = "rgFooter";
for (;
j < h;
j++) {
cell = document.createElement("td");
cell.className = "rgGroupCol";
l.appendChild(cell);
}
for (j = 0;
j < f.length - h;
j++) {
cell = document.createElement("td");
l.appendChild(cell);
}
this._updateAggregates(l, d);
if (this.get_dataItems().concat(this._cachedItems)[k.dataItemIndex]) {
this.get_element().tBodies[0].insertBefore(l, this.get_dataItems().concat(this._cachedItems)[k.dataItemIndex].get_element());
}
}, _updateAggregates: function (k, j) {
var d = ["", "sum", "min", "max", "last", "first", "count", "average", "countDistinct", "custom"];
var h = this.get_columns();
for (var e = 0;
e < h.length;
e++) {
var g = h[e];
if (g._data.Aggregate && g._data.DataField) {
var f = this._getCellByColumnUniqueNameFromTableRowElement(k, g._data.UniqueName);
if (j[g._data.DataField]) {
if (g._data.AggregateClientFormatString.indexOf("{0}")) {
f.innerHTML = g._data.AggregateClientFormatString.replace("{0}", j[g._data.DataField][d[g._data.Aggregate]]);
} else {
f.innerHTML = j[g._data.DataField][d[g._data.Aggregate]];
}
} else {
f.innerHTML = "";
}
}
}
}, _appendItem: function (m, n, q) {
var l = this.get_columns();
if (m == null) {
m = this._getNextCachedItem();
if (m) {
Array.add(this._dataItems, m);
}
}
if (this._virtualization) {
if (!this._dataItemsByGlobalIndex) {
this._dataItemsByGlobalIndex = {};
}
this._dataItemsByGlobalIndex[this._virtualization.get_startIndex() + q] = m;
if (this._virtualization._shouldLoadState) {
this._virtualization.loadState(m);
} else {
this._virtualization.hideEditFormItem(m.get_editFormItem(), m.get_element());
this._virtualization.updateItemState(m);
}
}
var p = null;
if (m == null) {
m = this.createItem();
}
var r = m.get_element().className.indexOf("rgEditRow") !== -1;
if (m.get_element().style.display == "none" || m.get_element().style.visibility == "hidden") {
m.set_visible(true);
m.get_element().style.display = ($telerik.isIE) ? "" : "table-row";
}
var s = Array.contains(this._owner._editIndexes, m._itemIndexHierarchical) && this._data.EditMode == "InPlace";
if (this._owner._clientKeyValues && this._data && this._data.clientDataKeyNames) {
for (var u = 0, w = this._data.clientDataKeyNames.length;
u < w;
u++) {
var f = this._data.clientDataKeyNames[u];
var g = (n) ? n[f] : null;
if (this._owner._clientKeyValues[m._itemIndexHierarchical]) {
this._owner._clientKeyValues[m._itemIndexHierarchical][f] = g;
} else {
if (this._owner._clientKeyValues[m._itemIndexHierarchical] != null) {
var x = this._owner._clientKeyValues[m._itemIndexHierarchical];
x[f] = g;
this._owner._clientKeyValues[m._itemIndexHierarchical] = x;
} else {
var x = new Object();
x[f] = g;
this._owner._clientKeyValues[m._itemIndexHierarchical] = x;
}
}
}
}
if (this._data._dataBindTemplates && r) {
this._fillTemplateEditorsData(m, n);
}
for (var t = 0, v = l.length;
t < v;
t++) {
var z = l[t].get_uniqueName();
var e = this._getCellByColumnUniqueNameFromTableRowElement(m.get_element(), z);
if (!e) {
continue;
}
if (this._virtualization) {
this._virtualization.loadCellSelection(m, e, z);
}
if (this._data.EditMode === "Batch" && this._isColumnEditable(l[t], m.get_element())) {
e = e.children[0];
}
var o = l[t]._data.DataField;
if (l[t]._data.ColumnType == "GridAttachmentColumn") {
o = l[t]._data.DataTextField;
}
if (typeof(o) == "undefined") {
o = z;
}
var A = n[o];
if (A == null) {
A = "";
}
if (typeof(A) != "undefined") {
var h = l[t];
if (r) {
h.populateEditCell(e, n, A, m);
} else {
h.populateCell(e, n, A, m);
}
}
}
var d = new Object();
var y = n;
d.get_dataItem = function () {
return y;
};
d.get_item = function () {
return m;
};
m._dataItem = y;
this._owner.raise_rowDataBound(d);
}, _getHeaderRow: function () {
var d;
if (this._hasMultiHeaders) {
var f = this._owner.ClientSettings.Scrolling;
var e = f && f.AllowScroll && f.UseStaticHeaders;
var g = e ? this._owner.get_masterTableViewHeader().get_element() : this.get_element();
d = $telerik.getElementByClassName(g.tHead, "rgMultiHeaderRow");
} else {
d = this.HeaderRow || this._owner.get_masterTableViewHeader().HeaderRow;
}
return d;
}, _createGroupColumn: function () {
var j = this._owner;
this._owner.raise_columnCreating(new Sys.EventArgs());
var g = this.get_element(), h = this._getHeaderRow(), e = document.createElement("th");
if (h) {
e.className = "rgHeader rgGroupCol";
e.setAttribute("scope", "col");
e.innerHTML = " ";
if (this._hasMultiHeaders) {
e.id = this.get_id() + "GroupColumn" + h.cells.length + "_MultiHeader-1";
e.rowSpan = $telerik.getElementsByClassName(h.parentNode, "rgMultiHeaderRow").length;
}
h.insertBefore(e, h.cells[0]);
}
this._updateColGroups(true);
var f = $create(Telerik.Web.UI.GridColumn, {
_owner: this,
_data: {
UniqueName: "GroupColumnClient" + this._groupColumnIndex++,
ColumnType: "GridGroupSplitterColumn"
}
}, null, null, e);
var d = new Sys.EventArgs();
d.get_column = function () {
return f;
};
f.Display = true;
Array.forEach(this.get_dataItems().concat(this._cachedItems), function (k) {
k.get_element().insertBefore(document.createElement("td"), k.get_element().cells[0]);
});
this._updateRows(true);
this._columnsInternal.unshift(f);
this._createColumnsByUniqueNameHash();
this._owner.raise_columnCreated(d);
}, _removeGroupColumn: function () {
var d = this._getHeaderRow();
d.removeChild(d.cells[0]);
this._updateColGroups(false);
this._updateRows(false);
Array.forEach(this.get_dataItems().concat(this._cachedItems), function (e) {
e.get_element().removeChild(e.get_element().cells[0]);
});
this._columnsInternal.shift().dispose();
this._createColumnsByUniqueNameHash();
}, _updateColGroups: function (d) {
var e = this._owner;
this._updateColGroup(this, d);
if (e.get_masterTableViewHeader()) {
this._updateColGroup(e.get_masterTableViewHeader(), d);
}
if (e.get_masterTableViewFooter()) {
this._updateColGroup(e.get_masterTableViewFooter(), d);
}
}, _updateColGroup: function (f, d) {
if (d) {
var e = document.createElement("col");
e.style.width = this.get_owner()._renderMode == Telerik.Web.UI.RenderMode.Mobile ? "41px" : "20px";
f.ColGroup.insertBefore(e, f.ColGroup.getElementsByTagName("col")[0]);
f.ColGroup.Cols.unshift(e);
} else {
f.ColGroup.removeChild(f.ColGroup.getElementsByTagName("col")[0]);
f.ColGroup.Cols.shift();
}
}, _updateRows: function (d) {
var g = this._owner.get_element(), k = this._owner.get_masterTableViewFooter(), f = $telerik.getElementByClassName(g, "rgCommandCell"), l = $telerik.getElementByClassName(g, "rgGroupPanelCell"), h = $telerik.getElementByClassName(g, "rgFilterRow"), j = $telerik.getElementByClassName(g, "rgFooter"), m = $telerik.getElementByClassName(g, "rgPager"), e = d ? 1 : -1;
if (f) {
f.colSpan += e;
}
if (l) {
l.colSpan += e;
}
if (m) {
m.cells[0].colSpan += e;
}
if (h) {
if (d) {
this._prependCell(h);
} else {
h.removeChild(h.cells[0]);
}
}
if (j) {
if (d) {
this._prependCell(j);
} else {
j.removeChild(j.cells[0]);
}
}
}, _prependCell: function (e) {
if (e) {
var d = document.createElement("td");
d.innerHTML = " ";
e.insertBefore(d, e.cells[0]);
return d;
}
return {};
}, _isColumnEditable: function (d, g) {
if (!d) {
return;
}
var e = d._data, f = g && g.id.split("__")[1].charAt(0) === "-";
if (f && e.InsertVisiblityMode === "AlwaysHidden") {
return false;
}
return e.Editable || (f && e.InsertVisiblityMode === "AlwaysVisible");
}, _hideRgNoRecordsRow: function (g) {
var f = g.rows, e;
for (var d = 0;
d < f.length;
d++) {
e = f[f.length - d - 1];
if (e.className && e.className.indexOf("rgNoRecords") !== -1) {
e.style.display = "none";
break;
}
}
}, _clearRowClassStyles: function (g) {
var h = ["rgSelectedRow"];
var d = ["rgSelectedCell"];
for (var e = 0;
e < h.length;
e++) {
Sys.UI.DomElement.removeCssClass(g, h[e]);
}
for (var e = 0;
e < d.length;
e++) {
var k = g.getElementsByTagName("td");
for (var f = 0;
k.length < e;
e++) {
Sys.UI.DomElement.removeCssClass(k[f], d[e]);
}
}
}, _getBindingContext: function (d, e) {
return this._extend({}, d, {
item: d,
index: e,
dataIndex: typeof(e) !== "undefined" ? (this.get_currentPageIndex() * this.get_pageSize()) + e : null,
isSelected: typeof(e) !== "undefined" && Array.contains(this._owner._selectedIndexes, e + ""),
owner: this,
format: this._formatValue
});
}, _formatValue: function (e, d) {
if (typeof(e) === "undefined" || e === null) {
return "";
}
if (e.toString().indexOf("/Date(") != -1) {
e = new Date(parseInt(e.replace("/Date(", "").replace(")/", "")));
}
if (d) {
if (d.indexOf("{0:") < 0) {
d = "{0:" + d + "}";
}
} else {
d = "{0}";
}
return String.localeFormat(d, e);
}, _extend: function (g, e) {
if (arguments.length > 2) {
for (var d = 1;
d < arguments.length;
d++) {
this._extend(g, arguments[d]);
}
} else {
for (var f in e) {
g[f] = e[f];
}
}
return g;
}, _cacheDataItems: function () {
var d = this.get_dataItems();
if (this._cachedItems && this._cachedItems.length > 0) {
var f = this._cachedItems;
this._cachedItems = d.splice(this._dataSource.length, d.length - this._dataSource.length);
for (var e = 0;
e < f.length;
e++) {
this._cachedItems[this._cachedItems.length] = f[e];
}
f = null;
} else {
this._cachedItems = d.splice(this._dataSource.length, d.length - this._dataSource.length);
}
}, _getNextCachedItem: function () {
if (this._cachedItems && this._cachedItems.length > 0) {
return this._cachedItems.splice(0, 1)[0];
}
}, _getFormatedDataText: function (f, e, d) {
return String.localeFormat((f == "") ? "{0}" : f, d[e]);
}, _copyDataFieldsValuesToArray: function (d, e) {
var h = [];
if (!d || !e) {
return h;
}
for (var g = 0;
g < d.length;
g++) {
var f = d[g];
if (typeof(e[f]) != "number") {
Array.add(h, String.format("'{0}'", e[f]));
} else {
Array.add(h, e[f]);
}
}
return h;
}, _fillTemplateEditorsData: function (h, f, d) {
var o = null;
if (this._owner._editIndexes.length > 0 && Array.contains(this._owner._editIndexes, f._itemIndexHierarchical)) {
if (d == null) {
if (h._owner._data.EditMode == "InPlace") {
o = h.get_element();
} else {
o = h.get_element().nextSibling;
}
} else {
if (h._owner._data.EditMode != "InPlace") {
d = this._getEditFormCellByUniqueName(h, column);
}
}
} else {
o = h.get_element();
}
if (!o && !d) {
return;
}
if (!d) {
if (!o.tagName) {
return;
}
if (o.tagName.toLowerCase() != "tr") {
return;
}
}
for (var n in f) {
var e = $telerik.findControl((d != null) ? d : o, n);
if (e != null) {
var p = Object.getType(e).getName();
if (p == "Telerik.Web.UI.RadTextBox" || p == "Telerik.Web.UI.RadNumericTextBox" || p == "Telerik.Web.UI.RadMaskedTextBox") {
e.set_value(f[n]);
continue;
}
if (p == "Telerik.Web.UI.RadDateInput") {
e.set_selectedDate(f[n]);
continue;
}
if (p == "Telerik.Web.UI.RadDatePicker") {
e.set_selectedDate(f[n]);
continue;
}
if (p == "Telerik.Web.UI.RadEditor") {
e.set_html(f[n]);
continue;
}
if (p == "Telerik.Web.UI.RadComboBox") {
var j = e.findItemByValue(f[n]);
if (j) {
j.select();
} else {
e.set_value(f[n]);
}
continue;
}
}
var g = $telerik.findElement((d != null) ? d : o, n);
if (g != null) {
if (g.tagName.toLowerCase() == "input") {
if (g.type != "checkbox" && g.type != "radio") {
g.value = f[n];
continue;
} else {
g.checked = f[n];
continue;
}
} else {
if (g.tagName.toLowerCase() == "span") {
g.innerHTML = f[n];
continue;
} else {
if (g.tagName.toLowerCase() == "textarea") {
g.innerHTML = f[n];
continue;
} else {
if (g.tagName.toLowerCase() == "select") {
var m = g.options;
for (var l = 0;
l < m.length;
l++) {
if (m[l].value == f[n]) {
m[l].selected = true;
}
}
}
}
}
}
}
}
}, _getEditFormCellByUniqueName: function (h, f) {
var d = null;
var j = h.get_element().nextSibling;
if (j == null) {
return;
}
if (!j.tagName) {
return;
}
if (j.tagName.toLowerCase() != "tr") {
return;
}
var e = j.getElementsByTagName("td");
for (var k = 0, m = e.length;
k < m;
k++) {
if (!e[k].id || e[k].id == "") {
continue;
}
var g = e[k].id.split("__");
if (g[g.length - 1] && g[g.length - 1] == f.get_uniqueName()) {
d = e[k];
break;
}
}
return d;
}, _fillEditorsData: function (f, e, p) {
var o = e._data.ColumnType;
var d = null;
if (e._owner._data.EditMode == "InPlace") {
d = this.getCellByColumnUniqueName(f, e.get_uniqueName());
} else {
d = this._getEditFormCellByUniqueName(f, e);
}
if (d == null) {
return;
}
if (o == "GridBoundColumn") {
var j = d.getElementsByTagName("input");
if (j.length > 0) {
j[0].value = p;
}
}
if (o == "GridDateTimeColumn") {
var j = d.getElementsByTagName("input");
for (var m = 0;
m < j.length;
m++) {
var g = $find(j[m].id);
if (g != null) {
g.set_selectedDate(p);
}
}
}
if (o == "GridNumericColumn") {
var j = d.getElementsByTagName("input");
for (var m = 0;
m < j.length;
m++) {
var h = $find(j[m].id);
if (h != null) {
h.set_value(p);
}
}
}
if (o == "GridHTMLEditorColumn") {
var j = d.getElementsByTagName("textarea");
for (var m = 0;
m < j.length;
m++) {
var h = $find(j[m].id);
if (h != null) {
h.set_html(p);
}
}
}
if (o == "GridDropDownColumn") {
var j = d.getElementsByTagName("input");
for (var m = 0;
m < j.length;
m++) {
var h = $find(j[m].id.replace("_Input", ""));
if (h != null) {
var l = h.findItemByValue(p);
if (l) {
l.select();
}
}
}
var n = d.getElementsByTagName("option");
for (var m = 0;
m < n.length;
m++) {
if (n[m].value == p) {
n[m].selected = true;
}
}
}
if (o == "GridCheckBoxColumn") {
var j = d.getElementsByTagName("input");
if (j.length == 1 && j[0].type == "checkbox") {
j[0].checked = p;
}
}
}, extractValuesFromItem: function (x) {
x = this._getRowByIndexOrItemIndexHierarchical(x);
if (Telerik.Web.UI.Grid.GetFirstParentByTagName(x, "table") !== this.get_element()) {
return null;
}
this.get_dataItems();
var n = $find(x.id);
var g = this.get_columns();
var w = {};
for (var q = 0, v = g.length;
q < v;
q++) {
var f = g[q];
var B = f.get_uniqueName();
var A = f._data.ColumnType;
var m = f._data.DataField;
var d;
if (this._data.EditMode != "InPlace") {
var p = x.id.indexOf("__") > -1 ? x.nextSibling : x;
var e = p.getElementsByTagName("td");
for (var t = 0, u = e.length;
t < u;
t++) {
if (!e[t].id || e[t].id.indexOf("__") < 0) {
continue;
}
var h = e[t].id.split("__");
if (h[h.length - 1] == f.get_uniqueName()) {
d = e[t];
break;
}
}
} else {
d = this._getCellByColumnUniqueNameFromTableRowElement(x, B);
}
if (!d) {
continue;
}
if (A == "GridBoundColumn") {
var s = d.getElementsByTagName("input");
if (s.length == 1) {
w[m] = s[0].value;
}
}
if (A == "GridDateTimeColumn") {
var s = d.getElementsByTagName("input");
for (var u = 0;
u < s.length;
u++) {
var o = $find(s[u].id);
if (o != null) {
w[m] = o.get_selectedDate();
}
}
}
if (A == "GridNumericColumn") {
var s = d.getElementsByTagName("input");
for (var u = 0;
u < s.length;
u++) {
var r = $find(s[u].id);
if (r != null) {
w[m] = r.get_value();
}
}
}
if (A == "GridHTMLEditorColumn") {
var s = d.getElementsByTagName("textarea");
for (var u = 0;
u < s.length;
u++) {
var r = $find(s[u].name.replace(/\$/gi, "_")) || $find(s[u].id);
if (r && r.get_html) {
w[m] = r.get_html();
}
}
}
if (A == "GridDropDownColumn") {
var s = d.getElementsByTagName("input");
for (var u = 0;
u < s.length;
u++) {
var r = $find(s[u].id.replace("_Input", ""));
if (r != null) {
w[m] = r.get_value();
}
}
var z = d.getElementsByTagName("select");
if (z.length > 0) {
var y = z[0];
w[m] = y.options[y.selectedIndex].value;
}
}
if (A == "GridCheckBoxColumn") {
var s = d.getElementsByTagName("input");
if (s.length == 1 && s[0].type == "checkbox") {
w[m] = s[0].checked;
}
}
}
return w;
}, extractOldValuesFromItem: function (f) {
f = this._getRowByIndexOrItemIndexHierarchical(f);
this.get_dataItems();
var d = $find(f.id);
var e = {};
if (d != null) {
e = d.get_dataItem();
}
return e;
}, extractKeysFromItem: function (g) {
var e = {};
g = this._getRowByIndexOrItemIndexHierarchical(g);
if (g && g.id && g.id.indexOf("__") > -1) {
var d = g.id.split("__")[1];
if (this._owner._clientKeyValues && this._owner._clientKeyValues[d]) {
var h = this._owner._clientKeyValues[d];
for (var f in h) {
e[f] = h[f];
}
}
}
return e;
}, prepareSortQueryOption: function (g, j) {
if (j != null && j != "" && g.get_count() > 0) {
var h = j.split(",");
var d = "";
var l = true;
for (var f = 0;
f < h.length;
f++) {
for (var e = 0;
e < g.get_count();
e++) {
if (h[f].indexOf(g.getItem(e).get_fieldName()) > -1) {
l = false;
break;
}
}
if (l) {
d += h[f] + ", ";
} else {
l = true;
}
}
return d.substring(0, d.lastIndexOf(","));
} else {
return j;
}
}, getDataServiceQuery: function (o, g, n, d, h) {
n = this.prepareSortQueryOption(this.get_sortExpressions(), n);
var l = this.get_sortExpressions().toString().replace(/ ASC/gm, " asc").replace(/ DESC/gm, " desc");
var e = this.get_filterExpressions().toDataService();
d = typeof d === "undefined" ? this.get_currentPageIndex() : d;
h = typeof h === "undefined" ? this.get_pageSize() : h;
var k = new Sys.StringBuilder();
var m = "&$orderby={0}";
if (n != null && n != "") {
var m = String.format(m, n);
if (l != "") {
m += ", {0}";
k.append(String.format(m, l));
} else {
k.append(m);
}
} else {
if (l != "") {
k.append(String.format(m, l));
}
}
var f = "&$filter={0}";
if (g != null && g != "") {
f = String.format(f, g);
if (e != "") {
f += " and {0}";
k.append(String.format(f, e));
} else {
k.append(f);
}
} else {
if (e != "") {
k.append(String.format(f, e));
}
}
if (this._owner._isBoundToServiceType(Telerik.Web.UI.GridClientDataServiceType.OData)) {
if (this.get_allowPaging() || this._virtualization) {
k.append("&$inlinecount=allpages");
}
if (this._owner._getDataResponseType() === "jsonp") {
k.append("&$format=json");
}
}
if (this.get_allowPaging() || this._virtualization) {
k.append(String.format("&$top={0}&$skip={1}", h, d * h));
}
var j = k.toString();
if (o.indexOf("?") > -1) {
return o + j;
}
return o + "?" + j.substr(1);
}
}, c;
for (c in b) {
a.GridTableView.prototype[c] = b[c];
}
})(Telerik.Web.UI);
/* END Telerik.Web.UI.Grid.RadGridScripts.js */
/* START Telerik.Web.UI.Input.TextBox.RadInputScript.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.PasswordStrengthChecker = function (a) {
Telerik.Web.UI.PasswordStrengthChecker.initializeBase(this, [a]);
};
Telerik.Web.UI.PasswordStrengthChecker.prototype = {
initialize: function () {
Telerik.Web.UI.PasswordStrengthChecker.callBaseMethod(this, "initialize");
}, dispose: function () {
}, _getPasswordStrength: function (e, p) {
var m = e;
var n = "";
var l = 0;
var s = p.CalculationWeightings.split(";");
var b = parseInt(s[0]);
var c = parseInt(s[1]);
var a = parseInt(s[2]);
var d = parseInt(s[3]);
var o = m.length / p.PreferredPasswordLength;
if (o > 1) {
o = 1;
}
var f = (o * b);
l += f;
if (o < 1) {
n = String.format("Remaining characters", p.PreferredPasswordLength - m.length);
}
if (p.MinimumNumericCharacters > 0) {
var h = new RegExp("[0-9]", "g");
var i = this._getRegexCount(h, m);
if (i >= p.MinimumNumericCharacters) {
l += c;
}
if (i < p.MinimumNumericCharacters) {
if (n != "") {
n += ", ";
}
n += String.format("Remaining numbers", p.MinimumNumericCharacters - i);
}
} else {
l += (o * c);
}
if (p.RequiresUpperAndLowerCaseCharacters == true || (typeof(p.RequiresUpperAndLowerCaseCharacters) == "String" && Boolean.parse(p.RequiresUpperAndLowerCaseCharacters) == true)) {
var g = new RegExp("[a-z]", "g");
var r = new RegExp("[A-Z]", "g");
var j = this._getRegexCount(g, m);
var k = this._getRegexCount(r, m);
if (j > 0 || k > 0) {
if (j >= p.MinLowerCaseChars && k >= p.MinUpperCaseChars) {
l += a;
} else {
if (p.MinLowerCaseChars > 0 && (p.MinLowerCaseChars - j) > 0) {
if (n != "") {
n += ", ";
}
n += String.format("Remaining lower case", p.MinLowerCaseChars - j);
}
if (p.MinUpperCaseChars > 0 && (p.MinUpperCaseChars - k) > 0) {
if (n != "") {
n += ", ";
}
n += String.format("Remaining upper case", p.MinUpperCaseChars - k);
}
}
} else {
if (n != "") {
n += ", ";
}
n += "Mixed case characters";
}
} else {
l += (o * a);
}
if (p.MinimumSymbolCharacters > 0) {
var q = new RegExp("[^a-zA-Z0-9\x20]", "g");
var i = this._getRegexCount(q, m);
if (i >= p.MinimumSymbolCharacters) {
l += d;
}
if (i < p.MinimumSymbolCharacters) {
if (n != "") {
n += ", ";
}
n += String.format("Remaining symbols", p.MinimumSymbolCharacters - i);
}
} else {
l += (o * d);
}
return l;
}, showStrength: function (e, a, h) {
var g = this._getPasswordStrength(a.value, h);
var b = new Telerik.Web.UI.PasswordStrengthCalculatingEventArgs(a.value, g, "");
e.raise_passwordStrengthCalculating(b);
var c = null;
if (b._strengthScore > 0 && b._strengthScore <= 100) {
c = Math.floor(b._strengthScore / 25);
}
var d = "";
if (b._indicatorText) {
d = b._indicatorText;
} else {
if (h._IndicatorWords == undefined) {
h._IndicatorWords = h.TextStrengthDescriptions.split(";");
while (h._IndicatorWords.length < 5) {
h._IndicatorWords[h._IndicatorWords.length] = "";
}
}
if (c != null) {
d = h._IndicatorWords[c];
}
}
if (h._IndicatorStyles == undefined) {
h._IndicatorStyles = h.TextStrengthDescriptionStyles.split(";");
}
var f = null;
if (h.IndicatorElementID == "") {
if (e.get_element) {
f = $get(e.get_element().id + "_passwordStrengthIndicator");
} else {
f = $get(a.id + "_passwordStrengthIndicator");
}
} else {
f = $get(h.IndicatorElementID);
}
if (f) {
f.innerHTML = d;
if (c != null) {
f.className = h.IndicatorElementBaseStyle + " " + h._IndicatorStyles[c + 1];
} else {
f.className = h.IndicatorElementBaseStyle + " " + h._IndicatorStyles[0];
}
}
}, _getRegexCount: function (b, d) {
var a = 0;
if (d != null && d != "") {
var c = d.match(b);
if (c != null) {
a = c.length;
}
}
return a;
}
};
Telerik.Web.UI.PasswordStrengthChecker.registerClass("Telerik.Web.UI.PasswordStrengthChecker", Telerik.Web.UI.RadWebControl);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadInputControl = function (a) {
Telerik.Web.UI.RadInputControl.initializeBase(this, [a]);
this._autoPostBack = false;
this._enabled = true;
this._showButton = false;
this._invalidStyleDuration = 100;
this._selectionOnFocus = Telerik.Web.UI.SelectionOnFocus.None;
this._postBackEventReferenceScript = "";
this._styles = null;
this._skin = null;
this._enableAriaSupport = false;
this._causesValidation = false;
this._validationGroup = "";
this._isEnterPressed = false;
this._isDropped = false;
this._enableOldBoxModel = false;
this._shouldResetWidthInPixels = true;
this._reducedPixelWidthFlag = false;
this._originalTextBoxWidth = null;
this._originalCellPadding = null;
this._originalDisplay = null;
this._onTextBoxKeyUpDelegate = null;
this._onTextBoxKeyPressDelegate = null;
this._onTextBoxBlurDelegate = null;
this._onTextBoxFocusDelegate = null;
this._onTextBoxDragEnterDelegate = null;
this._onTextBoxDragLeaveDelegate = null;
this._onTextBoxDragDropDelegate = null;
this._onTextBoxMouseOutDelegate = null;
this._onTextBoxMouseOverDelegate = null;
this._onTextBoxKeyDownDelegate = null;
this._onTextBoxMouseWheelDelegate = null;
this._onFormResetDelegate = null;
this._emptyMessage = "";
this._initialValueAsText = null;
this._originalInitialValueAsText = "";
this._validationText = "";
this._displayText = "";
this._value = "";
this._text = "";
this._holdsValidValue = true;
this._lastSetTextBoxValue = "";
if ($telerik.isSafari) {
this._onTextBoxMouseUpDelegate = null;
}
this._focused = false;
this._allowApplySelection = false;
this._isRtl = false;
this._nonTableLayout = true;
};
Telerik.Web.UI.RadInputControl.prototype = {
initialize: function () {
Telerik.Web.UI.RadInputControl.OverrideValidatorFunctions();
Telerik.Web.UI.RadInputControl.callBaseMethod(this, "initialize");
this._clientID = this.get_id();
this._wrapperElementID = this.get_id() + "_wrapper";
var a = (!$telerik.quirksMode && ($telerik.isIE6 || ($telerik.isIE7 && !document.documentMode) || (document.documentMode && document.documentMode < 8)));
this._nonTableLayout = this.get_wrapperElement().className.indexOf("riSingle") > -1;
this._textBoxElement = $get(this._clientID);
this._textBoxElement.RadInputValidationValue = this._validationText;
if (this._initialValueAsText !== null) {
this._value = this._constructValueFromInitialText(this._initialValueAsText);
this._text = this._constructEditText(this._value);
this._originalInitialValueAsText = this._initialValueAsText;
}
this._lastSetTextBoxValue = this._displayText;
this._textBoxElement.RadInputLastSetTextBoxValue = this._displayText;
this._initialValueAsText = this._text;
if (this._nonTableLayout && a) {
this._textBoxElement.style.width = "100%";
this._enableOldBoxModel = true;
}
this._originalTextBoxCssText = this._textBoxElement.style.cssText;
if (this._originalTextBoxCssText.lastIndexOf(";") != this._originalTextBoxCssText.length - 1) {
this._originalTextBoxCssText += ";";
}
var d = this.get_wrapperElement();
if (d.style.display == "none") {
this._originalDisplay = "";
} else {
this._originalDisplay = d.style.display;
}
if ($telerik.isIE7 || $telerik.quirksMode) {
if (this._originalDisplay == "inline-block") {
this._originalDisplay = "inline";
d.style.zoom = 1;
} else {
if (document.documentMode && document.documentMode > 7 && this._originalDisplay == "inline") {
this._originalDisplay = "inline-block";
}
}
}
if (d.style.display != "none") {
d.style.display = this._originalDisplay;
}
if ($telerik.getCurrentStyle(d, "direction") == "rtl") {
var b = this._skin != "" ? String.format(" RadInputRTL_{0}", this._skin) : "";
d.className += String.format(" RadInputRTL{0}", b);
this._isRtl = true;
}
this.repaint();
this._originalMaxLength = this._textBoxElement.maxLength;
if (this._originalMaxLength == -1) {
this._originalMaxLength = 2147483647;
}
this._selectionEnd = 0;
this._selectionStart = 0;
this._hovered = false;
this._invalid = false;
this._attachEventHandlers();
if (this._focused) {
this.updateDisplayValue();
var c = this;
setTimeout(function () {
c._updateSelectionOnFocus();
}, 0);
} else {
if (($telerik.isFirefox2 || $telerik.isSafari) && this.isEmpty() && this.get_emptyMessage().length > this._originalMaxLength) {
this.updateDisplayValue();
}
}
this.updateCssClass();
this._initializeButtons();
if (this.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
this.updateClientState();
this.raise_load(Sys.EventArgs.Empty);
}, dispose: function () {
Telerik.Web.UI.RadInputControl.callBaseMethod(this, "dispose");
if (this.Button) {
if (this._onButtonClickDelegate) {
$removeHandler(this.Button, "click", this._onButtonClickDelegate);
this._onButtonClickDelegate = null;
}
}
if (this._onTextBoxPasteDelegate) {
$removeHandler(this._textBoxElement, "paste", this._onTextBoxPasteDelegate);
this._onTextBoxPasteDelegate = null;
}
if (this._onTextBoxInputDelegate) {
$removeHandler(this._textBoxElement, "input", this._onTextBoxInputDelegate);
this._onTextBoxInputDelegate = null;
}
if (this._onTextBoxKeyDownDelegate) {
$removeHandler(this._textBoxElement, "keydown", this._onTextBoxKeyDownDelegate);
this._onTextBoxKeyDownDelegate = null;
}
if (this._onTextBoxKeyPressDelegate) {
$removeHandler(this._textBoxElement, "keypress", this._onTextBoxKeyPressDelegate);
this._onTextBoxKeyPressDelegate = null;
}
if (this._onTextBoxKeyUpDelegate) {
$removeHandler(this._textBoxElement, "keyup", this._onTextBoxKeyUpDelegate);
this._onTextBoxKeyUpDelegate = null;
}
if (this._onTextBoxBlurDelegate) {
$removeHandler(this._textBoxElement, "blur", this._onTextBoxBlurDelegate);
this._onTextBoxBlurDelegate = null;
}
if (this._onTextBoxFocusDelegate) {
$removeHandler(this._textBoxElement, "focus", this._onTextBoxFocusDelegate);
this._onTextBoxFocusDelegate = null;
}
if (this._onTextBoxDragEnterDelegate) {
$removeHandler(this._textBoxElement, "dragenter", this._onTextBoxDragEnterDelegate);
this._onTextBoxDragEnterDelegate = null;
}
if (this._onTextBoxDragLeaveDelegate) {
if ($telerik.isFirefox) {
$removeHandler(this._textBoxElement, "dragexit", this._onTextBoxDragLeaveDelegate);
} else {
$removeHandler(this._textBoxElement, "dragleave", this._onTextBoxDragLeaveDelegate);
}
this._onTextBoxDragLeaveDelegate = null;
}
if (this._onTextBoxMouseOutDelegate) {
$removeHandler(this._textBoxElement, "mouseout", this._onTextBoxMouseOutDelegate);
this._onTextBoxMouseOutDelegate = null;
}
if (this._onTextBoxMouseOverDelegate) {
$removeHandler(this._textBoxElement, "mouseover", this._onTextBoxMouseOverDelegate);
this._onTextBoxMouseOverDelegate = null;
}
if (this._onTextBoxMouseUpDelegate) {
$removeHandler(this._textBoxElement, "mouseup", this._onTextBoxMouseUpDelegate);
this._onTextBoxMouseUpDelegate = null;
}
if (this._onFormResetDelegate) {
if (this._textBoxElement.form) {
$removeHandler(this._textBoxElement.form, "reset", this._onFormResetDelegate);
}
this._onFormResetDelegate = null;
}
if (!$telerik.isIE) {
if (this._onTextBoxMouseWheelDelegate) {
if ((!$telerik.isSafari2 && $telerik.isSafari) || $telerik.isOpera) {
$removeHandler(this._textBoxElement, "mousewheel", this._onTextBoxMouseWheelDelegate);
} else {
$removeHandler(this._textBoxElement, "DOMMouseScroll", this._onTextBoxMouseWheelDelegate);
}
this._onTextBoxMouseWheelDelegate = null;
}
} else {
if (this._onTextBoxMouseWheelDelegate) {
$removeHandler(this._textBoxElement, "mousewheel", this._onTextBoxMouseWheelDelegate);
this._onTextBoxMouseWheelDelegate = null;
}
}
if (this._onTextBoxDragDropDelegate) {
if ($telerik.isFirefox && Sys.Browser.version < 3.5) {
$removeHandler(this._textBoxElement, "dragdrop", this._onTextBoxDragDropDelegate);
} else {
$removeHandler(this._textBoxElement, "drop", this._onTextBoxDragDropDelegate);
}
this._onTextBoxDragDropDelegate = null;
}
if (this._textBoxElement) {
this._textBoxElement._events = null;
}
}, clear: function () {
this.set_value("");
}, disable: function () {
this.set_enabled(false);
this._textBoxElement.disabled = "disabled";
this.updateCssClass();
this.updateClientState();
this.raise_disable(Sys.EventArgs.Empty);
}, enable: function () {
this.set_enabled(true);
this._textBoxElement.disabled = "";
this.updateCssClass();
this.updateClientState();
this.raise_enable(Sys.EventArgs.Empty);
}, focus: function () {
if (!this._textBoxElement.disabled) {
this._textBoxElement.focus();
}
}, blur: function () {
this._textBoxElement.blur();
}, isEmpty: function () {
return this._validationText == "";
}, isNegative: function () {
return false;
}, isReadOnly: function () {
return this._textBoxElement.readOnly || !this._enabled;
}, isMultiLine: function () {
return this._textBoxElement && this._textBoxElement.tagName.toUpperCase() == "TEXTAREA";
}, updateDisplayValue: function () {
if (this._focused) {
if (!this._holdsValidValue) {
this._holdsValidValue = true;
} else {
this.set_textBoxValue(this.get_editValue());
}
} else {
if (this._isEmptyMessage()) {
this.set_textBoxValue(this.get_emptyMessage());
} else {
this.set_textBoxValue(this.get_displayValue());
}
}
}, _isEmptyMessage: function () {
return this.isEmpty() && this.get_emptyMessage();
}, repaint: function () {
if (!this.canRepaint()) {
this.add_parentShown(this.get_element());
return;
} else {
this._clearParentShowHandlers();
}
this._updatePercentageHeight();
if (this._shouldResetWidthInPixels) {
this._resetWidthInPixels();
}
if (!this._reducedPixelWidthFlag && this._enableOldBoxModel) {
var a = this;
setTimeout(function () {
a._reducePixelWidthByPaddings();
}, 0);
}
}, updateCssClass: function (b) {
if (!this._holdsValidValue && !b) {
this._textBoxElement.style.cssText = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["InvalidStyle"][0]);
this._textBoxElement.className = this.get_styles()["InvalidStyle"][1];
return;
}
var c = "";
var a = "";
if (this._enabled && (!this._isEmptyMessage()) && (!this.isNegative())) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["EnabledStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["EnabledStyle"][1];
}
if (this._enabled && (!this._isEmptyMessage()) && this.isNegative()) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["NegativeStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["NegativeStyle"][1];
}
if (this._enabled && this._isEmptyMessage()) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["EmptyMessageStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["EmptyMessageStyle"][1];
}
if (this._focused) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["FocusedStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["FocusedStyle"][1];
}
if (this._invalid) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["InvalidStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["InvalidStyle"][1];
}
if (this._textBoxElement.readOnly && this._isEmptyMessage()) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["EmptyMessageStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["EmptyMessageStyle"][1];
} else {
if (this._textBoxElement.readOnly) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["ReadOnlyStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["ReadOnlyStyle"][1];
}
}
if (!this._enabled) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["DisabledStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = this.get_styles()["DisabledStyle"][1];
}
if (this._hovered) {
a = this._originalTextBoxCssText + this.updateCssText(this.get_styles()["HoveredStyle"][0]);
if (!this._compareStyles(this._textBoxElement.style.cssText, a)) {
this._textBoxElement.style.cssText = a;
}
c = c.trim() + " " + this.get_styles()["HoveredStyle"][1].replace("riTextBox", "").trim();
}
if (c != "" && !this._compareStyles(this._textBoxElement.className, c)) {
this._textBoxElement.className = c;
}
if (c == "" && this._textBoxElement.className && this._textBoxElement.className == "") {
this._textBoxElement.removeAttribute("class");
}
}, _compareStyles: function () {
if (arguments.length >= 2) {
var a = arguments[0].replace(/ /g, "").replace(/;/g, "");
var b = arguments[1].replace(/ /g, "").replace(/;/g, "");
return a === b;
}
return false;
}, updateCssText: function (f) {
var e = f.split(";");
var a;
var c = "";
for (a = 0;
a < e.length;
a++) {
var d = e[a].split(":");
if (d.length == 2) {
var b = "" + d[0].toLowerCase();
if (b != "width" && b != "height") {
c += e[a] + ";";
}
}
}
return c;
}, selectText: function (b, a) {
this._selectionStart = b;
this._selectionEnd = a;
this._applySelection();
}, selectAllText: function () {
if (this._textBoxElement.value.length > 0) {
this.selectText(0, this._textBoxElement.value.length);
return true;
}
return false;
}, get_value: function () {
return this._value;
}, get_valueAsString: function () {
if (this._value) {
return this._value.toString();
} else {
return "";
}
}, _setNewValue: function (a) {
this._holdsValidValue = this._setHiddenValue(a) || this._holdsValidValue;
this._textBoxElement.RadInputLastSetTextBoxValue = this._textBoxElement.value;
this._triggerDomEvent("change", this._textBoxElement);
if (this._holdsValidValue) {
this.set_displayValue(this._constructDisplayText(this._value));
this.updateClientState();
var b = this._initialValueAsText;
this._initialValueAsText = this._textBoxElement.value;
this.raise_valueChanged(this.get_editValue(), b);
this.updateCssClass();
} else {
this.updateClientState();
}
this._initialValueAsText = this.get_editValue();
}, set_value: function (b) {
var a = new Telerik.Web.UI.InputValueChangingEventArgs(b, this._initialValueAsText);
this.raise_valueChanging(a);
if (a.get_cancel() == true) {
this._SetValue(this._initialValueAsText);
return false;
}
b = a.get_newValue();
this._setNewValue(b);
}, get_displayValue: function () {
return this._displayText;
}, set_displayValue: function (a) {
this._displayText = a;
this.updateDisplayValue();
}, get_editValue: function () {
return this._text;
}, set_caretPosition: function (a) {
if (this._textBoxElement.tagName.toLowerCase() == "textarea" && this._textBoxElement.value.length < a) {
return;
}
this._selectionStart = a;
this._selectionEnd = a;
this._applySelection();
}, get_caretPosition: function () {
this._calculateSelection();
if (this._selectionStart != this._selectionEnd) {
return new Array(this._selectionStart, this._selectionEnd);
} else {
if (this._textBoxElement.selectionStart) {
return this._textBoxElement.selectionStart;
} else {
return this._selectionStart;
}
}
}, raisePostBackEvent: function () {
eval(this._postBackEventReferenceScript);
}, get_wrapperElement: function () {
return $get(this._wrapperElementID);
}, get_textBoxValue: function () {
return this._textBoxElement.value;
}, set_textBoxValue: function (a) {
if (this._textBoxElement.value != a) {
this._textBoxElement.value = a;
}
this._lastSetTextBoxValue = a;
this._textBoxElement.RadInputLastSetTextBoxValue = a;
}, get_autoPostBack: function () {
return this._autoPostBack;
}, set_autoPostBack: function (a) {
if (this._autoPostBack !== a) {
this._autoPostBack = a;
this.raisePropertyChanged("autoPostBack");
}
}, get_emptyMessage: function () {
return this._emptyMessage;
}, set_emptyMessage: function (a) {
if (this._emptyMessage !== a) {
this._emptyMessage = a;
if (this._textBoxElement) {
this.updateDisplayValue();
this.updateCssClass();
this.updateClientState();
this.raisePropertyChanged("emptyMessage");
}
}
}, get_selectionOnFocus: function () {
return this._selectionOnFocus;
}, set_selectionOnFocus: function (a) {
if (this._selectionOnFocus !== a) {
this._selectionOnFocus = a;
this.raisePropertyChanged("selectionOnFocus");
}
}, get_showButton: function () {
return this._showButton;
}, set_showButton: function (a) {
if (this._showButton !== a) {
this._showButton = a;
this.raisePropertyChanged("showButton");
}
}, get_invalidStyleDuration: function () {
return this._invalidStyleDuration;
}, set_invalidStyleDuration: function (a) {
if (this._invalidStyleDuration !== a) {
this._invalidStyleDuration = a;
this.raisePropertyChanged("invalidStyleDuration");
}
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (a) {
if (this._enabled !== a) {
this._enabled = a;
this.updateClientState();
if (this.get_enableAriaSupport()) {
this._applyAriaStateChange("disabled", !a);
}
this.raisePropertyChanged("enabled");
}
}, get_styles: function () {
return this._styles;
}, set_styles: function (a) {
if (this._styles !== a) {
this._styles = a;
this.raisePropertyChanged("styles");
}
}, saveClientState: function (a) {
var d = ["enabled", "emptyMessage", "validationText", "valueAsString"];
if (a) {
for (var b = 0, c = a.length;
b < c;
b++) {
d[d.length] = a[b];
}
}
var e = {};
for (var b = 0;
b < d.length;
b++) {
e[d[b]] = this["get_" + d[b]]();
}
this.saveCustomClientStateValues(e);
return Sys.Serialization.JavaScriptSerializer.serialize(e);
}, saveCustomClientStateValues: function (a) {
a.lastSetTextBoxValue = this._lastSetTextBoxValue;
}, get_visible: function () {
if (this.get_wrapperElement().style.display == "none") {
return false;
} else {
return true;
}
}, set_visible: function (a) {
if (a == true && this._originalDisplay != null) {
this.get_wrapperElement().style.display = this._originalDisplay;
this.repaint();
} else {
if (a == false && this.get_visible()) {
this._originalDisplay = this.get_wrapperElement().style.display;
this.get_wrapperElement().style.display = "none";
}
}
}, get_shouldResetWidthInPixels: function () {
return this._shouldResetWidthInPixels;
}, set_shouldResetWidthInPixels: function (a) {
this._shouldResetWidthInPixels = a;
}, get_enableOldBoxModel: function () {
return this._enableOldBoxModel;
}, set_enableOldBoxModel: function (a) {
this._enableOldBoxModel = a;
}, get_enableAriaSupport: function () {
return this._enableAriaSupport;
}, set_enableAriaSupport: function (a) {
if (this._enableAriaSupport != a) {
this._enableAriaSupport = a;
}
}, get_causesValidation: function () {
return this._causesValidation;
}, get_validationGroup: function () {
return this._validationGroup;
}, _reducePixelWidthByPaddings: function () {
if (this._textBoxElement.offsetWidth > 0 && this._textBoxElement.parentNode.tagName.toLowerCase() == "span" && this._textBoxElement.style.width && (this._nonTableLayout || (this._textBoxElement.parentNode.parentNode.className != "rcInputCell" && this._textBoxElement.style.width.indexOf("%") == -1 && (!this._originalTextBoxWidth || this._originalTextBoxWidth.indexOf("%") == -1)))) {
var e = 0;
if (document.defaultView && document.defaultView.getComputedStyle) {
e = parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-left-width")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-right")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-right-width"));
HeightPaddingsBorders = parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-top-width")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-top")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-bottom")) + parseInt(document.defaultView.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-bottom-width"));
} else {
if (this._textBoxElement.currentStyle) {
if (document.compatMode && document.compatMode != "BackCompat") {
e = parseInt(this._textBoxElement.currentStyle.borderLeftWidth) + parseInt(this._textBoxElement.currentStyle.paddingLeft) + parseInt(this._textBoxElement.currentStyle.paddingRight) + parseInt(this._textBoxElement.currentStyle.borderRightWidth);
HeightPaddingsBorders = parseInt(this._textBoxElement.currentStyle.borderTopWidth) + parseInt(this._textBoxElement.currentStyle.paddingTop) + parseInt(this._textBoxElement.currentStyle.paddingBottom) + parseInt(this._textBoxElement.currentStyle.borderBottomWidth);
}
}
}
var h = parseInt(this._textBoxElement.style.width);
if (this._nonTableLayout && this._textBoxElement.parentNode.style.width && this._textBoxElement.parentNode.style.width.indexOf("%") == -1) {
h = parseInt(this._textBoxElement.parentNode.currentStyle.width);
}
var j = h - e;
var a = parseInt(this._textBoxElement.offsetHeight) - HeightPaddingsBorders;
if (e == 0 || j <= 0) {
return;
}
this._textBoxElement.style.width = j + "px";
var d = "";
var g = this._originalTextBoxCssText.split(";");
if (g == []) {
for (var b = 0;
b < g.length;
b++) {
var f = g[b].split(":");
if (f.length == 2) {
var c = "" + f[0].toLowerCase();
if (c != "width" || c != "height") {
d += g[b] + ";";
} else {
if (c == "width") {
d += "width:" + j + "px;";
if (!this._originalTextBoxWidth) {
this._originalTextBoxWidth = g[b].split(":")[1].trim();
}
} else {
d += "height:" + j + "px;";
}
}
}
}
} else {
d += "width:" + j + "px;";
d += "height:" + a + "px;";
}
this._originalTextBoxCssText = d;
this._reducedPixelWidthFlag = true;
}
}, _updatePercentageHeight: function () {
var b = $get(this._wrapperElementID);
if (b.style.height.indexOf("%") != -1 && b.offsetHeight > 0) {
var a = 0;
if (this._textBoxElement.currentStyle) {
a = parseInt(this._textBoxElement.currentStyle.borderTopWidth) + parseInt(this._textBoxElement.currentStyle.borderBottomWidth) + parseInt(this._textBoxElement.currentStyle.paddingTop) + parseInt(this._textBoxElement.currentStyle.paddingBottom);
} else {
if (window.getComputedStyle) {
a = parseInt(window.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-top-width")) + parseInt(window.getComputedStyle(this._textBoxElement, null).getPropertyValue("border-bottom-width")) + parseInt(window.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-top")) + parseInt(window.getComputedStyle(this._textBoxElement, null).getPropertyValue("padding-bottom"));
}
}
this._textBoxElement.style.height = "1px";
this._textBoxElement.style.cssText = this._textBoxElement.style.cssText;
this._textBoxElement.style.height = b.offsetHeight - a + "px";
if (this._originalTextBoxCssText.search(/(^|[^-])height/) != -1) {
this._originalTextBoxCssText = this._originalTextBoxCssText.replace(/(^|[^-])height(\s*):(\s*)([^;]+);/i, "$1height:" + (b.offsetHeight - a) + "px;");
} else {
this._originalTextBoxCssText += "height:" + (b.offsetHeight - a) + "px;";
}
}
}, _resetWidthInPixels: function () {
if (($telerik.isIE6 || ($telerik.isIE7 && !document.documentMode) || (document.documentMode && document.documentMode < 8)) && this._textBoxElement.offsetWidth > 0 && (this._textBoxElement.parentNode.tagName.toLowerCase() == "td" || (this._textBoxElement.parentNode.parentNode.tagName.toLowerCase() == "td" && this._textBoxElement.parentNode.parentNode.className == "rcInputCell") || (this._textBoxElement.parentNode.tagName.toLowerCase() == "span" && this._textBoxElement.parentNode.parentNode.className != "rcInputCell" && (this._textBoxElement.currentStyle.width.indexOf("%") != -1 || (this._originalTextBoxWidth && this._originalTextBoxWidth.indexOf("%") != -1))))) {
var g = this._textBoxElement.value;
var d;
var h;
var c = "";
if (g != "") {
this._textBoxElement.value = "";
}
if (this._originalCellPadding && this._textBoxElement.parentNode.tagName.toLowerCase() == "td") {
this._textBoxElement.parentNode.style.paddingRight = this._originalCellPadding;
} else {
if (this._originalCellPadding && this._textBoxElement.parentNode.parentNode.tagName.toLowerCase() == "td" && this._textBoxElement.parentNode.parentNode.className == "rcInputCell") {
this._textBoxElement.parentNode.parentNode.style.paddingRight = this._originalCellPadding;
}
}
if (this._originalTextBoxWidth) {
this._textBoxElement.style.width = this._originalTextBoxWidth;
} else {
if (g != "") {
this._textBoxElement.style.cssText = this._textBoxElement.style.cssText;
}
}
d = parseInt(this._textBoxElement.currentStyle.paddingLeft) + parseInt(this._textBoxElement.currentStyle.paddingRight);
h = this._textBoxElement.clientWidth - d;
if (h > 0) {
this._textBoxElement.style.width = h + "px";
if (this._textBoxElement.parentNode.tagName.toLowerCase() == "td") {
if (!this._originalCellPadding) {
this._originalCellPadding = this._textBoxElement.parentNode.currentStyle.paddingRight;
}
this._textBoxElement.parentNode.style.paddingRight = "0px";
} else {
if (this._textBoxElement.parentNode.parentNode.tagName.toLowerCase() == "td" && this._textBoxElement.parentNode.parentNode.className == "rcInputCell") {
if (!this._originalCellPadding) {
this._originalCellPadding = this._textBoxElement.parentNode.parentNode.currentStyle.paddingRight;
}
this._textBoxElement.parentNode.parentNode.style.paddingRight = "0px";
}
}
var f = this._originalTextBoxCssText.split(";");
for (var a = 0;
a < f.length;
a++) {
var e = f[a].split(":");
if (e.length == 2) {
var b = "" + e[0].toLowerCase();
if (b != "width") {
c += f[a] + ";";
} else {
c += "width:" + h + "px;";
if (!this._originalTextBoxWidth) {
this._originalTextBoxWidth = f[a].split(":")[1].trim();
}
}
}
}
this._originalTextBoxCssText = c;
}
if (g != "") {
this._textBoxElement.value = g;
}
}
}, _initializeButtons: function () {
this._onButtonClickDelegate = Function.createDelegate(this, this._onButtonClickHandler);
this.Button = null;
var b = $get(this._wrapperElementID);
var a = b.getElementsByTagName("a");
for (i = 0;
i < a.length;
i++) {
if (a[i].className.indexOf("riButton") != (-1)) {
this.Button = a[i];
$addHandler(this.Button, "click", this._onButtonClickDelegate);
}
}
}, _initializeAriaSupport: function () {
var a = this.get_wrapperElement();
a.setAttribute("role", "textbox");
a.setAttribute("aria-atomic", "true");
a.setAttribute("aria-disabled", (!this.get_enabled()) + "");
if (this.isMultiLine()) {
a.setAttribute("aria-multiline", "true");
}
if (this.isReadOnly()) {
a.setAttribute("aria-readonly", "true");
}
if (this.Button) {
this.Button.setAttribute("role", "button");
this.Button.setAttribute("aria-label", "Go");
}
}, _applyAriaStateChange: function (a, b) {
var c = $get(this.get_id() + "_wrapper");
if (c) {
c.setAttribute("aria-" + a, b + "");
}
}, _attachEventHandlers: function () {
this._onTextBoxKeyUpDelegate = Function.createDelegate(this, this._onTextBoxKeyUpHandler);
this._onTextBoxKeyPressDelegate = Function.createDelegate(this, this._onTextBoxKeyPressHandler);
this._onTextBoxBlurDelegate = Function.createDelegate(this, this._onTextBoxBlurHandler);
this._onTextBoxFocusDelegate = Function.createDelegate(this, this._onTextBoxFocusHandler);
this._onTextBoxKeyDownDelegate = Function.createDelegate(this, this._onTextBoxKeyDownHandler);
$addHandler(this._textBoxElement, "keydown", this._onTextBoxKeyDownDelegate);
$addHandler(this._textBoxElement, "keypress", this._onTextBoxKeyPressDelegate);
$addHandler(this._textBoxElement, "keyup", this._onTextBoxKeyUpDelegate);
$addHandler(this._textBoxElement, "blur", this._onTextBoxBlurDelegate);
$addHandler(this._textBoxElement, "focus", this._onTextBoxFocusDelegate);
if ($telerik.isIE || $telerik.isSafari) {
this._onTextBoxPasteDelegate = Function.createDelegate(this, this._onTextBoxPasteHandler);
$addHandler(this._textBoxElement, "paste", this._onTextBoxPasteDelegate);
} else {
this._onTextBoxInputDelegate = Function.createDelegate(this, this._onTextBoxInputHandler);
$addHandler(this._textBoxElement, "input", this._onTextBoxInputDelegate);
}
if (this._textBoxElement && this._textBoxElement.form) {
this._onFormResetDelegate = Function.createDelegate(this, this._onFormResetHandler);
$addHandler(this._textBoxElement.form, "reset", this._onFormResetDelegate);
}
this._attachMouseEventHandlers();
}, _onTextBoxPasteHandler: function (c) {
if (this.isMultiLine() && this._maxLength > 0) {
if ($telerik.isSafari) {
var h = this;
window.setTimeout(function () {
h._textBoxElement.value = h._textBoxElement.value.substr(0, h._maxLength);
}, 1);
} else {
if (document.selection) {
if (!c) {
var c = window.event;
}
var a = true;
var b = "";
try {
b = window.clipboardData.getData("Text");
} catch (c) {
a = false;
}
if (a && b != "") {
if (c.preventDefault) {
c.preventDefault();
}
var f = document.selection.createRange();
var d = this._maxLength - this._escapeNewLineChars(this._textBoxElement.value, "\r\n").length + this._escapeNewLineChars(f.text, "\r\n").length;
var g = this._escapeNewLineChars(window.clipboardData.getData("Text"), "\r\n").substr(0, d);
if (g.length > 0 && g.charAt(g.length - 1) == "\r") {
g = g.substr(0, g.length - 1);
}
f.text = g;
} else {
var h = this;
window.setTimeout(function () {
h._textBoxElement.value = h._textBoxElement.value.substr(0, h._maxLength);
}, 1);
}
}
}
}
}, _onTextBoxInputHandler: function (a) {
if (this.isMultiLine() && this._maxLength > 0 && this._textBoxElement.value.length > this._maxLength) {
this._textBoxElement.value = this._textBoxElement.value.substr(0, this._maxLength);
}
}, _attachMouseEventHandlers: function () {
if (!$telerik.isIE) {
this._onTextBoxMouseUpDelegate = Function.createDelegate(this, this._onTextBoxMouseUpHandler);
$addHandler(this._textBoxElement, "mouseup", this._onTextBoxMouseUpDelegate);
}
this._onTextBoxMouseOutDelegate = Function.createDelegate(this, this._onTextBoxMouseOutHandler);
this._onTextBoxMouseOverDelegate = Function.createDelegate(this, this._onTextBoxMouseOverHandler);
this._onTextBoxMouseWheelDelegate = Function.createDelegate(this, this._onTextBoxMouseWheelHandler);
this._onTextBoxDragEnterDelegate = Function.createDelegate(this, this._onTextBoxDragEnterHandler);
this._onTextBoxDragLeaveDelegate = Function.createDelegate(this, this._onTextBoxDragLeaveHandler);
this._onTextBoxDragDropDelegate = Function.createDelegate(this, this._onTextBoxDragDropHandler);
$addHandler(this._textBoxElement, "mouseout", this._onTextBoxMouseOutDelegate);
$addHandler(this._textBoxElement, "mouseover", this._onTextBoxMouseOverDelegate);
$addHandler(this._textBoxElement, "dragenter", this._onTextBoxDragEnterDelegate);
if ($telerik.isFirefox) {
$addHandler(this._textBoxElement, "dragexit", this._onTextBoxDragLeaveDelegate);
} else {
$addHandler(this._textBoxElement, "dragleave", this._onTextBoxDragLeaveDelegate);
}
if ($telerik.isFirefox && Sys.Browser.version < 3.5) {
$addHandler(this._textBoxElement, "dragdrop", this._onTextBoxDragDropDelegate);
} else {
$addHandler(this._textBoxElement, "drop", this._onTextBoxDragDropDelegate);
}
if (!$telerik.isIE) {
if ((!$telerik.isSafari2 && $telerik.isSafari) || $telerik.isOpera) {
$addHandler(this._textBoxElement, "mousewheel", this._onTextBoxMouseWheelDelegate);
} else {
$addHandler(this._textBoxElement, "DOMMouseScroll", this._onTextBoxMouseWheelDelegate);
}
} else {
$addHandler(this._textBoxElement, "mousewheel", this._onTextBoxMouseWheelDelegate);
}
}, _onTextBoxMouseUpHandler: function (a) {
if (($telerik.isSafari || $telerik.isFirefox)) {
if (this._allowApplySelection) {
this._allowApplySelection = false;
this._updateSelectionOnFocus();
if (this.get_inputType && this.get_inputType() != Telerik.Web.UI.InputType.Text) {
return;
}
a.preventDefault();
a.stopPropagation();
return;
}
}
}, _cancelKeyPressEventIfMaxLengthReached: function (b) {
var f = this._escapeNewLineChars(this._textBoxElement.value, "\r\n");
var d = this._maxLength;
if (d > 0 && f.length + (b.charCode == 13) >= d && ((b.charCode == 13) || this._isNormalChar(b))) {
var c = false;
if (document.selection) {
if (document.selection.createRange().text) {
c = true;
}
} else {
var a = this.get_caretPosition();
if (a[0] || a[1]) {
c = true;
}
}
if (!c) {
b.stopPropagation();
b.preventDefault();
return false;
}
}
}, _onTextBoxKeyPressHandler: function (a) {
this._isEnterPressed = false;
var b = new Telerik.Web.UI.InputKeyPressEventArgs(a, a.charCode, String.fromCharCode(a.charCode));
this.raise_keyPress(b);
if (b.get_cancel()) {
a.stopPropagation();
a.preventDefault();
return false;
}
if ((a.charCode == 13) && !this.isMultiLine()) {
var c = this._textBoxElement.value;
this._isEnterPressed = true;
this.set_value(c);
this._isEnterPressed = false;
if (this.get_autoPostBack()) {
a.stopPropagation();
a.preventDefault();
return false;
}
return true;
}
if (this.isMultiLine()) {
return (this._cancelKeyPressEventIfMaxLengthReached(a));
}
}, _onTextBoxKeyUpHandler: function (a) {
}, _onTextBoxBlurHandler: function (a) {
this._focused = false;
if (this.isReadOnly()) {
return;
}
var b = this._textBoxElement.value;
if (this._initialValueAsText + "" !== b) {
this.set_value(b);
} else {
this.updateDisplayValue();
this.updateClientState();
this.updateCssClass();
}
this.raise_blur(Sys.EventArgs.Empty);
}, _onTextBoxFocusHandler: function (a) {
if (!this.isReadOnly()) {
this._allowApplySelection = true;
this._updateStateOnFocus();
}
if (($telerik.isSafari || $telerik.isFirefox) && this.get_selectionOnFocus() != Telerik.Web.UI.SelectionOnFocus.None && this.get_selectionOnFocus() != Telerik.Web.UI.SelectionOnFocus.SelectAll) {
var b = this;
window.setTimeout(function () {
b._triggerDomEvent("mouseup", b._textBoxElement);
}, 1);
}
}, _onTextBoxDragEnterHandler: function (a) {
if (this.isEmpty() && this.get_emptyMessage() != "") {
this.set_textBoxValue("");
}
}, _onTextBoxDragLeaveHandler: function (a) {
if (this.isEmpty() && this.get_emptyMessage() != "" && !$telerik.isMouseOverElement(this._textBoxElement, a)) {
this.set_textBoxValue(this.get_emptyMessage());
}
}, _updateStateOnFocus: function () {
if (this._isDropped || this._lastSetTextBoxValue !== this._textBoxElement.value) {
this._updateHiddenValue();
this._isDropped = false;
}
this._focused = true;
this.updateDisplayValue();
this.updateCssClass();
this._updateSelectionOnFocus();
this.raise_focus(Sys.EventArgs.Empty);
}, _onTextBoxMouseOutHandler: function (a) {
this._hovered = false;
this.updateCssClass();
this.raise_mouseOut(Sys.EventArgs.Empty);
}, _onTextBoxMouseOverHandler: function (a) {
this._hovered = true;
this.updateCssClass();
this.raise_mouseOver(Sys.EventArgs.Empty);
}, _onTextBoxKeyDownHandler: function (a) {
if (a.keyCode == 27 && !$telerik.isIE) {
var b = this;
window.setTimeout(function () {
b.set_textBoxValue(b.get_editValue());
}, 0);
}
}, _onTextBoxMouseWheelHandler: function (b) {
var a;
if (this._focused) {
if (b.rawEvent.wheelDelta) {
a = b.rawEvent.wheelDelta / 120;
if (window.opera) {
a = -a;
}
} else {
if (b.detail) {
a = -b.rawEvent.detail / 3;
} else {
if (b.rawEvent && b.rawEvent.detail) {
a = -b.rawEvent.detail / 3;
}
}
}
if (a > 0) {
this._handleWheel(false);
} else {
this._handleWheel(true);
}
b.stopPropagation();
b.preventDefault();
}
}, _onButtonClickHandler: function (a) {
var b = new Telerik.Web.UI.InputButtonClickEventArgs(Telerik.Web.UI.InputButtonType.Button);
this.raise_buttonClick(b);
}, _onTextBoxDragDropHandler: function (a) {
this._isDropped = true;
if ($telerik.isFirefox) {
var b = this;
window.setTimeout(function () {
b._textBoxElement.focus();
}, 1);
}
}, _onFormResetHandler: function (a) {
var b = this._constructValueFromInitialText(this._originalInitialValueAsText);
this._setHiddenValue(b);
this._initialValueAsText = this._text;
this.set_displayValue(this._constructDisplayText(this._value));
this.updateClientState();
this.updateCssClass();
}, _calculateSelection: function () {
if ((Sys.Browser.agent == Sys.Browser.Opera) || !document.selection) {
var c = this._supportSelection();
if (c) {
this._selectionEnd = this._textBoxElement.selectionEnd;
this._selectionStart = this._textBoxElement.selectionStart;
}
return;
}
var b = end = 0;
try {
b = Math.abs(document.selection.createRange().moveStart("character", -10000000));
if (b > 0) {
b = this._calculateSelectionInternal(b);
}
end = Math.abs(document.selection.createRange().moveEnd("character", -10000000));
if (end > 0) {
end = this._calculateSelectionInternal(end);
}
} catch (a) {
}
this._selectionEnd = end;
this._selectionStart = b;
}, _calculateSelectionInternal: function (e) {
if (!this.isMultiLine()) {
return e;
}
var b = Math.abs(this._textBoxElement.createTextRange().moveEnd("character", -10000000));
var c = document.body.createTextRange();
c.moveToElementText(this._textBoxElement);
var d = Math.abs(c.moveStart("character", -10000000));
var a = Math.abs(c.moveEnd("character", -10000000));
if (a - b == d) {
e -= d;
}
return e;
}, _SetValue: function (a) {
var b = this._setHiddenValue(a);
if (typeof(b) == "undefined" || b == true) {
this.set_textBoxValue(this.get_editValue());
this.updateClientState();
}
}, _triggerDomEvent: function (b, d) {
if (!b || b == "" || !d) {
return;
}
if (b == "change") {
this._textBoxElement.RadInputChangeFired = true;
}
if (d.fireEvent && document.createEventObject) {
var c = document.createEventObject();
d.fireEvent(String.format("on{0}", b), c);
} else {
if (d.dispatchEvent) {
var a = true;
var c = document.createEvent("HTMLEvents");
c.initEvent(b, a, true);
d.dispatchEvent(c);
}
}
if (b == "change") {
this._textBoxElement.RadInputChangeFired = false;
}
}, _updateSelectionOnFocus: function () {
if (!this._textBoxElement.value) {
this.set_caretPosition(0);
}
switch (this.get_selectionOnFocus()) {
case Telerik.Web.UI.SelectionOnFocus.None:
break;
case Telerik.Web.UI.SelectionOnFocus.CaretToBeginning:
this.set_caretPosition(0);
break;
case Telerik.Web.UI.SelectionOnFocus.CaretToEnd:
if (this._textBoxElement.value.length > 0) {
if ($telerik.isIE) {
var a = this._textBoxElement.value.replace(/\r/g, "").length;
if (a != this.get_caretPosition()) {
this.set_caretPosition(a);
}
} else {
this.set_caretPosition(this._textBoxElement.value.length);
}
}
break;
case Telerik.Web.UI.SelectionOnFocus.SelectAll:
this.selectAllText();
break;
default:
this.set_caretPosition(0);
break;
}
}, _isInVisibleContainer: function (b) {
var a = b;
while ((typeof(a) != "undefined") && (a != null)) {
if ((a.disabled == true) || (typeof(a.style) != "undefined" && ((typeof(a.style.display) != "undefined" && a.style.display == "none") || (typeof(a.style.visibility) != "undefined" && a.style.visibility == "hidden")))) {
return false;
}
if (typeof(a.parentNode) != "undefined" && a.parentNode != null && a.parentNode != a && a.parentNode.tagName.toLowerCase() != "body") {
a = a.parentNode;
} else {
return true;
}
}
return true;
}, _supportSelection: function () {
if (!!this.get_inputType) {
var a = this.get_inputType();
if (a == Telerik.Web.UI.InputType.Date || a == Telerik.Web.UI.InputType.DateTime || a == Telerik.Web.UI.InputType.DateTimeLocal || a == Telerik.Web.UI.InputType.Month || a == Telerik.Web.UI.InputType.Week || a == Telerik.Web.UI.InputType.Time) {
return false;
}
}
return true;
}, _applySelection: function () {
if (!this._isInVisibleContainer(this._textBoxElement)) {
return;
}
var b = this;
if ((Sys.Browser.agent == Sys.Browser.Opera) || !document.selection) {
var d = this._supportSelection();
if (d) {
this._textBoxElement.selectionStart = b._selectionStart;
this._textBoxElement.selectionEnd = b._selectionEnd;
}
return;
}
try {
this._textBoxElement.select();
sel = document.selection.createRange();
sel.collapse();
sel.moveStart("character", this._selectionStart);
sel.collapse();
sel.moveEnd("character", this._selectionEnd - this._selectionStart);
sel.select();
} catch (c) {
var a = this;
window.setTimeout(function () {
document.body.focus();
a._textBoxElement.select();
sel = document.selection.createRange();
sel.collapse();
sel.moveStart("character", a._selectionStart);
sel.collapse();
sel.moveEnd("character", a._selectionEnd - a._selectionStart);
sel.select();
}, 1);
}
}, set_invalid: function (a) {
if (this._holdsValidValue == a) {
this._holdsValidValue = !a;
this.updateCssClass();
}
}, get_invalid: function () {
return !this._holdsValidValue;
}, _invalidate: function () {
if (this._holdsValidValue) {
this._holdsValidValue = false;
this._initialValueAsText = "";
this._displayText = "";
this._clearHiddenValue();
return false;
}
}, _clearHiddenValue: function () {
var a = this._errorHandlingCanceled;
this._errorHandlingCanceled = true;
this._setHiddenValue("");
this.updateClientState();
this._errorHandlingCanceled = a;
}, _handleWheel: function (a) {
}, _setHiddenValue: function (a) {
if (a) {
a = a.toString();
} else {
a = "";
}
if (a == this._value) {
return false;
} else {
this._value = a;
this._text = this._constructEditText(a);
this.set_validationText(this._constructValidationText(a));
return true;
}
}, get_validationText: function (a) {
return this._validationText;
}, set_validationText: function (a) {
this._validationText = a;
this._textBoxElement.RadInputValidationValue = a;
}, _updateHiddenValue: function () {
if (!this._textBoxElement.readOnly) {
if (this._setHiddenValue(this._textBoxElement.value)) {
this.updateClientState();
return true;
} else {
return false;
}
} else {
return false;
}
}, _escapeNewLineChars: function (b, a) {
return b.replace(/\r\n/g, "\n").replace(/\n/g, a);
}, _isNormalChar: function (a) {
if (($telerik.isFirefox && (a.rawEvent.keyCode != 0 && a.rawEvent.keyCode != 13) || a.ctrlKey) || ($telerik.isOpera && a.rawEvent.which == 0) || ($telerik.isSafari && (a.charCode < Sys.UI.Key.space || a.charCode > 60000))) {
return false;
}
return true;
}, _constructEditText: function (a) {
return a;
}, _constructDisplayText: function (a) {
return a;
}, _constructValidationText: function (a) {
return a;
}, _constructValueFromInitialText: function (a) {
return a;
}, _canAutoPostBackAfterValidation: function () {
if (!this.get_causesValidation() || !Page_ValidationActive) {
return true;
}
return Page_ClientValidate(this.get_validationGroup());
}, add_blur: function (a) {
this.get_events().addHandler("blur", a);
}, remove_blur: function (a) {
this.get_events().removeHandler("blur", a);
}, raise_blur: function (a) {
this.raiseEvent("blur", a);
}, add_mouseOut: function (a) {
this.get_events().addHandler("mouseOut", a);
}, remove_mouseOut: function (a) {
this.get_events().removeHandler("mouseOut", a);
}, raise_mouseOut: function (a) {
this.raiseEvent("mouseOut", a);
}, add_valueChanged: function (a) {
this.get_events().addHandler("valueChanged", a);
}, remove_valueChanged: function (a) {
this.get_events().removeHandler("valueChanged", a);
}, raise_valueChanged: function (b, c) {
if (typeof(b) != "undefined" && b != null && typeof(c) != "undefined" && c != null && b.toString() == c.toString()) {
if (!this._isEnterPressed) {
return false;
}
}
var d = false;
if (typeof(b) != "undefined" && b != null && typeof(c) != "undefined" && c != null) {
if (b.toString() != c.toString()) {
var a = new Telerik.Web.UI.InputValueChangedEventArgs(b, c);
this.raiseEvent("valueChanged", a);
d = !a.get_cancel();
} else {
d = this._isEnterPressed;
}
}
if (this.get_autoPostBack() && d && this._canAutoPostBackAfterValidation()) {
this.raisePostBackEvent();
}
}, add_error: function (a) {
this.get_events().addHandler("error", a);
}, remove_error: function (a) {
this.get_events().removeHandler("error", a);
}, raise_error: function (a) {
if (this.InEventRaise) {
return;
}
this.InEventRaise = true;
this.raiseEvent("error", a);
if (!a.get_cancel()) {
this._invalid = true;
this._errorHandlingCanceled = false;
this.updateCssClass();
if (this.get_enableAriaSupport()) {
this._applyAriaStateChange("invalid", true);
}
var c = this._isIncrementing ? true : false;
var b = this;
var d = function () {
b._invalid = false;
b.updateCssClass(c);
if (b.get_enableAriaSupport()) {
b._applyAriaStateChange("invalid", false);
}
};
setTimeout(function () {
d();
}, this.get_invalidStyleDuration());
} else {
this._errorHandlingCanceled = true;
this._invalid = false;
this.updateCssClass();
}
this.InEventRaise = false;
}, add_load: function (a) {
this.get_events().addHandler("load", a);
}, remove_load: function (a) {
this.get_events().removeHandler("load", a);
}, raise_load: function (a) {
this.raiseEvent("load", a);
}, add_mouseOver: function (a) {
this.get_events().addHandler("mouseOver", a);
}, remove_mouseOver: function (a) {
this.get_events().removeHandler("mouseOver", a);
}, raise_mouseOver: function (a) {
this.raiseEvent("mouseOver", a);
}, add_focus: function (a) {
this.get_events().addHandler("focus", a);
}, remove_focus: function (a) {
this.get_events().removeHandler("focus", a);
}, raise_focus: function (a) {
this.raiseEvent("focus", a);
}, add_disable: function (a) {
this.get_events().addHandler("disable", a);
}, remove_disable: function (a) {
this.get_events().removeHandler("disable", a);
}, raise_disable: function (a) {
this.raiseEvent("disable", a);
}, add_enable: function (a) {
this.get_events().addHandler("enable", a);
}, remove_enable: function (a) {
this.get_events().removeHandler("enable", a);
}, raise_enable: function (a) {
this.raiseEvent("enable", a);
}, add_keyPress: function (a) {
this.get_events().addHandler("keyPress", a);
}, remove_keyPress: function (a) {
this.get_events().removeHandler("keyPress", a);
}, raise_keyPress: function (a) {
this.raiseEvent("keyPress", a);
}, add_enumerationChanged: function (a) {
this.get_events().addHandler("enumerationChanged", a);
}, remove_enumerationChanged: function (a) {
this.get_events().removeHandler("enumerationChanged", a);
}, raise_enumerationChanged: function (a) {
this.raiseEvent("enumerationChanged", a);
}, add_moveUp: function (a) {
this.get_events().addHandler("moveUp", a);
}, remove_moveUp: function (a) {
this.get_events().removeHandler("moveUp", a);
}, raise_moveUp: function (a) {
this.raiseEvent("moveUp", a);
}, add_moveDown: function (a) {
this.get_events().addHandler("moveDown", a);
}, remove_moveDown: function (a) {
this.get_events().removeHandler("moveDown", a);
}, raise_moveDown: function (a) {
this.raiseEvent("moveDown", a);
}, add_buttonClick: function (a) {
this.get_events().addHandler("buttonClick", a);
}, remove_buttonClick: function (a) {
this.get_events().removeHandler("buttonClick", a);
}, raise_buttonClick: function (a) {
this.raiseEvent("buttonClick", a);
}, add_valueChanging: function (a) {
this.get_events().addHandler("valueChanging", a);
}, remove_valueChanging: function (a) {
this.get_events().removeHandler("valueChanging", a);
}, raise_valueChanging: function (a) {
this.raiseEvent("valueChanging", a);
}
};
Telerik.Web.UI.RadInputControl.OverrideValidatorFunctions = function () {
if (typeof(ValidatorGetValue) == "function" && typeof(ValidatorGetValue_Original) == "undefined") {
ValidatorGetValue_Original = ValidatorGetValue;
ValidatorGetValue = function (b) {
var a = document.getElementById(b);
if (typeof(a.RadInputValidationValue) == "string") {
if (a.RadInputLastSetTextBoxValue == a.value) {
return a.RadInputValidationValue;
} else {
return a.value;
}
} else {
return ValidatorGetValue_Original(b);
}
};
}
if (typeof(ValidatorOnChange) == "function" && typeof(ValidatorOnChange_Original) == "undefined") {
ValidatorOnChange_Original = ValidatorOnChange;
ValidatorOnChange = function (b) {
b = b || window.event;
var a;
if ((typeof(b.srcElement) != "undefined") && (b.srcElement != null)) {
a = b.srcElement;
} else {
a = b.target;
}
if (typeof(a.RadInputValidationValue) != "string" || (typeof(a.RadInputChangeFired) == "boolean" && a.RadInputChangeFired)) {
return ValidatorOnChange_Original(b);
}
};
}
if (typeof(ValidatedTextBoxOnKeyPress) == "function" && typeof(ValidatedTextBoxOnKeyPress_Original) == "undefined") {
ValidatedTextBoxOnKeyPress_Original = ValidatedTextBoxOnKeyPress;
ValidatedTextBoxOnKeyPress = function (b) {
b = b || window.event;
if (b.keyCode == 13) {
ValidatorOnChange(b);
var a;
if ((typeof(b.srcElement) != "undefined") && (b.srcElement != null)) {
a = b.srcElement;
} else {
a = b.target;
}
if (typeof(a.RadInputValidationValue) != "string") {
return AllValidatorsValid(a.Validators);
}
}
return true;
};
}
};
Telerik.Web.UI.RadInputControl.registerClass("Telerik.Web.UI.RadInputControl", Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadInputControl.CancelRawEventOnEnterKey = function (b, a) {
if (a.get_keyCode() == 13) {
return $telerik.cancelRawEvent(a.get_domEvent());
}
};
Telerik.Web.UI.RadInputControl.OverrideValidatorFunctions();
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.InputErrorReason = function () {
};
Telerik.Web.UI.InputErrorReason.prototype = {ParseError: 1, OutOfRange: 2};
Telerik.Web.UI.InputErrorReason.registerEnum("Telerik.Web.UI.InputErrorReason", false);
Telerik.Web.UI.SelectionOnFocus = function () {
};
Telerik.Web.UI.SelectionOnFocus.prototype = {None: 0, CaretToBeginning: 1, CaretToEnd: 2, SelectAll: 3};
Telerik.Web.UI.SelectionOnFocus.registerEnum("Telerik.Web.UI.SelectionOnFocus", false);
Telerik.Web.UI.InputButtonType = function () {
};
Telerik.Web.UI.InputButtonType.prototype = {Button: 1, MoveUpButton: 2, MoveDownButton: 3};
Telerik.Web.UI.InputButtonType.registerEnum("Telerik.Web.UI.InputButtonType", false);
Telerik.Web.UI.DisplayFormatPosition = function () {
};
Telerik.Web.UI.DisplayFormatPosition.prototype = {Left: 1, Right: 2};
Telerik.Web.UI.DisplayFormatPosition.registerEnum("Telerik.Web.UI.DisplayFormatPosition", false);
Telerik.Web.UI.InputSettingValidateOnEvent = function () {
};
Telerik.Web.UI.InputSettingValidateOnEvent.prototype = {Blur: 0, Submit: 1, All: 2};
Telerik.Web.UI.InputSettingValidateOnEvent.registerEnum("Telerik.Web.UI.InputSettingValidateOnEvent", false);
Telerik.Web.UI.InputType = function () {
};
Telerik.Web.UI.InputType.prototype = {
Text: 0,
Date: 1,
DateTime: 2,
Number: 3,
Time: 4,
DateTimeLocal: 5,
Month: 6,
Week: 7,
Range: 8,
Email: 9,
Url: 10,
Search: 11,
Tel: 12,
Color: 13
};
Telerik.Web.UI.InputType.registerEnum("Telerik.Web.UI.InputType", false);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.InputValueChangedEventArgs = function (a, b) {
Telerik.Web.UI.InputValueChangedEventArgs.initializeBase(this);
this._newValue = a;
this._oldValue = b;
};
Telerik.Web.UI.InputValueChangedEventArgs.prototype = {
get_oldValue: function () {
return this._oldValue;
}, get_newValue: function () {
return this._newValue;
}
};
Telerik.Web.UI.InputValueChangedEventArgs.registerClass("Telerik.Web.UI.InputValueChangedEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.InputValueChangingEventArgs = function (a, b) {
Telerik.Web.UI.InputValueChangingEventArgs.initializeBase(this, [a, b]);
};
Telerik.Web.UI.InputValueChangingEventArgs.prototype = {
set_newValue: function (a) {
if (this._newValue !== a) {
this._newValue = a;
}
}
};
Telerik.Web.UI.InputValueChangingEventArgs.registerClass("Telerik.Web.UI.InputValueChangingEventArgs", Telerik.Web.UI.InputValueChangedEventArgs);
Telerik.Web.UI.MaskedTextBoxEventArgs = function (b, c, a) {
Telerik.Web.UI.MaskedTextBoxEventArgs.initializeBase(this);
this._newValue = b;
this._oldValue = c;
this._chunk = a;
};
Telerik.Web.UI.MaskedTextBoxEventArgs.prototype = {
get_oldValue: function () {
return this._oldValue;
}, get_newValue: function () {
return this._newValue;
}, get_currentPart: function () {
return this._chunk;
}
};
Telerik.Web.UI.MaskedTextBoxEventArgs.registerClass("Telerik.Web.UI.MaskedTextBoxEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.InputKeyPressEventArgs = function (a, c, b) {
Telerik.Web.UI.InputKeyPressEventArgs.initializeBase(this);
this._domEvent = a;
this._keyCode = c;
this._keyCharacter = b;
};
Telerik.Web.UI.InputKeyPressEventArgs.prototype = {
get_domEvent: function () {
return this._domEvent;
}, get_keyCode: function () {
return this._keyCode;
}, get_keyCharacter: function () {
return this._keyCharacter;
}
};
Telerik.Web.UI.InputKeyPressEventArgs.registerClass("Telerik.Web.UI.InputKeyPressEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.InputButtonClickEventArgs = function (a) {
Telerik.Web.UI.InputButtonClickEventArgs.initializeBase(this);
this._buttonType = a;
};
Telerik.Web.UI.InputButtonClickEventArgs.prototype = {
get_buttonType: function () {
return this._buttonType;
}
};
Telerik.Web.UI.InputButtonClickEventArgs.registerClass("Telerik.Web.UI.InputButtonClickEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.InputErrorEventArgs = function (b, a) {
Telerik.Web.UI.InputErrorEventArgs.initializeBase(this);
this._reason = b;
this._inputText = a;
};
Telerik.Web.UI.InputErrorEventArgs.prototype = {
get_reason: function () {
return this._reason;
}, get_inputText: function () {
return this._inputText;
}
};
Telerik.Web.UI.InputErrorEventArgs.registerClass("Telerik.Web.UI.InputErrorEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.NumericInputErrorEventArgs = function (d, a, c, b) {
Telerik.Web.UI.NumericInputErrorEventArgs.initializeBase(this, [d, a]);
this._keyCode = c;
this._keyCharacter = b;
};
Telerik.Web.UI.NumericInputErrorEventArgs.prototype = {
get_reason: function () {
return this._reason;
}, get_inputText: function () {
return this._inputText;
}, get_keyCode: function () {
return this._keyCode;
}, get_keyCharacter: function () {
return this._keyCharacter;
}
};
Telerik.Web.UI.NumericInputErrorEventArgs.registerClass("Telerik.Web.UI.NumericInputErrorEventArgs", Telerik.Web.UI.InputErrorEventArgs);
Telerik.Web.UI.InputManagerKeyPressEventArgs = function (a, c, b, d) {
Telerik.Web.UI.InputManagerKeyPressEventArgs.initializeBase(this, [a, c, b]);
this._targetInput = d;
};
Telerik.Web.UI.InputManagerKeyPressEventArgs.prototype = {
get_targetInput: function () {
return this._targetInput;
}
};
Telerik.Web.UI.InputManagerKeyPressEventArgs.registerClass("Telerik.Web.UI.InputManagerKeyPressEventArgs", Telerik.Web.UI.InputKeyPressEventArgs);
Telerik.Web.UI.InputManagerEventArgs = function (b, a) {
Telerik.Web.UI.InputManagerEventArgs.initializeBase(this);
this._targetInput = b;
this._domEvent = a;
};
Telerik.Web.UI.InputManagerEventArgs.prototype = {
get_targetInput: function () {
return this._targetInput;
}, get_domEvent: function () {
return this._domEvent;
}
};
Telerik.Web.UI.InputManagerEventArgs.registerClass("Telerik.Web.UI.InputManagerEventArgs", Sys.EventArgs);
Telerik.Web.UI.InputManagerErrorEventArgs = function (b, a, c) {
Telerik.Web.UI.InputManagerErrorEventArgs.initializeBase(this, [b, a]);
this._targetInput = c;
};
Telerik.Web.UI.InputManagerErrorEventArgs.prototype = {
get_targetInput: function () {
return this._targetInput;
}, set_inputText: function (a) {
this._inputText = a;
}
};
Telerik.Web.UI.InputManagerErrorEventArgs.registerClass("Telerik.Web.UI.InputManagerErrorEventArgs", Telerik.Web.UI.InputErrorEventArgs);
Telerik.Web.UI.NumericInputManagerErrorEventArgs = function (d, a, c, b, e) {
Telerik.Web.UI.NumericInputManagerErrorEventArgs.initializeBase(this, [d, a, c, b]);
this._targetInput = e;
};
Telerik.Web.UI.NumericInputManagerErrorEventArgs.prototype = {
get_targetInput: function () {
return this._targetInput;
}
};
Telerik.Web.UI.NumericInputManagerErrorEventArgs.registerClass("Telerik.Web.UI.NumericInputManagerErrorEventArgs", Telerik.Web.UI.NumericInputErrorEventArgs);
Telerik.Web.UI.InputManagerValidatingEventArgs = function (a) {
Telerik.Web.UI.InputManagerValidatingEventArgs.initializeBase(this);
this._input = a;
this._isValid = true;
this._context = null;
};
Telerik.Web.UI.InputManagerValidatingEventArgs.prototype = {
get_input: function () {
return this._input;
}, get_isValid: function () {
return this._isValid;
}, set_isValid: function (a) {
this._isValid = a;
}, get_context: function () {
return this._context;
}, set_context: function (a) {
this._context = a;
}
};
Telerik.Web.UI.InputManagerValidatingEventArgs.registerClass("Telerik.Web.UI.InputManagerValidatingEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.PasswordStrengthCalculatingEventArgs = function (b, c, a) {
Telerik.Web.UI.PasswordStrengthCalculatingEventArgs.initializeBase(this);
this._passwordText = b;
this._strengthScore = c;
this._indicatorText = a;
};
Telerik.Web.UI.PasswordStrengthCalculatingEventArgs.prototype = {
get_passwordText: function () {
return this._passwordText;
}, get_strengthScore: function () {
return this._strengthScore;
}, set_strengthScore: function (a) {
if (typeof a == "number") {
a = Math.ceil(a);
if (a > 100) {
a = 100;
}
if (a < 0) {
a = 0;
}
this._strengthScore = a;
}
}, set_indicatorText: function (a) {
this._indicatorText = a;
}
};
Telerik.Web.UI.PasswordStrengthCalculatingEventArgs.registerClass("Telerik.Web.UI.PasswordStrengthCalculatingEventArgs", Sys.EventArgs);
Telerik.Web.UI.InputManagerValueChangedEventArgs = function (b, a, d, c) {
this._domEvent = a;
this._oldValue = d;
this._newValue = c;
this._inputExtender = b;
};
Telerik.Web.UI.InputManagerValueChangedEventArgs.prototype = {
get_domEvent: function () {
return this._domEvent;
}, get_oldValue: function () {
return this._oldValue;
}, get_newValue: function () {
return this._newValue;
}, get_inputExtender: function () {
return this._inputExtender;
}
};
Telerik.Web.UI.InputManagerValueChangedEventArgs.registerClass("Telerik.Web.UI.InputManagerValueChangedEventArgs", Sys.EventArgs);
$telerik.findTextBox = $find;
$telerik.toTextBox = function (a) {
return a;
};
Telerik.Web.UI.RadTextBox = function (a) {
Telerik.Web.UI.RadTextBox.initializeBase(this, [a]);
this._maxLength = 0;
this._inputType = Telerik.Web.UI.InputType.Text;
this._passwordSettings = null;
this._resizeMode = "none";
this._resizeVertical = false;
this._resizeHorizontal = false;
this._onTextBoxMouseMoveDelegate = null;
this._onResizeIconMouseDownDelegate = null;
this._resizeIconSpan = null;
this._onMouseMoveDelegate = null;
this._onMouseUpDelegate = null;
this._wrapperElementExtraWidth = 0;
this._parentElementExtraWidth = 0;
this._wrapperElementExtraHeight = 0;
this._parentElementExtraHeight = 0;
this._minWidth = 75;
this._minHeight = 35;
};
Telerik.Web.UI.RadTextBox.prototype = {
initialize: function () {
Telerik.Web.UI.RadTextBox.callBaseMethod(this, "initialize");
if (this._passwordSettings != null) {
if (this._passwordSettings.ShowIndicator) {
Telerik.Web.UI.PasswordStrengthChecker.prototype.showStrength(this, this._textBoxElement, this._passwordSettings);
}
}
if (this._resizeMode != "none") {
if (this._resizeMode == "vertical") {
this._resizeVertical = true;
} else {
if (this._resizeMode == "horizontal") {
this._resizeHorizontal = true;
} else {
if (this._resizeMode == "both") {
this._resizeVertical = true;
this._resizeHorizontal = true;
}
}
}
this._wrapperElementExtraWidth = this._textBoxElement.parentNode.offsetWidth - this._textBoxElement.offsetWidth;
this._parentElementExtraWidth = this.get_wrapperElement().offsetWidth - this._textBoxElement.offsetWidth;
this._wrapperElementExtraHeight = this._textBoxElement.parentNode.offsetHeight - this._textBoxElement.offsetHeight;
this._parentElementExtraHeight = this.get_wrapperElement().offsetHeight - this._textBoxElement.offsetHeight;
this._onTextBoxMouseMoveDelegate = Function.createDelegate(this, this._onTextBoxMouseMoveHandler);
$addHandler(this._textBoxElement, "mousemove", this._onTextBoxMouseMoveDelegate);
if ($telerik.isIE) {
var a = document.createElement("span");
a.className = "riResizeIcon";
this._textBoxElement.parentNode.appendChild(a);
this._onResizeIconMouseDownDelegate = Function.createDelegate(this, this._onResizeIconMouseDownHandler);
this._resizeIconSpan = a;
$addHandler(this._resizeIconSpan, "mousedown", this._onResizeIconMouseDownDelegate);
if (this._resizeVertical) {
if (this._resizeHorizontal) {
if (this._isRtl) {
this._resizeIconSpan.style.cursor = "sw-resize";
} else {
this._resizeIconSpan.style.cursor = "se-resize";
}
} else {
this._resizeIconSpan.style.cursor = "s-resize";
}
} else {
this._resizeIconSpan.style.cursor = "w-resize";
}
} else {
this.get_wrapperElement().style.backgroundImage = "none";
}
}
}, dispose: function () {
if (this._onTextBoxMouseMoveDelegate) {
$removeHandler(this._textBoxElement, "mousemove", this._onTextBoxMouseMoveDelegate);
this._onTextBoxMouseMoveDelegate = null;
}
if (this._onResizeIconMouseDownDelegate) {
$removeHandler(this._resizeIconSpan, "mousedown", this._onResizeIconMouseDownDelegate);
this._onResizeIconMouseDownDelegate = null;
}
this._onMouseUpHandler(null);
Telerik.Web.UI.RadTextBox.callBaseMethod(this, "dispose");
}, _onTextBoxMouseWheelHandler: function (a) {
return true;
}, _onTextBoxKeyUpHandler: function (a) {
Telerik.Web.UI.RadTextBox.callBaseMethod(this, "_onTextBoxKeyUpHandler", [a]);
if (this._passwordSettings != null) {
if (this._passwordSettings.ShowIndicator) {
Telerik.Web.UI.PasswordStrengthChecker.prototype.showStrength(this, this._textBoxElement, this._passwordSettings);
}
}
}, _adjustWrappersDimensions: function () {
var a = false;
var c = this._parentElementExtraWidth + this._textBoxElement.offsetWidth;
var b = this._parentElementExtraHeight + this._textBoxElement.offsetHeight;
if (c != this.get_wrapperElement().offsetWidth) {
this.get_wrapperElement().style.width = c + "px";
this._textBoxElement.parentNode.style.width = this._wrapperElementExtraWidth + this._textBoxElement.offsetWidth + "px";
a = true;
}
if (b != this.get_wrapperElement().offsetHeight) {
this.get_wrapperElement().style.height = b + "px";
this._textBoxElement.parentNode.style.height = this._wrapperElementExtraHeight + this._textBoxElement.offsetHeight + "px";
a = true;
}
return a;
}, _onTextBoxMouseMoveHandler: function (b) {
if (!$telerik.isIE) {
var a = this._adjustWrappersDimensions();
if (a && !$telerik.isFirefox && !this._onMouseMoveDelegate) {
this._onMouseMoveDelegate = Function.createDelegate(this, this._onMouseMoveHandler);
$addHandler(document, "mousemove", this._onMouseMoveDelegate);
this._onMouseUpDelegate = Function.createDelegate(this, this._onMouseUpHandler);
$addHandler(document, "mouseup", this._onMouseUpDelegate);
}
}
}, _onResizeIconMouseDownHandler: function (a) {
$telerik.cancelRawEvent(a);
if (!this._onMouseUpDelegate && !this._onMouseMoveDelegate) {
this._onMouseMoveDelegate = Function.createDelegate(this, this._onMouseMoveHandler);
$addHandler(document, "mousemove", this._onMouseMoveDelegate);
this._onMouseUpDelegate = Function.createDelegate(this, this._onMouseUpHandler);
$addHandler(document, "mouseup", this._onMouseUpDelegate);
}
}, _onTextBoxMouseUpHandler: function (a) {
this._onMouseUpHandler(a);
Telerik.Web.UI.RadTextBox.callBaseMethod(this, "_onTextBoxMouseUpHandler", [a]);
}, _onMouseUpHandler: function (a) {
if (this._onMouseMoveDelegate) {
$removeHandler(document, "mousemove", this._onMouseMoveDelegate);
this._onMouseMoveDelegate = null;
}
if (this._onMouseUpDelegate) {
$removeHandler(document, "mouseup", this._onMouseUpDelegate);
this._onMouseUpDelegate = null;
}
}, _onMouseMoveHandler: function (c) {
if ($telerik.isIE) {
var f = $telerik.getLocation(this._textBoxElement);
var g;
var h;
if (c.rawEvent.pageX == null) {
var d = c.target.ownerDocument || document;
var b = d.documentElement;
var a = d.body;
g = c.clientX + (b && b.scrollLeft || a && a.scrollLeft || 0) - (b && b.clientLeft || a && a.clientLeft || 0);
h = c.clientY + (b && b.scrollTop || a && a.scrollTop || 0) - (b && b.clientTop || a && a.clientTop || 0);
} else {
g = c.rawEvent.pageX;
h = c.rawEvent.pageY;
}
if (this._resizeHorizontal) {
var j;
if (this._isRtl) {
j = (f.x - g) + this._textBoxElement.clientWidth + 5;
} else {
j = g - f.x + 5;
}
if (j >= this._minWidth) {
this._textBoxElement.style.width = j + "px";
}
}
if (this._resizeVertical) {
var i = 5 + h - f.y;
if (i >= this._minHeight) {
this._textBoxElement.style.height = i + "px";
}
}
}
this._adjustWrappersDimensions();
}, updateCssClass: function (a) {
if (this._resizeMode != "none") {
this._originalTextBoxCssText = "height: " + this._textBoxElement.style.height + "; width: " + this._textBoxElement.style.width + ";";
}
Telerik.Web.UI.RadTextBox.callBaseMethod(this, "updateCssClass", [a]);
}, get_inputType: function () {
return this._inputType;
}, set_inputType: function (a) {
if (this._inputType !== a) {
this._inputType = a;
this.raisePropertyChanged("inputType");
}
}, get_maxLength: function () {
return this._maxLength;
}, set_maxLength: function (a) {
if (this._maxLength !== a) {
this._maxLength = a;
this.get_element().maxLength = a;
this.raisePropertyChanged("maxLength");
}
}, get_passwordSettings: function () {
return this._passwordSettings;
}, set_passwordSettings: function (a) {
if (this._passwordSettings !== a) {
this._passwordSettings = a;
}
}, raise_passwordStrengthCalculating: function (a) {
this.raiseEvent("passwordStrengthCalculating", a);
}, add_passwordStrengthCalculating: function (a) {
this.get_events().addHandler("passwordStrengthCalculating", a);
}, remove_passwordStrengthCalculating: function (a) {
this.get_events().removeHandler("passwordStrengthCalculating", a);
}
};
Telerik.Web.UI.RadTextBox.registerClass("Telerik.Web.UI.RadTextBox", Telerik.Web.UI.RadInputControl);
/* END Telerik.Web.UI.Input.TextBox.RadInputScript.js */
/* START Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js */
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.NumberFormat");
NumberFormat = Telerik.Web.UI.NumberFormat = function () {
};
NumberFormat = Telerik.Web.UI.NumberFormat.Round = function (g, a) {
if (!a.get_numberFormat().AllowRounding) {
return parseFloat(Telerik.Web.UI.NumberFormat.ToFixed(g, 0, a.get_numberFormat().DecimalDigits));
}
if (g.toString().indexOf("e") > -1) {
var j = Math.pow(10, a.get_numberFormat().DecimalDigits);
return Math.round(g * j) / j;
} else {
if (g.toString().indexOf(".") > -1) {
var h = g.toString().split(".");
var f = Math.abs(parseInt(h[0]));
var b = parseFloat("0." + h[1]);
var c = Math.min(h[1].length, 16);
var l = h[0].charAt(0) == "-" ? -1 : 1;
if (h[1].length <= a.get_numberFormat().DecimalDigits) {
return g;
}
var n = b * Math.pow(10, c);
if (n.toString().indexOf(".") > -1) {
n = +n.toString().split(".")[0];
}
if (n.toString().length > a.get_numberFormat().DecimalDigits + 1) {
var o = 0;
var m = h[1];
while (m.indexOf("0") == 0) {
o++;
m = m.substr(1);
}
n = parseInt(n.toString().substr(0, a.get_numberFormat().DecimalDigits + 1));
c = n.toString().length + o;
}
for (var e = 1;
e <= c;
e++) {
if (e <= c - a.get_numberFormat().DecimalDigits) {
n = Math.round(n / 10);
} else {
n /= 10;
}
}
if (n.toString().indexOf(".") > -1) {
var d = n.toString().split(".")[1].length;
if (d > a.get_numberFormat().DecimalDigits) {
var j = Math.pow(10, a.get_numberFormat().DecimalDigits);
n = Math.round(n * j) / j;
}
}
var k = l * (f + n);
if (a.get_numberFormat().DecimalDigits > 0 && k.toString().indexOf(".") != -1 && k.toString().split(".")[1].length > a.get_numberFormat().DecimalDigits) {
return l * (parseFloat(f + "." + n.toString().substr(2)));
} else {
return k;
}
} else {
return g;
}
}
};
NumberFormat = Telerik.Web.UI.NumberFormat.SplitGroups = function (e, b, a) {
var d = e.toString().split("");
if (b > 0) {
for (var c = d.length - b;
c > 0;
c -= b) {
d.splice(c, 0, a);
}
}
return d.join("");
};
NumberFormat = Telerik.Web.UI.NumberFormat.Parse = function (d, c, a, b) {
return parseFloat(d.toString().replace(c, "").replace(a, ".").replace(b, "-"));
};
NumberFormat = Telerik.Web.UI.NumberFormat.ParseExact = function (p, a, g, n, o, b, j, h) {
if (!p) {
return "";
}
var d = null;
var k = null;
var f = Telerik.Web.UI.NumberFormat.ReplaceN(g, "", j, h).replace(a, "");
var m = Telerik.Web.UI.NumberFormat.ReplaceN(n, "", j, h).replace(a, "");
k = p.toString().replace(a, "");
if (k == f) {
d = true;
} else {
if (k == m) {
d = false;
} else {
return "";
}
}
var e = Telerik.Web.UI.NumberFormat.ReplaceN(g, "1", j, h).split("1");
var l = Telerik.Web.UI.NumberFormat.ReplaceN(n, "1", j, h).split("1");
var c;
for (c in e) {
p = p.toString().replace(e[c], "");
}
for (c in l) {
p = p.toString().replace(l[c], "");
}
var q = Telerik.Web.UI.NumberFormat.Parse(p, o, b, j);
if (d && !isNaN(q)) {
q = q * (-1);
}
return q;
};
NumberFormat = Telerik.Web.UI.NumberFormat.Pad = function (c, a, b) {
while (c.toString().length < a) {
c = c.toString() + b.toString();
}
return c;
};
NumberFormat = Telerik.Web.UI.NumberFormat.Format = function (f, a) {
var b = parseFloat(f.toString().replace(a.get_numberFormat().DecimalSeparator, "."));
if (isNaN(b)) {
return "";
}
var e = "";
b = this.Round(b, a);
var c = Telerik.Web.UI.NumberFormat.ToFixed(Math.abs(b)).split(".");
e += this.SplitGroups(c[0], a.get_numberFormat().GroupSizes, a.get_numberFormat().GroupSeparator);
if ((!a.get_numberFormat().AllowRounding) && (c[1])) {
e += a.get_numberFormat().DecimalSeparator + c[1];
} else {
if (!a.get_numberFormat().AllowRounding) {
e = e;
} else {
if (c[1]) {
e += a.get_numberFormat().DecimalSeparator + this.Pad(c[1], a.get_numberFormat().DecimalDigits, "0");
} else {
if (a.get_numberFormat().DecimalDigits > 0) {
e += a.get_numberFormat().DecimalSeparator + this.Pad("", a.get_numberFormat().DecimalDigits, "0");
}
}
}
}
var d = b < 0 ? a.get_numberFormat().NegativePattern : b == 0 && a.get_numberFormat().ZeroPattern ? a.get_numberFormat().ZeroPattern : a.get_numberFormat().PositivePattern;
return Telerik.Web.UI.NumberFormat.ReplaceN(d, e.toString(), a.get_numberFormat().NegativeSign, a.get_numberFormat().NumericPlaceHolder);
};
NumberFormat = Telerik.Web.UI.NumberFormat.ReplaceN = function (g, h, c, f) {
var d = c + f;
var e = f + c;
var a = 0;
var b = (-1);
if (g.indexOf(d) != (-1)) {
b = g.indexOf(d);
a = 1;
} else {
if (g.indexOf(e) != (-1)) {
b = g.indexOf(e);
a = 0;
} else {
b = g.indexOf(f + " ");
a = 0;
if ((b == (-1)) || ((b > 0) && g[b - 1] != (c))) {
b = g.indexOf(" " + f);
a = 1;
if ((b == (-1)) || (b != (g.Length - 2))) {
b = g.indexOf(" " + f + " ");
a = 1;
}
}
if ((b == (-1))) {
b = g.indexOf(f);
a = 0;
}
}
}
g = g.substring(0, b + a) + h + g.substring(b + a + 1, g.length);
return g;
};
NumberFormat = Telerik.Web.UI.NumberFormat.ToFixed = function (b, f, e) {
if (typeof b === "number" && !(isNaN(b))) {
var j = b.toString();
if (j.indexOf("e") != -1) {
var h = j.split("e");
var a = +h[1];
var k = [];
if (a < -1) {
a = Math.abs(a) - 1;
for (var c = 0;
c < a;
c++) {
k[c] = "0";
}
j = "0." + k.join("") + h[0].replace(".", "");
}
}
var d = j.indexOf(".");
if (typeof(f) == "number" && f > 0) {
if (d == -1) {
j = j + ".";
d = j.length - 1;
}
var g = f - (j.length - d - 1);
var k = [];
for (var c = 0;
c < g;
c++) {
k[c] = "0";
}
j = j + k.join("");
}
if (typeof(e) == "number" && d >= 0) {
if (e == 0) {
j = j.substr(0, d);
} else {
if (e > 0) {
j = j.substr(0, d + e + 1);
}
}
}
return j;
} else {
return "";
}
};
NumberFormat = Telerik.Web.UI.NumberFormat.ReturnZeroIfEmpty = function (a) {
if ((a == null) || (a == "") || isNaN(a)) {
return 0;
}
return a;
};
Type.registerNamespace("Telerik.Web.UI");
$telerik.findNumericTextBox = $find;
$telerik.toNumericTextBox = function (a) {
return a;
};
Telerik.Web.UI.RadNumericTextBox = function (a) {
Telerik.Web.UI.RadNumericTextBox.initializeBase(this, [a]);
this._showSpinButtons = false;
this._maxValue = 70368744177664;
this._minValue = -70368744177664;
this._numberFormat = null;
this._incrementSettings = null;
this._allowOutOfRangeAutoCorrect = true;
this._isIncrementing = false;
this._hold = false;
this._selectionOnFocus = Telerik.Web.UI.SelectionOnFocus.SelectAll;
this._onButtonUpMouseDownDelegate = null;
this._onButtonDownMouseDownDelegate = null;
this._onButtonUpMouseUpDelegate = null;
this._onButtonDownMouseUpDelegate = null;
this._onSpinMouseOutDelegate = null;
this._onSpinMouseClickDelegate = null;
};
Telerik.Web.UI.RadNumericTextBox.prototype = {
initialize: function () {
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "initialize");
this._compileRegEx();
}, dispose: function () {
if (this.SpinUpButton) {
if (this._onButtonUpMouseDownDelegate) {
$removeHandler(this.SpinUpButton, "mousedown", this._onButtonUpMouseDownDelegate);
this._onButtonUpMouseDownDelegate = null;
}
if (this._onButtonUpMouseUpDelegate) {
$removeHandler(this.SpinUpButton, "mouseup", this._onButtonUpMouseUpDelegate);
this._onButtonUpMouseUpDelegate = null;
}
if (this._onSpinMouseOutDelegate) {
$removeHandler(this.SpinUpButton, "mouseout", this._onSpinMouseOutDelegate);
}
if (this._onSpinMouseClickDelegate) {
$removeHandler(this.SpinUpButton, "click", this._onSpinMouseClickDelegate);
}
}
if (this.SpinDownButton) {
if (this._onButtonDownMouseDownDelegate) {
$removeHandler(this.SpinDownButton, "mousedown", this._onButtonDownMouseDownDelegate);
this._onButtonDownMouseDownDelegate = null;
}
if (this._onButtonDownMouseUpDelegate) {
$removeHandler(this.SpinDownButton, "mouseup", this._onButtonDownMouseUpDelegate);
this._onButtonDownMouseUpDelegate = null;
}
if (this._onSpinMouseOutDelegate) {
$removeHandler(this.SpinDownButton, "mouseout", this._onSpinMouseOutDelegate);
}
if (this._onSpinMouseClickDelegate) {
$removeHandler(this.SpinDownButton, "click", this._onSpinMouseClickDelegate);
}
}
this._onSpinMouseOutDelegate = null;
this._onSpinMouseClickDelegate = null;
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "dispose");
}, isNegative: function () {
return this.get_value() < 0;
}, get_value: function () {
return isNaN(this._value) ? "" : this._value;
}, set_value: function (b) {
this._holdsValidValue = true;
var c = Telerik.Web.UI.NumberFormat.Parse(this._initialValueAsText, this._rejectRegExp, this.get_numberFormat().DecimalSeparator, this.get_numberFormat().NegativeSign);
if (typeof(b) == "string" && b != "") {
b = Telerik.Web.UI.NumberFormat.Parse(b, this._rejectRegExp, this.get_numberFormat().DecimalSeparator, this.get_numberFormat().NegativeSign);
}
if (c === b && !this._isEnterPressed) {
this.updateDisplayValue();
this.updateCssClass();
return;
}
if (typeof(b) == "number" && (b < this.get_minValue() || b > this.get_maxValue())) {
var a = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.OutOfRange, b, null, null);
this.raise_error(a);
}
if (!this.get_allowOutOfRangeAutoCorrect() && !this._isIncrementing) {
this.set_textBoxValue(b.toString().replace((0.5).toString().charAt(1), this.get_numberFormat().DecimalSeparator));
}
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "set_value", [b]);
}, _constructEditText: function (a) {
if (typeof(a) == "number") {
if (!a && a !== 0) {
return "";
}
if (this.get_numberFormat().KeepTrailingZerosOnFocus) {
a = Telerik.Web.UI.NumberFormat.ToFixed(a, this.get_numberFormat().DecimalDigits);
} else {
if (this.get_numberFormat().KeepNotRoundedValue) {
a = Telerik.Web.UI.NumberFormat.ToFixed(a);
} else {
a = Telerik.Web.UI.NumberFormat.Round(a, this);
}
}
}
var b = a.toString().replace(".", this.get_numberFormat().DecimalSeparator);
return b.replace("-", this.get_numberFormat().NegativeSign);
}, _constructValueFromInitialText: function (b) {
var a = parseFloat(b);
if (isNaN(a)) {
return "";
}
if (this.get_numberFormat().KeepNotRoundedValue) {
return a;
} else {
return parseFloat(Telerik.Web.UI.NumberFormat.Round(a, this));
}
}, get_valueAsString: function () {
if (typeof this._value != "undefined" && this._value != null) {
return this._value.toString();
} else {
return "";
}
}, get_showSpinButtons: function () {
return this._showSpinButtons;
}, set_showSpinButtons: function (a) {
if (this._showSpinButtons !== a) {
this._showSpinButtons = a;
this.raisePropertyChanged("ShowSpinButtons");
}
}, get_maxValue: function () {
return this._maxValue;
}, set_maxValue: function (a) {
if (this._maxValue !== a) {
this._maxValue = a;
if (!this._clientID) {
return;
}
this.updateClientState();
this.raisePropertyChanged("maxValue");
}
}, get_minValue: function () {
return this._minValue;
}, set_minValue: function (a) {
if (this._minValue !== a) {
this._minValue = a;
if (!this._clientID) {
return;
}
this.updateClientState();
this.raisePropertyChanged("minValue");
}
}, get_numberFormat: function () {
return this._numberFormat;
}, set_numberFormat: function (a) {
this._numberFormat = a;
}, get_incrementSettings: function () {
return this._incrementSettings;
}, set_incrementSettings: function (a) {
if (this._incrementSettings !== a) {
this._incrementSettings = a;
this.raisePropertyChanged("IncrementSettings");
}
}, get_allowOutOfRangeAutoCorrect: function () {
return this._allowOutOfRangeAutoCorrect;
}, set_allowOutOfRangeAutoCorrect: function (a) {
this._allowOutOfRangeAutoCorrect = a;
}, saveClientState: function () {
var a = ["minValue", "maxValue"];
return Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "saveClientState", [a]);
}, _getParsedTextBoxValue: function () {
var a = Telerik.Web.UI.NumberFormat.Parse(this._textBoxElement.value, this._rejectRegExp, this.get_numberFormat().DecimalSeparator, this.get_numberFormat().NegativeSign);
a = Math.max(this.get_minValue(), a);
a = Math.min(this.get_maxValue(), a);
return a;
}, _compileRegEx: function () {
var a = this.get_numberFormat().DecimalSeparator == "." ? "\\." : this.get_numberFormat().DecimalSeparator;
this._acceptRegExp = new RegExp("[0-9" + a + this.get_numberFormat().NegativeSign + "]{1}");
this._rejectRegExp = new RegExp("[^0-9" + a + this.get_numberFormat().NegativeSign + "]{1}", "g");
this._decimalReplaceRegExp = new RegExp(a, "g");
}, _onTextBoxKeyDownHandler: function (a) {
this._numPadDecimalSeparatorPressed = false;
if (!this.get_incrementSettings().InterceptArrowKeys) {
return;
}
var b = (a.rawEvent && a.rawEvent.metaKey);
if (a.altKey || a.ctrlKey || b) {
return true;
}
if (a.keyCode == 38) {
this._move(this.get_incrementSettings().Step, false);
} else {
if (a.keyCode == 40) {
this._move(-this.get_incrementSettings().Step, false);
} else {
if (a.keyCode == 110) {
this._numPadDecimalSeparatorPressed = true;
}
}
}
}, _handleWheel: function (a) {
if (!this.get_incrementSettings().InterceptMouseWheel) {
return;
}
this._calculateSelection();
if (a) {
this._move(-this.get_incrementSettings().Step, false);
} else {
this._move(this.get_incrementSettings().Step, false);
}
this._applySelection();
}, _onTextBoxKeyPressHandler: function (d) {
var k = String.fromCharCode(d.charCode);
if (this._numPadDecimalSeparatorPressed) {
k = this.get_numberFormat().DecimalSeparator;
}
var l = (d.rawEvent && d.rawEvent.metaKey);
if (d.altKey || d.ctrlKey || l) {
return true;
}
var f = new Telerik.Web.UI.InputKeyPressEventArgs(d, d.charCode, String.fromCharCode(d.charCode));
this.raise_keyPress(f);
var i = d.charCode || d.keyCode;
var m = this._textBoxElement && (this._textBoxElement.className.indexOf("rgPagerTextBox") > -1) && i == 9 && $telerik.isFirefox;
if (f.get_cancel()) {
if (!m) {
d.stopPropagation();
d.preventDefault();
return false;
}
}
if (d.charCode == 13) {
this._isEnterPressed = true;
this.set_value(this._textBoxElement.value);
if (this.get_autoPostBack()) {
d.stopPropagation();
d.preventDefault();
return false;
}
return true;
}
if (!d.charCode || d.charCode == 8 || d.charCode == 9 || d.charCode == 27) {
return true;
}
var c = this._textBoxElement.value;
if (!this._isNormalChar(d)) {
return true;
}
if (!k.match(this._acceptRegExp)) {
var g = $telerik.isOpera && (d.charCode == 35 || d.charCode == 36) && !d.shiftKey;
if (!g) {
var f = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.ParseError, c, d.charCode, k);
this.raise_error(f);
d.stopPropagation();
d.preventDefault();
return false;
}
}
var h = false;
if (k == this.get_numberFormat().NegativeSign) {
this._calculateSelection();
var h = (this._selectionStart != 0);
h = h || (c.indexOf(this.get_numberFormat().NegativeSign) == 0 && (this._selectionStart == 0 && this._selectionEnd == 0));
} else {
if (!isNaN(parseInt(k, 10)) && c.indexOf(this.get_numberFormat().NegativeSign) != -1 && this.get_caretPosition() == 0) {
h = true;
}
}
if (h) {
var f = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.ParseError, c, d.charCode, k);
this.raise_error(f);
d.stopPropagation();
d.preventDefault();
return false;
}
if (k == this.get_numberFormat().DecimalSeparator && !this.isReadOnly()) {
this._calculateSelection();
var b = c.substr(0, this._selectionStart);
var j = c.substr(this._selectionStart, this._selectionEnd - this._selectionStart);
var a = c.substr(this._selectionEnd, c.length);
if (b.match(this._decimalReplaceRegExp)) {
this._selectionStart--;
this._selectionEnd--;
} else {
if (j.match(this._decimalReplaceRegExp)) {
this._selectionEnd--;
}
}
c = c.replace(this._decimalReplaceRegExp, "");
if (j.length == c.length) {
if (this._numPadDecimalSeparatorPressed) {
this.set_textBoxValue(this.get_numberFormat().DecimalSeparator);
this.set_caretPosition(b.length + 1);
d.preventDefault();
} else {
this.set_textBoxValue("");
}
} else {
if (b.indexOf(this.get_numberFormat().DecimalSeparator) != -1 || a.indexOf(this.get_numberFormat().DecimalSeparator) != -1) {
this.set_textBoxValue(b.replace(this._decimalReplaceRegExp, "") + this.get_numberFormat().DecimalSeparator + a.replace(this._decimalReplaceRegExp, ""));
d.preventDefault();
this.set_caretPosition(b.length + 1);
} else {
if (this._numPadDecimalSeparatorPressed) {
this.set_textBoxValue(b + this.get_numberFormat().DecimalSeparator + a);
this.set_caretPosition(b.length + 1);
d.preventDefault();
}
}
}
}
}, _moveUp: function () {
return this._move(this.get_incrementSettings().Step, true);
}, _moveDown: function () {
return this._move(-this.get_incrementSettings().Step, true);
}, _move: function (b, a) {
if (this.isReadOnly()) {
return false;
}
var c = this.get_value();
if (!c) {
c = 0;
}
c = c + b;
if (this._originalMaxLength > 0 && c.toString().length > this._originalMaxLength) {
return false;
}
this._isIncrementing = true;
if (!a) {
this._SetValue(c);
} else {
this.set_value(c);
}
this._isIncrementing = false;
return true;
}, _initializeAriaSupport: function () {
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "_initializeAriaSupport");
if (this.SpinUpButton) {
this.SpinUpButton.setAttribute("role", "spinbutton");
this.SpinUpButton.setAttribute("aria-label", "Spin up");
}
if (this.SpinDownButton) {
this.SpinDownButton.setAttribute("role", "spinbutton");
this.SpinDownButton.setAttribute("aria-label", "Spin down");
}
var a = this.get_wrapperElement();
if (this.get_maxValue()) {
a.setAttribute("aria-valuemax", this.get_maxValue());
}
if (this.get_minValue()) {
a.setAttribute("aria-valuemin", this.get_minValue());
}
}, _initializeButtons: function () {
this.SpinUpButton = null;
this.SpinDownButton = null;
this.Button = null;
var b = $get(this._wrapperElementID);
var a = b.getElementsByTagName("a");
var c;
for (c = 0;
c < a.length;
c++) {
if (a[c].className.indexOf("riDown") != (-1)) {
this.SpinDownButton = a[c];
} else {
if (a[c].className.indexOf("riUp") != (-1)) {
this.SpinUpButton = a[c];
}
}
}
if (this.get_showSpinButtons()) {
this._onButtonUpMouseDownDelegate = Function.createDelegate(this, this._onButtonUpMouseDownHandler);
this._onButtonDownMouseDownDelegate = Function.createDelegate(this, this._onButtonDownMouseDownHandler);
this._onButtonUpMouseUpDelegate = Function.createDelegate(this, this._onButtonUpMouseUpHandler);
this._onButtonDownMouseUpDelegate = Function.createDelegate(this, this._onButtonDownMouseUpHandler);
this._onSpinMouseOutDelegate = Function.createDelegate(this, this._onSpinMouseOutHandler);
this._onSpinMouseClickDelegate = Function.createDelegate(this, this._onSpinMouseClickHandler);
$addHandler(this.SpinUpButton, "mousedown", this._onButtonUpMouseDownDelegate);
$addHandler(this.SpinDownButton, "mousedown", this._onButtonDownMouseDownDelegate);
$addHandler(this.SpinUpButton, "mouseup", this._onButtonUpMouseUpDelegate);
$addHandler(this.SpinDownButton, "mouseup", this._onButtonDownMouseUpDelegate);
$addHandler(this.SpinUpButton, "mouseout", this._onSpinMouseOutDelegate);
$addHandler(this.SpinDownButton, "mouseout", this._onSpinMouseOutDelegate);
$addHandler(this.SpinUpButton, "click", this._onSpinMouseClickDelegate);
$addHandler(this.SpinDownButton, "click", this._onSpinMouseClickDelegate);
}
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "_initializeButtons");
}, _onSpinMouseOutHandler: function (a) {
this._hold = false;
}, _onSpinMouseClickHandler: function (a) {
if ($telerik.isIE) {
$telerik.cancelRawEvent(a);
}
}, _onButtonUpMouseDownHandler: function (a) {
if (this._lastSetTextBoxValue !== this._textBoxElement.value) {
this._setHiddenValue(this._textBoxElement.value);
}
var b = new Telerik.Web.UI.InputButtonClickEventArgs(Telerik.Web.UI.InputButtonType.MoveUpButton);
this.raise_buttonClick(b);
if (b.get_cancel()) {
return false;
}
this._hold = true;
this._repeatedMoveUp(300);
}, _onButtonDownMouseDownHandler: function (a) {
if (this._lastSetTextBoxValue !== this._textBoxElement.value) {
this._setHiddenValue(this._textBoxElement.value);
}
var b = new Telerik.Web.UI.InputButtonClickEventArgs(Telerik.Web.UI.InputButtonType.MoveDownButton);
this.raise_buttonClick(b);
if (b.get_cancel()) {
return false;
}
this._hold = true;
this._repeatedMoveDown(300);
}, _repeatedMoveUp: function (d) {
if (this._hold == false) {
return;
}
var a = this;
var c = d;
if (c > 50) {
c -= 40;
}
var b = function () {
a._repeatedMoveUp(c);
};
a._moveUp();
if (!this.get_autoPostBack()) {
window.setTimeout(b, d);
}
}, _repeatedMoveDown: function (d) {
if (this._hold == false) {
return;
}
var a = this;
var c = d;
if (c > 50) {
c -= 40;
}
var b = function () {
a._repeatedMoveDown(c);
};
a._moveDown();
if (!this.get_autoPostBack()) {
window.setTimeout(b, d);
}
}, _onButtonUpMouseUpHandler: function (a) {
this._hold = false;
this.SpinUpButton.blur();
}, _onButtonDownMouseUpHandler: function (a) {
this._hold = false;
this.SpinDownButton.blur();
}, _SetValue: function (b) {
if (b < this.get_minValue() || b > this.get_maxValue()) {
var a = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.OutOfRange, b, null, null);
this.raise_error(a);
}
Telerik.Web.UI.RadNumericTextBox.callBaseMethod(this, "_SetValue", [b]);
}, _setHiddenValue: function (a) {
if (a == null) {
a = "";
}
if (typeof(a) != "number") {
a = Telerik.Web.UI.NumberFormat.Parse(a, this._rejectRegExp, this.get_numberFormat().DecimalSeparator, this.get_numberFormat().NegativeSign);
}
if (!this.get_allowOutOfRangeAutoCorrect() && (a < this.get_minValue() || a > this.get_maxValue())) {
if (!this._isIncrementing) {
return this._invalidate();
} else {
return false;
}
}
a = Math.max(this.get_minValue(), a);
a = Math.min(this.get_maxValue(), a);
if (!this.get_numberFormat().KeepNotRoundedValue) {
a = Telerik.Web.UI.NumberFormat.Round(a, this);
}
if (isNaN(a) || a == null) {
a = "";
}
this._value = a;
this._text = this._constructEditText(a);
this.set_validationText(this._constructValidationText(a));
return true;
}, _constructValidationText: function (a) {
return a.toString().replace(".", this.get_numberFormat().DecimalSeparator);
}, _constructDisplayText: function (a) {
return Telerik.Web.UI.NumberFormat.Format(a, this);
}
};
Telerik.Web.UI.RadNumericTextBox.registerClass("Telerik.Web.UI.RadNumericTextBox", Telerik.Web.UI.RadInputControl);
/* END Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js */
/* START Telerik.Web.UI.Common.jQuery.js */
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function (a, b) {
"object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) {
if (!a.document)throw new Error("jQuery requires a window with a document");
return b(a)
} : b(a)
}("undefined" != typeof window ? window : this, function (a, b) {
var c = [], d = c.slice, e = c.concat, f = c.push, g = c.indexOf, h = {}, i = h.toString, j = h.hasOwnProperty, k = {}, l = "1.11.1", m = function (a, b) {
return new m.fn.init(a, b)
}, n = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, o = /^-ms-/, p = /-([\da-z])/gi, q = function (a, b) {
return b.toUpperCase()
};
m.fn = m.prototype = {
jquery: l, constructor: m, selector: "", length: 0, toArray: function () {
return d.call(this)
}, get: function (a) {
return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this)
}, pushStack: function (a) {
var b = m.merge(this.constructor(), a);
return b.prevObject = this, b.context = this.context, b
}, each: function (a, b) {
return m.each(this, a, b)
}, map: function (a) {
return this.pushStack(m.map(this, function (b, c) {
return a.call(b, c, b)
}))
}, slice: function () {
return this.pushStack(d.apply(this, arguments))
}, first: function () {
return this.eq(0)
}, last: function () {
return this.eq(-1)
}, eq: function (a) {
var b = this.length, c = +a + (0 > a ? b : 0);
return this.pushStack(c >= 0 && b > c ? [this[c]] : [])
}, end: function () {
return this.prevObject || this.constructor(null)
}, push: f, sort: c.sort, splice: c.splice
}, m.extend = m.fn.extend = function () {
var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j = !1;
for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || m.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)if (null != (e = arguments[h]))for (d in e)a = g[d], c = e[d], g !== c && (j && c && (m.isPlainObject(c) || (b = m.isArray(c))) ? (b ? (b = !1, f = a && m.isArray(a) ? a : []) : f = a && m.isPlainObject(a) ? a : {}, g[d] = m.extend(j, f, c)) : void 0 !== c && (g[d] = c));
return g
}, m.extend({
expando: "jQuery" + (l + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (a) {
throw new Error(a)
}, noop: function () {
}, isFunction: function (a) {
return "function" === m.type(a)
}, isArray: Array.isArray || function (a) {
return "array" === m.type(a)
}, isWindow: function (a) {
return null != a && a == a.window
}, isNumeric: function (a) {
return !m.isArray(a) && a - parseFloat(a) >= 0
}, isEmptyObject: function (a) {
var b;
for (b in a)return !1;
return !0
}, isPlainObject: function (a) {
var b;
if (!a || "object" !== m.type(a) || a.nodeType || m.isWindow(a))return !1;
try {
if (a.constructor && !j.call(a, "constructor") && !j.call(a.constructor.prototype, "isPrototypeOf"))return !1
} catch (c) {
return !1
}
if (k.ownLast)for (b in a)return j.call(a, b);
for (b in a);
return void 0 === b || j.call(a, b)
}, type: function (a) {
return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? h[i.call(a)] || "object" : typeof a
}, globalEval: function (b) {
b && m.trim(b) && (a.execScript || function (b) {
a.eval.call(a, b)
})(b)
}, camelCase: function (a) {
return a.replace(o, "ms-").replace(p, q)
}, nodeName: function (a, b) {
return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase()
}, each: function (a, b, c) {
var d, e = 0, f = a.length, g = r(a);
if (c) {
if (g) {
for (; f > e; e++)if (d = b.apply(a[e], c), d === !1)break
} else for (e in a)if (d = b.apply(a[e], c), d === !1)break
} else if (g) {
for (; f > e; e++)if (d = b.call(a[e], e, a[e]), d === !1)break
} else for (e in a)if (d = b.call(a[e], e, a[e]), d === !1)break;
return a
}, trim: function (a) {
return null == a ? "" : (a + "").replace(n, "")
}, makeArray: function (a, b) {
var c = b || [];
return null != a && (r(Object(a)) ? m.merge(c, "string" == typeof a ? [a] : a) : f.call(c, a)), c
}, inArray: function (a, b, c) {
var d;
if (b) {
if (g)return g.call(b, a, c);
for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++)if (c in b && b[c] === a)return c
}
return -1
}, merge: function (a, b) {
var c = +b.length, d = 0, e = a.length;
while (c > d)a[e++] = b[d++];
if (c !== c)while (void 0 !== b[d])a[e++] = b[d++];
return a.length = e, a
}, grep: function (a, b, c) {
for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++)d = !b(a[f], f), d !== h && e.push(a[f]);
return e
}, map: function (a, b, c) {
var d, f = 0, g = a.length, h = r(a), i = [];
if (h)for (; g > f; f++)d = b(a[f], f, c), null != d && i.push(d); else for (f in a)d = b(a[f], f, c), null != d && i.push(d);
return e.apply([], i)
}, guid: 1, proxy: function (a, b) {
var c, e, f;
return "string" == typeof b && (f = a[b], b = a, a = f), m.isFunction(a) ? (c = d.call(arguments, 2), e = function () {
return a.apply(b || this, c.concat(d.call(arguments)))
}, e.guid = a.guid = a.guid || m.guid++, e) : void 0
}, now: function () {
return +new Date
}, support: k
}), m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (a, b) {
h["[object " + b + "]"] = b.toLowerCase()
});
function r(a) {
var b = a.length, c = m.type(a);
return "function" === c || m.isWindow(a) ? !1 : 1 === a.nodeType && b ? !0 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a
}
var s = function (a) {
var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + -new Date, v = a.document, w = 0, x = 0, y = gb(), z = gb(), A = gb(), B = function (a, b) {
return a === b && (l = !0), 0
}, C = "undefined", D = 1 << 31, E = {}.hasOwnProperty, F = [], G = F.pop, H = F.push, I = F.push, J = F.slice, K = F.indexOf || function (a) {
for (var b = 0, c = this.length; c > b; b++)if (this[b] === a)return b;
return -1
}, L = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", N = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", O = N.replace("w", "w#"), P = "\\[" + M + "*(" + N + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + O + "))|)" + M + "*\\]", Q = ":(" + N + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + P + ")*)|.*)\\)|)", R = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), S = new RegExp("^" + M + "*," + M + "*"), T = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp("=" + M + "*([^\\]'\"]*?)" + M + "*\\]", "g"), V = new RegExp(Q), W = new RegExp("^" + O + "$"), X = {
ID: new RegExp("^#(" + N + ")"),
CLASS: new RegExp("^\\.(" + N + ")"),
TAG: new RegExp("^(" + N.replace("w", "w*") + ")"),
ATTR: new RegExp("^" + P),
PSEUDO: new RegExp("^" + Q),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"),
bool: new RegExp("^(?:" + L + ")$", "i"),
needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i")
}, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, $ = /^[^{]+\{\s*\[native \w/, _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ab = /[+~]/, bb = /'|\\/g, cb = new RegExp("\\\\([\\da-f]{1,6}" + M + "?|(" + M + ")|.)", "ig"), db = function (a, b, c) {
var d = "0x" + b - 65536;
return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320)
};
try {
I.apply(F = J.call(v.childNodes), v.childNodes), F[v.childNodes.length].nodeType
} catch (eb) {
I = {
apply: F.length ? function (a, b) {
H.apply(a, J.call(b))
} : function (a, b) {
var c = a.length, d = 0;
while (a[c++] = b[d++]);
a.length = c - 1
}
}
}
function fb(a, b, d, e) {
var f, h, j, k, l, o, r, s, w, x;
if ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, d = d || [], !a || "string" != typeof a)return d;
if (1 !== (k = b.nodeType) && 9 !== k)return [];
if (p && !e) {
if (f = _.exec(a))if (j = f[1]) {
if (9 === k) {
if (h = b.getElementById(j), !h || !h.parentNode)return d;
if (h.id === j)return d.push(h), d
} else if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j)return d.push(h), d
} else {
if (f[2])return I.apply(d, b.getElementsByTagName(a)), d;
if ((j = f[3]) && c.getElementsByClassName && b.getElementsByClassName)return I.apply(d, b.getElementsByClassName(j)), d
}
if (c.qsa && (!q || !q.test(a))) {
if (s = r = u, w = b, x = 9 === k && a, 1 === k && "object" !== b.nodeName.toLowerCase()) {
o = g(a), (r = b.getAttribute("id")) ? s = r.replace(bb, "\\$&") : b.setAttribute("id", s), s = "[id='" + s + "'] ", l = o.length;
while (l--)o[l] = s + qb(o[l]);
w = ab.test(a) && ob(b.parentNode) || b, x = o.join(",")
}
if (x)try {
return I.apply(d, w.querySelectorAll(x)), d
} catch (y) {
} finally {
r || b.removeAttribute("id")
}
}
}
return i(a.replace(R, "$1"), b, d, e)
}
function gb() {
var a = [];
function b(c, e) {
return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e
}
return b
}
function hb(a) {
return a[u] = !0, a
}
function ib(a) {
var b = n.createElement("div");
try {
return !!a(b)
} catch (c) {
return !1
} finally {
b.parentNode && b.parentNode.removeChild(b), b = null
}
}
function jb(a, b) {
var c = a.split("|"), e = a.length;
while (e--)d.attrHandle[c[e]] = b
}
function kb(a, b) {
var c = b && a, d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || D) - (~a.sourceIndex || D);
if (d)return d;
if (c)while (c = c.nextSibling)if (c === b)return -1;
return a ? 1 : -1
}
function lb(a) {
return function (b) {
var c = b.nodeName.toLowerCase();
return "input" === c && b.type === a
}
}
function mb(a) {
return function (b) {
var c = b.nodeName.toLowerCase();
return ("input" === c || "button" === c) && b.type === a
}
}
function nb(a) {
return hb(function (b) {
return b = +b, hb(function (c, d) {
var e, f = a([], c.length, b), g = f.length;
while (g--)c[e = f[g]] && (c[e] = !(d[e] = c[e]))
})
})
}
function ob(a) {
return a && typeof a.getElementsByTagName !== C && a
}
c = fb.support = {}, f = fb.isXML = function (a) {
var b = a && (a.ownerDocument || a).documentElement;
return b ? "HTML" !== b.nodeName : !1
}, m = fb.setDocument = function (a) {
var b, e = a ? a.ownerDocument || a : v, g = e.defaultView;
return e !== n && 9 === e.nodeType && e.documentElement ? (n = e, o = e.documentElement, p = !f(e), g && g !== g.top && (g.addEventListener ? g.addEventListener("unload", function () {
m()
}, !1) : g.attachEvent && g.attachEvent("onunload", function () {
m()
})), c.attributes = ib(function (a) {
return a.className = "i", !a.getAttribute("className")
}), c.getElementsByTagName = ib(function (a) {
return a.appendChild(e.createComment("")), !a.getElementsByTagName("*").length
}), c.getElementsByClassName = $.test(e.getElementsByClassName) && ib(function (a) {
return a.innerHTML = "<div class='a'></div><div class='a i'></div>", a.firstChild.className = "i", 2 === a.getElementsByClassName("i").length
}), c.getById = ib(function (a) {
return o.appendChild(a).id = u, !e.getElementsByName || !e.getElementsByName(u).length
}), c.getById ? (d.find.ID = function (a, b) {
if (typeof b.getElementById !== C && p) {
var c = b.getElementById(a);
return c && c.parentNode ? [c] : []
}
}, d.filter.ID = function (a) {
var b = a.replace(cb, db);
return function (a) {
return a.getAttribute("id") === b
}
}) : (delete d.find.ID, d.filter.ID = function (a) {
var b = a.replace(cb, db);
return function (a) {
var c = typeof a.getAttributeNode !== C && a.getAttributeNode("id");
return c && c.value === b
}
}), d.find.TAG = c.getElementsByTagName ? function (a, b) {
return typeof b.getElementsByTagName !== C ? b.getElementsByTagName(a) : void 0
} : function (a, b) {
var c, d = [], e = 0, f = b.getElementsByTagName(a);
if ("*" === a) {
while (c = f[e++])1 === c.nodeType && d.push(c);
return d
}
return f
}, d.find.CLASS = c.getElementsByClassName && function (a, b) {
return typeof b.getElementsByClassName !== C && p ? b.getElementsByClassName(a) : void 0
}, r = [], q = [], (c.qsa = $.test(e.querySelectorAll)) && (ib(function (a) {
a.innerHTML = "<select msallowclip=''><option selected=''></option></select>", a.querySelectorAll("[msallowclip^='']").length && q.push("[*^$]=" + M + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + M + "*(?:value|" + L + ")"), a.querySelectorAll(":checked").length || q.push(":checked")
}), ib(function (a) {
var b = e.createElement("input");
b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + M + "*[*^$|!~]?="), a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:")
})), (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ib(function (a) {
c.disconnectedMatch = s.call(a, "div"), s.call(a, "[s!='']:x"), r.push("!=", Q)
}), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = $.test(o.compareDocumentPosition), t = b || $.test(o.contains) ? function (a, b) {
var c = 9 === a.nodeType ? a.documentElement : a, d = b && b.parentNode;
return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)))
} : function (a, b) {
if (b)while (b = b.parentNode)if (b === a)return !0;
return !1
}, B = b ? function (a, b) {
if (a === b)return l = !0, 0;
var d = !a.compareDocumentPosition - !b.compareDocumentPosition;
return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === e || a.ownerDocument === v && t(v, a) ? -1 : b === e || b.ownerDocument === v && t(v, b) ? 1 : k ? K.call(k, a) - K.call(k, b) : 0 : 4 & d ? -1 : 1)
} : function (a, b) {
if (a === b)return l = !0, 0;
var c, d = 0, f = a.parentNode, g = b.parentNode, h = [a], i = [b];
if (!f || !g)return a === e ? -1 : b === e ? 1 : f ? -1 : g ? 1 : k ? K.call(k, a) - K.call(k, b) : 0;
if (f === g)return kb(a, b);
c = a;
while (c = c.parentNode)h.unshift(c);
c = b;
while (c = c.parentNode)i.unshift(c);
while (h[d] === i[d])d++;
return d ? kb(h[d], i[d]) : h[d] === v ? -1 : i[d] === v ? 1 : 0
}, e) : n
}, fb.matches = function (a, b) {
return fb(a, null, null, b)
}, fb.matchesSelector = function (a, b) {
if ((a.ownerDocument || a) !== n && m(a), b = b.replace(U, "='$1']"), !(!c.matchesSelector || !p || r && r.test(b) || q && q.test(b)))try {
var d = s.call(a, b);
if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType)return d
} catch (e) {
}
return fb(b, n, null, [a]).length > 0
}, fb.contains = function (a, b) {
return (a.ownerDocument || a) !== n && m(a), t(a, b)
}, fb.attr = function (a, b) {
(a.ownerDocument || a) !== n && m(a);
var e = d.attrHandle[b.toLowerCase()], f = e && E.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0;
return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null
}, fb.error = function (a) {
throw new Error("Syntax error, unrecognized expression: " + a)
}, fb.uniqueSort = function (a) {
var b, d = [], e = 0, f = 0;
if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) {
while (b = a[f++])b === a[f] && (e = d.push(f));
while (e--)a.splice(d[e], 1)
}
return k = null, a
}, e = fb.getText = function (a) {
var b, c = "", d = 0, f = a.nodeType;
if (f) {
if (1 === f || 9 === f || 11 === f) {
if ("string" == typeof a.textContent)return a.textContent;
for (a = a.firstChild; a; a = a.nextSibling)c += e(a)
} else if (3 === f || 4 === f)return a.nodeValue
} else while (b = a[d++])c += e(b);
return c
}, d = fb.selectors = {
cacheLength: 50,
createPseudo: hb,
match: X,
attrHandle: {},
find: {},
relative: {
">": {dir: "parentNode", first: !0},
" ": {dir: "parentNode"},
"+": {dir: "previousSibling", first: !0},
"~": {dir: "previousSibling"}
},
preFilter: {
ATTR: function (a) {
return a[1] = a[1].replace(cb, db), a[3] = (a[3] || a[4] || a[5] || "").replace(cb, db), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
}, CHILD: function (a) {
return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || fb.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && fb.error(a[0]), a
}, PSEUDO: function (a) {
var b, c = !a[6] && a[2];
return X.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && V.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3))
}
},
filter: {
TAG: function (a) {
var b = a.replace(cb, db).toLowerCase();
return "*" === a ? function () {
return !0
} : function (a) {
return a.nodeName && a.nodeName.toLowerCase() === b
}
}, CLASS: function (a) {
var b = y[a + " "];
return b || (b = new RegExp("(^|" + M + ")" + a + "(" + M + "|$)")) && y(a, function (a) {
return b.test("string" == typeof a.className && a.className || typeof a.getAttribute !== C && a.getAttribute("class") || "")
})
}, ATTR: function (a, b, c) {
return function (d) {
var e = fb.attr(d, a);
return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0
}
}, CHILD: function (a, b, c, d, e) {
var f = "nth" !== a.slice(0, 3), g = "last" !== a.slice(-4), h = "of-type" === b;
return 1 === d && 0 === e ? function (a) {
return !!a.parentNode
} : function (b, c, i) {
var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", q = b.parentNode, r = h && b.nodeName.toLowerCase(), s = !i && !h;
if (q) {
if (f) {
while (p) {
l = b;
while (l = l[p])if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType)return !1;
o = p = "only" === a && !o && "nextSibling"
}
return !0
}
if (o = [g ? q.firstChild : q.lastChild], g && s) {
k = q[u] || (q[u] = {}), j = k[a] || [], n = j[0] === w && j[1], m = j[0] === w && j[2], l = n && q.childNodes[n];
while (l = ++n && l && l[p] || (m = n = 0) || o.pop())if (1 === l.nodeType && ++m && l === b) {
k[a] = [w, n, m];
break
}
} else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w)m = j[1]; else while (l = ++n && l && l[p] || (m = n = 0) || o.pop())if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) && ++m && (s && ((l[u] || (l[u] = {}))[a] = [w, m]), l === b))break;
return m -= e, m === d || m % d === 0 && m / d >= 0
}
}
}, PSEUDO: function (a, b) {
var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || fb.error("unsupported pseudo: " + a);
return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? hb(function (a, c) {
var d, f = e(a, b), g = f.length;
while (g--)d = K.call(a, f[g]), a[d] = !(c[d] = f[g])
}) : function (a) {
return e(a, 0, c)
}) : e
}
},
pseudos: {
not: hb(function (a) {
var b = [], c = [], d = h(a.replace(R, "$1"));
return d[u] ? hb(function (a, b, c, e) {
var f, g = d(a, null, e, []), h = a.length;
while (h--)(f = g[h]) && (a[h] = !(b[h] = f))
}) : function (a, e, f) {
return b[0] = a, d(b, null, f, c), !c.pop()
}
}), has: hb(function (a) {
return function (b) {
return fb(a, b).length > 0
}
}), contains: hb(function (a) {
return function (b) {
return (b.textContent || b.innerText || e(b)).indexOf(a) > -1
}
}), lang: hb(function (a) {
return W.test(a || "") || fb.error("unsupported lang: " + a), a = a.replace(cb, db).toLowerCase(), function (b) {
var c;
do if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang"))return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) && 1 === b.nodeType);
return !1
}
}), target: function (b) {
var c = a.location && a.location.hash;
return c && c.slice(1) === b.id
}, root: function (a) {
return a === o
}, focus: function (a) {
return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex)
}, enabled: function (a) {
return a.disabled === !1
}, disabled: function (a) {
return a.disabled === !0
}, checked: function (a) {
var b = a.nodeName.toLowerCase();
return "input" === b && !!a.checked || "option" === b && !!a.selected
}, selected: function (a) {
return a.parentNode && a.parentNode.selectedIndex, a.selected === !0
}, empty: function (a) {
for (a = a.firstChild; a; a = a.nextSibling)if (a.nodeType < 6)return !1;
return !0
}, parent: function (a) {
return !d.pseudos.empty(a)
}, header: function (a) {
return Z.test(a.nodeName)
}, input: function (a) {
return Y.test(a.nodeName)
}, button: function (a) {
var b = a.nodeName.toLowerCase();
return "input" === b && "button" === a.type || "button" === b
}, text: function (a) {
var b;
return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase())
}, first: nb(function () {
return [0]
}), last: nb(function (a, b) {
return [b - 1]
}), eq: nb(function (a, b, c) {
return [0 > c ? c + b : c]
}), even: nb(function (a, b) {
for (var c = 0; b > c; c += 2)a.push(c);
return a
}), odd: nb(function (a, b) {
for (var c = 1; b > c; c += 2)a.push(c);
return a
}), lt: nb(function (a, b, c) {
for (var d = 0 > c ? c + b : c; --d >= 0;)a.push(d);
return a
}), gt: nb(function (a, b, c) {
for (var d = 0 > c ? c + b : c; ++d < b;)a.push(d);
return a
})
}
}, d.pseudos.nth = d.pseudos.eq;
for (b in{radio: !0, checkbox: !0, file: !0, password: !0, image: !0})d.pseudos[b] = lb(b);
for (b in{submit: !0, reset: !0})d.pseudos[b] = mb(b);
function pb() {
}
pb.prototype = d.filters = d.pseudos, d.setFilters = new pb, g = fb.tokenize = function (a, b) {
var c, e, f, g, h, i, j, k = z[a + " "];
if (k)return b ? 0 : k.slice(0);
h = a, i = [], j = d.preFilter;
while (h) {
(!c || (e = S.exec(h))) && (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = T.exec(h)) && (c = e.shift(), f.push({
value: c,
type: e[0].replace(R, " ")
}), h = h.slice(c.length));
for (g in d.filter)!(e = X[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({
value: c,
type: g,
matches: e
}), h = h.slice(c.length));
if (!c)break
}
return b ? h.length : h ? fb.error(a) : z(a, i).slice(0)
};
function qb(a) {
for (var b = 0, c = a.length, d = ""; c > b; b++)d += a[b].value;
return d
}
function rb(a, b, c) {
var d = b.dir, e = c && "parentNode" === d, f = x++;
return b.first ? function (b, c, f) {
while (b = b[d])if (1 === b.nodeType || e)return a(b, c, f)
} : function (b, c, g) {
var h, i, j = [w, f];
if (g) {
while (b = b[d])if ((1 === b.nodeType || e) && a(b, c, g))return !0
} else while (b = b[d])if (1 === b.nodeType || e) {
if (i = b[u] || (b[u] = {}), (h = i[d]) && h[0] === w && h[1] === f)return j[2] = h[2];
if (i[d] = j, j[2] = a(b, c, g))return !0
}
}
}
function sb(a) {
return a.length > 1 ? function (b, c, d) {
var e = a.length;
while (e--)if (!a[e](b, c, d))return !1;
return !0
} : a[0]
}
function tb(a, b, c) {
for (var d = 0, e = b.length; e > d; d++)fb(a, b[d], c);
return c
}
function ub(a, b, c, d, e) {
for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)(f = a[h]) && (!c || c(f, d, e)) && (g.push(f), j && b.push(h));
return g
}
function vb(a, b, c, d, e, f) {
return d && !d[u] && (d = vb(d)), e && !e[u] && (e = vb(e, f)), hb(function (f, g, h, i) {
var j, k, l, m = [], n = [], o = g.length, p = f || tb(b || "*", h.nodeType ? [h] : h, []), q = !a || !f && b ? p : ub(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q;
if (c && c(q, r, h, i), d) {
j = ub(r, n), d(j, [], h, i), k = j.length;
while (k--)(l = j[k]) && (r[n[k]] = !(q[n[k]] = l))
}
if (f) {
if (e || a) {
if (e) {
j = [], k = r.length;
while (k--)(l = r[k]) && j.push(q[k] = l);
e(null, r = [], j, i)
}
k = r.length;
while (k--)(l = r[k]) && (j = e ? K.call(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l))
}
} else r = ub(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : I.apply(g, r)
})
}
function wb(a) {
for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = rb(function (a) {
return a === b
}, h, !0), l = rb(function (a) {
return K.call(b, a) > -1
}, h, !0), m = [function (a, c, d) {
return !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d))
}]; f > i; i++)if (c = d.relative[a[i].type])m = [rb(sb(m), c)]; else {
if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) {
for (e = ++i; f > e; e++)if (d.relative[a[e].type])break;
return vb(i > 1 && sb(m), i > 1 && qb(a.slice(0, i - 1).concat({value: " " === a[i - 2].type ? "*" : ""})).replace(R, "$1"), c, e > i && wb(a.slice(i, e)), f > e && wb(a = a.slice(e)), f > e && qb(a))
}
m.push(c)
}
return sb(m)
}
function xb(a, b) {
var c = b.length > 0, e = a.length > 0, f = function (f, g, h, i, k) {
var l, m, o, p = 0, q = "0", r = f && [], s = [], t = j, u = f || e && d.find.TAG("*", k), v = w += null == t ? 1 : Math.random() || .1, x = u.length;
for (k && (j = g !== n && g); q !== x && null != (l = u[q]); q++) {
if (e && l) {
m = 0;
while (o = a[m++])if (o(l, g, h)) {
i.push(l);
break
}
k && (w = v)
}
c && ((l = !o && l) && p--, f && r.push(l))
}
if (p += q, c && q !== p) {
m = 0;
while (o = b[m++])o(r, s, g, h);
if (f) {
if (p > 0)while (q--)r[q] || s[q] || (s[q] = G.call(i));
s = ub(s)
}
I.apply(i, s), k && !f && s.length > 0 && p + b.length > 1 && fb.uniqueSort(i)
}
return k && (w = v, j = t), r
};
return c ? hb(f) : f
}
return h = fb.compile = function (a, b) {
var c, d = [], e = [], f = A[a + " "];
if (!f) {
b || (b = g(a)), c = b.length;
while (c--)f = wb(b[c]), f[u] ? d.push(f) : e.push(f);
f = A(a, xb(e, d)), f.selector = a
}
return f
}, i = fb.select = function (a, b, e, f) {
var i, j, k, l, m, n = "function" == typeof a && a, o = !f && g(a = n.selector || a);
if (e = e || [], 1 === o.length) {
if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) {
if (b = (d.find.ID(k.matches[0].replace(cb, db), b) || [])[0], !b)return e;
n && (b = b.parentNode), a = a.slice(j.shift().value.length)
}
i = X.needsContext.test(a) ? 0 : j.length;
while (i--) {
if (k = j[i], d.relative[l = k.type])break;
if ((m = d.find[l]) && (f = m(k.matches[0].replace(cb, db), ab.test(j[0].type) && ob(b.parentNode) || b))) {
if (j.splice(i, 1), a = f.length && qb(j), !a)return I.apply(e, f), e;
break
}
}
}
return (n || h(a, o))(f, b, !p, e, ab.test(a) && ob(b.parentNode) || b), e
}, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ib(function (a) {
return 1 & a.compareDocumentPosition(n.createElement("div"))
}), ib(function (a) {
return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href")
}) || jb("type|href|height|width", function (a, b, c) {
return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2)
}), c.attributes && ib(function (a) {
return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value")
}) || jb("value", function (a, b, c) {
return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue
}), ib(function (a) {
return null == a.getAttribute("disabled")
}) || jb(L, function (a, b, c) {
var d;
return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null
}), fb
}(a);
m.find = s, m.expr = s.selectors, m.expr[":"] = m.expr.pseudos, m.unique = s.uniqueSort, m.text = s.getText, m.isXMLDoc = s.isXML, m.contains = s.contains;
var t = m.expr.match.needsContext, u = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, v = /^.[^:#\[\.,]*$/;
function w(a, b, c) {
if (m.isFunction(b))return m.grep(a, function (a, d) {
return !!b.call(a, d, a) !== c
});
if (b.nodeType)return m.grep(a, function (a) {
return a === b !== c
});
if ("string" == typeof b) {
if (v.test(b))return m.filter(b, a, c);
b = m.filter(b, a)
}
return m.grep(a, function (a) {
return m.inArray(a, b) >= 0 !== c
})
}
m.filter = function (a, b, c) {
var d = b[0];
return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? m.find.matchesSelector(d, a) ? [d] : [] : m.find.matches(a, m.grep(b, function (a) {
return 1 === a.nodeType
}))
}, m.fn.extend({
find: function (a) {
var b, c = [], d = this, e = d.length;
if ("string" != typeof a)return this.pushStack(m(a).filter(function () {
for (b = 0; e > b; b++)if (m.contains(d[b], this))return !0
}));
for (b = 0; e > b; b++)m.find(a, d[b], c);
return c = this.pushStack(e > 1 ? m.unique(c) : c), c.selector = this.selector ? this.selector + " " + a : a, c
}, filter: function (a) {
return this.pushStack(w(this, a || [], !1))
}, not: function (a) {
return this.pushStack(w(this, a || [], !0))
}, is: function (a) {
return !!w(this, "string" == typeof a && t.test(a) ? m(a) : a || [], !1).length
}
});
var x, y = a.document, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, A = m.fn.init = function (a, b) {
var c, d;
if (!a)return this;
if ("string" == typeof a) {
if (c = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : z.exec(a), !c || !c[1] && b)return !b || b.jquery ? (b || x).find(a) : this.constructor(b).find(a);
if (c[1]) {
if (b = b instanceof m ? b[0] : b, m.merge(this, m.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : y, !0)), u.test(c[1]) && m.isPlainObject(b))for (c in b)m.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]);
return this
}
if (d = y.getElementById(c[2]), d && d.parentNode) {
if (d.id !== c[2])return x.find(a);
this.length = 1, this[0] = d
}
return this.context = y, this.selector = a, this
}
return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : m.isFunction(a) ? "undefined" != typeof x.ready ? x.ready(a) : a(m) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), m.makeArray(a, this))
};
A.prototype = m.fn, x = m(y);
var B = /^(?:parents|prev(?:Until|All))/, C = {children: !0, contents: !0, next: !0, prev: !0};
m.extend({
dir: function (a, b, c) {
var d = [], e = a[b];
while (e && 9 !== e.nodeType && (void 0 === c || 1 !== e.nodeType || !m(e).is(c)))1 === e.nodeType && d.push(e), e = e[b];
return d
}, sibling: function (a, b) {
for (var c = []; a; a = a.nextSibling)1 === a.nodeType && a !== b && c.push(a);
return c
}
}), m.fn.extend({
has: function (a) {
var b, c = m(a, this), d = c.length;
return this.filter(function () {
for (b = 0; d > b; b++)if (m.contains(this, c[b]))return !0
})
}, closest: function (a, b) {
for (var c, d = 0, e = this.length, f = [], g = t.test(a) || "string" != typeof a ? m(a, b || this.context) : 0; e > d; d++)for (c = this[d]; c && c !== b; c = c.parentNode)if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && m.find.matchesSelector(c, a))) {
f.push(c);
break
}
return this.pushStack(f.length > 1 ? m.unique(f) : f)
}, index: function (a) {
return a ? "string" == typeof a ? m.inArray(this[0], m(a)) : m.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
}, add: function (a, b) {
return this.pushStack(m.unique(m.merge(this.get(), m(a, b))))
}, addBack: function (a) {
return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
}
});
function D(a, b) {
do a = a[b]; while (a && 1 !== a.nodeType);
return a
}
m.each({
parent: function (a) {
var b = a.parentNode;
return b && 11 !== b.nodeType ? b : null
}, parents: function (a) {
return m.dir(a, "parentNode")
}, parentsUntil: function (a, b, c) {
return m.dir(a, "parentNode", c)
}, next: function (a) {
return D(a, "nextSibling")
}, prev: function (a) {
return D(a, "previousSibling")
}, nextAll: function (a) {
return m.dir(a, "nextSibling")
}, prevAll: function (a) {
return m.dir(a, "previousSibling")
}, nextUntil: function (a, b, c) {
return m.dir(a, "nextSibling", c)
}, prevUntil: function (a, b, c) {
return m.dir(a, "previousSibling", c)
}, siblings: function (a) {
return m.sibling((a.parentNode || {}).firstChild, a)
}, children: function (a) {
return m.sibling(a.firstChild)
}, contents: function (a) {
return m.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : m.merge([], a.childNodes)
}
}, function (a, b) {
m.fn[a] = function (c, d) {
var e = m.map(this, b, c);
return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = m.filter(d, e)), this.length > 1 && (C[a] || (e = m.unique(e)), B.test(a) && (e = e.reverse())), this.pushStack(e)
}
});
var E = /\S+/g, F = {};
function G(a) {
var b = F[a] = {};
return m.each(a.match(E) || [], function (a, c) {
b[c] = !0
}), b
}
m.Callbacks = function (a) {
a = "string" == typeof a ? F[a] || G(a) : m.extend({}, a);
var b, c, d, e, f, g, h = [], i = !a.once && [], j = function (l) {
for (c = a.memory && l, d = !0, f = g || 0, g = 0, e = h.length, b = !0; h && e > f; f++)if (h[f].apply(l[0], l[1]) === !1 && a.stopOnFalse) {
c = !1;
break
}
b = !1, h && (i ? i.length && j(i.shift()) : c ? h = [] : k.disable())
}, k = {
add: function () {
if (h) {
var d = h.length;
!function f(b) {
m.each(b, function (b, c) {
var d = m.type(c);
"function" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && "string" !== d && f(c)
})
}(arguments), b ? e = h.length : c && (g = d, j(c))
}
return this
}, remove: function () {
return h && m.each(arguments, function (a, c) {
var d;
while ((d = m.inArray(c, h, d)) > -1)h.splice(d, 1), b && (e >= d && e--, f >= d && f--)
}), this
}, has: function (a) {
return a ? m.inArray(a, h) > -1 : !(!h || !h.length)
}, empty: function () {
return h = [], e = 0, this
}, disable: function () {
return h = i = c = void 0, this
}, disabled: function () {
return !h
}, lock: function () {
return i = void 0, c || k.disable(), this
}, locked: function () {
return !i
}, fireWith: function (a, c) {
return !h || d && !i || (c = c || [], c = [a, c.slice ? c.slice() : c], b ? i.push(c) : j(c)), this
}, fire: function () {
return k.fireWith(this, arguments), this
}, fired: function () {
return !!d
}
};
return k
}, m.extend({
Deferred: function (a) {
var b = [["resolve", "done", m.Callbacks("once memory"), "resolved"], ["reject", "fail", m.Callbacks("once memory"), "rejected"], ["notify", "progress", m.Callbacks("memory")]], c = "pending", d = {
state: function () {
return c
}, always: function () {
return e.done(arguments).fail(arguments), this
}, then: function () {
var a = arguments;
return m.Deferred(function (c) {
m.each(b, function (b, f) {
var g = m.isFunction(a[b]) && a[b];
e[f[1]](function () {
var a = g && g.apply(this, arguments);
a && m.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments)
})
}), a = null
}).promise()
}, promise: function (a) {
return null != a ? m.extend(a, d) : d
}
}, e = {};
return d.pipe = d.then, m.each(b, function (a, f) {
var g = f[2], h = f[3];
d[f[1]] = g.add, h && g.add(function () {
c = h
}, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = function () {
return e[f[0] + "With"](this === e ? d : this, arguments), this
}, e[f[0] + "With"] = g.fireWith
}), d.promise(e), a && a.call(e, e), e
}, when: function (a) {
var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && m.isFunction(a.promise) ? e : 0, g = 1 === f ? a : m.Deferred(), h = function (a, b, c) {
return function (e) {
b[a] = this, c[a] = arguments.length > 1 ? d.call(arguments) : e, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c)
}
}, i, j, k;
if (e > 1)for (i = new Array(e), j = new Array(e), k = new Array(e); e > b; b++)c[b] && m.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f;
return f || g.resolveWith(k, c), g.promise()
}
});
var H;
m.fn.ready = function (a) {
return m.ready.promise().done(a), this
}, m.extend({
isReady: !1, readyWait: 1, holdReady: function (a) {
a ? m.readyWait++ : m.ready(!0)
}, ready: function (a) {
if (a === !0 ? !--m.readyWait : !m.isReady) {
if (!y.body)return setTimeout(m.ready);
m.isReady = !0, a !== !0 && --m.readyWait > 0 || (H.resolveWith(y, [m]), m.fn.triggerHandler && (m(y).triggerHandler("ready"), m(y).off("ready")))
}
}
});
function I() {
y.addEventListener ? (y.removeEventListener("DOMContentLoaded", J, !1), a.removeEventListener("load", J, !1)) : (y.detachEvent("onreadystatechange", J), a.detachEvent("onload", J))
}
function J() {
(y.addEventListener || "load" === event.type || "complete" === y.readyState) && (I(), m.ready())
}
m.ready.promise = function (b) {
if (!H)if (H = m.Deferred(), "complete" === y.readyState)setTimeout(m.ready); else if (y.addEventListener)y.addEventListener("DOMContentLoaded", J, !1), a.addEventListener("load", J, !1); else {
y.attachEvent("onreadystatechange", J), a.attachEvent("onload", J);
var c = !1;
try {
c = null == a.frameElement && y.documentElement
} catch (d) {
}
c && c.doScroll && !function e() {
if (!m.isReady) {
try {
c.doScroll("left")
} catch (a) {
return setTimeout(e, 50)
}
I(), m.ready()
}
}()
}
return H.promise(b)
};
var K = "undefined", L;
for (L in m(k))break;
k.ownLast = "0" !== L, k.inlineBlockNeedsLayout = !1, m(function () {
var a, b, c, d;
c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", k.inlineBlockNeedsLayout = a = 3 === b.offsetWidth, a && (c.style.zoom = 1)), c.removeChild(d))
}), function () {
var a = y.createElement("div");
if (null == k.deleteExpando) {
k.deleteExpando = !0;
try {
delete a.test
} catch (b) {
k.deleteExpando = !1
}
}
a = null
}(), m.acceptData = function (a) {
var b = m.noData[(a.nodeName + " ").toLowerCase()], c = +a.nodeType || 1;
return 1 !== c && 9 !== c ? !1 : !b || b !== !0 && a.getAttribute("classid") === b
};
var M = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, N = /([A-Z])/g;
function O(a, b, c) {
if (void 0 === c && 1 === a.nodeType) {
var d = "data-" + b.replace(N, "-$1").toLowerCase();
if (c = a.getAttribute(d), "string" == typeof c) {
try {
c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : M.test(c) ? m.parseJSON(c) : c
} catch (e) {
}
m.data(a, b, c)
} else c = void 0
}
return c
}
function P(a) {
var b;
for (b in a)if (("data" !== b || !m.isEmptyObject(a[b])) && "toJSON" !== b)return !1;
return !0
}
function Q(a, b, d, e) {
if (m.acceptData(a)) {
var f, g, h = m.expando, i = a.nodeType, j = i ? m.cache : a, k = i ? a[h] : a[h] && h;
if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b)return k || (k = i ? a[h] = c.pop() || m.guid++ : h), j[k] || (j[k] = i ? {} : {toJSON: m.noop}), ("object" == typeof b || "function" == typeof b) && (e ? j[k] = m.extend(j[k], b) : j[k].data = m.extend(j[k].data, b)), g = j[k], e || (g.data || (g.data = {}), g = g.data), void 0 !== d && (g[m.camelCase(b)] = d), "string" == typeof b ? (f = g[b], null == f && (f = g[m.camelCase(b)])) : f = g, f
}
}
function R(a, b, c) {
if (m.acceptData(a)) {
var d, e, f = a.nodeType, g = f ? m.cache : a, h = f ? a[m.expando] : m.expando;
if (g[h]) {
if (b && (d = c ? g[h] : g[h].data)) {
m.isArray(b) ? b = b.concat(m.map(b, m.camelCase)) : b in d ? b = [b] : (b = m.camelCase(b), b = b in d ? [b] : b.split(" ")), e = b.length;
while (e--)delete d[b[e]];
if (c ? !P(d) : !m.isEmptyObject(d))return
}
(c || (delete g[h].data, P(g[h]))) && (f ? m.cleanData([a], !0) : k.deleteExpando || g != g.window ? delete g[h] : g[h] = null)
}
}
}
m.extend({
cache: {},
noData: {"applet ": !0, "embed ": !0, "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},
hasData: function (a) {
return a = a.nodeType ? m.cache[a[m.expando]] : a[m.expando], !!a && !P(a)
},
data: function (a, b, c) {
return Q(a, b, c)
},
removeData: function (a, b) {
return R(a, b)
},
_data: function (a, b, c) {
return Q(a, b, c, !0)
},
_removeData: function (a, b) {
return R(a, b, !0)
}
}), m.fn.extend({
data: function (a, b) {
var c, d, e, f = this[0], g = f && f.attributes;
if (void 0 === a) {
if (this.length && (e = m.data(f), 1 === f.nodeType && !m._data(f, "parsedAttrs"))) {
c = g.length;
while (c--)g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = m.camelCase(d.slice(5)), O(f, d, e[d])));
m._data(f, "parsedAttrs", !0)
}
return e
}
return "object" == typeof a ? this.each(function () {
m.data(this, a)
}) : arguments.length > 1 ? this.each(function () {
m.data(this, a, b)
}) : f ? O(f, a, m.data(f, a)) : void 0
}, removeData: function (a) {
return this.each(function () {
m.removeData(this, a)
})
}
}), m.extend({
queue: function (a, b, c) {
var d;
return a ? (b = (b || "fx") + "queue", d = m._data(a, b), c && (!d || m.isArray(c) ? d = m._data(a, b, m.makeArray(c)) : d.push(c)), d || []) : void 0
}, dequeue: function (a, b) {
b = b || "fx";
var c = m.queue(a, b), d = c.length, e = c.shift(), f = m._queueHooks(a, b), g = function () {
m.dequeue(a, b)
};
"inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire()
}, _queueHooks: function (a, b) {
var c = b + "queueHooks";
return m._data(a, c) || m._data(a, c, {
empty: m.Callbacks("once memory").add(function () {
m._removeData(a, b + "queue"), m._removeData(a, c)
})
})
}
}), m.fn.extend({
queue: function (a, b) {
var c = 2;
return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? m.queue(this[0], a) : void 0 === b ? this : this.each(function () {
var c = m.queue(this, a, b);
m._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && m.dequeue(this, a)
})
}, dequeue: function (a) {
return this.each(function () {
m.dequeue(this, a)
})
}, clearQueue: function (a) {
return this.queue(a || "fx", [])
}, promise: function (a, b) {
var c, d = 1, e = m.Deferred(), f = this, g = this.length, h = function () {
--d || e.resolveWith(f, [f])
};
"string" != typeof a && (b = a, a = void 0), a = a || "fx";
while (g--)c = m._data(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h));
return h(), e.promise(b)
}
});
var S = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, T = ["Top", "Right", "Bottom", "Left"], U = function (a, b) {
return a = b || a, "none" === m.css(a, "display") || !m.contains(a.ownerDocument, a)
}, V = m.access = function (a, b, c, d, e, f, g) {
var h = 0, i = a.length, j = null == c;
if ("object" === m.type(c)) {
e = !0;
for (h in c)m.access(a, b, h, c[h], !0, f, g)
} else if (void 0 !== d && (e = !0, m.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function (a, b, c) {
return j.call(m(a), c)
})), b))for (; i > h; h++)b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
}, W = /^(?:checkbox|radio)$/i;
!function () {
var a = y.createElement("input"), b = y.createElement("div"), c = y.createDocumentFragment();
if (b.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", k.leadingWhitespace = 3 === b.firstChild.nodeType, k.tbody = !b.getElementsByTagName("tbody").length, k.htmlSerialize = !!b.getElementsByTagName("link").length, k.html5Clone = "<:nav></:nav>" !== y.createElement("nav").cloneNode(!0).outerHTML, a.type = "checkbox", a.checked = !0, c.appendChild(a), k.appendChecked = a.checked, b.innerHTML = "<textarea>x</textarea>", k.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue, c.appendChild(b), b.innerHTML = "<input type='radio' checked='checked' name='t'/>", k.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, k.noCloneEvent = !0, b.attachEvent && (b.attachEvent("onclick", function () {
k.noCloneEvent = !1
}), b.cloneNode(!0).click()), null == k.deleteExpando) {
k.deleteExpando = !0;
try {
delete b.test
} catch (d) {
k.deleteExpando = !1
}
}
}(), function () {
var b, c, d = y.createElement("div");
for (b in{
submit: !0,
change: !0,
focusin: !0
})c = "on" + b, (k[b + "Bubbles"] = c in a) || (d.setAttribute(c, "t"), k[b + "Bubbles"] = d.attributes[c].expando === !1);
d = null
}();
var X = /^(?:input|select|textarea)$/i, Y = /^key/, Z = /^(?:mouse|pointer|contextmenu)|click/, $ = /^(?:focusinfocus|focusoutblur)$/, _ = /^([^.]*)(?:\.(.+)|)$/;
function ab() {
return !0
}
function bb() {
return !1
}
function cb() {
try {
return y.activeElement
} catch (a) {
}
}
m.event = {
global: {},
add: function (a, b, c, d, e) {
var f, g, h, i, j, k, l, n, o, p, q, r = m._data(a);
if (r) {
c.handler && (i = c, c = i.handler, e = i.selector), c.guid || (c.guid = m.guid++), (g = r.events) || (g = r.events = {}), (k = r.handle) || (k = r.handle = function (a) {
return typeof m === K || a && m.event.triggered === a.type ? void 0 : m.event.dispatch.apply(k.elem, arguments)
}, k.elem = a), b = (b || "").match(E) || [""], h = b.length;
while (h--)f = _.exec(b[h]) || [], o = q = f[1], p = (f[2] || "").split(".").sort(), o && (j = m.event.special[o] || {}, o = (e ? j.delegateType : j.bindType) || o, j = m.event.special[o] || {}, l = m.extend({
type: o,
origType: q,
data: d,
handler: c,
guid: c.guid,
selector: e,
needsContext: e && m.expr.match.needsContext.test(e),
namespace: p.join(".")
}, i), (n = g[o]) || (n = g[o] = [], n.delegateCount = 0, j.setup && j.setup.call(a, d, p, k) !== !1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))), j.add && (j.add.call(a, l), l.handler.guid || (l.handler.guid = c.guid)), e ? n.splice(n.delegateCount++, 0, l) : n.push(l), m.event.global[o] = !0);
a = null
}
},
remove: function (a, b, c, d, e) {
var f, g, h, i, j, k, l, n, o, p, q, r = m.hasData(a) && m._data(a);
if (r && (k = r.events)) {
b = (b || "").match(E) || [""], j = b.length;
while (j--)if (h = _.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) {
l = m.event.special[o] || {}, o = (d ? l.delegateType : l.bindType) || o, n = k[o] || [], h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), i = f = n.length;
while (f--)g = n[f], !e && q !== g.origType || c && c.guid !== g.guid || h && !h.test(g.namespace) || d && d !== g.selector && ("**" !== d || !g.selector) || (n.splice(f, 1), g.selector && n.delegateCount--, l.remove && l.remove.call(a, g));
i && !n.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || m.removeEvent(a, o, r.handle), delete k[o])
} else for (o in k)m.event.remove(a, o + b[j], c, d, !0);
m.isEmptyObject(k) && (delete r.handle, m._removeData(a, "events"))
}
},
trigger: function (b, c, d, e) {
var f, g, h, i, k, l, n, o = [d || y], p = j.call(b, "type") ? b.type : b, q = j.call(b, "namespace") ? b.namespace.split(".") : [];
if (h = l = d = d || y, 3 !== d.nodeType && 8 !== d.nodeType && !$.test(p + m.event.triggered) && (p.indexOf(".") >= 0 && (q = p.split("."), p = q.shift(), q.sort()), g = p.indexOf(":") < 0 && "on" + p, b = b[m.expando] ? b : new m.Event(p, "object" == typeof b && b), b.isTrigger = e ? 2 : 3, b.namespace = q.join("."), b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = d), c = null == c ? [b] : m.makeArray(c, [b]), k = m.event.special[p] || {}, e || !k.trigger || k.trigger.apply(d, c) !== !1)) {
if (!e && !k.noBubble && !m.isWindow(d)) {
for (i = k.delegateType || p, $.test(i + p) || (h = h.parentNode); h; h = h.parentNode)o.push(h), l = h;
l === (d.ownerDocument || y) && o.push(l.defaultView || l.parentWindow || a)
}
n = 0;
while ((h = o[n++]) && !b.isPropagationStopped())b.type = n > 1 ? i : k.bindType || p, f = (m._data(h, "events") || {})[b.type] && m._data(h, "handle"), f && f.apply(h, c), f = g && h[g], f && f.apply && m.acceptData(h) && (b.result = f.apply(h, c), b.result === !1 && b.preventDefault());
if (b.type = p, !e && !b.isDefaultPrevented() && (!k._default || k._default.apply(o.pop(), c) === !1) && m.acceptData(d) && g && d[p] && !m.isWindow(d)) {
l = d[g], l && (d[g] = null), m.event.triggered = p;
try {
d[p]()
} catch (r) {
}
m.event.triggered = void 0, l && (d[g] = l)
}
return b.result
}
},
dispatch: function (a) {
a = m.event.fix(a);
var b, c, e, f, g, h = [], i = d.call(arguments), j = (m._data(this, "events") || {})[a.type] || [], k = m.event.special[a.type] || {};
if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) {
h = m.event.handlers.call(this, a, j), b = 0;
while ((f = h[b++]) && !a.isPropagationStopped()) {
a.currentTarget = f.elem, g = 0;
while ((e = f.handlers[g++]) && !a.isImmediatePropagationStopped())(!a.namespace_re || a.namespace_re.test(e.namespace)) && (a.handleObj = e, a.data = e.data, c = ((m.event.special[e.origType] || {}).handle || e.handler).apply(f.elem, i), void 0 !== c && (a.result = c) === !1 && (a.preventDefault(), a.stopPropagation()))
}
return k.postDispatch && k.postDispatch.call(this, a), a.result
}
},
handlers: function (a, b) {
var c, d, e, f, g = [], h = b.delegateCount, i = a.target;
if (h && i.nodeType && (!a.button || "click" !== a.type))for (; i != this; i = i.parentNode || this)if (1 === i.nodeType && (i.disabled !== !0 || "click" !== a.type)) {
for (e = [], f = 0; h > f; f++)d = b[f], c = d.selector + " ", void 0 === e[c] && (e[c] = d.needsContext ? m(c, this).index(i) >= 0 : m.find(c, this, null, [i]).length), e[c] && e.push(d);
e.length && g.push({elem: i, handlers: e})
}
return h < b.length && g.push({elem: this, handlers: b.slice(h)}), g
},
fix: function (a) {
if (a[m.expando])return a;
var b, c, d, e = a.type, f = a, g = this.fixHooks[e];
g || (this.fixHooks[e] = g = Z.test(e) ? this.mouseHooks : Y.test(e) ? this.keyHooks : {}), d = g.props ? this.props.concat(g.props) : this.props, a = new m.Event(f), b = d.length;
while (b--)c = d[b], a[c] = f[c];
return a.target || (a.target = f.srcElement || y), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, g.filter ? g.filter(a, f) : a
},
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "), filter: function (a, b) {
return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function (a, b) {
var c, d, e, f = b.button, g = b.fromElement;
return null == a.pageX && null != b.clientX && (d = a.target.ownerDocument || y, e = d.documentElement, c = d.body, a.pageX = b.clientX + (e && e.scrollLeft || c && c.scrollLeft || 0) - (e && e.clientLeft || c && c.clientLeft || 0), a.pageY = b.clientY + (e && e.scrollTop || c && c.scrollTop || 0) - (e && e.clientTop || c && c.clientTop || 0)), !a.relatedTarget && g && (a.relatedTarget = g === a.target ? b.toElement : g), a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a
}
},
special: {
load: {noBubble: !0}, focus: {
trigger: function () {
if (this !== cb() && this.focus)try {
return this.focus(), !1
} catch (a) {
}
}, delegateType: "focusin"
}, blur: {
trigger: function () {
return this === cb() && this.blur ? (this.blur(), !1) : void 0
}, delegateType: "focusout"
}, click: {
trigger: function () {
return m.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0
}, _default: function (a) {
return m.nodeName(a.target, "a")
}
}, beforeunload: {
postDispatch: function (a) {
void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result)
}
}
},
simulate: function (a, b, c, d) {
var e = m.extend(new m.Event, c, {type: a, isSimulated: !0, originalEvent: {}});
d ? m.event.trigger(e, null, b) : m.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault()
}
}, m.removeEvent = y.removeEventListener ? function (a, b, c) {
a.removeEventListener && a.removeEventListener(b, c, !1)
} : function (a, b, c) {
var d = "on" + b;
a.detachEvent && (typeof a[d] === K && (a[d] = null), a.detachEvent(d, c))
}, m.Event = function (a, b) {
return this instanceof m.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ab : bb) : this.type = a, b && m.extend(this, b), this.timeStamp = a && a.timeStamp || m.now(), void(this[m.expando] = !0)) : new m.Event(a, b)
}, m.Event.prototype = {
isDefaultPrevented: bb,
isPropagationStopped: bb,
isImmediatePropagationStopped: bb,
preventDefault: function () {
var a = this.originalEvent;
this.isDefaultPrevented = ab, a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
},
stopPropagation: function () {
var a = this.originalEvent;
this.isPropagationStopped = ab, a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
},
stopImmediatePropagation: function () {
var a = this.originalEvent;
this.isImmediatePropagationStopped = ab, a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation()
}
}, m.each({
mouseenter: "mouseover",
mouseleave: "mouseout",
pointerenter: "pointerover",
pointerleave: "pointerout"
}, function (a, b) {
m.event.special[a] = {
delegateType: b, bindType: b, handle: function (a) {
var c, d = this, e = a.relatedTarget, f = a.handleObj;
return (!e || e !== d && !m.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c
}
}
}), k.submitBubbles || (m.event.special.submit = {
setup: function () {
return m.nodeName(this, "form") ? !1 : void m.event.add(this, "click._submit keypress._submit", function (a) {
var b = a.target, c = m.nodeName(b, "input") || m.nodeName(b, "button") ? b.form : void 0;
c && !m._data(c, "submitBubbles") && (m.event.add(c, "submit._submit", function (a) {
a._submit_bubble = !0
}), m._data(c, "submitBubbles", !0))
})
}, postDispatch: function (a) {
a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && m.event.simulate("submit", this.parentNode, a, !0))
}, teardown: function () {
return m.nodeName(this, "form") ? !1 : void m.event.remove(this, "._submit")
}
}), k.changeBubbles || (m.event.special.change = {
setup: function () {
return X.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (m.event.add(this, "propertychange._change", function (a) {
"checked" === a.originalEvent.propertyName && (this._just_changed = !0)
}), m.event.add(this, "click._change", function (a) {
this._just_changed && !a.isTrigger && (this._just_changed = !1), m.event.simulate("change", this, a, !0)
})), !1) : void m.event.add(this, "beforeactivate._change", function (a) {
var b = a.target;
X.test(b.nodeName) && !m._data(b, "changeBubbles") && (m.event.add(b, "change._change", function (a) {
!this.parentNode || a.isSimulated || a.isTrigger || m.event.simulate("change", this.parentNode, a, !0)
}), m._data(b, "changeBubbles", !0))
})
}, handle: function (a) {
var b = a.target;
return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0
}, teardown: function () {
return m.event.remove(this, "._change"), !X.test(this.nodeName)
}
}), k.focusinBubbles || m.each({focus: "focusin", blur: "focusout"}, function (a, b) {
var c = function (a) {
m.event.simulate(b, a.target, m.event.fix(a), !0)
};
m.event.special[b] = {
setup: function () {
var d = this.ownerDocument || this, e = m._data(d, b);
e || d.addEventListener(a, c, !0), m._data(d, b, (e || 0) + 1)
}, teardown: function () {
var d = this.ownerDocument || this, e = m._data(d, b) - 1;
e ? m._data(d, b, e) : (d.removeEventListener(a, c, !0), m._removeData(d, b))
}
}
}), m.fn.extend({
on: function (a, b, c, d, e) {
var f, g;
if ("object" == typeof a) {
"string" != typeof b && (c = c || b, b = void 0);
for (f in a)this.on(f, b, c, a[f], e);
return this
}
if (null == c && null == d ? (d = b, c = b = void 0) : null == d && ("string" == typeof b ? (d = c, c = void 0) : (d = c, c = b, b = void 0)), d === !1)d = bb; else if (!d)return this;
return 1 === e && (g = d, d = function (a) {
return m().off(a), g.apply(this, arguments)
}, d.guid = g.guid || (g.guid = m.guid++)), this.each(function () {
m.event.add(this, a, d, c, b)
})
}, one: function (a, b, c, d) {
return this.on(a, b, c, d, 1)
}, off: function (a, b, c) {
var d, e;
if (a && a.preventDefault && a.handleObj)return d = a.handleObj, m(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this;
if ("object" == typeof a) {
for (e in a)this.off(e, b, a[e]);
return this
}
return (b === !1 || "function" == typeof b) && (c = b, b = void 0), c === !1 && (c = bb), this.each(function () {
m.event.remove(this, a, c, b)
})
}, trigger: function (a, b) {
return this.each(function () {
m.event.trigger(a, b, this)
})
}, triggerHandler: function (a, b) {
var c = this[0];
return c ? m.event.trigger(a, b, c, !0) : void 0
}
});
function db(a) {
var b = eb.split("|"), c = a.createDocumentFragment();
if (c.createElement)while (b.length)c.createElement(b.pop());
return c
}
var eb = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", fb = / jQuery\d+="(?:null|\d+)"/g, gb = new RegExp("<(?:" + eb + ")[\\s/>]", "i"), hb = /^\s+/, ib = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, jb = /<([\w:]+)/, kb = /<tbody/i, lb = /<|&#?\w+;/, mb = /<(?:script|style|link)/i, nb = /checked\s*(?:[^=]|=\s*.checked.)/i, ob = /^$|\/(?:java|ecma)script/i, pb = /^true\/(.*)/, qb = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, rb = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
area: [1, "<map>", "</map>"],
param: [1, "<object>", "</object>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
_default: k.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
}, sb = db(y), tb = sb.appendChild(y.createElement("div"));
rb.optgroup = rb.option, rb.tbody = rb.tfoot = rb.colgroup = rb.caption = rb.thead, rb.th = rb.td;
function ub(a, b) {
var c, d, e = 0, f = typeof a.getElementsByTagName !== K ? a.getElementsByTagName(b || "*") : typeof a.querySelectorAll !== K ? a.querySelectorAll(b || "*") : void 0;
if (!f)for (f = [], c = a.childNodes || a; null != (d = c[e]); e++)!b || m.nodeName(d, b) ? f.push(d) : m.merge(f, ub(d, b));
return void 0 === b || b && m.nodeName(a, b) ? m.merge([a], f) : f
}
function vb(a) {
W.test(a.type) && (a.defaultChecked = a.checked)
}
function wb(a, b) {
return m.nodeName(a, "table") && m.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
}
function xb(a) {
return a.type = (null !== m.find.attr(a, "type")) + "/" + a.type, a
}
function yb(a) {
var b = pb.exec(a.type);
return b ? a.type = b[1] : a.removeAttribute("type"), a
}
function zb(a, b) {
for (var c, d = 0; null != (c = a[d]); d++)m._data(c, "globalEval", !b || m._data(b[d], "globalEval"))
}
function Ab(a, b) {
if (1 === b.nodeType && m.hasData(a)) {
var c, d, e, f = m._data(a), g = m._data(b, f), h = f.events;
if (h) {
delete g.handle, g.events = {};
for (c in h)for (d = 0, e = h[c].length; e > d; d++)m.event.add(b, c, h[c][d])
}
g.data && (g.data = m.extend({}, g.data))
}
}
function Bb(a, b) {
var c, d, e;
if (1 === b.nodeType) {
if (c = b.nodeName.toLowerCase(), !k.noCloneEvent && b[m.expando]) {
e = m._data(b);
for (d in e.events)m.removeEvent(b, d, e.handle);
b.removeAttribute(m.expando)
}
"script" === c && b.text !== a.text ? (xb(b).text = a.text, yb(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), k.html5Clone && a.innerHTML && !m.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && W.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue)
}
}
m.extend({
clone: function (a, b, c) {
var d, e, f, g, h, i = m.contains(a.ownerDocument, a);
if (k.html5Clone || m.isXMLDoc(a) || !gb.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (tb.innerHTML = a.outerHTML, tb.removeChild(f = tb.firstChild)), !(k.noCloneEvent && k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || m.isXMLDoc(a)))for (d = ub(f), h = ub(a), g = 0; null != (e = h[g]); ++g)d[g] && Bb(e, d[g]);
if (b)if (c)for (h = h || ub(a), d = d || ub(f), g = 0; null != (e = h[g]); g++)Ab(e, d[g]); else Ab(a, f);
return d = ub(f, "script"), d.length > 0 && zb(d, !i && ub(a, "script")), d = h = e = null, f
}, buildFragment: function (a, b, c, d) {
for (var e, f, g, h, i, j, l, n = a.length, o = db(b), p = [], q = 0; n > q; q++)if (f = a[q], f || 0 === f)if ("object" === m.type(f))m.merge(p, f.nodeType ? [f] : f); else if (lb.test(f)) {
h = h || o.appendChild(b.createElement("div")), i = (jb.exec(f) || ["", ""])[1].toLowerCase(), l = rb[i] || rb._default, h.innerHTML = l[1] + f.replace(ib, "<$1></$2>") + l[2], e = l[0];
while (e--)h = h.lastChild;
if (!k.leadingWhitespace && hb.test(f) && p.push(b.createTextNode(hb.exec(f)[0])), !k.tbody) {
f = "table" !== i || kb.test(f) ? "<table>" !== l[1] || kb.test(f) ? 0 : h : h.firstChild, e = f && f.childNodes.length;
while (e--)m.nodeName(j = f.childNodes[e], "tbody") && !j.childNodes.length && f.removeChild(j)
}
m.merge(p, h.childNodes), h.textContent = "";
while (h.firstChild)h.removeChild(h.firstChild);
h = o.lastChild
} else p.push(b.createTextNode(f));
h && o.removeChild(h), k.appendChecked || m.grep(ub(p, "input"), vb), q = 0;
while (f = p[q++])if ((!d || -1 === m.inArray(f, d)) && (g = m.contains(f.ownerDocument, f), h = ub(o.appendChild(f), "script"), g && zb(h), c)) {
e = 0;
while (f = h[e++])ob.test(f.type || "") && c.push(f)
}
return h = null, o
}, cleanData: function (a, b) {
for (var d, e, f, g, h = 0, i = m.expando, j = m.cache, l = k.deleteExpando, n = m.event.special; null != (d = a[h]); h++)if ((b || m.acceptData(d)) && (f = d[i], g = f && j[f])) {
if (g.events)for (e in g.events)n[e] ? m.event.remove(d, e) : m.removeEvent(d, e, g.handle);
j[f] && (delete j[f], l ? delete d[i] : typeof d.removeAttribute !== K ? d.removeAttribute(i) : d[i] = null, c.push(f))
}
}
}), m.fn.extend({
text: function (a) {
return V(this, function (a) {
return void 0 === a ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || y).createTextNode(a))
}, null, a, arguments.length)
}, append: function () {
return this.domManip(arguments, function (a) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var b = wb(this, a);
b.appendChild(a)
}
})
}, prepend: function () {
return this.domManip(arguments, function (a) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var b = wb(this, a);
b.insertBefore(a, b.firstChild)
}
})
}, before: function () {
return this.domManip(arguments, function (a) {
this.parentNode && this.parentNode.insertBefore(a, this)
})
}, after: function () {
return this.domManip(arguments, function (a) {
this.parentNode && this.parentNode.insertBefore(a, this.nextSibling)
})
}, remove: function (a, b) {
for (var c, d = a ? m.filter(a, this) : this, e = 0; null != (c = d[e]); e++)b || 1 !== c.nodeType || m.cleanData(ub(c)), c.parentNode && (b && m.contains(c.ownerDocument, c) && zb(ub(c, "script")), c.parentNode.removeChild(c));
return this
}, empty: function () {
for (var a, b = 0; null != (a = this[b]); b++) {
1 === a.nodeType && m.cleanData(ub(a, !1));
while (a.firstChild)a.removeChild(a.firstChild);
a.options && m.nodeName(a, "select") && (a.options.length = 0)
}
return this
}, clone: function (a, b) {
return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () {
return m.clone(this, a, b)
})
}, html: function (a) {
return V(this, function (a) {
var b = this[0] || {}, c = 0, d = this.length;
if (void 0 === a)return 1 === b.nodeType ? b.innerHTML.replace(fb, "") : void 0;
if (!("string" != typeof a || mb.test(a) || !k.htmlSerialize && gb.test(a) || !k.leadingWhitespace && hb.test(a) || rb[(jb.exec(a) || ["", ""])[1].toLowerCase()])) {
a = a.replace(ib, "<$1></$2>");
try {
for (; d > c; c++)b = this[c] || {}, 1 === b.nodeType && (m.cleanData(ub(b, !1)), b.innerHTML = a);
b = 0
} catch (e) {
}
}
b && this.empty().append(a)
}, null, a, arguments.length)
}, replaceWith: function () {
var a = arguments[0];
return this.domManip(arguments, function (b) {
a = this.parentNode, m.cleanData(ub(this)), a && a.replaceChild(b, this)
}), a && (a.length || a.nodeType) ? this : this.remove()
}, detach: function (a) {
return this.remove(a, !0)
}, domManip: function (a, b) {
a = e.apply([], a);
var c, d, f, g, h, i, j = 0, l = this.length, n = this, o = l - 1, p = a[0], q = m.isFunction(p);
if (q || l > 1 && "string" == typeof p && !k.checkClone && nb.test(p))return this.each(function (c) {
var d = n.eq(c);
q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b)
});
if (l && (i = m.buildFragment(a, this[0].ownerDocument, !1, this), c = i.firstChild, 1 === i.childNodes.length && (i = c), c)) {
for (g = m.map(ub(i, "script"), xb), f = g.length; l > j; j++)d = i, j !== o && (d = m.clone(d, !0, !0), f && m.merge(g, ub(d, "script"))), b.call(this[j], d, j);
if (f)for (h = g[g.length - 1].ownerDocument, m.map(g, yb), j = 0; f > j; j++)d = g[j], ob.test(d.type || "") && !m._data(d, "globalEval") && m.contains(h, d) && (d.src ? m._evalUrl && m._evalUrl(d.src) : m.globalEval((d.text || d.textContent || d.innerHTML || "").replace(qb, "")));
i = c = null
}
return this
}
}), m.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function (a, b) {
m.fn[a] = function (a) {
for (var c, d = 0, e = [], g = m(a), h = g.length - 1; h >= d; d++)c = d === h ? this : this.clone(!0), m(g[d])[b](c), f.apply(e, c.get());
return this.pushStack(e)
}
});
var Cb, Db = {};
function Eb(b, c) {
var d, e = m(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : m.css(e[0], "display");
return e.detach(), f
}
function Fb(a) {
var b = y, c = Db[a];
return c || (c = Eb(a, b), "none" !== c && c || (Cb = (Cb || m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = (Cb[0].contentWindow || Cb[0].contentDocument).document, b.write(), b.close(), c = Eb(a, b), Cb.detach()), Db[a] = c), c
}
!function () {
var a;
k.shrinkWrapBlocks = function () {
if (null != a)return a;
a = !1;
var b, c, d;
return c = y.getElementsByTagName("body")[0], c && c.style ? (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(y.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(d), a) : void 0
}
}();
var Gb = /^margin/, Hb = new RegExp("^(" + S + ")(?!px)[a-z%]+$", "i"), Ib, Jb, Kb = /^(top|right|bottom|left)$/;
a.getComputedStyle ? (Ib = function (a) {
return a.ownerDocument.defaultView.getComputedStyle(a, null)
}, Jb = function (a, b, c) {
var d, e, f, g, h = a.style;
return c = c || Ib(a), g = c ? c.getPropertyValue(b) || c[b] : void 0, c && ("" !== g || m.contains(a.ownerDocument, a) || (g = m.style(a, b)), Hb.test(g) && Gb.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 === g ? g : g + ""
}) : y.documentElement.currentStyle && (Ib = function (a) {
return a.currentStyle
}, Jb = function (a, b, c) {
var d, e, f, g, h = a.style;
return c = c || Ib(a), g = c ? c[b] : void 0, null == g && h && h[b] && (g = h[b]), Hb.test(g) && !Kb.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)), void 0 === g ? g : g + "" || "auto"
});
function Lb(a, b) {
return {
get: function () {
var c = a();
if (null != c)return c ? void delete this.get : (this.get = b).apply(this, arguments)
}
}
}
!function () {
var b, c, d, e, f, g, h;
if (b = y.createElement("div"), b.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = d && d.style) {
c.cssText = "float:left;opacity:.5", k.opacity = "0.5" === c.opacity, k.cssFloat = !!c.cssFloat, b.style.backgroundClip = "content-box", b.cloneNode(!0).style.backgroundClip = "", k.clearCloneStyle = "content-box" === b.style.backgroundClip, k.boxSizing = "" === c.boxSizing || "" === c.MozBoxSizing || "" === c.WebkitBoxSizing, m.extend(k, {
reliableHiddenOffsets: function () {
return null == g && i(), g
}, boxSizingReliable: function () {
return null == f && i(), f
}, pixelPosition: function () {
return null == e && i(), e
}, reliableMarginRight: function () {
return null == h && i(), h
}
});
function i() {
var b, c, d, i;
c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), b.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", e = f = !1, h = !0, a.getComputedStyle && (e = "1%" !== (a.getComputedStyle(b, null) || {}).top, f = "4px" === (a.getComputedStyle(b, null) || {width: "4px"}).width, i = b.appendChild(y.createElement("div")), i.style.cssText = b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", i.style.marginRight = i.style.width = "0", b.style.width = "1px", h = !parseFloat((a.getComputedStyle(i, null) || {}).marginRight)), b.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", i = b.getElementsByTagName("td"), i[0].style.cssText = "margin:0;border:0;padding:0;display:none", g = 0 === i[0].offsetHeight, g && (i[0].style.display = "", i[1].style.display = "none", g = 0 === i[0].offsetHeight), c.removeChild(d))
}
}
}(), m.swap = function (a, b, c, d) {
var e, f, g = {};
for (f in b)g[f] = a.style[f], a.style[f] = b[f];
e = c.apply(a, d || []);
for (f in b)a.style[f] = g[f];
return e
};
var Mb = /alpha\([^)]*\)/i, Nb = /opacity\s*=\s*([^)]*)/, Ob = /^(none|table(?!-c[ea]).+)/, Pb = new RegExp("^(" + S + ")(.*)$", "i"), Qb = new RegExp("^([+-])=(" + S + ")", "i"), Rb = {
position: "absolute",
visibility: "hidden",
display: "block"
}, Sb = {letterSpacing: "0", fontWeight: "400"}, Tb = ["Webkit", "O", "Moz", "ms"];
function Ub(a, b) {
if (b in a)return b;
var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = Tb.length;
while (e--)if (b = Tb[e] + c, b in a)return b;
return d
}
function Vb(a, b) {
for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)d = a[g], d.style && (f[g] = m._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && U(d) && (f[g] = m._data(d, "olddisplay", Fb(d.nodeName)))) : (e = U(d), (c && "none" !== c || !e) && m._data(d, "olddisplay", e ? c : m.css(d, "display"))));
for (g = 0; h > g; g++)d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none"));
return a
}
function Wb(a, b, c) {
var d = Pb.exec(b);
return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
}
function Xb(a, b, c, d, e) {
for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2)"margin" === c && (g += m.css(a, c + T[f], !0, e)), d ? ("content" === c && (g -= m.css(a, "padding" + T[f], !0, e)), "margin" !== c && (g -= m.css(a, "border" + T[f] + "Width", !0, e))) : (g += m.css(a, "padding" + T[f], !0, e), "padding" !== c && (g += m.css(a, "border" + T[f] + "Width", !0, e)));
return g
}
function Yb(a, b, c) {
var d = !0, e = "width" === b ? a.offsetWidth : a.offsetHeight, f = Ib(a), g = k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, f);
if (0 >= e || null == e) {
if (e = Jb(a, b, f), (0 > e || null == e) && (e = a.style[b]), Hb.test(e))return e;
d = g && (k.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0
}
return e + Xb(a, b, c || (g ? "border" : "content"), d, f) + "px"
}
m.extend({
cssHooks: {
opacity: {
get: function (a, b) {
if (b) {
var c = Jb(a, "opacity");
return "" === c ? "1" : c
}
}
}
},
cssNumber: {
columnCount: !0,
fillOpacity: !0,
flexGrow: !0,
flexShrink: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {"float": k.cssFloat ? "cssFloat" : "styleFloat"},
style: function (a, b, c, d) {
if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
var e, f, g, h = m.camelCase(b), i = a.style;
if (b = m.cssProps[h] || (m.cssProps[h] = Ub(i, h)), g = m.cssHooks[b] || m.cssHooks[h], void 0 === c)return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b];
if (f = typeof c, "string" === f && (e = Qb.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b)), f = "number"), null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 === (c = g.set(a, c, d)))))try {
i[b] = c
} catch (j) {
}
}
},
css: function (a, b, c, d) {
var e, f, g, h = m.camelCase(b);
return b = m.cssProps[h] || (m.cssProps[h] = Ub(a.style, h)), g = m.cssHooks[b] || m.cssHooks[h], g && "get" in g && (f = g.get(a, !0, c)), void 0 === f && (f = Jb(a, b, d)), "normal" === f && b in Sb && (f = Sb[b]), "" === c || c ? (e = parseFloat(f), c === !0 || m.isNumeric(e) ? e || 0 : f) : f
}
}), m.each(["height", "width"], function (a, b) {
m.cssHooks[b] = {
get: function (a, c, d) {
return c ? Ob.test(m.css(a, "display")) && 0 === a.offsetWidth ? m.swap(a, Rb, function () {
return Yb(a, b, d)
}) : Yb(a, b, d) : void 0
}, set: function (a, c, d) {
var e = d && Ib(a);
return Wb(a, c, d ? Xb(a, b, d, k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, e), e) : 0)
}
}
}), k.opacity || (m.cssHooks.opacity = {
get: function (a, b) {
return Nb.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
}, set: function (a, b) {
var c = a.style, d = a.currentStyle, e = m.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", f = d && d.filter || c.filter || "";
c.zoom = 1, (b >= 1 || "" === b) && "" === m.trim(f.replace(Mb, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d && !d.filter) || (c.filter = Mb.test(f) ? f.replace(Mb, e) : f + " " + e)
}
}), m.cssHooks.marginRight = Lb(k.reliableMarginRight, function (a, b) {
return b ? m.swap(a, {display: "inline-block"}, Jb, [a, "marginRight"]) : void 0
}), m.each({margin: "", padding: "", border: "Width"}, function (a, b) {
m.cssHooks[a + b] = {
expand: function (c) {
for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++)e[a + T[d] + b] = f[d] || f[d - 2] || f[0];
return e
}
}, Gb.test(a) || (m.cssHooks[a + b].set = Wb)
}), m.fn.extend({
css: function (a, b) {
return V(this, function (a, b, c) {
var d, e, f = {}, g = 0;
if (m.isArray(b)) {
for (d = Ib(a), e = b.length; e > g; g++)f[b[g]] = m.css(a, b[g], !1, d);
return f
}
return void 0 !== c ? m.style(a, b, c) : m.css(a, b)
}, a, b, arguments.length > 1)
}, show: function () {
return Vb(this, !0)
}, hide: function () {
return Vb(this)
}, toggle: function (a) {
return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () {
U(this) ? m(this).show() : m(this).hide()
})
}
});
function Zb(a, b, c, d, e) {
return new Zb.prototype.init(a, b, c, d, e)
}
m.Tween = Zb, Zb.prototype = {
constructor: Zb, init: function (a, b, c, d, e, f) {
this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (m.cssNumber[c] ? "" : "px")
}, cur: function () {
var a = Zb.propHooks[this.prop];
return a && a.get ? a.get(this) : Zb.propHooks._default.get(this)
}, run: function (a) {
var b, c = Zb.propHooks[this.prop];
return this.pos = b = this.options.duration ? m.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Zb.propHooks._default.set(this), this
}
}, Zb.prototype.init.prototype = Zb.prototype, Zb.propHooks = {
_default: {
get: function (a) {
var b;
return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = m.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop]
}, set: function (a) {
m.fx.step[a.prop] ? m.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[m.cssProps[a.prop]] || m.cssHooks[a.prop]) ? m.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now
}
}
}, Zb.propHooks.scrollTop = Zb.propHooks.scrollLeft = {
set: function (a) {
a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
}
}, m.easing = {
linear: function (a) {
return a
}, swing: function (a) {
return .5 - Math.cos(a * Math.PI) / 2
}
}, m.fx = Zb.prototype.init, m.fx.step = {};
var $b, _b, ac = /^(?:toggle|show|hide)$/, bc = new RegExp("^(?:([+-])=|)(" + S + ")([a-z%]*)$", "i"), cc = /queueHooks$/, dc = [ic], ec = {
"*": [function (a, b) {
var c = this.createTween(a, b), d = c.cur(), e = bc.exec(b), f = e && e[3] || (m.cssNumber[a] ? "" : "px"), g = (m.cssNumber[a] || "px" !== f && +d) && bc.exec(m.css(c.elem, a)), h = 1, i = 20;
if (g && g[3] !== f) {
f = f || g[3], e = e || [], g = +d || 1;
do h = h || ".5", g /= h, m.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i)
}
return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c
}]
};
function fc() {
return setTimeout(function () {
$b = void 0
}), $b = m.now()
}
function gc(a, b) {
var c, d = {height: a}, e = 0;
for (b = b ? 1 : 0; 4 > e; e += 2 - b)c = T[e], d["margin" + c] = d["padding" + c] = a;
return b && (d.opacity = d.width = a), d
}
function hc(a, b, c) {
for (var d, e = (ec[b] || []).concat(ec["*"]), f = 0, g = e.length; g > f; f++)if (d = e[f].call(c, b, a))return d
}
function ic(a, b, c) {
var d, e, f, g, h, i, j, l, n = this, o = {}, p = a.style, q = a.nodeType && U(a), r = m._data(a, "fxshow");
c.queue || (h = m._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () {
h.unqueued || i()
}), h.unqueued++, n.always(function () {
n.always(function () {
h.unqueued--, m.queue(a, "fx").length || h.empty.fire()
})
})), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = m.css(a, "display"), l = "none" === j ? m._data(a, "olddisplay") || Fb(a.nodeName) : j, "inline" === l && "none" === m.css(a, "float") && (k.inlineBlockNeedsLayout && "inline" !== Fb(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")), c.overflow && (p.overflow = "hidden", k.shrinkWrapBlocks() || n.always(function () {
p.overflow = c.overflow[0], p.overflowX = c.overflow[1], p.overflowY = c.overflow[2]
}));
for (d in b)if (e = b[d], ac.exec(e)) {
if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) {
if ("show" !== e || !r || void 0 === r[d])continue;
q = !0
}
o[d] = r && r[d] || m.style(a, d)
} else j = void 0;
if (m.isEmptyObject(o))"inline" === ("none" === j ? Fb(a.nodeName) : j) && (p.display = j); else {
r ? "hidden" in r && (q = r.hidden) : r = m._data(a, "fxshow", {}), f && (r.hidden = !q), q ? m(a).show() : n.done(function () {
m(a).hide()
}), n.done(function () {
var b;
m._removeData(a, "fxshow");
for (b in o)m.style(a, b, o[b])
});
for (d in o)g = hc(q ? r[d] : 0, d, n), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0))
}
}
function jc(a, b) {
var c, d, e, f, g;
for (c in a)if (d = m.camelCase(c), e = b[d], f = a[c], m.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = m.cssHooks[d], g && "expand" in g) {
f = g.expand(f), delete a[d];
for (c in f)c in a || (a[c] = f[c], b[c] = e)
} else b[d] = e
}
function kc(a, b, c) {
var d, e, f = 0, g = dc.length, h = m.Deferred().always(function () {
delete i.elem
}), i = function () {
if (e)return !1;
for (var b = $b || fc(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)j.tweens[g].run(f);
return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1)
}, j = h.promise({
elem: a,
props: m.extend({}, b),
opts: m.extend(!0, {specialEasing: {}}, c),
originalProperties: b,
originalOptions: c,
startTime: $b || fc(),
duration: c.duration,
tweens: [],
createTween: function (b, c) {
var d = m.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);
return j.tweens.push(d), d
},
stop: function (b) {
var c = 0, d = b ? j.tweens.length : 0;
if (e)return this;
for (e = !0; d > c; c++)j.tweens[c].run(1);
return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this
}
}), k = j.props;
for (jc(k, j.opts.specialEasing); g > f; f++)if (d = dc[f].call(j, a, k, j.opts))return d;
return m.map(k, hc, j), m.isFunction(j.opts.start) && j.opts.start.call(a, j), m.fx.timer(m.extend(i, {
elem: a,
anim: j,
queue: j.opts.queue
})), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always)
}
m.Animation = m.extend(kc, {
tweener: function (a, b) {
m.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
for (var c, d = 0, e = a.length; e > d; d++)c = a[d], ec[c] = ec[c] || [], ec[c].unshift(b)
}, prefilter: function (a, b) {
b ? dc.unshift(a) : dc.push(a)
}
}), m.speed = function (a, b, c) {
var d = a && "object" == typeof a ? m.extend({}, a) : {
complete: c || !c && b || m.isFunction(a) && a,
duration: a,
easing: c && b || b && !m.isFunction(b) && b
};
return d.duration = m.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in m.fx.speeds ? m.fx.speeds[d.duration] : m.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function () {
m.isFunction(d.old) && d.old.call(this), d.queue && m.dequeue(this, d.queue)
}, d
}, m.fn.extend({
fadeTo: function (a, b, c, d) {
return this.filter(U).css("opacity", 0).show().end().animate({opacity: b}, a, c, d)
}, animate: function (a, b, c, d) {
var e = m.isEmptyObject(a), f = m.speed(b, c, d), g = function () {
var b = kc(this, m.extend({}, a), f);
(e || m._data(this, "finish")) && b.stop(!0)
};
return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
}, stop: function (a, b, c) {
var d = function (a) {
var b = a.stop;
delete a.stop, b(c)
};
return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function () {
var b = !0, e = null != a && a + "queueHooks", f = m.timers, g = m._data(this);
if (e)g[e] && g[e].stop && d(g[e]); else for (e in g)g[e] && g[e].stop && cc.test(e) && d(g[e]);
for (e = f.length; e--;)f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
(b || !c) && m.dequeue(this, a)
})
}, finish: function (a) {
return a !== !1 && (a = a || "fx"), this.each(function () {
var b, c = m._data(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = m.timers, g = d ? d.length : 0;
for (c.finish = !0, m.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;)f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1));
for (b = 0; g > b; b++)d[b] && d[b].finish && d[b].finish.call(this);
delete c.finish
})
}
}), m.each(["toggle", "show", "hide"], function (a, b) {
var c = m.fn[b];
m.fn[b] = function (a, d, e) {
return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(gc(b, !0), a, d, e)
}
}), m.each({
slideDown: gc("show"),
slideUp: gc("hide"),
slideToggle: gc("toggle"),
fadeIn: {opacity: "show"},
fadeOut: {opacity: "hide"},
fadeToggle: {opacity: "toggle"}
}, function (a, b) {
m.fn[a] = function (a, c, d) {
return this.animate(b, a, c, d)
}
}), m.timers = [], m.fx.tick = function () {
var a, b = m.timers, c = 0;
for ($b = m.now(); c < b.length; c++)a = b[c], a() || b[c] !== a || b.splice(c--, 1);
b.length || m.fx.stop(), $b = void 0
}, m.fx.timer = function (a) {
m.timers.push(a), a() ? m.fx.start() : m.timers.pop()
}, m.fx.interval = 13, m.fx.start = function () {
_b || (_b = setInterval(m.fx.tick, m.fx.interval))
}, m.fx.stop = function () {
clearInterval(_b), _b = null
}, m.fx.speeds = {slow: 600, fast: 200, _default: 400}, m.fn.delay = function (a, b) {
return a = m.fx ? m.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) {
var d = setTimeout(b, a);
c.stop = function () {
clearTimeout(d)
}
})
}, function () {
var a, b, c, d, e;
b = y.createElement("div"), b.setAttribute("className", "t"), b.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = y.createElement("select"), e = c.appendChild(y.createElement("option")), a = b.getElementsByTagName("input")[0], d.style.cssText = "top:1px", k.getSetAttribute = "t" !== b.className, k.style = /top/.test(d.getAttribute("style")), k.hrefNormalized = "/a" === d.getAttribute("href"), k.checkOn = !!a.value, k.optSelected = e.selected, k.enctype = !!y.createElement("form").enctype, c.disabled = !0, k.optDisabled = !e.disabled, a = y.createElement("input"), a.setAttribute("value", ""), k.input = "" === a.getAttribute("value"), a.value = "t", a.setAttribute("type", "radio"), k.radioValue = "t" === a.value
}();
var lc = /\r/g;
m.fn.extend({
val: function (a) {
var b, c, d, e = this[0];
{
if (arguments.length)return d = m.isFunction(a), this.each(function (c) {
var e;
1 === this.nodeType && (e = d ? a.call(this, c, m(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function (a) {
return null == a ? "" : a + ""
})), b = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e))
});
if (e)return b = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(lc, "") : null == c ? "" : c)
}
}
}), m.extend({
valHooks: {
option: {
get: function (a) {
var b = m.find.attr(a, "value");
return null != b ? b : m.trim(m.text(a))
}
}, select: {
get: function (a) {
for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)if (c = d[i], !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && m.nodeName(c.parentNode, "optgroup"))) {
if (b = m(c).val(), f)return b;
g.push(b)
}
return g
}, set: function (a, b) {
var c, d, e = a.options, f = m.makeArray(b), g = e.length;
while (g--)if (d = e[g], m.inArray(m.valHooks.option.get(d), f) >= 0)try {
d.selected = c = !0
} catch (h) {
d.scrollHeight
} else d.selected = !1;
return c || (a.selectedIndex = -1), e
}
}
}
}), m.each(["radio", "checkbox"], function () {
m.valHooks[this] = {
set: function (a, b) {
return m.isArray(b) ? a.checked = m.inArray(m(a).val(), b) >= 0 : void 0
}
}, k.checkOn || (m.valHooks[this].get = function (a) {
return null === a.getAttribute("value") ? "on" : a.value
})
});
var mc, nc, oc = m.expr.attrHandle, pc = /^(?:checked|selected)$/i, qc = k.getSetAttribute, rc = k.input;
m.fn.extend({
attr: function (a, b) {
return V(this, m.attr, a, b, arguments.length > 1)
}, removeAttr: function (a) {
return this.each(function () {
m.removeAttr(this, a)
})
}
}), m.extend({
attr: function (a, b, c) {
var d, e, f = a.nodeType;
if (a && 3 !== f && 8 !== f && 2 !== f)return typeof a.getAttribute === K ? m.prop(a, b, c) : (1 === f && m.isXMLDoc(a) || (b = b.toLowerCase(), d = m.attrHooks[b] || (m.expr.match.bool.test(b) ? nc : mc)), void 0 === c ? d && "get" in d && null !== (e = d.get(a, b)) ? e : (e = m.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && "set" in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""), c) : void m.removeAttr(a, b))
}, removeAttr: function (a, b) {
var c, d, e = 0, f = b && b.match(E);
if (f && 1 === a.nodeType)while (c = f[e++])d = m.propFix[c] || c, m.expr.match.bool.test(c) ? rc && qc || !pc.test(c) ? a[d] = !1 : a[m.camelCase("default-" + c)] = a[d] = !1 : m.attr(a, c, ""), a.removeAttribute(qc ? c : d)
}, attrHooks: {
type: {
set: function (a, b) {
if (!k.radioValue && "radio" === b && m.nodeName(a, "input")) {
var c = a.value;
return a.setAttribute("type", b), c && (a.value = c), b
}
}
}
}
}), nc = {
set: function (a, b, c) {
return b === !1 ? m.removeAttr(a, c) : rc && qc || !pc.test(c) ? a.setAttribute(!qc && m.propFix[c] || c, c) : a[m.camelCase("default-" + c)] = a[c] = !0, c
}
}, m.each(m.expr.match.bool.source.match(/\w+/g), function (a, b) {
var c = oc[b] || m.find.attr;
oc[b] = rc && qc || !pc.test(b) ? function (a, b, d) {
var e, f;
return d || (f = oc[b], oc[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, oc[b] = f), e
} : function (a, b, c) {
return c ? void 0 : a[m.camelCase("default-" + b)] ? b.toLowerCase() : null
}
}), rc && qc || (m.attrHooks.value = {
set: function (a, b, c) {
return m.nodeName(a, "input") ? void(a.defaultValue = b) : mc && mc.set(a, b, c)
}
}), qc || (mc = {
set: function (a, b, c) {
var d = a.getAttributeNode(c);
return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)), d.value = b += "", "value" === c || b === a.getAttribute(c) ? b : void 0
}
}, oc.id = oc.name = oc.coords = function (a, b, c) {
var d;
return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null
}, m.valHooks.button = {
get: function (a, b) {
var c = a.getAttributeNode(b);
return c && c.specified ? c.value : void 0
}, set: mc.set
}, m.attrHooks.contenteditable = {
set: function (a, b, c) {
mc.set(a, "" === b ? !1 : b, c)
}
}, m.each(["width", "height"], function (a, b) {
m.attrHooks[b] = {
set: function (a, c) {
return "" === c ? (a.setAttribute(b, "auto"), c) : void 0
}
}
})), k.style || (m.attrHooks.style = {
get: function (a) {
return a.style.cssText || void 0
}, set: function (a, b) {
return a.style.cssText = b + ""
}
});
var sc = /^(?:input|select|textarea|button|object)$/i, tc = /^(?:a|area)$/i;
m.fn.extend({
prop: function (a, b) {
return V(this, m.prop, a, b, arguments.length > 1)
}, removeProp: function (a) {
return a = m.propFix[a] || a, this.each(function () {
try {
this[a] = void 0, delete this[a]
} catch (b) {
}
})
}
}), m.extend({
propFix: {"for": "htmlFor", "class": "className"}, prop: function (a, b, c) {
var d, e, f, g = a.nodeType;
if (a && 3 !== g && 8 !== g && 2 !== g)return f = 1 !== g || !m.isXMLDoc(a), f && (b = m.propFix[b] || b, e = m.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b]
}, propHooks: {
tabIndex: {
get: function (a) {
var b = m.find.attr(a, "tabindex");
return b ? parseInt(b, 10) : sc.test(a.nodeName) || tc.test(a.nodeName) && a.href ? 0 : -1
}
}
}
}), k.hrefNormalized || m.each(["href", "src"], function (a, b) {
m.propHooks[b] = {
get: function (a) {
return a.getAttribute(b, 4)
}
}
}), k.optSelected || (m.propHooks.selected = {
get: function (a) {
var b = a.parentNode;
return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
}
}), m.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
m.propFix[this.toLowerCase()] = this
}), k.enctype || (m.propFix.enctype = "encoding");
var uc = /[\t\r\n\f]/g;
m.fn.extend({
addClass: function (a) {
var b, c, d, e, f, g, h = 0, i = this.length, j = "string" == typeof a && a;
if (m.isFunction(a))return this.each(function (b) {
m(this).addClass(a.call(this, b, this.className))
});
if (j)for (b = (a || "").match(E) || []; i > h; h++)if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : " ")) {
f = 0;
while (e = b[f++])d.indexOf(" " + e + " ") < 0 && (d += e + " ");
g = m.trim(d), c.className !== g && (c.className = g)
}
return this
}, removeClass: function (a) {
var b, c, d, e, f, g, h = 0, i = this.length, j = 0 === arguments.length || "string" == typeof a && a;
if (m.isFunction(a))return this.each(function (b) {
m(this).removeClass(a.call(this, b, this.className))
});
if (j)for (b = (a || "").match(E) || []; i > h; h++)if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : "")) {
f = 0;
while (e = b[f++])while (d.indexOf(" " + e + " ") >= 0)d = d.replace(" " + e + " ", " ");
g = a ? m.trim(d) : "", c.className !== g && (c.className = g)
}
return this
}, toggleClass: function (a, b) {
var c = typeof a;
return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(m.isFunction(a) ? function (c) {
m(this).toggleClass(a.call(this, c, this.className, b), b)
} : function () {
if ("string" === c) {
var b, d = 0, e = m(this), f = a.match(E) || [];
while (b = f[d++])e.hasClass(b) ? e.removeClass(b) : e.addClass(b)
} else(c === K || "boolean" === c) && (this.className && m._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : m._data(this, "__className__") || "")
})
}, hasClass: function (a) {
for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++)if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(uc, " ").indexOf(b) >= 0)return !0;
return !1
}
}), m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) {
m.fn[b] = function (a, c) {
return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
}
}), m.fn.extend({
hover: function (a, b) {
return this.mouseenter(a).mouseleave(b || a)
}, bind: function (a, b, c) {
return this.on(a, null, b, c)
}, unbind: function (a, b) {
return this.off(a, null, b)
}, delegate: function (a, b, c, d) {
return this.on(b, a, c, d)
}, undelegate: function (a, b, c) {
return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
}
});
var vc = m.now(), wc = /\?/, xc = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
m.parseJSON = function (b) {
if (a.JSON && a.JSON.parse)return a.JSON.parse(b + "");
var c, d = null, e = m.trim(b + "");
return e && !m.trim(e.replace(xc, function (a, b, e, f) {
return c && b && (d = 0), 0 === d ? a : (c = e || b, d += !f - !e, "")
})) ? Function("return " + e)() : m.error("Invalid JSON: " + b)
}, m.parseXML = function (b) {
var c, d;
if (!b || "string" != typeof b)return null;
try {
a.DOMParser ? (d = new DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b))
} catch (e) {
c = void 0
}
return c && c.documentElement && !c.getElementsByTagName("parsererror").length || m.error("Invalid XML: " + b), c
};
var yc, zc, Ac = /#.*$/, Bc = /([?&])_=[^&]*/, Cc = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Dc = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Ec = /^(?:GET|HEAD)$/, Fc = /^\/\//, Gc = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Hc = {}, Ic = {}, Jc = "*/".concat("*");
try {
zc = location.href
} catch (Kc) {
zc = y.createElement("a"), zc.href = "", zc = zc.href
}
yc = Gc.exec(zc.toLowerCase()) || [];
function Lc(a) {
return function (b, c) {
"string" != typeof b && (c = b, b = "*");
var d, e = 0, f = b.toLowerCase().match(E) || [];
if (m.isFunction(c))while (d = f[e++])"+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c)
}
}
function Mc(a, b, c, d) {
var e = {}, f = a === Ic;
function g(h) {
var i;
return e[h] = !0, m.each(a[h] || [], function (a, h) {
var j = h(b, c, d);
return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1)
}), i
}
return g(b.dataTypes[0]) || !e["*"] && g("*")
}
function Nc(a, b) {
var c, d, e = m.ajaxSettings.flatOptions || {};
for (d in b)void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]);
return c && m.extend(!0, a, c), a
}
function Oc(a, b, c) {
var d, e, f, g, h = a.contents, i = a.dataTypes;
while ("*" === i[0])i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type"));
if (e)for (g in h)if (h[g] && h[g].test(e)) {
i.unshift(g);
break
}
if (i[0] in c)f = i[0]; else {
for (g in c) {
if (!i[0] || a.converters[g + " " + i[0]]) {
f = g;
break
}
d || (d = g)
}
f = f || d
}
return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0
}
function Pc(a, b, c, d) {
var e, f, g, h, i, j = {}, k = a.dataTypes.slice();
if (k[1])for (g in a.converters)j[g.toLowerCase()] = a.converters[g];
f = k.shift();
while (f)if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift())if ("*" === f)f = i; else if ("*" !== i && i !== f) {
if (g = j[i + " " + f] || j["* " + f], !g)for (e in j)if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1]));
break
}
if (g !== !0)if (g && a["throws"])b = g(b); else try {
b = g(b)
} catch (l) {
return {state: "parsererror", error: g ? l : "No conversion from " + i + " to " + f}
}
}
return {state: "success", data: b}
}
m.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: zc,
type: "GET",
isLocal: Dc.test(yc[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": Jc,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {xml: /xml/, html: /html/, json: /json/},
responseFields: {xml: "responseXML", text: "responseText", json: "responseJSON"},
converters: {"* text": String, "text html": !0, "text json": m.parseJSON, "text xml": m.parseXML},
flatOptions: {url: !0, context: !0}
},
ajaxSetup: function (a, b) {
return b ? Nc(Nc(a, m.ajaxSettings), b) : Nc(m.ajaxSettings, a)
},
ajaxPrefilter: Lc(Hc),
ajaxTransport: Lc(Ic),
ajax: function (a, b) {
"object" == typeof a && (b = a, a = void 0), b = b || {};
var c, d, e, f, g, h, i, j, k = m.ajaxSetup({}, b), l = k.context || k, n = k.context && (l.nodeType || l.jquery) ? m(l) : m.event, o = m.Deferred(), p = m.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = {
readyState: 0,
getResponseHeader: function (a) {
var b;
if (2 === t) {
if (!j) {
j = {};
while (b = Cc.exec(f))j[b[1].toLowerCase()] = b[2]
}
b = j[a.toLowerCase()]
}
return null == b ? null : b
},
getAllResponseHeaders: function () {
return 2 === t ? f : null
},
setRequestHeader: function (a, b) {
var c = a.toLowerCase();
return t || (a = s[c] = s[c] || a, r[a] = b), this
},
overrideMimeType: function (a) {
return t || (k.mimeType = a), this
},
statusCode: function (a) {
var b;
if (a)if (2 > t)for (b in a)q[b] = [q[b], a[b]]; else v.always(a[v.status]);
return this
},
abort: function (a) {
var b = a || u;
return i && i.abort(b), x(0, b), this
}
};
if (o.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || zc) + "").replace(Ac, "").replace(Fc, yc[1] + "//"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = m.trim(k.dataType || "*").toLowerCase().match(E) || [""], null == k.crossDomain && (c = Gc.exec(k.url.toLowerCase()), k.crossDomain = !(!c || c[1] === yc[1] && c[2] === yc[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (yc[3] || ("http:" === yc[1] ? "80" : "443")))), k.data && k.processData && "string" != typeof k.data && (k.data = m.param(k.data, k.traditional)), Mc(Hc, k, b, v), 2 === t)return v;
h = k.global, h && 0 === m.active++ && m.event.trigger("ajaxStart"), k.type = k.type.toUpperCase(), k.hasContent = !Ec.test(k.type), e = k.url, k.hasContent || (k.data && (e = k.url += (wc.test(e) ? "&" : "?") + k.data, delete k.data), k.cache === !1 && (k.url = Bc.test(e) ? e.replace(Bc, "$1_=" + vc++) : e + (wc.test(e) ? "&" : "?") + "_=" + vc++)), k.ifModified && (m.lastModified[e] && v.setRequestHeader("If-Modified-Since", m.lastModified[e]), m.etag[e] && v.setRequestHeader("If-None-Match", m.etag[e])), (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType), v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + Jc + "; q=0.01" : "") : k.accepts["*"]);
for (d in k.headers)v.setRequestHeader(d, k.headers[d]);
if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t))return v.abort();
u = "abort";
for (d in{success: 1, error: 1, complete: 1})v[d](k[d]);
if (i = Mc(Ic, k, b, v)) {
v.readyState = 1, h && n.trigger("ajaxSend", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function () {
v.abort("timeout")
}, k.timeout));
try {
t = 1, i.send(r, x)
} catch (w) {
if (!(2 > t))throw w;
x(-1, w)
}
} else x(-1, "No Transport");
function x(a, b, c, d) {
var j, r, s, u, w, x = b;
2 !== t && (t = 2, g && clearTimeout(g), i = void 0, f = d || "", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, c && (u = Oc(k, v, c)), u = Pc(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"), w && (m.lastModified[e] = w), w = v.getResponseHeader("etag"), w && (m.etag[e] = w)), 204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state, r = u.data, s = u.error, j = !s)) : (s = x, (a || !x) && (x = "error", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + "", j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, h && n.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]), p.fireWith(l, [v, x]), h && (n.trigger("ajaxComplete", [v, k]), --m.active || m.event.trigger("ajaxStop")))
}
return v
},
getJSON: function (a, b, c) {
return m.get(a, b, c, "json")
},
getScript: function (a, b) {
return m.get(a, void 0, b, "script")
}
}), m.each(["get", "post"], function (a, b) {
m[b] = function (a, c, d, e) {
return m.isFunction(c) && (e = e || d, d = c, c = void 0), m.ajax({
url: a,
type: b,
dataType: e,
data: c,
success: d
})
}
}), m.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) {
m.fn[b] = function (a) {
return this.on(b, a)
}
}), m._evalUrl = function (a) {
return m.ajax({url: a, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0})
}, m.fn.extend({
wrapAll: function (a) {
if (m.isFunction(a))return this.each(function (b) {
m(this).wrapAll(a.call(this, b))
});
if (this[0]) {
var b = m(a, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && b.insertBefore(this[0]), b.map(function () {
var a = this;
while (a.firstChild && 1 === a.firstChild.nodeType)a = a.firstChild;
return a
}).append(this)
}
return this
}, wrapInner: function (a) {
return this.each(m.isFunction(a) ? function (b) {
m(this).wrapInner(a.call(this, b))
} : function () {
var b = m(this), c = b.contents();
c.length ? c.wrapAll(a) : b.append(a)
})
}, wrap: function (a) {
var b = m.isFunction(a);
return this.each(function (c) {
m(this).wrapAll(b ? a.call(this, c) : a)
})
}, unwrap: function () {
return this.parent().each(function () {
m.nodeName(this, "body") || m(this).replaceWith(this.childNodes)
}).end()
}
}), m.expr.filters.hidden = function (a) {
return a.offsetWidth <= 0 && a.offsetHeight <= 0 || !k.reliableHiddenOffsets() && "none" === (a.style && a.style.display || m.css(a, "display"))
}, m.expr.filters.visible = function (a) {
return !m.expr.filters.hidden(a)
};
var Qc = /%20/g, Rc = /\[\]$/, Sc = /\r?\n/g, Tc = /^(?:submit|button|image|reset|file)$/i, Uc = /^(?:input|select|textarea|keygen)/i;
function Vc(a, b, c, d) {
var e;
if (m.isArray(b))m.each(b, function (b, e) {
c || Rc.test(a) ? d(a, e) : Vc(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d)
}); else if (c || "object" !== m.type(b))d(a, b); else for (e in b)Vc(a + "[" + e + "]", b[e], c, d)
}
m.param = function (a, b) {
var c, d = [], e = function (a, b) {
b = m.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
};
if (void 0 === b && (b = m.ajaxSettings && m.ajaxSettings.traditional), m.isArray(a) || a.jquery && !m.isPlainObject(a))m.each(a, function () {
e(this.name, this.value)
}); else for (c in a)Vc(c, a[c], b, e);
return d.join("&").replace(Qc, "+")
}, m.fn.extend({
serialize: function () {
return m.param(this.serializeArray())
}, serializeArray: function () {
return this.map(function () {
var a = m.prop(this, "elements");
return a ? m.makeArray(a) : this
}).filter(function () {
var a = this.type;
return this.name && !m(this).is(":disabled") && Uc.test(this.nodeName) && !Tc.test(a) && (this.checked || !W.test(a))
}).map(function (a, b) {
var c = m(this).val();
return null == c ? null : m.isArray(c) ? m.map(c, function (a) {
return {name: b.name, value: a.replace(Sc, "\r\n")}
}) : {name: b.name, value: c.replace(Sc, "\r\n")}
}).get()
}
}), m.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function () {
return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Zc() || $c()
} : Zc;
var Wc = 0, Xc = {}, Yc = m.ajaxSettings.xhr();
a.ActiveXObject && m(a).on("unload", function () {
for (var a in Xc)Xc[a](void 0, !0)
}), k.cors = !!Yc && "withCredentials" in Yc, Yc = k.ajax = !!Yc, Yc && m.ajaxTransport(function (a) {
if (!a.crossDomain || k.cors) {
var b;
return {
send: function (c, d) {
var e, f = a.xhr(), g = ++Wc;
if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields)for (e in a.xhrFields)f[e] = a.xhrFields[e];
a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest");
for (e in c)void 0 !== c[e] && f.setRequestHeader(e, c[e] + "");
f.send(a.hasContent && a.data || null), b = function (c, e) {
var h, i, j;
if (b && (e || 4 === f.readyState))if (delete Xc[g], b = void 0, f.onreadystatechange = m.noop, e)4 !== f.readyState && f.abort(); else {
j = {}, h = f.status, "string" == typeof f.responseText && (j.text = f.responseText);
try {
i = f.statusText
} catch (k) {
i = ""
}
h || !a.isLocal || a.crossDomain ? 1223 === h && (h = 204) : h = j.text ? 200 : 404
}
j && d(h, i, j, f.getAllResponseHeaders())
}, a.async ? 4 === f.readyState ? setTimeout(b) : f.onreadystatechange = Xc[g] = b : b()
}, abort: function () {
b && b(void 0, !0)
}
}
}
});
function Zc() {
try {
return new a.XMLHttpRequest
} catch (b) {
}
}
function $c() {
try {
return new a.ActiveXObject("Microsoft.XMLHTTP")
} catch (b) {
}
}
m.ajaxSetup({
accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
contents: {script: /(?:java|ecma)script/},
converters: {
"text script": function (a) {
return m.globalEval(a), a
}
}
}), m.ajaxPrefilter("script", function (a) {
void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1)
}), m.ajaxTransport("script", function (a) {
if (a.crossDomain) {
var b, c = y.head || m("head")[0] || y.documentElement;
return {
send: function (d, e) {
b = y.createElement("script"), b.async = !0, a.scriptCharset && (b.charset = a.scriptCharset), b.src = a.url, b.onload = b.onreadystatechange = function (a, c) {
(c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || e(200, "success"))
}, c.insertBefore(b, c.firstChild)
}, abort: function () {
b && b.onload(void 0, !0)
}
}
}
});
var _c = [], ad = /(=)\?(?=&|$)|\?\?/;
m.ajaxSetup({
jsonp: "callback", jsonpCallback: function () {
var a = _c.pop() || m.expando + "_" + vc++;
return this[a] = !0, a
}
}), m.ajaxPrefilter("json jsonp", function (b, c, d) {
var e, f, g, h = b.jsonp !== !1 && (ad.test(b.url) ? "url" : "string" == typeof b.data && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && ad.test(b.data) && "data");
return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = m.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(ad, "$1" + e) : b.jsonp !== !1 && (b.url += (wc.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () {
return g || m.error(e + " was not called"), g[0]
}, b.dataTypes[0] = "json", f = a[e], a[e] = function () {
g = arguments
}, d.always(function () {
a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, _c.push(e)), g && m.isFunction(f) && f(g[0]), g = f = void 0
}), "script") : void 0
}), m.parseHTML = function (a, b, c) {
if (!a || "string" != typeof a)return null;
"boolean" == typeof b && (c = b, b = !1), b = b || y;
var d = u.exec(a), e = !c && [];
return d ? [b.createElement(d[1])] : (d = m.buildFragment([a], b, e), e && e.length && m(e).remove(), m.merge([], d.childNodes))
};
var bd = m.fn.load;
m.fn.load = function (a, b, c) {
if ("string" != typeof a && bd)return bd.apply(this, arguments);
var d, e, f, g = this, h = a.indexOf(" ");
return h >= 0 && (d = m.trim(a.slice(h, a.length)), a = a.slice(0, h)), m.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (f = "POST"), g.length > 0 && m.ajax({
url: a,
type: f,
dataType: "html",
data: b
}).done(function (a) {
e = arguments, g.html(d ? m("<div>").append(m.parseHTML(a)).find(d) : a)
}).complete(c && function (a, b) {
g.each(c, e || [a.responseText, b, a])
}), this
}, m.expr.filters.animated = function (a) {
return m.grep(m.timers, function (b) {
return a === b.elem
}).length
};
var cd = a.document.documentElement;
function dd(a) {
return m.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1
}
m.offset = {
setOffset: function (a, b, c) {
var d, e, f, g, h, i, j, k = m.css(a, "position"), l = m(a), n = {};
"static" === k && (a.style.position = "relative"), h = l.offset(), f = m.css(a, "top"), i = m.css(a, "left"), j = ("absolute" === k || "fixed" === k) && m.inArray("auto", [f, i]) > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), m.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (n.top = b.top - h.top + g), null != b.left && (n.left = b.left - h.left + e), "using" in b ? b.using.call(a, n) : l.css(n)
}
}, m.fn.extend({
offset: function (a) {
if (arguments.length)return void 0 === a ? this : this.each(function (b) {
m.offset.setOffset(this, a, b)
});
var b, c, d = {top: 0, left: 0}, e = this[0], f = e && e.ownerDocument;
if (f)return b = f.documentElement, m.contains(b, e) ? (typeof e.getBoundingClientRect !== K && (d = e.getBoundingClientRect()), c = dd(f), {
top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0),
left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0)
}) : d
}, position: function () {
if (this[0]) {
var a, b, c = {top: 0, left: 0}, d = this[0];
return "fixed" === m.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), m.nodeName(a[0], "html") || (c = a.offset()), c.top += m.css(a[0], "borderTopWidth", !0), c.left += m.css(a[0], "borderLeftWidth", !0)), {
top: b.top - c.top - m.css(d, "marginTop", !0),
left: b.left - c.left - m.css(d, "marginLeft", !0)
}
}
}, offsetParent: function () {
return this.map(function () {
var a = this.offsetParent || cd;
while (a && !m.nodeName(a, "html") && "static" === m.css(a, "position"))a = a.offsetParent;
return a || cd
})
}
}), m.each({scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function (a, b) {
var c = /Y/.test(b);
m.fn[a] = function (d) {
return V(this, function (a, d, e) {
var f = dd(a);
return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void(f ? f.scrollTo(c ? m(f).scrollLeft() : e, c ? e : m(f).scrollTop()) : a[d] = e)
}, a, d, arguments.length, null)
}
}), m.each(["top", "left"], function (a, b) {
m.cssHooks[b] = Lb(k.pixelPosition, function (a, c) {
return c ? (c = Jb(a, b), Hb.test(c) ? m(a).position()[b] + "px" : c) : void 0
})
}), m.each({Height: "height", Width: "width"}, function (a, b) {
m.each({padding: "inner" + a, content: b, "": "outer" + a}, function (c, d) {
m.fn[d] = function (d, e) {
var f = arguments.length && (c || "boolean" != typeof d), g = c || (d === !0 || e === !0 ? "margin" : "border");
return V(this, function (b, c, d) {
var e;
return m.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? m.css(b, c, g) : m.style(b, c, d, g)
}, b, f ? d : void 0, f, null)
}
})
}), m.fn.size = function () {
return this.length
}, m.fn.andSelf = m.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function () {
return m
});
var ed = a.jQuery, fd = a.$;
return m.noConflict = function (b) {
return a.$ === m && (a.$ = fd), b && a.jQuery === m && (a.jQuery = ed), m
}, typeof b === K && (a.jQuery = a.$ = m), m
});
// Move jQuery to $telerik
$telerik.$ = jQuery.noConflict(true);
/* END Telerik.Web.UI.Common.jQuery.js */
/* START Telerik.Web.UI.Common.Navigation.OverlayScript.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.Overlay = function (a) {
this._targetElement = a;
this._element = null;
};
Telerik.Web.UI.Overlay.IsSupported = function () {
return $telerik.isIE;
};
Telerik.Web.UI.Overlay.prototype = {
initialize: function () {
var a = document.createElement("div");
a.innerHTML = "<iframe>Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>";
this._element = a.firstChild;
this._element.src = "about:blank";
this._targetElement.parentNode.insertBefore(this._element, this._targetElement);
if (this._targetElement.style.zIndex > 0) {
this._element.style.zIndex = this._targetElement.style.zIndex - 1;
}
this._element.style.position = "absolute";
this._element.style.border = "0px";
this._element.frameBorder = 0;
this._element.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
this._element.tabIndex = -1;
if (!$telerik.isSafari && !$telerik.isIE10Mode) {
a.outerHTML = null;
}
this.updatePosition();
}, dispose: function () {
if (this._element.parentNode) {
this._element.parentNode.removeChild(this._element);
}
this._targetElement = null;
this._element = null;
}, get_targetElement: function () {
return this._targetElement;
}, set_targetElement: function (a) {
this._targetElement = a;
}, get_element: function () {
return this._element;
}, updatePosition: function () {
this._element.style.top = this._toUnit(this._targetElement.style.top);
this._element.style.left = this._toUnit(this._targetElement.style.left);
this._element.style.width = this._targetElement.offsetWidth + "px";
this._element.style.height = this._targetElement.offsetHeight + "px";
}, _toUnit: function (a) {
if (!a) {
return "0px";
}
return parseInt(a, 10) + "px";
}
};
Telerik.Web.UI.Overlay.registerClass("Telerik.Web.UI.Overlay", null, Sys.IDisposable);
/* END Telerik.Web.UI.Common.Navigation.OverlayScript.js */
/* START Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.RadDatePickerPopupDirection = function () {
throw Error.invalidOperation();
};
Telerik.Web.RadDatePickerPopupDirection.prototype = {TopLeft: 11, TopRight: 12, BottomLeft: 21, BottomRight: 22};
Telerik.Web.RadDatePickerPopupDirection.registerEnum("Telerik.Web.RadDatePickerPopupDirection");
/* END Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js */
/* START Telerik.Web.UI.Calendar.RadDatePicker.js */
Type.registerNamespace("Telerik.Web.UI");
$telerik.findDatePicker = $find;
$telerik.toDatePicker = function (a) {
return a;
};
Telerik.Web.UI.RadDatePicker = function (a) {
Telerik.Web.UI.RadDatePicker.initializeBase(this, [a]);
this._calendar = null;
this._dateInput = null;
this._popupButton = null;
this._validationInput = null;
this._popupDirection = Telerik.Web.RadDatePickerPopupDirection.BottomRight;
this._enableScreenBoundaryDetection = true;
this._zIndex = null;
this._enableShadows = true;
this._animationSettings = {};
this._popupControlID = null;
this._popupButtonSettings = null;
this._focusedDate = new Date(1980, 0, 1);
this._minDate = new Date(1980, 0, 1);
this._maxDate = new Date(2099, 11, 31);
this._enabled = true;
this._originalDisplay = null;
this._showPopupOnFocus = false;
this._enableAriaSupport = false;
this._onPopupImageMouseOverDelegate = null;
this._onPopupImageMouseOutDelegate = null;
this._onPopupButtonClickDelegate = null;
this._onPopupButtonKeyPressDelegate = null;
this._onDateInputFocusDelegate = null;
this._overlay = false;
this._showPopupOnInit = false;
};
Telerik.Web.UI.RadDatePicker.PopupInstances = {};
if (Telerik.Web.UI.RadDateInputComponent) {
Telerik.Web.UI.RadDatePicker.PopupInstances = Telerik.Web.UI.RadDatePickerComponent.PopupInstances;
}
Telerik.Web.UI.RadDatePicker.prototype = {
initialize: function () {
Telerik.Web.UI.RadDatePicker.callBaseMethod(this, "initialize");
this._initializeDateInput();
this._initializeCalendar();
var b = $get(this.get_id() + "_wrapper");
if (($telerik.isIE7 || $telerik.quirksMode) && b.style.display == "inline-block") {
b.style.display = "inline";
b.style.zoom = 1;
}
if ($telerik.isIE && document.documentMode && document.documentMode > 7 && b.style.display == "inline") {
b.style.display = "inline-block";
this.get_dateInput().repaint();
}
if ($telerik.getCurrentStyle(b, "direction") == "rtl") {
var a = this.get_dateInput()._skin != "" ? String.format(" RadPickerRTL_{0}", this.get_dateInput()._skin) : "";
b.className += String.format(" RadPickerRTL{0}", a);
}
this._refreshPopupShadowSetting();
this.CalendarSelectionInProgress = false;
this.InputSelectionInProgress = false;
if (this.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
if (this._calendar) {
this._calendar._allowAutoPostBackOnNavigateOnly = true;
if (this._showPopupOnInit) {
this._calendar._autoPostBack = false;
this.showPopup();
this._calendar._autoPostBack = true;
}
}
}, dispose: function () {
if (this._calendar != null) {
this.hidePopup();
this._calendar.dispose();
}
if (this._popupButton != null) {
var b = this.get__popupImage();
if (b != null) {
if (this._onPopupImageMouseOverDelegate) {
try {
$removeHandler(b, "mouseover", this._onPopupImageMouseOverDelegate);
} catch (a) {
}
this._onPopupImageMouseOverDelegate = null;
}
if (this._onPopupImageMouseOutDelegate) {
try {
$removeHandler(b, "mouseout", this._onPopupImageMouseOutDelegate);
} catch (a) {
}
this._onPopupImageMouseOutDelegate = null;
}
}
if (this._onPopupButtonClickDelegate) {
try {
$removeHandler(this._popupButton, "click", this._onPopupButtonClickDelegate);
} catch (a) {
}
this._onPopupButtonClickDelegate = null;
}
if (this._onPopupButtonKeyPressDelegate) {
try {
$removeHandler(this._popupButton, "keypress", this._onPopupButtonKeyPressDelegate);
} catch (a) {
}
this._onPopupButtonKeyPressDelegate = null;
}
}
if (this._popupButton) {
this._popupButton._events = null;
}
Telerik.Web.UI.RadDatePicker.callBaseMethod(this, "dispose");
}, clear: function () {
if (this._dateInput) {
this._dateInput.clear();
}
if (this._calendar) {
this._calendar.unselectDates(this._calendar.get_selectedDates());
}
}, _clearHovers: function () {
var b = this.get_popupContainer().getElementsByTagName("td");
for (var a = 0;
a < b.length;
a++) {
if (b[a].className && b[a].className.indexOf("rcHover") != -1) {
b[a].className = b[a].className.replace("rcHover", "");
}
}
}, togglePopup: function () {
if (this.isPopupVisible()) {
this.hidePopup();
} else {
this.showPopup();
}
return false;
}, isPopupVisible: function () {
if (!this._calendar) {
return false;
}
return this.get__popup().IsVisible() && (this.get__popup().Opener == this);
}, showPopup: function (h, j) {
if (this.isPopupVisible() || !this._calendar) {
return;
}
this._actionBeforeShowPopup();
this.get__popup().ExcludeFromHiding = this.get__PopupVisibleControls();
this.hidePopup();
var g = true;
var a = new Telerik.Web.UI.DatePickerPopupOpeningEventArgs(this._calendar, false);
this.raise_popupOpening(a);
if (a.get_cancel() == true) {
return;
}
g = !a.get_cancelCalendarSynchronization();
this._clearHovers();
this.get__popup().Opener = this;
this.get__popup().Show(h, j, this.get_popupContainer());
if (g == true) {
var c = this._dateInput.get_selectedDate();
if (this.isEmpty() || (!c)) {
this._focusCalendar();
} else {
this._setCalendarDate(c);
}
}
if (this._calendar && !this._calendar._linksHandlersAdded) {
var f = this._calendar.get_element().getElementsByTagName("a");
for (var b = 0, d = f.length;
b < d;
b++) {
var e = f[b];
$addHandlers(e, {click: Function.createDelegate(this, this._click)});
}
this._calendar._linksHandlersAdded = true;
}
if ((this._calendar._enableKeyboardNavigation) && (!this._calendar._enableMultiSelect)) {
this._calendar.CurrentViews[0].DomTable.tabIndex = 100;
this._calendar.CurrentViews[0].DomTable.focus();
}
}, _click: function (b) {
var a = (b.srcElement) ? b.srcElement : b.target;
if (a.tagName && a.tagName.toLowerCase() == "a") {
var c = a.getAttribute("href", 2);
if (c == "#" || (location.href + "#" == c)) {
if (b.preventDefault) {
b.preventDefault();
}
return false;
}
}
}, isEmpty: function () {
return this._dateInput.isEmpty();
}, hidePopup: function () {
if (!this.get_calendar()) {
return false;
}
this._hideFastNavigationPopup(this);
var a = Telerik.Web.UI.RadDatePicker.PopupInstances[this.get_calendar().get_id()];
if (a && a.IsVisible()) {
return a.Hide();
}
return true;
}, get_calendar: function () {
return this._calendar;
}, set_calendar: function (a) {
this._calendar = a;
}, get_popupButton: function () {
return this._popupButton;
}, get_dateInput: function () {
return this._dateInput;
}, set_dateInput: function (a) {
this._dateInput = a;
}, get_textBox: function () {
return this._dateInput._textBoxElement;
}, get_popupContainer: function () {
if ((this._popupContainer == null)) {
if (this._popupContainerID) {
this._popupContainer = $get(this._popupContainerID);
} else {
this._popupContainer = null;
}
}
return this._popupContainer;
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (c) {
if (this._enabled != c) {
var a = this.get_popupButton();
var b = this.get__popupImage();
if (c) {
this._enabled = true;
if (this._dateInput) {
this._dateInput.enable();
}
if (this._calendar) {
this._calendar.set_enabled(true);
}
if (a) {
Sys.UI.DomElement.removeCssClass(a, "rcDisabled");
a.setAttribute("href", "#");
}
if (this._onPopupButtonClickDelegate) {
$addHandler(a, "click", this._onPopupButtonClickDelegate);
} else {
if (a) {
this._onPopupButtonClickDelegate = Function.createDelegate(this, this._onPopupButtonClickHandler);
$addHandler(a, "click", this._onPopupButtonClickDelegate);
}
}
if (this._onPopupButtonKeyPressDelegate) {
$addHandler(a, "keypress", this._onPopupButtonKeyPressDelegate);
}
if (this._onPopupImageMouseOverDelegate) {
$addHandler(b, "mouseover", this._onPopupImageMouseOverDelegate);
}
if (this._onPopupImageMouseOutDelegate) {
$addHandler(b, "mouseout", this._onPopupImageMouseOutDelegate);
}
var d = $get(this.get_id() + "_wrapper");
if (d.attributes.disabled) {
d.removeAttribute("disabled");
}
} else {
this.hidePopup();
this._enabled = false;
if (this._dateInput) {
this._dateInput.disable();
}
if (this._onPopupButtonClickDelegate) {
$removeHandler(a, "click", this._onPopupButtonClickDelegate);
}
if (this._onPopupButtonKeyPressDelegate) {
$removeHandler(a, "keypress", this._onPopupButtonKeyPressDelegate);
}
if (this._onPopupImageMouseOverDelegate) {
$removeHandler(b, "mouseover", this._onPopupImageMouseOverDelegate);
}
if (this._onPopupImageMouseOutDelegate) {
$removeHandler(b, "mouseout", this._onPopupImageMouseOutDelegate);
}
if (a) {
Sys.UI.DomElement.addCssClass(a, "rcDisabled");
a.removeAttribute("href");
}
}
this.raisePropertyChanged("enabled");
}
}, get_visible: function () {
var a = $get(this.get_id() + "_wrapper");
if (a.style.display == "none") {
return false;
} else {
return true;
}
}, set_visible: function (a) {
var b = $get(this.get_id() + "_wrapper");
if (a == true && this._originalDisplay != null) {
b.style.display = this._originalDisplay;
this.repaint();
} else {
if (a == false && this.get_visible()) {
this._originalDisplay = b.style.display;
b.style.display = "none";
}
}
}, get_selectedDate: function () {
return this._dateInput.get_selectedDate();
}, set_selectedDate: function (a) {
this._dateInput.set_selectedDate(a);
}, get_minDate: function () {
return this._minDate;
}, set_minDate: function (d) {
var c = this._cloneDate(d);
if (this._minDate.toString() != c.toString()) {
if (!this._dateInput) {
this._minDate = c;
} else {
var a = false;
if (this.isEmpty()) {
a = true;
}
this._minDate = c;
this._dateInput.set_minDate(c);
if (this.get_focusedDate() < c) {
this.set_focusedDate(c);
}
var b = [c.getFullYear(), (c.getMonth() + 1), c.getDate()];
if (this._calendar) {
this._calendar.set_rangeMinDate(b);
}
}
this.updateClientState();
this.raisePropertyChanged("minDate");
}
}, get_minDateStr: function () {
var a = this._minDate.getFullYear().toString();
while (a.length < 4) {
a = "0" + a;
}
return parseInt(this._minDate.getMonth() + 1) + "/" + this._minDate.getDate() + "/" + a + " " + this._minDate.getHours() + ":" + this._minDate.getMinutes() + ":" + this._minDate.getSeconds();
}, get_maxDate: function () {
return this._maxDate;
}, set_maxDate: function (c) {
var b = this._cloneDate(c);
if (this._maxDate.toString() != b.toString()) {
if (!this._dateInput) {
this._maxDate = b;
} else {
this._maxDate = b;
this._dateInput.set_maxDate(b);
if (this.get_focusedDate() > b) {
this.set_focusedDate(b);
}
var a = [b.getFullYear(), (b.getMonth() + 1), b.getDate()];
if (this._calendar) {
this._calendar.set_rangeMaxDate(a);
}
}
this.updateClientState();
this.raisePropertyChanged("maxDate");
}
}, get_maxDateStr: function () {
var a = this._maxDate.getFullYear().toString();
while (a.length < 4) {
a = "0" + a;
}
return parseInt(this._maxDate.getMonth() + 1) + "/" + this._maxDate.getDate() + "/" + a + " " + this._maxDate.getHours() + ":" + this._maxDate.getMinutes() + ":" + this._maxDate.getSeconds();
}, get_focusedDate: function () {
return this._focusedDate;
}, set_focusedDate: function (b) {
var a = this._cloneDate(b);
if (this._focusedDate.toString() != a.toString()) {
this._focusedDate = a;
this.raisePropertyChanged("focusedDate");
}
}, get_showPopupOnFocus: function () {
return this._showPopupOnFocus;
}, set_showPopupOnFocus: function (a) {
this._showPopupOnFocus = a;
}, get_enableAriaSupport: function () {
return this._enableAriaSupport;
}, set_enableAriaSupport: function (a) {
if (this._enableAriaSupport != a) {
this._enableAriaSupport = a;
}
}, repaint: function () {
this._updatePercentageHeight();
}, get_popupDirection: function () {
return this._popupDirection;
}, set_popupDirection: function (a) {
this._popupDirection = a;
}, get_enableScreenBoundaryDetection: function () {
return this._enableScreenBoundaryDetection;
}, set_enableScreenBoundaryDetection: function (a) {
this._enableScreenBoundaryDetection = a;
}, saveClientState: function (a) {
var e = ["minDateStr", "maxDateStr"];
if (a) {
for (var c = 0, d = a.length;
c < d;
c++) {
e[e.length] = a[c];
}
}
var f = {};
var b;
for (var c = 0;
c < e.length;
c++) {
b = e[c];
switch (b) {
case"minDateStr":
f[b] = this.get_minDate().format("yyyy-MM-dd-HH-mm-ss");
break;
case"maxDateStr":
f[b] = this.get_maxDate().format("yyyy-MM-dd-HH-mm-ss");
break;
default:
f[b] = this["get_" + b]();
break;
}
}
return Sys.Serialization.JavaScriptSerializer.serialize(f);
}, _initializeDateInput: function () {
if (this._dateInput != null && (!this._dateInput.get_owner)) {
var a = this;
this._dateInput.get_owner = function () {
return a;
};
this._dateInput.Owner = this;
this._setUpValidationInput();
this._setUpDateInput();
this._propagateRangeValues();
this._initializePopupButton();
}
this._updatePercentageHeight();
}, _updatePercentageHeight: function () {
var b = $get(this.get_id() + "_wrapper");
if (b.style.height.indexOf("%") != -1 && b.offsetHeight > 0) {
var a = 0;
if (this.get_dateInput()._textBoxElement.currentStyle) {
a = parseInt(this.get_dateInput()._textBoxElement.currentStyle.borderTopWidth) + parseInt(this.get_dateInput()._textBoxElement.currentStyle.borderBottomWidth) + parseInt(this.get_dateInput()._textBoxElement.currentStyle.paddingTop) + parseInt(this.get_dateInput()._textBoxElement.currentStyle.paddingBottom);
} else {
if (window.getComputedStyle) {
a = parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement, null).getPropertyValue("border-top-width")) + parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement, null).getPropertyValue("border-bottom-width")) + parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement, null).getPropertyValue("padding-top")) + parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement, null).getPropertyValue("padding-bottom"));
}
}
this.get_dateInput()._textBoxElement.style.height = "1px";
this.get_dateInput()._textBoxElement.style.cssText = this.get_dateInput()._textBoxElement.style.cssText;
this.get_dateInput()._textBoxElement.style.height = b.offsetHeight - a + "px";
if (this.get_dateInput()._originalTextBoxCssText.search(/(^|[^-])height/) != -1) {
this.get_dateInput()._originalTextBoxCssText = this.get_dateInput()._originalTextBoxCssText.replace(/(^|[^-])height(\s*):(\s*)([^;]+);/i, "$1height:" + (b.offsetHeight - a) + "px;");
} else {
this.get_dateInput()._originalTextBoxCssText += "height:" + (b.offsetHeight - a) + "px;";
}
}
}, _initializeCalendar: function () {
if (this._calendar != null) {
this._setUpCalendar();
this._calendar.set_enableMultiSelect(false);
this._calendar.set_useColumnHeadersAsSelectors(false);
this._calendar.set_useRowHeadersAsSelectors(false);
if (this._zIndex) {
this._calendar._zIndex = parseInt(this._zIndex, 10) + 2;
}
this._calendar._enableShadows = this._enableShadows;
if (this._calendar.get_renderMode() == Telerik.Web.UI.RenderMode.Classic) {
this._popupContainerID = this._calendar.get_id() + "_wrapper";
} else {
this._popupContainerID = this._calendar.get_id();
}
}
}, _propagateRangeValues: function () {
if (this.get_minDate().toString() != new Date(1980, 0, 1)) {
this._dateInput._minDate = this.get_minDate();
}
if (this.get_maxDate().toString() != new Date(2099, 11, 31)) {
this._dateInput._maxDate = this.get_maxDate();
}
}, _triggerDomChangeEvent: function () {
this._dateInput._triggerDomEvent("change", this._validationInput);
}, _initializeAriaSupport: function () {
var b = document.getElementById(this.get_id() + "_wrapper");
b.setAttribute("aria-atomic", "true");
var a = document.getElementById(this.get_id() + "_popupButton");
if (a) {
a.setAttribute("role", "button");
a.setAttribute("aria-controls", this.get_calendar().get_id() + "_wrapper");
}
}, _initializePopupButton: function () {
this._popupButton = $get(this._popupControlID);
if (this._popupButton != null) {
this._attachPopupButtonEvents();
}
}, _attachPopupButtonEvents: function () {
var b = this.get__popupImage();
var a = this;
if (b != null) {
if (!this._hasAttribute("onmouseover")) {
this._onPopupImageMouseOverDelegate = Function.createDelegate(this, this._onPopupImageMouseOverHandler);
$addHandler(b, "mouseover", this._onPopupImageMouseOverDelegate);
}
if (!this._hasAttribute("onmouseout")) {
this._onPopupImageMouseOutDelegate = Function.createDelegate(this, this._onPopupImageMouseOutHandler);
$addHandler(b, "mouseout", this._onPopupImageMouseOutDelegate);
}
}
if (this._hasAttribute("href") != null && this._hasAttribute("href") != "" && this._hasAttribute("onclick") == null) {
this._onPopupButtonClickDelegate = Function.createDelegate(this, this._onPopupButtonClickHandler);
$addHandler(this._popupButton, "click", this._onPopupButtonClickDelegate);
}
if (this._popupButton) {
this._onPopupButtonKeyPressDelegate = Function.createDelegate(this, this._onPopupButtonKeyPressHandler);
$addHandler(this._popupButton, "keypress", this._onPopupButtonKeyPressDelegate);
}
}, _onPopupImageMouseOverHandler: function (a) {
this.get__popupImage().src = this._popupButtonSettings.ResolvedHoverImageUrl;
}, _onPopupImageMouseOutHandler: function (a) {
this.get__popupImage().src = this._popupButtonSettings.ResolvedImageUrl;
}, _onPopupButtonClickHandler: function (a) {
this.togglePopup();
a.stopPropagation();
a.preventDefault();
return false;
}, _onPopupButtonKeyPressHandler: function (a) {
if (a.charCode == 32) {
this.togglePopup();
a.stopPropagation();
a.preventDefault();
return false;
}
}, _hasAttribute: function (a) {
return this._popupButton.getAttribute(a);
}, _calendarDateSelected: function (b) {
if (this.InputSelectionInProgress == true) {
return;
}
if (b.IsSelected) {
if (this.hidePopup() == false) {
return;
}
var a = this._getJavaScriptDate(b.get_date());
this.CalendarSelectionInProgress = true;
this._setInputDate(a);
}
}, _actionBeforeShowPopup: function () {
for (var b in Telerik.Web.UI.RadDatePicker.PopupInstances) {
if (Telerik.Web.UI.RadDatePicker.PopupInstances.hasOwnProperty(b)) {
var a = Telerik.Web.UI.RadDatePicker.PopupInstances[b].Opener;
this._hideFastNavigationPopup(a);
Telerik.Web.UI.RadDatePicker.PopupInstances[b].Hide();
}
}
}, _hideFastNavigationPopup: function (b) {
if (b) {
var a = b.get_calendar()._getFastNavigation().Popup;
if (a && a.IsVisible()) {
a.Hide(true);
}
}
}, _setInputDate: function (a) {
this._dateInput.set_selectedDate(a);
}, _getJavaScriptDate: function (b) {
var a = new Date();
a.setFullYear(b[0], b[1] - 1, b[2]);
return a;
}, _onDateInputDateChanged: function (b, a) {
this._setValidatorDate(a.get_newDate());
this._triggerDomChangeEvent();
if (!this.isPopupVisible()) {
return;
}
if (this.isEmpty()) {
this._focusCalendar();
} else {
if (!this.CalendarSelectionInProgress) {
this._setCalendarDate(a.get_newDate());
}
}
}, _focusCalendar: function () {
if (this._showPopupOnInit) {
this._showPopupOnInit = false;
return;
}
this._calendar.unselectDates(this._calendar.get_selectedDates());
var a = [this.get_focusedDate().getFullYear(), this.get_focusedDate().getMonth() + 1, this.get_focusedDate().getDate()];
this._calendar.navigateToDate(a);
}, _setValidatorDate: function (c) {
var d = "";
if (c != null) {
var b = (c.getMonth() + 1).toString();
if (b.length == 1) {
b = "0" + b;
}
var a = c.getDate().toString();
if (a.length == 1) {
a = "0" + a;
}
d = c.getFullYear() + "-" + b + "-" + a;
}
this._validationInput.value = d;
}, _setCalendarDate: function (c) {
var b = [c.getFullYear(), c.getMonth() + 1, c.getDate()];
if (this._calendar._autoPostBack) {
var a = this._calendar.get_selectedDates();
if (a && b.join() == a.join()) {
return;
}
}
var d = (this._calendar.FocusedDate[1] != b[1]) || (this._calendar.FocusedDate[0] != b[0]);
this.InputSelectionInProgress = true;
this._calendar.unselectDates(this._calendar.get_selectedDates());
this._calendar.selectDate(b, d);
this.InputSelectionInProgress = false;
}, _cloneDate: function (b) {
var c = null;
if (!b) {
return null;
}
if (typeof(b.setFullYear) == "function") {
c = [];
c[c.length] = b.getFullYear();
c[c.length] = b.getMonth() + 1;
c[c.length] = b.getDate();
c[c.length] = b.getHours();
c[c.length] = b.getMinutes();
c[c.length] = b.getSeconds();
c[c.length] = b.getMilliseconds();
} else {
if (typeof(b) == "string") {
c = b.split(/-/);
}
}
if (c != null) {
var a = new Date();
a.setDate(1);
a.setFullYear(c[0]);
a.setMonth(c[1] - 1);
a.setDate(c[2]);
a.setHours(c[3]);
a.setMinutes(c[4]);
a.setSeconds(c[5]);
a.setMilliseconds(0);
return a;
}
return null;
}, _setUpValidationInput: function () {
this._validationInput = $get(this.get_id());
}, _setUpDateInput: function () {
this._onDateInputValueChangedDelegate = Function.createDelegate(this, this._onDateInputValueChangedHandler);
this._dateInput.add_valueChanged(this._onDateInputValueChangedDelegate);
this._onDateInputBlurDelegate = Function.createDelegate(this, this._onDateInputBlurHandler);
this._dateInput.add_blur(this._onDateInputBlurDelegate);
this._onDateInputKeyPressDelegate = Function.createDelegate(this, this._onDateInputKeyPressHandler);
this._dateInput.add_keyPress(this._onDateInputKeyPressDelegate);
this._onDateInputFocusDelegate = Function.createDelegate(this, this._onDateInputFocusHandler);
this._dateInput.add_focus(this._onDateInputFocusDelegate);
}, _onDateInputValueChangedHandler: function (b, a) {
this._onDateInputDateChanged(b, a);
this.raise_dateSelected(a);
this.CalendarSelectionInProgress = false;
}, _onDateInputBlurHandler: function (b, a) {
if (!b.get_selectedDate()) {
this._validationInput.value = "";
}
}, _onDateInputFocusHandler: function (b, a) {
if (this._calendar && this.get_showPopupOnFocus()) {
this.showPopup();
}
}, _triggerDomEvent: function (b, d) {
if (!b || b == "" || !d) {
return;
}
if (d.fireEvent && document.createEventObject) {
var c = document.createEventObject();
d.fireEvent(String.format("on{0}", b), c);
} else {
if (d.dispatchEvent) {
var a = true;
var c = document.createEvent("HTMLEvents");
c.initEvent(b, a, true);
d.dispatchEvent(c);
}
}
}, _onDateInputKeyPressHandler: function (b, a) {
if (a.get_keyCode() == 13) {
this._setValidatorDate(b.get_selectedDate());
}
}, _setUpCalendar: function () {
this._onCalendarDateSelectedDelegate = Function.createDelegate(this, this._onCalendarDateSelectedHandler);
this._calendar.add_dateSelected(this._onCalendarDateSelectedDelegate);
}, _onCalendarDateSelectedHandler: function (b, a) {
if (this.isPopupVisible()) {
this._calendarDateSelected(a.get_renderDay());
}
}, get__popupImage: function () {
var b = null;
if (this._popupButton != null) {
var a = this._popupButton.getElementsByTagName("img");
if (a.length > 0) {
b = a[0];
} else {
b = this._popupButton;
}
}
return b;
}, _refreshPopupShadowSetting: function () {
if (!this.get_calendar()) {
return;
}
var a = Telerik.Web.UI.RadDatePicker.PopupInstances[this.get_calendar().get_id()];
if (a && !$telerik.quirksMode) {
this.get__popup().EnableShadows = this._enableShadows;
}
}, get__popup: function () {
var a = Telerik.Web.UI.RadDatePicker.PopupInstances[this.get_calendar().get_id()];
if (!a) {
a = new Telerik.Web.UI.Calendar.Popup();
a._overlay = this._overlay;
if (this._zIndex) {
a.zIndex = this._zIndex;
}
if (!this._enableShadows) {
a.EnableShadows = false;
}
if (this._animationSettings) {
a.ShowAnimationDuration = this._animationSettings.ShowAnimationDuration;
a.ShowAnimationType = this._animationSettings.ShowAnimationType;
a.HideAnimationDuration = this._animationSettings.HideAnimationDuration;
a.HideAnimationType = this._animationSettings.HideAnimationType;
}
a._renderMode = this._renderMode;
Telerik.Web.UI.RadDatePicker.PopupInstances[this._calendar.get_id()] = a;
}
return a;
}, get__PopupVisibleControls: function () {
var a = [this.get_textBox(), this.get_popupContainer()];
if (this._popupButton != null) {
a[a.length] = this._popupButton;
}
return a;
}, get__PopupButtonSettings: function () {
return this._popupButtonSettings;
}, set__PopupButtonSettings: function (a) {
this._popupButtonSettings = a;
}, add_dateSelected: function (a) {
this.get_events().addHandler("dateSelected", a);
}, remove_dateSelected: function (a) {
this.get_events().removeHandler("dateSelected", a);
}, raise_dateSelected: function (a) {
this.raiseEvent("dateSelected", a);
}, add_popupOpening: function (a) {
this.get_events().addHandler("popupOpening", a);
}, remove_popupOpening: function (a) {
this.get_events().removeHandler("popupOpening", a);
}, raise_popupOpening: function (a) {
this.raiseEvent("popupOpening", a);
}, add_popupClosing: function (a) {
this.get_events().addHandler("popupClosing", a);
}, remove_popupClosing: function (a) {
this.get_events().removeHandler("popupClosing", a);
}, raise_popupClosing: function (a) {
this.raiseEvent("popupClosing", a);
}
};
Telerik.Web.UI.RadDatePicker.registerClass("Telerik.Web.UI.RadDatePicker", Telerik.Web.UI.RadWebControl);
/* END Telerik.Web.UI.Calendar.RadDatePicker.js */
/* START Telerik.Web.UI.Input.DateInput.RadDateInputScript.js */
Type.registerNamespace("Telerik.Web.UI.DateParsing");
var dp = Telerik.Web.UI.DateParsing;
with (dp) {
dp.DateEvaluator = function (a) {
this.Buckets = [null, null, null];
if (a != null) {
this.Slots = a.DateSlots;
this.ShortYearCenturyEnd = a.ShortYearCenturyEnd;
} else {
this.Slots = {Year: 2, Month: 0, Day: 1};
this.ShortYearCenturyEnd = 2029;
}
};
DateEvaluator.ParseDecimalInt = function (a) {
return parseInt(a, 10);
};
DateEvaluator.prototype = {
Distribute: function (e) {
var g = e.slice(0, e.length);
while (g.length > 0) {
var f = g.shift();
if (this.IsYear(f)) {
if (this.Buckets[this.Slots.Year] != null) {
var d = this.Buckets[this.Slots.Year];
if (this.IsYear(d)) {
throw new DateParseException();
}
g.unshift(d);
}
this.Buckets[this.Slots.Year] = f;
if (!this.MonthYearOnly) {
var a = this.Buckets[this.Slots.Day];
if (a != null) {
this.Buckets[this.Slots.Day] = null;
g.unshift(a);
}
}
} else {
if (this.IsMonth(f)) {
if (this.Buckets[this.Slots.Month] != null) {
g.unshift(this.Buckets[this.Slots.Month]);
}
this.Buckets[this.Slots.Month] = f;
var a = this.Buckets[this.Slots.Day];
if (a != null && !this.MonthYearOnly) {
this.Buckets[this.Slots.Day] = null;
g.unshift(a);
}
} else {
var b = this.GetFirstAvailablePosition(f, this.Buckets);
if (typeof(b) != "undefined") {
this.Buckets[b] = f;
} else {
if (f.Type == "NUMBER" && this.Buckets[this.Slots.Month] == null && this.Buckets[this.Slots.Day] != null) {
var c = this.Buckets[this.Slots.Day];
if (c.Value <= 12) {
this.Buckets[this.Slots.Day] = f;
this.Buckets[this.Slots.Month] = c;
}
}
}
}
}
}
}, TransformShortYear: function (e) {
if (e < 100) {
var a = this.ShortYearCenturyEnd;
var b = a - 99;
var d = b % 100;
var c = e - d;
if (c < 0) {
c += 100;
}
return b + c;
} else {
return e;
}
}, GetYear: function () {
var a = this.Buckets[this.Slots.Year];
if (a != null) {
var b = DateEvaluator.ParseDecimalInt(a.Value);
if (a.Value.length < 3) {
b = this.TransformShortYear(b);
}
return b;
} else {
return null;
}
}, GetMonth: function () {
if (this.IsYearDaySpecialCase()) {
return null;
} else {
return this.GetMonthIndex();
}
}, GetMonthIndex: function () {
var a = this.Buckets[this.Slots.Month];
if (a != null) {
if (a.Type == "MONTHNAME") {
return a.GetMonthIndex();
} else {
if (a.Type == "NUMBER") {
return DateEvaluator.ParseDecimalInt(a.Value) - 1;
}
}
} else {
return null;
}
}, GetDay: function () {
if (this.IsYearDaySpecialCase()) {
var b = this.Buckets[this.Slots.Month];
return DateEvaluator.ParseDecimalInt(b.Value);
} else {
var a = this.Buckets[this.Slots.Day];
if (a != null) {
return DateEvaluator.ParseDecimalInt(a.Value);
} else {
return null;
}
}
}, IsYearDaySpecialCase: function () {
var a = this.Buckets[this.Slots.Day];
var c = this.Buckets[this.Slots.Year];
var b = this.Buckets[this.Slots.Month];
return (c != null && this.IsYear(c) && b != null && b.Type == "NUMBER" && a == null);
}, IsYear: function (a) {
if (a.Type == "NUMBER") {
var b = DateEvaluator.ParseDecimalInt(a.Value);
return (b > (this.MonthYearOnly ? 12 : 31) && b <= 9999 || a.Value.length == 4);
} else {
return false;
}
}, IsMonth: function (a) {
return a.Type == "MONTHNAME";
}, GetFirstAvailablePosition: function (c, a) {
for (var b = 0;
b < a.length;
b++) {
if (b == this.Slots.Month && c.Type == "NUMBER") {
var d = DateEvaluator.ParseDecimalInt(c.Value);
if (d > 12) {
continue;
}
}
if (a[b] == null) {
return b;
}
}
}, NumericSpecialCase: function (e) {
for (var c = 0;
c < e.length;
c++) {
if (e[c].Type != "NUMBER") {
return false;
}
}
var a = this.Buckets[this.Slots.Day];
var f = this.Buckets[this.Slots.Year];
var d = this.Buckets[this.Slots.Month];
var b = 0;
if (!a) {
b++;
}
if (!f) {
b++;
}
if (!d) {
b++;
}
return (e.length + b != this.Buckets.length);
}, GetDate: function (h, b) {
var g = DateEntry.CloneDate(b);
var f = g.getHours();
if (this.MonthYearOnly) {
this.Buckets[this.Slots.Day] = NumberToken.Create(b.getDate(), null);
}
this.Distribute(h);
if (!this.MonthYearOnly && this.NumericSpecialCase(h)) {
throw new DateParseException();
}
if (this.GetYear() != null && this.GetMonth() != null && this.GetDay() != null) {
g = new Date(this.GetYear(), this.GetMonth(), this.GetDay());
g.setFullYear(this.GetYear());
} else {
var i = this.GetYear();
if (i != null) {
g.setFullYear(i);
}
var e = this.GetMonth();
if (e != null) {
this.SetMonth(g, e);
}
g.setHours(f);
var c = this.GetDay();
if (c != null) {
this.SetDay(g, c);
}
}
var a = g.getHours();
if (f < 3 && a > 20) {
var d = 24 + f - a;
g.setHours(24 + f + d);
}
return g;
}, GetDateFromSingleEntry: function (i, c) {
var h = DateEntry.CloneDate(c);
if (i.Type == "MONTHNAME") {
this.SetMonth(h, i.GetMonthIndex());
} else {
if (i.Type == "WEEKDAYNAME") {
var b = c.getDay();
var f = i.GetWeekDayIndex();
var e = (7 - b + f) % 7;
h.setDate(h.getDate() + e);
} else {
if (this.IsYear(i)) {
var k = this.TransformShortYear(DateEvaluator.ParseDecimalInt(i.Value));
var g = h.getMonth();
h.setFullYear(k);
if (h.getMonth() != g) {
h.setDate(1);
h.setMonth(g);
var a = new Telerik.Web.UI.Input.DatePickerGregorianCalendar();
var d = a.GetDaysInMonth(h);
h.setDate(d);
}
} else {
if (i.Type == "NUMBER") {
var j = DateEvaluator.ParseDecimalInt(i.Value);
if (j > 10000) {
throw new DateParseException();
}
h.setDate(j);
if (h.getMonth() != c.getMonth() || h.getFullYear() != c.getFullYear()) {
throw new DateParseException();
}
} else {
throw new DateParseException();
}
}
}
}
return h;
}, SetMonth: function (d, c) {
d.setMonth(c);
if (d.getMonth() != c) {
d.setDate(1);
d.setMonth(c);
var a = new Telerik.Web.UI.Input.DatePickerGregorianCalendar();
var b = a.GetDaysInMonth(d);
d.setDate(b);
}
}, SetDay: function (e, b) {
var d = e.getMonth();
e.setDate(b);
if (e.getMonth() != d) {
e.setMonth(d);
var a = new Telerik.Web.UI.Input.DatePickerGregorianCalendar();
var c = a.GetDaysInMonth(e);
e.setDate(c);
}
}
};
dp.DateEvaluator.registerClass("Telerik.Web.UI.DateParsing.DateEvaluator");
}
Type.registerNamespace("Telerik.Web.UI.Input");
Telerik.Web.UI.Input.DatePickerGregorianCalendar = function () {
};
Telerik.Web.UI.Input.DatePickerGregorianCalendar.prototype = {
DaysInMonths: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], GetYearDaysCount: function (a) {
var b = a.getFullYear();
return (((b % 4 == 0) && (b % 100 != 0)) || (b % 400 == 0)) ? 366 : 365;
}, GetDaysInMonth: function (a) {
if (this.GetYearDaysCount(a) == 366 && a.getMonth() == 1) {
return 29;
}
return this.DaysInMonths[a.getMonth()];
}
};
Telerik.Web.UI.Input.DatePickerGregorianCalendar.registerClass("Telerik.Web.UI.Input.DatePickerGregorianCalendar");
Type.registerNamespace("Telerik.Web.UI.DateParsing");
Telerik.Web.UI.DateParsing.DateTimeFormatInfo = function (a) {
this._data = a;
this.DayNames = a.DayNames;
this.AbbreviatedDayNames = a.AbbreviatedDayNames;
this.MonthNames = a.MonthNames;
this.AbbreviatedMonthNames = a.AbbreviatedMonthNames;
this.AMDesignator = a.AMDesignator;
this.PMDesignator = a.PMDesignator;
this.DateSeparator = a.DateSeparator;
this.TimeSeparator = a.TimeSeparator;
this.FirstDayOfWeek = a.FirstDayOfWeek;
this.DateSlots = a.DateSlots;
this.ShortYearCenturyEnd = a.ShortYearCenturyEnd;
this.TimeInputOnly = a.TimeInputOnly;
this.MonthYearOnly = a.MonthYearOnly;
};
Telerik.Web.UI.DateParsing.DateTimeFormatInfo.prototype = {
LeadZero: function (a) {
return (a < 0 || a > 9 ? "" : "0") + a;
}, FormatDate: function (f, l) {
if (!f) {
return "";
}
l = l + "";
l = l.replace(/%/ig, "");
var I = "";
var t = 0;
var b = "";
var N = "";
var Q = "" + f.getFullYear();
var B = f.getMonth() + 1;
var e = f.getDate();
var j = f.getDay();
var o = f.getHours();
var A = f.getMinutes();
var J = f.getSeconds();
var S, R, F, D, g, p, n, C, L, a, q, o, z, w, x, v;
var O = new Object();
if (Q.length < 4) {
var G = Q.length;
for (var r = 0;
r < 4 - G;
r++) {
Q = "0" + Q;
}
}
var P = Q.substring(2, 4);
var u = 0 + parseInt(P, 10);
if (u < 10) {
O.y = "" + P.substring(1, 2);
} else {
O.y = "" + P;
}
O.yyyy = Q;
O.yy = P;
O.M = B;
O.MM = this.LeadZero(B);
O.MMM = this.AbbreviatedMonthNames[B - 1];
O.MMMM = this.MonthNames[B - 1];
O.d = e;
O.dd = this.LeadZero(e);
O.dddd = this.DayNames[j];
O.ddd = this.AbbreviatedDayNames[j];
O.H = o;
O.HH = this.LeadZero(o);
if (o == 0) {
O.h = 12;
} else {
if (o > 12) {
O.h = o - 12;
} else {
O.h = o;
}
}
O.hh = this.LeadZero(O.h);
if (o > 11) {
O.tt = this.PMDesignator;
O.t = this.PMDesignator.substring(0, 1);
} else {
O.tt = this.AMDesignator;
O.t = this.AMDesignator.substring(0, 1);
}
O.m = A;
O.mm = this.LeadZero(A);
O.s = J;
O.ss = this.LeadZero(J);
while (t < l.length) {
b = l.charAt(t);
N = "";
if (l.charAt(t) == "'") {
t++;
while ((l.charAt(t) != "'")) {
N += l.charAt(t);
t++;
}
t++;
I += N;
continue;
}
while ((l.charAt(t) == b) && (t < l.length)) {
N += l.charAt(t++);
}
if (O[N] != null) {
I += O[N];
} else {
I += N;
}
}
return I;
}
};
Telerik.Web.UI.DateParsing.DateTimeFormatInfo.registerClass("Telerik.Web.UI.DateParsing.DateTimeFormatInfo");
Type.registerNamespace("Telerik.Web.UI.DateParsing");
var dp = Telerik.Web.UI.DateParsing;
with (dp) {
dp.DateTimeLexer = function (a) {
this.DateTimeFormatInfo = a;
};
var letterRegexString = "[\u0041-\u005a\u0061-\u007a\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u021f\u0222-\u0233\u0250-\u02ad\u02b0-\u02b8\u02bb-\u02c1\u02d0\u02d1\u02e0-\u02e4\u02ee\u037a\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03ce\u03d0-\u03d7\u03da-\u03f3\u0400-\u0481\u048c-\u04c4\u04c7\u04c8\u04cb\u04cc\u04d0-\u04f5\u04f8\u04f9\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u063a\u0640-\u064a\u0671-\u06d3\u06d5\u06e5\u06e6\u06fa-\u06fc\u0710\u0712-\u072c\u0780-\u07a5\u0905-\u0939\u093d\u0950\u0958-\u0961\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a82\u0a85-\u0a8b\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd-\u0ac2\u0ac7\u0acb\u0acd\u0ad0\u0ae0\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b36-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb5\u0bb7-\u0bb9\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cde\u0ce0\u0ce1\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d60\u0d61\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc\u0edd\u0f00\u0f40-\u0f47\u0f49-\u0f6a\u0f88-\u0f8b\u1000-\u1021\u1023-\u1027\u1029\u102a\u1050-\u1055\u10a0-\u10c5\u10d0-\u10f6\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1206\u1208-\u1246\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1286\u1288\u128a-\u128d\u1290-\u12ae\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12ce\u12d0-\u12d6\u12d8-\u12ee\u12f0-\u130e\u1310\u1312-\u1315\u1318-\u131e\u1320-\u1346\u1348-\u135a\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1780-\u17b3\u1820-\u1877\u1880-\u18a8\u1e00-\u1e9b\u1ea0-\u1ef9\u1f00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u207f\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2131\u2133-\u2139\u3005\u3006\u3031-\u3035\u3041-\u3094\u309d\u309e\u30a1-\u30fa\u30fc-\u30fe\u3105-\u312c\u3131-\u318e\u31a0-\u31b7\u3400-\u4db5\u4e00-\u9fa5\ua000-\ua48c\uac00-\ud7a3\uf900-\ufa2d\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe72\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][\u0300-\u034e\u0360-\u0362\u0483-\u0486\u0488\u0489\u0591-\u05a1\u05a3-\u05b9\u05bb-\u05bd\u05bf\u05c1\u05c2\u05c4\u064b-\u0655\u0670\u06d6-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u0901-\u0903\u093c\u093e-\u094d\u0951-\u0954\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a02\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a70\u0a71\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0b01-\u0b03\u0b3c\u0b3e-\u0b43\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b82\u0b83\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c82\u0c83\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0d02\u0d03\u0d3e-\u0d43\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102c-\u1032\u1036-\u1039\u1056-\u1059\u17b4-\u17d3\u18a9\u20d0-\u20e3\u302a-\u302f\u3099\u309a\ufb1e\ufe20-\ufe23]?";
if (navigator.userAgent.indexOf("Safari/") != -1 && /AppleWebKit\/(\d+)/.test(navigator.userAgent)) {
var webKitVersion = parseInt(RegExp.$1, 10);
if (webKitVersion < 416) {
letterRegexString = "";
}
}
DateTimeLexer.LetterMatcher = new RegExp(letterRegexString);
DateTimeLexer.DigitMatcher = new RegExp("[0-9]");
DateTimeLexer.prototype = {
GetTokens: function (a) {
this.Values = [];
this.Characters = a.split("");
this.Current = 0;
var d = this.DateTimeFormatInfo.TimeSeparator;
while (this.Current < this.Characters.length) {
var b = this.ReadCharacters(this.IsNumber);
if (b.length > 0) {
this.Values.push(b);
}
var e = this.ReadCharacters(this.IsLetter);
if (e.length > 0) {
this.Values.push(e);
}
var c = this.ReadCharacters(this.IsSeparator);
if (c.length > 0) {
if (c.toLowerCase() == d.toLowerCase()) {
this.Values.push(c);
}
}
}
return this.CreateTokens(this.Values);
}, IsNumber: function (a) {
return a.match(DateTimeLexer.DigitMatcher);
}, IsLetter: function (a) {
return (this.IsAmPmWithDots(a) || a.match(DateTimeLexer.LetterMatcher));
}, IsAmPmWithDots: function (d) {
var a = this.Characters[this.Current - 1] + d + this.Characters[this.Current + 1] + this.Characters[this.Current + 2];
var b = this.Characters[this.Current - 3] + this.Characters[this.Current - 2] + this.Characters[this.Current - 1] + d;
var c = new RegExp("a.m.|A.M.|p.m.|P.M.");
if (a.match(c) || b.match(c)) {
return true;
}
return false;
}, IsSeparator: function (a) {
return !this.IsNumber(a) && !this.IsLetter(a);
}, ReadCharacters: function (b) {
var c = [];
while (this.Current < this.Characters.length) {
var a = this.Characters[this.Current];
if (b.call(this, a)) {
c.push(a);
this.Current++;
} else {
break;
}
}
return c.join("");
}, CreateTokens: function (b) {
var d = [];
for (var a = 0;
a < b.length;
a++) {
var g = [NumberToken, MonthNameToken, WeekDayNameToken, TimeSeparatorToken, AMPMToken];
for (var c = 0;
c < g.length;
c++) {
var f = g[c];
var e = f.Create(b[a], this.DateTimeFormatInfo);
if (e != null) {
d.push(e);
break;
}
}
}
return d;
}
};
dp.DateTimeLexer.registerClass("Telerik.Web.UI.DateParsing.DateTimeLexer");
dp.Token = function (a, b) {
this.Type = a;
this.Value = b;
};
Token.prototype = {
toString: function () {
return this.Value;
}
};
Token.FindIndex = function (a, c) {
if (c.length < 2) {
return -1;
}
for (var b = 0;
b < a.length;
b++) {
if (a[b].toLowerCase().indexOf(c) == 0) {
return b;
}
}
return -1;
};
dp.Token.registerClass("Telerik.Web.UI.DateParsing.Token");
dp.NumberToken = function (a) {
Telerik.Web.UI.DateParsing.NumberToken.initializeBase(this, ["NUMBER", a]);
};
dp.NumberToken.prototype = {
toString: function () {
return dp.NumberToken.callBaseMethod(this, "toString");
}
};
dp.NumberToken.registerClass("Telerik.Web.UI.DateParsing.NumberToken", dp.Token);
dp.MonthNameToken = function (b, a) {
Telerik.Web.UI.DateParsing.MonthNameToken.initializeBase(this, ["MONTHNAME", b]);
this.DateTimeFormatInfo = a;
};
MonthNameToken.prototype = {
GetMonthIndex: function () {
var a = Token.FindIndex(this.DateTimeFormatInfo.MonthNames, this.Value);
if (a >= 0) {
return a;
} else {
return Token.FindIndex(this.DateTimeFormatInfo.AbbreviatedMonthNames, this.Value);
}
}, toString: function () {
return dp.MonthNameToken.callBaseMethod(this, "toString");
}
};
dp.MonthNameToken.registerClass("Telerik.Web.UI.DateParsing.MonthNameToken", dp.Token);
dp.WeekDayNameToken = function (b, a) {
Telerik.Web.UI.DateParsing.WeekDayNameToken.initializeBase(this, ["WEEKDAYNAME", b]);
this.DateTimeFormatInfo = a;
};
WeekDayNameToken.prototype = {
GetWeekDayIndex: function () {
var a = Token.FindIndex(this.DateTimeFormatInfo.DayNames, this.Value);
if (a >= 0) {
return a;
} else {
return Token.FindIndex(this.DateTimeFormatInfo.AbbreviatedDayNames, this.Value);
}
}, toString: function () {
return dp.WeekDayNameToken.callBaseMethod(this, "toString");
}
};
dp.WeekDayNameToken.registerClass("Telerik.Web.UI.DateParsing.WeekDayNameToken", dp.Token);
NumberToken.Create = function (a) {
var b = parseInt(a, 10);
if (!isNaN(b)) {
return new NumberToken(a);
}
return null;
};
MonthNameToken.Create = function (c, a) {
if (!c) {
return null;
}
var d = c.toLowerCase();
var b = Token.FindIndex(a.MonthNames, d);
if (b < 0) {
b = Token.FindIndex(a.AbbreviatedMonthNames, d);
}
if (b >= 0) {
return new MonthNameToken(d, a);
} else {
return null;
}
};
WeekDayNameToken.Create = function (c, a) {
if (!c) {
return null;
}
var d = c.toLowerCase();
var b = Token.FindIndex(a.DayNames, d);
if (b < 0) {
b = Token.FindIndex(a.AbbreviatedDayNames, d);
}
if (b >= 0) {
return new WeekDayNameToken(d, a);
} else {
return null;
}
return null;
};
dp.TimeSeparatorToken = function (a) {
Telerik.Web.UI.DateParsing.TimeSeparatorToken.initializeBase(this, ["TIMESEPARATOR", a]);
};
TimeSeparatorToken.prototype = {
toString: function () {
return dp.TimeSeparatorToken.callBaseMethod(this, "toString");
}
};
dp.TimeSeparatorToken.registerClass("Telerik.Web.UI.DateParsing.TimeSeparatorToken", dp.Token);
TimeSeparatorToken.Create = function (b, a) {
if (b == a.TimeSeparator) {
return new TimeSeparatorToken(b);
}
};
dp.AMPMToken = function (b, a) {
Telerik.Web.UI.DateParsing.AMPMToken.initializeBase(this, ["AMPM", b]);
this.IsPM = a;
};
AMPMToken.prototype = {
toString: function () {
return dp.AMPMToken.callBaseMethod(this, "toString");
}
};
dp.AMPMToken.registerClass("Telerik.Web.UI.DateParsing.AMPMToken", dp.Token);
AMPMToken.Create = function (b, a) {
var e = b.toLowerCase();
var c = (e == a.AMDesignator.toLowerCase());
var d = (e == a.PMDesignator.toLowerCase());
if (c || d) {
return new AMPMToken(e, d);
}
};
}
Type.registerNamespace("Telerik.Web.UI.DateParsing");
var dp = Telerik.Web.UI.DateParsing;
with (dp) {
dp.DateTimeParser = function (a) {
this.TimeInputOnly = a;
};
DateTimeParser.prototype = {
CurrentIs: function (a) {
return (this.CurrentToken() != null && this.CurrentToken().Type == a);
}, NextIs: function (a) {
return (this.NextToken() != null && this.NextToken().Type == a);
}, FirstIs: function (a) {
return (this.FirstToken() != null && this.FirstToken().Type == a);
}, CurrentToken: function () {
return this.Tokens[this.CurrentTokenIndex];
}, NextToken: function () {
return this.Tokens[this.CurrentTokenIndex + 1];
}, FirstToken: function () {
return this.Tokens[0];
}, StepForward: function (a) {
this.CurrentTokenIndex += a;
}, StepBack: function (a) {
this.CurrentTokenIndex -= a;
}, Parse: function (d) {
if (d.length == 0) {
throw new DateParseException();
}
this.Tokens = d;
this.CurrentTokenIndex = 0;
var a = this.ParseDate();
var c = this.ParseTime();
if (a == null && c == null) {
throw new DateParseException();
}
if (c != null) {
var b = new DateTimeEntry();
b.Date = a || new EmptyDateEntry();
b.Time = c;
return b;
} else {
return a;
}
}, ParseDate: function () {
if (this.TimeInputOnly) {
return new EmptyDateEntry();
}
var a = this.Triplet();
if (a == null) {
a = this.Pair();
}
if (a == null) {
a = this.Month();
}
if (a == null) {
a = this.Number();
}
if (a == null) {
a = this.WeekDay();
}
return a;
}, ParseTime: function () {
var a = this.TimeTriplet();
if (a == null) {
a = this.TimePair();
}
if (a == null) {
a = this.AMPMTimeNumber();
}
if (a == null) {
a = this.TimeNumber();
}
return a;
}, TimeTriplet: function () {
var b = null;
var a = function (c, d) {
return new TimeEntry(c.Tokens.concat(d.Tokens));
};
b = this.MatchTwoRules(this.TimeNumber, this.TimePair, a);
return b;
}, TimePair: function () {
var b = null;
var a = function (c, d) {
return new TimeEntry(c.Tokens.concat(d.Tokens));
};
b = this.MatchTwoRules(this.TimeNumber, this.AMPMTimeNumber, a);
if (b == null) {
b = this.MatchTwoRules(this.TimeNumber, this.TimeNumber, a);
}
return b;
}, TimeNumber: function () {
if (this.CurrentIs("AMPM")) {
this.StepForward(1);
}
if ((this.CurrentIs("NUMBER") && !this.NextIs("AMPM")) || (this.CurrentIs("NUMBER") && this.FirstIs("AMPM"))) {
var a = new TimeEntry([this.CurrentToken()]);
if (this.NextIs("TIMESEPARATOR")) {
this.StepForward(2);
} else {
this.StepForward(1);
}
return a;
}
}, AMPMTimeNumber: function () {
if (this.CurrentIs("NUMBER") && this.FirstIs("AMPM")) {
var a = new TimeEntry([this.CurrentToken(), this.FirstToken()]);
this.StepForward(2);
return a;
}
if (this.CurrentIs("NUMBER") && this.NextIs("AMPM")) {
var a = new TimeEntry([this.CurrentToken(), this.NextToken()]);
this.StepForward(2);
return a;
}
}, Triplet: function () {
var a = null;
a = this.NoSeparatorTriplet();
if (a == null) {
a = this.PairAndNumber();
}
if (a == null) {
a = this.NumberAndPair();
}
return a;
}, NoSeparatorTriplet: function () {
var a = null;
if (this.CurrentIs("NUMBER") && (this.Tokens.length == 1 || this.Tokens.length == 2) && (this.CurrentToken().Value.length == 6 || this.CurrentToken().Value.length == 8)) {
a = new NoSeparatorDateEntry(this.CurrentToken());
this.StepForward(1);
}
return a;
}, Pair: function () {
var b = null;
var a = function (c, d) {
return new PairEntry(c.Token, d.Token);
};
b = this.MatchTwoRules(this.Number, this.Number, a);
if (b == null) {
b = this.MatchTwoRules(this.Number, this.Month, a);
}
if (b == null) {
b = this.MatchTwoRules(this.Month, this.Number, a);
}
return b;
}, PairAndNumber: function () {
var a = function (b, c) {
return new TripletEntry(b.First, b.Second, c.Token);
};
return this.MatchTwoRules(this.Pair, this.Number, a);
}, NumberAndPair: function () {
var a = function (b, c) {
return new TripletEntry(b.Token, c.First, c.Second);
};
return this.MatchTwoRules(this.Number, this.Pair, a);
}, WeekDayAndPair: function () {
var a = function (b, c) {
return c;
};
return this.MatchTwoRules(this.WeekDay, this.Pair, a);
}, MatchTwoRules: function (b, f, c) {
var d = this.CurrentTokenIndex;
var a = b.call(this);
var e = null;
if (a != null) {
e = f.call(this);
if (e != null) {
return c(a, e);
}
}
this.CurrentTokenIndex = d;
}, Month: function () {
if (this.CurrentIs("MONTHNAME")) {
var a = new SingleEntry(this.CurrentToken());
this.StepForward(1);
return a;
} else {
if (this.CurrentIs("WEEKDAYNAME")) {
this.StepForward(1);
var a = this.Month();
if (a == null) {
this.StepBack(1);
}
return a;
}
}
}, WeekDay: function () {
if (this.CurrentIs("WEEKDAYNAME")) {
var a = new SingleEntry(this.CurrentToken());
this.StepForward(1);
return a;
}
}, Number: function () {
if (this.NextIs("TIMESEPARATOR")) {
return null;
}
if (this.CurrentIs("NUMBER")) {
if (this.CurrentToken().Value.length > 4) {
throw new DateParseException();
}
var a = new SingleEntry(this.CurrentToken());
this.StepForward(1);
return a;
} else {
if (this.CurrentIs("WEEKDAYNAME")) {
this.StepForward(1);
var a = this.Number();
if (a == null) {
this.StepBack(1);
}
return a;
}
}
}
};
dp.DateTimeParser.registerClass("Telerik.Web.UI.DateParsing.DateTimeParser");
dp.DateEntry = function (a) {
this.Type = a;
};
DateEntry.CloneDate = function (a) {
return new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), 0);
};
DateEntry.prototype = {
Evaluate: function (a) {
throw new Error("must override");
}
};
dp.DateEntry.registerClass("Telerik.Web.UI.DateParsing.DateEntry");
dp.PairEntry = function (a, b) {
Telerik.Web.UI.DateParsing.PairEntry.initializeBase(this, ["DATEPAIR"]);
this.First = a;
this.Second = b;
};
PairEntry.prototype.Evaluate = function (a, b) {
var d = [this.First, this.Second];
var c = new DateEvaluator(b);
c.MonthYearOnly = b.MonthYearOnly;
return c.GetDate(d, a);
};
dp.PairEntry.registerClass("Telerik.Web.UI.DateParsing.PairEntry", dp.DateEntry);
dp.TripletEntry = function (a, b, c) {
Telerik.Web.UI.DateParsing.TripletEntry.initializeBase(this, ["DATETRIPLET"]);
this.First = a;
this.Second = b;
this.Third = c;
};
TripletEntry.prototype.Evaluate = function (a, b) {
var d = [this.First, this.Second, this.Third];
var c = new DateEvaluator(b);
return c.GetDate(d, a);
};
dp.TripletEntry.registerClass("Telerik.Web.UI.DateParsing.TripletEntry", dp.DateEntry);
dp.SingleEntry = function (a) {
this.Token = a;
Telerik.Web.UI.DateParsing.SingleEntry.initializeBase(this, [a.Type]);
};
SingleEntry.prototype.Evaluate = function (a, b) {
var c = new DateEvaluator(b);
return c.GetDateFromSingleEntry(this.Token, a);
};
dp.SingleEntry.registerClass("Telerik.Web.UI.DateParsing.SingleEntry", dp.DateEntry);
dp.EmptyDateEntry = function (a) {
this.Token = a;
Telerik.Web.UI.DateParsing.EmptyDateEntry.initializeBase(this, ["EMPTYDATE"]);
};
EmptyDateEntry.prototype.Evaluate = function (a, b) {
return a;
};
dp.EmptyDateEntry.registerClass("Telerik.Web.UI.DateParsing.EmptyDateEntry", dp.DateEntry);
dp.DateTimeEntry = function () {
Telerik.Web.UI.DateParsing.DateTimeEntry.initializeBase(this, ["DATETIME"]);
};
DateTimeEntry.prototype.Evaluate = function (a, b) {
var c = new Date();
c.setTime(a.getTime() + (2 * 60 * 60 * 1000));
var d = this.Date.Evaluate(c, b);
return this.Time.Evaluate(d, b);
};
dp.DateTimeEntry.registerClass("Telerik.Web.UI.DateParsing.DateTimeEntry", dp.DateEntry);
dp.TimeEntry = function (a) {
Telerik.Web.UI.DateParsing.TimeEntry.initializeBase(this, ["TIME"]);
this.Tokens = a;
};
TimeEntry.prototype.Evaluate = function (a, b) {
var j = this.Tokens.slice(0, this.Tokens.length);
var e = false;
var d = false;
if (j[j.length - 1].Type == "AMPM") {
d = true;
e = j[j.length - 1].IsPM;
j.pop();
}
if (j[j.length - 1].Value.length > 2) {
var f = j[j.length - 1].Value;
j[j.length - 1].Value = f.substring(0, f.length - 2);
j.push(NumberToken.Create(f.substring(f.length - 2, f.length), b));
}
var h = DateEntry.CloneDate(a);
h.setMinutes(0);
h.setSeconds(0);
h.setMilliseconds(0);
var c, g, i;
if (j.length > 0) {
c = DateEvaluator.ParseDecimalInt(j[0].Value);
}
if (j.length > 1) {
g = DateEvaluator.ParseDecimalInt(j[1].Value);
}
if (j.length > 2) {
i = DateEvaluator.ParseDecimalInt(j[2].Value);
}
if (c != null && c < 24) {
if (c < 12 && e) {
c += 12;
} else {
if ((c == 12) && !e && d) {
c = 0;
}
}
h.setHours(c);
} else {
if (c != null) {
throw new DateParseException();
} else {
h.setHours(0);
}
}
if (g != null && g <= 60) {
h.setMinutes(g);
} else {
if (g != null) {
throw new DateParseException();
}
}
if (i != null && i <= 60) {
h.setSeconds(i);
} else {
if (i != null) {
throw new DateParseException();
}
}
return h;
};
dp.TimeEntry.registerClass("Telerik.Web.UI.DateParsing.TimeEntry", dp.DateEntry);
dp.NoSeparatorDateEntry = function (a) {
Telerik.Web.UI.DateParsing.NoSeparatorDateEntry.initializeBase(this, ["NO_SEPARATOR_DATE"]);
this.Token = a;
};
NoSeparatorDateEntry.prototype.Evaluate = function (a, b) {
var k = this.Token.Value;
var g = [];
if (k.length == 6) {
g[0] = k.substr(0, 2);
g[1] = k.substr(2, 2);
g[2] = k.substr(4, 2);
} else {
if (k.length == 8) {
var c = b.DateSlots;
var f = 0;
for (var d = 0;
d < 3;
d++) {
if (d == c.Year) {
g[g.length] = k.substr(f, 4);
f += 4;
} else {
g[g.length] = k.substr(f, 2);
f += 2;
}
}
} else {
throw new DateParseException();
}
}
var e = new DateTimeLexer();
var h = e.CreateTokens(g);
var j = new TripletEntry(h[0], h[1], h[2]);
return j.Evaluate(a, b);
};
dp.NoSeparatorDateEntry.registerClass("Telerik.Web.UI.DateParsing.NoSeparatorDateEntry", dp.DateEntry);
dp.DateParseException = function () {
this.isDateParseException = true;
this.message = "Invalid date!";
this.constructor = dp.DateParseException;
};
dp.DateParseException.registerClass("Telerik.Web.UI.DateParsing.DateParseException");
}
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.DateInputValueChangedEventArgs = function (b, d, a, c) {
Telerik.Web.UI.DateInputValueChangedEventArgs.initializeBase(this, [b, d]);
this._newDate = a;
this._oldDate = c;
};
Telerik.Web.UI.DateInputValueChangedEventArgs.prototype = {
get_newDate: function () {
return this._newDate;
}, get_oldDate: function () {
return this._oldDate;
}
};
Telerik.Web.UI.DateInputValueChangedEventArgs.registerClass("Telerik.Web.UI.DateInputValueChangedEventArgs", Telerik.Web.UI.InputValueChangedEventArgs);
$telerik.findDateInput = $find;
$telerik.toDateInput = function (a) {
return a;
};
Telerik.Web.UI.RadDateInput = function (a) {
Telerik.Web.UI.RadDateInput.initializeBase(this, [a]);
this._hiddenFormat = "yyyy-MM-dd-HH-mm-ss";
this._dateFormat = null;
this._displayDateFormat = null;
this._dateFormatInfo = null;
this._minDate = new Date(1980, 0, 1);
this._maxDate = new Date(2099, 11, 31);
this._selectionOnFocus = Telerik.Web.UI.SelectionOnFocus.SelectAll;
this._incrementSettings = null;
this._originalValue = "";
this._outOfRangeDate = null;
};
Telerik.Web.UI.RadDateInput.prototype = {
initialize: function () {
Telerik.Web.UI.RadDateInput.callBaseMethod(this, "initialize");
if (this.get_outOfRangeDate() != null) {
this._invalidate();
this.updateCssClass();
this.set_textBoxValue(this.get_outOfRangeDate().format(this.get_displayDateFormat()));
}
}, dispose: function () {
Telerik.Web.UI.RadDateInput.callBaseMethod(this, "dispose");
}, parseDate: function (h, a) {
if (!h) {
return null;
} else {
if (typeof h.getTime === "function") {
return new Date(h);
}
}
try {
var d = new Telerik.Web.UI.DateParsing.DateTimeLexer(this.get_dateFormatInfo());
var g = d.GetTokens(h);
var f = new Telerik.Web.UI.DateParsing.DateTimeParser(this.get_dateFormatInfo().TimeInputOnly);
var c = f.Parse(g);
a = this._getParsingBaseDate(a);
var b = c.Evaluate(a, this.get_dateFormatInfo());
return b;
} catch (e) {
if (e.isDateParseException) {
return null;
} else {
throw e;
}
}
}, isNegative: function () {
return false;
}, get_outOfRangeDate: function () {
return this._outOfRangeDate;
}, set_outOfRangeDate: function (a) {
this._outOfRangeDate = a;
}, _constructDisplayText: function (a) {
if (a && isFinite(a)) {
return this.get_dateFormatInfo().FormatDate(a, this.get_displayDateFormat());
} else {
return "";
}
}, _constructEditText: function (a) {
if (a && isFinite(a)) {
return this.get_dateFormatInfo().FormatDate(a, this.get_dateFormat());
} else {
return "";
}
}, _constructValueFromInitialText: function (a) {
return this._cloneDate(a);
}, get_valueAsString: function () {
if (this._value) {
if (this._value instanceof Date) {
return this._constructValidationText(this._value);
} else {
return this._value.toString();
}
} else {
return "";
}
}, set_selectedDate: function (a) {
this.set_value(this.get_dateFormatInfo().FormatDate(a, this.get_dateFormat()));
}, get_value: function () {
return this._text;
}, get_selectedDate: function () {
if (!this._value) {
return null;
} else {
return new Date(this._value);
}
}, set_value: function (b) {
var a = new Telerik.Web.UI.InputValueChangingEventArgs(b, this._initialValueAsText);
this.raise_valueChanging(a);
if (a.get_cancel() == true) {
this._SetValue(this._initialValueAsText);
return false;
}
if (a.get_newValue()) {
b = a.get_newValue();
}
var b = this.parseDate(b) || b;
this._setNewValue(b);
}, _onTextBoxKeyUpHandler: function (a) {
return;
}, get_minDateStr: function () {
return parseInt(this._minDate.getMonth() + 1) + "/" + this._minDate.getDate() + "/" + this._minDate.getFullYear() + " " + this._minDate.getHours() + ":" + this._minDate.getMinutes() + ":" + this._minDate.getSeconds();
}, get_minDate: function () {
return this._minDate;
}, set_minDate: function (c) {
var b = this._cloneDate(c);
if (b && this._minDate.toString() != b.toString()) {
this._minDate = b;
if (!this._clientID) {
return;
}
this.raisePropertyChanged("minDate");
var a = this.get_selectedDate();
if (a && !this._dateInRange(a)) {
this._invalidate();
this.updateCssClass();
}
this.updateClientState();
}
}, get_maxDate: function () {
return this._maxDate;
}, get_maxDateStr: function () {
return parseInt(this._maxDate.getMonth() + 1) + "/" + this._maxDate.getDate() + "/" + this._maxDate.getFullYear() + " " + this._maxDate.getHours() + ":" + this._maxDate.getMinutes() + ":" + this._maxDate.getSeconds();
}, set_maxDate: function (c) {
var b = this._cloneDate(c);
if (b && this._maxDate.toString() != b.toString()) {
this._maxDate = b;
if (!this._clientID) {
return;
}
this.raisePropertyChanged("maxDate");
var a = this.get_selectedDate();
if (a && !this._dateInRange(a)) {
this._invalidate();
this.updateCssClass();
}
this.updateClientState();
}
}, get_dateFormat: function () {
return this._dateFormat;
}, set_dateFormat: function (a) {
if (this._dateFormat != a) {
this._dateFormat = a;
this.raisePropertyChanged("dateFormat");
}
}, get_displayDateFormat: function () {
return this._displayDateFormat;
}, set_displayDateFormat: function (a) {
if (this._displayDateFormat != a) {
this._displayDateFormat = a;
this.raisePropertyChanged("displayDateFormat");
}
}, get_dateFormatInfo: function () {
return this._dateFormatInfo;
}, set_dateFormatInfo: function (a) {
this._dateFormatInfo = new Telerik.Web.UI.DateParsing.DateTimeFormatInfo(a);
}, get_incrementSettings: function () {
return this._incrementSettings;
}, set_incrementSettings: function (a) {
if (this._incrementSettings !== a) {
this._incrementSettings = a;
this.raisePropertyChanged("incrementSettings");
}
}, saveClientState: function () {
return Telerik.Web.UI.RadDateInput.callBaseMethod(this, "saveClientState");
}, saveCustomClientStateValues: function (a) {
a.minDateStr = this.get_minDate().format(this._hiddenFormat);
a.maxDateStr = this.get_maxDate().format(this._hiddenFormat);
Telerik.Web.UI.RadDateInput.callBaseMethod(this, "saveCustomClientStateValues", [a]);
}, _onFormResetHandler: function (a) {
var b = this._constructValueFromInitialText(this._originalInitialValueAsText);
var c = this._errorHandlingCanceled;
this._errorHandlingCanceled = true;
this._setHiddenValue(b);
this._initialValueAsText = this._text;
this.set_displayValue(this._constructDisplayText(this._value));
this.updateClientState();
this.updateCssClass();
this._errorHandlingCanceled = c;
}, _onTextBoxKeyDownHandler: function (a) {
if (!this.get_incrementSettings().InterceptArrowKeys) {
return;
}
if (a.altKey || a.ctrlKey) {
return true;
}
if (a.keyCode == 38) {
if (a.preventDefault) {
a.preventDefault();
}
return this._move(this.get_incrementSettings().Step, false);
}
if (a.keyCode == 40) {
if (a.preventDefault) {
a.preventDefault();
}
return this._move(-this.get_incrementSettings().Step, false);
}
}, _updateHiddenValueOnKeyPress: function (a) {
if (a.charCode == 13) {
Telerik.Web.UI.RadDateInput.callBaseMethod(this, "_updateHiddenValueOnKeyPress", [a]);
}
}, _handleWheel: function (a) {
if (!this.get_incrementSettings().InterceptMouseWheel) {
return;
}
var b = (a) ? -this.get_incrementSettings().Step : this.get_incrementSettings().Step;
return this._move(b, false);
}, _move: function (g, f) {
if (this.isReadOnly()) {
return false;
}
var a = this.parseDate(this._textBoxElement.value);
if (!a) {
return false;
}
if (!this.get_selectedDate()) {
this._updateHiddenValue();
}
var b = this._getReplacedFormat(a);
var e = this._getCurrentDatePart(b);
switch (e) {
case"y":
a.setFullYear(a.getFullYear() + g);
break;
case"M":
var d = a.getMonth();
a.setMonth(a.getMonth() + g);
if ((d + 12 + g % 12) % 12 != a.getMonth()) {
a.setDate(0);
}
break;
case"d":
a.setDate(a.getDate() + g);
break;
case"h":
a.setHours(a.getHours() + g);
break;
case"H":
a.setHours(a.getHours() + g);
break;
case"m":
a.setMinutes(a.getMinutes() + g);
break;
case"s":
a.setSeconds(a.getSeconds() + g);
break;
case"t":
a.setHours((a.getHours() + 12) % 24);
break;
default:
break;
}
if ((this.get_maxDate() < a) || (this.get_minDate() > a)) {
return false;
}
if (!f) {
this._SetValue(a);
} else {
this.set_value(a);
}
var c = this._getReplacedFormat(a);
this.set_caretPosition(c.indexOf(e));
return true;
}, _getReplacedFormat: function (a) {
var d = this.get_dateFormat();
var b = new Array({part: "y", value: a.getFullYear()}, {part: "M", value: a.getMonth() + 1}, {
part: "d",
value: a.getDate()
}, {part: "h", value: a.getHours() % 12 == 0 ? 12 : a.getHours() % 12}, {
part: "H",
value: a.getHours()
}, {part: "m", value: a.getMinutes()}, {part: "s", value: a.getSeconds()});
var e;
for (e = 0;
e < b.length;
e++) {
var h = b[e].part;
var l = new RegExp(h, "g");
var j = new RegExp(h);
var k = new RegExp(h + h);
var g = h + h;
if (d.match(j) && !d.match(k) && b[e].value.toString().length > 1) {
d = d.replace(l, g);
}
}
if (d.match(/MMMM/)) {
var f = this.get_dateFormatInfo().MonthNames[this.get_selectedDate().getMonth()];
var e;
var g = "";
for (e = 0;
e < f.length;
e++) {
g += "M";
}
d = d.replace(/MMMM/, g);
}
if (d.match(/dddd/)) {
var c = this.get_dateFormatInfo().DayNames[this.get_selectedDate().getDay()];
var e;
var g = "";
for (e = 0;
e < c.length;
e++) {
g += "d";
}
d = d.replace(/dddd/, g);
}
return d;
}, _getCurrentDatePart: function (a) {
var b = "";
var c = "yhMdhHmst";
while (((c.indexOf(b) == (-1)) || b == "")) {
this._calculateSelection();
b = a.substring(this._selectionStart, this._selectionStart + 1);
this.selectText(this._selectionStart - 1, this._selectionEnd - 1);
}
return b;
}, _getParsingBaseDate: function (a) {
var b = a;
if (b == null) {
b = new Date();
}
b.setHours(0, 0, 0, 0);
if (this._compareDates(b, this.get_minDate()) < 0) {
b = new Date(this.get_minDate());
b.setHours(0, 0, 0, 0);
} else {
if (this._compareDates(b, this.get_maxDate()) > 0) {
b = new Date(this.get_maxDate());
}
}
return b;
}, _cloneDate: function (b) {
var c = null;
if (!b) {
return null;
}
if (typeof(b.setFullYear) == "function") {
c = [];
c[c.length] = b.getFullYear();
c[c.length] = b.getMonth() + 1;
c[c.length] = b.getDate();
c[c.length] = b.getHours();
c[c.length] = b.getMinutes();
c[c.length] = b.getSeconds();
c[c.length] = b.getMilliseconds();
} else {
if (typeof(b) == "string") {
c = b.split(/-/);
}
}
if (c != null) {
var a = new Date();
a.setDate(1);
a.setFullYear(c[0]);
a.setMonth(c[1] - 1);
a.setDate(c[2]);
a.setHours(c[3]);
a.setMinutes(c[4]);
a.setSeconds(c[5]);
a.setMilliseconds(0);
return a;
}
return null;
}, _setHiddenValue: function (f) {
if ((f && this._value && f - this._value == 0) || f == this._value || !f && this._value == "" || f == "" && !this._value) {
return false;
}
if (f != "" && f) {
var b = this.parseDate(f);
if (b && this.Owner && this.Owner.constructor.getName() == "Telerik.Web.UI.RadMonthYearPicker") {
var e = this.Owner;
var d = e.get_minDate();
var c = e.get_maxDate();
if (b > c) {
b = c;
}
if (b < d) {
b = d;
}
}
if (b == null) {
var a = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.ParseError, f);
b = this._resolveDateError(a, null);
if (a.get_cancel()) {
return true;
}
}
if (b == null && !this._errorHandlingCanceled) {
return this._invalidate();
}
if (!this._dateInRange(b)) {
var a = new Telerik.Web.UI.InputErrorEventArgs(Telerik.Web.UI.InputErrorReason.OutOfRange, f);
b = this._resolveDateError(a, b);
if (a.get_cancel()) {
return true;
}
}
if (!this._dateInRange(b) && !this._errorHandlingCanceled) {
return this._invalidate();
}
this._value = b;
this._text = this._constructEditText(b);
this.set_validationText(this._constructValidationText(b));
return true;
} else {
this._value = "";
this._text = this._constructEditText("");
this.set_validationText("");
return true;
}
}, _constructValidationText: function (a) {
return this.get_dateFormatInfo().FormatDate(a, this._hiddenFormat);
}, _resolveDateError: function (a, c) {
var d = this.get_selectedDate();
this.raise_error(a);
var b = this.get_selectedDate();
if (b - d != 0) {
return b;
} else {
return c;
}
}, _dateInRange: function (a) {
return (this._compareDates(a, this.get_minDate()) >= 0) && (this._compareDates(a, this.get_maxDate()) <= 0);
}, _compareDates: function (a, b) {
return a - b;
}, raise_valueChanged: function (c, e) {
var f = false;
var b = this.parseDate(c);
var d = this.parseDate(e);
if (b || d) {
if (!b || !d || b.toString() != d.toString()) {
var a = new Telerik.Web.UI.DateInputValueChangedEventArgs(c, e, b, d);
this.raiseEvent("valueChanged", a);
f = !a.get_cancel();
} else {
f = this._isEnterPressed;
}
}
if (this.get_autoPostBack() && f && this._canAutoPostBackAfterValidation()) {
this._raisePostBackEventIsCalled = true;
this.raisePostBackEvent();
}
}, _isValidatorAttached: function (a) {
return a && a.controltovalidate && (a.controltovalidate == this.get_id() || (this.Owner && a.controltovalidate == this.Owner.get_id()));
}, _initializeAriaSupport: function () {
Telerik.Web.UI.RadDateInput.callBaseMethod(this, "_initializeAriaSupport");
var a = this.get_wrapperElement();
if (this.get_maxDate()) {
a.setAttribute("aria-valuemax", this.get_maxDateStr());
}
if (this.get_minDate()) {
a.setAttribute("aria-valuemin", this.get_minDateStr());
}
}
};
Telerik.Web.UI.RadDateInput.registerClass("Telerik.Web.UI.RadDateInput", Telerik.Web.UI.RadInputControl);
/* END Telerik.Web.UI.Input.DateInput.RadDateInputScript.js */
/* START Telerik.Web.UI.Calendar.RadCalendarScript.js */
Type.registerNamespace("Telerik.Web.UI");
$telerik.findCalendar = $find;
$telerik.toCalendar = function (a) {
return a;
};
Telerik.Web.UI.RadCalendar = function (a) {
Telerik.Web.UI.RadCalendar.initializeBase(this, [a]);
this._formatInfoArray = null;
this._specialDaysArray = null;
this._viewsHash = null;
this._monthYearNavigationSettings = null;
this._stylesHash = null;
this._dayRenderChangedDays = null;
this._viewRepeatableDays = null;
this._postBackCall = null;
this._firstDayOfWeek = null;
this._skin = null;
this._calendarWeekRule = null;
this._culture = null;
this._zIndex = null;
this._enableShadows = true;
this._nextFocusedCell = null;
this._hoveredDate = null;
this._hoveredDateTriplet = null;
this._documentKeyDownDelegate = null;
this._enabled = true;
this._useColumnHeadersAsSelectors = true;
this._useRowHeadersAsSelectors = true;
this._showOtherMonthsDays = true;
this._enableMultiSelect = true;
this._singleViewColumns = 7;
this._singleViewRows = 6;
this._multiViewColumns = 1;
this._multiViewRows = 1;
this._fastNavigationStep = 3;
this._enableNavigationAnimation = false;
this._cellDayFormat = "%d";
this._presentationType = Telerik.Web.UI.Calendar.PresentationType.Interactive;
this._orientation = Telerik.Web.UI.Calendar.Orientation.RenderInRows;
this._titleFormat = "MMMM yyyy";
this._dayCellToolTipFormat = "dddd, MMMM dd, yyyy";
this._showDayCellToolTips = true;
this._dateRangeSeparator = " - ";
this._autoPostBack = false;
this._calendarEnableNavigation = true;
this._calendarEnableMonthYearFastNavigation = true;
this._enableRepeatableDaysOnClient = true;
this._enableViewSelector = false;
this._enableKeyboardNavigation = false;
this._enableAriaSupport = false;
this._showRowHeaders = false;
this._navigateFromLinksButtons = true;
this._rangeSelectionStartDate = null;
this._rangeSelectionEndDate = null;
this._rangeSelectionMode = {};
this._hideNavigationControls = false;
this._overlay = false;
this._onLoadDelegate = null;
this._renderMode = Telerik.Web.UI.RenderMode.Classic;
};
Telerik.Web.UI.RadCalendar.prototype = {
initialize: function () {
Telerik.Web.UI.RadCalendar.callBaseMethod(this, "initialize");
this.EnableTodayButtonSelection = (this.get_monthYearNavigationSettings()[4] == "False") ? false : true;
this.DateTimeFormatInfo = new Telerik.Web.UI.Calendar.DateTimeFormatInfo(this.get__FormatInfoArray());
this.DateTimeFormatInfo.Calendar = Telerik.Web.UI.Calendar.GregorianCalendar;
this.DateTimeFormatInfo.CalendarWeekRule = this._calendarWeekRule;
var e, f, r;
var c = this._auxDatesHidden();
var a = eval(c.value);
this.RangeMinDate = a[0];
this.RangeMaxDate = a[1];
this.FocusedDate = a[2];
this.SpecialDays = new Telerik.Web.UI.Calendar.DateCollection();
for (e = 0;
e < this.get_specialDaysArray().length;
e++) {
var m = new Telerik.Web.UI.Calendar.RenderDay(this.get_specialDaysArray()[e]);
this.SpecialDays.Add(m.get_date(), m);
}
this.RecurringDays = new Telerik.Web.UI.Calendar.DateCollection();
for (var n in this.get__ViewRepeatableDays()) {
if (!this.get__ViewRepeatableDays().hasOwnProperty(n)) {
continue;
}
var d = n.split("_");
var p = this.get__ViewRepeatableDays()[n].split("_");
var q = this.SpecialDays.Get(p);
this.RecurringDays.Add(d, q);
}
this.RangeValidation = new Telerik.Web.UI.Calendar.RangeValidation(this.RangeMinDate, this.RangeMaxDate);
this.Selection = new Telerik.Web.UI.Calendar.Selection(this.RangeValidation, this.SpecialDays, this.RecurringDays, this.get_enableMultiSelect());
var t = [];
for (var s in this.get__ViewsHash()) {
if (!this.get__ViewsHash().hasOwnProperty(s)) {
continue;
}
t[t.length] = s;
}
this._topViewID = t[0];
this._titleID = this.get_id() + "_Title";
var o = this._selectedDatesHidden();
var b = eval(o.value);
for (e = 0;
e < b.length;
e++) {
this.Selection.Add(b[e]);
}
this._lastSelectedDate = null;
this._calendarDomObject = $get(this.get_id());
this._viewIDs = t;
this._initViews();
this._enableNavigation(this._isNavigationEnabled());
this._attachEventHandlers();
$addHandlers(this.get_element(), {click: Function.createDelegate(this, this._click)});
if ($telerik.isRightToLeft(this.get_element())) {
if (this.get_multiViewColumns() > 1 || this.get_multiViewRows() > 1) {
Sys.UI.DomElement.addCssClass(this.get_element(), String.format("RadCalendarRTL_{0} RadCalendarMultiViewRTL_{0}", this.get_skin()));
} else {
Sys.UI.DomElement.addCssClass(this.get_element(), String.format("RadCalendarRTL_{0}", this.get_skin()));
}
}
this.raise_init(Sys.EventArgs.Empty);
if (this._enableKeyboardNavigation && !this._enableMultiSelect) {
this._documentKeyDownDelegate = Function.createDelegate(this, this._documentKeyDown);
$telerik.addExternalHandler(document, "keydown", this._documentKeyDownDelegate);
}
if (this.get_enableAriaSupport()) {
this._initializeAriaSupport();
}
var k = this._selectedRangeDatesHidden();
if (k) {
var g = eval(k.value);
var l = g[0];
var h = g[1];
if (!(l[0] == "1980" && l[1] == "1" && l[2] == "1")) {
this._rangeSelectionStartDate = new Date(l[0], l[1] - 1, l[2]);
}
if (!(h[0] == "2099" && h[1] == "12" && h[2] == "30")) {
this._rangeSelectionEndDate = new Date(h[0], h[1] - 1, h[2]);
}
}
}, dispose: function () {
if (this.get_element()) {
$clearHandlers(this.get_element());
}
if (!this.disposed) {
this.disposed = true;
this._destroyViews();
this._calendarDomObject = null;
if (this.MonthYearFastNav) {
this.MonthYearFastNav.dispose();
}
if (this.SpecialDays) {
this.SpecialDays.Clear();
this.SpecialDays = null;
}
if (this.RecurringDays) {
this.RecurringDays.Clear();
this.RecurringDays = null;
}
this.Selection = null;
this.RangeValidation = null;
this.DateTimeFormatInfo = null;
}
if (this._documentKeyDownDelegate) {
$telerik.removeExternalHandler(document, "keydown", this._documentKeyDownDelegate);
this._documentKeyDownDelegate = null;
}
if (this._onLoadDelegate) {
Sys.Application.remove_load(this._onLoadDelegate);
this._onLoadDelegate = null;
}
Telerik.Web.UI.RadCalendar.callBaseMethod(this, "dispose");
}, _click: function (b) {
var a = (b.srcElement) ? b.srcElement : b.target;
if (a.tagName && a.tagName.toLowerCase() == "a") {
var c = a.getAttribute("href", 2);
if (c == "#" || (location.href + "#" == c)) {
if (b.preventDefault) {
b.preventDefault();
}
return false;
}
}
}, _documentKeyDown: function (a) {
if (this._enableKeyboardNavigation) {
a = a || window.event;
if (a.ctrlKey && a.keyCode == 89) {
try {
this.CurrentViews[0].DomTable.tabIndex = 100;
this.CurrentViews[0].DomTable.focus();
return false;
} catch (b) {
return false;
}
}
}
}, get_enableAriaSupport: function () {
return this._enableAriaSupport;
}, _initializeAriaSupport: function () {
var m = this.get_element();
var n = document.getElementById(m.id + "_Title");
m.setAttribute("role", "grid");
m.setAttribute("aria-atomic", "true");
m.setAttribute("aria-labelledby", n.id);
n.setAttribute("aria-live", "assertive");
n.parentNode.parentNode.parentNode.setAttribute("role", "presentation");
var c = document.getElementById(this.get_id() + "_Top");
if (this.get_enableMultiSelect()) {
c.setAttribute("aria-multiselectable", "true");
}
var l = c.rows;
for (var f = 0;
f < l.length;
f++) {
var k = l[f];
k.setAttribute("role", "row");
var b = k.cells;
for (var g = 0;
g < b.length;
g++) {
var a = b[g];
a.setAttribute("role", "gridcell");
}
}
var e = m.getElementsByTagName("th");
for (var f = 0, h = e.length;
f < h;
f++) {
var d = e[f];
if (d.scope === "col") {
d.setAttribute("role", "columnheader");
} else {
if (d.scope === "row") {
d.setAttribute("role", "rowheader");
}
}
}
this._initializeAriaForCalendarDays();
}, _initializeAriaForCalendarDays: function () {
var k = this.get_element();
var g = k.getElementsByTagName("a");
for (var d = 0, e = g.length;
d < e;
d++) {
var f = g[d];
f.tabIndex = -1;
f.setAttribute("role", "presentation");
}
var j = this.get_selectedDates();
if (!j.length) {
var b = this.get_focusedDate();
if (b) {
var a = this._hoveredDate;
var c = new Date(b[0], b[1] - 1, b[2]);
if (a && (a - c) !== 0) {
b = [a.getFullYear(), a.getMonth() + 1, a.getDate()];
}
this._activateDate(b);
}
} else {
for (var d = 0, e = j.length;
d < e;
d++) {
var h = this._findRenderDay(j[d]);
if (h) {
var f = h.DomElement.getElementsByTagName("a")[0];
h.DomElement.setAttribute("aria-selected", true);
if (f) {
f.tabIndex = 0;
}
}
}
}
}, _activateDate: function (a) {
var c = this._findRenderDay(a);
if (c && c.DomElement) {
this._nextFocusedCell = c.DomElement;
this._hoveredDateTriplet = a;
this._hoveredDate = new Date(a[0], a[1] - 1, a[2]);
c.RadCalendarView._addClassAndGetFocus(this._nextFocusedCell, c.RadCalendarView.DomTable);
if (this.get_enableAriaSupport()) {
var b = c.DomElement.getElementsByTagName("a")[0];
if (b) {
b.tabIndex = 0;
}
}
return true;
}
return false;
}, selectDate: function (a, b) {
if (this.EnableDateSelect == false) {
return false;
}
this._performDateSelection(a, true, b);
}, selectDates: function (a, c) {
if (false == this.EnableDateSelect) {
return false;
}
for (var b = 0;
b < a.length;
b++) {
this._performDateSelection(a[b], true, false, false);
}
if (c || c == null) {
this.navigateToDate(a[a.length - 1]);
}
}, unselectDate: function (a) {
if (false == this.EnableDateSelect) {
return false;
}
this._performDateSelection(a, false, false);
}, unselectDates: function (a) {
if ((false == this.EnableDateSelect) || (!a) || (!a.length > 0)) {
return false;
}
for (var b = 0;
b < a.length;
b++) {
this._performDateSelection(a[b], false, false, true);
}
this._submit("d");
}, calculateDateFromStep: function (b) {
var c = this.CurrentViews ? this.CurrentViews[0] : null;
if (!c) {
return;
}
var a = (b < 0 ? c._MonthStartDate : c._MonthEndDate);
a = this.DateTimeFormatInfo.Calendar.AddDays(a, b);
return a;
}, navigateToDate: function (a) {
if (this.RangeValidation && !this.RangeValidation.IsDateValid(a)) {
a = this._getBoundaryDate(a);
if (a == null) {
if (this._getFastNavigation().DateIsOutOfRangeMessage != null && this._getFastNavigation().DateIsOutOfRangeMessage != " ") {
alert(this._getFastNavigation().DateIsOutOfRangeMessage);
}
return;
}
}
var b = this._getStepFromDate(a);
this._navigate(b);
}, GetSelectedDates: function () {
return this.get_selectedDates();
}, GetRangeMinDate: function () {
return this.get_rangeMinDate();
}, SetRangeMinDate: function (a) {
this.set_rangeMinDate(a);
}, GetRangeMaxDate: function () {
return this.get_rangeMaxDate();
}, SetRangeMaxDate: function (a) {
this.set_rangeMaxDate(a);
}, get_selectedDates: function () {
return this.Selection._selectedDates.GetValues();
}, get_rangeMinDate: function () {
return this.RangeMinDate;
}, set_rangeMinDate: function (a) {
if (this.RangeValidation.CompareDates(a, this.RangeMaxDate) > 0) {
alert("RangeMinDate should be less than the RangeMaxDate value!");
return;
}
var c = this.RangeMinDate;
this.RangeMinDate = a;
this.RangeValidation._rangeMinDate = a;
this.MonthYearFastNav = null;
var b = [this.FocusedDate[0], this.FocusedDate[1], 1];
if (this.RangeValidation.CompareDates(b, this.RangeMinDate) <= 0 || this.RangeValidation.InSameMonth(b, c) || this.RangeValidation.InSameMonth(b, this.RangeMinDate)) {
if (!this.RangeValidation.IsDateValid(this.FocusedDate)) {
this.FocusedDate = a.slice();
}
this._moveToDate(this.FocusedDate, true);
}
this._serializeAuxDates();
this._updateSelectedDates();
}, get_rangeMaxDate: function () {
return this.RangeMaxDate;
}, set_rangeMaxDate: function (a) {
if (this.RangeValidation.CompareDates(a, this.RangeMinDate) < 0) {
alert("RangeMaxDate should be greater than the RangeMinDate value!");
return;
}
var c = this.RangeMaxDate;
this.RangeMaxDate = a;
this.RangeValidation._rangeMaxDate = a;
this.MonthYearFastNav = null;
var b = [this.FocusedDate[0], this.FocusedDate[1], 1];
if (this.RangeValidation.CompareDates(b, this.RangeMaxDate) > 0 || this.RangeValidation.InSameMonth(b, c) || this.RangeValidation.InSameMonth(b, this.RangeMaxDate)) {
if (!this.RangeValidation.IsDateValid(this.FocusedDate)) {
this.FocusedDate = a.slice();
}
this._moveToDate(this.FocusedDate, true);
}
this._serializeAuxDates();
this._updateSelectedDates();
}, get_focusedDate: function () {
return this.FocusedDate;
}, set_focusedDate: function (a) {
this.FocusedDate = a;
}, get_specialDaysArray: function () {
return this._specialDaysArray;
}, set_specialDaysArray: function (a) {
if (this._specialDaysArray !== a) {
this._specialDaysArray = a;
this.raisePropertyChanged("specialDaysArray");
}
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (a) {
if (this._enabled !== a) {
this._enabled = a;
if (this.RangeValidation) {
this._moveToDate(this.FocusedDate, true);
}
this.raisePropertyChanged("enabled");
}
}, get_useColumnHeadersAsSelectors: function () {
return this._useColumnHeadersAsSelectors;
}, set_useColumnHeadersAsSelectors: function (a) {
if (this._useColumnHeadersAsSelectors !== a) {
this._useColumnHeadersAsSelectors = a;
this.raisePropertyChanged("useColumnHeadersAsSelectors");
}
}, get_useRowHeadersAsSelectors: function () {
return this._useRowHeadersAsSelectors;
}, set_useRowHeadersAsSelectors: function (a) {
if (this._useRowHeadersAsSelectors !== a) {
this._useRowHeadersAsSelectors = a;
this.raisePropertyChanged("useRowHeadersAsSelectors");
}
}, get_showOtherMonthsDays: function () {
return this._showOtherMonthsDays;
}, set_showOtherMonthsDays: function (a) {
if (this._showOtherMonthsDays !== a) {
this._showOtherMonthsDays = a;
this.raisePropertyChanged("showOtherMonthsDays");
}
}, get_enableMultiSelect: function () {
return this._enableMultiSelect;
}, set_enableMultiSelect: function (f) {
if (this._enableMultiSelect !== f) {
this._enableMultiSelect = f;
var e = this.Selection;
if (e) {
e._enableMultiSelect = f;
var c = e._selectedDates;
if (c && c.Count() > 0) {
this._removeAllSelectedDatesStyle();
var c = e._selectedDates;
var a;
if (c._lastInsertedKey) {
a = c.Get(c._lastInsertedKey);
} else {
var d = c.Count();
a = c.GetValues()[d - 1];
}
c.Clear();
e.Add(a);
var b = this._findRenderDay(a);
if (b != null) {
this._setStyleToRenderedDate(b, true);
}
}
}
this.raisePropertyChanged("enableMultiSelect");
}
}, get_singleViewColumns: function () {
return this._singleViewColumns;
}, set_singleViewColumns: function (a) {
if (this._singleViewColumns !== a) {
this._singleViewColumns = a;
this.raisePropertyChanged("singleViewColumns");
}
}, get_singleViewRows: function () {
return this._singleViewRows;
}, set_singleViewRows: function (a) {
if (this._singleViewRows !== a) {
this._singleViewRows = a;
this.raisePropertyChanged("singleViewRows");
}
}, get_multiViewColumns: function () {
return this._multiViewColumns;
}, set_multiViewColumns: function (a) {
if (this._multiViewColumns !== a) {
this._multiViewColumns = a;
this.raisePropertyChanged("multiViewColumns");
}
}, get_multiViewRows: function () {
return this._multiViewRows;
}, set_multiViewRows: function (a) {
if (this._multiViewRows !== a) {
this._multiViewRows = a;
this.raisePropertyChanged("multiViewRows");
}
}, get_fastNavigationStep: function () {
return this._fastNavigationStep;
}, set_fastNavigationStep: function (a) {
if (this._fastNavigationStep !== a) {
this._fastNavigationStep = a;
this.raisePropertyChanged("fastNavigationStep");
}
}, get_skin: function () {
return this._skin;
}, set_skin: function (a) {
if (this._skin !== a) {
this._skin = a;
this.raisePropertyChanged("skin");
}
}, get_enableNavigationAnimation: function () {
return this._enableNavigationAnimation;
}, set_enableNavigationAnimation: function (a) {
if (this._enableNavigationAnimation !== a) {
this._enableNavigationAnimation = a;
this.raisePropertyChanged("enableNavigationAnimation");
}
}, get_cellDayFormat: function () {
return this._cellDayFormat;
}, set_cellDayFormat: function (a) {
if (this._cellDayFormat !== a) {
this._cellDayFormat = a;
this.raisePropertyChanged("cellDayFormat");
}
}, get_presentationType: function () {
return this._presentationType;
}, set_presentationType: function (a) {
if (this._presentationType !== a) {
this._presentationType = a;
if (this.RangeValidation) {
if (a == Telerik.Web.UI.Calendar.PresentationType.Preview) {
$telerik.$(".rcMain", this.get_element()).addClass("rcPreview");
} else {
$telerik.$(".rcMain", this.get_element()).removeClass("rcPreview");
}
this._moveToDate(this.FocusedDate, true);
}
this.raisePropertyChanged("presentationType");
}
}, get_renderMode: function () {
return this._renderMode;
}, set_renderMode: function (a) {
this._renderMode = a;
}, get_orientation: function () {
return this._orientation;
}, set_orientation: function (a) {
if (this._orientation !== a) {
this._orientation = a;
this.raisePropertyChanged("orientation");
}
}, get_titleFormat: function () {
return this._titleFormat;
}, set_titleFormat: function (a) {
if (this._titleFormat !== a) {
this._titleFormat = a;
this.raisePropertyChanged("titleFormat");
}
}, get_showDayCellToolTips: function () {
return this._showDayCellToolTips;
}, set_showDayCellToolTips: function (a) {
if (this._showDayCellToolTips != a) {
this._showDayCellToolTips = a;
this.raisePropertyChanged("showDayCellToolTips");
}
}, get_dayCellToolTipFormat: function () {
return this._dayCellToolTipFormat;
}, set_dayCellToolTipFormat: function (a) {
if (this._dayCellToolTipFormat !== a) {
this._dayCellToolTipFormat = a;
this.raisePropertyChanged("dayCellToolTipFormat");
}
}, get_dateRangeSeparator: function () {
return this._dateRangeSeparator;
}, set_dateRangeSeparator: function (a) {
if (this._dateRangeSeparator !== a) {
this._dateRangeSeparator = a;
this.raisePropertyChanged("dateRangeSeparator");
}
}, get_autoPostBack: function () {
return this._autoPostBack;
}, set_autoPostBack: function (a) {
if (this._autoPostBack !== a) {
this._autoPostBack = a;
this.raisePropertyChanged("autoPostBack");
}
}, get_calendarEnableNavigation: function () {
return this._calendarEnableNavigation;
}, set_calendarEnableNavigation: function (a) {
if (this._calendarEnableNavigation !== a) {
this._calendarEnableNavigation = a;
this.raisePropertyChanged("calendarEnableNavigation");
}
}, get_calendarEnableMonthYearFastNavigation: function () {
return this._calendarEnableMonthYearFastNavigation;
}, set_calendarEnableMonthYearFastNavigation: function (a) {
if (this._calendarEnableMonthYearFastNavigation !== a) {
this._calendarEnableMonthYearFastNavigation = a;
if (!a) {
$telerik.$(".rcTitlebar", this.get_element()).addClass("rcNoNav");
} else {
$telerik.$(".rcTitlebar", this.get_element()).removeClass("rcNoNav");
}
this.raisePropertyChanged("calendarEnableMonthYearFastNavigation");
}
}, get_enableRepeatableDaysOnClient: function () {
return this._enableRepeatableDaysOnClient;
}, set_enableRepeatableDaysOnClient: function (a) {
if (this._enableRepeatableDaysOnClient !== a) {
this._enableRepeatableDaysOnClient = a;
this.raisePropertyChanged("enableRepeatableDaysOnClient");
}
}, get_monthYearNavigationSettings: function () {
return this._monthYearNavigationSettings;
}, set_monthYearNavigationSettings: function (a) {
if (this._monthYearNavigationSettings !== a) {
this._monthYearNavigationSettings = a;
this.raisePropertyChanged("monthYearNavigationSettings");
}
}, get_stylesHash: function () {
return this._stylesHash;
}, set_stylesHash: function (a) {
if (this._stylesHash !== a) {
this._stylesHash = a;
this.raisePropertyChanged("stylesHash");
}
}, get_culture: function () {
return this._culture;
}, get_enableViewSelector: function () {
return this._enableViewSelector;
}, set_datesInRange: function (b, a) {
if (b && b) {
if (b > a) {
var c = b;
b = a;
a = c;
}
this._rangeSelectionStartDate = b;
this._rangeSelectionEndDate = a;
this.Selection._selectedDates.Clear();
this._removeAllSelectedDatesStyle();
this._initialRangeSelection(this._rangeSelectionStartDate, this._rangeSelectionEndDate);
}
}, get_rangeSelectionStartDate: function () {
return this._rangeSelectionStartDate;
}, get_rangeSelectionEndDate: function () {
return this._rangeSelectionEndDate;
}, get_hideNavigationControls: function () {
return this._hideNavigationControls;
}, set_hideNavigationControls: function (a) {
if (this._hideNavigationControls !== a) {
this._hideNavigationControls = a;
this.raisePropertyChanged("hideNavigationControls");
}
}, _destroyViews: function () {
for (var a = this._viewIDs.length - 1;
a >= 0;
a--) {
this._disposeView(this._viewIDs[a]);
}
this.CurrentViews = null;
this._viewsHash = null;
}, _attachEventHandlers: function () {
this._onLoadDelegate = Function.createDelegate(this, this._onLoadHandler);
Sys.Application.add_load(this._onLoadDelegate);
}, _isRtl: function () {
if (typeof(this.Rtl) == "undefined") {
this.Rtl = (this._getTextDirection() == "rtl");
}
return this.Rtl;
}, _getTextDirection: function () {
var a = this._calendarDomObject;
while (a != null) {
if (a.dir.toLowerCase() == "rtl") {
return "rtl";
}
a = a.parentNode;
}
return "ltr";
}, _getItemStyle: function (b, c, e, d, a, f) {
var g;
if (c) {
g = this.get_stylesHash()["OutOfRangeDayStyle"];
} else {
if (b && !this.get_showOtherMonthsDays()) {
g = this.get_stylesHash()["OtherMonthDayStyle"];
} else {
if (d) {
g = this.get_stylesHash()["SelectedDayStyle"];
} else {
if (f && f.join("").length > 0) {
g = f;
} else {
if (b) {
g = this.get_stylesHash()["OtherMonthDayStyle"];
} else {
if (e) {
g = this.get_stylesHash()["WeekendDayStyle"];
} else {
g = this.get_stylesHash()["DayStyle"];
}
}
}
}
}
}
if (a) {
if (g) {
g = g.slice(0);
} else {
g = ["", ""];
}
g[1] = (g[1] ? g[1] + " " : "") + this.get_stylesHash()["DisabledDayStyle"][1];
}
return g;
}, _isNavigationEnabled: function () {
if (!this.get_enabled() || !this.get_calendarEnableNavigation()) {
return false;
}
return true;
}, _isMonthYearNavigationEnabled: function () {
if (!this.get_enabled() || !this.get_calendarEnableMonthYearFastNavigation()) {
return false;
}
return true;
}, _hideDisabledNavigation: function (a, g) {
var f = this.DateTimeFormatInfo.Calendar.AddMonths(this.FocusedDate, g);
var e = [this.get_rangeMinDate()[0], this.get_rangeMinDate()[1], this.get_rangeMinDate()[2]];
var d = [this.get_rangeMaxDate()[0], this.get_rangeMaxDate()[1], this.get_rangeMaxDate()[2]];
f[2] = e[2] = d[2] = 1;
var c = this.RangeValidation.CompareDates(f, e);
var b = this.RangeValidation.CompareDates(f, d);
if (this.RangeValidation.IsDateValid(f) || c == 0 || b == 0) {
a.style.visibility = "";
} else {
a.style.visibility = "hidden";
}
}, _enableNavigation: function (b) {
b = (false != b);
var a = $get(this.get_id() + "_FNP");
if (a) {
a.onclick = (!b ? null : Telerik.Web.UI.Calendar.Utils.AttachMethod(this._fastNavigatePrev, this));
if (this.get_hideNavigationControls()) {
this._hideDisabledNavigation(a, -this.get_fastNavigationStep());
}
}
a = $get(this.get_id() + "_NP");
if (a) {
a.onclick = (!b ? null : Telerik.Web.UI.Calendar.Utils.AttachMethod(this._navigatePrev, this));
if (this.get_hideNavigationControls()) {
this._hideDisabledNavigation(a, -1);
}
}
a = $get(this.get_id() + "_NN");
if (a) {
a.onclick = (!b ? null : Telerik.Web.UI.Calendar.Utils.AttachMethod(this._navigateNext, this));
if (this.get_hideNavigationControls()) {
this._hideDisabledNavigation(a, 1);
}
}
a = $get(this.get_id() + "_FNN");
if (a) {
a.onclick = (!b ? null : Telerik.Web.UI.Calendar.Utils.AttachMethod(this._fastNavigateNext, this));
if (this.get_hideNavigationControls()) {
this._hideDisabledNavigation(a, this.get_fastNavigationStep());
}
}
a = $get(this._titleID);
if (a && this._isMonthYearNavigationEnabled()) {
a.onclick = Telerik.Web.UI.Calendar.Utils.AttachMethod(this._showMonthYearFastNav, this);
a.oncontextmenu = Telerik.Web.UI.Calendar.Utils.AttachMethod(this._showMonthYearFastNav, this);
}
}, _findRenderDay: function (a) {
var c = null;
for (var b = 0;
b < this.CurrentViews.length;
b++) {
var d = this.CurrentViews[b];
if (d.RenderDays == null) {
continue;
}
c = d.RenderDays.Get(a);
if (c != null) {
return c;
}
}
return null;
}, _findRenderDays: function (a) {
var d = [];
for (var b = 0;
b < this.CurrentViews.length;
b++) {
var e = this.CurrentViews[b];
if (e.RenderDays == null) {
continue;
}
var c = e.RenderDays.Get(a);
if (c != null) {
d[d.length] = c;
continue;
}
}
return d;
}, _performDateSelection: function (b, h, e, f) {
if (this.Selection.CanSelect(b)) {
if (e == true) {
this.navigateToDate(b);
}
if (h) {
var g = this._findRenderDays(b);
if (g.length > 0) {
for (var a = 0;
a < g.length;
a++) {
g[a].Select(true, f);
}
} else {
var c = this._findRenderDay(this._lastSelectedDate);
if (c && !this.get_enableMultiSelect()) {
c.PerformSelect(false);
}
this.Selection.Add(b);
this._serializeSelectedDates();
this._lastSelectedDate = b;
}
} else {
var g = this._findRenderDays(b);
if (g.length > 0) {
for (var a = 0;
a < g.length;
a++) {
g[a].Select(false, f);
}
} else {
this.Selection.Remove(b);
this._serializeSelectedDates();
}
}
}
}, _disposeView: function (g) {
for (var a = 0;
a < this.CurrentViews.length;
a++) {
var f = this.CurrentViews[a];
if (f.DomTable && f.DomTable.id == g) {
var e = f.DomTable.getElementsByTagName("a");
for (var b = 0, c = e.length;
b < c;
b++) {
var d = e[b];
$clearHandlers(d);
}
f.dispose();
this.CurrentViews.splice(a, 1);
return;
}
}
}, _findView: function (d) {
var b = null;
for (var a = 0;
a < this.CurrentViews.length;
a++) {
var c = this.CurrentViews[a];
if (c.DomTable.id == d) {
b = c;
break;
}
}
return b;
}, _initViews: function (e) {
if (!e) {
e = this._viewIDs;
}
this.CurrentViews = [];
var b;
for (var a = 0;
a < e.length;
a++) {
b = (a == 0 && e.length > 1);
var d = e[a];
var c = new Telerik.Web.UI.Calendar.CalendarView(this, $get(e[a]), d, b ? this.get_multiViewColumns() : this.get_singleViewColumns(), b ? this.get_multiViewRows() : this.get_singleViewRows(), b, this.get_useRowHeadersAsSelectors(), this.get_useColumnHeadersAsSelectors(), this.get_orientation());
c.MonthsInView = this.get__ViewsHash()[d][1];
this._disposeView(e[a]);
this.CurrentViews[a] = c;
}
if ((typeof(this.CurrentViews) != "undefined") && (typeof(this.CurrentViews[0]) != "undefined") && this.CurrentViews[0].IsMultiView) {
this.CurrentViews[0]._ViewStartDate = this.CurrentViews[0]._MonthStartDate = this.CurrentViews[1]._MonthStartDate;
this.CurrentViews[0]._ViewEndDate = this.CurrentViews[0]._MonthEndDate = this.CurrentViews[(this.CurrentViews.length - 1)]._MonthEndDate;
}
}, _serializeSelectedDates: function () {
var d = "[";
var b = this.Selection._selectedDates;
var e = b.GetValues();
var a = b.Get(b._lastInsertedKey);
for (var c = 0;
c < e.length;
c++) {
if (e[c] && e[c] !== a) {
d += "[" + e[c][0] + "," + e[c][1] + "," + e[c][2] + "],";
}
}
if (a) {
d += "[" + a[0] + "," + a[1] + "," + a[2] + "],";
}
if (d.length > 1) {
d = d.substring(0, d.length - 1);
}
d += "]";
var f = this._selectedDatesHidden();
if (f) {
f.value = d;
}
}, _selectedDatesHidden: function () {
return $get(this.get_id() + "_SD");
}, _serializeAuxDates: function () {
var a = "[[" + this.RangeMinDate + "],[" + this.RangeMaxDate + "],[" + this.FocusedDate + "]]";
if (this._auxDatesHidden() != null) {
this._auxDatesHidden().value = a;
}
}, _auxDatesHidden: function () {
return $get(this.get_id() + "_AD");
}, _submit: function (a, b) {
if (!b && this._allowAutoPostBackOnNavigateOnly) {
this._execClientAction(a);
} else {
if (this.get_autoPostBack()) {
this._doPostBack(a);
} else {
this._execClientAction(a);
}
}
}, _deserializeNavigationArgument: function (b) {
var a = b.split(":");
return a;
}, _execClientAction: function (c) {
var a = c.split(":");
switch (a[0]) {
case"d":
break;
case"n":
if (this.CurrentViews && !this.CurrentViews[0].IsMultiView) {
var d = parseInt(a[1], 0);
var e = parseInt(a[2], 0);
this._moveByStep(d, e);
}
break;
case"nd":
var b = [parseInt(a[1]), parseInt(a[2]), parseInt(a[3])];
this._moveToDate(b);
break;
}
}, _moveByStep: function (b, c) {
var d = this.CurrentViews[0];
if (!d) {
return;
}
var a = (b < 0 ? d._MonthStartDate : d._MonthEndDate);
a = this.DateTimeFormatInfo.Calendar.AddMonths(a, b);
if (!this.RangeValidation.IsDateValid(a)) {
if (b > 0) {
a = [this.RangeMaxDate[0], this.RangeMaxDate[1], this.RangeMaxDate[2]];
} else {
a = [this.RangeMinDate[0], this.RangeMinDate[1], this.RangeMinDate[2]];
}
}
if (b != 0) {
this._moveToDate(a);
}
}, _moveToDate: function (a, b) {
if (typeof(b) == "undefined") {
b = false;
}
if (this.get_multiViewColumns() > 1 || this.get_multiViewRows() > 1) {
return false;
}
if (!this.RangeValidation.IsDateValid(a)) {
a = this._getBoundaryDate(a);
if (a == null) {
if (this._getFastNavigation().DateIsOutOfRangeMessage != null && this._getFastNavigation().DateIsOutOfRangeMessage != " ") {
alert(this._getFastNavigation().DateIsOutOfRangeMessage);
}
return;
}
}
var d = this.FocusedDate;
this.FocusedDate = a;
a[2] = d[2] = 1;
var e = this.RangeValidation.CompareDates(a, d);
if (e == 0 && !b) {
return;
}
var f = this._viewIDs[0];
var c = false;
this._disposeView(f);
var g = new Telerik.Web.UI.Calendar.CalendarView(this, $get(f), f, c ? this.get_multiViewColumns() : this.get_singleViewColumns(), c ? this.get_multiViewRows() : this.get_singleViewRows(), c, this.get_useRowHeadersAsSelectors(), this.get_useColumnHeadersAsSelectors(), this.get_orientation(), a);
this.CurrentViews[this.CurrentViews.length] = g;
g.ScrollDir = e;
g.RenderDaysSingleView();
}, _checkRequestConditions: function (c) {
var a = this._deserializeNavigationArgument(c);
var d = 0;
var b = null;
if (a[0] != "d") {
if (a[0] == "n") {
d = parseInt(a[1], 0);
b = this.calculateDateFromStep(d);
} else {
if (a[0] == "nd") {
b = [parseInt(a[1]), parseInt(a[2]), parseInt(a[3])];
}
}
if (!b) {
return false;
}
if (!this.RangeValidation.IsDateValid(b)) {
b = this._getBoundaryDate(b);
if (b == null) {
if (this._getFastNavigation().DateIsOutOfRangeMessage != null && this._getFastNavigation().DateIsOutOfRangeMessage != " ") {
alert(this._getFastNavigation().DateIsOutOfRangeMessage);
}
return false;
}
}
}
return true;
}, _doPostBack: function (a) {
if (this._checkRequestConditions(a)) {
eval(this._postBackCall.replace("@@", a));
}
}, _getStepFromDate: function (a) {
var d = a[0] - this.FocusedDate[0];
var b = a[1] - this.FocusedDate[1];
var c = d * 12 + b;
return c;
}, _getBoundaryDate: function (a) {
if (!this.RangeValidation.IsDateValid(a)) {
if (this._isInSameMonth(a, this.RangeMinDate)) {
return [this.RangeMinDate[0], this.RangeMinDate[1], this.RangeMinDate[2]];
}
if (this._isInSameMonth(a, this.RangeMaxDate)) {
return [this.RangeMaxDate[0], this.RangeMaxDate[1], this.RangeMaxDate[2]];
}
return null;
}
return a;
}, _navigate: function (c) {
if (!c) {
return;
}
var a = new Telerik.Web.UI.CalendarViewChangingEventArgs(c);
this.raise_calendarViewChanging(a);
if (a.get_cancel()) {
return;
}
this.navStep = c;
this._submit("n:" + c, true);
this._serializeAuxDates();
var b = new Telerik.Web.UI.CalendarViewChangedEventArgs(c);
if (this.get_enableAriaSupport()) {
this._initializeAriaForCalendarDays();
}
this.raise_calendarViewChanged(b);
}, _clearKeyBoardNavigationProperties: function () {
if (this._navigateFromLinksButtons && this._enableKeyboardNavigation && !this._enableMultiSelect) {
this.CurrentViews[0].RadCalendar._nextFocusedCell = null;
this.CurrentViews[0].RadCalendar._hoveredDate = null;
this.CurrentViews[0].RadCalendar._hoveredDateTriplet = null;
this.CurrentViews[0]._removeHoverStyles(this.CurrentViews[0].DomTable);
}
}, _fastNavigatePrev: function () {
this._clearKeyBoardNavigationProperties();
var b = this._findView(this._topViewID);
var a = (-this.get_fastNavigationStep()) * b.MonthsInView;
this._navigate(a);
return false;
}, _navigatePrev: function () {
this._clearKeyBoardNavigationProperties();
var a = this._findView(this._topViewID);
this._navigate(-a.MonthsInView);
return false;
}, _navigateNext: function () {
this._clearKeyBoardNavigationProperties();
var a = this._findView(this._topViewID);
this._navigate(a.MonthsInView);
return false;
}, _fastNavigateNext: function () {
this._clearKeyBoardNavigationProperties();
var b = this._findView(this._topViewID);
var a = this.get_fastNavigationStep() * b.MonthsInView;
this._navigate(a);
return false;
}, _getRenderDayID: function (a) {
return (this.get_id() + "_" + a.join("_"));
}, _isInSameMonth: function (a, b) {
if (!a || a.length != 3) {
throw new Error("Date1 must be array: [y, m, d]");
}
if (!b || b.length != 3) {
throw new Error("Date2 must be array: [y, m, d]");
}
var e = a[0];
var f = b[0];
if (e < f) {
return false;
}
if (e > f) {
return false;
}
var c = a[1];
var d = b[1];
if (c < d) {
return false;
}
if (c > d) {
return false;
}
return true;
}, _getFastNavigation: function () {
var b = this.MonthYearFastNav;
if (!b) {
var a = this.DateTimeFormatInfo;
if (!a) {
a = new Telerik.Web.UI.Calendar.DateTimeFormatInfo(this.get__FormatInfoArray());
}
b = new Telerik.Web.UI.Calendar.MonthYearFastNavigation(a.AbbreviatedMonthNames, this.RangeMinDate, this.RangeMaxDate, this.get_skin(), this.get_id(), this.get_monthYearNavigationSettings());
this.MonthYearFastNav = b;
}
return this.MonthYearFastNav;
}, _showMonthYearFastNav: function (a) {
if (!a) {
a = window.event;
}
this._enableNavigation(this._isNavigationEnabled());
var b = $telerik.getDocumentRelativeCursorPosition(a);
if (this._isMonthYearNavigationEnabled()) {
this._getFastNavigation().Show(this._getPopup(), b.left, b.top, this.FocusedDate[1], this.FocusedDate[0], Telerik.Web.UI.Calendar.Utils.AttachMethod(this._monthYearFastNavExitFunc, this), this.get_stylesHash()["FastNavigationStyle"]);
}
a.returnValue = false;
a.cancelBubble = true;
if (a.stopPropagation) {
a.stopPropagation();
}
if (!document.all) {
window.setTimeout(function () {
try {
document.getElementsByTagName("INPUT")[0].focus();
} catch (c) {
}
}, 1);
}
return false;
}, _getPopup: function () {
var a = this.Popup;
if (!a) {
a = new Telerik.Web.UI.Calendar.Popup();
a._overlay = this._overlay;
if (this._zIndex) {
a.zIndex = this._zIndex;
}
if (!this._enableShadows) {
a.EnableShadows = false;
}
a._renderMode = this._renderMode;
this.Popup = a;
}
return a;
}, _monthYearFastNavExitFunc: function (c, b, a) {
if (!a || !this.EnableTodayButtonSelection) {
this.navigateToDate([c, b + 1, 1]);
} else {
this.unselectDate([c, b + 1, a]);
this.selectDate([c, b + 1, a], true);
if (this.EnableTodayButtonSelection && this.get_autoPostBack()) {
this._submit(["nd", c, (b + 1), a].join(":"));
}
}
}, _updateSelectedDates: function () {
var b = this.get_selectedDates();
for (var a = 0;
a < b.length;
a++) {
if (!this.RangeValidation.IsDateValid(b[a])) {
this.Selection.Remove(b[a]);
}
}
}, _onLoadHandler: function (a) {
this.raise_load(Sys.EventArgs.Empty);
}, get__FormatInfoArray: function () {
return this._formatInfoArray;
}, set__FormatInfoArray: function (a) {
if (this._formatInfoArray !== a) {
this._formatInfoArray = a;
this.raisePropertyChanged("formatInfoArray");
}
}, get__ViewsHash: function () {
return this._viewsHash;
}, set__ViewsHash: function (a) {
if (this._viewsHash !== a) {
this._viewsHash = a;
this.raisePropertyChanged("viewsHash");
}
}, get__DayRenderChangedDays: function () {
return this._dayRenderChangedDays;
}, set__DayRenderChangedDays: function (a) {
if (this._dayRenderChangedDays !== a) {
this._dayRenderChangedDays = a;
this.raisePropertyChanged("dayRenderChangedDays");
}
}, get__ViewRepeatableDays: function () {
return this._viewRepeatableDays;
}, set__ViewRepeatableDays: function (a) {
if (this._viewRepeatableDays !== a) {
this._viewRepeatableDays = a;
this.raisePropertyChanged("viewRepeatableDays");
}
}, add_init: function (a) {
this.get_events().addHandler("init", a);
}, remove_init: function (a) {
this.get_events().removeHandler("init", a);
}, raise_init: function (a) {
this.raiseEvent("init", a);
}, add_load: function (a) {
this.get_events().addHandler("load", a);
}, remove_load: function (a) {
this.get_events().removeHandler("load", a);
}, raise_load: function (a) {
this.raiseEvent("load", a);
}, add_dateSelecting: function (a) {
this.get_events().addHandler("dateSelecting", a);
}, remove_dateSelecting: function (a) {
this.get_events().removeHandler("dateSelecting", a);
}, raise_dateSelecting: function (a) {
this.raiseEvent("dateSelecting", a);
}, add_dateSelected: function (a) {
this.get_events().addHandler("dateSelected", a);
}, remove_dateSelected: function (a) {
this.get_events().removeHandler("dateSelected", a);
}, raise_dateSelected: function (a) {
this.raiseEvent("dateSelected", a);
}, add_dateClick: function (a) {
this.get_events().addHandler("dateClick", a);
}, remove_dateClick: function (a) {
this.get_events().removeHandler("dateClick", a);
}, raise_dateClick: function (a) {
this.raiseEvent("dateClick", a);
}, add_calendarViewChanging: function (a) {
this.get_events().addHandler("calendarViewChanging", a);
}, remove_calendarViewChanging: function (a) {
this.get_events().removeHandler("calendarViewChanging", a);
}, raise_calendarViewChanging: function (a) {
this.raiseEvent("calendarViewChanging", a);
}, add_calendarViewChanged: function (a) {
this.get_events().addHandler("calendarViewChanged", a);
}, remove_calendarViewChanged: function (a) {
this.get_events().removeHandler("calendarViewChanged", a);
}, raise_calendarViewChanged: function (a) {
this.raiseEvent("calendarViewChanged", a);
}, add_dayRender: function (a) {
this.get_events().addHandler("dayRender", a);
}, remove_dayRender: function (a) {
this.get_events().removeHandler("dayRender", a);
}, raise_dayRender: function (a) {
this.raiseEvent("dayRender", a);
}, add_rowHeaderClick: function (a) {
this.get_events().addHandler("rowHeaderClick", a);
}, remove_rowHeaderClick: function (a) {
this.get_events().removeHandler("rowHeaderClick", a);
}, raise_rowHeaderClick: function (a) {
this.raiseEvent("rowHeaderClick", a);
}, add_columnHeaderClick: function (a) {
this.get_events().addHandler("columnHeaderClick", a);
}, remove_columnHeaderClick: function (a) {
this.get_events().removeHandler("columnHeaderClick", a);
}, raise_columnHeaderClick: function (a) {
this.raiseEvent("columnHeaderClick", a);
}, add_viewSelectorClick: function (a) {
this.get_events().addHandler("viewSelectorClick", a);
}, remove_viewSelectorClick: function (a) {
this.get_events().removeHandler("viewSelectorClick", a);
}, raise_viewSelectorClick: function (a) {
this.raiseEvent("viewSelectorClick", a);
}, _selectedRangeDatesHidden: function () {
return $get(this.get_id() + "_RS");
}, _serializeRangeSelectionDates: function () {
var c = null;
var b = null;
if (this._rangeSelectionStartDate) {
c = [this._rangeSelectionStartDate.getFullYear(), this._rangeSelectionStartDate.getMonth() + 1, this._rangeSelectionStartDate.getDate()];
} else {
c = [1980, 1, 1];
}
if (this._rangeSelectionEndDate) {
b = [this._rangeSelectionEndDate.getFullYear(), this._rangeSelectionEndDate.getMonth() + 1, this._rangeSelectionEndDate.getDate()];
} else {
b = [2099, 12, 30];
}
var a = "[[" + c + "],[" + b + "]]";
if (this._selectedRangeDatesHidden() != null) {
this._selectedRangeDatesHidden().value = a;
}
}, _removeRangeSelection: function () {
if (this._rangeSelectionEndDate && this._rangeSelectionStartDate) {
this._removeAllSelectedDatesStyle();
this.Selection._selectedDates.Clear();
this._rangeSelectionEndDate = null;
this._rangeSelectionStartDate = null;
}
}, _dateClick: function (a) {
var f = a._renderDay.RadCalendarView.ID;
var c = a._renderDay._date;
if (this._rangeSelectionStartDate && this._rangeSelectionEndDate) {
this._removeAllSelectedDatesStyle();
this.Selection._selectedDates.Clear();
this._rangeSelectionEndDate = null;
this._rangeSelectionStartDate = null;
}
if (a._domEvent.shiftKey && this._rangeSelectionStartDate && Telerik.Web.UI.Calendar.RangeSelectionMode.OnKeyHold == this._rangeSelectionMode || this._rangeSelectionStartDate && Telerik.Web.UI.Calendar.RangeSelectionMode.ConsecutiveClicks == this._rangeSelectionMode) {
this._removeAllSelectedDatesStyle();
this.Selection._selectedDates.Clear();
this._rangeSelectionEndDate = new Date(c[0], c[1] - 1, c[2]);
var b = false;
if (this._rangeSelectionStartDate > this._rangeSelectionEndDate) {
var d = this._rangeSelectionStartDate;
this._rangeSelectionStartDate = this._rangeSelectionEndDate;
this._rangeSelectionEndDate = d;
b = true;
}
this._performSelection(this._rangeSelectionStartDate, this._rangeSelectionEndDate, b, f);
} else {
this._rangeSelectionStartDate = new Date(c[0], c[1] - 1, c[2]);
this._rangeSelectionEndDate = null;
}
this._serializeRangeSelectionDates();
}, _removeAllSelectedDatesStyle: function () {
for (var c = 0;
c < this.CurrentViews.length;
c++) {
var b = this.CurrentViews[c].RenderDays;
if (b) {
for (var d = 0;
d < b.GetValues().length;
d++) {
var a = b.GetValues()[d];
this._setStyleToRenderedDate(a, false);
}
}
}
}, _getAllSelectedDates: function (d, g) {
var a = new Array();
var c = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
a.push(c);
var b = new Date(d.getTime() + 86400000);
var e = b.getHours();
while (b < g) {
c = [b.getFullYear(), b.getMonth() + 1, b.getDate()];
a.push(c);
b = new Date(b.getTime() + 86400000);
if (e != b.getHours()) {
var f = this._addDays(b, -1);
c = [f.getFullYear(), f.getMonth() + 1, f.getDate()];
a.push(c);
}
e = b.getHours();
}
c = [g.getFullYear(), g.getMonth() + 1, g.getDate()];
a.push(c);
return a;
}, _initialRangeSelection: function (b, e) {
var a = this._getAllSelectedDates(b, e);
for (var c = 0;
c < a.length;
c++) {
this.Selection.Add(a[c]);
var d = this._findRenderDay(a[c]);
if (d) {
this._setStyleToRenderedDate(d, true);
}
}
this._serializeSelectedDates();
}, _performSelection: function (b, f, d, g) {
var a = this._getAllSelectedDates(b, f);
for (var c = 0;
c < a.length;
c++) {
this.Selection.Add(a[c]);
}
this._serializeSelectedDates();
var e;
if (!d) {
e = [f.getFullYear(), f.getMonth() + 1, f.getDate()];
} else {
e = [b.getFullYear(), b.getMonth() + 1, b.getDate()];
}
this._applyStyles(e, g);
}, _addDays: function (a, c) {
var b = new Date(a.getFullYear(), a.getMonth(), a.getDate());
return new Date(b.setDate(b.getDate() + c));
}, _setStyleToRenderedDate: function (c, b) {
c.IsSelected = b;
var a = c.GetDefaultItemStyle();
if (a) {
c.DomElement.className = a[1];
c.DomElement.style.cssText = a[0];
}
}, _applyStyles: function (g, h) {
var d = false;
var c = this.CurrentViews;
for (var e = 0;
e < c.length;
e++) {
var b = c[e].RenderDays;
if (b) {
for (var f = 0;
f < b.GetValues().length;
f++) {
if (this.Selection._selectedDates.Get(b.GetValues()[f]._date)) {
var a = b.GetValues()[f];
if (a._date.toString() == g.toString() && h == this.CurrentViews[e].ID) {
continue;
}
this._setStyleToRenderedDate(a, true);
}
}
}
}
}
};
Telerik.Web.UI.RadCalendar.registerClass("Telerik.Web.UI.RadCalendar", Telerik.Web.UI.RadWebControl);
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.DateTimeFormatInfo = function (a) {
this.DayNames = a[0];
this.AbbreviatedDayNames = a[1];
this.MonthNames = a[2];
this.AbbreviatedMonthNames = a[3];
this.FullDateTimePattern = a[4];
this.LongDatePattern = a[5];
this.LongTimePattern = a[6];
this.MonthDayPattern = a[7];
this.RFC1123Pattern = a[8];
this.ShortDatePattern = a[9];
this.ShortTimePattern = a[10];
this.SortableDateTimePattern = a[11];
this.UniversalSortableDateTimePattern = a[12];
this.YearMonthPattern = a[13];
this.AMDesignator = a[14];
this.PMDesignator = a[15];
this.DateSeparator = a[16];
this.TimeSeparator = a[17];
this.FirstDayOfWeek = a[18];
this.CalendarWeekRule = 0;
this.Calendar = null;
};
Telerik.Web.UI.Calendar.DateTimeFormatInfo.prototype = {
LeadZero: function (a) {
return (a < 0 || a > 9 ? "" : "0") + a;
}, FormatDate: function (f, l) {
l = l + "";
l = l.replace(/%/ig, "");
var I = "";
var t = 0;
var b = "";
var N = "";
var Q = "" + f[0];
var B = f[1];
var e = f[2];
var j = this.Calendar.GetDayOfWeek(f);
var o = 0;
var A = 0;
var J = 0;
var S, R, F, D, g, p, n, C, L, a, q, o, z, w, x, v;
var O = new Object();
if (Q.length < 4) {
var G = Q.length;
for (var r = 0;
r < 4 - G;
r++) {
Q = "0" + Q;
}
}
var P = Q.substring(2, 4);
var u = 0 + P;
if (u < 10) {
O.y = "" + P.substring(1, 2);
} else {
O.y = "" + P;
}
O.yyyy = Q;
O.yy = P;
O.M = B;
O.MM = this.LeadZero(B);
O.MMM = this.AbbreviatedMonthNames[B - 1];
O.MMMM = this.MonthNames[B - 1];
O.d = e;
O.dd = this.LeadZero(e);
O.dddd = this.DayNames[j];
O.ddd = this.AbbreviatedDayNames[j];
O.H = o;
O.HH = this.LeadZero(o);
if (o == 0) {
O.h = 12;
} else {
if (o > 12) {
O.h = o - 12;
} else {
O.h = o;
}
}
O.hh = this.LeadZero(O.h);
if (o > 11) {
O.tt = "PM";
O.t = "P";
} else {
O.tt = "AM";
O.t = "A";
}
O.m = A;
O.mm = this.LeadZero(A);
O.s = J;
O.ss = this.LeadZero(J);
while (t < l.length) {
b = l.charAt(t);
N = "";
if (l.charAt(t) == "'") {
t++;
while ((l.charAt(t) != "'")) {
N += l.charAt(t);
t++;
}
t++;
I += N;
continue;
}
while ((l.charAt(t) == b) && (t < l.length)) {
N += l.charAt(t++);
}
if (O[N] != null) {
I += O[N];
} else {
I += N;
}
}
return I;
}
};
Telerik.Web.UI.Calendar.DateTimeFormatInfo.registerClass("Telerik.Web.UI.Calendar.DateTimeFormatInfo");
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.MonthYearFastNavigation = function (d, c, b, f, a, e) {
this.MonthNames = d;
this.MinYear = c;
this.MaxYear = b;
this.Skin = f;
this.CalendarID = a;
this.TodayButtonCaption = e[0];
this.OkButtonCaption = e[1];
this.CancelButtonCaption = e[2];
this.DateIsOutOfRangeMessage = e[3];
this.EnableTodayButtonSelection = e[4];
this.EnableScreenBoundaryDetection = e[5];
this.ShowAnimationDuration = e[6];
this.ShowAnimationType = e[7];
this.HideAnimationDuration = e[8];
this.HideAnimationType = e[9];
this.DisableOutOfRangeMonths = e[10];
};
Telerik.Web.UI.Calendar.MonthYearFastNavigation.prototype = {
CreateLayout: function (l) {
var n = this;
var b = this.Month;
var m = document.createElement("table");
m.id = this.CalendarID + "_FastNavPopup";
m.cellSpacing = 0;
m.className = l[1];
m.style.cssText = l[0];
var g = this.MonthNames;
var h = g.length;
if (!g[12]) {
h--;
}
var k = Math.ceil(h / 2);
m.YearRowsCount = k - 1;
var f = 0;
var j, a;
this.YearCells = [];
this.MonthCells = [];
for (var d = 0;
d < k;
d++) {
j = m.insertRow(m.rows.length);
a = this.AddMonthCell(j, f++);
if (null != a.Month) {
this.MonthCells[this.MonthCells.length] = a;
}
a = this.AddMonthCell(j, f++);
if (null != a.Month) {
this.MonthCells[this.MonthCells.length] = a;
}
a = j.insertCell(j.cells.length);
a.unselectable = "on";
if (d < (k - 1)) {
this.YearCells[this.YearCells.length] = a;
var e = document.createElement("a");
a.appendChild(e);
e.href = "#";
e.innerHTML = " ";
e.onclick = function (i) {
if (!i) {
var i = window.event;
}
n.SelectYear(this.Year);
n._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
} else {
a.id = "rcMView_PrevY";
var e = document.createElement("a");
a.appendChild(e);
e.href = "#";
e.innerHTML = "<<";
this.FastNavPrevYearsLink = e;
if (n.StartYear >= n.MinYear[0]) {
e.onclick = function (i) {
if (!i) {
var i = window.event;
}
n.ScrollYears(-10);
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
a = j.insertCell(j.cells.length);
a.unselectable = "on";
if (d < (k - 1)) {
this.YearCells[this.YearCells.length] = a;
var e = document.createElement("a");
a.appendChild(e);
e.href = "#";
e.innerHTML = " ";
e.onclick = function (i) {
if (!i) {
var i = window.event;
}
n.SelectYear(this.Year);
n._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
} else {
a.id = "rcMView_NextY";
var e = document.createElement("a");
a.appendChild(e);
e.href = "#";
e.innerHTML = ">>";
this.FastNavNextYearsLink = e;
var c = n.StartYear + 10;
if (c <= n.MaxYear[0]) {
e.onclick = function (i) {
if (!i) {
var i = window.event;
}
n.ScrollYears(10);
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
}
j = m.insertRow(m.rows.length);
a = j.insertCell(j.cells.length);
a.className = "rcButtons";
a.colSpan = 4;
a.noWrap = true;
this.CreateButton("rcMView_Today", a, this.TodayButtonCaption, Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnToday, this));
a.appendChild(document.createTextNode(" "));
this.CreateButton("rcMView_OK", a, this.OkButtonCaption, Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnOK, this));
a.appendChild(document.createTextNode(" "));
this.CreateButton("rcMView_Cancel", a, this.CancelButtonCaption, Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnCancel, this));
return m;
}, _appendStylesAndPropertiesToMonthYearView: function (r, q) {
var s = this;
r.cellSpacing = 0;
r.style.cssText = q[0];
var l = this.MonthNames;
var m = l.length;
if (!l[12]) {
m--;
}
var p = Math.ceil(m / 2);
r.YearRowsCount = p - 1;
var k = 0;
var n, b;
var c;
var o = r.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
this.YearCells = [];
this.MonthCells = [];
var g = 0;
for (var f = 0;
f < p;
f++) {
n = o[f];
c = n.cells.length;
b = n.cells[c - 4];
b = this._appendMonthCellProperties(b, g);
if (null != b.Month) {
this.MonthCells[this.MonthCells.length] = b;
}
b = n.cells[c - 3];
b = this._appendMonthCellProperties(b, g + 1);
if (null != b.Month) {
this.MonthCells[this.MonthCells.length] = b;
}
b = n.cells[c - 2];
this.FastNavPrevYears = b;
b.unselectable = "on";
if (f < (p - 1)) {
this.YearCells[this.YearCells.length] = b;
var j = b.childNodes[0];
j.onclick = function (i) {
if (!i) {
var i = window.event;
}
var t = s.Year;
s.SelectYear(this.Year);
s._fireYearSelectedEvent(t, this.parentNode);
s._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
} else {
if (!b.childNodes[0] && !b.childNodes[0].childNodes[0]) {
b.id = "rcMView_PrevY";
}
var j = b.childNodes[0];
this.FastNavPrevYearsLink = j;
if (s.StartYear >= s.MinYear[0]) {
j.onclick = function (i) {
if (!i) {
var i = window.event;
}
s.ScrollYears(-10);
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
b = n.cells[c - 1];
this.FastNavNextYears = b;
b.unselectable = "on";
if (f < (p - 1)) {
this.YearCells[this.YearCells.length] = b;
var j = b.childNodes[0];
j.onclick = function (i) {
if (!i) {
var i = window.event;
}
var t = s.Year;
s.SelectYear(this.Year);
s._fireYearSelectedEvent(t, this.parentNode);
s._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
} else {
if (!b.childNodes[0] && !b.childNodes[0].childNodes[0]) {
b.id = "rcMView_NextY";
}
var j = b.childNodes[0];
this.FastNavNextYearsLink = j;
var e = s.StartYear + 10;
if (e <= s.MaxYear[0]) {
j.onclick = function (i) {
if (!i) {
var i = window.event;
}
s.ScrollYears(10);
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
g += 2;
}
var h = r.rows.length;
n = r.rows[h - 1];
b = n.cells[0];
b.colSpan = 4;
b.noWrap = true;
var d = (this.EnableTodayButtonSelection == "False" ? false : true);
if (d) {
this._appendButtonProperties(b.childNodes[0], "rcMView_Today", Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnToday, this));
} else {
var a = b.childNodes[0];
a.id = "rcMView_Today";
a.onclick = "return false;";
}
b.appendChild(document.createTextNode(" "));
this._appendButtonProperties(b.childNodes[1], "rcMView_OK", Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnOK, this));
b.appendChild(document.createTextNode(" "));
this._appendButtonProperties(b.childNodes[2], "rcMView_Cancel", Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnCancel, this));
return r;
}, _appendButtonProperties: function (a, b, c) {
a.id = b;
if ("function" == typeof(c)) {
a.onclick = c;
}
}, _disableOutOfRangeMonths: function () {
var b = (this.DisableOutOfRangeMonths == "False" ? false : true);
if (!b) {
return;
}
var m = this;
var l = this.MonthCells.length;
for (var d = 0;
d < l;
d++) {
var a = m.MonthCells[d];
a.className = a.className.replace("rcDisabled", "");
var g = a.childNodes[0];
if (g.onclick == null) {
g.onclick = function (i) {
if (!i) {
var i = window.event;
}
var n = m.Month;
m.SelectMonth(this.Month);
var j = m._getMonthYearPicker();
if (j) {
m._fireMonthSelectedEvent(j, m, n, a);
}
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
if (m.MinYear[0] == m.GetYear()) {
var k = m.MinYear[1] - 1;
for (var c = 0;
c < k;
c++) {
var a = m.MonthCells[c];
if (a) {
var e = a.childNodes[0];
e.onclick = null;
a.className = "rcDisabled";
}
}
if (m.Month < k) {
m.SelectMonth(k);
}
}
if (m.MaxYear[0] == this.GetYear()) {
var h = this.MaxYear[1];
if (m.Month > h) {
m.SelectMonth(h);
}
for (var f = h;
f < l;
f++) {
var a = m.MonthCells[f];
if (a) {
var e = a.childNodes[0];
e.onclick = null;
a.className = "rcDisabled";
}
}
}
}, _isMonthYearPicker: function () {
return this._getMonthYearPicker();
}, CreateButton: function (b, d, e, c) {
var a = document.createElement("input");
a.id = b;
a.type = "button";
a.value = e;
if ("function" == typeof(c)) {
a.onclick = c;
}
d.appendChild(a);
return a;
}, FillYears: function () {
var e = this.StartYear;
var g = this.YearCells;
var h = [];
var a;
var d = g.length / 2;
for (var b = 0;
b < d;
b++) {
a = g[b * 2];
this.SelectCell(a, false);
a.id = "rcMView_" + e.toString();
var c = a.getElementsByTagName("a")[0];
c.href = "#";
c.innerHTML = e;
c.Year = e;
if (c.Year < this.MinYear[0] || c.Year > this.MaxYear[0]) {
c.onclick = null;
a.className = "rcDisabled";
} else {
a.className = "";
if (c.onclick == null) {
var f = this;
c.onclick = function (i) {
if (!i) {
i = window.event;
}
var j = f.Year;
f.SelectYear(this.Year);
f._fireYearSelectedEvent(j, this.parentNode);
f._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
h[e] = a;
a = g[b * 2 + 1];
this.SelectCell(a, false);
a.id = "rcMView_" + (e + d).toString();
var c = a.getElementsByTagName("a")[0];
c.href = "#";
c.innerHTML = e + d;
c.Year = e + d;
if (c.Year < this.MinYear[0] || c.Year > this.MaxYear[0]) {
c.onclick = null;
a.className = "rcDisabled";
} else {
a.className = "";
if (c.onclick == null) {
var f = this;
c.onclick = function (i) {
if (!i) {
i = window.event;
}
var j = f.Year;
f.SelectYear(this.Year);
f._fireYearSelectedEvent(j, this.parentNode);
f._disableOutOfRangeMonths();
if (i.preventDefault) {
i.preventDefault();
}
return false;
};
}
}
h[e + d] = a;
e++;
}
this.YearsLookup = h;
}, _fireYearSelectedEvent: function (e, a) {
var b = this._getMonthYearPicker();
if (b) {
var d = null;
var c = null;
if (e != undefined) {
d = new Date(e, this.Month, 1);
c = new Date(this.Year, this.Month, 1);
} else {
c = new Date(this.Year, 0, 1);
}
b._raiseYearSelected(d, c, a);
}
}, SelectCell: function (a, c) {
if (a) {
var b = "rcSelected";
if (false == c) {
if (a.className.indexOf("rcDisabled") == -1) {
b = "";
} else {
b = a.className.replace("rcSelected", "");
}
}
a.className = b;
}
}, SelectYear: function (b) {
var a = this.Year;
var c = this.YearsLookup[b];
this.Year = b;
this.SelectCell(this.SelectedYearCell, false);
this.SelectCell(c, true);
this.SelectedYearCell = c;
}, _getMonthYearPicker: function () {
var a = $find(this.CalendarID);
if (a && a.constructor.getName() == "Telerik.Web.UI.RadMonthYearPicker") {
return a;
}
return null;
}, SelectMonth: function (a) {
var c = this.Month;
var b = this.MonthCells[a];
this.Month = a;
this.SelectCell(this.SelectedMonthCell, false);
this.SelectCell(b, true);
this.SelectedMonthCell = b;
}, ScrollYears: function (b) {
this.StartYear += b;
this.FillYears();
this.SetNavCells();
var a = this._getMonthYearPicker();
if (a) {
a._raiseViewChangedEvent();
}
this.SelectYear(this.Year);
}, SetNavCells: function () {
var c = this.StartYear + 10;
var b = this.FastNavPrevYearsLink;
var a = this.FastNavNextYearsLink;
var d = this;
if (this.StartYear < this.MinYear[0]) {
b.className = "rcDisabled";
b.onclick = null;
} else {
b.className = "";
if (b.onclick == null) {
b.onclick = function () {
d.ScrollYears(-10);
};
}
}
if (c > this.MaxYear[0]) {
a.className = "rcDisabled";
a.onclick = null;
} else {
a.className = "";
if (a.onclick == null) {
a.onclick = function () {
d.ScrollYears(10);
};
}
}
}, _appendMonthCellProperties: function (a, d) {
var b = a.childNodes[0];
a.unselectable = "on";
var c = this.MonthNames[d];
if (c) {
a.id = "rcMView_" + c;
a.Month = b.Month = d;
var e = this;
b.onclick = function (f) {
if (!f) {
var f = window.event;
}
var h = e.Month;
e.SelectMonth(this.Month);
var g = e._getMonthYearPicker();
if (g) {
e._fireMonthSelectedEvent(g, e, h, a);
}
if (f.preventDefault) {
f.preventDefault();
}
return false;
};
}
return a;
}, _fireMonthSelectedEvent: function (b, f, e, a) {
var d = null;
var c = null;
if (e != undefined) {
d = new Date(f.Year, e, 1);
c = new Date(f.Year, this.Month, 1);
} else {
c = new Date(f.Year, this.Month, 1);
}
b._raiseMonthSelected(d, c, a);
}, AddMonthCell: function (e, d) {
var a = e.insertCell(e.cells.length);
var b = document.createElement("a");
a.appendChild(b);
b.href = "#";
b.innerHTML = " ";
a.unselectable = "on";
var c = this.MonthNames[d];
if (c) {
a.id = "rcMView_" + c;
b.innerHTML = c;
a.Month = b.Month = d;
var f = this;
b.onclick = function (g) {
if (!g) {
var g = window.event;
}
f.SelectMonth(this.Month);
if (g.preventDefault) {
g.preventDefault();
}
return false;
};
}
return a;
}, GetYear: function () {
return this.Year;
}, GetMonth: function () {
return this.Month;
}, ShowMonthYearView: function (e, h, i, c, j, b, f, d) {
if (!e) {
return;
}
e.EnableScreenBoundaryDetection = this.EnableScreenBoundaryDetection.toUpperCase() == "FALSE" ? false : true;
e.ShowAnimationDuration = parseInt(this.ShowAnimationDuration, 10);
e.ShowAnimationType = parseInt(this.ShowAnimationType, 10);
e.HideAnimationDuration = parseInt(this.HideAnimationDuration, 10);
e.HideAnimationType = parseInt(this.HideAnimationType, 10);
this.Popup = e;
this.StartYear = j - 4;
var g = this.DomElement;
if (!g) {
var a = $get(d + "_wrapperElement");
g = this._appendStylesAndPropertiesToMonthYearView(a.childNodes[0], f);
this.DomElement = g;
} else {
this.SetNavCells();
}
this.FillYears();
this.SetNavCells();
this.SelectYear(j);
this.SelectMonth(c - 1);
this._disableOutOfRangeMonths();
this.ExitFunc = b;
e.Show(h, i, g, Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnExit, this));
}, Show: function (c, f, g, b, h, a, d) {
if (!c) {
return;
}
c.EnableScreenBoundaryDetection = this.EnableScreenBoundaryDetection.toUpperCase() == "FALSE" ? false : true;
c.ShowAnimationDuration = parseInt(this.ShowAnimationDuration, 10);
c.ShowAnimationType = parseInt(this.ShowAnimationType, 10);
c.HideAnimationDuration = parseInt(this.HideAnimationDuration, 10);
c.HideAnimationType = parseInt(this.HideAnimationType, 10);
this.Popup = c;
this.StartYear = h - 4;
var e = this.DomElement;
if (!e) {
e = this.CreateLayout(d);
this.DomElement = e;
} else {
this.SetNavCells();
}
this.FillYears();
this.SelectYear(h);
this._disableOutOfRangeMonths();
this.SelectMonth(b - 1);
this.ExitFunc = a;
c.Show(f, g, e, Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnExit, this));
}, OnExit: function () {
if ("function" == typeof(this.ExitFunc)) {
this.ExitFunc(this.Year, this.Month, this.Date);
this.Date = null;
}
}, OnToday: function (a) {
var b = new Date();
this.Date = b.getDate();
this.Month = b.getMonth();
this.Year = b.getFullYear();
this.Popup.Hide(true);
}, OnOK: function (a) {
this.Popup.Hide(true);
}, OnCancel: function (a) {
this.Popup.Hide();
}, dispose: function () {
if (this.DomElement) {
var a = this.DomElement.getElementsByTagName("a");
for (var b = 0;
b < a.length;
b++) {
a[b].onclick = null;
}
this.DomElement = null;
}
}
};
Telerik.Web.UI.Calendar.MonthYearFastNavigation.registerClass("Telerik.Web.UI.Calendar.MonthYearFastNavigation", null, Sys.IDisposable);
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.Selector = function (f, e, a, c, d, b) {
this.SelectorType = f;
this.RadCalendar = c;
this.RadCalendarView = d;
this.DomElement = b;
this.IsSelected = false;
this.RowIndex = e;
this.ColIndex = a;
var g = this;
};
Telerik.Web.UI.Calendar.Selector.prototype = {
Dispose: function () {
this.disposed = true;
this.DomElement = null;
this.RadCalendar = null;
this.RadCalendarView = null;
}, MouseOver: function () {
var e = document.getElementById(this.RadCalendarView.ID);
switch (this.SelectorType) {
case Telerik.Web.UI.Calendar.Utils.COLUMN_HEADER:
for (var b = 0;
b < this.RadCalendarView.Rows;
b++) {
var c = e.rows[this.RowIndex + b].cells[this.ColIndex].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOver();
}
}
break;
case Telerik.Web.UI.Calendar.Utils.VIEW_HEADER:
for (var b = 0;
b < this.RadCalendarView.Rows;
b++) {
for (var d = 0;
d < this.RadCalendarView.Cols;
d++) {
var c = e.rows[this.RowIndex + b].cells[this.ColIndex + d].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOver();
}
}
}
break;
case Telerik.Web.UI.Calendar.Utils.ROW_HEADER:
for (var b = 0;
b < this.RadCalendarView.Cols;
b++) {
var c = e.rows[this.RowIndex].cells[this.ColIndex + b].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOver();
}
}
break;
}
}, MouseOut: function () {
var e = document.getElementById(this.RadCalendarView.ID);
switch (this.SelectorType) {
case Telerik.Web.UI.Calendar.Utils.COLUMN_HEADER:
for (var b = 0;
b < this.RadCalendarView.Rows;
b++) {
var c = e.rows[this.RowIndex + b].cells[this.ColIndex].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOut();
}
}
break;
case Telerik.Web.UI.Calendar.Utils.VIEW_HEADER:
for (var b = 0;
b < this.RadCalendarView.Rows;
b++) {
for (var d = 0;
d < this.RadCalendarView.Cols;
d++) {
var c = e.rows[this.RowIndex + b].cells[this.ColIndex + d].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOut();
}
}
}
break;
case Telerik.Web.UI.Calendar.Utils.ROW_HEADER:
for (var b = 0;
b < this.RadCalendarView.Cols;
b++) {
var c = e.rows[this.RowIndex].cells[this.ColIndex + b].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(c);
var f = this.RadCalendarView.RenderDays.Get(a);
if (f) {
f.MouseOut();
}
}
break;
}
}, _removeRangeSelection: function () {
var a = this.RadCalendar;
if (a._rangeSelectionMode != Telerik.Web.UI.Calendar.RangeSelectionMode.None) {
a._removeRangeSelection();
a._serializeRangeSelectionDates();
}
}, Click: function () {
switch (this.SelectorType) {
case Telerik.Web.UI.Calendar.Utils.COLUMN_HEADER:
var b = new Telerik.Web.UI.CalendarClickEventArgs(this.DomElement, this.ColIndex);
this._removeRangeSelection();
this.RadCalendar.raise_columnHeaderClick(b);
if (b.get_cancel() == true) {
return;
}
break;
case Telerik.Web.UI.Calendar.Utils.ROW_HEADER:
var b = new Telerik.Web.UI.CalendarClickEventArgs(this.DomElement, this.RowIndex);
this._removeRangeSelection();
this.RadCalendar.raise_rowHeaderClick(b);
if (b.get_cancel() == true) {
return;
}
break;
case Telerik.Web.UI.Calendar.Utils.VIEW_HEADER:
var b = new Telerik.Web.UI.CalendarClickEventArgs(this.DomElement, -1);
this._removeRangeSelection();
this.RadCalendar.raise_viewSelectorClick(b);
if (b.get_cancel() == true) {
return;
}
break;
}
if (this.RadCalendar.get_enableMultiSelect()) {
var f = document.getElementById(this.RadCalendarView.ID);
this.IsSelected = true;
switch (this.SelectorType) {
case Telerik.Web.UI.Calendar.Utils.COLUMN_HEADER:
for (var e = 0;
e < this.RadCalendarView.Rows;
e++) {
var d = f.rows[this.RowIndex + e].cells[this.ColIndex].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (g.IsSelected == false && this.RadCalendar.Selection.CanSelect(a)) {
this.IsSelected = !this.IsSelected;
break;
}
}
for (var c = 0;
c < this.RadCalendarView.Rows;
c++) {
var d = f.rows[this.RowIndex + c].cells[this.ColIndex].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (this.IsSelected) {
if (g.IsSelected) {
g.Select(false, true);
}
} else {
if (!g.IsSelected) {
g.Select(true, true);
}
}
}
break;
case Telerik.Web.UI.Calendar.Utils.VIEW_HEADER:
for (var c = 0;
c < this.RadCalendarView.Rows;
c++) {
for (var e = 0;
e < this.RadCalendarView.Cols;
e++) {
var d = f.rows[this.RowIndex + c].cells[this.ColIndex + e].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (g.IsSelected == false && this.RadCalendar.Selection.CanSelect(a)) {
this.IsSelected = !this.IsSelected;
break;
}
}
if (this.IsSelected == false) {
break;
}
}
for (var c = 0;
c < this.RadCalendarView.Rows;
c++) {
for (var e = 0;
e < this.RadCalendarView.Cols;
e++) {
var d = f.rows[this.RowIndex + c].cells[this.ColIndex + e].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (this.IsSelected) {
if (g.IsSelected) {
g.Select(false, true);
}
} else {
if (!g.IsSelected) {
g.Select(true, true);
}
}
}
}
break;
case Telerik.Web.UI.Calendar.Utils.ROW_HEADER:
for (var e = 0;
e < this.RadCalendarView.Cols;
e++) {
var d = f.rows[this.RowIndex].cells[this.ColIndex + e].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (g.IsSelected == false && this.RadCalendar.Selection.CanSelect(a)) {
this.IsSelected = !this.IsSelected;
break;
}
}
for (var c = 0;
c < this.RadCalendarView.Cols;
c++) {
var d = f.rows[this.RowIndex].cells[this.ColIndex + c].DayId;
var a = Telerik.Web.UI.Calendar.Utils.GetDateFromId(d);
var g = this.RadCalendarView.RenderDays.Get(a);
if (!g) {
continue;
}
if (this.IsSelected) {
if (g.IsSelected) {
g.Select(false, true);
}
} else {
if (!g.IsSelected) {
g.Select(true, true);
}
}
}
break;
}
this.RadCalendar._serializeSelectedDates();
this.RadCalendar._submit("d");
}
}
};
Telerik.Web.UI.Calendar.Selector.registerClass("Telerik.Web.UI.Calendar.Selector");
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.RangeValidation = function (b, a) {
this._rangeMinDate = b;
this._rangeMaxDate = a;
};
Telerik.Web.UI.Calendar.RangeValidation.prototype = {
IsDateValid: function (a) {
return (this.CompareDates(this._rangeMinDate, a) <= 0 && this.CompareDates(a, this._rangeMaxDate) <= 0);
}, CompareDates: function (c, d) {
if (!c || c.length != 3) {
throw new Error("Date1 must be array: [y, m, d]");
}
if (!d || d.length != 3) {
throw new Error("Date2 must be array: [y, m, d]");
}
var g = c[0];
var h = d[0];
if (g < h) {
return -1;
}
if (g > h) {
return 1;
}
var e = c[1];
var f = d[1];
if (e < f) {
return -1;
}
if (e > f) {
return 1;
}
var a = c[2];
var b = d[2];
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
}, InSameMonth: function (a, b) {
return ((a[0] == b[0]) && (a[1] == b[1]));
}
};
Telerik.Web.UI.Calendar.RangeValidation.registerClass("Telerik.Web.UI.Calendar.RangeValidation");
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.Selection = function (b, d, c, a) {
this._specialDays = d;
this._recurringDays = c;
this._enableMultiSelect = a;
this._selectedDates = new Telerik.Web.UI.Calendar.DateCollection();
this._rangeValidation = b;
};
Telerik.Web.UI.Calendar.Selection.prototype = {
CanSelect: function (a) {
if (!this._rangeValidation.IsDateValid(a)) {
return false;
}
var c = this._specialDays.Get(a);
if (c != null) {
return c.IsSelectable != 0;
} else {
var b = this._recurringDays.Get(a);
if (b != null) {
return b.IsSelectable != 0;
} else {
return true;
}
}
}, Add: function (a) {
if (!this.CanSelect(a)) {
return;
}
if (!this._enableMultiSelect) {
this._selectedDates.Clear();
}
this._selectedDates.Add(a, a);
}, Remove: function (a) {
this._selectedDates.Remove(a);
}
};
Telerik.Web.UI.Calendar.Selection.registerClass("Telerik.Web.UI.Calendar.Selection");
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.GregorianCalendar = {
DatePartDay: 3,
DatePartDayOfYear: 1,
DatePartMonth: 2,
DatePartYear: 0,
DaysPer100Years: 36524,
DaysPer400Years: 146097,
DaysPer4Years: 1461,
DaysPerYear: 365,
DaysTo10000: 3652059,
DaysToMonth365: [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365],
DaysToMonth366: [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366],
MaxMillis: 315537897600000,
MillisPerDay: 86400000,
MillisPerHour: 3600000,
MillisPerMinute: 60000,
MillisPerSecond: 1000,
MaxYear: 9999,
GetDateFromArguments: function () {
var c, b, a;
switch (arguments.length) {
case 1:
var a = arguments[0];
if ("object" != typeof(a)) {
throw new Error("Unsupported input format");
}
if (a.getDate) {
c = a.getFullYear();
b = a.getMonth() + 1;
a = a.getDate();
} else {
if (3 == a.length) {
c = a[0];
b = a[1];
a = a[2];
} else {
throw new Error("Unsupported input format");
}
}
break;
case 3:
c = arguments[0];
b = arguments[1];
a = arguments[2];
break;
default:
throw new Error("Unsupported input format");
break;
}
c = parseInt(c);
if (isNaN(c)) {
throw new Error("Invalid YEAR");
}
b = parseInt(b);
if (isNaN(b)) {
throw new Error("Invalid MONTH");
}
a = parseInt(a);
if (isNaN(a)) {
throw new Error("Invalid DATE");
}
return [c, b, a];
},
DateToTicks: function () {
var a = this.GetDateFromArguments.apply(null, arguments);
var d = a[0];
var c = a[1];
var b = a[2];
return (this.GetAbsoluteDate(d, c, b));
},
GetAbsoluteDate: function (h, f, b) {
if (h < 1 || h > this.MaxYear + 1) {
throw new Error("Year is out of range [1..9999].");
}
if (f < 1 || f > 12) {
throw new Error("Month is out of range [1..12].");
}
var e = ((h % 4 == 0) && ((h % 100 != 0) || (h % 400 == 0)));
var a = e ? this.DaysToMonth366 : this.DaysToMonth365;
var c = a[f] - a[f - 1];
if (b < 1 || b > c) {
throw new Error("Day is out of range for the current month.");
}
var d = h - 1;
var g = d * this.DaysPerYear + this.GetInt(d / 4) - this.GetInt(d / 100) + this.GetInt(d / 400) + a[f - 1] + b - 1;
return g;
},
GetDatePartDay: function (f) {
var a = this.GetInt(f);
var b = this.GetInt(a / this.DaysPer400Years);
a -= b * this.DaysPer400Years;
var c = this.GetInt(a / this.DaysPer100Years);
if (c == 4) {
c = 3;
}
a -= c * this.DaysPer100Years;
var d = this.GetInt(a / this.DaysPer4Years);
a -= d * this.DaysPer4Years;
var e = this.GetInt(a / this.DaysPerYear);
if (e == 4) {
e = 3;
}
a -= e * 365;
return (a + 1);
},
TicksToDate: function (j) {
var i = [, ,];
var b = this.GetInt(j);
var c = this.GetInt(b / this.DaysPer400Years);
b -= c * this.DaysPer400Years;
var d = this.GetInt(b / this.DaysPer100Years);
if (d == 4) {
d = 3;
}
b -= d * this.DaysPer100Years;
var e = this.GetInt(b / this.DaysPer4Years);
b -= e * this.DaysPer4Years;
var f = this.GetInt(b / this.DaysPerYear);
if (f == 4) {
f = 3;
}
i[0] = (((((c * 400) + (d * 100)) + (e * 4)) + f) + 1);
b -= f * 365;
var a = (f == 3) && ((e != 24) || (d == 3));
var h = a ? this.DaysToMonth366 : this.DaysToMonth365;
var g = b >> 6;
while (b >= h[g]) {
g++;
}
i[1] = g;
i[2] = ((b - h[g - 1]) + 1);
return i;
},
GetDayOfMonth: function (a) {
return this.TicksToDate(this.DateToTicks(a))[2] + 1;
},
GetDayOfWeek: function (a) {
var b = this.DateToTicks(a);
var c = b + 1;
return this.GetInt(c % 7);
},
AddMonths: function (a, d) {
var b = this.DateToTicks(a);
var c = this.TicksToDate(b);
var e = c[0];
var f = c[1];
var g = c[2];
var h = this.GetInt((f - 1) + d);
if (h >= 0) {
f = this.GetInt((h % 12) + 1);
e += this.GetInt((h / 12));
} else {
f = this.GetInt(12 + ((h + 1) % 12));
e += this.GetInt((h - 11) / 12);
}
var j = (((e % 4) == 0) && (((e % 100) != 0) || ((e % 400) == 0))) ? this.DaysToMonth366 : this.DaysToMonth365;
var i = j[f] - j[f - 1];
if (g > i) {
g = i;
}
return [e, f, g];
},
AddYears: function (a, b) {
return this.AddMonths(a, b * 12);
},
AddDays: function (a, c) {
var b = this.DateToTicks(a);
var e = this.GetInt(c);
var d = b + e;
if (d < 0) {
d = 0;
}
return this.TicksToDate(d);
},
GetWeekOfYear: function (a, c, b) {
switch (c) {
case Telerik.Web.UI.Calendar.Utils.FIRST_DAY:
return this.GetInt(this.GetFirstDayWeekOfYear(a, b));
case Telerik.Web.UI.Calendar.Utils.FIRST_FULL_WEEK:
return this.GetInt(this.InternalGetWeekOfYearFullDays(a, b, 7, 365));
case Telerik.Web.UI.Calendar.Utils.FIRST_FOUR_DAY_WEEK:
return this.GetInt(this.InternalGetWeekOfYearFullDays(a, b, 4, 365));
}
},
InternalGetWeekOfYearFullDays: function (i, b, c, a) {
var g = this.GetDayOfYear(i) - 1;
var d = ((this.GetDayOfWeek(i)) - (g % 7));
var e = ((b - d) + 14) % 7;
if ((e != 0) && (e >= c)) {
e -= 7;
}
var f = g - e;
if (f >= 0) {
return ((f / 7) + 1);
}
var h = this.GetYear(i);
g = this.GetDaysInYear(h - 1);
d -= (g % 7);
e = ((b - d) + 14) % 7;
if ((e != 0) && (e >= c)) {
e -= 7;
}
f = g - e;
return ((f / 7) + 1);
},
GetFirstDayWeekOfYear: function (a, b) {
var c = this.GetDayOfYear(a) - 1;
var d = (this.GetDayOfWeek(a)) - (c % 7);
var e = ((d - b) + 14) % 7;
return (((c + e) / 7) + 1);
},
GetLeapMonth: function (a) {
var a = this.GetGregorianYear(a);
return 0;
},
GetMonth: function (a) {
return this.TicksToDate(this.DateToTicks(a))[1];
},
GetMonthsInYear: function (a) {
var a = this.GetGregorianYear(a);
return 12;
},
GetDaysInMonth: function (c, a) {
var c = this.GetGregorianYear(c);
var b = (((c % 4) == 0) && (((c % 100) != 0) || ((c % 400) == 0))) ? this.DaysToMonth366 : this.DaysToMonth365;
return (b[a] - b[a - 1]);
},
GetDaysInYear: function (a) {
var a = this.GetGregorianYear(a);
if (((a % 4) == 0) && (((a % 100) != 0) || ((a % 400) == 0))) {
return 366;
}
return 365;
},
GetDayOfYear: function (a) {
return this.GetInt(this.GetDatePartDay(this.DateToTicks(a)));
},
GetGregorianYear: function (a) {
return a;
},
GetYear: function (a) {
return this.TicksToDate(this.DateToTicks(a))[0];
},
IsLeapDay: function (a) {
var d = a.getFullYear();
var c = a.getMonth();
var b = a.getDate();
if (this.IsLeapYear(a) && ((c == 2) && (b == 29))) {
return true;
}
return false;
},
IsLeapMonth: function (a) {
var c = a.getFullYear();
var b = a.getMonth();
if (this.IsLeapYear(a)) {
if (b == 2) {
return true;
}
}
return false;
},
IsLeapYear: function (a) {
var b = a.getFullYear();
if ((b % 4) != 0) {
return false;
}
if ((b % 100) == 0) {
return ((b % 400) == 0);
}
return true;
},
GetInt: function (a) {
return a | a;
}
};
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.DateCollection = function () {
this.Initialize();
this._lastInsertedKey = null;
};
Telerik.Web.UI.Calendar.DateCollection.prototype = {
Initialize: function () {
this.Container = {};
}, GetStringKey: function (a) {
return a.join("-");
}, Add: function (b, a) {
if (!b || !a) {
return;
}
var c = this.GetStringKey(b);
this.Container[c] = a;
this._lastInsertedKey = b;
}, Remove: function (a) {
if (!a) {
return;
}
var b = this.GetStringKey(a);
if (this.Container[b] != null) {
this.Container[b] = null;
delete this.Container[b];
}
}, Clear: function () {
this.Initialize();
}, Get: function (a) {
if (a) {
return this.Container[a.join("-")];
}
}, GetValues: function () {
var b = [];
for (var a in this.Container) {
if (a.indexOf("-") == -1) {
continue;
}
b[b.length] = this.Container[a];
}
return b;
}, Count: function () {
return this.GetValues().length;
}
};
Telerik.Web.UI.Calendar.DateCollection.registerClass("Telerik.Web.UI.Calendar.DateCollection");
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.CalendarView = function (K, l, t, d, O, x, Y, X, I, m) {
this._onClickDelegate = null;
this._onMouseOverDelegate = null;
this._onMouseOutDelegate = null;
this._onKeyDownDelegate = null;
this._SingleViewMatrix = l;
this._ViewInMonthDate = m;
this.MonthsInView = 1;
this._MonthStartDate = null;
this._MonthDays = null;
this._MonthEndDate = null;
this._ViewStartDate = null;
this._ContentRows = O;
this._ContentColumns = d;
this._TitleContent = null;
this.RadCalendar = K;
this.DateTimeFormatInfo = K ? K.DateTimeFormatInfo : null;
this.Calendar = this.DateTimeFormatInfo ? this.DateTimeFormatInfo.Calendar : null;
if (!x) {
this.SetViewDateRange();
}
this.DomTable = l;
this.ID = t;
this.Cols = d;
this.Rows = O;
this.IsMultiView = x;
if (x) {
return;
}
if (!this.RadCalendar.get_enabled()) {
return;
}
var o = false;
var n = false;
var q = false;
var p = false;
this.UseRowHeadersAsSelectors = Y;
this.UseColumnHeadersAsSelectors = X;
var N = 0;
var c = l.rows[N].cells[0].id;
if (c.indexOf("_hd") > -1) {
o = true;
c = l.rows[++N].cells[0].id;
}
if (c.indexOf("_vs") > -1) {
q = true;
}
var e = l.rows[N].cells.length - this.Cols;
if (l.rows[N].cells[e] && l.rows[N].cells[e].id.indexOf("_cs") > -1) {
n = true;
}
var M = l.rows.length - this.Rows;
if (l.rows[N + M] && l.rows[N + M].cells[0].id.indexOf("_rs") > -1) {
p = true;
}
var T = 0;
var S = 0;
if (o) {
T++;
}
if (n || q) {
T++;
}
if (p || q) {
S++;
}
this.StartRowIndex = T;
this.StartColumnIndex = S;
var a = [];
if (I == Telerik.Web.UI.Calendar.Utils.RENDERINROWS) {
a = this.ComputeHeaders(O, d);
}
if (I == Telerik.Web.UI.Calendar.Utils.RENDERINCOLUMNS) {
a = this.ComputeHeaders(d, O);
}
if (!x) {
this.RenderDays = new Telerik.Web.UI.Calendar.DateCollection();
for (var s = T;
s < l.rows.length;
s++) {
var L = l.rows[s];
for (var D = S;
D < L.cells.length;
D++) {
var g = L.cells[D];
if (typeof(g.DayId) == "undefined") {
g.DayId = "";
}
var J = this.GetDate(s - T, D - S, d, O, this._ViewStartDate);
var w = !this.RadCalendar.RangeValidation.IsDateValid(J);
var v = !((this.RadCalendar.RangeValidation.CompareDates(J, this._MonthStartDate) >= 0) && (this.RadCalendar.RangeValidation.CompareDates(this._MonthEndDate, J) >= 0));
if (w || (v && !this.RadCalendar.get_showOtherMonthsDays())) {
continue;
}
if (isNaN(J[0]) || isNaN(J[1]) || isNaN(J[2])) {
continue;
}
var h = g.DayId;
if (!h) {
g.DayId = this.RadCalendar.get_id() + "_" + J.join("_");
h = g.DayId;
}
if (!h) {
continue;
}
var P = this.RadCalendar.SpecialDays.Get(J);
var k = this.Calendar.GetDayOfWeek(J);
var C = (0 == k || 6 == k);
var B = (P && P.Repeatable == Telerik.Web.UI.Calendar.Utils.RECURRING_TODAY);
var u = P ? Boolean(P.IsDisabled) : false;
var z;
if (u) {
z = false;
} else {
z = P ? Boolean(P.IsSelectable) : true;
}
var A;
if (!z) {
A = false;
} else {
A = (P && Boolean(P.IsSelected)) || (null != this.RadCalendar.Selection._selectedDates.Get(J));
}
var y = P ? P.Repeatable : null;
var W = P ? P.ToolTip : null;
var V = (J[1] == this._MonthStartDate[1]);
var R = null;
if (P) {
var Q = "SpecialDayStyle_" + P.get_date().join("_");
R = P.ItemStyle[Q];
}
var U = P ? P.ItemStyle : this.RadCalendar._getItemStyle(!V, w, C, A, u, R);
var f = [null, J, z, A, u, B, y, C, W, U, g, this.RadCalendar, h, this, s - T, D - S];
var F = new Telerik.Web.UI.Calendar.RenderDay(f);
this.RenderDays.Add(F.get_date(), F);
}
}
var r = Math.max(T - 1, 0);
if (I == Telerik.Web.UI.Calendar.Utils.RENDERINCOLUMNS && n) {
for (var s = 0;
s < this.Cols;
s++) {
var b = l.rows[r].cells[S + s];
if (this.isNumber(b.innerHTML)) {
b.innerHTML = a[s];
} else {
break;
}
}
}
if (I == Telerik.Web.UI.Calendar.Utils.RENDERINROWS && p) {
for (var s = 0;
s < this.Rows;
s++) {
var b = l.rows[T + s].cells[0];
if (this.isNumber(b.innerHTML)) {
b.innerHTML = a[s];
} else {
break;
}
}
}
if (this.RadCalendar.get_presentationType() == 2) {
return;
}
this._onClickDelegate = Function.createDelegate(this, this._onClickHandler);
this._onMouseOverDelegate = Function.createDelegate(this, this._onMouseOverHandler);
this._onMouseOutDelegate = Function.createDelegate(this, this._onMouseOutHandler);
this._onKeyDownDelegate = Function.createDelegate(this, this._onKeyDownHandler);
$addHandler(this.DomTable, "click", this._onClickDelegate);
$addHandler(this.DomTable, "mouseover", this._onMouseOverDelegate);
$addHandler(this.DomTable, "mouseout", this._onMouseOutDelegate);
$addHandler(this.DomTable, "keydown", this._onKeyDownDelegate);
}
this.ColumnHeaders = [];
if (n && this.UseColumnHeadersAsSelectors) {
for (s = 0;
s < this.Cols;
s++) {
var b = l.rows[r].cells[S + s];
var E = new Telerik.Web.UI.Calendar.Selector(Telerik.Web.UI.Calendar.Utils.COLUMN_HEADER, T, S + s, this.RadCalendar, this, b);
this.ColumnHeaders[s] = E;
}
}
this.RowHeaders = [];
if (p && this.UseRowHeadersAsSelectors) {
for (s = 0;
s < this.Rows;
s++) {
var b = l.rows[T + s].cells[0];
var G = new Telerik.Web.UI.Calendar.Selector(Telerik.Web.UI.Calendar.Utils.ROW_HEADER, T + s, 1, this.RadCalendar, this, b);
this.RowHeaders[s] = G;
}
}
this.ViewSelector = null;
if (q) {
var H = new Telerik.Web.UI.Calendar.Selector(Telerik.Web.UI.Calendar.Utils.VIEW_HEADER, r + 1, 1, this.RadCalendar, this, l.rows[r].cells[0]);
this.ViewSelector = H;
}
};
Telerik.Web.UI.Calendar.CalendarView.prototype = {
_onKeyDownHandler: function (a) {
this._raiseKeyPressInternal(a);
}, _raiseKeyPressInternal: function (a) {
if ((this.RadCalendar._enableKeyboardNavigation) && (!this.RadCalendar._enableMultiSelect)) {
var c = a.keyCode ? a.keyCode : a.charCode;
var d = this._performSelectionOnFirstDateOfMonth(c);
if (!d) {
var b = this._navigateToDate(c);
}
if (b || d || c == 13 || c == 32) {
if (a.preventDefault) {
a.preventDefault();
}
a.returnValue = false;
return false;
}
}
}, _onMouseOverHandler: function (a) {
this._onGenericHandler(a, "MouseOver");
}, _onMouseOutHandler: function (a) {
this._onGenericHandler(a, "MouseOut");
}, _onClickHandler: function (a) {
if ((this.RadCalendar._enableKeyboardNavigation) && (!this.RadCalendar._enableMultiSelect)) {
this.DomTable.tabIndex = 100;
this.DomTable.focus();
this.RadCalendar._nextFocusedCell = null;
this.RadCalendar._hoveredDate = null;
this._removeHoverStyles(this.DomTable);
}
this._onGenericHandler(a, "Click");
}, _onGenericHandler: function (b, c) {
if (this.RadCalendar == null) {
return;
}
var h = Telerik.Web.UI.Calendar.Utils.FindTarget(b, this.RadCalendar.get_id());
if (h == null) {
return;
}
if (h.DayId) {
var f = Telerik.Web.UI.Calendar.Utils.GetRenderDay(this, h.DayId);
if (f != null) {
if (c == "Click") {
f[c].apply(f, [b]);
} else {
f[c].apply(f);
}
}
} else {
if (h.id != null && h.id != "") {
if (h.id.indexOf("_cs") > -1) {
for (var d = 0;
d < this.ColumnHeaders.length;
d++) {
var a = this.ColumnHeaders[d];
if (a.DomElement.id == h.id) {
a[c].apply(a);
}
}
} else {
if (h.id.indexOf("_rs") > -1) {
for (var d = 0;
d < this.RowHeaders.length;
d++) {
var g = this.RowHeaders[d];
if (g.DomElement.id == h.id) {
g[c].apply(g);
}
}
} else {
if (h.id.indexOf("_vs") > -1) {
this.ViewSelector[c].apply(this.ViewSelector);
}
}
}
}
}
}, isNumber: function (b) {
if (isNaN(parseInt(b))) {
return false;
} else {
return true;
}
}, ComputeHeaders: function (g, f) {
var a = [];
var b = this._ViewStartDate;
for (var d = 0;
d < g;
d++) {
if (f <= 7) {
var e = this.Calendar.AddDays(b, f - 1);
if (e[2] < b[2]) {
var c = [e[0], e[1], 1];
a[a.length] = this.GetWeekOfYear(c);
} else {
a[a.length] = this.GetWeekOfYear(b);
}
b = this.Calendar.AddDays(e, 1);
} else {
var e = this.Calendar.AddDays(b, 6);
if (e[2] < b[2]) {
var c = [e[0], e[1], 1];
a[a.length] = this.GetWeekOfYear(c);
} else {
a[a.length] = this.GetWeekOfYear(b);
}
b = this.Calendar.AddDays(e, f - 6);
}
}
return a;
}, GetDate: function (f, b, a, g, e) {
var d;
if (this.RadCalendar.get_orientation() == Telerik.Web.UI.Calendar.Utils.RENDERINROWS) {
d = (a * f) + b;
} else {
if (this.RadCalendar.get_orientation() == Telerik.Web.UI.Calendar.Utils.RENDERINCOLUMNS) {
d = (g * b) + f;
}
}
var c = this.Calendar.AddDays(e, d);
return c;
}, dispose: function () {
if (this.disposed) {
return;
}
this.disposed = true;
if (this.RenderDays != null) {
var a = this.RenderDays.GetValues();
for (var b = 0;
b < a.length;
b++) {
a[b].dispose();
}
this.RenderDays.Clear();
}
if (this.ColumnHeaders != null) {
for (var b = 0;
b < this.ColumnHeaders.length;
b++) {
this.ColumnHeaders[b].Dispose();
}
}
this.ColumnHeaders = null;
if (this.RowHeaders != null) {
for (var b = 0;
b < this.RowHeaders.length;
b++) {
this.RowHeaders[b].Dispose();
}
}
$clearHandlers(this.DomTable);
this.genericHandler = null;
this.RowHeaders = null;
if (this.ViewSelector != null) {
this.ViewSelector.Dispose();
}
this.ViewSelector = null;
this._SingleViewMatrix = null;
this._ContentRows = null;
this._ContentColumns = null;
this.RadCalendar.RecurringDays.Clear();
this.RadCalendar = null;
this.Calendar = null;
this.DomTable = null;
this.Cols = null;
this.Rows = null;
}, GetWeekOfYear: function (a) {
return this.Calendar.GetWeekOfYear(a, this.DateTimeFormatInfo.CalendarWeekRule, this.NumericFirstDayOfWeek());
}, NumericFirstDayOfWeek: function () {
if (this.RadCalendar._firstDayOfWeek != Telerik.Web.UI.Calendar.Utils.DEFAULT) {
return this.RadCalendar._firstDayOfWeek;
}
return this.DateTimeFormatInfo.FirstDayOfWeek;
}, EffectiveVisibleDate: function () {
var a = this._ViewInMonthDate || this.RadCalendar.FocusedDate;
return [a[0], a[1], 1];
}, FirstCalendarDay: function (c) {
var b = c;
var a = (this.Calendar.GetDayOfWeek(b)) - this.NumericFirstDayOfWeek();
if (a <= 0) {
a += 7;
}
return this.Calendar.AddDays(b, -a);
}, SetViewDateRange: function () {
var a = (this.RadCalendar._viewIDs.length > 1);
if (!a) {
this._MonthStartDate = this.EffectiveVisibleDate();
} else {
this._MonthStartDate = this.RadCalendar.get__ViewsHash()[this._SingleViewMatrix.id][0];
}
this._MonthDays = this.Calendar.GetDaysInMonth(this._MonthStartDate[0], this._MonthStartDate[1]);
this._MonthEndDate = this.Calendar.AddDays(this._MonthStartDate, this._MonthDays - 1);
this._ViewStartDate = this.FirstCalendarDay(this._MonthStartDate);
this._ViewEndDate = this.Calendar.AddDays(this._ViewStartDate, (this._ContentRows * this._ContentColumns - 1));
this.GetTitleContentAsString();
}, GetTitleContentAsString: function () {
if (!this.IsMultiView) {
this._TitleContent = this.DateTimeFormatInfo.FormatDate(this.EffectiveVisibleDate(), this.RadCalendar.get_titleFormat());
} else {
this._TitleContent = this.DateTimeFormatInfo.FormatDate(this._ViewStartDate, this.RadCalendar.get_titleFormat()) + this.RadCalendar.get_dateRangeSeparator() + this.DateTimeFormatInfo.FormatDate(this._ViewEndDate, this.RadCalendar.get_titleFormat());
}
return this._TitleContent;
}, RenderDaysSingleView: function () {
this.SetViewDateRange();
var a = this.EffectiveVisibleDate();
var b = this.FirstCalendarDay(a);
var d = this._SingleViewMatrix;
this.RenderViewDays(d, b, a, this.RadCalendar.get_orientation(), this.StartRowIndex, this.StartColumnIndex);
this.ApplyViewTable(d, this.ScrollDir || 0);
var c = $get(this.RadCalendar._titleID);
if (c) {
c.innerHTML = this._TitleContent;
}
return d;
}, RenderViewDays: function (k, d, n, g, m, l) {
var c = d;
var h, a;
if (g == Telerik.Web.UI.Calendar.Utils.RENDERINROWS) {
for (var e = m;
e < k.rows.length;
e++) {
var h = k.rows[e];
for (var f = l;
f < h.cells.length;
f++) {
a = h.cells[f];
this.SetCalendarCell(a, c, e, f);
c = this.Calendar.AddDays(c, 1);
}
}
} else {
if (g == Telerik.Web.UI.Calendar.Utils.RENDERINCOLUMNS) {
var b = k.rows[0].cells.length;
for (var e = l;
e < b;
e++) {
for (var f = m;
f < k.rows.length;
f++) {
a = k.rows[f].cells[e];
this.SetCalendarCell(a, c, f, e);
c = this.Calendar.AddDays(c, 1);
}
}
}
}
}, SetCalendarCell: function (a, f, x, d) {
var m = !this.RadCalendar.RangeValidation.IsDateValid(f);
var F = (f[1] == this._MonthStartDate[1]);
var E = this.DateTimeFormatInfo.FormatDate(f, this.RadCalendar.get_cellDayFormat());
var y = this.RadCalendar.SpecialDays.Get(f);
if (this.RadCalendar.get_enableRepeatableDaysOnClient() && y == null) {
var w = Telerik.Web.UI.Calendar.Utils.RECURRING_NONE;
var B = this.RadCalendar.SpecialDays.GetValues();
for (var k = 0;
k < B.length;
k++) {
w = B[k].IsRecurring(f, this);
if (w != Telerik.Web.UI.Calendar.Utils.RECURRING_NONE) {
y = B[k];
this.RadCalendar.RecurringDays.Add(f, y);
break;
}
}
}
var n = this.RadCalendar.Selection._selectedDates.Get(f) != null;
if (F || (!F && this.RadCalendar.get_showOtherMonthsDays())) {
if (!m && (!y || y.IsSelectable && !y.IsDisabled)) {
E = "<a href='#' onclick='return false;'>" + E + "</a>";
} else {
E = "<span>" + E + "</span>";
}
} else {
E = " ";
}
var h = this.Calendar.GetDayOfWeek(f);
var p = (0 == h || 6 == h);
var l = y ? y.IsDisabled : false;
var o = (y && y.Repeatable == Telerik.Web.UI.Calendar.Utils.RECURRING_TODAY);
a.innerHTML = E;
if ($telerik.isIE) {
var q = a.getElementsByTagName("a");
if (q.length > 0) {
q[0].href = "#";
}
}
var C = null;
if (y) {
var A = "SpecialDayStyle_" + y.get_date().join("_");
C = y.ItemStyle[A];
}
var D = this.RadCalendar._getItemStyle(!F, m, p, n, l, C);
if (D) {
var c = this.RadCalendar.get__DayRenderChangedDays()[f.join("_")];
if (c != null && (F || (!F && this.RadCalendar.get_showOtherMonthsDays()))) {
a.style.cssText = Telerik.Web.UI.Calendar.Utils.MergeStyles(c[0], D[0]);
a.className = Telerik.Web.UI.Calendar.Utils.MergeClassName(c[1], D[1]);
} else {
a.style.cssText = D[0];
a.className = D[1];
}
}
var g = this.RadCalendar._getRenderDayID(f);
a.DayId = (!F && !this.RadCalendar.get_showOtherMonthsDays()) ? "" : g;
var t = null;
if (!m) {
var e = [null, f, true, n, null, o, null, p, null, D, a, this.RadCalendar, g, this, x, d];
t = new Telerik.Web.UI.Calendar.RenderDay(e);
this.RenderDays.Add(t.get_date(), t);
} else {
if (a.RenderDay != null) {
if (a.RenderDay.disposed == null) {
a.RenderDay.Dispose();
}
a.RenderDay = null;
this.RenderDays.Remove(f);
}
}
var b = "";
var z = this.RadCalendar.SpecialDays.Get(f);
if (z != null && z.ToolTip != null) {
b = z.ToolTip;
} else {
if (typeof(this.RadCalendar.get_dayCellToolTipFormat()) != "undefined") {
b = this.DateTimeFormatInfo.FormatDate(f, this.RadCalendar.get_dayCellToolTipFormat());
}
}
if (!this.RadCalendar.get_showOtherMonthsDays() && a.DayId == "") {
a.title = "";
} else {
if (this.RadCalendar._showDayCellToolTips) {
a.title = b;
}
}
var v = a.style.cssText;
var u = a.className;
var j = new Telerik.Web.UI.CalendarDayRenderEventArgs(a, f, t);
this.RadCalendar.raise_dayRender(j);
var s = a.style.cssText;
var r = a.className;
if (v != s || u != r) {
if (this.RadCalendar.get__DayRenderChangedDays()[f.join("_")] == null) {
this.RadCalendar.get__DayRenderChangedDays()[f.join("_")] = ["", "", "", ""];
}
this.RadCalendar.get__DayRenderChangedDays()[f.join("_")][2] = s;
this.RadCalendar.get__DayRenderChangedDays()[f.join("_")][3] = r;
}
}, ApplyViewTable: function (f, b) {
this.RadCalendar._enableNavigation(false);
this.RadCalendar.EnableDateSelect = false;
var m = this._SingleViewMatrix;
var h = m.parentNode;
var n = h.scrollWidth;
var d = h.scrollHeight;
var g = document.createElement("div");
g.style.overflow = "hidden";
g.style.width = n + "px";
g.style.height = d + "px";
g.style.border = "0px solid red";
var e = document.createElement("div");
e.style.width = 2 * n + "px";
e.style.height = d + "px";
e.style.border = "0px solid blue";
g.appendChild(e);
if (m.parentNode) {
m.parentNode.removeChild(m);
}
if (f.parentNode) {
f.parentNode.removeChild(f);
}
if (!document.all) {
m.style.setProperty("float", "left", "");
f.style.setProperty("float", "left", "");
}
var a = 0;
if (b > 0) {
a = 1;
e.appendChild(m);
f.parentNode.removeChild(f);
e.appendChild(f);
} else {
if (b < 0) {
a = -1;
e.appendChild(f);
m.parentNode.removeChild(m);
e.appendChild(m);
}
}
h.appendChild(g);
if (b < 0 && this.RadCalendar.get_enableNavigationAnimation() == true) {
g.scrollLeft = h.offsetWidth + 10;
}
var l = this;
var k = 10;
var c = function () {
if (g.parentNode) {
g.parentNode.removeChild(g);
}
if (e.parentNode) {
e.parentNode.removeChild(e);
}
if (m.parentNode) {
m.parentNode.removeChild(m);
}
h.appendChild(f);
l.RadCalendar._enableNavigation(true);
l.RadCalendar.EnableDateSelect = true;
};
var i = function () {
if ((a > 0 && (g.scrollLeft + g.offsetWidth) < g.scrollWidth) || (a < 0 && g.scrollLeft > 0)) {
g.scrollLeft += a * k;
window.setTimeout(i, 10);
} else {
c();
}
};
var j = function () {
window.setTimeout(i, 100);
};
if (!this.RadCalendar._isRtl() && this.RadCalendar.get_enableNavigationAnimation() == true) {
j();
} else {
c();
}
}, _performSelectionOnFirstDateOfMonth: function (d) {
this._selectFocusedDate(d);
var b = this.RadCalendar.get_selectedDates()[0];
var a = this.RadCalendar._hoveredDateTriplet;
if (d >= 37 && d <= 40) {
if ((b == null) && (this.RadCalendar._nextFocusedCell == null)) {
var c = this._selectFirstDateOfTheCalendarView();
this.RadCalendar._hoveredDateTriplet = c;
this.RadCalendar._hoveredDate = new Date(c[0], c[1] - 1, c[2]);
return true;
}
if (b != null) {
this.RadCalendar._hoveredDateTriplet = b;
a = b;
}
if (!this.RadCalendar._hoveredDate) {
if (a == null) {
this.RadCalendar._hoveredDateTriplet = this._selectFirstDateOfTheCalendarView();
return true;
}
this.RadCalendar._hoveredDate = new Date(a[0], a[1] - 1, a[2]);
}
}
return false;
}, _selectFocusedDate: function (b) {
if (b == 13 || b == 32) {
if (this.RadCalendar._nextFocusedCell != null) {
var c = new Array();
var a = this.RadCalendar._hoveredDate;
c.push(a.getFullYear());
c.push(a.getMonth() + 1);
c.push(a.getDate());
this.RadCalendar.selectDate(c, false);
}
}
}, _navigateToDate: function (b) {
var a = false;
switch (b) {
case 37:
this._moveLeft(this.RadCalendar._hoveredDate, b);
a = true;
break;
case 38:
this._moveTop(this.RadCalendar._hoveredDate, b);
a = true;
break;
case 39:
this._moveRight(this.RadCalendar._hoveredDate, b);
a = true;
break;
case 40:
this._moveBottom(this.RadCalendar._hoveredDate, b);
a = true;
break;
default:
break;
}
return a;
}, _addClassAndGetFocus: function (b, a) {
if (b.className.indexOf("rcHover") < 0) {
b.className = "rcHover " + b.className;
}
if (this.RadCalendar && this.RadCalendar.get_enableAriaSupport()) {
var c = b.getElementsByTagName("a")[0];
if (c) {
c.tabIndex = 0;
}
}
a.tabIndex = 100;
if (a.offsetWidth) {
a.focus();
}
}, _selectFirstDateOfTheCalendarView: function () {
var b = this.RadCalendar.CurrentViews[0];
var a = this._getAllCells(b.DomTable);
var f = b._MonthStartDate[2].toString();
var g = b._MonthStartDate;
for (var e = 0;
e < a.length;
e++) {
if (a[e].tagName.toUpperCase() == "TD" && a[e].DayId != "") {
var c = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a[e].DayId)[2];
if (c == f) {
this.RadCalendar._nextFocusedCell = a[e];
var d = this.DomTable;
this._addClassAndGetFocus(this.RadCalendar._nextFocusedCell, d);
return g;
}
}
}
}, _getNewSelectedDate: function (b, c, a) {
c = this._addDays(this.RadCalendar._hoveredDate, a);
this.RadCalendar._hoveredDate = c;
if (b) {
this._navigateToNextMonthView();
} else {
this._navigateToPreviousMonthView();
}
return c;
}, _getPreviousSibling: function (a) {
var b = a.previousSibling;
if (b && b.nodeType == 3) {
return null;
} else {
return b;
}
}, _getNextSibling: function (a) {
var b = a.nextSibling;
if (b && b.nodeType == 3) {
return null;
} else {
return b;
}
}, _getFirstChild: function (a) {
var b = a.firstChild;
if (a.nodeType == 3) {
return null;
}
if (b && b.nodeType == 3) {
return b.nextSibling;
} else {
return b;
}
}, _getLastChild: function (a) {
var b = a.lastChild;
if (b && b.nodeType == 3) {
return b.previousSibling;
} else {
return b;
}
}, _moveLeft: function (d, f) {
var i = null;
var c = this.DomTable;
var e = false;
var a = this.RadCalendar;
var h = a.RangeMinDate;
var g = new Date(h[0], h[1] - 1, h[2]);
var j = null;
if (d <= g) {
return;
}
if (!a._nextFocusedCell) {
var k = $telerik.getElementByClassName(c, "rcSelected", "td");
if (this._getPreviousSibling(k.parentNode) == null) {
i = this._getNewSelectedDate(false, i, -1);
e = true;
f = 38;
a._nextFocusedCell = this._hoverLastDateOfMonth(a, f, i);
} else {
if (k.previousSibling && k.previousSibling.className && k.previousSibling.className.indexOf("rcOtherMonth") > -1) {
i = this._getNewSelectedDate(true, i, -1);
e = true;
f = 40;
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, f, i);
} else {
j = k;
a._nextFocusedCell = k.previousSibling;
}
}
} else {
this._removeHoverStyles(c);
j = a._nextFocusedCell;
a._nextFocusedCell = a._nextFocusedCell.previousSibling;
}
var b = a._nextFocusedCell;
if (!b) {
a._nextFocusedCell = this._getLastChild(j.parentNode.previousSibling);
}
if (b && b.tagName && b.tagName.toUpperCase() == "TH" || (b && !b.tagName && !a._showRowHeaders)) {
a._nextFocusedCell = this._getLastChild(b.parentNode.previousSibling);
}
this._addClassAndGetFocus(a._nextFocusedCell, c);
if (!e) {
i = this._addDays(d, -1);
a._hoveredDate = i;
a._nextFocusedCell = this._moveCurentViewToNextPrev(d, i, f);
this._addClassAndGetFocus(a._nextFocusedCell, c);
}
}, _moveRight: function (c, e) {
var h = null;
var b = this.DomTable;
var a = this.RadCalendar;
var d = false;
var g = a.RangeMaxDate;
var f = new Date(g[0], g[1] - 1, g[2]);
if (c >= f) {
return;
}
if (!a._nextFocusedCell) {
var j = $telerik.getElementByClassName(b, "rcSelected", "td");
if (j.parentNode.nextSibling == null) {
h = this._getNewSelectedDate(true, h, 1);
e = 40;
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, e, h);
d = true;
} else {
if (this._getNextSibling(j) == null) {
a._nextFocusedCell = this._getFirstChild(j.parentNode.nextSibling);
if (a._nextFocusedCell == null) {
h = this._getNewSelectedDate(true, h, 1);
e = 40;
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, e, h);
d = true;
}
} else {
if ((j.nextSibling.className.indexOf("rcOtherMonth") > -1) && (this._getPreviousSibling(j.parentNode) != null)) {
h = this._getNewSelectedDate(true, h, 1);
e = 40;
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, e, h);
d = true;
} else {
if (j.nextSibling.className.indexOf("rcOtherMonth") > -1) {
h = this._getNewSelectedDate(false, h, 1);
e = 38;
a._nextFocusedCell = this._hoverLastDateOfMonth(a, e, h);
d = true;
} else {
a._nextFocusedCell = j.nextSibling;
}
}
}
}
} else {
this._removeHoverStyles(b);
if (this._getNextSibling(a._nextFocusedCell) != null) {
a._nextFocusedCell = a._nextFocusedCell.nextSibling;
} else {
a._nextFocusedCell = this._getFirstChild(a._nextFocusedCell.parentNode.nextSibling);
}
}
var i = a._nextFocusedCell;
if (i.tagName.toUpperCase() == "TH") {
a._nextFocusedCell = i.nextSibling;
}
this._addClassAndGetFocus(a._nextFocusedCell, b);
if (!d) {
h = this._addDays(c, 1);
a._hoveredDate = h;
a._nextFocusedCell = this._moveCurentViewToNextPrev(c, h, e);
this._addClassAndGetFocus(a._nextFocusedCell, b);
}
}, _moveBottom: function (d, g) {
var k = null;
var c = this.DomTable;
var a = this.RadCalendar;
var f = false;
var i = a.RangeMaxDate;
var h = new Date(i[0], i[1] - 1, i[2]);
var j = this._addDays(d, 6);
if (j >= h) {
return;
}
if (!a._nextFocusedCell) {
var l = $telerik.getElementByClassName(c, "rcSelected", "td");
var e = l.cellIndex;
if (l.parentNode.firstChild.nodeType == 3) {
e = e + 1;
}
if (this._getNextSibling(l.parentNode) == null) {
if (!this._getFirstChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e - 1].parentNode.nextSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e].parentNode.nextSibling.childNodes[e];
}
k = this._getNewSelectedDate(true, k, 7);
f = true;
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a._nextFocusedCell.DayId)[2];
if (b.toString() != k.getDate().toString()) {
a._nextFocusedCell = a._nextFocusedCell.parentNode.nextSibling.childNodes[e];
}
} else {
a._nextFocusedCell = l.parentNode.nextSibling.childNodes[e];
if (a._nextFocusedCell.className.indexOf("rcOtherMonth") > -1) {
k = this._getNewSelectedDate(true, k, 7);
f = true;
if (!this._getFirstChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e - 1].parentNode.nextSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e].parentNode.nextSibling.childNodes[e];
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a._nextFocusedCell.DayId)[2];
if (b.toString() != k.getDate().toString()) {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e];
}
}
}
}
} else {
this._removeHoverStyles(c);
var e = a._nextFocusedCell.cellIndex;
if (a._nextFocusedCell.parentNode.firstChild.nodeType == 3) {
e = e + 1;
}
if (this._getNextSibling(a._nextFocusedCell.parentNode) == null) {
if (!this._getFirstChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e - 1].parentNode.nextSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getFirstChild(this._getLastChild(c)).cells[e].parentNode.nextSibling.childNodes[e];
}
f = true;
k = this._getNewSelectedDate(true, k, 7);
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a._nextFocusedCell.DayId)[2];
if (b.toString() != k.getDate().toString()) {
a._nextFocusedCell = a._nextFocusedCell.parentNode.nextSibling.childNodes[e];
}
} else {
a._nextFocusedCell = a._nextFocusedCell.parentNode.nextSibling.childNodes[e];
}
}
this._addClassAndGetFocus(a._nextFocusedCell, c);
if (!f) {
k = this._addDays(d, 7);
a._hoveredDate = k;
if ((k.getMonth() + 1).toString() != this.RadCalendar.CurrentViews[0]._MonthStartDate[1].toString()) {
a._nextFocusedCell = this._moveCurentViewToNextPrev(d, k, g);
this._addClassAndGetFocus(a._nextFocusedCell, c);
}
}
}, _moveTop: function (d, g) {
var k = null;
var c = this.DomTable;
var a = this.RadCalendar;
var f = false;
var i = a.RangeMinDate;
var h = new Date(i[0], i[1] - 1, i[2]);
var j = this._addDays(d, -6);
var l = a._nextFocusedCell;
if (j <= h) {
return;
}
if (!l) {
var m = $telerik.getElementByClassName(c, "rcSelected", "td");
var e = m.cellIndex;
if (m.parentNode.firstChild.nodeType == 3) {
e = e + 1;
}
if (this._getPreviousSibling(m.parentNode) == null) {
if (!this._getLastChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e - 1].parentNode.previousSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e].parentNode.previousSibling.childNodes[e];
}
f = true;
k = this._getNewSelectedDate(false, k, -7);
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a._nextFocusedCell.DayId)[2];
if (b.toString() != k.getDate().toString()) {
a._nextFocusedCell = a._nextFocusedCell.parentNode.previousSibling.childNodes[e];
}
} else {
if (m.parentNode.previousSibling.childNodes[e].className.indexOf("rcOtherMonth") > -1) {
if (!this._getLastChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e - 1].parentNode.previousSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e].parentNode.previousSibling.childNodes[e];
}
f = true;
k = this._getNewSelectedDate(false, k, -7);
g = 40;
f = true;
} else {
a._nextFocusedCell = m.parentNode.previousSibling.childNodes[e];
}
}
} else {
this._removeHoverStyles(c);
var e = a._nextFocusedCell.cellIndex;
if (a._nextFocusedCell.parentNode.firstChild.nodeType == 3) {
e = e + 1;
}
if (this._getPreviousSibling(a._nextFocusedCell.parentNode) == null) {
if (!this._getLastChild(this._getLastChild(c)).cells[e]) {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e - 1].parentNode.previousSibling.childNodes[e];
} else {
a._nextFocusedCell = this._getLastChild(this._getLastChild(c)).cells[e].parentNode.previousSibling.childNodes[e];
}
f = true;
k = this._getNewSelectedDate(false, k, -7);
if (a._nextFocusedCell.DayId == "") {
a._nextFocusedCell = a._nextFocusedCell.parentNode.previousSibling.childNodes[e];
} else {
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a._nextFocusedCell.DayId)[2];
if (b.toString() != k.getDate().toString()) {
a._nextFocusedCell = a._nextFocusedCell.parentNode.previousSibling.childNodes[e];
}
}
} else {
a._nextFocusedCell = a._nextFocusedCell.parentNode.previousSibling.childNodes[e];
}
}
this._addClassAndGetFocus(a._nextFocusedCell, c);
if (!f) {
k = this._addDays(d, -7);
a._hoveredDate = k;
if (l && a._nextFocusedCell.className.indexOf("rcOtherMonth") > -1) {
a._nextFocusedCell = this._moveCurentViewToNextPrev(d, k, g);
}
this._addClassAndGetFocus(a._nextFocusedCell, c);
}
}, _navigateToNextMonthView: function () {
var a = this.RadCalendar;
a._navigateFromLinksButtons = false;
a._navigateNext();
a._navigateFromLinksButtons = true;
}, _navigateToPreviousMonthView: function () {
var a = this.RadCalendar;
a._navigateFromLinksButtons = false;
a._navigatePrev();
a._navigateFromLinksButtons = true;
}, _moveCurentViewToNextPrev: function (d, c, b) {
var a = this.RadCalendar;
if (d.getFullYear() == c.getFullYear()) {
if (d.getMonth() < c.getMonth()) {
this._navigateToNextMonthView();
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, b, c);
} else {
if (d.getMonth() > c.getMonth()) {
this._navigateToPreviousMonthView();
a._nextFocusedCell = this._hoverLastDateOfMonth(a, b, c);
}
}
} else {
if (d.getMonth() < c.getMonth() && d.getFullYear() > c.getFullYear()) {
this._navigateToPreviousMonthView();
a._nextFocusedCell = this._hoverLastDateOfMonth(a, b, c);
} else {
if (d.getMonth() > c.getMonth() && d.getFullYear() < c.getFullYear()) {
this._navigateToNextMonthView();
a._nextFocusedCell = this._hoverFirstDateOfMonth(a, b, c);
}
}
}
return a._nextFocusedCell;
}, _getAllCells: function (b) {
if (b.cells) {
return b.cells;
} else {
var a = new Array();
for (var c = 0;
c < b.rows.length;
c++) {
for (var d = 0;
d < b.rows[c].cells.length;
d++) {
a.push(b.rows[c].cells[d]);
}
}
return a;
}
}, _hoverLastDateOfMonth: function (b, f, h) {
var a = this._getAllCells(b.CurrentViews[0].DomTable);
var d;
var g = b.CurrentViews[0]._MonthEndDate[2].toString();
if (f == 38) {
g = h.getDate().toString();
}
for (var e = 0;
e < a.length;
e++) {
if (a[e].tagName.toUpperCase() == "TD" && a[e].DayId != "") {
var c = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a[e].DayId)[2];
if (c == g) {
d = a[e];
}
}
}
return d;
}, _hoverFirstDateOfMonth: function (b, e, g) {
var a = this._getAllCells(b.CurrentViews[0].DomTable);
var f = b.CurrentViews[0]._MonthStartDate[2].toString();
if (e == 40) {
f = g.getDate().toString();
}
for (var d = 0;
d < a.length;
d++) {
if (a[d].tagName.toUpperCase() == "TD" && a[d].DayId != "") {
var c = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a[d].DayId)[2];
if (c == f) {
b._nextFocusedCell = a[d];
break;
}
}
}
return b._nextFocusedCell;
}, _addDays: function (a, c) {
var b = new Date(a.getFullYear(), a.getMonth(), a.getDate());
return new Date(b.setDate(b.getDate() + c));
}, _removeHoverStyles: function (a) {
var b = this._getElementsByClassName(a, "rcHover", "td");
for (var c = 0;
c < b.length;
c++) {
b[c].className = b[c].className.replace("rcHover", "").replace(/^\s+/, "").replace(/\s+$/, "");
if (this.RadCalendar && this.RadCalendar.get_enableAriaSupport()) {
var d = b[c].getElementsByTagName("a")[0];
if (d) {
d.tabIndex = -1;
}
}
}
}, _getElementsByClassName: function (e, d, h) {
var b = null;
var c = [];
if (h) {
b = e.getElementsByTagName(h);
}
for (var f = 0, g = b.length;
f < g;
f++) {
var a = b[f];
if (Sys.UI.DomElement.containsCssClass(a, d)) {
c.push(a);
}
}
return c;
}
};
Telerik.Web.UI.Calendar.CalendarView.registerClass("Telerik.Web.UI.Calendar.CalendarView", null, Sys.IDisposable);
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.RenderDay = function (a) {
if (typeof(a) != "undefined") {
var b = 0;
this.TemplateID = a[b++];
this._date = a[b++];
this.IsSelectable = a[b++];
this.IsSelected = a[b++];
this.IsDisabled = a[b++];
this.IsToday = a[b++];
this.Repeatable = a[b++];
this.IsWeekend = a[b++];
this.ToolTip = a[b++];
this.ItemStyle = a[b++];
this.DomElement = a[b++];
this.RadCalendar = a[b++];
this.ID = a[b++];
this.RadCalendarView = a[b++];
this.DayRow = a[b++];
this.DayColumn = a[b++];
}
};
Telerik.Web.UI.Calendar.RenderDay.prototype = {
dispose: function () {
this.disposed = true;
if (this.DomElement) {
this.DomElement.DayId = "";
this.DomElement.RenderDay = null;
}
this.DomElement = null;
this.RadCalendar = null;
this.RadCalendarView = null;
this.DayRow = null;
this.DayColumn = null;
}, MouseOver: function () {
if (!this.ApplyHoverBehavior()) {
return;
}
var a = this.RadCalendar.get_stylesHash()["DayOverStyle"];
var b = this.GetDefaultItemStyle();
this.DomElement.className = b[1].replace(/^\s+|\s+$/g, "") + " " + a[1];
this.DomElement.style.cssText = a[0];
}, MouseOut: function () {
if (!this.ApplyHoverBehavior()) {
return;
}
var a = this.GetDefaultItemStyle();
if ((this.RadCalendar && this.RadCalendar._hoveredDate) && ([this.RadCalendar._hoveredDate.getFullYear(), this.RadCalendar._hoveredDate.getMonth() + 1, this.RadCalendar._hoveredDate.getDate()] == this._date.toString())) {
this.DomElement.className = a[1].replace(/^\s+|\s+$/g, "") + " rcHover";
} else {
this.DomElement.className = a[1];
}
this.DomElement.style.cssText = a[0];
}, Click: function (b) {
var c = new Telerik.Web.UI.CalendarDateClickEventArgs(b, this);
var a = this.RadCalendar;
if (a._rangeSelectionMode != Telerik.Web.UI.Calendar.RangeSelectionMode.None) {
a._dateClick(c);
}
this.RadCalendar.raise_dateClick(c);
if (c.get_cancel()) {
return;
}
this.Select(!this.IsSelected);
}, Select: function (e, c) {
if (!this.RadCalendar.Selection.CanSelect(this.get_date())) {
return;
}
if (null == e) {
e = true;
}
if (this.RadCalendar.get_enableMultiSelect()) {
this.PerformSelect(e);
} else {
var g = false;
if (e) {
var a = this.RadCalendar._findRenderDay(this.RadCalendar._lastSelectedDate);
if (a && a != this) {
g = (false == a.Select(false));
}
var f = this.RadCalendar.Selection._selectedDates.GetValues();
for (var b = 0;
b < f.length;
b++) {
if (f[b]) {
var a = this.RadCalendar._findRenderDay(f[b]);
if (a && a != this) {
g = (false == a.Select(false, true));
}
}
}
}
var h = false;
if (!g) {
var d = this.PerformSelect(e);
if (typeof(d) != "undefined") {
h = !d;
}
if (this.RadCalendar) {
this.RadCalendar._lastSelectedDate = (this.IsSelected ? this.get_date() : null);
} else {
return;
}
}
}
if (this.RadCalendar) {
this.RadCalendar._serializeSelectedDates();
if (!c && !h) {
this.RadCalendar._submit("d");
}
}
}, PerformSelect: function (c) {
if (null == c) {
c = true;
}
if (this.IsSelected != c) {
var b = new Telerik.Web.UI.CalendarDateSelectingEventArgs(c, this);
this.RadCalendar.raise_dateSelecting(b);
if (b.get_cancel()) {
return false;
}
this.IsSelected = c;
var a = this.GetDefaultItemStyle();
if (a) {
this.DomElement.className = a[1];
this.DomElement.style.cssText = a[0];
}
if (this.RadCalendar.get_enableAriaSupport()) {
if (c) {
this.DomElement.setAttribute("aria-selected", true);
} else {
this.DomElement.removeAttribute("aria-selected");
}
}
if (c) {
this.RadCalendar.Selection.Add(this.get_date());
} else {
this.RadCalendar.Selection.Remove(this.get_date());
}
this.RadCalendar.raise_dateSelected(new Telerik.Web.UI.CalendarDateSelectedEventArgs(this));
}
}, GetDefaultItemStyle: function () {
var g = (this.get_date()[1] == this.RadCalendarView._MonthStartDate[1]);
var d = this.RadCalendar.SpecialDays.Get(this.get_date());
if (d == null && this.RadCalendar.RecurringDays.Get(this.get_date()) != null) {
d = this.RadCalendar.RecurringDays.Get(this.get_date());
}
var f = null;
if (this.IsSelected && (g || this.RadCalendar.get_showOtherMonthsDays())) {
return this.RadCalendar.get_stylesHash()["SelectedDayStyle"];
} else {
if (d) {
var e = "SpecialDayStyle_" + d.get_date().join("_");
f = d.ItemStyle[e];
var c = null;
if (!g) {
c = this.RadCalendar.get_stylesHash()["OtherMonthDayStyle"];
} else {
if (this.IsWeekend) {
c = this.RadCalendar.get_stylesHash()["WeekendDayStyle"];
} else {
c = this.RadCalendar.get_stylesHash()["DayStyle"];
}
}
f[0] = Telerik.Web.UI.Calendar.Utils.MergeStyles(c[0], f[0]);
f[1] = Telerik.Web.UI.Calendar.Utils.MergeClassName(c[1], f[1]);
} else {
if (!g) {
f = this.RadCalendar.get_stylesHash()["OtherMonthDayStyle"];
} else {
if (this.IsWeekend) {
f = this.RadCalendar.get_stylesHash()["WeekendDayStyle"];
} else {
f = this.RadCalendar.get_stylesHash()["DayStyle"];
}
}
}
}
var a = this.RadCalendar.get__DayRenderChangedDays()[this.get_date().join("_")];
var b = [];
if (a != null) {
b[0] = Telerik.Web.UI.Calendar.Utils.MergeStyles(a[0], f[0]);
b[1] = Telerik.Web.UI.Calendar.Utils.MergeClassName(a[1], f[1]);
b[0] = Telerik.Web.UI.Calendar.Utils.MergeStyles(a[2] || "", b[0]);
b[1] = Telerik.Web.UI.Calendar.Utils.MergeClassName(a[3] || "", b[1]);
return b;
}
return f;
}, ApplyHoverBehavior: function () {
var c = this.RadCalendar.SpecialDays.Get(this.get_date());
if (c && !c.IsSelectable) {
return false;
}
if (this.RadCalendar.get_enableRepeatableDaysOnClient()) {
var b = Telerik.Web.UI.Calendar.Utils.RECURRING_NONE;
var d = this.RadCalendar.SpecialDays.GetValues();
for (var a = 0;
a < d.length;
a++) {
b = d[a].IsRecurring(this.get_date(), this.RadCalendarView);
if (b != Telerik.Web.UI.Calendar.Utils.RECURRING_NONE) {
c = d[a];
if (!c.IsSelectable) {
return false;
}
}
}
}
return true;
}, IsRecurring: function (b, a) {
if (this.Repeatable != Telerik.Web.UI.Calendar.Utils.RECURRING_NONE) {
switch (this.Repeatable) {
case Telerik.Web.UI.Calendar.Utils.RECURRING_DAYINMONTH:
if (b[2] == this.get_date()[2]) {
return this.Repeatable;
}
break;
case Telerik.Web.UI.Calendar.Utils.RECURRING_TODAY:
var g = new Date();
if ((b[0] == g.getFullYear()) && (b[1] == (g.getMonth() + 1)) && (b[2] == g.getDate())) {
return this.Repeatable;
}
break;
case Telerik.Web.UI.Calendar.Utils.RECURRING_DAYANDMONTH:
if ((b[1] == this.get_date()[1]) && (b[2] == this.get_date()[2])) {
return this.Repeatable;
}
break;
case Telerik.Web.UI.Calendar.Utils.RECURRING_WEEKANDMONTH:
var c = new Date();
c.setFullYear(b[0], (b[1] - 1), b[2]);
var e = new Date();
e.setFullYear(this.get_date()[0], (this.get_date()[1] - 1), this.get_date()[2]);
if ((c.getDay() == e.getDay()) && (b[1] == this.get_date()[1])) {
return this.Repeatable;
}
break;
case Telerik.Web.UI.Calendar.Utils.RECURRING_WEEK:
var c = new Date();
c.setFullYear(b[0], (b[1] - 1), b[2]);
var e = new Date();
e.setFullYear(this.get_date()[0], (this.get_date()[1] - 1), this.get_date()[2]);
if (c.getDay() == e.getDay()) {
return this.Repeatable;
}
break;
case Telerik.Web.UI.Calendar.Utils.RECURRING_WEEKDAYWEEKNUMBERANDMONTH:
var c = new Date();
c.setFullYear(b[0], (b[1] - 1), b[2]);
var e = new Date();
e.setFullYear(this.get_date()[0], (this.get_date()[1] - 1), this.get_date()[2]);
var d = this._getNumberOfWeekDayInMonth(c, a);
var f = this._getNumberOfWeekDayInMonth(e, a);
if ((b[1] == this.get_date()[1]) && (c.getDay() == e.getDay()) && (d == f)) {
return this.Repeatable;
}
break;
default:
break;
}
}
return Telerik.Web.UI.Calendar.Utils.RECURRING_NONE;
}, _getNumberOfWeekDayInMonth: function (a, g) {
var f = g.DateTimeFormatInfo.CalendarWeekRule;
var c = g.RadCalendar._firstDayOfWeek;
var h = g.Calendar.GetWeekOfYear(a, f, c);
var d = new Date();
d.setFullYear(a.getFullYear(), a.getMonth(), 1);
var b = g.Calendar.GetDayOfWeek(a);
while (b != g.Calendar.GetDayOfWeek(d)) {
d.setDate(d.getDate() + 1);
}
var e = g.Calendar.GetWeekOfYear(d, f, c);
return h - e;
}, get_date: function () {
return this._date;
}, set_date: function (a) {
if (this._date !== a) {
this._date = a;
this.raisePropertyChanged("date");
}
}, get_isSelectable: function () {
return this.IsSelectable;
}, get_isSelected: function () {
return this.IsSelected;
}, get_isToday: function () {
return this.IsToday;
}, get_isWeekend: function () {
return this.IsWeekend;
}
};
Telerik.Web.UI.Calendar.RenderDay.registerClass("Telerik.Web.UI.Calendar.RenderDay", null, Sys.IDisposable);
/* END Telerik.Web.UI.Calendar.RadCalendarScript.js */
/* START Telerik.Web.UI.Calendar.RadCalendarCommonScript.js */
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.CalendarClickEventArgs = function (a, b) {
Telerik.Web.UI.CalendarClickEventArgs.initializeBase(this);
this._domElement = a;
this._index = b;
};
Telerik.Web.UI.CalendarClickEventArgs.prototype = {
get_domElement: function () {
return this._domElement;
}, get_index: function () {
return this._index;
}
};
Telerik.Web.UI.CalendarClickEventArgs.registerClass("Telerik.Web.UI.CalendarClickEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.CalendarDayRenderEventArgs = function (a, b, c) {
Telerik.Web.UI.CalendarDayRenderEventArgs.initializeBase(this);
this._cell = a;
this._date = b;
this._renderDay = c;
};
Telerik.Web.UI.CalendarDayRenderEventArgs.prototype = {
get_cell: function () {
return this._cell;
}, get_date: function () {
return this._date;
}, get_renderDay: function () {
return this._renderDay;
}
};
Telerik.Web.UI.CalendarDayRenderEventArgs.registerClass("Telerik.Web.UI.CalendarDayRenderEventArgs", Sys.EventArgs);
Telerik.Web.UI.CalendarDateClickEventArgs = function (a, b) {
Telerik.Web.UI.CalendarDateClickEventArgs.initializeBase(this);
this._domEvent = a;
this._renderDay = b;
};
Telerik.Web.UI.CalendarDateClickEventArgs.prototype = {
get_domEvent: function () {
return this._domEvent;
}, get_renderDay: function () {
return this._renderDay;
}
};
Telerik.Web.UI.CalendarDateClickEventArgs.registerClass("Telerik.Web.UI.CalendarDateClickEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.CalendarDateSelectingEventArgs = function (a, b) {
Telerik.Web.UI.CalendarDateSelectingEventArgs.initializeBase(this);
this._isSelecting = a;
this._renderDay = b;
};
Telerik.Web.UI.CalendarDateSelectingEventArgs.prototype = {
get_isSelecting: function () {
return this._isSelecting;
}, get_renderDay: function () {
return this._renderDay;
}
};
Telerik.Web.UI.CalendarDateSelectingEventArgs.registerClass("Telerik.Web.UI.CalendarDateSelectingEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.CalendarDateSelectedEventArgs = function (a) {
Telerik.Web.UI.CalendarDateSelectedEventArgs.initializeBase(this);
this._renderDay = a;
};
Telerik.Web.UI.CalendarDateSelectedEventArgs.prototype = {
get_renderDay: function () {
return this._renderDay;
}
};
Telerik.Web.UI.CalendarDateSelectedEventArgs.registerClass("Telerik.Web.UI.CalendarDateSelectedEventArgs", Sys.EventArgs);
Telerik.Web.UI.CalendarViewChangingEventArgs = function (a) {
Telerik.Web.UI.CalendarViewChangingEventArgs.initializeBase(this);
this._step = a;
};
Telerik.Web.UI.CalendarViewChangingEventArgs.prototype = {
get_step: function () {
return this._step;
}
};
Telerik.Web.UI.CalendarViewChangingEventArgs.registerClass("Telerik.Web.UI.CalendarViewChangingEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.CalendarViewChangedEventArgs = function (a) {
Telerik.Web.UI.CalendarViewChangedEventArgs.initializeBase(this);
this._step = a;
};
Telerik.Web.UI.CalendarViewChangedEventArgs.prototype = {
get_step: function () {
return this._step;
}
};
Telerik.Web.UI.CalendarViewChangedEventArgs.registerClass("Telerik.Web.UI.CalendarViewChangedEventArgs", Sys.EventArgs);
Telerik.Web.UI.DatePickerPopupOpeningEventArgs = function (b, a) {
Telerik.Web.UI.DatePickerPopupOpeningEventArgs.initializeBase(this);
this._popupControl = b;
this._cancelCalendarSynchronization = a;
};
Telerik.Web.UI.DatePickerPopupOpeningEventArgs.prototype = {
get_popupControl: function () {
return this._popupControl;
}, get_cancelCalendarSynchronization: function () {
return this._cancelCalendarSynchronization;
}, set_cancelCalendarSynchronization: function (a) {
if (this._cancelCalendarSynchronization !== a) {
this._cancelCalendarSynchronization = a;
}
}
};
Telerik.Web.UI.DatePickerPopupOpeningEventArgs.registerClass("Telerik.Web.UI.DatePickerPopupOpeningEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.DatePickerPopupClosingEventArgs = function (a) {
Telerik.Web.UI.DatePickerPopupClosingEventArgs.initializeBase(this);
this._popupControl = a;
};
Telerik.Web.UI.DatePickerPopupClosingEventArgs.prototype = {
get_popupControl: function () {
return this._popupControl;
}
};
Telerik.Web.UI.DatePickerPopupClosingEventArgs.registerClass("Telerik.Web.UI.DatePickerPopupClosingEventArgs", Sys.CancelEventArgs);
Telerik.Web.UI.TimeViewSelectedEventArgs = function (a, b) {
Telerik.Web.UI.TimeViewSelectedEventArgs.initializeBase(this);
this._newTime = a;
this._oldTime = b;
};
Telerik.Web.UI.TimeViewSelectedEventArgs.prototype = {
get_newTime: function () {
return this._newTime;
}, get_oldTime: function () {
return this._oldTime;
}
};
Telerik.Web.UI.TimeViewSelectedEventArgs.registerClass("Telerik.Web.UI.TimeViewSelectedEventArgs", Sys.EventArgs);
Telerik.Web.UI.TimeViewSelectingEventArgs = function (a, b) {
Telerik.Web.UI.TimeViewSelectingEventArgs.initializeBase(this);
this._newTime = a;
this._oldTime = b;
};
Telerik.Web.UI.TimeViewSelectingEventArgs.prototype = {
get_newTime: function () {
return this._newTime;
}, get_oldTime: function () {
return this._oldTime;
}
};
Telerik.Web.UI.TimeViewSelectingEventArgs.registerClass("Telerik.Web.UI.TimeViewSelectingEventArgs", Sys.CancelEventArgs);
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.PresentationType = function () {
};
Telerik.Web.UI.Calendar.PresentationType.prototype = {Interactive: 1, Preview: 2};
Telerik.Web.UI.Calendar.PresentationType.registerEnum("Telerik.Web.UI.Calendar.PresentationType", false);
Telerik.Web.UI.Calendar.FirstDayOfWeek = function () {
};
Telerik.Web.UI.Calendar.FirstDayOfWeek.prototype = {
Monday: 1,
Tuesday: 2,
Wednesday: 3,
Thursday: 4,
Friday: 5,
Saturday: 6,
Sunday: 7
};
Telerik.Web.UI.Calendar.FirstDayOfWeek.registerEnum("Telerik.Web.UI.Calendar.FirstDayOfWeek", false);
Telerik.Web.UI.Calendar.Orientation = function () {
};
Telerik.Web.UI.Calendar.Orientation.prototype = {RenderInRows: 1, RenderInColumns: 2};
Telerik.Web.UI.Calendar.Orientation.registerEnum("Telerik.Web.UI.Calendar.Orientation", false);
Telerik.Web.UI.Calendar.AutoPostBackControl = function () {
};
Telerik.Web.UI.Calendar.AutoPostBackControl.prototype = {None: 0, Both: 1, TimeView: 2, Calendar: 3};
Telerik.Web.UI.Calendar.AutoPostBackControl.registerEnum("Telerik.Web.UI.Calendar.AutoPostBackControl", false);
Telerik.Web.UI.Calendar.RangeSelectionMode = function () {
};
Telerik.Web.UI.Calendar.RangeSelectionMode.prototype = {None: 0, OnKeyHold: 1, ConsecutiveClicks: 2};
Telerik.Web.UI.Calendar.RangeSelectionMode.registerEnum("Telerik.Web.UI.Calendar.RangeSelectionMode", false);
if (typeof(window.RadCalendarNamespace) == "undefined") {
window.RadCalendarNamespace = {};
}
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.CalendarAnimationType = function () {
throw Error.invalidOperation();
};
Telerik.Web.UI.CalendarAnimationType.prototype = {Fade: 1, Slide: 2};
Telerik.Web.UI.CalendarAnimationType.registerEnum("Telerik.Web.UI.CalendarAnimationType");
Telerik.Web.UI.Calendar.Popup = function () {
this.DomElement = null;
this.ExcludeFromHiding = [];
this.zIndex = null;
this.ShowAnimationDuration = 300;
this.ShowAnimationType = Telerik.Web.UI.CalendarAnimationType.Fade;
this.HideAnimationDuration = 300;
this.HideAnimationType = Telerik.Web.UI.CalendarAnimationType.Fade;
this.EnableShadows = true;
this._overlay = false;
this._overlayIFrame = null;
if ($telerik.quirksMode || $telerik.isIE6) {
this.EnableShadows = false;
}
};
Telerik.Web.UI.Calendar.Popup.zIndex = 5000;
Telerik.Web.UI.Calendar.Popup.cssClass = "RadCalendarPopup";
Telerik.Web.UI.Calendar.Popup.secondaryCssClass = "RadCalendarFastNavPopup";
Telerik.Web.UI.Calendar.Popup.shadowCssClass = "RadCalendarPopupShadows";
Telerik.Web.UI.Calendar.Popup.prototype = {
CreateContainer: function (c) {
var a = document.createElement("div");
if (c == "table") {
a.className = Telerik.Web.UI.Calendar.Popup.secondaryCssClass;
} else {
a.className = Telerik.Web.UI.Calendar.Popup.cssClass;
}
if (this.EnableShadows) {
a.className += " " + Telerik.Web.UI.Calendar.Popup.shadowCssClass;
}
var b = RadHelperUtils.GetStyleObj(a);
b.position = "absolute";
if (navigator.userAgent.match(/Safari/)) {
b.visibility = "hidden";
b.left = "-1000px";
} else {
b.display = "none";
}
b.border = "0";
if (this.zIndex) {
b.zIndex = this.zIndex;
} else {
b.zIndex = Telerik.Web.UI.Calendar.Popup.zIndex;
Telerik.Web.UI.Calendar.Popup.zIndex += 2;
}
if (!(this.Opener && this.Opener._popupDirection && !(this.Opener.MonthYearFastNav))) {
a.onclick = function (d) {
if (!d) {
d = window.event;
}
d.returnValue = false;
d.cancelBubble = true;
if (d.stopPropagation) {
d.stopPropagation();
}
return false;
};
}
if (this.EnableShadows && this._renderMode == 1) {
a.innerHTML = '<div class="rcShadTR"></div><div class="rcShadBL"></div><div class="rcShadBR"></div>';
}
document.body.insertBefore(a, document.body.firstChild);
return a;
}, RemoveScriptsOnOpera: function (b) {
if (window.opera) {
var d = b.getElementsByTagName("*");
for (var a = 0;
a < d.length;
a++) {
var c = d[a];
if (c.tagName != null && c.tagName.toLowerCase() == "script") {
c.parentNode.removeChild(c);
}
}
}
}, Show: function (q, r, i, h) {
if (this.IsVisible()) {
this.Hide();
}
this.ExitFunc = ("function" == typeof(h) ? h : null);
var d = this.DomElement;
if (!d) {
d = this.CreateContainer(i.tagName.toLowerCase());
this.DomElement = d;
} else {
$telerik.$(d).stop(true, true);
}
if ($telerik.isIE && this.EnableShadows && d.className.indexOf("rcIE") == -1) {
Sys.UI.DomElement.addCssClass(d, "rcIE");
}
if (i) {
if (this.EnableShadows && this._renderMode == 1) {
d.innerHTML = '<div class="rcShadTR"></div><div class="rcShadBL"></div><div class="rcShadBR"></div>';
} else {
d.innerHTML = "";
}
if (i.nextSibling) {
this.Sibling = i.nextSibling;
}
this.Parent = i.parentNode;
this.RemoveScriptsOnOpera(i);
d.appendChild(i);
if (navigator.userAgent.match(/Safari/) && i.style.visibility == "hidden") {
i.style.visibility = "visible";
i.style.position = "";
i.style.left = "";
} else {
if (i.style.display == "none") {
i.style.display = "";
}
}
}
var m = $telerik.getViewPortSize();
var f = Telerik.Web.UI.Calendar.Utils.GetElementDimensions(d);
if (this.EnableShadows && this._renderMode == 1) {
var g = $telerik.getChildByClassName(d, "rcShadTR");
var e = $telerik.getChildByClassName(d, "rcShadBL");
if (g && e) {
g.style.height = f.height - parseInt($telerik.getCurrentStyle(d, "paddingBottom"), 10) + "px";
e.style.width = f.width - parseInt($telerik.getCurrentStyle(d, "paddingRight"), 10) + "px";
}
}
if ((typeof(q) == "undefined" || typeof(r) == "undefined") && this.Opener) {
var c = this.Opener.get_textBox ? this.Opener.get_textBox() : this.Opener._latestInputID ? $get(this.Opener._latestInputID) : null;
var b;
var a;
if (c && c.offsetWidth > 0) {
a = c;
} else {
if (i && i.id.indexOf("_timeView_wrapper") != -1) {
b = this.Opener.get__timePopupImage();
} else {
b = this.Opener.get__popupImage();
}
}
if (b && b.offsetWidth > 0) {
a = b;
} else {
if (!c || c.offsetWidth == 0) {
a = this.Opener.get_element();
}
}
if ($telerik.isIE && (navigator.userAgent.search(/\bARM\b;|\bTouch\b/i) != -1)) {
var j = $telerik.getLocation(a);
var l = {x: j.x, y: j.y};
} else {
var j = $telerik.$(a).offset();
var l = {x: j.left, y: j.top};
}
var k = parseInt(this.Opener.get_popupDirection(), 10);
switch (k) {
case Telerik.Web.RadDatePickerPopupDirection.TopRight:
q = l.x;
r = l.y - f.height;
break;
case Telerik.Web.RadDatePickerPopupDirection.BottomLeft:
q = l.x - (f.width - a.offsetWidth);
r = l.y + a.offsetHeight;
break;
case Telerik.Web.RadDatePickerPopupDirection.TopLeft:
q = l.x - (f.width - a.offsetWidth);
r = l.y - f.height;
break;
default:
q = l.x;
r = l.y + a.offsetHeight;
break;
}
if (this.Opener.get_enableScreenBoundaryDetection()) {
if (q < 0 && !this.OverFlowsRight(m, f.width, l.x)) {
q = l.x;
}
if (this.OverFlowsRight(m, f.width, l.x) && l.x - (f.width - a.offsetWidth) >= 0) {
q = l.x - (f.width - a.offsetWidth);
}
if (r < 0 && !this.OverFlowsBottom(m, f.height, l.y + a.offsetHeight)) {
r = l.y + a.offsetHeight;
}
if (this.OverFlowsBottom(m, f.height, l.y + a.offsetHeight) && l.y - f.height >= 0) {
r = l.y - f.height;
}
}
} else {
if ((i.id.indexOf("FastNavPopup") != -1 || i.id.indexOf("MonthYearTableViewID") != -1) && this.EnableScreenBoundaryDetection) {
if (q + f.width > m.width && q - f.width >= 0) {
q = q - f.width;
}
}
}
var n = RadHelperUtils.GetStyleObj(d);
n.left = parseInt(q, 10) + "px";
n.top = parseInt(r, 10) + "px";
if (typeof(this.ShowAnimationDuration) == "number" && this.ShowAnimationDuration > 0) {
if (navigator.userAgent.match(/Safari/)) {
n.visibility = "visible";
}
var o = this;
removeFilterStyleinIE = function () {
o.RemoveFilterStyle();
};
this._animate(true, removeFilterStyleinIE);
} else {
if (navigator.userAgent.match(/Safari/)) {
n.visibility = "visible";
} else {
n.display = "";
}
}
if (this._overlay || this.Opener && this.Opener._overlay) {
this._overlayIFrame = new Telerik.Web.UI.Overlay(d);
this._overlayIFrame.initialize();
}
this.OnClickFunc = Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnClick, this);
this.OnKeyPressFunc = Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnKeyPress, this);
if ($telerik.isChrome) {
this.OnKeyPressDown = Telerik.Web.UI.Calendar.Utils.AttachMethod(this.OnKeyPress, this);
}
var p = this;
window.setTimeout(function () {
RadHelperUtils.AttachEventListener(document, "click", p.OnClickFunc);
RadHelperUtils.AttachEventListener(document, "keypress", p.OnKeyPressFunc);
if ($telerik.isChrome) {
RadHelperUtils.AttachEventListener(document, "keydown", p.OnKeyPressDown);
}
}, 300);
}, Hide: function (h) {
var c = this.Opener;
if (c) {
var a;
var g = c.constructor.__typeName;
if (g == "Telerik.Web.UI.RadDateTimePicker" || g == "Telerik.Web.UI.RadDatePicker") {
if (c.get__TimePopup) {
var d = c.get__TimePopup();
if (d && d.IsVisible()) {
a = new Telerik.Web.UI.DatePickerPopupClosingEventArgs(c.get_timeView());
}
}
if (c.get_calendar && c.get_calendar() && c.get__popup) {
var d = c.get__popup();
if (d && d.IsVisible()) {
a = new Telerik.Web.UI.DatePickerPopupClosingEventArgs(c._calendar);
}
}
}
if (g == "Telerik.Web.UI.RadMonthYearPicker") {
var d = c.Popup;
if (d && d.IsVisible()) {
a = new Telerik.Web.UI.MonthYearPickerPopupClosingEventArgs(c);
}
}
if (a) {
c.raise_popupClosing(a);
if (a.get_cancel()) {
return false;
}
}
this.Opener = null;
}
var b = this.DomElement;
var e = RadHelperUtils.GetStyleObj(b);
if (b) {
$telerik.$(b).stop(true, true);
if ($telerik.isIE && this.EnableShadows && b.className.indexOf("rcIE") == -1) {
Sys.UI.DomElement.addCssClass(b, "rcIE");
}
}
var f = this;
removeDiv = function () {
if (b) {
if (f.EnableShadows && f._renderMode == 1) {
var k = $telerik.getChildByClassName(b, "rcShadTR");
if (k) {
b.removeChild(k);
}
var i = $telerik.getChildByClassName(b, "rcShadBL");
if (i) {
b.removeChild(i);
}
var j = $telerik.getChildByClassName(b, "rcShadBR");
if (j) {
b.removeChild(j);
}
}
if (navigator.userAgent.match(/Safari/)) {
e.visibility = "hidden";
e.position = "absolute";
e.left = "-1000px";
} else {
e.display = "none";
}
e = null;
if (b.childNodes.length != 0) {
if (navigator.userAgent.match(/Safari/)) {
b.childNodes[0].style.visibility = "hidden";
b.childNodes[0].style.position = "absolute";
b.childNodes[0].style.left = "-1000px";
} else {
b.childNodes[0].style.display = "none";
}
}
var l = b.childNodes[0];
if (l != null) {
b.removeChild(l);
if (f.Parent != null) {
f.Parent.appendChild(l);
} else {
if (f.Sibling != null) {
var m = f.Sibling.parentNode;
if (m != null) {
m.insertBefore(l, f.Sibling);
}
}
}
if (navigator.userAgent.match(/Safari/)) {
RadHelperUtils.GetStyleObj(l).visibility = "hidden";
RadHelperUtils.GetStyleObj(l).position = "absolute";
RadHelperUtils.GetStyleObj(l).left = "-1000px";
} else {
RadHelperUtils.GetStyleObj(l).display = "none";
}
}
if (f._overlayIFrame) {
f._overlayIFrame.dispose();
f._overlayIFrame = null;
}
if (f.DomElement) {
f.DomElement.outerHTML = "";
delete f.DomElement;
f.DomElement = null;
}
}
};
if (b && typeof(this.HideAnimationDuration) == "number" && this.HideAnimationDuration > 0) {
this._animate(false, removeDiv);
} else {
removeDiv();
}
if (this.OnClickFunc != null) {
RadHelperUtils.DetachEventListener(document, "click", this.OnClickFunc);
this.OnClickFunc = null;
}
if (this.OnKeyPressFunc != null) {
RadHelperUtils.DetachEventListener(document, "keydown", this.OnKeyPressFunc);
this.OnKeyPressFunc = null;
}
if (h && this.ExitFunc) {
this.ExitFunc();
}
return true;
}, _animate: function (b, a) {
if (!this.DomElement) {
return;
}
var c = Telerik.Web.UI.CalendarAnimationType;
if (b) {
switch (this.ShowAnimationType) {
case c.Slide:
$telerik.$(this.DomElement).slideDown(this.ShowAnimationDuration, a);
return;
case c.Fade:
default:
$telerik.$(this.DomElement).fadeIn(this.ShowAnimationDuration, a);
return;
}
} else {
switch (this.HideAnimationType) {
case c.Slide:
$telerik.$(this.DomElement).slideUp(this.HideAnimationDuration, a);
return;
case c.Fade:
default:
$telerik.$(this.DomElement).fadeOut(this.HideAnimationDuration, a);
return;
}
}
}, RemoveFilterStyle: function () {
if ($telerik.isIE && this.DomElement) {
this.DomElement.style.removeAttribute("filter");
if (this.EnableShadows) {
Sys.UI.DomElement.removeCssClass(this.DomElement, "rcIE");
}
}
}, OverFlowsBottom: function (c, b, d) {
var a = d + b;
return a > c.height;
}, OverFlowsRight: function (c, a, d) {
var b = d + a;
return b > c.width;
}, IsVisible: function () {
var a = this.DomElement;
var b = RadHelperUtils.GetStyleObj(a);
if (a) {
if (navigator.userAgent.match(/Safari/)) {
return (b.visibility != "hidden");
}
return (b.display != "none");
}
return false;
}, IsChildOf: function (a, b) {
while (a.parentNode) {
if (a.parentNode == b) {
return true;
}
a = a.parentNode;
}
return false;
}, ShouldHide: function (a) {
var c = a.target;
if (c == null) {
c = a.srcElement;
}
for (var b = 0;
b < this.ExcludeFromHiding.length;
b++) {
if (this.ExcludeFromHiding[b] == c) {
return false;
}
if (this.IsChildOf(c, this.ExcludeFromHiding[b])) {
return false;
}
}
return true;
}, OnKeyPress: function (a) {
if (!a) {
a = window.event;
}
if (a.keyCode == 27) {
this.Hide();
}
}, OnClick: function (a) {
if (!a) {
a = window.event;
}
if (this.ShouldHide(a)) {
this.Hide();
}
}
};
Telerik.Web.UI.Calendar.Popup.registerClass("Telerik.Web.UI.Calendar.Popup");
if (typeof(RadHelperUtils) == "undefined") {
var RadHelperUtils = {
IsDefined: function (a) {
if ((typeof(a) != "undefined") && (a != null)) {
return true;
}
return false;
}, StringStartsWith: function (a, b) {
if (typeof(b) != "string") {
return false;
}
return (0 == a.indexOf(b));
}, AttachEventListener: function (b, d, c) {
if (c == null) {
return;
}
var a = RadHelperUtils.CompatibleEventName(d);
if (typeof(b.addEventListener) != "undefined") {
b.addEventListener(a, c, false);
} else {
if (b.attachEvent) {
b.attachEvent(a, c);
} else {
b["on" + d] = c;
}
}
}, DetachEventListener: function (b, d, c) {
var a = RadHelperUtils.CompatibleEventName(d);
if (typeof(b.removeEventListener) != "undefined") {
b.removeEventListener(a, c, false);
} else {
if (b.detachEvent) {
b.detachEvent(a, c);
} else {
b["on" + d] = null;
}
}
}, CompatibleEventName: function (a) {
a = a.toLowerCase();
if (document.addEventListener) {
if (RadHelperUtils.StringStartsWith(a, "on")) {
return a.substr(2);
} else {
return a;
}
} else {
if (document.attachEvent && !RadHelperUtils.StringStartsWith(a, "on")) {
return "on" + a;
} else {
return a;
}
}
}, GetStyleObj: function (a) {
if (!RadHelperUtils.IsDefined(a)) {
return null;
}
if (a.style) {
return a.style;
} else {
return a;
}
}
};
}
Type.registerNamespace("Telerik.Web.UI.Calendar");
Telerik.Web.UI.Calendar.Utils = {
COLUMN_HEADER: 1,
VIEW_HEADER: 2,
ROW_HEADER: 3,
FIRST_DAY: 0,
FIRST_FOUR_DAY_WEEK: 2,
FIRST_FULL_WEEK: 1,
DEFAULT: 7,
FRIDAY: 5,
MONDAY: 1,
SATURDAY: 6,
SUNDAY: 0,
THURSDAY: 4,
TUESDAY: 2,
WEDNESDAY: 3,
RENDERINROWS: 1,
RENDERINCOLUMNS: 2,
NONE: 4,
RECURRING_DAYINMONTH: 1,
RECURRING_DAYANDMONTH: 2,
RECURRING_WEEK: 4,
RECURRING_WEEKANDMONTH: 8,
RECURRING_TODAY: 16,
RECURRING_WEEKDAYWEEKNUMBERANDMONTH: 32,
RECURRING_NONE: 64,
AttachMethod: function (a, b) {
return function () {
return a.apply(b, arguments);
};
},
GetDateFromId: function (c) {
var a = c.split("_");
if (a.length < 2) {
return null;
}
var b = [parseInt(a[a.length - 3]), parseInt(a[a.length - 2]), parseInt(a[a.length - 1])];
return b;
},
GetRenderDay: function (d, a) {
var b = Telerik.Web.UI.Calendar.Utils.GetDateFromId(a);
var c = d.RenderDays.Get(b);
return c;
},
FindTarget: function (b, a) {
var c;
if (b && b.target) {
c = b.target;
} else {
if (window.event && window.event.srcElement) {
c = window.event.srcElement;
}
}
if (!c) {
return null;
}
if (c.tagName == null && c.nodeType == 3 && (navigator.userAgent.match(/Safari/))) {
c = c.parentNode;
}
while (c != null && c.tagName.toLowerCase() != "body") {
if ((c.tagName.toLowerCase() == "th" || c.tagName.toLowerCase() == "td") && Telerik.Web.UI.Calendar.Utils.FindTableElement(c) != null && Telerik.Web.UI.Calendar.Utils.FindTableElement(c).id.indexOf(a) != -1) {
break;
}
c = c.parentNode;
}
if (c.tagName == null || (c.tagName.toLowerCase() != "td" && c.tagName.toLowerCase() != "th")) {
return null;
}
return c;
},
FindTableElement: function (a) {
while (a != null && a.tagName.toLowerCase() != "table") {
a = a.parentNode;
}
return a;
},
MergeStyles: function (a, b) {
if (a.lastIndexOf(";", a.length) != a.length - 1) {
a += ";";
}
var c = b.split(";");
var e = a;
for (var d = 0;
d < c.length - 1;
d++) {
var f = c[d].split(":");
if (a.indexOf(f[0]) == -1) {
e += c[d] + ";";
}
}
return e;
},
MergeClassName: function (d, a) {
var e = d.split(" ");
var f = a.split(" ");
if (f.length == 1 && f[0] == "") {
f = [];
}
for (var g = 0;
g < e.length;
g++) {
if (e[g].length > 0) {
var b = false;
for (var c = 0;
c < f.length;
c++) {
if (f[c] == e[g]) {
b = true;
break;
}
}
if (!b) {
f[f.length] = e[g];
}
}
}
return f.join(" ");
},
GetElementDimensions: function (c) {
var d = c.style.left;
var b = c.style.display;
var e = c.style.position;
c.style.left = "-6000px";
c.style.display = "";
c.style.position = "absolute";
var a = $telerik.getBounds(c);
c.style.left = d;
c.style.display = b;
c.style.position = e;
return {width: a.width, height: a.height};
}
};
/* END Telerik.Web.UI.Calendar.RadCalendarCommonScript.js */
/* START Telerik.Web.UI.Common.jQueryPlugins.js */
if (typeof $telerik.$ === "undefined") {
$telerik.$ = jQuery;
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright � 2008 George McGinley Smith
* All rights reserved.
*/
/*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright � 2001 Robert Penner
* All rights reserved.
*/
}
(function (a) {
a.easing.jswing = a.easing.swing;
a.extend(a.easing, {
def: "easeOutQuad", swing: function (i, h, e, f, g) {
return a.easing[a.easing.def](i, h, e, f, g);
}, easeLinear: function (i, h, e, f, g) {
return f * h / g + e;
}, easeInQuad: function (i, h, e, f, g) {
return f * (h /= g) * h + e;
}, easeOutQuad: function (i, h, e, f, g) {
return -f * (h /= g) * (h - 2) + e;
}, easeInOutQuad: function (i, h, e, f, g) {
if ((h /= g / 2) < 1) {
return f / 2 * h * h + e;
}
return -f / 2 * ((--h) * (h - 2) - 1) + e;
}, easeInCubic: function (i, h, e, f, g) {
return f * (h /= g) * h * h + e;
}, easeOutCubic: function (i, h, e, f, g) {
return f * ((h = h / g - 1) * h * h + 1) + e;
}, easeInOutCubic: function (i, h, e, f, g) {
if ((h /= g / 2) < 1) {
return f / 2 * h * h * h + e;
}
return f / 2 * ((h -= 2) * h * h + 2) + e;
}, easeInQuart: function (i, h, e, f, g) {
return f * (h /= g) * h * h * h + e;
}, easeOutQuart: function (i, h, e, f, g) {
return -f * ((h = h / g - 1) * h * h * h - 1) + e;
}, easeInOutQuart: function (i, h, e, f, g) {
if ((h /= g / 2) < 1) {
return f / 2 * h * h * h * h + e;
}
return -f / 2 * ((h -= 2) * h * h * h - 2) + e;
}, easeInQuint: function (i, h, e, f, g) {
return f * (h /= g) * h * h * h * h + e;
}, easeOutQuint: function (i, h, e, f, g) {
return f * ((h = h / g - 1) * h * h * h * h + 1) + e;
}, easeInOutQuint: function (i, h, e, f, g) {
if ((h /= g / 2) < 1) {
return f / 2 * h * h * h * h * h + e;
}
return f / 2 * ((h -= 2) * h * h * h * h + 2) + e;
}, easeInSine: function (i, h, e, f, g) {
return -f * Math.cos(h / g * (Math.PI / 2)) + f + e;
}, easeOutSine: function (i, h, e, f, g) {
return f * Math.sin(h / g * (Math.PI / 2)) + e;
}, easeInOutSine: function (i, h, e, f, g) {
return -f / 2 * (Math.cos(Math.PI * h / g) - 1) + e;
}, easeInExpo: function (i, h, e, f, g) {
return (h == 0) ? e : f * Math.pow(2, 10 * (h / g - 1)) + e;
}, easeOutExpo: function (i, h, e, f, g) {
return (h == g) ? e + f : f * (-Math.pow(2, -10 * h / g) + 1) + e;
}, easeInOutExpo: function (i, h, e, f, g) {
if (h == 0) {
return e;
}
if (h == g) {
return e + f;
}
if ((h /= g / 2) < 1) {
return f / 2 * Math.pow(2, 10 * (h - 1)) + e;
}
return f / 2 * (-Math.pow(2, -10 * --h) + 2) + e;
}, easeInCirc: function (i, h, e, f, g) {
return -f * (Math.sqrt(1 - (h /= g) * h) - 1) + e;
}, easeOutCirc: function (i, h, e, f, g) {
return f * Math.sqrt(1 - (h = h / g - 1) * h) + e;
}, easeInOutCirc: function (i, h, e, f, g) {
if ((h /= g / 2) < 1) {
return -f / 2 * (Math.sqrt(1 - h * h) - 1) + e;
}
return f / 2 * (Math.sqrt(1 - (h -= 2) * h) + 1) + e;
}, easeInElastic: function (l, k, f, g, h) {
var j = 1.70158;
var i = 0;
var e = g;
if (k == 0) {
return f;
}
if ((k /= h) == 1) {
return f + g;
}
if (!i) {
i = h * 0.3;
}
if (e < Math.abs(g)) {
e = g;
var j = i / 4;
} else {
var j = i / (2 * Math.PI) * Math.asin(g / e);
}
return -(e * Math.pow(2, 10 * (k -= 1)) * Math.sin((k * h - j) * (2 * Math.PI) / i)) + f;
}, easeOutElastic: function (l, k, f, g, h) {
var j = 1.70158;
var i = 0;
var e = g;
if (k == 0) {
return f;
}
if ((k /= h) == 1) {
return f + g;
}
if (!i) {
i = h * 0.3;
}
if (e < Math.abs(g)) {
e = g;
var j = i / 4;
} else {
var j = i / (2 * Math.PI) * Math.asin(g / e);
}
return e * Math.pow(2, -10 * k) * Math.sin((k * h - j) * (2 * Math.PI) / i) + g + f;
}, easeInOutElastic: function (l, k, f, g, h) {
var j = 1.70158;
var i = 0;
var e = g;
if (k == 0) {
return f;
}
if ((k /= h / 2) == 2) {
return f + g;
}
if (!i) {
i = h * (0.3 * 1.5);
}
if (e < Math.abs(g)) {
e = g;
var j = i / 4;
} else {
var j = i / (2 * Math.PI) * Math.asin(g / e);
}
if (k < 1) {
return -0.5 * (e * Math.pow(2, 10 * (k -= 1)) * Math.sin((k * h - j) * (2 * Math.PI) / i)) + f;
}
return e * Math.pow(2, -10 * (k -= 1)) * Math.sin((k * h - j) * (2 * Math.PI) / i) * 0.5 + g + f;
}, easeInBack: function (j, i, e, f, g, h) {
if (h == undefined) {
h = 1.70158;
}
return f * (i /= g) * i * ((h + 1) * i - h) + e;
}, easeOutBack: function (j, i, e, f, g, h) {
if (h == undefined) {
h = 1.70158;
}
return f * ((i = i / g - 1) * i * ((h + 1) * i + h) + 1) + e;
}, easeInOutBack: function (j, i, e, f, g, h) {
if (h == undefined) {
h = 1.70158;
}
if ((i /= g / 2) < 1) {
return f / 2 * (i * i * (((h *= (1.525)) + 1) * i - h)) + e;
}
return f / 2 * ((i -= 2) * i * (((h *= (1.525)) + 1) * i + h) + 2) + e;
}, easeInBounce: function (i, h, e, f, g) {
return f - a.easing.easeOutBounce(i, g - h, 0, f, g) + e;
}, easeOutBounce: function (i, h, e, f, g) {
if ((h /= g) < (1 / 2.75)) {
return f * (7.5625 * h * h) + e;
} else {
if (h < (2 / 2.75)) {
return f * (7.5625 * (h -= (1.5 / 2.75)) * h + 0.75) + e;
} else {
if (h < (2.5 / 2.75)) {
return f * (7.5625 * (h -= (2.25 / 2.75)) * h + 0.9375) + e;
} else {
return f * (7.5625 * (h -= (2.625 / 2.75)) * h + 0.984375) + e;
}
}
}
}, easeInOutBounce: function (i, h, e, f, g) {
if (h < g / 2) {
return a.easing.easeInBounce(i, h * 2, 0, f, g) * 0.5 + e;
}
return a.easing.easeOutBounce(i, h * 2 - g, 0, f, g) * 0.5 + f * 0.5 + e;
}
});
})($telerik.$);
/*
* jQuery throttle / debounce - v1.1 - 3/7/2010
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function (d, c) {
var a = $telerik.$ || d.Cowboy || (d.Cowboy = {}), b;
a.throttle = b = function (g, i, e, f) {
var j, h = 0;
if (typeof i !== "boolean") {
f = e;
e = i;
i = c;
}
function k() {
var p = this, n = +new Date() - h, l = arguments;
function o() {
h = +new Date();
e.apply(p, l);
}
function m() {
j = c;
}
if (f && !j) {
o();
}
j && clearTimeout(j);
if (f === c && n > g) {
o();
} else {
if (i !== true) {
j = setTimeout(f ? m : o, f === c ? g - n : g);
}
}
}
if (a.guid) {
k.guid = e.guid = e.guid || a.guid++;
}
return k;
};
a.debounce = function (g, e, f) {
return f === c ? b(g, e, false) : b(g, f, e !== false);
};
})(window);
(function (b) {
b.fx.step.height = function (e) {
var f = $telerik.quirksMode ? 1 : 0;
var g = e.now > f ? e.now : f;
e.elem.style[e.prop] = Math.round(g) + e.unit;
};
function c(f, e) {
return ["live", f, e.replace(/\./g, "`").replace(/ /g, "|")].join(".");
}
function a(f, e) {
b.each(e, function (g, h) {
if (g.indexOf("et_") > 0) {
f[g] = h;
return;
}
if (g == "domEvent" && h) {
f["get_" + g] = function () {
return new Sys.UI.DomEvent(h.originalEvent || h.rawEvent || h);
};
} else {
f["get_" + g] = function (i) {
return function () {
return i;
};
}(h);
}
});
return f;
}
b.extend({
registerControlEvents: function (e, f) {
b.each(f, function (h, g) {
e.prototype["add_" + g] = function (i) {
this.get_events().addHandler(g, i);
};
e.prototype["remove_" + g] = function (i) {
this.get_events().removeHandler(g, i);
};
});
}, registerKendoWidgetEvents: function (e, f) {
b.each(f, function (h, g) {
e.prototype["add_" + g] = function (i) {
this.kendoWidget.bind(g, i);
};
e.prototype["remove_" + g] = function (i) {
this.kendoWidget.unbind(g, i);
};
});
}, registerControlProperties: function (e, f) {
b.each(f, function (h, g) {
e.prototype["get_" + h] = function () {
var i = this["_" + h];
return typeof i == "undefined" ? g : i;
};
e.prototype["set_" + h] = function (i) {
this["_" + h] = i;
};
});
}, registerEnum: function (f, e, h, g) {
g = g || false;
f[e] = function () {
};
f[e].prototype = h;
f[e].registerEnum(f.getName() + "." + e, g);
}, raiseControlEvent: function (f, g, e) {
var h = f.get_events().getHandler(g);
if (h) {
h(f, a(new Sys.EventArgs(), e));
}
}, raiseCancellableControlEvent: function (g, h, e) {
var i = g.get_events().getHandler(h);
if (i) {
var f = a(new Sys.CancelEventArgs(), e);
i(g, f);
return f.get_cancel();
}
return false;
}, extendEventArgs: function (e, f) {
return a(e, f);
}, isBogus: function (e) {
try {
var g = e.parentNode;
return false;
} catch (f) {
return true;
}
}
});
b.eachCallback = function (e, g) {
var f = 0;
function h() {
if (e.length == 0) {
return;
}
var i = e[f];
g.apply(i);
f++;
if (f < e.length) {
setTimeout(h, 1);
}
}
setTimeout(h, 1);
};
b.fn.eachCallback = function (g) {
var e = 0;
var f = this;
function h() {
if (f.length == 0) {
return;
}
var i = f.get(e);
g.apply(i);
e++;
if (e < f.length) {
setTimeout(h, 1);
}
}
setTimeout(h, 1);
};
if ($telerik.isTouchDevice) {
var d;
b.each(["t_touchover", "t_touchout"], function (e, f) {
b.fn[f] = function (g) {
return this.bind(f, g);
};
});
b(document.body).bind("touchstart", function (f) {
d = f.originalEvent.currentTarget;
}).bind("touchmove", function (f) {
var i = f.originalEvent.changedTouches[0], h = document.elementFromPoint(i.clientX, i.clientY);
if (d != h) {
var g = {target: d, relatedTarget: d, CtrlKey: false, AltKey: false, ShiftKey: false};
b(d).trigger("t_touchout", g);
d = h;
b(d).trigger("t_touchover", b.extend(g, {target: d, relatedTarget: d}));
}
});
}
})($telerik.$);
/*
* jQuery Double Tap Plugin.
*
* Copyright (c) 2010 Raul Sanchez (http://www.appcropolis.com)
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function (a) {
a.fn.doubletap = function (e, f, c) {
var d, b;
c = c == null ? 500 : c;
d = $telerik.isTouchDevice ? "touchend" : "click";
a(this).bind(d, function (h) {
var j = new Date().getTime();
var i = a(this).data("lastTouch") || j + 1;
var g = j - i;
clearTimeout(b);
if (g < 500 && g > 0) {
if (e != null && typeof e == "function") {
e(h);
}
} else {
a(this).data("lastTouch", j);
b = setTimeout(function (k) {
if (f != null && typeof f == "function") {
f(k);
}
clearTimeout(b);
}, c, [h]);
}
a(this).data("lastTouch", j);
});
};
})($telerik.$);
(function (a) {
a.observable = function (d) {
var c = {};
a.extend(d, {
trigger: function (g) {
var h = c[g];
if (!h) {
return;
}
for (var j = 0;
j < h.length;
j++) {
var f = Array.prototype.slice.call(arguments);
f.shift();
h[j].handler.apply(h[j].context, f);
}
}, on: function (g, f) {
a.each(g, function (h, i) {
b(h, i, f);
});
}, off: function (g, f) {
a.each(g, function (h, i) {
e(h, i, f);
});
}, disposeObservable: function () {
for (var f in c) {
delete c[f];
}
c = null;
}
});
function b(g, h, f) {
var i = c[g] || [];
i.push({handler: h, context: f});
c[g] = i;
}
function e(g, h, f) {
var k = c[g];
if (!k) {
return;
}
var m = -1;
for (var l = 0;
l < k.length;
l++) {
var j = k[l];
if (j.func === h && j.context === f) {
m = l;
break;
}
}
if (m > -1) {
k = k.splice(m, 1);
}
c[g] = k;
}
};
})($telerik.$);
(function (a, s) {
var b = $telerik;
var c = Telerik.Web.UI;
var m = a.fn;
var g = a.extend;
var r = "string";
var t = "undefined";
var e = ".";
var o = 1;
var f = [];
c.EventType = function () {
throw Error.invalidOperation();
};
c.EventType.prototype = {Up: 0, Down: 1, Move: 2, Leave: 3};
c.EventType.registerEnum("Telerik.Web.UI.EventType", false);
function i() {
var w = [];
var v = c.EventType;
for (var u in v) {
w.push(u.toLowerCase());
}
return w;
}
f = i();
function j() {
var u = Telerik.Web;
var z = u.Platform;
var y = z.ios;
var v = z.android;
var w = u.BrowserFeatures;
var C = w.touchEvents;
var B = w.pointerEvents;
var A = w.msPointerEvents;
var x = {up: "mouseup", down: "mousedown", move: "mousemove", leave: "mouseleave"};
if (C && (y || v)) {
x = {up: "touchend touchcancel", down: "touchstart", move: "touchmove", leave: "touchcancel"};
} else {
if (B) {
x = {up: "pointerup", down: "pointerdown", move: "pointermove", leave: "pointercancel pointerleave"};
} else {
if (A) {
x = {
up: "MSPointerUp",
down: "MSPointerDown",
move: "MSPointerMove",
leave: "MSPointerCancel MSPointerLeave"
};
}
}
}
return x;
}
c.EventNamesMap = j();
function l(u) {
return typeof(u) === r;
}
function k(u) {
return typeof(u) !== t;
}
function p(u, z, A, v) {
var x = {selector: s, data: s, ns: s};
var C = g({}, x, v);
var D = C.selector;
var w = C.data;
var B = C.ns;
var y;
y = h(z, B);
return u.on(y, D, w, A);
}
function h(w, x) {
var u;
var v;
u = q(w);
v = d(u, x);
return v;
}
function q(v) {
var u = c.EventNamesMap;
if (l(v)) {
return u[v] || v;
} else {
return u[f[v]];
}
}
function d(u, x) {
if (k(x)) {
var v = u.split(" ");
for (var w = 0;
w < v.length;
w++) {
v[w] += e + x;
}
return v.join(" ");
} else {
return u;
}
}
b.onEvent = function (v, w, x, u) {
return p(a(v), w, x, u);
};
m.onEvent = function (w, x, v) {
var u = this;
return p(u, w, x, v);
};
function n(u, y, z, v) {
var w = {selector: s, ns: s};
var B = g({}, w, v);
var C = B.selector;
var A = B.ns;
var x;
if (arguments.length === o) {
return u.off();
} else {
x = h(y, A);
return u.off(x, C, z);
}
}
b.offEvent = function (v, w, x, u) {
return n(a(v), w, x, u);
};
m.offEvent = function (w, x, v) {
var u = this;
return n(u, w, x, v);
};
})($telerik.$);
/* END Telerik.Web.UI.Common.jQueryPlugins.js */
/* START Telerik.Web.UI.Common.Popup.PopupScripts.js */
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ModalExtender = function (a) {
this._windowResizeDelegate = null;
this._windowScrollDelegate = null;
this._xCoordinate = -1;
this._yCoordinate = -1;
this._backgroundElement = null;
this._foregroundElement = a;
this._saveTabIndexes = [];
this._saveAccessKeys = [];
this._saveDesableSelect = [];
this._saveDisabledElements = [];
this._tagWithTabIndex = new Array("A", "AREA", "BUTTON", "INPUT", "OBJECT", "SELECT", "TEXTAREA", "IFRAME", "SPAN");
this._tagWithAcessKey = this._tagWithTabIndex;
this._elementsToDisable = [];
};
Telerik.Web.UI.ModalExtender.prototype = {
dispose: function () {
this.hide();
this._backgroundElement = null;
this._foregroundElement = null;
}, show: function () {
var a = this._getModalOverlay();
if ($telerik.getVisible(a)) {
return;
}
this._attachWindowHandlers(true);
var b = this._foregroundElement;
b.parentNode.appendChild(a);
var c = $telerik.getCurrentStyle(b, "zIndex");
if (!isNaN(parseInt(c, 10)) && parseInt(c, 10) != 0) {
a.style.zIndex = c - 1;
}
a.style.display = "";
this._disableElements(this._elementsToDisable);
this._disableTab();
this._disableAccesskey();
this._updatePageLayout();
this._updatePageLayout();
}, _storeBrowserPosition: function () {
var a = document.body;
var b = document.documentElement;
this._browserTop = a.scrollTop > b.scrollTop ? a.scrollTop : b.scrollTop;
this._browserLeft = a.scrollLeft > b.scrollLeft ? a.scrollTop : b.scrollLeft;
}, _restoreBrowserPosition: function (b, e) {
try {
if (null == b) {
b = this._browserLeft;
}
if (null == e) {
e = this._browserTop;
}
var c = document.body;
var d = document.documentElement;
c.scrollTop = e;
c.scrollLeft = b;
d.scrollTop = e;
d.scrollLeft = b;
} catch (a) {
}
}, hide: function () {
this._restoreTab();
this._restoreAccessKey();
this._restoreDisabledElements();
this._attachWindowHandlers(false);
var a = this._backgroundElement;
if (a) {
if (a.parentNode) {
a.parentNode.removeChild(a);
}
this._backgroundElement = null;
}
}, _enableScroll: function (a) {
if (a) {
document.body.style.overflow = null != this._overflow ? this._overflow : "";
document.documentElement.style.overflow = null != this._documentOverflow ? this._documentOverflow : "";
document.body.style.marginRight = "";
} else {
this._overflow = document.body.style.overflow;
document.body.style.overflow = "hidden";
this._documentOverflow = document.documentElement.style.overflow;
document.documentElement.style.overflow = "hidden";
document.body.style.marginRight = "18px";
}
}, _getModalOverlay: function () {
if (!this._backgroundElement) {
var a = document.createElement("div");
a.style.display = "none";
a.style.position = "absolute";
if ($telerik.isRightToLeft(this._foregroundElement)) {
a.style.right = "0px";
} else {
a.style.left = "0px";
}
a.style.top = "0px";
a.style.zIndex = 10000;
a.style.backgroundColor = "#aaaaaa";
a.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)";
a.style.opacity = ".5";
a.style.MozOpacity = ".5";
a.setAttribute("unselectable", "on");
a.className = "TelerikModalOverlay";
this._backgroundElement = a;
}
return this._backgroundElement;
}, _attachWindowHandlers: function (a) {
var b = window;
if (true == a) {
this._windowResizeDelegate = Function.createDelegate(this, this._updatePageLayout);
$addHandler(b, "resize", this._windowResizeDelegate);
this._windowScrollDelegate = Function.createDelegate(this, this._updatePageLayout);
$addHandler(b, "scroll", this._windowScrollDelegate);
} else {
if (this._windowResizeDelegate) {
$removeHandler(b, "resize", this._windowResizeDelegate);
}
this._windowResizeDelegate = null;
if (this._windowScrollDelegate) {
$removeHandler(b, "scroll", this._windowScrollDelegate);
}
this._windowScrollDelegate = null;
}
}, _updatePageLayout: function () {
var a = $telerik.getClientBounds();
var c = a.width;
var b = a.height;
var d = this._getModalOverlay();
d.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), c) + "px";
d.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), b) + "px";
}, _getElementsWithTabIndexes: function (b, c) {
var d = this;
var a = $telerik.$(b).find(this._tagWithTabIndex.join(",")).filter(function () {
if (this.tabIndex == -1 || this.disabled || this === c || $telerik.$.contains(c, this)) {
return false;
}
if (!$telerik.getVisible(this)) {
return false;
}
if (this.nodeName == "SPAN" && !d._hasTabIndexAttribute(this)) {
return false;
}
return true;
});
return $telerik.$.makeArray(a);
}, _getElementsWithAccessKey: function (b, c) {
var a = $telerik.$(b).find(this._tagWithAcessKey.join(",")).filter(function () {
if (!this.accessKey || this.disabled || this === c || $telerik.$.contains(c, this)) {
return false;
}
if (!$telerik.getVisible(this)) {
return false;
}
return true;
});
return $telerik.$.makeArray(a);
}, _hasTabIndexAttribute: function (b) {
if (b.hasAttribute) {
return b.hasAttribute("tabIndex");
}
var a = b.getAttribute("tabIndex");
if (a == null || a == "undefined" || a === -32768) {
return false;
}
if (typeof a == "number" && a != 0) {
return true;
}
if (a == 0) {
var d = $telerik.getOuterHtml(b), c = d.replace(b.innerHTML);
return /tabindex=/i.test(c);
}
return false;
}, _getElementsToDisable: function (c, b, d) {
var a = $telerik.$(b).find(c.join(",")).filter(function () {
if (this.disabled || !$telerik.getVisible(this) || this === d || $telerik.$.contains(d, this)) {
return false;
}
return true;
});
return $telerik.$.makeArray(a);
}, _disableElements: function (b) {
this._saveDisabledElements = [];
if (!b || b.length == 0) {
return;
}
var a = this._getElementsToDisable(b, document, this._foregroundElement);
for (var c = 0;
c < a.length;
c++) {
a[c].disabled = true;
this._saveDisabledElements.push(a[c]);
}
}, _restoreDisabledElements: function () {
for (var a = 0;
a < this._saveDisabledElements.length;
a++) {
this._saveDisabledElements[a].disabled = false;
}
}, _disableTab: function () {
var c = this._getElementsWithTabIndexes(document, this._foregroundElement);
this._saveTabIndexes = [];
var e;
for (e = 0;
e < c.length;
e++) {
var b = c[e], f = b.tabIndex, d = this._hasTabIndexAttribute(b);
this._saveTabIndexes.push({tag: b, index: f, hasAttribute: d});
b.tabIndex = "-1";
}
if ($telerik.isIE6) {
var h = [];
var g = this._foregroundElement.getElementsByTagName("SELECT");
for (e = 0;
e < g.length;
e++) {
h.push(g[e]);
}
this._saveDesableSelect = [];
var a = document.getElementsByTagName("SELECT");
for (e = 0;
e < a.length;
e++) {
if (Array.indexOf(h, a[e]) == -1) {
this._saveDesableSelect.push({tag: a[e], visib: $telerik.getCurrentStyle(a[e], "visibility")});
a[e].style.visibility = "hidden";
}
}
}
}, _restoreTab: function () {
for (var a = 0;
a < this._saveTabIndexes.length;
a++) {
var c = this._saveTabIndexes[a].tag;
c.tabIndex = this._saveTabIndexes[a].index;
if (!this._saveTabIndexes[a].hasAttribute && this._hasTabIndexAttribute(c)) {
c.removeAttribute("tabIndex");
}
}
if ($telerik.isIE6) {
for (var b = 0;
b < this._saveDesableSelect.length;
b++) {
this._saveDesableSelect[b].tag.style.visibility = this._saveDesableSelect[b].visib;
}
}
}, _disableAccesskey: function () {
this._saveAccessKeys = [];
var b = this._getElementsWithAccessKey(document, this._foregroundElement);
for (var d = 0;
d < b.length;
d++) {
var c = b[d], a = c.accessKey;
this._saveAccessKeys.push({element: c, accessKey: a});
c.accessKey = "";
}
}, _restoreAccessKey: function () {
for (var a = 0;
a < this._saveAccessKeys.length;
a++) {
this._saveAccessKeys[a].element.accessKey = this._saveAccessKeys[a].accessKey;
}
}
};
Telerik.Web.UI.ModalExtender.registerClass("Telerik.Web.UI.ModalExtender", null);
Type.registerNamespace("Telerik.Web");
Telerik.Web.PositioningMode = function () {
throw Error.invalidOperation();
};
Telerik.Web.PositioningMode.prototype = {
Absolute: 0,
Center: 1,
BottomLeft: 2,
BottomRight: 3,
TopLeft: 4,
TopRight: 5
};
Telerik.Web.PositioningMode.registerEnum("Telerik.Web.PositioningMode");
Telerik.Web.PopupBehavior = function (a) {
Telerik.Web.PopupBehavior.initializeBase(this, [a]);
this._x = 0;
this._y = 0;
this._positioningMode = Telerik.Web.PositioningMode.Absolute;
this._parentElement = null;
this._parentElementID = null;
this._moveHandler = null;
this._firstPopup = true;
this._originalParent = null;
this._overlay = false;
this._keepInScreenBounds = true;
this._manageVisibility = true;
};
Telerik.Web.PopupBehavior._ie6pinnedList = {};
Telerik.Web.PopupBehavior.prototype = {
getPageOffset: function () {
var a = {
x: ($telerik.getCorrectScrollLeft(document.documentElement) || $telerik.getCorrectScrollLeft(document.body)),
y: (document.documentElement.scrollTop || document.body.scrollTop)
};
return a;
}, pin: function (g) {
var b = this.get_elementToShow();
var e = this.getPageOffset();
var a;
if ($telerik.isIE6) {
var c = this.get_id();
if (g) {
if (Telerik.Web.PopupBehavior._ie6pinnedList[c]) {
return;
}
a = $telerik.getBounds(b);
Telerik.Web.PopupBehavior._ie6pinnedList[c] = window.setInterval(Function.createDelegate(this, function () {
var h = this.getPageOffset();
var j = a.x - e.x + h.x;
var k = a.y - e.y + h.y;
if (this.get_x() == j && this.get_y() == k) {
return;
}
var i = this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(j);
this.set_y(k);
this.show();
this.set_parentElement(i);
}), 130);
} else {
var f = Telerik.Web.PopupBehavior._ie6pinnedList[c];
if (f) {
window.clearInterval(f);
}
delete Telerik.Web.PopupBehavior._ie6pinnedList[c];
}
} else {
var d = g ? "fixed" : "absolute";
if (b.style.position == d) {
return;
}
a = $telerik.getBounds(b);
if (g && (e.x || e.y)) {
this._x = a.x - e.x;
this._y = a.y - e.y;
$telerik.setLocation(b, {x: this._x, y: this._y});
}
b.style.position = d;
}
}, center: function () {
var b = this.get_elementToShow();
if (this._manageVisibility) {
$telerik.setVisible(b, true);
}
var d = $telerik.getClientBounds();
var c = $telerik.getBounds(b);
var e = parseInt((d.width - c.width) / 2, 10);
var f = parseInt((d.height - c.height) / 2, 10);
var a = this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(e);
this.set_y(f);
this.show();
this.set_parentElement(a);
}, get_parentElement: function () {
if (!this._parentElement && this._parentElementID) {
this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement != null, String.format('Couldn\'t find parent element "{0}"', this._parentElementID));
}
return this._parentElement;
}, set_parentElement: function (a) {
this._parentElement = a;
}, get_parentElementID: function () {
if (this._parentElement) {
return this._parentElement.id;
}
return this._parentElementID;
}, set_parentElementID: function (a) {
this._parentElementID = a;
if (this.get_isInitialized()) {
this.set_parentElement($get(a));
}
}, get_positioningMode: function () {
return this._positioningMode;
}, set_positioningMode: function (a) {
this._positioningMode = a;
}, get_x: function () {
return this._x;
}, set_x: function (a) {
if (a != this._x) {
this._x = a;
if ($telerik.getVisible(this.get_elementToShow()) && this._manageVisibility) {
this.show();
}
}
}, get_y: function () {
return this._y;
}, set_y: function (a) {
if (a != this._y) {
this._y = a;
if ($telerik.getVisible(this.get_elementToShow()) && this._manageVisibility) {
this.show();
}
}
}, get_overlay: function () {
return this._overlay;
}, set_overlay: function (c) {
this._overlay = c;
this._attachWindowHandlers(false);
if (this._overlay) {
this._attachWindowHandlers(true);
} else {
if (!$telerik.isIE6) {
var b = this.get_elementToShow();
var a = b._hideWindowedElementsIFrame;
if (a) {
a.style.display = "none";
}
}
}
}, get_manageVisibility: function () {
return this._manageVisibility;
}, set_manageVisibility: function (a) {
this._manageVisibility = a;
}, get_keepInScreenBounds: function () {
return this._keepInScreenBounds;
}, set_keepInScreenBounds: function (a) {
this._keepInScreenBounds = a;
}, get_elementToShow: function () {
return this._elementToShow ? this._elementToShow : this.get_element();
}, set_elementToShow: function (a) {
if (this._elementToShow) {
this._detachElementToShow();
}
this._elementToShow = a;
}, _detachElementToShow: function () {
var a = this.get_elementToShow();
if (this._moveHandler) {
$telerik.removeExternalHandler(a, "move", this._moveHandler);
this._moveHandler = null;
}
var c = a._hideWindowedElementsIFrame;
if (c) {
var d = c.parentNode;
var b = c.nextSibling;
if (d) {
d.removeChild(c);
if (b) {
d.insertBefore(document.createElement("span"), b);
} else {
d.appendChild(document.createElement("span"));
}
}
}
}, hide: function () {
var b = this.get_elementToShow();
if (this._manageVisibility) {
$telerik.setVisible(b, false);
}
if (b.originalWidth) {
b.style.width = b.originalWidth + "px";
b.originalWidth = null;
}
if (Sys.Browser.agent === Sys.Browser.InternetExplorer || this._overlay) {
var a = b._hideWindowedElementsIFrame;
if (a) {
a.style.display = "none";
}
}
}, show: function () {
var c = this.get_elementToShow();
c.style.position = "absolute";
var b = document.documentElement;
if ($telerik.isFirefox) {
var i = $telerik.getCurrentStyle(b, "overflow");
if ("hidden" == i) {
c.style.left = b.scrollLeft + "px";
c.style.top = b.scrollLeft + "px";
}
}
var e = this._manageVisibility;
if (e) {
$telerik.setVisible(c, true);
}
var g = c.offsetParent || b;
if (e) {
$telerik.setVisible(c, false);
}
var a;
var j;
if (this._parentElement) {
j = $telerik.getBounds(this._parentElement);
var h = this._getOffsetParentLocation(g);
a = {x: j.x - h.x, y: j.y - h.y};
} else {
j = $telerik.getBounds(g);
a = {x: 0, y: 0};
}
if (e) {
$telerik.setVisible(c, true);
}
var l = Math.max(c.offsetWidth - (c.clientLeft ? c.clientLeft * 2 : 0), 0);
var d = Math.max(c.offsetHeight - (c.clientTop ? c.clientTop * 2 : 0), 0);
var k;
switch (this._positioningMode) {
case Telerik.Web.PositioningMode.Center:
k = {x: Math.round(j.width / 2 - l / 2), y: Math.round(j.height / 2 - d / 2)};
break;
case Telerik.Web.PositioningMode.BottomLeft:
k = {x: 0, y: j.height};
break;
case Telerik.Web.PositioningMode.BottomRight:
k = {x: j.width - l, y: j.height};
break;
case Telerik.Web.PositioningMode.TopLeft:
k = {x: 0, y: -c.offsetHeight};
break;
case Telerik.Web.PositioningMode.TopRight:
k = {x: j.width - l, y: -c.offsetHeight};
break;
default:
k = {x: 0, y: 0};
}
k.x += this._x + a.x;
k.y += this._y + a.y;
$telerik.setLocation(c, k);
if (this._firstPopup) {
c.style.width = l + "px";
}
this._firstPopup = false;
var f = this._fixPositionInBounds();
this._createOverlay(f);
}, _getViewportBounds: function () {
var b = $telerik.getClientBounds();
var c = document.documentElement;
var a = document.body;
b.scrollLeft = $telerik.isMobileSafari ? window.pageXOffset : ($telerik.getCorrectScrollLeft(c) || $telerik.getCorrectScrollLeft(a));
b.scrollTop = $telerik.isMobileSafari ? window.pageYOffset : (c.scrollTop || a.scrollTop);
return b;
}, _getOffsetParentLocation: function (a) {
if (a && a.tagName.toUpperCase() != "BODY" && a.tagName.toUpperCase() != "HTML") {
var c = $telerik.getLocation(a);
var b = $telerik.getBorderBox(a);
c.x += b.top;
c.y += b.left;
c.x -= $telerik.getCorrectScrollLeft(a);
c.y -= a.scrollTop;
return c;
}
return {x: 0, y: 0};
}, _fixPositionInBounds: function () {
var c = this.get_elementToShow();
var j = $telerik.getBounds(c);
if (!this._keepInScreenBounds) {
return j;
}
var b = this._getViewportBounds();
var m = false;
var e = (b.width > j.width);
var d = (b.height > j.height);
var l = b.scrollTop;
var a = b.height + l;
var g = b.scrollLeft;
var k = b.width + g;
if (($telerik.isIE8 || $telerik.isOpera || $telerik.isSafari) && $telerik.isRightToLeft(document.body)) {
var i = c.style.display;
if ($telerik.isOpera) {
c.style.display = "none";
}
var f = document.documentElement.scrollWidth;
k = f ? f : document.body.scrollWidth;
if ($telerik.isOpera) {
c.style.display = i;
}
}
if (j.x < g || !e) {
j.x = g;
m = true;
}
if (j.y < l || !d) {
j.y = l;
m = true;
}
if (e && (j.x + j.width > k)) {
j.x = k - j.width;
m = true;
}
if (d && (a < j.y + j.height)) {
j.y = a - j.height;
m = true;
}
if (m) {
var h = this._getOffsetParentLocation(c.offsetParent);
j.y -= h.y;
j.x -= h.x;
$telerik.setLocation(c, j);
}
return j;
}, _createOverlay: function (d) {
if (!$telerik.isIE6 && !this._overlay) {
return;
}
var c = this.get_elementToShow();
var b = c._hideWindowedElementsIFrame;
if (!b) {
b = document.createElement("iframe");
b.src = "javascript:'<html></html>';";
b.style.position = "absolute";
b.style.display = "none";
b.scrolling = "no";
b.frameBorder = "0";
b.tabIndex = "-1";
b.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
c.parentNode.insertBefore(b, c);
c._hideWindowedElementsIFrame = b;
this._moveHandler = Function.createDelegate(this, this._onMove);
$telerik.addExternalHandler(c, "move", this._moveHandler);
}
$telerik.setBounds(b, d);
if ($telerik.isFirefox) {
var a = this._getViewportBounds();
b.style.top = parseInt(d.y, 10) - a.scrollTop + "px";
b.style.left = parseInt(d.x, 10) - a.scrollLeft + "px";
b.style.position = "fixed";
if ($telerik.isFirefox3) {
b.style.backgroundColor = "#fff";
}
}
if ($telerik.quirksMode) {
return;
}
b.style.display = c.style.display;
var e = $telerik.getCurrentStyle(c, "zIndex");
if (e) {
b.style.zIndex = e;
}
}, _setCoordinates: function (b, c) {
var a = false;
if (b != this._x) {
this._x = b;
a = true;
}
if (c != this._y) {
this._y = c;
a = true;
}
if ($telerik.getVisible(this.get_elementToShow()) && a && this._manageVisibility) {
this.show();
}
}, initialize: function () {
Telerik.Web.PopupBehavior.callBaseMethod(this, "initialize");
this.hide();
}, dispose: function () {
var a = this.get_elementToShow();
if (a) {
this._attachWindowHandlers(false);
if ($telerik.getVisible(a) && this._manageVisibility) {
this.hide();
}
if (this._originalParent) {
a.parentNode.removeChild(a);
this._originalParent.appendChild(a);
this._originalParent = null;
}
this._detachElementToShow();
}
this._parentElement = null;
Telerik.Web.PopupBehavior.callBaseMethod(this, "dispose");
if (a && a._behaviors && a._behaviors.length == 0) {
a._behaviors = null;
}
a = null;
}, _onMove: function () {
var b = this.get_elementToShow();
var c = b._hideWindowedElementsIFrame;
if (c) {
if (Sys.Browser.agent === Sys.Browser.Firefox) {
var a = this._getViewportBounds();
c.style.top = parseInt(b.style.top, 10) - a.scrollTop + "px";
c.style.left = parseInt(b.style.left, 10) - a.scrollLeft + "px";
c.style.position = "fixed";
} else {
c.style.top = b.style.top;
c.style.left = b.style.left;
}
}
}, _handleElementResize: function () {
var a = this.get_elementToShow();
var c = a._hideWindowedElementsIFrame;
if (c) {
var b = $telerik.getBounds(a);
$telerik.setBounds(c, b);
}
}, _attachWindowHandlers: function (a) {
if (!Sys.Browser.agent === Sys.Browser.Firefox) {
return;
}
var b = window;
if (true == a) {
this._windowResizeDelegate = Function.createDelegate(this, this._onMove);
$telerik.addExternalHandler(b, "resize", this._windowResizeDelegate);
this._windowScrollDelegate = Function.createDelegate(this, this._onMove);
$telerik.addExternalHandler(b, "scroll", this._windowScrollDelegate);
} else {
if (this._windowResizeDelegate) {
$telerik.removeExternalHandler(b, "resize", this._windowResizeDelegate);
}
this._windowResizeDelegate = null;
if (this._windowScrollDelegate) {
$telerik.removeExternalHandler(b, "scroll", this._windowScrollDelegate);
}
this._windowScrollDelegate = null;
}
}
};
Telerik.Web.PopupBehavior.registerClass("Telerik.Web.PopupBehavior", Sys.UI.Behavior);
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Helpers");
(function (a, p) {
var b = Telerik.Web.UI, h = "pageX", i = "pageY", c = "clientX", d = "clientY", r = "x", s = "y", f = Math, e = f.floor, l = !!window.PointerEvent, g = !!window.MSPointerEvent, k, m, j, o, n = null;
if (l || g) {
k = l ? "pointerdown" : "MSPointerDown";
m = l ? "pointermove" : "MSPointerMove";
j = l ? "pointercancel" : "MSPointerCancel";
o = l ? "pointerup" : "MSPointerUp";
n = l ? "pointerout" : "MSPointerOut";
}
var q = (function () {
var t = {};
t.hasTouch = "ontouchstart" in window;
t.hasPointer = l || g;
t.hasPointerTouch = !!navigator.msMaxTouchPoints;
t.isTouch = t.hasTouch || t.hasPointerTouch;
t._pointers = [];
return t;
})();
b.ResizeExtender = function (w, v, z, A, u, x, t, y) {
this._document = u ? u : document;
this._documentMouseMoveDelegate = null;
this._documentMouseUpDelegate = null;
this._jsOwner = null;
this._element = null;
this._tableElement = null;
this._saveDelegates = {};
this._moveCursorType = "move";
this._moveToMouseLocation = false;
this._hideIframes = true;
this._iframeToSkip = null;
this._enabled = true;
this._startX = 0;
this._startY = 0;
this._cancelResize = true;
this._startCursorLocation = null;
this._autoScrollEnabled = true;
this._ieTouchActionManager = new b.Helpers.IETouchActionManager(v);
this._touchEventIdentifier = null;
this._utils = q;
this.initialize(w, v, z, A, x, t, y);
};
b.ResizeExtender.containsBounds = function (v, t) {
if (!v || !t) {
return false;
}
var u = $telerik.containsPoint(v, t.x, t.y);
if (u) {
var w = t.x + t.width;
var z = t.y + t.height;
u = $telerik.containsPoint(v, w, z);
}
return u;
};
b.ResizeExtender.prototype = {
initialize: function (u, x, y, z, v, t, w) {
if (!x) {
return;
}
if (this._element) {
alert("Element " + x.getAttribute("id") + " cannot be made resizable, as the resizeExtender already has the element " + this._element.getAttribute("id") + " associated with it. You must create a new extender resizer object");
return;
}
this._jsOwner = u;
this._element = x;
this._tableElement = z;
this._handles = y;
this._ieTouchActionManager.allowUserTouch();
if (v) {
this._moveCursorType = v;
}
if (t != null) {
this._autoScrollEnabled = t;
}
if (w != null) {
this._moveToMouseLocation = w;
}
this._configureHandleElements(true);
}, dispose: function () {
this._ieTouchActionManager.dispose();
this._attachDocumentHandlers(false);
this._configureHandleElements(false);
this._startCursorLocation = null;
this._iframeToSkip = null;
this._jsOwner = null;
this._element = null;
this._handles = null;
this._saveDelegates = null;
this._constraints = null;
}, enable: function (t) {
this._enabled = t;
}, set_hideIframes: function (t) {
this._hideIframes = t;
}, get_hideIframes: function () {
return this._hideIframes;
}, set_iframeToSkip: function (t) {
this._iframeToSkip = t;
}, get_iframeToSkip: function () {
return this._iframeToSkip;
}, get_constraints: function () {
return this._constraints;
}, set_constraints: function (t) {
this._constraints = t;
}, get_useCssTransform: function () {
return this._useCssTransform;
}, set_useCssTransform: function (t) {
this._useCssTransform = t;
}, _raiseDragEvent: function (v, u, x) {
var y = this, w = y._jsOwner;
if (w && w["on" + v]) {
var t = u;
if (!t) {
t = {};
}
t.element = y._element;
t.ownerEvent = x;
t.eventIdetifier = y._getTouchEventIdentifier(x);
return w["on" + v](t);
}
return true;
}, _raiseEvent: function (u, t) {
var v = this._jsOwner;
if (v && v["on" + u]) {
if (!t) {
t = new Sys.EventArgs();
} else {
if (u == "Resize") {
t = this._resizeDir;
} else {
if (u == "Resizing") {
t = this._getProposedBounds(t);
}
}
}
return v["on" + u](t);
}
return true;
}, _getProposedBounds: function (t) {
var u = $telerik.getBounds(this._element);
return {x: t.x || u.x, y: t.y || u.y, width: t.width || u.width, height: t.height || u.height};
}, getPositionedParent: function () {
var t = this._element.parentNode;
while (t && t != document) {
if ("static" != $telerik.getCurrentStyle(t, "position", "static")) {
return t;
}
t = t.parentNode;
}
return null;
}, _storeStartCoords: function (v) {
var E = this, G = E._utils;
if (!E._enabled) {
return;
}
E._cancelResize = false;
var F = E._getTouchEventLocation(v, E._touchEventIdentifier);
if (G.isTouch && F && F.x && F.y) {
E._startX = F.x;
E._startY = F.y;
} else {
if (v.originalEvent) {
E._startX = e(v.originalEvent[c]);
E._startY = e(v.originalEvent[d]);
} else {
E._startX = e(v.clientX);
E._startY = e(v.clientY);
}
}
var x = E._element;
var w = $telerik.getBounds(x);
var y = (x.id != null && b.RadDock && b.RadDock.isInstanceOfType($find(x.id)));
if ($telerik.isIE && y != true) {
var C = E.getPositionedParent();
if (C) {
w.x += C.scrollLeft;
w.y += C.scrollTop;
}
}
E._originalBounds = w;
var D = v.target ? v.target : v.srcElement;
if (D && D.type == 3) {
D = D.parentNode;
}
E._resizeType = $telerik.getCurrentStyle(D, "cursor");
if (!E._resizeType && v.currentTarget) {
E._resizeType = $telerik.getCurrentStyle(v.currentTarget, "cursor");
}
E._resizeDir = {
north: E._resizeType.match(/n.?-/) ? 1 : 0,
east: E._resizeType.match(/e-/) ? 1 : 0,
south: E._resizeType.match(/s.?-/) ? 1 : 0,
west: E._resizeType.match(/w-/) ? 1 : 0,
move: new RegExp(E._moveCursorType).test(this._resizeType) ? 1 : 0
};
E._leftHandleMouseDelta = 0;
if (E._resizeDir.west) {
E._leftHandleMouseDelta = Math.abs(w.x - this._startX);
}
var u = E._resizeDir.move ? E._raiseDragEvent("DragStart", null, v) : E._raiseEvent("ResizeStart");
E._cancelResize = (u == false);
var B = $telerik.getCurrentStyle(x.parentNode, "position");
var z = ("relative" == B) || ("absolute" == B);
E._offsetLocation = z ? $telerik.getLocation(x.parentNode) : {x: 0, y: 0};
if (E._moveToMouseLocation) {
var A = $telerik.isTouchDevice ? {
left: E._startX,
top: E._startY
} : $telerik.getDocumentRelativeCursorPosition({clientX: this._startX, clientY: this._startY});
if (z) {
var t = $telerik.getBorderBox(x.parentNode);
A.left -= t.left;
A.top -= t.top;
}
E._startCursorLocation = {x: A.left - Math.floor(w.width / 2), y: A.top - Math.floor(w.height / 2)};
}
if (!E._cancelResize) {
E._clearSelection();
E._setIframesVisible(false);
E._attachDocumentHandlers(false);
E._attachDocumentHandlers(true);
}
}, _getTouchEventLocation: function (u, C, v) {
var B = this, z = u.originalEvent ? u.originalEvent : null, t = u.changedTouches || (z ? z.changedTouches : u.rawEvent ? u.rawEvent.changedTouches : false), y = null;
q._pointers = B._getUniquePointerIds();
var A = q._pointers;
var x;
var w;
if (q.isTouch) {
if (z) {
if (q.hasPointer) {
x = false;
for (w = 0;
w < A.length;
w++) {
if (A[w].pointerId === C) {
y = {x: A[w][h], y: A[w][i]};
x = true;
break;
}
}
if (!x) {
y = {x: e(z[h]), y: e(z[i])};
}
} else {
if (t && t[0]) {
x = false;
for (w = 0;
w < t.length;
w++) {
if (t[w].identifier === C) {
y = {x: t[w][h], y: t[w][i]};
x = true;
break;
}
}
if (!x) {
y = {x: t[0][h], y: t[0][i]};
}
}
}
} else {
y = {x: e(u.clientX), y: e(u.clientY)};
}
}
return y;
}, _getEventClientCoordinates: function (t) {
if (t.originalEvent) {
return {x: t.originalEvent[c], y: t.originalEvent[d]};
} else {
return {x: t[c], y: t[d]};
}
}, _getIntegerCoordinates: function (t) {
if (!t || !t.hasOwnProperty(r) || !t.hasOwnProperty(s)) {
return null;
} else {
return {x: e(t.x), y: e(t.y)};
}
}, _getIntegerEventCoordinates: function (u) {
var w = this, t = w._getEventClientCoordinates(u), v = w._getIntegerCoordinates(t);
return v;
}, _getTouchEventIdentifier: function (t) {
var v = this, w = v._utils, u = t.originalEvent ? t.originalEvent : null;
if (w.isTouch) {
if (u) {
if (u.targetTouches && u.targetTouches[0]) {
return u.targetTouches[0].identifier;
} else {
if (u.pointerId) {
return u.pointerId;
}
}
} else {
return null;
}
}
return null;
}, _resize: function (w) {
var G = this, H = G._utils;
if (!G._enabled || G._cancelResize) {
return false;
}
var t = G._originalBounds;
var C = new Sys.UI.Bounds(0, 0, 0, 0);
var y = null;
if (H.isTouch) {
y = G._getTouchEventLocation(w, G._touchEventIdentifier);
} else {
y = G._getIntegerEventCoordinates(w);
}
if (y === null) {
return false;
}
var I = y.x - G._startX;
var J = y.y - G._startY;
var v = G._resizeDir;
var z = v.move;
if (z) {
var A = G._startCursorLocation;
if (A) {
t.x = A.x;
t.y = A.y;
G._originalBounds = t;
G._startCursorLocation = null;
}
C.x = t.x + I;
C.y = t.y + J;
var B = G._getMoveConstraints(t);
if (B) {
C.x = G._constrainPosition(C.x, B.x, B.width);
C.y = G._constrainPosition(C.y, B.y, B.height);
}
} else {
if (v.east) {
C.x = t.x;
C.width = t.width + I;
} else {
if (v.west) {
C.x = y.x - G._leftHandleMouseDelta;
C.width = t.width - I;
}
}
if (v.south) {
C.y = t.y;
C.height = t.height + J;
} else {
if (v.north) {
C.y = t.y + J;
C.height = t.height - J;
}
}
var F = G._getSizeConstraints(t);
if (F) {
C.x = G._constrainPosition(C.x, F.x, Math.min(C.x + C.width, F.width - C.width));
C.y = G._constrainPosition(C.y, F.y, Math.min(C.y + C.height, F.height - C.height));
C.width = G._constrainDimension(C.width, F.width - C.x);
C.height = G._constrainDimension(C.height, F.height - C.y);
}
}
var D = G._offsetLocation;
if (D) {
C.x -= D.x;
C.y -= D.y;
}
var E = z ? G._raiseDragEvent("Drag", C, w) : G._raiseEvent("Resizing", C);
if (false == E) {
return true;
}
var x = G._element;
if (G._useCssTransform && z) {
G._lastTouchDelta = {x: C.x - t.x + D.x, y: C.y - t.y + D.y};
var u = {x: C.x ? G._lastTouchDelta.x : 0, y: C.y ? G._lastTouchDelta.y : 0};
G._setTranslate(x, u.x, u.y);
} else {
if (z || C.x > 0) {
x.style.left = C.x + "px";
}
if (z || C.y > 0) {
x.style.top = C.y + "px";
}
}
if (C.width > 0) {
x.style.width = C.width + "px";
}
if (C.height > 0) {
x.style.height = C.height + "px";
}
if (!z) {
G._updateInnerTableSize();
}
return true;
}, _setTranslate: function (t, v, w) {
var u = t.style;
u.webkitTransform = u.mozTransform = u.OTransform = "translate(" + v + "px," + w + "px)";
}, _updateInnerTableSize: function () {
var t = this._resizeDir;
if (t.south || t.north) {
var u = this._element.style.height;
var v = this._tableElement;
if (v) {
v.style.height = u;
this._fixIeHeight(v, u);
}
}
}, _getMoveConstraints: function (t) {
var u = this._getSizeConstraints();
if (u) {
u.width -= t.width;
u.height -= t.height;
}
return u;
}, _getSizeConstraints: function (t) {
var u = this._constraints;
if (!u) {
return null;
}
var v = u.x + this._offsetLocation.x;
var w = u.y + this._offsetLocation.y;
return new Sys.UI.Bounds(v, w, v + u.width, w + u.height);
}, _constrainPosition: function (v, u, t) {
return Math.max(u, Math.min(t, v));
}, _constrainDimension: function (u, t) {
return this._constrainPosition(u, 0, t);
}, _fixIeHeight: function (w, u) {
if ("CSS1Compat" == document.compatMode) {
var t = (w.offsetHeight - parseInt(u, 10));
if (t > 0) {
var v = (parseInt(w.style.height, 10) - t);
if (v > 0) {
w.style.height = v + "px";
}
}
}
}, _setIframesVisible: function (t) {
if (!this.get_hideIframes()) {
return;
}
var x = this._document.getElementsByTagName("iframe");
var y = this.get_iframeToSkip();
for (var w = 0, z = x.length;
w < z;
w++) {
var v = x[w];
if (y && (y === v || y == v)) {
y = null;
} else {
v.style.visibility = t ? "" : "hidden";
if ($telerik.isIE) {
try {
v.contentWindow.document.body.style.visibility = t ? "" : "hidden";
} catch (u) {
}
}
}
}
}, _configureHandleElements: function (t) {
var v = this._handles;
var w = ["nw", "n", "ne", "w", "e", "sw", "s", "se", this._moveCursorType];
for (var x = 0, z = w.length;
x < z;
x++) {
var A = w[x];
var u = v[A];
if (u) {
if (Object.prototype.toString.call(u) === "[object Array]") {
for (var y = 0;
y < u.length;
y++) {
this._configureHandle("id" + x + "_" + y, t, u[y], A);
}
} else {
this._configureHandle("id" + x, t, u, A);
}
}
}
}, _configureHandle: function (A, t, w, z) {
var y = this;
var v = this._saveDelegates;
var u = v[A] ? v[A].delegate : null;
if (t) {
if (!u) {
var x = y._addMobileHandler(this, w, "mousedown", this._onHandleMouseDown, null, true);
w.style.cursor = (z == this._moveCursorType) ? z : z + "-resize";
v[A] = {element: w, delegate: x};
}
} else {
if (u) {
y._removeMobileHandler(w, "mousedown", u, null, true);
w.style.cursor = "";
delete v[A];
}
}
}, _attachDocumentHandlers: function (t) {
var x = this;
var w = x._document;
if (t) {
x._documentMouseMoveDelegate = x._addMobileHandler(x, w, "mousemove", x._onDocumentMouseMove, null, true);
x._documentMouseUpDelegate = x._addMobileHandler(x, w, "mouseup", x._onDocumentMouseUp, null, true);
} else {
var v = x._documentMouseMoveDelegate;
if (v) {
x._removeMobileHandler(w, "mousemove", v, null, true);
}
var u = x._documentMouseUpDelegate;
if (u) {
x._removeMobileHandler(w, "mouseup", u, null, true);
}
x._documentMouseMoveDelegate = null;
x._documentMouseUpDelegate = null;
}
}, _addMobileHandler: function (z, u, v, w, y, x) {
var A = this;
if (!u || !z) {
return;
}
var t = Function.createDelegate(z, w);
if (q.isTouch || q.hasPointer) {
if (a) {
a(u).bind(A._getMobileEventCounterpart(v), t);
} else {
$telerik.addExternalHandler(u, A._getMobileEventCounterpart(v), t);
}
}
if (!A._utils.hasPointer) {
if (x) {
$telerik.addExternalHandler(u, v, t);
} else {
$addHandler(u, v, t);
}
}
return t;
}, _removeMobileHandler: function (t, u, v, x, w) {
var y = this;
if (!t) {
return;
}
if (q.isTouch || q.hasPointer) {
if (a) {
a(t).unbind(y._getMobileEventCounterpart(u), (x || v));
} else {
$telerik.removeExternalHandler(t, y._getMobileEventCounterpart(u), (x || v));
}
}
if (!y._utils.hasPointer) {
if (w) {
$telerik.removeExternalHandler(t, u, v);
} else {
$removeHandler(t, u, v);
}
}
}, _getMobileEventCounterpart: function (t) {
var u = this, v = u._utils;
if (v.isTouch) {
switch (t) {
case"mousedown":
return (k || "touchstart");
case"mousemove":
return (m || "touchmove");
case"mouseup":
return (o || "touchend");
}
}
return t;
}, _canExecuteTouchEvent: function (t) {
var w = this, x = w._utils, v = t.originalEvent ? t.originalEvent : null, u = null;
if (x.isTouch) {
if (v) {
if (x.hasPointer) {
if (v.pointerId) {
u = v.pointerId;
}
} else {
if (v.targetTouches && v.targetTouches[0]) {
u = v.targetTouches[0].identifier;
}
}
if (u === null) {
return false;
}
if (w._touchEventIdentifier !== null) {
if (w._touchEventIdentifier !== u) {
return false;
}
} else {
w._touchEventIdentifier = u;
}
return true;
} else {
return true;
}
} else {
return false;
}
}, _cleanUpPointerTracking: function (t) {
var w = this;
if (!q.hasPointer) {
return;
}
q._pointers = w._getUniquePointerIds();
var v = q._pointers;
var u = t.originalEvent ? this._indexOfPointer(t.originalEvent.pointerId) : null;
if (u !== null && u !== -1) {
v.splice(u, 1);
}
}, _getUniquePointerIds: function () {
var v = q._pointers, w = [], u = null, t = [];
w = $telerik.$.grep(v, function (x, y) {
if (!x.pointerId) {
return false;
}
u = x.pointerId;
if ($telerik.$.inArray(u, t) === -1) {
t.push(u);
return true;
}
return false;
});
return w;
}, _indexOfPointer: function (u) {
var v = q._pointers, w = v.length;
for (var t = 0;
t < w;
t++) {
if (u === v[t].pointerId) {
return t;
}
}
return -1;
}, _updatePointer: function (t) {
var v = this;
if (!q.hasPointer) {
return;
}
var u = t.originalEvent ? v._indexOfPointer(t.originalEvent.pointerId) : null;
if (u !== null && u !== -1) {
if (t.originalEvent.pointerId === v._touchEventIdentifier) {
q._pointers[u].pageX = e(t.originalEvent.pageX);
q._pointers[u].pageY = e(t.originalEvent.pageY);
}
}
}, _onHandleMouseDown: function (u) {
var w = this, y = w._utils, x = null, v = u.originalEvent, t = true;
if (y.isTouch) {
if (v) {
x = w._getTouchEventIdentifier(u);
if (x !== null) {
q._pointers.push({pageX: e(v[h]), pageY: e(v[i]), pointerId: x});
}
t = w._canExecuteTouchEvent(u);
} else {
w._resetTouchIdentifier();
}
}
if (t) {
w._updatePointer(u);
w._storeStartCoords(u);
}
if (!y.isTouch) {
return $telerik.cancelRawEvent(u);
}
if (y.isTouch && y.hasPointer) {
w._onDocumentMouseMove(u);
}
}, _onDocumentMouseMove: function (u) {
var v = this, x = v._utils, t = true, w;
if (x.isTouch) {
t = v._canExecuteTouchEvent(u);
v._updatePointer(u);
}
if (t) {
w = v._resize(u);
}
if (v._autoScrollEnabled) {
v._autoScroll(u);
}
if (w) {
return $telerik.cancelRawEvent(u);
}
}, _onDocumentMouseUp: function (t) {
var v = this;
var w = !v._cancelResize;
v._cancelResize = true;
v._startCursorLocation = null;
var u = v._resizeDir && v._resizeDir.move;
if (v._useCssTransform && u) {
v._moveBoxBy(v._lastTouchDelta);
}
if (w) {
v._clearSelection();
v._setIframesVisible(true);
if (u) {
v._raiseDragEvent("DragEnd", null, t);
} else {
v._raiseEvent("ResizeEnd");
}
v._attachDocumentHandlers(false);
if (v._scroller) {
v._scroller.set_enabled(false);
}
}
v._touchEventIdentifier = null;
if (q.isTouch) {
var x = v._getTouchEventIdentifier(t);
if (x !== null) {
v._cleanUpPointerTracking(t);
}
}
}, _getTouchIdentifier: function () {
return this._touchEventIdentifier;
}, _resetTouchIdentifier: function () {
var t = this;
t._touchEventIdentifier = null;
}, _moveBoxBy: function (v, t) {
var u = this._originalBounds;
var w = this._offsetLocation;
t = t || this._element;
this._resetBoxTransform(t);
t.style.left = u.x + v.x - w.x + "px";
t.style.top = u.y + v.y - w.y + "px";
}, _resetBoxTransform: function (t) {
var u = t.style;
u.webkitTransform = u.mozTransform = u.OTransform = u.msTranslate = "translate(0,0)";
}, _clearSelection: function () {
if (this._document.selection && this._document.selection.empty) {
try {
this._document.selection.empty();
} catch (t) {
}
}
}, _initializeAutoScroll: function () {
if (this._autoScrollInitialized) {
return;
}
this._scrollEdgeConst = 40;
this._scrollByConst = 10;
this._scroller = null;
this._scrollDeltaX = 0;
this._scrollDeltaY = 0;
this._scrollerTickHandler = Function.createDelegate(this, this._onScrollerTick);
this._scroller = new Telerik.Web.Timer();
this._scroller.set_interval(10);
this._scroller.add_tick(this._scrollerTickHandler);
this._autoScrollInitialized = true;
}, _autoScroll: function (u) {
this._initializeAutoScroll();
var t = $telerik.getClientBounds();
if (t.width > 0) {
this._scrollDeltaX = this._scrollDeltaY = 0;
if (u.clientX < t.x + this._scrollEdgeConst) {
this._scrollDeltaX = -this._scrollByConst;
} else {
if (u.clientX > t.width - this._scrollEdgeConst) {
this._scrollDeltaX = this._scrollByConst;
}
}
if (u.clientY < t.y + this._scrollEdgeConst) {
this._scrollDeltaY = -this._scrollByConst;
} else {
if (u.clientY > t.height - this._scrollEdgeConst) {
this._scrollDeltaY = this._scrollByConst;
}
}
var v = this._scroller;
if (this._scrollDeltaX != 0 || this._scrollDeltaY != 0) {
this._originalStartX = this._startX;
this._originalStartY = this._startY;
v.set_enabled(true);
} else {
if (v.get_enabled()) {
this._startX = this._originalStartX;
this._startY = this._originalStartY;
}
v.set_enabled(false);
}
}
}, _onScrollerTick: function () {
var z = document.documentElement.scrollLeft || document.body.scrollLeft;
var A = document.documentElement.scrollTop || document.body.scrollTop;
window.scrollBy(this._scrollDeltaX, this._scrollDeltaY);
var x = document.documentElement.scrollLeft || document.body.scrollLeft;
var y = document.documentElement.scrollTop || document.body.scrollTop;
var t = x - z;
var u = y - A;
var v = this._element;
var B = {x: parseInt(v.style.left, 10) + t, y: parseInt(v.style.top, 10) + u};
this._startX -= t;
this._startY -= u;
try {
$telerik.setLocation(v, B);
} catch (w) {
}
}
};
b.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender", null, Sys.IDisposable);
Telerik.Web.UI.Helpers.IETouchActionManager = function (t) {
this.element = t;
};
Telerik.Web.UI.Helpers.IETouchActionManager.prototype = {
allowUserTouch: function () {
if (!this.isPointerEnabled()) {
return;
}
var t = this.getStyle();
this.cachedTouchAction = t.msTouchAction;
t.msTouchAction = "none";
}, restore: function () {
if (!this.isPointerEnabled()) {
return;
}
this.getStyle().msTouchAction = this.cachedTouchAction;
}, getStyle: function () {
return this.element ? this.element.style : {};
}, isPointerEnabled: function () {
try {
return window.navigator.msPointerEnabled;
} catch (t) {
return false;
}
}, dispose: function () {
this.restore();
this.element = null;
}
};
})($telerik.$);
/* END Telerik.Web.UI.Common.Popup.PopupScripts.js */
/* START Telerik.Web.UI.Common.AnimationFramework.AnimationFramework.js */
(function (b, a) {
var e = "cID", f = "completeCallback", d = "key", g = "display", p = "random", k = 50, r = document.createElement("p").style, s = "transition" in r, v = {
queue: true,
specialEasing: true,
step: true,
progress: true,
start: true,
done: true,
fail: true,
always: true
}, u = {
ease: "easeInQuad",
easeIn: "easeInQuad",
easeOut: "easeOutQuad",
easeInOut: "easeInOutQuad"
}, l = ["linear", "ease", "easeIn", "easeOut", "easeInOut", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInSine", "easeOutSine", "easeInOutSine", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInCirc", "easeOutQuad", "easeInOutQuad", "easeInBack", "easeOutBack", "easeInOutBack"], m = {
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out"
}, i = {
linear: true,
ease: true,
"ease-in": true,
"ease-out": true,
"ease-in-out": true,
easeIn: true,
easeOut: true,
easeInOut: true
}, h = {
easeInQuad: [0.55, 0.08500000000000001, 0.6800000000000001, 0.53],
easeOutQuad: [0.25, 0.46, 0.45, 0.94],
easeInOutQuad: [0.455, 0.03, 0.515, 0.955],
easeInCubic: [0.55, 0.055, 0.675, 0.19],
easeOutCubic: [0.215, 0.61, 0.355, 1],
easeInOutCubic: [0.645, 0.045, 0.355, 1],
easeInQuart: [0.895, 0.03, 0.6850000000000001, 0.22],
easeOutQuart: [0.165, 0.84, 0.44, 1],
easeInOutQuart: [0.77, 0, 0.175, 1],
easeInQuint: [0.755, 0.05, 0.855, 0.06],
easeOutQuint: [0.23, 1, 0.32, 1],
easeInOutQuint: [0.86, 0, 0.07000000000000001, 1],
easeInSine: [0.47, 0, 0.745, 0.715],
easeOutSine: [0.39, 0.575, 0.565, 1],
easeInOutSine: [0.445, 0.05, 0.55, 0.95],
easeInExpo: [0.95, 0.05, 0.795, 0.035],
easeOutExpo: [0.19, 1, 0.22, 1],
easeInOutExpo: [1, 0, 0, 1],
easeInCirc: [0.6, 0.04, 0.98, 0.335],
easeOutCirc: [0.075, 0.82, 0.165, 1],
easeInOutCirc: [0.785, 0.135, 0.15, 0.86],
easeInBack: [0.6, -0.28, 0.735, 0.045],
easeOutBack: [0.175, 0.885, 0.32, 1.275],
easeInOutBack: [0.6800000000000001, -0.55, 0.265, 1.55]
}, t, j = {transition: "none"};
Array.forEach(["Moz", "webkit", "O", "ms"], function (z) {
var y = z, w = (y + "Transition" in r) ? y : null, x;
if (w) {
x = w.toLowerCase();
t = (x === "o" || x === "webkit") ? x + "TransitionEnd" : "transitionend";
return false;
}
});
b.transition = function (A, D, y, z, x) {
var w, B, C;
if (z && z.toLowerCase() == p) {
z = l[Math.round(Math.random() * (l.length - 1))];
}
if (s && (i[z] || h[z])) {
w = a(A);
if (a.isPlainObject(y)) {
C = y;
for (B in v) {
if (B in C) {
n(arguments);
return;
}
}
} else {
C = {duration: y, easing: z, complete: x};
}
c(w, D, C);
} else {
n(arguments);
}
};
a.fn.transition = function (z, x, y, w) {
b.transition(this, z, x, y, w);
};
b.stopTransition = function (x, w, y) {
return q(a(x), w || false, y || false);
};
a.fn.stopTransition = function (w, x) {
return b.stopTransition(this, w || false, x || false);
};
function n(y) {
var w = a(y[0]), A = 1, B = y.length, x = [], z = y[3];
y[3] = u[z] || z;
for (;
A < B;
A++) {
x[A - 1] = y[A];
}
w.animate.apply(w, x);
}
function c(w, D, C) {
var z = m[C.easing] || C.easing || "easeOutQuad", E = [], y = parseFloat(C.duration), B, x;
for (B in D) {
B = B.replace(/[A-Z]/g, function (F) {
return "-" + F.toLowerCase();
});
E.push(B);
}
if (h[z]) {
z = "cubic-bezier(" + h[z].join(",") + ")";
}
w.data(d, E);
var A = function () {
var F = w.data(e), G = typeof arguments[0] === "boolean" ? arguments[0] : true;
if (F) {
clearTimeout(F);
F = null;
}
w.off(t, A).removeData(d).removeData(e).removeData(f).css(j);
if (C.complete && G) {
C.complete.call(w.eq(0));
}
};
w.data(f, A);
w.on(t, A);
x = setTimeout(A, Math.ceil(y + k));
w.data(e, x);
w.css(g);
w.css(a.extend({
"transition-duration": y / 1000 + "s",
"transition-timing-function": z,
"transition-property": E.join(", ")
}, D));
}
function q(w, z, B) {
var y = w.data(f), x = w.data(d), D = (!B && x), C, A;
if (s) {
if (D) {
A = getComputedStyle(w[0]);
C = o(x, A);
}
if (y) {
y.call(w, B);
}
if (D) {
w.css(C);
}
return w;
} else {
return w.stop(z, B);
}
}
function o(w) {
var x = {}, y = arguments[1];
Array.forEach(w, function (z) {
x[z] = y[z];
});
return x;
}
})($telerik, $telerik.$);
/* END Telerik.Web.UI.Common.AnimationFramework.AnimationFramework.js */
/* START Telerik.Web.UI.Common.Animation.AnimationScripts.js */
Type.registerNamespace("Telerik.Web.UI.Animations");
(function () {
var a = $telerik.$;
var b = Telerik.Web.UI;
b.Animations.playJQueryAnimation = function (d, f, o, i, n, l, k, e, m) {
if (!d) {
return;
}
if (!f) {
f = 2;
}
if (!o) {
o = new Sys.UI.Bounds(1, 1, 1, 1);
}
if (!i) {
i = new Sys.UI.Bounds(1, 1, 1, 1);
}
var c = e ? e : 500;
if (!n) {
n = 32;
}
n += "";
var q = parseInt(n.substr(0, 1), 10);
var j = parseInt(n.substr(1, 1), 10);
if (l) {
l();
}
a(d).stopTransition(false, true);
if (f == 2) {
a(d).css({left: i.x, top: i.y}).fadeIn(c, k);
return;
}
if (f == 8) {
var g = $telerik.getClientBounds();
var h = $telerik.getClientBounds();
o.x = h.width / 2;
o.y = h.height;
switch (j) {
case 2:
o.x = i.x;
break;
case 3:
o.x = g.width;
break;
case 1:
o.x = g.x;
}
switch (q) {
case 2:
o.y = i.y;
break;
case 1:
o.y = g.y - i.height;
break;
case 3:
o.y = g.height;
}
} else {
if (f == 4) {
o.x = i.x;
o.y = i.y;
o.width = i.width;
o.height = 1;
switch (j) {
case 2:
o.x = i.x;
break;
case 3:
o.x = i.x;
break;
case 1:
var p = i.x;
if (2 == q) {
p += i.width;
}
o.x = p;
}
switch (q) {
case 2:
o.y = i.y;
o.height = i.height;
o.width = 1;
break;
case 1:
o.y = i.y + i.height;
break;
case 3:
o.y = i.y;
}
}
}
a(d).css({
width: o.width,
height: o.height,
left: o.x,
top: o.y,
opacity: 0.1,
filter: "alpha(opacity=10)"
}).show().transition({width: i.width, height: i.height, left: i.x, top: i.y, opacity: m ? m : 1}, c, null, k);
};
a.fx.prototype.oldstep = a.fx.prototype.step;
a.fx.prototype.step = function (d) {
var e = this.prop;
if (e == "left" || e == "top" || e == "telerikCarouselAngle" || e == "telerikCoverFlowIndex") {
if (this.elem.getAttribute("paused")) {
if (!this.elem.getAttribute("elapsedTime")) {
var c = (+new Date()) - this.startTime;
this.elem.setAttribute("elapsedTime", c);
}
return true;
}
if (this.elem.getAttribute("elapsedTime")) {
this.startTime = (+new Date()) - this.elem.getAttribute("elapsedTime");
this.elem.removeAttribute("elapsedTime");
}
}
return this.oldstep(d);
};
b.Animations.jMoveBase = function (f, e, c, d) {
b.Animations.jMoveBase.initializeBase(this);
this._owner = f;
this._element = e;
this._duration = c;
this._events = null;
this._animationEndedDelegate = null;
this._isPlaying = false;
this._isPaused = false;
this._isCyclic = false;
this._easing = d;
this._isDisposed = false;
};
b.Animations.jMoveBase.prototype = {
initialize: function () {
b.Animations.jMoveBase.callBaseMethod(this, "initialize");
this._animationEndedDelegate = Function.createDelegate(this, this._animationEnded);
}, dispose: function () {
if (this._isDisposed) {
return;
}
this._getAnimationQuery().stopTransition(true, false);
this._owner = null;
this._element = null;
this._animationEndedDelegate = null;
b.Animations.jMoveBase.callBaseMethod(this, "dispose");
this._isDisposed = true;
}, get_isPlaying: function () {
return this._isPlaying;
}, get_isCyclic: function () {
return this._isCyclic;
}, set_isCyclic: function (c) {
this._isCyclic = c;
}, get_easing: function () {
return this._easing;
}, set_easing: function (c) {
this._easing = c;
}, get_duration: function () {
return this._duration;
}, set_duration: function (c) {
this._duration = c;
}, get_isActive: function () {
return true;
}, play: function (h) {
var e = this._getAnimationQuery().filter("[paused='true']");
var d = e.attr("paused");
e.removeAttr("paused");
if (d && e.attr("elapsedTime")) {
this._isPlaying = true;
this._isPaused = false;
} else {
var c = this._owner;
var g = c.get_frameDuration();
if (this._isPaused && this._isCyclic && (g > 0 && !h) && c._setAnimationTimeout) {
c._setAnimationTimeout(g);
} else {
var f = this._animationStarted();
if (f != false) {
this._playAnimation();
this._isPlaying = true;
this._isPaused = false;
}
}
}
}, stop: function () {
this._getAnimationQuery().stopTransition(false, this._isPlaying);
this._isPlaying = false;
}, pause: function () {
if (this._isPlaying) {
this._getAnimationQuery().filter(":animated").attr("paused", true);
}
this._isPlaying = false;
this._isPaused = true;
}, add_started: function (c) {
this.get_events().addHandler("started", c);
}, remove_started: function (c) {
this.get_events().removeHandler("started", c);
}, add_ended: function (c) {
this.get_events().addHandler("ended", c);
}, remove_ended: function (c) {
this.get_events().removeHandler("ended", c);
}, _getAnimationQuery: function () {
return a(this._element);
}, _playAnimation: function () {
}, _animationStarted: function () {
var c = new Sys.CancelEventArgs();
this._raiseEvent("started", c);
return !c.get_cancel();
}, _animationEnded: function () {
this._isPlaying = false;
this._raiseEvent("ended", Sys.EventArgs.Empty);
}, _raiseEvent: function (d, c) {
var e = this.get_events().getHandler(d);
if (e) {
if (!c) {
c = Sys.EventArgs.Empty;
}
e(this, c);
}
}
};
b.Animations.jMoveBase.registerClass("Telerik.Web.UI.Animations.jMoveBase", Sys.Component);
b.Animations.jMove = function (g, e, c, f, h, d) {
b.Animations.jMove.initializeBase(this, [g, e, c, d]);
this._horizontal = (typeof(f) == "undefined" || f == null) ? 0 : f;
this._vertical = (typeof(h) == "undefined" || h == null) ? 0 : h;
};
b.Animations.jMove.prototype = {
initialize: function () {
b.Animations.jMove.callBaseMethod(this, "initialize");
}, dispose: function () {
b.Animations.jMove.callBaseMethod(this, "dispose");
}, get_vertical: function () {
return this._vertical;
}, set_vertical: function (c) {
this._vertical = c;
}, get_horizontal: function () {
return this._horizontal;
}, set_horizontal: function (c) {
this._horizontal = c;
}, _getFinalPosition: function () {
return (isNaN(parseInt(this._vertical, 10))) ? this._horizontal : this._vertical;
}, _getAnimatedProperty: function () {
return (isNaN(parseInt(this._vertical, 10))) ? "left" : "top";
}, _getPosition: function () {
return this._element.style[this._getAnimatedProperty()];
}, _playAnimation: function () {
var f = this._getFinalPosition();
var c = this._getAnimationQuery();
var d = this._getAnimatedProperty();
var g = {queue: true};
g[d] = f;
var e = {};
e[d] = f;
c.stopTransition(true, !this._isCyclic).transition(e, this._duration, this._easing || "ease", this._animationEndedDelegate);
}
};
b.Animations.jMove.registerClass("Telerik.Web.UI.Animations.jMove", b.Animations.jMoveBase);
b.Animations.jCarousel = function (i, f, g, d, h, c, e) {
b.Animations.jCarousel.initializeBase(this, [i, f, d, e]);
this._items = g;
this._minScale = h.minScale;
this._x = h.xO;
this._y = h.yO;
this._xRadius = h.xR;
this._yRadius = h.yR;
this._customProperties = c;
this._angle = Math.PI / 2;
this._query = null;
};
b.Animations.jCarousel.prototype = {
initialize: function () {
b.Animations.jCarousel.callBaseMethod(this, "initialize");
}, dispose: function () {
b.Animations.jCarousel.callBaseMethod(this, "dispose");
this._items = null;
this._customProperties = null;
this._query = null;
}, get_angle: function () {
return this._angle;
}, set_angle: function (c) {
this._angle = c;
}, _getFinalPosition: function () {
return this._angle;
}, _getAnimatedProperty: function () {
return "telerikCarouselAngle";
}, _getAnimationQuery: function () {
var c = this._query;
if (!c) {
a.each(this._items, function (e, f) {
var d = this.element;
if (!c) {
c = a(d);
} else {
c = c.add(d);
}
});
this._query = c;
}
return c;
}, _playAnimation: function () {
this._getAnimationQuery().stopTransition(true, !this._isCyclic);
var e = this._items;
var f = (e.length > 0) ? ((Math.PI * 2) / e.length) : 0;
var c = this._angle;
var d = this;
a.each(e, function (g, h) {
if (c.toString().indexOf("e") > -1) {
c = (Math.round(c * 10000) / 10000);
}
a(this.element).stop(true, false).transition({queue: true, telerikCarouselAngle: c}, {
xO: d._x,
yO: d._y,
xR: d._xRadius,
yR: d._yRadius,
minScale: d._minScale,
reflection: this.reflection,
width: this.width,
height: this.height,
outerWidth: this.outerWidth,
outerHeight: this.outerHeight,
customProperties: d._customProperties,
duration: d._duration,
easing: d._easing,
complete: d._animationEndedDelegate
});
c += f;
});
}
};
b.Animations.jCarousel.registerClass("Telerik.Web.UI.Animations.jCarousel", b.Animations.jMoveBase);
a.fx.step.telerikCarouselAngle = function (e) {
var c = e.now;
var g = e.options;
var j = Math.sin(c);
var f = g.minScale;
var i = f + (j + 1) * ((1 - f) / 2);
var n = g.xO + (((Math.cos(c + Math.PI) * g.xR) - g.outerWidth / 2) * i);
var o = g.yO + ((j * g.yR) * i);
e.elem.telerikCarouselAngle = e.now;
var d = a.extend({}, g.customProperties);
if (g.customProperties) {
var m = /^([\d+-.]+)(.*)$/;
a.each(d, function (p, r) {
var q = m.exec(r);
if (q) {
d[p] = q ? (q[1] * i + q[2]) : r;
}
});
}
var k = !a.support.opacity && (g.customProperties && g.customProperties.opacity) && g.reflection;
var l = "px";
var h = a.extend(d, {
width: g.width * i + l,
height: g.height * i * (k ? 2 : 1) + l,
left: n + l,
top: o + l,
zIndex: parseInt(i * 100, 10)
});
a(e.elem).css("display", "none").css(h).css("display", "");
};
b.Animations.jCoverFlow = function (i, f, g, d, h, c, e) {
b.Animations.jCoverFlow.initializeBase(this, [i, f, d, e]);
this._items = g;
this._minScale = h.minScale;
this._x = h.xO;
this._y = h.yO;
this._xRadius = h.xR;
this._yRadius = h.yR;
this._xItemSpacing = h.xItemSpacing;
this._yItemSpacing = h.yItemSpacing;
this._selectedItemOffsetX = h.selectedItemOffsetX;
this._selectedItemOffsetY = h.selectedItemOffsetY;
this._matrix = h.matrix;
this._customProperties = c;
this._index = 0;
this._query = null;
};
b.Animations.jCoverFlow.prototype = {
initialize: function () {
b.Animations.jCoverFlow.callBaseMethod(this, "initialize");
}, dispose: function () {
b.Animations.jCoverFlow.callBaseMethod(this, "dispose");
this._items = null;
this._customProperties = null;
this._matrix = null;
this._query = null;
}, get_index: function () {
return this._index;
}, set_index: function (c) {
this._index = c;
}, _getFinalPosition: function () {
return this._index;
}, _getAnimatedProperty: function () {
return "telerikCoverFlowIndex";
}, _getAnimationQuery: function () {
if (!this._query) {
var d = this._items;
var f = a();
for (var c = 0, e = d.length;
c < e;
c++) {
f.add(d[c].element);
}
this._query = f;
}
return this._query;
}, _getTransformProperty: function () {
var c = "transform";
if ($telerik.isIE9Mode) {
c = "msTransform";
} else {
if ($telerik.isIE) {
c = "filter";
} else {
if ($telerik.isFirefox) {
c = "MozTransform";
} else {
if ($telerik.isSafari) {
c = "WebkitTransform";
} else {
if ($telerik.isOpera) {
c = "OTransform";
}
}
}
}
}
return c;
}, _playAnimation: function () {
this._getAnimationQuery().stopTransition(true, !this._isCyclic);
var g = this._items;
var h = g.length;
var f = this._owner.isVertical();
var e = this._index;
var i = g[e];
if (!i) {
return;
}
var j = {
top: this._y - i.outerHeight / 2,
right: this._x + i.outerWidth / 2,
bottom: this._y + i.outerHeight / 2,
left: this._x - i.outerWidth / 2
};
var d = this._matrix;
if (d.m11 == 1 && d.m22 == 1 && d.m12 == 0 && d.m21 == 0) {
d = null;
}
var k = this._getTransformProperty();
var c = this;
var l = $telerik.getContentSize(this._owner._clipElement);
a.each(g, function (B, I) {
var n = (B - e);
var z = (n == 0);
var G = z ? 1 : c._minScale;
var s = this.element;
var o = parseInt(s.telerikCoverFlowIndex, 10);
var u = (o == 0);
var p = u ? 1 : c._minScale;
var v = (n > 0);
var C = c._x + this.outerWidth / 2;
var J = f ? (C - this.outerWidth * G) : (j[v ? "right" : "left"]);
var q = f ? (C - this.outerWidth * p) : (j[o > 0 ? "right" : "left"]);
var A = c._y + this.outerHeight / 2;
var K = f ? (j[v ? "bottom" : "top"]) : (A - this.outerHeight * G);
var r = f ? (j[o > 0 ? "bottom" : "top"]) : (A - this.outerHeight * p);
var H = {};
var m = (u || z);
if (f || m) {
H.top = {start: r, end: K};
}
if (!f || m) {
H.left = {start: q, end: J};
}
for (var t = 0;
t < 2;
t++) {
var w = (t == 0);
var D = w ? n : o;
var E = w ? G : p;
if (D > 0) {
if (f) {
H.top[w ? "end" : "start"] += c._yRadius + (--D * c._yItemSpacing);
} else {
H.left[w ? "end" : "start"] += c._xRadius + (--D * c._xItemSpacing);
}
} else {
if (D < 0) {
if (f) {
H.top[w ? "end" : "start"] += -(c._yRadius + this.outerHeight * E) + (++D * c._yItemSpacing);
} else {
H.left[w ? "end" : "start"] += -(c._xRadius + this.outerWidth * E) + (++D * c._xItemSpacing);
}
} else {
H.left[w ? "end" : "start"] += c._selectedItemOffsetX;
H.top[w ? "end" : "start"] += c._selectedItemOffsetY;
}
}
}
if (m || ((!H.top || ((H.top.start >= -this.outerHeight * p && H.top.start <= l.height) || (H.top.end >= -this.outerHeight * G && H.top.end <= l.height))) && (!H.left || ((H.left.start >= -this.outerWidth * p && H.left.start <= l.width) || (H.left.end >= -this.outerWidth * G && H.left.end <= l.width))))) {
var F = {zIndex: ((h - Math.abs(o)) * 100)};
if (H.top) {
F.top = H.top.start + "px";
}
if (H.left) {
F.left = H.left.start + "px";
}
if (Math.abs(o - n) > 1) {
F.zIndex = ((h - Math.abs(n)) * 100);
}
a(s).stop(true, false).css(F).transition({queue: true, telerikCoverFlowIndex: n}, {
isVertical: f,
animateSize: m,
steps: H,
minScale: c._minScale,
width: this.width,
height: this.height,
outerWidth: this.outerWidth,
outerHeight: this.outerHeight,
matrix: d,
transformProperty: k,
reflection: this.reflection,
itemsCount: h,
customProperties: c._customProperties,
duration: c._duration,
easing: c._easing,
complete: c._animationEndedDelegate
});
} else {
a(s).stopTransition(true, false).attr("telerikCoverFlowIndex", n);
}
});
}
};
b.Animations.jCoverFlow.registerClass("Telerik.Web.UI.Animations.jCoverFlow", b.Animations.jMoveBase);
a.fx.step.telerikCoverFlowIndex = function (f) {
var d = f.now;
var m = f.options;
f.elem.telerikCoverFlowIndex = d;
var o = Math.abs((d - f.start) / (f.end - f.start));
var w = "px";
var n = {};
if (Math.abs(f.start - f.end) <= 1) {
n.zIndex = parseInt((m.itemsCount - Math.abs(d)) * 100, 10);
}
var s = 0;
var u = 0;
var h = m.isVertical;
var l = m.minScale;
var p = m.animateSize ? (f.end == 0 ? (l + (1 - l) * o) : (1 - (1 - l) * o)) : l;
if (m.animateSize) {
if (m.customProperties) {
var e = a.extend({}, m.customProperties);
var x = /^([\d+-.]+)(.*)$/;
a.each(e, function (y, A) {
var z = x.exec(A);
e[y] = z ? (z[1] * p + z[2]) : A;
});
n = a.extend(e, n);
}
n = a.extend(n, {width: m.width * p + w, height: m.height * p + w});
}
if (m.matrix) {
var i = a.extend({}, m.matrix);
var k = m.animateSize ? (f.end == 0 ? (1 - o) : o) : 1;
var j = (d == 0) ? 0 : (d < 0 ? -1 : 1);
if (f.start * f.end < 0) {
if ((f.start < 0 && d < 0) || (f.start > 0 && d > 0)) {
k = 1 - o * Math.abs((f.end - f.start) / f.start);
} else {
k = o * Math.abs((f.end - f.start) / f.end) - Math.abs(f.start / f.end);
}
}
i = {m11: 1 - (1 - i.m11) * k, m12: (i.m12 * k) * j, m21: (i.m21 * k) * j, m22: 1 - (1 - i.m22) * k};
var g = ("filter" == m.transformProperty);
var r = "matrix(" + i.m11 + ", " + i.m21 + ", " + i.m12 + ", " + i.m22 + ", 0, 0)";
if (g) {
r = "progid:DXImageTransform.Microsoft.Matrix(FilterType='bilinear',M11=" + i.m11 + ", M12=" + i.m12 + ", M21=" + i.m21 + ", M22=" + i.m22 + ",sizingMethod='auto expand')";
}
n[m.transformProperty] = r;
var t = Math.abs(i.m11) + Math.abs(i.m12);
var v = Math.abs(i.m21) + Math.abs(i.m22);
if (!h) {
s = j * ((1 - t) / 2);
} else {
u = j * ((1 - v) / 2);
}
if (g) {
s += (t - 1) / 2;
u += (v - 1) / 2;
if (m.matrix.m12 && m.reflection) {
s *= 2;
}
}
}
var c = m.animateSize;
var q = m.steps;
if ((h || c) && q.top) {
n.top = (q.top.start + (q.top.end - q.top.start) * o) - u * p * m.outerHeight + w;
}
if ((!h || c) && q.left) {
n.left = (q.left.start + (q.left.end - q.left.start) * o) - s * p * m.outerWidth + w;
}
if ("filter" == m.transformProperty && m.matrix && m.reflection) {
n.height = 2 * (n.height ? parseInt(n.height, 10) : (l * m.height)) + w;
}
a(f.elem).css("display", "none").css(n).css("display", "");
};
})();
/* END Telerik.Web.UI.Common.Animation.AnimationScripts.js */
/* START Telerik.Web.UI.Common.TouchScrollExtender.js */
(function (a) {
Type.registerNamespace("Telerik.Web.UI");
var b = Telerik.Web.UI;
var c = 0;
Telerik.Web.UI.TouchScrollExtender = function (f) {
this._containerElements = a(f);
var g = arguments[1] || {};
this._autoScan = "autoScan" in g ? g.autoScan : false;
this._showScrollHints = "showScrollHints" in g ? g.showScrollHints : true;
this._useRoundedHints = "useRoundedHints" in g ? g.useRoundedHints : true;
this._hasHorizontalScrollHint = false;
this._hasVerticalScrollHint = false;
this._verticalScrollHint = false;
this._horizontalScrollHint = false;
this._lastAnimator = false;
this._dragCanceled = false;
this.containers = [];
this._enableTouchScroll = true;
this._unbindBeforeDragging = false;
};
Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender = function () {
return $telerik.isTouchDevice;
};
Telerik.Web.UI.TouchScrollExtender.prototype = {
initialize: function () {
if (this._enableTouchScroll) {
if (this._autoScan) {
this._containerElements = this._containerElements.add(a("*", this._containerElements)).filter(function () {
return (a(this).css("overflow") == "scroll" || a(this).css("overflow") == "auto");
});
}
var f = this;
this._containerElements.each(function () {
this.style.overflow = "hidden";
var g = a(this).addClass("RadTouchExtender").css("-webkit-tap-highlight-color", "rgba(0, 0, 0, 0);");
var h = {
element: g.stop(),
horizontalScrollHint: a('<div id="horizontalScrollHint" style="position: absolute; display: none; z-index: 200000; font-size: 0; height: 3px; border: 1px solid #333; background: #777; " />').appendTo(this.parentNode),
verticalScrollHint: a('<div id="verticalScrollHint" style="position: absolute; display: none; z-index: 200000; width: 3px; border: 1px solid #333; background: #777; " />').appendTo(this.parentNode)
};
if (f._useRoundedHints) {
h.horizontalScrollHint.css({
"-moz-border-radius": "3px",
"-webkit-border-radius": "3px",
"border-radius": "3px"
});
h.verticalScrollHint.css({
"-moz-border-radius": "3px",
"-webkit-border-radius": "3px",
"border-radius": "3px"
});
}
g.data("dragID", f.containers.push(h) - 1);
});
this._startDragProxy = a.proxy(this._startDrag, this);
if (b.TouchScrollExtender._getNeedsScrollExtender()) {
this._onGestureStartProxy = a.proxy(this._onGestureStart, this);
this._onGestureEndProxy = a.proxy(this._onGestureEnd, this);
this._containerElements.bind("touchstart", this._startDragProxy);
this._containerElements.bind("gesturestart", this._onGestureStartProxy);
this._containerElements.bind("gestureend", this._onGestureEndProxy);
} else {
this._containerElements.bind("mousedown", this._startDragProxy);
}
this._storeLastLocation = a.throttle(100, function (g) {
this._lastAnimator.kX = g.x;
this._lastAnimator.kY = g.y;
});
this._alignScrollHints = a.throttle(20, function () {
var j = 0;
var k = 0;
var h = this._lastAnimator.element[0];
var l = this._lastAnimator.horizontalScrollHint;
var m = this._lastAnimator.verticalScrollHint;
var g = this._getBorderBox(h);
var i = a(h).position();
if (this._hasHorizontalScrollHint && l) {
j = Math.abs(h.scrollLeft) * this._widthConstant + i.left + g.left;
l.css({left: j});
}
if (this._hasVerticalScrollHint && m) {
k = Math.abs(h.scrollTop) * this._heightConstant + i.top + g.top;
m.css({top: k});
}
});
this._throttleScroll = a.throttle(10, function (g) {
this._lastAnimator.element[0].scrollLeft = this._lastAnimator.dragStartX - g.x;
this._lastAnimator.element[0].scrollTop = this._lastAnimator.dragStartY - g.y;
});
}
}, dispose: function () {
this.disable();
this._detachInitilalEvents();
this.containers = null;
this._containerElements = null;
this._events = null;
}, _detachInitilalEvents: function () {
if (this._containerElements) {
if (this._startDragProxy) {
this._containerElements.unbind("mousedown", this._startDragProxy);
}
if (this._onGestureStartProxy) {
this._containerElements.unbind("gesturestart", this._onGestureStartProxy);
}
if (this._onGestureEndProxy) {
this._containerElements.unbind("gestureend", this._onGestureEndProxy);
}
}
}, _startDrag: function (h) {
if (d()) {
this._detachEvents();
return;
}
if (this._dragCanceled) {
return;
}
var f = a(h.target);
var g = f.parents(".RadTouchExtender");
if (f.hasClass("RadTouchExtender")) {
g = g.add(f);
}
var i = this._lastAnimator = this.containers[g.data("dragID")];
var j = i.element[0];
this._hasHorizontalScrollHint = j.offsetWidth < j.scrollWidth;
this._hasVerticalScrollHint = j.offsetHeight < j.scrollHeight;
i.hasDragged = false;
if (this._hasHorizontalScrollHint || this._hasVerticalScrollHint) {
i.element.stop(true);
i.originalEvent = h.originalEvent;
if (!b.TouchScrollExtender._getNeedsScrollExtender()) {
this._cancelEvents(h);
}
var l = $telerik.getTouchEventLocation(h);
i.kX = l.x;
i.kY = l.y;
var k = j.scrollLeft || 0;
var m = j.scrollTop || 0;
i.dragStartX = (k > 0 ? k : 0) + l.x;
i.dragStartY = (m > 0 ? m : 0) + l.y;
if (b.TouchScrollExtender._getNeedsScrollExtender()) {
if (this._unbindBeforeDragging) {
a(document.body).unbind({
touchmove: a.proxy(this._compositeDragger, this),
touchend: a.proxy(this._endDrag, this)
});
}
a(document.body).bind({
touchmove: a.proxy(this._compositeDragger, this),
touchend: a.proxy(this._endDrag, this)
});
} else {
a(document.body).bind({
mousemove: a.proxy(this._compositeDragger, this),
mouseup: a.proxy(this._endDrag, this)
});
}
}
}, _getBorderBox: function (h) {
var f = {left: 0, top: 0, right: 0, bottom: 0, horizontal: 0, vertical: 0};
if (window.getComputedStyle) {
var g = window.getComputedStyle(h, null);
f.left = parseInt(g.getPropertyValue("border-left-width"), 10);
f.right = parseInt(g.getPropertyValue("border-right-width"), 10);
f.top = parseInt(g.getPropertyValue("border-top-width"), 10);
f.bottom = parseInt(g.getPropertyValue("border-bottom-width"), 10);
} else {
f.left = h.currentStyle.borderLeftWidth;
f.right = h.currentStyle.borderRightWidth;
f.top = h.currentStyle.borderTopWidth;
f.bottom = h.currentStyle.borderBottomWidth;
}
f.horizontal = f.left + f.right;
f.vertical = f.top + f.bottom;
return f;
}, _addScrollHints: function () {
if (this._showScrollHints) {
var m = 0;
var n = 0;
var k = this._lastAnimator;
var g = k.element[0];
var f = this._getBorderBox(g);
var i = a(g).position();
if (this._hasHorizontalScrollHint) {
var j = k.element.innerWidth();
var o = ~~((j / g.scrollWidth) * j) - 2;
this._widthConstant = (o / j);
setTimeout(function () {
m = Math.abs(g.scrollLeft) * (o / j) + i.left + f.left;
n = g.offsetHeight + i.top + f.top - 7;
k.horizontalScrollHint.width(o).css({left: m, top: n});
}, 0);
k.horizontalScrollHint.fadeTo(200, 0.5);
}
if (this._hasVerticalScrollHint) {
var h = k.element.innerHeight();
var l = ~~((h / g.scrollHeight) * h) - 2;
this._heightConstant = (l / h);
setTimeout(function () {
n = Math.abs(g.scrollTop) * (l / h) + i.top + f.top;
m = g.offsetWidth + i.left + f.left - 7;
k.verticalScrollHint.height(l).css({left: m, top: n});
}, 0);
k.verticalScrollHint.fadeTo(200, 0.5);
}
}
}, _removeScrollHints: function () {
if (this._showScrollHints) {
var f = this._lastAnimator.horizontalScrollHint;
var g = this._lastAnimator.verticalScrollHint;
if (this._hasHorizontalScrollHint && f) {
f.hide();
}
if (this._hasVerticalScrollHint && g) {
g.hide();
}
}
}, _simpleDragger: function (f) {
if (this._dragCanceled) {
return;
}
this._cancelEvents(f);
var g = $telerik.getTouchEventLocation(f);
if (this._lastAnimator.element.length) {
this._throttleScroll(g);
this._alignScrollHints();
}
this._storeLastLocation(g);
}, _compositeDragger: function (f) {
if (this._dragCanceled) {
return;
}
var i = $telerik.getTouchEventLocation(f);
var g = this._lastAnimator;
var h = g.element[0];
this._cancelEvents(f, g, i, "compositeDragger");
if (Math.abs(g.kX - i.x) > 10 || Math.abs(g.kY - i.y) > 10) {
g.hasDragged = true;
this._addScrollHints();
if (b.TouchScrollExtender._getNeedsScrollExtender()) {
a(document.body).unbind("touchmove", this._compositeDragger).bind("touchmove", a.proxy(this._simpleDragger, this));
} else {
a(document.body).unbind("mousemove", this._compositeDragger).bind("mousemove", a.proxy(this._simpleDragger, this));
}
if ($telerik.isIE) {
g.element.bind("click", this._cancelEvents);
h.setCapture(true);
} else {
h.addEventListener("click", this._cancelEvents, true);
}
}
}, disable: function () {
this._detachEvents();
this._dragCanceled = true;
}, enable: function () {
this._dragCanceled = false;
}, _onGestureStart: function () {
this._detachEvents();
this._dragCanceled = true;
}, _onGestureEnd: function () {
this._dragCanceled = false;
}, _endDrag: function (f) {
e();
if (this._dragCanceled) {
return;
}
this._cancelEvents(f);
this._detachEvents();
if (b.TouchScrollExtender._getNeedsScrollExtender()) {
if (this._lastAnimator.originalEvent.touches.length == 1 && !this._lastAnimator.hasDragged) {
var j = this._lastAnimator.originalEvent;
var g = document.createEvent("MouseEvents");
g.initMouseEvent("click", j.bubbles, j.cancelable, j.view, j.detail, j.screenX, j.screenY, j.clientX, j.clientY, false, false, false, false, j.button, j.relatedTarget);
j.target.dispatchEvent(g);
}
}
var k = this;
var i = $telerik.getTouchEventLocation(f);
var h = this._lastAnimator;
if ($telerik.isIE) {
setTimeout(function () {
h.element.unbind("click", k._cancelEvents);
document.releaseCapture();
}, 10);
} else {
setTimeout(function () {
h.element[0].removeEventListener("click", k._cancelEvents, true);
}, 0);
}
if (h.hasDragged) {
if (h.element.length) {
h.endX = i.x;
h.endY = i.y;
}
this._finishDrag(h);
}
}, _detachEvents: function () {
if (b.TouchScrollExtender._getNeedsScrollExtender()) {
a(document.body).unbind("touchmove", this._simpleDragger).unbind("touchmove", this._compositeDragger).unbind("touchend", this._endDrag);
} else {
a(document.body).unbind("mousemove", this._simpleDragger).unbind("mousemove", this._compositeDragger).unbind("mouseup", this._endDrag);
}
}, _finishDrag: function (f) {
var h = f.element[0].scrollLeft + f.kX - f.endX;
var i = f.element[0].scrollTop + f.kY - f.endY;
f.kX = 0;
f.kY = 0;
var g = this;
f.element.stop(true).animate({scrollLeft: h, scrollTop: i}, {
duration: 500, easing: "easeOutQuad", complete: function () {
g._removeScrollHints();
}, step: function () {
g._alignScrollHints();
}
});
if (this._hasHorizontalScrollHint && f.horizontalScrollHint) {
f.horizontalScrollHint.stop().css("opacity", 0.5).fadeTo(450, 0);
}
if (this._hasVerticalScrollHint && f.verticalScrollHint) {
f.verticalScrollHint.stop().css("opacity", 0.5).fadeTo(450, 0);
}
}, _cancelEvents: function (f) {
f.stopPropagation();
f.preventDefault();
}, _setUnbindBeforeDragging: function (f) {
this._unbindBeforeDragging = f;
}
};
Telerik.Web.UI.TouchScrollExtender.registerClass("Telerik.Web.UI.TouchScrollExtender", null, Sys.IDisposable);
function d() {
c += 1;
if (c > 1) {
e();
return true;
}
}
function e() {
c = 0;
}
})($telerik.$);
/* END Telerik.Web.UI.Common.TouchScrollExtender.js */
/* START Telerik.Web.UI.Common.Widgets.Draggable.js */
Type.registerNamespace("Telerik.Web.UI.Helpers");
Type.registerNamespace("Telerik.Web.UI.Widgets");
(function (b, a) {
var d = function (l) {
(function () {
var n = {};
a.extend(l, {
trigger: function (q) {
var r = n[q];
if (!r) {
return;
}
for (var s = 0;
s < r.length;
s++) {
var p = Array.prototype.slice.call(arguments);
p.shift();
p.unshift(this);
r[s].handler.apply(r[s].context, p);
}
}, _bind: function (q, p) {
a.each(q, function (r, s) {
m(r, s, p);
});
}, _unbind: function (q, p) {
a.each(q, function (r, s) {
o(r, s, p);
});
}, _disposeEvents: function () {
n = null;
}
});
function m(q, r, p) {
var s = n[q] || [];
s.push({handler: r, context: p});
n[q] = s;
}
function o(q, r, p) {
var s = n[q];
if (!s) {
return;
}
var u = -1;
for (var t = 0;
t < s.length;
t++) {
if (s[t].func == r && s[t].context == p) {
u = t;
break;
}
}
if (u > -1) {
s = s.splice(u, 1);
}
n[q] = s;
}
})();
};
var h = ".Telerik.Web.UI.Draggable", e = "mousedown" + h, g = "mouseup" + h, f = "mousemove" + h, k = $telerik.getMobileEventCounterpart("mousedown") + h, i = $telerik.getMobileEventCounterpart("mouseup") + h, j = $telerik.getMobileEventCounterpart("mousemove") + h, c = "dragstart" + h;
b.Widgets.Draggable = function (l, m) {
this._element = l;
this._options = a.extend({
useTransformations: false,
shouldPreventDefault: true,
enableFrameOverlay: false,
enableDelay: false,
validateNestedElementsAsTriggers: false,
mouseButtonTrigger: b.Widgets.MouseButton.Left,
touchHoldDelay: m && m.touchHoldDelay ? Math.min(1000, m.touchHoldDelay) : 1000,
touchHoldDelta: m && m.touchHoldDelta ? Math.min(20, m.touchHoldDelta) : 20,
customScrollingEvaluator: null,
useExternalHandle: m && m.handle,
cursorType: "move",
handle: l,
ownerDocument: document,
constraints: {minX: null, minY: null, maxX: null, maxY: null}
}, m || {});
this._ieTouchActionManager = new b.Helpers.IETouchActionManager(this._options.handle);
this._isScrolling = false;
d(this);
this.initialize();
};
b.Widgets.Draggable.prototype = {
initialize: function (l, m) {
this._initStyleVars(true);
this._checkTransformationAvailability();
this._ieTouchActionManager.allowUserTouch();
this._toggleHandleCursor();
this._attachHandlers(true);
this._enabled = true;
}, dispose: function () {
this._ieTouchActionManager.dispose();
this._attachHandlers(false);
this._initStyleVars(false);
this._disposeEvents();
this._toggleHandleCursor();
this._options = null;
this._element = null;
}, get_handle: function () {
return this._options.handle;
}, set_handle: function (l) {
this._options.handle = l;
}, get_useExternalHandle: function () {
return this._options.useExternalHandle;
}, get_position: function () {
var l = a(this._element).offset();
return {x: l.left, y: l.top};
}, get_handlePosition: function () {
var l = a(this._options.handle);
return {x: l.offset().left, y: l.offset().top};
}, get_useTransform: function () {
return this._options.useTransformations;
}, set_useTransform: function (l) {
if (l) {
this._checkTransformationAvailability();
if (l && !this._options.useTransformations) {
alert("The browser does not support CSS3 transformations");
}
} else {
this._options.useTransformations = false;
}
}, get_constraints: function () {
return this._options.constraints;
}, set_constraints: function (l) {
if (l) {
if ((l.minX && l.maxX && l.minX > l.maxX) || (l.minY && l.maxY && l.minY > l.maxY)) {
throw Error("Invalid Parameters");
}
}
a.extend(this._options.constraints, l || {maxX: null, minX: null, maxY: null, minY: null});
}, get_minX: function () {
this._options.constraints.minX;
}, set_minX: function (m) {
var l = this._options.constraints;
if ((isNaN(m) && m !== null && m !== "") || (l.maxX && m !== null && l.maxX < m)) {
throw Error("Invalid Parameters");
}
l.minX = m;
}, get_maxX: function () {
this._options.constraints.maxX;
}, set_maxX: function (m) {
var l = this._options.constraints;
if ((isNaN(m) && m !== null && m !== "") || (l.minX && m !== null && l.minX > m)) {
throw Error("Invalid Parameters");
}
l.maxX = m;
}, get_minY: function () {
this._options.constraints.minY;
}, set_minY: function (m) {
var l = this._options.constraints;
if ((isNaN(m) && m !== null && m !== "") || (l.maxY && m !== null && l.maxY < m)) {
throw Error("Invalid Parameters");
}
l.minY = m;
}, get_maxY: function () {
this._options.constraints.maxY;
}, set_maxY: function (m) {
var l = this._options.constraints;
if ((isNaN(m) && m !== null && m !== "") || (l.minY && m !== null && l.minY > m)) {
throw Error("Invalid Parameters");
}
l.maxY = m;
}, get_enabled: function () {
return this._enabled;
}, set_enabled: function (l) {
this._enabled = l;
}, moveTo: function (l) {
this._moveWithDelta(l);
}, add_dragStarting: function (l) {
this._bind({dragStarting: l});
}, remove_dragStarting: function (l) {
this._unbind({dragStarting: l});
}, add_dragStart: function (l) {
this._bind({dragStart: l});
}, remove_dragStart: function (l) {
this._unbind({dragStart: l});
}, add_dragging: function (l) {
this._bind({dragging: l});
}, remove_dragging: function (l) {
this._unbind({dragging: l});
}, add_dragEnd: function (l) {
this._bind({dragEnd: l});
}, remove_dragEnd: function (l) {
this._unbind({dragEnd: l});
}, _initStyleVars: function (l) {
this._elStyle = l ? this._element.style : null;
this._transfPropName = l ? this._getBrowserPrefix(true) + "Transform" : null;
this._transfStyleProp = l ? this._getBrowserPrefix(false) + "transform" : null;
}, _checkTransformationAvailability: function () {
var l = this._options.ownerDocument.body.style;
this._options.useTransformations = (l.transform !== undefined || l[this._transfPropName] !== undefined);
}, _getBrowserPrefix: function (m) {
var l = "";
if ($telerik.isOpera) {
l = "O";
} else {
if ($telerik.isSafari) {
l = "webkit";
} else {
if ($telerik.isIE) {
l = "ms";
} else {
if ($telerik.isFirefox) {
l = "Moz";
}
}
}
}
if (!m) {
l = "-" + l.toLowerCase() + "-";
}
return l;
}, _getBounds: function () {
return $telerik.getBounds(this._element);
}, _attachHandlers: function (m) {
var l = a(this._options.handle);
if (m) {
this._mouseDownHandlerProxy = a.proxy(this._mouseDownHandler, this);
l.on(e, this._mouseDownHandlerProxy);
l.on(k, this._mouseDownHandlerProxy);
l.on(c, this._dragStartHandle);
} else {
l.off(e, this._mouseDownHandlerProxy);
l.off(k, this._mouseDownHandlerProxy);
l.off(c, this._dragStartHandle);
a(this._options.ownerDocument).off(f, this._mouseMoveHandlerProxy);
a(this._options.ownerDocument).off(i, this._mouseUpHandler);
a(this._options.ownerDocument).off(g, this._mouseUpHandler);
a(this._options.ownerDocument).off(j, this._touchMoveHandlerProxy);
}
}, _dragStartHandle: function (l) {
$telerik.cancelRawEvent(l.originalEvent);
}, _mouseDownHandler: function (m) {
if (!this._enabled) {
return;
}
if (this._options.shouldPreventDefault) {
m.preventDefault();
}
if (this._isTouchEvent(m)) {
a(this._options.handle).off(e, this._mouseDownHandlerProxy);
}
if ((!this._isTouchEvent(m) && !this._validateButtonTrigger(m)) || (this._options.validateNestedElementsAsTriggers && !this._validateTargetElemCursor(m))) {
return;
}
var n = this._getEventLocation(m);
this.startCoords = this.deltaHelper = {x: n.x, y: n.y};
this.startPosition = this.initialPosition = this.get_position();
var l = new b.Widgets.DraggableEventArgs(this.initialPosition, null, m);
this.trigger("dragStarting", l);
if (!l._cancel) {
this._mouseMoveHandlerProxy = a.proxy(this._mouseMoveHandler, this);
a(this._options.ownerDocument).on(f, this._mouseMoveHandlerProxy);
a(this._options.ownerDocument).one(this._isTouchEvent(m) ? i : g, a.proxy(this._mouseUpHandler, this));
if (this._isTouchEvent(m) && this._options.enableDelay) {
this._touchHoldSimulator(m);
} else {
this._triggerDragStart(m, this);
}
if (this._options.enableFrameOverlay) {
this._showOverlay();
}
}
this._cancelDragSelection(m);
}, _validateTargetElemCursor: function (l) {
return $telerik.getComputedStyle(l.target || l.srcElement, "cursor") == this._options.cursorType;
}, _validateButtonTrigger: function (l) {
return ((this._options.mouseButtonTrigger & this._eventButtonToMouseButton(l.button)) != 0);
}, _cancelDragSelection: function (l) {
if (!this._isTouchEvent(l)) {
$telerik.cancelRawEvent(l);
}
}, _touchHoldSimulator: function (l) {
this._touchMoveHandlerProxy = a.proxy(this._touchMoveHandler, this);
a(this._options.ownerDocument).on(j, this._touchMoveHandlerProxy);
var m = this;
this.touchHoldTimeout = window.setTimeout(function () {
if (!m._isScrolling) {
m._triggerDragStart(l);
}
}, this._options.touchHoldDelay);
}, _touchMoveHandler: function (m) {
var n = this._getEventLocation(m);
var l = {x: this.startCoords.x - n.x, y: this.startCoords.y - n.y};
if (this._options.customScrollingEvaluator) {
this._isScrolling = this._options.customScrollingEvaluator(this, m);
} else {
this._isScrolling = Math.abs(l.x) > this._options.touchHoldDelta || Math.abs(l.y) > this._options.touchHoldDelta;
}
}, _triggerDragStart: function (m) {
this._clearTouchHoldTimeout();
var l = new b.Widgets.DraggableEventArgs(this.initialPosition, null, m.originalEvent);
this.trigger("dragStart", l);
if (!l._cancel) {
if (this._isTouchEvent(m)) {
a(this._options.ownerDocument).off(j, this._touchMoveHandlerProxy);
}
this._mouseMoveHandlerProxy = a.proxy(this._mouseMoveHandler, this);
a(this._options.ownerDocument).on(this._isTouchEvent(m) ? j : f, this._mouseMoveHandlerProxy);
}
}, _clearTouchHoldTimeout: function () {
window.clearTimeout(this.touchHoldTimeout);
}, _mouseUpHandler: function (m) {
this._isScrolling = false;
this._clearTouchHoldTimeout();
if (this._options.useTransformations) {
this._applyTransformation();
}
a(this._options.ownerDocument).off(f, this._mouseMoveHandlerProxy);
a(this._options.ownerDocument).off(j, this._mouseMoveHandlerProxy);
a(this._options.ownerDocument).off(this._isTouchEvent(m) ? j : f, this._touchMoveHandler);
if (this._isTouchEvent(m)) {
this.eventTimer = window.setTimeout(a.proxy(this._reatachMouseDownHandlers, this), 500);
}
if (this._options.enableFrameOverlay) {
this._hideOverlay();
}
var l = new b.Widgets.DraggableEventArgs(this.startPosition, {
x: this.get_position().x - this.startPosition.x,
y: this.get_position().y - this.startPosition.y
}, m.originalEvent);
this.trigger("dragEnd", l);
}, _reatachMouseDownHandlers: function () {
var l = a(this._options.handle);
l.off(e, this._mouseDownHandlerProxy);
l.on(e, this._mouseDownHandlerProxy);
}, _mouseMoveHandler: function (l) {
this._drag(l);
this._cancelDragSelection(l);
}, _drag: function (o) {
var p = this._getEventLocation(o), m = this._options.constraints, n = this._calcConstraints({
x: p.x - this.startCoords.x,
y: p.y - this.startCoords.y
}, this.startPosition, m), l = new b.Widgets.DraggableEventArgs(this.startPosition, n, o.originalEvent);
if (!this._options.useTransformations) {
this.initialPosition = this.get_position();
this.deltaHelper = {x: p.x - this.deltaHelper.x, y: p.y - this.deltaHelper.y};
this.deltaHelper = this._calcConstraintsClassic(this.deltaHelper, this.initialPosition, p, this._options.constraints);
} else {
this.deltaHelper = n;
}
this.trigger("dragging", l);
if (l._cancel == true) {
return;
}
if (this._options.useTransformations) {
this._dragTransform(this.deltaHelper);
} else {
this._dragClassic(this.deltaHelper);
}
this.deltaHelper = {x: p.x, y: p.y};
if (this._options.enableFrameOverlay) {
this._resizeOverlay();
}
}, _dragTransform: function (l) {
if (a(this._element).hasClass("rdwDoNotTransfrom")) {
return;
}
this._clearDragTranslation();
this._elStyle[this._transfPropName] += " translate(" + l.x + "px, " + l.y + "px)";
a(this._element).addClass("rdwTransformed");
}, _dragClassic: function (l) {
if (a(this._element).hasClass("rdwDoNotTransfrom")) {
return;
}
this._moveWithDelta(l);
}, _applyTransformation: function () {
var p = this._elStyle[this._transfPropName];
var r = "translate(";
var o = r.length;
var n = p.substr(p.lastIndexOf(r));
var q = n.substr(o, n.indexOf(")") - o);
var m = q.split(",");
var l = {x: parseFloat(m[0]), y: parseFloat(m[1])};
this._clearDragTranslation();
this._moveWithDelta(l);
}, _clearDragTranslation: function () {
if (!a(this._element).hasClass("rdwTransformed")) {
return;
}
var l = this._elStyle[this._transfPropName];
this._elStyle[this._transfPropName] = l.substr(0, l.lastIndexOf("translate("));
a(this._element).removeClass("rdwTransformed");
}, _getEventLocation: function (l) {
if (this._isTouchEvent(l)) {
return this._getTouchEventLocation(l);
} else {
return {x: l.clientX, y: l.clientY};
}
}, _moveWithDelta: function (l) {
a(this._element).css({
top: parseFloat(a(this._element).css("top")) + parseFloat(l.y) + "px",
left: parseFloat(a(this._element).css("left")) + parseFloat(l.x) + "px"
});
}, _calcConstraints: function (m, n, l) {
var o = m;
if ((l.maxX != null && n.x + a(this._element).width() > l.maxX) || (l.minX != null && n.x < l.minX) || (l.maxY != null && n.y + a(this._element).height() > l.maxY) || (l.minY != null && n.y < l.minY)) {
return {x: 0, y: 0};
}
if (m.x < 0) {
o.x = l.minX !== null && !isNaN(l.minX) ? Math.max(m.x, l.minX - n.x) : m.x;
} else {
o.x = l.maxX !== null && !isNaN(l.maxX) ? Math.min(m.x, l.maxX - n.x - a(this._element).width()) : m.x;
}
if (m.y < 0) {
o.y = l.minY !== null && !isNaN(l.minY) ? Math.max(m.y, l.minY - n.y) : m.y;
} else {
o.y = l.maxY !== null && !isNaN(l.maxY) ? Math.min(m.y, l.maxY - n.y - a(this._element).height()) : m.y;
}
return o;
}, _calcConstraintsClassic: function (m, o, n, l) {
var p = m;
if ((l.maxX && o.x > l.maxX) || (l.minX && o.x < l.minX) || (l.maxY && o.y > l.maxY) || (l.minY && o.y < l.minY)) {
return {x: 0, y: 0};
}
if (m.x < 0) {
p.x = o.x + m.x < l.minX ? l.minX - o.x : l.maxX && n.x > l.maxX ? 0 : m.x;
} else {
p.x = l.maxX && o.x + a(this._element).width() + m.x >= l.maxX ? l.maxX - o.x - a(this._element).width() : l.minX && n.x < l.minX ? 0 : m.x;
}
if (m.y < 0) {
p.y = o.y + this.deltaHelper.y < l.minY ? l.minY - o.y : l.maxY && n.y > l.maxY ? 0 : m.y;
} else {
p.y = l.maxY && o.y + a(this._element).height() + m.y >= l.maxY ? l.maxY - o.y - a(this._element).height() : l.minY && n.y < l.minY ? 0 : m.y;
}
return p;
}, _showOverlay: function () {
var l = this._getIFrames(this._options.ownerDocument);
for (var m = 0;
m < l.length;
m++) {
this._createOverlay(l[m]);
}
}, _hideOverlay: function () {
a(".rrFrameOverlay").remove();
a(this._options.ownerDocument).find("iframe").removeData("rrFrameOverlayData");
}, _resizeOverlay: function () {
a(this._options.ownerDocument).find("iframe").each(function () {
var l = a(this);
a("#" + l.data("rrFrameOverlayData")).width(l.width()).height(l.height());
});
}, _createOverlay: function (l) {
var m = $telerik.getBounds(l), n = this._options.ownerDocument.createElement("div");
n.id = "rrOverlay_" + this._generateString(6) + (Date.now() % 1000000);
n.className = "rrFrameOverlay";
n.style.cssText = "position:absolute; top:" + m.y + "px;left:" + m.x + "px;width:" + m.width + "px;height:" + m.height + "px;background-color: white; opacity: 0; filter: alpha(opacity=0)";
a(l).data("rrFrameOverlayData", n.id);
this._options.ownerDocument.body.appendChild(n);
}, _getIFrames: function (l) {
return l.getElementsByTagName("iframe");
}, _generateString: function (n) {
var l = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");
if (!n) {
n = Math.floor(Math.random() * l.length);
}
var o = "";
for (var m = 0;
m < n;
m++) {
o += l[Math.floor(Math.random() * l.length)];
}
return o;
}, _toggleHandleCursor: function () {
var l = this.get_handle();
if (this._origCursor === null) {
l.style.cursor = this._origCursor;
this._origCursor = null;
} else {
this._origCursor = l.style.cursor;
l.style.cursor = this._options.cursorType;
}
}, _isTouchEvent: function (l) {
return /(touch)|(mspoint)/i.test(l.type);
}, _getTouchEventLocation: function (m) {
var o = arguments[1], p = o ? [o + "X"] : "pageX", q = o ? [o + "Y"] : "pageY", n = {
x: m[p],
y: m[q]
}, l = m.changedTouches || (m.originalEvent ? m.originalEvent.changedTouches : m.rawEvent ? m.rawEvent.changedTouches : false);
if (l && l.length < 2) {
n.x = l[0][p];
n.y = l[0][q];
}
if ($telerik.isMobileIE10 && m.originalEvent) {
n.x = m.originalEvent[p];
n.y = m.originalEvent[q];
}
return n;
}, _eventButtonToMouseButton: function (l) {
var m = Telerik.Web.UI.Widgets.MouseButton;
if ($telerik.isIE6 || $telerik.isIE7 || $telerik.isIE8) {
switch (l) {
case 1:
return m.Left;
case 4:
return m.Middle;
case 2:
return m.Right;
default:
return m.None;
}
} else {
switch (l) {
case 0:
return m.Left;
case 1:
return m.Middle;
case 2:
return m.Right;
default:
return m.None;
}
}
}
};
b.Widgets.DraggableEventArgs = function (n, l, m) {
this._cancel = false;
this._position = n;
this._delta = l || {x: 0, y: 0};
this._domEvent = m;
this._newPosition = {x: this._position.x + this._delta.x, y: this._position.y + this._delta.y};
};
b.Widgets.DraggableEventArgs.prototype = {
get_position: function () {
return this._position;
}, get_newPosition: function () {
return this._newPosition;
}, get_domEvent: function () {
return this._domEvent;
}, get_cancel: function () {
return this._cancel;
}, set_cancel: function (l) {
this._cancel = (l === true || l === "true");
}
};
Telerik.Web.UI.Helpers.IETouchActionManager = function (l) {
this.element = l;
};
Telerik.Web.UI.Helpers.IETouchActionManager.prototype = {
allowUserTouch: function () {
if (!this.isPointerEnabled()) {
return;
}
var l = this.getStyle();
this.cachedTouchAction = l.msTouchAction;
l.msTouchAction = "none";
}, restore: function () {
if (!this.isPointerEnabled()) {
return;
}
this.getStyle().msTouchAction = this.cachedTouchAction;
}, getStyle: function () {
return this.element ? this.element.style : {};
}, isPointerEnabled: function () {
try {
return window.navigator.msPointerEnabled;
} catch (l) {
return false;
}
}, dispose: function () {
this.restore();
this.element = null;
}
};
a.registerEnum(b.Widgets, "MouseButton", {None: 0, Left: 1, Middle: 2, Right: 4});
})(Telerik.Web.UI, $telerik.$);
/* END Telerik.Web.UI.Common.Widgets.Draggable.js */
/* START Telerik.Web.UI.Common.Widgets.Resizable.js */
Type.registerNamespace("Telerik.Web.UI.Widgets");
(function (b, a) {
var c = function (d) {
(function () {
var f = {};
a.extend(d, {
trigger: function (j) {
var k = f[j];
if (!k) {
return;
}
for (var l = 0;
l < k.length;
l++) {
var h = Array.prototype.slice.call(arguments);
h.shift();
h.unshift(this);
k[l].handler.apply(k[l].context, h);
}
}, _bind: function (i, h) {
a.each(i, function (j, k) {
e(j, k, h);
});
}, _unbind: function (i, h) {
a.each(i, function (j, k) {
g(j, k, h);
});
}, _disposeEvents: function () {
f = null;
}
});
function e(i, j, h) {
var k = f[i] || [];
k.push({handler: j, context: h});
f[i] = k;
}
function g(j, k, h) {
var l = f[j];
if (!l) {
return;
}
var n = -1;
for (var m = 0;
m < l.length;
m++) {
if (l[m].func == k && l[m].context == h) {
n = m;
break;
}
}
if (n > -1) {
l = l.splice(n, 1);
}
f[j] = l;
}
})();
};
b.Widgets.Resizable = function (d, e) {
this._element = d;
this._handlesCollection = {};
this.options = a.extend({
handleSize: 7,
liveResize: false,
enableFrameOverlay: false,
appendHandleToElement: false,
useTinyHandles: false,
constraints: {minWidth: null, minHeight: null, maxWidth: null, maxHeight: null},
ownerDocument: document,
handles: [{direction: "W", element: null}, {direction: "NW", element: null}, {
direction: "N",
element: null
}, {direction: "NE", element: null}, {direction: "E", element: null}, {
direction: "SE",
element: null
}, {direction: "S", element: null}, {direction: "SW", element: null}]
}, e || {});
c(this);
this.initialize();
};
b.Widgets.Resizable.prototype = {
initialize: function () {
this._initHandles();
}, add_resizeStart: function (d) {
this._bind({resizeStart: d});
}, remove_resizeStart: function (d) {
this._unbind({resizeStart: d});
}, add_resizing: function (d) {
this._bind({resizing: d});
}, remove_resizing: function (d) {
this._unbind({resizing: d});
}, add_resizeEnd: function (d) {
this._bind({resizeEnd: d});
}, remove_resizeEnd: function (d) {
this._unbind({resizeEnd: d});
}, get_element: function () {
return this._element;
}, get_constraints: function () {
return this.options.constraints;
}, set_constraints: function (d) {
if (d) {
if ((d.minWidth && d.maxWidth && d.minWidth > d.maxWidth) || (d.minHeight && d.maxHeight && d.minHeight > d.maxHeight)) {
throw Error("Invalid Parameters");
}
}
a.extend(this.options.constraints, d || {maxWidth: null, minWidth: null, maxHeight: null, minHeight: null});
for (var e in this._handlesCollection) {
this._setHandleConstraints(this._handlesCollection[e]);
}
}, get_minWidth: function () {
return this.options.constraints.minWidth;
}, set_minWidth: function (f) {
var d = this.options.constraints;
if ((isNaN(f) && f !== null && f !== "") || (d.maxWidth && d.maxWidth < f)) {
throw Error("Invalid Parameters");
}
d.minWidth = f;
for (var e in this._handlesCollection) {
this._setHandleConstraints(this._handlesCollection[e]);
}
}, get_maxWidth: function () {
return this.options.constraints.maxWidth;
}, set_maxWidth: function (f) {
var d = this.options.constraints;
if ((isNaN(f) && f !== null && f !== "") || (d.minWidth && d.minWidth > f)) {
throw Error("Invalid Parameters");
}
d.maxWidth = f;
for (var e in this._handlesCollection) {
this._setHandleConstraints(this._handlesCollection[e]);
}
}, get_minHeight: function () {
return this.options.constraints.minHeight;
}, set_minHeight: function (f) {
var d = this.options.constraints;
if ((isNaN(f) && f !== null && f !== "") || (d.maxHeight && d.maxHeight < f)) {
throw Error("Invalid Parameters");
}
d.minHeight = f;
for (var e in this._handlesCollection) {
this._setHandleConstraints(this._handlesCollection[e]);
}
}, get_maxHeight: function () {
return this.options.constraints.maxHeight;
}, set_maxHeight: function (f) {
var d = this.options.constraints;
if ((isNaN(f) && f !== null && f !== "") || (d.minHeight && d.minHeight > f)) {
throw Error("Invalid Parameters");
}
d.maxHeight = f;
for (var e in this._handlesCollection) {
this._setHandleConstraints(this._handlesCollection[e]);
}
}, hideHandles: function () {
for (var d in this._handlesCollection) {
var e = this._handlesCollection[d];
e._element.style.display = "none";
}
}, showHandles: function () {
for (var d in this._handlesCollection) {
var e = this._handlesCollection[d];
e._element.style.display = "";
}
}, repaint: function () {
this._configureHandles();
}, _initHandles: function () {
var e = this.options.handles;
for (var f = 0;
f < e.length;
f++) {
var d = null;
if (e[f].element) {
d = this._initExternalHandle(e[f]);
} else {
d = this._initHandle(e[f]);
}
d.add_dragStart(a.proxy(this._handleDragStart, this));
d.add_dragging(a.proxy(this._handleDragging, this));
d.add_dragEnd(a.proxy(this._handleDragEnd, this));
this._handlesCollection[d._direction] = d;
}
this._configureHandles();
}, _initExternalHandle: function (e) {
var d = new b.Widgets.Handle(e.element, e.direction, {
handle: e.element,
cursorType: this._getCursorFromDirection(e.direction),
enableFrameOverlay: this.options.enableFrameOverlay
});
return d;
}, _initHandle: function (f) {
var e = this._createHandleElement(f);
var d = new b.Widgets.Handle(e, f.direction, {
ownerDocument: this.options.ownerDocument,
cursorType: this._getCursorFromDirection(f.direction),
enableFrameOverlay: this.options.enableFrameOverlay
});
return d;
}, _createHandleElement: function (e) {
var d = this.options.ownerDocument.createElement("div");
d.style.position = "absolute";
d.setAttribute("unselectable", "on");
d.className = "rrHandle rr" + e.direction;
return d;
}, _configureHandles: function () {
for (var d in this._handlesCollection) {
var e = this._handlesCollection[d];
if (e.get_useExternalHandle()) {
this._setHandleConstraints(e);
continue;
}
this._appendHandleToDOM(e);
this._applyElementsZIndex(e);
this._sizeHandle(e);
this._positionHandle(e);
e._element.style.cssText = e._element.style.cssText;
this._setHandleConstraints(e);
}
}, _appendHandleToDOM: function (d) {
if (!this._element.parentNode) {
throw Error("Resizable element should be part of the DOM tree");
}
if (this.options.appendHandleToElement) {
this._element.appendChild(d._element);
} else {
var e = this._element.parentNode;
if (this._element.nextSibling) {
e.insertBefore(d._element, this._element.nextSibling);
} else {
e.appendChild(d._element);
}
}
}, _applyElementsZIndex: function (d) {
var e = this._element.style.zIndex || $telerik.getComputedStyle(this._element, "z-index");
d._element.style.zIndex = e || "";
}, _setHandleConstraints: function (e) {
var d = {
minWidth: this.options.constraints.minWidth ? this.options.constraints.minWidth - Math.ceil(a(this._element).innerWidth()) : null,
maxWidth: this.options.constraints.maxWidth ? this.options.constraints.maxWidth - Math.floor(a(this._element).innerWidth()) : null,
minHeight: this.options.constraints.minHeight ? this.options.constraints.minHeight - Math.ceil(a(this._element).innerHeight()) : null,
maxHeight: this.options.constraints.maxHeight ? this.options.constraints.maxHeight - Math.floor(a(this._element).innerHeight()) : null
};
var g = !!e.get_useExternalHandle();
var f = g ? 0 : this.options.handleSize;
e.set_constraints(null);
if (e._direction == "E" || e._direction == "W") {
e.set_minY(a(e._element).offset().top);
e.set_maxY(a(e._element).offset().top + a(e._element).height());
} else {
if (e._direction == "N" || e._direction == "S") {
e.set_minX(a(e._element).offset().left);
e.set_maxX(a(e._element).offset().left + a(e._element).width());
}
}
if (e._direction.indexOf("W") > -1) {
if (d.maxWidth !== null) {
e.set_minX(null);
e.set_minX(e.get_position().x - d.maxWidth);
}
e.set_maxX(null);
if (d.minWidth !== null) {
e.set_maxX(e.get_position().x - d.minWidth + f);
} else {
e.set_maxX(this._getHandleOpositeConstraints(e._direction, g).x);
}
} else {
if (e._direction.indexOf("E") > -1) {
if (d.maxWidth !== null) {
e.set_maxX(null);
e.set_maxX(e.get_position().x + d.maxWidth + f);
}
e.set_minX(null);
if (d.minWidth !== null) {
e.set_minX(e.get_position().x + d.minWidth);
} else {
e.set_minX(this._getHandleOpositeConstraints(e._direction, g).x);
}
}
}
if (e._direction.indexOf("N") > -1) {
if (d.maxHeight !== null) {
e.set_minY(null);
e.set_minY(e.get_position().y - d.maxHeight);
}
e.set_maxY(null);
if (d.minHeight !== null) {
e.set_maxY(e.get_position().y - d.minHeight + f);
} else {
e.set_maxY(this._getHandleOpositeConstraints(e._direction, g).y);
}
} else {
if (e._direction.indexOf("S") > -1) {
if (d.maxHeight !== null) {
e.set_maxY(null);
e.set_maxY(e.get_position().y + d.maxHeight + f);
}
e.set_minY(null);
if (d.minHeight !== null) {
e.set_minY(e.get_position().y + d.minHeight);
} else {
e.set_minY(this._getHandleOpositeConstraints(e._direction, g).y);
}
}
}
}, _getHandleOpositeConstraints: function (d, f) {
var g = {x: null, y: null};
var e = f ? 0 : this.options.handleSize / 2;
if (d.toLowerCase().indexOf("w") > -1) {
g.x = a(this._element).offset().left + a(this._element).width() + e;
} else {
if (d.toLowerCase().indexOf("e") > -1) {
g.x = a(this._element).offset().left - e;
}
}
if (d.toLowerCase().indexOf("n") > -1) {
g.y = a(this._element).offset().top + a(this._element).height() + e;
} else {
if (d.toLowerCase().indexOf("s") > -1) {
g.y = a(this._element).offset().top - e;
}
}
return g;
}, _sizeHandle: function (e) {
var d = e.get_direction();
if (this.options.useTinyHandles) {
e._element.style.width = e._element.style.height = this.options.handleSize + "px";
} else {
if (d.indexOf("W") > -1 || d.indexOf("E") > -1) {
e._element.style.width = this.options.handleSize + "px";
} else {
e._element.style.width = Math.max(this.options.handleSize, parseFloat(this._element.clientWidth) - this.options.handleSize) + "px";
}
if (d.indexOf("N") > -1 || d.indexOf("S") > -1) {
e._element.style.height = this.options.handleSize + "px";
} else {
e._element.style.height = Math.max(this.options.handleSize, parseFloat(this._element.clientHeight) - this.options.handleSize) + "px";
}
}
}, _positionHandle: function (g) {
var f = g.get_direction();
var h = f.indexOf("S") > -1 ? parseFloat(this._element.clientHeight) : 0;
var i = f.indexOf("E") > -1 ? parseFloat(this._element.clientWidth) : 0;
var e = parseFloat(this._element.clientHeight) > this.options.handleSize / 2 && (f == "E" || f == "W") ? 1 : -1;
var d = parseFloat(this._element.clientWidth) > this.options.handleSize / 2 && (f == "N" || f == "S") ? 1 : -1;
if (this.options.appendHandleToElement && this._isRootPositioned()) {
g._element.style.top = (h + e * this.options.handleSize / 2) + "px";
g._element.style.left = (i + d * this.options.handleSize / 2) + "px";
} else {
g._element.style.top = (this._getPosition(this._element).top + h + e * this.options.handleSize / 2) + "px";
g._element.style.left = (this._getPosition(this._element).left + i + d * this.options.handleSize / 2) + "px";
if (this.options.useTinyHandles) {
if (f == "S" || f == "N") {
g._element.style.left = (this._getPosition(this._element).left + (this._element.clientWidth) / 2 - this.options.handleSize / 2) + "px";
}
if (f == "E" || f == "W") {
g._element.style.top = (this._getPosition(this._element).top + (this._element.clientHeight) / 2 - this.options.handleSize / 2) + "px";
}
}
}
}, _isRootPositioned: function () {
var d = this._isRootIndirectlyPositioned() || $telerik.getComputedStyle(this._element, "position") != "static";
return d;
}, _isRootIndirectlyPositioned: function () {
var d = this._element;
return ($telerik.getComputedStyle(d, "transform") != "none" && $telerik.getComputedStyle(d, "MozTransform") != "none" && $telerik.getComputedStyle(d, "webkitTransform") != "none" && $telerik.getComputedStyle(d, "OTransform") != "none" && $telerik.getComputedStyle(d, "msTransform") != "none");
}, _getPosition: function (e) {
var g = {top: e.offsetTop, left: e.offsetLeft}, f = e.offsetParent;
while (f && ($telerik.getComputedStyle(f, "position") == "static" || f.tagName == "body")) {
var d = a(f);
g.top += f.offsetTop;
g.left += f.offsetLeft;
if (d.css("box-sizing") == "content-box") {
g.top += parseFloat(d.css("padding-top"));
g.left += parseFloat(d.css("padding-left"));
}
f = f.offsetParent;
}
return g;
}, _toggleDocumentCursor: function (d) {
if (typeof(d) == "string") {
this.options.ownerDocument.body.style.cursor = this._getCursorFromDirection(d);
} else {
this.options.ownerDocument.body.style.cursor = "";
}
}, _getCursorFromDirection: function (d) {
if (d) {
return d.toLowerCase() + "-resize";
} else {
return null;
}
}, _handleDragStart: function (e, d) {
var f = new b.Widgets.Resizable.ResizeableEventArgs(e.get_direction(), null, d.get_domEvent());
this.trigger("resizeStart", f);
if (!f._cancel) {
this._toggleDocumentCursor(e.get_direction());
}
d.set_cancel(f._cancel);
if (this.options.liveResize && !f._cancel) {
this.resizeHelper = {
width: this._element.clientWidth,
height: this._element.clientHeight,
offset: a(this._element).offset()
};
}
}, _handleDragging: function (g, d) {
var e = {x: d._delta.x, y: d._delta.y}, f = g.get_direction();
if (g.get_useExternalHandle()) {
if (f == "N" || f == "S") {
e.x = 0;
e.y = Math.min(e.y, this._element.clientHeight);
}
if (f == "E" || f == "W") {
e.x = Math.min(e.x, this._element.clientWidth);
e.y = 0;
}
}
var h = new b.Widgets.Resizable.ResizeableEventArgs(f, e, d.get_domEvent());
this.trigger("resizing", h);
d.set_cancel(h._cancel);
if (this.options.liveResize && !h._cancel) {
this._applyElementSizing(f, e);
}
}, _handleDragEnd: function (g, d) {
var e = d._delta, f = g.get_direction();
if (g.get_useExternalHandle()) {
if (f == "N" || f == "S") {
e.x = 0;
e.y = Math.min(e.y, this._element.clientHeight);
}
if (f == "E" || f == "W") {
e.x = Math.min(e.x, this._element.clientWidth);
e.y = 0;
}
}
this._toggleDocumentCursor();
this._configureHandles();
var h = new b.Widgets.Resizable.ResizeableEventArgs(g.get_direction(), e, d.get_domEvent());
this.trigger("resizeEnd", h);
}, _applyElementSizing: function (e, d) {
var f = 1, g = 1;
if (e.indexOf("W") > -1) {
g = -1;
$telerik.$(this._element).css("left", parseFloat(this.resizeHelper.offset.left) + d.x);
}
if (e.indexOf("N") > -1) {
f = -1;
$telerik.$(this._element).css("top", parseFloat(this.resizeHelper.offset.top) + d.y);
}
a(this._element).innerWidth(parseFloat(this.resizeHelper.width) + g * d.x).innerHeight(parseFloat(this.resizeHelper.height) + f * d.y);
}, dispose: function () {
for (var d in this._handlesCollection) {
var e = this._handlesCollection[d];
if (!e.get_useExternalHandle()) {
if (e._element.parentNode) {
e._element.parentNode.removeChild(e._element);
}
}
e.dispose();
}
this._element = null;
this._handlesCollection = null;
this.options = null;
}
};
b.Widgets.Resizable.ResizeableEventArgs = function (e, d, f) {
this._cancel = false;
this._delta = d;
this._direction = e;
this._domEvent = f;
};
b.Widgets.Resizable.ResizeableEventArgs.prototype = {
get_delta: function () {
return this._delta;
}, get_direction: function () {
return this._direction;
}, get_domEvent: function () {
return this._domEvent;
}, get_cancel: function () {
return this._cancel;
}, set_cancel: function (d) {
this._cancel = (d === true || d === "true");
}
};
b.Widgets.Handle = function (e, d, f) {
this._direction = d;
this.options = a.extend(this.options, f || {});
Telerik.Web.UI.Widgets.Handle.initializeBase(this, [e, f]);
};
b.Widgets.Handle.prototype = {
get_direction: function () {
return this._direction;
}
};
Telerik.Web.UI.Widgets.Draggable.registerClass("Telerik.Web.UI.Widgets.Draggable");
Telerik.Web.UI.Widgets.Handle.registerClass("Telerik.Web.UI.Widgets.Handle", Telerik.Web.UI.Widgets.Draggable);
})(Telerik.Web.UI, $telerik.$);
/* END Telerik.Web.UI.Common.Widgets.Resizable.js */
/* START Telerik.Web.UI.Window.RadWindowScripts.js */
Type.registerNamespace("Telerik.Web.UI");
(function (a, b, c) {
$telerik.toWindow = function (d) {
return d;
};
$telerik.findWindow = $find;
b.RadWindowControllerClass = function () {
this._activeWindow = null;
this._historyStack = [];
};
b.RadWindowControllerClass.prototype = {
getInstance: function () {
return this;
}, hideCurrentWindowIfNonModal: function () {
if (this._activeWindow != null && this._activeWindow.isModal && !this._activeWindow.isModal()) {
this._activeWindow.close();
}
this._activeWindow = null;
}, inactivateCurrentWindow: function () {
if (this._activeWindow != null) {
this._activeWindow.setActive(false);
}
this._activeWindow = null;
}, set_activeWindow: function (d) {
if (d == this._activeWindow) {
return;
}
this.inactivateCurrentWindow();
this._activeWindow = d;
Array.remove(this._historyStack, d);
Array.add(this._historyStack, d);
}, notifyWindowClosed: function (d) {
if (this._activeWindow == d) {
this._activeWindow = null;
}
Array.remove(this._historyStack, d);
this._activatePreviousWindow();
}, _activatePreviousWindow: function () {
var d = this._historyStack;
var e = d.length - 1;
for (;
e >= 0;
e--) {
var f = d[e];
if (!f) {
return;
}
if (f.isCreated() && !f.isClosed() && !f.isMinimized()) {
f.setActive(true);
break;
} else {
Array.removeAt(d, e);
}
}
}, get_activeWindow: function () {
return this._activeWindow;
}
};
b.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass", null);
if (!b.RadWindowController) {
b.RadWindowController = new b.RadWindowControllerClass();
}
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.RadWindowUtils");
b.RadWindowUtils.Localization = {
Close: "Close",
Minimize: "Minimize",
Maximize: "Maximize",
Reload: "Reload",
PinOn: "Pin on",
PinOff: "Pin off",
Restore: "Restore",
OK: "OK",
Cancel: "Cancel",
Yes: "Yes",
No: "No"
};
a.registerEnum(b, "WindowBehaviors", {
None: 0,
Resize: 1,
Minimize: 2,
Close: 4,
Pin: 8,
Maximize: 16,
Move: 32,
Reload: 64,
Default: (1 + 2 + 4 + 8 + 16 + 32 + 64)
});
a.registerEnum(b, "WindowAutoSizeBehaviors", {
Width: 1,
WidthProportional: 2,
Height: 4,
HeightProportional: 8,
Default: (2 + 8)
});
a.registerEnum(b, "WindowAnimation", {None: 0, Resize: 1, Fade: 2, Slide: 4, FlyIn: 8});
a.registerEnum(b, "WindowMinimizeMode", {SameLocation: 1, MinimizeZone: 2, Default: 1});
b.RadWindow = function (d) {
b.RadWindow.initializeBase(this, [d]);
this._openerElement = null;
this._offsetElement = null;
this._popupElement = null;
this._tableElement = null;
this._contentElement = null;
this._contentCell = null;
this._titleElement = null;
this._titleCell = null;
this._titlebarElement = null;
this._statusCell = null;
this._statusMessageElement = null;
this._iframe = null;
this._dockMode = false;
this._isPredefined = false;
this._buttonsElement = null;
this._buttonsArray = [];
this._iconUrl = null;
this._shortCutManager = null;
this.isIE = ($telerik.isIE);
this._openerElementID = null;
this._offsetElementID = null;
this._behaviors = b.WindowBehaviors.Default;
this._left = null;
this._top = null;
this._title = "";
this._width = "300px";
this._minWidth = null;
this._minHeight = null;
this._defaultMinWidth = null;
this._defaultMinHeight = null;
this._handlesWidth = null;
this._resizeOverlayElement = null;
this._height = "300px";
this._opacity = 100;
this._visibleTitlebar = true;
this._visibleStatusbar = true;
this._modal = false;
this._overlay = false;
this._keepInScreenBounds = false;
this._windowAnimation = null;
this._onMouseDownDelegate = null;
this._onClickDelegate = null;
this._onTitlebarDblclickDelegate = null;
this._onTitlebarClickDelegate = null;
this._onWindowResizeDelegate = null;
this._onIframeLoadDelegate = null;
this._onChildPageUnloadDelegate = null;
this._onChildPageClickDelegate = null;
this._onKeyDownDelegate = null;
this._onModalShowHandler = null;
this._onModalCloseHandler = null;
this._loaded = false;
this._isCloned = false;
this._restoreRect = null;
this._popupBehavior = null;
this._popupVisible = false;
this._dropDownTouchScroll = null;
this._browserWindow = window;
this._stylezindex = null;
this._renderMode = b.RenderMode.Classic;
var e = navigator.userAgent;
this._isiOS5Safari = e.match(/OS 5_\d like Mac OS X/i);
this._isiPhoneiPadAppleWebkit = e.match(/iPhone|iPad/) && e.match(/AppleWebKit/);
this._iframeWrapper = null;
this.GetWindowManager = this.get_windowManager;
this.BrowserWindow = window;
this.GetContentFrame = this.get_contentFrame;
this.GetLeftPosition = function () {
this.getWindowBounds().x;
};
this.GetTopPosition = function () {
this.getWindowBounds().y;
};
this.GetTitlebar = function () {
return this.ui ? this.ui.titlebar : null;
};
this.GetStatusbar = function () {
return this._statusCell;
};
this.SetOpenerElementId = this.set_openerElementID;
this.SetStatus = this.set_status;
this.GetStatus = this.get_status;
this.SetModal = this.set_modal;
this.SetWidth = this.set_width;
this.SetHeight = this.set_height;
this.GetWidth = this.get_width;
this.GetHeight = this.get_height;
this.SetOffsetElementId = this.set_offsetElementID;
this.SetTitle = this.set_title;
this.MoveTo = this.moveTo;
this.Center = this.center;
this.SetVisible = this.setVisible;
this.SetSize = this.setSize;
this.Show = this.show;
this.Hide = this.hide;
this.GetUrl = this.get_navigateUrl;
this.SetUrl = this.setUrl;
this.Reload = this.reload;
this.SetActive = this.setActive;
this.Minimize = this.minimize;
this.Restore = this.restore;
this.Maximize = this.maximize;
this.Close = this.close;
this.TogglePin = this.togglePin;
this.IsMaximized = this.isMaximized;
this.IsMinimized = this.isMinimized;
this.IsModal = this.isModal;
this.IsClosed = this.isClosed;
this.IsPinned = this.isPinned;
this.IsVisible = this.isVisible;
this.IsActive = this.isActive;
this.IsBehaviorEnabled = this.isBehaviorEnabled;
};
b.RadWindow.prototype = {
_getLocalization: function () {
return b.RadWindowUtils.Localization;
}, _getLocalizationString: function (f) {
var e = this.get_localization();
if (typeof(e) == "string") {
e = Sys.Serialization.JavaScriptSerializer.deserialize(e);
this.set_localization(e);
}
var d = this._getLocalization();
if (!e) {
return d[f];
}
return e[f];
}, _registerGlobalBodyEventHandlers: function (e) {
var d = this.get_shortcuts();
if (!d) {
return;
}
if (!this._shortCutManager) {
this._shortCutManager = new b.WindowShortCutManager(d);
}
if (e) {
this._onKeyDownDelegate = Function.createDelegate(this, this._onKeyDown);
$addHandler(document.documentElement, "keydown", this._onKeyDownDelegate);
} else {
if (this._onKeyDownDelegate) {
$removeHandler(document.documentElement, "keydown", this._onKeyDownDelegate);
this._onKeyDownDelegate = null;
}
}
}, _registerIframeLoadHandler: function (d) {
if (!this._iframe) {
return;
}
if (d) {
this._onIframeLoadDelegate = Function.createDelegate(this, this._onIframeLoad);
$addHandler(this._iframe, "load", this._onIframeLoadDelegate);
} else {
if (this._onIframeLoadDelegate) {
$removeHandler(this._iframe, "load", this._onIframeLoadDelegate);
this._onIframeLoadDelegate = null;
$clearHandlers(this._iframe);
}
}
}, _registerWindowResizeHandler: function (d) {
if (d) {
this._onWindowResizeDelegate = Function.createDelegate(this, this._maintainMaximizedSize);
$addHandler(window, "resize", this._onWindowResizeDelegate);
} else {
if (this._onWindowResizeDelegate) {
$removeHandler(window, "resize", this._onWindowResizeDelegate);
this._onWindowResizeDelegate = null;
}
}
}, _registerOpenerElementHandler: function (e, d) {
if (!e) {
return;
}
if (Sys.UI.DomElement.containsCssClass(e, "RadButton")) {
e.setAttribute("rwOpener", true);
} else {
e.removeAttribute("rwOpener");
}
if (true == d) {
this._onClickDelegate = Function.createDelegate(this, this._onClick);
$addHandler(e, "click", this._onClickDelegate);
} else {
$removeHandler(e, "click", this._onClickDelegate);
this._onClickDelegate = null;
}
}, _registerTitlebarHandlers: function (d) {
var e = this.ui ? this.ui.titleCell || this.ui.titlebar : null;
if (d) {
this._onTitlebarDblclickDelegate = Function.createDelegate(this, function () {
if (this.isMinimized()) {
this.restore();
} else {
if (this.isBehaviorEnabled(b.WindowBehaviors.Maximize)) {
if (this.isMaximized()) {
this.restore();
} else {
this.maximize();
}
}
}
});
this._onTitlebarClickDelegate = Function.createDelegate(this, function () {
if (this._getWindowController()._activeWindow === this) {
this.setActive(true);
}
});
$addHandler(e, "dblclick", this._onTitlebarDblclickDelegate);
$addHandler(e, "click", this._onTitlebarClickDelegate);
} else {
if (e) {
if (this._onTitlebarDblclickDelegate) {
$removeHandler(e, "dblclick", this._onTitlebarDblclickDelegate);
this._onTitlebarDblclickDelegate = null;
}
if (this._onTitlebarClickDelegate) {
$removeHandler(e, "click", this._onTitlebarClickDelegate);
this._onTitlebarClickDelegate = null;
}
$clearHandlers(e);
}
}
}, _makeModal: function (d) {
if (this._onModalShowHandler) {
this.remove_show(this._onModalShowHandler);
this._onModalShowHandler = null;
}
if (this._onModalCloseHandler) {
this.remove_close(this._onModalCloseHandler);
this._onModalCloseHandler = null;
}
if (this._modalExtender) {
this._modalExtender.dispose();
this._modalExtender = null;
}
if (!d) {
return;
}
if (typeof(b.RadWindowManager) != "undefined" && b.RadWindowManager.isInstanceOfType(this)) {
return;
}
this._onModalShowHandler = function (g) {
if (!g._modalExtender) {
g._modalExtender = new b.ModalExtender(g._popupElement);
}
g._modalExtender.show();
var f = null;
try {
f = document.activeElement;
} catch (e) {
document.documentElement.focus();
f = document.activeElement;
}
if (f && f.tagName && f.tagName.toLowerCase() != "body") {
var h = (!$telerik.isDescendant(this._contentElement, f) && this._dockMode);
if (!(g._isPredefined) || h) {
g._focusedPageElement = f;
f.blur();
}
}
if (g.get_centerIfModal()) {
g.center();
}
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler = function (e) {
window.setTimeout(function () {
if (e._modalExtender) {
e._modalExtender.hide();
}
var g = e._focusedPageElement;
if (g) {
try {
g.focus();
} catch (f) {
}
e._focusedPageElement = null;
}
}, 10);
};
this.add_close(this._onModalCloseHandler);
}, _enableMoveResize: function (e) {
if (!this.view) {
return;
}
var d = {
resize: this.isBehaviorEnabled(b.WindowBehaviors.Resize),
move: this.isBehaviorEnabled(b.WindowBehaviors.Move)
};
if (e) {
this.view.enableMoveResize(d);
} else {
this.view.disableMoveResize(d);
}
}, _setResizeOverlayVisible: function (d) {
if (this._dockMode) {
return;
}
var f = this._resizeOverlayElement;
if (!f) {
var g = this._getHandlesWidth();
var e = this._visibleTitlebar ? this._getTitlebarHeight() : g;
f = document.createElement("div");
f.style.position = "absolute";
f.style.zIndex = "1";
f.style.top = e + "px";
f.style.left = Math.round(g / 2) + "px";
f.style.backgroundColor = "White";
f.style.filter = "alpha(opacity=0)";
f.style.opacity = 0;
this._contentCell.appendChild(f);
this._resizeOverlayElement = f;
}
this._setResizeOverlaySize();
f.style.display = d ? "" : "none";
}, _setResizeOverlaySize: function () {
var e = this._resizeOverlayElement;
if (e) {
var d = this._contentCell;
e.style.width = d.offsetWidth + "px";
e.style.height = d.offsetHeight + "px";
}
}, onResizeStart: function () {
if (this.isMaximized()) {
return false;
}
this.setActive(true);
this._setResizeOverlayVisible(true);
this._cachedDragZoneBounds = this._getRestrictionZoneBounds();
var d = new Sys.CancelEventArgs();
this.raiseEvent("resizeStart", d);
if (d.get_cancel()) {
return false;
}
}, onResizing: function (d) {
if (!this._cachedDragZoneBounds || this._checkRestrictionZoneBounds(this._cachedDragZoneBounds, d)) {
this._manageVisibilityFirefox(false);
if (this._isiOS5Safari) {
this.setContentFixedHeight(d.height, this._iframeWrapper);
}
if (this._dockMode) {
this.setWidthDockMode(d.width - 1);
this.setHeightDockMode(d.height - 1);
} else {
this._setResizeOverlaySize();
}
var f = this._getCurrentBounds();
var j = this.get_minWidth();
var h = parseInt(this.get_maxWidth());
var i = this.get_minHeight();
var g = parseInt(this.get_maxHeight());
var e = false;
if (d.width < j || h && d.width > h) {
var l = j;
if (d.width < j) {
d.width = j;
} else {
d.width = h;
l = h;
}
var k = this._resizeExtender._originalBounds;
if (this._resizeExtender._resizeDir.west) {
d.x = k.x + (k.width - l);
if (this._cachedDragZoneBounds) {
d.x -= this._cachedDragZoneBounds.x;
}
} else {
d.x = f.x;
}
d.y = f.y;
d.height = f.height;
e = true;
}
if (d.height < i || g && d.height > g) {
d.height = (d.height < i) ? i : g;
d.x = f.x;
d.y = f.y;
d.width = f.width;
e = true;
}
if (e) {
this.setSize(d.width, d.height);
this._manageVisibilityFirefox(false);
this._setPopupVisible(d.x, d.y);
return false;
}
this._updateTitleWidth();
return true;
}
return false;
}, onResizeEnd: function () {
this._manageVisibilityFirefox(false);
this._cachedDragWindowBounds = null;
var d = this._getCurrentBounds();
if (!this._dockMode) {
this._setResizeOverlayVisible(false);
}
this._setPopupVisible(d.x, d.y);
this._storeBounds();
if (this._overlay && $telerik.isFirefox) {
this._popupBehavior._onMove();
}
this.raiseEvent("resizeEnd", new Sys.EventArgs());
this._manageVisibilityFirefox(true);
}, onDragStart: function () {
this.setActive(true);
if (this.isPinned() || this.isMaximized()) {
return false;
}
if (this.isMinimized() && this.get_minimizeZoneID()) {
return false;
}
var f = this.get_popupElement();
this._cachedDragZoneBounds = this._getRestrictionZoneBounds();
var e = $telerik.getSize(f);
var d = $telerik.getBorderBox(f);
e.width -= d.horizontal;
e.height -= d.vertical;
this._cachedDragWindowBounds = e;
this._setResizeOverlayVisible(true);
this.raiseEvent("dragStart", new Sys.EventArgs());
return true;
}, onDragEnd: function (e) {
this._cachedDragZoneBounds = null;
this._cachedDragWindowBounds = null;
if (this._overlay && $telerik.isFirefox) {
this._popupBehavior._onMove();
}
this._setResizeOverlayVisible(false);
this._manageVisibilityFirefox(false);
var d = this._getCurrentBounds();
this._manageVisibilityFirefox(false);
this.moveTo(d.x, d.y);
this.setActive(true);
if (this.isMinimized()) {
this._getTitleElement().style.width = "";
}
this._manageVisibilityFirefox(true);
this.raiseEvent("dragEnd", new Sys.EventArgs());
}, onDrag: function (d) {
if (!this._cachedDragZoneBounds) {
return true;
}
var f = this._cachedDragWindowBounds;
var g = this._cachedDragZoneBounds;
d.width = f.width;
d.height = f.height;
var e = this._checkRestrictionZoneBounds(g, d);
if (!e) {
if (d.x <= g.x) {
d.x = g.x;
} else {
if (g.x + g.width <= d.x + f.width) {
d.x = g.x + g.width - f.width;
}
}
if (d.y <= g.y) {
d.y = g.y;
} else {
if (g.y + g.height <= d.y + f.height) {
d.y = g.y + g.height - f.height;
}
}
e = true;
}
return e;
}, initialize: function () {
b.RadWindow.callBaseMethod(this, "initialize");
this.initView();
var e = this.get_element();
if (e.innerHTML.toLowerCase().indexOf("thank you for using the trial version of telerik ui for asp.net ajax") > 0) {
e.style.display = "";
}
if (this.get_visibleOnPageLoad()) {
setTimeout(Function.createDelegate(this, function () {
this.show();
}), 0);
}
this._registerWindowResizeHandler(true);
var d = this.get_element().className;
if (d) {
this.set_cssClass(d.replace(/^ /, ""));
}
}, initView: function () {
var d = b.Window.UIFactory;
if (!this.ui || this.ui.window != this) {
this.ui = d.getRenderer(this._renderMode, this);
}
if (!this.view || this.view.window != this) {
this.view = d.getView(this._renderMode, this);
}
}, dispose: function () {
var d = this.get_windowManager();
if (d) {
if (d.get_preserveClientState()) {
d.saveWindowState(this);
}
if (this.get_destroyOnClose()) {
d.removeWindow(this);
}
}
this.disposeUI();
b.RadWindow.callBaseMethod(this, "dispose");
}, disposeUI: function () {
if (this._windowAnimation) {
this._windowAnimation.dispose();
}
if (!$telerik.isChrome && !$telerik.isSafari) {
this._removeFromDOM = this.get_destroyOnClose();
}
this._enableMoveResize(false);
this._makeModal(false);
this._registerTitlebarHandlers(false);
if (this._titleIconElement) {
$clearHandlers(this._titleIconElement);
}
this._registerWindowResizeHandler(false);
this._registerIframeLoadHandler(false);
if (this._openerElement) {
this._registerOpenerElementHandler(this._openerElement, false);
}
this.set_behaviors(b.WindowBehaviors.None);
if (this.view) {
this.view.dispose();
}
if (this.ui) {
this.ui.dispose();
}
this.view = this.ui = null;
var e = this._iframe;
if (e) {
e.radWindow = null;
var i = "sandbox" in document.createElement("iframe");
e.src = i ? "about:blank" : "javascript:'<html></html>';";
e.name = "";
e.removeAttribute("name");
e.removeAttribute("NAME");
}
this._createTouchScrollExtender(false);
if (this._contentElement && this._isPredefined) {
this._contentElement.innerHTML = "";
}
var d = this.get_contentElement();
if (this._dockMode && d) {
if (Sys && Sys.WebForms) {
var h = Sys.WebForms.PageRequestManager.getInstance();
if (h && h.get_isInAsyncPostBack()) {
$telerik.disposeElement(d);
}
}
}
var f = this._popupElement;
if (f && f.parentNode) {
f.parentNode.removeChild(f);
}
this._popupVisible = false;
var g = this._popupBehavior;
if (this.get_destroyOnClose() && g) {
g.dispose();
this._popupBehavior = null;
}
}, hide: function () {
this._hide();
this._registerGlobalBodyEventHandlers(false);
return true;
}, clone: function (f) {
var g = document.createElement("span");
if (f) {
g.setAttribute("id", f);
}
var e = this.get_contentElement();
var d = e ? e.cloneNode(true) : null;
if (this._renderMode != b.RenderMode.Classic) {
this._contentElement = d;
}
try {
var h = $telerik.cloneControl(this, b.RadWindow, g);
} finally {
if (this._renderMode != b.RenderMode.Classic && e) {
this.set_contentElement(e);
}
}
return h;
}, _createTouchScrollExtender: function (f) {
var d = $get(this.get_id() + "_C");
if (d) {
var e = this._dropDownTouchScroll;
if (e) {
if (!f) {
e.dispose();
this._dropDownTouchScroll = null;
}
} else {
if (f) {
this._dropDownTouchScroll = new b.TouchScrollExtender(d);
this._dropDownTouchScroll.initialize();
}
}
}
}, set_contentElement: function (d) {
if (!this._isPredefined && d.getElementsByTagName("iframe").length == 0) {
this._dockMode = true;
}
if (this.view) {
this.view.setContent(d);
}
}, _setShadowCSSClass: function (d) {
this.ui.setShadowCssClass(d);
}, get_contentElement: function () {
return this._contentElement || (this.ui ? this.ui.pendingContent : null);
}, isCreated: function () {
return this._popupElement != null;
}, show: function () {
var e = this.isCreated();
this._createUI();
var d = new Sys.CancelEventArgs();
this.raiseEvent("beforeShow", d);
if (d.get_cancel()) {
return;
}
if (this.get_navigateUrl() && (!e || this.get_reloadOnShow())) {
this.setUrl(this.get_navigateUrl());
}
if (!e && (this.get_initialBehaviors() != b.WindowBehaviors.None)) {
this._show();
this._afterShow();
if (this.isInitialBehaviorEnabled(b.WindowBehaviors.Minimize)) {
this.minimize();
}
if (this.isInitialBehaviorEnabled(b.WindowBehaviors.Maximize)) {
this.maximize();
}
if (this.isInitialBehaviorEnabled(b.WindowBehaviors.Pin)) {
this.togglePin();
}
return;
}
if (this.isModal() && this.get_centerIfModal()) {
this.center();
}
if (this.get_animation() == b.WindowAnimation.None) {
this._show();
this._afterShow();
} else {
this._playAnimation();
}
}, _show: function () {
if (this.get_offsetElementID() && !this._offsetElement) {
var f = $get(this.get_offsetElementID());
if (f) {
this._offsetElement = f;
}
}
var e = this._popupBehavior.get_parentElement();
if (this._offsetElement && !this._offsetSet) {
this._popupBehavior.set_parentElement(this._offsetElement);
this._offsetSet = true;
}
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
this._reSetWindowPosition();
this._popupVisible = true;
this.setVisible(true);
var g = this._getStoredBounds();
if (this._firstShow && !g) {
this.set_width(this.get_width());
this.set_height(this.get_height());
} else {
this._restoreBounds();
}
if (e != this._popupBehavior.get_parentElement()) {
this._popupBehavior.set_parentElement(e);
}
var d = this.get_contentElement();
if (!this._isPredefned && d) {
$telerik.repaintChildren(d);
}
}, _hide: function () {
if (!this.get_animation() || this.get_animation() == 0) {
this._afterHide();
} else {
if (this._enableShadow && $telerik.isIE) {
this._setShadowCSSClass(false);
}
var e = Function.createDelegate(this, this._afterHide), f = this.isMaximized(), d = this.get_animationDuration();
$telerik.$(this._popupElement).stopTransition().transition({opacity: 0}, d, "linear", function () {
e(f);
});
}
}, _afterHide: function (d) {
if (!this._popupBehavior) {
return;
}
this._manageVisibilityFirefox(true);
if (d == null) {
d = this.isMaximized();
}
var e = this.isMinimized();
if (d || e) {
this.restore();
}
if ($telerik.isFirefox) {
this.setOverflowVisible(false);
}
this._popupVisible = false;
if ($telerik.isIE9 || $telerik.isIE10) {
this._moveElementToShowOutOfView();
} else {
this.setVisible(false);
}
this._getWindowController().notifyWindowClosed(this);
}, _moveElementToShowOutOfView: function () {
if (!this.view) {
this.initView();
}
this.view.moveOutOfSight();
}, get_leftHidingPoint: function () {
return this._isRightToLeft ? 10000 : -10000;
}, _afterShow: function () {
if ($telerik.isIE9 || $telerik.isIE10) {
this._restoreElementToShowStyling();
}
this.setActive(true);
if ($telerik.isFirefox) {
this.setOverflowVisible(true);
}
this._registerGlobalBodyEventHandlers(true);
this._storeBounds();
this.raiseEvent("show", new Sys.EventArgs());
var d = !this.get_animation() == b.WindowAnimation.None;
if (this.get_autoSize() && (this._dockMode || d)) {
this.autoSize(d);
}
if (this.get_enableAriaSupport() && this._popupElement && this.isVisible()) {
this._popupElement.setAttribute("aria-hidden", "false");
}
}, _restoreElementToShowStyling: function () {
if (this._popupBehavior) {
a(this._popupBehavior.get_elementToShow()).css("overflow", "");
}
}, _playAnimation: function () {
var g = Function.createDelegate(this, function () {
var q = this._getCalculatedPopupBounds();
this._setPopupVisible(q.x, q.y);
var m = $telerik.getBounds(this._popupElement);
var p = this.get_offsetElementID();
if (p) {
var n = $get(p);
if (n) {
var o = $telerik.getBounds(n);
m.x = o.x;
m.y = o.y;
}
}
$telerik.$(this._popupElement).hide();
return m;
});
var d = this._popupElement;
if (this._enableShadow && $telerik.isIE) {
this._setShadowCSSClass(false);
}
var f = this.get_animation();
var l = this._openerElement ? $telerik.getBounds(this._openerElement) : null;
var h = g();
var e = this.get_animationDuration();
var k = "" + this._position;
var j = null;
var i = Function.createDelegate(this, function () {
var m = this.get_popupElement();
m.style.filter = "";
if ($telerik.isIE7) {
m.style.removeAttribute("filter");
}
m.style.opacity = "";
if (this._enableShadow && $telerik.isIE && !$telerik.isIE6) {
this._setShadowCSSClass(true);
}
this._show();
this._afterShow();
});
b.Animations.playJQueryAnimation(d, f, l, h, k, j, i, e);
}, _onClick: function (d) {
this.show();
return this._cancelEvent(d);
}, _onKeyDown: function (d) {
var f = this._shortCutManager.isShortCutHit(d);
if (!f) {
return;
}
if (this.isActive()) {
this.fire(f.get_name());
}
}, _cancelEvent: function (d) {
if (d) {
d.returnValue = false;
d.cancelBubble = true;
d.preventDefault();
d.stopPropagation();
}
return false;
}, _getWindowController: function () {
return b.RadWindowController.getInstance();
}, _getReloadOnShowUrl: function (e) {
var f = "rwndrnd=" + Math.random();
if (e.indexOf("?") > -1) {
f = "&" + f;
} else {
f = "?" + f;
}
var d = e.indexOf("#");
e = (d > -1) ? e.substr(0, d) + f + e.substr(d) : e + f;
return e;
}, getWindowBounds: function () {
return this._getCalculatedPopupBounds();
}, toString: function () {
return "[RadWindow id=" + this.get_id() + "]";
}, center: function () {
var d = this._getCentralBounds();
this.moveTo(d.x, d.y);
}, moveTo: function (h, i) {
var e = this._popupElement;
if (this.isVisible()) {
this._manageVisibilityFirefox(false);
}
if (e) {
var d = this.ui.getBounds();
var f = this._getRestrictionZoneBounds();
if (f) {
var g = this._checkRestrictionZoneBounds(null, new Sys.UI.Bounds(h + f.x, i + f.y, d.width, d.height));
if (!g) {
return false;
}
}
}
h = parseInt(h);
i = parseInt(i);
this._createUI();
this._setPopupVisible(h, i);
this._storeBounds();
if (this.isVisible()) {
this._manageVisibilityFirefox(true);
}
return true;
}, setSize: function (e, d) {
this._firstShow = false;
this.set_width(e);
this.set_height(d);
this._storeBounds();
}, _calculateBoundsToFit: function (p, f) {
var q = this.get_minWidth() - this._getHandlesWidth();
var o = this._tableElement ? (parseInt(this._tableElement.offsetHeight) - parseInt(this.get_height())) : 0;
var r = this._getTitleElement();
if (r) {
r.style.width = "1px";
}
var d;
var e;
p.style.height = this._renderMode == b.RenderMode.Classic ? "1px" : "";
p.style.width = this._renderMode == b.RenderMode.Classic ? "1px" : "";
if (this._dockMode) {
p.style.position = "absolute";
try {
var m = p.scrollWidth + $telerik.getBorderBox(p).horizontal;
e = m > q ? m : q;
d = p.scrollHeight;
if (this._contentCell) {
Sys.UI.DomElement.addCssClass(this._contentCell, "rwLoading");
}
} finally {
p.style.position = "";
}
} else {
e = f.scrollWidth;
if (e < q) {
p.style.width = q + "px";
e = f.scrollWidth;
}
d = f.scrollHeight;
}
var n = this._getRestrictionZoneBounds();
var s = n ? n : this._getViewportBounds();
var u = this._getHandlesWidth() + e;
var h = this.get_defaultMinHeight() + d;
if (this._enableShadow && $telerik.isIE && !$telerik.isIE6 && this._tableElement) {
if (o > 0) {
h -= o;
}
}
var t = Math.min(u, s.width);
var g = Math.min(h, s.height);
var l = this.get_minWidth();
var k = this.get_minHeight();
var i = parseInt(this.get_maxHeight());
var j = parseInt(this.get_maxWidth());
if (l > t) {
t = l;
}
if (k > g) {
g = k;
}
if (i && i < g) {
g = i;
}
if (j && j < t) {
t = j;
}
return {width: t, height: g, contentPageWidth: e, contentPageHeight: d};
}, _autoSizeBehaviorBounds: function (f, d) {
var g = this._getRestrictionZoneBounds();
var j = g ? g : this._getViewportBounds();
var e = f;
if (g) {
e.y -= g.y;
e.x -= g.x;
}
if (this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.WidthProportional)) {
e.x = this.calcPosition(f.x, f.width, d.width, j.width, false);
e.width = d.width;
} else {
if (this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.Width)) {
e.width = d.width;
}
}
if (this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.HeightProportional)) {
e.y = this.calcPosition(f.y, f.height, d.height, j.height, true);
e.height = d.height;
} else {
if (this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.Height)) {
e.height = d.height;
}
}
var h = 17;
if (e.height < d.contentPageHeight) {
e.width = Math.min(e.width + h, j.width);
}
if (e.width < d.contentPageWidth) {
e.height = Math.min(e.height + h, j.height);
}
if (!g) {
this.set_keepInScreenBounds(true);
} else {
if (e.width == g.width) {
e.x = 0;
}
if (e.height == g.height) {
e.y = 0;
if (this._enableShadow && $telerik.isIE && !$telerik.isIE6 && this._tableElement) {
var i = parseInt(this._tableElement.offsetHeight) - parseInt(this.get_height());
e.height -= i;
}
}
}
return e;
}, autoSize: function (o) {
if (this.isClosed() || this.isMinimized() || this.isMaximized()) {
return;
}
this.setOverflowVisible(true);
this._autoSizeInProgress = !this.get_autoSize();
var f = this.get_contentFrame();
var n = this._getTitleElement();
var k = this.get_popupElement();
var l = $telerik.getBounds(k);
var d = $telerik.getBorderBox(k);
l.width -= d.horizontal;
l.height -= d.vertical;
var g = null;
var i = this.get_keepInScreenBounds();
var m = this.get_contentElement();
if (!this._dockMode) {
try {
g = f.contentWindow.document.documentElement;
if (!g) {
return;
}
} catch (h) {
return false;
}
m = g;
if ($telerik.isIE || $telerik.isFirefox) {
m = f;
}
}
var e = this._calculateBoundsToFit(m, g);
var j = this._autoSizeBehaviorBounds(l, e);
j.width += d.horizontal;
j.height += d.vertical;
this.setOverflowVisible(false);
if (o) {
this._autoSizeWithAnimation(j);
} else {
this._restoreRect = null;
this.setBounds(j);
this.setOverflowVisible(true);
if (this._contentCell) {
Sys.UI.DomElement.removeCssClass(this._contentCell, "rwLoading");
}
this.raiseEvent("autoSizeEnd", new Sys.EventArgs());
}
if ($telerik.isIE && f) {
f.style.overflow = "hidden";
setTimeout(function () {
f.style.overflow = "";
}, 0);
}
this.set_keepInScreenBounds(i);
if (f) {
m.style.width = "100%";
m.style.height = "100%";
if ($telerik.isIE9Mode) {
this.set_height(this.get_height());
}
}
if (n) {
n.style.width = "";
}
return true;
}, _autoSizeWithAnimation: function (f) {
var e = this.get_popupElement();
if (this._enableShadow && $telerik.isIE) {
this._setShadowCSSClass(false);
}
var g = Function.createDelegate(this, function () {
if (this.isClosed()) {
return;
}
var i = this.get_popupElement();
i.style.filter = "";
if ($telerik.isIE7) {
i.style.removeAttribute("filter");
}
i.style.opacity = "";
this._restoreRect = null;
this.setBounds(f);
this.setOverflowVisible(true);
if (this._contentCell) {
Sys.UI.DomElement.removeCssClass(this._contentCell, "rwLoading");
}
if (this._enableShadow && $telerik.isIE && !$telerik.isIE6) {
this._setShadowCSSClass(true);
}
this.raiseEvent("autoSizeEnd", new Sys.EventArgs());
});
if (this._tableElement) {
this._tableElement.style.height = "100%";
}
var d = {width: f.width, height: f.height, x: f.x, y: f.y};
var h = this._getRestrictionZoneBounds();
if (h) {
d.x += h.x;
d.y += h.y;
}
setTimeout(function () {
$telerik.$(e).transition({
width: d.width,
height: d.height,
left: d.x,
top: d.y,
opacity: 1
}, 300, "easeIn", g);
}, 0);
}, setBounds: function (d) {
if (!d) {
return;
}
this._checkRestrictionZoneBounds = function () {
return true;
};
this.moveTo(d.x, d.y);
this.setSize(d.width, d.height);
this._checkRestrictionZoneBounds = b.RadWindow.prototype._checkRestrictionZoneBounds;
}, _substractWrappersBorder: function (f, g) {
var i = this.get_popupElement();
var d = this._contentCell;
if (!i || !d) {
return f;
}
var h = $telerik.getBorderBox(i);
var e = $telerik.getBorderBox(d);
f -= g ? (h.horizontal + e.hrizontal) : (h.vertical + e.vertical);
return f;
}, setWidthDockMode: function (d) {
if (!this._dockMode || !this.get_contentElement()) {
return;
}
this.view.setContentWidth(d);
}, setHeightDockMode: function (e) {
var d = this.get_contentElement();
if (!this._dockMode || !d) {
return;
}
this.setContentFixedHeight(e, d);
}, setContentFixedHeight: function (e, d) {
if (this.isCreated()) {
this.view.setContentFixedHeight(e, d);
}
}, calcPosition: function (h, g, f, j, d) {
var i = h + Math.round((g - f) / 2);
if (i < 0 || i + g > j) {
i = Math.round(Math.abs((j - f) / 2));
if (this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.Default)) {
var e = this._dockMode ? window : this.BrowserWindow;
i += d ? Math.max(e.document.documentElement.scrollTop, e.document.body.scrollTop) : Math.max(e.document.documentElement.scrollLeft, e.document.body.scrollLeft);
}
}
return i;
}, _maintainMaximizedSize: function () {
if (this.isVisible() && this._getRestrictionZoneBounds()) {
this._reSetWindowPosition();
}
if (!this.isMaximized()) {
return;
}
if (this.view) {
this.view.setMaximizeSize();
}
}, _enablePageScrolling: function (f) {
var d = document.body;
var e = document.documentElement;
if (f) {
if (null != this._documentOverflow) {
e.style.overflow = this._documentOverflow;
}
if (null != this._bodyOverflow) {
d.style.overflow = this._bodyOverflow;
}
this._documentOverflow = null;
this._bodyOverflow = null;
} else {
if (null == this._documentOverflow) {
this._documentOverflow = e.style.overflow;
}
if (null == this._bodyOverflow) {
this._bodyOverflow = d.style.overflow;
}
d.style.overflow = "hidden";
e.style.overflow = "hidden";
}
}, _getRestrictionZoneBounds: function () {
var e = null;
if (this.get_restrictionZoneID()) {
var d = $get(this.get_restrictionZoneID());
if (d) {
e = $telerik.getBounds(d);
e.scrollLeft = 0;
e.scrollTop = 0;
}
}
return e;
}, _storeBounds: function () {
if (!this.isCreated()) {
return;
}
var d = this._getCurrentBounds();
if (this.isMaximized()) {
return false;
}
if (this.isMinimized()) {
if (this._restoreRect) {
d.width = this._restoreRect.width;
d.height = this._restoreRect.height;
} else {
d.width = this.get_width();
d.height = this.get_height();
}
}
if (($telerik.isIE9 || $telerik.isIE10) && this._restoreRect && d.x == this.get_leftHidingPoint() && d.y == -10000) {
d.x = this._restoreRect.x;
d.y = this._restoreRect.y;
}
this._restoreRect = d;
}, _restoreBounds: function () {
if (!this._restoreRect) {
return;
}
var d = this._restoreRect;
this.setSize(d.width, d.height);
this.moveTo(d.x, d.y);
}, _getStoredBounds: function () {
if (this._restoreRect) {
return this._restoreRect;
}
}, _deleteStoredBounds: function () {
this._restoreRect = null;
}, _getCurrentBounds: function () {
var d = this.ui.getBounds();
if (this._firstShow != true) {
this._updateWindowSize(this._height);
this._firstShow = true;
}
var e = this._getRestrictionZoneBounds();
if (e) {
d.x -= e.x;
d.y -= e.y;
}
return d;
}, _getCentralBounds: function () {
var d = this._getCurrentBounds();
var e = this._getViewportBounds();
var f = parseInt((e.width - d.width) / 2);
var g = parseInt((e.height - d.height) / 2);
d.x = f + e.scrollLeft;
d.y = g + e.scrollTop;
return d;
}, _getViewportBounds: function () {
var g = this._getRestrictionZoneBounds();
if (g) {
return g;
}
var d = $telerik.getClientBounds();
var e = $telerik.getCorrectScrollLeft(document.documentElement) || $telerik.getCorrectScrollLeft(document.body);
var f = document.documentElement.scrollTop || document.body.scrollTop;
d.scrollLeft = e;
d.scrollTop = f;
if (this.isIE) {
if (d.width == 0) {
d.width = document.body.clientWidth;
}
if (d.height == 0) {
d.height = document.body.clientHeight;
}
}
return d;
}, _getCalculatedPopupBounds: function () {
var h = this._getStoredBounds();
if (h) {
return h;
}
var f = this._getCurrentBounds();
var e = this._offsetElement;
if (this._top == null && this._left == null && !e) {
f = this._getCentralBounds();
} else {
if (e) {
f.y = 0;
f.x = 0;
} else {
var g = this._getViewportBounds();
f.x = g.scrollLeft;
f.y = g.scrollTop;
}
var d = this._left ? this._left : 0;
f.x += d;
var i = this._top ? this._top : 0;
f.y += i;
}
return f;
}, _checkRestrictionZoneBounds: function (f, d) {
var e = f;
if (!e) {
e = this._getRestrictionZoneBounds();
if (!e) {
return true;
}
}
return b.ResizeExtender.containsBounds(e, d);
}, _getTitlebarHeight: function () {
if (!this.ui) {
return 0;
}
return this.ui.getTitlebarHeight();
}, _reSetWindowPosition: function () {
var d = this._getCalculatedPopupBounds();
this._setPopupVisible(d.x, d.y);
}, _fixIeHeight: function (g, e) {
if ("CSS1Compat" == document.compatMode) {
var d = (g.offsetHeight - parseInt(e));
if (d > 0) {
var f = (parseInt(g.style.height) - d);
if (f > 0) {
g.style.height = f + "px";
}
}
}
}, _setPopupVisible: function (d, e) {
var f = this._getRestrictionZoneBounds();
if (f) {
d += f.x;
e += f.y;
}
if (this.isCreated()) {
this.view.moveTo(d, e);
}
}, _createDefaultTable: function () {
var d = document.createElement("table");
d.align = "left";
d.cellSpacing = 0;
d.cellPadding = 0;
d.insertRow(-1);
return d;
}, _isWindowRightToLeft: function () {
var e = this._isRightToLeft;
if (e == null) {
var d = this.get_element();
var f = d.parentNode ? d : this._getDefaultParent();
e = this._isRightToLeft = $telerik.isRightToLeft(f);
}
return e;
}, _createStatusbarResizer: function (d) {
if (this.ui) {
this.ui.createStatusbarResizer();
}
}, _createStatusbarMessageCell: function (f) {
var g = f.rows[0].insertCell(-1);
g.style.width = "100%";
var e = this._getStatusMessageElement();
g.appendChild(e);
var d = document.createElement("label");
d.setAttribute("for", e.id);
d.innerHTML = "status label";
d.style.display = "none";
g.appendChild(d);
}, _createUI: function () {
this.initView();
this.ui.createUI();
}, _getDefaultParent: function () {
var d = this.get_formID() ? document.getElementById(this.get_formID()) : null;
if (!d) {
if (document.forms && document.forms.length > 0) {
d = document.forms[0];
} else {
d = document.body;
}
}
return d;
}, _getStatusMessageElement: function () {
if (this.ui) {
return this.ui.getStatusMessageNode();
}
}, _getTitleCommandButtonsHolder: function () {
if (this.ui) {
return this.ui.getTitleCommandsContainer();
}
}, _getTitleElement: function () {
if (this.ui) {
return this.ui.getTitleNode();
}
}, _getTitleIcon: function () {
if (this.ui) {
return this.ui.getIconNode();
}
}, _getTitleCommandButton: function (d) {
if (this.ui) {
return this.ui.getCommandButton(d);
}
}, getTitleCommandButton: function (d) {
return this._getTitleCommandButton(d);
}, _getHandlesWidth: function () {
if (!this._handlesWidth && this.ui) {
this._handlesWidth = this.ui.getHandlesWidth();
}
return this._handlesWidth;
}, get_defaultMinWidth: function () {
if (this.ui) {
return this.ui.get_uiMinWidth();
}
}, get_defaultMinHeight: function () {
if (this.ui) {
return this.ui.get_uiMinHeight();
}
}, setOverflowVisible: function (f) {
if (!f && this._overflowHidden) {
return;
}
var g = "hidden";
var e = "hidden";
var j = "hidden";
var i;
var d;
if (!this._dockMode) {
try {
var h = this.get_contentFrame();
if (h) {
h.style.overflow = f ? "" : "hidden";
}
i = h.contentWindow.document.documentElement;
if (!i) {
return;
}
d = h.contentWindow.document.body;
if (!f) {
this._oldBodyOverflow = d.style.overflow;
this._oldDocOverflow = i.style.overflow;
this._overflowHidden = true;
}
} catch (k) {
}
}
if (f) {
e = this._oldBodyOverflow;
j = this._oldDocOverflow;
g = "auto";
this._overflowHidden = false;
}
if (this._dockMode) {
this.get_contentElement().style.overflow = g;
} else {
if (i && d) {
if (j || j == "") {
i.style.overflow = j;
}
if (e || e == "") {
d.style.overflow = e;
}
}
}
}, _manageVisibilityFirefox: function (e) {
var d = this._popupBehavior;
if ($telerik.isFirefox && Sys.Browser.version < 4 && d) {
d.set_manageVisibility(e);
}
}, _updateTitleWidth: function () {
if (this.ui) {
this.ui.updateTitleWidth();
}
}, _addWindowToDocument: function () {
this.view.moveToDefaultParent();
}, _createBackReference: function () {
var g = this;
if (!g.Argument) {
g.Argument = {};
}
var f = this._iframe;
try {
f.radWindow = g;
if (f.contentWindow != null) {
f.contentWindow.radWindow = g;
}
} catch (d) {
}
}, _getFullSkinName: function () {
return "RadWindow RadWindow_" + this.get_skin() + " rwNormalWindow rwTransparentWindow";
}, _configureMinimizeButton: function (d) {
var f = (true == d) ? this._getLocalizationString("Restore") : this._getLocalizationString("Minimize");
var e = (true == d) ? this.restore : this._minimize;
var h = this._getTitleCommandButton("Minimize");
if (!(this.isBehaviorEnabled(b.WindowBehaviors.Close)) && h) {
var i = h.parentNode;
var g = this._isWindowRightToLeft() ? "right" : "left";
if (true == d) {
g = (g == "right") ? "left" : "right";
}
i.style.styleFloat = g;
i.style.cssFloat = g;
}
this._registerTitlebarHandlersButton("Minimize", f, e);
}, _configureMaximizeButton: function (d) {
var f = (true == d) ? this._getLocalizationString("Restore") : this._getLocalizationString("Maximize");
var e = (true == d) ? this.restore : this.maximize;
this._registerTitlebarHandlersButton("Maximize", f, e);
}, _registerTitlebarHandlersButton: function (e, f, d) {
if (this.ui) {
this.ui.changeCommandButtonByName(e, f, Function.createDelegate(this, d));
}
}, isCloned: function () {
return this._isCloned;
}, isBehaviorEnabled: function (d) {
return d & this._behaviors ? true : false;
}, isInitialBehaviorEnabled: function (d) {
return d & this.get_initialBehaviors() ? true : false;
}, isAutoSizeBehaviorEnabled: function (d) {
return d & this.get_autoSizeBehaviors() ? true : false;
}, setVisible: function (d) {
if (!this.view) {
this.initView();
}
if (d) {
this.view.show();
} else {
this.view.hide();
}
}, isVisible: function () {
return this._popupVisible;
}, isModal: function () {
return this._modal;
}, isActive: function () {
return this.view && this.view.isActive();
}, isPinned: function () {
var d = this._getTitleCommandButton("Pin");
return (d && Sys.UI.DomElement.containsCssClass(d, "on"));
}, isClosed: function () {
return (!this.isVisible());
}, isMinimized: function () {
return (this._popupElement && Sys.UI.DomElement.containsCssClass(this._popupElement, "rwMinimizedWindow"));
}, isMaximized: function () {
return (this._popupElement && Sys.UI.DomElement.containsCssClass(this._popupElement, "rwMaximizedWindow"));
}, _moveToMinimizeZone: function () {
var d = $get(this.get_minimizeZoneID());
if (d) {
if (this.isPinned()) {
this._isMinimizePinned = true;
this.togglePin();
}
this.view.minimizeToZone(d);
}
}, _moveToDocument: function () {
this.view.revertToDefaultParent();
if (this._isMinimizePinned) {
this._isMinimizePinned = false;
this.togglePin();
}
}, minimize: function () {
this._clearTouchEventIdentifier();
if (this._minimize() !== false) {
this.setActive(true);
}
}, _minimize: function () {
this._clearTouchEventIdentifier();
if (!this.isCreated()) {
return false;
}
var d = this.onCommand("Minimize");
if (!d) {
return false;
}
if (this.isMaximized()) {
this._normalizeWindowRootCss();
this._restoreBounds();
}
if (this.view) {
this.view.minimize();
}
}, restore: function () {
var d = this;
this._clearTouchEventIdentifier();
if (!d.isCreated() || d.isClosed()) {
return;
}
var e = d.onCommand("Restore");
if (!e) {
return;
}
d._configureMinimizeButton();
d._configureMaximizeButton();
if (d.isMinimized() && d.get_minimizeZoneID()) {
d._moveToDocument();
}
d._normalizeWindowRootCss();
d._enablePageScrolling(true);
d._restoreBounds();
d._manageVisibilityFirefox(false);
d.setVisible(true);
if (d._enableShadow && !$telerik.isIE6) {
d._setShadowCSSClass(true);
}
if (d.get_showOnTopWhenMaximized() && d._restoreZindex) {
d._popupElement.style.zIndex = d._restoreZindex;
d._restoreZindex = null;
}
d.setVisible(true);
d.setActive(true);
d._manageVisibilityFirefox(true);
if (this.isVisible()) {
d._show();
}
}, maximize: function () {
this._clearTouchEventIdentifier();
if (!this.isCreated()) {
return;
}
var d = this.onCommand("Maximize");
if (!d) {
return;
}
this._storeBounds();
if (this.isMinimized() && this.get_minimizeZoneID()) {
this._moveToDocument();
}
if (this.isMinimized()) {
this._normalizeWindowRootCss();
this._checkRestrictionZoneBounds = function () {
return true;
};
this._restoreBounds();
this._checkRestrictionZoneBounds = b.RadWindow.prototype._checkRestrictionZoneBounds;
}
this.view.maximize();
if (!this.isActive()) {
this.setActive(true);
}
}, setActive: function (d) {
if (this.isCreated() && this.view) {
this.view.setActive(d);
}
if (d) {
this._getWindowController().set_activeWindow(this);
this.raiseEvent("activate", new Sys.EventArgs());
}
}, togglePin: function () {
this._clearTouchEventIdentifier();
if (!this.isCreated()) {
return;
}
var f = this.onCommand("Pin");
if (!f) {
return;
}
this.setActive(true);
var e = this.isPinned();
var d = e ? this._getLocalizationString("PinOn") : this._getLocalizationString("PinOff");
this.view.toggleCommand("Pin");
this._registerTitlebarHandlersButton("Pin", d, this.togglePin);
b.RadWindowUtils.setPinned(!e, this);
}, reload: function () {
this._clearTouchEventIdentifier();
if (!this.isCreated()) {
return;
}
var f = this.onCommand("Reload");
if (!f) {
return;
}
if (!this._iframe) {
return;
}
this._onWindowUrlChanging();
try {
this._iframe.contentWindow.location.reload();
if (($telerik.isChrome || $telerik.isSafari) && this._iframe.contentWindow.document.domain != document.domain) {
this._onWindowUrlChanged();
}
} catch (d) {
this._onWindowUrlChanged();
}
}, fire: function (d) {
if (d && typeof(this[d]) == "function") {
this[d]();
} else {
var e = this.get_windowManager();
if (!e) {
return;
}
if (d && typeof(e[d]) == "function") {
e[d]();
}
}
}, _normalizeWindowRootCss: function () {
var e = this._popupElement;
if (e) {
$telerik.removeCssClasses(e, ["rwMinimizedWindow", "rwMaximizedWindow", "rwMinimizedWindowShadow"]);
Sys.UI.DomElement.addCssClass(e, "rwNormalWindow");
var d = e._hideWindowedElementsIFrame;
if (d) {
Sys.UI.DomElement.removeCssClass(d, "rwMinimizedWindowOverlay");
}
}
this._updateTitleWidth();
}, close: function (e) {
if (this.isClosed()) {
return;
}
var f = new Sys.CancelEventArgs();
var g = (typeof(e) != "undefined" && !(e instanceof Sys.UI.DomEvent)) ? e : null;
f._argument = g;
f.get_argument = function () {
return this._argument;
};
this.raiseEvent("beforeClose", f);
if (f.get_cancel()) {
return;
}
if ($telerik.isIE9Mode && this.isMaximized() && this.get_destroyOnClose()) {
this._callHideWithTimeOut();
} else {
this.hide();
}
var d = new Sys.EventArgs();
d._argument = g;
d.get_argument = function () {
return this._argument;
};
this.raiseEvent("close", d);
this._enablePageScrolling(true);
this._normalizeWindowRootCss();
if (e instanceof Sys.UI.DomEvent) {
e = null;
}
this._invokeDialogCallBackFunction(e);
if (this.get_destroyOnClose() && !this._dockMode) {
this.dispose();
}
}, _callHideWithTimeOut: function () {
window.setTimeout(Function.createDelegate(this, this.hide), 0);
}, _invokeDialogCallBackFunction: function (d) {
var e = this.get_clientCallBackFunction();
if (e) {
if ("string" == typeof(e)) {
e = eval(e);
}
if ("function" == typeof(e)) {
e(this, d);
}
}
}, onCommand: function (e) {
var d = new Sys.CancelEventArgs();
d._commandName = e;
d.get_commandName = function () {
return this._commandName;
};
this.raise_command(d);
if (d.get_cancel()) {
return false;
}
return true;
}, setUrl: function (e) {
if (this._dockMode) {
return;
}
this._createUI();
this.set_navigateUrl(e);
var d = e;
if (this.get_reloadOnShow()) {
d = this._getReloadOnShowUrl(d);
}
this.view.setUrl(d);
if (!this._loaded) {
this._registerIframeLoadHandler(true);
}
this._loaded = true;
}, _registerChildPageHandlers: function (d) {
var f = null;
try {
f = this._iframe.contentWindow.document;
if (f.domain != document.domain) {
return;
}
} catch (g) {
return;
}
if (null == f) {
return;
}
if (d) {
this._onChildPageUnloadDelegate = Function.createDelegate(this, this._onChildPageUnload);
this._iframe.contentWindow.onunload = this._onChildPageUnloadDelegate;
this._onChildPageClickDelegate = Function.createDelegate(this, this._onChildPageClick);
$telerik.addExternalHandler(f, "click", this._onChildPageClickDelegate);
} else {
if (this._onChildPageClickDelegate) {
$telerik.removeExternalHandler(f, "click", this._onChildPageClickDelegate);
this._onChildPageClickDelegate = null;
}
}
}, _onChildPageUnload: function (d) {
this._registerChildPageHandlers(false);
if (this._removeFromDOM && !$telerik.isChrome && !$telerik.isSafari) {
this._removeFromDOM = false;
var f = this._popupElement;
if (f && f.parentNode) {
f.parentNode.removeChild(f);
}
}
}, _onChildPageClick: function (d) {
if (!this.isVisible() || this.isClosed()) {
return;
}
var f = d.target ? d.target : d.srcElement;
if (f) {
if (f.tagName == "INPUT" && f.type == "button") {
return;
} else {
if (f.tagName == "BUTTON" || f.tagName == "A") {
return;
}
}
}
this.setActive(true);
}, _onIframeLoad: function () {
this._onWindowUrlChanged();
if ($telerik.isFirefox) {
this.setOverflowVisible(true);
}
this._registerChildPageHandlers(true);
this.raiseEvent("pageLoad", new Sys.EventArgs());
if (this.get_autoSize()) {
var f = this.get_animation() != b.WindowAnimation.None;
this.autoSize(f);
}
var e = null;
try {
e = this._iframe.contentWindow;
e.close = Function.createDelegate(this, function () {
this.close();
});
} catch (d) {
return false;
}
}, _onWindowUrlChanging: function () {
if (this.isCreated()) {
this.view.onUrlChanging();
}
}, _onWindowUrlChanged: function () {
if (this.isCreated()) {
this.view.onUrlChanged();
}
}, _updatePopupZindex: function () {
if (this._popupBehavior) {
if (this.isVisible()) {
this._popupBehavior.show();
}
}
}, _updateOpacity: function () {
var d = this._dockMode ? this.get_contentElement() : this.get_contentFrame();
if (d) {
if (this._opacity < 100) {
if (this._contentCell) {
this._contentCell.style.background = "none transparent";
}
var e = d.style;
e.filter = "alpha(opacity=" + this._opacity + ")";
e.opacity = (this._opacity / 100);
} else {
if (this._contentCell) {
this._contentCell.style.background = "";
}
if ($telerik.isIE) {
if (this._contentCell) {
this._contentCell.removeAttribute("style");
}
d.style.removeAttribute("filter");
d.style.removeAttribute("opacity");
} else {
d.style.filter = "";
d.style.opacity = "";
}
}
}
}, get_zindex: function () {
return this.ui ? this.ui.get_zIndexCss() : -1;
}, get_browserWindow: function () {
return this._browserWindow;
}, get_contentFrame: function () {
return this._iframe;
}, get_offsetElementID: function () {
return this._offsetElementID;
}, set_offsetElementID: function (d) {
if (this._offsetElementID != d) {
this._offsetElementID = d;
this._offsetElement = $get(d);
this._deleteStoredBounds();
this._offsetSet = false;
}
if (this.isVisible()) {
this._show();
}
}, get_openerElementID: function () {
return this._openerElementID;
}, set_openerElementID: function (d) {
if (this._openerElementID != d) {
if (this._openerElement) {
this._registerOpenerElementHandler(this._openerElement, false);
this._openerElement = null;
}
this._openerElementID = d;
if (this._openerElementID) {
this._openerElement = $get(this._openerElementID);
}
if (this._openerElement) {
this._registerOpenerElementHandler(this._openerElement, true);
}
}
}, get_left: function () {
return this._left;
}, set_left: function (d) {
if (this._left != d) {
this._left = parseInt(d) || parseInt(d) == 0 ? parseInt(d) : null;
}
}, get_top: function () {
return this._top;
}, set_top: function (d) {
if (this._top != d) {
this._top = parseInt(d) || parseInt(d) == 0 ? parseInt(d) : null;
}
}, get_stylezindex: function () {
if (this.ui) {
return this.ui.get_initialZIndexCss();
}
}, get_title: function () {
return this._title;
}, set_title: function (d) {
if (this._title != d) {
this._title = d;
}
if (this.isCreated()) {
this.view.setTitleText(this._title);
}
}, get_width: function () {
return parseInt(this._width);
}, _fixSizeValue: function (d) {
d = "" + d;
if (-1 == d.indexOf("px")) {
d = parseInt(d);
if (!isNaN(d)) {
d = d + "px";
} else {
d = "";
}
}
return d;
}, set_width: function (i) {
if (null == i) {
return false;
}
if (this.isMaximized()) {
return false;
}
var f = this.get_minWidth();
if (f && f > i) {
i = f;
}
var e = parseInt(this.get_maxWidth());
if (e && e < i && e > f) {
i = e;
}
if (this.isVisible()) {
this._manageVisibilityFirefox(false);
}
i = this._fixSizeValue(i);
if (this.isCreated()) {
var g = this.ui.getBounds();
var d = parseInt(i);
if (isNaN(d)) {
d = g.width;
}
var h = this._checkRestrictionZoneBounds(null, new Sys.UI.Bounds(g.x, g.y, d, g.height));
if (!h) {
return false;
}
}
if (this._width != i) {
this._width = i;
}
if (this._dockMode) {
this.setWidthDockMode(this.get_width());
}
if (this.isCreated()) {
if (!this.popupElementIsOutOfView()) {
this._deleteStoredBounds();
}
this.view.setWidth(this._width);
}
this._updateTitleWidth();
this._manageVisibilityFirefox(true);
return true;
}, popupElementIsOutOfView: function () {
return !!this.view && this.view.isOutOfSight();
}, get_minWidth: function () {
var e = parseInt(this._minWidth);
if (!this.isCreated()) {
return e;
}
var d = this.get_defaultMinWidth();
return (e && (e > d)) ? e : d;
}, set_minWidth: function (d) {
if (this._minWidth != d) {
this._minWidth = d;
}
}, get_minHeight: function () {
var e = parseInt(this._minHeight);
if (!this.isCreated()) {
return e;
}
var d = this.get_defaultMinHeight();
return (e && (e > d)) ? e : d;
}, set_minHeight: function (d) {
if (this._minHeight != d) {
this._minHeight = d;
}
}, get_height: function () {
return parseInt(this._height);
}, set_height: function (i) {
if (null == i) {
return false;
}
if (this.isMaximized()) {
return false;
}
var f = this.get_minHeight();
if (f && f > i && (!e || (e && e >= f))) {
i = f;
}
var e = parseInt(this.get_maxHeight());
if (e && e < i) {
i = e;
}
if (this.isVisible()) {
this._manageVisibilityFirefox(false);
}
i = this._fixSizeValue(i);
if (this.isCreated()) {
this._firstShow = false;
var d = this.get_contentElement();
if (this._dockMode && d) {
d.style.height = "";
}
var g = this.ui.getBounds();
var h = this._checkRestrictionZoneBounds(null, new Sys.UI.Bounds(g.x, g.y, g.width, parseInt(i)));
if (!h) {
return false;
}
}
if (this._height != i) {
this._height = i;
}
if (this._dockMode) {
this.setHeightDockMode(this.get_height());
}
if (this.isCreated()) {
if (!this.popupElementIsOutOfView()) {
this._deleteStoredBounds();
}
this.view.setHeight(this._height);
this.view.updatePopupZindex();
}
this._manageVisibilityFirefox(true);
if (this._isiOS5Safari) {
this.setContentFixedHeight(this.get_height(), this._iframeWrapper);
}
return true;
}, _updateWindowSize: function (d, e) {
if (this.view) {
this.view.setHeight(d, e);
}
}, get_behaviors: function () {
return this._behaviors;
}, set_behaviors: function (j) {
if (this._behaviors != j) {
this._behaviors = j;
}
if (null == this._titlebarElement) {
return;
}
this._enableMoveResize(false);
this._enableMoveResize(true);
var e = b.WindowBehaviors;
var d = [[this.isBehaviorEnabled(e.Pin), "rwPinButton", this._getLocalizationString("PinOn"), Function.createDelegate(this, this.togglePin)], [this.isBehaviorEnabled(e.Reload), "rwReloadButton", this._getLocalizationString("Reload"), Function.createDelegate(this, this.reload)], [this.isBehaviorEnabled(e.Minimize), "rwMinimizeButton", this._getLocalizationString("Minimize"), Function.createDelegate(this, this._minimize)], [this.isBehaviorEnabled(e.Maximize), "rwMaximizeButton", this._getLocalizationString("Maximize"), Function.createDelegate(this, this.maximize)], [this.isBehaviorEnabled(e.Close), "rwCloseButton", this._getLocalizationString("Close"), Function.createDelegate(this, this.close)]];
var g = [];
for (var h = 0;
h < d.length;
h++) {
var f = d[h];
if (f[0]) {
g.push(f.splice(1, 3));
}
}
if (this.view) {
this._buttonsArray = this.view.setCommandButtons(g);
}
}, addShortcut: function (d, e) {
if (this._shortCutManager) {
this._shortCutManager.addShortCut(d.toLowerCase(), e);
} else {
if (!this.get_shortcuts()) {
this._shortcuts = "[['" + d.toLowerCase() + "', '" + e + "']]";
}
this._registerGlobalBodyEventHandlers(true);
}
}, removeShortcut: function (d) {
if (this._shortCutManager) {
this._shortCutManager.removeShortCut(d.toLowerCase());
}
}, getShortcutString: function (e) {
if (!this._shortCutManager) {
return null;
}
var d = this._shortCutManager.findShortCutByName(e.toLowerCase());
return (d && d.get_shortCutString()) ? d.get_shortCutString() : null;
}, isShortcutAdded: function (d) {
return this.getShortcutString(d.toLowerCase()) ? true : false;
}, removeAllShortcutsCommand: function (d) {
while (this.isShortcutAdded(d)) {
this.removeShortcut(d.toLowerCase());
}
}, get_modal: function () {
return this._modal;
}, set_modal: function (d) {
if (this._modal != d) {
this._modal = d;
}
this._makeModal(this._modal);
if (this.isVisible()) {
this._afterShow();
}
}, get_visibleTitlebar: function () {
return this._visibleTitlebar;
}, set_visibleTitlebar: function (e) {
if (this._visibleTitlebar != e) {
this._visibleTitlebar = e;
}
var d = this.get_popupElement();
if (d) {
e ? Sys.UI.DomElement.removeCssClass(d, "rwNoTitleBar") : Sys.UI.DomElement.addCssClass(d, "rwNoTitleBar");
}
if (this.ui && this.ui.titlebar) {
this.ui.titlebar.style.display = e ? "" : "none";
if (this.get_enableAriaSupport()) {
this.ui.titlebar.setAttribute("aria-hidden", !e);
}
}
}, get_visibleStatusbar: function () {
return this._visibleStatusbar;
}, set_visibleStatusbar: function (d) {
if (this._visibleStatusbar != d) {
this._visibleStatusbar = d;
}
if (this._statusCell) {
this._statusCell.parentNode.style.display = d ? "" : "none";
if (this.get_enableAriaSupport()) {
this._statusCell.parentNode.setAttribute("aria-hidden", !d);
}
}
}, get_overlay: function () {
return this._overlay;
}, set_overlay: function (d) {
this._overlay = d;
if (this._popupBehavior) {
this._popupBehavior.set_overlay(this._overlay);
}
if (this.isVisible()) {
this._reSetWindowPosition();
}
}, get_opacity: function () {
return this._opacity;
}, set_opacity: function (d) {
if (this.get_opacity() != d) {
this._opacity = d > 100 ? 100 : d;
this._opacity = d < 0 ? 0 : d;
if (this.isCreated()) {
this._updateOpacity();
}
}
}, get_iconUrl: function () {
return this._iconUrl;
}, set_iconUrl: function (d) {
this._iconUrl = d;
if (this._titleIconElement) {
if (this.get_iconUrl() == "") {
this._titleIconElement.className = "rwIcon";
} else {
this._titleIconElement.style.background = "transparent url('" + d + "') no-repeat scroll 0px 0px";
}
}
}, get_renderMode: function () {
return this._renderMode;
}, set_renderMode: function (d) {
this._renderMode = d;
}, get_keepInScreenBounds: function () {
return this._keepInScreenBounds;
}, set_keepInScreenBounds: function (d) {
this._keepInScreenBounds = d;
if (this._popupBehavior) {
this._popupBehavior.set_keepInScreenBounds(this._keepInScreenBounds);
}
if (this.isVisible()) {
this._reSetWindowPosition();
}
}, get_popupElement: function () {
return this._popupElement;
}, set_status: function (e) {
var d = this._getStatusMessageElement();
if (d) {
window.setTimeout(function () {
d.value = e;
}, 0);
}
}, get_status: function () {
var d = this._getStatusMessageElement();
if (d) {
return d.value;
}
}, raise_command: function (d) {
this.raiseEvent("command", d);
}, add_resize: function (d) {
this.get_events().addHandler("resizeEnd", d);
}, remove_resize: function (d) {
this.get_events().removeHandler("resizeEnd", d);
}, saveClientState: function () {
var e = ["position"];
var f = {};
for (var d = 0;
d < e.length;
d++) {
f[e[d]] = this["get_" + e[d]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(f);
}, _applyAriaForLayoutTables: function () {
var f = this._tableElement;
if (f) {
f.setAttribute("role", "presentation");
var n = f.getElementsByTagName("tr");
for (var d = 0;
d < n.length;
d++) {
var m = n[d];
m.setAttribute("role", "presentation");
var k = m.getElementsByTagName("td");
for (var e = 0;
e < k.length;
e++) {
k[e].setAttribute("role", "presentation");
}
}
}
var l = this.ui.titlebar;
if (l) {
l.setAttribute("role", "presentation");
}
var g = this._statusCell;
if (g) {
var h = g.getElementsByTagName("table")[0];
if (h) {
h.setAttribute("role", "presentation");
}
}
}, _applyAriaSupport: function () {
this._applyAriaForLayoutTables();
var d = this.get_popupElement();
d.setAttribute("aria-hidden", "true");
d.setAttribute("aria-labelledby", this._getTitleElement().id);
if (this._isPredefined) {
d.setAttribute("role", "alertdialog");
d.setAttribute("aria-describedby", this.get_id() + "_content");
} else {
d.setAttribute("role", "dialog");
}
}, _clearTouchEventIdentifier: function () {
var e = this, d = e._resizeExtender;
if (d && d._touchEventIdentifier) {
d._touchEventIdentifier = null;
}
}
};
a.registerControlProperties(b.RadWindow, {
minimizeZoneID: null,
restrictionZoneID: "",
minimizeIconUrl: null,
clientCallBackFunction: null,
navigateUrl: null,
localization: null,
shortcuts: null,
initialBehaviors: b.WindowBehaviors.None,
destroyOnClose: false,
reloadOnShow: false,
showContentDuringLoad: true,
visibleOnPageLoad: false,
showOnTopWhenMaximized: true,
animation: b.WindowAnimation.None,
animationDuration: 500,
autoSize: false,
autoSizeBehaviors: b.WindowAutoSizeBehaviors.Default,
windowManager: null,
cssClass: "",
name: null,
skin: "Deafult",
formID: null,
enableShadow: false,
enableAriaSupport: false,
maxWidth: null,
maxHeight: null,
centerIfModal: true
});
a.registerControlEvents(b.RadWindow, ["command", "dragStart", "dragEnd", "activate", "beforeShow", "show", "pageLoad", "close", "beforeClose", "resizeStart", "resizeEnd", "autoSizeEnd"]);
b.RadWindow.registerClass("Telerik.Web.UI.RadWindow", b.RadWebControl);
b.RadWindowUtils._zIndex = 3000;
b.RadWindowUtils.get_newZindex = function (d) {
d = parseInt(d);
if (null == d || isNaN(d)) {
d = 0;
}
if (b.RadWindowUtils._zIndex < d) {
b.RadWindowUtils._zIndex = d;
}
b.RadWindowUtils._zIndex++;
return b.RadWindowUtils._zIndex;
};
b.RadWindowUtils._pinnedList = {};
b.RadWindowUtils.setPinned = function (j, h) {
if (j) {
var i = h._getViewportBounds();
var k = h._getCurrentBounds();
h.LeftOffset = k.x - i.scrollLeft;
h.TopOffset = k.y - i.scrollTop;
var e = window.setInterval(function () {
b.RadWindowUtils._updatePinnedElementPosition(h);
}, 100);
b.RadWindowUtils._pinnedList[e] = h;
} else {
var d = null;
var g = b.RadWindowUtils._pinnedList;
for (var f in g) {
if (g[f] == h) {
d = f;
break;
}
}
if (null != d) {
window.clearInterval(d);
b.RadWindowUtils._pinnedList[d] = null;
}
h.TopOffset = null;
h.LeftOffset = null;
}
};
b.RadWindowUtils._updatePinnedElementPosition = function (e) {
if (e.isMaximized() || !e.isVisible()) {
return;
}
var f = e._getViewportBounds();
var h = e._getCurrentBounds();
var d = (e.LeftOffset != null) ? e.LeftOffset + f.scrollLeft : h.x;
var g = (e.TopOffset != null) ? e.TopOffset + f.scrollTop : h.y;
if (h.x != d || h.y != g) {
e.moveTo(d, g);
}
};
})($telerik.$, Telerik.Web.UI);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.IRenderer = function () {
};
b.IRenderer.prototype = {
createUI: function () {
}, setContent: function (d) {
}, get_container: function () {
}, getHandlesWidth: function () {
}, setShadowCssClass: function (d) {
}, getBounds: function () {
}, updateTitleWidth: function () {
}, getTitleNode: function () {
}, createTitle: function () {
}, getIconNode: function () {
}, createIcon: function () {
}, getTitleCommandsContainer: function () {
}, createTitleCommandsContainer: function () {
}, getStatusMessageNode: function () {
}, createStatusMessage: function () {
}, createStatusbarResizer: function () {
}, getCommandButton: function () {
}, createCommandButton: function (d) {
}, changeCommandButton: function (d, f, e) {
}, changeCommandButtonByName: function (e, f, d) {
}, clearCommandButtons: function () {
}, geTitlebarHeight: function () {
}, get_zIndexCss: function () {
}, get_initialZIndexCss: function () {
}, get_uiMinWidth: function () {
}, get_uiMinHeight: function () {
}, dispose: function () {
}
};
b.IRenderer.registerInterface("Telerik.Web.UI.Window.IRenderer");
b.RendererBase = function (d) {
this.window = d;
};
b.RendererBase.prototype = {};
b.RendererBase.registerClass("Telerik.Web.UI.Window.RendererBase", null, b.IRenderer);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.IView = function () {
};
b.IView.prototype = {
moveTo: function (d, e) {
}, setContent: function (d) {
}, setUrl: function (d) {
}, show: function () {
}, hide: function () {
}, isVisible: function () {
}, maximize: function () {
}, minimize: function () {
}, setWidth: function (d) {
}, setHeight: function () {
}, setMaximizeSize: function () {
}, setContentFixedHeight: function () {
}, setContentWidth: function (d) {
}, setTitleText: function (d) {
}, showShadow: function () {
}, hideShadow: function () {
}, moveOutOfSight: function () {
}, isOutOfSight: function () {
}, enableMoveResize: function (d) {
}, disableMoveResize: function (d) {
}, setCommandButtons: function (d) {
}, toggleCommand: function (d) {
}, minimizeToZone: function (d) {
}, moveToDefaultParent: function () {
}, revertToDefaultParent: function () {
}, setActive: function (d) {
}, isActive: function () {
}, onUrlChanging: function () {
}, onUrlChanged: function () {
}, updatePopupZindex: function () {
}, dispose: function () {
}
};
b.IView.registerInterface("Telerik.Web.UI.Window.IView");
b.ViewBase = function (d) {
this.window = d;
};
b.ViewBase.prototype = {};
b.ViewBase.registerClass("Telerik.Web.UI.Window.ViewBase", null, b.IView);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.ClassicRenderer = function (d) {
b.ClassicRenderer.initializeBase(this, [d]);
this.container = this.table = this.titleCell = this.titlebar = this.topResizer = this.commandsContainer = this.title = this.icon = this.statusMessage = this.contentFrame = this.content = this.contentCell = this.bottomResizer = this.statusCell = null;
};
b.ClassicRenderer.prototype = {
createUI: function () {
if (!this.container) {
var E = this.window.get_id();
var F = "RadWindowWrapper_" + E;
var q = this.window._isWindowRightToLeft();
var t = document.createElement("div");
t.id = F;
t.className = this.window._getFullSkinName();
var l = this.window.get_cssClass();
if (l) {
Sys.UI.DomElement.addCssClass(t, l);
}
if (q) {
Sys.UI.DomElement.addCssClass(t, "RadWindow_rtl");
}
if (!this.window._visibleTitlebar) {
Sys.UI.DomElement.addCssClass(t, "rwNoTitleBar");
}
t.style.width = this.window._width;
t.style.height = this.window._height;
t.setAttribute("unselectable", "on");
this.container = this.window._popupElement = t;
var x = document.createElement("table");
x.cellSpacing = 0;
x.cellPadding = 0;
Sys.UI.DomElement.addCssClass(x, "rwTable");
this.table = this.window._tableElement = x;
var f = [];
if (q) {
f = ["rwCorner rwTopRight", "rwTitlebar", "rwCorner rwTopLeft", "rwCorner rwBodyRight", "rwWindowContent", "rwCorner rwBodyLeft", "rwCorner rwBodyRight", "rwStatusbar", "rwCorner rwBodyLeft", "rwCorner rwFooterRight", "rwFooterCenter", "rwCorner rwFooterLeft"];
} else {
f = ["rwCorner rwTopLeft", "rwTitlebar", "rwCorner rwTopRight", "rwCorner rwBodyLeft", "rwWindowContent", "rwCorner rwBodyRight", "rwCorner rwBodyLeft", "rwStatusbar", "rwCorner rwBodyRight", "rwCorner rwFooterLeft", "rwFooterCenter", "rwCorner rwFooterRight"];
}
var v = ["rwTitleRow", "rwContentRow", "rwStatusbarRow", "rwFooterRow"];
var p = 0;
for (var m = 0;
m < 4;
m++) {
var u = x.insertRow(-1);
u.className = v[m];
for (var r = 1;
r <= 3;
r++) {
var d = u.insertCell(-1);
d.innerHTML = " ";
d.className = f[p];
p++;
}
}
var A = x.rows[0].cells[1];
A.innerHTML = "";
this.titleCell = this.window._titleCell = A;
var C = document.createElement("div");
C.className = "rwTopResize";
C.innerHTML = "<!-- / -->";
this.topResizer = this.window._topResizer = C;
this.titleCell.appendChild(this.window._topResizer);
var y = this.window._createDefaultTable();
y.className = "rwTitlebarControls";
this.titlebar = this.window._titlebarElement = y;
this.titleCell.appendChild(this.titlebar);
var D = this.getIconNode();
var n = this.titlebar.rows[0].insertCell(-1);
n.appendChild(D);
this.window.set_iconUrl(this.window.get_iconUrl());
var B = this.getTitleNode();
var z = this.titlebar.rows[0].insertCell(-1);
z.appendChild(B);
this.window.set_title(this.window._title);
var g = this.titlebar.rows[0].insertCell(-1);
g.noWrap = true;
g.style.whiteSpace = "nowrap";
g.appendChild(this.window._getTitleCommandButtonsHolder());
var h = x.rows[1].cells[1];
h.vAlign = "top";
h.innerHTML = "";
this.contentCell = this.window._contentCell = h;
if (!(this.window._dockMode || this.window._isPredefined)) {
Sys.UI.DomElement.addCssClass(this.contentCell, "rwExternalContent");
}
if (this.window._enableShadow && !$telerik.isIE6) {
this.window._setShadowCSSClass(true);
}
var s = this.window.get_name();
var w = this.window._createDefaultTable();
w.style.width = "100%";
this.statusCell = this.window._statusCell = x.rows[2].cells[1];
this.statusCell.innerHTML = "";
this.statusCell.appendChild(w);
if (!q) {
this.window._createStatusbarMessageCell(w);
}
if (this.window.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)) {
this.createStatusbarResizer(w);
}
if (q) {
this.window._createStatusbarMessageCell(w);
}
this.container.appendChild(this.window._tableElement);
this.container.style.display = "none";
this.container.style.position = "absolute";
this.window._addWindowToDocument();
this.window._registerTitlebarHandlers(true);
this.window.set_visibleTitlebar(this.window._visibleTitlebar);
this.window.set_visibleStatusbar(this.window._visibleStatusbar);
if (this.window.get_enableAriaSupport()) {
this.window._applyAriaSupport();
}
if (this.window._dockMode) {
var k = this.content = $get(this.window.get_id() + "_C");
if (k && k.innerHTML) {
k.style.display = "";
k.style.overflow = "auto";
k.style.border = "0px";
this.window.set_contentElement(k);
this.window.setWidthDockMode(this.window.get_width());
this.window.setHeightDockMode(this.window.get_height());
}
} else {
var e = ($telerik.isIE && !$telerik.isIE9Mode) ? document.createElement("<iframe name='" + s + "'>") : document.createElement("iframe");
e.name = s;
e.src = "javascript:'<html></html>';";
e.style.width = "100%";
e.style.height = "100%";
e.style.border = "0px";
e.frameBorder = "0";
if ($telerik.isIE8) {
e.style.display = "block";
}
this.contentFrame = this.window._iframe = e;
if (($telerik.isMobileSafari || this.window._isiPhoneiPadAppleWebkit) && !this.window._isPredefined) {
var o = document.createElement("div");
a(o).addClass("rwIframeWrapperIOS");
o.appendChild(this.contentFrame);
this.contentCell.appendChild(o);
if (this.window._isiOS5Safari) {
this.window.setContentFixedHeight(this.window.get_height(), o);
}
this.window._iframeWrapper = o;
} else {
this.contentCell.appendChild(this.window._iframe);
}
this.window._createBackReference();
}
this.window._updateOpacity();
}
if (!$telerik.isTouchDevice) {
this.container.style.Transform = "none";
this.container.style.BackfaceVisibility = "visible";
this.container.style.webkitTransform = "none";
this.container.style.webkitBackfaceVisibility = "visible";
this.container.style.OTransform = "none";
this.container.style.OBackfaceVisibility = "visible";
this.container.style.MozTransform = "none";
this.container.style.MozBackfaceVisibility = "visible";
this.container.style.msTransform = "none";
this.container.style.msBackfaceVisibility = "visible";
}
if (!this.window._popupBehavior) {
this.window.set_behaviors(this.window._behaviors);
this.popupBehavior = this.window._popupBehavior = $create(Telerik.Web.PopupBehavior, {
id: (new Date() - 100) + "PopupBehavior",
parentElement: null,
overlay: this.window._overlay,
keepInScreenBounds: this.window._keepInScreenBounds
}, null, null, this.container);
}
}, setContent: function (d) {
this.contentCell.appendChild(d);
d.style.display = "";
this.content = this.window._contentElement = d;
}, get_container: function () {
return this.container;
}, getHandlesWidth: function () {
if (!this._handlesWidth) {
var e = this.table;
if (!e) {
return 0;
}
var d = parseInt($telerik.getCurrentStyle(e.rows[2].cells[0], "width"));
if (!d) {
return 0;
}
this._handlesWidth = 2 * d;
}
return this._handlesWidth;
}, setShadowCssClass: function (d) {
if (d) {
Sys.UI.DomElement.addCssClass(this.container, "rwShadow");
Sys.UI.DomElement.addCssClass(this.table, "rwShadow");
} else {
Sys.UI.DomElement.removeCssClass(this.container, "rwShadow");
Sys.UI.DomElement.removeCssClass(this.table, "rwShadow");
}
}, getBounds: function () {
var e = this.container;
var f = (e.style.display == "none");
e.style.display = "";
var d = $telerik.getBounds(e);
if (f) {
e.style.display = "none";
}
return d;
}, updateTitleWidth: function () {
if (this.window._visibleTitlebar && !this.window.isMinimized()) {
var k = this.getTitleNode();
if (!k) {
return;
}
k.style.width = "1px";
var l = 0;
var e = this.getTitleCommandsContainer();
var d = e.offsetWidth;
if (d > 0) {
var h = e.getElementsByTagName("LI");
if (h.length == 0) {
d = 0;
} else {
if (h[0] && h[0].offsetWidth > 0) {
d = h.length * h[0].offsetWidth;
}
}
e.style.width = d ? d + "px" : "";
l += d;
}
var f = this.getIconNode();
var g = f.offsetWidth;
if (g > 0 && f.parentNode.tagName == "TD") {
f.parentNode.style.width = g + "px";
l += g;
}
l += this.getHandlesWidth();
var i = 0;
var j = this.titlebar;
i = j ? j.offsetWidth - l : l;
if (i > 0) {
k.style.width = i + "px";
}
}
}, getTitleNode: function () {
if (!this.title) {
this.createTitle();
}
return this.title;
}, createTitle: function () {
var d = document.createElement("em");
d.setAttribute("unselectable", "on");
if (this.window.get_enableAriaSupport()) {
d.id = this.window.get_id() + "_title";
d.setAttribute("role", "label");
}
return this.title = this.window._titleElement = d;
}, getIconNode: function () {
if (!this.icon) {
this.createIcon();
}
return this.icon;
}, createIcon: function () {
var d = document.createElement("a");
d.className = "rwIcon";
$addHandler(d, "mousedown", this.window._cancelEvent);
this.icon = this.window._titleIconElement = d;
}, getTitleCommandsContainer: function () {
if (!this.commandsContainer) {
this.createTitleCommandsContainer();
}
return this.commandsContainer;
}, createTitleCommandsContainer: function () {
var d = document.createElement("ul");
d.className = "rwControlButtons";
if (this.window.get_enableAriaSupport()) {
d.setAttribute("role", "presentation");
}
this.commandsContainer = this.window._buttonsElement = d;
}, getStatusMessageNode: function () {
if (!this.statusMessage) {
this.createStatusMessage();
}
return this.statusMessage;
}, createStatusMessage: function () {
var d = document.createElement("input");
d.id = this.window.get_id() + "_status";
d.readOnly = "readonly";
d.setAttribute("unselectable", "on");
d.setAttribute("tabindex", "-1");
this.statusMessage = this.window._statusMessageElement = d;
}, createStatusbarResizer: function () {
if (this.bottomResizer) {
return;
}
var d = this.statusCell.firstChild.rows[0].insertCell(-1);
d.style.width = "15px";
var e = document.createElement("div");
d.appendChild(e);
this.bottomResizer = this.window._bottomResizer = e;
}, getCommandButton: function (d) {
if (!d || !this.commandsContainer) {
return null;
}
var e = d.toLowerCase();
e = e.charAt(0).toUpperCase() + e.substring(1);
d = "rw" + e + "Button";
return a("." + d, this.commandsContainer)[0];
}, createCommandButton: function (d) {
var f = document.createElement("li");
var e = document.createElement("a");
e.href = "javascript:void(0);";
e.className = d[0];
e.setAttribute("title", d[1]);
if (this.window.get_enableAriaSupport()) {
f.setAttribute("role", "presentation");
e.setAttribute("role", "button");
}
var g = document.createElement("span");
g.innerHTML = d[1];
e.appendChild(g);
$telerik.addHandler(e, "click", d[2]);
$addHandlers(e, {dblclick: this._cancelEvent, mousedown: this._cancelEvent}, this);
$telerik.addHandler(e, "click", this._cancelEvent);
f.appendChild(e);
this.commandsContainer.appendChild(f);
return e;
}, changeCommandButton: function (d, f, e) {
if (!d) {
return;
}
d.setAttribute("title", f);
d.innerHTML = f;
$telerik.clearHandlers(d);
$telerik.addHandler(d, "click", e);
$addHandlers(d, {dblclick: this._cancelEvent, mousedown: this._cancelEvent}, this);
}, changeCommandButtonByName: function (e, g, f) {
var d = this.getCommandButton(e);
if (d) {
this.changeCommandButton(d, g, f);
}
}, clearCommandButtons: function () {
var e = a(this.commandsContainer);
var d = e.find("a[class$='Button']");
for (var f = 0;
f < d.length;
f++) {
this.clearCommandButton(d[f]);
}
e.empty();
}, clearCommandButton: function (d) {
$clearHandlers(d);
}, getTitlebarHeight: function () {
if (!this.table) {
return 0;
}
return this.table.rows[0].offsetHeight;
}, get_zIndexCss: function () {
return this.container ? this.container.style.zIndex : -1;
}, get_initialZIndexCss: function () {
var d = this.window.get_element();
return d ? parseInt(d.style.zIndex || $telerik.getComputedStyle(d, "zIndex")) : null;
}, get_uiMinWidth: function () {
if (!this._defaultMinWidth) {
var d = this.getHandlesWidth();
this._defaultMinWidth = d;
if (this.window._visibleTitlebar) {
var f = this.table;
var h = this.title;
var e = h.style.width;
if (h) {
h.style.width = "1px";
}
if (this.content) {
this.content.style.width = "1px";
}
f.style.width = "1px";
var g = this.titleCell.offsetWidth;
h.style.width = e;
f.style.width = "";
if (this.content) {
this.content.style.width = "";
}
this._defaultMinWidth += g;
}
}
return this._defaultMinWidth;
}, get_uiMinHeight: function () {
if (!this._defaultMinHeight) {
var d = Math.ceil(this.getHandlesWidth() / 2);
this._defaultMinHeight = d;
this._defaultMinHeight += this.window._visibleTitlebar ? this.titleCell.offsetHeight : d;
this._defaultMinHeight += this.window._visibleStatusbar ? this.statusCell.offsetHeight : 0;
}
return this._defaultMinHeight;
}, dispose: function () {
this.container = this.table = this.titleCell = this.titlebar = this.topResizer = this.commandsContainer = this.title = this.icon = this.statusMessage = this.contentFrame = this.content = this.contentCell = this.bottomResizer = this.statusCell = null;
}, _cancelEvent: function (d) {
var f = this;
if (f.window) {
f.window._clearTouchEventIdentifier();
}
return $telerik.cancelRawEvent(d);
}
};
b.ClassicRenderer.registerClass("Telerik.Web.UI.Window.ClassicRenderer", b.RendererBase, b.IRenderer);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.ClassicView = function (d) {
b.ClassicView.initializeBase(this, [d]);
this.ui = this.window.ui;
};
b.ClassicView.prototype = {
moveTo: function (d, e) {
this.ui.popupBehavior._setCoordinates(d, e);
this.ui.popupBehavior.show();
this._removeExplicitMSAjaxWidth();
this.ui.updateTitleWidth();
}, show: function () {
if (this.ui.popupBehavior) {
this.ui.popupBehavior.show();
}
this._isViewVisible = true;
}, hide: function () {
if (this.ui.popupBehavior) {
this.ui.popupBehavior.hide();
}
this._isViewVisible = false;
this._ariaHide();
}, isVisible: function () {
return this._isViewVisible;
}, setContent: function (e) {
var d = this.ui.content;
if (d && e != d) {
$telerik.disposeElement(d);
d.innerHTML = "";
d.appendChild(e);
e = d;
}
this.ui.createUI();
if (this.ui.contentFrame) {
this.ui.contentFrame.style.display = "none";
} else {
if (!this.window._dropDownTouchScroll && Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender()) {
this.window._createTouchScrollExtender(true);
}
}
this.ui.setContent(e);
}, setUrl: function (e) {
var d = this.ui.contentFrame;
if (!d) {
return;
}
d.src = e;
this.onUrlChanging();
}, maximize: function () {
this.ui.setShadowCssClass(false);
var d = this.ui.container;
$telerik.removeCssClasses(d, ["rwNormalWindow", "rwMinimizedWindow", "rwMinimizedWindowShadow"]);
Sys.UI.DomElement.addCssClass(d, "rwMaximizedWindow");
this.window._configureMaximizeButton(true);
this.window._configureMinimizeButton();
this.window._maintainMaximizedSize();
this.window._maintainMaximizedSize();
var e = d._hideWindowedElementsIFrame;
if (e) {
Sys.UI.DomElement.removeCssClass(e, "rwMinimizedWindowOverlay");
this.ui.popupBehavior._handleElementResize();
}
if (this.window.get_showOnTopWhenMaximized()) {
var f = d.style.zIndex;
if (f) {
this.window._restoreZindex = f;
}
d.style.zIndex = 100000;
}
this.ui.updateTitleWidth();
}, setMaximizeSize: function () {
var e = this.ui.container;
if (!e) {
return;
}
var i = this.window._getViewportBounds();
e.style.top = (i.scrollTop + i.y) + "px";
e.style.left = (i.scrollLeft + i.x) + "px";
var g = parseInt(this.window.get_maxWidth());
var f = parseInt(this.window.get_maxHeight());
if (g) {
i.width = g;
}
if (f) {
i.height = f;
}
$telerik.setSize(e, {width: i.width, height: i.height});
var l = this.window._getRestrictionZoneBounds();
if (!l) {
this.window._enablePageScrolling(false);
}
var j = this.window._tableElement;
i = $telerik.getContentSize(e);
var d = $telerik.getBorderBox(j);
var h = $telerik.getPaddingBox(j);
var k = i.height - d.vertical - h.vertical;
j.style.height = k + "px";
this.window._fixIeHeight(j, k);
if (this.window._dockMode) {
this.window.setWidthDockMode(i.width);
this.window.setHeightDockMode(i.height);
}
this.ui.updateTitleWidth();
if (this.window._isiOS5Safari) {
this.window.setContentFixedHeight(i.height, this.window._iframeWrapper);
}
}, minimize: function () {
this.window._configureMinimizeButton(true);
this.window._configureMinimizeButton(true);
this.window._enablePageScrolling(true);
var d = this.ui.container;
$telerik.removeCssClasses(d, ["rwNormalWindow", "rwMaximizedWindow"]);
Sys.UI.DomElement.addCssClass(d, "rwMinimizedWindow");
if (this.window._enableShadow && !$telerik.isIE6) {
this.ui.setShadowCssClass(true);
Sys.UI.DomElement.addCssClass(d, "rwMinimizedWindowShadow");
}
var e = d._hideWindowedElementsIFrame;
if (e) {
Sys.UI.DomElement.addCssClass(e, "rwMinimizedWindowOverlay");
}
this.ui.getTitleNode().style.width = "";
this.minimizeToZone(this.window.get_minimizeZoneID());
}, setWidth: function (e) {
var d = this.ui.container;
var f = parseInt(e);
d.style.width = (f - $telerik.getBorderBox(d).horizontal) + "px";
this.updatePopupZindex();
}, setHeight: function (j, i) {
var e = this.ui.container;
var h = this.ui.table;
var f = parseInt(j ? j : h.style.height);
if (true == i) {
f = h.offsetHeight;
}
if (parseInt(f) == 0) {
return;
}
var d = $telerik.getBorderBox(e).vertical;
f = f > d ? f - d : f;
var g = f + "px";
h.style.height = g;
this._fixTableHeightInIE(h, f);
e.style.height = g;
}, setContentFixedHeight: function (f, d) {
if (!d) {
return;
}
var j = this.ui;
var g = this._substractWrappersBorder(f);
var k = this.window.isVisible();
var e = j.table.rows[3].cells[1];
var i = j.table.rows[0].cells[1];
var h = j.table.rows[2].cells[1];
g -= k ? parseInt($telerik.getBounds(e).height) : parseInt($telerik.getCurrentStyle(e, "height"));
if (this.window._visibleTitlebar) {
g -= k ? parseInt($telerik.getBounds(j.titlebar).height) : parseInt($telerik.getCurrentStyle(j.titlebar, "height"));
g -= k ? parseInt($telerik.getBounds(j.topResizer).height) : parseInt($telerik.getCurrentStyle(j.topResizer, "height"));
} else {
g -= k ? parseInt($telerik.getBounds(i).height) : parseInt($telerik.getCurrentStyle(i, "height"));
}
if (this.window._visibleStatusbar) {
g -= k ? parseInt($telerik.getBounds(h).height) : parseInt($telerik.getCurrentStyle(h, "height"));
}
if (g > 0) {
d.style.height = g + "px";
}
}, setContentWidth: function (d) {
if (!this.ui.content) {
return;
}
widthToSet = this.window._substractWrappersBorder(d) - this.ui.getHandlesWidth();
if (widthToSet > 0) {
this.ui.content.style.width = widthToSet + "px";
}
}, setTitleText: function (d) {
if (!this.ui.title) {
return;
}
this.ui.title.innerHTML = d || " ";
this.ui.updateTitleWidth();
}, showShadow: function () {
this.ui.setShadowCssClass(true);
}, hideShadow: function () {
this.ui.setShadowCssClass(false);
}, moveOutOfSight: function () {
var e = this.ui.popupBehavior;
if (e) {
this.window._storeBounds();
var d = e.get_elementToShow();
a(d).css({
display: "",
position: "absolute",
top: "-10000px",
left: this.window.get_leftHidingPoint() + "px",
overflow: "hidden"
});
if (d._hideWindowedElementsIFrame && d._hideWindowedElementsIFrame.style) {
d._hideWindowedElementsIFrame.style.display = "none";
}
}
this._ariaHide();
}, isOutOfSight: function () {
var d = this.ui.container;
if (!d) {
return false;
}
var e = parseInt(d.style.left, 10);
return ($telerik.isIE9 || $telerik.isIE10) && e == this.window.get_leftHidingPoint();
}, enableMoveResize: function (d) {
this.disableMoveResize(d);
if (!this.ui.container) {
return;
}
var h = this.ui.table.rows;
var e = {};
var g = this.window._isWindowRightToLeft();
if (d.resize) {
this.ui.createStatusbarResizer();
this.ui.bottomResizer.style.display = "";
if (g) {
e = {
nw: h[0].cells[2],
n: this.ui.topResizer,
ne: h[0].cells[0],
w: [h[1].cells[2], h[2].cells[2]],
e: [h[1].cells[0], h[2].cells[0]],
sw: h[3].cells[2],
s: h[3].cells[1],
se: [h[3].cells[0], this.ui.bottomResizer]
};
} else {
e = {
nw: h[0].cells[0],
n: this.ui.topResizer,
ne: h[0].cells[2],
w: [h[1].cells[0], h[2].cells[0]],
e: [h[1].cells[2], h[2].cells[2]],
sw: h[3].cells[0],
s: h[3].cells[1],
se: [h[3].cells[2], this.ui.bottomResizer]
};
}
}
if (d.move) {
e.move = this.ui.titleCell;
}
this.resizeExtender = this.window._resizeExtender = new Telerik.Web.UI.ResizeExtender(this.window, this.ui.container, e, this.ui.table);
var f = this.window._dockMode ? null : this.ui.contentFrame;
this.resizeExtender.set_iframeToSkip(f);
}, disableMoveResize: function (d) {
if (this.resizeExtender) {
this.resizeExtender.dispose();
this.resizeExtender = this.window._resizeExtender = null;
}
if (d.Resize && this.ui.bottomResizer) {
this.ui.bottomResizer.style.display = "none";
}
}, setCommandButtons: function (d) {
var e = [];
this.ui.clearCommandButtons();
for (var f = 0;
f < d.length;
f++) {
e.push(this.ui.createCommandButton(d[f]));
}
this.ui.updateTitleWidth();
return e;
}, toggleCommand: function (e) {
var d = this.ui.getCommandButton(e);
if (!d) {
return;
}
Sys.UI.DomElement.toggleCssClass(d, "on");
}, minimizeToZone: function (e) {
if (!e) {
return;
}
if (typeof(e) == "string") {
e = $get(e);
}
var d = this.ui.container;
if (d.parentNode != e) {
d.parentNode.removeChild(d);
e.appendChild(d);
this.window.setVisible(true);
d.style.position = "static";
if ($telerik.isIE) {
d.style.display = "inline";
} else {
d.style.cssFloat = "left";
}
}
}, moveToDefaultParent: function () {
var d = this.window._getDefaultParent();
d.insertBefore(this.ui.container, d.firstChild);
}, revertToDefaultParent: function () {
var d = this.ui.container;
d.parentNode.removeChild(d);
d.style.position = "absolute";
if ($telerik.isIE) {
d.style.display = "";
} else {
d.style.cssFloat = "";
}
this.moveToDefaultParent();
}, setActive: function (e) {
var d = this.ui.container;
if (e) {
if (!this.window.isMaximized()) {
var g = parseInt(d.style.zIndex);
var f = this.ui.get_initialZIndexCss() || Telerik.Web.UI.RadWindowUtils.get_newZindex(g);
d.style.zIndex = "" + f;
}
Sys.UI.DomElement.removeCssClass(d, "rwInactiveWindow");
} else {
Sys.UI.DomElement.addCssClass(d, "rwInactiveWindow");
}
}, isActive: function () {
var d = this.ui.container;
return (d && !Sys.UI.DomElement.containsCssClass(d, "rwInactiveWindow"));
}, onUrlChanging: function () {
if (!this.ui.contentFrame) {
return;
}
if (this.window.get_showContentDuringLoad()) {
var e = this.ui.statusMessage;
if (e) {
Sys.UI.DomElement.addCssClass(e, "rwLoading");
}
} else {
var d = this.ui.contentFrame;
var f = d.style;
f.position = "absolute";
f.top = "-10000px";
if ($telerik.isIE9Mode) {
this.setHeight(this.window._height);
}
if (this.window._isWindowRightToLeft() && $telerik.isChrome) {
f.width = "1px";
}
var g = d.parentNode;
Sys.UI.DomElement.addCssClass(g, "rwLoading");
}
}, onUrlChanged: function () {
var h = this.ui.statusMessage, g = this.ui.contentFrame;
if (this.window.get_showContentDuringLoad()) {
if (h) {
Sys.UI.DomElement.removeCssClass(h, "rwLoading");
}
} else {
g.style.position = "";
if (this.window._isWindowRightToLeft() && $telerik.isChrome) {
g.style.width = "100%";
}
var j = g.parentNode;
Sys.UI.DomElement.removeCssClass(j, "rwLoading");
if ($telerik.isIE9Mode) {
if (this.window.isMaximized()) {
this.window._maintainMaximizedSize();
} else {
if (!this.window.isMinimized()) {
this.setHeight(this.window.get_height());
}
}
}
}
if (h) {
this.window.set_status(this.window.get_navigateUrl());
}
try {
var d = g.contentWindow.document;
var i = d.title;
if (i && i != this.window.get_title()) {
this.window.set_title(i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"));
}
} catch (f) {
}
}, updatePopupZindex: function () {
var d = this.ui.popupBehavior;
if (d) {
if (this.window.isVisible()) {
d.show();
}
}
}, dispose: function () {
}, _substractWrappersBorder: function (f, g) {
var i = this.ui.container;
var d = this.ui.contentCell;
if (!i || !d) {
return f;
}
var h = $telerik.getBorderBox(i);
var e = $telerik.getBorderBox(d);
f -= g ? (h.horizontal + e.hrizontal) : (h.vertical + e.vertical);
return f;
}, _fixTableHeightInIE: function (g, e) {
if ("CSS1Compat" == document.compatMode) {
var d = (g.offsetHeight - parseInt(e));
if (d > 0) {
var f = (parseInt(g.style.height) - d);
if (f > 0) {
g.style.height = f + "px";
}
}
}
}, _removeExplicitMSAjaxWidth: function () {
if (!this.window.get_width()) {
this.ui.container.style.width = "";
}
}, _ariaHide: function () {
if (this.window.get_enableAriaSupport() && this.ui.container && !this.window.isVisible()) {
this.ui.container.setAttribute("aria-hidden", "true");
}
}
};
b.ClassicView.registerClass("Telerik.Web.UI.Window.ClassicView", b.ViewBase, b.IView);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.LightweightRenderer = function (d) {
b.LightweightRenderer.initializeBase(this, [d]);
this.options = a.extend({skin: this.window.get_skin(), minTitleWidth: 30});
this.container = this.titlebar = this.icon = this.title = this.commandsContainer = this.content = this.contentFrame = this.statusbar = this.statusMessage = this.topResizer = this.bottomResizer = null;
};
b.LightweightRenderer.prototype = {
createUI: function () {
if (this.container) {
return;
}
var l = this.window._isWindowRightToLeft();
var d = Sys.UI.DomElement.addCssClass;
var e = document.createElement("div");
this.container = this.window._popupElement = e;
e.id = "RadWindowWrapper_" + this.window.get_id();
e.className = this._getSkinCssClass();
var i = this.window.get_cssClass();
if (i) {
d(e, i);
}
if (l) {
d(e, "rwRtl");
}
if (!this.window._visibleTitlebar) {
d(e, "rwNoTitleBar");
}
this.setShadowCssClass(this.window._enableShadow);
e.setAttribute("unselectable", "on");
var f = e.style;
f.width = this.window._width;
f.height = this.window._height;
f.position = "absolute";
var n = this.titlebar = this.window._titlebarElement = document.createElement("div");
n.className = "rwTitleBar";
e.appendChild(n);
var o = document.createElement("div");
o.className = "rwTitleWrapper";
n.appendChild(o);
o.appendChild(this.getIconNode());
o.appendChild(this.getTitleNode());
this.window.set_title(this.window._title);
o.appendChild(this.getTitleCommandsContainer());
this.window._registerTitlebarHandlers(true);
this.window.set_iconUrl(this.window.get_iconUrl());
var g = this.content = $get(this.window.get_id() + "_C") || this.pendingContent || document.createElement("div");
if (g) {
g.removeAttribute("id");
g.style.display = "none";
g.className = "rwContent";
this.setContent(g);
}
if (!this.window._dockMode) {
var h = g.getElementsByTagName("iframe");
var j = h.length > 0 ? h[0] : document.createElement(($telerik.isIE && !$telerik.isIE9Mode) ? "<iframe name='" + name + "'>" : "iframe");
j.name = name;
j.src = "javascript:'<html></html>';";
j.style.width = "100%";
j.style.height = "100%";
j.style.border = "0px";
j.frameBorder = "0";
if ($telerik.isIE8) {
j.style.display = "block";
}
this.contentFrame = this.window._iframe = j;
if (($telerik.isMobileSafari || this.window._isiPhoneiPadAppleWebkit) && !this.window._isPredefined) {
var k = document.createElement("div");
a(k).addClass("rwIframeWrapperIOS");
k.appendChild(this.contentFrame);
this.content.appendChild(k);
if (this.window._isiOS5Safari) {
this.window.setContentFixedHeight(this.window.get_height(), k);
}
this.window._iframeWrapper = k;
} else {
this.content.appendChild(this.contentFrame);
}
Sys.UI.DomElement.addCssClass(this.content, "rwExternalContent");
this.window._createBackReference();
}
if (this.window._visibleStatusbar) {
var m = this.statusbar = document.createElement("div");
m.className = "rwStatusBar";
e.appendChild(m);
m.appendChild(this.getStatusMessageNode());
if (this.window.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)) {
m.appendChild(this.createStatusbarResizer());
}
}
this.window._addWindowToDocument();
if (!$telerik.isTouchDevice) {
this.container.style.Transform = "none";
this.container.style.BackfaceVisibility = "visible";
this.container.style.webkitTransform = "none";
this.container.style.webkitBackfaceVisibility = "visible";
this.container.style.OTransform = "none";
this.container.style.OBackfaceVisibility = "visible";
this.container.style.MozTransform = "none";
this.container.style.MozBackfaceVisibility = "visible";
this.container.style.msTransform = "none";
this.container.style.msBackfaceVisibility = "visible";
}
if (!this.window._popupBehavior) {
this.window.set_behaviors(this.window._behaviors);
this.popupBehavior = this.window._popupBehavior = $create(Telerik.Web.PopupBehavior, {
id: (new Date() - 100) + "PopupBehavior",
parentElement: null,
overlay: this.window._overlay,
keepInScreenBounds: this.window._keepInScreenBounds
}, null, null, this.container);
}
}, _getSkinCssClass: function () {
return "RadWindow RadWindow_" + this.options.skin + " rwTransparentWindow rwRoundedCorner";
}, setContent: function (d) {
this._setContent(d);
this.content = this.window._contentElement = d;
}, _setContent: function (e) {
var d = this.container.children;
if (d.length == 1) {
this.container.appendChild(e);
} else {
this.container.insertBefore(e, d[1]);
}
e.style.display = "";
}, get_container: function () {
return this.container;
}, getHandlesWidth: function () {
return 12;
}, setShadowCssClass: function (e) {
var d = e ? Sys.UI.DomElement.addCssClass : Sys.UI.DomElement.removeCssClass;
d(this.container, "rwShadow");
}, getBounds: function () {
var e = this.container;
var f = (e.style.display == "none");
e.style.display = "";
var d = $telerik.getBounds(e);
if (f) {
e.style.display = "none";
}
return d;
}, showContentOverlay: function () {
var d = this.contentOverlay;
if (!this.contentOverlay) {
d = this.createContentOverlay();
}
d.style.display = "";
}, hideContentOverlay: function () {
if (!this.contentOverlay) {
return;
}
this.contentOverlay.style.display = "none";
}, createContentOverlay: function () {
var d = this.content;
var e = this.contentOverlay = document.createElement("div");
var f = e.style;
f.position = "absolute";
f.top = 0;
f.left = 0;
f.zIndex = "1";
f.backgroundColor = "white";
f.filter = "alpha(opacity=0)";
f.opacity = 0;
f.width = "100%";
f.height = "100%";
d.appendChild(e);
return e;
}, updateTitleWidth: function () {
}, getTitleNode: function () {
if (!this.title) {
this.createTitle();
}
return this.title;
}, createTitle: function () {
var d = document.createElement("h6");
d.setAttribute("unselectable", "on");
d.className = "rwTitle";
if (this.window.get_enableAriaSupport()) {
d.id = this.window.get_id() + "_title";
d.setAttribute("role", "label");
}
this.title = this.window._titleElement = d;
}, getIconNode: function () {
if (!this.icon) {
this.createIcon();
}
return this.icon;
}, createIcon: function () {
var d = document.createElement("span");
d.className = "rwIcon";
this.icon = this.window._titleIconElement = d;
}, getTitleCommandsContainer: function () {
if (!this.commandsContainer) {
this.createTitleCommandsContainer();
}
return this.commandsContainer;
}, createTitleCommandsContainer: function () {
var d = document.createElement("ul");
d.className = "rwCommands";
if (this.window.get_enableAriaSupport()) {
d.setAttribute("role", "presentation");
}
this.commandsContainer = this.window._buttonsElement = d;
}, getStatusMessageNode: function () {
if (!this.statusMessage) {
this.createStatusMessage();
}
return this.statusMessage;
}, createStatusMessage: function () {
var d = document.createElement("input");
d.id = this.window.get_id() + "_status";
d.readOnly = "readonly";
d.setAttribute("unselectable", "on");
d.setAttribute("tabindex", "-1");
this.statusMessage = this._statusMessageElement = d;
}, createStatusbarResizer: function () {
if (this.bottomResizer) {
return;
}
var d = document.createElement("span");
d.className = "rwResize";
return this.bottomResizer = d;
}, removeStatusbarResizer: function () {
var e = this;
var d = e.bottomResizer;
if (!d) {
return;
}
d.parentNode.removeChild(d);
e.bottomResizer = null;
}, getCommandButton: function (d) {
if (!d || !this.commandsContainer) {
return null;
}
var e = d.toLowerCase();
e = e.charAt(0).toUpperCase() + e.substring(1);
var f = ".rw" + e + "Button, .rw" + e;
return a(f, this.commandsContainer)[0];
}, createCommandButton: function (e) {
var f = document.createElement("li");
f.className = "rwListItem";
var d = document.createElement("input");
d.setAttribute("type", "button");
d.className = "rwCommandButton " + e[0];
d.value = d.title = e[1];
$telerik.addHandler(d, "click", this._preventDefault);
$telerik.addHandler(d, "click", e[2]);
$addHandlers(d, {dblclick: this._cancelEvent, mousedown: this._cancelEvent}, this);
f.appendChild(d);
this.commandsContainer.appendChild(f);
if (this.window.get_enableAriaSupport()) {
f.setAttribute("role", "presentation");
d.setAttribute("role", "button");
}
return d;
}, changeCommandButton: function (d, f, e) {
d.value = d.title = f;
$telerik.clearHandlers(d);
$telerik.addHandler(d, "click", this._preventDefault);
$telerik.addHandler(d, "click", e);
$addHandlers(d, {dblclick: this._cancelEvent, mousedown: this._cancelEvent}, this);
}, changeCommandButtonByName: function (f, g, e) {
var d = this.getCommandButton(f);
if (d) {
this.changeCommandButton(d, g, e);
}
}, clearCommandButtons: function () {
var e = a(this.commandsContainer);
var d = e.find("button");
for (var f = 0;
f < d.length;
f++) {
this.clearCommandButton(d[f]);
}
e.empty();
}, clearCommandButton: function (d) {
$telerik.clearHandlers(d);
}, geTitlebarHeight: function () {
if (!this.titlebar) {
return 0;
}
return this.titlebar.offsetHeight;
}, get_zIndexCss: function () {
return this.container ? this.container.style.zIndex : -1;
}, get_initialZIndexCss: function () {
var d = this.window.get_element();
return d ? parseInt(d.style.zIndex || $telerik.getComputedStyle(d, "zIndex")) : null;
}, get_uiMinWidth: function () {
this._minUIWidth = this.options.minTitleWidth || 0;
this._minUIWidth += this.getHandlesWidth();
if (this.commandsContainer) {
this._minUIWidth += this.commandsContainer.offsetWidth;
}
if (this.icon) {
this._minUIWidth += this.icon.offsetWidth;
}
return this._minUIWidth;
}, get_uiMinHeight: function () {
if (!this._minUIHeight) {
this._minUIHeight = this.getHandlesWidth() || 0;
if (this.window._visibleTitlebar) {
this._minUIHeight += this.titlebar.offsetHeight;
}
if (this.window._visibleStatusbar) {
this._minUIHeight += this.statusbar.offsetHeight;
}
}
return this._minUIHeight;
}, dispose: function () {
this.container = this.titlebar = this.icon = this.title = this.commandsContainer = this.content = this.contentFrame = this.statusbar = this.statusMessage = this.topResizer = this.bottomResizer = null;
}, _cancelEvent: function (d) {
return $telerik.cancelRawEvent(d);
}, _preventDefault: function (d) {
if (d.preventDefault) {
d.preventDefault();
}
d.returnValue = false;
}
};
b.LightweightRenderer.registerClass("Telerik.Web.UI.Window.LightweightRenderer", b.RendererBase, b.IRenderer);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.LightweightView = function (d) {
b.LightweightView.initializeBase(this, [d]);
this.ui = this.window.ui;
};
b.LightweightView.prototype = {
moveTo: function (d, e) {
this.ui.popupBehavior._setCoordinates(d, e);
this.ui.popupBehavior.show();
this._removeExplicitMSAjaxWidth();
this.ui.updateTitleWidth();
this.window.set_left(d);
this.window.set_top(e);
}, setContent: function (e) {
var d = this.ui.content;
if (d && e != d) {
$telerik.disposeElement(d);
d.innerHTML = "";
d.appendChild(e);
e = d;
}
if (!this.window.isCreated()) {
this.ui.pendingContent = e;
}
this.ui.createUI();
if (this.window._isPredefined && this.ui.contentFrame) {
this.ui.contentFrame.style.display = "none";
this.ui.contentFrame.style.height = "";
}
if (this.ui.contentFrame && this.ui.contentFrame.parentNode != e) {
this.ui.contentFrame.style.display = "none";
} else {
if (!this.window._dropDownTouchScroll && Telerik.Web.UI.TouchScrollExtender._getNeedsScrollExtender()) {
this.window._createTouchScrollExtender(true);
}
}
this.ui.setContent(e);
}, setUrl: function (e) {
var d = this.ui.contentFrame;
if (!d) {
return;
}
d.src = e;
this.setContentFixedHeight(this.window.get_height(), this.ui.content);
this.onUrlChanging();
}, show: function () {
if (this.ui.popupBehavior) {
this.ui.popupBehavior.show();
}
this._showResizableHandlers();
this._repaintResizable();
this._isViewVisible = true;
}, hide: function () {
if (this.ui.popupBehavior) {
this.ui.popupBehavior.hide();
}
this._hideResizableHandlers();
this._isViewVisible = false;
}, isVisible: function () {
return this._isViewVisible;
}, maximize: function () {
this.ui.setShadowCssClass(false);
var d = this.ui.container;
$telerik.removeCssClasses(d, ["rwNormalWindow", "rwMinimizedWindow", "rwMinimizedWindowShadow"]);
Sys.UI.DomElement.addCssClass(d, "rwMaximizedWindow");
this.window._configureMaximizeButton(true);
this.window._configureMinimizeButton();
this.window._maintainMaximizedSize();
this.window._maintainMaximizedSize();
var e = d._hideWindowedElementsIFrame;
if (e) {
Sys.UI.DomElement.removeCssClass(e, "rwMinimizedWindowOverlay");
this.ui.popupBehavior._handleElementResize();
}
if (this.window.get_showOnTopWhenMaximized()) {
var f = d.style.zIndex;
if (f) {
this.window._restoreZindex = f;
}
d.style.zIndex = 100000;
}
this.ui.updateTitleWidth();
}, setMaximizeSize: function () {
var d = this.ui.container;
if (!d) {
return;
}
var g = this.window._getViewportBounds();
d.style.top = (g.scrollTop + g.y) + "px";
d.style.left = (g.scrollLeft + g.x) + "px";
var f = parseInt(this.window.get_maxWidth());
var e = parseInt(this.window.get_maxHeight());
if (f) {
g.width = f;
}
if (e) {
g.height = e;
}
$telerik.setSize(d, {width: g.width, height: g.height});
var h = this.window._getRestrictionZoneBounds();
if (!h) {
this.window._enablePageScrolling(false);
}
if (this.window._dockMode) {
this.window.setWidthDockMode(g.width);
this.window.setHeightDockMode(g.height);
}
this.ui.updateTitleWidth();
if (this.ui.contentFrame) {
this.setContentFixedHeight(g.height, this.ui.content);
}
}, minimize: function () {
this.window._configureMinimizeButton(true);
this.window._configureMinimizeButton(true);
this.window._enablePageScrolling(true);
var d = this.ui.container;
$telerik.removeCssClasses(d, ["rwNormalWindow", "rwMaximizedWindow"]);
Sys.UI.DomElement.addCssClass(d, "rwMinimizedWindow");
if (this.window._enableShadow && !$telerik.isIE6) {
this.ui.setShadowCssClass(true);
Sys.UI.DomElement.addCssClass(d, "rwMinimizedWindowShadow");
}
var e = d._hideWindowedElementsIFrame;
if (e) {
Sys.UI.DomElement.addCssClass(e, "rwMinimizedWindowOverlay");
}
this.setWidth(200);
this.setHeight(this.ui.titlebar.offsetHeight);
this.ui.getTitleNode().style.width = "";
this.minimizeToZone(this.window.get_minimizeZoneID());
}, setWidth: function (d) {
this._setWidth(d);
this._repaintResizable();
}, _setWidth: function (e) {
var d = this.ui.container;
var f = parseInt(e);
f -= $telerik.getBorderBox(d).horizontal;
f -= $telerik.getPaddingBox(d).horizontal;
d.style.width = f + "px";
}, setHeight: function (d) {
this._setHeight(d);
this._repaintResizable();
}, _setHeight: function (h) {
var d = this.ui.container;
var f = parseInt(h);
if (f == 0) {
return;
}
this.setContentFixedHeight(f, this.ui.content);
var e = $telerik.getBorderBox(d).vertical;
e += $telerik.getPadding(d, Telerik.Web.BoxSide.Bottom);
f = f > e ? f - e : f;
var g = f + "px";
d.style.height = g;
}, setContentFixedHeight: function (e, d) {
if (!d) {
return;
}
var g = this.ui;
var f = this._substractWrappersBorder(e) - $telerik.getPaddingBox(g.container).vertical;
var h = this.window.isVisible();
if (this.window._visibleTitlebar) {
f -= h ? parseInt($telerik.getBounds(g.titlebar).height) : parseInt($telerik.getCurrentStyle(g.titlebar, "height"));
}
f -= $telerik.getPaddingBox(d).vertical;
f -= $telerik.getBorderBox(d).vertical;
if (this.window._visibleStatusbar) {
f -= h ? parseInt(g.statusbar.offsetHeight) : parseInt($telerik.getCurrentStyle(g.statusbar, "height"));
f -= h ? 0 : parseInt($telerik.getBorderBox(g.statusbar).vertical);
}
if (f > 0) {
d.style.height = f + "px";
}
}, setContentWidth: function (d) {
this.ui.content.style.width = "";
}, setTitleText: function (d) {
if (!this.ui.title) {
return;
}
this.ui.title.innerHTML = d || " ";
this.ui.updateTitleWidth();
}, showShadow: function () {
this.ui.setShadowCssClass(true);
}, hideShadow: function () {
this.ui.setShadowCssClass(false);
}, moveOutOfSight: function () {
var e = this.ui.popupBehavior;
if (e) {
this.window._storeBounds();
var d = e.get_elementToShow();
a(d).css({
display: "",
position: "absolute",
top: "-10000px",
left: this.window.get_leftHidingPoint() + "px",
overflow: "hidden"
});
if (d._hideWindowedElementsIFrame && d._hideWindowedElementsIFrame.style) {
d._hideWindowedElementsIFrame.style.display = "none";
}
}
this._ariaHide();
}, isOutOfSight: function () {
var d = this.ui.container;
if (!d) {
return false;
}
var e = parseInt(d.style.left, 10);
return ($telerik.isIE9 || $telerik.isIE10) && e == this.window.get_leftHidingPoint();
}, enableMoveResize: function (d) {
this.disableMoveResize(d);
if (d.move && !this.draggable) {
this.draggable = new Telerik.Web.UI.Widgets.Draggable(this.ui.container, {
handle: this.ui.titlebar,
shouldPreventDefault: false
});
this.draggable.add_dragStart(Function.createDelegate(this, function (i, f) {
this._cancelDragSelection(f.get_domEvent());
this.window.setActive(true);
var n = this.window.isPinned() || this.window.isMaximized() || (this.window.isMinimized() && this.window.get_minimizeZoneID());
f.set_cancel(n);
if (n) {
return;
}
this.restrictBounds = this.window._getRestrictionZoneBounds();
var l = $telerik.getPaddingBox(this.ui.container);
if (this.restrictBounds) {
var g = $telerik.getBorderBox(this.ui.container);
var j = this.restrictBounds, k = {
x: j.x,
y: j.y,
width: j.width - l.horizontal - g.horizontal,
height: j.height - l.vertical - g.vertical
}, h = {minX: k.x, minY: k.y, maxX: k.width + k.x, maxY: k.height + k.y};
var m = {x: this.window.get_left(), y: this.window.get_top()};
m.y = Math.max(h.minY, Math.min(h.maxY, m.y));
f._position.y = m.y;
this.moveTo(m.x, m.y);
i.set_constraints(h);
}
this.window.raiseEvent("dragStart", new Sys.EventArgs());
}));
this.draggable.add_dragging(Function.createDelegate(this, function (g, f) {
this.ui.showContentOverlay();
$telerik.cancelRawEvent(f.get_domEvent());
f.set_cancel(this.window.isPinned() || this.window.isMaximized() || (this.window.isMinimized() && this.window.get_minimizeZoneID()));
}));
this.draggable.add_dragEnd(Function.createDelegate(this, function (g, f) {
this.ui.hideContentOverlay();
var h = f.get_newPosition();
this.moveTo(h.x, h.y);
this.window._storeBounds();
this._repaintResizable();
this.window.raiseEvent("dragEnd", new Sys.EventArgs());
}));
}
if (d.resize && !this.resizable) {
this.resizable = new Telerik.Web.UI.Widgets.Resizable(this.ui.container, {
appendHandleToElement: !$telerik.isIE,
constraints: {minWidth: this.ui.get_uiMinWidth(), minHeight: this.ui.get_uiMinHeight()},
handleSize: 12,
shouldPreventDefault: false
});
this.resizable.add_resizeStart(a.proxy(this._resizeStartHandler, this));
this.resizable.add_resizing(a.proxy(this._resizingHandler, this));
this.resizable.add_resizeEnd(a.proxy(this._resizeEndHandler, this));
if (this.ui.bottomResizer && !this.bottomResizerHandle) {
var e = new Telerik.Web.UI.Widgets.Handle(this.ui.bottomResizer, "SE", {cursorType: "se-resize"});
e.add_dragStart(a.proxy(this.resizable._handleDragStart, this.resizable));
e.add_dragging(a.proxy(this.resizable._handleDragging, this.resizable));
e.add_dragEnd(a.proxy(this.resizable._handleDragEnd, this.resizable));
this.bottomResizerHandle = e;
}
}
}, _resizeStartHandler: function (f, d) {
this.ui.showContentOverlay();
$telerik.cancelRawEvent(d.get_domEvent());
this.window.setActive(true);
if (this.window.isMinimized() || this.window.isMaximized()) {
d.set_cancel(true);
}
f.set_constraints({minWidth: this.ui.get_uiMinWidth(), minHeight: this.ui.get_uiMinHeight()});
this.restrictBounds = this.window._getRestrictionZoneBounds();
this.resizeHelper = {
width: this.window.get_width(),
height: this.window.get_height() || this.ui.container.clientHeight,
offset: {top: parseInt(this.window.get_top()), left: parseInt(this.window.get_left())},
borders: $telerik.getBorderBox(this.ui.container)
};
var e = new Sys.CancelEventArgs();
this.window.raiseEvent("resizeStart", e);
d.set_cancel(e.get_cancel());
}, touchCount: 0, _resizingHandler: function (j, d) {
$telerik.cancelRawEvent(d.get_domEvent());
var g = this.restrictBounds, f = this._getResizeBounds(d), e = this.resizeHelper.borders, h = {
x: f.x - e.left,
y: f.y - e.top,
width: f.width + e.horizontal,
height: f.height + e.vertical
};
var i = this.window._checkRestrictionZoneBounds(g, h);
f.width = Math.max(j.options.constraints.minWidth, f.width);
f.height = Math.max(j.options.constraints.minHeight, f.height);
d.set_cancel(true);
if (i && this.touchCount++ > 0) {
var k = this.ui.container.style;
k.left = f.x + "px";
k.top = f.y + "px";
this._setWidth(f.width);
this._setHeight(f.height);
this._currentResizeBounds = f;
}
}, _getResizeBounds: function (d) {
var f = d.get_direction();
var h = function (k) {
return f.indexOf(k) > -1;
};
var e = d.get_delta();
var i = this.resizeHelper;
var g = h("N") ? -1 : 1;
var j = h("W") ? -1 : 1;
return {
x: i.offset.left + (h("W") ? e.x : 0),
y: i.offset.top + (h("N") ? e.y : 0),
width: i.width + j * e.x,
height: i.height + g * e.y
};
}, _getMoveBounds: function (d) {
var e = d.get_newPosition();
var f = this.resizeHelper;
return {x: e.x, y: e.y, width: f.width, height: f.height};
}, _resizeEndHandler: function (f, d) {
this.touchCount = 0;
$telerik.cancelRawEvent(d.get_domEvent());
this.ui.hideContentOverlay();
var e = this._currentResizeBounds;
if (e) {
this.moveTo(parseInt(e.x), parseInt(e.y));
this.window.set_width(parseInt(e.width));
this.window.set_height(parseInt(e.height));
}
this.window._storeBounds();
this.window.raiseEvent("resizeEnd", new Sys.EventArgs());
this._currentResizeBounds = null;
}, _showResizableHandlers: function () {
if (this.resizable) {
this.resizable.showHandles();
}
}, _hideResizableHandlers: function () {
if (this.resizable) {
this.resizable.hideHandles();
}
}, _repaintResizable: function () {
if (this.resizable) {
this.resizable.repaint();
}
}, _isDir: function (d, e) {
return d.indexOf(e) > -1;
}, disableMoveResize: function (d) {
if (this.draggable) {
this.draggable.dispose();
this.draggable = null;
}
if (this.resizable) {
if (this.bottomResizerHandle) {
this.ui.removeStatusbarResizer();
this.bottomResizerHandle.dispose();
this.bottomResizerHandle = null;
}
this.resizable.dispose();
this.resizable = null;
}
}, setCommandButtons: function (d) {
var e = [];
this.ui.clearCommandButtons();
for (var f = 0;
f < d.length;
f++) {
e.push(this.ui.createCommandButton(d[f]));
}
this.ui.updateTitleWidth();
return e;
}, toggleCommand: function (e) {
var d = this.ui.getCommandButton(e);
if (!d) {
return;
}
Sys.UI.DomElement.toggleCssClass(d, "on");
}, minimizeToZone: function (e) {
if (!e) {
return;
}
if (typeof(e) == "string") {
e = $get(e);
}
var d = this.ui.container;
if (d.parentNode != e) {
d.parentNode.removeChild(d);
e.appendChild(d);
this.window.setVisible(true);
d.style.position = "static";
if ($telerik.isIE) {
d.style.display = "inline";
} else {
d.style.cssFloat = "left";
}
}
}, moveToDefaultParent: function () {
var d = this.window._getDefaultParent();
d.insertBefore(this.ui.container, d.firstChild);
}, revertToDefaultParent: function () {
var d = this.window._getDefaultParent();
d.insertBefore(this.ui.container, d.firstChild);
}, setActive: function (e) {
var d = this.ui.container;
if (e) {
if (!this.window.isMaximized()) {
var g = parseInt(d.style.zIndex);
var f = this.ui.get_initialZIndexCss() || Telerik.Web.UI.RadWindowUtils.get_newZindex(g);
d.style.zIndex = "" + f;
}
Sys.UI.DomElement.removeCssClass(d, "rwInactiveWindow");
} else {
Sys.UI.DomElement.addCssClass(d, "rwInactiveWindow");
}
this._repaintResizable();
}, isActive: function () {
var d = this.ui.container;
return (d && !Sys.UI.DomElement.containsCssClass(d, "rwInactiveWindow"));
}, onUrlChanging: function () {
if (!this.ui.contentFrame) {
return;
}
if (this.window.get_showContentDuringLoad()) {
var e = this.ui.statusbar;
if (e) {
Sys.UI.DomElement.addCssClass(e, "rwLoading");
}
} else {
var d = this.ui.contentFrame;
var f = d.style;
d.originalPosition = f.position;
d.originalHeight = f.height;
f.position = "absolute";
f.top = "-10000px";
if ($telerik.isIE9Mode) {
this.setHeight(this.window._height);
}
if (this.window._isWindowRightToLeft() && $telerik.isChrome) {
f.width = "1px";
}
Sys.UI.DomElement.addCssClass(this.ui.container, "rwLoading");
}
}, onUrlChanged: function () {
var i = this.ui.statusbar, g = this.ui.contentFrame;
if (this.window.get_showContentDuringLoad()) {
if (i) {
Sys.UI.DomElement.removeCssClass(i, "rwLoading");
}
} else {
g.style.position = "";
g.style.height = g.originalHeight;
g.originalHeight = null;
if (this.window._isWindowRightToLeft() && $telerik.isChrome) {
g.style.width = "100%";
}
Sys.UI.DomElement.removeCssClass(this.ui.container, "rwLoading");
if ($telerik.isIE9Mode) {
if (this.window.isMaximized()) {
this.window._maintainMaximizedSize();
} else {
if (!this.window.isMinimized()) {
this.setHeight(this.window.get_height());
}
}
}
}
if (i) {
this.window.set_status(this.window.get_navigateUrl());
}
try {
var d = g.contentWindow.document;
var h = d.title;
if (h && h != this.window.get_title()) {
this.window.set_title(h.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"));
}
} catch (f) {
}
}, updatePopupZindex: function () {
var d = this.ui.popupBehavior;
if (d) {
if (this.window.isVisible()) {
d.show();
}
}
}, dispose: function () {
}, _substractWrappersBorder: function (d, e) {
var g = this.ui.container;
if (!g) {
return d;
}
var f = $telerik.getBorderBox(g);
d -= e ? f.horizontal : f.vertical;
return d;
}, _removeExplicitMSAjaxWidth: function () {
if (!this.window.get_width()) {
this.ui.container.style.width = "";
}
}, _ariaHide: function () {
if (this.window.get_enableAriaSupport() && this.ui.container && !this.window.isVisible()) {
this.ui.container.setAttribute("aria-hidden", "true");
}
}, _cancelDragSelection: function (d) {
if (!$telerik.isTouchDevice) {
$telerik.cancelRawEvent(d);
}
}, _preventDefault: function (d) {
if (d.preventDefault) {
d.preventDefault();
}
d.returnValue = false;
}
};
b.LightweightView.registerClass("Telerik.Web.UI.Window.LightweightView", b.ViewBase, b.IView);
})($telerik.$, Telerik.Web.UI.Window);
Type.registerNamespace("Telerik.Web.UI.Window");
(function (a, b, c) {
b.UIFactory = {
getRenderer: function (d, f) {
var e = Telerik.Web.UI.RenderMode;
if (d == e.Classic) {
return new b.ClassicRenderer(f);
} else {
if (d == e.Lite) {
return new b.LightweightRenderer(f);
}
}
}, getView: function (d, f) {
var e = Telerik.Web.UI.RenderMode;
if (d == e.Classic) {
return new b.ClassicView(f);
} else {
if (d == e.Lite) {
return new b.LightweightView(f);
}
}
}
};
})($telerik.$, Telerik.Web.UI.Window);
(function (a, b) {
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.WindowShortCutManager = function (c) {
this._shortcuts = [];
this.addShortCuts(c);
};
Telerik.Web.UI.WindowShortCutManager.prototype = {
addShortCuts: function (d) {
if (typeof(d) == "string") {
d = Sys.Serialization.JavaScriptSerializer.deserialize(d);
}
for (var c = 0;
c < d.length;
c++) {
this.addShortCut(d[c][0], d[c][1]);
}
}, addShortCut: function (d, e) {
var c = new Telerik.Web.UI.WindowShortCut(d, e);
c.HashValue = this._getShortCutHashValue(c);
this._shortcuts[c.HashValue] = c;
}, removeShortCut: function (d) {
var c = this.findShortCutByName(d);
if (c) {
this._shortcuts[c.HashValue] = null;
}
}, setShortCut: function (c, d) {
this.removeShortCut(c);
this.addShortCut(c, d);
}, isShortCutHit: function (c) {
return this._hitTest(c.keyCode, c.ctrlKey, (null != c.ctrlLeft ? c.ctrlLeft : c.ctrlKey), c.shiftKey, (null != c.shiftLeft ? c.shiftLeft : c.shiftKey), c.altKey, (null != c.altLeft ? c.altLeft : c.altKey));
}, _hitTest: function (f, d, h, j, i, c, g) {
var e = this._getHashValue(f, d, h, j, i, c, g);
return this._shortcuts[e];
}, _getHashValue: function (f, d, h, j, i, c, g) {
var k = f & 65535;
var e = 0;
e |= (d ? (1 << 0) : 0);
e |= (j ? (1 << 2) : 0);
e |= (c ? (1 << 4) : 0);
k |= (e << 16);
return k;
}, _getShortCutHashValue: function (c) {
return this._getHashValue(c.KeyCode, c.CtrlKey, c.LeftCtrlKey, c.ShiftKey, c.LeftShiftKey, c.AltKey, c.LeftAltKey);
}, findShortCutByName: function (e) {
var c;
for (var d in this._shortcuts) {
c = this._shortcuts[d];
if (null != c && c._name == e) {
return c;
}
}
return null;
}
};
Telerik.Web.UI.WindowShortCut = function (c, d) {
this._name = c;
this._shortcutString = "";
this.setShortCut(d);
};
Telerik.Web.UI.WindowShortCut.prototype = {
CtrlKey: false,
LeftCtrlKey: false,
ShiftKey: false,
LeftShiftKey: false,
AltKey: false,
LeftAltKey: false,
KeyCode: 0,
get_name: function () {
return this._name;
},
set_name: function (c) {
this._name = c;
},
get_shortCutString: function () {
return this._shortcutString;
},
setShortCut: function (c) {
this._parseShortcutString(c);
this._shortcutString = c;
},
_parseShortcutString: function (d) {
if ("string" == typeof(d)) {
this.CtrlKey = false;
this.LeftCtrlKey = false;
this.ShiftKey = false;
this.LeftShiftKey = false;
this.AltKey = false;
this.LeftAltKey = false;
this.KeyCode = 0;
d = d.replace(/\s*/gi, "");
d = d.replace(/\+\+/gi, "+PLUS");
var f = d.split("+");
var e = "";
for (var c = 0;
c < f.length;
c++) {
e = f[c].toUpperCase();
switch (e) {
case"LCTRL":
this.LeftCtrlKey = true;
break;
case"CTRL":
this.CtrlKey = true;
break;
case"LSHIFT":
this.LeftShiftKey = true;
break;
case"SHIFT":
this.ShiftKey = true;
break;
case"LALT":
this.LeftAltKey = true;
break;
case"ALT":
this.AltKey = true;
break;
case"F1":
this.KeyCode = 112;
break;
case"F2":
this.KeyCode = 113;
break;
case"F3":
this.KeyCode = 114;
break;
case"F4":
this.KeyCode = 115;
break;
case"F5":
this.KeyCode = 116;
break;
case"F6":
this.KeyCode = 117;
break;
case"F7":
this.KeyCode = 118;
break;
case"F8":
this.KeyCode = 119;
break;
case"F9":
this.KeyCode = 120;
break;
case"F10":
this.KeyCode = 121;
break;
case"F11":
this.KeyCode = 122;
break;
case"F12":
this.KeyCode = 123;
break;
case"ENTER":
this.KeyCode = 13;
break;
case"HOME":
this.KeyCode = 36;
break;
case"END":
this.KeyCode = 35;
break;
case"LEFT":
this.KeyCode = 37;
break;
case"RIGHT":
this.KeyCode = 39;
break;
case"UP":
this.KeyCode = 38;
break;
case"DOWN":
this.KeyCode = 40;
break;
case"PAGEUP":
this.KeyCode = 33;
break;
case"PAGEDOWN":
this.KeyCode = 34;
break;
case"SPACE":
this.KeyCode = 32;
break;
case"TAB":
this.KeyCode = 9;
break;
case"BACK":
this.KeyCode = 8;
break;
case"CONTEXT":
this.KeyCode = 93;
break;
case"ESCAPE":
case"ESC":
this.KeyCode = 27;
break;
case"DELETE":
case"DEL":
this.KeyCode = 46;
break;
case"INSERT":
case"INS":
this.KeyCode = 45;
break;
case"PLUS":
this.KeyCode = "+".charCodeAt(0);
break;
default:
this.KeyCode = e.charCodeAt(0);
break;
}
}
} else {
throw {description: "Invalid shortcut string"};
}
}
};
})($telerik.$, Telerik.Web.UI);
/* END Telerik.Web.UI.Window.RadWindowScripts.js */
/* START Telerik.Web.UI.Window.RadWindowManager.js */
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.WindowManager");
$telerik.toWindowManager = function (a) {
return a;
};
$telerik.findWindowManager = $find;
function GetRadWindowManager() {
return Telerik.Web.UI.WindowManager.Manager;
}
window.radalert = function (g, f, c, e, a, b) {
var d = GetRadWindowManager();
return d.radalert(g, f, c, e, a, b);
};
window.radconfirm = function (h, a, g, d, b, f, c) {
var e = GetRadWindowManager();
return e.radconfirm(h, a, g, d, b, f, c);
};
window.radprompt = function (h, a, g, d, b, f, c) {
var e = GetRadWindowManager();
return e.radprompt(h, a, g, d, b, f, c);
};
window.radopen = function (f, c, g, a, b, e) {
var d = GetRadWindowManager();
return d.open(f, c, null, g, a, b, e);
};
window.radopenWithContainer = function (b, d) {
var c = GetRadWindowManager();
var a = $get(b);
if (!a) {
radalert("Content element with such ClientID not found!<br/> Make sure you have provided a correct ClientID!");
return;
}
return c.open(null, d, a);
};
Telerik.Web.UI.RadWindowManager = function (a) {
Telerik.Web.UI.RadWindowManager.initializeBase(this, [a]);
this._windowIDs = [];
this._windows = [];
this._preserveClientState = false;
this.Open = this.open;
this.GetWindowByName = this.getWindowByName;
this.GetWindowById = this.getWindowById;
this.GetActiveWindow = this.getActiveWindow;
this.GetWindowObjects = this.get_windows;
this.GetWindows = this.get_windows;
this.Cascade = this.cascade;
this.Tile = this.tile;
this.RestoreAll = this.restoreAll;
this.MaximizeAll = this.maximizeAll;
this.MinimizeAll = this.minimizeAll;
this.ShowAll = this.showAll;
this.CloseAll = this.closeAll;
this.CloseActiveWindow = this.closeActiveWindow;
this.MinimizeActiveWindow = this.minimizeActiveWindow;
this.RestoreActiveWindow = this.restoreActiveWindow;
};
Telerik.Web.UI.RadWindowManager.prototype = {
get_zIndex: function () {
return Telerik.Web.UI.RadWindowUtils._zIndex;
}, set_zIndex: function (a) {
if (isNaN(a)) {
return;
}
Telerik.Web.UI.RadWindowUtils._zIndex = a;
}, initialize: function (b) {
try {
var c = this.get_element().style.zIndex;
if (c) {
this.set_zIndex(c);
}
} catch (a) {
}
this._initialize();
this._registerAsPageManager();
if (this.get_preserveClientState()) {
this.restoreState();
}
}, dispose: function () {
var a = this.get_preserveClientState();
if (a) {
this.saveState();
}
this._disposeWindows();
this._windows = null;
Telerik.Web.UI.RadWindowManager.callBaseMethod(this, "dispose");
}, open: function (l, n, b, m, d, e, j) {
var a, g = this.getWindowByName(n);
if (!g) {
if (!n) {
n = this.get_id() + this._getUniqueId();
}
g = this._createWindow(n, b);
var c = this.get_element().className;
if (c) {
g.set_cssClass(c.replace(/^ /, ""));
}
} else {
if (b && this.get_navigateUrl()) {
g._dockMode = false;
}
}
if (l && !g.get_reloadOnShow() && g._iframe && g._iframe.src != l) {
g.setUrl(l);
} else {
if (l) {
g._navigateUrl = l;
}
}
if (m || d) {
g.setSize(m, d);
}
var h = g.get_popupElement();
var f = parseInt(e, 10);
if (!isNaN(f)) {
g.set_left(f);
if (h) {
a = g.getWindowBounds();
g.moveTo(f, a.y);
}
}
var k = parseInt(j, 10);
if (!isNaN(k)) {
g.set_top(k);
if (h) {
a = g.getWindowBounds();
g.moveTo(a.x, k);
}
}
g.show();
return g;
}, radalert: function (g, e, c, d, a, b) {
var f = this._getStandardPopup("alert", g, null, b);
if (typeof(d) != "undefined") {
f.set_title(d);
}
f.setSize(e ? e : 280, c ? c : 200);
f.set_clientCallBackFunction(function (j, h) {
if (a) {
a(h);
}
});
f.center();
f.show();
return f;
}, radconfirm: function (h, a, f, d, b, e, c) {
var g = this._getStandardPopup("confirm", h, null, c);
if (typeof(e) != "undefined") {
g.set_title(e);
}
g.setSize(f ? f : 280, d ? d : 200);
g.set_clientCallBackFunction(function (k, j) {
if (a) {
a(j);
}
});
g.center();
g.show();
return g;
}, radprompt: function (j, a, g, e, b, f, c) {
var h = this._getStandardPopup("prompt", j, c);
if (typeof(f) != "undefined") {
h.set_title(f);
}
h.setSize(g ? g : 280, e ? e : 200);
h.set_clientCallBackFunction(function (l, k) {
if (a) {
a(k);
}
});
h.center();
h.show();
if (c && $telerik.isIE) {
var d = h.get_popupElement().getElementsByTagName("INPUT")[0];
if (d) {
d.value = c;
}
}
return h;
}, getActiveWindow: function () {
return Telerik.Web.UI.RadWindowController.get_activeWindow();
}, getWindowById: function (b) {
var c = this.get_windows();
for (var a = 0;
a < c.length;
a++) {
var d = c[a];
if (b == d.get_id()) {
return d;
}
}
return null;
}, getWindowByName: function (b) {
var c = this.get_windows();
if (!c) {
return null;
}
for (var a = 0;
a < c.length;
a++) {
var d = c[a];
if (b == d.get_name()) {
return d;
}
}
return null;
}, removeWindow: function (a) {
if (!a) {
return;
}
var b = this.getWindowByName(a.get_name());
var c = this.get_windows();
if (b) {
Array.remove(c, b);
}
}, _getUniqueId: function () {
return "" + (new Date() - 100);
}, _initialize: function () {
var a = this._windowIDs;
for (var b = 0;
b < a.length;
b++) {
var d = a[b];
var c = $find(d);
if (!c) {
continue;
}
c.set_windowManager(this);
this._windows[this._windows.length] = c;
}
}, _disposeWindows: function () {
for (var a = 0;
a < this._windows.length;
a++) {
var b = this._windows[a];
if (b.isCloned()) {
b.dispose();
}
}
this._windows = [];
}, clearCloneCache: function () {
this.__clonedProperties__ = null;
}, _createWindow: function (c, a) {
var b = this.clone(c);
b.set_modal(b.isModal());
b.set_centerIfModal(this.get_centerIfModal());
b.set_name(c);
this._windows[this._windows.length] = b;
b.set_windowManager(this);
if (a) {
b.set_contentElement(a);
b._dockMode = true;
b.set_behaviors(b.get_behaviors() & ~Telerik.Web.UI.WindowBehaviors.Reload);
}
return b;
}, _replaceLocalization: function (e, a) {
var d = /##LOC\[(.*?)\]##/;
while (e.match(d)) {
var b = this._getLocalizationString(RegExp.$1);
var c = b ? b : "";
e = e.replace(d, c);
}
return e;
}, _getStandardPopup: function (l, k, f, e) {
var j = this._createWindow(l + this._getUniqueId(), false);
j.set_destroyOnClose(true);
j.set_restrictionZoneID(null);
j.set_modal(true);
k = k.replace(/\$/g, "$$$");
var a = document.getElementById(this.get_id() + "_" + l.toLowerCase() + "template");
var b = $telerik.isIE && !$telerik.isIE9Mode ? "''" : "";
var c = this._stringFormat(a.innerHTML, j.get_id(), k, f ? f : b);
c = this._replaceLocalization(c, Telerik.Web.UI.RadWindowUtils.Localization);
var h = document.createElement("div");
h.innerHTML = c;
h.id = j.get_id() + "_content";
j.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move);
j.set_visibleStatusbar(false);
j._isPredefined = true;
j.set_contentElement(h);
if (l != "prompt" && e != null && e != "null") {
var d = $telerik.$(h).find("div[class*='rwDialog']")[0];
if (d) {
if (e != "") {
d.style.backgroundImage = "url('" + e + "')";
} else {
$telerik.$(d).removeClass("rad" + l);
$telerik.$(d).removeClass("rw" + l.substr(0, 1).toUpperCase() + l.substr(1) + "Dialog");
}
}
}
var g = j.get_contentElement().getElementsByTagName("INPUT")[0];
if (!g) {
g = j.get_contentElement().getElementsByTagName("A")[0];
}
if (g && g.focus) {
window.setTimeout(function () {
var n = true;
if (g.setActive) {
try {
g.setActive();
n = false;
} catch (m) {
}
}
if (n) {
g.focus();
}
}, 0);
}
return j;
}, _stringFormat: function (b) {
for (var a = 1;
a < arguments.length;
a++) {
b = b.replace(new RegExp("\\{" + (a - 1) + "\\}", "ig"), arguments[a]);
}
return b;
}, _registerAsPageManager: function () {
var a = Telerik.Web.UI.WindowManager.Manager;
var b = this.get_id();
if (a && a.get_id() == b) {
a.dispose();
Telerik.Web.UI.WindowManager.Manager = null;
}
if (a && !a.get_id()) {
Telerik.Web.UI.WindowManager.Manager = null;
}
if (!Telerik.Web.UI.WindowManager.Manager) {
Telerik.Web.UI.WindowManager.Manager = this;
}
if (a) {
this._ensureFirstManagerIsRegistered();
}
}, _ensureFirstManagerIsRegistered: function () {
var a = this.get_id(), b = this;
document.body.innerHTML.replace(/\$create\(Telerik.Web.UI.RadWindowManager.*\$get\("([^"]*)"\)/, function (d, c) {
if (a == c) {
Telerik.Web.UI.WindowManager.Manager = b;
}
});
}, saveWindowState: function (c) {
if (!c || !c.isCreated()) {
return;
}
var a = c.getWindowBounds();
var b = (c.isVisible() || c.isMinimized()) + "@" + a.width + "@" + a.height + "@" + a.x + "@" + a.y + "@" + c.isMinimized();
this._setRadWindowCookie(c.get_id(), b);
}, saveState: function () {
var b = this.get_windows();
for (i = 0;
i < b.length;
i++) {
var a = b[i];
if (a.isCloned()) {
this.saveWindowState(a);
}
}
}, restoreState: function () {
function d(g, f) {
var e = f.split("@");
if (e.length > 1) {
if ("true" == e[0] && !g.isVisible()) {
g.show();
}
window.setTimeout(function () {
if (parseInt(e[1]) > 0) {
g.set_width(e[1]);
}
if (parseInt(e[2]) > 0) {
g.set_height(e[2]);
}
if ("true" == e[0]) {
g.moveTo(parseInt(e[3]), parseInt(e[4]));
}
if ("true" == e[5]) {
g.minimize();
}
}, 1);
}
}
var c = this.get_windows();
for (i = 0;
i < c.length;
i++) {
var b = c[i];
var a = this._getRadWindowCookie(b.get_id());
if (a) {
d(b, a);
}
}
}, _getOnlyCookie: function () {
var d = "RadWindowCookie";
var a = document.cookie.split("; ");
for (var c = 0;
c < a.length;
c++) {
var b = a[c].split("=");
if (d == b[0]) {
return b[1];
}
}
return null;
}, _setRadWindowCookie: function (d, f) {
d = "[" + d + "]";
var e = this._getOnlyCookie();
var b = "";
var c = "";
if (e) {
var a = e.split(d);
if (a && a.length > 1) {
b = a[0];
c = a[1].substr(a[1].indexOf("#") + 1);
} else {
c = e;
}
}
var g = new Date();
g.setFullYear(g.getFullYear() + 10);
document.cookie = "RadWindowCookie=" + (b + d + "-" + f + "#" + c) + ";path=/;expires=" + g.toUTCString() + ";";
}, _getRadWindowCookie: function (d) {
var a = this._getOnlyCookie();
if (!a) {
return;
}
var e = null;
d = "[" + d + "]";
var c = a.indexOf(d);
if (c >= 0) {
var b = c + d.length + 1;
e = a.substring(b, a.indexOf("#", b));
}
return e;
}, cascade: function () {
var d = 0;
var c = 0;
var b = this._getWindowsSortedByZindex();
for (var a = 0;
a < b.length;
a++) {
var e = b[a];
if (!e.isClosed() && e.isVisible()) {
e.restore();
e.moveTo(c, d);
e.setActive(true);
d += 25;
c += 25;
}
}
}, tile: function () {
var c = this._getWindowsSortedByZindex();
var e = 0, a;
for (a = 0;
a < c.length;
a++) {
var k = c[a];
if (!k.isClosed() && k.isVisible()) {
e++;
}
}
var f = 5;
var d = 0;
var g = 1;
if (e <= f) {
d = e;
} else {
a = 2;
while ((e * a) < (f * (a + 1))) {
a++;
if (a > 6) {
break;
}
}
g = a;
d = Math.ceil(e / g);
}
var h = $telerik.getClientBounds();
var m = Math.floor(h.width / d);
var l = Math.floor(h.height / g);
var b = document.documentElement.scrollLeft || document.body.scrollLeft;
var o = document.documentElement.scrollTop || document.body.scrollTop;
var n = 0;
for (a = 0;
a < c.length;
a++) {
var j = c[a];
if (!j.isClosed() && j.isVisible()) {
n++;
if ((n - 1) % (d) == 0 && n > d) {
o += l;
b = document.documentElement.scrollLeft || document.body.scrollLeft;
}
j.restore();
j.moveTo(b, o);
j.setSize(m, l);
b += m;
}
}
}, closeActiveWindow: function () {
this._executeActiveWindow("close");
}, minimizeActiveWindow: function () {
this._executeActiveWindow("minimize");
}, restoreActiveWindow: function () {
this._executeActiveWindow("restore");
}, closeAll: function () {
this._executeAll("close");
}, showAll: function () {
this._executeAll("show");
}, minimizeAll: function () {
this._executeAll("minimize");
}, maximizeAll: function () {
this._executeAll("maximize");
}, restoreAll: function () {
this._executeAll("restore");
}, _getWindowsSortedByZindex: function () {
var a = this._windows.concat([]);
var b = function (c, d) {
var e = c.get_zindex();
var f = d.get_zindex();
if (e == f) {
return 0;
}
return (e < f ? -1 : 1);
};
return a.sort(b);
}, _executeAll: function (a) {
if (!this._windows) {
return;
}
var c = this._windows.concat([]);
for (var b = 0;
b < c.length;
b++) {
c[b][a]();
}
}, _executeActiveWindow: function (b) {
var a = this.getActiveWindow();
if (a && "function" == typeof(a[b])) {
a[b]();
}
}, get_preserveClientState: function () {
return this._preserveClientState;
}, set_preserveClientState: function (a) {
if (this._preserveClientState != a) {
this._preserveClientState = a;
}
}, set_windowControls: function (a) {
this._windowIDs = eval(a);
this._disposeWindows();
}, set_child: function (a) {
}, get_windowControls: function () {
}, get_windows: function () {
return this._windows;
}
};
Telerik.Web.UI.RadWindowManager.registerClass("Telerik.Web.UI.RadWindowManager", Telerik.Web.UI.RadWindow);
/* END Telerik.Web.UI.Window.RadWindowManager.js */
/* START AjaxControlToolkit.Common.Common.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.BoxSide = function () {
}
AjaxControlToolkit.BoxSide.prototype = {
Top: 0,
Right: 1,
Bottom: 2,
Left: 3
}
AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false);
AjaxControlToolkit._CommonToolkitScripts = function () {
}
AjaxControlToolkit._CommonToolkitScripts.prototype = {
_borderStyleNames: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
_borderWidthNames: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
_paddingWidthNames: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
_marginWidthNames: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
getCurrentStyle: function (element, attribute, defaultValue) {
var currentValue = null;
if (element) {
if (element.currentStyle) {
currentValue = element.currentStyle[attribute];
} else if (document.defaultView && document.defaultView.getComputedStyle) {
var style = document.defaultView.getComputedStyle(element, null);
if (style) {
currentValue = style[attribute];
}
}
if (!currentValue && element.style.getPropertyValue) {
currentValue = element.style.getPropertyValue(attribute);
}
else if (!currentValue && element.style.getAttribute) {
currentValue = element.style.getAttribute(attribute);
}
}
if ((!currentValue || currentValue == "" || typeof(currentValue) === 'undefined')) {
if (typeof(defaultValue) != 'undefined') {
currentValue = defaultValue;
}
else {
currentValue = null;
}
}
return currentValue;
},
getInheritedBackgroundColor: function (element) {
if (!element) return '#FFFFFF';
var background = this.getCurrentStyle(element, 'backgroundColor');
try {
while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
element = element.parentNode;
if (!element) {
background = '#FFFFFF';
} else {
background = this.getCurrentStyle(element, 'backgroundColor');
}
}
} catch (ex) {
background = '#FFFFFF';
}
return background;
},
getLocation: function (element) {
if (element === document.documentElement) {
return new Sys.UI.Point(0, 0);
}
if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0, 0);
var screenRects = element.getClientRects();
if (!screenRects || !screenRects.length) {
return new Sys.UI.Point(0, 0);
}
var first = screenRects[0];
var dLeft = 0;
var dTop = 0;
var inFrame = false;
try {
inFrame = element.ownerDocument.parentWindow.frameElement;
} catch (ex) {
inFrame = true;
}
if (inFrame) {
var clientRect = element.getBoundingClientRect();
if (!clientRect) {
return new Sys.UI.Point(0, 0);
}
var minLeft = first.left;
var minTop = first.top;
for (var i = 1; i < screenRects.length; i++) {
var r = screenRects[i];
if (r.left < minLeft) {
minLeft = r.left;
}
if (r.top < minTop) {
minTop = r.top;
}
}
dLeft = minLeft - clientRect.left;
dTop = minTop - clientRect.top;
}
var ownerDocument = element.document.documentElement;
return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);
}
return Sys.UI.DomElement.getLocation(element);
},
setLocation: function (element, point) {
Sys.UI.DomElement.setLocation(element, point.x, point.y);
},
getContentSize: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
var size = this.getSize(element);
var borderBox = this.getBorderBox(element);
var paddingBox = this.getPaddingBox(element);
return {
width: size.width - borderBox.horizontal - paddingBox.horizontal,
height: size.height - borderBox.vertical - paddingBox.vertical
}
},
getSize: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
return {
width: element.offsetWidth,
height: element.offsetHeight
};
},
setContentSize: function (element, size) {
if (!element) {
throw Error.argumentNull('element');
}
if (!size) {
throw Error.argumentNull('size');
}
if (this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
var borderBox = this.getBorderBox(element);
var paddingBox = this.getPaddingBox(element);
size = {
width: size.width + borderBox.horizontal + paddingBox.horizontal,
height: size.height + borderBox.vertical + paddingBox.vertical
};
}
element.style.width = size.width.toString() + 'px';
element.style.height = size.height.toString() + 'px';
},
setSize: function (element, size) {
if (!element) {
throw Error.argumentNull('element');
}
if (!size) {
throw Error.argumentNull('size');
}
var borderBox = this.getBorderBox(element);
var paddingBox = this.getPaddingBox(element);
var contentSize = {
width: size.width - borderBox.horizontal - paddingBox.horizontal,
height: size.height - borderBox.vertical - paddingBox.vertical
};
this.setContentSize(element, contentSize);
},
getBounds: function (element) {
var offset = $common.getLocation(element);
return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
},
setBounds: function (element, bounds) {
if (!element) {
throw Error.argumentNull('element');
}
if (!bounds) {
throw Error.argumentNull('bounds');
}
this.setSize(element, bounds);
$common.setLocation(element, bounds);
},
getClientBounds: function () {
var clientWidth;
var clientHeight;
switch (Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight;
break;
case Sys.Browser.Safari:
clientWidth = window.innerWidth;
clientHeight = window.innerHeight;
break;
case Sys.Browser.Opera:
clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
break;
default:
clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
break;
}
return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
},
getMarginBox: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
var box = {
top: this.getMargin(element, AjaxControlToolkit.BoxSide.Top),
right: this.getMargin(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getMargin(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getMargin(element, AjaxControlToolkit.BoxSide.Left)
};
box.horizontal = box.left + box.right;
box.vertical = box.top + box.bottom;
return box;
},
getBorderBox: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
var box = {
top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
};
box.horizontal = box.left + box.right;
box.vertical = box.top + box.bottom;
return box;
},
getPaddingBox: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
var box = {
top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
};
box.horizontal = box.left + box.right;
box.vertical = box.top + box.bottom;
return box;
},
isBorderVisible: function (element, boxSide) {
if (!element) {
throw Error.argumentNull('element');
}
if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
}
var styleName = this._borderStyleNames[boxSide];
var styleValue = this.getCurrentStyle(element, styleName);
return styleValue != "none";
},
getMargin: function (element, boxSide) {
if (!element) {
throw Error.argumentNull('element');
}
if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
}
var styleName = this._marginWidthNames[boxSide];
var styleValue = this.getCurrentStyle(element, styleName);
try {
return this.parsePadding(styleValue);
} catch (ex) {
return 0;
}
},
getBorderWidth: function (element, boxSide) {
if (!element) {
throw Error.argumentNull('element');
}
if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
}
if (!this.isBorderVisible(element, boxSide)) {
return 0;
}
var styleName = this._borderWidthNames[boxSide];
var styleValue = this.getCurrentStyle(element, styleName);
return this.parseBorderWidth(styleValue);
},
getPadding: function (element, boxSide) {
if (!element) {
throw Error.argumentNull('element');
}
if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
}
var styleName = this._paddingWidthNames[boxSide];
var styleValue = this.getCurrentStyle(element, styleName);
return this.parsePadding(styleValue);
},
parseBorderWidth: function (borderWidth) {
if (!this._borderThicknesses) {
var borderThicknesses = {};
var div0 = document.createElement('div');
div0.style.visibility = 'hidden';
div0.style.position = 'absolute';
div0.style.fontSize = '1px';
document.body.appendChild(div0)
var div1 = document.createElement('div');
div1.style.height = '0px';
div1.style.overflow = 'hidden';
div0.appendChild(div1);
var base = div0.offsetHeight;
div1.style.borderTop = 'solid black';
div1.style.borderTopWidth = 'thin';
borderThicknesses['thin'] = div0.offsetHeight - base;
div1.style.borderTopWidth = 'medium';
borderThicknesses['medium'] = div0.offsetHeight - base;
div1.style.borderTopWidth = 'thick';
borderThicknesses['thick'] = div0.offsetHeight - base;
div0.removeChild(div1);
document.body.removeChild(div0);
this._borderThicknesses = borderThicknesses;
}
if (borderWidth) {
switch (borderWidth) {
case 'thin':
case 'medium':
case 'thick':
return this._borderThicknesses[borderWidth];
case 'inherit':
return 0;
}
var unit = this.parseUnit(borderWidth);
Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit, unit.type));
return unit.size;
}
return 0;
},
parsePadding: function (padding) {
if (padding) {
if (padding == 'inherit') {
return 0;
}
var unit = this.parseUnit(padding);
Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit, unit.type));
return unit.size;
}
return 0;
},
parseUnit: function (value) {
if (!value) {
throw Error.argumentNull('value');
}
value = value.trim().toLowerCase();
var l = value.length;
var s = -1;
for (var i = 0; i < l; i++) {
var ch = value.substr(i, 1);
if ((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
break;
}
s = i;
}
if (s == -1) {
throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);
}
var type;
var size;
if (s < (l - 1)) {
type = value.substring(s + 1).trim();
} else {
type = 'px';
}
size = parseFloat(value.substr(0, s + 1));
if (type == 'px') {
size = Math.floor(size);
}
return {
size: size,
type: type
};
},
getElementOpacity: function (element) {
if (!element) {
throw Error.argumentNull('element');
}
var hasOpacity = false;
var opacity;
if (element.filters) {
var filters = element.filters;
if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
if (alphaFilter) {
opacity = alphaFilter.opacity / 100.0;
hasOpacity = true;
}
}
}
else {
opacity = this.getCurrentStyle(element, 'opacity', 1);
hasOpacity = true;
}
if (hasOpacity === false) {
return 1.0;
}
return parseFloat(opacity);
},
setElementOpacity: function (element, value) {
if (!element) {
throw Error.argumentNull('element');
}
if (element.filters) {
var filters = element.filters;
var createFilter = true;
if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
if (alphaFilter) {
createFilter = false;
alphaFilter.opacity = value * 100;
}
}
if (createFilter) {
element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';
}
}
else {
element.style.opacity = value;
}
},
getVisible: function (element) {
return (element &&
("none" != $common.getCurrentStyle(element, "display")) &&
("hidden" != $common.getCurrentStyle(element, "visibility")));
},
setVisible: function (element, value) {
if (element && value != $common.getVisible(element)) {
if (value) {
if (element.style.removeAttribute) {
element.style.removeAttribute("display");
} else {
element.style.removeProperty("display");
}
} else {
element.style.display = 'none';
}
element.style.visibility = value ? 'visible' : 'hidden';
}
},
resolveFunction: function (value) {
if (value) {
if (value instanceof Function) {
return value;
} else if (String.isInstanceOfType(value) && value.length > 0) {
var func;
if ((func = window[value]) instanceof Function) {
return func;
} else if ((func = eval(value)) instanceof Function) {
return func;
}
}
}
return null;
},
addCssClasses: function (element, classNames) {
for (var i = 0; i < classNames.length; i++) {
Sys.UI.DomElement.addCssClass(element, classNames[i]);
}
},
removeCssClasses: function (element, classNames) {
for (var i = 0; i < classNames.length; i++) {
Sys.UI.DomElement.removeCssClass(element, classNames[i]);
}
},
setStyle: function (element, style) {
$common.applyProperties(element.style, style);
},
removeHandlers: function (element, events) {
for (var name in events) {
$removeHandler(element, name, events[name]);
}
},
overlaps: function (r1, r2) {
return r1.x < (r2.x + r2.width)
&& r2.x < (r1.x + r1.width)
&& r1.y < (r2.y + r2.height)
&& r2.y < (r1.y + r1.height);
},
containsPoint: function (rect, x, y) {
return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height);
},
isKeyDigit: function (keyCode) {
return (0x30 <= keyCode && keyCode <= 0x39);
},
isKeyNavigation: function (keyCode) {
return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down);
},
padLeft: function (text, size, ch, truncate) {
return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false);
},
padRight: function (text, size, ch, truncate) {
return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false);
},
_pad: function (text, size, ch, side, truncate) {
text = text.toString();
var length = text.length;
var builder = new Sys.StringBuilder();
if (side == 'r') {
builder.append(text);
}
while (length < size) {
builder.append(ch);
length++;
}
if (side == 'l') {
builder.append(text);
}
var result = builder.toString();
if (truncate && result.length > size) {
if (side == 'l') {
result = result.substr(result.length - size, size);
} else {
result = result.substr(0, size);
}
}
return result;
},
__DOMEvents: {
focusin: {
eventGroup: "UIEvents", init: function (e, p) {
e.initUIEvent("focusin", true, false, window, 1);
}
},
focusout: {
eventGroup: "UIEvents", init: function (e, p) {
e.initUIEvent("focusout", true, false, window, 1);
}
},
activate: {
eventGroup: "UIEvents", init: function (e, p) {
e.initUIEvent("activate", true, true, window, 1);
}
},
focus: {
eventGroup: "UIEvents", init: function (e, p) {
e.initUIEvent("focus", false, false, window, 1);
}
},
blur: {
eventGroup: "UIEvents", init: function (e, p) {
e.initUIEvent("blur", false, false, window, 1);
}
},
click: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
dblclick: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
mousedown: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
mouseup: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
mouseover: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
mousemove: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
mouseout: {
eventGroup: "MouseEvents", init: function (e, p) {
e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);
}
},
load: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("load", false, false);
}
},
unload: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("unload", false, false);
}
},
select: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("select", true, false);
}
},
change: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("change", true, false);
}
},
submit: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("submit", true, true);
}
},
reset: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("reset", true, false);
}
},
resize: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("resize", true, false);
}
},
scroll: {
eventGroup: "HTMLEvents", init: function (e, p) {
e.initEvent("scroll", true, false);
}
}
},
tryFireRawEvent: function (element, rawEvent) {
try {
if (element.fireEvent) {
element.fireEvent("on" + rawEvent.type, rawEvent);
return true;
} else if (element.dispatchEvent) {
element.dispatchEvent(rawEvent);
return true;
}
} catch (e) {
}
return false;
},
tryFireEvent: function (element, eventName, properties) {
try {
if (document.createEventObject) {
var e = document.createEventObject();
$common.applyProperties(e, properties || {});
element.fireEvent("on" + eventName, e);
return true;
} else if (document.createEvent) {
var def = $common.__DOMEvents[eventName];
if (def) {
var e = document.createEvent(def.eventGroup);
def.init(e, properties || {});
element.dispatchEvent(e);
return true;
}
}
} catch (e) {
}
return false;
},
wrapElement: function (innerElement, newOuterElement, newInnerParentElement) {
var parent = innerElement.parentNode;
parent.replaceChild(newOuterElement, innerElement);
(newInnerParentElement || newOuterElement).appendChild(innerElement);
},
unwrapElement: function (innerElement, oldOuterElement) {
var parent = oldOuterElement.parentNode;
if (parent != null) {
$common.removeElement(innerElement);
parent.replaceChild(innerElement, oldOuterElement);
}
},
removeElement: function (element) {
var parent = element.parentNode;
if (parent != null) {
parent.removeChild(element);
}
},
applyProperties: function (target, properties) {
for (var p in properties) {
var pv = properties[p];
if (pv != null && Object.getType(pv) === Object) {
var tv = target[p];
$common.applyProperties(tv, pv);
} else {
target[p] = pv;
}
}
},
createElementFromTemplate: function (template, appendToParent, nameTable) {
if (typeof(template.nameTable) != 'undefined') {
var newNameTable = template.nameTable;
if (String.isInstanceOfType(newNameTable)) {
newNameTable = nameTable[newNameTable];
}
if (newNameTable != null) {
nameTable = newNameTable;
}
}
var elementName = null;
if (typeof(template.name) !== 'undefined') {
elementName = template.name;
}
var elt = document.createElement(template.nodeName);
if (typeof(template.name) !== 'undefined' && nameTable) {
nameTable[template.name] = elt;
}
if (typeof(template.parent) !== 'undefined' && appendToParent == null) {
var newParent = template.parent;
if (String.isInstanceOfType(newParent)) {
newParent = nameTable[newParent];
}
if (newParent != null) {
appendToParent = newParent;
}
}
if (typeof(template.properties) !== 'undefined' && template.properties != null) {
$common.applyProperties(elt, template.properties);
}
if (typeof(template.cssClasses) !== 'undefined' && template.cssClasses != null) {
$common.addCssClasses(elt, template.cssClasses);
}
if (typeof(template.events) !== 'undefined' && template.events != null) {
$addHandlers(elt, template.events);
}
if (typeof(template.visible) !== 'undefined' && template.visible != null) {
this.setVisible(elt, template.visible);
}
if (appendToParent) {
appendToParent.appendChild(elt);
}
if (typeof(template.opacity) !== 'undefined' && template.opacity != null) {
$common.setElementOpacity(elt, template.opacity);
}
if (typeof(template.children) !== 'undefined' && template.children != null) {
for (var i = 0; i < template.children.length; i++) {
var subtemplate = template.children[i];
$common.createElementFromTemplate(subtemplate, elt, nameTable);
}
}
var contentPresenter = elt;
if (typeof(template.contentPresenter) !== 'undefined' && template.contentPresenter != null) {
contentPresenter = nameTable[contentPresenter];
}
if (typeof(template.content) !== 'undefined' && template.content != null) {
var content = template.content;
if (String.isInstanceOfType(content)) {
content = nameTable[content];
}
if (content.parentNode) {
$common.wrapElement(content, elt, contentPresenter);
} else {
contentPresenter.appendChild(content);
}
}
return elt;
},
prepareHiddenElementForATDeviceUpdate: function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');
if (!objHidden) {
var objHidden = document.createElement('input');
objHidden.setAttribute('type', 'hidden');
objHidden.setAttribute('value', '1');
objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');
objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');
if (document.forms[0]) {
document.forms[0].appendChild(objHidden);
}
}
},
updateFormToRefreshATDeviceBuffer: function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');
if (objHidden) {
if (objHidden.getAttribute('value') == '1') {
objHidden.setAttribute('value', '0');
} else {
objHidden.setAttribute('value', '1');
}
}
}
}
var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();
var $common = CommonToolkitScripts;
Sys.UI.DomElement.getVisible = $common.getVisible;
Sys.UI.DomElement.setVisible = $common.setVisible;
Sys.UI.Control.overlaps = $common.overlaps;
AjaxControlToolkit._DomUtility = function () {
}
AjaxControlToolkit._DomUtility.prototype = {
isDescendant: function (ancestor, descendant) {
for (var n = descendant.parentNode; n != null; n = n.parentNode) {
if (n == ancestor) return true;
}
return false;
},
isDescendantOrSelf: function (ancestor, descendant) {
if (ancestor === descendant)
return true;
return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
},
isAncestor: function (descendant, ancestor) {
return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
},
isAncestorOrSelf: function (descendant, ancestor) {
if (descendant === ancestor)
return true;
return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
},
isSibling: function (self, sibling) {
var parent = self.parentNode;
for (var i = 0; i < parent.childNodes.length; i++) {
if (parent.childNodes[i] == sibling) return true;
}
return false;
}
}
AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");
AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility();
AjaxControlToolkit.TextBoxWrapper = function (element) {
AjaxControlToolkit.TextBoxWrapper.initializeBase(this, [element]);
this._current = element.value;
this._watermark = null;
this._isWatermarked = false;
}
AjaxControlToolkit.TextBoxWrapper.prototype = {
dispose: function () {
this.get_element().AjaxControlToolkitTextBoxWrapper = null;
AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this, 'dispose');
},
get_Current: function () {
this._current = this.get_element().value;
return this._current;
},
set_Current: function (value) {
this._current = value;
this._updateElement();
},
get_Value: function () {
if (this.get_IsWatermarked()) {
return "";
} else {
return this.get_Current();
}
},
set_Value: function (text) {
this.set_Current(text);
if (!text || (0 == text.length)) {
if (null != this._watermark) {
this.set_IsWatermarked(true);
}
} else {
this.set_IsWatermarked(false);
}
},
get_Watermark: function () {
return this._watermark;
},
set_Watermark: function (value) {
this._watermark = value;
this._updateElement();
},
get_IsWatermarked: function () {
return this._isWatermarked;
},
set_IsWatermarked: function (isWatermarked) {
if (this._isWatermarked != isWatermarked) {
this._isWatermarked = isWatermarked;
this._updateElement();
this._raiseWatermarkChanged();
}
},
_updateElement: function () {
var element = this.get_element();
if (this._isWatermarked) {
if (element.value != this._watermark) {
element.value = this._watermark;
}
} else {
if (element.value != this._current) {
element.value = this._current;
}
}
},
add_WatermarkChanged: function (handler) {
this.get_events().addHandler("WatermarkChanged", handler);
},
remove_WatermarkChanged: function (handler) {
this.get_events().removeHandler("WatermarkChanged", handler);
},
_raiseWatermarkChanged: function () {
var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged");
if (onWatermarkChangedHandler) {
onWatermarkChangedHandler(this, Sys.EventArgs.Empty);
}
}
}
AjaxControlToolkit.TextBoxWrapper.get_Wrapper = function (element) {
if (null == element.AjaxControlToolkitTextBoxWrapper) {
element.AjaxControlToolkitTextBoxWrapper = new AjaxControlToolkit.TextBoxWrapper(element);
}
return element.AjaxControlToolkitTextBoxWrapper;
}
AjaxControlToolkit.TextBoxWrapper.registerClass('AjaxControlToolkit.TextBoxWrapper', Sys.UI.Behavior);
AjaxControlToolkit.TextBoxWrapper.validatorGetValue = function (id) {
var control = $get(id);
if (control && control.AjaxControlToolkitTextBoxWrapper) {
return control.AjaxControlToolkitTextBoxWrapper.get_Value();
}
return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(id);
}
if (typeof(ValidatorGetValue) == 'function') {
AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue;
ValidatorGetValue = AjaxControlToolkit.TextBoxWrapper.validatorGetValue;
}
if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
try {
Sys.CultureInfo.prototype._getAbbrMonthIndex('');
} catch (ex) {
Sys.CultureInfo.prototype._getAbbrMonthIndex = function (value) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}
return Array.indexOf(this._upperAbbrMonths, this._toUpper(value));
}
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
}
}
/* END AjaxControlToolkit.Common.Common.js */
/* START AjaxControlToolkit.ExtenderBase.BaseScripts.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.BehaviorBase = function (element) {
AjaxControlToolkit.BehaviorBase.initializeBase(this, [element]);
this._clientStateFieldID = null;
this._pageRequestManager = null;
this._partialUpdateBeginRequestHandler = null;
this._partialUpdateEndRequestHandler = null;
}
AjaxControlToolkit.BehaviorBase.prototype = {
initialize: function () {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'initialize');
},
dispose: function () {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'dispose');
if (this._pageRequestManager) {
if (this._partialUpdateBeginRequestHandler) {
this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateBeginRequestHandler = null;
}
if (this._partialUpdateEndRequestHandler) {
this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
this._partialUpdateEndRequestHandler = null;
}
this._pageRequestManager = null;
}
},
get_ClientStateFieldID: function () {
return this._clientStateFieldID;
},
set_ClientStateFieldID: function (value) {
if (this._clientStateFieldID != value) {
this._clientStateFieldID = value;
this.raisePropertyChanged('ClientStateFieldID');
}
},
get_ClientState: function () {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);
if (input) {
return input.value;
}
}
return null;
},
set_ClientState: function (value) {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);
if (input) {
input.value = value;
}
}
},
registerPartialUpdateEvents: function () {
if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) {
this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
if (this._pageRequestManager) {
this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);
this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);
this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
}
}
},
_partialUpdateBeginRequest: function (sender, beginRequestEventArgs) {
},
_partialUpdateEndRequest: function (sender, endRequestEventArgs) {
}
}
AjaxControlToolkit.BehaviorBase.registerClass('AjaxControlToolkit.BehaviorBase', Sys.UI.Behavior);
AjaxControlToolkit.DynamicPopulateBehaviorBase = function (element) {
AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this, [element]);
this._DynamicControlID = null;
this._DynamicContextKey = null;
this._DynamicServicePath = null;
this._DynamicServiceMethod = null;
this._cacheDynamicResults = false;
this._dynamicPopulateBehavior = null;
this._populatingHandler = null;
this._populatedHandler = null;
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype = {
initialize: function () {
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize');
this._populatingHandler = Function.createDelegate(this, this._onPopulating);
this._populatedHandler = Function.createDelegate(this, this._onPopulated);
},
dispose: function () {
if (this._populatedHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);
}
this._populatedHandler = null;
}
if (this._populatingHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);
}
this._populatingHandler = null;
}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior = null;
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose');
},
populate: function (contextKeyOverride) {
if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) {
this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior = null;
}
if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) {
this._dynamicPopulateBehavior = $create(AjaxControlToolkit.DynamicPopulateBehavior,
{
"id": this.get_id() + "_DynamicPopulateBehavior",
"ContextKey": this._DynamicContextKey,
"ServicePath": this._DynamicServicePath,
"ServiceMethod": this._DynamicServiceMethod,
"cacheDynamicResults": this._cacheDynamicResults
}, null, null, $get(this._DynamicControlID));
this._dynamicPopulateBehavior.add_populating(this._populatingHandler);
this._dynamicPopulateBehavior.add_populated(this._populatedHandler);
}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey);
}
},
_onPopulating: function (sender, eventArgs) {
this.raisePopulating(eventArgs);
},
_onPopulated: function (sender, eventArgs) {
this.raisePopulated(eventArgs);
},
get_dynamicControlID: function () {
return this._DynamicControlID;
},
get_DynamicControlID: this.get_dynamicControlID,
set_dynamicControlID: function (value) {
if (this._DynamicControlID != value) {
this._DynamicControlID = value;
this.raisePropertyChanged('dynamicControlID');
this.raisePropertyChanged('DynamicControlID');
}
},
set_DynamicControlID: this.set_dynamicControlID,
get_dynamicContextKey: function () {
return this._DynamicContextKey;
},
get_DynamicContextKey: this.get_dynamicContextKey,
set_dynamicContextKey: function (value) {
if (this._DynamicContextKey != value) {
this._DynamicContextKey = value;
this.raisePropertyChanged('dynamicContextKey');
this.raisePropertyChanged('DynamicContextKey');
}
},
set_DynamicContextKey: this.set_dynamicContextKey,
get_dynamicServicePath: function () {
return this._DynamicServicePath;
},
get_DynamicServicePath: this.get_dynamicServicePath,
set_dynamicServicePath: function (value) {
if (this._DynamicServicePath != value) {
this._DynamicServicePath = value;
this.raisePropertyChanged('dynamicServicePath');
this.raisePropertyChanged('DynamicServicePath');
}
},
set_DynamicServicePath: this.set_dynamicServicePath,
get_dynamicServiceMethod: function () {
return this._DynamicServiceMethod;
},
get_DynamicServiceMethod: this.get_dynamicServiceMethod,
set_dynamicServiceMethod: function (value) {
if (this._DynamicServiceMethod != value) {
this._DynamicServiceMethod = value;
this.raisePropertyChanged('dynamicServiceMethod');
this.raisePropertyChanged('DynamicServiceMethod');
}
},
set_DynamicServiceMethod: this.set_dynamicServiceMethod,
get_cacheDynamicResults: function () {
return this._cacheDynamicResults;
},
set_cacheDynamicResults: function (value) {
if (this._cacheDynamicResults != value) {
this._cacheDynamicResults = value;
this.raisePropertyChanged('cacheDynamicResults');
}
},
add_populated: function (handler) {
this.get_events().addHandler("populated", handler);
},
remove_populated: function (handler) {
this.get_events().removeHandler("populated", handler);
},
raisePopulated: function (arg) {
var handler = this.get_events().getHandler("populated");
if (handler) handler(this, arg);
},
add_populating: function (handler) {
this.get_events().addHandler('populating', handler);
},
remove_populating: function (handler) {
this.get_events().removeHandler('populating', handler);
},
raisePopulating: function (eventArgs) {
var handler = this.get_events().getHandler('populating');
if (handler) {
handler(this, eventArgs);
}
}
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass('AjaxControlToolkit.DynamicPopulateBehaviorBase', AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.ControlBase = function (element) {
AjaxControlToolkit.ControlBase.initializeBase(this, [element]);
this._clientStateField = null;
this._callbackTarget = null;
this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit);
this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete);
this._onerror$delegate = Function.createDelegate(this, this._onerror);
}
AjaxControlToolkit.ControlBase.prototype = {
initialize: function () {
AjaxControlToolkit.ControlBase.callBaseMethod(this, "initialize");
if (this._clientStateField) {
this.loadClientState(this._clientStateField.value);
}
if (typeof(Sys.WebForms) !== "undefined" && typeof(Sys.WebForms.PageRequestManager) !== "undefined") {
Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
} else {
$addHandler(document.forms[0], "submit", this._onsubmit$delegate);
}
},
dispose: function () {
if (typeof(Sys.WebForms) !== "undefined" && typeof(Sys.WebForms.PageRequestManager) !== "undefined") {
Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);
} else {
$removeHandler(document.forms[0], "submit", this._onsubmit$delegate);
}
AjaxControlToolkit.ControlBase.callBaseMethod(this, "dispose");
},
findElement: function (id) {
return $get(this.get_id() + '_' + id.split(':').join('_'));
},
get_clientStateField: function () {
return this._clientStateField;
},
set_clientStateField: function (value) {
if (this.get_isInitialized()) throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);
if (this._clientStateField != value) {
this._clientStateField = value;
this.raisePropertyChanged('clientStateField');
}
},
loadClientState: function (value) {
},
saveClientState: function () {
return null;
},
_invoke: function (name, args, cb) {
if (!this._callbackTarget) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);
}
if (typeof(WebForm_DoCallback) === "undefined") {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);
}
var ar = [];
for (var i = 0; i < args.length; i++)
ar[i] = args[i];
var clientState = this.saveClientState();
if (clientState != null && !String.isInstanceOfType(clientState)) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);
}
var payload = Sys.Serialization.JavaScriptSerializer.serialize({
name: name,
args: ar,
state: this.saveClientState()
});
WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true);
},
_oncomplete: function (result, context) {
result = Sys.Serialization.JavaScriptSerializer.deserialize(result);
if (result.error) {
throw Error.create(result.error);
}
this.loadClientState(result.state);
context(result.result);
},
_onerror: function (message, context) {
throw Error.create(message);
},
_onsubmit: function () {
if (this._clientStateField) {
this._clientStateField.value = this.saveClientState();
}
return true;
}
}
AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase", Sys.UI.Control);
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.Resources = {
"PasswordStrength_InvalidWeightingRatios": "Strength Weighting ratios must have 4 elements",
"Animation_ChildrenNotAllowed": "AjaxControlToolkit.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from AjaxControlToolkit.Animation.ParentAnimation",
"PasswordStrength_RemainingSymbols": "{0} symbol characters",
"ExtenderBase_CannotSetClientStateField": "clientStateField can only be set before initialization",
"RTE_PreviewHTML": "Preview HTML",
"RTE_JustifyCenter": "Justify Center",
"PasswordStrength_RemainingUpperCase": "{0} more upper case characters",
"Animation_TargetNotFound": "AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control. No element or control could be found corresponding to \"{0}\"",
"RTE_FontColor": "Font Color",
"RTE_LabelColor": "Label Color",
"Common_InvalidBorderWidthUnit": "A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth",
"RTE_Heading": "Heading",
"Tabs_PropertySetBeforeInitialization": "{0} cannot be changed before initialization",
"RTE_OrderedList": "Ordered List",
"ReorderList_DropWatcherBehavior_NoChild": "Could not find child of list with id \"{0}\"",
"CascadingDropDown_MethodTimeout": "[Method timeout]",
"RTE_Columns": "Columns",
"RTE_InsertImage": "Insert Image",
"RTE_InsertTable": "Insert Table",
"RTE_Values": "Values",
"RTE_OK": "OK",
"ExtenderBase_PageNotRegisteredForCallbacks": "This Page has not been registered for callbacks",
"Animation_NoDynamicPropertyFound": "AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"",
"Animation_InvalidBaseType": "AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation",
"RTE_UnorderedList": "Unordered List",
"ResizableControlBehavior_InvalidHandler": "{0} handler not a function, function name, or function text",
"Animation_InvalidColor": "Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"",
"RTE_CellColor": "Cell Color",
"PasswordStrength_RemainingMixedCase": "Mixed case characters",
"RTE_Italic": "Italic",
"CascadingDropDown_NoParentElement": "Failed to find parent element \"{0}\"",
"ValidatorCallout_DefaultErrorMessage": "This control is invalid",
"RTE_Indent": "Indent",
"ReorderList_DropWatcherBehavior_CallbackError": "Reorder failed, see details below.\\r\\n\\r\\n{0}",
"PopupControl_NoDefaultProperty": "No default property supported for control \"{0}\" of type \"{1}\"",
"RTE_Normal": "Normal",
"PopupExtender_NoParentElement": "Couldn\u0027t find parent element \"{0}\"",
"RTE_ViewValues": "View Values",
"RTE_Legend": "Legend",
"RTE_Labels": "Labels",
"RTE_CellSpacing": "Cell Spacing",
"PasswordStrength_RemainingNumbers": "{0} more numbers",
"RTE_Border": "Border",
"RTE_Create": "Create",
"RTE_BackgroundColor": "Background Color",
"RTE_Cancel": "Cancel",
"RTE_JustifyFull": "Justify Full",
"RTE_JustifyLeft": "Justify Left",
"RTE_Cut": "Cut",
"ResizableControlBehavior_CannotChangeProperty": "Changes to {0} not supported",
"RTE_ViewSource": "View Source",
"Common_InvalidPaddingUnit": "A unit type of \"{0}\" is invalid for parsePadding",
"RTE_Paste": "Paste",
"ExtenderBase_ControlNotRegisteredForCallbacks": "This Control has not been registered for callbacks",
"Calendar_Today": "Today: {0}",
"MultiHandleSlider_CssHeightWidthRequired": "You must specify a CSS width and height for all handle styles as well as the rail.",
"Common_DateTime_InvalidFormat": "Invalid format",
"ListSearch_DefaultPrompt": "Type to search",
"CollapsiblePanel_NoControlID": "Failed to find element \"{0}\"",
"RTE_ViewEditor": "View Editor",
"RTE_BarColor": "Bar Color",
"PasswordStrength_DefaultStrengthDescriptions": "NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!",
"RTE_Inserttexthere": "Insert text here",
"Animation_UknownAnimationName": "AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"",
"ExtenderBase_InvalidClientStateType": "saveClientState must return a value of type String",
"Rating_CallbackError": "An unhandled exception has occurred:\\r\\n{0}",
"Tabs_OwnerExpected": "owner must be set before initialize",
"DynamicPopulate_WebServiceTimeout": "Web service call timed out",
"PasswordStrength_RemainingLowerCase": "{0} more lower case characters",
"Animation_MissingAnimationName": "AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property",
"RTE_JustifyRight": "Justify Right",
"Tabs_ActiveTabArgumentOutOfRange": "Argument is not a member of the tabs collection",
"RTE_CellPadding": "Cell Padding",
"RTE_ClearFormatting": "Clear Formatting",
"AlwaysVisible_ElementRequired": "AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element",
"Slider_NoSizeProvided": "Please set valid values for the height and width attributes in the slider\u0027s CSS classes",
"DynamicPopulate_WebServiceError": "Web Service call failed: {0}",
"PasswordStrength_StrengthPrompt": "Strength: ",
"PasswordStrength_RemainingCharacters": "{0} more characters",
"PasswordStrength_Satisfied": "Nothing more required",
"RTE_Hyperlink": "Hyperlink",
"Animation_NoPropertyFound": "AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\"",
"PasswordStrength_InvalidStrengthDescriptionStyles": "Text Strength description style classes must match the number of text descriptions.",
"PasswordStrength_GetHelpRequirements": "Get help on password requirements",
"PasswordStrength_InvalidStrengthDescriptions": "Invalid number of text strength descriptions specified",
"RTE_Underline": "Underline",
"Tabs_PropertySetAfterInitialization": "{0} cannot be changed after initialization",
"RTE_Rows": "Rows",
"RTE_Redo": "Redo",
"RTE_Size": "Size",
"RTE_Undo": "Undo",
"RTE_Bold": "Bold",
"RTE_Copy": "Copy",
"RTE_Font": "Font",
"CascadingDropDown_MethodError": "[Method error {0}]",
"RTE_BorderColor": "Border Color",
"RTE_Paragraph": "Paragraph",
"RTE_InsertHorizontalRule": "Insert Horizontal Rule",
"Common_UnitHasNoDigits": "No digits",
"RTE_Outdent": "Outdent",
"Common_DateTime_InvalidTimeSpan": "\"{0}\" is not a valid TimeSpan format",
"Animation_CannotNestSequence": "AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation",
"Shared_BrowserSecurityPreventsPaste": "Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."
};
/* END AjaxControlToolkit.ExtenderBase.BaseScripts.js */
/* START AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.DynamicPopulateBehavior = function (element) {
AjaxControlToolkit.DynamicPopulateBehavior.initializeBase(this, [element]);
this._servicePath = null;
this._serviceMethod = null;
this._contextKey = null;
this._cacheDynamicResults = false;
this._populateTriggerID = null;
this._setUpdatingCssClass = null;
this._clearDuringUpdate = true;
this._customScript = null;
this._clickHandler = null;
this._callID = 0;
this._currentCallID = -1;
this._populated = false;
}
AjaxControlToolkit.DynamicPopulateBehavior.prototype = {
initialize: function () {
AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this, 'initialize');
$common.prepareHiddenElementForATDeviceUpdate();
if (this._populateTriggerID) {
var populateTrigger = $get(this._populateTriggerID);
if (populateTrigger) {
this._clickHandler = Function.createDelegate(this, this._onPopulateTriggerClick);
$addHandler(populateTrigger, "click", this._clickHandler);
}
}
},
dispose: function () {
if (this._populateTriggerID && this._clickHandler) {
var populateTrigger = $get(this._populateTriggerID);
if (populateTrigger) {
$removeHandler(populateTrigger, "click", this._clickHandler);
}
this._populateTriggerID = null;
this._clickHandler = null;
}
AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this, 'dispose');
},
populate: function (contextKey) {
if (this._populated && this._cacheDynamicResults) {
return;
}
if (this._currentCallID == -1) {
var eventArgs = new Sys.CancelEventArgs();
this.raisePopulating(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
this._setUpdating(true);
}
if (this._customScript) {
var scriptResult = eval(this._customScript);
this._setTargetHtml(scriptResult);
this._setUpdating(false);
} else {
this._currentCallID = ++this._callID;
if (this._servicePath && this._serviceMethod) {
Sys.Net.WebServiceProxy.invoke(this._servicePath, this._serviceMethod, false,
{contextKey: (contextKey ? contextKey : this._contextKey)},
Function.createDelegate(this, this._onMethodComplete), Function.createDelegate(this, this._onMethodError),
this._currentCallID);
$common.updateFormToRefreshATDeviceBuffer();
}
}
},
_onMethodComplete: function (result, userContext, methodName) {
if (userContext != this._currentCallID) return;
this._setTargetHtml(result);
this._setUpdating(false);
},
_onMethodError: function (webServiceError, userContext, methodName) {
if (userContext != this._currentCallID) return;
if (webServiceError.get_timedOut()) {
this._setTargetHtml(AjaxControlToolkit.Resources.DynamicPopulate_WebServiceTimeout);
} else {
this._setTargetHtml(String.format(AjaxControlToolkit.Resources.DynamicPopulate_WebServiceError, webServiceError.get_statusCode()));
}
this._setUpdating(false);
},
_onPopulateTriggerClick: function () {
this.populate(this._contextKey);
},
_setUpdating: function (updating) {
this.setStyle(updating);
if (!updating) {
this._currentCallID = -1;
this._populated = true;
this.raisePopulated(this, Sys.EventArgs.Empty);
}
},
_setTargetHtml: function (value) {
var e = this.get_element()
if (e) {
if (e.tagName == "INPUT") {
e.value = value;
} else {
e.innerHTML = value;
}
}
},
setStyle: function (updating) {
var e = this.get_element();
if (this._setUpdatingCssClass) {
if (!updating) {
e.className = this._oldCss;
this._oldCss = null;
} else {
this._oldCss = e.className;
e.className = this._setUpdatingCssClass;
}
}
if (updating && this._clearDuringUpdate) {
this._setTargetHtml("");
}
},
get_ClearContentsDuringUpdate: function () {
return this._clearDuringUpdate;
},
set_ClearContentsDuringUpdate: function (value) {
if (this._clearDuringUpdate != value) {
this._clearDuringUpdate = value;
this.raisePropertyChanged('ClearContentsDuringUpdate');
}
},
get_ContextKey: function () {
return this._contextKey;
},
set_ContextKey: function (value) {
if (this._contextKey != value) {
this._contextKey = value;
this.raisePropertyChanged('ContextKey');
}
},
get_PopulateTriggerID: function () {
return this._populateTriggerID;
},
set_PopulateTriggerID: function (value) {
if (this._populateTriggerID != value) {
this._populateTriggerID = value;
this.raisePropertyChanged('PopulateTriggerID');
}
},
get_ServicePath: function () {
return this._servicePath;
},
set_ServicePath: function (value) {
if (this._servicePath != value) {
this._servicePath = value;
this.raisePropertyChanged('ServicePath');
}
},
get_ServiceMethod: function () {
return this._serviceMethod;
},
set_ServiceMethod: function (value) {
if (this._serviceMethod != value) {
this._serviceMethod = value;
this.raisePropertyChanged('ServiceMethod');
}
},
get_cacheDynamicResults: function () {
return this._cacheDynamicResults;
},
set_cacheDynamicResults: function (value) {
if (this._cacheDynamicResults != value) {
this._cacheDynamicResults = value;
this.raisePropertyChanged('cacheDynamicResults');
}
},
get_UpdatingCssClass: function () {
return this._setUpdatingCssClass;
},
set_UpdatingCssClass: function (value) {
if (this._setUpdatingCssClass != value) {
this._setUpdatingCssClass = value;
this.raisePropertyChanged('UpdatingCssClass');
}
},
get_CustomScript: function () {
return this._customScript;
},
set_CustomScript: function (value) {
if (this._customScript != value) {
this._customScript = value;
this.raisePropertyChanged('CustomScript');
}
},
add_populating: function (handler) {
this.get_events().addHandler('populating', handler);
},
remove_populating: function (handler) {
this.get_events().removeHandler('populating', handler);
},
raisePopulating: function (eventArgs) {
var handler = this.get_events().getHandler('populating');
if (handler) {
handler(this, eventArgs);
}
},
add_populated: function (handler) {
this.get_events().addHandler('populated', handler);
},
remove_populated: function (handler) {
this.get_events().removeHandler('populated', handler);
},
raisePopulated: function (eventArgs) {
var handler = this.get_events().getHandler('populated');
if (handler) {
handler(this, eventArgs);
}
}
}
AjaxControlToolkit.DynamicPopulateBehavior.registerClass('AjaxControlToolkit.DynamicPopulateBehavior', AjaxControlToolkit.BehaviorBase);
/* END AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js */
/* START AjaxControlToolkit.Compat.Timer.Timer.js */
/////////////////////////////////////////////////////////////////////////////
Sys.Timer = function () {
Sys.Timer.initializeBase(this);
this._interval = 1000;
this._enabled = false;
this._timer = null;
}
Sys.Timer.prototype = {
get_interval: function () {
return this._interval;
},
set_interval: function (value) {
if (this._interval !== value) {
this._interval = value;
this.raisePropertyChanged('interval');
if (!this.get_isUpdating() && (this._timer !== null)) {
this._stopTimer();
this._startTimer();
}
}
},
get_enabled: function () {
return this._enabled;
},
set_enabled: function (value) {
if (value !== this.get_enabled()) {
this._enabled = value;
this.raisePropertyChanged('enabled');
if (!this.get_isUpdating()) {
if (value) {
this._startTimer();
}
else {
this._stopTimer();
}
}
}
},
add_tick: function (handler) {
this.get_events().addHandler("tick", handler);
},
remove_tick: function (handler) {
this.get_events().removeHandler("tick", handler);
},
dispose: function () {
this.set_enabled(false);
this._stopTimer();
Sys.Timer.callBaseMethod(this, 'dispose');
},
updated: function () {
Sys.Timer.callBaseMethod(this, 'updated');
if (this._enabled) {
this._stopTimer();
this._startTimer();
}
},
_timerCallback: function () {
var handler = this.get_events().getHandler("tick");
if (handler) {
handler(this, Sys.EventArgs.Empty);
}
},
_startTimer: function () {
this._timer = window.setInterval(Function.createDelegate(this, this._timerCallback), this._interval);
},
_stopTimer: function () {
window.clearInterval(this._timer);
this._timer = null;
}
}
Sys.Timer.descriptor = {
properties: [{name: 'interval', type: Number},
{name: 'enabled', type: Boolean}],
events: [{name: 'tick'}]
}
Sys.Timer.registerClass('Sys.Timer', Sys.Component);
/* END AjaxControlToolkit.Compat.Timer.Timer.js */
/* START AjaxControlToolkit.Animation.Animations.js */
Type.registerNamespace('AjaxControlToolkit.Animation');
var $AA = AjaxControlToolkit.Animation;
$AA.registerAnimation = function (name, type) {
if (type && ((type === $AA.Animation) || (type.inheritsFrom && type.inheritsFrom($AA.Animation)))) {
if (!$AA.__animations) {
$AA.__animations = {};
}
$AA.__animations[name.toLowerCase()] = type;
type.play = function () {
var animation = new type();
type.apply(animation, arguments);
animation.initialize();
var handler = Function.createDelegate(animation,
function () {
animation.remove_ended(handler);
handler = null;
animation.dispose();
});
animation.add_ended(handler);
animation.play();
}
} else {
throw Error.argumentType('type', type, $AA.Animation, AjaxControlToolkit.Resources.Animation_InvalidBaseType);
}
}
$AA.buildAnimation = function (json, defaultTarget) {
if (!json || json === '') {
return null;
}
var obj;
json = '(' + json + ')';
if (!Sys.Debug.isDebug) {
try {
obj = Sys.Serialization.JavaScriptSerializer.deserialize(json);
} catch (ex) {
}
} else {
obj = Sys.Serialization.JavaScriptSerializer.deserialize(json);
}
return $AA.createAnimation(obj, defaultTarget);
}
$AA.createAnimation = function (obj, defaultTarget) {
if (!obj || !obj.AnimationName) {
throw Error.argument('obj', AjaxControlToolkit.Resources.Animation_MissingAnimationName);
}
var type = $AA.__animations[obj.AnimationName.toLowerCase()];
if (!type) {
throw Error.argument('type', String.format(AjaxControlToolkit.Resources.Animation_UknownAnimationName, obj.AnimationName));
}
var animation = new type();
if (defaultTarget) {
animation.set_target(defaultTarget);
}
if (obj.AnimationChildren && obj.AnimationChildren.length) {
if ($AA.ParentAnimation.isInstanceOfType(animation)) {
for (var i = 0; i < obj.AnimationChildren.length; i++) {
var child = $AA.createAnimation(obj.AnimationChildren[i]);
if (child) {
animation.add(child);
}
}
} else {
throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_ChildrenNotAllowed, type.getName()));
}
}
var properties = type.__animationProperties;
if (!properties) {
type.__animationProperties = {};
type.resolveInheritance();
for (var name in type.prototype) {
if (name.startsWith('set_')) {
type.__animationProperties[name.substr(4).toLowerCase()] = name;
}
}
delete type.__animationProperties['id'];
properties = type.__animationProperties;
}
for (var property in obj) {
var prop = property.toLowerCase();
if (prop == 'animationname' || prop == 'animationchildren') {
continue;
}
var value = obj[property];
var setter = properties[prop];
if (setter && String.isInstanceOfType(setter) && animation[setter]) {
if (!Sys.Debug.isDebug) {
try {
animation[setter](value);
} catch (ex) {
}
} else {
animation[setter](value);
}
} else {
if (prop.endsWith('script')) {
setter = properties[prop.substr(0, property.length - 6)];
if (setter && String.isInstanceOfType(setter) && animation[setter]) {
animation.DynamicProperties[setter] = value;
} else if (Sys.Debug.isDebug) {
throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_NoDynamicPropertyFound, property, property.substr(0, property.length - 5)));
}
} else if (Sys.Debug.isDebug) {
throw Error.argument('obj', String.format(AjaxControlToolkit.Resources.Animation_NoPropertyFound, property));
}
}
}
return animation;
}
$AA.Animation = function (target, duration, fps) {
$AA.Animation.initializeBase(this);
this._duration = 1;
this._fps = 25;
this._target = null;
this._tickHandler = null;
this._timer = null;
this._percentComplete = 0;
this._percentDelta = null;
this._owner = null;
this._parentAnimation = null;
this.DynamicProperties = {};
if (target) {
this.set_target(target);
}
if (duration) {
this.set_duration(duration);
}
if (fps) {
this.set_fps(fps);
}
}
$AA.Animation.prototype = {
dispose: function () {
if (this._timer) {
this._timer.dispose();
this._timer = null;
}
this._tickHandler = null;
this._target = null;
$AA.Animation.callBaseMethod(this, 'dispose');
},
play: function () {
if (!this._owner) {
var resume = true;
if (!this._timer) {
resume = false;
if (!this._tickHandler) {
this._tickHandler = Function.createDelegate(this, this._onTimerTick);
}
this._timer = new Sys.Timer();
this._timer.add_tick(this._tickHandler);
this.onStart();
this._timer.set_interval(1000 / this._fps);
this._percentDelta = 100 / (this._duration * this._fps);
this._updatePercentComplete(0, true);
}
this._timer.set_enabled(true);
this.raisePropertyChanged('isPlaying');
if (!resume) {
this.raisePropertyChanged('isActive');
}
}
},
pause: function () {
if (!this._owner) {
if (this._timer) {
this._timer.set_enabled(false);
this.raisePropertyChanged('isPlaying');
}
}
},
stop: function (finish) {
if (!this._owner) {
var t = this._timer;
this._timer = null;
if (t) {
t.dispose();
if (this._percentComplete !== 100) {
this._percentComplete = 100;
this.raisePropertyChanged('percentComplete');
if (finish || finish === undefined) {
this.onStep(100);
}
}
this.onEnd();
this.raisePropertyChanged('isPlaying');
this.raisePropertyChanged('isActive');
}
}
},
onStart: function () {
this.raiseStarted();
for (var property in this.DynamicProperties) {
try {
this[property](eval(this.DynamicProperties[property]));
} catch (ex) {
if (Sys.Debug.isDebug) {
throw ex;
}
}
}
},
onStep: function (percentage) {
this.setValue(this.getAnimatedValue(percentage));
this.raiseStep();
},
onEnd: function () {
this.raiseEnded();
},
getAnimatedValue: function (percentage) {
throw Error.notImplemented();
},
setValue: function (value) {
throw Error.notImplemented();
},
interpolate: function (start, end, percentage) {
return start + (end - start) * (percentage / 100);
},
_onTimerTick: function () {
this._updatePercentComplete(this._percentComplete + this._percentDelta, true);
},
_updatePercentComplete: function (percentComplete, animate) {
if (percentComplete > 100) {
percentComplete = 100;
}
this._percentComplete = percentComplete;
this.raisePropertyChanged('percentComplete');
if (animate) {
this.onStep(percentComplete);
}
if (percentComplete === 100) {
this.stop(false);
}
},
setOwner: function (owner) {
this._owner = owner;
},
raiseStarted: function () {
var handlers = this.get_events().getHandler('started');
if (handlers) {
handlers(this, Sys.EventArgs.Empty);
}
},
add_started: function (handler) {
this.get_events().addHandler("started", handler);
},
remove_started: function (handler) {
this.get_events().removeHandler("started", handler);
},
raiseEnded: function () {
var handlers = this.get_events().getHandler('ended');
if (handlers) {
handlers(this, Sys.EventArgs.Empty);
}
},
add_ended: function (handler) {
this.get_events().addHandler("ended", handler);
},
remove_ended: function (handler) {
this.get_events().removeHandler("ended", handler);
},
raiseStep: function () {
var handlers = this.get_events().getHandler('step');
if (handlers) {
handlers(this, Sys.EventArgs.Empty);
}
},
add_step: function (handler) {
this.get_events().addHandler("step", handler);
},
remove_step: function (handler) {
this.get_events().removeHandler("step", handler);
},
get_target: function () {
if (!this._target && this._parentAnimation) {
return this._parentAnimation.get_target();
}
return this._target;
},
set_target: function (value) {
if (this._target != value) {
this._target = value;
this.raisePropertyChanged('target');
}
},
set_animationTarget: function (id) {
var target = null;
var element = $get(id);
if (element) {
target = element;
} else {
var ctrl = $find(id);
if (ctrl) {
element = ctrl.get_element();
if (element) {
target = element;
}
}
}
if (target) {
this.set_target(target);
} else {
throw Error.argument('id', String.format(AjaxControlToolkit.Resources.Animation_TargetNotFound, id));
}
},
get_duration: function () {
return this._duration;
},
set_duration: function (value) {
value = this._getFloat(value);
if (this._duration != value) {
this._duration = value;
this.raisePropertyChanged('duration');
}
},
get_fps: function () {
return this._fps;
},
set_fps: function (value) {
value = this._getInteger(value);
if (this.fps != value) {
this._fps = value;
this.raisePropertyChanged('fps');
}
},
get_isActive: function () {
return (this._timer !== null);
},
get_isPlaying: function () {
return (this._timer !== null) && this._timer.get_enabled();
},
get_percentComplete: function () {
return this._percentComplete;
},
_getBoolean: function (value) {
if (String.isInstanceOfType(value)) {
return Boolean.parse(value);
}
return value;
},
_getInteger: function (value) {
if (String.isInstanceOfType(value)) {
return parseInt(value);
}
return value;
},
_getFloat: function (value) {
if (String.isInstanceOfType(value)) {
return parseFloat(value);
}
return value;
},
_getEnum: function (value, type) {
if (String.isInstanceOfType(value) && type && type.parse) {
return type.parse(value);
}
return value;
}
}
$AA.Animation.registerClass('AjaxControlToolkit.Animation.Animation', Sys.Component);
$AA.registerAnimation('animation', $AA.Animation);
$AA.ParentAnimation = function (target, duration, fps, animations) {
$AA.ParentAnimation.initializeBase(this, [target, duration, fps]);
this._animations = [];
if (animations && animations.length) {
for (var i = 0; i < animations.length; i++) {
this.add(animations[i]);
}
}
}
$AA.ParentAnimation.prototype = {
initialize: function () {
$AA.ParentAnimation.callBaseMethod(this, 'initialize');
if (this._animations) {
for (var i = 0; i < this._animations.length; i++) {
var animation = this._animations[i];
if (animation && !animation.get_isInitialized) {
animation.initialize();
}
}
}
},
dispose: function () {
this.clear();
this._animations = null;
$AA.ParentAnimation.callBaseMethod(this, 'dispose');
},
get_animations: function () {
return this._animations;
},
add: function (animation) {
if (this._animations) {
if (animation) {
animation._parentAnimation = this;
}
Array.add(this._animations, animation);
this.raisePropertyChanged('animations');
}
},
remove: function (animation) {
if (this._animations) {
if (animation) {
animation.dispose();
}
Array.remove(this._animations, animation);
this.raisePropertyChanged('animations');
}
},
removeAt: function (index) {
if (this._animations) {
var animation = this._animations[index];
if (animation) {
animation.dispose();
}
Array.removeAt(this._animations, index);
this.raisePropertyChanged('animations');
}
},
clear: function () {
if (this._animations) {
for (var i = this._animations.length - 1; i >= 0; i--) {
this._animations[i].dispose();
this._animations[i] = null;
}
Array.clear(this._animations);
this._animations = [];
this.raisePropertyChanged('animations');
}
}
}
$AA.ParentAnimation.registerClass('AjaxControlToolkit.Animation.ParentAnimation', $AA.Animation);
$AA.registerAnimation('parent', $AA.ParentAnimation);
$AA.ParallelAnimation = function (target, duration, fps, animations) {
$AA.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]);
}
$AA.ParallelAnimation.prototype = {
add: function (animation) {
$AA.ParallelAnimation.callBaseMethod(this, 'add', [animation]);
animation.setOwner(this);
},
onStart: function () {
$AA.ParallelAnimation.callBaseMethod(this, 'onStart');
var animations = this.get_animations();
for (var i = 0; i < animations.length; i++) {
animations[i].onStart();
}
},
onStep: function (percentage) {
var animations = this.get_animations();
for (var i = 0; i < animations.length; i++) {
animations[i].onStep(percentage);
}
},
onEnd: function () {
var animations = this.get_animations();
for (var i = 0; i < animations.length; i++) {
animations[i].onEnd();
}
$AA.ParallelAnimation.callBaseMethod(this, 'onEnd');
}
}
$AA.ParallelAnimation.registerClass('AjaxControlToolkit.Animation.ParallelAnimation', $AA.ParentAnimation);
$AA.registerAnimation('parallel', $AA.ParallelAnimation);
$AA.SequenceAnimation = function (target, duration, fps, animations, iterations) {
$AA.SequenceAnimation.initializeBase(this, [target, duration, fps, animations]);
this._handler = null;
this._paused = false;
this._playing = false;
this._index = 0;
this._remainingIterations = 0;
this._iterations = (iterations !== undefined) ? iterations : 1;
}
$AA.SequenceAnimation.prototype = {
dispose: function () {
this._handler = null;
$AA.SequenceAnimation.callBaseMethod(this, 'dispose');
},
stop: function () {
if (this._playing) {
var animations = this.get_animations();
if (this._index < animations.length) {
animations[this._index].remove_ended(this._handler);
for (var i = this._index; i < animations.length; i++) {
animations[i].stop();
}
}
this._playing = false;
this._paused = false;
this.raisePropertyChanged('isPlaying');
this.onEnd();
}
},
pause: function () {
if (this.get_isPlaying()) {
var current = this.get_animations()[this._index];
if (current != null) {
current.pause();
}
this._paused = true;
this.raisePropertyChanged('isPlaying');
}
},
play: function () {
var animations = this.get_animations();
if (!this._playing) {
this._playing = true;
if (this._paused) {
this._paused = false;
var current = animations[this._index];
if (current != null) {
current.play();
this.raisePropertyChanged('isPlaying');
}
} else {
this.onStart();
this._index = 0;
var first = animations[this._index];
if (first) {
first.add_ended(this._handler);
first.play();
this.raisePropertyChanged('isPlaying');
} else {
this.stop();
}
}
}
},
onStart: function () {
$AA.SequenceAnimation.callBaseMethod(this, 'onStart');
this._remainingIterations = this._iterations - 1;
if (!this._handler) {
this._handler = Function.createDelegate(this, this._onEndAnimation);
}
},
_onEndAnimation: function () {
var animations = this.get_animations();
var current = animations[this._index++];
if (current) {
current.remove_ended(this._handler);
}
if (this._index < animations.length) {
var next = animations[this._index];
next.add_ended(this._handler);
next.play();
} else if (this._remainingIterations >= 1 || this._iterations <= 0) {
this._remainingIterations--;
this._index = 0;
var first = animations[0];
first.add_ended(this._handler);
first.play();
} else {
this.stop();
}
},
onStep: function (percentage) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.Animation_CannotNestSequence);
},
onEnd: function () {
this._remainingIterations = 0;
$AA.SequenceAnimation.callBaseMethod(this, 'onEnd');
},
get_isActive: function () {
return true;
},
get_isPlaying: function () {
return this._playing && !this._paused;
},
get_iterations: function () {
return this._iterations;
},
set_iterations: function (value) {
value = this._getInteger(value);
if (this._iterations != value) {
this._iterations = value;
this.raisePropertyChanged('iterations');
}
},
get_isInfinite: function () {
return this._iterations <= 0;
}
}
$AA.SequenceAnimation.registerClass('AjaxControlToolkit.Animation.SequenceAnimation', $AA.ParentAnimation);
$AA.registerAnimation('sequence', $AA.SequenceAnimation);
$AA.SelectionAnimation = function (target, duration, fps, animations) {
$AA.SelectionAnimation.initializeBase(this, [target, duration, fps, animations]);
this._selectedIndex = -1;
this._selected = null;
}
$AA.SelectionAnimation.prototype = {
getSelectedIndex: function () {
throw Error.notImplemented();
},
onStart: function () {
$AA.SelectionAnimation.callBaseMethod(this, 'onStart');
var animations = this.get_animations();
this._selectedIndex = this.getSelectedIndex();
if (this._selectedIndex >= 0 && this._selectedIndex < animations.length) {
this._selected = animations[this._selectedIndex];
if (this._selected) {
this._selected.setOwner(this);
this._selected.onStart();
}
}
},
onStep: function (percentage) {
if (this._selected) {
this._selected.onStep(percentage);
}
},
onEnd: function () {
if (this._selected) {
this._selected.onEnd();
this._selected.setOwner(null);
}
this._selected = null;
this._selectedIndex = null;
$AA.SelectionAnimation.callBaseMethod(this, 'onEnd');
}
}
$AA.SelectionAnimation.registerClass('AjaxControlToolkit.Animation.SelectionAnimation', $AA.ParentAnimation);
$AA.registerAnimation('selection', $AA.SelectionAnimation);
$AA.ConditionAnimation = function (target, duration, fps, animations, conditionScript) {
$AA.ConditionAnimation.initializeBase(this, [target, duration, fps, animations]);
this._conditionScript = conditionScript;
}
$AA.ConditionAnimation.prototype = {
getSelectedIndex: function () {
var selected = -1;
if (this._conditionScript && this._conditionScript.length > 0) {
try {
selected = eval(this._conditionScript) ? 0 : 1;
} catch (ex) {
}
}
return selected;
},
get_conditionScript: function () {
return this._conditionScript;
},
set_conditionScript: function (value) {
if (this._conditionScript != value) {
this._conditionScript = value;
this.raisePropertyChanged('conditionScript');
}
}
}
$AA.ConditionAnimation.registerClass('AjaxControlToolkit.Animation.ConditionAnimation', $AA.SelectionAnimation);
$AA.registerAnimation('condition', $AA.ConditionAnimation);
$AA.CaseAnimation = function (target, duration, fps, animations, selectScript) {
$AA.CaseAnimation.initializeBase(this, [target, duration, fps, animations]);
this._selectScript = selectScript;
}
$AA.CaseAnimation.prototype = {
getSelectedIndex: function () {
var selected = -1;
if (this._selectScript && this._selectScript.length > 0) {
try {
var result = eval(this._selectScript)
if (result !== undefined)
selected = result;
} catch (ex) {
}
}
return selected;
},
get_selectScript: function () {
return this._selectScript;
},
set_selectScript: function (value) {
if (this._selectScript != value) {
this._selectScript = value;
this.raisePropertyChanged('selectScript');
}
}
}
$AA.CaseAnimation.registerClass('AjaxControlToolkit.Animation.CaseAnimation', $AA.SelectionAnimation);
$AA.registerAnimation('case', $AA.CaseAnimation);
$AA.FadeEffect = function () {
throw Error.invalidOperation();
}
$AA.FadeEffect.prototype = {
FadeIn: 0,
FadeOut: 1
}
$AA.FadeEffect.registerEnum("AjaxControlToolkit.Animation.FadeEffect", false);
$AA.FadeAnimation = function (target, duration, fps, effect, minimumOpacity, maximumOpacity, forceLayoutInIE) {
$AA.FadeAnimation.initializeBase(this, [target, duration, fps]);
this._effect = (effect !== undefined) ? effect : $AA.FadeEffect.FadeIn;
this._max = (maximumOpacity !== undefined) ? maximumOpacity : 1;
this._min = (minimumOpacity !== undefined) ? minimumOpacity : 0;
this._start = this._min;
this._end = this._max;
this._layoutCreated = false;
this._forceLayoutInIE = (forceLayoutInIE === undefined || forceLayoutInIE === null) ? true : forceLayoutInIE;
this._currentTarget = null;
this._resetOpacities();
}
$AA.FadeAnimation.prototype = {
_resetOpacities: function () {
if (this._effect == $AA.FadeEffect.FadeIn) {
this._start = this._min;
this._end = this._max;
} else {
this._start = this._max;
this._end = this._min;
}
},
_createLayout: function () {
var element = this._currentTarget;
if (element) {
this._originalWidth = $common.getCurrentStyle(element, 'width');
var originalHeight = $common.getCurrentStyle(element, 'height');
this._originalBackColor = $common.getCurrentStyle(element, 'backgroundColor');
if ((!this._originalWidth || this._originalWidth == '' || this._originalWidth == 'auto') &&
(!originalHeight || originalHeight == '' || originalHeight == 'auto')) {
element.style.width = element.offsetWidth + 'px';
}
if (!this._originalBackColor || this._originalBackColor == '' || this._originalBackColor == 'transparent' || this._originalBackColor == 'rgba(0, 0, 0, 0)') {
element.style.backgroundColor = $common.getInheritedBackgroundColor(element);
}
this._layoutCreated = true;
}
},
onStart: function () {
$AA.FadeAnimation.callBaseMethod(this, 'onStart');
this._currentTarget = this.get_target();
this.setValue(this._start);
if (this._forceLayoutInIE && !this._layoutCreated && Sys.Browser.agent == Sys.Browser.InternetExplorer) {
this._createLayout();
}
},
getAnimatedValue: function (percentage) {
return this.interpolate(this._start, this._end, percentage);
},
setValue: function (value) {
if (this._currentTarget) {
$common.setElementOpacity(this._currentTarget, value);
}
},
get_effect: function () {
return this._effect;
},
set_effect: function (value) {
value = this._getEnum(value, $AA.FadeEffect);
if (this._effect != value) {
this._effect = value;
this._resetOpacities();
this.raisePropertyChanged('effect');
}
},
get_minimumOpacity: function () {
return this._min;
},
set_minimumOpacity: function (value) {
value = this._getFloat(value);
if (this._min != value) {
this._min = value;
this._resetOpacities();
this.raisePropertyChanged('minimumOpacity');
}
},
get_maximumOpacity: function () {
return this._max;
},
set_maximumOpacity: function (value) {
value = this._getFloat(value);
if (this._max != value) {
this._max = value;
this._resetOpacities();
this.raisePropertyChanged('maximumOpacity');
}
},
get_forceLayoutInIE: function () {
return this._forceLayoutInIE;
},
set_forceLayoutInIE: function (value) {
value = this._getBoolean(value);
if (this._forceLayoutInIE != value) {
this._forceLayoutInIE = value;
this.raisePropertyChanged('forceLayoutInIE');
}
},
set_startValue: function (value) {
value = this._getFloat(value);
this._start = value;
}
}
$AA.FadeAnimation.registerClass('AjaxControlToolkit.Animation.FadeAnimation', $AA.Animation);
$AA.registerAnimation('fade', $AA.FadeAnimation);
$AA.FadeInAnimation = function (target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
$AA.FadeInAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeIn, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeInAnimation.prototype = {
onStart: function () {
$AA.FadeInAnimation.callBaseMethod(this, 'onStart');
if (this._currentTarget) {
this.set_startValue($common.getElementOpacity(this._currentTarget));
}
}
}
$AA.FadeInAnimation.registerClass('AjaxControlToolkit.Animation.FadeInAnimation', $AA.FadeAnimation);
$AA.registerAnimation('fadeIn', $AA.FadeInAnimation);
$AA.FadeOutAnimation = function (target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
$AA.FadeOutAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeOut, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeOutAnimation.prototype = {
onStart: function () {
$AA.FadeOutAnimation.callBaseMethod(this, 'onStart');
if (this._currentTarget) {
this.set_startValue($common.getElementOpacity(this._currentTarget));
}
}
}
$AA.FadeOutAnimation.registerClass('AjaxControlToolkit.Animation.FadeOutAnimation', $AA.FadeAnimation);
$AA.registerAnimation('fadeOut', $AA.FadeOutAnimation);
$AA.PulseAnimation = function (target, duration, fps, iterations, minimumOpacity, maximumOpacity, forceLayoutInIE) {
$AA.PulseAnimation.initializeBase(this, [target, duration, fps, null, ((iterations !== undefined) ? iterations : 3)]);
this._out = new $AA.FadeOutAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE);
this.add(this._out);
this._in = new $AA.FadeInAnimation(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE);
this.add(this._in);
}
$AA.PulseAnimation.prototype = {
get_minimumOpacity: function () {
return this._out.get_minimumOpacity();
},
set_minimumOpacity: function (value) {
value = this._getFloat(value);
this._out.set_minimumOpacity(value);
this._in.set_minimumOpacity(value);
this.raisePropertyChanged('minimumOpacity');
},
get_maximumOpacity: function () {
return this._out.get_maximumOpacity();
},
set_maximumOpacity: function (value) {
value = this._getFloat(value);
this._out.set_maximumOpacity(value);
this._in.set_maximumOpacity(value);
this.raisePropertyChanged('maximumOpacity');
},
get_forceLayoutInIE: function () {
return this._out.get_forceLayoutInIE();
},
set_forceLayoutInIE: function (value) {
value = this._getBoolean(value);
this._out.set_forceLayoutInIE(value);
this._in.set_forceLayoutInIE(value);
this.raisePropertyChanged('forceLayoutInIE');
},
set_duration: function (value) {
value = this._getFloat(value);
$AA.PulseAnimation.callBaseMethod(this, 'set_duration', [value]);
this._in.set_duration(value);
this._out.set_duration(value);
},
set_fps: function (value) {
value = this._getInteger(value);
$AA.PulseAnimation.callBaseMethod(this, 'set_fps', [value]);
this._in.set_fps(value);
this._out.set_fps(value);
}
}
$AA.PulseAnimation.registerClass('AjaxControlToolkit.Animation.PulseAnimation', $AA.SequenceAnimation);
$AA.registerAnimation('pulse', $AA.PulseAnimation);
$AA.PropertyAnimation = function (target, duration, fps, property, propertyKey) {
$AA.PropertyAnimation.initializeBase(this, [target, duration, fps]);
this._property = property;
this._propertyKey = propertyKey;
this._currentTarget = null;
}
$AA.PropertyAnimation.prototype = {
onStart: function () {
$AA.PropertyAnimation.callBaseMethod(this, 'onStart');
this._currentTarget = this.get_target();
},
setValue: function (value) {
var element = this._currentTarget;
if (element && this._property && this._property.length > 0) {
if (this._propertyKey && this._propertyKey.length > 0 && element[this._property]) {
element[this._property][this._propertyKey] = value;
} else {
element[this._property] = value;
}
}
},
getValue: function () {
var element = this.get_target();
if (element && this._property && this._property.length > 0) {
var property = element[this._property];
if (property) {
if (this._propertyKey && this._propertyKey.length > 0) {
return property[this._propertyKey];
}
return property;
}
}
return null;
},
get_property: function () {
return this._property;
},
set_property: function (value) {
if (this._property != value) {
this._property = value;
this.raisePropertyChanged('property');
}
},
get_propertyKey: function () {
return this._propertyKey;
},
set_propertyKey: function (value) {
if (this._propertyKey != value) {
this._propertyKey = value;
this.raisePropertyChanged('propertyKey');
}
}
}
$AA.PropertyAnimation.registerClass('AjaxControlToolkit.Animation.PropertyAnimation', $AA.Animation);
$AA.registerAnimation('property', $AA.PropertyAnimation);
$AA.DiscreteAnimation = function (target, duration, fps, property, propertyKey, values) {
$AA.DiscreteAnimation.initializeBase(this, [target, duration, fps, property, propertyKey]);
this._values = (values && values.length) ? values : [];
}
$AA.DiscreteAnimation.prototype = {
getAnimatedValue: function (percentage) {
var index = Math.floor(this.interpolate(0, this._values.length - 1, percentage));
return this._values[index];
},
get_values: function () {
return this._values;
},
set_values: function (value) {
if (this._values != value) {
this._values = value;
this.raisePropertyChanged('values');
}
}
}
$AA.DiscreteAnimation.registerClass('AjaxControlToolkit.Animation.DiscreteAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('discrete', $AA.DiscreteAnimation);
$AA.InterpolatedAnimation = function (target, duration, fps, property, propertyKey, startValue, endValue) {
$AA.InterpolatedAnimation.initializeBase(this, [target, duration, fps, ((property !== undefined) ? property : 'style'), propertyKey]);
this._startValue = startValue;
this._endValue = endValue;
}
$AA.InterpolatedAnimation.prototype = {
get_startValue: function () {
return this._startValue;
},
set_startValue: function (value) {
value = this._getFloat(value);
if (this._startValue != value) {
this._startValue = value;
this.raisePropertyChanged('startValue');
}
},
get_endValue: function () {
return this._endValue;
},
set_endValue: function (value) {
value = this._getFloat(value);
if (this._endValue != value) {
this._endValue = value;
this.raisePropertyChanged('endValue');
}
}
}
$AA.InterpolatedAnimation.registerClass('AjaxControlToolkit.Animation.InterpolatedAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('interpolated', $AA.InterpolatedAnimation);
$AA.ColorAnimation = function (target, duration, fps, property, propertyKey, startValue, endValue) {
$AA.ColorAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
this._start = null;
this._end = null;
this._interpolateRed = false;
this._interpolateGreen = false;
this._interpolateBlue = false;
}
$AA.ColorAnimation.prototype = {
onStart: function () {
$AA.ColorAnimation.callBaseMethod(this, 'onStart');
this._start = $AA.ColorAnimation.getRGB(this.get_startValue());
this._end = $AA.ColorAnimation.getRGB(this.get_endValue());
this._interpolateRed = (this._start.Red != this._end.Red);
this._interpolateGreen = (this._start.Green != this._end.Green);
this._interpolateBlue = (this._start.Blue != this._end.Blue);
},
getAnimatedValue: function (percentage) {
var r = this._start.Red;
var g = this._start.Green;
var b = this._start.Blue;
if (this._interpolateRed)
r = Math.round(this.interpolate(r, this._end.Red, percentage));
if (this._interpolateGreen)
g = Math.round(this.interpolate(g, this._end.Green, percentage));
if (this._interpolateBlue)
b = Math.round(this.interpolate(b, this._end.Blue, percentage));
return $AA.ColorAnimation.toColor(r, g, b);
},
set_startValue: function (value) {
if (this._startValue != value) {
this._startValue = value;
this.raisePropertyChanged('startValue');
}
},
set_endValue: function (value) {
if (this._endValue != value) {
this._endValue = value;
this.raisePropertyChanged('endValue');
}
}
}
$AA.ColorAnimation.getRGB = function (color) {
if (!color || color.length != 7) {
throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor, color);
}
return {
'Red': parseInt(color.substr(1, 2), 16),
'Green': parseInt(color.substr(3, 2), 16),
'Blue': parseInt(color.substr(5, 2), 16)
};
}
$AA.ColorAnimation.toColor = function (red, green, blue) {
var r = red.toString(16);
var g = green.toString(16);
var b = blue.toString(16);
if (r.length == 1) r = '0' + r;
if (g.length == 1) g = '0' + g;
if (b.length == 1) b = '0' + b;
return '#' + r + g + b;
}
$AA.ColorAnimation.registerClass('AjaxControlToolkit.Animation.ColorAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('color', $AA.ColorAnimation);
$AA.LengthAnimation = function (target, duration, fps, property, propertyKey, startValue, endValue, unit) {
$AA.LengthAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
this._unit = (unit != null) ? unit : 'px';
}
$AA.LengthAnimation.prototype = {
getAnimatedValue: function (percentage) {
var value = this.interpolate(this.get_startValue(), this.get_endValue(), percentage);
return Math.round(value) + this._unit;
},
get_unit: function () {
return this._unit;
},
set_unit: function (value) {
if (this._unit != value) {
this._unit = value;
this.raisePropertyChanged('unit');
}
}
}
$AA.LengthAnimation.registerClass('AjaxControlToolkit.Animation.LengthAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('length', $AA.LengthAnimation);
$AA.MoveAnimation = function (target, duration, fps, horizontal, vertical, relative, unit) {
$AA.MoveAnimation.initializeBase(this, [target, duration, fps, null]);
this._horizontal = horizontal ? horizontal : 0;
this._vertical = vertical ? vertical : 0;
this._relative = (relative === undefined) ? true : relative;
this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'left', null, null, unit);
this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'top', null, null, unit);
this.add(this._verticalAnimation);
this.add(this._horizontalAnimation);
}
$AA.MoveAnimation.prototype = {
onStart: function () {
$AA.MoveAnimation.callBaseMethod(this, 'onStart');
var element = this.get_target();
this._horizontalAnimation.set_startValue(element.offsetLeft);
this._horizontalAnimation.set_endValue(this._relative ? element.offsetLeft + this._horizontal : this._horizontal);
this._verticalAnimation.set_startValue(element.offsetTop);
this._verticalAnimation.set_endValue(this._relative ? element.offsetTop + this._vertical : this._vertical);
},
get_horizontal: function () {
return this._horizontal;
},
set_horizontal: function (value) {
value = this._getFloat(value);
if (this._horizontal != value) {
this._horizontal = value;
this.raisePropertyChanged('horizontal');
}
},
get_vertical: function () {
return this._vertical;
},
set_vertical: function (value) {
value = this._getFloat(value);
if (this._vertical != value) {
this._vertical = value;
this.raisePropertyChanged('vertical');
}
},
get_relative: function () {
return this._relative;
},
set_relative: function (value) {
value = this._getBoolean(value);
if (this._relative != value) {
this._relative = value;
this.raisePropertyChanged('relative');
}
},
get_unit: function () {
this._horizontalAnimation.get_unit();
},
set_unit: function (value) {
var unit = this._horizontalAnimation.get_unit();
if (unit != value) {
this._horizontalAnimation.set_unit(value);
this._verticalAnimation.set_unit(value);
this.raisePropertyChanged('unit');
}
}
}
$AA.MoveAnimation.registerClass('AjaxControlToolkit.Animation.MoveAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('move', $AA.MoveAnimation);
$AA.ResizeAnimation = function (target, duration, fps, width, height, unit) {
$AA.ResizeAnimation.initializeBase(this, [target, duration, fps, null]);
this._width = width;
this._height = height;
this._horizontalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'width', null, null, unit);
this._verticalAnimation = new $AA.LengthAnimation(target, duration, fps, 'style', 'height', null, null, unit);
this.add(this._horizontalAnimation);
this.add(this._verticalAnimation);
}
$AA.ResizeAnimation.prototype = {
onStart: function () {
$AA.ResizeAnimation.callBaseMethod(this, 'onStart');
var element = this.get_target();
this._horizontalAnimation.set_startValue(element.offsetWidth);
this._verticalAnimation.set_startValue(element.offsetHeight);
this._horizontalAnimation.set_endValue((this._width !== null && this._width !== undefined) ?
this._width : element.offsetWidth);
this._verticalAnimation.set_endValue((this._height !== null && this._height !== undefined) ?
this._height : element.offsetHeight);
},
get_width: function () {
return this._width;
},
set_width: function (value) {
value = this._getFloat(value);
if (this._width != value) {
this._width = value;
this.raisePropertyChanged('width');
}
},
get_height: function () {
return this._height;
},
set_height: function (value) {
value = this._getFloat(value);
if (this._height != value) {
this._height = value;
this.raisePropertyChanged('height');
}
},
get_unit: function () {
this._horizontalAnimation.get_unit();
},
set_unit: function (value) {
var unit = this._horizontalAnimation.get_unit();
if (unit != value) {
this._horizontalAnimation.set_unit(value);
this._verticalAnimation.set_unit(value);
this.raisePropertyChanged('unit');
}
}
}
$AA.ResizeAnimation.registerClass('AjaxControlToolkit.Animation.ResizeAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('resize', $AA.ResizeAnimation);
$AA.ScaleAnimation = function (target, duration, fps, scaleFactor, unit, center, scaleFont, fontUnit) {
$AA.ScaleAnimation.initializeBase(this, [target, duration, fps]);
this._scaleFactor = (scaleFactor !== undefined) ? scaleFactor : 1;
this._unit = (unit !== undefined) ? unit : 'px';
this._center = center;
this._scaleFont = scaleFont;
this._fontUnit = (fontUnit !== undefined) ? fontUnit : 'pt';
this._element = null;
this._initialHeight = null;
this._initialWidth = null;
this._initialTop = null;
this._initialLeft = null;
this._initialFontSize = null;
}
$AA.ScaleAnimation.prototype = {
getAnimatedValue: function (percentage) {
return this.interpolate(1.0, this._scaleFactor, percentage);
},
onStart: function () {
$AA.ScaleAnimation.callBaseMethod(this, 'onStart');
this._element = this.get_target();
if (this._element) {
this._initialHeight = this._element.offsetHeight;
this._initialWidth = this._element.offsetWidth;
if (this._center) {
this._initialTop = this._element.offsetTop;
this._initialLeft = this._element.offsetLeft;
}
if (this._scaleFont) {
this._initialFontSize = parseFloat(
$common.getCurrentStyle(this._element, 'fontSize'));
}
}
},
setValue: function (scale) {
if (this._element) {
var width = Math.round(this._initialWidth * scale);
var height = Math.round(this._initialHeight * scale);
this._element.style.width = width + this._unit;
this._element.style.height = height + this._unit;
if (this._center) {
this._element.style.top = (this._initialTop +
Math.round((this._initialHeight - height) / 2)) + this._unit;
this._element.style.left = (this._initialLeft +
Math.round((this._initialWidth - width) / 2)) + this._unit;
}
if (this._scaleFont) {
var size = this._initialFontSize * scale;
if (this._fontUnit == 'px' || this._fontUnit == 'pt') {
size = Math.round(size);
}
this._element.style.fontSize = size + this._fontUnit;
}
}
},
onEnd: function () {
this._element = null;
this._initialHeight = null;
this._initialWidth = null;
this._initialTop = null;
this._initialLeft = null;
this._initialFontSize = null;
$AA.ScaleAnimation.callBaseMethod(this, 'onEnd');
},
get_scaleFactor: function () {
return this._scaleFactor;
},
set_scaleFactor: function (value) {
value = this._getFloat(value);
if (this._scaleFactor != value) {
this._scaleFactor = value;
this.raisePropertyChanged('scaleFactor');
}
},
get_unit: function () {
return this._unit;
},
set_unit: function (value) {
if (this._unit != value) {
this._unit = value;
this.raisePropertyChanged('unit');
}
},
get_center: function () {
return this._center;
},
set_center: function (value) {
value = this._getBoolean(value);
if (this._center != value) {
this._center = value;
this.raisePropertyChanged('center');
}
},
get_scaleFont: function () {
return this._scaleFont;
},
set_scaleFont: function (value) {
value = this._getBoolean(value);
if (this._scaleFont != value) {
this._scaleFont = value;
this.raisePropertyChanged('scaleFont');
}
},
get_fontUnit: function () {
return this._fontUnit;
},
set_fontUnit: function (value) {
if (this._fontUnit != value) {
this._fontUnit = value;
this.raisePropertyChanged('fontUnit');
}
}
}
$AA.ScaleAnimation.registerClass('AjaxControlToolkit.Animation.ScaleAnimation', $AA.Animation);
$AA.registerAnimation('scale', $AA.ScaleAnimation);
$AA.Action = function (target, duration, fps) {
$AA.Action.initializeBase(this, [target, duration, fps]);
if (duration === undefined) {
this.set_duration(0);
}
}
$AA.Action.prototype = {
onEnd: function () {
this.doAction();
$AA.Action.callBaseMethod(this, 'onEnd');
},
doAction: function () {
throw Error.notImplemented();
},
getAnimatedValue: function () {
},
setValue: function () {
}
}
$AA.Action.registerClass('AjaxControlToolkit.Animation.Action', $AA.Animation);
$AA.registerAnimation('action', $AA.Action);
$AA.EnableAction = function (target, duration, fps, enabled) {
$AA.EnableAction.initializeBase(this, [target, duration, fps]);
this._enabled = (enabled !== undefined) ? enabled : true;
}
$AA.EnableAction.prototype = {
doAction: function () {
var element = this.get_target();
if (element) {
element.disabled = !this._enabled;
}
},
get_enabled: function () {
return this._enabled;
},
set_enabled: function (value) {
value = this._getBoolean(value);
if (this._enabled != value) {
this._enabled = value;
this.raisePropertyChanged('enabled');
}
}
}
$AA.EnableAction.registerClass('AjaxControlToolkit.Animation.EnableAction', $AA.Action);
$AA.registerAnimation('enableAction', $AA.EnableAction);
$AA.HideAction = function (target, duration, fps, visible) {
$AA.HideAction.initializeBase(this, [target, duration, fps]);
this._visible = visible;
}
$AA.HideAction.prototype = {
doAction: function () {
var element = this.get_target();
if (element) {
$common.setVisible(element, this._visible);
}
},
get_visible: function () {
return this._visible;
},
set_visible: function (value) {
if (this._visible != value) {
this._visible = value;
this.raisePropertyChanged('visible');
}
}
}
$AA.HideAction.registerClass('AjaxControlToolkit.Animation.HideAction', $AA.Action);
$AA.registerAnimation('hideAction', $AA.HideAction);
$AA.StyleAction = function (target, duration, fps, attribute, value) {
$AA.StyleAction.initializeBase(this, [target, duration, fps]);
this._attribute = attribute;
this._value = value;
}
$AA.StyleAction.prototype = {
doAction: function () {
var element = this.get_target();
if (element) {
element.style[this._attribute] = this._value;
}
},
get_attribute: function () {
return this._attribute;
},
set_attribute: function (value) {
if (this._attribute != value) {
this._attribute = value;
this.raisePropertyChanged('attribute');
}
},
get_value: function () {
return this._value;
},
set_value: function (value) {
if (this._value != value) {
this._value = value;
this.raisePropertyChanged('value');
}
}
}
$AA.StyleAction.registerClass('AjaxControlToolkit.Animation.StyleAction', $AA.Action);
$AA.registerAnimation('styleAction', $AA.StyleAction);
$AA.OpacityAction = function (target, duration, fps, opacity) {
$AA.OpacityAction.initializeBase(this, [target, duration, fps]);
this._opacity = opacity;
}
$AA.OpacityAction.prototype = {
doAction: function () {
var element = this.get_target();
if (element) {
$common.setElementOpacity(element, this._opacity);
}
},
get_opacity: function () {
return this._opacity;
},
set_opacity: function (value) {
value = this._getFloat(value);
if (this._opacity != value) {
this._opacity = value;
this.raisePropertyChanged('opacity');
}
}
}
$AA.OpacityAction.registerClass('AjaxControlToolkit.Animation.OpacityAction', $AA.Action);
$AA.registerAnimation('opacityAction', $AA.OpacityAction);
$AA.ScriptAction = function (target, duration, fps, script) {
$AA.ScriptAction.initializeBase(this, [target, duration, fps]);
this._script = script;
}
$AA.ScriptAction.prototype = {
doAction: function () {
try {
eval(this._script);
} catch (ex) {
}
},
get_script: function () {
return this._script;
},
set_script: function (value) {
if (this._script != value) {
this._script = value;
this.raisePropertyChanged('script');
}
}
}
$AA.ScriptAction.registerClass('AjaxControlToolkit.Animation.ScriptAction', $AA.Action);
$AA.registerAnimation('scriptAction', $AA.ScriptAction);
/* END AjaxControlToolkit.Animation.Animations.js */
/* START AjaxControlToolkit.Animation.AnimationBehavior.js */
Type.registerNamespace('AjaxControlToolkit.Animation');
AjaxControlToolkit.Animation.AnimationBehavior = function (element) {
AjaxControlToolkit.Animation.AnimationBehavior.initializeBase(this, [element]);
this._onLoad = null;
this._onClick = null;
this._onMouseOver = null;
this._onMouseOut = null;
this._onHoverOver = null;
this._onHoverOut = null;
this._onClickHandler = null;
this._onMouseOverHandler = null;
this._onMouseOutHandler = null;
}
AjaxControlToolkit.Animation.AnimationBehavior.prototype = {
initialize: function () {
AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(this, 'initialize');
var element = this.get_element();
if (element) {
this._onClickHandler = Function.createDelegate(this, this.OnClick);
$addHandler(element, 'click', this._onClickHandler);
this._onMouseOverHandler = Function.createDelegate(this, this.OnMouseOver);
$addHandler(element, 'mouseover', this._onMouseOverHandler);
this._onMouseOutHandler = Function.createDelegate(this, this.OnMouseOut);
$addHandler(element, 'mouseout', this._onMouseOutHandler);
}
},
dispose: function () {
var element = this.get_element();
if (element) {
if (this._onClickHandler) {
$removeHandler(element, 'click', this._onClickHandler);
this._onClickHandler = null;
}
if (this._onMouseOverHandler) {
$removeHandler(element, 'mouseover', this._onMouseOverHandler);
this._onMouseOverHandler = null;
}
if (this._onMouseOutHandler) {
$removeHandler(element, 'mouseout', this._onMouseOutHandler);
this._onMouseOutHandler = null;
}
}
this._onLoad = null;
this._onClick = null;
this._onMouseOver = null;
this._onMouseOut = null;
this._onHoverOver = null;
this._onHoverOut = null;
AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(this, 'dispose');
},
get_OnLoad: function () {
return this._onLoad ? this._onLoad.get_json() : null;
},
set_OnLoad: function (value) {
if (!this._onLoad) {
this._onLoad = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onLoad.initialize();
}
this._onLoad.set_json(value);
this.raisePropertyChanged('OnLoad');
this._onLoad.play();
},
get_OnLoadBehavior: function () {
return this._onLoad;
},
get_OnClick: function () {
return this._onClick ? this._onClick.get_json() : null;
},
set_OnClick: function (value) {
if (!this._onClick) {
this._onClick = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onClick.initialize();
}
this._onClick.set_json(value);
this.raisePropertyChanged('OnClick');
},
get_OnClickBehavior: function () {
return this._onClick;
},
OnClick: function () {
if (this._onClick) {
this._onClick.play();
}
},
get_OnMouseOver: function () {
return this._onMouseOver ? this._onMouseOver.get_json() : null;
},
set_OnMouseOver: function (value) {
if (!this._onMouseOver) {
this._onMouseOver = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onMouseOver.initialize();
}
this._onMouseOver.set_json(value);
this.raisePropertyChanged('OnMouseOver');
},
get_OnMouseOverBehavior: function () {
return this._onMouseOver;
},
OnMouseOver: function () {
if (this._onMouseOver) {
this._onMouseOver.play();
}
if (this._onHoverOver) {
if (this._onHoverOut) {
this._onHoverOut.quit();
}
this._onHoverOver.play();
}
},
get_OnMouseOut: function () {
return this._onMouseOut ? this._onMouseOut.get_json() : null;
},
set_OnMouseOut: function (value) {
if (!this._onMouseOut) {
this._onMouseOut = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onMouseOut.initialize();
}
this._onMouseOut.set_json(value);
this.raisePropertyChanged('OnMouseOut');
},
get_OnMouseOutBehavior: function () {
return this._onMouseOut;
},
OnMouseOut: function () {
if (this._onMouseOut) {
this._onMouseOut.play();
}
if (this._onHoverOut) {
if (this._onHoverOver) {
this._onHoverOver.quit();
}
this._onHoverOut.play();
}
},
get_OnHoverOver: function () {
return this._onHoverOver ? this._onHoverOver.get_json() : null;
},
set_OnHoverOver: function (value) {
if (!this._onHoverOver) {
this._onHoverOver = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHoverOver.initialize();
}
this._onHoverOver.set_json(value);
this.raisePropertyChanged('OnHoverOver');
},
get_OnHoverOverBehavior: function () {
return this._onHoverOver;
},
get_OnHoverOut: function () {
return this._onHoverOut ? this._onHoverOut.get_json() : null;
},
set_OnHoverOut: function (value) {
if (!this._onHoverOut) {
this._onHoverOut = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHoverOut.initialize();
}
this._onHoverOut.set_json(value);
this.raisePropertyChanged('OnHoverOut');
},
get_OnHoverOutBehavior: function () {
return this._onHoverOut;
}
}
AjaxControlToolkit.Animation.AnimationBehavior.registerClass('AjaxControlToolkit.Animation.AnimationBehavior', AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.Animation.GenericAnimationBehavior = function (element) {
AjaxControlToolkit.Animation.GenericAnimationBehavior.initializeBase(this, [element]);
this._json = null;
this._animation = null;
}
AjaxControlToolkit.Animation.GenericAnimationBehavior.prototype = {
dispose: function () {
this.disposeAnimation();
AjaxControlToolkit.Animation.GenericAnimationBehavior.callBaseMethod(this, 'dispose');
},
disposeAnimation: function () {
if (this._animation) {
this._animation.dispose();
}
this._animation = null;
},
play: function () {
if (this._animation && !this._animation.get_isPlaying()) {
this.stop();
this._animation.play();
}
},
stop: function () {
if (this._animation) {
if (this._animation.get_isPlaying()) {
this._animation.stop(true);
}
}
},
quit: function () {
if (this._animation) {
if (this._animation.get_isPlaying()) {
this._animation.stop(false);
}
}
},
get_json: function () {
return this._json;
},
set_json: function (value) {
if (this._json != value) {
this._json = value;
this.raisePropertyChanged('json');
this.disposeAnimation();
var element = this.get_element();
if (element) {
this._animation = AjaxControlToolkit.Animation.buildAnimation(this._json, element);
if (this._animation) {
this._animation.initialize();
}
this.raisePropertyChanged('animation');
}
}
},
get_animation: function () {
return this._animation;
}
}
AjaxControlToolkit.Animation.GenericAnimationBehavior.registerClass('AjaxControlToolkit.Animation.GenericAnimationBehavior', AjaxControlToolkit.BehaviorBase);
/* END AjaxControlToolkit.Animation.AnimationBehavior.js */
/* START AjaxControlToolkit.PopupExtender.PopupBehavior.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.PopupBehavior = function (element) {
AjaxControlToolkit.PopupBehavior.initializeBase(this, [element]);
this._x = 0;
this._y = 0;
this._positioningMode = AjaxControlToolkit.PositioningMode.Absolute;
this._parentElement = null;
this._parentElementID = null;
this._moveHandler = null;
this._firstPopup = true;
this._originalParent = null;
this._visible = false;
this._onShow = null;
this._onShowEndedHandler = null;
this._onHide = null;
this._onHideEndedHandler = null;
}
AjaxControlToolkit.PopupBehavior.prototype = {
initialize: function () {
AjaxControlToolkit.PopupBehavior.callBaseMethod(this, 'initialize');
this._hidePopup();
this.get_element().style.position = "absolute";
this._onShowEndedHandler = Function.createDelegate(this, this._onShowEnded);
this._onHideEndedHandler = Function.createDelegate(this, this._onHideEnded);
},
dispose: function () {
var element = this.get_element();
if (element) {
if (this._visible) {
this.hide();
}
if (this._originalParent) {
element.parentNode.removeChild(element);
this._originalParent.appendChild(element);
this._originalParent = null;
}
element._hideWindowedElementsIFrame = null;
}
this._parentElement = null;
if (this._onShow && this._onShow.get_animation() && this._onShowEndedHandler) {
this._onShow.get_animation().remove_ended(this._onShowEndedHandler);
}
this._onShowEndedHandler = null;
this._onShow = null;
if (this._onHide && this._onHide.get_animation() && this._onHideEndedHandler) {
this._onHide.get_animation().remove_ended(this._onHideEndedHandler);
}
this._onHideEndedHandler = null;
this._onHide = null;
AjaxControlToolkit.PopupBehavior.callBaseMethod(this, 'dispose');
},
show: function () {
if (this._visible) {
return;
}
var eventArgs = new Sys.CancelEventArgs();
this.raiseShowing(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
this._visible = true;
var element = this.get_element();
$common.setVisible(element, true);
this.setupPopup();
if (this._onShow) {
$common.setVisible(element, false);
this.onShow();
} else {
this.raiseShown(Sys.EventArgs.Empty);
}
},
hide: function () {
if (!this._visible) {
return;
}
var eventArgs = new Sys.CancelEventArgs();
this.raiseHiding(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
this._visible = false;
if (this._onHide) {
this.onHide();
} else {
this._hidePopup();
this._hideCleanup();
}
},
getBounds: function () {
var element = this.get_element();
var offsetParent = element.offsetParent || document.documentElement;
var diff;
var parentBounds;
if (this._parentElement) {
parentBounds = $common.getBounds(this._parentElement);
var offsetParentLocation = $common.getLocation(offsetParent);
diff = {x: parentBounds.x - offsetParentLocation.x, y: parentBounds.y - offsetParentLocation.y};
} else {
parentBounds = $common.getBounds(offsetParent);
diff = {x: 0, y: 0};
}
var width = element.offsetWidth - (element.clientLeft ? element.clientLeft * 2 : 0);
var height = element.offsetHeight - (element.clientTop ? element.clientTop * 2 : 0);
if (this._firstpopup) {
element.style.width = width + "px";
this._firstpopup = false;
}
var position;
switch (this._positioningMode) {
case AjaxControlToolkit.PositioningMode.Center:
position = {
x: Math.round(parentBounds.width / 2 - width / 2),
y: Math.round(parentBounds.height / 2 - height / 2)
};
break;
case AjaxControlToolkit.PositioningMode.BottomLeft:
position = {
x: 0,
y: parentBounds.height
};
break;
case AjaxControlToolkit.PositioningMode.BottomRight:
position = {
x: parentBounds.width - width,
y: parentBounds.height
};
break;
case AjaxControlToolkit.PositioningMode.TopLeft:
position = {
x: 0,
y: -element.offsetHeight
};
break;
case AjaxControlToolkit.PositioningMode.TopRight:
position = {
x: parentBounds.width - width,
y: -element.offsetHeight
};
break;
case AjaxControlToolkit.PositioningMode.Right:
position = {
x: parentBounds.width,
y: 0
};
break;
case AjaxControlToolkit.PositioningMode.Left:
position = {
x: -element.offsetWidth,
y: 0
};
break;
default:
position = {x: 0, y: 0};
}
position.x += this._x + diff.x;
position.y += this._y + diff.y;
return new Sys.UI.Bounds(position.x, position.y, width, height);
},
adjustPopupPosition: function (bounds) {
var element = this.get_element();
if (!bounds) {
bounds = this.getBounds();
}
var newPosition = $common.getBounds(element);
var updateNeeded = false;
if (newPosition.x < 0) {
bounds.x -= newPosition.x;
updateNeeded = true;
}
if (newPosition.y < 0) {
bounds.y -= newPosition.y;
updateNeeded = true;
}
if (updateNeeded) {
$common.setLocation(element, bounds);
}
},
addBackgroundIFrame: function () {
var element = this.get_element();
if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
var childFrame = element._hideWindowedElementsIFrame;
if (!childFrame) {
childFrame = document.createElement("iframe");
childFrame.src = "javascript:'<html></html>';";
childFrame.style.position = "absolute";
childFrame.style.display = "none";
childFrame.scrolling = "no";
childFrame.frameBorder = "0";
childFrame.tabIndex = "-1";
childFrame.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
element.parentNode.insertBefore(childFrame, element);
element._hideWindowedElementsIFrame = childFrame;
this._moveHandler = Function.createDelegate(this, this._onMove);
Sys.UI.DomEvent.addHandler(element, "move", this._moveHandler);
}
$common.setBounds(childFrame, $common.getBounds(element));
childFrame.style.display = element.style.display;
if (element.currentStyle && element.currentStyle.zIndex) {
childFrame.style.zIndex = element.currentStyle.zIndex;
} else if (element.style.zIndex) {
childFrame.style.zIndex = element.style.zIndex;
}
}
},
setupPopup: function () {
var element = this.get_element();
var bounds = this.getBounds();
$common.setLocation(element, bounds);
this.adjustPopupPosition(bounds);
element.zIndex = 1000;
this.addBackgroundIFrame();
},
_hidePopup: function () {
var element = this.get_element();
$common.setVisible(element, false);
if (element.originalWidth) {
element.style.width = element.originalWidth + "px";
element.originalWidth = null;
}
},
_hideCleanup: function () {
var element = this.get_element();
if (this._moveHandler) {
Sys.UI.DomEvent.removeHandler(element, "move", this._moveHandler);
this._moveHandler = null;
}
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
var childFrame = element._hideWindowedElementsIFrame;
if (childFrame) {
childFrame.style.display = "none";
}
}
this.raiseHidden(Sys.EventArgs.Empty);
},
_onMove: function () {
var element = this.get_element();
if (element._hideWindowedElementsIFrame) {
element.parentNode.insertBefore(element._hideWindowedElementsIFrame, element);
element._hideWindowedElementsIFrame.style.top = element.style.top;
element._hideWindowedElementsIFrame.style.left = element.style.left;
}
},
get_onShow: function () {
return this._onShow ? this._onShow.get_json() : null;
},
set_onShow: function (value) {
if (!this._onShow) {
this._onShow = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onShow.initialize();
}
this._onShow.set_json(value);
var animation = this._onShow.get_animation();
if (animation) {
animation.add_ended(this._onShowEndedHandler);
}
this.raisePropertyChanged('onShow');
},
get_onShowBehavior: function () {
return this._onShow;
},
onShow: function () {
if (this._onShow) {
if (this._onHide) {
this._onHide.quit();
}
this._onShow.play();
}
},
_onShowEnded: function () {
this.adjustPopupPosition();
this.addBackgroundIFrame();
this.raiseShown(Sys.EventArgs.Empty);
},
get_onHide: function () {
return this._onHide ? this._onHide.get_json() : null;
},
set_onHide: function (value) {
if (!this._onHide) {
this._onHide = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHide.initialize();
}
this._onHide.set_json(value);
var animation = this._onHide.get_animation();
if (animation) {
animation.add_ended(this._onHideEndedHandler);
}
this.raisePropertyChanged('onHide');
},
get_onHideBehavior: function () {
return this._onHide;
},
onHide: function () {
if (this._onHide) {
if (this._onShow) {
this._onShow.quit();
}
this._onHide.play();
}
},
_onHideEnded: function () {
this._hideCleanup();
},
get_parentElement: function () {
if (!this._parentElement && this._parentElementID) {
this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement != null, String.format(AjaxControlToolkit.Resources.PopupExtender_NoParentElement, this._parentElementID));
}
return this._parentElement;
},
set_parentElement: function (element) {
this._parentElement = element;
this.raisePropertyChanged('parentElement');
},
get_parentElementID: function () {
if (this._parentElement) {
return this._parentElement.id
}
return this._parentElementID;
},
set_parentElementID: function (elementID) {
this._parentElementID = elementID;
if (this.get_isInitialized()) {
this.set_parentElement($get(elementID));
}
},
get_positioningMode: function () {
return this._positioningMode;
},
set_positioningMode: function (mode) {
this._positioningMode = mode;
this.raisePropertyChanged('positioningMode');
},
get_x: function () {
return this._x;
},
set_x: function (value) {
if (value != this._x) {
this._x = value;
if (this._visible) {
this.setupPopup();
}
this.raisePropertyChanged('x');
}
},
get_y: function () {
return this._y;
},
set_y: function (value) {
if (value != this._y) {
this._y = value;
if (this._visible) {
this.setupPopup();
}
this.raisePropertyChanged('y');
}
},
get_visible: function () {
return this._visible;
},
add_showing: function (handler) {
this.get_events().addHandler('showing', handler);
},
remove_showing: function (handler) {
this.get_events().removeHandler('showing', handler);
},
raiseShowing: function (eventArgs) {
var handler = this.get_events().getHandler('showing');
if (handler) {
handler(this, eventArgs);
}
},
add_shown: function (handler) {
this.get_events().addHandler('shown', handler);
},
remove_shown: function (handler) {
this.get_events().removeHandler('shown', handler);
},
raiseShown: function (eventArgs) {
var handler = this.get_events().getHandler('shown');
if (handler) {
handler(this, eventArgs);
}
},
add_hiding: function (handler) {
this.get_events().addHandler('hiding', handler);
},
remove_hiding: function (handler) {
this.get_events().removeHandler('hiding', handler);
},
raiseHiding: function (eventArgs) {
var handler = this.get_events().getHandler('hiding');
if (handler) {
handler(this, eventArgs);
}
},
add_hidden: function (handler) {
this.get_events().addHandler('hidden', handler);
},
remove_hidden: function (handler) {
this.get_events().removeHandler('hidden', handler);
},
raiseHidden: function (eventArgs) {
var handler = this.get_events().getHandler('hidden');
if (handler) {
handler(this, eventArgs);
}
}
}
AjaxControlToolkit.PopupBehavior.registerClass('AjaxControlToolkit.PopupBehavior', AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.PositioningMode = function () {
throw Error.invalidOperation();
}
AjaxControlToolkit.PositioningMode.prototype = {
Absolute: 0,
Center: 1,
BottomLeft: 2,
BottomRight: 3,
TopLeft: 4,
TopRight: 5,
Right: 6,
Left: 7
}
AjaxControlToolkit.PositioningMode.registerEnum('AjaxControlToolkit.PositioningMode');
/* END AjaxControlToolkit.PopupExtender.PopupBehavior.js */
/* START AjaxControlToolkit.PopupControl.PopupControlBehavior.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.PopupControlBehavior = function (element) {
AjaxControlToolkit.PopupControlBehavior.initializeBase(this, [element]);
this._popupControlID = null;
this._commitProperty = null;
this._commitScript = null;
this._position = null;
this._offsetX = 0;
this._offsetY = 0;
this._extenderControlID = null;
this._popupElement = null;
this._popupBehavior = null;
this._popupVisible = false;
this._focusHandler = null;
this._popupKeyDownHandler = null;
this._popupClickHandler = null;
this._bodyClickHandler = null;
this._onShowJson = null;
this._onHideJson = null;
}
AjaxControlToolkit.PopupControlBehavior.prototype = {
initialize: function () {
AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this, 'initialize');
var e = this.get_element();
this._popupElement = $get(this._popupControlID);
this._popupBehavior = $create(AjaxControlToolkit.PopupBehavior, {
'id': this.get_id() + 'PopupBehavior',
'parentElement': e
}, null, null, this._popupElement);
if (this._onShowJson) {
this._popupBehavior.set_onShow(this._onShowJson);
}
if (this._onHideJson) {
this._popupBehavior.set_onHide(this._onHideJson);
}
this._focusHandler = Function.createDelegate(this, this._onFocus);
this._popupClickHandler = Function.createDelegate(this, this._onPopupClick);
this._bodyClickHandler = Function.createDelegate(this, this._onBodyClick);
this._popupKeyDownHandler = Function.createDelegate(this, this._onPopupKeyDown);
$addHandler(e, 'focus', this._focusHandler);
$addHandler(e, 'click', this._focusHandler);
$addHandler(document.body, 'click', this._bodyClickHandler);
$addHandler(this._popupElement, 'click', this._popupClickHandler);
$addHandler(this._popupElement, 'keydown', this._popupKeyDownHandler);
this.registerPartialUpdateEvents();
if (AjaxControlToolkit.PopupControlBehavior.__VisiblePopup && (this.get_id() == AjaxControlToolkit.PopupControlBehavior.__VisiblePopup.get_id())) {
this._onFocus(null);
}
},
dispose: function () {
var e = this.get_element();
this._onShowJson = null;
this._onHideJson = null;
if (this._popupBehavior) {
this._popupBehavior.dispose();
this._popupBehavior = null;
}
if (this._focusHandler) {
$removeHandler(e, 'focus', this._focusHandler);
$removeHandler(e, 'click', this._focusHandler);
this._focusHandler = null;
}
if (this._bodyClickHandler) {
$removeHandler(document.body, 'click', this._bodyClickHandler);
this._bodyClickHandler = null;
}
if (this._popupClickHandler) {
$removeHandler(this._popupElement, 'click', this._popupClickHandler);
this._popupClickHandler = null;
}
if (this._popupKeyDownHandler) {
$removeHandler(this._popupElement, 'keydown', this._popupKeyDownHandler);
this._popupKeyDownHandler = null;
}
AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this, 'dispose');
},
showPopup: function () {
var old = AjaxControlToolkit.PopupControlBehavior.__VisiblePopup;
if (old && old._popupBehavior) {
old.hidePopup();
}
AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this, 'populate');
this._popupBehavior.set_x(this._getLeftOffset());
this._popupBehavior.set_y(this._getTopOffset());
this._popupBehavior.show();
this._popupVisible = true;
AjaxControlToolkit.PopupControlBehavior.__VisiblePopup = this;
},
hidePopup: function () {
this._popupBehavior.hide();
this._popupVisible = false;
AjaxControlToolkit.PopupControlBehavior.__VisiblePopup = null;
},
_onFocus: function (e) {
if (!this._popupVisible) {
this.showPopup();
}
if (e) {
e.stopPropagation();
}
},
_onPopupKeyDown: function (e) {
if (this._popupVisible && e.keyCode == 27) {
this.get_element().focus();
}
},
_onPopupClick: function (e) {
e.stopPropagation();
},
_onBodyClick: function () {
if (this._popupVisible) {
this.hidePopup();
}
},
_close: function (result) {
var e = this.get_element();
if (null != result) {
if ('$$CANCEL$$' != result) {
if (this._commitProperty) {
e[this._commitProperty] = result;
} else if ('text' == e.type) {
e.value = result;
} else {
Sys.Debug.assert(false, String.format(AjaxControlToolkit.Resources.PopupControl_NoDefaultProperty, e.id, e.type));
}
if (this._commitScript) {
eval(this._commitScript);
}
}
this.hidePopup();
}
},
_partialUpdateEndRequest: function (sender, endRequestEventArgs) {
AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this, '_partialUpdateEndRequest', [sender, endRequestEventArgs]);
if (this.get_element()) {
var result = endRequestEventArgs.get_dataItems()[this.get_element().id];
if ((undefined === result) &&
AjaxControlToolkit.PopupControlBehavior.__VisiblePopup &&
(this.get_id() == AjaxControlToolkit.PopupControlBehavior.__VisiblePopup.get_id())) {
result = endRequestEventArgs.get_dataItems()["_PopupControl_Proxy_ID_"];
}
if (undefined !== result) {
this._close(result);
}
}
},
_onPopulated: function (sender, eventArgs) {
AjaxControlToolkit.PopupControlBehavior.callBaseMethod(this, '_onPopulated', [sender, eventArgs]);
if (this._popupVisible) {
this._popupBehavior.show();
}
},
_getLeftOffset: function () {
if (AjaxControlToolkit.PopupControlPopupPosition.Left == this._position) {
return (-1 * this.get_element().offsetWidth) + this._offsetX;
} else if (AjaxControlToolkit.PopupControlPopupPosition.Right == this._position) {
return this.get_element().offsetWidth + this._offsetX;
} else {
return this._offsetX;
}
},
_getTopOffset: function () {
var yoffSet;
if (AjaxControlToolkit.PopupControlPopupPosition.Top == this._position) {
yoffSet = (-1 * this.get_element().offsetHeight) + this._offsetY;
} else if (AjaxControlToolkit.PopupControlPopupPosition.Bottom == this._position) {
yoffSet = this.get_element().offsetHeight + this._offsetY;
} else {
yoffSet = this._offsetY;
}
return yoffSet;
},
get_onShow: function () {
return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson;
},
set_onShow: function (value) {
if (this._popupBehavior) {
this._popupBehavior.set_onShow(value)
} else {
this._onShowJson = value;
}
this.raisePropertyChanged('onShow');
},
get_onShowBehavior: function () {
return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null;
},
onShow: function () {
if (this._popupBehavior) {
this._popupBehavior.onShow();
}
},
get_onHide: function () {
return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson;
},
set_onHide: function (value) {
if (this._popupBehavior) {
this._popupBehavior.set_onHide(value)
} else {
this._onHideJson = value;
}
this.raisePropertyChanged('onHide');
},
get_onHideBehavior: function () {
return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null;
},
onHide: function () {
if (this._popupBehavior) {
this._popupBehavior.onHide();
}
},
get_PopupControlID: function () {
return this._popupControlID;
},
set_PopupControlID: function (value) {
if (this._popupControlID != value) {
this._popupControlID = value;
this.raisePropertyChanged('PopupControlID');
}
},
get_CommitProperty: function () {
return this._commitProperty;
},
set_CommitProperty: function (value) {
if (this._commitProperty != value) {
this._commitProperty = value;
this.raisePropertyChanged('CommitProperty');
}
},
get_CommitScript: function () {
return this._commitScript;
},
set_CommitScript: function (value) {
if (this._commitScript != value) {
this._commitScript = value;
this.raisePropertyChanged('CommitScript');
}
},
get_Position: function () {
return this._position;
},
set_Position: function (value) {
if (this._position != value) {
this._position = value;
this.raisePropertyChanged('Position');
}
},
get_ExtenderControlID: function () {
return this._extenderControlID;
},
set_ExtenderControlID: function (value) {
if (this._extenderControlID != value) {
this._extenderControlID = value;
this.raisePropertyChanged('ExtenderControlID');
}
},
get_OffsetX: function () {
return this._offsetX;
},
set_OffsetX: function (value) {
if (this._offsetX != value) {
this._offsetX = value;
this.raisePropertyChanged('OffsetX');
}
},
get_OffsetY: function () {
return this._offsetY;
},
set_OffsetY: function (value) {
if (this._offsetY != value) {
this._offsetY = value;
this.raisePropertyChanged('OffsetY');
}
},
get_PopupVisible: function () {
return this._popupVisible;
},
add_showing: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.add_showing(handler);
}
},
remove_showing: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.remove_showing(handler);
}
},
raiseShowing: function (eventArgs) {
if (this._popupBehavior) {
this._popupBehavior.raiseShowing(eventArgs);
}
},
add_shown: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.add_shown(handler);
}
},
remove_shown: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.remove_shown(handler);
}
},
raiseShown: function (eventArgs) {
if (this._popupBehavior) {
this._popupBehavior.raiseShown(eventArgs);
}
},
add_hiding: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.add_hiding(handler);
}
},
remove_hiding: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.remove_hiding(handler);
}
},
raiseHiding: function (eventArgs) {
if (this._popupBehavior) {
this._popupBehavior.raiseHiding(eventArgs);
}
},
add_hidden: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.add_hidden(handler);
}
},
remove_hidden: function (handler) {
if (this._popupBehavior) {
this._popupBehavior.remove_hidden(handler);
}
},
raiseHidden: function (eventArgs) {
if (this._popupBehavior) {
this._popupBehavior.raiseHidden(eventArgs);
}
}
}
AjaxControlToolkit.PopupControlBehavior.registerClass('AjaxControlToolkit.PopupControlBehavior', AjaxControlToolkit.DynamicPopulateBehaviorBase);
AjaxControlToolkit.PopupControlBehavior.__VisiblePopup = null;
AjaxControlToolkit.PopupControlPopupPosition = function () {
throw Error.invalidOperation();
}
AjaxControlToolkit.PopupControlPopupPosition.prototype = {
Center: 0,
Top: 1,
Left: 2,
Bottom: 3,
Right: 4
}
AjaxControlToolkit.PopupControlPopupPosition.registerEnum("AjaxControlToolkit.PopupControlPopupPosition", false);
/* END AjaxControlToolkit.PopupControl.PopupControlBehavior.js */
/* START AjaxControlToolkit.ConfirmButton.confirmButtonBehavior.js */
Type.registerNamespace('AjaxControlToolkit');
AjaxControlToolkit.ConfirmButtonHiddenEventArgs = function (confirmed) {
AjaxControlToolkit.ConfirmButtonHiddenEventArgs.initializeBase(this);
this._confirmed = confirmed;
}
AjaxControlToolkit.ConfirmButtonHiddenEventArgs.prototype = {
get_confirmed: function () {
return this._confirmed;
}
}
AjaxControlToolkit.ConfirmButtonHiddenEventArgs.registerClass('AjaxControlToolkit.ConfirmButtonHiddenEventArgs', Sys.EventArgs);
AjaxControlToolkit.ConfirmButtonBehavior = function (element) {
AjaxControlToolkit.ConfirmButtonBehavior.initializeBase(this, [element]);
this._ConfirmTextValue = null;
this._OnClientCancelValue = null;
this._ConfirmOnFormSubmit = false;
this._displayModalPopupID = null;
this._postBackScript = null;
this._clickHandler = null;
this._oldScript = null;
}
AjaxControlToolkit.ConfirmButtonBehavior.prototype = {
initialize: function () {
AjaxControlToolkit.ConfirmButtonBehavior.callBaseMethod(this, 'initialize');
var element = this.get_element();
this._clickHandler = Function.createDelegate(this, this._onClick);
$addHandler(element, "click", this._clickHandler);
this._oldScript = element.getAttribute("onclick");
if (this._oldScript) {
element.setAttribute("onclick", null);
}
if (this._ConfirmOnFormSubmit && (typeof(WebForm_OnSubmit) == 'function') && !AjaxControlToolkit.ConfirmButtonBehavior._originalWebForm_OnSubmit) {
if (AjaxControlToolkit.TextBoxWatermarkBehavior && AjaxControlToolkit.TextBoxWatermarkBehavior._originalWebForm_OnSubmit) {
AjaxControlToolkit.ConfirmButtonBehavior._originalWebForm_OnSubmit = AjaxControlToolkit.TextBoxWatermarkBehavior._originalWebForm_OnSubmit;
AjaxControlToolkit.TextBoxWatermarkBehavior._originalWebForm_OnSubmit = AjaxControlToolkit.ConfirmButtonBehavior.WebForm_OnSubmit;
} else {
AjaxControlToolkit.ConfirmButtonBehavior._originalWebForm_OnSubmit = WebForm_OnSubmit;
WebForm_OnSubmit = AjaxControlToolkit.ConfirmButtonBehavior.WebForm_OnSubmit;
}
}
},
dispose: function () {
if (this._clickHandler) {
$removeHandler(this.get_element(), "click", this._clickHandler);
this._clickHandler = null;
}
if (this._oldScript) {
this.get_element().setAttribute("onclick", this._oldScript);
this._oldScript = null;
}
AjaxControlToolkit.ConfirmButtonBehavior.callBaseMethod(this, 'dispose');
},
_onClick: function (e) {
if (this.get_element() && !this.get_element().disabled) {
if (this._ConfirmOnFormSubmit) {
AjaxControlToolkit.ConfirmButtonBehavior._clickedBehavior = this;
} else {
if (!this._displayConfirmDialog()) {
e.preventDefault();
return false;
}
else if (this._oldScript) {
if (String.isInstanceOfType(this._oldScript)) {
eval(this._oldScript);
}
else if (typeof(this._oldScript) == 'function') {
this._oldScript();
}
}
}
}
},
_displayConfirmDialog: function () {
var eventArgs = new Sys.CancelEventArgs();
this.raiseShowing(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
if (this._displayModalPopupID) {
var mpe = $find(this._displayModalPopupID);
if (!mpe) {
throw Error.argument('displayModalPopupID', String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID, this._displayModalPopupID));
}
mpe.set_OnOkScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(true);");
mpe.set_OnCancelScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(false);");
mpe.show();
return false;
} else {
var result = window.confirm(this._ConfirmTextValue);
this._handleConfirmDialogCompletion(result);
return result;
}
},
_handleConfirmDialogCompletion: function (result) {
this.raiseHidden(new AjaxControlToolkit.ConfirmButtonHiddenEventArgs(result));
if (result) {
if (this._postBackScript) {
eval(this._postBackScript);
}
} else {
if (this._OnClientCancelValue) {
window[this._OnClientCancelValue]();
}
}
},
get_OnClientCancel: function () {
return this._OnClientCancelValue;
},
set_OnClientCancel: function (value) {
if (this._OnClientCancelValue != value) {
this._OnClientCancelValue = value;
this.raisePropertyChanged('OnClientCancel');
}
},
get_ConfirmText: function () {
return this._ConfirmTextValue;
},
set_ConfirmText: function (value) {
if (this._ConfirmTextValue != value) {
this._ConfirmTextValue = value;
this.raisePropertyChanged('ConfirmText');
}
},
get_ConfirmOnFormSubmit: function () {
return this._ConfirmOnFormSubmit;
},
set_ConfirmOnFormSubmit: function (value) {
if (this._ConfirmOnFormSubmit != value) {
this._ConfirmOnFormSubmit = value;
this.raisePropertyChanged('ConfirmOnFormSubmit');
}
},
get_displayModalPopupID: function () {
return this._displayModalPopupID;
},
set_displayModalPopupID: function (value) {
if (this._displayModalPopupID != value) {
this._displayModalPopupID = value;
this.raisePropertyChanged('displayModalPopupID');
}
},
get_postBackScript: function () {
return this._postBackScript;
},
set_postBackScript: function (value) {
if (this._postBackScript != value) {
this._postBackScript = value;
this.raisePropertyChanged('postBackScript');
}
},
add_showing: function (handler) {
this.get_events().addHandler('showing', handler);
},
remove_showing: function (handler) {
this.get_events().removeHandler('showing', handler);
},
raiseShowing: function (eventArgs) {
var handler = this.get_events().getHandler('showing');
if (handler) {
handler(this, eventArgs);
}
},
add_hidden: function (handler) {
this.get_events().addHandler('hidden', handler);
},
remove_hidden: function (handler) {
this.get_events().removeHandler('hidden', handler);
},
raiseHidden: function (eventArgs) {
var handler = this.get_events().getHandler('hidden');
if (handler) {
handler(this, eventArgs);
}
}
}
AjaxControlToolkit.ConfirmButtonBehavior.registerClass('AjaxControlToolkit.ConfirmButtonBehavior', AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.ConfirmButtonBehavior.WebForm_OnSubmit = function () {
var result = AjaxControlToolkit.ConfirmButtonBehavior._originalWebForm_OnSubmit();
if (result && AjaxControlToolkit.ConfirmButtonBehavior._clickedBehavior) {
result = AjaxControlToolkit.ConfirmButtonBehavior._clickedBehavior._displayConfirmDialog();
}
AjaxControlToolkit.ConfirmButtonBehavior._clickedBehavior = null;
return result;
}
/* END AjaxControlToolkit.ConfirmButton.confirmButtonBehavior.js */
if (typeof(Sys) !== 'undefined')Sys.Application.notifyScriptLoaded();
(function () {
function loadHandler() {
var hf = $get('MainContent_ScriptManager1_TSM');
if (!hf) return;
if (!hf._RSM_init) {
hf._RSM_init = true;
hf.value = '';
}
hf.value += ';;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-AU:d28568d3-e53e-4706-928f-3765912b66ca:ea597d4b:b25378d2;Telerik.Web.UI, Version=2014.3.1209.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-AU:0e2aaed8-3b29-4dda-bbe2-51b16609be9a:16e4e7cd:58366029:b7778d6c:e085fe68:f7645509:88144a7a:7c926187:8674cba1:c08e9f8a:59462f1:a51ee93e:24ee1bba:874f8ea2:c128760b:19620875:f46195d3:92fe8ea0:fa31b949:490a9d4e:bd8f85e4;AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-AU:707835dd-fa4b-41d1-89e7-6df5d518ffb5:b14bb7d5:13f47f54:1d056c78:dc2d6e36:5acd2e8e:4cda6429:35ff259d:331b3c69:1fdadad4';
Sys.Application.remove_load(loadHandler);
};
Sys.Application.add_load(loadHandler);
})();