﻿/*!
* jQuery UI 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*/
jQuery.ui || (function (a) { a.ui = { version: "1.8", plugin: { add: function (c, d, f) { var e = a.ui[c].prototype; for (var b in f) { e.plugins[b] = e.plugins[b] || []; e.plugins[b].push([d, f[b]]) } }, call: function (b, d, c) { var f = b.plugins[d]; if (!f || !b.element[0].parentNode) { return } for (var e = 0; e < f.length; e++) { if (b.options[f[e][0]]) { f[e][1].apply(b.element, c) } } } }, contains: function (d, c) { return document.compareDocumentPosition ? d.compareDocumentPosition(c) & 16 : d !== c && d.contains(c) }, hasScroll: function (e, c) { if (a(e).css("overflow") == "hidden") { return false } var b = (c && c == "left") ? "scrollLeft" : "scrollTop", d = false; if (e[b] > 0) { return true } e[b] = 1; d = (e[b] > 0); e[b] = 0; return d }, isOverAxis: function (c, b, d) { return (c > b) && (c < (b + d)) }, isOver: function (g, c, f, e, b, d) { return a.ui.isOverAxis(g, f, b) && a.ui.isOverAxis(c, e, d) }, keyCode: { BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38} }; a.fn.extend({ _focus: a.fn.focus, focus: function (b, c) { return typeof b === "number" ? this.each(function () { var d = this; setTimeout(function () { a(d).focus(); (c && c.call(d)) }, b) }) : this._focus.apply(this, arguments) }, enableSelection: function () { return this.attr("unselectable", "off").css("MozUserSelect", "").unbind("selectstart.ui") }, disableSelection: function () { return this.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () { return false }) }, scrollParent: function () { var b; if ((a.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { b = 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 { b = 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")) || !b.length ? a(document) : b }, zIndex: function (e) { if (e !== undefined) { return this.css("zIndex", e) } if (this.length) { var c = a(this[0]), b, d; while (c.length && c[0] !== document) { b = c.css("position"); if (b == "absolute" || b == "relative" || b == "fixed") { d = parseInt(c.css("zIndex")); if (!isNaN(d) && d != 0) { return d } } c = c.parent() } } return 0 } }); a.extend(a.expr[":"], { data: function (d, c, b) { return !!a.data(d, b[3]) }, focusable: function (c) { var d = c.nodeName.toLowerCase(), b = a.attr(c, "tabindex"); return (/input|select|textarea|button|object/.test(d) ? !c.disabled : "a" == d || "area" == d ? c.href || !isNaN(b) : !isNaN(b)) && !a(c)["area" == d ? "parents" : "closest"](":hidden").length }, tabbable: function (c) { var b = a.attr(c, "tabindex"); return (isNaN(b) || b >= 0) && a(c).is(":focusable") } }) })(jQuery); ; 
/*
* jQuery UI Widget 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Widget
*/
(function (b) { var a = b.fn.remove; b.fn.remove = function (c, d) { return this.each(function () { if (!d) { if (!c || b.filter(c, [this]).length) { b("*", this).add(this).each(function () { b(this).triggerHandler("remove") }) } } return a.call(b(this), c, d) }) }; b.widget = function (d, f, c) { var e = d.split(".")[0], h; d = d.split(".")[1]; h = e + "-" + d; if (!c) { c = f; f = b.Widget } b.expr[":"][h] = function (i) { return !!b.data(i, d) }; b[e] = b[e] || {}; b[e][d] = function (i, j) { if (arguments.length) { this._createWidget(i, j) } }; var g = new f(); g.options = b.extend({}, g.options); b[e][d].prototype = b.extend(true, g, { namespace: e, widgetName: d, widgetEventPrefix: b[e][d].prototype.widgetEventPrefix || d, widgetBaseClass: h }, c); b.widget.bridge(d, b[e][d]) }; b.widget.bridge = function (d, c) { b.fn[d] = function (g) { var e = typeof g === "string", f = Array.prototype.slice.call(arguments, 1), h = this; g = !e && f.length ? b.extend.apply(null, [true, g].concat(f)) : g; if (e && g.substring(0, 1) === "_") { return h } if (e) { this.each(function () { var i = b.data(this, d), j = i && b.isFunction(i[g]) ? i[g].apply(i, f) : i; if (j !== i && j !== undefined) { h = j; return false } }) } else { this.each(function () { var i = b.data(this, d); if (i) { if (g) { i.option(g) } i._init() } else { b.data(this, d, new c(g, this)) } }) } return h } }; b.Widget = function (c, d) { if (arguments.length) { this._createWidget(c, d) } }; b.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function (d, e) { this.element = b(e).data(this.widgetName, this); this.options = b.extend(true, {}, this.options, b.metadata && b.metadata.get(e)[this.widgetName], d); var c = this; this.element.bind("remove." + this.widgetName, function () { c.destroy() }); this._create(); this._init() }, _create: function () { }, _init: function () { }, destroy: function () { this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled") }, widget: function () { return this.element }, option: function (e, f) { var d = e, c = this; if (arguments.length === 0) { return b.extend({}, c.options) } if (typeof e === "string") { if (f === undefined) { return this.options[e] } d = {}; d[e] = f } b.each(d, function (g, h) { c._setOption(g, h) }); return c }, _setOption: function (c, d) { this.options[c] = d; if (c === "disabled") { this.widget()[d ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", d) } return this }, enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _trigger: function (d, e, f) { var h = this.options[d]; e = b.Event(e); e.type = (d === this.widgetEventPrefix ? d : this.widgetEventPrefix + d).toLowerCase(); f = f || {}; if (e.originalEvent) { for (var c = b.event.props.length, g; c; ) { g = b.event.props[--c]; e[g] = e.originalEvent[g] } } this.element.trigger(e, f); return !(b.isFunction(h) && h.call(this.element[0], e, f) === false || e.isDefaultPrevented()) } } })(jQuery); ; 
/*!
 * jQuery UI Mouse 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function (a) { a.widget("ui.mouse", { options: { cancel: ":input,option", distance: 1, delay: 0 }, _mouseInit: function () { var b = this; this.element.bind("mousedown." + this.widgetName, function (c) { return b._mouseDown(c) }).bind("click." + this.widgetName, function (c) { if (b._preventClickEvent) { b._preventClickEvent = false; c.stopImmediatePropagation(); return false } }); this.started = false }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName) }, _mouseDown: function (d) { d.originalEvent = d.originalEvent || {}; if (d.originalEvent.mouseHandled) { return } (this._mouseStarted && this._mouseUp(d)); this._mouseDownEvent = d; var c = this, e = (d.which == 1), b = (typeof this.options.cancel == "string" ? a(d.target).parents().add(d.target).filter(this.options.cancel).length : false); if (!e || b || !this._mouseCapture(d)) { return true } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function () { c.mouseDelayMet = true }, this.options.delay) } if (this._mouseDistanceMet(d) && this._mouseDelayMet(d)) { this._mouseStarted = (this._mouseStart(d) !== false); if (!this._mouseStarted) { d.preventDefault(); return true } } this._mouseMoveDelegate = function (f) { return c._mouseMove(f) }; this._mouseUpDelegate = function (f) { return c._mouseUp(f) }; a(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); (a.browser.safari || d.preventDefault()); d.originalEvent.mouseHandled = true; return true }, _mouseMove: function (b) { if (a.browser.msie && !b.button) { return this._mouseUp(b) } if (this._mouseStarted) { this._mouseDrag(b); return b.preventDefault() } if (this._mouseDistanceMet(b) && this._mouseDelayMet(b)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, b) !== false); (this._mouseStarted ? this._mouseDrag(b) : this._mouseUp(b)) } return !this._mouseStarted }, _mouseUp: function (b) { a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; this._preventClickEvent = (b.target == this._mouseDownEvent.target); this._mouseStop(b) } return false }, _mouseDistanceMet: function (b) { return (Math.max(Math.abs(this._mouseDownEvent.pageX - b.pageX), Math.abs(this._mouseDownEvent.pageY - b.pageY)) >= this.options.distance) }, _mouseDelayMet: function (b) { return this.mouseDelayMet }, _mouseStart: function (b) { }, _mouseDrag: function (b) { }, _mouseStop: function (b) { }, _mouseCapture: function (b) { return true } }) })(jQuery); ; 
/*
 * jQuery UI Position 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Position
 */
(function (f) { f.ui = f.ui || {}; var c = /left|center|right/, e = "center", d = /top|center|bottom/, g = "center", a = f.fn.position, b = f.fn.offset; f.fn.position = function (i) { if (!i || !i.of) { return a.apply(this, arguments) } i = f.extend({}, i); var l = f(i.of), n = (i.collision || "flip").split(" "), m = i.offset ? i.offset.split(" ") : [0, 0], k, h, j; if (i.of.nodeType === 9) { k = l.width(); h = l.height(); j = { top: 0, left: 0} } else { if (i.of.scrollTo && i.of.document) { k = l.width(); h = l.height(); j = { top: l.scrollTop(), left: l.scrollLeft()} } else { if (i.of.preventDefault) { i.at = "left top"; k = h = 0; j = { top: i.of.pageY, left: i.of.pageX} } else { k = l.outerWidth(); h = l.outerHeight(); j = l.offset() } } } f.each(["my", "at"], function () { var o = (i[this] || "").split(" "); if (o.length === 1) { o = c.test(o[0]) ? o.concat([g]) : d.test(o[0]) ? [e].concat(o) : [e, g] } o[0] = c.test(o[0]) ? o[0] : e; o[1] = d.test(o[1]) ? o[1] : g; i[this] = o }); if (n.length === 1) { n[1] = n[0] } m[0] = parseInt(m[0], 10) || 0; if (m.length === 1) { m[1] = m[0] } m[1] = parseInt(m[1], 10) || 0; if (i.at[0] === "right") { j.left += k } else { if (i.at[0] === e) { j.left += k / 2 } } if (i.at[1] === "bottom") { j.top += h } else { if (i.at[1] === g) { j.top += h / 2 } } j.left += m[0]; j.top += m[1]; return this.each(function () { var r = f(this), q = r.outerWidth(), p = r.outerHeight(), o = f.extend({}, j); if (i.my[0] === "right") { o.left -= q } else { if (i.my[0] === e) { o.left -= q / 2 } } if (i.my[1] === "bottom") { o.top -= p } else { if (i.my[1] === g) { o.top -= p / 2 } } f.each(["left", "top"], function (t, s) { if (f.ui.position[n[t]]) { f.ui.position[n[t]][s](o, { targetWidth: k, targetHeight: h, elemWidth: q, elemHeight: p, offset: m, my: i.my, at: i.at }) } }); if (f.fn.bgiframe) { r.bgiframe() } r.offset(f.extend(o, { using: i.using })) }) }; f.ui.position = { fit: { left: function (h, i) { var k = f(window), j = h.left + i.elemWidth - k.width() - k.scrollLeft(); h.left = j > 0 ? h.left - j : Math.max(0, h.left) }, top: function (h, i) { var k = f(window), j = h.top + i.elemHeight - k.height() - k.scrollTop(); h.top = j > 0 ? h.top - j : Math.max(0, h.top) } }, flip: { left: function (i, j) { if (j.at[0] === "center") { return } var l = f(window), k = i.left + j.elemWidth - l.width() - l.scrollLeft(), h = j.my[0] === "left" ? -j.elemWidth : j.my[0] === "right" ? j.elemWidth : 0, m = -2 * j.offset[0]; i.left += i.left < 0 ? h + j.targetWidth + m : k > 0 ? h - j.targetWidth + m : 0 }, top: function (i, k) { if (k.at[1] === "center") { return } var m = f(window), l = i.top + k.elemHeight - m.height() - m.scrollTop(), h = k.my[1] === "top" ? -k.elemHeight : k.my[1] === "bottom" ? k.elemHeight : 0, j = k.at[1] === "top" ? k.targetHeight : -k.targetHeight, n = -2 * k.offset[1]; i.top += i.top < 0 ? h + k.targetHeight + n : l > 0 ? h + j + n : 0 } } }; if (!f.offset.setOffset) { f.offset.setOffset = function (l, i) { if (/static/.test(f.curCSS(l, "position"))) { l.style.position = "relative" } var k = f(l), n = k.offset(), h = parseInt(f.curCSS(l, "top", true), 10) || 0, m = parseInt(f.curCSS(l, "left", true), 10) || 0, j = { top: (i.top - n.top) + h, left: (i.left - n.left) + m }; if ("using" in i) { i.using.call(l, j) } else { k.css(j) } }; f.fn.offset = function (h) { var i = this[0]; if (!i || !i.ownerDocument) { return null } if (h) { return this.each(function () { f.offset.setOffset(this, h) }) } return b.call(this) } } } (jQuery)); ; 
/*
 * jQuery UI Draggable 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function (a) { a.widget("ui.draggable", a.ui.mouse, { 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 (b) { var c = this.options; if (this.helper || c.disabled || a(b.target).is(".ui-resizable-handle")) { return false } this.handle = this._getHandle(b); if (!this.handle) { return false } return true }, _mouseStart: function (b) { var c = this.options; this.helper = this._createHelper(b); 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: b.pageX - this.offset.left, top: b.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this.position = this._generatePosition(b); this.originalPageX = b.pageX; this.originalPageY = b.pageY; (c.cursorAt && this._adjustOffsetFromHelper(c.cursorAt)); if (c.containment) { this._setContainment() } if (this._trigger("start", b) === false) { this._clear(); return false } this._cacheHelperProportions(); if (a.ui.ddmanager && !c.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, b) } this.helper.addClass("ui-draggable-dragging"); this._mouseDrag(b, true); return true }, _mouseDrag: function (b, d) { this.position = this._generatePosition(b); this.positionAbs = this._convertPositionTo("absolute"); if (!d) { var c = this._uiHash(); if (this._trigger("drag", b, c) === false) { this._mouseUp({}); return false } this.position = c.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, b) } return false }, _mouseStop: function (c) { var d = false; if (a.ui.ddmanager && !this.options.dropBehaviour) { d = a.ui.ddmanager.drop(this, c) } if (this.dropped) { d = this.dropped; this.dropped = false } if (!this.element[0] || !this.element[0].parentNode) { return false } if ((this.options.revert == "invalid" && !d) || (this.options.revert == "valid" && d) || this.options.revert === true || (a.isFunction(this.options.revert) && this.options.revert.call(this.element, d))) { var b = this; a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { if (b._trigger("stop", c) !== false) { b._clear() } }) } else { if (this._trigger("stop", c) !== false) { this._clear() } } return false }, cancel: function () { if (this.helper.is(".ui-draggable-dragging")) { this._mouseUp({}) } else { this._clear() } return this }, _getHandle: function (b) { var c = !this.options.handle || !a(this.options.handle, this.element).length ? true : false; a(this.options.handle, this.element).find("*").andSelf().each(function () { if (this == b.target) { c = true } }); return c }, _createHelper: function (c) { var d = this.options; var b = a.isFunction(d.helper) ? a(d.helper.apply(this.element[0], [c])) : (d.helper == "clone" ? this.element.clone() : this.element); if (!b.parents("body").length) { b.appendTo((d.appendTo == "parent" ? this.element[0].parentNode : d.appendTo)) } if (b[0] != this.element[0] && !(/(fixed|absolute)/).test(b.css("position"))) { b.css("position", "absolute") } return b }, _adjustOffsetFromHelper: function (b) { if (typeof b == "string") { b = b.split(" ") } if (a.isArray(b)) { b = { left: +b[0], top: +b[1] || 0} } if ("left" in b) { this.offset.click.left = b.left + this.margins.left } if ("right" in b) { this.offset.click.left = this.helperProportions.width - b.right + this.margins.left } if ("top" in b) { this.offset.click.top = b.top + this.margins.top } if ("bottom" in b) { this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top } }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) { b.left += this.scrollParent.scrollLeft(); b.top += this.scrollParent.scrollTop() } if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie)) { b = { top: 0, left: 0} } return { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var b = this.element.position(); return { top: b.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: b.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)} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var e = this.options; if (e.containment == "parent") { e.containment = this.helper[0].parentNode } if (e.containment == "document" || e.containment == "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(e.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (a(e.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (!(/^(document|window|parent)$/).test(e.containment) && e.containment.constructor != Array) { var c = a(e.containment)[0]; if (!c) { return } var d = a(e.containment).offset(); var b = (a(c).css("overflow") != "hidden"); this.containment = [d.left + (parseInt(a(c).css("borderLeftWidth"), 10) || 0) + (parseInt(a(c).css("paddingLeft"), 10) || 0) - this.margins.left, d.top + (parseInt(a(c).css("borderTopWidth"), 10) || 0) + (parseInt(a(c).css("paddingTop"), 10) || 0) - this.margins.top, d.left + (b ? Math.max(c.scrollWidth, c.offsetWidth) : c.offsetWidth) - (parseInt(a(c).css("borderLeftWidth"), 10) || 0) - (parseInt(a(c).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, d.top + (b ? Math.max(c.scrollHeight, c.offsetHeight) : c.offsetHeight) - (parseInt(a(c).css("borderTopWidth"), 10) || 0) - (parseInt(a(c).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } else { if (e.containment.constructor == Array) { this.containment = e.containment } } }, _convertPositionTo: function (f, h) { if (!h) { h = this.position } var c = f == "absolute" ? 1 : -1; var e = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, g = (/(html|body)/i).test(b[0].tagName); return { top: (h.top + this.offset.relative.top * c + this.offset.parent.top * c - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (g ? 0 : b.scrollTop())) * c)), left: (h.left + this.offset.relative.left * c + this.offset.parent.left * c - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : g ? 0 : b.scrollLeft()) * c))} }, _generatePosition: function (e) { var h = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, i = (/(html|body)/i).test(b[0].tagName); var d = e.pageX; var c = e.pageY; if (this.originalPosition) { if (this.containment) { if (e.pageX - this.offset.click.left < this.containment[0]) { d = this.containment[0] + this.offset.click.left } if (e.pageY - this.offset.click.top < this.containment[1]) { c = this.containment[1] + this.offset.click.top } if (e.pageX - this.offset.click.left > this.containment[2]) { d = this.containment[2] + this.offset.click.left } if (e.pageY - this.offset.click.top > this.containment[3]) { c = this.containment[3] + this.offset.click.top } } if (h.grid) { var g = this.originalPageY + Math.round((c - this.originalPageY) / h.grid[1]) * h.grid[1]; c = this.containment ? (!(g - this.offset.click.top < this.containment[1] || g - this.offset.click.top > this.containment[3]) ? g : (!(g - this.offset.click.top < this.containment[1]) ? g - h.grid[1] : g + h.grid[1])) : g; var f = this.originalPageX + Math.round((d - this.originalPageX) / h.grid[0]) * h.grid[0]; d = this.containment ? (!(f - this.offset.click.left < this.containment[0] || f - this.offset.click.left > this.containment[2]) ? f : (!(f - this.offset.click.left < this.containment[0]) ? f - h.grid[0] : f + h.grid[0])) : f } } return { top: (c - 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 : b.scrollTop())))), left: (d - 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 : b.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 (b, c, d) { d = d || this._uiHash(); a.ui.plugin.call(this, b, [c, d]); if (b == "drag") { this.positionAbs = this._convertPositionTo("absolute") } return a.Widget.prototype._trigger.call(this, b, c, d) }, plugins: {}, _uiHash: function (b) { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } }); a.extend(a.ui.draggable, { version: "1.8" }); a.ui.plugin.add("draggable", "connectToSortable", { start: function (c, e) { var d = a(this).data("draggable"), f = d.options, b = a.extend({}, e, { item: d.element }); d.sortables = []; a(f.connectToSortable).each(function () { var g = a.data(this, "sortable"); if (g && !g.options.disabled) { d.sortables.push({ instance: g, shouldRevert: g.options.revert }); g._refreshItems(); g._trigger("activate", c, b) } }) }, stop: function (c, e) { var d = a(this).data("draggable"), b = a.extend({}, e, { item: d.element }); a.each(d.sortables, function () { if (this.instance.isOver) { this.instance.isOver = 0; d.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = true } this.instance._mouseStop(c); this.instance.options.helper = this.instance.options._helper; if (d.options.helper == "original") { this.instance.currentItem.css({ top: "auto", left: "auto" }) } } else { this.instance.cancelHelperRemoval = false; this.instance._trigger("deactivate", c, b) } }) }, drag: function (c, f) { var e = a(this).data("draggable"), b = this; var d = function (i) { var n = this.offset.click.top, m = this.offset.click.left; var g = this.positionAbs.top, k = this.positionAbs.left; var j = i.height, l = i.width; var p = i.top, h = i.left; return a.ui.isOver(g + n, k + m, p, h, j, l) }; a.each(e.sortables, function (g) { this.instance.positionAbs = e.positionAbs; this.instance.helperProportions = e.helperProportions; this.instance.offset.click = e.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = a(b).clone().appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return f.helper[0] }; c.target = this.instance.currentItem[0]; this.instance._mouseCapture(c, true); this.instance._mouseStart(c, true, true); this.instance.offset.click.top = e.offset.click.top; this.instance.offset.click.left = e.offset.click.left; this.instance.offset.parent.left -= e.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= e.offset.parent.top - this.instance.offset.parent.top; e._trigger("toSortable", c); e.dropped = this.instance.element; e.currentItem = e.element; this.instance.fromOutside = e } if (this.instance.currentItem) { this.instance._mouseDrag(c) } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance._trigger("out", c, this.instance._uiHash(this.instance)); this.instance._mouseStop(c, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); if (this.instance.placeholder) { this.instance.placeholder.remove() } e._trigger("fromSortable", c); e.dropped = false } } }) } }); a.ui.plugin.add("draggable", "cursor", { start: function (c, d) { var b = a("body"), e = a(this).data("draggable").options; if (b.css("cursor")) { e._cursor = b.css("cursor") } b.css("cursor", e.cursor) }, stop: function (b, c) { var d = a(this).data("draggable").options; if (d._cursor) { a("body").css("cursor", d._cursor) } } }); a.ui.plugin.add("draggable", "iframeFix", { start: function (b, c) { var d = a(this).data("draggable").options; 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") }) }, stop: function (b, c) { a("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }) } }); a.ui.plugin.add("draggable", "opacity", { start: function (c, d) { var b = a(d.helper), e = a(this).data("draggable").options; if (b.css("opacity")) { e._opacity = b.css("opacity") } b.css("opacity", e.opacity) }, stop: function (b, c) { var d = a(this).data("draggable").options; if (d._opacity) { a(c.helper).css("opacity", d._opacity) } } }); a.ui.plugin.add("draggable", "scroll", { start: function (c, d) { var b = a(this).data("draggable"); if (b.scrollParent[0] != document && b.scrollParent[0].tagName != "HTML") { b.overflowOffset = b.scrollParent.offset() } }, drag: function (d, e) { var c = a(this).data("draggable"), f = c.options, b = false; if (c.scrollParent[0] != document && c.scrollParent[0].tagName != "HTML") { if (!f.axis || f.axis != "x") { if ((c.overflowOffset.top + c.scrollParent[0].offsetHeight) - d.pageY < f.scrollSensitivity) { c.scrollParent[0].scrollTop = b = c.scrollParent[0].scrollTop + f.scrollSpeed } else { if (d.pageY - c.overflowOffset.top < f.scrollSensitivity) { c.scrollParent[0].scrollTop = b = c.scrollParent[0].scrollTop - f.scrollSpeed } } } if (!f.axis || f.axis != "y") { if ((c.overflowOffset.left + c.scrollParent[0].offsetWidth) - d.pageX < f.scrollSensitivity) { c.scrollParent[0].scrollLeft = b = c.scrollParent[0].scrollLeft + f.scrollSpeed } else { if (d.pageX - c.overflowOffset.left < f.scrollSensitivity) { c.scrollParent[0].scrollLeft = b = c.scrollParent[0].scrollLeft - f.scrollSpeed } } } } else { if (!f.axis || f.axis != "x") { if (d.pageY - a(document).scrollTop() < f.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() - f.scrollSpeed) } else { if (a(window).height() - (d.pageY - a(document).scrollTop()) < f.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() + f.scrollSpeed) } } } if (!f.axis || f.axis != "y") { if (d.pageX - a(document).scrollLeft() < f.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() - f.scrollSpeed) } else { if (a(window).width() - (d.pageX - a(document).scrollLeft()) < f.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() + f.scrollSpeed) } } } } if (b !== false && a.ui.ddmanager && !f.dropBehaviour) { a.ui.ddmanager.prepareOffsets(c, d) } } }); a.ui.plugin.add("draggable", "snap", { start: function (c, d) { var b = a(this).data("draggable"), e = b.options; b.snapElements = []; a(e.snap.constructor != String ? (e.snap.items || ":data(draggable)") : e.snap).each(function () { var g = a(this); var f = g.offset(); if (this != b.element[0]) { b.snapElements.push({ item: this, width: g.outerWidth(), height: g.outerHeight(), top: f.top, left: f.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 (c, d) { var f = a(this).data("draggable").options; var e = a.makeArray(a(f.stack)).sort(function (h, g) { return (parseInt(a(h).css("zIndex"), 10) || 0) - (parseInt(a(g).css("zIndex"), 10) || 0) }); if (!e.length) { return } var b = parseInt(e[0].style.zIndex) || 0; a(e).each(function (g) { this.style.zIndex = b + g }); this[0].style.zIndex = b + e.length } }); a.ui.plugin.add("draggable", "zIndex", { start: function (c, d) { var b = a(d.helper), e = a(this).data("draggable").options; if (b.css("zIndex")) { e._zIndex = b.css("zIndex") } b.css("zIndex", e.zIndex) }, stop: function (b, c) { var d = a(this).data("draggable").options; if (d._zIndex) { a(c.helper).css("zIndex", d._zIndex) } } }) })(jQuery); ; 
/*
 * jQuery UI Droppable 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Droppables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 */
(function (a) { a.widget("ui.droppable", { widgetEventPrefix: "drop", options: { accept: "*", activeClass: false, addClasses: true, greedy: false, hoverClass: false, scope: "default", tolerance: "intersect" }, _create: function () { var c = this.options, b = c.accept; this.isover = 0; this.isout = 1; this.accept = a.isFunction(b) ? b : function (e) { return e.is(b) }; this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; a.ui.ddmanager.droppables[c.scope] = a.ui.ddmanager.droppables[c.scope] || []; a.ui.ddmanager.droppables[c.scope].push(this); (c.addClasses && this.element.addClass("ui-droppable")) }, destroy: function () { var b = a.ui.ddmanager.droppables[this.options.scope]; for (var c = 0; c < b.length; c++) { if (b[c] == this) { b.splice(c, 1) } } this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"); return this }, _setOption: function (b, c) { if (b == "accept") { this.accept = a.isFunction(c) ? c : function (e) { return e.is(c) } } a.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (c) { var b = a.ui.ddmanager.current; if (this.options.activeClass) { this.element.addClass(this.options.activeClass) } (b && this._trigger("activate", c, this.ui(b))) }, _deactivate: function (c) { var b = a.ui.ddmanager.current; if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } (b && this._trigger("deactivate", c, this.ui(b))) }, _over: function (c) { var b = a.ui.ddmanager.current; if (!b || (b.currentItem || b.element)[0] == this.element[0]) { return } if (this.accept.call(this.element[0], (b.currentItem || b.element))) { if (this.options.hoverClass) { this.element.addClass(this.options.hoverClass) } this._trigger("over", c, this.ui(b)) } }, _out: function (c) { var b = a.ui.ddmanager.current; if (!b || (b.currentItem || b.element)[0] == this.element[0]) { return } if (this.accept.call(this.element[0], (b.currentItem || b.element))) { if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("out", c, this.ui(b)) } }, _drop: function (c, d) { var b = d || a.ui.ddmanager.current; if (!b || (b.currentItem || b.element)[0] == this.element[0]) { return false } var e = false; this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function () { var f = a.data(this, "droppable"); if (f.options.greedy && !f.options.disabled && f.options.scope == b.options.scope && f.accept.call(f.element[0], (b.currentItem || b.element)) && a.ui.intersect(b, a.extend(f, { offset: f.element.offset() }), f.options.tolerance)) { e = true; return false } }); if (e) { return false } if (this.accept.call(this.element[0], (b.currentItem || b.element))) { if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("drop", c, this.ui(b)); return this.element } return false }, ui: function (b) { return { draggable: (b.currentItem || b.element), helper: b.helper, position: b.position, offset: b.positionAbs} } }); a.extend(a.ui.droppable, { version: "1.8" }); 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 (e, g) { var b = a.ui.ddmanager.droppables[e.options.scope] || []; var f = g ? g.type : null; var h = (e.currentItem || e.element).find(":data(droppable)").andSelf(); droppablesLoop: for (var d = 0; d < b.length; d++) { if (b[d].options.disabled || (e && !b[d].accept.call(b[d].element[0], (e.currentItem || e.element)))) { continue } for (var c = 0; c < h.length; c++) { if (h[c] == b[d].element[0]) { b[d].proportions.height = 0; continue droppablesLoop } } b[d].visible = b[d].element.css("display") != "none"; if (!b[d].visible) { continue } b[d].offset = b[d].element.offset(); b[d].proportions = { width: b[d].element[0].offsetWidth, height: b[d].element[0].offsetHeight }; if (f == "mousedown") { b[d]._activate.call(b[d], g) } } }, drop: function (b, c) { var d = false; a.each(a.ui.ddmanager.droppables[b.options.scope] || [], function () { if (!this.options) { return } if (!this.options.disabled && this.visible && a.ui.intersect(b, this, this.options.tolerance)) { d = d || this._drop.call(this, c) } if (!this.options.disabled && this.visible && this.accept.call(this.element[0], (b.currentItem || b.element))) { this.isout = 1; this.isover = 0; this._deactivate.call(this, c) } }); return d }, drag: function (b, c) { if (b.options.refreshPositions) { a.ui.ddmanager.prepareOffsets(b, c) } a.each(a.ui.ddmanager.droppables[b.options.scope] || [], function () { if (this.options.disabled || this.greedyChild || !this.visible) { return } var e = a.ui.intersect(b, this, this.options.tolerance); var g = !e && this.isover == 1 ? "isout" : (e && this.isover == 0 ? "isover" : null); if (!g) { return } var f; if (this.options.greedy) { var d = this.element.parents(":data(droppable):eq(0)"); if (d.length) { f = a.data(d[0], "droppable"); f.greedyChild = (g == "isover" ? 1 : 0) } } if (f && g == "isover") { f.isover = 0; f.isout = 1; f._out.call(f, c) } this[g] = 1; this[g == "isout" ? "isover" : "isout"] = 0; this[g == "isover" ? "_over" : "_out"].call(this, c); if (f && g == "isout") { f.isout = 0; f.isover = 1; f._over.call(f, c) } }) } } })(jQuery); ; 
/*
 * jQuery UI Autocomplete 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Autocomplete
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
(function (a) { a.widget("ui.autocomplete", { options: { minLength: 1, delay: 300 }, _create: function () { var b = this, c = this.element[0].ownerDocument; this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off").attr({ role: "textbox", "aria-autocomplete": "list", "aria-haspopup": "true" }).bind("keydown.autocomplete", function (d) { var e = a.ui.keyCode; switch (d.keyCode) { case e.PAGE_UP: b._move("previousPage", d); break; case e.PAGE_DOWN: b._move("nextPage", d); break; case e.UP: b._move("previous", d); d.preventDefault(); break; case e.DOWN: b._move("next", d); d.preventDefault(); break; case e.ENTER: if (b.menu.active) { d.preventDefault() } case e.TAB: if (!b.menu.active) { return } b.menu.select(); break; case e.ESCAPE: b.element.val(b.term); b.close(d); break; case e.SHIFT: case e.CONTROL: case 18: break; default: clearTimeout(b.searching); b.searching = setTimeout(function () { b.search(null, d) }, b.options.delay); break } }).bind("focus.autocomplete", function () { b.previous = b.element.val() }).bind("blur.autocomplete", function (d) { clearTimeout(b.searching); b.closing = setTimeout(function () { b.close(d) }, 150) }); this._initSource(); this.response = function () { return b._response.apply(b, arguments) }; this.menu = a("<ul></ul>").addClass("ui-autocomplete").appendTo("body", c).menu({ focus: function (e, f) { var d = f.item.data("item.autocomplete"); if (false !== b._trigger("focus", null, { item: d })) { b.element.val(d.value) } }, selected: function (e, f) { var d = f.item.data("item.autocomplete"); if (false !== b._trigger("select", e, { item: d })) { b.element.val(d.value) } b.close(e); b.previous = b.element.val(); if (b.element[0] !== c.activeElement) { b.element.focus() } }, blur: function (d, e) { if (b.menu.element.is(":visible")) { b.element.val(b.term) } } }).zIndex(this.element.zIndex() + 1).css({ top: 0, left: 0 }).hide().data("menu"); if (a.fn.bgiframe) { this.menu.element.bgiframe() } }, destroy: function () { this.element.removeClass("ui-autocomplete-input ui-widget ui-widget-content").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); this.menu.element.remove(); a.Widget.prototype.destroy.call(this) }, _setOption: function (b) { a.Widget.prototype._setOption.apply(this, arguments); if (b === "source") { this._initSource() } }, _initSource: function () { var c, b; if (a.isArray(this.options.source)) { c = this.options.source; this.source = function (e, d) { var f = new RegExp(a.ui.autocomplete.escapeRegex(e.term), "i"); d(a.grep(c, function (g) { return f.test(g.label || g.value || g) })) } } else { if (typeof this.options.source === "string") { b = this.options.source; this.source = function (e, d) { a.getJSON(b, e, d) } } else { this.source = this.options.source } } }, search: function (c, b) { c = c != null ? c : this.element.val(); if (c.length < this.options.minLength) { return this.close(b) } clearTimeout(this.closing); if (this._trigger("search") === false) { return } return this._search(c) }, _search: function (b) { this.term = this.element.addClass("ui-autocomplete-loading").val(); this.source({ term: b }, this.response) }, _response: function (b) { if (b.length) { b = this._normalize(b); this._suggest(b); this._trigger("open") } else { this.close() } this.element.removeClass("ui-autocomplete-loading") }, close: function (b) { clearTimeout(this.closing); if (this.menu.element.is(":visible")) { this._trigger("close", b); this.menu.element.hide(); this.menu.deactivate() } if (this.previous !== this.element.val()) { this._trigger("change", b) } }, _normalize: function (b) { if (b.length && b[0].label && b[0].value) { return b } return a.map(b, function (c) { if (typeof c === "string") { return { label: c, value: c} } return a.extend({ label: c.label || c.value, value: c.value || c.label }, c) }) }, _suggest: function (b) { var c = this.menu.element.empty().zIndex(this.element.zIndex() + 1), d, e; this._renderMenu(c, b); this.menu.deactivate(); this.menu.refresh(); this.menu.element.show().position({ my: "left top", at: "left bottom", of: this.element, collision: "none" }); d = c.width("").width(); e = this.element.width(); c.width(Math.max(d, e)) }, _renderMenu: function (d, c) { var b = this; a.each(c, function (e, f) { b._renderItem(d, f) }) }, _renderItem: function (b, c) { return a("<li></li>").data("item.autocomplete", c).append("<a>" + c.label + "</a>").appendTo(b) }, _move: function (c, b) { if (!this.menu.element.is(":visible")) { this.search(null, b); return } if (this.menu.first() && /^previous/.test(c) || this.menu.last() && /^next/.test(c)) { this.element.val(this.term); this.menu.deactivate(); return } this.menu[c]() }, widget: function () { return this.menu.element } }); a.extend(a.ui.autocomplete, { escapeRegex: function (b) { return b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") } }) } (jQuery)); (function (a) { a.widget("ui.menu", { _create: function () { var b = this; this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({ role: "listbox", "aria-activedescendant": "ui-active-menuitem" }).click(function (c) { c.preventDefault(); b.select() }); this.refresh() }, refresh: function () { var c = this; var b = this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "menuitem"); b.children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function () { c.activate(a(this).parent()) }).mouseleave(function () { c.deactivate() }) }, activate: function (d) { this.deactivate(); if (this.hasScroll()) { var e = d.offset().top - this.element.offset().top, b = this.element.attr("scrollTop"), c = this.element.height(); if (e < 0) { this.element.attr("scrollTop", b + e) } else { if (e > c) { this.element.attr("scrollTop", b + e - c + d.height()) } } } this.active = d.eq(0).children("a").addClass("ui-state-hover").attr("id", "ui-active-menuitem").end(); this._trigger("focus", null, { item: d }) }, deactivate: function () { if (!this.active) { return } this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); this._trigger("blur"); this.active = null }, next: function () { this.move("next", "li:first") }, previous: function () { this.move("prev", "li:last") }, first: function () { return this.active && !this.active.prev().length }, last: function () { return this.active && !this.active.next().length }, move: function (d, c) { if (!this.active) { this.activate(this.element.children(c)); return } var b = this.active[d](); if (b.length) { this.activate(b) } else { this.activate(this.element.children(c)) } }, nextPage: function () { if (this.hasScroll()) { if (!this.active || this.last()) { this.activate(this.element.children(":first")); return } var d = this.active.offset().top, c = this.element.height(), b = this.element.children("li").filter(function () { var e = a(this).offset().top - d - c + a(this).height(); return e < 10 && e > -10 }); if (!b.length) { b = this.element.children(":last") } this.activate(b) } else { this.activate(this.element.children(!this.active || this.last() ? ":first" : ":last")) } }, previousPage: function () { if (this.hasScroll()) { if (!this.active || this.first()) { this.activate(this.element.children(":last")); return } var c = this.active.offset().top, b = this.element.height(); result = this.element.children("li").filter(function () { var d = a(this).offset().top - c + b - a(this).height(); return d < 10 && d > -10 }); if (!result.length) { result = this.element.children(":first") } this.activate(result) } else { this.activate(this.element.children(!this.active || this.first() ? ":last" : ":first")) } }, hasScroll: function () { return this.element.height() < this.element.attr("scrollHeight") }, select: function () { this._trigger("selected", null, { item: this.active }) } }) } (jQuery)); ; 
/*
 * jQuery UI Dialog 1.8
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */
(function (b) { var a = "ui-dialog ui-widget ui-widget-content ui-corner-all "; b.widget("ui.dialog", { 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: "center", resizable: true, show: null, stack: true, title: "", width: 300, zIndex: 1000 }, _create: function () { this.originalTitle = this.element.attr("title"); var k = this, l = k.options, i = l.title || k.originalTitle || "&#160;", d = b.ui.dialog.getTitleId(k.element), j = (k.uiDialog = b("<div></div>")).appendTo(document.body).hide().addClass(a + l.dialogClass).css({ zIndex: l.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function (m) { if (l.closeOnEscape && m.keyCode && m.keyCode === b.ui.keyCode.ESCAPE) { k.close(m); m.preventDefault() } }).attr({ role: "dialog", "aria-labelledby": d }).mousedown(function (m) { k.moveToTop(false, m) }), f = k.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j), e = (k.uiDialogTitlebar = b("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j), h = b('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", "button").hover(function () { h.addClass("ui-state-hover") }, function () { h.removeClass("ui-state-hover") }).focus(function () { h.addClass("ui-state-focus") }).blur(function () { h.removeClass("ui-state-focus") }).click(function (m) { k.close(m); return false }).appendTo(e), g = (k.uiDialogTitlebarCloseText = b("<span></span>")).addClass("ui-icon ui-icon-closethick").text(l.closeText).appendTo(h), c = b("<span></span>").addClass("ui-dialog-title").attr("id", d).html(i).prependTo(e); if (b.isFunction(l.beforeclose) && !b.isFunction(l.beforeClose)) { l.beforeClose = l.beforeclose } e.find("*").add(e).disableSelection(); if (l.draggable && b.fn.draggable) { k._makeDraggable() } if (l.resizable && b.fn.resizable) { k._makeResizable() } k._createButtons(l.buttons); k._isOpen = false; if (b.fn.bgiframe) { j.bgiframe() } }, _init: function () { if (this.options.autoOpen) { this.open() } }, destroy: function () { var c = this; if (c.overlay) { c.overlay.destroy() } c.uiDialog.hide(); c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); c.uiDialog.remove(); if (c.originalTitle) { c.element.attr("title", c.originalTitle) } return c }, widget: function () { return this.uiDialog }, close: function (e) { var c = this, d; if (false === c._trigger("beforeClose", e)) { return } if (c.overlay) { c.overlay.destroy() } c.uiDialog.unbind("keypress.ui-dialog"); c._isOpen = false; if (c.options.hide) { c.uiDialog.hide(c.options.hide, function () { c._trigger("close", e) }) } else { c.uiDialog.hide(); c._trigger("close", e) } b.ui.dialog.overlay.resize(); if (c.options.modal) { d = 0; b(".ui-dialog").each(function () { if (this !== c.uiDialog[0]) { d = Math.max(d, b(this).css("z-index")) } }); b.ui.dialog.maxZ = d } return c }, isOpen: function () { return this._isOpen }, moveToTop: function (g, f) { var c = this, e = c.options, d; if ((e.modal && !g) || (!e.stack && !e.modal)) { return c._trigger("focus", f) } if (e.zIndex > b.ui.dialog.maxZ) { b.ui.dialog.maxZ = e.zIndex } if (c.overlay) { b.ui.dialog.maxZ += 1; c.overlay.$el.css("z-index", b.ui.dialog.overlay.maxZ = b.ui.dialog.maxZ) } d = { scrollTop: c.element.attr("scrollTop"), scrollLeft: c.element.attr("scrollLeft") }; b.ui.dialog.maxZ += 1; c.uiDialog.css("z-index", b.ui.dialog.maxZ); c.element.attr(d); c._trigger("focus", f); return c }, open: function () { if (this._isOpen) { return } var d = this, e = d.options, c = d.uiDialog; d.overlay = e.modal ? new b.ui.dialog.overlay(d) : null; if (c.next().length) { c.appendTo("body") } d._size(); d._position(e.position); c.show(e.show); d.moveToTop(true); if (e.modal) { c.bind("keypress.ui-dialog", function (h) { if (h.keyCode !== b.ui.keyCode.TAB) { return } var g = b(":tabbable", this), i = g.filter(":first"), f = g.filter(":last"); if (h.target === f[0] && !h.shiftKey) { i.focus(1); return false } else { if (h.target === i[0] && h.shiftKey) { f.focus(1); return false } } }) } b([]).add(c.find(".ui-dialog-content :tabbable:first")).add(c.find(".ui-dialog-buttonpane :tabbable:first")).add(c).filter(":first").focus(); d._trigger("open"); d._isOpen = true; return d }, _createButtons: function (f) { var e = this, c = false, d = b("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"); e.uiDialog.find(".ui-dialog-buttonpane").remove(); if (typeof f === "object" && f !== null) { b.each(f, function () { return !(c = true) }) } if (c) { b.each(f, function (g, i) { var h = b('<button type="button"></button>').text(g).click(function () { i.apply(e.element[0], arguments) }).appendTo(d); if (b.fn.button) { h.button() } }); d.appendTo(e.uiDialog) } }, _makeDraggable: function () { var c = this, f = c.options, g = b(document), e; function d(h) { return { position: h.position, offset: h.offset} } c.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function (h, i) { e = f.height === "auto" ? "auto" : b(this).height(); b(this).height(b(this).height()).addClass("ui-dialog-dragging"); c._trigger("dragStart", h, d(i)) }, drag: function (h, i) { c._trigger("drag", h, d(i)) }, stop: function (h, i) { f.position = [i.position.left - g.scrollLeft(), i.position.top - g.scrollTop()]; b(this).removeClass("ui-dialog-dragging").height(e); c._trigger("dragStop", h, d(i)); b.ui.dialog.overlay.resize() } }) }, _makeResizable: function (h) { h = (h === undefined ? this.options.resizable : h); var d = this, g = d.options, c = d.uiDialog.css("position"), f = (typeof h === "string" ? h : "n,e,s,w,se,sw,ne,nw"); function e(i) { return { originalPosition: i.originalPosition, originalSize: i.originalSize, position: i.position, size: i.size} } d.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: d.element, maxWidth: g.maxWidth, maxHeight: g.maxHeight, minWidth: g.minWidth, minHeight: d._minHeight(), handles: f, start: function (i, j) { b(this).addClass("ui-dialog-resizing"); d._trigger("resizeStart", i, e(j)) }, resize: function (i, j) { d._trigger("resize", i, e(j)) }, stop: function (i, j) { b(this).removeClass("ui-dialog-resizing"); g.height = b(this).height(); g.width = b(this).width(); d._trigger("resizeStop", i, e(j)); b.ui.dialog.overlay.resize() } }).css("position", c).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se") }, _minHeight: function () { var c = this.options; if (c.height === "auto") { return c.minHeight } else { return Math.min(c.minHeight, c.height) } }, _position: function (d) { var e = [], f = [0, 0], c; d = d || b.ui.dialog.prototype.options.position; if (typeof d === "string" || (typeof d === "object" && "0" in d)) { e = d.split ? d.split(" ") : [d[0], d[1]]; if (e.length === 1) { e[1] = e[0] } b.each(["left", "top"], function (h, g) { if (+e[h] === e[h]) { f[h] = e[h]; e[h] = g } }) } else { if (typeof d === "object") { if ("left" in d) { e[0] = "left"; f[0] = d.left } else { if ("right" in d) { e[0] = "right"; f[0] = -d.right } } if ("top" in d) { e[1] = "top"; f[1] = d.top } else { if ("bottom" in d) { e[1] = "bottom"; f[1] = -d.bottom } } } } c = this.uiDialog.is(":visible"); if (!c) { this.uiDialog.show() } this.uiDialog.css({ top: 0, left: 0 }).position({ my: e.join(" "), at: e.join(" "), offset: f.join(" "), of: window, collision: "fit", using: function (h) { var g = b(this).css(h).offset().top; if (g < 0) { b(this).css("top", h.top - g) } } }); if (!c) { this.uiDialog.hide() } }, _setOption: function (f, g) { var d = this, c = d.uiDialog, h = c.is(":data(resizable)"), e = false; switch (f) { case "beforeclose": f = "beforeClose"; break; case "buttons": d._createButtons(g); break; case "closeText": d.uiDialogTitlebarCloseText.text("" + g); break; case "dialogClass": c.removeClass(d.options.dialogClass).addClass(a + g); break; case "disabled": if (g) { c.addClass("ui-dialog-disabled") } else { c.removeClass("ui-dialog-disabled") } break; case "draggable": if (g) { d._makeDraggable() } else { c.draggable("destroy") } break; case "height": e = true; break; case "maxHeight": if (h) { c.resizable("option", "maxHeight", g) } e = true; break; case "maxWidth": if (h) { c.resizable("option", "maxWidth", g) } e = true; break; case "minHeight": if (h) { c.resizable("option", "minHeight", g) } e = true; break; case "minWidth": if (h) { c.resizable("option", "minWidth", g) } e = true; break; case "position": d._position(g); break; case "resizable": if (h && !g) { c.resizable("destroy") } if (h && typeof g === "string") { c.resizable("option", "handles", g) } if (!h && g !== false) { d._makeResizable(g) } break; case "title": b(".ui-dialog-title", d.uiDialogTitlebar).html("" + (g || "&#160;")); break; case "width": e = true; break } b.Widget.prototype._setOption.apply(d, arguments); if (e) { d._size() } }, _size: function () { var d = this.options, c; this.element.css("width", "auto").hide(); c = this.uiDialog.css({ height: "auto", width: d.width }).height(); this.element.css(d.height === "auto" ? { minHeight: Math.max(d.minHeight - c, 0), height: "auto"} : { minHeight: 0, height: Math.max(d.height - c, 0) }).show(); if (this.uiDialog.is(":data(resizable)")) { this.uiDialog.resizable("option", "minHeight", this._minHeight()) } } }); b.extend(b.ui.dialog, { version: "1.8", uuid: 0, maxZ: 0, getTitleId: function (c) { var d = c.attr("id"); if (!d) { this.uuid += 1; d = this.uuid } return "ui-dialog-title-" + d }, overlay: function (c) { this.$el = b.ui.dialog.overlay.create(c) } }); b.extend(b.ui.dialog.overlay, { instances: [], oldInstances: [], maxZ: 0, events: b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function (c) { return c + ".dialog-overlay" }).join(" "), create: function (d) { if (this.instances.length === 0) { setTimeout(function () { if (b.ui.dialog.overlay.instances.length) { b(document).bind(b.ui.dialog.overlay.events, function (e) { return (b(e.target).zIndex() >= b.ui.dialog.overlay.maxZ) }) } }, 1); b(document).bind("keydown.dialog-overlay", function (e) { if (d.options.closeOnEscape && e.keyCode && e.keyCode === b.ui.keyCode.ESCAPE) { d.close(e); e.preventDefault() } }); b(window).bind("resize.dialog-overlay", b.ui.dialog.overlay.resize) } var c = (this.oldInstances.pop() || b("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({ width: this.width(), height: this.height() }); if (b.fn.bgiframe) { c.bgiframe() } this.instances.push(c); return c }, destroy: function (c) { this.oldInstances.push(this.instances.splice(b.inArray(c, this.instances), 1)[0]); if (this.instances.length === 0) { b([document, window]).unbind(".dialog-overlay") } c.remove(); var d = 0; b.each(this.instances, function () { d = Math.max(d, this.css("z-index")) }); this.maxZ = d }, height: function () { var d, c; if (b.browser.msie && b.browser.version < 7) { d = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); c = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); if (d < c) { return b(window).height() + "px" } else { return d + "px" } } else { return b(document).height() + "px" } }, width: function () { var c, d; if (b.browser.msie && b.browser.version < 7) { c = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); d = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if (c < d) { return b(window).width() + "px" } else { return c + "px" } } else { return b(document).width() + "px" } }, resize: function () { var c = b([]); b.each(b.ui.dialog.overlay.instances, function () { c = c.add(this) }); c.css({ width: 0, height: 0 }).css({ width: b.ui.dialog.overlay.width(), height: b.ui.dialog.overlay.height() }) } }); b.extend(b.ui.dialog.overlay.prototype, { destroy: function () { b.ui.dialog.overlay.destroy(this.$el) } }) } (jQuery)); ;