﻿jQuery.ui || function (b) { function l(a, d, c, e) { function f(c) { c = b[a][d][c] || []; return "string" == typeof c ? c.split(/,?\s+/) : c } var g = f("getter"); 1 == e.length && "string" == typeof e[0] && (g = g.concat(f("getterSetter"))); return -1 != b.inArray(c, g) } var m = b.fn.remove, n = b.browser.mozilla && 1.9 > parseFloat(b.browser.version); b.ui = { version: "1.7.2", plugin: { add: function (a, d, c) { var a = b.ui[a].prototype, e; for (e in c) a.plugins[e] = a.plugins[e] || [], a.plugins[e].push([d, c[e]]) }, call: function (a, b, c) { if ((b = a.plugins[b]) && a.element[0].parentNode) for (var e = 0; e < b.length; e++) a.options[b[e][0]] && b[e][1].apply(a.element, c) } }, contains: function (a, b) { return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b) }, hasScroll: function (a, d) { if ("hidden" == b(a).css("overflow")) return !1; var c = d && "left" == d ? "scrollLeft" : "scrollTop", e = !1; if (0 < a[c]) return !0; a[c] = 1; e = 0 < a[c]; a[c] = 0; return e }, isOverAxis: function (a, b, c) { return a > b && a < b + c }, isOver: function (a, d, c, e, f, g) { return b.ui.isOverAxis(a, c, f) && b.ui.isOverAxis(d, e, g) }, keyCode: { BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38} }; if (n) { var j = b.attr, o = b.fn.removeAttr, h = /^aria-/, p = /^wairole:/; b.attr = function (a, b, c) { var e = void 0 !== c; return "role" == b ? e ? j.call(this, a, b, "wairole:" + c) : (j.apply(this, arguments) || "").replace(p, "") : h.test(b) ? e ? a.setAttributeNS("http://www.w3.org/2005/07/aaa", b.replace(h, "aaa:"), c) : j.call(this, a, b.replace(h, "aaa:")) : j.apply(this, arguments) }; b.fn.removeAttr = function (a) { return h.test(a) ? this.each(function () { this.removeAttributeNS("http://www.w3.org/2005/07/aaa", a.replace(h, "")) }) : o.call(this, a) } } b.fn.extend({ remove: function () { b("*", this).add(this).each(function () { b(this).triggerHandler("remove") }); return m.apply(this, arguments) }, enableSelection: function () { return this.attr("unselectable", "off").css("MozUserSelect", "").unbind("selectstart.ui") }, disableSelection: function () { return this.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () { return !1 }) }, scrollParent: function () { var a; a = b.browser.msie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(b.curCSS(this, "position", 1)) && /(auto|scroll)/.test(b.curCSS(this, "overflow", 1) + b.curCSS(this, "overflow-y", 1) + b.curCSS(this, "overflow-x", 1)) }).eq(0) : this.parents().filter(function () { return /(auto|scroll)/.test(b.curCSS(this, "overflow", 1) + b.curCSS(this, "overflow-y", 1) + b.curCSS(this, "overflow-x", 1)) }).eq(0); return /fixed/.test(this.css("position")) || !a.length ? b(document) : a } }); b.extend(b.expr[":"], { data: function (a, d, c) { return !!b.data(a, c[3]) }, focusable: function (a) { var d = a.nodeName.toLowerCase(), c = b.attr(a, "tabindex"); return (/input|select|textarea|button|object/.test(d) ? !a.disabled : "a" == d || "area" == d ? a.href || !isNaN(c) : !isNaN(c)) && !b(a)["area" == d ? "parents" : "closest"](":hidden").length }, tabbable: function (a) { var d = b.attr(a, "tabindex"); return (isNaN(d) || 0 <= d) && b(a).is(":focusable") } }); b.widget = function (a, d) { var c = a.split(".")[0], a = a.split(".")[1]; b.fn[a] = function (d) { var f = "string" == typeof d, g = Array.prototype.slice.call(arguments, 1); if (f && "_" == d.substring(0, 1)) return this; if (f && l(c, a, d, g)) { var k = b.data(this[0], a); return k ? k[d].apply(k, g) : void 0 } return this.each(function () { var i = b.data(this, a); !i && !f && b.data(this, a, new b[c][a](this, d))._init(); i && f && b.isFunction(i[d]) && i[d].apply(i, g) }) }; b[c] = b[c] || {}; b[c][a] = function (d, f) { var g = this; this.namespace = c; this.widgetName = a; this.widgetEventPrefix = b[c][a].eventPrefix || a; this.widgetBaseClass = c + "-" + a; this.options = b.extend({}, b.widget.defaults, b[c][a].defaults, b.metadata && b.metadata.get(d)[a], f); this.element = b(d).bind("setData." + a, function (a, b, c) { if (a.target == d) return g._setData(b, c) }).bind("getData." + a, function (a, b) { if (a.target == d) return g._getData(b) }).bind("remove", function () { return g.destroy() }) }; b[c][a].prototype = b.extend({}, b.widget.prototype, d); b[c][a].getterSetter = "option" }; b.widget.prototype = { _init: function () { }, destroy: function () { this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").removeAttr("aria-disabled") }, option: function (a, d) { var c = a, e = this; if ("string" == typeof a) { if (void 0 === d) return this._getData(a); c = {}; c[a] = d } b.each(c, function (a, b) { e._setData(a, b) }) }, _getData: function (a) { return this.options[a] }, _setData: function (a, b) { this.options[a] = b; "disabled" == a && this.element[b ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", b) }, enable: function () { this._setData("disabled", !1) }, disable: function () { this._setData("disabled", !0) }, _trigger: function (a, d, c) { var e = this.options[a], a = a == this.widgetEventPrefix ? a : this.widgetEventPrefix + a, d = b.Event(d); d.type = a; if (d.originalEvent) for (var a = b.event.props.length, f; a; ) f = b.event.props[--a], d[f] = d.originalEvent[f]; this.element.trigger(d, c); return !(b.isFunction(e) && !1 === e.call(this.element[0], d, c) || d.isDefaultPrevented()) } }; b.widget.defaults = { disabled: !1 }; b.ui.mouse = { _mouseInit: function () { var a = this; this.element.bind("mousedown." + this.widgetName, function (b) { return a._mouseDown(b) }).bind("click." + this.widgetName, function (b) { if (a._preventClickEvent) return a._preventClickEvent = !1, b.stopImmediatePropagation(), !1 }); if (b.browser.msie) this._mouseUnselectable = this.element.attr("unselectable"), this.element.attr("unselectable", "on"); this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName); b.browser.msie && this.element.attr("unselectable", this._mouseUnselectable) }, _mouseDown: function (a) { a.originalEvent = a.originalEvent || {}; if (!a.originalEvent.mouseHandled) { this._mouseStarted && this._mouseUp(a); this._mouseDownEvent = a; var d = this, c = 1 == a.which, e = "string" == typeof this.options.cancel ? b(a.target).parents().add(a.target).filter(this.options.cancel).length : !1; if (!c || e || !this._mouseCapture(a)) return !0; this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) this._mouseDelayTimer = setTimeout(function () { d.mouseDelayMet = !0 }, this.options.delay); if (this._mouseDistanceMet(a) && this._mouseDelayMet(a) && (this._mouseStarted = !1 !== this._mouseStart(a), !this._mouseStarted)) return a.preventDefault(), !0; this._mouseMoveDelegate = function (a) { return d._mouseMove(a) }; this._mouseUpDelegate = function (a) { return d._mouseUp(a) }; b(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); b.browser.safari || a.preventDefault(); return a.originalEvent.mouseHandled = !0 } }, _mouseMove: function (a) { if (b.browser.msie && !a.button) return this._mouseUp(a); if (this._mouseStarted) return this._mouseDrag(a), a.preventDefault(); if (this._mouseDistanceMet(a) && this._mouseDelayMet(a)) (this._mouseStarted = !1 !== this._mouseStart(this._mouseDownEvent, a)) ? this._mouseDrag(a) : this._mouseUp(a); return !this._mouseStarted }, _mouseUp: function (a) { b(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) this._mouseStarted = !1, this._preventClickEvent = a.target == this._mouseDownEvent.target, this._mouseStop(a); return !1 }, _mouseDistanceMet: function (a) { return Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }; b.ui.mouse.defaults = { cancel: null, distance: 1, delay: 0} } (jQuery);
