﻿/*!
* jQuery UI 1.9m6
*
* 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
*/
(function (a, d) { a.ui = a.ui || {}; if (a.ui.version) { return } a.extend(a.ui, { version: "1.9m6", keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, 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, WINDOWS: 91} }); a.fn.extend({ _focus: a.fn.focus, focus: function (e, f) { return typeof e === "number" ? this.each(function () { var g = this; setTimeout(function () { a(g).focus(); if (f) { f.call(g) } }, e) }) : this._focus.apply(this, arguments) }, scrollParent: function () { var e; if ((a.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { e = this.parents().filter(function () { return (/(relative|absolute|fixed)/).test(a.curCSS(this, "position", 1)) && (/(auto|scroll)/).test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0) } else { e = this.parents().filter(function () { return (/(auto|scroll)/).test(a.curCSS(this, "overflow", 1) + a.curCSS(this, "overflow-y", 1) + a.curCSS(this, "overflow-x", 1)) }).eq(0) } return (/fixed/).test(this.css("position")) || !e.length ? a(document) : e }, zIndex: function (h) { if (h !== d) { return this.css("zIndex", h) } if (this.length) { var f = a(this[0]), e, g; while (f.length && f[0] !== document) { e = f.css("position"); if (e === "absolute" || e === "relative" || e === "fixed") { g = parseInt(f.css("zIndex"), 10); if (!isNaN(g) && g !== 0) { return g } } f = f.parent() } } return 0 }, disableSelection: function () { return this.bind((a.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }); a.each(["Width", "Height"], function (g, e) { var f = e === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], h = e.toLowerCase(), k = { innerWidth: a.fn.innerWidth, innerHeight: a.fn.innerHeight, outerWidth: a.fn.outerWidth, outerHeight: a.fn.outerHeight }; function j(m, l, i, n) { a.each(f, function () { l -= parseFloat(a.curCSS(m, "padding" + this, true)) || 0; if (i) { l -= parseFloat(a.curCSS(m, "border" + this + "Width", true)) || 0 } if (n) { l -= parseFloat(a.curCSS(m, "margin" + this, true)) || 0 } }); return l } a.fn["inner" + e] = function (i) { if (i === d) { return k["inner" + e].call(this) } return this.each(function () { a(this).css(h, j(this, i) + "px") }) }; a.fn["outer" + e] = function (i, l) { if (typeof i !== "number") { return k["outer" + e].call(this, i) } return this.each(function () { a(this).css(h, j(this, i, true, l) + "px") }) } }); function c(g, e) { var j = g.nodeName.toLowerCase(); if ("area" === j) { var i = g.parentNode, h = i.name, f; if (!g.href || !h || i.nodeName.toLowerCase() !== "map") { return false } f = a("img[usemap=#" + h + "]")[0]; return !!f && b(f) } return (/input|select|textarea|button|object/.test(j) ? !g.disabled : "a" == j ? g.href || e : e) && b(g) } function b(e) { return !a(e).parents().andSelf().filter(function () { return a.curCSS(this, "visibility") === "hidden" || a.expr.filters.hidden(this) }).length } a.extend(a.expr[":"], { data: function (g, f, e) { return !!a.data(g, e[3]) }, focusable: function (e) { return c(e, !isNaN(a.attr(e, "tabindex"))) }, tabbable: function (g) { var e = a.attr(g, "tabindex"), f = isNaN(e); return (f || e >= 0) && c(g, !f) } }); a(function () { var e = document.body, f = e.appendChild(f = document.createElement("div")); a.extend(f.style, { minHeight: "100px", height: "auto", padding: 0, borderWidth: 0 }); a.support.minHeight = f.offsetHeight === 100; a.support.selectstart = "onselectstart" in f; e.removeChild(f).style.display = "none" }); a.extend(a.ui, { plugin: { add: function (f, g, j) { var h = a.ui[f].prototype; for (var e in j) { h.plugins[e] = h.plugins[e] || []; h.plugins[e].push([g, j[e]]) } }, call: function (e, g, f) { var j = e.plugins[g]; if (!j || !e.element[0].parentNode) { return } for (var h = 0; h < j.length; h++) { if (e.options[j[h][0]]) { j[h][1].apply(e.element, f) } } } }, contains: a.contains, hasScroll: function (h, f) { if (a(h).css("overflow") === "hidden") { return false } var e = (f && f === "left") ? "scrollLeft" : "scrollTop", g = false; if (h[e] > 0) { return true } h[e] = 1; g = (h[e] > 0); h[e] = 0; return g }, isOverAxis: function (f, e, g) { return (f > e) && (f < (e + g)) }, isOver: function (j, f, i, h, e, g) { return a.ui.isOverAxis(j, i, e) && a.ui.isOverAxis(f, h, g) } }) })(jQuery);
/*!
* jQuery UI Widget 1.9m6
*
* 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, d) { var c = Array.prototype.slice; var b = a.cleanData; a.cleanData = function (f) { for (var g = 0, h; (h = f[g]) != null; g++) { try { a(h).triggerHandler("remove") } catch (j) { } } b(f) }; a.widget = function (f, h, e) { var g = f.split(".")[0], j; f = f.split(".")[1]; j = g + "-" + f; if (!e) { e = h; h = a.Widget } a.expr[":"][j] = function (k) { return !!a.data(k, f) }; a[g] = a[g] || {}; a[g][f] = a.extend(function (k, l) { if (!this._createWidget) { return new a[g][f](k, l) } if (arguments.length) { this._createWidget(k, l) } }, a[g][f], { version: e.version }); var i = new h(); i.options = a.widget.extend({}, i.options); a.each(e, function (l, k) { if (a.isFunction(k)) { e[l] = (function () { var m = function (o) { return h.prototype[o].apply(this, c.call(arguments, 1)) }; var n = function (p, o) { return h.prototype[p].apply(this, o) }; return function () { var q = this._super, o = this._superApply, p; this._super = m; this._superApply = n; p = k.apply(this, arguments); this._super = q; this._superApply = o; return p } } ()) } }); a[g][f].prototype = a.widget.extend(i, { namespace: g, widgetName: f, widgetEventPrefix: f, widgetBaseClass: j }, e); a.widget.bridge(f, a[g][f]) }; a.widget.extend = function (j) { var f = c.call(arguments, 1), i = 0, e = f.length, g, h; for (; i < e; i++) { for (g in f[i]) { h = f[i][g]; if (f[i].hasOwnProperty(g) && h !== d) { j[g] = a.isPlainObject(h) ? a.widget.extend({}, j[g], h) : h } } } return j }; a.widget.bridge = function (f, e) { a.fn[f] = function (i) { var g = typeof i === "string", h = c.call(arguments, 1), j = this; i = !g && h.length ? a.widget.extend.apply(null, [i].concat(h)) : i; if (g) { this.each(function () { var k = a.data(this, f); if (!k) { return a.error("cannot call methods on " + f + " prior to initialization; attempted to call method '" + i + "'") } if (!a.isFunction(k[i]) || i.charAt(0) === "_") { return a.error("no such method '" + i + "' for " + f + " widget instance") } var l = k[i].apply(k, h); if (l !== k && l !== d) { j = l && l.jquery ? j.pushStack(l.get()) : l; return false } }) } else { this.each(function () { var k = a.data(this, f); if (k) { k.option(i || {})._init() } else { e(i, this) } }) } return j } }; a.Widget = function (e, f) { if (!this._createWidget) { return new a[namespace][name](e, f) } if (arguments.length) { this._createWidget(e, f) } }; a.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { disabled: false, create: null }, _createWidget: function (e, f) { f = a(f || this.defaultElement || this)[0]; this.element = a(f); this.options = a.widget.extend({}, this.options, this._getCreateOptions(), e); this.bindings = a(); this.hoverable = a(); this.focusable = a(); if (f !== this) { a.data(f, this.widgetName, this); this._bind({ remove: "destroy" }) } this._create(); this._trigger("create"); this._init() }, _getCreateOptions: a.noop, _create: a.noop, _init: a.noop, destroy: function () { this._destroy(); this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled ui-state-disabled"); this.bindings.unbind("." + this.widgetName); this.hoverable.removeClass("ui-state-hover"); this.focusable.removeClass("ui-state-focus") }, _destroy: a.noop, widget: function () { return this.element }, option: function (h, j) { var e = h, k, g, f; if (arguments.length === 0) { return a.widget.extend({}, this.options) } if (typeof h === "string") { e = {}; k = h.split("."); h = k.shift(); if (k.length) { g = e[h] = a.widget.extend({}, this.options[h]); for (f = 0; f < k.length - 1; f++) { g[k[f]] = g[k[f]] || {}; g = g[k[f]] } h = k.pop(); if (j === d) { return g[h] === d ? null : g[h] } g[h] = j } else { if (j === d) { return this.options[h] === d ? null : this.options[h] } e[h] = j } } this._setOptions(e); return this }, _setOptions: function (e) { var f = this; a.each(e, function (g, h) { f._setOption(g, h) }); return this }, _setOption: function (e, f) { this.options[e] = f; if (e === "disabled") { this.widget().toggleClass(this.widgetBaseClass + "-disabled ui-state-disabled", !!f).attr("aria-disabled", f); this.hoverable.removeClass("ui-state-hover"); this.focusable.removeClass("ui-state-focus") } return this }, enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _bind: function (g, f) { if (!f) { f = g; g = this.element } else { g = a(g); this.bindings = this.bindings.add(g) } var e = this; a.each(f, function (m, l) { function j() { if (e.options.disabled === true || a(this).hasClass("ui-state-disabled")) { return } return (typeof l === "string" ? e[l] : l).apply(e, arguments) } var k = m.match(/^(\w+)\s*(.*)$/), i = k[1] + "." + e.widgetName, h = k[2]; if (h) { e.widget().delegate(h, i, j) } else { g.bind(i, j) } }) }, _delay: function (h, g) { function f() { return (typeof h === "string" ? e[h] : h).apply(e, arguments) } var e = this; return setTimeout(f, g || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e); this._bind(e, { mouseenter: function (f) { a(f.currentTarget).addClass("ui-state-hover") }, mouseleave: function (f) { a(f.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (e) { this.focusable = this.focusable.add(e); this._bind(e, { focusin: function (f) { a(f.currentTarget).addClass("ui-state-focus") }, focusout: function (f) { a(f.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (g, h, j) { var l = this.options[g], e; h = a.Event(h); h.type = (g === this.widgetEventPrefix ? g : this.widgetEventPrefix + g).toLowerCase(); j = j || {}; if (h.originalEvent) { for (var f = a.event.props.length, k; f; ) { k = a.event.props[--f]; h[k] = h.originalEvent[k] } } this.element.trigger(h, j); e = a.isArray(j) ? [h].concat(j) : [h, j]; return !(a.isFunction(l) && l.apply(this.element[0], e) === false || h.isDefaultPrevented()) } }; a.each({ show: "fadeIn", hide: "fadeOut" }, function (f, e) { a.Widget.prototype["_" + f] = function (i, h, k) { if (typeof h === "string") { h = { effect: h} } var j, g = !h ? f : h === true || typeof h === "number" ? e : h.effect || e; h = h || {}; if (typeof h === "number") { h = { duration: h} } j = !a.isEmptyObject(h); h.complete = k; if (h.delay) { i.delay(h.delay) } if (j && a.effects && (a.effects.effect[g] || a.uiBackCompat !== false && a.effects[g])) { i[f](h) } else { if (g !== f && i[g]) { i[g](h.duration, h.easing, k) } else { i.queue(function (l) { a(this)[f](); if (k) { k.call(i[0]) } l() }) } } } }); if (a.uiBackCompat !== false) { a.Widget.prototype._getCreateOptions = function () { return a.metadata && a.metadata.get(this.element[0])[this.widgetName] } } })(jQuery);
/*!
* jQuery UI Mouse 1.9m6
*
* 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/Mouse
*
* Depends:
*	jquery.ui.widget.js
*/
(function (b, c) { var a = false; b(document).mouseup(function (d) { a = false }); b.widget("ui.mouse", { version: "1.9m6", options: { cancel: ":input,option", distance: 1, delay: 0 }, _mouseInit: function () { var d = this; this.element.bind("mousedown." + this.widgetName, function (e) { return d._mouseDown(e) }).bind("click." + this.widgetName, function (e) { if (true === b.data(e.target, d.widgetName + ".preventClickEvent")) { b.removeData(e.target, d.widgetName + ".preventClickEvent"); e.stopImmediatePropagation(); return false } }); this.started = false }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName) }, _mouseDown: function (f) { if (a) { return } (this._mouseStarted && this._mouseUp(f)); this._mouseDownEvent = f; var e = this, g = (f.which == 1), d = (typeof this.options.cancel == "string" && f.target.nodeName ? b(f.target).closest(this.options.cancel).length : false); if (!g || d || !this._mouseCapture(f)) { return true } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function () { e.mouseDelayMet = true }, this.options.delay) } if (this._mouseDistanceMet(f) && this._mouseDelayMet(f)) { this._mouseStarted = (this._mouseStart(f) !== false); if (!this._mouseStarted) { f.preventDefault(); return true } } if (true === b.data(f.target, this.widgetName + ".preventClickEvent")) { b.removeData(f.target, this.widgetName + ".preventClickEvent") } this._mouseMoveDelegate = function (h) { return e._mouseMove(h) }; this._mouseUpDelegate = function (h) { return e._mouseUp(h) }; b(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); f.preventDefault(); a = true; return true }, _mouseMove: function (d) { if (b.browser.msie && !(document.documentMode >= 9) && !d.button) { return this._mouseUp(d) } if (this._mouseStarted) { this._mouseDrag(d); return d.preventDefault() } if (this._mouseDistanceMet(d) && this._mouseDelayMet(d)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, d) !== false); (this._mouseStarted ? this._mouseDrag(d) : this._mouseUp(d)) } return !this._mouseStarted }, _mouseUp: function (d) { b(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; if (d.target == this._mouseDownEvent.target) { b.data(d.target, this.widgetName + ".preventClickEvent", true) } this._mouseStop(d) } return false }, _mouseDistanceMet: function (d) { return (Math.max(Math.abs(this._mouseDownEvent.pageX - d.pageX), Math.abs(this._mouseDownEvent.pageY - d.pageY)) >= this.options.distance) }, _mouseDelayMet: function (d) { return this.mouseDelayMet }, _mouseStart: function (d) { }, _mouseDrag: function (d) { }, _mouseStop: function (d) { }, _mouseCapture: function (d) { return true } }) })(jQuery); (function (a, b) { a.widget("ui.draggable", a.ui.mouse, { version: "1.9m6", widgetEventPrefix: "drag", options: { addClasses: true, appendTo: "parent", axis: false, connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false }, _create: function () { if (this.options.helper == "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) { this.element[0].style.position = "relative" } (this.options.addClasses && this.element.addClass("ui-draggable")); (this.options.disabled && this.element.addClass("ui-draggable-disabled")); this._mouseInit() }, destroy: function () { if (!this.element.data("draggable")) { return } this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy(); return this }, _mouseCapture: function (c) { var d = this.options; if (this.helper || d.disabled || a(c.target).is(".ui-resizable-handle")) { return false } this.handle = this._getHandle(c); if (!this.handle) { return false } a(d.iframeFix === true ? "iframe" : d.iframeFix).each(function () { a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1000 }).css(a(this).offset()).appendTo("body") }); return true }, _mouseStart: function (c) { var d = this.options; this.helper = this._createHelper(c); this._cacheHelperProportions(); if (a.ui.ddmanager) { a.ui.ddmanager.current = this } this._cacheMargins(); this.cssPosition = this.helper.css("position"); this.scrollParent = this.helper.scrollParent(); this.offset = this.positionAbs = this.element.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; a.extend(this.offset, { click: { left: c.pageX - this.offset.left, top: c.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this.position = this._generatePosition(c); this.originalPageX = c.pageX; this.originalPageY = c.pageY; (d.cursorAt && this._adjustOffsetFromHelper(d.cursorAt)); if (d.containment) { this._setContainment() } if (this._trigger("start", c) === false) { this._clear(); return false } this._cacheHelperProportions(); if (a.ui.ddmanager && !d.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, c) } this.helper.addClass("ui-draggable-dragging"); this._mouseDrag(c, true); if (a.ui.ddmanager) { a.ui.ddmanager.dragStart(this, c) } return true }, _mouseDrag: function (c, e) { this.position = this._generatePosition(c); this.positionAbs = this._convertPositionTo("absolute"); if (!e) { var d = this._uiHash(); if (this._trigger("drag", c, d) === false) { this._mouseUp({}); return false } this.position = d.position } if (!this.options.axis || this.options.axis != "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis != "x") { this.helper[0].style.top = this.position.top + "px" } if (a.ui.ddmanager) { a.ui.ddmanager.drag(this, c) } return false }, _mouseStop: function (d) { var e = false; if (a.ui.ddmanager && !this.options.dropBehaviour) { e = a.ui.ddmanager.drop(this, d) } if (this.dropped) { e = this.dropped; this.dropped = false } if (!this.element[0] || !this.element[0].parentNode) { return false } if ((this.options.revert == "invalid" && !e) || (this.options.revert == "valid" && e) || this.options.revert === true || (a.isFunction(this.options.revert) && this.options.revert.call(this.element, e))) { var c = this; a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { if (c._trigger("stop", d) !== false) { c._clear() } }) } else { if (this._trigger("stop", d) !== false) { this._clear() } } return false }, _mouseUp: function (c) { if (this.options.iframeFix === true) { a("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }) } if (a.ui.ddmanager) { a.ui.ddmanager.dragStop(this, c) } return a.ui.mouse.prototype._mouseUp.call(this, c) }, cancel: function () { if (this.helper.is(".ui-draggable-dragging")) { this._mouseUp({}) } else { this._clear() } return this }, _getHandle: function (c) { var d = !this.options.handle || !a(this.options.handle, this.element).length ? true : false; a(this.options.handle, this.element).find("*").andSelf().each(function () { if (this == c.target) { d = true } }); return d }, _createHelper: function (d) { var e = this.options; var c = a.isFunction(e.helper) ? a(e.helper.apply(this.element[0], [d])) : (e.helper == "clone" ? this.element.clone().removeAttr("id") : this.element); if (!c.parents("body").length) { c.appendTo((e.appendTo == "parent" ? this.element[0].parentNode : e.appendTo)) } if (c[0] != this.element[0] && !(/(fixed|absolute)/).test(c.css("position"))) { c.css("position", "absolute") } return c }, _adjustOffsetFromHelper: function (c) { if (typeof c == "string") { c = c.split(" ") } if (a.isArray(c)) { c = { left: +c[0], top: +c[1] || 0} } if ("left" in c) { this.offset.click.left = c.left + this.margins.left } if ("right" in c) { this.offset.click.left = this.helperProportions.width - c.right + this.margins.left } if ("top" in c) { this.offset.click.top = c.top + this.margins.top } if ("bottom" in c) { this.offset.click.top = this.helperProportions.height - c.bottom + this.margins.top } }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var c = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) { c.left += this.scrollParent.scrollLeft(); c.top += this.scrollParent.scrollTop() } if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie)) { c = { top: 0, left: 0} } return { top: c.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: c.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var c = this.element.position(); return { top: c.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: c.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } else { return { top: 0, left: 0} } }, _cacheMargins: function () { this.margins = { left: (parseInt(this.element.css("marginLeft"), 10) || 0), top: (parseInt(this.element.css("marginTop"), 10) || 0), right: (parseInt(this.element.css("marginRight"), 10) || 0), bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var g = this.options; if (g.containment == "parent") { g.containment = this.helper[0].parentNode } if (g.containment == "document" || g.containment == "window") { this.containment = [g.containment == "document" ? 0 : a(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, g.containment == "document" ? 0 : a(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, (g.containment == "document" ? 0 : a(window).scrollLeft()) + a(g.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (g.containment == "document" ? 0 : a(window).scrollTop()) + (a(g.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (!(/^(document|window|parent)$/).test(g.containment) && g.containment.constructor != Array) { var h = a(g.containment); var e = h[0]; if (!e) { return } var f = h.offset(); var d = (a(e).css("overflow") != "hidden"); this.containment = [(parseInt(a(e).css("borderLeftWidth"), 10) || 0) + (parseInt(a(e).css("paddingLeft"), 10) || 0), (parseInt(a(e).css("borderTopWidth"), 10) || 0) + (parseInt(a(e).css("paddingTop"), 10) || 0), (d ? Math.max(e.scrollWidth, e.offsetWidth) : e.offsetWidth) - (parseInt(a(e).css("borderLeftWidth"), 10) || 0) - (parseInt(a(e).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (d ? Math.max(e.scrollHeight, e.offsetHeight) : e.offsetHeight) - (parseInt(a(e).css("borderTopWidth"), 10) || 0) - (parseInt(a(e).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom]; this.relative_container = h } else { if (g.containment.constructor == Array) { this.containment = g.containment } } }, _convertPositionTo: function (g, i) { if (!i) { i = this.position } var e = g == "absolute" ? 1 : -1; var f = this.options, c = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = (/(html|body)/i).test(c[0].tagName); return { top: (i.top + this.offset.relative.top * e + this.offset.parent.top * e - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (h ? 0 : c.scrollTop())) * e)), left: (i.left + this.offset.relative.left * e + this.offset.parent.left * e - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : h ? 0 : c.scrollLeft()) * e))} }, _generatePosition: function (d) { var e = this.options, l = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, i = (/(html|body)/i).test(l[0].tagName); var h = d.pageX; var g = d.pageY; if (this.originalPosition) { var c; if (this.containment) { if (this.relative_container) { var k = this.relative_container.offset(); c = [this.containment[0] + k.left, this.containment[1] + k.top, this.containment[2] + k.left, this.containment[3] + k.top] } else { c = this.containment } if (d.pageX - this.offset.click.left < c[0]) { h = c[0] + this.offset.click.left } if (d.pageY - this.offset.click.top < c[1]) { g = c[1] + this.offset.click.top } if (d.pageX - this.offset.click.left > c[2]) { h = c[2] + this.offset.click.left } if (d.pageY - this.offset.click.top > c[3]) { g = c[3] + this.offset.click.top } } if (e.grid) { var j = e.grid[1] ? this.originalPageY + Math.round((g - this.originalPageY) / e.grid[1]) * e.grid[1] : this.originalPageY; g = c ? (!(j - this.offset.click.top < c[1] || j - this.offset.click.top > c[3]) ? j : (!(j - this.offset.click.top < c[1]) ? j - e.grid[1] : j + e.grid[1])) : j; var f = e.grid[0] ? this.originalPageX + Math.round((h - this.originalPageX) / e.grid[0]) * e.grid[0] : this.originalPageX; h = c ? (!(f - this.offset.click.left < c[0] || f - this.offset.click.left > c[2]) ? f : (!(f - this.offset.click.left < c[0]) ? f - e.grid[0] : f + e.grid[0])) : f } } return { top: (g - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (i ? 0 : l.scrollTop())))), left: (h - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : i ? 0 : l.scrollLeft())))} }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"); if (this.helper[0] != this.element[0] && !this.cancelHelperRemoval) { this.helper.remove() } this.helper = null; this.cancelHelperRemoval = false }, _trigger: function (c, d, e) { e = e || this._uiHash(); a.ui.plugin.call(this, c, [d, e]); if (c == "drag") { this.positionAbs = this._convertPositionTo("absolute") } return a.Widget.prototype._trigger.call(this, c, d, e) }, plugins: {}, _uiHash: function (c) { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } }); a.ui.plugin.add("draggable", "connectToSortable", { start: function (d, f) { var e = a(this).data("draggable"), g = e.options, c = a.extend({}, f, { item: e.element }); e.sortables = []; a(g.connectToSortable).each(function () { var h = a.data(this, "sortable"); if (h && !h.options.disabled) { e.sortables.push({ instance: h, shouldRevert: h.options.revert }); h.refreshPositions(); h._trigger("activate", d, c) } }) }, stop: function (d, f) { var e = a(this).data("draggable"), c = a.extend({}, f, { item: e.element }); a.each(e.sortables, function () { if (this.instance.isOver) { this.instance.isOver = 0; e.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = true } this.instance._mouseStop(d); this.instance.options.helper = this.instance.options._helper; if (e.options.helper == "original") { this.instance.currentItem.css({ top: "auto", left: "auto" }) } } else { this.instance.cancelHelperRemoval = false; this.instance._trigger("deactivate", d, c) } }) }, drag: function (d, g) { var f = a(this).data("draggable"), c = this; var e = function (j) { var p = this.offset.click.top, n = this.offset.click.left; var h = this.positionAbs.top, l = this.positionAbs.left; var k = j.height, m = j.width; var q = j.top, i = j.left; return a.ui.isOver(h + p, l + n, q, i, k, m) }; a.each(f.sortables, function (h) { this.instance.positionAbs = f.positionAbs; this.instance.helperProportions = f.helperProportions; this.instance.offset.click = f.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = a(c).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return g.helper[0] }; d.target = this.instance.currentItem[0]; this.instance._mouseCapture(d, true); this.instance._mouseStart(d, true, true); this.instance.offset.click.top = f.offset.click.top; this.instance.offset.click.left = f.offset.click.left; this.instance.offset.parent.left -= f.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= f.offset.parent.top - this.instance.offset.parent.top; f._trigger("toSortable", d); f.dropped = this.instance.element; f.currentItem = f.element; this.instance.fromOutside = f } if (this.instance.currentItem) { this.instance._mouseDrag(d) } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance._trigger("out", d, this.instance._uiHash(this.instance)); this.instance._mouseStop(d, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); if (this.instance.placeholder) { this.instance.placeholder.remove() } f._trigger("fromSortable", d); f.dropped = false } } }) } }); a.ui.plugin.add("draggable", "cursor", { start: function (d, e) { var c = a("body"), f = a(this).data("draggable").options; if (c.css("cursor")) { f._cursor = c.css("cursor") } c.css("cursor", f.cursor) }, stop: function (c, d) { var e = a(this).data("draggable").options; if (e._cursor) { a("body").css("cursor", e._cursor) } } }); a.ui.plugin.add("draggable", "opacity", { start: function (d, e) { var c = a(e.helper), f = a(this).data("draggable").options; if (c.css("opacity")) { f._opacity = c.css("opacity") } c.css("opacity", f.opacity) }, stop: function (c, d) { var e = a(this).data("draggable").options; if (e._opacity) { a(d.helper).css("opacity", e._opacity) } } }); a.ui.plugin.add("draggable", "scroll", { start: function (d, e) { var c = a(this).data("draggable"); if (c.scrollParent[0] != document && c.scrollParent[0].tagName != "HTML") { c.overflowOffset = c.scrollParent.offset() } }, drag: function (e, f) { var d = a(this).data("draggable"), g = d.options, c = false; if (d.scrollParent[0] != document && d.scrollParent[0].tagName != "HTML") { if (!g.axis || g.axis != "x") { if ((d.overflowOffset.top + d.scrollParent[0].offsetHeight) - e.pageY < g.scrollSensitivity) { d.scrollParent[0].scrollTop = c = d.scrollParent[0].scrollTop + g.scrollSpeed } else { if (e.pageY - d.overflowOffset.top < g.scrollSensitivity) { d.scrollParent[0].scrollTop = c = d.scrollParent[0].scrollTop - g.scrollSpeed } } } if (!g.axis || g.axis != "y") { if ((d.overflowOffset.left + d.scrollParent[0].offsetWidth) - e.pageX < g.scrollSensitivity) { d.scrollParent[0].scrollLeft = c = d.scrollParent[0].scrollLeft + g.scrollSpeed } else { if (e.pageX - d.overflowOffset.left < g.scrollSensitivity) { d.scrollParent[0].scrollLeft = c = d.scrollParent[0].scrollLeft - g.scrollSpeed } } } } else { if (!g.axis || g.axis != "x") { if (e.pageY - a(document).scrollTop() < g.scrollSensitivity) { c = a(document).scrollTop(a(document).scrollTop() - g.scrollSpeed) } else { if (a(window).height() - (e.pageY - a(document).scrollTop()) < g.scrollSensitivity) { c = a(document).scrollTop(a(document).scrollTop() + g.scrollSpeed) } } } if (!g.axis || g.axis != "y") { if (e.pageX - a(document).scrollLeft() < g.scrollSensitivity) { c = a(document).scrollLeft(a(document).scrollLeft() - g.scrollSpeed) } else { if (a(window).width() - (e.pageX - a(document).scrollLeft()) < g.scrollSensitivity) { c = a(document).scrollLeft(a(document).scrollLeft() + g.scrollSpeed) } } } } if (c !== false && a.ui.ddmanager && !g.dropBehaviour) { a.ui.ddmanager.prepareOffsets(d, e) } } }); a.ui.plugin.add("draggable", "snap", { start: function (d, e) { var c = a(this).data("draggable"), f = c.options; c.snapElements = []; a(f.snap.constructor != String ? (f.snap.items || ":data(draggable)") : f.snap).each(function () { var h = a(this); var g = h.offset(); if (this != c.element[0]) { c.snapElements.push({ item: this, width: h.outerWidth(), height: h.outerHeight(), top: g.top, left: g.left }) } }) }, drag: function (u, p) { var g = a(this).data("draggable"), q = g.options; var y = q.snapTolerance; var x = p.offset.left, w = x + g.helperProportions.width, f = p.offset.top, e = f + g.helperProportions.height; for (var v = g.snapElements.length - 1; v >= 0; v--) { var s = g.snapElements[v].left, n = s + g.snapElements[v].width, m = g.snapElements[v].top, A = m + g.snapElements[v].height; if (!((s - y < x && x < n + y && m - y < f && f < A + y) || (s - y < x && x < n + y && m - y < e && e < A + y) || (s - y < w && w < n + y && m - y < f && f < A + y) || (s - y < w && w < n + y && m - y < e && e < A + y))) { if (g.snapElements[v].snapping) { (g.options.snap.release && g.options.snap.release.call(g.element, u, a.extend(g._uiHash(), { snapItem: g.snapElements[v].item }))) } g.snapElements[v].snapping = false; continue } if (q.snapMode != "inner") { var c = Math.abs(m - e) <= y; var z = Math.abs(A - f) <= y; var j = Math.abs(s - w) <= y; var k = Math.abs(n - x) <= y; if (c) { p.position.top = g._convertPositionTo("relative", { top: m - g.helperProportions.height, left: 0 }).top - g.margins.top } if (z) { p.position.top = g._convertPositionTo("relative", { top: A, left: 0 }).top - g.margins.top } if (j) { p.position.left = g._convertPositionTo("relative", { top: 0, left: s - g.helperProportions.width }).left - g.margins.left } if (k) { p.position.left = g._convertPositionTo("relative", { top: 0, left: n }).left - g.margins.left } } var h = (c || z || j || k); if (q.snapMode != "outer") { var c = Math.abs(m - f) <= y; var z = Math.abs(A - e) <= y; var j = Math.abs(s - x) <= y; var k = Math.abs(n - w) <= y; if (c) { p.position.top = g._convertPositionTo("relative", { top: m, left: 0 }).top - g.margins.top } if (z) { p.position.top = g._convertPositionTo("relative", { top: A - g.helperProportions.height, left: 0 }).top - g.margins.top } if (j) { p.position.left = g._convertPositionTo("relative", { top: 0, left: s }).left - g.margins.left } if (k) { p.position.left = g._convertPositionTo("relative", { top: 0, left: n - g.helperProportions.width }).left - g.margins.left } } if (!g.snapElements[v].snapping && (c || z || j || k || h)) { (g.options.snap.snap && g.options.snap.snap.call(g.element, u, a.extend(g._uiHash(), { snapItem: g.snapElements[v].item }))) } g.snapElements[v].snapping = (c || z || j || k || h) } } }); a.ui.plugin.add("draggable", "stack", { start: function (d, e) { var g = a(this).data("draggable").options; var f = a.makeArray(a(g.stack)).sort(function (i, h) { return (parseInt(a(i).css("zIndex"), 10) || 0) - (parseInt(a(h).css("zIndex"), 10) || 0) }); if (!f.length) { return } var c = parseInt(f[0].style.zIndex) || 0; a(f).each(function (h) { this.style.zIndex = c + h }); this[0].style.zIndex = c + f.length } }); a.ui.plugin.add("draggable", "zIndex", { start: function (d, e) { var c = a(e.helper), f = a(this).data("draggable").options; if (c.css("zIndex")) { f._zIndex = c.css("zIndex") } c.css("zIndex", f.zIndex) }, stop: function (c, d) { var e = a(this).data("draggable").options; if (e._zIndex) { a(d.helper).css("zIndex", e._zIndex) } } }) })(jQuery); (function (a, b) { a.widget("ui.droppable", { version: "1.9m6", widgetEventPrefix: "drop", options: { accept: "*", activeClass: false, addClasses: true, greedy: false, hoverClass: false, scope: "default", tolerance: "intersect" }, _create: function () { var d = this.options, c = d.accept; this.isover = 0; this.isout = 1; this.accept = a.isFunction(c) ? c : function (e) { return e.is(c) }; this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; a.ui.ddmanager.droppables[d.scope] = a.ui.ddmanager.droppables[d.scope] || []; a.ui.ddmanager.droppables[d.scope].push(this); (d.addClasses && this.element.addClass("ui-droppable")) }, destroy: function () { var c = a.ui.ddmanager.droppables[this.options.scope]; for (var d = 0; d < c.length; d++) { if (c[d] == this) { c.splice(d, 1) } } this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"); return this }, _setOption: function (c, d) { if (c == "accept") { this.accept = a.isFunction(d) ? d : function (e) { return e.is(d) } } a.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (d) { var c = a.ui.ddmanager.current; if (this.options.activeClass) { this.element.addClass(this.options.activeClass) } (c && this._trigger("activate", d, this.ui(c))) }, _deactivate: function (d) { var c = a.ui.ddmanager.current; if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } (c && this._trigger("deactivate", d, this.ui(c))) }, _over: function (d) { var c = a.ui.ddmanager.current; if (!c || (c.currentItem || c.element)[0] == this.element[0]) { return } if (this.accept.call(this.element[0], (c.currentItem || c.element))) { if (this.options.hoverClass) { this.element.addClass(this.options.hoverClass) } this._trigger("over", d, this.ui(c)) } }, _out: function (d) { var c = a.ui.ddmanager.current; if (!c || (c.currentItem || c.element)[0] == this.element[0]) { return } if (this.accept.call(this.element[0], (c.currentItem || c.element))) { if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("out", d, this.ui(c)) } }, _drop: function (d, e) { var c = e || a.ui.ddmanager.current; if (!c || (c.currentItem || c.element)[0] == this.element[0]) { return false } var f = false; this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function () { var g = a.data(this, "droppable"); if (g.options.greedy && !g.options.disabled && g.options.scope == c.options.scope && g.accept.call(g.element[0], (c.currentItem || c.element)) && a.ui.intersect(c, a.extend(g, { offset: g.element.offset() }), g.options.tolerance)) { f = true; return false } }); if (f) { return false } if (this.accept.call(this.element[0], (c.currentItem || c.element))) { if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("drop", d, this.ui(c)); return this.element } return false }, ui: function (d) { return { draggable: (d.currentItem || d.element), helper: d.helper, position: d.position, offset: d.positionAbs} } }); a.ui.intersect = function (q, j, o) { if (!j.offset) { return false } var e = (q.positionAbs || q.position.absolute).left, d = e + q.helperProportions.width, n = (q.positionAbs || q.position.absolute).top, m = n + q.helperProportions.height; var g = j.offset.left, c = g + j.proportions.width, p = j.offset.top, k = p + j.proportions.height; switch (o) { case "fit": return (g <= e && d <= c && p <= n && m <= k); break; case "intersect": return (g < e + (q.helperProportions.width / 2) && d - (q.helperProportions.width / 2) < c && p < n + (q.helperProportions.height / 2) && m - (q.helperProportions.height / 2) < k); break; case "pointer": var h = ((q.positionAbs || q.position.absolute).left + (q.clickOffset || q.offset.click).left), i = ((q.positionAbs || q.position.absolute).top + (q.clickOffset || q.offset.click).top), f = a.ui.isOver(i, h, p, g, j.proportions.height, j.proportions.width); return f; break; case "touch": return ((n >= p && n <= k) || (m >= p && m <= k) || (n < p && m > k)) && ((e >= g && e <= c) || (d >= g && d <= c) || (e < g && d > c)); break; default: return false; break } }; a.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function (f, h) { var c = a.ui.ddmanager.droppables[f.options.scope] || []; var g = h ? h.type : null; var k = (f.currentItem || f.element).find(":data(droppable)").andSelf(); droppablesLoop: for (var e = 0; e < c.length; e++) { if (c[e].options.disabled || (f && !c[e].accept.call(c[e].element[0], (f.currentItem || f.element)))) { continue } for (var d = 0; d < k.length; d++) { if (k[d] == c[e].element[0]) { c[e].proportions.height = 0; continue droppablesLoop } } c[e].visible = c[e].element.css("display") != "none"; if (!c[e].visible) { continue } if (g == "mousedown") { c[e]._activate.call(c[e], h) } c[e].offset = c[e].element.offset(); c[e].proportions = { width: c[e].element[0].offsetWidth, height: c[e].element[0].offsetHeight} } }, drop: function (c, d) { var e = false; a.each(a.ui.ddmanager.droppables[c.options.scope] || [], function () { if (!this.options) { return } if (!this.options.disabled && this.visible && a.ui.intersect(c, this, this.options.tolerance)) { e = e || this._drop.call(this, d) } if (!this.options.disabled && this.visible && this.accept.call(this.element[0], (c.currentItem || c.element))) { this.isout = 1; this.isover = 0; this._deactivate.call(this, d) } }); return e }, dragStart: function (c, d) { c.element.parentsUntil("body").bind("scroll.droppable", function () { if (!c.options.refreshPositions) { a.ui.ddmanager.prepareOffsets(c, d) } }) }, drag: function (c, d) { if (c.options.refreshPositions) { a.ui.ddmanager.prepareOffsets(c, d) } a.each(a.ui.ddmanager.droppables[c.options.scope] || [], function () { if (this.options.disabled || this.greedyChild || !this.visible) { return } var f = a.ui.intersect(c, this, this.options.tolerance); var h = !f && this.isover == 1 ? "isout" : (f && this.isover == 0 ? "isover" : null); if (!h) { return } var g; if (this.options.greedy) { var e = this.element.parents(":data(droppable):eq(0)"); if (e.length) { g = a.data(e[0], "droppable"); g.greedyChild = (h == "isover" ? 1 : 0) } } if (g && h == "isover") { g.isover = 0; g.isout = 1; g._out.call(g, d) } this[h] = 1; this[h == "isout" ? "isover" : "isout"] = 0; this[h == "isover" ? "_over" : "_out"].call(this, d); if (g && h == "isout") { g.isout = 0; g.isover = 1; g._over.call(g, d) } }) }, dragStop: function (c, d) { c.element.parentsUntil("body").unbind("scroll.droppable"); if (!c.options.refreshPositions) { a.ui.ddmanager.prepareOffsets(c, d) } } } })(jQuery); (function (c, d) { c.widget("ui.resizable", c.ui.mouse, { version: "1.9m6", widgetEventPrefix: "resize", options: { alsoResize: false, animate: false, animateDuration: "slow", animateEasing: "swing", aspectRatio: false, autoHide: false, containment: false, ghost: false, grid: false, handles: "e,s,se", helper: false, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 1000 }, _create: function () { var f = this, k = this.options; this.element.addClass("ui-resizable"); c.extend(this, { _aspectRatio: !!(k.aspectRatio), aspectRatio: k.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: k.helper || k.ghost || k.animate ? k.helper || "ui-resizable-helper" : null }); if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { if (/relative/.test(this.element.css("position")) && c.browser.opera) { this.element.css({ position: "relative", top: "auto", left: "auto" }) } this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") })); this.element = this.element.parent().data("resizable", this.element.data("resizable")); this.elementIsWrapper = true; this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }); this.originalResizeStyle = this.originalElement.css("resize"); this.originalElement.css("resize", "none"); this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })); this.originalElement.css({ margin: this.originalElement.css("margin") }); this._proportionallyResize() } this.handles = k.handles || (!c(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" }); if (this.handles.constructor == String) { if (this.handles == "all") { this.handles = "n,e,s,w,se,sw,ne,nw" } var l = this.handles.split(","); this.handles = {}; for (var g = 0; g < l.length; g++) { var j = c.trim(l[g]), e = "ui-resizable-" + j; var h = c('<div class="ui-resizable-handle ' + e + '"></div>'); if (/sw|se|ne|nw/.test(j)) { h.css({ zIndex: ++k.zIndex }) } if ("se" == j) { h.addClass("ui-icon ui-icon-gripsmall-diagonal-se") } this.handles[j] = ".ui-resizable-" + j; this.element.append(h) } } this._renderAxis = function (q) { q = q || this.element; for (var n in this.handles) { if (this.handles[n].constructor == String) { this.handles[n] = c(this.handles[n], this.element).show() } if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { var o = c(this.handles[n], this.element), p = 0; p = /sw|ne|nw|se|n|s/.test(n) ? o.outerHeight() : o.outerWidth(); var m = ["padding", /ne|nw|n/.test(n) ? "Top" : /se|sw|s/.test(n) ? "Bottom" : /^e$/.test(n) ? "Right" : "Left"].join(""); q.css(m, p); this._proportionallyResize() } if (!c(this.handles[n]).length) { continue } } }; this._renderAxis(this.element); this._handles = c(".ui-resizable-handle", this.element).disableSelection(); this._handles.mouseover(function () { if (!f.resizing) { if (this.className) { var i = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i) } f.axis = i && i[1] ? i[1] : "se" } }); if (k.autoHide) { this._handles.hide(); c(this.element).addClass("ui-resizable-autohide").hover(function () { if (k.disabled) { return } c(this).removeClass("ui-resizable-autohide"); f._handles.show() }, function () { if (k.disabled) { return } if (!f.resizing) { c(this).addClass("ui-resizable-autohide"); f._handles.hide() } }) } this._mouseInit() }, destroy: function () { this._mouseDestroy(); var e = function (g) { c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; if (this.elementIsWrapper) { e(this.element); var f = this.element; f.after(this.originalElement.css({ position: f.css("position"), width: f.outerWidth(), height: f.outerHeight(), top: f.css("top"), left: f.css("left") })).remove() } this.originalElement.css("resize", this.originalResizeStyle); e(this.originalElement); return this }, _mouseCapture: function (f) { var g = false; for (var e in this.handles) { if (c(this.handles[e])[0] == f.target) { g = true } } return !this.options.disabled && g }, _mouseStart: function (g) { var j = this.options, f = this.element.position(), e = this.element; this.resizing = true; this.documentScroll = { top: c(document).scrollTop(), left: c(document).scrollLeft() }; if (e.is(".ui-draggable") || (/absolute/).test(e.css("position"))) { e.css({ position: "absolute", top: f.top, left: f.left }) } if (c.browser.opera && (/relative/).test(e.css("position"))) { e.css({ position: "relative", top: "auto", left: "auto" }) } this._renderProxy(); var k = b(this.helper.css("left")), h = b(this.helper.css("top")); if (j.containment) { k += c(j.containment).scrollLeft() || 0; h += c(j.containment).scrollTop() || 0 } this.offset = this.helper.offset(); this.position = { left: k, top: h }; this.size = this._helper ? { width: e.outerWidth(), height: e.outerHeight()} : { width: e.width(), height: e.height() }; this.originalSize = this._helper ? { width: e.outerWidth(), height: e.outerHeight()} : { width: e.width(), height: e.height() }; this.originalPosition = { left: k, top: h }; this.sizeDiff = { width: e.outerWidth() - e.width(), height: e.outerHeight() - e.height() }; this.originalMousePosition = { left: g.pageX, top: g.pageY }; this.aspectRatio = (typeof j.aspectRatio == "number") ? j.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); var i = c(".ui-resizable-" + this.axis).css("cursor"); c("body").css("cursor", i == "auto" ? this.axis + "-resize" : i); e.addClass("ui-resizable-resizing"); this._propagate("start", g); return true }, _mouseDrag: function (e) { var h = this.helper, g = this.options, m = {}, q = this, j = this.originalMousePosition, n = this.axis; var r = (e.pageX - j.left) || 0, p = (e.pageY - j.top) || 0; var i = this._change[n]; if (!i) { return false } var l = i.apply(this, [e, r, p]), k = c.browser.msie && c.browser.version < 7, f = this.sizeDiff; this._updateVirtualBoundaries(e.shiftKey); if (this._aspectRatio || e.shiftKey) { l = this._updateRatio(l, e) } l = this._respectSize(l, e); this._propagate("resize", e); h.css({ top: this.position.top + "px", left: this.position.left + "px", width: this.size.width + "px", height: this.size.height + "px" }); if (!this._helper && this._proportionallyResizeElements.length) { this._proportionallyResize() } this._updateCache(l); this._trigger("resize", e, this.ui()); return false }, _mouseStop: function (h) { this.resizing = false; var i = this.options, m = this; if (this._helper) { var g = this._proportionallyResizeElements, e = g.length && (/textarea/i).test(g[0].nodeName), f = e && c.ui.hasScroll(g[0], "left") ? 0 : m.sizeDiff.height, k = e ? 0 : m.sizeDiff.width; var n = { width: (m.helper.width() - k), height: (m.helper.height() - f) }, j = (parseInt(m.element.css("left"), 10) + (m.position.left - m.originalPosition.left)) || null, l = (parseInt(m.element.css("top"), 10) + (m.position.top - m.originalPosition.top)) || null; if (!i.animate) { this.element.css(c.extend(n, { top: l, left: j })) } m.helper.height(m.size.height); m.helper.width(m.size.width); if (this._helper && !i.animate) { this._proportionallyResize() } } c("body").css("cursor", "auto"); this.element.removeClass("ui-resizable-resizing"); this._propagate("stop", h); if (this._helper) { this.helper.remove() } return false }, _updateVirtualBoundaries: function (g) { var j = this.options, i, h, f, k, e; e = { minWidth: a(j.minWidth) ? j.minWidth : 0, maxWidth: a(j.maxWidth) ? j.maxWidth : Infinity, minHeight: a(j.minHeight) ? j.minHeight : 0, maxHeight: a(j.maxHeight) ? j.maxHeight : Infinity }; if (this._aspectRatio || g) { i = e.minHeight * this.aspectRatio; f = e.minWidth / this.aspectRatio; h = e.maxHeight * this.aspectRatio; k = e.maxWidth / this.aspectRatio; if (i > e.minWidth) { e.minWidth = i } if (f > e.minHeight) { e.minHeight = f } if (h < e.maxWidth) { e.maxWidth = h } if (k < e.maxHeight) { e.maxHeight = k } } this._vBoundaries = e }, _updateCache: function (e) { var f = this.options; this.offset = this.helper.offset(); if (a(e.left)) { this.position.left = e.left } if (a(e.top)) { this.position.top = e.top } if (a(e.height)) { this.size.height = e.height } if (a(e.width)) { this.size.width = e.width } }, _updateRatio: function (h, g) { var i = this.options, j = this.position, f = this.size, e = this.axis; if (a(h.height)) { h.width = (h.height * this.aspectRatio) } else { if (a(h.width)) { h.height = (h.width / this.aspectRatio) } } if (e == "sw") { h.left = j.left + (f.width - h.width); h.top = null } if (e == "nw") { h.top = j.top + (f.height - h.height); h.left = j.left + (f.width - h.width) } return h }, _respectSize: function (l, g) { var j = this.helper, i = this._vBoundaries, r = this._aspectRatio || g.shiftKey, q = this.axis, t = a(l.width) && i.maxWidth && (i.maxWidth < l.width), m = a(l.height) && i.maxHeight && (i.maxHeight < l.height), h = a(l.width) && i.minWidth && (i.minWidth > l.width), s = a(l.height) && i.minHeight && (i.minHeight > l.height); if (h) { l.width = i.minWidth } if (s) { l.height = i.minHeight } if (t) { l.width = i.maxWidth } if (m) { l.height = i.maxHeight } var f = this.originalPosition.left + this.originalSize.width, p = this.position.top + this.size.height; var k = /sw|nw|w/.test(q), e = /nw|ne|n/.test(q); if (h && k) { l.left = f - i.minWidth } if (t && k) { l.left = f - i.maxWidth } if (s && e) { l.top = p - i.minHeight } if (m && e) { l.top = p - i.maxHeight } var n = !l.width && !l.height; if (n && !l.left && l.top) { l.top = null } else { if (n && !l.top && l.left) { l.left = null } } return l }, _proportionallyResize: function () { var k = this.options; if (!this._proportionallyResizeElements.length) { return } var g = this.helper || this.element; for (var f = 0; f < this._proportionallyResizeElements.length; f++) { var h = this._proportionallyResizeElements[f]; if (!this.borderDif) { var e = [h.css("borderTopWidth"), h.css("borderRightWidth"), h.css("borderBottomWidth"), h.css("borderLeftWidth")], j = [h.css("paddingTop"), h.css("paddingRight"), h.css("paddingBottom"), h.css("paddingLeft")]; this.borderDif = c.map(e, function (l, n) { var m = parseInt(l, 10) || 0, o = parseInt(j[n], 10) || 0; return m + o }) } if (c.browser.msie && !(!(c(g).is(":hidden") || c(g).parents(":hidden").length))) { continue } h.css({ height: (g.height() - this.borderDif[0] - this.borderDif[2]) || 0, width: (g.width() - this.borderDif[1] - this.borderDif[3]) || 0 }) } }, _renderProxy: function () { var f = this.element, i = this.options; this.elementOffset = f.offset(); if (this._helper) { this.helper = this.helper || c('<div style="overflow:hidden;"></div>'); var e = c.browser.msie && c.browser.version < 7, g = (e ? 1 : 0), h = (e ? 2 : -1); this.helper.addClass(this._helper).css({ width: this.element.outerWidth() + h, height: this.element.outerHeight() + h, position: "absolute", left: this.elementOffset.left - g + "px", top: this.elementOffset.top - g + "px", zIndex: ++i.zIndex }); this.helper.appendTo("body").disableSelection() } else { this.helper = this.element } }, _change: { e: function (g, f, e) { return { width: this.originalSize.width + f} }, w: function (h, f, e) { var j = this.options, g = this.originalSize, i = this.originalPosition; return { left: i.left + f, width: g.width - f} }, n: function (h, f, e) { var j = this.options, g = this.originalSize, i = this.originalPosition; return { top: i.top + e, height: g.height - e} }, s: function (g, f, e) { return { height: this.originalSize.height + e} }, se: function (g, f, e) { return c.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [g, f, e])) }, sw: function (g, f, e) { return c.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [g, f, e])) }, ne: function (g, f, e) { return c.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [g, f, e])) }, nw: function (g, f, e) { return c.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [g, f, e])) } }, _propagate: function (f, e) { c.ui.plugin.call(this, f, [e, this.ui()]); (f != "resize" && this._trigger(f, e, this.ui())) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition} } }); c.ui.plugin.add("resizable", "alsoResize", { start: function (f, g) { var e = c(this).data("resizable"), i = e.options; var h = function (j) { c(j).each(function () { var k = c(this); k.data("resizable-alsoresize", { width: parseInt(k.width(), 10), height: parseInt(k.height(), 10), left: parseInt(k.css("left"), 10), top: parseInt(k.css("top"), 10), position: k.css("position") }) }) }; if (typeof (i.alsoResize) == "object" && !i.alsoResize.parentNode) { if (i.alsoResize.length) { i.alsoResize = i.alsoResize[0]; h(i.alsoResize) } else { c.each(i.alsoResize, function (j) { h(j) }) } } else { h(i.alsoResize) } }, resize: function (g, i) { var f = c(this).data("resizable"), j = f.options, h = f.originalSize, l = f.originalPosition; var k = { height: (f.size.height - h.height) || 0, width: (f.size.width - h.width) || 0, top: (f.position.top - l.top) || 0, left: (f.position.left - l.left) || 0 }, e = function (m, n) { c(m).each(function () { var q = c(this), r = c(this).data("resizable-alsoresize"), p = {}, o = n && n.length ? n : q.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; c.each(o, function (s, u) { var t = (r[u] || 0) + (k[u] || 0); if (t && t >= 0) { p[u] = t || null } }); if (c.browser.opera && /relative/.test(q.css("position"))) { f._revertToRelativePosition = true; q.css({ position: "absolute", top: "auto", left: "auto" }) } q.css(p) }) }; if (typeof (j.alsoResize) == "object" && !j.alsoResize.nodeType) { c.each(j.alsoResize, function (m, n) { e(m, n) }) } else { e(j.alsoResize) } }, stop: function (g, h) { var f = c(this).data("resizable"), i = f.options; var e = function (j) { c(j).each(function () { var k = c(this); k.css({ position: k.data("resizable-alsoresize").position }) }) }; if (f._revertToRelativePosition) { f._revertToRelativePosition = false; if (typeof (i.alsoResize) == "object" && !i.alsoResize.nodeType) { c.each(i.alsoResize, function (j) { e(j) }) } else { e(i.alsoResize) } } c(this).removeData("resizable-alsoresize") } }); c.ui.plugin.add("resizable", "animate", { stop: function (i, n) { var p = c(this).data("resizable"), j = p.options; var h = p._proportionallyResizeElements, e = h.length && (/textarea/i).test(h[0].nodeName), f = e && c.ui.hasScroll(h[0], "left") ? 0 : p.sizeDiff.height, l = e ? 0 : p.sizeDiff.width; var g = { width: (p.size.width - l), height: (p.size.height - f) }, k = (parseInt(p.element.css("left"), 10) + (p.position.left - p.originalPosition.left)) || null, m = (parseInt(p.element.css("top"), 10) + (p.position.top - p.originalPosition.top)) || null; p.element.animate(c.extend(g, m && k ? { top: m, left: k} : {}), { duration: j.animateDuration, easing: j.animateEasing, step: function () { var o = { width: parseInt(p.element.css("width"), 10), height: parseInt(p.element.css("height"), 10), top: parseInt(p.element.css("top"), 10), left: parseInt(p.element.css("left"), 10) }; if (h && h.length) { c(h[0]).css({ width: o.width, height: o.height }) } p._updateCache(o); p._propagate("resize", i) } }) } }); c.ui.plugin.add("resizable", "containment", { start: function (f, r) { var t = c(this).data("resizable"), j = t.options, l = t.element; var g = j.containment, k = (g instanceof c) ? g.get(0) : (/parent/.test(g)) ? l.parent().get(0) : g; if (!k) { return } t.containerElement = c(k); if (/document/.test(g) || g == document) { t.containerOffset = { left: 0, top: 0 }; t.containerPosition = { left: 0, top: 0 }; t.parentData = { element: c(document), left: 0, top: 0, width: c(document).width(), height: c(document).height() || document.body.parentNode.scrollHeight} } else { var n = c(k), i = []; c(["Top", "Right", "Left", "Bottom"]).each(function (p, o) { i[p] = b(n.css("padding" + o)) }); t.containerOffset = n.offset(); t.containerPosition = n.position(); t.containerSize = { height: (n.innerHeight() - i[3]), width: (n.innerWidth() - i[1]) }; var q = t.containerOffset, e = t.containerSize.height, m = t.containerSize.width, h = (c.ui.hasScroll(k, "left") ? k.scrollWidth : m), s = (c.ui.hasScroll(k) ? k.scrollHeight : e); t.parentData = { element: k, left: q.left, top: q.top, width: h, height: s} } }, resize: function (g, q) { var t = c(this).data("resizable"), i = t.options, f = t.containerSize, p = t.containerOffset, m = t.size, n = t.position, r = t._aspectRatio || g.shiftKey, e = { top: 0, left: 0 }, h = t.containerElement; if (h[0] != document && (/static/).test(h.css("position"))) { e = p } if (n.left < (t._helper ? p.left : 0)) { t.size.width = t.size.width + (t._helper ? (t.position.left - p.left) : (t.position.left - e.left)); if (r) { t.size.height = t.size.width / i.aspectRatio } t.position.left = i.helper ? p.left : 0 } if (n.top < (t._helper ? p.top : 0)) { t.size.height = t.size.height + (t._helper ? (t.position.top - p.top) : t.position.top); if (r) { t.size.width = t.size.height * i.aspectRatio } t.position.top = t._helper ? p.top : 0 } t.offset.left = t.parentData.left + t.position.left; t.offset.top = t.parentData.top + t.position.top; var l = Math.abs((t._helper ? t.offset.left - e.left : (t.offset.left - e.left)) + t.sizeDiff.width), s = Math.abs((t._helper ? t.offset.top - e.top : (t.offset.top - p.top)) + t.sizeDiff.height); var k = t.containerElement.get(0) == t.element.parent().get(0), j = /relative|absolute/.test(t.containerElement.css("position")); if (k && j) { l -= t.parentData.left } if (l + t.size.width >= t.parentData.width) { t.size.width = t.parentData.width - l; if (r) { t.size.height = t.size.width / t.aspectRatio } } if (s + t.size.height >= t.parentData.height) { t.size.height = t.parentData.height - s; if (r) { t.size.width = t.size.height * t.aspectRatio } } }, stop: function (f, n) { var q = c(this).data("resizable"), g = q.options, l = q.position, m = q.containerOffset, e = q.containerPosition, i = q.containerElement; var j = c(q.helper), r = j.offset(), p = j.outerWidth() - q.sizeDiff.width, k = j.outerHeight() - q.sizeDiff.height; if (q._helper && !g.animate && (/relative/).test(i.css("position"))) { c(this).css({ left: r.left - e.left - m.left, width: p, height: k }) } if (q._helper && !g.animate && (/static/).test(i.css("position"))) { c(this).css({ left: r.left - e.left - m.left, width: p, height: k }) } } }); c.ui.plugin.add("resizable", "ghost", { start: function (g, h) { var e = c(this).data("resizable"), i = e.options, f = e.size; e.ghost = e.originalElement.clone(); e.ghost.css({ opacity: 0.25, display: "block", position: "relative", height: f.height, width: f.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass(typeof i.ghost == "string" ? i.ghost : ""); e.ghost.appendTo(e.helper) }, resize: function (f, g) { var e = c(this).data("resizable"), h = e.options; if (e.ghost) { e.ghost.css({ position: "relative", height: e.size.height, width: e.size.width }) } }, stop: function (f, g) { var e = c(this).data("resizable"), h = e.options; if (e.ghost && e.helper) { e.helper.get(0).removeChild(e.ghost.get(0)) } } }); c.ui.plugin.add("resizable", "grid", { resize: function (e, m) { var p = c(this).data("resizable"), h = p.options, k = p.size, i = p.originalSize, j = p.originalPosition, n = p.axis, l = h._aspectRatio || e.shiftKey; h.grid = typeof h.grid == "number" ? [h.grid, h.grid] : h.grid; var g = Math.round((k.width - i.width) / (h.grid[0] || 1)) * (h.grid[0] || 1), f = Math.round((k.height - i.height) / (h.grid[1] || 1)) * (h.grid[1] || 1); if (/^(se|s|e)$/.test(n)) { p.size.width = i.width + g; p.size.height = i.height + f } else { if (/^(ne)$/.test(n)) { p.size.width = i.width + g; p.size.height = i.height + f; p.position.top = j.top - f } else { if (/^(sw)$/.test(n)) { p.size.width = i.width + g; p.size.height = i.height + f; p.position.left = j.left - g } else { p.size.width = i.width + g; p.size.height = i.height + f; p.position.top = j.top - f; p.position.left = j.left - g } } } } }); var b = function (e) { return parseInt(e, 10) || 0 }; var a = function (e) { return !isNaN(parseInt(e, 10)) } })(jQuery); (function (a, b) { a.widget("ui.selectable", a.ui.mouse, { version: "1.9m6", options: { appendTo: "body", autoRefresh: true, distance: 0, filter: "*", tolerance: "touch" }, _create: function () { var c = this; this.element.addClass("ui-selectable"); this.dragged = false; var d; this.refresh = function () { d = a(c.options.filter, c.element[0]); d.each(function () { var e = a(this); var f = e.offset(); a.data(this, "selectable-item", { element: this, $element: e, left: f.left, top: f.top, right: f.left + e.outerWidth(), bottom: f.top + e.outerHeight(), startselected: false, selected: e.hasClass("ui-selected"), selecting: e.hasClass("ui-selecting"), unselecting: e.hasClass("ui-unselecting") }) }) }; this.refresh(); this.selectees = d.addClass("ui-selectee"); this._mouseInit(); this.helper = a("<div class='ui-selectable-helper'></div>") }, destroy: function () { this.selectees.removeClass("ui-selectee").removeData("selectable-item"); this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"); this._mouseDestroy(); return this }, _mouseStart: function (e) { var c = this; this.opos = [e.pageX, e.pageY]; if (this.options.disabled) { return } var d = this.options; this.selectees = a(d.filter, this.element[0]); this._trigger("start", e); a(d.appendTo).append(this.helper); this.helper.css({ left: e.clientX, top: e.clientY, width: 0, height: 0 }); if (d.autoRefresh) { this.refresh() } this.selectees.filter(".ui-selected").each(function () { var f = a.data(this, "selectable-item"); f.startselected = true; if (!e.metaKey) { f.$element.removeClass("ui-selected"); f.selected = false; f.$element.addClass("ui-unselecting"); f.unselecting = true; c._trigger("unselecting", e, { unselecting: f.element }) } }); a(e.target).parents().andSelf().each(function () { var g = a.data(this, "selectable-item"); if (g) { var f = !e.metaKey || !g.$element.hasClass("ui-selected"); g.$element.removeClass(f ? "ui-unselecting" : "ui-selected").addClass(f ? "ui-selecting" : "ui-unselecting"); g.unselecting = !f; g.selecting = f; g.selected = f; if (f) { c._trigger("selecting", e, { selecting: g.element }) } else { c._trigger("unselecting", e, { unselecting: g.element }) } return false } }) }, _mouseDrag: function (j) { var d = this; this.dragged = true; if (this.options.disabled) { return } var f = this.options; var e = this.opos[0], i = this.opos[1], c = j.pageX, h = j.pageY; if (e > c) { var g = c; c = e; e = g } if (i > h) { var g = h; h = i; i = g } this.helper.css({ left: e, top: i, width: c - e, height: h - i }); this.selectees.each(function () { var k = a.data(this, "selectable-item"); if (!k || k.element == d.element[0]) { return } var l = false; if (f.tolerance == "touch") { l = (!(k.left > c || k.right < e || k.top > h || k.bottom < i)) } else { if (f.tolerance == "fit") { l = (k.left > e && k.right < c && k.top > i && k.bottom < h) } } if (l) { if (k.selected) { k.$element.removeClass("ui-selected"); k.selected = false } if (k.unselecting) { k.$element.removeClass("ui-unselecting"); k.unselecting = false } if (!k.selecting) { k.$element.addClass("ui-selecting"); k.selecting = true; d._trigger("selecting", j, { selecting: k.element }) } } else { if (k.selecting) { if (j.metaKey && k.startselected) { k.$element.removeClass("ui-selecting"); k.selecting = false; k.$element.addClass("ui-selected"); k.selected = true } else { k.$element.removeClass("ui-selecting"); k.selecting = false; if (k.startselected) { k.$element.addClass("ui-unselecting"); k.unselecting = true } d._trigger("unselecting", j, { unselecting: k.element }) } } if (k.selected) { if (!j.metaKey && !k.startselected) { k.$element.removeClass("ui-selected"); k.selected = false; k.$element.addClass("ui-unselecting"); k.unselecting = true; d._trigger("unselecting", j, { unselecting: k.element }) } } } }); return false }, _mouseStop: function (e) { var c = this; this.dragged = false; var d = this.options; a(".ui-unselecting", this.element[0]).each(function () { var f = a.data(this, "selectable-item"); f.$element.removeClass("ui-unselecting"); f.unselecting = false; f.startselected = false; c._trigger("unselected", e, { unselected: f.element }) }); a(".ui-selecting", this.element[0]).each(function () { var f = a.data(this, "selectable-item"); f.$element.removeClass("ui-selecting").addClass("ui-selected"); f.selecting = false; f.selected = true; f.startselected = true; c._trigger("selected", e, { selected: f.element }) }); this._trigger("stop", e); this.helper.remove(); return false } }) })(jQuery); (function (a, b) { a.widget("ui.sortable", a.ui.mouse, { version: "1.9m6", widgetEventPrefix: "sort", options: { appendTo: "parent", axis: false, connectWith: false, containment: false, cursor: "auto", cursorAt: false, dropOnEmpty: true, forcePlaceholderSize: false, forceHelperSize: false, grid: false, handle: false, helper: "original", items: "> *", opacity: false, placeholder: false, revert: false, scroll: true, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1000 }, _create: function () { var c = this.options; this.containerCache = {}; this.element.addClass("ui-sortable"); this.refresh(); this.floating = this.items.length ? c.axis === "x" || (/left|right/).test(this.items[0].item.css("float")) || (/inline|table-cell/).test(this.items[0].item.css("display")) : false; this.offset = this.element.offset(); this._mouseInit() }, destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable"); this._mouseDestroy(); for (var c = this.items.length - 1; c >= 0; c--) { this.items[c].item.removeData("sortable-item") } return this }, _setOption: function (c, d) { if (c === "disabled") { this.options[c] = d; this.widget().toggleClass("ui-sortable-disabled", !!d) } else { a.Widget.prototype._setOption.apply(this, arguments) } }, _mouseCapture: function (f, g) { if (this.reverting) { return false } if (this.options.disabled || this.options.type == "static") { return false } this._refreshItems(f); var e = null, d = this, c = a(f.target).parents().each(function () { if (a.data(this, "sortable-item") == d) { e = a(this); return false } }); if (a.data(f.target, "sortable-item") == d) { e = a(f.target) } if (!e) { return false } if (this.options.handle && !g) { var h = false; a(this.options.handle, e).find("*").andSelf().each(function () { if (this == f.target) { h = true } }); if (!h) { return false } } this.currentItem = e; this._removeCurrentsFromItems(); return true }, _mouseStart: function (f, g, c) { var h = this.options, d = this; this.currentContainer = this; this.refreshPositions(); this.helper = this._createHelper(f); this._cacheHelperProportions(); this._cacheMargins(); this.scrollParent = this.helper.scrollParent(); this.offset = this.currentItem.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; this.helper.css("position", "absolute"); this.cssPosition = this.helper.css("position"); a.extend(this.offset, { click: { left: f.pageX - this.offset.left, top: f.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this._generatePosition(f); this.originalPageX = f.pageX; this.originalPageY = f.pageY; (h.cursorAt && this._adjustOffsetFromHelper(h.cursorAt)); this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; if (this.helper[0] != this.currentItem[0]) { this.currentItem.hide() } this._createPlaceholder(); if (h.containment) { this._setContainment() } if (h.cursor) { if (a("body").css("cursor")) { this._storedCursor = a("body").css("cursor") } a("body").css("cursor", h.cursor) } if (h.opacity) { if (this.helper.css("opacity")) { this._storedOpacity = this.helper.css("opacity") } this.helper.css("opacity", h.opacity) } if (h.zIndex) { if (this.helper.css("zIndex")) { this._storedZIndex = this.helper.css("zIndex") } this.helper.css("zIndex", h.zIndex) } if (this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML") { this.overflowOffset = this.scrollParent.offset() } this._trigger("start", f, this._uiHash()); if (!this._preserveHelperProportions) { this._cacheHelperProportions() } if (!c) { for (var e = this.containers.length - 1; e >= 0; e--) { this.containers[e]._trigger("activate", f, d._uiHash(this)) } } if (a.ui.ddmanager) { a.ui.ddmanager.current = this } if (a.ui.ddmanager && !h.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, f) } this.dragging = true; this.helper.addClass("ui-sortable-helper"); this._mouseDrag(f); return true }, _mouseDrag: function (g) { this.position = this._generatePosition(g); this.positionAbs = this._convertPositionTo("absolute"); if (!this.lastPositionAbs) { this.lastPositionAbs = this.positionAbs } if (this.options.scroll) { var h = this.options, c = false; if (this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML") { if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - g.pageY < h.scrollSensitivity) { this.scrollParent[0].scrollTop = c = this.scrollParent[0].scrollTop + h.scrollSpeed } else { if (g.pageY - this.overflowOffset.top < h.scrollSensitivity) { this.scrollParent[0].scrollTop = c = this.scrollParent[0].scrollTop - h.scrollSpeed } } if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - g.pageX < h.scrollSensitivity) { this.scrollParent[0].scrollLeft = c = this.scrollParent[0].scrollLeft + h.scrollSpeed } else { if (g.pageX - this.overflowOffset.left < h.scrollSensitivity) { this.scrollParent[0].scrollLeft = c = this.scrollParent[0].scrollLeft - h.scrollSpeed } } } else { if (g.pageY - a(document).scrollTop() < h.scrollSensitivity) { c = a(document).scrollTop(a(document).scrollTop() - h.scrollSpeed) } else { if (a(window).height() - (g.pageY - a(document).scrollTop()) < h.scrollSensitivity) { c = a(document).scrollTop(a(document).scrollTop() + h.scrollSpeed) } } if (g.pageX - a(document).scrollLeft() < h.scrollSensitivity) { c = a(document).scrollLeft(a(document).scrollLeft() - h.scrollSpeed) } else { if (a(window).width() - (g.pageX - a(document).scrollLeft()) < h.scrollSensitivity) { c = a(document).scrollLeft(a(document).scrollLeft() + h.scrollSpeed) } } } if (c !== false && a.ui.ddmanager && !h.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, g) } } this.positionAbs = this._convertPositionTo("absolute"); if (!this.options.axis || this.options.axis != "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis != "x") { this.helper[0].style.top = this.position.top + "px" } for (var e = this.items.length - 1; e >= 0; e--) { var f = this.items[e], d = f.item[0], j = this._intersectsWithPointer(f); if (!j) { continue } if (d != this.currentItem[0] && this.placeholder[j == 1 ? "next" : "prev"]()[0] != d && !a.contains(this.placeholder[0], d) && (this.options.type == "semi-dynamic" ? !a.contains(this.element[0], d) : true)) { this.direction = j == 1 ? "down" : "up"; if (this.options.tolerance == "pointer" || this._intersectsWithSides(f)) { this._rearrange(g, f) } else { break } this._trigger("change", g, this._uiHash()); break } } this._contactContainers(g); if (a.ui.ddmanager) { a.ui.ddmanager.drag(this, g) } this._trigger("sort", g, this._uiHash()); this.lastPositionAbs = this.positionAbs; return false }, _mouseStop: function (d, e) { if (!d) { return } if (a.ui.ddmanager && !this.options.dropBehaviour) { a.ui.ddmanager.drop(this, d) } if (this.options.revert) { var c = this; var f = c.placeholder.offset(); c.reverting = true; a(this.helper).animate({ left: f.left - this.offset.parent.left - c.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), top: f.top - this.offset.parent.top - c.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) }, parseInt(this.options.revert, 10) || 500, function () { c._clear(d) }) } else { this._clear(d, e) } return false }, cancel: function () { var c = this; if (this.dragging) { this._mouseUp({ target: null }); if (this.options.helper == "original") { this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } for (var d = this.containers.length - 1; d >= 0; d--) { this.containers[d]._trigger("deactivate", null, c._uiHash(this)); if (this.containers[d].containerCache.over) { this.containers[d]._trigger("out", null, c._uiHash(this)); this.containers[d].containerCache.over = 0 } } } if (this.placeholder) { if (this.placeholder[0].parentNode) { this.placeholder[0].parentNode.removeChild(this.placeholder[0]) } if (this.options.helper != "original" && this.helper && this.helper[0].parentNode) { this.helper.remove() } a.extend(this, { helper: null, dragging: false, reverting: false, _noFinalSort: null }); if (this.domPosition.prev) { a(this.domPosition.prev).after(this.currentItem) } else { a(this.domPosition.parent).prepend(this.currentItem) } } return this }, serialize: function (e) { var c = this._getItemsAsjQuery(e && e.connected); var d = []; e = e || {}; a(c).each(function () { var f = (a(e.item || this).attr(e.attribute || "id") || "").match(e.expression || (/(.+)[-=_](.+)/)); if (f) { d.push((e.key || f[1] + "[]") + "=" + (e.key && e.expression ? f[1] : f[2])) } }); if (!d.length && e.key) { d.push(e.key + "=") } return d.join("&") }, toArray: function (e) { var c = this._getItemsAsjQuery(e && e.connected); var d = []; e = e || {}; c.each(function () { d.push(a(e.item || this).attr(e.attribute || "id") || "") }); return d }, _intersectsWith: function (m) { var e = this.positionAbs.left, d = e + this.helperProportions.width, k = this.positionAbs.top, j = k + this.helperProportions.height; var f = m.left, c = f + m.width, n = m.top, i = n + m.height; var o = this.offset.click.top, h = this.offset.click.left; var g = (k + o) > n && (k + o) < i && (e + h) > f && (e + h) < c; if (this.options.tolerance == "pointer" || this.options.forcePointerForContainers || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? "width" : "height"] > m[this.floating ? "width" : "height"])) { return g } else { return (f < e + (this.helperProportions.width / 2) && d - (this.helperProportions.width / 2) < c && n < k + (this.helperProportions.height / 2) && j - (this.helperProportions.height / 2) < i) } }, _intersectsWithPointer: function (e) { var f = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, e.top, e.height), d = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, e.left, e.width), h = f && d, c = this._getDragVerticalDirection(), g = this._getDragHorizontalDirection(); if (!h) { return false } return this.floating ? (((g && g == "right") || c == "down") ? 2 : 1) : (c && (c == "down" ? 2 : 1)) }, _intersectsWithSides: function (f) { var d = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, f.top + (f.height / 2), f.height), e = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, f.left + (f.width / 2), f.width), c = this._getDragVerticalDirection(), g = this._getDragHorizontalDirection(); if (this.floating && g) { return ((g == "right" && e) || (g == "left" && !e)) } else { return c && ((c == "down" && d) || (c == "up" && !d)) } }, _getDragVerticalDirection: function () { var c = this.positionAbs.top - this.lastPositionAbs.top; return c != 0 && (c > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var c = this.positionAbs.left - this.lastPositionAbs.left; return c != 0 && (c > 0 ? "right" : "left") }, refresh: function (c) { this._refreshItems(c); this.refreshPositions(); return this }, _connectWith: function () { var c = this.options; return c.connectWith.constructor == String ? [c.connectWith] : c.connectWith }, _getItemsAsjQuery: function (c) { var m = this; var h = []; var f = []; var k = this._connectWith(); if (k && c) { for (var e = k.length - 1; e >= 0; e--) { var l = a(k[e]); for (var d = l.length - 1; d >= 0; d--) { var g = a.data(l[d], "sortable"); if (g && g != this && !g.options.disabled) { f.push([a.isFunction(g.options.items) ? g.options.items.call(g.element) : a(g.options.items, g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), g]) } } } } f.push([a.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : a(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); for (var e = f.length - 1; e >= 0; e--) { f[e][0].each(function () { h.push(this) }) } return a(h) }, _removeCurrentsFromItems: function () { var e = this.currentItem.find(":data(sortable-item)"); for (var d = 0; d < this.items.length; d++) { for (var c = 0; c < e.length; c++) { if (e[c] == this.items[d].item[0]) { this.items.splice(d, 1) } } } }, _refreshItems: function (c) { this.items = []; this.containers = [this]; var k = this.items; var q = this; var g = [[a.isFunction(this.options.items) ? this.options.items.call(this.element[0], c, { item: this.currentItem }) : a(this.options.items, this.element), this]]; var m = this._connectWith(); if (m) { for (var f = m.length - 1; f >= 0; f--) { var n = a(m[f]); for (var e = n.length - 1; e >= 0; e--) { var h = a.data(n[e], "sortable"); if (h && h != this && !h.options.disabled) { g.push([a.isFunction(h.options.items) ? h.options.items.call(h.element[0], c, { item: this.currentItem }) : a(h.options.items, h.element), h]); this.containers.push(h) } } } } for (var f = g.length - 1; f >= 0; f--) { var l = g[f][1]; var d = g[f][0]; for (var e = 0, o = d.length; e < o; e++) { var p = a(d[e]); p.data("sortable-item", l); k.push({ item: p, instance: l, width: 0, height: 0, left: 0, top: 0 }) } } }, refreshPositions: function (c) { if (this.offsetParent && this.helper) { this.offset.parent = this._getParentOffset() } for (var e = this.items.length - 1; e >= 0; e--) { var f = this.items[e]; if (f.instance != this.currentContainer && this.currentContainer && f.item[0] != this.currentItem[0]) { continue } var d = this.options.toleranceElement ? a(this.options.toleranceElement, f.item) : f.item; if (!c) { f.width = d.outerWidth(); f.height = d.outerHeight() } var g = d.offset(); f.left = g.left; f.top = g.top } if (this.options.custom && this.options.custom.refreshContainers) { this.options.custom.refreshContainers.call(this) } else { for (var e = this.containers.length - 1; e >= 0; e--) { var g = this.containers[e].element.offset(); this.containers[e].containerCache.left = g.left; this.containers[e].containerCache.top = g.top; this.containers[e].containerCache.width = this.containers[e].element.outerWidth(); this.containers[e].containerCache.height = this.containers[e].element.outerHeight() } } return this }, _createPlaceholder: function (e) { var c = e || this, f = c.options; if (!f.placeholder || f.placeholder.constructor == String) { var d = f.placeholder; f.placeholder = { element: function () { var g = a(document.createElement(c.currentItem[0].nodeName)).addClass(d || c.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; if (!d) { g.style.visibility = "hidden" } return g }, update: function (g, h) { if (d && !f.forcePlaceholderSize) { return } if (!h.height()) { h.height(c.currentItem.innerHeight() - parseInt(c.currentItem.css("paddingTop") || 0, 10) - parseInt(c.currentItem.css("paddingBottom") || 0, 10)) } if (!h.width()) { h.width(c.currentItem.innerWidth() - parseInt(c.currentItem.css("paddingLeft") || 0, 10) - parseInt(c.currentItem.css("paddingRight") || 0, 10)) } } } } c.placeholder = a(f.placeholder.element.call(c.element, c.currentItem)); c.currentItem.after(c.placeholder); f.placeholder.update(c, c.placeholder) }, _contactContainers: function (c) { var e = null, l = null; for (var g = this.containers.length - 1; g >= 0; g--) { if (a.contains(this.currentItem[0], this.containers[g].element[0])) { continue } if (this._intersectsWith(this.containers[g].containerCache)) { if (e && a.contains(this.containers[g].element[0], e.element[0])) { continue } e = this.containers[g]; l = g } else { if (this.containers[g].containerCache.over) { this.containers[g]._trigger("out", c, this._uiHash(this)); this.containers[g].containerCache.over = 0 } } } if (!e) { return } if (this.containers.length === 1) { this.containers[l]._trigger("over", c, this._uiHash(this)); this.containers[l].containerCache.over = 1 } else { if (this.currentContainer != this.containers[l]) { var k = 10000; var h = null; var d = this.positionAbs[this.containers[l].floating ? "left" : "top"]; for (var f = this.items.length - 1; f >= 0; f--) { if (!a.contains(this.containers[l].element[0], this.items[f].item[0])) { continue } var m = this.items[f][this.containers[l].floating ? "left" : "top"]; if (Math.abs(m - d) < k) { k = Math.abs(m - d); h = this.items[f] } } if (!h && !this.options.dropOnEmpty) { return } this.currentContainer = this.containers[l]; h ? this._rearrange(c, h, null, true) : this._rearrange(c, null, this.containers[l].element, true); this._trigger("change", c, this._uiHash()); this.containers[l]._trigger("change", c, this._uiHash(this)); this.options.placeholder.update(this.currentContainer, this.placeholder); this.containers[l]._trigger("over", c, this._uiHash(this)); this.containers[l].containerCache.over = 1 } } }, _createHelper: function (d) { var e = this.options; var c = a.isFunction(e.helper) ? a(e.helper.apply(this.element[0], [d, this.currentItem])) : (e.helper == "clone" ? this.currentItem.clone() : this.currentItem); if (!c.parents("body").length) { a(e.appendTo != "parent" ? e.appendTo : this.currentItem[0].parentNode)[0].appendChild(c[0]) } if (c[0] == this.currentItem[0]) { this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left")} } if (c[0].style.width == "" || e.forceHelperSize) { c.width(this.currentItem.width()) } if (c[0].style.height == "" || e.forceHelperSize) { c.height(this.currentItem.height()) } return c }, _adjustOffsetFromHelper: function (c) { if (typeof c == "string") { c = c.split(" ") } if (a.isArray(c)) { c = { left: +c[0], top: +c[1] || 0} } if ("left" in c) { this.offset.click.left = c.left + this.margins.left } if ("right" in c) { this.offset.click.left = this.helperProportions.width - c.right + this.margins.left } if ("top" in c) { this.offset.click.top = c.top + this.margins.top } if ("bottom" in c) { this.offset.click.top = this.helperProportions.height - c.bottom + this.margins.top } }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var c = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) { c.left += this.scrollParent.scrollLeft(); c.top += this.scrollParent.scrollTop() } if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie)) { c = { top: 0, left: 0} } return { top: c.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: c.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var c = this.currentItem.position(); return { top: c.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: c.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } else { return { top: 0, left: 0} } }, _cacheMargins: function () { this.margins = { left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0), top: (parseInt(this.currentItem.css("marginTop"), 10) || 0)} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var f = this.options; if (f.containment == "parent") { f.containment = this.helper[0].parentNode } if (f.containment == "document" || f.containment == "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(f.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (a(f.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (!(/^(document|window|parent)$/).test(f.containment)) { var d = a(f.containment)[0]; var e = a(f.containment).offset(); var c = (a(d).css("overflow") != "hidden"); this.containment = [e.left + (parseInt(a(d).css("borderLeftWidth"), 10) || 0) + (parseInt(a(d).css("paddingLeft"), 10) || 0) - this.margins.left, e.top + (parseInt(a(d).css("borderTopWidth"), 10) || 0) + (parseInt(a(d).css("paddingTop"), 10) || 0) - this.margins.top, e.left + (c ? Math.max(d.scrollWidth, d.offsetWidth) : d.offsetWidth) - (parseInt(a(d).css("borderLeftWidth"), 10) || 0) - (parseInt(a(d).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, e.top + (c ? Math.max(d.scrollHeight, d.offsetHeight) : d.offsetHeight) - (parseInt(a(d).css("borderTopWidth"), 10) || 0) - (parseInt(a(d).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } }, _convertPositionTo: function (g, i) { if (!i) { i = this.position } var e = g == "absolute" ? 1 : -1; var f = this.options, c = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = (/(html|body)/i).test(c[0].tagName); return { top: (i.top + this.offset.relative.top * e + this.offset.parent.top * e - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (h ? 0 : c.scrollTop())) * e)), left: (i.left + this.offset.relative.left * e + this.offset.parent.left * e - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : h ? 0 : c.scrollLeft()) * e))} }, _generatePosition: function (f) { var i = this.options, c = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, j = (/(html|body)/i).test(c[0].tagName); if (this.cssPosition == "relative" && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset() } var e = f.pageX; var d = f.pageY; if (this.originalPosition) { if (this.containment) { if (f.pageX - this.offset.click.left < this.containment[0]) { e = this.containment[0] + this.offset.click.left } if (f.pageY - this.offset.click.top < this.containment[1]) { d = this.containment[1] + this.offset.click.top } if (f.pageX - this.offset.click.left > this.containment[2]) { e = this.containment[2] + this.offset.click.left } if (f.pageY - this.offset.click.top > this.containment[3]) { d = this.containment[3] + this.offset.click.top } } if (i.grid) { var h = this.originalPageY + Math.round((d - this.originalPageY) / i.grid[1]) * i.grid[1]; d = this.containment ? (!(h - this.offset.click.top < this.containment[1] || h - this.offset.click.top > this.containment[3]) ? h : (!(h - this.offset.click.top < this.containment[1]) ? h - i.grid[1] : h + i.grid[1])) : h; var g = this.originalPageX + Math.round((e - this.originalPageX) / i.grid[0]) * i.grid[0]; e = this.containment ? (!(g - this.offset.click.left < this.containment[0] || g - this.offset.click.left > this.containment[2]) ? g : (!(g - this.offset.click.left < this.containment[0]) ? g - i.grid[0] : g + i.grid[0])) : g } } return { top: (d - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (j ? 0 : c.scrollTop())))), left: (e - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : j ? 0 : c.scrollLeft())))} }, _rearrange: function (h, g, d, f) { d ? d[0].appendChild(this.placeholder[0]) : g.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == "down" ? g.item[0] : g.item[0].nextSibling)); this.counter = this.counter ? ++this.counter : 1; var e = this, c = this.counter; window.setTimeout(function () { if (c == e.counter) { e.refreshPositions(!f) } }, 0) }, _clear: function (e, f) { this.reverting = false; var g = [], c = this; if (!this._noFinalSort && this.currentItem.parent().length) { this.placeholder.before(this.currentItem) } this._noFinalSort = null; if (this.helper[0] == this.currentItem[0]) { for (var d in this._storedCSS) { if (this._storedCSS[d] == "auto" || this._storedCSS[d] == "static") { this._storedCSS[d] = "" } } this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } if (this.fromOutside && !f) { g.push(function (h) { this._trigger("receive", h, this._uiHash(this.fromOutside)) }) } if ((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !f) { g.push(function (h) { this._trigger("update", h, this._uiHash()) }) } if (!a.contains(this.element[0], this.currentItem[0])) { if (!f) { g.push(function (h) { this._trigger("remove", h, this._uiHash()) }) } for (var d = this.containers.length - 1; d >= 0; d--) { if (a.contains(this.containers[d].element[0], this.currentItem[0]) && !f) { g.push((function (h) { return function (i) { h._trigger("receive", i, this._uiHash(this)) } }).call(this, this.containers[d])); g.push((function (h) { return function (i) { h._trigger("update", i, this._uiHash(this)) } }).call(this, this.containers[d])) } } } for (var d = this.containers.length - 1; d >= 0; d--) { if (!f) { g.push((function (h) { return function (i) { h._trigger("deactivate", i, this._uiHash(this)) } }).call(this, this.containers[d])) } if (this.containers[d].containerCache.over) { g.push((function (h) { return function (i) { h._trigger("out", i, this._uiHash(this)) } }).call(this, this.containers[d])); this.containers[d].containerCache.over = 0 } } if (this._storedCursor) { a("body").css("cursor", this._storedCursor) } if (this._storedOpacity) { this.helper.css("opacity", this._storedOpacity) } if (this._storedZIndex) { this.helper.css("zIndex", this._storedZIndex == "auto" ? "" : this._storedZIndex) } this.dragging = false; if (this.cancelHelperRemoval) { if (!f) { this._trigger("beforeStop", e, this._uiHash()); for (var d = 0; d < g.length; d++) { g[d].call(this, e) } this._trigger("stop", e, this._uiHash()) } return false } if (!f) { this._trigger("beforeStop", e, this._uiHash()) } this.placeholder[0].parentNode.removeChild(this.placeholder[0]); if (this.helper[0] != this.currentItem[0]) { this.helper.remove() } this.helper = null; if (!f) { for (var d = 0; d < g.length; d++) { g[d].call(this, e) } this._trigger("stop", e, this._uiHash()) } this.fromOutside = false; return true }, _trigger: function () { if (a.Widget.prototype._trigger.apply(this, arguments) === false) { this.cancel() } }, _uiHash: function (d) { var c = d || this; return { helper: c.helper, placeholder: c.placeholder || a([]), position: c.position, originalPosition: c.originalPosition, offset: c.positionAbs, item: c.currentItem, sender: d ? d.element : null} } }) })(jQuery); jQuery.effects || (function (i, e) { var h = i.uiBackCompat !== false; i.effects = { effect: {} }; i.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"], function (o, n) { i.fx.step[n] = function (p) { if (!p.colorInit) { p.start = m(p.elem, n); p.end = k(p.end); p.colorInit = true } p.elem.style[n] = "rgb(" + Math.max(Math.min(parseInt((p.pos * (p.end[0] - p.start[0])) + p.start[0], 10), 255), 0) + "," + Math.max(Math.min(parseInt((p.pos * (p.end[1] - p.start[1])) + p.start[1], 10), 255), 0) + "," + Math.max(Math.min(parseInt((p.pos * (p.end[2] - p.start[2])) + p.start[2], 10), 255), 0) + ")" } }); function k(o) { var n; if (o && o.constructor === Array && o.length === 3) { return o } if (n = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(o)) { return [parseInt(n[1], 10), parseInt(n[2], 10), parseInt(n[3], 10)] } if (n = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(o)) { return [parseFloat(n[1]) * 2.55, parseFloat(n[2]) * 2.55, parseFloat(n[3]) * 2.55] } if (n = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(o)) { return [parseInt(n[1], 16), parseInt(n[2], 16), parseInt(n[3], 16)] } if (n = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(o)) { return [parseInt(n[1] + n[1], 16), parseInt(n[2] + n[2], 16), parseInt(n[3] + n[3], 16)] } if (n = /rgba\(0, 0, 0, 0\)/.exec(o)) { return a.transparent } return a[i.trim(o).toLowerCase()] } function m(p, n) { var o; do { o = i.curCSS(p, n); if (o != "" && o !== "transparent" || i.nodeName(p, "body")) { break } n = "backgroundColor" } while (p = p.parentNode); return k(o) } var a = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0], transparent: [255, 255, 255] }; var f = ["add", "remove", "toggle"], b = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }, d = "ec.storage."; i.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (n, o) { i.fx.step[o] = function (p) { if (p.end !== "none" && !p.setAttr || p.pos === 1 && !p.setAttr) { jQuery.style(p.elem, o, p.end); p.setAttr = true } } }); function g() { var q = document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle, r = {}, o, p, n; if (q && q.length && q[0] && q[q[0]]) { n = q.length; while (n--) { o = q[n]; if (typeof q[o] === "string") { r[i.camelCase(o)] = q[o] } } } else { for (o in q) { if (typeof q[o] === "string") { r[o] = q[o] } } } return r } function j(n, p) { var r = {}, o, q; for (o in p) { q = p[o]; if (n[o] != q) { if (!b[o]) { if (i.fx.step[o] || !isNaN(parseFloat(q))) { r[o] = q } } } } return r } i.effects.animateClass = function (n, p, s, r) { var q = i.speed(p, s, r); return this.queue(function () { var t = i(this), o = t.attr("class"), v, u = q.children ? t.find("*").andSelf() : t; u = u.map(function () { var w = i(this); return { el: w, originalStyleAttr: w.attr("style") || " ", start: g.call(this)} }); i.each(f, function (w, x) { if (n[x]) { t[x + "Class"](n[x]) } }); v = t.attr("class"); u = u.map(function () { this.end = g.call(this.el[0]); this.diff = j(this.start, this.end); return this }); t.attr("class", o); u = u.map(function () { var x = this, w = i.Deferred(); this.el.animate(this.diff, { duration: q.duration, easing: q.easing, queue: false, complete: function () { w.resolve(x) } }); return w.promise() }); i.when.apply(i, u.get()).done(function () { t.attr("class", v); i.each(arguments, function () { if (typeof this.el.attr("style") === "object") { this.el.attr("style").cssText = ""; this.el.attr("style").cssText = this.originalStyleAttr } else { this.el.attr("style", this.originalStyleAttr) } }); q.complete.call(t[0]) }) }) }; i.fn.extend({ _addClass: i.fn.addClass, addClass: function (o, n, q, p) { return n ? i.effects.animateClass.apply(this, [{ add: o }, n, q, p]) : this._addClass(o) }, _removeClass: i.fn.removeClass, removeClass: function (o, n, q, p) { return n ? i.effects.animateClass.apply(this, [{ remove: o }, n, q, p]) : this._removeClass(o) }, _toggleClass: i.fn.toggleClass, toggleClass: function (p, o, n, r, q) { if (typeof o === "boolean" || o === e) { if (!n) { return this._toggleClass(p, o) } else { return i.effects.animateClass.apply(this, [(o ? { add: p} : { remove: p }), n, r, q]) } } else { return i.effects.animateClass.apply(this, [{ toggle: p }, o, n, r]) } }, switchClass: function (n, p, o, r, q) { return i.effects.animateClass.apply(this, [{ add: p, remove: n }, o, r, q]) } }); i.extend(i.effects, { version: "1.9m6", save: function (o, p) { for (var n = 0; n < p.length; n++) { if (p[n] !== null) { o.data(d + p[n], o[0].style[p[n]]) } } }, restore: function (o, p) { for (var n = 0; n < p.length; n++) { if (p[n] !== null) { o.css(p[n], o.data(d + p[n])) } } }, setMode: function (n, o) { if (o === "toggle") { o = n.is(":hidden") ? "show" : "hide" } return o }, getBaseline: function (o, p) { var q, n; switch (o[0]) { case "top": q = 0; break; case "middle": q = 0.5; break; case "bottom": q = 1; break; default: q = o[0] / p.height } switch (o[1]) { case "left": n = 0; break; case "center": n = 0.5; break; case "right": n = 1; break; default: n = o[1] / p.width } return { x: n, y: q} }, createWrapper: function (o) { if (o.parent().is(".ui-effects-wrapper")) { return o.parent() } var p = { width: o.outerWidth(true), height: o.outerHeight(true), "float": o.css("float") }, r = i("<div></div>").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), n = { width: o.width(), height: o.height() }, q = document.activeElement; o.wrap(r); if (o[0] === q || i.contains(o[0], q)) { i(q).focus() } r = o.parent(); if (o.css("position") === "static") { r.css({ position: "relative" }); o.css({ position: "relative" }) } else { i.extend(p, { position: o.css("position"), zIndex: o.css("z-index") }); i.each(["top", "left", "bottom", "right"], function (s, t) { p[t] = o.css(t); if (isNaN(parseInt(p[t], 10))) { p[t] = "auto" } }); o.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" }) } o.css(n); return r.css(p).show() }, removeWrapper: function (n) { var o = document.activeElement; if (n.parent().is(".ui-effects-wrapper")) { n.parent().replaceWith(n); if (n[0] === o || i.contains(n[0], o)) { i(o).focus() } } return n }, setTransition: function (o, q, n, p) { p = p || {}; i.each(q, function (s, r) { var t = o.cssUnit(r); if (t[0] > 0) { p[r] = t[0] * n + t[1] } }); return p } }); function c(o, n, p, q) { if (i.isPlainObject(o)) { return o } o = { effect: o }; if (n === e) { n = {} } if (i.isFunction(n)) { q = n; p = null; n = {} } if (i.type(n) === "number" || i.fx.speeds[n]) { q = p; p = n; n = {} } if (i.isFunction(p)) { q = p; p = null } if (n) { i.extend(o, n) } p = p || n.duration; o.duration = i.fx.off ? 0 : typeof p === "number" ? p : p in i.fx.speeds ? i.fx.speeds[p] : i.fx.speeds._default; o.complete = q || n.complete; return o } function l(n) { if (!n || typeof n === "number" || i.fx.speeds[n]) { return true } if (typeof n === "string" && !i.effects.effect[n]) { if (h && i.effects[n]) { return false } return true } return false } i.fn.extend({ effect: function (v, w, o, u) { var t = c.apply(this, arguments), q = t.mode, r = t.queue, s = i.effects.effect[t.effect], n = !s && h && i.effects[t.effect]; if (i.fx.off || !(s || n)) { if (q) { return this[q](t.duration, t.complete) } else { return this.each(function () { if (t.complete) { t.complete.call(this) } }) } } function p(z) { var A = i(this), y = t.complete, B = t.mode; function x() { if (i.isFunction(y)) { y.call(A[0]) } if (i.isFunction(z)) { z() } } if (A.is(":hidden") ? B === "hide" : B === "show") { x() } else { s.call(A[0], t, x) } } if (s) { return r === false ? this.each(p) : this.queue(r || "fx", p) } else { return n.call(this, { options: t, duration: t.duration, callback: t.complete, mode: t.mode }) } }, _show: i.fn.show, show: function (o) { if (l(o)) { return this._show.apply(this, arguments) } else { var n = c.apply(this, arguments); n.mode = "show"; return this.effect.call(this, n) } }, _hide: i.fn.hide, hide: function (o) { if (l(o)) { return this._hide.apply(this, arguments) } else { var n = c.apply(this, arguments); n.mode = "hide"; return this.effect.call(this, n) } }, __toggle: i.fn.toggle, toggle: function (o) { if (l(o) || typeof o === "boolean" || i.isFunction(o)) { return this.__toggle.apply(this, arguments) } else { var n = c.apply(this, arguments); n.mode = "toggle"; return this.effect.call(this, n) } }, cssUnit: function (n) { var o = this.css(n), p = []; i.each(["em", "px", "%", "pt"], function (q, r) { if (o.indexOf(r) > 0) { p = [parseFloat(o), r] } }); return p } }); i.easing.jswing = i.easing.swing; i.extend(i.easing, { def: "easeOutQuad", swing: function (o, p, n, r, q) { return i.easing[i.easing.def](o, p, n, r, q) }, easeInQuad: function (o, p, n, r, q) { return r * (p /= q) * p + n }, easeOutQuad: function (o, p, n, r, q) { return -r * (p /= q) * (p - 2) + n }, easeInOutQuad: function (o, p, n, r, q) { if ((p /= q / 2) < 1) { return r / 2 * p * p + n } return -r / 2 * ((--p) * (p - 2) - 1) + n }, easeInCubic: function (o, p, n, r, q) { return r * (p /= q) * p * p + n }, easeOutCubic: function (o, p, n, r, q) { return r * ((p = p / q - 1) * p * p + 1) + n }, easeInOutCubic: function (o, p, n, r, q) { if ((p /= q / 2) < 1) { return r / 2 * p * p * p + n } return r / 2 * ((p -= 2) * p * p + 2) + n }, easeInQuart: function (o, p, n, r, q) { return r * (p /= q) * p * p * p + n }, easeOutQuart: function (o, p, n, r, q) { return -r * ((p = p / q - 1) * p * p * p - 1) + n }, easeInOutQuart: function (o, p, n, r, q) { if ((p /= q / 2) < 1) { return r / 2 * p * p * p * p + n } return -r / 2 * ((p -= 2) * p * p * p - 2) + n }, easeInQuint: function (o, p, n, r, q) { return r * (p /= q) * p * p * p * p + n }, easeOutQuint: function (o, p, n, r, q) { return r * ((p = p / q - 1) * p * p * p * p + 1) + n }, easeInOutQuint: function (o, p, n, r, q) { if ((p /= q / 2) < 1) { return r / 2 * p * p * p * p * p + n } return r / 2 * ((p -= 2) * p * p * p * p + 2) + n }, easeInSine: function (o, p, n, r, q) { return -r * Math.cos(p / q * (Math.PI / 2)) + r + n }, easeOutSine: function (o, p, n, r, q) { return r * Math.sin(p / q * (Math.PI / 2)) + n }, easeInOutSine: function (o, p, n, r, q) { return -r / 2 * (Math.cos(Math.PI * p / q) - 1) + n }, easeInExpo: function (o, p, n, r, q) { return (p == 0) ? n : r * Math.pow(2, 10 * (p / q - 1)) + n }, easeOutExpo: function (o, p, n, r, q) { return (p == q) ? n + r : r * (-Math.pow(2, -10 * p / q) + 1) + n }, easeInOutExpo: function (o, p, n, r, q) { if (p == 0) { return n } if (p == q) { return n + r } if ((p /= q / 2) < 1) { return r / 2 * Math.pow(2, 10 * (p - 1)) + n } return r / 2 * (-Math.pow(2, -10 * --p) + 2) + n }, easeInCirc: function (o, p, n, r, q) { return -r * (Math.sqrt(1 - (p /= q) * p) - 1) + n }, easeOutCirc: function (o, p, n, r, q) { return r * Math.sqrt(1 - (p = p / q - 1) * p) + n }, easeInOutCirc: function (o, p, n, r, q) { if ((p /= q / 2) < 1) { return -r / 2 * (Math.sqrt(1 - p * p) - 1) + n } return r / 2 * (Math.sqrt(1 - (p -= 2) * p) + 1) + n }, easeInElastic: function (o, r, n, y, w) { var u = 1.70158, v = w * 0.3, q = y; if (r == 0) { return n } if ((r /= w) == 1) { return n + y } if (q < Math.abs(y)) { q = y; u = v / 4 } else { u = v / (2 * Math.PI) * Math.asin(y / q) } return -(q * Math.pow(2, 10 * (r -= 1)) * Math.sin((r * w - u) * (2 * Math.PI) / v)) + n }, easeOutElastic: function (o, r, n, y, w) { var u = 1.70158, v = w * 0.3, q = y; if (r == 0) { return n } if ((r /= w) == 1) { return n + y } if (q < Math.abs(y)) { q = y; u = v / 4 } else { u = v / (2 * Math.PI) * Math.asin(y / q) } return q * Math.pow(2, -10 * r) * Math.sin((r * w - u) * (2 * Math.PI) / v) + y + n }, easeInOutElastic: function (o, r, n, y, w) { var u = 1.70158, v = w * (0.3 * 1.5), q = y; if (r == 0) { return n } if ((r /= w / 2) == 2) { return n + y } if (q < Math.abs(y)) { q = y; u = v / 4 } else { u = v / (2 * Math.PI) * Math.asin(y / q) } if (r < 1) { return -0.5 * (q * Math.pow(2, 10 * (r -= 1)) * Math.sin((r * w - u) * (2 * Math.PI) / v)) + n } return q * Math.pow(2, -10 * (r -= 1)) * Math.sin((r * w - u) * (2 * Math.PI) / v) * 0.5 + y + n }, easeInBack: function (o, p, n, u, r, q) { if (q == e) { q = 1.70158 } return u * (p /= r) * p * ((q + 1) * p - q) + n }, easeOutBack: function (o, p, n, u, r, q) { if (q == e) { q = 1.70158 } return u * ((p = p / r - 1) * p * ((q + 1) * p + q) + 1) + n }, easeInOutBack: function (o, p, n, u, r, q) { if (q == e) { q = 1.70158 } if ((p /= r / 2) < 1) { return u / 2 * (p * p * (((q *= 1.525) + 1) * p - q)) + n } return u / 2 * ((p -= 2) * p * (((q *= 1.525) + 1) * p + q) + 2) + n }, easeInBounce: function (o, p, n, r, q) { return r - i.easing.easeOutBounce(o, q - p, 0, r, q) + n }, easeOutBounce: function (o, p, n, r, q) { if ((p /= q) < (1 / 2.75)) { return r * (7.5625 * p * p) + n } else { if (p < (2 / 2.75)) { return r * (7.5625 * (p -= (1.5 / 2.75)) * p + 0.75) + n } else { if (p < (2.5 / 2.75)) { return r * (7.5625 * (p -= (2.25 / 2.75)) * p + 0.9375) + n } else { return r * (7.5625 * (p -= (2.625 / 2.75)) * p + 0.984375) + n } } } }, easeInOutBounce: function (o, p, n, r, q) { if (p < q / 2) { return i.easing.easeInBounce(o, p * 2, 0, r, q) * 0.5 + n } return i.easing.easeOutBounce(o, p * 2 - q, 0, r, q) * 0.5 + r * 0.5 + n } }) })(jQuery); (function (b, d) { var a = /up|down|vertical/, c = /up|left|vertical|horizontal/; b.effects.effect.blind = function (g, l) { var h = b(this), p = ["position", "top", "bottom", "left", "right", "height", "width"], m = b.effects.setMode(h, g.mode || "hide"), q = g.direction || "up", j = a.test(q), i = j ? "height" : "width", n = j ? "top" : "left", s = c.test(q), k = {}, r = m === "show", f, e; if (h.parent().is(".ui-effects-wrapper")) { b.effects.save(h.parent(), p) } else { b.effects.save(h, p) } h.show(); f = b.effects.createWrapper(h).css({ overflow: "hidden" }); e = f[i](); k[i] = r ? e : 0; if (!s) { h.css(j ? "bottom" : "right", 0).css(j ? "top" : "left", "").css({ position: "absolute" }); k[n] = r ? 0 : e } if (r) { f.css(i, 0); if (!s) { f.css(n, e) } } f.animate(k, { duration: g.duration, easing: g.easing, queue: false, complete: function () { if (m === "hide") { h.hide() } b.effects.restore(h, p); b.effects.removeWrapper(h); l() } }) } })(jQuery); (function (a, b) { a.effects.effect.bounce = function (m, l) { var c = a(this), d = ["position", "top", "bottom", "left", "right", "height", "width"], k = a.effects.setMode(c, m.mode || "effect"), j = k === "hide", v = k === "show", w = m.direction || "up", e = m.distance, h = m.times || 5, x = h * 2 + (v || j ? 1 : 0), u = m.duration / x, p = m.easing, f = (w === "up" || w === "down") ? "top" : "left", n = (w === "up" || w === "left"), t, g, s, q = c.queue(), r = q.length; if (v || j) { d.push("opacity") } a.effects.save(c, d); c.show(); a.effects.createWrapper(c); if (!e) { e = c[f === "top" ? "outerHeight" : "outerWidth"]() / 3 } if (v) { s = { opacity: 1 }; s[f] = 0; c.css("opacity", 0).css(f, n ? -e * 2 : e * 2).animate(s, u, p) } if (j) { e = e / Math.pow(2, h - 1) } s = {}; s[f] = 0; for (t = 0; t < h; t++) { g = {}; g[f] = (n ? "-=" : "+=") + e; c.animate(g, u, p).animate(s, u, p); e = j ? e * 2 : e / 2 } if (j) { g = { opacity: 0 }; g[f] = (n ? "-=" : "+=") + e; c.animate(g, u, p) } c.queue(function () { if (j) { c.hide() } a.effects.restore(c, d); a.effects.removeWrapper(c); l() }); if (r > 1) { q.splice.apply(q, [1, 0].concat(q.splice(r, x + 1))) } c.dequeue() } })(jQuery); (function (a, b) { a.effects.effect.clip = function (f, i) { var g = a(this), m = ["position", "top", "bottom", "left", "right", "height", "width"], l = a.effects.setMode(g, f.mode || "hide"), p = l === "show", n = f.direction || "vertical", k = n === "vertical", q = k ? "height" : "width", j = k ? "top" : "left", h = {}, d, e, c; a.effects.save(g, m); g.show(); d = a.effects.createWrapper(g).css({ overflow: "hidden" }); e = (g[0].tagName === "IMG") ? d : g; c = e[q](); if (p) { e.css(q, 0); e.css(j, c / 2) } h[q] = p ? c : 0; h[j] = p ? 0 : c / 2; e.animate(h, { queue: false, duration: f.duration, easing: f.easing, complete: function () { if (!p) { g.hide() } a.effects.restore(g, m); a.effects.removeWrapper(g); i() } }) } })(jQuery); (function (a, b) { a.effects.effect.drop = function (d, h) { var e = a(this), j = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"], i = a.effects.setMode(e, d.mode || "hide"), l = i === "show", k = d.direction || "left", f = (k === "up" || k === "down") ? "top" : "left", m = (k === "up" || k === "left") ? "pos" : "neg", g = { opacity: l ? 1 : 0 }, c; a.effects.save(e, j); e.show(); a.effects.createWrapper(e); c = d.distance || e[f == "top" ? "outerHeight" : "outerWidth"]({ margin: true }) / 2; if (l) { e.css("opacity", 0).css(f, m == "pos" ? -c : c) } g[f] = (l ? (m === "pos" ? "+=" : "-=") : (m === "pos" ? "-=" : "+=")) + c; e.animate(g, { queue: false, duration: d.duration, easing: d.easing, complete: function () { i == "hide" && e.hide(); a.effects.restore(e, j); a.effects.removeWrapper(e); h() } }) } })(jQuery); (function (a, b) { a.effects.effect.explode = function (s, r) { var k = s.pieces ? Math.round(Math.sqrt(s.pieces)) : 3, d = k, c = a(this), m = a.effects.setMode(c, s.mode || "hide"), w = m === "show", g = c.show().css("visibility", "hidden").offset(), t = Math.ceil(c.outerWidth() / d), q = Math.ceil(c.outerHeight() / k), h = [], v, u, e, p, n, l; for (v = 0; v < k; v++) { p = g.top + v * q; l = v - (k - 1) / 2; for (u = 0; u < d; u++) { e = g.left + u * t; n = u - (d - 1) / 2; c.clone().appendTo("body").wrap("<div></div>").css({ position: "absolute", visibility: "visible", left: -u * t, top: -v * q }).parent().addClass("ui-effects-explode").css({ position: "absolute", overflow: "hidden", width: t, height: q, left: e + (w ? n * t : 0), top: p + (w ? l * q : 0), opacity: w ? 0 : 1 }).animate({ left: e + (w ? 0 : n * t), top: p + (w ? 0 : l * q), opacity: w ? 1 : 0 }, s.duration || 500, s.easing, x) } } function x() { h.push(this); if (h.length == k * d) { f() } } function f() { c.css({ visibility: "visible" }); a(h).remove(); if (!w) { c.hide() } r() } } })(jQuery); (function (a, b) { a.effects.effect.fade = function (g, c) { var e = a(this), f = a.effects.setMode(e, g.mode || "toggle"), d = f === "hide"; e.show(); e.animate({ opacity: d ? 0 : 1 }, { queue: false, duration: g.duration, easing: g.easing, complete: function () { if (d) { e.hide() } c() } }) } })(jQuery); (function (a, b) { a.effects.effect.fold = function (e, i) { var f = a(this), n = ["position", "top", "bottom", "left", "right", "height", "width"], k = a.effects.setMode(f, e.mode || "hide"), r = k === "show", l = k === "hide", t = e.size || 15, m = /([0-9]+)%/.exec(t), s = !!e.horizFirst, j = r != s, g = j ? ["width", "height"] : ["height", "width"], h = e.duration / 2, d, c, q = {}, p = {}; a.effects.save(f, n); f.show(); d = a.effects.createWrapper(f).css({ overflow: "hidden" }); c = j ? [d.width(), d.height()] : [d.height(), d.width()]; if (m) { t = parseInt(m[1], 10) / 100 * c[l ? 0 : 1] } if (r) { d.css(s ? { height: 0, width: t} : { height: t, width: 0 }) } q[g[0]] = r ? c[0] : t; p[g[1]] = r ? c[1] : 0; d.animate(q, h, e.easing).animate(p, h, e.easing, function () { if (l) { f.hide() } a.effects.restore(f, n); a.effects.removeWrapper(f); i() }) } })(jQuery); (function (a, b) { a.effects.effect.highlight = function (h, c) { var e = a(this), d = ["backgroundImage", "backgroundColor", "opacity"], g = a.effects.setMode(e, h.mode || "show"), f = { backgroundColor: e.css("backgroundColor") }; if (g === "hide") { f.opacity = 0 } a.effects.save(e, d); e.show().css({ backgroundImage: "none", backgroundColor: h.color || "#ffff99" }).animate(f, { queue: false, duration: h.duration, easing: h.easing, complete: function () { if (g === "hide") { e.hide() } a.effects.restore(e, d); c() } }) } })(jQuery); (function (a, b) { a.effects.effect.pulsate = function (c, g) { var e = a(this), k = a.effects.setMode(e, c.mode || "show"), p = k === "show", l = k === "hide", q = (p || k === "hide"), m = ((c.times || 5) * 2) + (q ? 1 : 0), f = c.duration / m, n = 0, j = e.queue(), d = j.length, h; if (p || !e.is(":visible")) { e.css("opacity", 0).show(); n = 1 } for (h = 1; h < m; h++) { e.animate({ opacity: n }, f, c.easing); n = 1 - n } e.animate({ opacity: n }, f, c.easing); e.queue(function () { if (l) { e.hide() } g() }); if (d > 1) { j.splice.apply(j, [1, 0].concat(j.splice(d, m + 1))) } e.dequeue() } })(jQuery); (function (a, b) { a.effects.effect.puff = function (j, c) { var h = a(this), i = a.effects.setMode(h, j.mode || "hide"), f = i === "hide", g = parseInt(j.percent, 10) || 150, e = g / 100, d = { height: h.height(), width: h.width() }; a.extend(j, { effect: "scale", queue: false, fade: true, mode: i, complete: c, percent: f ? g : 100, from: f ? d : { height: d.height * e, width: d.width * e} }); h.effect(j) }; a.effects.effect.scale = function (c, f) { var d = a(this), l = a.extend(true, {}, c), g = a.effects.setMode(d, c.mode || "effect"), h = parseInt(c.percent, 10) || (parseInt(c.percent, 10) == 0 ? 0 : (g == "hide" ? 0 : 100)), j = c.direction || "both", k = c.origin, e = { height: d.height(), width: d.width(), outerHeight: d.outerHeight(), outerWidth: d.outerWidth() }, i = { y: j != "horizontal" ? (h / 100) : 1, x: j != "vertical" ? (h / 100) : 1 }; l.effect = "size"; l.queue = false; l.complete = f; if (g != "effect") { l.origin = k || ["middle", "center"]; l.restore = true } l.from = c.from || (g == "show" ? { height: 0, width: 0} : e); l.to = { height: e.height * i.y, width: e.width * i.x, outerHeight: e.outerHeight * i.y, outerWidth: e.outerWidth * i.x }; if (l.fade) { if (g == "show") { l.from.opacity = 0; l.to.opacity = 1 } if (g == "hide") { l.from.opacity = 1; l.to.opacity = 0 } } d.effect(l) }; a.effects.effect.size = function (k, j) { var c = a(this), e = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], m = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], l = ["width", "height", "overflow"], f = ["fontSize"], r = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], d = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], g = a.effects.setMode(c, k.mode || "effect"), q = k.restore || g !== "effect", u = k.scale || "both", s = k.origin || ["middle", "center"], n, h, i, t = c.css("position"), p = c.css("bottom") !== "auto" ? "bottom" : "top"; originalHorizontalPositioning = c.css("right") !== "auto" ? "right" : "left"; if (g === "show") { c.show() } n = { height: c.height(), width: c.width(), outerHeight: c.outerHeight(), outerWidth: c.outerWidth() }; c.from = k.from || n; c.to = k.to || n; i = { from: { y: c.from.height / n.height, x: c.from.width / n.width }, to: { y: c.to.height / n.height, x: c.to.width / n.width} }; if (u == "box" || u == "both") { if (i.from.y !== i.to.y) { e = e.concat(r); c.from = a.effects.setTransition(c, r, i.from.y, c.from); c.to = a.effects.setTransition(c, r, i.to.y, c.to) } if (i.from.x !== i.to.x) { e = e.concat(d); c.from = a.effects.setTransition(c, d, i.from.x, c.from); c.to = a.effects.setTransition(c, d, i.to.x, c.to) } } if (u == "content" || u == "both") { if (i.from.y !== i.to.y) { e = e.concat(f); c.from = a.effects.setTransition(c, f, i.from.y, c.from); c.to = a.effects.setTransition(c, f, i.to.y, c.to) } } a.effects.save(c, q ? e : m); c.show(); a.effects.createWrapper(c); c.css("overflow", "hidden").css(c.from); if (s) { h = a.effects.getBaseline(s, n); c.from.top = (n.outerHeight - c.outerHeight()) * h.y; c.from.left = (n.outerWidth - c.outerWidth()) * h.x; c.to.top = (n.outerHeight - c.to.outerHeight) * h.y; c.to.left = (n.outerWidth - c.to.outerWidth) * h.x } c.css(c.from); if (u == "content" || u == "both") { r = r.concat(["marginTop", "marginBottom"]).concat(f); d = d.concat(["marginLeft", "marginRight"]); l = e.concat(r).concat(d); c.find("*[width]").each(function () { var v = a(this), o = { height: v.height(), width: v.width() }; if (q) { a.effects.save(v, l) } v.from = { height: o.height * i.from.y, width: o.width * i.from.x }; v.to = { height: o.height * i.to.y, width: o.width * i.to.x }; if (i.from.y != i.to.y) { v.from = a.effects.setTransition(v, r, i.from.y, v.from); v.to = a.effects.setTransition(v, r, i.to.y, v.to) } if (i.from.x != i.to.x) { v.from = a.effects.setTransition(v, d, i.from.x, v.from); v.to = a.effects.setTransition(v, d, i.to.x, v.to) } v.css(v.from); v.animate(v.to, k.duration, k.easing, function () { if (q) { a.effects.restore(v, l) } }) }) } c.animate(c.to, { queue: false, duration: k.duration, easing: k.easing, complete: function () { if (c.to.opacity === 0) { c.css("opacity", c.from.opacity) } if (g == "hide") { c.hide() } a.effects.restore(c, q ? e : m); if (!q) { if (t === "static") { c.css({ position: "relative", top: c.to.top, left: c.to.left }) } else { a.each([p, originalHorizontalPositioning], function (o, v) { c.css(v, function (y, B) { var A = parseInt(B, 10), w = o ? c.to.left : c.to.top, D = o ? c.to.outerWidth - c.from.outerWidth : c.to.outerHeight - c.from.outerHeight, C = s[o] === v, x = s[o] === "middle" || s[o] === "center", z = v == "left" || v == "top"; if (B === "auto") { return w + "px" } if (!z) { if (t === "relative") { w *= -1 } else { if (!x) { w -= D * (C ? -1 : 1) } } } return A + w + "px" }) }) } } a.effects.removeWrapper(c); j() } }) } })(jQuery); (function (a, b) { a.effects.effect.shake = function (l, k) { var c = a(this), d = ["position", "top", "bottom", "left", "right", "height", "width"], j = a.effects.setMode(c, l.mode || "effect"), u = l.direction || "left", e = l.distance || 20, h = l.times || 3, v = h * 2 + 1, q = l.duration, g = (u == "up" || u == "down") ? "top" : "left", f = (u == "up" || u == "left"), t = {}, s = {}, r = {}, p, m = c.queue(), n = m.length; a.effects.save(c, d); c.show(); a.effects.createWrapper(c); t[g] = (f ? "-=" : "+=") + e; s[g] = (f ? "+=" : "-=") + e * 2; r[g] = (f ? "-=" : "+=") + e * 2; c.animate(t, q, l.easing); for (p = 1; p < h; p++) { c.animate(s, q, l.easing).animate(r, q, l.easing) } c.animate(s, q, l.easing).animate(t, q / 2, l.easing).queue(function () { if (j === "hide") { c.hide() } a.effects.restore(c, d); a.effects.removeWrapper(c); k() }); if (n > 1) { m.splice.apply(m, [1, 0].concat(m.splice(n, v + 1))) } c.dequeue() } })(jQuery); (function (a, b) { a.effects.effect.slide = function (e, i) { var f = a(this), k = ["position", "top", "bottom", "left", "right", "width", "height"], j = a.effects.setMode(f, e.mode || "show"), m = j === "show", l = e.direction || "left", g = (l == "up" || l == "down") ? "top" : "left", d = (l == "up" || l == "left"), c, h = {}, n; a.effects.save(f, k); f.show(); c = e.distance || f[g === "top" ? "outerHeight" : "outerWidth"]({ margin: true }); a.effects.createWrapper(f).css({ overflow: "hidden" }); if (m) { f.css(g, d ? (isNaN(c) ? "-" + c : -c) : c) } h[g] = (m ? (d ? "+=" : "-=") : (d ? "-=" : "+=")) + c; f.animate(h, { queue: false, duration: e.duration, easing: e.easing, complete: function () { if (j === "hide") { f.hide() } a.effects.restore(f, k); a.effects.removeWrapper(f); i() } }) } })(jQuery); (function (a, b) { a.effects.effect.transfer = function (d, h) { var f = a(this), k = a(d.to), n = k.css("position") === "fixed", j = a("body"), l = n ? j.scrollTop() : 0, m = n ? j.scrollLeft() : 0, c = k.offset(), g = { top: c.top - l, left: c.left - m, height: k.innerHeight(), width: k.innerWidth() }, i = f.offset(), e = a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.className).css({ top: i.top - l, left: i.left - m, height: f.innerHeight(), width: f.innerWidth(), position: n ? "fixed" : "absolute" }).animate(g, d.duration, d.easing, function () { e.remove(); h() }) } })(jQuery); (function (b, c) { var a = {}; b.widget("ui.accordion", { version: "1.9m6", options: { active: 0, animated: "slide", collapsible: false, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, activate: null, beforeActivate: null }, _create: function () { var d = this, e = d.options; d.element.addClass("ui-accordion ui-widget ui-helper-reset"); d.headers = d.element.find(e.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"); d._hoverable(d.headers); d._focusable(d.headers); d.headers.find(":first-child").addClass("ui-accordion-heading"); d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); if (!e.collapsible && e.active === false) { e.active = 0 } if (e.active < 0) { e.active += this.headers.length } d.active = d._findActive(e.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"); d.active.next().addClass("ui-accordion-content-active"); d._createIcons(); d.refresh(); d.element.attr("role", "tablist"); d.headers.attr("role", "tab").bind("keydown.accordion", b.proxy(d, "_keydown")).next().attr("role", "tabpanel"); d.headers.not(d.active).attr({ "aria-expanded": "false", "aria-selected": "false", tabIndex: -1 }).next().hide(); if (!d.active.length) { d.headers.eq(0).attr("tabIndex", 0) } else { d.active.attr({ "aria-expanded": "true", "aria-selected": "true", tabIndex: 0 }) } if (!b.browser.safari) { d.headers.find("a").attr("tabIndex", -1) } this._setupEvents(e.event) }, _createIcons: function () { var d = this.options.icons; if (d) { b("<span>").addClass("ui-accordion-header-icon ui-icon " + d.header).prependTo(this.headers); this.active.children(".ui-accordion-header-icon").removeClass(d.header).addClass(d.activeHeader); this.element.addClass("ui-accordion-icons") } }, _destroyIcons: function () { this.headers.children(".ui-accordion-header-icon").remove(); this.element.removeClass("ui-accordion-icons") }, _destroy: function () { this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"); this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex").find("a").removeAttr("tabIndex").end().find(".ui-accordion-heading").removeClass("ui-accordion-heading"); this._destroyIcons(); var d = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled"); if (this.options.heightStyle !== "content") { d.css("height", "") } }, _setOption: function (d, e) { if (d === "active") { this._activate(e); return } if (d === "event") { if (this.options.event) { this.headers.unbind(this.options.event + ".accordion", this._eventHandler) } this._setupEvents(e) } this._super("_setOption", d, e); if (d === "collapsible" && !e && this.options.active === false) { this._activate(0) } if (d === "icons") { this._destroyIcons(); if (e) { this._createIcons() } } if (d === "disabled") { this.headers.add(this.headers.next()).toggleClass("ui-accordion-disabled ui-state-disabled", !!e) } }, _keydown: function (g) { if (this.options.disabled || g.altKey || g.ctrlKey) { return } var h = b.ui.keyCode, f = this.headers.length, d = this.headers.index(g.target), e = false; switch (g.keyCode) { case h.RIGHT: case h.DOWN: e = this.headers[(d + 1) % f]; break; case h.LEFT: case h.UP: e = this.headers[(d - 1 + f) % f]; break; case h.SPACE: case h.ENTER: this._eventHandler(g) } if (e) { b(g.target).attr("tabIndex", -1); b(e).attr("tabIndex", 0); e.focus(); g.preventDefault() } }, refresh: function () { var d = this.options, e = this.element.parent(), f, g; if (d.heightStyle === "fill") { if (!b.support.minHeight) { g = e.css("overflow"); e.css("overflow", "hidden") } f = e.height(); this.element.siblings(":visible").each(function () { var i = b(this), h = i.css("position"); if (h === "absolute" || h === "fixed") { return } f -= i.outerHeight(true) }); if (g) { e.css("overflow", g) } this.headers.each(function () { f -= b(this).outerHeight(true) }); this.headers.next().each(function () { b(this).height(Math.max(0, f - b(this).innerHeight() + b(this).height())) }).css("overflow", "auto") } else { if (d.heightStyle === "auto") { f = 0; this.headers.next().each(function () { f = Math.max(f, b(this).height("").height()) }).height(f) } } return this }, _activate: function (d) { var e = this._findActive(d)[0]; if (e === this.active[0]) { return } e = e || this.active[0]; this._eventHandler({ target: e, currentTarget: e, preventDefault: b.noop }) }, _findActive: function (d) { return typeof d === "number" ? this.headers.eq(d) : b() }, _setupEvents: function (d) { if (d) { this.headers.bind(d.split(" ").join(".accordion ") + ".accordion", b.proxy(this, "_eventHandler")) } }, _eventHandler: function (d) { var l = this.options, g = this.active, h = b(d.currentTarget), j = h[0] === g[0], e = j && l.collapsible, f = e ? b() : h.next(), i = g.next(), k = { oldHeader: g, oldContent: i, newHeader: e ? b() : h, newContent: f }; d.preventDefault(); if (l.disabled || (j && !l.collapsible) || (this._trigger("beforeActivate", d, k) === false)) { return } l.active = e ? false : this.headers.index(h); this.active = j ? b() : h; this._toggle(k); g.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-accordion-header-icon").removeClass(l.icons.activeHeader).addClass(l.icons.header); if (!j) { h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-accordion-header-icon").removeClass(l.icons.header).addClass(l.icons.activeHeader); h.next().addClass("ui-accordion-content-active") } }, _toggle: function (h) { var k = this, l = k.options, d = h.newContent, i = h.oldContent; function e() { k._completed(h) } if (l.animated) { var j = b.ui.accordion.animations, g = l.animated, f; if (!j[g]) { f = { easing: b.easing[g] ? g : "slide", duration: 700 }; g = "slide" } j[g]({ toShow: d, toHide: i, prevShow: a.toShow, prevHide: a.toHide, complete: e, down: d.length && (!i.length || (d.index() < i.index())) }, f) } else { i.hide(); d.show(); e() } i.prev().attr({ "aria-expanded": "false", "aria-selected": "false", tabIndex: -1 }).blur(); d.prev().attr({ "aria-expanded": "true", "aria-selected": "true", tabIndex: 0 }).focus() }, _completed: function (f) { var d = f.newContent, e = f.oldContent; if (this.options.heightStyle === "content") { d.add(e).css({ height: "", overflow: "" }) } e.removeClass("ui-accordion-content-active"); if (e.length) { e.parent()[0].className = e.parent()[0].className } this._trigger("activate", null, f) } }); b.extend(b.ui.accordion, { animations: { slide: function (m, k) { if (m.prevShow || m.prevHide) { m.prevHide.stop(true, true); m.toHide = m.prevShow } var g = m.toShow.css("overflow"), e = m.toHide.css("overflow"), j = 0, f = {}, i = {}, h = ["height", "paddingTop", "paddingBottom"], d; m = b.extend({ easing: "swing", duration: 300 }, m, k); a = m; if (!m.toHide.size()) { d = m.toShow[0].style.width; m.toShow.show().width(m.toShow.width()).hide().animate({ height: "show", paddingTop: "show", paddingBottom: "show" }, { duration: m.duration, easing: m.easing, complete: function () { m.toShow.width(d); m.complete() } }); return } if (!m.toShow.size()) { m.toHide.animate({ height: "hide", paddingTop: "hide", paddingBottom: "hide" }, m); return } var l = m.toShow; d = l[0].style.width; l.width(parseInt(l.parent().width(), 10) - parseInt(l.css("paddingLeft"), 10) - parseInt(l.css("paddingRight"), 10) - (parseInt(l.css("borderLeftWidth"), 10) || 0) - (parseInt(l.css("borderRightWidth"), 10) || 0)); b.each(h, function (o, q) { i[q] = "hide"; var p = ("" + b.css(m.toShow[0], q)).match(/^([\d+-.]+)(.*)$/), n = q === "height" && p[1] === "0" ? 1 : p[1]; f[q] = { value: n, unit: p[2] || "px"} }); m.toShow.css({ height: 0, overflow: "hidden" }).show(); m.toHide.filter(":hidden").each(m.complete).end().filter(":visible").animate(i, { step: function (n, o) { if (o.prop == "height" || o.prop == "paddingTop" || o.prop == "paddingBottom") { j = (o.end - o.start === 0) ? 0 : (o.now - o.start) / (o.end - o.start) } m.toShow[0].style[o.prop] = (j * f[o.prop].value) + f[o.prop].unit }, duration: m.duration, easing: m.easing, complete: function () { m.toShow.css({ width: d, overflow: g }); m.toHide.css("overflow", e); m.complete() } }) }, bounceslide: function (d) { this.slide(d, { easing: d.down ? "easeOutBounce" : "swing", duration: d.down ? 1000 : 200 }) } } }); if (b.uiBackCompat !== false) { (function (e, d) { e.extend(d.options, { navigation: false, navigationFilter: function () { return this.href.toLowerCase() === location.href.toLowerCase() } }); var f = d._create; d._create = function () { if (this.options.navigation) { var g = this, j = this.element.find(this.options.header), h = j.next(), i = j.add(h).find("a").filter(this.options.navigationFilter)[0]; if (i) { j.add(h).each(function (k) { if (e.contains(this, i)) { g.options.active = Math.floor(k / 2); return false } }) } } f.call(this) } } (jQuery, jQuery.ui.accordion.prototype)); (function (f, d) { f.extend(d.options, { heightStyle: null, autoHeight: true, clearStyle: false, fillSpace: false }); var g = d._create, e = d._setOption; f.extend(d, { _create: function () { this.options.heightStyle = this.options.heightStyle || this._mergeHeightStyle(); g.call(this) }, _setOption: function (h, i) { if (h === "autoHeight" || h === "clearStyle" || h === "fillSpace") { this.options.heightStyle = this._mergeHeightStyle() } e.apply(this, arguments) }, _mergeHeightStyle: function () { var h = this.options; if (h.fillSpace) { return "fill" } if (h.clearStyle) { return "content" } if (h.autoHeight) { return "auto" } } }) } (jQuery, jQuery.ui.accordion.prototype)); (function (f, e) { f.extend(e.options.icons, { activeHeader: null, headerSelected: "ui-icon-triangle-1-s" }); var d = e._createIcons; e._createIcons = function () { this.options.icons.activeHeader = this.options.icons.activeHeader || this.options.icons.headerSelected; d.call(this) } } (jQuery, jQuery.ui.accordion.prototype)); (function (f, e) { e.activate = e._activate; var d = e._findActive; e._findActive = function (g) { if (g === -1) { g = false } if (g && typeof g !== "number") { g = this.headers.index(this.headers.filter(g)); if (g === -1) { g = false } } return d.call(this, g) } } (jQuery, jQuery.ui.accordion.prototype)); jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh; (function (f, e) { f.extend(e.options, { change: null, changestart: null }); var d = e._trigger; e._trigger = function (h, i, j) { var g = d.apply(this, arguments); if (!g) { return false } if (h === "beforeActivate") { g = d.call(this, "changestart", i, j) } else { if (h === "activate") { g = d.call(this, "change", i, j) } } return g } } (jQuery, jQuery.ui.accordion.prototype)) } })(jQuery); (function (a, b) { var c = 0; a.widget("ui.autocomplete", { version: "1.9m6", defaultElement: "<input>", options: { appendTo: "body", autoFocus: false, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, pending: 0, _create: function () { var d = this, f = this.element[0].ownerDocument, e, g; this.valueMethod = this.element[this.element.is("input,textarea") ? "val" : "text"]; this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off").attr({ role: "textbox", "aria-autocomplete": "list", "aria-haspopup": "true" }).bind("keydown.autocomplete", function (h) { if (d.options.disabled || d.element.prop("readOnly")) { e = true; g = true; return } e = false; g = false; var i = a.ui.keyCode; switch (h.keyCode) { case i.PAGE_UP: e = true; d._move("previousPage", h); break; case i.PAGE_DOWN: e = true; d._move("nextPage", h); break; case i.UP: e = true; d._move("previous", h); h.preventDefault(); break; case i.DOWN: e = true; d._move("next", h); h.preventDefault(); break; case i.ENTER: case i.NUMPAD_ENTER: if (d.menu.active) { e = true; h.preventDefault() } case i.TAB: if (!d.menu.active) { return } d.menu.select(h); break; case i.ESCAPE: d._value(d.term); d.close(h); break; default: d._searchTimeout(h); break } }).bind("keypress.autocomplete", function (h) { if (e) { e = false; h.preventDefault(); return } var i = a.ui.keyCode; switch (h.keyCode) { case i.PAGE_UP: d._move("previousPage", h); break; case i.PAGE_DOWN: d._move("nextPage", h); break; case i.UP: d._move("previous", h); h.preventDefault(); break; case i.DOWN: d._move("next", h); h.preventDefault(); break } }).bind("input.autocomplete", function (h) { if (g) { g = false; h.preventDefault(); return } d._searchTimeout(h) }).bind("focus.autocomplete", function () { if (d.options.disabled) { return } d.selectedItem = null; d.previous = d._value() }).bind("blur.autocomplete", function (h) { if (d.options.disabled) { return } clearTimeout(d.searching); d.closing = setTimeout(function () { d.close(h); d._change(h) }, 150) }); this._initSource(); this.response = function () { return d._response.apply(d, arguments) }; this.menu = a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo || "body", f)[0]).mousedown(function (h) { var i = d.menu.element[0]; if (!a(h.target).closest(".ui-menu-item").length) { setTimeout(function () { a(document).one("mousedown", function (j) { if (j.target !== d.element[0] && j.target !== i && !a.contains(i, j.target)) { d.close() } }) }, 1) } setTimeout(function () { clearTimeout(d.closing) }, 13) }).menu({ input: a(), focus: function (i, j) { var h = j.item.data("item.autocomplete"); if (false !== d._trigger("focus", i, { item: h })) { if (/^key/.test(i.originalEvent.type)) { d._value(h.value) } } }, select: function (j, k) { var i = k.item.data("item.autocomplete"), h = d.previous; if (d.element[0] !== f.activeElement) { d.element.focus(); d.previous = h; setTimeout(function () { d.previous = h; d.selectedItem = i }, 1) } if (false !== d._trigger("select", j, { item: i })) { d._value(i.value) } d.term = d._value(); d.close(j); d.selectedItem = i }, blur: function (h, i) { if (d.menu.element.is(":visible") && (d._value() !== d.term)) { d._value(d.term) } } }).zIndex(this.element.zIndex() + 1).hide().data("menu"); if (a.fn.bgiframe) { this.menu.element.bgiframe() } }, _destroy: function () { clearTimeout(this.searching); this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); this.menu.element.remove() }, _setOption: function (d, e) { this._super("_setOption", d, e); if (d === "source") { this._initSource() } if (d === "appendTo") { this.menu.element.appendTo(a(e || "body", this.element[0].ownerDocument)[0]) } if (d === "disabled" && e && this.xhr) { this.xhr.abort() } }, _initSource: function () { var d = this, f, e; if (a.isArray(this.options.source)) { f = this.options.source; this.source = function (h, g) { g(a.ui.autocomplete.filter(f, h.term)) } } else { if (typeof this.options.source === "string") { e = this.options.source; this.source = function (h, g) { if (d.xhr) { d.xhr.abort() } d.xhr = a.ajax({ url: e, data: h, dataType: "json", autocompleteRequest: ++c, success: function (j, i) { if (this.autocompleteRequest === c) { g(j) } }, error: function () { if (this.autocompleteRequest === c) { g([]) } } }) } } else { this.source = this.options.source } } }, _searchTimeout: function (e) { var d = this; d.searching = setTimeout(function () { if (d.term != d.element.val()) { d.selectedItem = null; d.search(null, e) } }, d.options.delay) }, search: function (e, d) { e = e != null ? e : this._value(); this.term = this._value(); if (e.length < this.options.minLength) { return this.close(d) } clearTimeout(this.closing); if (this._trigger("search", d) === false) { return } return this._search(e) }, _search: function (d) { this.pending++; this.element.addClass("ui-autocomplete-loading"); this.source({ term: d }, this.response) }, _response: function (d) { if (d) { d = this._normalize(d) } this._trigger("response", null, { content: d }); if (!this.options.disabled && d && d.length) { this._suggest(d); this._trigger("open") } else { this.close() } this.pending--; if (!this.pending) { this.element.removeClass("ui-autocomplete-loading") } }, close: function (d) { clearTimeout(this.closing); if (this.menu.element.is(":visible")) { this.menu.element.hide(); this.menu.blur(); this._trigger("close", d) } }, _change: function (d) { if (this.previous !== this._value()) { this._trigger("change", d, { item: this.selectedItem }) } }, _normalize: function (d) { if (d.length && d[0].label && d[0].value) { return d } return a.map(d, function (e) { if (typeof e === "string") { return { label: e, value: e} } return a.extend({ label: e.label || e.value, value: e.value || e.label }, e) }) }, _suggest: function (d) { var e = this.menu.element.empty().zIndex(this.element.zIndex() + 1); this._renderMenu(e, d); this.menu.blur(); this.menu.refresh(); e.show(); this._resizeMenu(); e.position(a.extend({ of: this.element }, this.options.position)); if (this.options.autoFocus) { this.menu.next(new a.Event("mouseover")) } }, _resizeMenu: function () { var d = this.menu.element; d.outerWidth(Math.max(d.width("").outerWidth(), this.element.outerWidth())) }, _renderMenu: function (f, e) { var d = this; a.each(e, function (g, h) { d._renderItem(f, h) }) }, _renderItem: function (d, e) { return a("<li></li>").data("item.autocomplete", e).append(a("<a></a>").text(e.label)).appendTo(d) }, _move: function (e, d) { if (!this.menu.element.is(":visible")) { this.search(null, d); return } if (this.menu.first() && /^previous/.test(e) || this.menu.last() && /^next/.test(e)) { this._value(this.term); this.menu.blur(); return } this.menu[e](d) }, widget: function () { return this.menu.element }, _value: function (d) { return this.valueMethod.apply(this.element, arguments) } }); a.extend(a.ui.autocomplete, { escapeRegex: function (d) { return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") }, filter: function (f, d) { var e = new RegExp(a.ui.autocomplete.escapeRegex(d), "i"); return a.grep(f, function (g) { return e.test(g.label || g.value || g) }) } }) } (jQuery)); (function (f, b) { var k, e, a, h, i = "ui-button ui-widget ui-state-default ui-corner-all", c = "ui-state-hover ui-state-active ", g = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", j = function () { var l = f(this).find(":ui-button"); setTimeout(function () { l.button("refresh") }, 1) }, d = function (m) { var l = m.name, n = m.form, o = f([]); if (l) { if (n) { o = f(n).find("[name='" + l + "']") } else { o = f("[name='" + l + "']", m.ownerDocument).filter(function () { return !this.form }) } } return o }; f.widget("ui.button", { version: "1.9m6", defaultElement: "<button>", options: { disabled: null, text: true, label: null, icons: { primary: null, secondary: null} }, _create: function () { this.element.closest("form").unbind("reset.button").bind("reset.button", j); if (typeof this.options.disabled !== "boolean") { this.options.disabled = this.element.prop("disabled") } this._determineButtonType(); this.hasTitle = !!this.buttonElement.attr("title"); var l = this, n = this.options, o = this.type === "checkbox" || this.type === "radio", p = "ui-state-hover" + (!o ? " ui-state-active" : ""), m = "ui-state-focus"; if (n.label === null) { n.label = this.buttonElement.html() } if (this.element.is(":disabled")) { n.disabled = true } this.buttonElement.addClass(i).attr("role", "button").bind("mouseenter.button", function () { if (n.disabled) { return } f(this).addClass("ui-state-hover"); if (this === k) { f(this).addClass("ui-state-active") } }).bind("mouseleave.button", function () { if (n.disabled) { return } f(this).removeClass(p) }).bind("click.button", function (q) { if (n.disabled) { q.preventDefault(); q.stopImmediatePropagation() } }); this.element.bind("focus.button", function () { l.buttonElement.addClass(m) }).bind("blur.button", function () { l.buttonElement.removeClass(m) }); if (o) { this.element.bind("change.button", function () { if (h) { return } l.refresh() }); this.buttonElement.bind("mousedown.button", function (q) { if (n.disabled) { return } h = false; e = q.pageX; a = q.pageY }).bind("mouseup.button", function (q) { if (n.disabled) { return } if (e !== q.pageX || a !== q.pageY) { h = true } }) } if (this.type === "checkbox") { this.buttonElement.bind("click.button", function () { if (n.disabled || h) { return false } f(this).toggleClass("ui-state-active"); l.buttonElement.attr("aria-pressed", l.element[0].checked) }) } else { if (this.type === "radio") { this.buttonElement.bind("click.button", function () { if (n.disabled || h) { return false } f(this).addClass("ui-state-active"); l.buttonElement.attr("aria-pressed", "true"); var q = l.element[0]; d(q).not(q).map(function () { return f(this).button("widget")[0] }).removeClass("ui-state-active").attr("aria-pressed", "false") }) } else { this.buttonElement.bind("mousedown.button", function () { if (n.disabled) { return false } f(this).addClass("ui-state-active"); k = this; f(document).one("mouseup", function () { k = null }) }).bind("mouseup.button", function () { if (n.disabled) { return false } f(this).removeClass("ui-state-active") }).bind("keydown.button", function (q) { if (n.disabled) { return false } if (q.keyCode == f.ui.keyCode.SPACE || q.keyCode == f.ui.keyCode.ENTER) { f(this).addClass("ui-state-active") } }).bind("keyup.button", function () { f(this).removeClass("ui-state-active") }); if (this.buttonElement.is("a")) { this.buttonElement.keyup(function (q) { if (q.keyCode === f.ui.keyCode.SPACE) { f(this).click() } }) } } } this._setOption("disabled", n.disabled); this._resetButton() }, _determineButtonType: function () { if (this.element.is(":checkbox")) { this.type = "checkbox" } else { if (this.element.is(":radio")) { this.type = "radio" } else { if (this.element.is("input")) { this.type = "input" } else { this.type = "button" } } } if (this.type === "checkbox" || this.type === "radio") { var l = this.element.parents().last(), n = "label[for='" + this.element.attr("id") + "']"; this.buttonElement = l.find(n); if (!this.buttonElement.length) { l = l.length ? l.siblings() : this.element.siblings(); this.buttonElement = l.filter(n); if (!this.buttonElement.length) { this.buttonElement = l.find(n) } } this.element.addClass("ui-helper-hidden-accessible"); var m = this.element.is(":checked"); if (m) { this.buttonElement.addClass("ui-state-active") } this.buttonElement.prop("aria-pressed", m) } else { this.buttonElement = this.element } }, widget: function () { return this.buttonElement }, _destroy: function () { this.element.removeClass("ui-helper-hidden-accessible"); this.buttonElement.removeClass(i + " " + c + " " + g).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()); if (!this.hasTitle) { this.buttonElement.removeAttr("title") } }, _setOption: function (l, m) { this._super("_setOption", l, m); if (l === "disabled") { if (m) { this.element.prop("disabled", true) } else { this.element.prop("disabled", false) } return } this._resetButton() }, refresh: function () { var l = this.element.is(":disabled"); if (l !== this.options.disabled) { this._setOption("disabled", l) } if (this.type === "radio") { d(this.element[0]).each(function () { if (f(this).is(":checked")) { f(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") } else { f(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false") } }) } else { if (this.type === "checkbox") { if (this.element.is(":checked")) { this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") } else { this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false") } } } }, _resetButton: function () { if (this.type === "input") { if (this.options.label) { this.element.val(this.options.label) } return } var p = this.buttonElement.removeClass(g), n = f("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(p.empty()).text(), m = this.options.icons, l = m.primary && m.secondary, o = []; if (m.primary || m.secondary) { if (this.options.text) { o.push("ui-button-text-icon" + (l ? "s" : (m.primary ? "-primary" : "-secondary"))) } if (m.primary) { p.prepend("<span class='ui-button-icon-primary ui-icon " + m.primary + "'></span>") } if (m.secondary) { p.append("<span class='ui-button-icon-secondary ui-icon " + m.secondary + "'></span>") } if (!this.options.text) { o.push(l ? "ui-button-icons-only" : "ui-button-icon-only"); if (!this.hasTitle) { p.attr("title", n) } } } else { o.push("ui-button-text-only") } p.addClass(o.join(" ")) } }); f.ui.button.version = "1.9m6"; f.widget("ui.buttonset", { options: { items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" }, _create: function () { this.element.addClass("ui-buttonset") }, _init: function () { this.refresh() }, _setOption: function (l, m) { if (l === "disabled") { this.buttons.button("option", l, m) } this._super("_setOption", l, m) }, refresh: function () { var l = this.element.css("direction") === "rtl"; this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function () { return f(this).button("widget")[0] }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(l ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(l ? "ui-corner-left" : "ui-corner-right").end().end() }, _destroy: function () { this.element.removeClass("ui-buttonset"); this.buttons.map(function () { return f(this).button("widget")[0] }).removeClass("ui-corner-left ui-corner-right").end().button("destroy") } }) } (jQuery)); (function ($, undefined) { $.extend($.ui, { datepicker: { version: "1.9m6"} }); var PROP_NAME = "datepicker"; var dpuuid = new Date().getTime(); var instActive; function Datepicker() { this.debug = false; this._curInst = null; this._keyEvent = false; this._disabledInputs = []; this._datepickerShowing = false; this._inDialog = false; this._mainDivId = "ui-datepicker-div"; this._inlineClass = "ui-datepicker-inline"; this._appendClass = "ui-datepicker-append"; this._triggerClass = "ui-datepicker-trigger"; this._dialogClass = "ui-datepicker-dialog"; this._disableClass = "ui-datepicker-disabled"; this._unselectableClass = "ui-datepicker-unselectable"; this._currentClass = "ui-datepicker-current-day"; this._dayOverClass = "ui-datepicker-days-cell-over"; this.regional = []; this.regional[""] = { closeText: "Done", prevText: "Prev", nextText: "Next", currentText: "Today", monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], weekHeader: "Wk", dateFormat: "mm/dd/yy", firstDay: 0, isRTL: false, showMonthAfterYear: false, yearSuffix: "" }; this._defaults = { showOn: "focus", showAnim: "fadeIn", showOptions: {}, defaultDate: null, appendText: "", buttonText: "...", buttonImage: "", buttonImageOnly: false, hideIfNoPrevNext: false, navigationAsDateFormat: false, gotoCurrent: false, changeMonth: false, changeYear: false, yearRange: "c-10:c+10", showOtherMonths: false, selectOtherMonths: false, showWeek: false, calculateWeek: this.iso8601Week, shortYearCutoff: "+10", minDate: null, maxDate: null, duration: "fast", beforeShowDay: null, beforeShow: null, onSelect: null, onChangeMonthYear: null, onClose: null, numberOfMonths: 1, showCurrentAtPos: 0, stepMonths: 1, stepBigMonths: 12, altField: "", altFormat: "", constrainInput: true, showButtonPanel: false, autoSize: false, disabled: false }; $.extend(this._defaults, this.regional[""]); this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')) } $.extend(Datepicker.prototype, { markerClassName: "hasDatepicker", maxRows: 4, log: function () { if (this.debug) { console.log.apply("", arguments) } }, _widgetDatepicker: function () { return this.dpDiv }, setDefaults: function (settings) { extendRemove(this._defaults, settings || {}); return this }, _attachDatepicker: function (target, settings) { var inlineSettings = null; for (var attrName in this._defaults) { var attrValue = target.getAttribute("date:" + attrName); if (attrValue) { inlineSettings = inlineSettings || {}; try { inlineSettings[attrName] = eval(attrValue) } catch (err) { inlineSettings[attrName] = attrValue } } } var nodeName = target.nodeName.toLowerCase(); var inline = (nodeName == "div" || nodeName == "span"); if (!target.id) { this.uuid += 1; target.id = "dp" + this.uuid } var inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}, inlineSettings || {}); if (nodeName == "input") { this._connectDatepicker(target, inst) } else { if (inline) { this._inlineDatepicker(target, inst) } } }, _newInst: function (target, inline) { var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"); return { id: id, input: target, selectedDay: 0, selectedMonth: 0, selectedYear: 0, drawMonth: 0, drawYear: 0, inline: inline, dpDiv: (!inline ? this.dpDiv : bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))} }, _connectDatepicker: function (target, inst) { var input = $(target); inst.append = $([]); inst.trigger = $([]); if (input.hasClass(this.markerClassName)) { return } this._attachments(input, inst); input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function (event, key, value) { inst.settings[key] = value }).bind("getData.datepicker", function (event, key) { return this._get(inst, key) }); this._autoSize(inst); $.data(target, PROP_NAME, inst); if (inst.settings.disabled) { this._disableDatepicker(target) } }, _attachments: function (input, inst) { var appendText = this._get(inst, "appendText"); var isRTL = this._get(inst, "isRTL"); if (inst.append) { inst.append.remove() } if (appendText) { inst.append = $('<span class="' + this._appendClass + '">' + appendText + "</span>"); input[isRTL ? "before" : "after"](inst.append) } input.unbind("focus", this._showDatepicker); if (inst.trigger) { inst.trigger.remove() } var showOn = this._get(inst, "showOn"); if (showOn == "focus" || showOn == "both") { input.focus(this._showDatepicker) } if (showOn == "button" || showOn == "both") { var buttonText = this._get(inst, "buttonText"); var buttonImage = this._get(inst, "buttonImage"); inst.trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({ src: buttonImage, alt: buttonText, title: buttonText }) : $('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage == "" ? buttonText : $("<img/>").attr({ src: buttonImage, alt: buttonText, title: buttonText }))); input[isRTL ? "before" : "after"](inst.trigger); inst.trigger.click(function () { if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) { $.datepicker._hideDatepicker() } else { $.datepicker._showDatepicker(input[0]) } return false }) } }, _autoSize: function (inst) { if (this._get(inst, "autoSize") && !inst.inline) { var date = new Date(2009, 12 - 1, 20); var dateFormat = this._get(inst, "dateFormat"); if (dateFormat.match(/[DM]/)) { var findMax = function (names) { var max = 0; var maxI = 0; for (var i = 0; i < names.length; i++) { if (names[i].length > max) { max = names[i].length; maxI = i } } return maxI }; date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort")))); date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort"))) + 20 - date.getDay()) } inst.input.attr("size", this._formatDate(inst, date).length) } }, _inlineDatepicker: function (target, inst) { var divSpan = $(target); if (divSpan.hasClass(this.markerClassName)) { return } divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker", function (event, key, value) { inst.settings[key] = value }).bind("getData.datepicker", function (event, key) { return this._get(inst, key) }); $.data(target, PROP_NAME, inst); this._setDate(inst, this._getDefaultDate(inst), true); this._updateDatepicker(inst); this._updateAlternate(inst); if (inst.settings.disabled) { this._disableDatepicker(target) } inst.dpDiv.css("display", "block") }, _dialogDatepicker: function (input, date, onSelect, settings, pos) { var inst = this._dialogInst; if (!inst) { this.uuid += 1; var id = "dp" + this.uuid; this._dialogInput = $('<input type="text" id="' + id + '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'); this._dialogInput.keydown(this._doKeyDown); $("body").append(this._dialogInput); inst = this._dialogInst = this._newInst(this._dialogInput, false); inst.settings = {}; $.data(this._dialogInput[0], PROP_NAME, inst) } extendRemove(inst.settings, settings || {}); date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); this._dialogInput.val(date); this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); if (!this._pos) { var browserWidth = document.documentElement.clientWidth; var browserHeight = document.documentElement.clientHeight; var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; var scrollY = document.documentElement.scrollTop || document.body.scrollTop; this._pos = [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY] } this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); inst.settings.onSelect = onSelect; this._inDialog = true; this.dpDiv.addClass(this._dialogClass); this._showDatepicker(this._dialogInput[0]); if ($.blockUI) { $.blockUI(this.dpDiv) } $.data(this._dialogInput[0], PROP_NAME, inst); return this }, _destroyDatepicker: function (target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return } var nodeName = target.nodeName.toLowerCase(); $.removeData(target, PROP_NAME); if (nodeName == "input") { inst.append.remove(); inst.trigger.remove(); $target.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp) } else { if (nodeName == "div" || nodeName == "span") { $target.removeClass(this.markerClassName).empty() } } }, _enableDatepicker: function (target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return } var nodeName = target.nodeName.toLowerCase(); if (nodeName == "input") { target.disabled = false; inst.trigger.filter("button").each(function () { this.disabled = false }).end().filter("img").css({ opacity: "1.0", cursor: "" }) } else { if (nodeName == "div" || nodeName == "span") { var inline = $target.children("." + this._inlineClass); inline.children().removeClass("ui-state-disabled"); inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", false) } } this._disabledInputs = $.map(this._disabledInputs, function (value) { return (value == target ? null : value) }) }, _disableDatepicker: function (target) { var $target = $(target); var inst = $.data(target, PROP_NAME); if (!$target.hasClass(this.markerClassName)) { return } var nodeName = target.nodeName.toLowerCase(); if (nodeName == "input") { target.disabled = true; inst.trigger.filter("button").each(function () { this.disabled = true }).end().filter("img").css({ opacity: "0.5", cursor: "default" }) } else { if (nodeName == "div" || nodeName == "span") { var inline = $target.children("." + this._inlineClass); inline.children().addClass("ui-state-disabled"); inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", true) } } this._disabledInputs = $.map(this._disabledInputs, function (value) { return (value == target ? null : value) }); this._disabledInputs[this._disabledInputs.length] = target }, _isDisabledDatepicker: function (target) { if (!target) { return false } for (var i = 0; i < this._disabledInputs.length; i++) { if (this._disabledInputs[i] == target) { return true } } return false }, _getInst: function (target) { try { return $.data(target, PROP_NAME) } catch (err) { throw "Missing instance data for this datepicker" } }, _optionDatepicker: function (target, name, value) { var inst = this._getInst(target); if (arguments.length == 2 && typeof name == "string") { return (name == "defaults" ? $.extend({}, $.datepicker._defaults) : (inst ? (name == "all" ? $.extend({}, inst.settings) : this._get(inst, name)) : null)) } var settings = name || {}; if (typeof name == "string") { settings = {}; settings[name] = value } if (inst) { if (this._curInst == inst) { this._hideDatepicker() } var date = this._getDateDatepicker(target, true); var minDate = this._getMinMaxDate(inst, "min"); var maxDate = this._getMinMaxDate(inst, "max"); extendRemove(inst.settings, settings); if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) { inst.settings.minDate = this._formatDate(inst, minDate) } if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) { inst.settings.maxDate = this._formatDate(inst, maxDate) } this._attachments($(target), inst); this._autoSize(inst); this._setDate(inst, date); this._updateAlternate(inst); this._updateDatepicker(inst) } }, _changeDatepicker: function (target, name, value) { this._optionDatepicker(target, name, value) }, _refreshDatepicker: function (target) { var inst = this._getInst(target); if (inst) { this._updateDatepicker(inst) } }, _setDateDatepicker: function (target, date) { var inst = this._getInst(target); if (inst) { this._setDate(inst, date); this._updateDatepicker(inst); this._updateAlternate(inst) } }, _getDateDatepicker: function (target, noDefault) { var inst = this._getInst(target); if (inst && !inst.inline) { this._setDateFromField(inst, noDefault) } return (inst ? this._getDate(inst) : null) }, _doKeyDown: function (event) { var inst = $.datepicker._getInst(event.target); var handled = true; var isRTL = inst.dpDiv.is(".ui-datepicker-rtl"); inst._keyEvent = true; if ($.datepicker._datepickerShowing) { switch (event.keyCode) { case 9: $.datepicker._hideDatepicker(); handled = false; break; case 13: var sel = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv); if (sel[0]) { $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]) } var onSelect = $.datepicker._get(inst, "onSelect"); if (onSelect) { var dateStr = $.datepicker._formatDate(inst); onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]) } else { $.datepicker._hideDatepicker() } return false; break; case 27: $.datepicker._hideDatepicker(); break; case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M"); break; case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M"); break; case 35: if (event.ctrlKey || event.metaKey) { $.datepicker._clearDate(event.target) } handled = event.ctrlKey || event.metaKey; break; case 36: if (event.ctrlKey || event.metaKey) { $.datepicker._gotoToday(event.target) } handled = event.ctrlKey || event.metaKey; break; case 37: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D") } handled = event.ctrlKey || event.metaKey; if (event.originalEvent.altKey) { $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M") } break; case 38: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, -7, "D") } handled = event.ctrlKey || event.metaKey; break; case 39: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D") } handled = event.ctrlKey || event.metaKey; if (event.originalEvent.altKey) { $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M") } break; case 40: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, +7, "D") } handled = event.ctrlKey || event.metaKey; break; default: handled = false } } else { if (event.keyCode == 36 && event.ctrlKey) { $.datepicker._showDatepicker(this) } else { handled = false } } if (handled) { event.preventDefault(); event.stopPropagation() } }, _doKeyPress: function (event) { var inst = $.datepicker._getInst(event.target); if ($.datepicker._get(inst, "constrainInput")) { var chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1) } }, _doKeyUp: function (event) { var inst = $.datepicker._getInst(event.target); if (inst.input.val() != inst.lastVal) { try { var date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), (inst.input ? inst.input.val() : null), $.datepicker._getFormatConfig(inst)); if (date) { $.datepicker._setDateFromField(inst); $.datepicker._updateAlternate(inst); $.datepicker._updateDatepicker(inst) } } catch (event) { $.datepicker.log(event) } } return true }, _showDatepicker: function (input) { input = input.target || input; if (input.nodeName.toLowerCase() != "input") { input = $("input", input.parentNode)[0] } if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) { return } var inst = $.datepicker._getInst(input); if ($.datepicker._curInst && $.datepicker._curInst != inst) { if ($.datepicker._datepickerShowing) { $.datepicker._triggerOnClose($.datepicker._curInst) } $.datepicker._curInst.dpDiv.stop(true, true) } var beforeShow = $.datepicker._get(inst, "beforeShow"); var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; if (beforeShowSettings === false) { return } extendRemove(inst.settings, beforeShowSettings); inst.lastVal = null; $.datepicker._lastInput = input; $.datepicker._setDateFromField(inst); if ($.datepicker._inDialog) { input.value = "" } if (!$.datepicker._pos) { $.datepicker._pos = $.datepicker._findPos(input); $.datepicker._pos[1] += input.offsetHeight } var isFixed = false; $(input).parents().each(function () { isFixed |= $(this).css("position") == "fixed"; return !isFixed }); if (isFixed && $.browser.opera) { $.datepicker._pos[0] -= document.documentElement.scrollLeft; $.datepicker._pos[1] -= document.documentElement.scrollTop } var offset = { left: $.datepicker._pos[0], top: $.datepicker._pos[1] }; $.datepicker._pos = null; inst.dpDiv.empty(); inst.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }); $.datepicker._updateDatepicker(inst); offset = $.datepicker._checkOffset(inst, offset, isFixed); inst.dpDiv.css({ position: ($.datepicker._inDialog && $.blockUI ? "static" : (isFixed ? "fixed" : "absolute")), display: "none", left: offset.left + "px", top: offset.top + "px" }); if (!inst.inline) { var showAnim = $.datepicker._get(inst, "showAnim"); var duration = $.datepicker._get(inst, "duration"); var postProcess = function () { var cover = inst.dpDiv.find("iframe.ui-datepicker-cover"); if (!!cover.length) { var borders = $.datepicker._getBorders(inst.dpDiv); cover.css({ left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight() }) } }; inst.dpDiv.zIndex($(input).zIndex() + 1); $.datepicker._datepickerShowing = true; if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) { inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess) } else { inst.dpDiv[showAnim || "show"]((showAnim ? duration : null), postProcess) } if (!showAnim || !duration) { postProcess() } if (inst.input.is(":visible") && !inst.input.is(":disabled")) { inst.input.focus() } $.datepicker._curInst = inst } }, _updateDatepicker: function (inst) { var self = this; self.maxRows = 4; var borders = $.datepicker._getBorders(inst.dpDiv); instActive = inst; inst.dpDiv.empty().append(this._generateHTML(inst)); var cover = inst.dpDiv.find("iframe.ui-datepicker-cover"); if (!!cover.length) { cover.css({ left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight() }) } inst.dpDiv.find("." + this._dayOverClass + " a").mouseover(); var numMonths = this._getNumberOfMonths(inst); var cols = numMonths[1]; var width = 17; inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); if (cols > 1) { inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em") } inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"); inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"); if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && inst.input.is(":visible") && !inst.input.is(":disabled") && inst.input[0] != document.activeElement) { inst.input.focus() } if (inst.yearshtml) { var origyearshtml = inst.yearshtml; setTimeout(function () { if (origyearshtml === inst.yearshtml && inst.yearshtml) { inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml) } origyearshtml = inst.yearshtml = null }, 0) } }, _getBorders: function (elem) { var convert = function (value) { return { thin: 1, medium: 2, thick: 3}[value] || value }; return [parseFloat(convert(elem.css("border-left-width"))), parseFloat(convert(elem.css("border-top-width")))] }, _checkOffset: function (inst, offset, isFixed) { var dpWidth = inst.dpDiv.outerWidth(); var dpHeight = inst.dpDiv.outerHeight(); var inputWidth = inst.input ? inst.input.outerWidth() : 0; var inputHeight = inst.input ? inst.input.outerHeight() : 0; var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0); offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(dpHeight + inputHeight) : 0); return offset }, _findPos: function (obj) { var inst = this._getInst(obj); var isRTL = this._get(inst, "isRTL"); while (obj && (obj.type == "hidden" || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { obj = obj[isRTL ? "previousSibling" : "nextSibling"] } var position = $(obj).offset(); return [position.left, position.top] }, _triggerOnClose: function (inst) { var onClose = this._get(inst, "onClose"); if (onClose) { onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]) } }, _hideDatepicker: function (input) { var inst = this._curInst; if (!inst || (input && inst != $.data(input, PROP_NAME))) { return } if (this._datepickerShowing) { var showAnim = this._get(inst, "showAnim"); var duration = this._get(inst, "duration"); var postProcess = function () { $.datepicker._tidyDialog(inst); this._curInst = null }; if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) { inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess) } else { inst.dpDiv[(showAnim == "slideDown" ? "slideUp" : (showAnim == "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess) } if (!showAnim) { postProcess() } $.datepicker._triggerOnClose(inst); this._datepickerShowing = false; this._lastInput = null; if (this._inDialog) { this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); if ($.blockUI) { $.unblockUI(); $("body").append(this.dpDiv) } } this._inDialog = false } }, _tidyDialog: function (inst) { inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar") }, _checkExternalClick: function (event) { if (!$.datepicker._curInst) { return } var $target = $(event.target); if ($target[0].id != $.datepicker._mainDivId && $target.parents("#" + $.datepicker._mainDivId).length == 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.hasClass($.datepicker._triggerClass) && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) { $.datepicker._hideDatepicker() } }, _adjustDate: function (id, offset, period) { var target = $(id); var inst = this._getInst(target[0]); if (this._isDisabledDatepicker(target[0])) { return } this._adjustInstDate(inst, offset + (period == "M" ? this._get(inst, "showCurrentAtPos") : 0), period); this._updateDatepicker(inst) }, _gotoToday: function (id) { var target = $(id); var inst = this._getInst(target[0]); if (this._get(inst, "gotoCurrent") && inst.currentDay) { inst.selectedDay = inst.currentDay; inst.drawMonth = inst.selectedMonth = inst.currentMonth; inst.drawYear = inst.selectedYear = inst.currentYear } else { var date = new Date(); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear() } this._notifyChange(inst); this._adjustDate(target) }, _selectMonthYear: function (id, select, period) { var target = $(id); var inst = this._getInst(target[0]); inst["selected" + (period == "M" ? "Month" : "Year")] = inst["draw" + (period == "M" ? "Month" : "Year")] = parseInt(select.options[select.selectedIndex].value, 10); this._notifyChange(inst); this._adjustDate(target) }, _selectDay: function (id, month, year, td) { var target = $(id); if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { return } var inst = this._getInst(target[0]); inst.selectedDay = inst.currentDay = $("a", td).html(); inst.selectedMonth = inst.currentMonth = month; inst.selectedYear = inst.currentYear = year; this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear)) }, _clearDate: function (id) { var target = $(id); var inst = this._getInst(target[0]); this._selectDate(target, "") }, _selectDate: function (id, dateStr) { var target = $(id); var inst = this._getInst(target[0]); dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); if (inst.input) { inst.input.val(dateStr) } this._updateAlternate(inst); var onSelect = this._get(inst, "onSelect"); if (onSelect) { onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]) } else { if (inst.input) { inst.input.trigger("change") } } if (inst.inline) { this._updateDatepicker(inst) } else { this._hideDatepicker(); this._lastInput = inst.input[0]; if (typeof (inst.input[0]) != "object") { inst.input.focus() } this._lastInput = null } }, _updateAlternate: function (inst) { var altField = this._get(inst, "altField"); if (altField) { var altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat"); var date = this._getDate(inst); var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); $(altField).each(function () { $(this).val(dateStr) }) } }, noWeekends: function (date) { var day = date.getDay(); return [(day > 0 && day < 6), ""] }, iso8601Week: function (date) { var checkDate = new Date(date.getTime()); checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); var time = checkDate.getTime(); checkDate.setMonth(0); checkDate.setDate(1); return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1 }, parseDate: function (format, value, settings) { if (format == null || value == null) { throw "Invalid arguments" } value = (typeof value == "object" ? value.toString() : value + ""); if (value == "") { return null } var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; shortYearCutoff = (typeof shortYearCutoff != "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; var year = -1; var month = -1; var day = -1; var doy = -1; var literal = false; var lookAhead = function (match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) { iFormat++ } return matches }; var getNumber = function (match) { var isDoubled = lookAhead(match); var size = (match == "@" ? 14 : (match == "!" ? 20 : (match == "y" && isDoubled ? 4 : (match == "o" ? 3 : 2)))); var digits = new RegExp("^\\d{1," + size + "}"); var num = value.substring(iValue).match(digits); if (!num) { throw "Missing number at position " + iValue } iValue += num[0].length; return parseInt(num[0], 10) }; var getName = function (match, shortNames, longNames) { var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { return [[k, v]] }).sort(function (a, b) { return -(a[1].length - b[1].length) }); var index = -1; $.each(names, function (i, pair) { var name = pair[1]; if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { index = pair[0]; iValue += name.length; return false } }); if (index != -1) { return index + 1 } else { throw "Unknown name at position " + iValue } }; var checkLiteral = function () { if (value.charAt(iValue) != format.charAt(iFormat)) { throw "Unexpected literal at position " + iValue } iValue++ }; var iValue = 0; for (var iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) == "'" && !lookAhead("'")) { literal = false } else { checkLiteral() } } else { switch (format.charAt(iFormat)) { case "d": day = getNumber("d"); break; case "D": getName("D", dayNamesShort, dayNames); break; case "o": doy = getNumber("o"); break; case "m": month = getNumber("m"); break; case "M": month = getName("M", monthNamesShort, monthNames); break; case "y": year = getNumber("y"); break; case "@": var date = new Date(getNumber("@")); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "!": var date = new Date((getNumber("!") - this._ticksTo1970) / 10000); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "'": if (lookAhead("'")) { checkLiteral() } else { literal = true } break; default: checkLiteral() } } } if (iValue < value.length) { var extra = value.substr(iValue); if (!/^\s+/.test(extra)) { throw "Extra/unparsed characters found in date: " + extra } } if (year == -1) { year = new Date().getFullYear() } else { if (year < 100) { year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100) } } if (doy > -1) { month = 1; day = doy; do { var dim = this._getDaysInMonth(year, month - 1); if (day <= dim) { break } month++; day -= dim } while (true) } var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) { throw "Invalid date" } return date }, ATOM: "yy-mm-dd", COOKIE: "D, dd M yy", ISO_8601: "yy-mm-dd", RFC_822: "D, d M y", RFC_850: "DD, dd-M-y", RFC_1036: "D, d M y", RFC_1123: "D, d M yy", RFC_2822: "D, d M yy", RSS: "D, d M y", TICKS: "!", TIMESTAMP: "@", W3C: "yy-mm-dd", _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), formatDate: function (format, date, settings) { if (!date) { return "" } var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; var lookAhead = function (match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) { iFormat++ } return matches }; var formatNumber = function (match, value, len) { var num = "" + value; if (lookAhead(match)) { while (num.length < len) { num = "0" + num } } return num }; var formatName = function (match, value, shortNames, longNames) { return (lookAhead(match) ? longNames[value] : shortNames[value]) }; var output = ""; var literal = false; if (date) { for (var iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) == "'" && !lookAhead("'")) { literal = false } else { output += format.charAt(iFormat) } } else { switch (format.charAt(iFormat)) { case "d": output += formatNumber("d", date.getDate(), 2); break; case "D": output += formatName("D", date.getDay(), dayNamesShort, dayNames); break; case "o": output += formatNumber("o", Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); break; case "m": output += formatNumber("m", date.getMonth() + 1, 2); break; case "M": output += formatName("M", date.getMonth(), monthNamesShort, monthNames); break; case "y": output += (lookAhead("y") ? date.getFullYear() : (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); break; case "@": output += date.getTime(); break; case "!": output += date.getTime() * 10000 + this._ticksTo1970; break; case "'": if (lookAhead("'")) { output += "'" } else { literal = true } break; default: output += format.charAt(iFormat) } } } } return output }, _possibleChars: function (format) { var chars = ""; var literal = false; var lookAhead = function (match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); if (matches) { iFormat++ } return matches }; for (var iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) == "'" && !lookAhead("'")) { literal = false } else { chars += format.charAt(iFormat) } } else { switch (format.charAt(iFormat)) { case "d": case "m": case "y": case "@": chars += "0123456789"; break; case "D": case "M": return null; case "'": if (lookAhead("'")) { chars += "'" } else { literal = true } break; default: chars += format.charAt(iFormat) } } } return chars }, _get: function (inst, name) { return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name] }, _setDateFromField: function (inst, noDefault) { if (inst.input.val() == inst.lastVal) { return } var dateFormat = this._get(inst, "dateFormat"); var dates = inst.lastVal = inst.input ? inst.input.val() : null; var date, defaultDate; date = defaultDate = this._getDefaultDate(inst); var settings = this._getFormatConfig(inst); try { date = this.parseDate(dateFormat, dates, settings) || defaultDate } catch (event) { this.log(event); dates = (noDefault ? "" : dates) } inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); inst.currentDay = (dates ? date.getDate() : 0); inst.currentMonth = (dates ? date.getMonth() : 0); inst.currentYear = (dates ? date.getFullYear() : 0); this._adjustInstDate(inst) }, _getDefaultDate: function (inst) { return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, "defaultDate"), new Date())) }, _determineDate: function (inst, date, defaultDate) { var offsetNumeric = function (offset) { var date = new Date(); date.setDate(date.getDate() + offset); return date }; var offsetString = function (offset) { try { return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst)) } catch (e) { } var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(); var year = date.getFullYear(); var month = date.getMonth(); var day = date.getDate(); var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; var matches = pattern.exec(offset); while (matches) { switch (matches[2] || "d") { case "d": case "D": day += parseInt(matches[1], 10); break; case "w": case "W": day += parseInt(matches[1], 10) * 7; break; case "m": case "M": month += parseInt(matches[1], 10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; case "y": case "Y": year += parseInt(matches[1], 10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break } matches = pattern.exec(offset) } return new Date(year, month, day) }; var newDate = (date == null || date === "" ? defaultDate : (typeof date == "string" ? offsetString(date) : (typeof date == "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); newDate = (newDate && newDate.toString() == "Invalid Date" ? defaultDate : newDate); if (newDate) { newDate.setHours(0); newDate.setMinutes(0); newDate.setSeconds(0); newDate.setMilliseconds(0) } return this._daylightSavingAdjust(newDate) }, _daylightSavingAdjust: function (date) { if (!date) { return null } date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); return date }, _setDate: function (inst, date, noChange) { var clear = !date; var origMonth = inst.selectedMonth; var origYear = inst.selectedYear; var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); inst.selectedDay = inst.currentDay = newDate.getDate(); inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) { this._notifyChange(inst) } this._adjustInstDate(inst); if (inst.input) { inst.input.val(clear ? "" : this._formatDate(inst)) } }, _getDate: function (inst) { var startDate = (!inst.currentYear || (inst.input && inst.input.val() == "") ? null : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); return startDate }, _generateHTML: function (inst) { var today = new Date(); today = this._daylightSavingAdjust(new Date(today.getFullYear(), today.getMonth(), today.getDate())); var isRTL = this._get(inst, "isRTL"); var showButtonPanel = this._get(inst, "showButtonPanel"); var hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"); var navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"); var numMonths = this._getNumberOfMonths(inst); var showCurrentAtPos = this._get(inst, "showCurrentAtPos"); var stepMonths = this._get(inst, "stepMonths"); var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); var minDate = this._getMinMaxDate(inst, "min"); var maxDate = this._getMinMaxDate(inst, "max"); var drawMonth = inst.drawMonth - showCurrentAtPos; var drawYear = inst.drawYear; if (drawMonth < 0) { drawMonth += 12; drawYear-- } if (maxDate) { var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { drawMonth--; if (drawMonth < 0) { drawMonth = 11; drawYear-- } } } inst.drawMonth = drawMonth; inst.drawYear = drawYear; var prevText = this._get(inst, "prevText"); prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst))); var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._adjustDate('#" + inst.id + "', -" + stepMonths + ", 'M');\" title=\"" + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + (isRTL ? "e" : "w") + '">' + prevText + "</span></a>" : (hideIfNoPrevNext ? "" : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + (isRTL ? "e" : "w") + '">' + prevText + "</span></a>")); var nextText = this._get(inst, "nextText"); nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst))); var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._adjustDate('#" + inst.id + "', +" + stepMonths + ", 'M');\" title=\"" + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + (isRTL ? "w" : "e") + '">' + nextText + "</span></a>" : (hideIfNoPrevNext ? "" : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + (isRTL ? "w" : "e") + '">' + nextText + "</span></a>")); var currentText = this._get(inst, "currentText"); var gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid + '.datepicker._hideDatepicker();">' + this._get(inst, "closeText") + "</button>" : ""); var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : "") + (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._gotoToday('#" + inst.id + "');\">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : ""; var firstDay = parseInt(this._get(inst, "firstDay"), 10); firstDay = (isNaN(firstDay) ? 0 : firstDay); var showWeek = this._get(inst, "showWeek"); var dayNames = this._get(inst, "dayNames"); var dayNamesShort = this._get(inst, "dayNamesShort"); var dayNamesMin = this._get(inst, "dayNamesMin"); var monthNames = this._get(inst, "monthNames"); var monthNamesShort = this._get(inst, "monthNamesShort"); var beforeShowDay = this._get(inst, "beforeShowDay"); var showOtherMonths = this._get(inst, "showOtherMonths"); var selectOtherMonths = this._get(inst, "selectOtherMonths"); var calculateWeek = this._get(inst, "calculateWeek") || this.iso8601Week; var defaultDate = this._getDefaultDate(inst); var html = ""; for (var row = 0; row < numMonths[0]; row++) { var group = ""; this.maxRows = 4; for (var col = 0; col < numMonths[1]; col++) { var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); var cornerClass = " ui-corner-all"; var calender = ""; if (isMultiMonth) { calender += '<div class="ui-datepicker-group'; if (numMonths[1] > 1) { switch (col) { case 0: calender += " ui-datepicker-group-first"; cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break; case numMonths[1] - 1: calender += " ui-datepicker-group-last"; cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break; default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break } } calender += '">' } calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : "") + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : "") + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + '</div><table class="ui-datepicker-calendar"><thead><tr>'; var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, "weekHeader") + "</th>" : ""); for (var dow = 0; dow < 7; dow++) { var day = (dow + firstDay) % 7; thead += "<th" + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : "") + '><span title="' + dayNames[day] + '">' + dayNamesMin[day] + "</span></th>" } calender += thead + "</tr></thead><tbody>"; var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) { inst.selectedDay = Math.min(inst.selectedDay, daysInMonth) } var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; var curRows = Math.ceil((leadDays + daysInMonth) / 7); var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); this.maxRows = numRows; var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); for (var dRow = 0; dRow < numRows; dRow++) { calender += "<tr>"; var tbody = (!showWeek ? "" : '<td class="ui-datepicker-week-col">' + this._get(inst, "calculateWeek")(printDate) + "</td>"); for (var dow = 0; dow < 7; dow++) { var daySettings = (beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); var otherMonth = (printDate.getMonth() != drawMonth); var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || (minDate && printDate < minDate) || (maxDate && printDate > maxDate); tbody += '<td class="' + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (otherMonth ? " ui-datepicker-other-month" : "") + ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ? " " + this._dayOverClass : "") + (unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "") + (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + (printDate.getTime() == currentDate.getTime() ? " " + this._currentClass : "") + (printDate.getTime() == today.getTime() ? " ui-datepicker-today" : "")) + '"' + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : "") + (unselectable ? "" : ' onclick="DP_jQuery_' + dpuuid + ".datepicker._selectDay('#" + inst.id + "'," + printDate.getMonth() + "," + printDate.getFullYear() + ', this);return false;"') + ">" + (otherMonth && !showOtherMonths ? "&#xa0;" : (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + "</span>" : '<a class="ui-state-default' + (printDate.getTime() == today.getTime() ? " ui-state-highlight" : "") + (printDate.getTime() == currentDate.getTime() ? " ui-state-active" : "") + (otherMonth ? " ui-priority-secondary" : "") + '" href="#">' + printDate.getDate() + "</a>")) + "</td>"; printDate.setDate(printDate.getDate() + 1); printDate = this._daylightSavingAdjust(printDate) } calender += tbody + "</tr>" } drawMonth++; if (drawMonth > 11) { drawMonth = 0; drawYear++ } calender += "</tbody></table>" + (isMultiMonth ? "</div>" + ((numMonths[0] > 0 && col == numMonths[1] - 1) ? '<div class="ui-datepicker-row-break"></div>' : "") : ""); group += calender } html += group } html += buttonPanel + ($.browser.msie && parseInt($.browser.version, 10) < 7 && !inst.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ""); inst._keyEvent = false; return html }, _generateMonthYearHeader: function (inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) { var changeMonth = this._get(inst, "changeMonth"); var changeYear = this._get(inst, "changeYear"); var showMonthAfterYear = this._get(inst, "showMonthAfterYear"); var html = '<div class="ui-datepicker-title">'; var monthHtml = ""; if (secondary || !changeMonth) { monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + "</span>" } else { var inMinYear = (minDate && minDate.getFullYear() == drawYear); var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); monthHtml += '<select class="ui-datepicker-month" onchange="DP_jQuery_' + dpuuid + ".datepicker._selectMonthYear('#" + inst.id + "', this, 'M');\" >"; for (var month = 0; month < 12; month++) { if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) { monthHtml += '<option value="' + month + '"' + (month == drawMonth ? ' selected="selected"' : "") + ">" + monthNamesShort[month] + "</option>" } } monthHtml += "</select>" } if (!showMonthAfterYear) { html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") } if (!inst.yearshtml) { inst.yearshtml = ""; if (secondary || !changeYear) { html += '<span class="ui-datepicker-year">' + drawYear + "</span>" } else { var years = this._get(inst, "yearRange").split(":"); var thisYear = new Date().getFullYear(); var determineYear = function (value) { var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10))); return (isNaN(year) ? thisYear : year) }; var year = determineYear(years[0]); var endYear = Math.max(year, determineYear(years[1] || "")); year = (minDate ? Math.max(year, minDate.getFullYear()) : year); endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); inst.yearshtml += '<select class="ui-datepicker-year" onchange="DP_jQuery_' + dpuuid + ".datepicker._selectMonthYear('#" + inst.id + "', this, 'Y');\" >"; for (; year <= endYear; year++) { inst.yearshtml += '<option value="' + year + '"' + (year == drawYear ? ' selected="selected"' : "") + ">" + year + "</option>" } inst.yearshtml += "</select>"; html += inst.yearshtml; inst.yearshtml = null } } html += this._get(inst, "yearSuffix"); if (showMonthAfterYear) { html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml } html += "</div>"; return html }, _adjustInstDate: function (inst, offset, period) { var year = inst.drawYear + (period == "Y" ? offset : 0); var month = inst.drawMonth + (period == "M" ? offset : 0); var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period == "D" ? offset : 0); var date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); if (period == "M" || period == "Y") { this._notifyChange(inst) } }, _restrictMinMax: function (inst, date) { var minDate = this._getMinMaxDate(inst, "min"); var maxDate = this._getMinMaxDate(inst, "max"); var newDate = (minDate && date < minDate ? minDate : date); newDate = (maxDate && newDate > maxDate ? maxDate : newDate); return newDate }, _notifyChange: function (inst) { var onChange = this._get(inst, "onChangeMonthYear"); if (onChange) { onChange.apply((inst.input ? inst.input[0] : null), [inst.selectedYear, inst.selectedMonth + 1, inst]) } }, _getNumberOfMonths: function (inst) { var numMonths = this._get(inst, "numberOfMonths"); return (numMonths == null ? [1, 1] : (typeof numMonths == "number" ? [1, numMonths] : numMonths)) }, _getMinMaxDate: function (inst, minMax) { return this._determineDate(inst, this._get(inst, minMax + "Date"), null) }, _getDaysInMonth: function (year, month) { return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate() }, _getFirstDayOfMonth: function (year, month) { return new Date(year, month, 1).getDay() }, _canAdjustMonth: function (inst, offset, curYear, curMonth) { var numMonths = this._getNumberOfMonths(inst); var date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); if (offset < 0) { date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())) } return this._isInRange(inst, date) }, _isInRange: function (inst, date) { var minDate = this._getMinMaxDate(inst, "min"); var maxDate = this._getMinMaxDate(inst, "max"); return ((!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime())) }, _getFormatConfig: function (inst) { var shortYearCutoff = this._get(inst, "shortYearCutoff"); shortYearCutoff = (typeof shortYearCutoff != "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); return { shortYearCutoff: shortYearCutoff, dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")} }, _formatDate: function (inst, day, month, year) { if (!day) { inst.currentDay = inst.selectedDay; inst.currentMonth = inst.selectedMonth; inst.currentYear = inst.selectedYear } var date = (day ? (typeof day == "object" ? day : this._daylightSavingAdjust(new Date(year, month, day))) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)) } }); function bindHover(dpDiv) { var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return dpDiv.delegate(selector, "mouseout", function () { $(this).removeClass("ui-state-hover"); if (this.className.indexOf("ui-datepicker-prev") != -1) { $(this).removeClass("ui-datepicker-prev-hover") } if (this.className.indexOf("ui-datepicker-next") != -1) { $(this).removeClass("ui-datepicker-next-hover") } }).delegate(selector, "mouseover", function () { if (!$.datepicker._isDisabledDatepicker(instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); $(this).addClass("ui-state-hover"); if (this.className.indexOf("ui-datepicker-prev") != -1) { $(this).addClass("ui-datepicker-prev-hover") } if (this.className.indexOf("ui-datepicker-next") != -1) { $(this).addClass("ui-datepicker-next-hover") } } }) } function extendRemove(target, props) { $.extend(target, props); for (var name in props) { if (props[name] == null || props[name] == undefined) { target[name] = props[name] } } return target } function isArray(a) { return (a && (($.browser.safari && typeof a == "object" && a.length) || (a.constructor && a.constructor.toString().match(/\Array\(\)/)))) } $.fn.datepicker = function (options) { if (!this.length) { return this } if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv); $.datepicker.initialized = true } var otherArgs = Array.prototype.slice.call(arguments, 1); if (typeof options == "string" && (options == "isDisabled" || options == "getDate" || options == "widget")) { return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs)) } if (options == "option" && arguments.length == 2 && typeof arguments[1] == "string") { return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs)) } return this.each(function () { typeof options == "string" ? $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options) }) }; $.datepicker = new Datepicker(); $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); $.datepicker.version = "1.9m6"; window["DP_jQuery_" + dpuuid] = $ })(jQuery); (function (d, e) { var b = "ui-dialog ui-widget ui-widget-content ui-corner-all ", a = { buttons: true, height: true, maxHeight: true, maxWidth: true, minHeight: true, minWidth: true, width: true }, c = { maxHeight: true, maxWidth: true, minHeight: true, minWidth: true }; d.widget("ui.dialog", { version: "1.9m6", options: { autoOpen: true, buttons: {}, closeOnEscape: true, closeText: "close", dialogClass: "", draggable: true, hide: null, height: "auto", maxHeight: false, maxWidth: false, minHeight: 150, minWidth: 150, modal: false, position: { my: "center", at: "center", of: window, collision: "fit", using: function (g) { var f = d(this).css(g).offset().top; if (f < 0) { d(this).css("top", g.top - f) } } }, resizable: true, show: null, stack: true, title: "", width: 300, zIndex: 1000 }, _create: function () { this.originalTitle = this.element.attr("title"); if (typeof this.originalTitle !== "string") { this.originalTitle = "" } this.options.title = this.options.title || this.originalTitle; var n = this, o = n.options, l = o.title || "&#160;", g = d.ui.dialog.getTitleId(n.element), m = (n.uiDialog = d("<div>")).addClass(b + o.dialogClass).css({ display: "none", outline: 0, zIndex: o.zIndex }).attr("tabIndex", -1).keydown(function (p) { if (o.closeOnEscape && !p.isDefaultPrevented() && p.keyCode && p.keyCode === d.ui.keyCode.ESCAPE) { n.close(p); p.preventDefault() } }).attr({ role: "dialog", "aria-labelledby": g }).mousedown(function (p) { n.moveToTop(false, p) }).appendTo("body"), i = n.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(m), h = (n.uiDialogTitlebar = d("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").prependTo(m), k = d("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role", "button").click(function (p) { p.preventDefault(); n.close(p) }).appendTo(h), j = (n.uiDialogTitlebarCloseText = d("<span>")).addClass("ui-icon ui-icon-closethick").text(o.closeText).appendTo(k), f = d("<span>").addClass("ui-dialog-title").attr("id", g).html(l).prependTo(h); h.find("*").add(h).disableSelection(); this._hoverable(k); this._focusable(k); if (o.draggable && d.fn.draggable) { n._makeDraggable() } if (o.resizable && d.fn.resizable) { n._makeResizable() } n._createButtons(o.buttons); n._isOpen = false; if (d.fn.bgiframe) { m.bgiframe() } }, _init: function () { if (this.options.autoOpen) { this.open() } }, _destroy: function () { var f = this; if (f.overlay) { f.overlay.destroy() } f.uiDialog.hide(); f.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); f.uiDialog.remove(); if (f.originalTitle) { f.element.attr("title", f.originalTitle) } }, widget: function () { return this.uiDialog }, close: function (i) { if (!this._isOpen) { return f } var f = this, h, g; if (false === f._trigger("beforeClose", i)) { return } f._isOpen = false; if (f.overlay) { f.overlay.destroy() } f.uiDialog.unbind("keypress.ui-dialog"); if (f.options.hide) { f.uiDialog.hide(f.options.hide, function () { f._trigger("close", i) }) } else { f.uiDialog.hide(); f._trigger("close", i) } d.ui.dialog.overlay.resize(); if (f.options.modal) { h = 0; d(".ui-dialog").each(function () { if (this !== f.uiDialog[0]) { g = d(this).css("z-index"); if (!isNaN(g)) { h = Math.max(h, g) } } }); d.ui.dialog.maxZ = h } return f }, isOpen: function () { return this._isOpen }, moveToTop: function (j, i) { var f = this, h = f.options, g; if ((h.modal && !j) || (!h.stack && !h.modal)) { return f._trigger("focus", i) } if (h.zIndex > d.ui.dialog.maxZ) { d.ui.dialog.maxZ = h.zIndex } if (f.overlay) { d.ui.dialog.maxZ += 1; d.ui.dialog.overlay.maxZ = d.ui.dialog.maxZ; f.overlay.$el.css("z-index", d.ui.dialog.overlay.maxZ) } g = { scrollTop: f.element.scrollTop(), scrollLeft: f.element.scrollLeft() }; d.ui.dialog.maxZ += 1; f.uiDialog.css("z-index", d.ui.dialog.maxZ); f.element.attr(g); f._trigger("focus", i); return f }, open: function () { if (this._isOpen) { return } var g = this, h = g.options, f = g.uiDialog; g._size(); g._position(h.position); f.show(h.show); g.overlay = h.modal ? new d.ui.dialog.overlay(g) : null; g.moveToTop(true); if (h.modal) { f.bind("keydown.ui-dialog", function (l) { if (l.keyCode !== d.ui.keyCode.TAB) { return } var k = d(":tabbable", this), m = k.filter(":first"), j = k.filter(":last"); if (l.target === j[0] && !l.shiftKey) { m.focus(1); return false } else { if (l.target === m[0] && l.shiftKey) { j.focus(1); return false } } }) } var i = g.element.find(":tabbable"); if (!i.length) { i = f.find(".ui-dialog-buttonpane :tabbable"); if (!i.length) { i = f } } i.eq(0).focus(); g._isOpen = true; g._trigger("open"); return g }, _createButtons: function (i) { var h = this, f = false; h.uiDialog.find(".ui-dialog-buttonpane").remove(); if (typeof i === "object" && i !== null) { d.each(i, function () { return !(f = true) }) } if (f) { var g = d("<div>").addClass("ui-dialog-buttonpane  ui-widget-content ui-helper-clearfix"), j = d("<div>").addClass("ui-dialog-buttonset").appendTo(g); d.each(i, function (k, m) { m = d.isFunction(m) ? { click: m, text: k} : m; var l = d("<button type='button'>").attr(m, true).unbind("click").click(function () { m.click.apply(h.element[0], arguments) }).appendTo(j); if (d.fn.button) { l.button() } }); h.uiDialog.addClass("ui-dialog-buttons"); g.appendTo(h.uiDialog) } else { h.uiDialog.removeClass("ui-dialog-buttons") } }, _makeDraggable: function () { var f = this, h = f.options, i = d(document); function g(j) { return { position: j.position, offset: j.offset} } f.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function (j, k) { d(this).addClass("ui-dialog-dragging"); f._trigger("dragStart", j, g(k)) }, drag: function (j, k) { f._trigger("drag", j, g(k)) }, stop: function (j, k) { h.position = [k.position.left - i.scrollLeft(), k.position.top - i.scrollTop()]; d(this).removeClass("ui-dialog-dragging"); f._trigger("dragStop", j, g(k)); d.ui.dialog.overlay.resize() } }) }, _makeResizable: function (k) { k = (k === e ? this.options.resizable : k); var g = this, j = g.options, f = g.uiDialog.css("position"), i = typeof k === "string" ? k : "n,e,s,w,se,sw,ne,nw"; function h(l) { return { originalPosition: l.originalPosition, originalSize: l.originalSize, position: l.position, size: l.size} } g.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: g.element, maxWidth: j.maxWidth, maxHeight: j.maxHeight, minWidth: j.minWidth, minHeight: g._minHeight(), handles: i, start: function (l, m) { d(this).addClass("ui-dialog-resizing"); g._trigger("resizeStart", l, h(m)) }, resize: function (l, m) { g._trigger("resize", l, h(m)) }, stop: function (l, m) { d(this).removeClass("ui-dialog-resizing"); j.height = d(this).height(); j.width = d(this).width(); g._trigger("resizeStop", l, h(m)); d.ui.dialog.overlay.resize() } }).css("position", f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se") }, _minHeight: function () { var f = this.options; if (f.height === "auto") { return f.minHeight } else { return Math.min(f.minHeight, f.height) } }, _position: function (g) { var h = [], i = [0, 0], f; if (g) { if (typeof g === "string" || (typeof g === "object" && "0" in g)) { h = g.split ? g.split(" ") : [g[0], g[1]]; if (h.length === 1) { h[1] = h[0] } d.each(["left", "top"], function (k, j) { if (+h[k] === h[k]) { i[k] = h[k]; h[k] = j } }); g = { my: h.join(" "), at: h.join(" "), offset: i.join(" ")} } g = d.extend({}, d.ui.dialog.prototype.options.position, g) } else { g = d.ui.dialog.prototype.options.position } f = this.uiDialog.is(":visible"); if (!f) { this.uiDialog.show() } this.uiDialog.position(g); if (!f) { this.uiDialog.hide() } }, _setOptions: function (i) { var g = this, f = {}, h = false; d.each(i, function (j, k) { g._setOption(j, k); if (j in a) { h = true } if (j in c) { f[j] = k } }); if (h) { this._size() } if (this.uiDialog.is(":data(resizable)")) { this.uiDialog.resizable("option", f) } }, _setOption: function (i, j) { var g = this, f = g.uiDialog; switch (i) { case "buttons": g._createButtons(j); break; case "closeText": g.uiDialogTitlebarCloseText.text("" + j); break; case "dialogClass": f.removeClass(g.options.dialogClass).addClass(b + j); break; case "disabled": if (j) { f.addClass("ui-dialog-disabled") } else { f.removeClass("ui-dialog-disabled") } break; case "draggable": var h = f.is(":data(draggable)"); if (h && !j) { f.draggable("destroy") } if (!h && j) { g._makeDraggable() } break; case "position": g._position(j); break; case "resizable": var k = f.is(":data(resizable)"); if (k && !j) { f.resizable("destroy") } if (k && typeof j === "string") { f.resizable("option", "handles", j) } if (!k && j !== false) { g._makeResizable(j) } break; case "title": d(".ui-dialog-title", g.uiDialogTitlebar).html("" + (j || "&#160;")); break } this._super("_setOption", i, j) }, _size: function () { var j = this.options, g, i, f = this.uiDialog.is(":visible"); this.element.show().css({ width: "auto", minHeight: 0, height: 0 }); if (j.minWidth > j.width) { j.width = j.minWidth } g = this.uiDialog.css({ height: "auto", width: j.width }).height(); i = Math.max(0, j.minHeight - g); if (j.height === "auto") { if (d.support.minHeight) { this.element.css({ minHeight: i, height: "auto" }) } else { this.uiDialog.show(); var h = this.element.css("height", "auto").height(); if (!f) { this.uiDialog.hide() } this.element.height(Math.max(h, i)) } } else { this.element.height(Math.max(j.height - g, 0)) } if (this.uiDialog.is(":data(resizable)")) { this.uiDialog.resizable("option", "minHeight", this._minHeight()) } } }); d.extend(d.ui.dialog, { uuid: 0, maxZ: 0, getTitleId: function (f) { var g = f.attr("id"); if (!g) { this.uuid += 1; g = this.uuid } return "ui-dialog-title-" + g }, overlay: function (f) { this.$el = d.ui.dialog.overlay.create(f) } }); d.extend(d.ui.dialog.overlay, { instances: [], oldInstances: [], maxZ: 0, events: d.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function (f) { return f + ".dialog-overlay" }).join(" "), create: function (g) { if (this.instances.length === 0) { setTimeout(function () { if (d.ui.dialog.overlay.instances.length) { d(document).bind(d.ui.dialog.overlay.events, function (h) { if (d(h.target).zIndex() < d.ui.dialog.overlay.maxZ) { return false } }) } }, 1); d(document).bind("keydown.dialog-overlay", function (h) { if (g.options.closeOnEscape && !h.isDefaultPrevented() && h.keyCode && h.keyCode === d.ui.keyCode.ESCAPE) { g.close(h); h.preventDefault() } }); d(window).bind("resize.dialog-overlay", d.ui.dialog.overlay.resize) } var f = (this.oldInstances.pop() || d("<div>").addClass("ui-widget-overlay")).appendTo(document.body).css({ width: this.width(), height: this.height() }); if (d.fn.bgiframe) { f.bgiframe() } this.instances.push(f); return f }, destroy: function (f) { var g = d.inArray(f, this.instances); if (g !== -1) { this.oldInstances.push(this.instances.splice(g, 1)[0]) } if (this.instances.length === 0) { d([document, window]).unbind(".dialog-overlay") } f.height(0).width(0).remove(); var h = 0; d.each(this.instances, function () { h = Math.max(h, this.css("z-index")) }); this.maxZ = h }, height: function () { var g, f; if (d.browser.msie) { g = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); f = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); if (g < f) { return d(window).height() + "px" } else { return g + "px" } } else { return d(document).height() + "px" } }, width: function () { var f, g; if (d.browser.msie) { f = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); g = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if (f < g) { return d(window).width() + "px" } else { return f + "px" } } else { return d(document).width() + "px" } }, resize: function () { var f = d([]); d.each(d.ui.dialog.overlay.instances, function () { f = f.add(this) }); f.css({ width: 0, height: 0 }).css({ width: d.ui.dialog.overlay.width(), height: d.ui.dialog.overlay.height() }) } }); d.extend(d.ui.dialog.overlay.prototype, { destroy: function () { d.ui.dialog.overlay.destroy(this.$el) } }) } (jQuery)); (function (b) { var a = 0; b.widget("ui.menu", { version: "1.9m6", defaultElement: "<ul>", delay: 150, options: { position: { my: "left top", at: "right top"} }, _create: function () { this.activeMenu = this.element; this.menuId = this.element.attr("id") || "ui-menu-" + a++; if (this.element.find(".ui-icon").length) { this.element.addClass("ui-menu-icons") } this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({ id: this.menuId, role: "menu" }).bind("click.menu", b.proxy(function (c) { if (this.options.disabled) { c.preventDefault() } }, this)); this._bind({ "click .ui-menu-item:has(a)": function (c) { c.stopImmediatePropagation(); var d = b(c.currentTarget); if (!this.active || (this.active[0] !== d[0])) { this.focus(c, d) } this.select(c) }, "mouseover .ui-menu-item": function (c) { c.stopImmediatePropagation(); var d = b(c.currentTarget); d.siblings().children(".ui-state-active").removeClass("ui-state-active"); this.focus(c, d) }, mouseleave: "_mouseleave", "mouseleave .ui-menu": "_mouseleave", "mouseout .ui-menu-item": "blur", focus: function (c) { this.focus(c, b(c.target).children(".ui-menu-item:first")) }, blur: "collapseAll" }); this.refresh(); this.element.attr("tabIndex", 0); this._bind({ keydown: function (g) { switch (g.keyCode) { case b.ui.keyCode.PAGE_UP: this.previousPage(g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.PAGE_DOWN: this.nextPage(g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.HOME: this._move("first", "first", g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.END: this._move("last", "last", g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.UP: this.previous(g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.DOWN: this.next(g); g.preventDefault(); g.stopImmediatePropagation(); break; case b.ui.keyCode.LEFT: if (this.collapse(g)) { g.stopImmediatePropagation() } g.preventDefault(); break; case b.ui.keyCode.RIGHT: if (this.expand(g)) { g.stopImmediatePropagation() } g.preventDefault(); break; case b.ui.keyCode.ENTER: if (this.active.children("a[aria-haspopup='true']").length) { if (this.expand(g)) { g.stopImmediatePropagation() } } else { this.select(g); g.stopImmediatePropagation() } g.preventDefault(); break; case b.ui.keyCode.ESCAPE: if (this.collapse(g)) { g.stopImmediatePropagation() } g.preventDefault(); break; default: g.stopPropagation(); clearTimeout(this.filterTimer); var c, f = this.previousFilter || "", h = String.fromCharCode(g.keyCode), e = false; if (h == f) { e = true } else { h = f + h } function d(i) { return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } c = this.activeMenu.children(".ui-menu-item").filter(function () { return new RegExp("^" + d(h), "i").test(b(this).children("a").text()) }); c = e && c.index(this.active.next()) != -1 ? this.active.nextAll(".ui-menu-item") : c; if (!c.length) { h = String.fromCharCode(g.keyCode); c = this.activeMenu.children(".ui-menu-item").filter(function () { return new RegExp("^" + d(h), "i").test(b(this).children("a").text()) }) } if (c.length) { this.focus(g, c); if (c.length > 1) { this.previousFilter = h; this.filterTimer = this._delay(function () { delete this.previousFilter }, 1000) } else { delete this.previousFilter } } else { delete this.previousFilter } } } }); this._bind(document, { click: function (c) { if (!b(c.target).closest(".ui-menu").length) { this.collapseAll(c) } } }) }, _destroy: function () { this.element.removeAttr("aria-activedescendant").find("ul").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").show(); this.element.find(".ui-menu-item").unbind(".menu").removeClass("ui-menu-item").removeAttr("role").children("a").removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").removeAttr("id").children(".ui-icon").remove() }, refresh: function () { var c = this.element.find("ul:not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr("role", "menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false"); var d = this.menuId; c.add(this.element).children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "presentation").children("a").addClass("ui-corner-all").attr("tabIndex", -1).attr("role", "menuitem").attr("id", function (e) { return d + "-" + e }); c.each(function () { var f = b(this), e = f.prev("a"); e.attr("aria-haspopup", "true").prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>'); f.attr("aria-labelledby", e.attr("id")) }) }, focus: function (c, j) { this.blur(c); if (this._hasScroll()) { var e = parseFloat(b.curCSS(this.activeMenu[0], "borderTopWidth", true)) || 0, k = parseFloat(b.curCSS(this.activeMenu[0], "paddingTop", true)) || 0, f = j.offset().top - this.activeMenu.offset().top - e - k, i = this.activeMenu.scrollTop(), g = this.activeMenu.height(), d = j.height(); if (f < 0) { this.activeMenu.scrollTop(i + f) } else { if (f + d > g) { this.activeMenu.scrollTop(i + f - g + d) } } } this.active = j.first().children("a").addClass("ui-state-focus").end(); this.element.attr("aria-activedescendant", this.active.children("a").attr("id")); this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"); this.timer = this._delay(function () { this._close() }, this.delay); var h = b(">ul", j); if (h.length && (/^mouse/.test(c.type))) { this._startOpening(h) } this.activeMenu = j.parent(); this._trigger("focus", c, { item: j }) }, blur: function (c) { if (!this.active) { return } clearTimeout(this.timer); this.active.children("a").removeClass("ui-state-focus"); this.active = null; this._trigger("blur", c, { item: this.active }) }, _startOpening: function (c) { clearTimeout(this.timer); if (c.attr("aria-hidden") !== "true") { return } this.timer = this._delay(function () { this._close(); this._open(c) }, this.delay) }, _open: function (d) { clearTimeout(this.timer); this.element.find(".ui-menu").not(d.parents()).hide().attr("aria-hidden", "true"); var c = b.extend({}, { of: this.active }, b.type(this.options.position) == "function" ? this.options.position(this.active) : this.options.position); d.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(c) }, collapseAll: function (c) { var d = false; if (c) { var e = b(c.target); if (e.is("ui.menu")) { d = e } else { if (e.closest(".ui-menu").length) { d = e.closest(".ui-menu") } } } this._close(d); if (!d) { this.blur(c); this.activeMenu = this.element } }, _close: function (c) { if (!c) { c = this.active ? this.active.parent() : this.element } c.find("ul").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find("a.ui-state-active").removeClass("ui-state-active") }, collapse: function (d) { var c = this.active && this.active.parents("li:not(.ui-menubar-item)").first(); if (c && c.length) { this._close(); this.focus(d, c); return true } }, expand: function (d) { var c = this.active && this.active.children("ul").children("li").first(); if (c && c.length) { this._open(c.parent()); this._delay(function () { this.focus(d, c) }, 20); return true } }, next: function (c) { this._move("next", "first", c) }, previous: function (c) { this._move("prev", "last", c) }, first: function () { return this.active && !this.active.prevAll(".ui-menu-item").length }, last: function () { return this.active && !this.active.nextAll(".ui-menu-item").length }, _move: function (f, d, e) { if (!this.active) { this.focus(e, this.activeMenu.children(".ui-menu-item")[d]()); return } var c; if (f === "first" || f === "last") { c = this.active[f === "first" ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) } else { c = this.active[f + "All"](".ui-menu-item").eq(0) } if (c.length) { this.focus(e, c) } else { this.focus(e, this.activeMenu.children(".ui-menu-item")[d]()) } }, nextPage: function (e) { if (this._hasScroll()) { if (!this.active) { this.focus(e, this.activeMenu.children(".ui-menu-item").first()); return } if (this.last()) { return } var f = this.active.offset().top, d = this.element.height(), c; this.active.nextAll(".ui-menu-item").each(function () { c = b(this); return b(this).offset().top - f - d < 0 }); this.focus(e, c) } else { this.focus(e, this.activeMenu.children(".ui-menu-item")[!this.active ? "first" : "last"]()) } }, previousPage: function (e) { if (this._hasScroll()) { if (!this.active) { this.focus(e, this.activeMenu.children(".ui-menu-item").first()); return } if (this.first()) { return } var f = this.active.offset().top, d = this.element.height(), c; this.active.prevAll(".ui-menu-item").each(function () { c = b(this); return b(this).offset().top - f + d > 0 }); this.focus(e, c) } else { this.focus(e, this.activeMenu.children(".ui-menu-item").first()) } }, _hasScroll: function () { return this.element.height() < this.element.prop("scrollHeight") }, _mouseleave: function (c) { this.collapseAll(c); this.blur() }, select: function (c) { var d = { item: this.active }; this.collapseAll(c); this._trigger("select", c, d) } }) } (jQuery)); (function (a) { a.widget("ui.menubar", { version: "1.9m6", options: { autoExpand: false, buttons: false, menuIcon: false, position: { my: "left top", at: "left bottom"} }, _create: function () { var c = this; var b = this.items = this.element.children("li").addClass("ui-menubar-item").attr("role", "presentation").children("button, a"); b.slice(1).attr("tabIndex", -1); this.element.addClass("ui-menubar ui-widget-header ui-helper-clearfix").attr("role", "menubar"); this._focusable(b); this._hoverable(b); b.next("ul").menu({ position: { within: this.options.position.within }, select: function (d, e) { e.item.parents("ul.ui-menu:last").hide(); c._close(); a(d.target).prev().focus(); c._trigger("select", d, e) } }).hide().attr({ "aria-hidden": "true", "aria-expanded": "false" }).bind("keydown.menubar", function (d) { var e = a(this); if (e.is(":hidden")) { return } switch (d.keyCode) { case a.ui.keyCode.LEFT: c._left(d); d.preventDefault(); break; case a.ui.keyCode.RIGHT: c._right(d); d.preventDefault(); break } }); b.each(function () { var d = a(this), e = d.next("ul"); d.bind("click.menubar focus.menubar mouseenter.menubar", function (f) { if (f.type == "focus" && !f.originalEvent) { return } f.preventDefault(); if (f.type == "click" && e.is(":visible") && c.active && c.active[0] == e[0]) { c._close(); return } if ((c.open && f.type == "mouseenter") || f.type == "click" || c.options.autoExpand) { if (c.options.autoExpand) { clearTimeout(c.timer) } if (e.length >= 1) { c._open(f, e) } else { if (f.type == "click") { c._close(); window.location.href = d.attr("href"); return } else { c._close(); return } } } }).bind("keydown", function (f) { switch (f.keyCode) { case a.ui.keyCode.SPACE: case a.ui.keyCode.UP: case a.ui.keyCode.DOWN: c._open(f, a(this).next()); f.preventDefault(); break; case a.ui.keyCode.LEFT: c._prev(f, a(this)); f.preventDefault(); break; case a.ui.keyCode.RIGHT: c._next(f, a(this)); f.preventDefault(); break } }).addClass("ui-button ui-widget ui-button-text-only ui-menubar-link").attr("role", "menuitem").attr("aria-haspopup", "true").wrapInner("<span class='ui-button-text'></span>"); if (c.options.autoExpand) { d.bind("mouseleave.menubar", function (f) { c.timer = setTimeout(function () { c._close() }, 150) }); e.bind("mouseleave.menubar", function (f) { c.timer = setTimeout(function () { c._close() }, 150) }).bind("mouseenter.menubar", function (f) { clearTimeout(c.timer) }) } if (c.options.menuIcon) { d.addClass("ui-state-default").append("<span class='ui-button-icon-secondary ui-icon ui-icon-triangle-1-s'></span>"); d.removeClass("ui-button-text-only").addClass("ui-button-text-icon-secondary") } if (!c.options.buttons) { d.addClass("ui-menubar-link").removeClass("ui-state-default") } }); c._bind({ keydown: function (d) { if (d.keyCode == a.ui.keyCode.ESCAPE && c.active && c.active.menu("collapse", d) !== true) { var e = c.active; c.active.blur(); c._close(d); e.prev().focus() } }, focusin: function (d) { clearTimeout(c.closeTimer) }, focusout: function (d) { c.closeTimer = setTimeout(function () { c._close(d) }, 100) } }) }, _destroy: function () { var b = this.element.children("li").removeClass("ui-menubar-item").removeAttr("role").children("button, a"); this.element.removeClass("ui-menubar ui-widget-header ui-helper-clearfix").removeAttr("role").unbind(".menubar"); b.unbind(".menubar").removeClass("ui-button ui-widget ui-button-text-only ui-menubar-link ui-state-default").removeAttr("role").removeAttr("aria-haspopup").children("span.ui-button-text").each(function (c, f) { var d = a(this); d.parent().html(d.html()) }).end().children(".ui-icon").remove(); this.element.find(":ui-menu").menu("destroy").show().removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("tabindex").unbind(".menubar") }, _close: function () { if (!this.active || !this.active.length) { return } this.active.menu("collapseAll").hide().attr({ "aria-hidden": "true", "aria-expanded": "false" }); this.active.prev().removeClass("ui-state-active").removeAttr("tabIndex"); this.active = null; this.open = false }, _open: function (c, d) { if (this.active && this.active[0] == d[0]) { return } if (this.active) { this.active.menu("collapseAll").hide().attr({ "aria-hidden": "true", "aria-expanded": "false" }); this.active.prev().removeClass("ui-state-active") } var b = d.prev().addClass("ui-state-active").attr("tabIndex", -1); this.active = d.show().position(a.extend({ of: b }, this.options.position)).removeAttr("aria-hidden").attr("aria-expanded", "true").menu("focus", c, d.children("li").first()).focus().focusin(); this.open = true }, _prev: function (e, b) { b.attr("tabIndex", -1); var d = b.parent().prevAll("li").children(".ui-button").eq(0); if (d.length) { d.removeAttr("tabIndex")[0].focus() } else { var c = this.element.children("li:last").children(".ui-button:last"); c.removeAttr("tabIndex")[0].focus() } }, _next: function (d, b) { b.attr("tabIndex", -1); var c = b.parent().nextAll("li").children(".ui-button").eq(0); if (c.length) { c.removeAttr("tabIndex")[0].focus() } else { var e = this.element.children("li:first").children(".ui-button:first"); e.removeAttr("tabIndex")[0].focus() } }, _left: function (d) { var c = this.active.parent().prevAll("li:eq(0)").children(".ui-menu").eq(0); if (c.length) { this._open(d, c) } else { var b = this.element.children("li:last").children(".ui-menu:first"); this._open(d, b) } }, _right: function (c) { var b = this.active.parent().nextAll("li:eq(0)").children(".ui-menu").eq(0); if (b.length) { this._open(c, b) } else { var d = this.element.children("li:first").children(".ui-menu:first"); this._open(c, d) } } }) } (jQuery)); (function (b) { var a = 0; b.widget("ui.popup", { version: "1.9m6", options: { position: { my: "left top", at: "left bottom"} }, _create: function () { if (!this.options.trigger) { this.options.trigger = this.element.prev() } if (!this.element.attr("id")) { this.element.attr("id", "ui-popup-" + a++); this.generatedId = true } if (!this.element.attr("role")) { this.element.attr("role", "dialog"); this.generatedRole = true } this.options.trigger.attr("aria-haspopup", "true").attr("aria-owns", this.element.attr("id")); this.element.addClass("ui-popup"); this.close(); this._bind(this.options.trigger, { keydown: function (c) { if (b.ui.button && this.options.trigger.is("a:ui-button") && c.keyCode == b.ui.keyCode.SPACE) { c.preventDefault() } if (c.keyCode == b.ui.keyCode.SPACE && this.options.trigger.is("a:not(:ui-button)")) { this.options.trigger.trigger("click", c) } if (c.keyCode == b.ui.keyCode.DOWN) { c.preventDefault(); this.options.trigger.trigger("click", c) } }, click: function (c) { c.preventDefault(); if (this.isOpen) { return } clearTimeout(this.closeTimer); this._delay(function () { this.open(c) }, 1) } }); if (!this.element.is(":ui-menu")) { this._bind({ keydown: function (e) { if (e.keyCode !== b.ui.keyCode.TAB) { return } var d = b(":tabbable", this.element), f = d.first(), c = d.last(); if (e.target === c[0] && !e.shiftKey) { f.focus(1); e.preventDefault() } else { if (e.target === f[0] && e.shiftKey) { c.focus(1); e.preventDefault() } } } }) } this._bind({ focusout: function (c) { this.closeTimer = this._delay(function () { this.close(c) }, 100) }, focusin: function (c) { clearTimeout(this.closeTimer) } }); this._bind({ keyup: function (c) { if (c.keyCode == b.ui.keyCode.ESCAPE && this.element.is(":visible")) { this.close(c); this.options.trigger.focus() } } }); this._bind(document, { click: function (c) { if (this.isOpen && !b(c.target).closest(".ui-popup").length) { this.close(c) } } }) }, _destroy: function () { this.element.show().removeClass("ui-popup").removeAttr("aria-hidden").removeAttr("aria-expanded").unbind("keypress.ui-popup"); this.options.trigger.removeAttr("aria-haspopup").removeAttr("aria-owns"); if (this.generatedId) { this.element.removeAttr("id") } if (this.generatedRole) { this.element.removeAttr("role") } }, open: function (e) { var c = b.extend({}, { of: this.options.trigger }, this.options.position); this.element.show().attr("aria-hidden", "false").attr("aria-expanded", "true").position(c); if (this.element.is(":ui-menu")) { this.element.menu("focus", e, this.element.children("li").first()); this.element.focus() } else { var d = this.element.find(":tabbable"); this.removeTabIndex = false; if (!d.length) { if (!this.element.is(":tabbable")) { this.element.attr("tabindex", "0"); this.removeTabIndex = true } d = d.add(this.element[0]) } d.first().focus(1) } this.options.trigger.attr("tabindex", -1); this.isOpen = true; this._trigger("open", e) }, close: function (c) { this.element.hide().attr("aria-hidden", "true").attr("aria-expanded", "false"); this.options.trigger.attr("tabindex", 0); if (this.removeTabIndex) { this.element.removeAttr("tabindex") } this.isOpen = false; this._trigger("close", c) } }) } (jQuery)); (function (f, c) { f.ui = f.ui || {}; var e = /left|center|right/, h = /top|center|bottom/, b = /[+-]\d+%?/, i = /^\w+/, d = /%$/, a = "center", g = f.fn.position; f.position = { scrollbarWidth: function () { var k, j, m = f("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), l = m.children()[0]; f("body").append(m); k = l.offsetWidth; m.css("overflow", "scroll"); j = l.offsetWidth; if (k === j) { j = m[0].clientWidth } m.remove(); return k - j }, getScrollInfo: function (l) { var n = l[0] !== window, k = n ? l.css("overflow-x") : "", j = n ? l.css("overflow-y") : "", m = k === "auto" || k === "scroll" ? f.position.scrollbarWidth() : 0, o = j === "auto" || j === "scroll" ? f.position.scrollbarWidth() : 0; return { height: l.height() < l[0].scrollHeight ? o : 0, width: l.width() < l[0].scrollWidth ? m : 0} } }; f.fn.position = function (r) { if (!r || !r.of) { return g.apply(this, arguments) } r = f.extend({}, r); var n = f(r.of), k = f(r.within || window), o = n[0], q = (r.collision || "flip").split(" "), j = {}, s, p, m, l; if (o.nodeType === 9) { p = n.width(); m = n.height(); l = { top: 0, left: 0} } else { if (f.isWindow(o)) { p = n.width(); m = n.height(); l = { top: n.scrollTop(), left: n.scrollLeft()} } else { if (o.preventDefault) { r.at = "left top"; p = m = 0; l = { top: r.of.pageY, left: r.of.pageX} } else { p = n.outerWidth(); m = n.outerHeight(); l = n.offset() } } } f.each(["my", "at"], function () { var v = (r[this] || "").split(" "), u, t; if (v.length === 1) { v = e.test(v[0]) ? v.concat([a]) : h.test(v[0]) ? [a].concat(v) : [a, a] } v[0] = e.test(v[0]) ? v[0] : a; v[1] = h.test(v[1]) ? v[1] : a; u = b.exec(v[0]); t = b.exec(v[1]); j[this] = [u ? u[0] : 0, t ? t[0] : 0]; r[this] = [i.exec(v[0])[0], i.exec(v[1])[0]] }); if (q.length === 1) { q[1] = q[0] } if (r.at[0] === "right") { l.left += p } else { if (r.at[0] === a) { l.left += p / 2 } } if (r.at[1] === "bottom") { l.top += m } else { if (r.at[1] === a) { l.top += m / 2 } } s = [parseInt(j.at[0], 10) * (d.test(j.at[0]) ? p / 100 : 1), parseInt(j.at[1], 10) * (d.test(j.at[1]) ? m / 100 : 1)]; l.left += s[0]; l.top += s[1]; return this.each(function () { var x = f(this), z = x.outerWidth(), v = x.outerHeight(), y = parseInt(f.curCSS(this, "marginLeft", true)) || 0, u = parseInt(f.curCSS(this, "marginTop", true)) || 0, w = f.position.getScrollInfo(k), C = z + y + (parseInt(f.curCSS(this, "marginRight", true)) || 0) + w.width, D = v + u + (parseInt(f.curCSS(this, "marginBottom", true)) || 0) + w.height, A = f.extend({}, l), B = [parseInt(j.my[0], 10) * (d.test(j.my[0]) ? x.outerWidth() / 100 : 1), parseInt(j.my[1], 10) * (d.test(j.my[1]) ? x.outerHeight() / 100 : 1)], t; if (r.my[0] === "right") { A.left -= z } else { if (r.my[0] === a) { A.left -= z / 2 } } if (r.my[1] === "bottom") { A.top -= v } else { if (r.my[1] === a) { A.top -= v / 2 } } A.left += B[0]; A.top += B[1]; t = { marginLeft: y, marginTop: u }; f.each(["left", "top"], function (F, E) { if (f.ui.position[q[F]]) { f.ui.position[q[F]][E](A, { targetWidth: p, targetHeight: m, elemWidth: z, elemHeight: v, collisionPosition: t, collisionWidth: C, collisionHeight: D, offset: [s[0] + B[0], s[1] + B[1]], my: r.my, at: r.at, within: k, elem: x }) } }); if (f.fn.bgiframe) { x.bgiframe() } x.offset(f.extend(A, { using: r.using })) }) }; f.ui.position = { fit: { left: function (o, n) { var m = n.within, q = f(window), l = f.isWindow(n.within[0]), s = l ? q.scrollLeft() : m.offset().left, u = l ? q.width() : m.outerWidth(), p = o.left - n.collisionPosition.marginLeft, t = s - p, k = p + n.collisionWidth - u - s, j, r; if (n.collisionWidth > u) { if (t > 0 && k <= 0) { j = o.left + t + n.collisionWidth - u - s; o.left += t - j } else { if (k > 0 && t <= 0) { o.left = s } else { if (t > k) { o.left = s + u - n.collisionWidth } else { o.left = s } } } } else { if (t > 0) { o.left += t } else { if (k > 0) { o.left -= k } else { o.left = Math.max(o.left - p, o.left) } } } }, top: function (n, m) { var l = m.within, q = f(window), k = f.isWindow(m.within[0]), t = k ? q.scrollTop() : l.offset().top, u = k ? q.height() : l.outerHeight(), p = n.top - m.collisionPosition.marginTop, r = t - p, o = p + m.collisionHeight - u - t, s, j; if (m.collisionHeight > u) { if (r > 0 && o <= 0) { j = n.top + r + m.collisionHeight - u - t; n.top += r - j } else { if (o > 0 && r <= 0) { n.top = t } else { if (r > o) { n.top = t + u - m.collisionHeight } else { n.top = t } } } } else { if (r > 0) { n.top += r } else { if (o > 0) { n.top -= o } else { n.top = Math.max(n.top - p, n.top) } } } } }, flip: { left: function (q, p) { if (p.at[0] === a) { return } p.elem.removeClass("ui-flipped-left ui-flipped-right"); var o = p.within, s = f(window), l = f.isWindow(p.within[0]), v = (l ? 0 : o.offset().left) + o.scrollLeft(), y = l ? o.width() : o.outerWidth(), r = q.left - p.collisionPosition.marginLeft, w = r - v, k = r + p.collisionWidth - y - v, m = p.my[0] === "left", u = p.my[0] === "left" ? -p.elemWidth : p.my[0] === "right" ? p.elemWidth : 0, x = p.at[0] === "left" ? p.targetWidth : -p.targetWidth, n = -2 * p.offset[0], j, t; if (w < 0) { j = q.left + u + x + n + p.collisionWidth - y - v; if (j < 0 || j < Math.abs(w)) { p.elem.addClass("ui-flipped-right"); q.left += u + x + n } } else { if (k > 0) { t = q.left - p.collisionPosition.marginLeft + u + x + n - v; if (t > 0 || Math.abs(t) < k) { p.elem.addClass("ui-flipped-left"); q.left += u + x + n } } } }, top: function (o, n) { if (n.at[1] === a) { return } n.elem.removeClass("ui-flipped-top ui-flipped-bottom"); var m = n.within, r = f(window), k = f.isWindow(n.within[0]), w = (k ? 0 : m.offset().top) + m.scrollTop(), x = k ? m.height() : m.outerHeight(), q = o.top - n.collisionPosition.marginTop, t = q - w, p = q + n.collisionHeight - x - w, u = n.my[1] === "top", s = u ? -n.elemHeight : n.my[1] === "bottom" ? n.elemHeight : 0, y = n.at[1] === "top" ? n.targetHeight : -n.targetHeight, l = -2 * n.offset[1], v, j; if (t < 0) { j = o.top + s + y + l + n.collisionHeight - x - w; if (j < 0 || j < Math.abs(t)) { n.elem.addClass("ui-flipped-bottom"); o.top += s + y + l } } else { if (p > 0) { v = o.top - n.collisionPosition.marginTop + s + y + l - w; if (v > 0 || Math.abs(v) < p) { n.elem.addClass("ui-flipped-top"); o.top += s + y + l } } } } }, flipfit: { left: function () { f.ui.position.flip.left.apply(this, arguments); f.ui.position.fit.left.apply(this, arguments) }, top: function () { f.ui.position.flip.top.apply(this, arguments); f.ui.position.fit.top.apply(this, arguments) } } }; if (f.uiBackCompat !== false) { (function (k) { var j = k.fn.position; k.fn.position = function (m) { if (!m || !m.offset) { return j.call(this, m) } var n = m.offset.split(" "), l = m.at.split(" "); if (n.length === 1) { n[1] = n[0] } if (/^\d/.test(n[0])) { n[0] = "+" + n[0] } if (/^\d/.test(n[1])) { n[1] = "+" + n[1] } if (l.length === 1) { if (/left|center|right/.test(l[0])) { l[1] = "center" } else { l[1] = l[0]; l[0] = "center" } } return j.call(this, k.extend(m, { at: l[0] + n[0] + " " + l[1] + n[1], offset: c })) } } (jQuery)) } } (jQuery)); (function (a, b) { a.widget("ui.progressbar", { version: "1.9m6", options: { value: 0, max: 100 }, min: 0, _create: function () { this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({ role: "progressbar", "aria-valuemin": this.min, "aria-valuemax": this.options.max, "aria-valuenow": this._value() }); this.valueDiv = a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element); this.oldValue = this._value(); this._refreshValue() }, _destroy: function () { this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); this.valueDiv.remove() }, value: function (c) { if (c === b) { return this._value() } this._setOption("value", c); return this }, _setOption: function (c, d) { if (c === "value") { this.options.value = d; this._refreshValue(); if (this._value() === this.options.max) { this._trigger("complete") } } this._super("_setOption", c, d) }, _value: function () { var c = this.options.value; if (typeof c !== "number") { c = 0 } return Math.min(this.options.max, Math.max(this.min, c)) }, _percentage: function () { return 100 * this._value() / this.options.max }, _refreshValue: function () { var d = this.value(); var c = this._percentage(); if (this.oldValue !== d) { this.oldValue = d; this._trigger("change") } this.valueDiv.toggle(d > this.min).toggleClass("ui-corner-right", d === this.options.max).width(c.toFixed(0) + "%"); this.element.attr("aria-valuenow", d) } }) })(jQuery); (function (b, c) { var a = 5; b.widget("ui.slider", b.ui.mouse, { version: "1.9m6", widgetEventPrefix: "slide", options: { animate: false, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null }, _create: function () { var e = this, k = this.options, j = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"), h = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", d = (k.values && k.values.length) || 1, g = []; this._keySliding = false; this._mouseSliding = false; this._animateOff = true; this._handleIndex = null; this._detectOrientation(); this._mouseInit(); this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget ui-widget-content ui-corner-all" + (k.disabled ? " ui-slider-disabled ui-disabled" : "")); this.range = b([]); if (k.range) { if (k.range === true) { if (!k.values) { k.values = [this._valueMin(), this._valueMin()] } if (k.values.length && k.values.length !== 2) { k.values = [k.values[0], k.values[0]] } } this.range = b("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header" + ((k.range === "min" || k.range === "max") ? " ui-slider-range-" + k.range : "")) } for (var f = j.length; f < d; f += 1) { g.push(h) } this.handles = j.add(b(g.join("")).appendTo(e.element)); this.handle = this.handles.eq(0); this.handles.add(this.range).filter("a").click(function (i) { i.preventDefault() }).hover(function () { if (!k.disabled) { b(this).addClass("ui-state-hover") } }, function () { b(this).removeClass("ui-state-hover") }).focus(function () { if (!k.disabled) { b(".ui-slider .ui-state-focus").removeClass("ui-state-focus"); b(this).addClass("ui-state-focus") } else { b(this).blur() } }).blur(function () { b(this).removeClass("ui-state-focus") }); this.handles.each(function (l) { b(this).data("index.ui-slider-handle", l) }); this.handles.keydown(function (p) { var m = true, l = b(this).data("index.ui-slider-handle"), q, n, i, o; if (e.options.disabled) { return } switch (p.keyCode) { case b.ui.keyCode.HOME: case b.ui.keyCode.END: case b.ui.keyCode.PAGE_UP: case b.ui.keyCode.PAGE_DOWN: case b.ui.keyCode.UP: case b.ui.keyCode.RIGHT: case b.ui.keyCode.DOWN: case b.ui.keyCode.LEFT: m = false; if (!e._keySliding) { e._keySliding = true; b(this).addClass("ui-state-active"); q = e._start(p, l); if (q === false) { return } } break } o = e.options.step; if (e.options.values && e.options.values.length) { n = i = e.values(l) } else { n = i = e.value() } switch (p.keyCode) { case b.ui.keyCode.HOME: i = e._valueMin(); break; case b.ui.keyCode.END: i = e._valueMax(); break; case b.ui.keyCode.PAGE_UP: i = e._trimAlignValue(n + ((e._valueMax() - e._valueMin()) / a)); break; case b.ui.keyCode.PAGE_DOWN: i = e._trimAlignValue(n - ((e._valueMax() - e._valueMin()) / a)); break; case b.ui.keyCode.UP: case b.ui.keyCode.RIGHT: if (n === e._valueMax()) { return } i = e._trimAlignValue(n + o); break; case b.ui.keyCode.DOWN: case b.ui.keyCode.LEFT: if (n === e._valueMin()) { return } i = e._trimAlignValue(n - o); break } e._slide(p, l, i); return m }).keyup(function (l) { var i = b(this).data("index.ui-slider-handle"); if (e._keySliding) { e._keySliding = false; e._stop(l, i); e._change(l, i); b(this).removeClass("ui-state-active") } }); this._refreshValue(); this._animateOff = false }, destroy: function () { this.handles.remove(); this.range.remove(); this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); this._mouseDestroy(); return this }, _mouseCapture: function (f) { var g = this.options, j, l, e, h, n, k, m, i, d; if (g.disabled) { return false } this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); j = { x: f.pageX, y: f.pageY }; l = this._normValueFromMouse(j); e = this._valueMax() - this._valueMin() + 1; n = this; this.handles.each(function (o) { var p = Math.abs(l - n.values(o)); if (e > p) { e = p; h = b(this); k = o } }); if (g.range === true && this.values(1) === g.min) { k += 1; h = b(this.handles[k]) } m = this._start(f, k); if (m === false) { return false } this._mouseSliding = true; n._handleIndex = k; h.addClass("ui-state-active").focus(); i = h.offset(); d = !b(f.target).parents().andSelf().is(".ui-slider-handle"); this._clickOffset = d ? { left: 0, top: 0} : { left: f.pageX - i.left - (h.width() / 2), top: f.pageY - i.top - (h.height() / 2) - (parseInt(h.css("borderTopWidth"), 10) || 0) - (parseInt(h.css("borderBottomWidth"), 10) || 0) + (parseInt(h.css("marginTop"), 10) || 0) }; if (!this.handles.hasClass("ui-state-hover")) { this._slide(f, k, l) } this._animateOff = true; return true }, _mouseStart: function (d) { return true }, _mouseDrag: function (f) { var d = { x: f.pageX, y: f.pageY }, e = this._normValueFromMouse(d); this._slide(f, this._handleIndex, e); return false }, _mouseStop: function (d) { this.handles.removeClass("ui-state-active"); this._mouseSliding = false; this._stop(d, this._handleIndex); this._change(d, this._handleIndex); this._handleIndex = null; this._clickOffset = null; this._animateOff = false; return false }, _detectOrientation: function () { this.orientation = (this.options.orientation === "vertical") ? "vertical" : "horizontal" }, _normValueFromMouse: function (e) { var d, h, g, f, i; if (this.orientation === "horizontal") { d = this.elementSize.width; h = e.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0) } else { d = this.elementSize.height; h = e.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0) } g = (h / d); if (g > 1) { g = 1 } if (g < 0) { g = 0 } if (this.orientation === "vertical") { g = 1 - g } f = this._valueMax() - this._valueMin(); i = this._valueMin() + g * f; return this._trimAlignValue(i) }, _start: function (f, e) { var d = { handle: this.handles[e], value: this.value() }; if (this.options.values && this.options.values.length) { d.value = this.values(e); d.values = this.values() } return this._trigger("start", f, d) }, _slide: function (h, g, f) { var d, e, i; if (this.options.values && this.options.values.length) { d = this.values(g ? 0 : 1); if ((this.options.values.length === 2 && this.options.range === true) && ((g === 0 && f > d) || (g === 1 && f < d))) { f = d } if (f !== this.values(g)) { e = this.values(); e[g] = f; i = this._trigger("slide", h, { handle: this.handles[g], value: f, values: e }); d = this.values(g ? 0 : 1); if (i !== false) { this.values(g, f, true) } } } else { if (f !== this.value()) { i = this._trigger("slide", h, { handle: this.handles[g], value: f }); if (i !== false) { this.value(f) } } } }, _stop: function (f, e) { var d = { handle: this.handles[e], value: this.value() }; if (this.options.values && this.options.values.length) { d.value = this.values(e); d.values = this.values() } this._trigger("stop", f, d) }, _change: function (f, e) { if (!this._keySliding && !this._mouseSliding) { var d = { handle: this.handles[e], value: this.value() }; if (this.options.values && this.options.values.length) { d.value = this.values(e); d.values = this.values() } this._trigger("change", f, d) } }, value: function (d) { if (arguments.length) { this.options.value = this._trimAlignValue(d); this._refreshValue(); this._change(null, 0); return } return this._value() }, values: function (e, h) { var g, d, f; if (arguments.length > 1) { this.options.values[e] = this._trimAlignValue(h); this._refreshValue(); this._change(null, e); return } if (arguments.length) { if (b.isArray(arguments[0])) { g = this.options.values; d = arguments[0]; for (f = 0; f < g.length; f += 1) { g[f] = this._trimAlignValue(d[f]); this._change(null, f) } this._refreshValue() } else { if (this.options.values && this.options.values.length) { return this._values(e) } else { return this.value() } } } else { return this._values() } }, _setOption: function (e, f) { var d, g = 0; if (b.isArray(this.options.values)) { g = this.options.values.length } b.Widget.prototype._setOption.apply(this, arguments); switch (e) { case "disabled": if (f) { this.handles.filter(".ui-state-focus").blur(); this.handles.removeClass("ui-state-hover"); this.handles.prop("disabled", true); this.element.addClass("ui-disabled") } else { this.handles.prop("disabled", false); this.element.removeClass("ui-disabled") } break; case "orientation": this._detectOrientation(); this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation); this._refreshValue(); break; case "value": this._animateOff = true; this._refreshValue(); this._change(null, 0); this._animateOff = false; break; case "values": this._animateOff = true; this._refreshValue(); for (d = 0; d < g; d += 1) { this._change(null, d) } this._animateOff = false; break } }, _value: function () { var d = this.options.value; d = this._trimAlignValue(d); return d }, _values: function (d) { var g, f, e; if (arguments.length) { g = this.options.values[d]; g = this._trimAlignValue(g); return g } else { f = this.options.values.slice(); for (e = 0; e < f.length; e += 1) { f[e] = this._trimAlignValue(f[e]) } return f } }, _trimAlignValue: function (g) { if (g <= this._valueMin()) { return this._valueMin() } if (g >= this._valueMax()) { return this._valueMax() } var d = (this.options.step > 0) ? this.options.step : 1, f = (g - this._valueMin()) % d, e = g - f; if (Math.abs(f) * 2 >= d) { e += (f > 0) ? d : (-d) } return parseFloat(e.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () { var g = this.options.range, f = this.options, m = this, e = (!this._animateOff) ? f.animate : false, h, d = {}, i, k, j, l; if (this.options.values && this.options.values.length) { this.handles.each(function (o, n) { h = (m.values(o) - m._valueMin()) / (m._valueMax() - m._valueMin()) * 100; d[m.orientation === "horizontal" ? "left" : "bottom"] = h + "%"; b(this).stop(1, 1)[e ? "animate" : "css"](d, f.animate); if (m.options.range === true) { if (m.orientation === "horizontal") { if (o === 0) { m.range.stop(1, 1)[e ? "animate" : "css"]({ left: h + "%" }, f.animate) } if (o === 1) { m.range[e ? "animate" : "css"]({ width: (h - i) + "%" }, { queue: false, duration: f.animate }) } } else { if (o === 0) { m.range.stop(1, 1)[e ? "animate" : "css"]({ bottom: (h) + "%" }, f.animate) } if (o === 1) { m.range[e ? "animate" : "css"]({ height: (h - i) + "%" }, { queue: false, duration: f.animate }) } } } i = h }) } else { k = this.value(); j = this._valueMin(); l = this._valueMax(); h = (l !== j) ? (k - j) / (l - j) * 100 : 0; d[m.orientation === "horizontal" ? "left" : "bottom"] = h + "%"; this.handle.stop(1, 1)[e ? "animate" : "css"](d, f.animate); if (g === "min" && this.orientation === "horizontal") { this.range.stop(1, 1)[e ? "animate" : "css"]({ width: h + "%" }, f.animate) } if (g === "max" && this.orientation === "horizontal") { this.range[e ? "animate" : "css"]({ width: (100 - h) + "%" }, { queue: false, duration: f.animate }) } if (g === "min" && this.orientation === "vertical") { this.range.stop(1, 1)[e ? "animate" : "css"]({ height: h + "%" }, f.animate) } if (g === "max" && this.orientation === "vertical") { this.range[e ? "animate" : "css"]({ height: (100 - h) + "%" }, { queue: false, duration: f.animate }) } } } }) } (jQuery)); (function (b) { function a(c) { return function () { var d = this.element.val(); c.apply(this, arguments); this._refresh(); if (d !== this.element.val()) { this._trigger("change") } } } b.widget("ui.spinner", { version: "1.9m6", defaultElement: "<input>", widgetEventPrefix: "spin", options: { incremental: true, max: null, min: null, numberFormat: null, page: 10, step: 1, change: null, spin: null, start: null, stop: null }, _create: function () { this._value(this.element.val(), true); this._draw(); this._bind(this._events); this._refresh() }, _getCreateOptions: function () { var c = {}, d = this.element; b.each(["min", "max", "step"], function (e, f) { var g = d.attr(f); if (g !== undefined && g.length) { c[f] = g } }); return c }, _events: { keydown: function (c) { if (this._start(c) && this._keydown(c)) { c.preventDefault() } }, keyup: "_stop", focus: function () { this.uiSpinner.addClass("ui-state-active"); this.previous = this.element.val() }, blur: function (c) { this._refresh(); this.uiSpinner.removeClass("ui-state-active"); if (this.previous !== this.element.val()) { this._trigger("change", c) } }, mousewheel: function (c, d) { if (!d) { return } if (!this.spinning && !this._start(c)) { return false } this._spin((d > 0 ? 1 : -1) * this.options.step, c); clearTimeout(this.mousewheelTimer); this.mousewheelTimer = setTimeout(function () { if (this.spinning) { this._stop(c) } }, 100); c.preventDefault() }, "mousedown .ui-spinner-button": function (c) { c.preventDefault(); if (document.activeElement !== this.element[0]) { this.element.focus() } if (this._start(c) === false) { return } this._repeat(null, b(c.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, c) }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function (c) { if (!b(c.currentTarget).hasClass("ui-state-active")) { return } if (this._start(c) === false) { return false } this._repeat(null, b(c.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, c) }, "mouseleave .ui-spinner-button": "_stop" }, _draw: function () { var c = this.uiSpinner = this.element.addClass("ui-spinner-input").attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml()); this._hoverable(c); this.element.attr("role", "spinbutton"); this.buttons = c.find(".ui-spinner-button").attr("tabIndex", -1).button().removeClass("ui-corner-all"); if (this.buttons.height() === c.height()) { c.height(c.height()) } if (this.options.disabled) { this.disable() } }, _keydown: function (d) { var c = this.options, e = b.ui.keyCode; switch (d.keyCode) { case e.UP: this._repeat(null, 1, d); return true; case e.DOWN: this._repeat(null, -1, d); return true; case e.PAGE_UP: this._repeat(null, c.page, d); return true; case e.PAGE_DOWN: this._repeat(null, -c.page, d); return true } return false }, _uiSpinnerHtml: function () { return "<span class='ui-spinner ui-state-default ui-widget ui-widget-content ui-corner-all'></span>" }, _buttonHtml: function () { return "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon ui-icon-triangle-1-n'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon ui-icon-triangle-1-s'>&#9660;</span></a>" }, _start: function (c) { if (!this.spinning && this._trigger("start", c) === false) { return false } if (!this.counter) { this.counter = 1 } this.spinning = true; return true }, _repeat: function (d, c, e) { d = d || 500; clearTimeout(this.timer); this.timer = this._delay(function () { this._repeat(40, c, e) }, d); this._spin(c * this.options.step, e) }, _spin: function (d, c) { var e = this.value() || 0; if (!this.counter) { this.counter = 1 } e = this._adjustValue(e + d * this._increment(this.counter)); if (!this.spinning || this._trigger("spin", c, { value: e }) !== false) { this._value(e); this.counter++ } }, _increment: function (c) { var d = this.options.incremental; if (d) { return b.isFunction(d) ? d(c) : Math.floor(c * c * c / 50000 - c * c / 500 + 17 * c / 200 + 1) } return 1 }, _precision: function () { var c = this._precisionOf(this.options.step); if (this.options.min !== null) { c = Math.max(c, this._precisionOf(this.options.min)) } return c }, _precisionOf: function (d) { var e = d.toString(), c = e.indexOf("."); return c === -1 ? 0 : e.length - c - 1 }, _adjustValue: function (e) { var d, f, c = this.options; d = c.min !== null ? c.min : 0; f = e - d; f = Math.round(f / c.step) * c.step; e = d + f; e = parseFloat(e.toFixed(this._precision())); if (c.max !== null && e > c.max) { return c.max } if (c.min !== null && e < c.min) { return c.min } return e }, _stop: function (c) { if (!this.spinning) { return } clearTimeout(this.timer); clearTimeout(this.mousewheelTimer); this.counter = 0; this.spinning = false; this._trigger("stop", c) }, _setOption: function (c, d) { this._super("_setOption", c, d); if (c === "disabled") { if (d) { this.element.prop("disabled", true); this.buttons.button("disable") } else { this.element.prop("disabled", false); this.buttons.button("enable") } } }, _setOptions: a(function (c) { this._super("_setOptions", c); this._value(this.element.val()) }), _parse: function (c) { if (typeof c === "string" && c !== "") { c = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(c) : +c } return c === "" || isNaN(c) ? null : c }, _format: function (c) { if (c === "") { return "" } return window.Globalize && this.options.numberFormat ? Globalize.format(c, this.options.numberFormat) : c }, _refresh: function () { this.element.attr({ "aria-valuemin": this.options.min, "aria-valuemax": this.options.max, "aria-valuenow": this._parse(this.element.val()) }) }, _value: function (e, c) { var d; if (e !== "") { d = this._parse(e); if (d !== null) { if (!c) { d = this._adjustValue(d) } e = this._format(d) } } this.element.val(e); this._refresh() }, destroy: function () { this.element.removeClass("ui-spinner-input").prop("disabled", false).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); this._super("destroy"); this.uiSpinner.replaceWith(this.element) }, stepUp: a(function (c) { this._stepUp(c) }), _stepUp: function (c) { this._spin((c || 1) * this.options.step) }, stepDown: a(function (c) { this._stepDown(c) }), _stepDown: function (c) { this._spin((c || 1) * -this.options.step) }, pageUp: a(function (c) { this._stepUp((c || 1) * this.options.page) }), pageDown: a(function (c) { this._stepDown((c || 1) * this.options.page) }), value: function (c) { if (!arguments.length) { return this._parse(this.element.val()) } a(this._value).call(this, c) }, widget: function () { return this.uiSpinner } }) } (jQuery)); (function (e, g) { var c = 0; function f() { return ++c } var d = (function () { var i = /#.*$/, h = location.href.replace(i, ""); return function (j) { j = j.cloneNode(false); return j.hash.length > 1 && j.href.replace(i, "") === h } })(); e.widget("ui.tabs", { version: "1.9m6", options: { active: null, collapsible: false, event: "click", fx: null, activate: null, beforeActivate: null, beforeLoad: null, load: null }, _create: function () { var j = this, i = j.options, k = i.active; j.running = false; j.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); j._processTabs(); if (k === null) { if (location.hash) { j.anchors.each(function (l, m) { if (m.hash === location.hash) { k = l; return false } }) } if (k === null) { k = j.lis.filter(".ui-tabs-active").index() } if (k === null || k === -1) { k = j.lis.length ? 0 : false } } if (k !== false) { k = this.lis.eq(k).index(); if (k === -1) { k = i.collapsible ? false : 0 } } i.active = k; if (!i.collapsible && i.active === false && this.anchors.length) { i.active = 0 } if (e.isArray(i.disabled)) { i.disabled = e.unique(i.disabled.concat(e.map(this.lis.filter(".ui-state-disabled"), function (m, l) { return j.lis.index(m) }))).sort() } this._setupFx(i.fx); this._refresh(); this.panels.hide(); this.lis.removeClass("ui-tabs-active ui-state-active"); if (i.active !== false && this.anchors.length) { this.active = this._findActive(i.active); var h = j._getPanelForTab(this.active); h.show(); this.lis.eq(i.active).addClass("ui-tabs-active ui-state-active"); this.load(i.active) } else { this.active = e() } }, _setOption: function (h, i) { if (h == "active") { this._activate(i); return } if (h === "disabled") { this._setupDisabled(i); return } this._super("_setOption", h, i); if (h === "collapsible" && !i && this.options.active === false) { this._activate(0) } if (h === "event") { this._setupEvents(i) } if (h === "fx") { this._setupFx(i) } }, _tabId: function (h) { return e(h).attr("aria-controls") || "ui-tabs-" + f() }, _sanitizeSelector: function (h) { return h ? h.replace(/[!"$%&'()*+,.\/:;<=>?@[\]^`{|}~]/g, "\\$&") : "" }, refresh: function () { var h = this, j = this.options, i = this.list.children(":has(a[href])"); j.disabled = e.map(i.filter(".ui-state-disabled"), function (l) { return i.index(l) }); this._processTabs(); this._refresh(); this.panels.not(this._getPanelForTab(this.active)).hide(); if (j.active === false || !this.anchors.length) { j.active = false; this.active = e() } else { if (this.active.length && !e.contains(this.list[0], this.active[0])) { var k = j.active - 1; this._activate(k >= 0 ? k : 0) } else { j.active = this.anchors.index(this.active) } } }, _refresh: function () { var h = this.options; this.element.toggleClass("ui-tabs-collapsible", h.collapsible); this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"); this.lis.addClass("ui-state-default ui-corner-top"); this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"); this._setupDisabled(h.disabled); this._setupEvents(h.event); this.lis.unbind(".tabs"); this._focusable(this.lis); this._hoverable(this.lis) }, _processTabs: function () { var h = this; this.list = this.element.find("ol,ul").eq(0); this.lis = e(" > li:has(a[href])", this.list); this.anchors = this.lis.map(function () { return e("a", this)[0] }); this.panels = e([]); this.anchors.each(function (m, l) { var j, k; if (d(l)) { j = l.hash; k = h.element.find(h._sanitizeSelector(j)) } else { var n = h._tabId(l); j = "#" + n; k = h.element.find(j); if (!k.length) { k = h._createPanel(n); k.insertAfter(h.panels[m - 1] || h.list) } } if (k.length) { h.panels = h.panels.add(k) } e(l).attr("aria-controls", j.substring(1)) }) }, _createPanel: function (h) { return e("<div></div>").attr("id", h).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("destroy.tabs", true) }, _setupDisabled: function (k) { if (e.isArray(k)) { if (!k.length) { k = false } else { if (k.length === this.anchors.length) { k = true } } } for (var j = 0, h; (h = this.lis[j]); j++) { e(h).toggleClass("ui-state-disabled", (k === true || e.inArray(j, k) !== -1)) } this.options.disabled = k }, _setupFx: function (h) { if (h) { if (e.isArray(h)) { this.hideFx = h[0]; this.showFx = h[1] } else { this.hideFx = this.showFx = h } } }, _resetStyle: function (h, i) { if (!e.support.opacity && i.opacity) { h[0].style.removeAttribute("filter") } }, _setupEvents: function (h) { this.anchors.unbind(".tabs"); if (h) { this.anchors.bind(h.split(" ").join(".tabs ") + ".tabs", e.proxy(this, "_eventHandler")) } this.anchors.bind("click.tabs", function (i) { i.preventDefault() }) }, _eventHandler: function (h) { var m = this, r = m.options, l = m.active, n = e(h.currentTarget), p = n[0] === l[0], i = p && r.collapsible, j = i ? e() : m._getPanelForTab(n), o = !l.length ? e() : m._getPanelForTab(l), k = n.closest("li"), q = { oldTab: l, oldPanel: o, newTab: i ? e() : n, newPanel: j }; h.preventDefault(); if (k.hasClass("ui-state-disabled") || k.hasClass("ui-tabs-loading") || m.running || (p && !r.collapsible) || (m._trigger("beforeActivate", h, q) === false)) { n[0].blur(); return } r.active = i ? false : m.anchors.index(n); m.active = p ? e() : n; if (m.xhr) { m.xhr.abort() } if (!o.length && !j.length) { throw "jQuery UI Tabs: Mismatching fragment identifier." } if (j.length) { m.load(m.anchors.index(n), h); n[0].blur() } m._toggle(h, q) }, _toggle: function (o, n) { var m = this, l = m.options, h = n.newPanel, k = n.oldPanel; m.running = true; function j() { m.running = false; m._trigger("activate", o, n) } function i() { n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"); if (h.length && m.showFx) { h.animate(m.showFx, m.showFx.duration || "normal", function () { m._resetStyle(e(this), m.showFx); j() }) } else { h.show(); j() } } if (k.length && m.hideFx) { k.animate(m.hideFx, m.hideFx.duration || "normal", function () { n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"); m._resetStyle(e(this), m.hideFx); i() }) } else { n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"); k.hide(); i() } }, _activate: function (h) { var i = this._findActive(h)[0]; if (i === this.active[0]) { return } i = i || this.active[0]; this._eventHandler({ target: i, currentTarget: i, preventDefault: e.noop }) }, _findActive: function (h) { return typeof h === "number" ? this.anchors.eq(h) : typeof h === "string" ? this.anchors.filter("[href$='" + h + "']") : e() }, _getIndex: function (h) { if (typeof h == "string") { h = this.anchors.index(this.anchors.filter("[href$=" + h + "]")) } return h }, _destroy: function () { var h = this.options; if (this.xhr) { this.xhr.abort() } this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"); this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"); this.anchors.unbind(".tabs").removeData("href.tabs").removeData("load.tabs"); this.lis.unbind(".tabs").add(this.panels).each(function () { if (e.data(this, "destroy.tabs")) { e(this).remove() } else { e(this).removeClass(["ui-state-default", "ui-corner-top", "ui-tabs-active", "ui-state-active", "ui-state-disabled", "ui-tabs-panel", "ui-widget-content", "ui-corner-bottom"].join(" ")) } }); return this }, enable: function (h) { var i = this.options.disabled; if (i === false) { return } if (h === g) { i = false } else { h = this._getIndex(h); if (e.isArray(i)) { i = e.map(i, function (j) { return j !== h ? j : null }) } else { i = e.map(this.lis, function (j, k) { return k !== h ? k : null }) } } this._setupDisabled(i) }, disable: function (h) { var i = this.options.disabled; if (i === true) { return } if (h === g) { i = true } else { h = this._getIndex(h); if (e.inArray(h, i) !== -1) { return } if (e.isArray(i)) { i = e.merge([h], i).sort() } else { i = [h] } } this._setupDisabled(i) }, load: function (l, n) { l = this._getIndex(l); var i = this, k = this.options, j = this.anchors.eq(l), h = i._getPanelForTab(j), m = { tab: j, panel: h }; if (d(j[0])) { return } this.xhr = e.ajax({ url: j.attr("href"), beforeSend: function (p, o) { return i._trigger("beforeLoad", n, e.extend({ jqXHR: p, ajaxSettings: o }, m)) } }); if (this.xhr) { this.lis.eq(l).addClass("ui-tabs-loading"); this.xhr.success(function (o) { h.html(o); i._trigger("load", n, m) }).complete(function (p, o) { if (o === "abort") { i.panels.stop(false, true) } i.lis.eq(l).removeClass("ui-tabs-loading"); if (p === i.xhr) { delete i.xhr } }) } return this }, _getPanelForTab: function (h) { var i = e(h).attr("aria-controls"); return this.element.find(this._sanitizeSelector("#" + i)) } }); if (e.uiBackCompat !== false) { e.ui.tabs.prototype._ui = function (i, h) { return { tab: i, panel: h, index: this.anchors.index(i)} }; (function (i, h) { h.url = function (k, j) { this.anchors.eq(k).attr("href", j) } } (jQuery, jQuery.ui.tabs.prototype)); (function (l, j) { l.extend(j.options, { ajaxOptions: null, cache: false }); var m = j._create, k = j._setOption, i = j._destroy, h = j.url || l.noop; l.extend(j, { _create: function () { m.call(this); var n = this; this.element.bind("tabsbeforeload.tabs", function (o, p) { if (l.data(p.tab[0], "cache.tabs")) { o.preventDefault(); return } l.extend(p.ajaxSettings, n.options.ajaxOptions, { error: function (t, q, r) { try { n.options.ajaxOptions.error(t, q, p.tab.closest("li").index(), p.tab[0]) } catch (r) { } } }); p.jqXHR.success(function () { if (n.options.cache) { l.data(p.tab[0], "cache.tabs", true) } }) }) }, _setOption: function (n, o) { if (n === "cache" && o === false) { this.anchors.removeData("cache.tabs") } k.apply(this, arguments) }, _destroy: function () { this.anchors.removeData("cache.tabs"); i.call(this) }, url: function (o, n) { this.anchors.eq(o).removeData("cache.tabs"); h.apply(this, arguments) } }) } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { h.abort = function () { if (this.xhr) { this.xhr.abort() } } } (jQuery, jQuery.ui.tabs.prototype)); e.widget("ui.tabs", e.ui.tabs, { options: { spinner: "<em>Loading&#8230;</em>" }, _create: function () { this._super("_create"); this._bind({ tabsbeforeload: function (j, k) { if (!this.options.spinner) { return } var i = k.tab.find("span"), h = i.html(); i.html(this.options.spinner); k.jqXHR.complete(function () { i.html(h) }) } }) } }); (function (k, j) { k.extend(j.options, { enable: null, disable: null }); var i = j.enable, h = j.disable; j.enable = function (n) { var m = this.options, l; if (n && m.disabled === true || (k.isArray(m.disabled) && k.inArray(n, m.disabled) !== -1)) { l = true } i.apply(this, arguments); if (l) { this._trigger("enable", null, this._ui(this.anchors[n], this.panels[n])) } }; j.disable = function (n) { var m = this.options, l; if (n && m.disabled === false || (k.isArray(m.disabled) && k.inArray(n, m.disabled) === -1)) { l = true } h.apply(this, arguments); if (l) { this._trigger("disable", null, this._ui(this.anchors[n], this.panels[n])) } } } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { i.extend(h.options, { add: null, remove: null, tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>" }); h.add = function (o, n, m) { if (m === g) { m = this.anchors.length } var l = this.options, j = i(l.tabTemplate.replace(/#\{href\}/g, o).replace(/#\{label\}/g, n)), q = !o.indexOf("#") ? o.replace("#", "") : this._tabId(j.find("a")[0]); j.addClass("ui-state-default ui-corner-top").data("destroy.tabs", true); j.find("a").attr("aria-controls", q); var p = m >= this.lis.length; var k = this.element.find("#" + q); if (!k.length) { k = this._createPanel(q); if (p) { if (m > 0) { k.insertAfter(this.panels.eq(-1)) } else { k.appendTo(this.element) } } else { k.insertBefore(this.panels[m]) } } k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(); if (p) { j.appendTo(this.list) } else { j.insertBefore(this.lis[m]) } l.disabled = i.map(l.disabled, function (r) { return r >= m ? ++r : r }); this.refresh(); if (this.lis.length === 1 && l.active === false) { this.option("active", 0) } this._trigger("add", null, this._ui(this.anchors[m], this.panels[m])); return this }; h.remove = function (l) { l = this._getIndex(l); var k = this.options, m = this.lis.eq(l).remove(), j = this._getPanelForTab(m.find("a[aria-controls]")).remove(); if (m.hasClass("ui-tabs-active") && this.anchors.length > 2) { this._activate(l + (l + 1 < this.anchors.length ? 1 : -1)) } k.disabled = i.map(i.grep(k.disabled, function (o) { return o !== l }), function (o) { return o >= l ? --o : o }); this.refresh(); this._trigger("remove", null, this._ui(m.find("a")[0], j[0])); return this } } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { h.length = function () { return this.anchors.length } } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { i.extend(h.options, { idPrefix: "ui-tabs-" }); var j = h._tabId; h._tabId = function (k) { return i(k).attr("aria-controls") || k.title && k.title.replace(/\s/g, "_").replace(/[^\w\u00c0-\uFFFF-]/g, "") || this.options.idPrefix + f() } } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { i.extend(h.options, { panelTemplate: "<div></div>" }); var j = h._createPanel; h._createPanel = function (k) { return i(this.options.panelTemplate).attr("id", k).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("destroy.tabs", true) } } (jQuery, jQuery.ui.tabs.prototype)); (function (k, h) { var l = h._create, j = h._setOption, i = h._eventHandler; h._create = function () { var m = this.options; if (m.active === null && m.selected !== g) { m.active = m.selected === -1 ? false : m.selected } l.call(this); m.selected = m.active; if (m.selected === false) { m.selected = -1 } }; h._setOption = function (n, o) { if (n !== "selected") { return j.apply(this, arguments) } var m = this.options; j.call(this, "active", o === -1 ? false : o); m.selected = m.active; if (m.selected === false) { m.selected = -1 } }; h._eventHandler = function (m) { i.apply(this, arguments); this.options.selected = this.options.active; if (this.options.selected === false) { this.options.selected = -1 } } } (jQuery, jQuery.ui.tabs.prototype)); (function (j, i) { j.extend(i.options, { show: null, select: null }); var k = i._create, h = i._trigger; i._create = function () { k.call(this); if (this.options.active !== false) { this._trigger("show", null, this._ui(this.active[0], this._getPanelForTab(this.active)[0])) } }; i._trigger = function (m, n, o) { var l = h.apply(this, arguments); if (!l) { return false } if (m === "beforeActivate" && o.newTab.length) { l = h.call(this, "select", n, { tab: o.newTab[0], panel: o.newPanel[0], index: o.newTab.closest("li").index() }) } else { if (m === "activate" && o.newTab.length) { l = h.call(this, "show", n, { tab: o.newTab[0], panel: o.newPanel[0], index: o.newTab.closest("li").index() }) } } } } (jQuery, jQuery.ui.tabs.prototype)); (function (i, h) { h.select = function (j) { j = this._getIndex(j); if (j === -1) { if (this.options.collapsible && this.options.selected !== -1) { j = this.options.selected } else { return } } this.anchors.eq(j).trigger(this.options.event + ".tabs") } } (jQuery, jQuery.ui.tabs.prototype)); var b = 0; function a() { return ++b } e.widget("ui.tabs", e.ui.tabs, { options: { cookie: null }, _create: function () { var h = this.options, i; if (h.active == null && h.cookie) { i = parseInt(this._cookie(), 10); if (i === -1) { i = false } h.active = i } this._super("_create") }, _cookie: function (i) { var h = [this.cookie || (this.cookie = this.options.cookie.name || "ui-tabs-" + a())]; if (arguments.length) { h.push(i === false ? -1 : i); h.push(this.options.cookie) } return e.cookie.apply(null, h) }, _refresh: function () { this._super("_refresh"); if (this.options.cookie) { this._cookie(this.options.active, this.options.cookie) } }, _eventHandler: function (h) { this._superApply("_eventHandler", arguments); if (this.options.cookie) { this._cookie(this.options.active, this.options.cookie) } }, _destroy: function () { this._super("_destroy"); if (this.options.cookie) { this._cookie(null, this.options.cookie) } } }); e.widget("ui.tabs", e.ui.tabs, { _trigger: function (i, j, k) { var h = e.extend({}, k); if (i === "load") { h.panel = h.panel[0]; h.tab = h.tab[0] } return this._super("_trigger", i, j, h) } }) } })(jQuery); (function (b) { var a = 0; b.widget("ui.tooltip", { version: "1.9m6", options: { content: function () { return b(this).attr("title") }, hide: true, items: "[title]", position: { my: "left+15 center", at: "right center", collision: "flipfit flipfit" }, show: true, tooltipClass: null, close: null, open: null }, _create: function () { this._bind({ mouseover: "open", focusin: "open" }); this.tooltips = {} }, _setOption: function (c, d) { if (c === "disabled") { this[d ? "_disable" : "_enable"](); this.options[c] = d; return } this._super("_setOption", c, d) }, _disable: function () { var c = this; b.each(this.tooltips, function (f, d) { var e = b.Event("blur"); e.target = e.currentTarget = d[0]; c.close(e, true) }); this.element.find(this.options.items).andSelf().each(function () { var d = b(this); if (d.is("[title]")) { d.data("tooltip-title", d.attr("title")).attr("title", "") } }) }, _enable: function () { this.element.find(this.options.items).andSelf().each(function () { var c = b(this); if (c.data("tooltip-title")) { c.attr("title", c.data("tooltip-title")) } }) }, open: function (e) { var d, c = this, f = b(e ? e.target : this.element).closest(this.options.items); if (!f.length || f.attr("aria-describedby")) { return } if (!f.data("tooltip-title")) { f.data("tooltip-title", f.attr("title")) } d = this.options.content.call(f[0], function (g) { setTimeout(function () { c._open(e, f, g) }, 1) }); if (d) { c._open(e, f, d) } }, _open: function (d, f, c) { if (!c) { return } if (f.is("[title]")) { f.attr("title", "") } var e = this._find(f); if (!e.length) { e = this._tooltip(f); f.attr("aria-describedby", e.attr("id")) } e.find(".ui-tooltip-content").html(c); e.stop(true).position(b.extend({ of: f }, this.options.position)).hide(); this._show(e, this.options.show); this._trigger("open", d, { tooltip: e }); this._bind(f, { mouseleave: "close", blur: "close", keyup: function (g) { if (g.keyCode == b.ui.keyCode.ESCAPE) { var h = b.Event(g); h.currentTarget = f[0]; this.close(h, true) } } }) }, close: function (d, f) { var c = this, g = b(d ? d.currentTarget : this.element), e = this._find(g); if (!f && document.activeElement === g[0]) { return } if (g.data("tooltip-title")) { g.attr("title", g.data("tooltip-title")) } g.removeAttr("aria-describedby"); e.stop(true); this._hide(e, this.options.hide, function () { b(this).remove(); delete c.tooltips[this.id] }); g.unbind("mouseleave.tooltip blur.tooltip keyup.tooltip"); this._trigger("close", d, { tooltip: e }) }, _tooltip: function (c) { var e = "ui-tooltip-" + a++, d = b("<div>").attr({ id: e, role: "tooltip" }).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || "")); b("<div>").addClass("ui-tooltip-content").appendTo(d); d.appendTo(document.body); if (b.fn.bgiframe) { d.bgiframe() } this.tooltips[e] = c; return d }, _find: function (c) { var d = c.attr("aria-describedby"); return d ? b("#" + d) : b() }, _destroy: function () { b.each(this.tooltips, function (c) { b("#" + c).remove() }) } }) } (jQuery));
