﻿// (c) 2010 CodePlex Foundation
(function (f, b) { var P = "binding", Z = "DataContext", Y = "Globalization", E = "WebServices", O = "Network", t = "Serialization", w = "ComponentModel", N = "Core", D = "jQuery", m = "_notify", C = "_loadedScripts", B = "onreadystatechange", r = "_autoQueue", A = "_readyQueue", z = "_domReadyQueue", i = "script", h = "string", c = null, v = "dependencies", q = "executionDependencies", e = false, a = true, g = "undefined", o = "function"; if (!b || !b.loader) { var u = function (a) { a = a || {}; d(arguments, function (b) { b && k(b, function (c, b) { a[b] = c }) }, 1); return a }, k = function (a, c) { for (var b in a) c(a[b], b) }, d = function (b, e, f) { var d; if (b) { b = b instanceof Array || typeof b.length === "number" && (typeof b.callee === o || b.item && typeof b.nodeType === g && !b.addEventListener && !b.attachEvent) ? b : [b]; for (var c = f || 0, h = b.length; c < h; c++) if (e(b[c], c)) { d = a; break } } return !d }, gb = function (b, e, d) { var c = b[e], a = typeof c === o; a && c.call(b, d); return a }; function jb(a) { a = a || {}; d(arguments, function (b) { b && k(b, function (c, b) { if (typeof a[b] === g) a[b] = c }) }, 1); return a } var I = !!document.attachEvent, kb = 0, U = 1, x = 2, V = 3, db = {}; function p(b, e) { var d; if (b) for (var c = 0, f = b.length; c < f; c++) if (e(F(b[c]))) { d = a; break } return !d } function fb(c) { var b = {}; d(c, function (c) { b[c] = a }); return b } function ib(c, d) { for (var b = 0, f = c.length; b < f; b++) if (c[b] === d) return a; return e } function W(b, c) { var a = []; p(b.contains, function (e) { d(j(e, c ? q : v), function (c) { !b._contains[c] && a.push(c) }) }); return a } function X(b, c) { var a; if (b.contains) a = W(b, c); else { var d = R(b); if (d) a = W(d, c); else a = j(b, c ? q : v) } return a } function ab(b) { k(b._parents, function (b) { k(b._composites, function (b) { G(b, c, c, a) }); G(b, c, c, a) }) } function F(a) { return y(a) || (b.scripts[a] = { name: a }) } function G(a, c, e, d) { return b.loader._requireScript(a, c, e, d) } function S(b, c, f, e) { var a; d(b, function (b) { b = y(b); a |= G(b, c, f, e) }); return a } function y(a, e) { var d = typeof a === h ? b.scripts[a] || b.composites[a] || !e && (j(b.components[a], i) || j(b.plugins[a], i)) : a ? a.script || a : c; if (d && !d._isScript) d = c; return d } function l(a, b) { var c = (a._state = b || a._state) || 0; b && p(a.contains, function (a) { l(a, b) }); return c } function R(a) { return a._composite } function T(a) { return !a || l(a) > x } function Q(b, a) { var c = b[a]; delete b[a]; return c } function J(e, a, b) { d(Q(e, a), function (a) { a.apply(c, b || []) }) } function j(a, c, b) { return a ? (a[c] = a[c] || b) : b } function M(c, b, a) { j(c, b, []).push(a) } function eb(d, b, c, a) { j(d, b, {})[c] = a } function s(b, a) { return (a || document).getElementsByTagName(b) } function bb(a) { return document.createElement(a) } function K(a, d, g, i, h, f) { function b() { if (!I || !h || /loaded|complete/.test(a.readyState)) { if (I) a.detachEvent(g || "on" + d, b); else { a.removeEventListener(d, b, e); f && a.removeEventListener("error", b, e) } i.apply(a); a = c } } if (I) a.attachEvent(g || "on" + d, b); else { a.addEventListener(d, b, e); f && a.addEventListener("error", b, e) } } function cb() { b._domReady && b._2Pass(Q(b, z)) } function H() { var c = b._ready; if (!c && b._domReady && !(b.loader && b.loader._loading)) b._ready = c = a; c && b._2Pass(Q(b, A)) } f.Sys = b = jb(b, { version: [3, 0, 31106, 0], __namespace: a, debug: e, scripts: {}, activateDom: a, composites: {}, components: {}, plugins: {}, create: {}, converters: {}, _domLoaded: function () { if (b._domChecked) return; b._domChecked = a; function d() { if (!b._domReady) { b._domReady = a; var d = b._autoRequire; d && b.require(d, function () { b._autoRequire = c; J(b, r) }, db); cb(); H() } } K(f, "load", c, d); var e; if (I) if (f == f.top && document.documentElement.doScroll) { var h, i, g = bb("div"); e = function () { try { g.doScroll("left") } catch (a) { h = f.setTimeout(e, 0); return } g = c; d() }; e() } else K(document, c, B, d, a); else document.addEventListener && K(document, "DOMContentLoaded", c, d) }, _getById: function (c, e, i, g, b, h) { if (b) if (g && b.id === e) c.push(b); else !h && d(s("*", b), function (b) { if (b.id === e) { c.push(b); return a } }); else { var f = document.getElementById(e); f && c.push(f) } return c.length }, _getByClass: function (j, d, g, k, b, l) { function h(c) { var e, b = c.className; if (b && (b === d || b.indexOf(" " + d) >= 0 || b.indexOf(d + " ") >= 0)) { j.push(c); e = a } return e } var c, f, e; if (k && h(b) && g) return a; if (!l) { b = b || document; var i = b.querySelectorAll || b.getElementsByClassName; if (i) { if (b.querySelectorAll) d = "." + d; e = i.call(b, d); for (c = 0, f = e.length; c < f; c++) { j.push(e[c]); if (g) return a } } else { e = s("*", b); for (c = 0, f = e.length; c < f; c++) if (h(e[c]) && g) return a } } }, query: function (a, c) { return new b.ElementSet(a, c) }, "get": function (c, b) { return b && typeof b.get === o ? b.get(c) : this._find(c, b, a) }, _find: function (m, e, i, j) { var g = [], l; if (typeof m === h) l = [m]; else l = m; var k = e instanceof Array, n = /^([\$#\.])((\w|[$:\.\-])+)$/, o = /^((\w+)|\*)$/; if (typeof e === h || e instanceof Array) e = b._find(e); if (e instanceof b.ElementSet) e = e.get(); d(l, function (c) { if (typeof c !== h) if (j) ib(e, c) && g.push(c); else g.push(c); else { var l = n.exec(c); if (l && l.length === 4) { c = l[2]; var q = l[1]; if (q === "$") b._getComponent(g, c, e); else { var p = q === "#" ? b._getById : b._getByClass; if (e) d(e, function (a) { if (a.nodeType === 1) return p(g, c, i, k, a, j) }); else p(g, c, i) } } else if (o.test(c)) if (e instanceof Array) d(e, function (b) { if (b.nodeType === 1) { if (k && (c === "*" || b.tagName.toLowerCase() === c)) { g.push(b); if (i) return a } if (!j) if (!d(s(c, b), function (b) { g.push(b); if (i) return a })) return a } }); else { var m = s(c, e); if (i) { m[0] && g.push(m[0]); return a } d(m, function (a) { g.push(a) }) } else if (f.jQuery) { !j && g.push.apply(g, jQuery(c, e).get()); k && g.push.apply(g, jQuery(e).filter(c).get()) } } }); return g.length ? i ? g[0] || c : g : c }, onDomReady: function (a) { M(this, z, a); cb() }, onReady: function (a) { M(this, A, a); H() }, _onjQuery: function () { if (!b._jqLoaded) { b._jqLoaded = a; var d = jQuery.fn, c = b.ElementSet.prototype; d.components = c.components; d.component = c.component } }, _set: function (a, b) { k(b, function (c, b) { gb(a, "add_" + b, c) || gb(a, "set_" + b, c) || (a[b] = c) }) }, "require": function (j, f, h) { var m = b.loader._session++, c, k; function g() { if (f) if (b._autoRequire && h !== db) M(b, r, g); else b.onDomReady(function () { f(j, h) }) } function i() { if (!k && !c && !l()) { k = a; g() } H() } function l() { c = a; var f = []; d(j, function (a) { a = y(a); if (a) { var b = a.contains; if (b) p(b, function (a) { f.push(a) }); else f.push(a) } }); b.loader.combine && b.loader._findComposites(f); var g = S(f, i, m); c = e; return g } i() }, loadScripts: function (c, a, b) { this.loader._loadScripts(c, a, b) }, loader: { __class: a, combine: a, basePath: "", _loading: 0, _session: 0, _init: function () { var e = s(i), a = e.length ? e[e.length - 1].src : c; if (a) { this.basePath = a.slice(0, a.lastIndexOf("/")); var g = a.lastIndexOf("#"), f; if (g !== -1) { var h = a.substr(g + 1).split("&"); d(h, function (d) { var a = d.split("="), c = a[0], b = a[1]; if (c === "require") f = b.split(",") }) } b._autoRequire = f } }, _loadSrc: function (f, e) { var h = u(bb(i), { type: "text/javascript", src: f }), b = j(this, C, {}); d(s(i), function (c) { var a = c.src; if (a && !b[a]) b[a] = [] }); var g = b[f]; if (g) e && g.push(e); else { K(h, "load", B, function () { d(g, function (a) { a() }); b[f] = c }, a, a); this._loading++; b[f] = g = e ? [e] : []; s("head")[0].appendChild(h) } }, _load: function (b, d, g) { var e; if (T(b)) d(); else { e = a; var c = j(b, m, []), f = "session" + g; if (!c[f]) { c[f] = a; c.push(d) } if (l(b) < U) { l(b, U); this._loadSrc(this._getUrl(b), this._getHandler(b)) } } return e }, _getUrl: function (a) { var f = b.debug, g = a.name, c = (f ? a.debugUrl || a.releaseUrl : a.releaseUrl).replace(/\{0\}/g, g) || ""; if (c.substr(0, 2) === "%/") { var d = this.basePath, e = d.charAt(d.length - 1) === "/"; c = d + (e ? "" : "/") + c.substr(2) } return c }, _getHandler: function (a) { return function () { b.loader._loading--; l(a) < x && l(a, x); J(a, m); p(a.contains, function (a) { J(a, m) }) } }, _findComposites: function (h) { var f = {}, c = {}, g; function e(b) { b = y(b); var c = l(b); if (c < U && !R(b)) { f[b.name] = b; g = a; d(b.dependencies, e) } c < V && d(b.executionDependencies, e) } d(h, e); if (g) { k(b.composites, function (b) { if (p(b.contains, function (b) { if (!f[b.name]) return a })) { var e = {}, g = 0; d(b.contains, function (b) { var a = c[b]; if (a && !e[a.name]) { e[a.name] = a; g += a.contains.length - 1 } }); if (b.contains.length - 1 > g) { k(e, function (a) { d(a.contains, function (a) { delete c[a] }) }); d(b.contains, function (a) { c[a] = b }) } } }); k(c, function (a, c) { b.scripts[c]._composite = a }) } }, _loadScripts: function (d, e, h) { var g = -1, i = j(this, C, {}); d = d instanceof Array ? Array.apply(c, d) : [d]; function f(a) { if (!a) b.loader._loading--; if (++g < d.length) b.loader._loadSrc(d[g], f); else { e && e(d, h); H() } } f(a) }, _requireScript: function (c, g, h, d) { var m; if (!T(c)) { var e = S(X(c), g, h, d), i = S(X(c, a), g, h, d); if (!e && !i && l(c) === x) { l(c, V); J(c, "_callback"); if (c.name === D && f.jQuery) { var n = b.loader; k(b.components, n._createPlugin); k(b.plugins, function (b) { n._createPlugin(b, a) }); b._onjQuery() } if (d) { var j = c.contains; if (j) p(j, function (a) { ab(a) }); else ab(F(c)) } } else !d && !e && this._load(R(c) || c, g, h); m |= e || i } return m || !T(c) }, _registerParents: function (a) { function b(b) { var c = F(b); eb(c, "_parents", a.name, a) } d(a.dependencies, b); d(a.executionDependencies, b) }, _createPlugin: function (d, e) { if (f.jQuery) { e = e === a; var h, g; if (e) { h = d.global ? jQuery : d.dom ? jQuery.fn : c; g = b.plugins } else h = d._isBehavior ? jQuery.fn : jQuery, g = b.components; if (h) { var i = d.name, j = i; if (e) j = d.functionName || i; h[j] = (!e || d.global ? g[i]._jqQueue : g[i]._jqQueueDom) || b._getCreate(d, e, a) } } }, defineScript: function (e) { var l = b.scripts, f = e.name, i = e.contains, m = this; if (i) { var k = b.composites; k[f] = e = u(k[f], e); e._contains = fb(i); p(i, function (a) { eb(a, "_composites", f, e) }) } else { e = l[f] = u(l[f], e); this._registerParents(e); var g; function j(c) { var a; if (typeof c === h) c = { typeName: c }; else a = c.name; if (!a) { a = c.typeName; var i = a.lastIndexOf("."); if (i >= 0) a = a.substr(i + 1); a = a.substr(0, 1).toLowerCase() + a.substr(1); c.name = a } c._isBehavior = g; c.script = e; var d = b.components, k = d[a] = u(d[a], c), j = b._getCreate(c), f = g ? b.ElementSet.prototype : b.create; f[a] = f[a] || j; m._createPlugin(c) } d(e.components, j); g = a; d(e.behaviors, j); d(e.plugins, function (d) { var g = d.name, i = d.functionName || g, h = b.plugins; d.script = e; h[g] = u(h[g], d); var f = d.global ? b : d.dom ? b.ElementSet.prototype : d.components ? b.ComponentSet.prototype : c; if (f) f[i] = f[i] || b._getCreate(d, a); m._createPlugin(d, a) }) } if (e.isLoaded) e._state = V; e._isScript = a }, defineScripts: function (a, e) { d(e, function (d) { b.loader.defineScript(u(c, a, d)) }) }, registerScript: function (i, f, g) { var b = F(i); b._callback = g; var e = j(b, q, []), h = fb(e); d(f, function (a) { !h[a] && e.push(a) }); this._registerParents(b); l(b, x); G(b, c, c, a) } } }); b._getComponent = b._getComponent || function () { }; b._2Pass = b._2Pass || function (a) { d(a, function (a) { a() }) }; var n; if (!b.ElementSet) { n = b.ElementSet = function (c, a) { this._elements = typeof a === "object" && typeof a.query === o ? a.query(c).get() : b._find(c, a) || [] }; n.prototype = { __class: a, components: function (d, c) { var a = new b.ElementSet(this.get()); if (f.jQuery && this instanceof jQuery) a._jquery = this; return new b.ComponentSet(a, d, c) }, component: function (b, a) { return this.components(b, a).get(0) }, each: function (c) { for (var b = this._elements, a = 0, d = b.length; a < d; a++) if (c.call(b[a], a) === e) break; return this }, "get": function (b) { var a = this._elements; return typeof b === g ? Array.apply(c, a) : a[b] || c }, find: function (a) { return new b.ElementSet(a, this) }, filter: function (c) { return new b.ElementSet(b._find(c, this._elements, e, a)) } } } if (!b.ComponentSet) { n = b.ComponentSet = function (a, d, c) { this._elementSet = a || (a = new b.ElementSet); this._components = this._execute(a, d, c) }; n.prototype = { __class: a, setProperties: function (a) { return this.each(function () { b._set(this, a) }) }, "get": function (b) { var a = this._components; return typeof b === g ? Array.apply(c, a) : a[b || 0] || c }, each: function (b) { d(this._components, function (c, d) { if (b.call(c, d) === e) return a }); return this }, elements: function () { var a = this._elementSet; return a._jquery || a }, _execute: function (f, b, c) { var a = []; function e(c) { var a; return c instanceof b || (a = c.constructor) && (a === b || a.inheritsFrom && a.inheritsFrom(b) || a.implementsInterface && a.implementsInterface(b)) } if (b instanceof Array) a.push.apply(a, b); else f.each(function () { var c = this.control; c && (!b || e(c)) && a.push(c); d(this._behaviors, function (c) { (!b || e(c)) && a.push(c) }) }); if (typeof c !== g) if (a[c]) a = [a[c]]; else a = []; return a } } } n = c; var hb = function () { return function () { } }; b._getCreate = b._getCreate || hb; n = b.loader; n.defineScripts({ releaseUrl: "%/MicrosoftAjax{0}.js", debugUrl: "%/MicrosoftAjax{0}.debug.js", executionDependencies: [N] }, [{ name: N, executionDependencies: c, isLoaded: !!f.Type }, { name: w, plugins: [{ name: "setCommand", dom: a }, { name: "addHandler", dom: a }, { name: "addHandlers", dom: a }, { name: "removeHandler", dom: a }, { name: "clearHandlers", dom: a}], isLoaded: !!b.Component }, { name: "History", executionDependencies: [w, t], isLoaded: !!(b.Application && b.Application.get_stateString) }, { name: t, isLoaded: !!b.Serialization }, { name: O, executionDependencies: [t], isLoaded: !!(b.Net && b.Net.WebRequest) }, { name: E, executionDependencies: [O], isLoaded: !!(b.Net && b.Net.WebServiceProxy) }, { name: "ApplicationServices", executionDependencies: [E], isLoaded: !!(b.Services && b.Services.RoleService && b.Services.RoleService.get_path) }, { name: Y, isLoaded: !!Number._parse }, { name: "OpenData", executionDependencies: [Z], components: ["Sys.Data.OpenDataContext", { typeName: "Sys.Data.OpenDataServiceProxy", parameters: ["serviceUri"]}], isLoaded: !!(b.Data && b.Data.OpenDataServiceProxy) }, { name: Z, executionDependencies: [w, t, E], components: ["Sys.Data.DataContext"], isLoaded: !!(b.Data && b.Data.DataContext) }, { name: "Templates", executionDependencies: [w, t], behaviors: ["Sys.UI.DataView"], plugins: [{ name: P, global: a }, { name: P, dom: a }, { name: P, components: a }, { name: "activateElements", dom: a}], isLoaded: !!(b.UI && b.UI.Template) }, { name: "MicrosoftAjax", releaseUrl: "%/MicrosoftAjax.js", debugUrl: "%/MicrosoftAjax.debug.js", executionDependencies: c, contains: [N, w, "History", t, O, E, Y]}]); var L = (f.location.protocol === "https:" ? "https" : "http") + "://ajax.microsoft.com/ajax/"; n.defineScripts(c, [{ name: D, releaseUrl: L + "jquery/jquery-1.4.1.min.js", debugUrl: L + "jquery/jquery-1.4.1.js", isLoaded: !!f.jQuery }, { name: "jQueryValidate", releaseUrl: L + "jquery.validate/1.6/jquery.validate.min.js", debugUrl: L + "jquery.validate/1.6/jquery.validate.js", dependencies: [D], isLoaded: !!(f.jQuery && jQuery.fn.validate)}]); n._init(); if (!f.Type) { f.Type = Function; Type.registerNamespace = Type.registerNamespace || function (e) { M(b, "_ns", e); var a = f; d(e.split("."), function (b) { a = a[b] = a[b] || {} }); a = c } } f.jQuery && b._onjQuery(); b._domLoaded() } })(window, window.Sys);
