/*!
 * jQuery UI Widget 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function (a, b) { if (a.cleanData) { var c = a.cleanData; a.cleanData = function (b) { for (var d = 0, e; (e = b[d]) != null; d++) { a(e).triggerHandler("remove") } c(b) } } else { var d = a.fn.remove; a.fn.remove = function (b, c) { return this.each(function () { if (!c) { if (!b || a.filter(b, [this]).length) { a("*", this).add([this]).each(function () { a(this).triggerHandler("remove") }) } } return d.call(a(this), b, c) }) } } a.widget = function (b, c, d) { var e = b.split(".")[0], f; b = b.split(".")[1]; f = e + "-" + b; if (!d) { d = c; c = a.Widget } a.expr[":"][f] = function (c) { return !!a.data(c, b) }; a[e] = a[e] || {}; a[e][b] = function (a, b) { if (arguments.length) { this._createWidget(a, b) } }; var g = new c; g.options = a.extend(true, {}, g.options); a[e][b].prototype = a.extend(true, g, { namespace: e, widgetName: b, widgetEventPrefix: a[e][b].prototype.widgetEventPrefix || b, widgetBaseClass: f }, d); a.widget.bridge(b, a[e][b]) }; a.widget.bridge = function (c, d) { a.fn[c] = function (e) { var f = typeof e === "string", g = Array.prototype.slice.call(arguments, 1), h = this; e = !f && g.length ? a.extend.apply(null, [true, e].concat(g)) : e; if (f && e.charAt(0) === "_") { return h } if (f) { this.each(function () { var d = a.data(this, c), f = d && a.isFunction(d[e]) ? d[e].apply(d, g) : d; if (f !== d && f !== b) { h = f; return false } }) } else { this.each(function () { var b = a.data(this, c); if (b) { b.option(e || {})._init() } else { a.data(this, c, new d(e, this)) } }) } return h } }; a.Widget = function (a, b) { if (arguments.length) { this._createWidget(a, b) } }; a.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function (b, c) { a.data(c, this.widgetName, this); this.element = a(c); this.options = a.extend(true, {}, this.options, this._getCreateOptions(), b); var d = this; this.element.bind("remove." + this.widgetName, function () { d.destroy() }); this._create(); this._trigger("create"); this._init() }, _getCreateOptions: function () { return a.metadata && a.metadata.get(this.element[0])[this.widgetName] }, _create: function () { }, _init: function () { }, destroy: function () { this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled " + "ui-state-disabled") }, widget: function () { return this.element }, option: function (c, d) { var e = c; if (arguments.length === 0) { return a.extend({}, this.options) } if (typeof c === "string") { if (d === b) { return this.options[c] } e = {}; e[c] = d } this._setOptions(e); return this }, _setOptions: function (b) { var c = this; a.each(b, function (a, b) { c._setOption(a, b) }); return this }, _setOption: function (a, b) { this.options[a] = b; if (a === "disabled") { this.widget()[b ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled" + " " + "ui-state-disabled").attr("aria-disabled", b) } return this }, enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _trigger: function (b, c, d) { var e = this.options[b]; c = a.Event(c); c.type = (b === this.widgetEventPrefix ? b : this.widgetEventPrefix + b).toLowerCase(); d = d || {}; if (c.originalEvent) { for (var f = a.event.props.length, g; f; ) { g = a.event.props[--f]; c[g] = c.originalEvent[g] } } this.element.trigger(c, d); return !(a.isFunction(e) && e.call(this.element[0], c, d) === false || c.isDefaultPrevented()) } } })(jQuery)

