/*********************
SCRIPTS INCLUDES IN THIS FILE
1. scripts/jquery-1.6.2.min.js
2. jquery.json-2.2.js
3. jquery.validate.1.9.0.min.js
4. google.webfont.js
5. jquery.mousewheel.js
6. jquery.jscrollpane.min.js
7. jquery.autocomplete.js
8. jquery.ui.core.js
9. jquery.ui.widget.js
10. jquery.ui.mouse.js
11. jquery.ui.slider.js
12. jquery.textshadow.js
12+1. Karira.APPPublic.API.js
14. json2.js
15. jquery.cookie.js
16. flowplayer-3.2.6.min.js
17. jquery.anythingslider.js
*********************/
/************************ 1. jquery-1.6.2.min.js ************************/
/*!
* jQuery UI 1.8.16
*
* 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) {
    function c(h, g) { var i = h.nodeName.toLowerCase(); if ("area" === i) { g = h.parentNode; i = g.name; if (!h.href || !i || g.nodeName.toLowerCase() !== "map") return false; h = a("img[usemap=#" + i + "]")[0]; return !!h && e(h) } return (/input|select|textarea|button|object/.test(i) ? !h.disabled : "a" == i ? h.href || g : g) && e(h) } function e(h) { return !a(h).parents().andSelf().filter(function () { return a.curCSS(this, "visibility") === "hidden" || a.expr.filters.hidden(this) }).length } a.ui = a.ui || {}; if (!a.ui.version) {
        a.extend(a.ui, { version: "1.8.16",
            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({ propAttr: a.fn.prop || a.fn.attr, _focus: a.fn.focus, focus: function (h, g) {
            return typeof h === "number" ? this.each(function () {
                var i =
this; setTimeout(function () { a(i).focus(); g && g.call(i) }, h)
            }) : this._focus.apply(this, arguments)
        }, scrollParent: function () {
            var h; h = a.browser.msie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? 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) : 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")) || !h.length ? a(document) : h
        }, zIndex: function (h) { if (h !== d) return this.css("zIndex", h); if (this.length) { h = a(this[0]); for (var g; h.length && h[0] !== document; ) { g = h.css("position"); if (g === "absolute" || g === "relative" || g === "fixed") { g = parseInt(h.css("zIndex"), 10); if (!isNaN(g) && g !== 0) return g } h = h.parent() } } return 0 }, disableSelection: function () {
            return this.bind((a.support.selectstart ? "selectstart" :
"mousedown") + ".ui-disableSelection", function (h) { h.preventDefault() })
        }, enableSelection: function () { return this.unbind(".ui-disableSelection") } 
        }); a.each(["Width", "Height"], function (h, g) {
            function i(l, o, n, k) { a.each(b, function () { o -= parseFloat(a.curCSS(l, "padding" + this, true)) || 0; if (n) o -= parseFloat(a.curCSS(l, "border" + this + "Width", true)) || 0; if (k) o -= parseFloat(a.curCSS(l, "margin" + this, true)) || 0 }); return o } var b = g === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], f = g.toLowerCase(), j = { innerWidth: a.fn.innerWidth, innerHeight: a.fn.innerHeight,
                outerWidth: a.fn.outerWidth, outerHeight: a.fn.outerHeight
            }; a.fn["inner" + g] = function (l) { if (l === d) return j["inner" + g].call(this); return this.each(function () { a(this).css(f, i(this, l) + "px") }) }; a.fn["outer" + g] = function (l, o) { if (typeof l !== "number") return j["outer" + g].call(this, l); return this.each(function () { a(this).css(f, i(this, l, true, o) + "px") }) } 
        }); a.extend(a.expr[":"], { data: function (h, g, i) { return !!a.data(h, i[3]) }, focusable: function (h) { return c(h, !isNaN(a.attr(h, "tabindex"))) }, tabbable: function (h) {
            var g = a.attr(h,
"tabindex"), i = isNaN(g); return (i || g >= 0) && c(h, !i)
        } 
        }); a(function () { var h = document.body, g = h.appendChild(g = document.createElement("div")); a.extend(g.style, { minHeight: "100px", height: "auto", padding: 0, borderWidth: 0 }); a.support.minHeight = g.offsetHeight === 100; a.support.selectstart = "onselectstart" in g; h.removeChild(g).style.display = "none" }); a.extend(a.ui, { plugin: { add: function (h, g, i) { h = a.ui[h].prototype; for (var b in i) { h.plugins[b] = h.plugins[b] || []; h.plugins[b].push([g, i[b]]) } }, call: function (h, g, i) {
            if ((g = h.plugins[g]) &&
h.element[0].parentNode) for (var b = 0; b < g.length; b++) h.options[g[b][0]] && g[b][1].apply(h.element, i)
        } 
        }, contains: function (h, g) { return document.compareDocumentPosition ? h.compareDocumentPosition(g) & 16 : h !== g && h.contains(g) }, hasScroll: function (h, g) { if (a(h).css("overflow") === "hidden") return false; g = g && g === "left" ? "scrollLeft" : "scrollTop"; var i = false; if (h[g] > 0) return true; h[g] = 1; i = h[g] > 0; h[g] = 0; return i }, isOverAxis: function (h, g, i) { return h > g && h < g + i }, isOver: function (h, g, i, b, f, j) {
            return a.ui.isOverAxis(h, i, f) &&
a.ui.isOverAxis(g, b, j)
        } 
        })
    } 
})(jQuery);
(function (a, d) {
    if (a.cleanData) { var c = a.cleanData; a.cleanData = function (h) { for (var g = 0, i; (i = h[g]) != null; g++) try { a(i).triggerHandler("remove") } catch (b) { } c(h) } } else { var e = a.fn.remove; a.fn.remove = function (h, g) { return this.each(function () { if (!g) if (!h || a.filter(h, [this]).length) a("*", this).add([this]).each(function () { try { a(this).triggerHandler("remove") } catch (i) { } }); return e.call(a(this), h, g) }) } } a.widget = function (h, g, i) {
        var b = h.split(".")[0], f; h = h.split(".")[1]; f = b + "-" + h; if (!i) { i = g; g = a.Widget } a.expr[":"][f] =
function (j) { return !!a.data(j, h) }; a[b] = a[b] || {}; a[b][h] = function (j, l) { arguments.length && this._createWidget(j, l) }; g = new g; g.options = a.extend(true, {}, g.options); a[b][h].prototype = a.extend(true, g, { namespace: b, widgetName: h, widgetEventPrefix: a[b][h].prototype.widgetEventPrefix || h, widgetBaseClass: f }, i); a.widget.bridge(h, a[b][h])
    }; a.widget.bridge = function (h, g) {
        a.fn[h] = function (i) {
            var b = typeof i === "string", f = Array.prototype.slice.call(arguments, 1), j = this; i = !b && f.length ? a.extend.apply(null, [true, i].concat(f)) :
i; if (b && i.charAt(0) === "_") return j; b ? this.each(function () { var l = a.data(this, h), o = l && a.isFunction(l[i]) ? l[i].apply(l, f) : l; if (o !== l && o !== d) { j = o; return false } }) : this.each(function () { var l = a.data(this, h); l ? l.option(i || {})._init() : a.data(this, h, new g(i, this)) }); return j
        } 
    }; a.Widget = function (h, g) { arguments.length && this._createWidget(h, g) }; a.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function (h, g) {
        a.data(g, this.widgetName, this); this.element = a(g); this.options =
a.extend(true, {}, this.options, this._getCreateOptions(), h); var i = this; this.element.bind("remove." + this.widgetName, function () { i.destroy() }); this._create(); this._trigger("create"); this._init()
    }, _getCreateOptions: function () { return a.metadata && a.metadata.get(this.element[0])[this.widgetName] }, _create: function () { }, _init: function () { }, destroy: function () {
        this.element.unbind("." + this.widgetName).removeData(this.widgetName); this.widget().unbind("." + this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass +
"-disabled ui-state-disabled")
    }, widget: function () { return this.element }, option: function (h, g) { var i = h; if (arguments.length === 0) return a.extend({}, this.options); if (typeof h === "string") { if (g === d) return this.options[h]; i = {}; i[h] = g } this._setOptions(i); return this }, _setOptions: function (h) { var g = this; a.each(h, function (i, b) { g._setOption(i, b) }); return this }, _setOption: function (h, g) {
        this.options[h] = g; if (h === "disabled") this.widget()[g ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled ui-state-disabled").attr("aria-disabled",
g); return this
    }, enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _trigger: function (h, g, i) { var b = this.options[h]; g = a.Event(g); g.type = (h === this.widgetEventPrefix ? h : this.widgetEventPrefix + h).toLowerCase(); i = i || {}; if (g.originalEvent) { h = a.event.props.length; for (var f; h; ) { f = a.event.props[--h]; g[f] = g.originalEvent[f] } } this.element.trigger(g, i); return !(a.isFunction(b) && b.call(this.element[0], g, i) === false || g.isDefaultPrevented()) } 
    }
})(jQuery);
(function (a) {
    var d = false; a(document).mouseup(function () { d = false }); a.widget("ui.mouse", { options: { cancel: ":input,option", distance: 1, delay: 0 }, _mouseInit: function () { var c = this; this.element.bind("mousedown." + this.widgetName, function (e) { return c._mouseDown(e) }).bind("click." + this.widgetName, function (e) { if (true === a.data(e.target, c.widgetName + ".preventClickEvent")) { a.removeData(e.target, c.widgetName + ".preventClickEvent"); e.stopImmediatePropagation(); return false } }); this.started = false }, _mouseDestroy: function () {
        this.element.unbind("." +
this.widgetName)
    }, _mouseDown: function (c) {
        if (!d) {
            this._mouseStarted && this._mouseUp(c); this._mouseDownEvent = c; var e = this, h = c.which == 1, g = typeof this.options.cancel == "string" && c.target.nodeName ? a(c.target).closest(this.options.cancel).length : false; if (!h || g || !this._mouseCapture(c)) return true; this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) this._mouseDelayTimer = setTimeout(function () { e.mouseDelayMet = true }, this.options.delay); if (this._mouseDistanceMet(c) && this._mouseDelayMet(c)) {
                this._mouseStarted =
this._mouseStart(c) !== false; if (!this._mouseStarted) { c.preventDefault(); return true } 
            } true === a.data(c.target, this.widgetName + ".preventClickEvent") && a.removeData(c.target, this.widgetName + ".preventClickEvent"); this._mouseMoveDelegate = function (i) { return e._mouseMove(i) }; this._mouseUpDelegate = function (i) { return e._mouseUp(i) }; a(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); c.preventDefault(); return d = true
        } 
    }, _mouseMove: function (c) {
        if (a.browser.msie &&
!(document.documentMode >= 9) && !c.button) return this._mouseUp(c); if (this._mouseStarted) { this._mouseDrag(c); return c.preventDefault() } if (this._mouseDistanceMet(c) && this._mouseDelayMet(c)) (this._mouseStarted = this._mouseStart(this._mouseDownEvent, c) !== false) ? this._mouseDrag(c) : this._mouseUp(c); return !this._mouseStarted
    }, _mouseUp: function (c) {
        a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) {
            this._mouseStarted =
false; c.target == this._mouseDownEvent.target && a.data(c.target, this.widgetName + ".preventClickEvent", true); this._mouseStop(c)
        } return false
    }, _mouseDistanceMet: function (c) { return Math.max(Math.abs(this._mouseDownEvent.pageX - c.pageX), Math.abs(this._mouseDownEvent.pageY - c.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return true } 
    })
})(jQuery);
(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")) { this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy(); return this } }, _mouseCapture: function (d) {
        var c =
this.options; if (this.helper || c.disabled || a(d.target).is(".ui-resizable-handle")) return false; this.handle = this._getHandle(d); if (!this.handle) return false; if (c.iframeFix) a(c.iframeFix === true ? "iframe" : c.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: 1E3 }).css(a(this).offset()).appendTo("body") }); return true
    }, _mouseStart: function (d) {
        var c = this.options;
        this.helper = this._createHelper(d); 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: d.pageX - this.offset.left, top: d.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() });
        this.originalPosition = this.position = this._generatePosition(d); this.originalPageX = d.pageX; this.originalPageY = d.pageY; c.cursorAt && this._adjustOffsetFromHelper(c.cursorAt); c.containment && this._setContainment(); if (this._trigger("start", d) === false) { this._clear(); return false } this._cacheHelperProportions(); a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, d); this.helper.addClass("ui-draggable-dragging"); this._mouseDrag(d, true); a.ui.ddmanager && a.ui.ddmanager.dragStart(this, d); return true
    },
        _mouseDrag: function (d, c) { this.position = this._generatePosition(d); this.positionAbs = this._convertPositionTo("absolute"); if (!c) { c = this._uiHash(); if (this._trigger("drag", d, 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"; a.ui.ddmanager && a.ui.ddmanager.drag(this, d); return false }, _mouseStop: function (d) {
            var c =
false; if (a.ui.ddmanager && !this.options.dropBehaviour) c = a.ui.ddmanager.drop(this, d); if (this.dropped) { c = this.dropped; this.dropped = false } if ((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original") return false; if (this.options.revert == "invalid" && !c || this.options.revert == "valid" && c || this.options.revert === true || a.isFunction(this.options.revert) && this.options.revert.call(this.element, c)) {
                var e = this; a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration,
10), function () { e._trigger("stop", d) !== false && e._clear() })
            } else this._trigger("stop", d) !== false && this._clear(); return false
        }, _mouseUp: function (d) { this.options.iframeFix === true && a("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }); a.ui.ddmanager && a.ui.ddmanager.dragStop(this, d); return a.ui.mouse.prototype._mouseUp.call(this, d) }, cancel: function () { this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(); return this }, _getHandle: function (d) {
            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 == d.target) c = true }); return c
        }, _createHelper: function (d) {
            var c = this.options; d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [d])) : c.helper == "clone" ? this.element.clone().removeAttr("id") : this.element; d.parents("body").length || d.appendTo(c.appendTo == "parent" ? this.element[0].parentNode : c.appendTo); d[0] != this.element[0] && !/(fixed|absolute)/.test(d.css("position")) &&
d.css("position", "absolute"); return d
        }, _adjustOffsetFromHelper: function (d) { if (typeof d == "string") d = d.split(" "); if (a.isArray(d)) d = { left: +d[0], top: +d[1] || 0 }; if ("left" in d) this.offset.click.left = d.left + this.margins.left; if ("right" in d) this.offset.click.left = this.helperProportions.width - d.right + this.margins.left; if ("top" in d) this.offset.click.top = d.top + this.margins.top; if ("bottom" in d) this.offset.click.top = this.helperProportions.height - d.bottom + this.margins.top }, _getParentOffset: function () {
            this.offsetParent =
this.helper.offsetParent(); var d = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) { d.left += this.scrollParent.scrollLeft(); d.top += this.scrollParent.scrollTop() } if (this.offsetParent[0] == document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie) d = { top: 0, left: 0 }; return { top: d.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: d.left + (parseInt(this.offsetParent.css("borderLeftWidth"),
10) || 0)
}
        }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var d = this.element.position(); return { top: d.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: d.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 d = this.options; if (d.containment == "parent") d.containment = this.helper[0].parentNode; if (d.containment == "document" || d.containment == "window") this.containment = [d.containment == "document" ? 0 : a(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, d.containment == "document" ? 0 : a(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
(d.containment == "document" ? 0 : a(window).scrollLeft()) + a(d.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (d.containment == "document" ? 0 : a(window).scrollTop()) + (a(d.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(d.containment) && d.containment.constructor != Array) {
                d = a(d.containment); var c = d[0]; if (c) {
                    d.offset(); var e = a(c).css("overflow") !=
"hidden"; this.containment = [(parseInt(a(c).css("borderLeftWidth"), 10) || 0) + (parseInt(a(c).css("paddingLeft"), 10) || 0), (parseInt(a(c).css("borderTopWidth"), 10) || 0) + (parseInt(a(c).css("paddingTop"), 10) || 0), (e ? 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 - this.margins.right, (e ? 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 - this.margins.bottom]; this.relative_container = d
                } 
            } else if (d.containment.constructor == Array) this.containment = d.containment
        }, _convertPositionTo: function (d, c) {
            if (!c) c = this.position; d = d == "absolute" ? 1 : -1; var e = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = /(html|body)/i.test(e[0].tagName); return { top: c.top +
this.offset.relative.top * d + this.offset.parent.top * d - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : h ? 0 : e.scrollTop()) * d), left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - (a.browser.safari && a.browser.version < 526 && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : h ? 0 : e.scrollLeft()) * d)
            }
        }, _generatePosition: function (d) {
            var c = this.options, e = this.cssPosition == "absolute" &&
!(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = /(html|body)/i.test(e[0].tagName), g = d.pageX, i = d.pageY; if (this.originalPosition) {
                var b; if (this.containment) {
                    if (this.relative_container) { b = this.relative_container.offset(); b = [this.containment[0] + b.left, this.containment[1] + b.top, this.containment[2] + b.left, this.containment[3] + b.top] } else b = this.containment; if (d.pageX - this.offset.click.left < b[0]) g = b[0] + this.offset.click.left;
                    if (d.pageY - this.offset.click.top < b[1]) i = b[1] + this.offset.click.top; if (d.pageX - this.offset.click.left > b[2]) g = b[2] + this.offset.click.left; if (d.pageY - this.offset.click.top > b[3]) i = b[3] + this.offset.click.top
                } if (c.grid) {
                    i = c.grid[1] ? this.originalPageY + Math.round((i - this.originalPageY) / c.grid[1]) * c.grid[1] : this.originalPageY; i = b ? !(i - this.offset.click.top < b[1] || i - this.offset.click.top > b[3]) ? i : !(i - this.offset.click.top < b[1]) ? i - c.grid[1] : i + c.grid[1] : i; g = c.grid[0] ? this.originalPageX + Math.round((g - this.originalPageX) /
c.grid[0]) * c.grid[0] : this.originalPageX; g = b ? !(g - this.offset.click.left < b[0] || g - this.offset.click.left > b[2]) ? g : !(g - this.offset.click.left < b[0]) ? g - c.grid[0] : g + c.grid[0] : g
                } 
            } return { top: i - 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() : h ? 0 : e.scrollTop()), left: g - 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() : h ? 0 : e.scrollLeft())
            }
        }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"); this.helper[0] != this.element[0] && !this.cancelHelperRemoval && this.helper.remove(); this.helper = null; this.cancelHelperRemoval = false }, _trigger: function (d, c, e) {
            e = e || this._uiHash(); a.ui.plugin.call(this, d, [c, e]); if (d == "drag") this.positionAbs = this._convertPositionTo("absolute"); return a.Widget.prototype._trigger.call(this, d, c,
e)
        }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } 
    }); a.extend(a.ui.draggable, { version: "1.8.16" }); a.ui.plugin.add("draggable", "connectToSortable", { start: function (d, c) {
        var e = a(this).data("draggable"), h = e.options, g = a.extend({}, c, { item: e.element }); e.sortables = []; a(h.connectToSortable).each(function () {
            var i = a.data(this, "sortable"); if (i && !i.options.disabled) {
                e.sortables.push({ instance: i, shouldRevert: i.options.revert });
                i.refreshPositions(); i._trigger("activate", d, g)
            } 
        })
    }, stop: function (d, c) {
        var e = a(this).data("draggable"), h = a.extend({}, c, { 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; e.options.helper == "original" && this.instance.currentItem.css({ top: "auto", left: "auto" }) } else {
                this.instance.cancelHelperRemoval =
false; this.instance._trigger("deactivate", d, h)
            } 
        })
    }, drag: function (d, c) {
        var e = a(this).data("draggable"), h = this; a.each(e.sortables, function () {
            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(h).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 c.helper[0] }; d.target = this.instance.currentItem[0]; this.instance._mouseCapture(d, true); this.instance._mouseStart(d, 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", d); e.dropped = this.instance.element; e.currentItem = e.element; this.instance.fromOutside = e
                } 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(); this.instance.placeholder &&
this.instance.placeholder.remove(); e._trigger("fromSortable", d); e.dropped = false
            } 
        })
    } 
    }); a.ui.plugin.add("draggable", "cursor", { start: function () { var d = a("body"), c = a(this).data("draggable").options; if (d.css("cursor")) c._cursor = d.css("cursor"); d.css("cursor", c.cursor) }, stop: function () { var d = a(this).data("draggable").options; d._cursor && a("body").css("cursor", d._cursor) } }); a.ui.plugin.add("draggable", "opacity", { start: function (d, c) {
        d = a(c.helper); c = a(this).data("draggable").options; if (d.css("opacity")) c._opacity =
d.css("opacity"); d.css("opacity", c.opacity)
    }, stop: function (d, c) { d = a(this).data("draggable").options; d._opacity && a(c.helper).css("opacity", d._opacity) } 
    }); a.ui.plugin.add("draggable", "scroll", { start: function () { var d = a(this).data("draggable"); if (d.scrollParent[0] != document && d.scrollParent[0].tagName != "HTML") d.overflowOffset = d.scrollParent.offset() }, drag: function (d) {
        var c = a(this).data("draggable"), e = c.options, h = false; if (c.scrollParent[0] != document && c.scrollParent[0].tagName != "HTML") {
            if (!e.axis || e.axis !=
"x") if (c.overflowOffset.top + c.scrollParent[0].offsetHeight - d.pageY < e.scrollSensitivity) c.scrollParent[0].scrollTop = h = c.scrollParent[0].scrollTop + e.scrollSpeed; else if (d.pageY - c.overflowOffset.top < e.scrollSensitivity) c.scrollParent[0].scrollTop = h = c.scrollParent[0].scrollTop - e.scrollSpeed; if (!e.axis || e.axis != "y") if (c.overflowOffset.left + c.scrollParent[0].offsetWidth - d.pageX < e.scrollSensitivity) c.scrollParent[0].scrollLeft = h = c.scrollParent[0].scrollLeft + e.scrollSpeed; else if (d.pageX - c.overflowOffset.left <
e.scrollSensitivity) c.scrollParent[0].scrollLeft = h = c.scrollParent[0].scrollLeft - e.scrollSpeed
        } else {
            if (!e.axis || e.axis != "x") if (d.pageY - a(document).scrollTop() < e.scrollSensitivity) h = a(document).scrollTop(a(document).scrollTop() - e.scrollSpeed); else if (a(window).height() - (d.pageY - a(document).scrollTop()) < e.scrollSensitivity) h = a(document).scrollTop(a(document).scrollTop() + e.scrollSpeed); if (!e.axis || e.axis != "y") if (d.pageX - a(document).scrollLeft() < e.scrollSensitivity) h = a(document).scrollLeft(a(document).scrollLeft() -
e.scrollSpeed); else if (a(window).width() - (d.pageX - a(document).scrollLeft()) < e.scrollSensitivity) h = a(document).scrollLeft(a(document).scrollLeft() + e.scrollSpeed)
        } h !== false && a.ui.ddmanager && !e.dropBehaviour && a.ui.ddmanager.prepareOffsets(c, d)
    } 
    }); a.ui.plugin.add("draggable", "snap", { start: function () {
        var d = a(this).data("draggable"), c = d.options; d.snapElements = []; a(c.snap.constructor != String ? c.snap.items || ":data(draggable)" : c.snap).each(function () {
            var e = a(this), h = e.offset(); this != d.element[0] && d.snapElements.push({ item: this,
                width: e.outerWidth(), height: e.outerHeight(), top: h.top, left: h.left
            })
        })
    }, drag: function (d, c) {
        for (var e = a(this).data("draggable"), h = e.options, g = h.snapTolerance, i = c.offset.left, b = i + e.helperProportions.width, f = c.offset.top, j = f + e.helperProportions.height, l = e.snapElements.length - 1; l >= 0; l--) {
            var o = e.snapElements[l].left, n = o + e.snapElements[l].width, k = e.snapElements[l].top, m = k + e.snapElements[l].height; if (o - g < i && i < n + g && k - g < f && f < m + g || o - g < i && i < n + g && k - g < j && j < m + g || o - g < b && b < n + g && k - g < f && f < m + g || o - g < b && b < n + g && k - g < j &&
j < m + g) {
                if (h.snapMode != "inner") { var p = Math.abs(k - j) <= g, q = Math.abs(m - f) <= g, s = Math.abs(o - b) <= g, r = Math.abs(n - i) <= g; if (p) c.position.top = e._convertPositionTo("relative", { top: k - e.helperProportions.height, left: 0 }).top - e.margins.top; if (q) c.position.top = e._convertPositionTo("relative", { top: m, left: 0 }).top - e.margins.top; if (s) c.position.left = e._convertPositionTo("relative", { top: 0, left: o - e.helperProportions.width }).left - e.margins.left; if (r) c.position.left = e._convertPositionTo("relative", { top: 0, left: n }).left - e.margins.left } var u =
p || q || s || r; if (h.snapMode != "outer") { p = Math.abs(k - f) <= g; q = Math.abs(m - j) <= g; s = Math.abs(o - i) <= g; r = Math.abs(n - b) <= g; if (p) c.position.top = e._convertPositionTo("relative", { top: k, left: 0 }).top - e.margins.top; if (q) c.position.top = e._convertPositionTo("relative", { top: m - e.helperProportions.height, left: 0 }).top - e.margins.top; if (s) c.position.left = e._convertPositionTo("relative", { top: 0, left: o }).left - e.margins.left; if (r) c.position.left = e._convertPositionTo("relative", { top: 0, left: n - e.helperProportions.width }).left - e.margins.left } if (!e.snapElements[l].snapping &&
(p || q || s || r || u)) e.options.snap.snap && e.options.snap.snap.call(e.element, d, a.extend(e._uiHash(), { snapItem: e.snapElements[l].item })); e.snapElements[l].snapping = p || q || s || r || u
            } else { e.snapElements[l].snapping && e.options.snap.release && e.options.snap.release.call(e.element, d, a.extend(e._uiHash(), { snapItem: e.snapElements[l].item })); e.snapElements[l].snapping = false } 
        } 
    } 
    }); a.ui.plugin.add("draggable", "stack", { start: function () {
        var d = a(this).data("draggable").options; d = a.makeArray(a(d.stack)).sort(function (e, h) {
            return (parseInt(a(e).css("zIndex"),
10) || 0) - (parseInt(a(h).css("zIndex"), 10) || 0)
        }); if (d.length) { var c = parseInt(d[0].style.zIndex) || 0; a(d).each(function (e) { this.style.zIndex = c + e }); this[0].style.zIndex = c + d.length } 
    } 
    }); a.ui.plugin.add("draggable", "zIndex", { start: function (d, c) { d = a(c.helper); c = a(this).data("draggable").options; if (d.css("zIndex")) c._zIndex = d.css("zIndex"); d.css("zIndex", c.zIndex) }, stop: function (d, c) { d = a(this).data("draggable").options; d._zIndex && a(c.helper).css("zIndex", d._zIndex) } })
})(jQuery);
(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 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 () { for (var d = a.ui.ddmanager.droppables[this.options.scope], c = 0; c < d.length; c++) d[c] == this && d.splice(c, 1); this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"); return this }, _setOption: function (d, c) { if (d == "accept") this.accept = a.isFunction(c) ? c : function (e) { return e.is(c) }; a.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (d) {
        var c = a.ui.ddmanager.current; 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; 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])) if (this.accept.call(this.element[0], c.currentItem || c.element)) {
            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])) if (this.accept.call(this.element[0], c.currentItem || c.element)) { this.options.hoverClass && this.element.removeClass(this.options.hoverClass); this._trigger("out", d, this.ui(c)) } }, _drop: function (d, c) {
        var e = c || a.ui.ddmanager.current; if (!e || (e.currentItem || e.element)[0] == this.element[0]) return false; var h = 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 == e.options.scope && g.accept.call(g.element[0], e.currentItem || e.element) && a.ui.intersect(e, a.extend(g, { offset: g.element.offset() }), g.options.tolerance)) { h = true; return false } 
        }); if (h) return false; if (this.accept.call(this.element[0], e.currentItem || e.element)) {
            this.options.activeClass && this.element.removeClass(this.options.activeClass); this.options.hoverClass && this.element.removeClass(this.options.hoverClass); this._trigger("drop",
d, this.ui(e)); return this.element
        } return false
    }, ui: function (d) { return { draggable: d.currentItem || d.element, helper: d.helper, position: d.position, offset: d.positionAbs} } 
    }); a.extend(a.ui.droppable, { version: "1.8.16" }); a.ui.intersect = function (d, c, e) {
        if (!c.offset) return false; var h = (d.positionAbs || d.position.absolute).left, g = h + d.helperProportions.width, i = (d.positionAbs || d.position.absolute).top, b = i + d.helperProportions.height, f = c.offset.left, j = f + c.proportions.width, l = c.offset.top, o = l + c.proportions.height;
        switch (e) {
            case "fit": return f <= h && g <= j && l <= i && b <= o; case "intersect": return f < h + d.helperProportions.width / 2 && g - d.helperProportions.width / 2 < j && l < i + d.helperProportions.height / 2 && b - d.helperProportions.height / 2 < o; case "pointer": return a.ui.isOver((d.positionAbs || d.position.absolute).top + (d.clickOffset || d.offset.click).top, (d.positionAbs || d.position.absolute).left + (d.clickOffset || d.offset.click).left, l, f, c.proportions.height, c.proportions.width); case "touch": return (i >= l && i <= o || b >= l && b <= o || i < l && b > o) && (h >=
f && h <= j || g >= f && g <= j || h < f && g > j); default: return false
        } 
    }; a.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function (d, c) {
        var e = a.ui.ddmanager.droppables[d.options.scope] || [], h = c ? c.type : null, g = (d.currentItem || d.element).find(":data(droppable)").andSelf(), i = 0; a: for (; i < e.length; i++) if (!(e[i].options.disabled || d && !e[i].accept.call(e[i].element[0], d.currentItem || d.element))) {
            for (var b = 0; b < g.length; b++) if (g[b] == e[i].element[0]) { e[i].proportions.height = 0; continue a } e[i].visible = e[i].element.css("display") !=
"none"; if (e[i].visible) { h == "mousedown" && e[i]._activate.call(e[i], c); e[i].offset = e[i].element.offset(); e[i].proportions = { width: e[i].element[0].offsetWidth, height: e[i].element[0].offsetHeight} } 
        } 
    }, drop: function (d, c) {
        var e = false; a.each(a.ui.ddmanager.droppables[d.options.scope] || [], function () {
            if (this.options) {
                if (!this.options.disabled && this.visible && a.ui.intersect(d, this, this.options.tolerance)) e = e || this._drop.call(this, c); if (!this.options.disabled && this.visible && this.accept.call(this.element[0], d.currentItem ||
d.element)) { this.isout = 1; this.isover = 0; this._deactivate.call(this, c) } 
            } 
        }); return e
    }, dragStart: function (d, c) { d.element.parents(":not(body,html)").bind("scroll.droppable", function () { d.options.refreshPositions || a.ui.ddmanager.prepareOffsets(d, c) }) }, drag: function (d, c) {
        d.options.refreshPositions && a.ui.ddmanager.prepareOffsets(d, c); a.each(a.ui.ddmanager.droppables[d.options.scope] || [], function () {
            if (!(this.options.disabled || this.greedyChild || !this.visible)) {
                var e = a.ui.intersect(d, this, this.options.tolerance);
                if (e = !e && this.isover == 1 ? "isout" : e && this.isover == 0 ? "isover" : null) { var h; if (this.options.greedy) { var g = this.element.parents(":data(droppable):eq(0)"); if (g.length) { h = a.data(g[0], "droppable"); h.greedyChild = e == "isover" ? 1 : 0 } } if (h && e == "isover") { h.isover = 0; h.isout = 1; h._out.call(h, c) } this[e] = 1; this[e == "isout" ? "isover" : "isout"] = 0; this[e == "isover" ? "_over" : "_out"].call(this, c); if (h && e == "isout") { h.isout = 0; h.isover = 1; h._over.call(h, c) } } 
            } 
        })
    }, dragStop: function (d, c) {
        d.element.parents(":not(body,html)").unbind("scroll.droppable");
        d.options.refreshPositions || a.ui.ddmanager.prepareOffsets(d, c)
    } 
    }
})(jQuery);
(function (a) {
    a.widget("ui.resizable", a.ui.mouse, { 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: 1E3 }, _create: function () {
        var e = this, h = this.options; this.element.addClass("ui-resizable"); a.extend(this, { _aspectRatio: !!h.aspectRatio, aspectRatio: h.aspectRatio, originalElement: this.element,
            _proportionallyResizeElements: [], _helper: h.helper || h.ghost || h.animate ? h.helper || "ui-resizable-helper" : null
        }); if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
            /relative/.test(this.element.css("position")) && a.browser.opera && this.element.css({ position: "relative", top: "auto", left: "auto" }); this.element.wrap(a('<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 = h.handles || (!a(".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 g = this.handles.split(","); this.handles = {}; for (var i = 0; i < g.length; i++) { var b = a.trim(g[i]), f = a('<div class="ui-resizable-handle ' + ("ui-resizable-" + b) + '"></div>'); /sw|se|ne|nw/.test(b) && f.css({ zIndex: ++h.zIndex }); "se" == b && f.addClass("ui-icon ui-icon-gripsmall-diagonal-se"); this.handles[b] = ".ui-resizable-" + b; this.element.append(f) } } this._renderAxis = function (j) {
            j = j || this.element; for (var l in this.handles) {
                if (this.handles[l].constructor ==
String) this.handles[l] = a(this.handles[l], this.element).show(); if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { var o = a(this.handles[l], this.element), n = 0; n = /sw|ne|nw|se|n|s/.test(l) ? o.outerHeight() : o.outerWidth(); o = ["padding", /ne|nw|n/.test(l) ? "Top" : /se|sw|s/.test(l) ? "Bottom" : /^e$/.test(l) ? "Right" : "Left"].join(""); j.css(o, n); this._proportionallyResize() } a(this.handles[l])
            } 
        }; this._renderAxis(this.element); this._handles = a(".ui-resizable-handle", this.element).disableSelection();
        this._handles.mouseover(function () { if (!e.resizing) { if (this.className) var j = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); e.axis = j && j[1] ? j[1] : "se" } }); if (h.autoHide) { this._handles.hide(); a(this.element).addClass("ui-resizable-autohide").hover(function () { if (!h.disabled) { a(this).removeClass("ui-resizable-autohide"); e._handles.show() } }, function () { if (!h.disabled) if (!e.resizing) { a(this).addClass("ui-resizable-autohide"); e._handles.hide() } }) } this._mouseInit()
    }, destroy: function () {
        this._mouseDestroy();
        var e = function (g) { a(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 h = this.element; h.after(this.originalElement.css({ position: h.css("position"), width: h.outerWidth(), height: h.outerHeight(), top: h.css("top"), left: h.css("left") })).remove() } this.originalElement.css("resize", this.originalResizeStyle); e(this.originalElement); return this
    }, _mouseCapture: function (e) {
        var h =
false; for (var g in this.handles) if (a(this.handles[g])[0] == e.target) h = true; return !this.options.disabled && h
    }, _mouseStart: function (e) {
        var h = this.options, g = this.element.position(), i = this.element; this.resizing = true; this.documentScroll = { top: a(document).scrollTop(), left: a(document).scrollLeft() }; if (i.is(".ui-draggable") || /absolute/.test(i.css("position"))) i.css({ position: "absolute", top: g.top, left: g.left }); a.browser.opera && /relative/.test(i.css("position")) && i.css({ position: "relative", top: "auto", left: "auto" });
        this._renderProxy(); g = d(this.helper.css("left")); var b = d(this.helper.css("top")); if (h.containment) { g += a(h.containment).scrollLeft() || 0; b += a(h.containment).scrollTop() || 0 } this.offset = this.helper.offset(); this.position = { left: g, top: b }; this.size = this._helper ? { width: i.outerWidth(), height: i.outerHeight()} : { width: i.width(), height: i.height() }; this.originalSize = this._helper ? { width: i.outerWidth(), height: i.outerHeight()} : { width: i.width(), height: i.height() }; this.originalPosition = { left: g, top: b }; this.sizeDiff =
{ width: i.outerWidth() - i.width(), height: i.outerHeight() - i.height() }; this.originalMousePosition = { left: e.pageX, top: e.pageY }; this.aspectRatio = typeof h.aspectRatio == "number" ? h.aspectRatio : this.originalSize.width / this.originalSize.height || 1; h = a(".ui-resizable-" + this.axis).css("cursor"); a("body").css("cursor", h == "auto" ? this.axis + "-resize" : h); i.addClass("ui-resizable-resizing"); this._propagate("start", e); return true
    }, _mouseDrag: function (e) {
        var h = this.helper, g = this.originalMousePosition, i = this._change[this.axis];
        if (!i) return false; g = i.apply(this, [e, e.pageX - g.left || 0, e.pageY - g.top || 0]); this._updateVirtualBoundaries(e.shiftKey); if (this._aspectRatio || e.shiftKey) g = this._updateRatio(g, e); g = this._respectSize(g, 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" }); !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(); this._updateCache(g); this._trigger("resize", e, this.ui()); return false
    },
        _mouseStop: function (e) {
            this.resizing = false; var h = this.options, g = this; if (this._helper) {
                var i = this._proportionallyResizeElements, b = i.length && /textarea/i.test(i[0].nodeName); i = b && a.ui.hasScroll(i[0], "left") ? 0 : g.sizeDiff.height; b = b ? 0 : g.sizeDiff.width; b = { width: g.helper.width() - b, height: g.helper.height() - i }; i = parseInt(g.element.css("left"), 10) + (g.position.left - g.originalPosition.left) || null; var f = parseInt(g.element.css("top"), 10) + (g.position.top - g.originalPosition.top) || null; h.animate || this.element.css(a.extend(b,
{ top: f, left: i })); g.helper.height(g.size.height); g.helper.width(g.size.width); this._helper && !h.animate && this._proportionallyResize()
            } a("body").css("cursor", "auto"); this.element.removeClass("ui-resizable-resizing"); this._propagate("stop", e); this._helper && this.helper.remove(); return false
        }, _updateVirtualBoundaries: function (e) {
            var h = this.options, g, i, b; h = { minWidth: c(h.minWidth) ? h.minWidth : 0, maxWidth: c(h.maxWidth) ? h.maxWidth : Infinity, minHeight: c(h.minHeight) ? h.minHeight : 0, maxHeight: c(h.maxHeight) ? h.maxHeight :
Infinity
            }; if (this._aspectRatio || e) { e = h.minHeight * this.aspectRatio; i = h.minWidth / this.aspectRatio; g = h.maxHeight * this.aspectRatio; b = h.maxWidth / this.aspectRatio; if (e > h.minWidth) h.minWidth = e; if (i > h.minHeight) h.minHeight = i; if (g < h.maxWidth) h.maxWidth = g; if (b < h.maxHeight) h.maxHeight = b } this._vBoundaries = h
        }, _updateCache: function (e) {
            this.offset = this.helper.offset(); if (c(e.left)) this.position.left = e.left; if (c(e.top)) this.position.top = e.top; if (c(e.height)) this.size.height = e.height; if (c(e.width)) this.size.width =
e.width
        }, _updateRatio: function (e) { var h = this.position, g = this.size, i = this.axis; if (c(e.height)) e.width = e.height * this.aspectRatio; else if (c(e.width)) e.height = e.width / this.aspectRatio; if (i == "sw") { e.left = h.left + (g.width - e.width); e.top = null } if (i == "nw") { e.top = h.top + (g.height - e.height); e.left = h.left + (g.width - e.width) } return e }, _respectSize: function (e) {
            var h = this._vBoundaries, g = this.axis, i = c(e.width) && h.maxWidth && h.maxWidth < e.width, b = c(e.height) && h.maxHeight && h.maxHeight < e.height, f = c(e.width) && h.minWidth &&
h.minWidth > e.width, j = c(e.height) && h.minHeight && h.minHeight > e.height; if (f) e.width = h.minWidth; if (j) e.height = h.minHeight; if (i) e.width = h.maxWidth; if (b) e.height = h.maxHeight; var l = this.originalPosition.left + this.originalSize.width, o = this.position.top + this.size.height, n = /sw|nw|w/.test(g); g = /nw|ne|n/.test(g); if (f && n) e.left = l - h.minWidth; if (i && n) e.left = l - h.maxWidth; if (j && g) e.top = o - h.minHeight; if (b && g) e.top = o - h.maxHeight; if ((h = !e.width && !e.height) && !e.left && e.top) e.top = null; else if (h && !e.top && e.left) e.left =
null; return e
        }, _proportionallyResize: function () {
            if (this._proportionallyResizeElements.length) for (var e = this.helper || this.element, h = 0; h < this._proportionallyResizeElements.length; h++) {
                var g = this._proportionallyResizeElements[h]; if (!this.borderDif) {
                    var i = [g.css("borderTopWidth"), g.css("borderRightWidth"), g.css("borderBottomWidth"), g.css("borderLeftWidth")], b = [g.css("paddingTop"), g.css("paddingRight"), g.css("paddingBottom"), g.css("paddingLeft")]; this.borderDif = a.map(i, function (f, j) {
                        f = parseInt(f, 10) ||
0; j = parseInt(b[j], 10) || 0; return f + j
                    })
                } a.browser.msie && (a(e).is(":hidden") || a(e).parents(":hidden").length) || g.css({ height: e.height() - this.borderDif[0] - this.borderDif[2] || 0, width: e.width() - this.borderDif[1] - this.borderDif[3] || 0 })
            } 
        }, _renderProxy: function () {
            var e = this.options; this.elementOffset = this.element.offset(); if (this._helper) {
                this.helper = this.helper || a('<div style="overflow:hidden;"></div>'); var h = a.browser.msie && a.browser.version < 7, g = h ? 1 : 0; h = h ? 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: ++e.zIndex
                }); this.helper.appendTo("body").disableSelection()
            } else this.helper = this.element
        }, _change: { e: function (e, h) { return { width: this.originalSize.width + h} }, w: function (e, h) { return { left: this.originalPosition.left + h, width: this.originalSize.width - h} }, n: function (e, h, g) { return { top: this.originalPosition.top + g, height: this.originalSize.height - g} }, s: function (e, h, g) {
            return { height: this.originalSize.height +
g
            }
        }, se: function (e, h, g) { return a.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, h, g])) }, sw: function (e, h, g) { return a.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, h, g])) }, ne: function (e, h, g) { return a.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, h, g])) }, nw: function (e, h, g) { return a.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, h, g])) } 
        }, _propagate: function (e, h) {
            a.ui.plugin.call(this, e, [h, this.ui()]);
            e != "resize" && this._trigger(e, h, 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} } 
    }); a.extend(a.ui.resizable, { version: "1.8.16" }); a.ui.plugin.add("resizable", "alsoResize", { start: function () {
        var e = a(this).data("resizable").options, h = function (g) {
            a(g).each(function () {
                var i = a(this); i.data("resizable-alsoresize", { width: parseInt(i.width(),
10), height: parseInt(i.height(), 10), left: parseInt(i.css("left"), 10), top: parseInt(i.css("top"), 10), position: i.css("position")
                })
            })
        }; if (typeof e.alsoResize == "object" && !e.alsoResize.parentNode) if (e.alsoResize.length) { e.alsoResize = e.alsoResize[0]; h(e.alsoResize) } else a.each(e.alsoResize, function (g) { h(g) }); else h(e.alsoResize)
    }, resize: function (e, h) {
        var g = a(this).data("resizable"); e = g.options; var i = g.originalSize, b = g.originalPosition, f = { height: g.size.height - i.height || 0, width: g.size.width - i.width || 0, top: g.position.top -
b.top || 0, left: g.position.left - b.left || 0
        }, j = function (l, o) { a(l).each(function () { var n = a(this), k = a(this).data("resizable-alsoresize"), m = {}, p = o && o.length ? o : n.parents(h.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; a.each(p, function (q, s) { if ((q = (k[s] || 0) + (f[s] || 0)) && q >= 0) m[s] = q || null }); if (a.browser.opera && /relative/.test(n.css("position"))) { g._revertToRelativePosition = true; n.css({ position: "absolute", top: "auto", left: "auto" }) } n.css(m) }) }; typeof e.alsoResize == "object" && !e.alsoResize.nodeType ?
a.each(e.alsoResize, function (l, o) { j(l, o) }) : j(e.alsoResize)
    }, stop: function () { var e = a(this).data("resizable"), h = e.options, g = function (i) { a(i).each(function () { var b = a(this); b.css({ position: b.data("resizable-alsoresize").position }) }) }; if (e._revertToRelativePosition) { e._revertToRelativePosition = false; typeof h.alsoResize == "object" && !h.alsoResize.nodeType ? a.each(h.alsoResize, function (i) { g(i) }) : g(h.alsoResize) } a(this).removeData("resizable-alsoresize") } 
    }); a.ui.plugin.add("resizable", "animate", { stop: function (e) {
        var h =
a(this).data("resizable"), g = h.options, i = h._proportionallyResizeElements, b = i.length && /textarea/i.test(i[0].nodeName), f = b && a.ui.hasScroll(i[0], "left") ? 0 : h.sizeDiff.height; b = { width: h.size.width - (b ? 0 : h.sizeDiff.width), height: h.size.height - f }; f = parseInt(h.element.css("left"), 10) + (h.position.left - h.originalPosition.left) || null; var j = parseInt(h.element.css("top"), 10) + (h.position.top - h.originalPosition.top) || null; h.element.animate(a.extend(b, j && f ? { top: j, left: f} : {}), { duration: g.animateDuration, easing: g.animateEasing,
    step: function () { var l = { width: parseInt(h.element.css("width"), 10), height: parseInt(h.element.css("height"), 10), top: parseInt(h.element.css("top"), 10), left: parseInt(h.element.css("left"), 10) }; i && i.length && a(i[0]).css({ width: l.width, height: l.height }); h._updateCache(l); h._propagate("resize", e) } 
})
    } 
    }); a.ui.plugin.add("resizable", "containment", { start: function () {
        var e = a(this).data("resizable"), h = e.element, g = e.options.containment; if (h = g instanceof a ? g.get(0) : /parent/.test(g) ? h.parent().get(0) : g) {
            e.containerElement =
a(h); if (/document/.test(g) || g == document) { e.containerOffset = { left: 0, top: 0 }; e.containerPosition = { left: 0, top: 0 }; e.parentData = { element: a(document), left: 0, top: 0, width: a(document).width(), height: a(document).height() || document.body.parentNode.scrollHeight} } else {
                var i = a(h), b = []; a(["Top", "Right", "Left", "Bottom"]).each(function (l, o) { b[l] = d(i.css("padding" + o)) }); e.containerOffset = i.offset(); e.containerPosition = i.position(); e.containerSize = { height: i.innerHeight() - b[3], width: i.innerWidth() - b[1] }; g = e.containerOffset;
                var f = e.containerSize.height, j = e.containerSize.width; j = a.ui.hasScroll(h, "left") ? h.scrollWidth : j; f = a.ui.hasScroll(h) ? h.scrollHeight : f; e.parentData = { element: h, left: g.left, top: g.top, width: j, height: f}
            } 
        } 
    }, resize: function (e) {
        var h = a(this).data("resizable"), g = h.options, i = h.containerOffset, b = h.position; e = h._aspectRatio || e.shiftKey; var f = { top: 0, left: 0 }, j = h.containerElement; if (j[0] != document && /static/.test(j.css("position"))) f = i; if (b.left < (h._helper ? i.left : 0)) {
            h.size.width += h._helper ? h.position.left - i.left :
h.position.left - f.left; if (e) h.size.height = h.size.width / g.aspectRatio; h.position.left = g.helper ? i.left : 0
        } if (b.top < (h._helper ? i.top : 0)) { h.size.height += h._helper ? h.position.top - i.top : h.position.top; if (e) h.size.width = h.size.height * g.aspectRatio; h.position.top = h._helper ? i.top : 0 } h.offset.left = h.parentData.left + h.position.left; h.offset.top = h.parentData.top + h.position.top; g = Math.abs((h._helper ? h.offset.left - f.left : h.offset.left - f.left) + h.sizeDiff.width); i = Math.abs((h._helper ? h.offset.top - f.top : h.offset.top -
i.top) + h.sizeDiff.height); b = h.containerElement.get(0) == h.element.parent().get(0); f = /relative|absolute/.test(h.containerElement.css("position")); if (b && f) g -= h.parentData.left; if (g + h.size.width >= h.parentData.width) { h.size.width = h.parentData.width - g; if (e) h.size.height = h.size.width / h.aspectRatio } if (i + h.size.height >= h.parentData.height) { h.size.height = h.parentData.height - i; if (e) h.size.width = h.size.height * h.aspectRatio } 
    }, stop: function () {
        var e = a(this).data("resizable"), h = e.options, g = e.containerOffset, i = e.containerPosition,
b = e.containerElement, f = a(e.helper), j = f.offset(), l = f.outerWidth() - e.sizeDiff.width; f = f.outerHeight() - e.sizeDiff.height; e._helper && !h.animate && /relative/.test(b.css("position")) && a(this).css({ left: j.left - i.left - g.left, width: l, height: f }); e._helper && !h.animate && /static/.test(b.css("position")) && a(this).css({ left: j.left - i.left - g.left, width: l, height: f })
    } 
    }); a.ui.plugin.add("resizable", "ghost", { start: function () {
        var e = a(this).data("resizable"), h = e.options, g = e.size; e.ghost = e.originalElement.clone(); e.ghost.css({ opacity: 0.25,
            display: "block", position: "relative", height: g.height, width: g.width, margin: 0, left: 0, top: 0
        }).addClass("ui-resizable-ghost").addClass(typeof h.ghost == "string" ? h.ghost : ""); e.ghost.appendTo(e.helper)
    }, resize: function () { var e = a(this).data("resizable"); e.ghost && e.ghost.css({ position: "relative", height: e.size.height, width: e.size.width }) }, stop: function () { var e = a(this).data("resizable"); e.ghost && e.helper && e.helper.get(0).removeChild(e.ghost.get(0)) } 
    }); a.ui.plugin.add("resizable", "grid", { resize: function () {
        var e =
a(this).data("resizable"), h = e.options, g = e.size, i = e.originalSize, b = e.originalPosition, f = e.axis; h.grid = typeof h.grid == "number" ? [h.grid, h.grid] : h.grid; var j = Math.round((g.width - i.width) / (h.grid[0] || 1)) * (h.grid[0] || 1); h = Math.round((g.height - i.height) / (h.grid[1] || 1)) * (h.grid[1] || 1); if (/^(se|s|e)$/.test(f)) { e.size.width = i.width + j; e.size.height = i.height + h } else if (/^(ne)$/.test(f)) { e.size.width = i.width + j; e.size.height = i.height + h; e.position.top = b.top - h } else {
            if (/^(sw)$/.test(f)) {
                e.size.width = i.width + j; e.size.height =
i.height + h
            } else { e.size.width = i.width + j; e.size.height = i.height + h; e.position.top = b.top - h } e.position.left = b.left - j
        } 
    } 
    }); var d = function (e) { return parseInt(e, 10) || 0 }, c = function (e) { return !isNaN(parseInt(e, 10)) } 
})(jQuery);
(function (a) {
    a.widget("ui.selectable", a.ui.mouse, { options: { appendTo: "body", autoRefresh: true, distance: 0, filter: "*", tolerance: "touch" }, _create: function () {
        var d = this; this.element.addClass("ui-selectable"); this.dragged = false; var c; this.refresh = function () {
            c = a(d.options.filter, d.element[0]); c.each(function () {
                var e = a(this), h = e.offset(); a.data(this, "selectable-item", { element: this, $element: e, left: h.left, top: h.top, right: h.left + e.outerWidth(), bottom: h.top + e.outerHeight(), startselected: false, selected: e.hasClass("ui-selected"),
                    selecting: e.hasClass("ui-selecting"), unselecting: e.hasClass("ui-unselecting")
                })
            })
        }; this.refresh(); this.selectees = c.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 (d) {
        var c = this; this.opos = [d.pageX,
d.pageY]; if (!this.options.disabled) {
            var e = this.options; this.selectees = a(e.filter, this.element[0]); this._trigger("start", d); a(e.appendTo).append(this.helper); this.helper.css({ left: d.clientX, top: d.clientY, width: 0, height: 0 }); e.autoRefresh && this.refresh(); this.selectees.filter(".ui-selected").each(function () {
                var h = a.data(this, "selectable-item"); h.startselected = true; if (!d.metaKey) {
                    h.$element.removeClass("ui-selected"); h.selected = false; h.$element.addClass("ui-unselecting"); h.unselecting = true; c._trigger("unselecting",
d, { unselecting: h.element })
                } 
            }); a(d.target).parents().andSelf().each(function () { var h = a.data(this, "selectable-item"); if (h) { var g = !d.metaKey || !h.$element.hasClass("ui-selected"); h.$element.removeClass(g ? "ui-unselecting" : "ui-selected").addClass(g ? "ui-selecting" : "ui-unselecting"); h.unselecting = !g; h.selecting = g; (h.selected = g) ? c._trigger("selecting", d, { selecting: h.element }) : c._trigger("unselecting", d, { unselecting: h.element }); return false } })
        } 
    }, _mouseDrag: function (d) {
        var c = this; this.dragged = true; if (!this.options.disabled) {
            var e =
this.options, h = this.opos[0], g = this.opos[1], i = d.pageX, b = d.pageY; if (h > i) { var f = i; i = h; h = f } if (g > b) { f = b; b = g; g = f } this.helper.css({ left: h, top: g, width: i - h, height: b - g }); this.selectees.each(function () {
    var j = a.data(this, "selectable-item"); if (!(!j || j.element == c.element[0])) {
        var l = false; if (e.tolerance == "touch") l = !(j.left > i || j.right < h || j.top > b || j.bottom < g); else if (e.tolerance == "fit") l = j.left > h && j.right < i && j.top > g && j.bottom < b; if (l) {
            if (j.selected) { j.$element.removeClass("ui-selected"); j.selected = false } if (j.unselecting) {
                j.$element.removeClass("ui-unselecting");
                j.unselecting = false
            } if (!j.selecting) { j.$element.addClass("ui-selecting"); j.selecting = true; c._trigger("selecting", d, { selecting: j.element }) } 
        } else {
            if (j.selecting) if (d.metaKey && j.startselected) { j.$element.removeClass("ui-selecting"); j.selecting = false; j.$element.addClass("ui-selected"); j.selected = true } else { j.$element.removeClass("ui-selecting"); j.selecting = false; if (j.startselected) { j.$element.addClass("ui-unselecting"); j.unselecting = true } c._trigger("unselecting", d, { unselecting: j.element }) } if (j.selected) if (!d.metaKey &&
!j.startselected) { j.$element.removeClass("ui-selected"); j.selected = false; j.$element.addClass("ui-unselecting"); j.unselecting = true; c._trigger("unselecting", d, { unselecting: j.element }) } 
        } 
    } 
}); return false
        } 
    }, _mouseStop: function (d) {
        var c = this; this.dragged = false; a(".ui-unselecting", this.element[0]).each(function () { var e = a.data(this, "selectable-item"); e.$element.removeClass("ui-unselecting"); e.unselecting = false; e.startselected = false; c._trigger("unselected", d, { unselected: e.element }) }); a(".ui-selecting", this.element[0]).each(function () {
            var e =
a.data(this, "selectable-item"); e.$element.removeClass("ui-selecting").addClass("ui-selected"); e.selecting = false; e.selected = true; e.startselected = true; c._trigger("selected", d, { selected: e.element })
        }); this._trigger("stop", d); this.helper.remove(); return false
    } 
    }); a.extend(a.ui.selectable, { version: "1.8.16" })
})(jQuery);
(function (a) {
    a.widget("ui.sortable", a.ui.mouse, { 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: 1E3 }, _create: function () {
        var d = this.options; this.containerCache = {}; this.element.addClass("ui-sortable");
        this.refresh(); this.floating = this.items.length ? d.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 d = this.items.length - 1; d >= 0; d--) this.items[d].item.removeData("sortable-item"); return this }, _setOption: function (d, c) {
        if (d ===
"disabled") { this.options[d] = c; this.widget()[c ? "addClass" : "removeClass"]("ui-sortable-disabled") } else a.Widget.prototype._setOption.apply(this, arguments)
    }, _mouseCapture: function (d, c) {
        if (this.reverting) return false; if (this.options.disabled || this.options.type == "static") return false; this._refreshItems(d); var e = null, h = this; a(d.target).parents().each(function () { if (a.data(this, "sortable-item") == h) { e = a(this); return false } }); if (a.data(d.target, "sortable-item") == h) e = a(d.target); if (!e) return false; if (this.options.handle &&
!c) { var g = false; a(this.options.handle, e).find("*").andSelf().each(function () { if (this == d.target) g = true }); if (!g) return false } this.currentItem = e; this._removeCurrentsFromItems(); return true
    }, _mouseStart: function (d, c, e) {
        c = this.options; var h = this; this.currentContainer = this; this.refreshPositions(); this.helper = this._createHelper(d); 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: d.pageX - this.offset.left, top: d.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this._generatePosition(d); this.originalPageX = d.pageX; this.originalPageY = d.pageY; c.cursorAt && this._adjustOffsetFromHelper(c.cursorAt); this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
        this.helper[0] != this.currentItem[0] && this.currentItem.hide(); this._createPlaceholder(); c.containment && this._setContainment(); if (c.cursor) { if (a("body").css("cursor")) this._storedCursor = a("body").css("cursor"); a("body").css("cursor", c.cursor) } if (c.opacity) { if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); this.helper.css("opacity", c.opacity) } if (c.zIndex) { if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); this.helper.css("zIndex", c.zIndex) } if (this.scrollParent[0] !=
document && this.scrollParent[0].tagName != "HTML") this.overflowOffset = this.scrollParent.offset(); this._trigger("start", d, this._uiHash()); this._preserveHelperProportions || this._cacheHelperProportions(); if (!e) for (e = this.containers.length - 1; e >= 0; e--) this.containers[e]._trigger("activate", d, h._uiHash(this)); if (a.ui.ddmanager) a.ui.ddmanager.current = this; a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, d); this.dragging = true; this.helper.addClass("ui-sortable-helper"); this._mouseDrag(d);
        return true
    }, _mouseDrag: function (d) {
        this.position = this._generatePosition(d); this.positionAbs = this._convertPositionTo("absolute"); if (!this.lastPositionAbs) this.lastPositionAbs = this.positionAbs; if (this.options.scroll) {
            var c = this.options, e = false; if (this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML") {
                if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - d.pageY < c.scrollSensitivity) this.scrollParent[0].scrollTop = e = this.scrollParent[0].scrollTop + c.scrollSpeed; else if (d.pageY - this.overflowOffset.top <
c.scrollSensitivity) this.scrollParent[0].scrollTop = e = this.scrollParent[0].scrollTop - c.scrollSpeed; if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - d.pageX < c.scrollSensitivity) this.scrollParent[0].scrollLeft = e = this.scrollParent[0].scrollLeft + c.scrollSpeed; else if (d.pageX - this.overflowOffset.left < c.scrollSensitivity) this.scrollParent[0].scrollLeft = e = this.scrollParent[0].scrollLeft - c.scrollSpeed
            } else {
                if (d.pageY - a(document).scrollTop() < c.scrollSensitivity) e = a(document).scrollTop(a(document).scrollTop() -
c.scrollSpeed); else if (a(window).height() - (d.pageY - a(document).scrollTop()) < c.scrollSensitivity) e = a(document).scrollTop(a(document).scrollTop() + c.scrollSpeed); if (d.pageX - a(document).scrollLeft() < c.scrollSensitivity) e = a(document).scrollLeft(a(document).scrollLeft() - c.scrollSpeed); else if (a(window).width() - (d.pageX - a(document).scrollLeft()) < c.scrollSensitivity) e = a(document).scrollLeft(a(document).scrollLeft() + c.scrollSpeed)
            } e !== false && a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this,
d)
        } 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 (c = this.items.length - 1; c >= 0; c--) {
            e = this.items[c]; var h = e.item[0], g = this._intersectsWithPointer(e); if (g) if (h != this.currentItem[0] && this.placeholder[g == 1 ? "next" : "prev"]()[0] != h && !a.ui.contains(this.placeholder[0], h) && (this.options.type == "semi-dynamic" ? !a.ui.contains(this.element[0],
h) : true)) { this.direction = g == 1 ? "down" : "up"; if (this.options.tolerance == "pointer" || this._intersectsWithSides(e)) this._rearrange(d, e); else break; this._trigger("change", d, this._uiHash()); break } 
        } this._contactContainers(d); a.ui.ddmanager && a.ui.ddmanager.drag(this, d); this._trigger("sort", d, this._uiHash()); this.lastPositionAbs = this.positionAbs; return false
    }, _mouseStop: function (d, c) {
        if (d) {
            a.ui.ddmanager && !this.options.dropBehaviour && a.ui.ddmanager.drop(this, d); if (this.options.revert) {
                var e = this; c = e.placeholder.offset();
                e.reverting = true; a(this.helper).animate({ left: c.left - this.offset.parent.left - e.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), top: c.top - this.offset.parent.top - e.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) }, parseInt(this.options.revert, 10) || 500, function () { e._clear(d) })
            } else this._clear(d, c); return false
        } 
    }, cancel: function () {
        var d = this; if (this.dragging) {
            this._mouseUp({ target: null }); this.options.helper == "original" ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") :
this.currentItem.show(); for (var c = this.containers.length - 1; c >= 0; c--) { this.containers[c]._trigger("deactivate", null, d._uiHash(this)); if (this.containers[c].containerCache.over) { this.containers[c]._trigger("out", null, d._uiHash(this)); this.containers[c].containerCache.over = 0 } } 
        } if (this.placeholder) {
            this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]); this.options.helper != "original" && this.helper && this.helper[0].parentNode && this.helper.remove(); a.extend(this, { helper: null,
                dragging: false, reverting: false, _noFinalSort: null
            }); this.domPosition.prev ? a(this.domPosition.prev).after(this.currentItem) : a(this.domPosition.parent).prepend(this.currentItem)
        } return this
    }, serialize: function (d) { var c = this._getItemsAsjQuery(d && d.connected), e = []; d = d || {}; a(c).each(function () { var h = (a(d.item || this).attr(d.attribute || "id") || "").match(d.expression || /(.+)[-=_](.+)/); if (h) e.push((d.key || h[1] + "[]") + "=" + (d.key && d.expression ? h[1] : h[2])) }); !e.length && d.key && e.push(d.key + "="); return e.join("&") },
        toArray: function (d) { var c = this._getItemsAsjQuery(d && d.connected), e = []; d = d || {}; c.each(function () { e.push(a(d.item || this).attr(d.attribute || "id") || "") }); return e }, _intersectsWith: function (d) {
            var c = this.positionAbs.left, e = c + this.helperProportions.width, h = this.positionAbs.top, g = h + this.helperProportions.height, i = d.left, b = i + d.width, f = d.top, j = f + d.height, l = this.offset.click.top, o = this.offset.click.left; l = h + l > f && h + l < j && c + o > i && c + o < b; return this.options.tolerance == "pointer" || this.options.forcePointerForContainers ||
this.options.tolerance != "pointer" && this.helperProportions[this.floating ? "width" : "height"] > d[this.floating ? "width" : "height"] ? l : i < c + this.helperProportions.width / 2 && e - this.helperProportions.width / 2 < b && f < h + this.helperProportions.height / 2 && g - this.helperProportions.height / 2 < j
        }, _intersectsWithPointer: function (d) {
            var c = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, d.top, d.height); d = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, d.left, d.width); c = c && d; d = this._getDragVerticalDirection();
            var e = this._getDragHorizontalDirection(); if (!c) return false; return this.floating ? e && e == "right" || d == "down" ? 2 : 1 : d && (d == "down" ? 2 : 1)
        }, _intersectsWithSides: function (d) { var c = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, d.top + d.height / 2, d.height); d = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, d.left + d.width / 2, d.width); var e = this._getDragVerticalDirection(), h = this._getDragHorizontalDirection(); return this.floating && h ? h == "right" && d || h == "left" && !d : e && (e == "down" && c || e == "up" && !c) },
        _getDragVerticalDirection: function () { var d = this.positionAbs.top - this.lastPositionAbs.top; return d != 0 && (d > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var d = this.positionAbs.left - this.lastPositionAbs.left; return d != 0 && (d > 0 ? "right" : "left") }, refresh: function (d) { this._refreshItems(d); this.refreshPositions(); return this }, _connectWith: function () { var d = this.options; return d.connectWith.constructor == String ? [d.connectWith] : d.connectWith }, _getItemsAsjQuery: function (d) {
            var c = [], e = [], h = this._connectWith();
            if (h && d) for (d = h.length - 1; d >= 0; d--) for (var g = a(h[d]), i = g.length - 1; i >= 0; i--) { var b = a.data(g[i], "sortable"); if (b && b != this && !b.options.disabled) e.push([a.isFunction(b.options.items) ? b.options.items.call(b.element) : a(b.options.items, b.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), b]) } e.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 (d = e.length - 1; d >= 0; d--) e[d][0].each(function () { c.push(this) }); return a(c)
        }, _removeCurrentsFromItems: function () { for (var d = this.currentItem.find(":data(sortable-item)"), c = 0; c < this.items.length; c++) for (var e = 0; e < d.length; e++) d[e] == this.items[c].item[0] && this.items.splice(c, 1) }, _refreshItems: function (d) {
            this.items = []; this.containers = [this]; var c = this.items, e = [[a.isFunction(this.options.items) ? this.options.items.call(this.element[0], d, { item: this.currentItem }) : a(this.options.items, this.element),
this]], h = this._connectWith(); if (h) for (var g = h.length - 1; g >= 0; g--) for (var i = a(h[g]), b = i.length - 1; b >= 0; b--) { var f = a.data(i[b], "sortable"); if (f && f != this && !f.options.disabled) { e.push([a.isFunction(f.options.items) ? f.options.items.call(f.element[0], d, { item: this.currentItem }) : a(f.options.items, f.element), f]); this.containers.push(f) } } for (g = e.length - 1; g >= 0; g--) { d = e[g][1]; h = e[g][0]; b = 0; for (i = h.length; b < i; b++) { f = a(h[b]); f.data("sortable-item", d); c.push({ item: f, instance: d, width: 0, height: 0, left: 0, top: 0 }) } } 
        }, refreshPositions: function (d) {
            if (this.offsetParent &&
this.helper) this.offset.parent = this._getParentOffset(); for (var c = this.items.length - 1; c >= 0; c--) { var e = this.items[c]; if (!(e.instance != this.currentContainer && this.currentContainer && e.item[0] != this.currentItem[0])) { var h = this.options.toleranceElement ? a(this.options.toleranceElement, e.item) : e.item; if (!d) { e.width = h.outerWidth(); e.height = h.outerHeight() } h = h.offset(); e.left = h.left; e.top = h.top } } if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (c =
this.containers.length - 1; c >= 0; c--) { h = this.containers[c].element.offset(); this.containers[c].containerCache.left = h.left; this.containers[c].containerCache.top = h.top; this.containers[c].containerCache.width = this.containers[c].element.outerWidth(); this.containers[c].containerCache.height = this.containers[c].element.outerHeight() } return this
        }, _createPlaceholder: function (d) {
            var c = d || this, e = c.options; if (!e.placeholder || e.placeholder.constructor == String) {
                var h = e.placeholder; e.placeholder = { element: function () {
                    var g =
a(document.createElement(c.currentItem[0].nodeName)).addClass(h || c.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; if (!h) g.style.visibility = "hidden"; return g
                }, update: function (g, i) {
                    if (!(h && !e.forcePlaceholderSize)) {
                        i.height() || i.height(c.currentItem.innerHeight() - parseInt(c.currentItem.css("paddingTop") || 0, 10) - parseInt(c.currentItem.css("paddingBottom") || 0, 10)); i.width() || i.width(c.currentItem.innerWidth() - parseInt(c.currentItem.css("paddingLeft") || 0, 10) - parseInt(c.currentItem.css("paddingRight") ||
0, 10))
                    } 
                } 
                }
            } c.placeholder = a(e.placeholder.element.call(c.element, c.currentItem)); c.currentItem.after(c.placeholder); e.placeholder.update(c, c.placeholder)
        }, _contactContainers: function (d) {
            for (var c = null, e = null, h = this.containers.length - 1; h >= 0; h--) if (!a.ui.contains(this.currentItem[0], this.containers[h].element[0])) if (this._intersectsWith(this.containers[h].containerCache)) { if (!(c && a.ui.contains(this.containers[h].element[0], c.element[0]))) { c = this.containers[h]; e = h } } else if (this.containers[h].containerCache.over) {
                this.containers[h]._trigger("out",
d, this._uiHash(this)); this.containers[h].containerCache.over = 0
            } if (c) if (this.containers.length === 1) { this.containers[e]._trigger("over", d, this._uiHash(this)); this.containers[e].containerCache.over = 1 } else if (this.currentContainer != this.containers[e]) {
                c = 1E4; h = null; for (var g = this.positionAbs[this.containers[e].floating ? "left" : "top"], i = this.items.length - 1; i >= 0; i--) if (a.ui.contains(this.containers[e].element[0], this.items[i].item[0])) {
                    var b = this.items[i][this.containers[e].floating ? "left" : "top"]; if (Math.abs(b -
g) < c) { c = Math.abs(b - g); h = this.items[i] } 
                } if (h || this.options.dropOnEmpty) { this.currentContainer = this.containers[e]; h ? this._rearrange(d, h, null, true) : this._rearrange(d, null, this.containers[e].element, true); this._trigger("change", d, this._uiHash()); this.containers[e]._trigger("change", d, this._uiHash(this)); this.options.placeholder.update(this.currentContainer, this.placeholder); this.containers[e]._trigger("over", d, this._uiHash(this)); this.containers[e].containerCache.over = 1 } 
            } 
        }, _createHelper: function (d) {
            var c =
this.options; d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [d, this.currentItem])) : c.helper == "clone" ? this.currentItem.clone() : this.currentItem; d.parents("body").length || a(c.appendTo != "parent" ? c.appendTo : this.currentItem[0].parentNode)[0].appendChild(d[0]); if (d[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 (d[0].style.width ==
"" || c.forceHelperSize) d.width(this.currentItem.width()); if (d[0].style.height == "" || c.forceHelperSize) d.height(this.currentItem.height()); return d
        }, _adjustOffsetFromHelper: function (d) {
            if (typeof d == "string") d = d.split(" "); if (a.isArray(d)) d = { left: +d[0], top: +d[1] || 0 }; if ("left" in d) this.offset.click.left = d.left + this.margins.left; if ("right" in d) this.offset.click.left = this.helperProportions.width - d.right + this.margins.left; if ("top" in d) this.offset.click.top = d.top + this.margins.top; if ("bottom" in d) this.offset.click.top =
this.helperProportions.height - d.bottom + this.margins.top
        }, _getParentOffset: function () {
            this.offsetParent = this.helper.offsetParent(); var d = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) { d.left += this.scrollParent.scrollLeft(); d.top += this.scrollParent.scrollTop() } if (this.offsetParent[0] == document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie) d =
{ top: 0, left: 0 }; return { top: d.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: d.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)}
        }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var d = this.currentItem.position(); return { top: d.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: d.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 d = this.options; if (d.containment == "parent") d.containment = this.helper[0].parentNode; if (d.containment == "document" || d.containment == "window") this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(d.containment == "document" ?
document : window).width() - this.helperProportions.width - this.margins.left, (a(d.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; if (!/^(document|window|parent)$/.test(d.containment)) {
                var c = a(d.containment)[0]; d = a(d.containment).offset(); var e = 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 + (e ? 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 + (e ? 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]
            } 
        }, _convertPositionTo: function (d, c) {
            if (!c) c =
this.position; d = d == "absolute" ? 1 : -1; var e = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = /(html|body)/i.test(e[0].tagName); return { top: c.top + this.offset.relative.top * d + this.offset.parent.top * d - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : h ? 0 : e.scrollTop()) * d), left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - (a.browser.safari &&
this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : h ? 0 : e.scrollLeft()) * d)
}
        }, _generatePosition: function (d) {
            var c = this.options, e = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, h = /(html|body)/i.test(e[0].tagName); if (this.cssPosition == "relative" && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) this.offset.relative = this._getRelativeOffset();
            var g = d.pageX, i = d.pageY; if (this.originalPosition) {
                if (this.containment) { if (d.pageX - this.offset.click.left < this.containment[0]) g = this.containment[0] + this.offset.click.left; if (d.pageY - this.offset.click.top < this.containment[1]) i = this.containment[1] + this.offset.click.top; if (d.pageX - this.offset.click.left > this.containment[2]) g = this.containment[2] + this.offset.click.left; if (d.pageY - this.offset.click.top > this.containment[3]) i = this.containment[3] + this.offset.click.top } if (c.grid) {
                    i = this.originalPageY + Math.round((i -
this.originalPageY) / c.grid[1]) * c.grid[1]; i = this.containment ? !(i - this.offset.click.top < this.containment[1] || i - this.offset.click.top > this.containment[3]) ? i : !(i - this.offset.click.top < this.containment[1]) ? i - c.grid[1] : i + c.grid[1] : i; g = this.originalPageX + Math.round((g - this.originalPageX) / c.grid[0]) * c.grid[0]; g = 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 - c.grid[0] : g + c.grid[0] : g
                } 
            } return { top: i -
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() : h ? 0 : e.scrollTop()), left: g - 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() : h ? 0 : e.scrollLeft())
            }
        }, _rearrange: function (d, c, e, h) {
            e ? e[0].appendChild(this.placeholder[0]) : c.item[0].parentNode.insertBefore(this.placeholder[0],
this.direction == "down" ? c.item[0] : c.item[0].nextSibling); this.counter = this.counter ? ++this.counter : 1; var g = this, i = this.counter; window.setTimeout(function () { i == g.counter && g.refreshPositions(!h) }, 0)
        }, _clear: function (d, c) {
            this.reverting = false; var e = []; !this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem); this._noFinalSort = null; if (this.helper[0] == this.currentItem[0]) {
                for (var h in this._storedCSS) if (this._storedCSS[h] == "auto" || this._storedCSS[h] == "static") this._storedCSS[h] =
""; this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")
            } else this.currentItem.show(); this.fromOutside && !c && e.push(function (g) { this._trigger("receive", g, 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]) && !c) e.push(function (g) { this._trigger("update", g, this._uiHash()) }); if (!a.ui.contains(this.element[0], this.currentItem[0])) {
                c || e.push(function (g) {
                    this._trigger("remove",
g, this._uiHash())
                }); for (h = this.containers.length - 1; h >= 0; h--) if (a.ui.contains(this.containers[h].element[0], this.currentItem[0]) && !c) { e.push(function (g) { return function (i) { g._trigger("receive", i, this._uiHash(this)) } } .call(this, this.containers[h])); e.push(function (g) { return function (i) { g._trigger("update", i, this._uiHash(this)) } } .call(this, this.containers[h])) } 
            } for (h = this.containers.length - 1; h >= 0; h--) {
                c || e.push(function (g) { return function (i) { g._trigger("deactivate", i, this._uiHash(this)) } } .call(this,
this.containers[h])); if (this.containers[h].containerCache.over) { e.push(function (g) { return function (i) { g._trigger("out", i, this._uiHash(this)) } } .call(this, this.containers[h])); this.containers[h].containerCache.over = 0 } 
            } this._storedCursor && a("body").css("cursor", this._storedCursor); 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 (!c) {
                    this._trigger("beforeStop",
d, this._uiHash()); for (h = 0; h < e.length; h++) e[h].call(this, d); this._trigger("stop", d, this._uiHash())
                } return false
            } c || this._trigger("beforeStop", d, this._uiHash()); this.placeholder[0].parentNode.removeChild(this.placeholder[0]); this.helper[0] != this.currentItem[0] && this.helper.remove(); this.helper = null; if (!c) { for (h = 0; h < e.length; h++) e[h].call(this, d); this._trigger("stop", d, this._uiHash()) } this.fromOutside = false; return true
        }, _trigger: function () { 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} } 
    }); a.extend(a.ui.sortable, { version: "1.8.16" })
})(jQuery);
jQuery.effects || function (a, d) {
    function c(n) {
        var k; if (n && n.constructor == Array && n.length == 3) return n; if (k = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n)) return [parseInt(k[1], 10), parseInt(k[2], 10), parseInt(k[3], 10)]; if (k = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n)) return [parseFloat(k[1]) * 2.55, parseFloat(k[2]) * 2.55, parseFloat(k[3]) * 2.55]; if (k = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n)) return [parseInt(k[1],
16), parseInt(k[2], 16), parseInt(k[3], 16)]; if (k = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n)) return [parseInt(k[1] + k[1], 16), parseInt(k[2] + k[2], 16), parseInt(k[3] + k[3], 16)]; if (/rgba\(0, 0, 0, 0\)/.exec(n)) return j.transparent; return j[a.trim(n).toLowerCase()]
    } function e(n, k) { var m; do { m = a.curCSS(n, k); if (m != "" && m != "transparent" || a.nodeName(n, "body")) break; k = "backgroundColor" } while (n = n.parentNode); return c(m) } function h() {
        var n = document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle,
k = {}, m, p; if (n && n.length && n[0] && n[n[0]]) for (var q = n.length; q--; ) { m = n[q]; if (typeof n[m] == "string") { p = m.replace(/\-(\w)/g, function (s, r) { return r.toUpperCase() }); k[p] = n[m] } } else for (m in n) if (typeof n[m] === "string") k[m] = n[m]; return k
    } function g(n) { var k, m; for (k in n) { m = n[k]; if (m == null || a.isFunction(m) || k in o || /scrollbar/.test(k) || !/color/i.test(k) && isNaN(parseFloat(m))) delete n[k] } return n } function i(n, k) { var m = { _: 0 }, p; for (p in k) if (n[p] != k[p]) m[p] = k[p]; return m } function b(n, k, m, p) {
        if (typeof n == "object") {
            p =
k; m = null; k = n; n = k.effect
        } if (a.isFunction(k)) { p = k; m = null; k = {} } if (typeof k == "number" || a.fx.speeds[k]) { p = m; m = k; k = {} } if (a.isFunction(m)) { p = m; m = null } k = k || {}; m = m || k.duration; m = a.fx.off ? 0 : typeof m == "number" ? m : m in a.fx.speeds ? a.fx.speeds[m] : a.fx.speeds._default; p = p || k.complete; return [n, k, m, p]
    } function f(n) { if (!n || typeof n === "number" || a.fx.speeds[n]) return true; if (typeof n === "string" && !a.effects[n]) return true; return false } a.effects = {}; a.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor",
"borderTopColor", "borderColor", "color", "outlineColor"], function (n, k) { a.fx.step[k] = function (m) { if (!m.colorInit) { m.start = e(m.elem, k); m.end = c(m.end); m.colorInit = true } m.elem.style[k] = "rgb(" + Math.max(Math.min(parseInt(m.pos * (m.end[0] - m.start[0]) + m.start[0], 10), 255), 0) + "," + Math.max(Math.min(parseInt(m.pos * (m.end[1] - m.start[1]) + m.start[1], 10), 255), 0) + "," + Math.max(Math.min(parseInt(m.pos * (m.end[2] - m.start[2]) + m.start[2], 10), 255), 0) + ")" } }); var j = { 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]
}, l = ["add", "remove", "toggle"], o = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; a.effects.animateClass = function (n, k, m,
p) { if (a.isFunction(m)) { p = m; m = null } return this.queue(function () { var q = a(this), s = q.attr("style") || " ", r = g(h.call(this)), u, v = q.attr("class"); a.each(l, function (w, x) { n[x] && q[x + "Class"](n[x]) }); u = g(h.call(this)); q.attr("class", v); q.animate(i(r, u), { queue: false, duration: k, easing: m, complete: function () { a.each(l, function (w, x) { n[x] && q[x + "Class"](n[x]) }); if (typeof q.attr("style") == "object") { q.attr("style").cssText = ""; q.attr("style").cssText = s } else q.attr("style", s); p && p.apply(this, arguments); a.dequeue(this) } }) }) };
    a.fn.extend({ _addClass: a.fn.addClass, addClass: function (n, k, m, p) { return k ? a.effects.animateClass.apply(this, [{ add: n }, k, m, p]) : this._addClass(n) }, _removeClass: a.fn.removeClass, removeClass: function (n, k, m, p) { return k ? a.effects.animateClass.apply(this, [{ remove: n }, k, m, p]) : this._removeClass(n) }, _toggleClass: a.fn.toggleClass, toggleClass: function (n, k, m, p, q) {
        return typeof k == "boolean" || k === d ? m ? a.effects.animateClass.apply(this, [k ? { add: n} : { remove: n }, m, p, q]) : this._toggleClass(n, k) : a.effects.animateClass.apply(this,
[{ toggle: n }, k, m, p])
    }, switchClass: function (n, k, m, p, q) { return a.effects.animateClass.apply(this, [{ add: k, remove: n }, m, p, q]) } 
    }); a.extend(a.effects, { version: "1.8.16", save: function (n, k) { for (var m = 0; m < k.length; m++) k[m] !== null && n.data("ec.storage." + k[m], n[0].style[k[m]]) }, restore: function (n, k) { for (var m = 0; m < k.length; m++) k[m] !== null && n.css(k[m], n.data("ec.storage." + k[m])) }, setMode: function (n, k) { if (k == "toggle") k = n.is(":hidden") ? "show" : "hide"; return k }, getBaseline: function (n, k) {
        var m; switch (n[0]) {
            case "top": m =
0; break; case "middle": m = 0.5; break; case "bottom": m = 1; break; default: m = n[0] / k.height
        } switch (n[1]) { case "left": n = 0; break; case "center": n = 0.5; break; case "right": n = 1; break; default: n = n[1] / k.width } return { x: n, y: m}
    }, createWrapper: function (n) {
        if (n.parent().is(".ui-effects-wrapper")) return n.parent(); var k = { width: n.outerWidth(true), height: n.outerHeight(true), "float": n.css("float") }, m = a("<div></div>").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }),
p = document.activeElement; n.wrap(m); if (n[0] === p || a.contains(n[0], p)) a(p).focus(); m = n.parent(); if (n.css("position") == "static") { m.css({ position: "relative" }); n.css({ position: "relative" }) } else { a.extend(k, { position: n.css("position"), zIndex: n.css("z-index") }); a.each(["top", "left", "bottom", "right"], function (q, s) { k[s] = n.css(s); if (isNaN(parseInt(k[s], 10))) k[s] = "auto" }); n.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" }) } return m.css(k).show()
    }, removeWrapper: function (n) {
        var k, m = document.activeElement;
        if (n.parent().is(".ui-effects-wrapper")) { k = n.parent().replaceWith(n); if (n[0] === m || a.contains(n[0], m)) a(m).focus(); return k } return n
    }, setTransition: function (n, k, m, p) { p = p || {}; a.each(k, function (q, s) { unit = n.cssUnit(s); if (unit[0] > 0) p[s] = unit[0] * m + unit[1] }); return p } 
    }); a.fn.extend({ effect: function (n) {
        var k = b.apply(this, arguments), m = { options: k[1], duration: k[2], callback: k[3] }; k = m.options.mode; var p = a.effects[n]; if (a.fx.off || !p) return k ? this[k](m.duration, m.callback) : this.each(function () { m.callback && m.callback.call(this) });
        return p.call(this, m)
    }, _show: a.fn.show, show: function (n) { if (f(n)) return this._show.apply(this, arguments); else { var k = b.apply(this, arguments); k[1].mode = "show"; return this.effect.apply(this, k) } }, _hide: a.fn.hide, hide: function (n) { if (f(n)) return this._hide.apply(this, arguments); else { var k = b.apply(this, arguments); k[1].mode = "hide"; return this.effect.apply(this, k) } }, __toggle: a.fn.toggle, toggle: function (n) {
        if (f(n) || typeof n === "boolean" || a.isFunction(n)) return this.__toggle.apply(this, arguments); else {
            var k = b.apply(this,
arguments); k[1].mode = "toggle"; return this.effect.apply(this, k)
        } 
    }, cssUnit: function (n) { var k = this.css(n), m = []; a.each(["em", "px", "%", "pt"], function (p, q) { if (k.indexOf(q) > 0) m = [parseFloat(k), q] }); return m } 
    }); a.easing.jswing = a.easing.swing; a.extend(a.easing, { def: "easeOutQuad", swing: function (n, k, m, p, q) { return a.easing[a.easing.def](n, k, m, p, q) }, easeInQuad: function (n, k, m, p, q) { return p * (k /= q) * k + m }, easeOutQuad: function (n, k, m, p, q) { return -p * (k /= q) * (k - 2) + m }, easeInOutQuad: function (n, k, m, p, q) {
        if ((k /= q / 2) < 1) return p /
2 * k * k + m; return -p / 2 * (--k * (k - 2) - 1) + m
    }, easeInCubic: function (n, k, m, p, q) { return p * (k /= q) * k * k + m }, easeOutCubic: function (n, k, m, p, q) { return p * ((k = k / q - 1) * k * k + 1) + m }, easeInOutCubic: function (n, k, m, p, q) { if ((k /= q / 2) < 1) return p / 2 * k * k * k + m; return p / 2 * ((k -= 2) * k * k + 2) + m }, easeInQuart: function (n, k, m, p, q) { return p * (k /= q) * k * k * k + m }, easeOutQuart: function (n, k, m, p, q) { return -p * ((k = k / q - 1) * k * k * k - 1) + m }, easeInOutQuart: function (n, k, m, p, q) { if ((k /= q / 2) < 1) return p / 2 * k * k * k * k + m; return -p / 2 * ((k -= 2) * k * k * k - 2) + m }, easeInQuint: function (n, k, m,
p, q) { return p * (k /= q) * k * k * k * k + m }, easeOutQuint: function (n, k, m, p, q) { return p * ((k = k / q - 1) * k * k * k * k + 1) + m }, easeInOutQuint: function (n, k, m, p, q) { if ((k /= q / 2) < 1) return p / 2 * k * k * k * k * k + m; return p / 2 * ((k -= 2) * k * k * k * k + 2) + m }, easeInSine: function (n, k, m, p, q) { return -p * Math.cos(k / q * (Math.PI / 2)) + p + m }, easeOutSine: function (n, k, m, p, q) { return p * Math.sin(k / q * (Math.PI / 2)) + m }, easeInOutSine: function (n, k, m, p, q) { return -p / 2 * (Math.cos(Math.PI * k / q) - 1) + m }, easeInExpo: function (n, k, m, p, q) { return k == 0 ? m : p * Math.pow(2, 10 * (k / q - 1)) + m }, easeOutExpo: function (n,
k, m, p, q) { return k == q ? m + p : p * (-Math.pow(2, -10 * k / q) + 1) + m }, easeInOutExpo: function (n, k, m, p, q) { if (k == 0) return m; if (k == q) return m + p; if ((k /= q / 2) < 1) return p / 2 * Math.pow(2, 10 * (k - 1)) + m; return p / 2 * (-Math.pow(2, -10 * --k) + 2) + m }, easeInCirc: function (n, k, m, p, q) { return -p * (Math.sqrt(1 - (k /= q) * k) - 1) + m }, easeOutCirc: function (n, k, m, p, q) { return p * Math.sqrt(1 - (k = k / q - 1) * k) + m }, easeInOutCirc: function (n, k, m, p, q) { if ((k /= q / 2) < 1) return -p / 2 * (Math.sqrt(1 - k * k) - 1) + m; return p / 2 * (Math.sqrt(1 - (k -= 2) * k) + 1) + m }, easeInElastic: function (n, k, m,
p, q) { n = 1.70158; var s = 0, r = p; if (k == 0) return m; if ((k /= q) == 1) return m + p; s || (s = q * 0.3); if (r < Math.abs(p)) { r = p; n = s / 4 } else n = s / (2 * Math.PI) * Math.asin(p / r); return -(r * Math.pow(2, 10 * (k -= 1)) * Math.sin((k * q - n) * 2 * Math.PI / s)) + m }, easeOutElastic: function (n, k, m, p, q) { n = 1.70158; var s = 0, r = p; if (k == 0) return m; if ((k /= q) == 1) return m + p; s || (s = q * 0.3); if (r < Math.abs(p)) { r = p; n = s / 4 } else n = s / (2 * Math.PI) * Math.asin(p / r); return r * Math.pow(2, -10 * k) * Math.sin((k * q - n) * 2 * Math.PI / s) + p + m }, easeInOutElastic: function (n, k, m, p, q) {
    n = 1.70158; var s =
0, r = p; if (k == 0) return m; if ((k /= q / 2) == 2) return m + p; s || (s = q * 0.3 * 1.5); if (r < Math.abs(p)) { r = p; n = s / 4 } else n = s / (2 * Math.PI) * Math.asin(p / r); if (k < 1) return -0.5 * r * Math.pow(2, 10 * (k -= 1)) * Math.sin((k * q - n) * 2 * Math.PI / s) + m; return r * Math.pow(2, -10 * (k -= 1)) * Math.sin((k * q - n) * 2 * Math.PI / s) * 0.5 + p + m
}, easeInBack: function (n, k, m, p, q, s) { if (s == d) s = 1.70158; return p * (k /= q) * k * ((s + 1) * k - s) + m }, easeOutBack: function (n, k, m, p, q, s) { if (s == d) s = 1.70158; return p * ((k = k / q - 1) * k * ((s + 1) * k + s) + 1) + m }, easeInOutBack: function (n, k, m, p, q, s) {
    if (s == d) s = 1.70158;
    if ((k /= q / 2) < 1) return p / 2 * k * k * (((s *= 1.525) + 1) * k - s) + m; return p / 2 * ((k -= 2) * k * (((s *= 1.525) + 1) * k + s) + 2) + m
}, easeInBounce: function (n, k, m, p, q) { return p - a.easing.easeOutBounce(n, q - k, 0, p, q) + m }, easeOutBounce: function (n, k, m, p, q) { return (k /= q) < 1 / 2.75 ? p * 7.5625 * k * k + m : k < 2 / 2.75 ? p * (7.5625 * (k -= 1.5 / 2.75) * k + 0.75) + m : k < 2.5 / 2.75 ? p * (7.5625 * (k -= 2.25 / 2.75) * k + 0.9375) + m : p * (7.5625 * (k -= 2.625 / 2.75) * k + 0.984375) + m }, easeInOutBounce: function (n, k, m, p, q) {
    if (k < q / 2) return a.easing.easeInBounce(n, k * 2, 0, p, q) * 0.5 + m; return a.easing.easeOutBounce(n,
k * 2 - q, 0, p, q) * 0.5 + p * 0.5 + m
} 
    })
} (jQuery);
(function (a) {
    a.effects.blind = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right"], h = a.effects.setMode(c, d.options.mode || "hide"), g = d.options.direction || "vertical"; a.effects.save(c, e); c.show(); var i = a.effects.createWrapper(c).css({ overflow: "hidden" }), b = g == "vertical" ? "height" : "width"; g = g == "vertical" ? i.height() : i.width(); h == "show" && i.css(b, 0); var f = {}; f[b] = h == "show" ? g : 0; i.animate(f, d.duration, d.options.easing, function () {
                h == "hide" && c.hide(); a.effects.restore(c,
e); a.effects.removeWrapper(c); d.callback && d.callback.apply(c[0], arguments); c.dequeue()
            })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.bounce = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right"], h = a.effects.setMode(c, d.options.mode || "effect"), g = d.options.direction || "up", i = d.options.distance || 20, b = d.options.times || 5, f = d.duration || 250; /show|hide/.test(h) && e.push("opacity"); a.effects.save(c, e); c.show(); a.effects.createWrapper(c); var j = g == "up" || g == "down" ? "top" : "left"; g = g == "up" || g == "left" ? "pos" : "neg"; i = d.options.distance || (j == "top" ? c.outerHeight({ margin: true }) / 3 : c.outerWidth({ margin: true }) /
3); if (h == "show") c.css("opacity", 0).css(j, g == "pos" ? -i : i); if (h == "hide") i /= b * 2; h != "hide" && b--; if (h == "show") { var l = { opacity: 1 }; l[j] = (g == "pos" ? "+=" : "-=") + i; c.animate(l, f / 2, d.options.easing); i /= 2; b-- } for (l = 0; l < b; l++) { var o = {}, n = {}; o[j] = (g == "pos" ? "-=" : "+=") + i; n[j] = (g == "pos" ? "+=" : "-=") + i; c.animate(o, f / 2, d.options.easing).animate(n, f / 2, d.options.easing); i = h == "hide" ? i * 2 : i / 2 } if (h == "hide") {
                l = { opacity: 0 }; l[j] = (g == "pos" ? "-=" : "+=") + i; c.animate(l, f / 2, d.options.easing, function () {
                    c.hide(); a.effects.restore(c, e); a.effects.removeWrapper(c);
                    d.callback && d.callback.apply(this, arguments)
                })
            } else { o = {}; n = {}; o[j] = (g == "pos" ? "-=" : "+=") + i; n[j] = (g == "pos" ? "+=" : "-=") + i; c.animate(o, f / 2, d.options.easing).animate(n, f / 2, d.options.easing, function () { a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(this, arguments) }) } c.queue("fx", function () { c.dequeue() }); c.dequeue()
        })
    } 
})(jQuery);
(function (a) {
    a.effects.clip = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right", "height", "width"], h = a.effects.setMode(c, d.options.mode || "hide"), g = d.options.direction || "vertical"; a.effects.save(c, e); c.show(); var i = a.effects.createWrapper(c).css({ overflow: "hidden" }); i = c[0].tagName == "IMG" ? i : c; var b = { size: g == "vertical" ? "height" : "width", position: g == "vertical" ? "top" : "left" }; g = g == "vertical" ? i.height() : i.width(); if (h == "show") {
                i.css(b.size, 0); i.css(b.position,
g / 2)
            } var f = {}; f[b.size] = h == "show" ? g : 0; f[b.position] = h == "show" ? 0 : g / 2; i.animate(f, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () { h == "hide" && c.hide(); a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(c[0], arguments); c.dequeue() } })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.drop = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right", "opacity"], h = a.effects.setMode(c, d.options.mode || "hide"), g = d.options.direction || "left"; a.effects.save(c, e); c.show(); a.effects.createWrapper(c); var i = g == "up" || g == "down" ? "top" : "left"; g = g == "up" || g == "left" ? "pos" : "neg"; var b = d.options.distance || (i == "top" ? c.outerHeight({ margin: true }) / 2 : c.outerWidth({ margin: true }) / 2); if (h == "show") c.css("opacity", 0).css(i, g == "pos" ? -b : b); var f = { opacity: h ==
"show" ? 1 : 0
            }; f[i] = (h == "show" ? g == "pos" ? "+=" : "-=" : g == "pos" ? "-=" : "+=") + b; c.animate(f, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () { h == "hide" && c.hide(); a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(this, arguments); c.dequeue() } })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.explode = function (d) {
        return this.queue(function () {
            var c = d.options.pieces ? Math.round(Math.sqrt(d.options.pieces)) : 3, e = d.options.pieces ? Math.round(Math.sqrt(d.options.pieces)) : 3; d.options.mode = d.options.mode == "toggle" ? a(this).is(":visible") ? "hide" : "show" : d.options.mode; var h = a(this).show().css("visibility", "hidden"), g = h.offset(); g.top -= parseInt(h.css("marginTop"), 10) || 0; g.left -= parseInt(h.css("marginLeft"), 10) || 0; for (var i = h.outerWidth(true), b = h.outerHeight(true), f = 0; f < c; f++) for (var j =
0; j < e; j++) h.clone().appendTo("body").wrap("<div></div>").css({ position: "absolute", visibility: "visible", left: -j * (i / e), top: -f * (b / c) }).parent().addClass("ui-effects-explode").css({ position: "absolute", overflow: "hidden", width: i / e, height: b / c, left: g.left + j * (i / e) + (d.options.mode == "show" ? (j - Math.floor(e / 2)) * (i / e) : 0), top: g.top + f * (b / c) + (d.options.mode == "show" ? (f - Math.floor(c / 2)) * (b / c) : 0), opacity: d.options.mode == "show" ? 0 : 1 }).animate({ left: g.left + j * (i / e) + (d.options.mode == "show" ? 0 : (j - Math.floor(e / 2)) * (i / e)), top: g.top +
f * (b / c) + (d.options.mode == "show" ? 0 : (f - Math.floor(c / 2)) * (b / c)), opacity: d.options.mode == "show" ? 1 : 0
}, d.duration || 500); setTimeout(function () { d.options.mode == "show" ? h.css({ visibility: "visible" }) : h.css({ visibility: "visible" }).hide(); d.callback && d.callback.apply(h[0]); h.dequeue(); a("div.ui-effects-explode").remove() }, d.duration || 500)
        })
    } 
})(jQuery);
(function (a) { a.effects.fade = function (d) { return this.queue(function () { var c = a(this), e = a.effects.setMode(c, d.options.mode || "hide"); c.animate({ opacity: e }, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () { d.callback && d.callback.apply(this, arguments); c.dequeue() } }) }) } })(jQuery);
(function (a) {
    a.effects.fold = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right"], h = a.effects.setMode(c, d.options.mode || "hide"), g = d.options.size || 15, i = !!d.options.horizFirst, b = d.duration ? d.duration / 2 : a.fx.speeds._default / 2; a.effects.save(c, e); c.show(); var f = a.effects.createWrapper(c).css({ overflow: "hidden" }), j = h == "show" != i, l = j ? ["width", "height"] : ["height", "width"]; j = j ? [f.width(), f.height()] : [f.height(), f.width()]; var o = /([0-9]+)%/.exec(g); if (o) g = parseInt(o[1],
10) / 100 * j[h == "hide" ? 0 : 1]; if (h == "show") f.css(i ? { height: 0, width: g} : { height: g, width: 0 }); i = {}; o = {}; i[l[0]] = h == "show" ? j[0] : g; o[l[1]] = h == "show" ? j[1] : 0; f.animate(i, b, d.options.easing).animate(o, b, d.options.easing, function () { h == "hide" && c.hide(); a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(c[0], arguments); c.dequeue() })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.highlight = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["backgroundImage", "backgroundColor", "opacity"], h = a.effects.setMode(c, d.options.mode || "show"), g = { backgroundColor: c.css("backgroundColor") }; if (h == "hide") g.opacity = 0; a.effects.save(c, e); c.show().css({ backgroundImage: "none", backgroundColor: d.options.color || "#ffff99" }).animate(g, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () {
                h == "hide" && c.hide(); a.effects.restore(c, e); h == "show" && !a.support.opacity &&
this.style.removeAttribute("filter"); d.callback && d.callback.apply(this, arguments); c.dequeue()
            } 
            })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.pulsate = function (d) {
        return this.queue(function () {
            var c = a(this), e = a.effects.setMode(c, d.options.mode || "show"); times = (d.options.times || 5) * 2 - 1; duration = d.duration ? d.duration / 2 : a.fx.speeds._default / 2; isVisible = c.is(":visible"); animateTo = 0; if (!isVisible) { c.css("opacity", 0).show(); animateTo = 1 } if (e == "hide" && isVisible || e == "show" && !isVisible) times--; for (e = 0; e < times; e++) { c.animate({ opacity: animateTo }, duration, d.options.easing); animateTo = (animateTo + 1) % 2 } c.animate({ opacity: animateTo }, duration,
d.options.easing, function () { animateTo == 0 && c.hide(); d.callback && d.callback.apply(this, arguments) }); c.queue("fx", function () { c.dequeue() }).dequeue()
        })
    } 
})(jQuery);
(function (a) {
    a.effects.puff = function (d) { return this.queue(function () { var c = a(this), e = a.effects.setMode(c, d.options.mode || "hide"), h = parseInt(d.options.percent, 10) || 150, g = h / 100, i = { height: c.height(), width: c.width() }; a.extend(d.options, { fade: true, mode: e, percent: e == "hide" ? h : 100, from: e == "hide" ? i : { height: i.height * g, width: i.width * g} }); c.effect("scale", d.options, d.duration, d.callback); c.dequeue() }) }; a.effects.scale = function (d) {
        return this.queue(function () {
            var c = a(this), e = a.extend(true, {}, d.options), h = a.effects.setMode(c,
d.options.mode || "effect"), g = parseInt(d.options.percent, 10) || (parseInt(d.options.percent, 10) == 0 ? 0 : h == "hide" ? 0 : 100), i = d.options.direction || "both", b = d.options.origin; if (h != "effect") { e.origin = b || ["middle", "center"]; e.restore = true } b = { height: c.height(), width: c.width() }; c.from = d.options.from || (h == "show" ? { height: 0, width: 0} : b); g = { y: i != "horizontal" ? g / 100 : 1, x: i != "vertical" ? g / 100 : 1 }; c.to = { height: b.height * g.y, width: b.width * g.x }; if (d.options.fade) {
                if (h == "show") { c.from.opacity = 0; c.to.opacity = 1 } if (h == "hide") {
                    c.from.opacity =
1; c.to.opacity = 0
                } 
            } e.from = c.from; e.to = c.to; e.mode = h; c.effect("size", e, d.duration, d.callback); c.dequeue()
        })
    }; a.effects.size = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], h = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], g = ["width", "height", "overflow"], i = ["fontSize"], b = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], f = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"],
j = a.effects.setMode(c, d.options.mode || "effect"), l = d.options.restore || false, o = d.options.scale || "both", n = d.options.origin, k = { height: c.height(), width: c.width() }; c.from = d.options.from || k; c.to = d.options.to || k; if (n) { n = a.effects.getBaseline(n, k); c.from.top = (k.height - c.from.height) * n.y; c.from.left = (k.width - c.from.width) * n.x; c.to.top = (k.height - c.to.height) * n.y; c.to.left = (k.width - c.to.width) * n.x } var m = { from: { y: c.from.height / k.height, x: c.from.width / k.width }, to: { y: c.to.height / k.height, x: c.to.width / k.width} };
            if (o == "box" || o == "both") { if (m.from.y != m.to.y) { e = e.concat(b); c.from = a.effects.setTransition(c, b, m.from.y, c.from); c.to = a.effects.setTransition(c, b, m.to.y, c.to) } if (m.from.x != m.to.x) { e = e.concat(f); c.from = a.effects.setTransition(c, f, m.from.x, c.from); c.to = a.effects.setTransition(c, f, m.to.x, c.to) } } if (o == "content" || o == "both") if (m.from.y != m.to.y) { e = e.concat(i); c.from = a.effects.setTransition(c, i, m.from.y, c.from); c.to = a.effects.setTransition(c, i, m.to.y, c.to) } a.effects.save(c, l ? e : h); c.show(); a.effects.createWrapper(c);
            c.css("overflow", "hidden").css(c.from); if (o == "content" || o == "both") {
                b = b.concat(["marginTop", "marginBottom"]).concat(i); f = f.concat(["marginLeft", "marginRight"]); g = e.concat(b).concat(f); c.find("*[width]").each(function () {
                    child = a(this); l && a.effects.save(child, g); var p = { height: child.height(), width: child.width() }; child.from = { height: p.height * m.from.y, width: p.width * m.from.x }; child.to = { height: p.height * m.to.y, width: p.width * m.to.x }; if (m.from.y != m.to.y) {
                        child.from = a.effects.setTransition(child, b, m.from.y, child.from);
                        child.to = a.effects.setTransition(child, b, m.to.y, child.to)
                    } if (m.from.x != m.to.x) { child.from = a.effects.setTransition(child, f, m.from.x, child.from); child.to = a.effects.setTransition(child, f, m.to.x, child.to) } child.css(child.from); child.animate(child.to, d.duration, d.options.easing, function () { l && a.effects.restore(child, g) })
                })
            } c.animate(c.to, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () {
                c.to.opacity === 0 && c.css("opacity", c.from.opacity); j == "hide" && c.hide(); a.effects.restore(c,
l ? e : h); a.effects.removeWrapper(c); d.callback && d.callback.apply(this, arguments); c.dequeue()
            } 
            })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.shake = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right"]; a.effects.setMode(c, d.options.mode || "effect"); var h = d.options.direction || "left", g = d.options.distance || 20, i = d.options.times || 3, b = d.duration || d.options.duration || 140; a.effects.save(c, e); c.show(); a.effects.createWrapper(c); var f = h == "up" || h == "down" ? "top" : "left", j = h == "up" || h == "left" ? "pos" : "neg"; h = {}; var l = {}, o = {}; h[f] = (j == "pos" ? "-=" : "+=") + g; l[f] = (j == "pos" ? "+=" : "-=") + g * 2; o[f] =
(j == "pos" ? "-=" : "+=") + g * 2; c.animate(h, b, d.options.easing); for (g = 1; g < i; g++) c.animate(l, b, d.options.easing).animate(o, b, d.options.easing); c.animate(l, b, d.options.easing).animate(h, b / 2, d.options.easing, function () { a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(this, arguments) }); c.queue("fx", function () { c.dequeue() }); c.dequeue()
        })
    } 
})(jQuery);
(function (a) {
    a.effects.slide = function (d) {
        return this.queue(function () {
            var c = a(this), e = ["position", "top", "bottom", "left", "right"], h = a.effects.setMode(c, d.options.mode || "show"), g = d.options.direction || "left"; a.effects.save(c, e); c.show(); a.effects.createWrapper(c).css({ overflow: "hidden" }); var i = g == "up" || g == "down" ? "top" : "left"; g = g == "up" || g == "left" ? "pos" : "neg"; var b = d.options.distance || (i == "top" ? c.outerHeight({ margin: true }) : c.outerWidth({ margin: true })); if (h == "show") c.css(i, g == "pos" ? isNaN(b) ? "-" + b : -b : b);
            var f = {}; f[i] = (h == "show" ? g == "pos" ? "+=" : "-=" : g == "pos" ? "-=" : "+=") + b; c.animate(f, { queue: false, duration: d.duration, easing: d.options.easing, complete: function () { h == "hide" && c.hide(); a.effects.restore(c, e); a.effects.removeWrapper(c); d.callback && d.callback.apply(this, arguments); c.dequeue() } })
        })
    } 
})(jQuery);
(function (a) {
    a.effects.transfer = function (d) {
        return this.queue(function () {
            var c = a(this), e = a(d.options.to), h = e.offset(); e = { top: h.top, left: h.left, height: e.innerHeight(), width: e.innerWidth() }; h = c.offset(); var g = a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.options.className).css({ top: h.top, left: h.left, height: c.innerHeight(), width: c.innerWidth(), position: "absolute" }).animate(e, d.duration, d.options.easing, function () {
                g.remove(); d.callback && d.callback.apply(c[0], arguments);
                c.dequeue()
            })
        })
    } 
})(jQuery);
(function (a) {
    a.widget("ui.accordion", { options: { active: 0, animated: "slide", autoHeight: true, clearStyle: false, collapsible: false, event: "click", fillSpace: false, header: "> li > :first-child,> :not(li):even", icons: { header: "ui-icon-triangle-1-e", headerSelected: "ui-icon-triangle-1-s" }, navigation: false, navigationFilter: function () { return this.href.toLowerCase() === location.href.toLowerCase() } }, _create: function () {
        var d = this, c = d.options; d.running = 0; d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); d.headers =
d.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion", function () { c.disabled || a(this).addClass("ui-state-hover") }).bind("mouseleave.accordion", function () { c.disabled || a(this).removeClass("ui-state-hover") }).bind("focus.accordion", function () { c.disabled || a(this).addClass("ui-state-focus") }).bind("blur.accordion", function () { c.disabled || a(this).removeClass("ui-state-focus") }); d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
        if (c.navigation) { var e = d.element.find("a").filter(c.navigationFilter).eq(0); if (e.length) { var h = e.closest(".ui-accordion-header"); d.active = h.length ? h : e.closest(".ui-accordion-content").prev() } } d.active = d._findActive(d.active || c.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.resize(); d.element.attr("role", "tablist"); d.headers.attr("role", "tab").bind("keydown.accordion",
function (g) { return d._keydown(g) }).next().attr("role", "tabpanel"); d.headers.not(d.active || "").attr({ "aria-expanded": "false", "aria-selected": "false", tabIndex: -1 }).next().hide(); d.active.length ? d.active.attr({ "aria-expanded": "true", "aria-selected": "true", tabIndex: 0 }) : d.headers.eq(0).attr("tabIndex", 0); a.browser.safari || d.headers.find("a").attr("tabIndex", -1); c.event && d.headers.bind(c.event.split(" ").join(".accordion ") + ".accordion", function (g) { d._clickHandler.call(d, g, this); g.preventDefault() })
    }, _createIcons: function () {
        var d =
this.options; if (d.icons) { a("<span></span>").addClass("ui-icon " + d.icons.header).prependTo(this.headers); this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected); this.element.addClass("ui-accordion-icons") } 
    }, _destroyIcons: function () { this.headers.children(".ui-icon").remove(); this.element.removeClass("ui-accordion-icons") }, destroy: function () {
        var d = this.options; 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");
        this.headers.find("a").removeAttr("tabIndex"); this._destroyIcons(); var c = 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 (d.autoHeight || d.fillHeight) c.css("height", ""); return a.Widget.prototype.destroy.call(this)
    }, _setOption: function (d, c) {
        a.Widget.prototype._setOption.apply(this, arguments); d == "active" && this.activate(c); if (d == "icons") {
            this._destroyIcons();
            c && this._createIcons()
        } if (d == "disabled") this.headers.add(this.headers.next())[c ? "addClass" : "removeClass"]("ui-accordion-disabled ui-state-disabled")
    }, _keydown: function (d) {
        if (!(this.options.disabled || d.altKey || d.ctrlKey)) {
            var c = a.ui.keyCode, e = this.headers.length, h = this.headers.index(d.target), g = false; switch (d.keyCode) {
                case c.RIGHT: case c.DOWN: g = this.headers[(h + 1) % e]; break; case c.LEFT: case c.UP: g = this.headers[(h - 1 + e) % e]; break; case c.SPACE: case c.ENTER: this._clickHandler({ target: d.target }, d.target);
                    d.preventDefault()
            } if (g) { a(d.target).attr("tabIndex", -1); a(g).attr("tabIndex", 0); g.focus(); return false } return true
        } 
    }, resize: function () {
        var d = this.options, c; if (d.fillSpace) {
            if (a.browser.msie) { var e = this.element.parent().css("overflow"); this.element.parent().css("overflow", "hidden") } c = this.element.parent().height(); a.browser.msie && this.element.parent().css("overflow", e); this.headers.each(function () { c -= a(this).outerHeight(true) }); this.headers.next().each(function () {
                a(this).height(Math.max(0, c - a(this).innerHeight() +
a(this).height()))
            }).css("overflow", "auto")
        } else if (d.autoHeight) { c = 0; this.headers.next().each(function () { c = Math.max(c, a(this).height("").height()) }).height(c) } return this
    }, activate: function (d) { this.options.active = d; d = this._findActive(d)[0]; this._clickHandler({ target: d }, d); return this }, _findActive: function (d) { return d ? typeof d === "number" ? this.headers.filter(":eq(" + d + ")") : this.headers.not(this.headers.not(d)) : d === false ? a([]) : this.headers.filter(":eq(0)") }, _clickHandler: function (d, c) {
        var e = this.options;
        if (!e.disabled) if (d.target) {
            d = a(d.currentTarget || c); c = d[0] === this.active[0]; e.active = e.collapsible && c ? false : this.headers.index(d); if (!(this.running || !e.collapsible && c)) {
                var h = this.active; f = d.next(); i = this.active.next(); b = { options: e, newHeader: c && e.collapsible ? a([]) : d, oldHeader: this.active, newContent: c && e.collapsible ? a([]) : f, oldContent: i }; var g = this.headers.index(this.active[0]) > this.headers.index(d[0]); this.active = c ? a([]) : d; this._toggle(f, i, b, c, g); h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);
                if (!c) { d.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(e.icons.header).addClass(e.icons.headerSelected); d.next().addClass("ui-accordion-content-active") } 
            } 
        } else if (e.collapsible) {
            this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header); this.active.next().addClass("ui-accordion-content-active"); var i = this.active.next(),
b = { options: e, newHeader: a([]), oldHeader: e.active, newContent: a([]), oldContent: i }, f = this.active = a([]); this._toggle(f, i, b)
        } 
    }, _toggle: function (d, c, e, h, g) {
        var i = this, b = i.options; i.toShow = d; i.toHide = c; i.data = e; var f = function () { if (i) return i._completed.apply(i, arguments) }; i._trigger("changestart", null, i.data); i.running = c.size() === 0 ? d.size() : c.size(); if (b.animated) {
            e = {}; e = b.collapsible && h ? { toShow: a([]), toHide: c, complete: f, down: g, autoHeight: b.autoHeight || b.fillSpace} : { toShow: d, toHide: c, complete: f, down: g, autoHeight: b.autoHeight ||
b.fillSpace
            }; if (!b.proxied) b.proxied = b.animated; if (!b.proxiedDuration) b.proxiedDuration = b.duration; b.animated = a.isFunction(b.proxied) ? b.proxied(e) : b.proxied; b.duration = a.isFunction(b.proxiedDuration) ? b.proxiedDuration(e) : b.proxiedDuration; h = a.ui.accordion.animations; var j = b.duration, l = b.animated; if (l && !h[l] && !a.easing[l]) l = "slide"; h[l] || (h[l] = function (o) { this.slide(o, { easing: l, duration: j || 700 }) }); h[l](e)
        } else { if (b.collapsible && h) d.toggle(); else { c.hide(); d.show() } f(true) } c.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 (d) { this.running = d ? 0 : --this.running; if (!this.running) { this.options.clearStyle && this.toShow.add(this.toHide).css({ height: "", overflow: "" }); this.toHide.removeClass("ui-accordion-content-active"); if (this.toHide.length) this.toHide.parent()[0].className = this.toHide.parent()[0].className; this._trigger("change", null, this.data) } } 
    }); a.extend(a.ui.accordion, { version: "1.8.16",
        animations: { slide: function (d, c) {
            d = a.extend({ easing: "swing", duration: 300 }, d, c); if (d.toHide.size()) if (d.toShow.size()) {
                var e = d.toShow.css("overflow"), h = 0, g = {}, i = {}, b; c = d.toShow; b = c[0].style.width; c.width(parseInt(c.parent().width(), 10) - parseInt(c.css("paddingLeft"), 10) - parseInt(c.css("paddingRight"), 10) - (parseInt(c.css("borderLeftWidth"), 10) || 0) - (parseInt(c.css("borderRightWidth"), 10) || 0)); a.each(["height", "paddingTop", "paddingBottom"], function (f, j) {
                    i[j] = "hide"; f = ("" + a.css(d.toShow[0], j)).match(/^([\d+-.]+)(.*)$/);
                    g[j] = { value: f[1], unit: f[2] || "px"}
                }); d.toShow.css({ height: 0, overflow: "hidden" }).show(); d.toHide.filter(":hidden").each(d.complete).end().filter(":visible").animate(i, { step: function (f, j) { if (j.prop == "height") h = j.end - j.start === 0 ? 0 : (j.now - j.start) / (j.end - j.start); d.toShow[0].style[j.prop] = h * g[j.prop].value + g[j.prop].unit }, duration: d.duration, easing: d.easing, complete: function () { d.autoHeight || d.toShow.css("height", ""); d.toShow.css({ width: b, overflow: e }); d.complete() } })
            } else d.toHide.animate({ height: "hide",
                paddingTop: "hide", paddingBottom: "hide"
            }, d); else d.toShow.animate({ height: "show", paddingTop: "show", paddingBottom: "show" }, d)
        }, bounceslide: function (d) { this.slide(d, { easing: d.down ? "easeOutBounce" : "swing", duration: d.down ? 1E3 : 200 }) } 
        }
    })
})(jQuery);
(function (a) {
    var d = 0; a.widget("ui.autocomplete", { options: { appendTo: "body", autoFocus: false, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null }, pending: 0, _create: function () {
        var c = this, e = this.element[0].ownerDocument, h; this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off").attr({ role: "textbox", "aria-autocomplete": "list", "aria-haspopup": "true" }).bind("keydown.autocomplete", function (g) {
            if (!(c.options.disabled || c.element.propAttr("readOnly"))) {
                h =
false; var i = a.ui.keyCode; switch (g.keyCode) {
                    case i.PAGE_UP: c._move("previousPage", g); break; case i.PAGE_DOWN: c._move("nextPage", g); break; case i.UP: c._move("previous", g); g.preventDefault(); break; case i.DOWN: c._move("next", g); g.preventDefault(); break; case i.ENTER: case i.NUMPAD_ENTER: if (c.menu.active) { h = true; g.preventDefault() } case i.TAB: if (!c.menu.active) return; c.menu.select(g); break; case i.ESCAPE: c.element.val(c.term); c.close(g); break; default: clearTimeout(c.searching); c.searching = setTimeout(function () {
                        if (c.term !=
c.element.val()) { c.selectedItem = null; c.search(null, g) } 
                    }, c.options.delay); break
                } 
            } 
        }).bind("keypress.autocomplete", function (g) { if (h) { h = false; g.preventDefault() } }).bind("focus.autocomplete", function () { if (!c.options.disabled) { c.selectedItem = null; c.previous = c.element.val() } }).bind("blur.autocomplete", function (g) { if (!c.options.disabled) { clearTimeout(c.searching); c.closing = setTimeout(function () { c.close(g); c._change(g) }, 150) } }); this._initSource(); this.response = function () { return c._response.apply(c, arguments) };
        this.menu = a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo || "body", e)[0]).mousedown(function (g) { var i = c.menu.element[0]; a(g.target).closest(".ui-menu-item").length || setTimeout(function () { a(document).one("mousedown", function (b) { b.target !== c.element[0] && b.target !== i && !a.ui.contains(i, b.target) && c.close() }) }, 1); setTimeout(function () { clearTimeout(c.closing) }, 13) }).menu({ focus: function (g, i) {
            i = i.item.data("item.autocomplete"); false !== c._trigger("focus", g, { item: i }) && /^key/.test(g.originalEvent.type) &&
c.element.val(i.value)
        }, selected: function (g, i) { var b = i.item.data("item.autocomplete"), f = c.previous; if (c.element[0] !== e.activeElement) { c.element.focus(); c.previous = f; setTimeout(function () { c.previous = f; c.selectedItem = b }, 1) } false !== c._trigger("select", g, { item: b }) && c.element.val(b.value); c.term = c.element.val(); c.close(g); c.selectedItem = b }, blur: function () { c.menu.element.is(":visible") && c.element.val() !== c.term && c.element.val(c.term) } 
        }).zIndex(this.element.zIndex() + 1).css({ top: 0, left: 0 }).hide().data("menu");
        a.fn.bgiframe && this.menu.element.bgiframe()
    }, destroy: function () { this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); this.menu.element.remove(); a.Widget.prototype.destroy.call(this) }, _setOption: function (c, e) {
        a.Widget.prototype._setOption.apply(this, arguments); c === "source" && this._initSource(); if (c === "appendTo") this.menu.element.appendTo(a(e || "body", this.element[0].ownerDocument)[0]); c === "disabled" &&
e && this.xhr && this.xhr.abort()
    }, _initSource: function () {
        var c = this, e, h; if (a.isArray(this.options.source)) { e = this.options.source; this.source = function (g, i) { i(a.ui.autocomplete.filter(e, g.term)) } } else if (typeof this.options.source === "string") { h = this.options.source; this.source = function (g, i) { c.xhr && c.xhr.abort(); c.xhr = a.ajax({ url: h, data: g, dataType: "json", autocompleteRequest: ++d, success: function (b) { this.autocompleteRequest === d && i(b) }, error: function () { this.autocompleteRequest === d && i([]) } }) } } else this.source =
this.options.source
    }, search: function (c, e) { c = c != null ? c : this.element.val(); this.term = this.element.val(); if (c.length < this.options.minLength) return this.close(e); clearTimeout(this.closing); if (this._trigger("search", e) !== false) return this._search(c) }, _search: function (c) { this.pending++; this.element.addClass("ui-autocomplete-loading"); this.source({ term: c }, this.response) }, _response: function (c) {
        if (!this.options.disabled && c && c.length) { c = this._normalize(c); this._suggest(c); this._trigger("open") } else this.close();
        this.pending--; this.pending || this.element.removeClass("ui-autocomplete-loading")
    }, close: function (c) { clearTimeout(this.closing); if (this.menu.element.is(":visible")) { this.menu.element.hide(); this.menu.deactivate(); this._trigger("close", c) } }, _change: function (c) { this.previous !== this.element.val() && this._trigger("change", c, { item: this.selectedItem }) }, _normalize: function (c) {
        if (c.length && c[0].label && c[0].value) return c; return a.map(c, 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 (c) { var e = this.menu.element.empty().zIndex(this.element.zIndex() + 1); this._renderMenu(e, c); this.menu.deactivate(); this.menu.refresh(); e.show(); this._resizeMenu(); e.position(a.extend({ of: this.element }, this.options.position)); this.options.autoFocus && this.menu.next(new a.Event("mouseover")) }, _resizeMenu: function () { var c = this.menu.element; c.outerWidth(Math.max(c.width("").outerWidth(), this.element.outerWidth())) }, _renderMenu: function (c, e) {
        var h = this;
        a.each(e, function (g, i) { h._renderItem(c, i) })
    }, _renderItem: function (c, e) { return a("<li></li>").data("item.autocomplete", e).append(a("<a></a>").text(e.label)).appendTo(c) }, _move: function (c, e) { if (this.menu.element.is(":visible")) if (this.menu.first() && /^previous/.test(c) || this.menu.last() && /^next/.test(c)) { this.element.val(this.term); this.menu.deactivate() } else this.menu[c](e); else this.search(null, e) }, widget: function () { return this.menu.element } 
    }); a.extend(a.ui.autocomplete, { escapeRegex: function (c) {
        return c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
"\\$&")
    }, filter: function (c, e) { var h = new RegExp(a.ui.autocomplete.escapeRegex(e), "i"); return a.grep(c, function (g) { return h.test(g.label || g.value || g) }) } 
    })
})(jQuery);
(function (a) {
    a.widget("ui.menu", { _create: function () { var d = 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) { if (a(c.target).closest(".ui-menu-item a").length) { c.preventDefault(); d.select(c) } }); this.refresh() }, refresh: function () {
        var d = this; this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function (c) { d.activate(c, a(this).parent()) }).mouseleave(function () { d.deactivate() })
    }, activate: function (d, c) { this.deactivate(); if (this.hasScroll()) { var e = c.offset().top - this.element.offset().top, h = this.element.scrollTop(), g = this.element.height(); if (e < 0) this.element.scrollTop(h + e); else e >= g && this.element.scrollTop(h + e - g + c.height()) } this.active = c.eq(0).children("a").addClass("ui-state-hover").attr("id", "ui-active-menuitem").end(); this._trigger("focus", d, { item: c }) }, deactivate: function () {
        if (this.active) {
            this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
            this._trigger("blur"); this.active = null
        } 
    }, next: function (d) { this.move("next", ".ui-menu-item:first", d) }, previous: function (d) { this.move("prev", ".ui-menu-item:last", d) }, 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 (d, c, e) {
        if (this.active) { d = this.active[d + "All"](".ui-menu-item").eq(0); d.length ? this.activate(e, d) : this.activate(e, this.element.children(c)) } else this.activate(e,
this.element.children(c))
    }, nextPage: function (d) {
        if (this.hasScroll()) if (!this.active || this.last()) this.activate(d, this.element.children(".ui-menu-item:first")); else { var c = this.active.offset().top, e = this.element.height(), h = this.element.children(".ui-menu-item").filter(function () { var g = a(this).offset().top - c - e + a(this).height(); return g < 10 && g > -10 }); h.length || (h = this.element.children(".ui-menu-item:last")); this.activate(d, h) } else this.activate(d, this.element.children(".ui-menu-item").filter(!this.active ||
this.last() ? ":first" : ":last"))
    }, previousPage: function (d) {
        if (this.hasScroll()) if (!this.active || this.first()) this.activate(d, this.element.children(".ui-menu-item:last")); else { var c = this.active.offset().top, e = this.element.height(); result = this.element.children(".ui-menu-item").filter(function () { var h = a(this).offset().top - c + e - a(this).height(); return h < 10 && h > -10 }); result.length || (result = this.element.children(".ui-menu-item:first")); this.activate(d, result) } else this.activate(d, this.element.children(".ui-menu-item").filter(!this.active ||
this.first() ? ":last" : ":first"))
    }, hasScroll: function () { return this.element.height() < this.element[a.fn.prop ? "prop" : "attr"]("scrollHeight") }, select: function (d) { this._trigger("selected", d, { item: this.active }) } 
    })
})(jQuery);
(function (a) {
    var d, c, e, h, g = function () { var b = a(this).find(":ui-button"); setTimeout(function () { b.button("refresh") }, 1) }, i = function (b) { var f = b.name, j = b.form, l = a([]); if (f) l = j ? a(j).find("[name='" + f + "']") : a("[name='" + f + "']", b.ownerDocument).filter(function () { return !this.form }); return l }; a.widget("ui.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", g); if (typeof this.options.disabled !==
"boolean") this.options.disabled = this.element.propAttr("disabled"); this._determineButtonType(); this.hasTitle = !!this.buttonElement.attr("title"); var b = this, f = this.options, j = this.type === "checkbox" || this.type === "radio", l = "ui-state-hover" + (!j ? " ui-state-active" : ""); if (f.label === null) f.label = this.buttonElement.html(); if (this.element.is(":disabled")) f.disabled = true; this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role", "button").bind("mouseenter.button", function () {
    if (!f.disabled) {
        a(this).addClass("ui-state-hover");
        this === d && a(this).addClass("ui-state-active")
    } 
}).bind("mouseleave.button", function () { f.disabled || a(this).removeClass(l) }).bind("click.button", function (o) { if (f.disabled) { o.preventDefault(); o.stopImmediatePropagation() } }); this.element.bind("focus.button", function () { b.buttonElement.addClass("ui-state-focus") }).bind("blur.button", function () { b.buttonElement.removeClass("ui-state-focus") }); if (j) {
            this.element.bind("change.button", function () { h || b.refresh() }); this.buttonElement.bind("mousedown.button", function (o) {
                if (!f.disabled) {
                    h =
false; c = o.pageX; e = o.pageY
                } 
            }).bind("mouseup.button", function (o) { if (!f.disabled) if (c !== o.pageX || e !== o.pageY) h = true })
        } if (this.type === "checkbox") this.buttonElement.bind("click.button", function () { if (f.disabled || h) return false; a(this).toggleClass("ui-state-active"); b.buttonElement.attr("aria-pressed", b.element[0].checked) }); else if (this.type === "radio") this.buttonElement.bind("click.button", function () {
            if (f.disabled || h) return false; a(this).addClass("ui-state-active"); b.buttonElement.attr("aria-pressed", "true");
            var o = b.element[0]; i(o).not(o).map(function () { return a(this).button("widget")[0] }).removeClass("ui-state-active").attr("aria-pressed", "false")
        }); else {
            this.buttonElement.bind("mousedown.button", function () { if (f.disabled) return false; a(this).addClass("ui-state-active"); d = this; a(document).one("mouseup", function () { d = null }) }).bind("mouseup.button", function () { if (f.disabled) return false; a(this).removeClass("ui-state-active") }).bind("keydown.button", function (o) {
                if (f.disabled) return false; if (o.keyCode == a.ui.keyCode.SPACE ||
o.keyCode == a.ui.keyCode.ENTER) a(this).addClass("ui-state-active")
            }).bind("keyup.button", function () { a(this).removeClass("ui-state-active") }); this.buttonElement.is("a") && this.buttonElement.keyup(function (o) { o.keyCode === a.ui.keyCode.SPACE && a(this).click() })
        } this._setOption("disabled", f.disabled); this._resetButton()
    }, _determineButtonType: function () {
        this.type = this.element.is(":checkbox") ? "checkbox" : this.element.is(":radio") ? "radio" : this.element.is("input") ? "input" : "button"; if (this.type === "checkbox" || this.type ===
"radio") { var b = this.element.parents().filter(":last"), f = "label[for='" + this.element.attr("id") + "']"; this.buttonElement = b.find(f); if (!this.buttonElement.length) { b = b.length ? b.siblings() : this.element.siblings(); this.buttonElement = b.filter(f); if (!this.buttonElement.length) this.buttonElement = b.find(f) } this.element.addClass("ui-helper-hidden-accessible"); (b = this.element.is(":checked")) && this.buttonElement.addClass("ui-state-active"); this.buttonElement.attr("aria-pressed", b) } else this.buttonElement = this.element
    },
        widget: function () { return this.buttonElement }, destroy: function () {
            this.element.removeClass("ui-helper-hidden-accessible"); this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  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").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()); this.hasTitle || this.buttonElement.removeAttr("title");
            a.Widget.prototype.destroy.call(this)
        }, _setOption: function (b, f) { a.Widget.prototype._setOption.apply(this, arguments); if (b === "disabled") f ? this.element.propAttr("disabled", true) : this.element.propAttr("disabled", false); else this._resetButton() }, refresh: function () {
            var b = this.element.is(":disabled"); b !== this.options.disabled && this._setOption("disabled", b); if (this.type === "radio") i(this.element[0]).each(function () {
                a(this).is(":checked") ? a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
"true") : a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false")
            }); else if (this.type === "checkbox") this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false")
        }, _resetButton: function () {
            if (this.type === "input") this.options.label && this.element.val(this.options.label); else {
                var b = this.buttonElement.removeClass("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"),
f = a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(), j = this.options.icons, l = j.primary && j.secondary, o = []; if (j.primary || j.secondary) {
                    if (this.options.text) o.push("ui-button-text-icon" + (l ? "s" : j.primary ? "-primary" : "-secondary")); j.primary && b.prepend("<span class='ui-button-icon-primary ui-icon " + j.primary + "'></span>"); j.secondary && b.append("<span class='ui-button-icon-secondary ui-icon " + j.secondary + "'></span>"); if (!this.options.text) {
                        o.push(l ? "ui-button-icons-only" :
"ui-button-icon-only"); this.hasTitle || b.attr("title", f)
                    } 
                } else o.push("ui-button-text-only"); b.addClass(o.join(" "))
            } 
        } 
    }); a.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 (b, f) { b === "disabled" && this.buttons.button("option", b, f); a.Widget.prototype._setOption.apply(this, arguments) }, refresh: function () {
        var b = this.element.css("direction") ===
"ltr"; this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function () { return a(this).button("widget")[0] }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b ? "ui-corner-left" : "ui-corner-right").end().filter(":last").addClass(b ? "ui-corner-right" : "ui-corner-left").end().end()
    }, destroy: function () {
        this.element.removeClass("ui-buttonset"); this.buttons.map(function () { return a(this).button("widget")[0] }).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
        a.Widget.prototype.destroy.call(this)
    } 
    })
})(jQuery);
(function (a, d) {
    function c() {
        this.debug = false; this._curInst = null; this._keyEvent = false; this._disabledInputs = []; this._inDialog = this._datepickerShowing = 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
}; a.extend(this._defaults, this.regional[""]); this.dpDiv = e(a('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))
    } function e(b) {
        return b.bind("mouseout",
function (f) { f = a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"); f.length && f.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover") }).bind("mouseover", function (f) {
    f = a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"); if (!(a.datepicker._isDisabledDatepicker(i.inline ? b.parent()[0] : i.input[0]) || !f.length)) {
        f.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
        f.addClass("ui-state-hover"); f.hasClass("ui-datepicker-prev") && f.addClass("ui-datepicker-prev-hover"); f.hasClass("ui-datepicker-next") && f.addClass("ui-datepicker-next-hover")
    } 
})
    } function h(b, f) { a.extend(b, f); for (var j in f) if (f[j] == null || f[j] == d) b[j] = f[j]; return b } a.extend(a.ui, { datepicker: { version: "1.8.16"} }); var g = (new Date).getTime(), i; a.extend(c.prototype, { markerClassName: "hasDatepicker", maxRows: 4, log: function () { this.debug && console.log.apply("", arguments) }, _widgetDatepicker: function () { return this.dpDiv },
        setDefaults: function (b) { h(this._defaults, b || {}); return this }, _attachDatepicker: function (b, f) { var j = null; for (var l in this._defaults) { var o = b.getAttribute("date:" + l); if (o) { j = j || {}; try { j[l] = eval(o) } catch (n) { j[l] = o } } } l = b.nodeName.toLowerCase(); o = l == "div" || l == "span"; if (!b.id) { this.uuid += 1; b.id = "dp" + this.uuid } var k = this._newInst(a(b), o); k.settings = a.extend({}, f || {}, j || {}); if (l == "input") this._connectDatepicker(b, k); else o && this._inlineDatepicker(b, k) }, _newInst: function (b, f) {
            return { id: b[0].id.replace(/([^A-Za-z0-9_-])/g,
"\\\\$1"), input: b, selectedDay: 0, selectedMonth: 0, selectedYear: 0, drawMonth: 0, drawYear: 0, inline: f, dpDiv: !f ? this.dpDiv : e(a('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))
            }
        }, _connectDatepicker: function (b, f) {
            var j = a(b); f.append = a([]); f.trigger = a([]); if (!j.hasClass(this.markerClassName)) {
                this._attachments(j, f); j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
function (l, o, n) { f.settings[o] = n }).bind("getData.datepicker", function (l, o) { return this._get(f, o) }); this._autoSize(f); a.data(b, "datepicker", f); f.settings.disabled && this._disableDatepicker(b)
            } 
        }, _attachments: function (b, f) {
            var j = this._get(f, "appendText"), l = this._get(f, "isRTL"); f.append && f.append.remove(); if (j) { f.append = a('<span class="' + this._appendClass + '">' + j + "</span>"); b[l ? "before" : "after"](f.append) } b.unbind("focus", this._showDatepicker); f.trigger && f.trigger.remove(); j = this._get(f, "showOn"); if (j ==
"focus" || j == "both") b.focus(this._showDatepicker); if (j == "button" || j == "both") {
                j = this._get(f, "buttonText"); var o = this._get(f, "buttonImage"); f.trigger = a(this._get(f, "buttonImageOnly") ? a("<img/>").addClass(this._triggerClass).attr({ src: o, alt: j, title: j }) : a('<button type="button"></button>').addClass(this._triggerClass).html(o == "" ? j : a("<img/>").attr({ src: o, alt: j, title: j }))); b[l ? "before" : "after"](f.trigger); f.trigger.click(function () {
                    a.datepicker._datepickerShowing && a.datepicker._lastInput == b[0] ? a.datepicker._hideDatepicker() :
a.datepicker._showDatepicker(b[0]); return false
                })
            } 
        }, _autoSize: function (b) { if (this._get(b, "autoSize") && !b.inline) { var f = new Date(2009, 11, 20), j = this._get(b, "dateFormat"); if (j.match(/[DM]/)) { var l = function (o) { for (var n = 0, k = 0, m = 0; m < o.length; m++) if (o[m].length > n) { n = o[m].length; k = m } return k }; f.setMonth(l(this._get(b, j.match(/MM/) ? "monthNames" : "monthNamesShort"))); f.setDate(l(this._get(b, j.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - f.getDay()) } b.input.attr("size", this._formatDate(b, f).length) } }, _inlineDatepicker: function (b,
f) { var j = a(b); if (!j.hasClass(this.markerClassName)) { j.addClass(this.markerClassName).append(f.dpDiv).bind("setData.datepicker", function (l, o, n) { f.settings[o] = n }).bind("getData.datepicker", function (l, o) { return this._get(f, o) }); a.data(b, "datepicker", f); this._setDate(f, this._getDefaultDate(f), true); this._updateDatepicker(f); this._updateAlternate(f); f.settings.disabled && this._disableDatepicker(b); f.dpDiv.css("display", "block") } }, _dialogDatepicker: function (b, f, j, l, o) {
    b = this._dialogInst; if (!b) {
        this.uuid +=
1; this._dialogInput = a('<input type="text" id="' + ("dp" + this.uuid) + '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'); this._dialogInput.keydown(this._doKeyDown); a("body").append(this._dialogInput); b = this._dialogInst = this._newInst(this._dialogInput, false); b.settings = {}; a.data(this._dialogInput[0], "datepicker", b)
    } h(b.settings, l || {}); f = f && f.constructor == Date ? this._formatDate(b, f) : f; this._dialogInput.val(f); this._pos = o ? o.length ? o : [o.pageX, o.pageY] : null; if (!this._pos) this._pos = [document.documentElement.clientWidth /
2 - 100 + (document.documentElement.scrollLeft || document.body.scrollLeft), document.documentElement.clientHeight / 2 - 150 + (document.documentElement.scrollTop || document.body.scrollTop)]; this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"); b.settings.onSelect = j; this._inDialog = true; this.dpDiv.addClass(this._dialogClass); this._showDatepicker(this._dialogInput[0]); a.blockUI && a.blockUI(this.dpDiv); a.data(this._dialogInput[0], "datepicker", b); return this
}, _destroyDatepicker: function (b) {
    var f =
a(b), j = a.data(b, "datepicker"); if (f.hasClass(this.markerClassName)) { var l = b.nodeName.toLowerCase(); a.removeData(b, "datepicker"); if (l == "input") { j.append.remove(); j.trigger.remove(); f.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp) } else if (l == "div" || l == "span") f.removeClass(this.markerClassName).empty() } 
}, _enableDatepicker: function (b) {
    var f = a(b), j = a.data(b, "datepicker"); if (f.hasClass(this.markerClassName)) {
        var l =
b.nodeName.toLowerCase(); if (l == "input") { b.disabled = false; j.trigger.filter("button").each(function () { this.disabled = false }).end().filter("img").css({ opacity: "1.0", cursor: "" }) } else if (l == "div" || l == "span") { f = f.children("." + this._inlineClass); f.children().removeClass("ui-state-disabled"); f.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled") } this._disabledInputs = a.map(this._disabledInputs, function (o) { return o == b ? null : o })
    } 
}, _disableDatepicker: function (b) {
    var f = a(b), j = a.data(b,
"datepicker"); if (f.hasClass(this.markerClassName)) {
        var l = b.nodeName.toLowerCase(); if (l == "input") { b.disabled = true; j.trigger.filter("button").each(function () { this.disabled = true }).end().filter("img").css({ opacity: "0.5", cursor: "default" }) } else if (l == "div" || l == "span") { f = f.children("." + this._inlineClass); f.children().addClass("ui-state-disabled"); f.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled", "disabled") } this._disabledInputs = a.map(this._disabledInputs, function (o) {
            return o ==
b ? null : o
        }); this._disabledInputs[this._disabledInputs.length] = b
    } 
}, _isDisabledDatepicker: function (b) { if (!b) return false; for (var f = 0; f < this._disabledInputs.length; f++) if (this._disabledInputs[f] == b) return true; return false }, _getInst: function (b) { try { return a.data(b, "datepicker") } catch (f) { throw "Missing instance data for this datepicker"; } }, _optionDatepicker: function (b, f, j) {
    var l = this._getInst(b); if (arguments.length == 2 && typeof f == "string") return f == "defaults" ? a.extend({}, a.datepicker._defaults) : l ? f == "all" ?
a.extend({}, l.settings) : this._get(l, f) : null; var o = f || {}; if (typeof f == "string") { o = {}; o[f] = j } if (l) {
        this._curInst == l && this._hideDatepicker(); var n = this._getDateDatepicker(b, true), k = this._getMinMaxDate(l, "min"), m = this._getMinMaxDate(l, "max"); h(l.settings, o); if (k !== null && o.dateFormat !== d && o.minDate === d) l.settings.minDate = this._formatDate(l, k); if (m !== null && o.dateFormat !== d && o.maxDate === d) l.settings.maxDate = this._formatDate(l, m); this._attachments(a(b), l); this._autoSize(l); this._setDate(l, n); this._updateAlternate(l);
        this._updateDatepicker(l)
    } 
}, _changeDatepicker: function (b, f, j) { this._optionDatepicker(b, f, j) }, _refreshDatepicker: function (b) { (b = this._getInst(b)) && this._updateDatepicker(b) }, _setDateDatepicker: function (b, f) { if (b = this._getInst(b)) { this._setDate(b, f); this._updateDatepicker(b); this._updateAlternate(b) } }, _getDateDatepicker: function (b, f) { (b = this._getInst(b)) && !b.inline && this._setDateFromField(b, f); return b ? this._getDate(b) : null }, _doKeyDown: function (b) {
    var f = a.datepicker._getInst(b.target), j = true, l = f.dpDiv.is(".ui-datepicker-rtl");
    f._keyEvent = true; if (a.datepicker._datepickerShowing) switch (b.keyCode) {
        case 9: a.datepicker._hideDatepicker(); j = false; break; case 13: j = a("td." + a.datepicker._dayOverClass + ":not(." + a.datepicker._currentClass + ")", f.dpDiv); j[0] && a.datepicker._selectDay(b.target, f.selectedMonth, f.selectedYear, j[0]); if (b = a.datepicker._get(f, "onSelect")) { j = a.datepicker._formatDate(f); b.apply(f.input ? f.input[0] : null, [j, f]) } else a.datepicker._hideDatepicker(); return false; case 27: a.datepicker._hideDatepicker(); break; case 33: a.datepicker._adjustDate(b.target,
b.ctrlKey ? -a.datepicker._get(f, "stepBigMonths") : -a.datepicker._get(f, "stepMonths"), "M"); break; case 34: a.datepicker._adjustDate(b.target, b.ctrlKey ? +a.datepicker._get(f, "stepBigMonths") : +a.datepicker._get(f, "stepMonths"), "M"); break; case 35: if (b.ctrlKey || b.metaKey) a.datepicker._clearDate(b.target); j = b.ctrlKey || b.metaKey; break; case 36: if (b.ctrlKey || b.metaKey) a.datepicker._gotoToday(b.target); j = b.ctrlKey || b.metaKey; break; case 37: if (b.ctrlKey || b.metaKey) a.datepicker._adjustDate(b.target, l ? +1 : -1, "D"); j =
b.ctrlKey || b.metaKey; if (b.originalEvent.altKey) a.datepicker._adjustDate(b.target, b.ctrlKey ? -a.datepicker._get(f, "stepBigMonths") : -a.datepicker._get(f, "stepMonths"), "M"); break; case 38: if (b.ctrlKey || b.metaKey) a.datepicker._adjustDate(b.target, -7, "D"); j = b.ctrlKey || b.metaKey; break; case 39: if (b.ctrlKey || b.metaKey) a.datepicker._adjustDate(b.target, l ? -1 : +1, "D"); j = b.ctrlKey || b.metaKey; if (b.originalEvent.altKey) a.datepicker._adjustDate(b.target, b.ctrlKey ? +a.datepicker._get(f, "stepBigMonths") : +a.datepicker._get(f,
"stepMonths"), "M"); break; case 40: if (b.ctrlKey || b.metaKey) a.datepicker._adjustDate(b.target, +7, "D"); j = b.ctrlKey || b.metaKey; break; default: j = false
    } else if (b.keyCode == 36 && b.ctrlKey) a.datepicker._showDatepicker(this); else j = false; if (j) { b.preventDefault(); b.stopPropagation() } 
}, _doKeyPress: function (b) {
    var f = a.datepicker._getInst(b.target); if (a.datepicker._get(f, "constrainInput")) {
        f = a.datepicker._possibleChars(a.datepicker._get(f, "dateFormat")); var j = String.fromCharCode(b.charCode == d ? b.keyCode : b.charCode);
        return b.ctrlKey || b.metaKey || j < " " || !f || f.indexOf(j) > -1
    } 
}, _doKeyUp: function (b) { b = a.datepicker._getInst(b.target); if (b.input.val() != b.lastVal) try { if (a.datepicker.parseDate(a.datepicker._get(b, "dateFormat"), b.input ? b.input.val() : null, a.datepicker._getFormatConfig(b))) { a.datepicker._setDateFromField(b); a.datepicker._updateAlternate(b); a.datepicker._updateDatepicker(b) } } catch (f) { a.datepicker.log(f) } return true }, _showDatepicker: function (b) {
    b = b.target || b; if (b.nodeName.toLowerCase() != "input") b = a("input",
b.parentNode)[0]; if (!(a.datepicker._isDisabledDatepicker(b) || a.datepicker._lastInput == b)) {
        var f = a.datepicker._getInst(b); if (a.datepicker._curInst && a.datepicker._curInst != f) { a.datepicker._datepickerShowing && a.datepicker._triggerOnClose(a.datepicker._curInst); a.datepicker._curInst.dpDiv.stop(true, true) } var j = a.datepicker._get(f, "beforeShow"); j = j ? j.apply(b, [b, f]) : {}; if (j !== false) {
            h(f.settings, j); f.lastVal = null; a.datepicker._lastInput = b; a.datepicker._setDateFromField(f); if (a.datepicker._inDialog) b.value =
""; if (!a.datepicker._pos) { a.datepicker._pos = a.datepicker._findPos(b); a.datepicker._pos[1] += b.offsetHeight } var l = false; a(b).parents().each(function () { l |= a(this).css("position") == "fixed"; return !l }); if (l && a.browser.opera) { a.datepicker._pos[0] -= document.documentElement.scrollLeft; a.datepicker._pos[1] -= document.documentElement.scrollTop } j = { left: a.datepicker._pos[0], top: a.datepicker._pos[1] }; a.datepicker._pos = null; f.dpDiv.empty(); f.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }); a.datepicker._updateDatepicker(f);
            j = a.datepicker._checkOffset(f, j, l); f.dpDiv.css({ position: a.datepicker._inDialog && a.blockUI ? "static" : l ? "fixed" : "absolute", display: "none", left: j.left + "px", top: j.top + "px" }); if (!f.inline) {
                j = a.datepicker._get(f, "showAnim"); var o = a.datepicker._get(f, "duration"), n = function () { var k = f.dpDiv.find("iframe.ui-datepicker-cover"); if (k.length) { var m = a.datepicker._getBorders(f.dpDiv); k.css({ left: -m[0], top: -m[1], width: f.dpDiv.outerWidth(), height: f.dpDiv.outerHeight() }) } }; f.dpDiv.zIndex(a(b).zIndex() + 1); a.datepicker._datepickerShowing =
true; a.effects && a.effects[j] ? f.dpDiv.show(j, a.datepicker._get(f, "showOptions"), o, n) : f.dpDiv[j || "show"](j ? o : null, n); if (!j || !o) n(); f.input.is(":visible") && !f.input.is(":disabled") && f.input.focus(); a.datepicker._curInst = f
            } 
        } 
    } 
}, _updateDatepicker: function (b) {
    this.maxRows = 4; var f = a.datepicker._getBorders(b.dpDiv); i = b; b.dpDiv.empty().append(this._generateHTML(b)); var j = b.dpDiv.find("iframe.ui-datepicker-cover"); j.length && j.css({ left: -f[0], top: -f[1], width: b.dpDiv.outerWidth(), height: b.dpDiv.outerHeight() });
    b.dpDiv.find("." + this._dayOverClass + " a").mouseover(); f = this._getNumberOfMonths(b); j = f[1]; b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); j > 1 && b.dpDiv.addClass("ui-datepicker-multi-" + j).css("width", 17 * j + "em"); b.dpDiv[(f[0] != 1 || f[1] != 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"); b.dpDiv[(this._get(b, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"); b == a.datepicker._curInst && a.datepicker._datepickerShowing && b.input && b.input.is(":visible") &&
!b.input.is(":disabled") && b.input[0] != document.activeElement && b.input.focus(); if (b.yearshtml) { var l = b.yearshtml; setTimeout(function () { l === b.yearshtml && b.yearshtml && b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml); l = b.yearshtml = null }, 0) } 
}, _getBorders: function (b) { var f = function (j) { return { thin: 1, medium: 2, thick: 3}[j] || j }; return [parseFloat(f(b.css("border-left-width"))), parseFloat(f(b.css("border-top-width")))] }, _checkOffset: function (b, f, j) {
    var l = b.dpDiv.outerWidth(), o = b.dpDiv.outerHeight(),
n = b.input ? b.input.outerWidth() : 0, k = b.input ? b.input.outerHeight() : 0, m = document.documentElement.clientWidth + a(document).scrollLeft(), p = document.documentElement.clientHeight + a(document).scrollTop(); f.left -= this._get(b, "isRTL") ? l - n : 0; f.left -= j && f.left == b.input.offset().left ? a(document).scrollLeft() : 0; f.top -= j && f.top == b.input.offset().top + k ? a(document).scrollTop() : 0; f.left -= Math.min(f.left, f.left + l > m && m > l ? Math.abs(f.left + l - m) : 0); f.top -= Math.min(f.top, f.top + o > p && p > o ? Math.abs(o + k) : 0); return f
}, _findPos: function (b) {
    for (var f =
this._get(this._getInst(b), "isRTL"); b && (b.type == "hidden" || b.nodeType != 1 || a.expr.filters.hidden(b)); ) b = b[f ? "previousSibling" : "nextSibling"]; b = a(b).offset(); return [b.left, b.top]
}, _triggerOnClose: function (b) { var f = this._get(b, "onClose"); if (f) f.apply(b.input ? b.input[0] : null, [b.input ? b.input.val() : "", b]) }, _hideDatepicker: function (b) {
    var f = this._curInst; if (!(!f || b && f != a.data(b, "datepicker"))) if (this._datepickerShowing) {
        b = this._get(f, "showAnim"); var j = this._get(f, "duration"), l = function () {
            a.datepicker._tidyDialog(f);
            this._curInst = null
        }; a.effects && a.effects[b] ? f.dpDiv.hide(b, a.datepicker._get(f, "showOptions"), j, l) : f.dpDiv[b == "slideDown" ? "slideUp" : b == "fadeIn" ? "fadeOut" : "hide"](b ? j : null, l); b || l(); a.datepicker._triggerOnClose(f); this._datepickerShowing = false; this._lastInput = null; if (this._inDialog) { this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); if (a.blockUI) { a.unblockUI(); a("body").append(this.dpDiv) } } this._inDialog = false
    } 
}, _tidyDialog: function (b) { b.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar") },
        _checkExternalClick: function (b) { if (a.datepicker._curInst) { b = a(b.target); b[0].id != a.datepicker._mainDivId && b.parents("#" + a.datepicker._mainDivId).length == 0 && !b.hasClass(a.datepicker.markerClassName) && !b.hasClass(a.datepicker._triggerClass) && a.datepicker._datepickerShowing && !(a.datepicker._inDialog && a.blockUI) && a.datepicker._hideDatepicker() } }, _adjustDate: function (b, f, j) {
            b = a(b); var l = this._getInst(b[0]); if (!this._isDisabledDatepicker(b[0])) {
                this._adjustInstDate(l, f + (j == "M" ? this._get(l, "showCurrentAtPos") :
0), j); this._updateDatepicker(l)
            } 
        }, _gotoToday: function (b) { b = a(b); var f = this._getInst(b[0]); if (this._get(f, "gotoCurrent") && f.currentDay) { f.selectedDay = f.currentDay; f.drawMonth = f.selectedMonth = f.currentMonth; f.drawYear = f.selectedYear = f.currentYear } else { var j = new Date; f.selectedDay = j.getDate(); f.drawMonth = f.selectedMonth = j.getMonth(); f.drawYear = f.selectedYear = j.getFullYear() } this._notifyChange(f); this._adjustDate(b) }, _selectMonthYear: function (b, f, j) {
            b = a(b); var l = this._getInst(b[0]); l["selected" + (j == "M" ?
"Month" : "Year")] = l["draw" + (j == "M" ? "Month" : "Year")] = parseInt(f.options[f.selectedIndex].value, 10); this._notifyChange(l); this._adjustDate(b)
        }, _selectDay: function (b, f, j, l) { var o = a(b); if (!(a(l).hasClass(this._unselectableClass) || this._isDisabledDatepicker(o[0]))) { o = this._getInst(o[0]); o.selectedDay = o.currentDay = a("a", l).html(); o.selectedMonth = o.currentMonth = f; o.selectedYear = o.currentYear = j; this._selectDate(b, this._formatDate(o, o.currentDay, o.currentMonth, o.currentYear)) } }, _clearDate: function (b) {
            b = a(b);
            this._getInst(b[0]); this._selectDate(b, "")
        }, _selectDate: function (b, f) { b = this._getInst(a(b)[0]); f = f != null ? f : this._formatDate(b); b.input && b.input.val(f); this._updateAlternate(b); var j = this._get(b, "onSelect"); if (j) j.apply(b.input ? b.input[0] : null, [f, b]); else b.input && b.input.trigger("change"); if (b.inline) this._updateDatepicker(b); else { this._hideDatepicker(); this._lastInput = b.input[0]; typeof b.input[0] != "object" && b.input.focus(); this._lastInput = null } }, _updateAlternate: function (b) {
            var f = this._get(b, "altField");
            if (f) { var j = this._get(b, "altFormat") || this._get(b, "dateFormat"), l = this._getDate(b), o = this.formatDate(j, l, this._getFormatConfig(b)); a(f).each(function () { a(this).val(o) }) } 
        }, noWeekends: function (b) { b = b.getDay(); return [b > 0 && b < 6, ""] }, iso8601Week: function (b) { b = new Date(b.getTime()); b.setDate(b.getDate() + 4 - (b.getDay() || 7)); var f = b.getTime(); b.setMonth(0); b.setDate(1); return Math.floor(Math.round((f - b) / 864E5) / 7) + 1 }, parseDate: function (b, f, j) {
            if (b == null || f == null) throw "Invalid arguments"; f = typeof f == "object" ?
f.toString() : f + ""; if (f == "") return null; var l = (j ? j.shortYearCutoff : null) || this._defaults.shortYearCutoff; l = typeof l != "string" ? l : (new Date).getFullYear() % 100 + parseInt(l, 10); for (var o = (j ? j.dayNamesShort : null) || this._defaults.dayNamesShort, n = (j ? j.dayNames : null) || this._defaults.dayNames, k = (j ? j.monthNamesShort : null) || this._defaults.monthNamesShort, m = (j ? j.monthNames : null) || this._defaults.monthNames, p = j = -1, q = -1, s = -1, r = false, u = function (z) { (z = H + 1 < b.length && b.charAt(H + 1) == z) && H++; return z }, v = function (z) {
    var I =
u(z); z = new RegExp("^\\d{1," + (z == "@" ? 14 : z == "!" ? 20 : z == "y" && I ? 4 : z == "o" ? 3 : 2) + "}"); z = f.substring(y).match(z); if (!z) throw "Missing number at position " + y; y += z[0].length; return parseInt(z[0], 10)
}, w = function (z, I, N) { z = a.map(u(z) ? N : I, function (D, E) { return [[E, D]] }).sort(function (D, E) { return -(D[1].length - E[1].length) }); var J = -1; a.each(z, function (D, E) { D = E[1]; if (f.substr(y, D.length).toLowerCase() == D.toLowerCase()) { J = E[0]; y += D.length; return false } }); if (J != -1) return J + 1; else throw "Unknown name at position " + y; }, x =
function () { if (f.charAt(y) != b.charAt(H)) throw "Unexpected literal at position " + y; y++ }, y = 0, H = 0; H < b.length; H++) if (r) if (b.charAt(H) == "'" && !u("'")) r = false; else x(); else switch (b.charAt(H)) {
                case "d": q = v("d"); break; case "D": w("D", o, n); break; case "o": s = v("o"); break; case "m": p = v("m"); break; case "M": p = w("M", k, m); break; case "y": j = v("y"); break; case "@": var C = new Date(v("@")); j = C.getFullYear(); p = C.getMonth() + 1; q = C.getDate(); break; case "!": C = new Date((v("!") - this._ticksTo1970) / 1E4); j = C.getFullYear(); p = C.getMonth() +
1; q = C.getDate(); break; case "'": if (u("'")) x(); else r = true; break; default: x()
            } if (y < f.length) throw "Extra/unparsed characters found in date: " + f.substring(y); if (j == -1) j = (new Date).getFullYear(); else if (j < 100) j += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (j <= l ? 0 : -100); if (s > -1) { p = 1; q = s; do { l = this._getDaysInMonth(j, p - 1); if (q <= l) break; p++; q -= l } while (1) } C = this._daylightSavingAdjust(new Date(j, p - 1, q)); if (C.getFullYear() != j || C.getMonth() + 1 != p || C.getDate() != q) throw "Invalid date"; return C
        }, 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: (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)) * 24 * 60 * 60 * 1E7, formatDate: function (b, f, j) {
            if (!f) return ""; var l = (j ? j.dayNamesShort : null) || this._defaults.dayNamesShort, o = (j ? j.dayNames : null) || this._defaults.dayNames, n = (j ? j.monthNamesShort : null) || this._defaults.monthNamesShort; j = (j ? j.monthNames :
null) || this._defaults.monthNames; var k = function (u) { (u = r + 1 < b.length && b.charAt(r + 1) == u) && r++; return u }, m = function (u, v, w) { v = "" + v; if (k(u)) for (; v.length < w; ) v = "0" + v; return v }, p = function (u, v, w, x) { return k(u) ? x[v] : w[v] }, q = "", s = false; if (f) for (var r = 0; r < b.length; r++) if (s) if (b.charAt(r) == "'" && !k("'")) s = false; else q += b.charAt(r); else switch (b.charAt(r)) {
                case "d": q += m("d", f.getDate(), 2); break; case "D": q += p("D", f.getDay(), l, o); break; case "o": q += m("o", Math.round(((new Date(f.getFullYear(), f.getMonth(), f.getDate())).getTime() -
(new Date(f.getFullYear(), 0, 0)).getTime()) / 864E5), 3); break; case "m": q += m("m", f.getMonth() + 1, 2); break; case "M": q += p("M", f.getMonth(), n, j); break; case "y": q += k("y") ? f.getFullYear() : (f.getYear() % 100 < 10 ? "0" : "") + f.getYear() % 100; break; case "@": q += f.getTime(); break; case "!": q += f.getTime() * 1E4 + this._ticksTo1970; break; case "'": if (k("'")) q += "'"; else s = true; break; default: q += b.charAt(r)
            } return q
        }, _possibleChars: function (b) {
            for (var f = "", j = false, l = function (n) { (n = o + 1 < b.length && b.charAt(o + 1) == n) && o++; return n }, o =
0; o < b.length; o++) if (j) if (b.charAt(o) == "'" && !l("'")) j = false; else f += b.charAt(o); else switch (b.charAt(o)) { case "d": case "m": case "y": case "@": f += "0123456789"; break; case "D": case "M": return null; case "'": if (l("'")) f += "'"; else j = true; break; default: f += b.charAt(o) } return f
        }, _get: function (b, f) { return b.settings[f] !== d ? b.settings[f] : this._defaults[f] }, _setDateFromField: function (b, f) {
            if (b.input.val() != b.lastVal) {
                var j = this._get(b, "dateFormat"), l = b.lastVal = b.input ? b.input.val() : null, o, n; o = n = this._getDefaultDate(b);
                var k = this._getFormatConfig(b); try { o = this.parseDate(j, l, k) || n } catch (m) { this.log(m); l = f ? "" : l } b.selectedDay = o.getDate(); b.drawMonth = b.selectedMonth = o.getMonth(); b.drawYear = b.selectedYear = o.getFullYear(); b.currentDay = l ? o.getDate() : 0; b.currentMonth = l ? o.getMonth() : 0; b.currentYear = l ? o.getFullYear() : 0; this._adjustInstDate(b)
            } 
        }, _getDefaultDate: function (b) { return this._restrictMinMax(b, this._determineDate(b, this._get(b, "defaultDate"), new Date)) }, _determineDate: function (b, f, j) {
            var l = function (n) {
                var k = new Date;
                k.setDate(k.getDate() + n); return k
            }, o = function (n) {
                try { return a.datepicker.parseDate(a.datepicker._get(b, "dateFormat"), n, a.datepicker._getFormatConfig(b)) } catch (k) { } var m = (n.toLowerCase().match(/^c/) ? a.datepicker._getDate(b) : null) || new Date, p = m.getFullYear(), q = m.getMonth(); m = m.getDate(); for (var s = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, r = s.exec(n); r; ) {
                    switch (r[2] || "d") {
                        case "d": case "D": m += parseInt(r[1], 10); break; case "w": case "W": m += parseInt(r[1], 10) * 7; break; case "m": case "M": q += parseInt(r[1], 10); m =
Math.min(m, a.datepicker._getDaysInMonth(p, q)); break; case "y": case "Y": p += parseInt(r[1], 10); m = Math.min(m, a.datepicker._getDaysInMonth(p, q)); break
                    } r = s.exec(n)
                } return new Date(p, q, m)
            }; if (f = (f = f == null || f === "" ? j : typeof f == "string" ? o(f) : typeof f == "number" ? isNaN(f) ? j : l(f) : new Date(f.getTime())) && f.toString() == "Invalid Date" ? j : f) { f.setHours(0); f.setMinutes(0); f.setSeconds(0); f.setMilliseconds(0) } return this._daylightSavingAdjust(f)
        }, _daylightSavingAdjust: function (b) {
            if (!b) return null; b.setHours(b.getHours() >
12 ? b.getHours() + 2 : 0); return b
        }, _setDate: function (b, f, j) { var l = !f, o = b.selectedMonth, n = b.selectedYear; f = this._restrictMinMax(b, this._determineDate(b, f, new Date)); b.selectedDay = b.currentDay = f.getDate(); b.drawMonth = b.selectedMonth = b.currentMonth = f.getMonth(); b.drawYear = b.selectedYear = b.currentYear = f.getFullYear(); if ((o != b.selectedMonth || n != b.selectedYear) && !j) this._notifyChange(b); this._adjustInstDate(b); if (b.input) b.input.val(l ? "" : this._formatDate(b)) }, _getDate: function (b) {
            return !b.currentYear || b.input &&
b.input.val() == "" ? null : this._daylightSavingAdjust(new Date(b.currentYear, b.currentMonth, b.currentDay))
        }, _generateHTML: function (b) {
            var f = new Date; f = this._daylightSavingAdjust(new Date(f.getFullYear(), f.getMonth(), f.getDate())); var j = this._get(b, "isRTL"), l = this._get(b, "showButtonPanel"), o = this._get(b, "hideIfNoPrevNext"), n = this._get(b, "navigationAsDateFormat"), k = this._getNumberOfMonths(b), m = this._get(b, "showCurrentAtPos"), p = this._get(b, "stepMonths"), q = k[0] != 1 || k[1] != 1, s = this._daylightSavingAdjust(!b.currentDay ?
new Date(9999, 9, 9) : new Date(b.currentYear, b.currentMonth, b.currentDay)), r = this._getMinMaxDate(b, "min"), u = this._getMinMaxDate(b, "max"); m = b.drawMonth - m; var v = b.drawYear; if (m < 0) { m += 12; v-- } if (u) { var w = this._daylightSavingAdjust(new Date(u.getFullYear(), u.getMonth() - k[0] * k[1] + 1, u.getDate())); for (w = r && w < r ? r : w; this._daylightSavingAdjust(new Date(v, m, 1)) > w; ) { m--; if (m < 0) { m = 11; v-- } } } b.drawMonth = m; b.drawYear = v; w = this._get(b, "prevText"); w = !n ? w : this.formatDate(w, this._daylightSavingAdjust(new Date(v, m - p, 1)), this._getFormatConfig(b));
            w = this._canAdjustMonth(b, -1, v, m) ? '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + g + ".datepicker._adjustDate('#" + b.id + "', -" + p + ", 'M');\" title=\"" + w + '"><span class="ui-icon ui-icon-circle-triangle-' + (j ? "e" : "w") + '">' + w + "</span></a>" : o ? "" : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="' + w + '"><span class="ui-icon ui-icon-circle-triangle-' + (j ? "e" : "w") + '">' + w + "</span></a>"; var x = this._get(b, "nextText"); x = !n ? x : this.formatDate(x, this._daylightSavingAdjust(new Date(v,
m + p, 1)), this._getFormatConfig(b)); o = this._canAdjustMonth(b, +1, v, m) ? '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + g + ".datepicker._adjustDate('#" + b.id + "', +" + p + ", 'M');\" title=\"" + x + '"><span class="ui-icon ui-icon-circle-triangle-' + (j ? "w" : "e") + '">' + x + "</span></a>" : o ? "" : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="' + x + '"><span class="ui-icon ui-icon-circle-triangle-' + (j ? "w" : "e") + '">' + x + "</span></a>"; p = this._get(b, "currentText"); x = this._get(b, "gotoCurrent") &&
b.currentDay ? s : f; p = !n ? p : this.formatDate(p, x, this._getFormatConfig(b)); n = !b.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + g + '.datepicker._hideDatepicker();">' + this._get(b, "closeText") + "</button>" : ""; l = l ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (j ? n : "") + (this._isInRange(b, x) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' +
g + ".datepicker._gotoToday('#" + b.id + "');\">" + p + "</button>" : "") + (j ? "" : n) + "</div>" : ""; n = parseInt(this._get(b, "firstDay"), 10); n = isNaN(n) ? 0 : n; p = this._get(b, "showWeek"); x = this._get(b, "dayNames"); this._get(b, "dayNamesShort"); var y = this._get(b, "dayNamesMin"), H = this._get(b, "monthNames"), C = this._get(b, "monthNamesShort"), z = this._get(b, "beforeShowDay"), I = this._get(b, "showOtherMonths"), N = this._get(b, "selectOtherMonths"); this._get(b, "calculateWeek"); for (var J = this._getDefaultDate(b), D = "", E = 0; E < k[0]; E++) {
                var P =
""; this.maxRows = 4; for (var L = 0; L < k[1]; L++) {
                    var Q = this._daylightSavingAdjust(new Date(v, m, b.selectedDay)), B = " ui-corner-all", F = ""; if (q) { F += '<div class="ui-datepicker-group'; if (k[1] > 1) switch (L) { case 0: F += " ui-datepicker-group-first"; B = " ui-corner-" + (j ? "right" : "left"); break; case k[1] - 1: F += " ui-datepicker-group-last"; B = " ui-corner-" + (j ? "left" : "right"); break; default: F += " ui-datepicker-group-middle"; B = ""; break } F += '">' } F += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + B + '">' + (/all|left/.test(B) &&
E == 0 ? j ? o : w : "") + (/all|right/.test(B) && E == 0 ? j ? w : o : "") + this._generateMonthYearHeader(b, m, v, r, u, E > 0 || L > 0, H, C) + '</div><table class="ui-datepicker-calendar"><thead><tr>'; var G = p ? '<th class="ui-datepicker-week-col">' + this._get(b, "weekHeader") + "</th>" : ""; for (B = 0; B < 7; B++) { var A = (B + n) % 7; G += "<th" + ((B + n + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : "") + '><span title="' + x[A] + '">' + y[A] + "</span></th>" } F += G + "</tr></thead><tbody>"; G = this._getDaysInMonth(v, m); if (v == b.selectedYear && m == b.selectedMonth) b.selectedDay = Math.min(b.selectedDay,
G); B = (this._getFirstDayOfMonth(v, m) - n + 7) % 7; G = Math.ceil((B + G) / 7); this.maxRows = G = q ? this.maxRows > G ? this.maxRows : G : G; A = this._daylightSavingAdjust(new Date(v, m, 1 - B)); for (var R = 0; R < G; R++) {
                        F += "<tr>"; var S = !p ? "" : '<td class="ui-datepicker-week-col">' + this._get(b, "calculateWeek")(A) + "</td>"; for (B = 0; B < 7; B++) {
                            var M = z ? z.apply(b.input ? b.input[0] : null, [A]) : [true, ""], K = A.getMonth() != m, O = K && !N || !M[0] || r && A < r || u && A > u; S += '<td class="' + ((B + n + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (K ? " ui-datepicker-other-month" : "") + (A.getTime() ==
Q.getTime() && m == b.selectedMonth && b._keyEvent || J.getTime() == A.getTime() && J.getTime() == Q.getTime() ? " " + this._dayOverClass : "") + (O ? " " + this._unselectableClass + " ui-state-disabled" : "") + (K && !I ? "" : " " + M[1] + (A.getTime() == s.getTime() ? " " + this._currentClass : "") + (A.getTime() == f.getTime() ? " ui-datepicker-today" : "")) + '"' + ((!K || I) && M[2] ? ' title="' + M[2] + '"' : "") + (O ? "" : ' onclick="DP_jQuery_' + g + ".datepicker._selectDay('#" + b.id + "'," + A.getMonth() + "," + A.getFullYear() + ', this);return false;"') + ">" + (K && !I ? "&#xa0;" : O ? '<span class="ui-state-default">' +
A.getDate() + "</span>" : '<a class="ui-state-default' + (A.getTime() == f.getTime() ? " ui-state-highlight" : "") + (A.getTime() == s.getTime() ? " ui-state-active" : "") + (K ? " ui-priority-secondary" : "") + '" href="#">' + A.getDate() + "</a>") + "</td>"; A.setDate(A.getDate() + 1); A = this._daylightSavingAdjust(A)
                        } F += S + "</tr>"
                    } m++; if (m > 11) { m = 0; v++ } F += "</tbody></table>" + (q ? "</div>" + (k[0] > 0 && L == k[1] - 1 ? '<div class="ui-datepicker-row-break"></div>' : "") : ""); P += F
                } D += P
            } D += l + (a.browser.msie && parseInt(a.browser.version, 10) < 7 && !b.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' :
""); b._keyEvent = false; return D
        }, _generateMonthYearHeader: function (b, f, j, l, o, n, k, m) {
            var p = this._get(b, "changeMonth"), q = this._get(b, "changeYear"), s = this._get(b, "showMonthAfterYear"), r = '<div class="ui-datepicker-title">', u = ""; if (n || !p) u += '<span class="ui-datepicker-month">' + k[f] + "</span>"; else {
                k = l && l.getFullYear() == j; var v = o && o.getFullYear() == j; u += '<select class="ui-datepicker-month" onchange="DP_jQuery_' + g + ".datepicker._selectMonthYear('#" + b.id + "', this, 'M');\" >"; for (var w = 0; w < 12; w++) if ((!k || w >= l.getMonth()) &&
(!v || w <= o.getMonth())) u += '<option value="' + w + '"' + (w == f ? ' selected="selected"' : "") + ">" + m[w] + "</option>"; u += "</select>"
            } s || (r += u + (n || !(p && q) ? "&#xa0;" : "")); if (!b.yearshtml) {
                b.yearshtml = ""; if (n || !q) r += '<span class="ui-datepicker-year">' + j + "</span>"; else {
                    m = this._get(b, "yearRange").split(":"); var x = (new Date).getFullYear(); k = function (y) { y = y.match(/c[+-].*/) ? j + parseInt(y.substring(1), 10) : y.match(/[+-].*/) ? x + parseInt(y, 10) : parseInt(y, 10); return isNaN(y) ? x : y }; f = k(m[0]); m = Math.max(f, k(m[1] || "")); f = l ? Math.max(f,
l.getFullYear()) : f; m = o ? Math.min(m, o.getFullYear()) : m; for (b.yearshtml += '<select class="ui-datepicker-year" onchange="DP_jQuery_' + g + ".datepicker._selectMonthYear('#" + b.id + "', this, 'Y');\" >"; f <= m; f++) b.yearshtml += '<option value="' + f + '"' + (f == j ? ' selected="selected"' : "") + ">" + f + "</option>"; b.yearshtml += "</select>"; r += b.yearshtml; b.yearshtml = null
                } 
            } r += this._get(b, "yearSuffix"); if (s) r += (n || !(p && q) ? "&#xa0;" : "") + u; r += "</div>"; return r
        }, _adjustInstDate: function (b, f, j) {
            var l = b.drawYear + (j == "Y" ? f : 0), o = b.drawMonth +
(j == "M" ? f : 0); f = Math.min(b.selectedDay, this._getDaysInMonth(l, o)) + (j == "D" ? f : 0); l = this._restrictMinMax(b, this._daylightSavingAdjust(new Date(l, o, f))); b.selectedDay = l.getDate(); b.drawMonth = b.selectedMonth = l.getMonth(); b.drawYear = b.selectedYear = l.getFullYear(); if (j == "M" || j == "Y") this._notifyChange(b)
        }, _restrictMinMax: function (b, f) { var j = this._getMinMaxDate(b, "min"); b = this._getMinMaxDate(b, "max"); f = j && f < j ? j : f; return f = b && f > b ? b : f }, _notifyChange: function (b) {
            var f = this._get(b, "onChangeMonthYear"); if (f) f.apply(b.input ?
b.input[0] : null, [b.selectedYear, b.selectedMonth + 1, b])
        }, _getNumberOfMonths: function (b) { b = this._get(b, "numberOfMonths"); return b == null ? [1, 1] : typeof b == "number" ? [1, b] : b }, _getMinMaxDate: function (b, f) { return this._determineDate(b, this._get(b, f + "Date"), null) }, _getDaysInMonth: function (b, f) { return 32 - this._daylightSavingAdjust(new Date(b, f, 32)).getDate() }, _getFirstDayOfMonth: function (b, f) { return (new Date(b, f, 1)).getDay() }, _canAdjustMonth: function (b, f, j, l) {
            var o = this._getNumberOfMonths(b); j = this._daylightSavingAdjust(new Date(j,
l + (f < 0 ? f : o[0] * o[1]), 1)); f < 0 && j.setDate(this._getDaysInMonth(j.getFullYear(), j.getMonth())); return this._isInRange(b, j)
        }, _isInRange: function (b, f) { var j = this._getMinMaxDate(b, "min"); b = this._getMinMaxDate(b, "max"); return (!j || f.getTime() >= j.getTime()) && (!b || f.getTime() <= b.getTime()) }, _getFormatConfig: function (b) {
            var f = this._get(b, "shortYearCutoff"); f = typeof f != "string" ? f : (new Date).getFullYear() % 100 + parseInt(f, 10); return { shortYearCutoff: f, dayNamesShort: this._get(b, "dayNamesShort"), dayNames: this._get(b,
"dayNames"), monthNamesShort: this._get(b, "monthNamesShort"), monthNames: this._get(b, "monthNames")
            }
        }, _formatDate: function (b, f, j, l) { if (!f) { b.currentDay = b.selectedDay; b.currentMonth = b.selectedMonth; b.currentYear = b.selectedYear } f = f ? typeof f == "object" ? f : this._daylightSavingAdjust(new Date(l, j, f)) : this._daylightSavingAdjust(new Date(b.currentYear, b.currentMonth, b.currentDay)); return this.formatDate(this._get(b, "dateFormat"), f, this._getFormatConfig(b)) } 
    }); a.fn.datepicker = function (b) {
        if (!this.length) return this;
        if (!a.datepicker.initialized) { a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv); a.datepicker.initialized = true } var f = Array.prototype.slice.call(arguments, 1); if (typeof b == "string" && (b == "isDisabled" || b == "getDate" || b == "widget")) return a.datepicker["_" + b + "Datepicker"].apply(a.datepicker, [this[0]].concat(f)); if (b == "option" && arguments.length == 2 && typeof arguments[1] == "string") return a.datepicker["_" + b + "Datepicker"].apply(a.datepicker, [this[0]].concat(f)); return this.each(function () {
            typeof b ==
"string" ? a.datepicker["_" + b + "Datepicker"].apply(a.datepicker, [this].concat(f)) : a.datepicker._attachDatepicker(this, b)
        })
    }; a.datepicker = new c; a.datepicker.initialized = false; a.datepicker.uuid = (new Date).getTime(); a.datepicker.version = "1.8.16"; window["DP_jQuery_" + g] = a
})(jQuery);
(function (a, d) {
    var c = { buttons: true, height: true, maxHeight: true, maxWidth: true, minHeight: true, minWidth: true, width: true }, e = { maxHeight: true, maxWidth: true, minHeight: true, minWidth: true }, h = a.attrFn || { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true, click: true }; a.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: { my: "center", at: "center", collision: "fit", using: function (g) { var i = a(this).css(g).offset().top; i < 0 && a(this).css("top", g.top - i) } }, resizable: true, show: null, stack: true, title: "", width: 300, zIndex: 1E3
    }, _create: function () {
        this.originalTitle = this.element.attr("title"); if (typeof this.originalTitle !== "string") this.originalTitle = ""; this.options.title = this.options.title || this.originalTitle; var g = this, i = g.options, b = i.title || "&#160;", f = a.ui.dialog.getTitleId(g.element), j = (g.uiDialog = a("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all " +
i.dialogClass).css({ zIndex: i.zIndex }).attr("tabIndex", -1).css("outline", 0).keydown(function (n) { if (i.closeOnEscape && !n.isDefaultPrevented() && n.keyCode && n.keyCode === a.ui.keyCode.ESCAPE) { g.close(n); n.preventDefault() } }).attr({ role: "dialog", "aria-labelledby": f }).mousedown(function (n) { g.moveToTop(false, n) }); g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j); var l = (g.uiDialogTitlebar = a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),
o = a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", "button").hover(function () { o.addClass("ui-state-hover") }, function () { o.removeClass("ui-state-hover") }).focus(function () { o.addClass("ui-state-focus") }).blur(function () { o.removeClass("ui-state-focus") }).click(function (n) { g.close(n); return false }).appendTo(l); (g.uiDialogTitlebarCloseText = a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(o); a("<span></span>").addClass("ui-dialog-title").attr("id",
f).html(b).prependTo(l); if (a.isFunction(i.beforeclose) && !a.isFunction(i.beforeClose)) i.beforeClose = i.beforeclose; l.find("*").add(l).disableSelection(); i.draggable && a.fn.draggable && g._makeDraggable(); i.resizable && a.fn.resizable && g._makeResizable(); g._createButtons(i.buttons); g._isOpen = false; a.fn.bgiframe && j.bgiframe()
    }, _init: function () { this.options.autoOpen && this.open() }, destroy: function () {
        var g = this; g.overlay && g.overlay.destroy(); g.uiDialog.hide(); g.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
        g.uiDialog.remove(); g.originalTitle && g.element.attr("title", g.originalTitle); return g
    }, widget: function () { return this.uiDialog }, close: function (g) {
        var i = this, b, f; if (false !== i._trigger("beforeClose", g)) {
            i.overlay && i.overlay.destroy(); i.uiDialog.unbind("keypress.ui-dialog"); i._isOpen = false; if (i.options.hide) i.uiDialog.hide(i.options.hide, function () { i._trigger("close", g) }); else { i.uiDialog.hide(); i._trigger("close", g) } a.ui.dialog.overlay.resize(); if (i.options.modal) {
                b = 0; a(".ui-dialog").each(function () {
                    if (this !==
i.uiDialog[0]) { f = a(this).css("z-index"); isNaN(f) || (b = Math.max(b, f)) } 
                }); a.ui.dialog.maxZ = b
            } return i
        } 
    }, isOpen: function () { return this._isOpen }, moveToTop: function (g, i) {
        var b = this, f = b.options; if (f.modal && !g || !f.stack && !f.modal) return b._trigger("focus", i); if (f.zIndex > a.ui.dialog.maxZ) a.ui.dialog.maxZ = f.zIndex; if (b.overlay) { a.ui.dialog.maxZ += 1; b.overlay.$el.css("z-index", a.ui.dialog.overlay.maxZ = a.ui.dialog.maxZ) } g = { scrollTop: b.element.scrollTop(), scrollLeft: b.element.scrollLeft() }; a.ui.dialog.maxZ += 1;
        b.uiDialog.css("z-index", a.ui.dialog.maxZ); b.element.attr(g); b._trigger("focus", i); return b
    }, open: function () {
        if (!this._isOpen) {
            var g = this, i = g.options, b = g.uiDialog; g.overlay = i.modal ? new a.ui.dialog.overlay(g) : null; g._size(); g._position(i.position); b.show(i.show); g.moveToTop(true); i.modal && b.bind("keypress.ui-dialog", function (f) {
                if (f.keyCode === a.ui.keyCode.TAB) {
                    var j = a(":tabbable", this), l = j.filter(":first"); j = j.filter(":last"); if (f.target === j[0] && !f.shiftKey) { l.focus(1); return false } else if (f.target ===
l[0] && f.shiftKey) { j.focus(1); return false } 
                } 
            }); a(g.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus(); g._isOpen = true; g._trigger("open"); return g
        } 
    }, _createButtons: function (g) {
        var i = this, b = false, f = a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), j = a("<div></div>").addClass("ui-dialog-buttonset").appendTo(f); i.uiDialog.find(".ui-dialog-buttonpane").remove(); typeof g === "object" && g !== null && a.each(g,
function () { return !(b = true) }); if (b) { a.each(g, function (l, o) { o = a.isFunction(o) ? { click: o, text: l} : o; var n = a('<button type="button"></button>').click(function () { o.click.apply(i.element[0], arguments) }).appendTo(j); a.each(o, function (k, m) { if (k !== "click") k in h ? n[k](m) : n.attr(k, m) }); a.fn.button && n.button() }); f.appendTo(i.uiDialog) } 
    }, _makeDraggable: function () {
        function g(l) { return { position: l.position, offset: l.offset} } var i = this, b = i.options, f = a(document), j; i.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
            handle: ".ui-dialog-titlebar", containment: "document", start: function (l, o) { j = b.height === "auto" ? "auto" : a(this).height(); a(this).height(a(this).height()).addClass("ui-dialog-dragging"); i._trigger("dragStart", l, g(o)) }, drag: function (l, o) { i._trigger("drag", l, g(o)) }, stop: function (l, o) { b.position = [o.position.left - f.scrollLeft(), o.position.top - f.scrollTop()]; a(this).removeClass("ui-dialog-dragging").height(j); i._trigger("dragStop", l, g(o)); a.ui.dialog.overlay.resize() } 
        })
    }, _makeResizable: function (g) {
        function i(l) {
            return { originalPosition: l.originalPosition,
                originalSize: l.originalSize, position: l.position, size: l.size
            }
        } g = g === d ? this.options.resizable : g; var b = this, f = b.options, j = b.uiDialog.css("position"); g = typeof g === "string" ? g : "n,e,s,w,se,sw,ne,nw"; b.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: b.element, maxWidth: f.maxWidth, maxHeight: f.maxHeight, minWidth: f.minWidth, minHeight: b._minHeight(), handles: g, start: function (l, o) { a(this).addClass("ui-dialog-resizing"); b._trigger("resizeStart", l, i(o)) }, resize: function (l, o) {
            b._trigger("resize",
l, i(o))
        }, stop: function (l, o) { a(this).removeClass("ui-dialog-resizing"); f.height = a(this).height(); f.width = a(this).width(); b._trigger("resizeStop", l, i(o)); a.ui.dialog.overlay.resize() } 
        }).css("position", j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")
    }, _minHeight: function () { var g = this.options; return g.height === "auto" ? g.minHeight : Math.min(g.minHeight, g.height) }, _position: function (g) {
        var i = [], b = [0, 0], f; if (g) {
            if (typeof g === "string" || typeof g === "object" && "0" in g) {
                i = g.split ? g.split(" ") :
[g[0], g[1]]; if (i.length === 1) i[1] = i[0]; a.each(["left", "top"], function (j, l) { if (+i[j] === i[j]) { b[j] = i[j]; i[j] = l } }); g = { my: i.join(" "), at: i.join(" "), offset: b.join(" ")}
            } g = a.extend({}, a.ui.dialog.prototype.options.position, g)
        } else g = a.ui.dialog.prototype.options.position; (f = this.uiDialog.is(":visible")) || this.uiDialog.show(); this.uiDialog.css({ top: 0, left: 0 }).position(a.extend({ of: window }, g)); f || this.uiDialog.hide()
    }, _setOptions: function (g) {
        var i = this, b = {}, f = false; a.each(g, function (j, l) {
            i._setOption(j, l);
            if (j in c) f = true; if (j in e) b[j] = l
        }); f && this._size(); this.uiDialog.is(":data(resizable)") && this.uiDialog.resizable("option", b)
    }, _setOption: function (g, i) {
        var b = this, f = b.uiDialog; switch (g) {
            case "beforeclose": g = "beforeClose"; break; case "buttons": b._createButtons(i); break; case "closeText": b.uiDialogTitlebarCloseText.text("" + i); break; case "dialogClass": f.removeClass(b.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all " + i); break; case "disabled": i ? f.addClass("ui-dialog-disabled") :
f.removeClass("ui-dialog-disabled"); break; case "draggable": var j = f.is(":data(draggable)"); j && !i && f.draggable("destroy"); !j && i && b._makeDraggable(); break; case "position": b._position(i); break; case "resizable": (j = f.is(":data(resizable)")) && !i && f.resizable("destroy"); j && typeof i === "string" && f.resizable("option", "handles", i); !j && i !== false && b._makeResizable(i); break; case "title": a(".ui-dialog-title", b.uiDialogTitlebar).html("" + (i || "&#160;")); break
        } a.Widget.prototype._setOption.apply(b, arguments)
    }, _size: function () {
        var g =
this.options, i, b, f = this.uiDialog.is(":visible"); this.element.show().css({ width: "auto", minHeight: 0, height: 0 }); if (g.minWidth > g.width) g.width = g.minWidth; i = this.uiDialog.css({ height: "auto", width: g.width }).height(); b = Math.max(0, g.minHeight - i); if (g.height === "auto") if (a.support.minHeight) this.element.css({ minHeight: b, height: "auto" }); else { this.uiDialog.show(); g = this.element.css("height", "auto").height(); f || this.uiDialog.hide(); this.element.height(Math.max(g, b)) } else this.element.height(Math.max(g.height -
i, 0)); this.uiDialog.is(":data(resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight())
    } 
    }); a.extend(a.ui.dialog, { version: "1.8.16", uuid: 0, maxZ: 0, getTitleId: function (g) { g = g.attr("id"); if (!g) { this.uuid += 1; g = this.uuid } return "ui-dialog-title-" + g }, overlay: function (g) { this.$el = a.ui.dialog.overlay.create(g) } }); a.extend(a.ui.dialog.overlay, { instances: [], oldInstances: [], maxZ: 0, events: a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","), function (g) { return g + ".dialog-overlay" }).join(" "),
        create: function (g) {
            if (this.instances.length === 0) { setTimeout(function () { a.ui.dialog.overlay.instances.length && a(document).bind(a.ui.dialog.overlay.events, function (b) { if (a(b.target).zIndex() < a.ui.dialog.overlay.maxZ) return false }) }, 1); a(document).bind("keydown.dialog-overlay", function (b) { if (g.options.closeOnEscape && !b.isDefaultPrevented() && b.keyCode && b.keyCode === a.ui.keyCode.ESCAPE) { g.close(b); b.preventDefault() } }); a(window).bind("resize.dialog-overlay", a.ui.dialog.overlay.resize) } var i = (this.oldInstances.pop() ||
a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({ width: this.width(), height: this.height() }); a.fn.bgiframe && i.bgiframe(); this.instances.push(i); return i
        }, destroy: function (g) { var i = a.inArray(g, this.instances); i != -1 && this.oldInstances.push(this.instances.splice(i, 1)[0]); this.instances.length === 0 && a([document, window]).unbind(".dialog-overlay"); g.remove(); var b = 0; a.each(this.instances, function () { b = Math.max(b, this.css("z-index")) }); this.maxZ = b }, height: function () {
            var g, i; if (a.browser.msie &&
a.browser.version < 7) { g = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); i = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight); return g < i ? a(window).height() + "px" : g + "px" } else return a(document).height() + "px"
        }, width: function () {
            var g, i; if (a.browser.msie) { g = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); i = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); return g < i ? a(window).width() + "px" : g + "px" } else return a(document).width() +
"px"
        }, resize: function () { var g = a([]); a.each(a.ui.dialog.overlay.instances, function () { g = g.add(this) }); g.css({ width: 0, height: 0 }).css({ width: a.ui.dialog.overlay.width(), height: a.ui.dialog.overlay.height() }) } 
    }); a.extend(a.ui.dialog.overlay.prototype, { destroy: function () { a.ui.dialog.overlay.destroy(this.$el) } })
})(jQuery);
(function (a) {
    a.ui = a.ui || {}; var d = /left|center|right/, c = /top|center|bottom/, e = a.fn.position, h = a.fn.offset; a.fn.position = function (g) {
        if (!g || !g.of) return e.apply(this, arguments); g = a.extend({}, g); var i = a(g.of), b = i[0], f = (g.collision || "flip").split(" "), j = g.offset ? g.offset.split(" ") : [0, 0], l, o, n; if (b.nodeType === 9) { l = i.width(); o = i.height(); n = { top: 0, left: 0} } else if (b.setTimeout) { l = i.width(); o = i.height(); n = { top: i.scrollTop(), left: i.scrollLeft()} } else if (b.preventDefault) {
            g.at = "left top"; l = o = 0; n = { top: g.of.pageY,
                left: g.of.pageX
            }
        } else { l = i.outerWidth(); o = i.outerHeight(); n = i.offset() } a.each(["my", "at"], function () { var k = (g[this] || "").split(" "); if (k.length === 1) k = d.test(k[0]) ? k.concat(["center"]) : c.test(k[0]) ? ["center"].concat(k) : ["center", "center"]; k[0] = d.test(k[0]) ? k[0] : "center"; k[1] = c.test(k[1]) ? k[1] : "center"; g[this] = k }); if (f.length === 1) f[1] = f[0]; j[0] = parseInt(j[0], 10) || 0; if (j.length === 1) j[1] = j[0]; j[1] = parseInt(j[1], 10) || 0; if (g.at[0] === "right") n.left += l; else if (g.at[0] === "center") n.left += l / 2; if (g.at[1] === "bottom") n.top +=
o; else if (g.at[1] === "center") n.top += o / 2; n.left += j[0]; n.top += j[1]; return this.each(function () {
    var k = a(this), m = k.outerWidth(), p = k.outerHeight(), q = parseInt(a.curCSS(this, "marginLeft", true)) || 0, s = parseInt(a.curCSS(this, "marginTop", true)) || 0, r = m + q + (parseInt(a.curCSS(this, "marginRight", true)) || 0), u = p + s + (parseInt(a.curCSS(this, "marginBottom", true)) || 0), v = a.extend({}, n), w; if (g.my[0] === "right") v.left -= m; else if (g.my[0] === "center") v.left -= m / 2; if (g.my[1] === "bottom") v.top -= p; else if (g.my[1] === "center") v.top -=
p / 2; v.left = Math.round(v.left); v.top = Math.round(v.top); w = { left: v.left - q, top: v.top - s }; a.each(["left", "top"], function (x, y) { a.ui.position[f[x]] && a.ui.position[f[x]][y](v, { targetWidth: l, targetHeight: o, elemWidth: m, elemHeight: p, collisionPosition: w, collisionWidth: r, collisionHeight: u, offset: j, my: g.my, at: g.at }) }); a.fn.bgiframe && k.bgiframe(); k.offset(a.extend(v, { using: g.using }))
})
    }; a.ui.position = { fit: { left: function (g, i) {
        var b = a(window); b = i.collisionPosition.left + i.collisionWidth - b.width() - b.scrollLeft(); g.left =
b > 0 ? g.left - b : Math.max(g.left - i.collisionPosition.left, g.left)
    }, top: function (g, i) { var b = a(window); b = i.collisionPosition.top + i.collisionHeight - b.height() - b.scrollTop(); g.top = b > 0 ? g.top - b : Math.max(g.top - i.collisionPosition.top, g.top) } 
    }, flip: { left: function (g, i) {
        if (i.at[0] !== "center") {
            var b = a(window); b = i.collisionPosition.left + i.collisionWidth - b.width() - b.scrollLeft(); var f = i.my[0] === "left" ? -i.elemWidth : i.my[0] === "right" ? i.elemWidth : 0, j = i.at[0] === "left" ? i.targetWidth : -i.targetWidth, l = -2 * i.offset[0]; g.left +=
i.collisionPosition.left < 0 ? f + j + l : b > 0 ? f + j + l : 0
        } 
    }, top: function (g, i) { if (i.at[1] !== "center") { var b = a(window); b = i.collisionPosition.top + i.collisionHeight - b.height() - b.scrollTop(); var f = i.my[1] === "top" ? -i.elemHeight : i.my[1] === "bottom" ? i.elemHeight : 0, j = i.at[1] === "top" ? i.targetHeight : -i.targetHeight, l = -2 * i.offset[1]; g.top += i.collisionPosition.top < 0 ? f + j + l : b > 0 ? f + j + l : 0 } } 
    }
    }; if (!a.offset.setOffset) {
        a.offset.setOffset = function (g, i) {
            if (/static/.test(a.curCSS(g, "position"))) g.style.position = "relative"; var b = a(g),
f = b.offset(), j = parseInt(a.curCSS(g, "top", true), 10) || 0, l = parseInt(a.curCSS(g, "left", true), 10) || 0; f = { top: i.top - f.top + j, left: i.left - f.left + l }; "using" in i ? i.using.call(g, f) : b.css(f)
        }; a.fn.offset = function (g) { var i = this[0]; if (!i || !i.ownerDocument) return null; if (g) return this.each(function () { a.offset.setOffset(this, g) }); return h.call(this) } 
    } 
})(jQuery);
(function (a, d) {
    a.widget("ui.progressbar", { 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(); a.Widget.prototype.destroy.apply(this, arguments)
    }, value: function (c) { if (c === d) return this._value(); this._setOption("value", c); return this }, _setOption: function (c, e) { if (c === "value") { this.options.value = e; this._refreshValue(); this._value() === this.options.max && this._trigger("complete") } a.Widget.prototype._setOption.apply(this, arguments) }, _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 c = this.value(), e = this._percentage(); if (this.oldValue !== c) { this.oldValue = c; this._trigger("change") } this.valueDiv.toggle(c > this.min).toggleClass("ui-corner-right", c === this.options.max).width(e.toFixed(0) + "%"); this.element.attr("aria-valuenow", c) } 
    }); a.extend(a.ui.progressbar, { version: "1.8.16" })
})(jQuery);
(function (a) {
    a.widget("ui.slider", a.ui.mouse, { widgetEventPrefix: "slide", options: { animate: false, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null }, _create: function () {
        var d = this, c = this.options, e = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"), h = c.values && c.values.length || 1, g = []; this._mouseSliding = this._keySliding = 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" + (c.disabled ? " ui-slider-disabled ui-disabled" : "")); this.range = a([]); if (c.range) { if (c.range === true) { if (!c.values) c.values = [this._valueMin(), this._valueMin()]; if (c.values.length && c.values.length !== 2) c.values = [c.values[0], c.values[0]] } this.range = a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header" + (c.range === "min" || c.range === "max" ? " ui-slider-range-" + c.range : "")) } for (var i = e.length; i < h; i += 1) g.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
        this.handles = e.add(a(g.join("")).appendTo(d.element)); this.handle = this.handles.eq(0); this.handles.add(this.range).filter("a").click(function (b) { b.preventDefault() }).hover(function () { c.disabled || a(this).addClass("ui-state-hover") }, function () { a(this).removeClass("ui-state-hover") }).focus(function () { if (c.disabled) a(this).blur(); else { a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"); a(this).addClass("ui-state-focus") } }).blur(function () { a(this).removeClass("ui-state-focus") }); this.handles.each(function (b) {
            a(this).data("index.ui-slider-handle",
b)
        }); this.handles.keydown(function (b) {
            var f = true, j = a(this).data("index.ui-slider-handle"), l, o, n; if (!d.options.disabled) {
                switch (b.keyCode) { case a.ui.keyCode.HOME: case a.ui.keyCode.END: case a.ui.keyCode.PAGE_UP: case a.ui.keyCode.PAGE_DOWN: case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: f = false; if (!d._keySliding) { d._keySliding = true; a(this).addClass("ui-state-active"); l = d._start(b, j); if (l === false) return } break } n = d.options.step; l = d.options.values && d.options.values.length ?
(o = d.values(j)) : (o = d.value()); switch (b.keyCode) {
                    case a.ui.keyCode.HOME: o = d._valueMin(); break; case a.ui.keyCode.END: o = d._valueMax(); break; case a.ui.keyCode.PAGE_UP: o = d._trimAlignValue(l + (d._valueMax() - d._valueMin()) / 5); break; case a.ui.keyCode.PAGE_DOWN: o = d._trimAlignValue(l - (d._valueMax() - d._valueMin()) / 5); break; case a.ui.keyCode.UP: case a.ui.keyCode.RIGHT: if (l === d._valueMax()) return; o = d._trimAlignValue(l + n); break; case a.ui.keyCode.DOWN: case a.ui.keyCode.LEFT: if (l === d._valueMin()) return; o = d._trimAlignValue(l -
n); break
                } d._slide(b, j, o); return f
            } 
        }).keyup(function (b) { var f = a(this).data("index.ui-slider-handle"); if (d._keySliding) { d._keySliding = false; d._stop(b, f); d._change(b, f); a(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 (d) {
        var c = this.options, e, h, g, i, b; if (c.disabled) return false; this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); e = this._normValueFromMouse({ x: d.pageX, y: d.pageY }); h = this._valueMax() - this._valueMin() + 1; i = this; this.handles.each(function (f) { var j = Math.abs(e - i.values(f)); if (h > j) { h = j; g = a(this); b = f } }); if (c.range === true && this.values(1) === c.min) { b += 1; g = a(this.handles[b]) } if (this._start(d, b) === false) return false;
        this._mouseSliding = true; i._handleIndex = b; g.addClass("ui-state-active").focus(); c = g.offset(); this._clickOffset = !a(d.target).parents().andSelf().is(".ui-slider-handle") ? { left: 0, top: 0} : { left: d.pageX - c.left - g.width() / 2, top: d.pageY - c.top - g.height() / 2 - (parseInt(g.css("borderTopWidth"), 10) || 0) - (parseInt(g.css("borderBottomWidth"), 10) || 0) + (parseInt(g.css("marginTop"), 10) || 0) }; this.handles.hasClass("ui-state-hover") || this._slide(d, b, e); return this._animateOff = true
    }, _mouseStart: function () { return true }, _mouseDrag: function (d) {
        var c =
this._normValueFromMouse({ x: d.pageX, y: d.pageY }); this._slide(d, this._handleIndex, c); 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._clickOffset = this._handleIndex = null; return this._animateOff = false }, _detectOrientation: function () { this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal" }, _normValueFromMouse: function (d) {
        var c; if (this.orientation === "horizontal") {
            c =
this.elementSize.width; d = d.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)
        } else { c = this.elementSize.height; d = d.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0) } c = d / c; if (c > 1) c = 1; if (c < 0) c = 0; if (this.orientation === "vertical") c = 1 - c; d = this._valueMax() - this._valueMin(); return this._trimAlignValue(this._valueMin() + c * d)
    }, _start: function (d, c) {
        var e = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) {
            e.value = this.values(c);
            e.values = this.values()
        } return this._trigger("start", d, e)
    }, _slide: function (d, c, e) {
        var h; if (this.options.values && this.options.values.length) { h = this.values(c ? 0 : 1); if (this.options.values.length === 2 && this.options.range === true && (c === 0 && e > h || c === 1 && e < h)) e = h; if (e !== this.values(c)) { h = this.values(); h[c] = e; d = this._trigger("slide", d, { handle: this.handles[c], value: e, values: h }); this.values(c ? 0 : 1); d !== false && this.values(c, e, true) } } else if (e !== this.value()) {
            d = this._trigger("slide", d, { handle: this.handles[c], value: e });
            d !== false && this.value(e)
        } 
    }, _stop: function (d, c) { var e = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) { e.value = this.values(c); e.values = this.values() } this._trigger("stop", d, e) }, _change: function (d, c) { if (!this._keySliding && !this._mouseSliding) { var e = { handle: this.handles[c], value: this.value() }; if (this.options.values && this.options.values.length) { e.value = this.values(c); e.values = this.values() } this._trigger("change", d, e) } }, value: function (d) {
        if (arguments.length) {
            this.options.value =
this._trimAlignValue(d); this._refreshValue(); this._change(null, 0)
        } else return this._value()
    }, values: function (d, c) {
        var e, h, g; if (arguments.length > 1) { this.options.values[d] = this._trimAlignValue(c); this._refreshValue(); this._change(null, d) } else if (arguments.length) if (a.isArray(arguments[0])) { e = this.options.values; h = arguments[0]; for (g = 0; g < e.length; g += 1) { e[g] = this._trimAlignValue(h[g]); this._change(null, g) } this._refreshValue() } else return this.options.values && this.options.values.length ? this._values(d) :
this.value(); else return this._values()
    }, _setOption: function (d, c) {
        var e, h = 0; if (a.isArray(this.options.values)) h = this.options.values.length; a.Widget.prototype._setOption.apply(this, arguments); switch (d) {
            case "disabled": if (c) { this.handles.filter(".ui-state-focus").blur(); this.handles.removeClass("ui-state-hover"); this.handles.propAttr("disabled", true); this.element.addClass("ui-disabled") } else { this.handles.propAttr("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 (e = 0; e < h; e += 1) this._change(null, e); this._animateOff = false; break
        } 
    }, _value: function () { var d = this.options.value; return d = this._trimAlignValue(d) }, _values: function (d) {
        var c, e; if (arguments.length) {
            c = this.options.values[d];
            return c = this._trimAlignValue(c)
        } else { c = this.options.values.slice(); for (e = 0; e < c.length; e += 1) c[e] = this._trimAlignValue(c[e]); return c } 
    }, _trimAlignValue: function (d) { if (d <= this._valueMin()) return this._valueMin(); if (d >= this._valueMax()) return this._valueMax(); var c = this.options.step > 0 ? this.options.step : 1, e = (d - this._valueMin()) % c; d = d - e; if (Math.abs(e) * 2 >= c) d += e > 0 ? c : -c; return parseFloat(d.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () {
        var d =
this.options.range, c = this.options, e = this, h = !this._animateOff ? c.animate : false, g, i = {}, b, f, j, l; if (this.options.values && this.options.values.length) this.handles.each(function (o) {
    g = (e.values(o) - e._valueMin()) / (e._valueMax() - e._valueMin()) * 100; i[e.orientation === "horizontal" ? "left" : "bottom"] = g + "%"; a(this).stop(1, 1)[h ? "animate" : "css"](i, c.animate); if (e.options.range === true) if (e.orientation === "horizontal") {
        if (o === 0) e.range.stop(1, 1)[h ? "animate" : "css"]({ left: g + "%" }, c.animate); if (o === 1) e.range[h ? "animate" : "css"]({ width: g -
b + "%"
        }, { queue: false, duration: c.animate })
    } else { if (o === 0) e.range.stop(1, 1)[h ? "animate" : "css"]({ bottom: g + "%" }, c.animate); if (o === 1) e.range[h ? "animate" : "css"]({ height: g - b + "%" }, { queue: false, duration: c.animate }) } b = g
}); else {
            f = this.value(); j = this._valueMin(); l = this._valueMax(); g = l !== j ? (f - j) / (l - j) * 100 : 0; i[e.orientation === "horizontal" ? "left" : "bottom"] = g + "%"; this.handle.stop(1, 1)[h ? "animate" : "css"](i, c.animate); if (d === "min" && this.orientation === "horizontal") this.range.stop(1, 1)[h ? "animate" : "css"]({ width: g + "%" },
c.animate); if (d === "max" && this.orientation === "horizontal") this.range[h ? "animate" : "css"]({ width: 100 - g + "%" }, { queue: false, duration: c.animate }); if (d === "min" && this.orientation === "vertical") this.range.stop(1, 1)[h ? "animate" : "css"]({ height: g + "%" }, c.animate); if (d === "max" && this.orientation === "vertical") this.range[h ? "animate" : "css"]({ height: 100 - g + "%" }, { queue: false, duration: c.animate })
        } 
    } 
    }); a.extend(a.ui.slider, { version: "1.8.16" })
})(jQuery);
(function (a, d) {
    function c() { return ++h } function e() { return ++g } var h = 0, g = 0; a.widget("ui.tabs", { options: { add: null, ajaxOptions: null, cache: false, cookie: null, collapsible: false, disable: null, disabled: [], enable: null, event: "click", fx: null, idPrefix: "ui-tabs-", load: null, panelTemplate: "<div></div>", remove: null, select: null, show: null, spinner: "<em>Loading&#8230;</em>", tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>" }, _create: function () { this._tabify(true) }, _setOption: function (i, b) {
        if (i == "selected") this.options.collapsible &&
b == this.options.selected || this.select(b); else { this.options[i] = b; this._tabify() } 
    }, _tabId: function (i) { return i.title && i.title.replace(/\s/g, "_").replace(/[^\w\u00c0-\uFFFF-]/g, "") || this.options.idPrefix + c() }, _sanitizeSelector: function (i) { return i.replace(/:/g, "\\:") }, _cookie: function () { var i = this.cookie || (this.cookie = this.options.cookie.name || "ui-tabs-" + e()); return a.cookie.apply(null, [i].concat(a.makeArray(arguments))) }, _ui: function (i, b) { return { tab: i, panel: b, index: this.anchors.index(i)} }, _cleanup: function () {
        this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function () {
            var i =
a(this); i.html(i.data("label.tabs")).removeData("label.tabs")
        })
    }, _tabify: function (i) {
        function b(r, u) { r.css("display", ""); !a.support.opacity && u.opacity && r[0].style.removeAttribute("filter") } var f = this, j = this.options, l = /^#.+/; this.list = this.element.find("ol,ul").eq(0); this.lis = a(" > li:has(a[href])", this.list); this.anchors = this.lis.map(function () { return a("a", this)[0] }); this.panels = a([]); this.anchors.each(function (r, u) {
            var v = a(u).attr("href"), w = v.split("#")[0], x; if (w && (w === location.toString().split("#")[0] ||
(x = a("base")[0]) && w === x.href)) { v = u.hash; u.href = v } if (l.test(v)) f.panels = f.panels.add(f.element.find(f._sanitizeSelector(v))); else if (v && v !== "#") { a.data(u, "href.tabs", v); a.data(u, "load.tabs", v.replace(/#.*$/, "")); v = f._tabId(u); u.href = "#" + v; u = f.element.find("#" + v); if (!u.length) { u = a(j.panelTemplate).attr("id", v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(f.panels[r - 1] || f.list); u.data("destroy.tabs", true) } f.panels = f.panels.add(u) } else j.disabled.push(r)
        }); if (i) {
            this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
            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"); if (j.selected === d) {
                location.hash && this.anchors.each(function (r, u) { if (u.hash == location.hash) { j.selected = r; return false } }); if (typeof j.selected !== "number" && j.cookie) j.selected = parseInt(f._cookie(), 10); if (typeof j.selected !== "number" && this.lis.filter(".ui-tabs-selected").length) j.selected =
this.lis.index(this.lis.filter(".ui-tabs-selected")); j.selected = j.selected || (this.lis.length ? 0 : -1)
            } else if (j.selected === null) j.selected = -1; j.selected = j.selected >= 0 && this.anchors[j.selected] || j.selected < 0 ? j.selected : 0; j.disabled = a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"), function (r) { return f.lis.index(r) }))).sort(); a.inArray(j.selected, j.disabled) != -1 && j.disabled.splice(a.inArray(j.selected, j.disabled), 1); this.panels.addClass("ui-tabs-hide"); this.lis.removeClass("ui-tabs-selected ui-state-active");
            if (j.selected >= 0 && this.anchors.length) { f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash)).removeClass("ui-tabs-hide"); this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active"); f.element.queue("tabs", function () { f._trigger("show", null, f._ui(f.anchors[j.selected], f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash))[0])) }); this.load(j.selected) } a(window).bind("unload", function () { f.lis.add(f.anchors).unbind(".tabs"); f.lis = f.anchors = f.panels = null })
        } else j.selected = this.lis.index(this.lis.filter(".ui-tabs-selected"));
        this.element[j.collapsible ? "addClass" : "removeClass"]("ui-tabs-collapsible"); j.cookie && this._cookie(j.selected, j.cookie); i = 0; for (var o; o = this.lis[i]; i++) a(o)[a.inArray(i, j.disabled) != -1 && !a(o).hasClass("ui-tabs-selected") ? "addClass" : "removeClass"]("ui-state-disabled"); j.cache === false && this.anchors.removeData("cache.tabs"); this.lis.add(this.anchors).unbind(".tabs"); if (j.event !== "mouseover") {
            var n = function (r, u) { u.is(":not(.ui-state-disabled)") && u.addClass("ui-state-" + r) }, k = function (r, u) {
                u.removeClass("ui-state-" +
r)
            }; this.lis.bind("mouseover.tabs", function () { n("hover", a(this)) }); this.lis.bind("mouseout.tabs", function () { k("hover", a(this)) }); this.anchors.bind("focus.tabs", function () { n("focus", a(this).closest("li")) }); this.anchors.bind("blur.tabs", function () { k("focus", a(this).closest("li")) })
        } var m, p; if (j.fx) if (a.isArray(j.fx)) { m = j.fx[0]; p = j.fx[1] } else m = p = j.fx; var q = p ? function (r, u) {
            a(r).closest("li").addClass("ui-tabs-selected ui-state-active"); u.hide().removeClass("ui-tabs-hide").animate(p, p.duration || "normal",
function () { b(u, p); f._trigger("show", null, f._ui(r, u[0])) })
        } : function (r, u) { a(r).closest("li").addClass("ui-tabs-selected ui-state-active"); u.removeClass("ui-tabs-hide"); f._trigger("show", null, f._ui(r, u[0])) }, s = m ? function (r, u) { u.animate(m, m.duration || "normal", function () { f.lis.removeClass("ui-tabs-selected ui-state-active"); u.addClass("ui-tabs-hide"); b(u, m); f.element.dequeue("tabs") }) } : function (r, u) { f.lis.removeClass("ui-tabs-selected ui-state-active"); u.addClass("ui-tabs-hide"); f.element.dequeue("tabs") };
        this.anchors.bind(j.event + ".tabs", function () {
            var r = this, u = a(r).closest("li"), v = f.panels.filter(":not(.ui-tabs-hide)"), w = f.element.find(f._sanitizeSelector(r.hash)); if (u.hasClass("ui-tabs-selected") && !j.collapsible || u.hasClass("ui-state-disabled") || u.hasClass("ui-state-processing") || f.panels.filter(":animated").length || f._trigger("select", null, f._ui(this, w[0])) === false) { this.blur(); return false } j.selected = f.anchors.index(this); f.abort(); if (j.collapsible) if (u.hasClass("ui-tabs-selected")) {
                j.selected =
-1; j.cookie && f._cookie(j.selected, j.cookie); f.element.queue("tabs", function () { s(r, v) }).dequeue("tabs"); this.blur(); return false
            } else if (!v.length) { j.cookie && f._cookie(j.selected, j.cookie); f.element.queue("tabs", function () { q(r, w) }); f.load(f.anchors.index(this)); this.blur(); return false } j.cookie && f._cookie(j.selected, j.cookie); if (w.length) { v.length && f.element.queue("tabs", function () { s(r, v) }); f.element.queue("tabs", function () { q(r, w) }); f.load(f.anchors.index(this)) } else throw "jQuery UI Tabs: Mismatching fragment identifier.";
            a.browser.msie && this.blur()
        }); this.anchors.bind("click.tabs", function () { return false })
    }, _getIndex: function (i) { if (typeof i == "string") i = this.anchors.index(this.anchors.filter("[href$=" + i + "]")); return i }, destroy: function () {
        var i = this.options; this.abort(); this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"); this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"); this.anchors.each(function () {
            var b =
a.data(this, "href.tabs"); if (b) this.href = b; var f = a(this).unbind(".tabs"); a.each(["href", "load", "cache"], function (j, l) { f.removeData(l + ".tabs") })
        }); this.lis.unbind(".tabs").add(this.panels).each(function () { a.data(this, "destroy.tabs") ? a(this).remove() : a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide") }); i.cookie && this._cookie(null, i.cookie); return this
    }, add: function (i,
b, f) {
        if (f === d) f = this.anchors.length; var j = this, l = this.options; b = a(l.tabTemplate.replace(/#\{href\}/g, i).replace(/#\{label\}/g, b)); i = !i.indexOf("#") ? i.replace("#", "") : this._tabId(a("a", b)[0]); b.addClass("ui-state-default ui-corner-top").data("destroy.tabs", true); var o = j.element.find("#" + i); o.length || (o = a(l.panelTemplate).attr("id", i).data("destroy.tabs", true)); o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"); if (f >= this.lis.length) { b.appendTo(this.list); o.appendTo(this.list[0].parentNode) } else {
            b.insertBefore(this.lis[f]);
            o.insertBefore(this.panels[f])
        } l.disabled = a.map(l.disabled, function (n) { return n >= f ? ++n : n }); this._tabify(); if (this.anchors.length == 1) { l.selected = 0; b.addClass("ui-tabs-selected ui-state-active"); o.removeClass("ui-tabs-hide"); this.element.queue("tabs", function () { j._trigger("show", null, j._ui(j.anchors[0], j.panels[0])) }); this.load(0) } this._trigger("add", null, this._ui(this.anchors[f], this.panels[f])); return this
    }, remove: function (i) {
        i = this._getIndex(i); var b = this.options, f = this.lis.eq(i).remove(), j = this.panels.eq(i).remove();
        if (f.hasClass("ui-tabs-selected") && this.anchors.length > 1) this.select(i + (i + 1 < this.anchors.length ? 1 : -1)); b.disabled = a.map(a.grep(b.disabled, function (l) { return l != i }), function (l) { return l >= i ? --l : l }); this._tabify(); this._trigger("remove", null, this._ui(f.find("a")[0], j[0])); return this
    }, enable: function (i) {
        i = this._getIndex(i); var b = this.options; if (a.inArray(i, b.disabled) != -1) {
            this.lis.eq(i).removeClass("ui-state-disabled"); b.disabled = a.grep(b.disabled, function (f) { return f != i }); this._trigger("enable", null,
this._ui(this.anchors[i], this.panels[i])); return this
        } 
    }, disable: function (i) { i = this._getIndex(i); var b = this.options; if (i != b.selected) { this.lis.eq(i).addClass("ui-state-disabled"); b.disabled.push(i); b.disabled.sort(); this._trigger("disable", null, this._ui(this.anchors[i], this.panels[i])) } return this }, select: function (i) { i = this._getIndex(i); if (i == -1) if (this.options.collapsible && this.options.selected != -1) i = this.options.selected; else return this; this.anchors.eq(i).trigger(this.options.event + ".tabs"); return this },
        load: function (i) {
            i = this._getIndex(i); var b = this, f = this.options, j = this.anchors.eq(i)[0], l = a.data(j, "load.tabs"); this.abort(); if (!l || this.element.queue("tabs").length !== 0 && a.data(j, "cache.tabs")) this.element.dequeue("tabs"); else {
                this.lis.eq(i).addClass("ui-state-processing"); if (f.spinner) { var o = a("span", j); o.data("label.tabs", o.html()).html(f.spinner) } this.xhr = a.ajax(a.extend({}, f.ajaxOptions, { url: l, success: function (n, k) {
                    b.element.find(b._sanitizeSelector(j.hash)).html(n); b._cleanup(); f.cache && a.data(j,
"cache.tabs", true); b._trigger("load", null, b._ui(b.anchors[i], b.panels[i])); try { f.ajaxOptions.success(n, k) } catch (m) { } 
                }, error: function (n, k) { b._cleanup(); b._trigger("load", null, b._ui(b.anchors[i], b.panels[i])); try { f.ajaxOptions.error(n, k, i, j) } catch (m) { } } 
                })); b.element.dequeue("tabs"); return this
            } 
        }, abort: function () { this.element.queue([]); this.panels.stop(false, true); this.element.queue("tabs", this.element.queue("tabs").splice(-2, 2)); if (this.xhr) { this.xhr.abort(); delete this.xhr } this._cleanup(); return this },
        url: function (i, b) { this.anchors.eq(i).removeData("cache.tabs").data("load.tabs", b); return this }, length: function () { return this.anchors.length } 
    }); a.extend(a.ui.tabs, { version: "1.8.16" }); a.extend(a.ui.tabs.prototype, { rotation: null, rotate: function (i, b) {
        var f = this, j = this.options, l = f._rotate || (f._rotate = function (o) { clearTimeout(f.rotation); f.rotation = setTimeout(function () { var n = j.selected; f.select(++n < f.anchors.length ? n : 0) }, i); o && o.stopPropagation() }); b = f._unrotate || (f._unrotate = !b ? function (o) {
            o.clientX &&
f.rotate(null)
        } : function () { t = j.selected; l() }); if (i) { this.element.bind("tabsshow", l); this.anchors.bind(j.event + ".tabs", b); l() } else { clearTimeout(f.rotation); this.element.unbind("tabsshow", l); this.anchors.unbind(j.event + ".tabs", b); delete this._rotate; delete this._unrotate } return this
    } 
    })
})(jQuery);

/************************ 1. jquery-1.6.2.min.js ************************/

/************************ 2. jquery.json-2.2.js ************************/
/*
 * jQuery JSON Plugin
 * version: 2.1 (2009-08-14)
 *
 * This document is licensed as free software under the terms of the
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 
 * website's http://www.json.org/json2.js, which proclaims:
 * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
 * I uphold.
 *
 * It is also influenced heavily by MochiKit's serializeJSON, which is 
 * copyrighted 2005 by Bob Ippolito.
 */
 
(function($) {
    /** jQuery.toJSON( json-serializble )
    Converts the given argument into a JSON respresentation.

        If an object has a "toJSON" function, that will be used to get the representation.
    Non-integer/string keys are skipped in the object, as are keys that point to a function.

        json-serializble:
    The *thing* to be converted.
    **/
    $.toJSON = function(o) {
        if (typeof (JSON) == 'object' && JSON.stringify)
            return JSON.stringify(o);

        var type = typeof (o);

        if (o === null)
            return "null";

        if (type == "undefined")
            return undefined;

        if (type == "number" || type == "boolean")
            return o + "";

        if (type == "string")
            return $.quoteString(o);

        if (type == 'object') {
            if (typeof o.toJSON == "function")
                return $.toJSON(o.toJSON());

            if (o.constructor === Date) {
                var month = o.getUTCMonth() + 1;
                if (month < 10) month = '0' + month;

                var day = o.getUTCDate();
                if (day < 10) day = '0' + day;

                var year = o.getUTCFullYear();

                var hours = o.getUTCHours();
                if (hours < 10) hours = '0' + hours;

                var minutes = o.getUTCMinutes();
                if (minutes < 10) minutes = '0' + minutes;

                var seconds = o.getUTCSeconds();
                if (seconds < 10) seconds = '0' + seconds;

                var milli = o.getUTCMilliseconds();
                if (milli < 100) milli = '0' + milli;
                if (milli < 10) milli = '0' + milli;

                /*                return '"' + year + '-' + month + '-' + day + 'T' +
                hours + ':' + minutes + ':' + seconds +
                '.' + milli + 'Z"'; */
                return 'new Date(' + o.getTime() + ')';


            }

            if (o.constructor === Array) {
                var ret = [];
                for (var i = 0; i < o.length; i++)
                    ret.push($.toJSON(o[i]) || "null");

                return "[" + ret.join(",") + "]";
            }

            var pairs = [];
            for (var k in o) {
                var name;
                var type = typeof k;

                if (type == "number")
                    name = '"' + k + '"';
                else if (type == "string")
                    name = $.quoteString(k);
                else
                    continue;  //skip non-string or number keys

                if (typeof o[k] == "function")
                    continue;  //skip pairs where the value is a function.

                var val = $.toJSON(o[k]);

                pairs.push(name + ":" + val);
            }

            return "{" + pairs.join(", ") + "}";
        }
    };

    /** jQuery.evalJSON(src)
    Evaluates a given piece of json source.
    **/
    $.evalJSON = function(src) {
        if (typeof (JSON) == 'object' && JSON.parse)
            return JSON.parse(src);
        return eval("(" + src + ")");
    };

    /** jQuery.secureEvalJSON(src)
    Evals JSON in a way that is *more* secure.
    **/
    $.secureEvalJSON = function(src) {
        if (typeof (JSON) == 'object' && JSON.parse)
            return JSON.parse(src);

        var filtered = src;
        filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
        filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
        filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');

        if (/^[\],:{}\s]*$/.test(filtered))
            return eval("(" + src + ")");
        else
            throw new SyntaxError("Error parsing JSON, source is not valid.");
    };

    /** jQuery.quoteString(string)
    Returns a string-repr of a string, escaping quotes intelligently.  
    Mostly a support function for toJSON.
    
    Examples:
    >>> jQuery.quoteString("apple")
    "apple"
        
    >>> jQuery.quoteString('"Where are we going?", she asked.')
    "\"Where are we going?\", she asked."
    **/
    $.quoteString = function(string) {
        if (string.match(_escapeable)) {
            return '"' + string.replace(_escapeable, function(a) {
                var c = _meta[a];
                if (typeof c === 'string') return c;
                c = a.charCodeAt();
                return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
            }) + '"';
        }
        return '"' + string + '"';
    };

    var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;

    var _meta = {
        '\b': '\\b',
        '\t': '\\t',
        '\n': '\\n',
        '\f': '\\f',
        '\r': '\\r',
        '"': '\\"',
        '\\': '\\\\'
    };
})(jQuery);

/************************ 2. jquery.json-2.2.js ************************/

/************************ 3. jquery.validate.1.9.0.min.js ************************/
﻿/**
* jQuery Validation Plugin 1.9.0
*
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
* http://docs.jquery.com/Plugins/Validation
*
* Copyright (c) 2006 - 2011 JÃ¶rn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/
(function (c) {
    c.extend(c.fn, { validate: function (a) {
        if (this.length) {
            var b = c.data(this[0], "validator"); if (b) return b; this.attr("novalidate", "novalidate"); b = new c.validator(a, this[0]); c.data(this[0], "validator", b); if (b.settings.onsubmit) {
                a = this.find("input, button"); a.filter(".cancel").click(function () { b.cancelSubmit = true }); b.settings.submitHandler && a.filter(":submit").click(function () { b.submitButton = this }); this.submit(function (d) {
                    function e() {
                        if (b.settings.submitHandler) {
                            if (b.submitButton) var f = c("<input type='hidden'/>").attr("name",
b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm); b.settings.submitHandler.call(b, b.currentForm); b.submitButton && f.remove(); return false
                        } return true
                    } b.settings.debug && d.preventDefault(); if (b.cancelSubmit) { b.cancelSubmit = false; return e() } if (b.form()) { if (b.pendingRequest) { b.formSubmitted = true; return false } return e() } else { b.focusInvalid(); return false } 
                })
            } return b
        } else a && a.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
    }, valid: function () {
        if (c(this[0]).is("form")) return this.validate().form();
        else { var a = true, b = c(this[0].form).validate(); this.each(function () { a &= b.element(this) }); return a } 
    }, removeAttrs: function (a) { var b = {}, d = this; c.each(a.split(/\s/), function (e, f) { b[f] = d.attr(f); d.removeAttr(f) }); return b }, rules: function (a, b) {
        var d = this[0]; if (a) {
            var e = c.data(d.form, "validator").settings, f = e.rules, g = c.validator.staticRules(d); switch (a) {
                case "add": c.extend(g, c.validator.normalizeRule(b)); f[d.name] = g; if (b.messages) e.messages[d.name] = c.extend(e.messages[d.name], b.messages); break; case "remove": if (!b) {
                        delete f[d.name];
                        return g
                    } var h = {}; c.each(b.split(/\s/), function (j, i) { h[i] = g[i]; delete g[i] }); return h
            } 
        } d = c.validator.normalizeRules(c.extend({}, c.validator.metadataRules(d), c.validator.classRules(d), c.validator.attributeRules(d), c.validator.staticRules(d)), d); if (d.required) { e = d.required; delete d.required; d = c.extend({ required: e }, d) } return d
    } 
    }); c.extend(c.expr[":"], { blank: function (a) { return !c.trim("" + a.value) }, filled: function (a) { return !!c.trim("" + a.value) }, unchecked: function (a) { return !a.checked } }); c.validator = function (a,
b) { this.settings = c.extend(true, {}, c.validator.defaults, a); this.currentForm = b; this.init() }; c.validator.format = function (a, b) { if (arguments.length == 1) return function () { var d = c.makeArray(arguments); d.unshift(a); return c.validator.format.apply(this, d) }; if (arguments.length > 2 && b.constructor != Array) b = c.makeArray(arguments).slice(1); if (b.constructor != Array) b = [b]; c.each(b, function (d, e) { a = a.replace(RegExp("\\{" + d + "\\}", "g"), e) }); return a }; c.extend(c.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error",
    validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: c([]), errorLabelContainer: c([]), onsubmit: true, ignore: ":hidden", ignoreTitle: false, onfocusin: function (a) { this.lastActive = a; if (this.settings.focusCleanup && !this.blockFocusCleanup) { this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass); this.addWrapper(this.errorsFor(a)).hide() } }, onfocusout: function (a) { if (!this.checkable(a) && (a.name in this.submitted || !this.optional(a))) this.element(a) },
    onkeyup: function (a) { if (a.name in this.submitted || a == this.lastElement) this.element(a) }, onclick: function (a) { if (a.name in this.submitted) this.element(a); else a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (a, b, d) { a.type === "radio" ? this.findByName(a.name).addClass(b).removeClass(d) : c(a).addClass(b).removeClass(d) }, unhighlight: function (a, b, d) { a.type === "radio" ? this.findByName(a.name).removeClass(b).addClass(d) : c(a).removeClass(b).addClass(d) } 
}, setDefaults: function (a) {
    c.extend(c.validator.defaults,
a)
}, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: c.validator.format("Please enter no more than {0} characters."),
    minlength: c.validator.format("Please enter at least {0} characters."), rangelength: c.validator.format("Please enter a value between {0} and {1} characters long."), range: c.validator.format("Please enter a value between {0} and {1}."), max: c.validator.format("Please enter a value less than or equal to {0}."), min: c.validator.format("Please enter a value greater than or equal to {0}.")
}, autoCreateRanges: false, prototype: { init: function () {
    function a(e) {
        var f = c.data(this[0].form, "validator"), g = "on" + e.type.replace(/^validate/,
""); f.settings[g] && f.settings[g].call(f, this[0], e)
    } this.labelContainer = c(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || c(this.currentForm); this.containers = c(this.settings.errorContainer).add(this.settings.errorLabelContainer); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var b = this.groups = {}; c.each(this.settings.groups, function (e, f) { c.each(f.split(/\s/), function (g, h) { b[h] = e }) }); var d =
this.settings.rules; c.each(d, function (e, f) { d[e] = c.validator.normalizeRule(f) }); c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", a).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click",
a); this.settings.invalidHandler && c(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
}, form: function () { this.checkForm(); c.extend(this.submitted, this.errorMap); this.invalid = c.extend({}, this.errorMap); this.valid() || c(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return this.valid() }, checkForm: function () { this.prepareForm(); for (var a = 0, b = this.currentElements = this.elements(); b[a]; a++) this.check(b[a]); return this.valid() }, element: function (a) {
    this.lastElement =
a = this.validationTargetFor(this.clean(a)); this.prepareElement(a); this.currentElements = c(a); var b = this.check(a); if (b) delete this.invalid[a.name]; else this.invalid[a.name] = true; if (!this.numberOfInvalids()) this.toHide = this.toHide.add(this.containers); this.showErrors(); return b
}, showErrors: function (a) {
    if (a) { c.extend(this.errorMap, a); this.errorList = []; for (var b in a) this.errorList.push({ message: a[b], element: this.findByName(b)[0] }); this.successList = c.grep(this.successList, function (d) { return !(d.name in a) }) } this.settings.showErrors ?
this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
}, resetForm: function () { c.fn.resetForm && c(this.currentForm).resetForm(); this.submitted = {}; this.lastElement = null; this.prepareForm(); this.hideErrors(); this.elements().removeClass(this.settings.errorClass) }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (a) { var b = 0, d; for (d in a) b++; return b }, hideErrors: function () { this.addWrapper(this.toHide).hide() }, valid: function () {
    return this.size() ==
0
}, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { c(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (a) { } }, findLastActive: function () { var a = this.lastActive; return a && c.grep(this.errorList, function (b) { return b.element.name == a.name }).length == 1 && a }, elements: function () {
    var a = this, b = {}; return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
        !this.name &&
a.settings.debug && window.console && console.error("%o has no name assigned", this); if (this.name in b || !a.objectLength(c(this).rules())) return false; return b[this.name] = true
    })
}, clean: function (a) { return c(a)[0] }, errors: function () { return c(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext) }, reset: function () { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = c([]); this.toHide = c([]); this.currentElements = c([]) }, prepareForm: function () { this.reset(); this.toHide = this.errors().add(this.containers) },
    prepareElement: function (a) { this.reset(); this.toHide = this.errorsFor(a) }, check: function (a) {
        a = this.validationTargetFor(this.clean(a)); var b = c(a).rules(), d = false, e; for (e in b) {
            var f = { method: e, parameters: b[e] }; try { var g = c.validator.methods[e].call(this, a.value.replace(/\r/g, ""), a, f.parameters); if (g == "dependency-mismatch") d = true; else { d = false; if (g == "pending") { this.toHide = this.toHide.not(this.errorsFor(a)); return } if (!g) { this.formatAndAdd(a, f); return false } } } catch (h) {
                this.settings.debug && window.console && console.log("exception occured when checking element " +
a.id + ", check the '" + f.method + "' method", h); throw h;
            } 
        } if (!d) { this.objectLength(b) && this.successList.push(a); return true } 
    }, customMetaMessage: function (a, b) { if (c.metadata) { var d = this.settings.meta ? c(a).metadata()[this.settings.meta] : c(a).metadata(); return d && d.messages && d.messages[b] } }, customMessage: function (a, b) { var d = this.settings.messages[a]; return d && (d.constructor == String ? d : d[b]) }, findDefined: function () { for (var a = 0; a < arguments.length; a++) if (arguments[a] !== undefined) return arguments[a] }, defaultMessage: function (a,
b) { return this.findDefined(this.customMessage(a.name, b), this.customMetaMessage(a, b), !this.settings.ignoreTitle && a.title || undefined, c.validator.messages[b], "<strong>Warning: No message defined for " + a.name + "</strong>") }, formatAndAdd: function (a, b) {
    var d = this.defaultMessage(a, b.method), e = /\$?\{(\d+)\}/g; if (typeof d == "function") d = d.call(this, b.parameters, a); else if (e.test(d)) d = jQuery.format(d.replace(e, "{$1}"), b.parameters); this.errorList.push({ message: d, element: a }); this.errorMap[a.name] = d; this.submitted[a.name] =
d
}, addWrapper: function (a) { if (this.settings.wrapper) a = a.add(a.parent(this.settings.wrapper)); return a }, defaultShowErrors: function () {
    for (var a = 0; this.errorList[a]; a++) { var b = this.errorList[a]; this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass); this.showLabel(b.element, b.message) } if (this.errorList.length) this.toShow = this.toShow.add(this.containers); if (this.settings.success) for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]);
    if (this.settings.unhighlight) { a = 0; for (b = this.validElements(); b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass) } this.toHide = this.toHide.not(this.toShow); this.hideErrors(); this.addWrapper(this.toShow).show()
}, validElements: function () { return this.currentElements.not(this.invalidElements()) }, invalidElements: function () { return c(this.errorList).map(function () { return this.element }) }, showLabel: function (a, b) {
    var d = this.errorsFor(a); if (d.length) {
        d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
        d.attr("generated") && d.html(b)
    } else { d = c("<" + this.settings.errorElement + "/>").attr({ "for": this.idOrName(a), generated: true }).addClass(this.settings.errorClass).html(b || ""); if (this.settings.wrapper) d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, c(a)) : d.insertAfter(a)) } if (!b && this.settings.success) { d.text(""); typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d) } this.toShow =
this.toShow.add(d)
}, errorsFor: function (a) { var b = this.idOrName(a); return this.errors().filter(function () { return c(this).attr("for") == b }) }, idOrName: function (a) { return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name) }, validationTargetFor: function (a) { if (this.checkable(a)) a = this.findByName(a.name).not(this.settings.ignore)[0]; return a }, checkable: function (a) { return /radio|checkbox/i.test(a.type) }, findByName: function (a) {
    var b = this.currentForm; return c(document.getElementsByName(a)).map(function (d,
e) { return e.form == b && e.name == a && e || null })
}, getLength: function (a, b) { switch (b.nodeName.toLowerCase()) { case "select": return c("option:selected", b).length; case "input": if (this.checkable(b)) return this.findByName(b.name).filter(":checked").length } return a.length }, depend: function (a, b) { return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : true }, dependTypes: { "boolean": function (a) { return a }, string: function (a, b) { return !!c(a, b.form).length }, "function": function (a, b) { return a(b) } }, optional: function (a) {
    return !c.validator.methods.required.call(this,
c.trim(a.value), a) && "dependency-mismatch"
}, startRequest: function (a) { if (!this.pending[a.name]) { this.pendingRequest++; this.pending[a.name] = true } }, stopRequest: function (a, b) {
    this.pendingRequest--; if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[a.name]; if (b && this.pendingRequest == 0 && this.formSubmitted && this.form()) { c(this.currentForm).submit(); this.formSubmitted = false } else if (!b && this.pendingRequest == 0 && this.formSubmitted) {
        c(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted =
false
    } 
}, previousValue: function (a) { return c.data(a, "previousValue") || c.data(a, "previousValue", { old: null, valid: true, message: this.defaultMessage(a, "remote") }) } 
}, classRuleSettings: { required: { required: true }, email: { email: true }, url: { url: true }, date: { date: true }, dateISO: { dateISO: true }, dateDE: { dateDE: true }, number: { number: true }, numberDE: { numberDE: true }, digits: { digits: true }, creditcard: { creditcard: true} }, addClassRules: function (a, b) {
    a.constructor == String ? this.classRuleSettings[a] = b : c.extend(this.classRuleSettings,
a)
}, classRules: function (a) { var b = {}; (a = c(a).attr("class")) && c.each(a.split(" "), function () { this in c.validator.classRuleSettings && c.extend(b, c.validator.classRuleSettings[this]) }); return b }, attributeRules: function (a) { var b = {}; a = c(a); for (var d in c.validator.methods) { var e; if (e = d === "required" && typeof c.fn.prop === "function" ? a.prop(d) : a.attr(d)) b[d] = e; else if (a[0].getAttribute("type") === d) b[d] = true } b.maxlength && /-1|2147483647|524288/.test(b.maxlength) && delete b.maxlength; return b }, metadataRules: function (a) {
    if (!c.metadata) return {};
    var b = c.data(a.form, "validator").settings.meta; return b ? c(a).metadata()[b] : c(a).metadata()
}, staticRules: function (a) { var b = {}, d = c.data(a.form, "validator"); if (d.settings.rules) b = c.validator.normalizeRule(d.settings.rules[a.name]) || {}; return b }, normalizeRules: function (a, b) {
    c.each(a, function (d, e) {
        if (e === false) delete a[d]; else if (e.param || e.depends) {
            var f = true; switch (typeof e.depends) { case "string": f = !!c(e.depends, b.form).length; break; case "function": f = e.depends.call(b, b) } if (f) a[d] = e.param !== undefined ?
e.param : true; else delete a[d]
        } 
    }); c.each(a, function (d, e) { a[d] = c.isFunction(e) ? e(b) : e }); c.each(["minlength", "maxlength", "min", "max"], function () { if (a[this]) a[this] = Number(a[this]) }); c.each(["rangelength", "range"], function () { if (a[this]) a[this] = [Number(a[this][0]), Number(a[this][1])] }); if (c.validator.autoCreateRanges) { if (a.min && a.max) { a.range = [a.min, a.max]; delete a.min; delete a.max } if (a.minlength && a.maxlength) { a.rangelength = [a.minlength, a.maxlength]; delete a.minlength; delete a.maxlength } } a.messages && delete a.messages;
    return a
}, normalizeRule: function (a) { if (typeof a == "string") { var b = {}; c.each(a.split(/\s/), function () { b[this] = true }); a = b } return a }, addMethod: function (a, b, d) { c.validator.methods[a] = b; c.validator.messages[a] = d != undefined ? d : c.validator.messages[a]; b.length < 3 && c.validator.addClassRules(a, c.validator.normalizeRule(a)) }, methods: { required: function (a, b, d) {
    if (!this.depend(d, b)) return "dependency-mismatch"; switch (b.nodeName.toLowerCase()) {
        case "select": return (a = c(b).val()) && a.length > 0; case "input": if (this.checkable(b)) return this.getLength(a,
b) > 0; default: return c.trim(a).length > 0
    } 
}, remote: function (a, b, d) {
    if (this.optional(b)) return "dependency-mismatch"; var e = this.previousValue(b); this.settings.messages[b.name] || (this.settings.messages[b.name] = {}); e.originalMessage = this.settings.messages[b.name].remote; this.settings.messages[b.name].remote = e.message; d = typeof d == "string" && { url: d} || d; if (this.pending[b.name]) return "pending"; if (e.old === a) return e.valid; e.old = a; var f = this; this.startRequest(b); var g = {}; g[b.name] = a; c.ajax(c.extend(true, { url: d,
        mode: "abort", port: "validate" + b.name, dataType: "json", data: g, success: function (h) { f.settings.messages[b.name].remote = e.originalMessage; var j = h === true; if (j) { var i = f.formSubmitted; f.prepareElement(b); f.formSubmitted = i; f.successList.push(b); f.showErrors() } else { i = {}; h = h || f.defaultMessage(b, "remote"); i[b.name] = e.message = c.isFunction(h) ? h(a) : h; f.showErrors(i) } e.valid = j; f.stopRequest(b, j) } 
    }, d)); return "pending"
}, minlength: function (a, b, d) { return this.optional(b) || this.getLength(c.trim(a), b) >= d }, maxlength: function (a,
b, d) { return this.optional(b) || this.getLength(c.trim(a), b) <= d }, rangelength: function (a, b, d) { a = this.getLength(c.trim(a), b); return this.optional(b) || a >= d[0] && a <= d[1] }, min: function (a, b, d) { return this.optional(b) || a >= d }, max: function (a, b, d) { return this.optional(b) || a <= d }, range: function (a, b, d) { return this.optional(b) || a >= d[0] && a <= d[1] }, email: function (a, b) { return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a) },
    url: function (a, b) { return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a) },
    date: function (a, b) { return this.optional(b) || !/Invalid|NaN/.test(new Date(a)) }, dateISO: function (a, b) { return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a) }, number: function (a, b) { return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a) }, digits: function (a, b) { return this.optional(b) || /^\d+$/.test(a) }, creditcard: function (a, b) {
        if (this.optional(b)) return "dependency-mismatch"; if (/[^0-9 -]+/.test(a)) return false; var d = 0, e = 0, f = false; a = a.replace(/\D/g, ""); for (var g = a.length - 1; g >=
0; g--) { e = a.charAt(g); e = parseInt(e, 10); if (f) if ((e *= 2) > 9) e -= 9; d += e; f = !f } return d % 10 == 0
    }, accept: function (a, b, d) { d = typeof d == "string" ? d.replace(/,/g, "|") : "png|jpe?g|gif"; return this.optional(b) || a.match(RegExp(".(" + d + ")$", "i")) }, equalTo: function (a, b, d) { d = c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () { c(b).valid() }); return a == d.val() } 
}
}); c.format = c.validator.format
})(jQuery);
(function (c) { var a = {}; if (c.ajaxPrefilter) c.ajaxPrefilter(function (d, e, f) { e = d.port; if (d.mode == "abort") { a[e] && a[e].abort(); a[e] = f } }); else { var b = c.ajax; c.ajax = function (d) { var e = ("port" in d ? d : c.ajaxSettings).port; if (("mode" in d ? d : c.ajaxSettings).mode == "abort") { a[e] && a[e].abort(); return a[e] = b.apply(this, arguments) } return b.apply(this, arguments) } } })(jQuery);
(function (c) {
    !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && c.each({ focus: "focusin", blur: "focusout" }, function (a, b) { function d(e) { e = c.event.fix(e); e.type = b; return c.event.handle.call(this, e) } c.event.special[b] = { setup: function () { this.addEventListener(a, d, true) }, teardown: function () { this.removeEventListener(a, d, true) }, handler: function (e) { arguments[0] = c.event.fix(e); arguments[0].type = b; return c.event.handle.apply(this, arguments) } } }); c.extend(c.fn, { validateDelegate: function (a,
b, d) { return this.bind(b, function (e) { var f = c(e.target); if (f.is(a)) return d.apply(f, arguments) }) } 
    })
})(jQuery);
/************************ 3. jquery.validate.1.9.0.min.js ************************/


/************************ 4. google.webfont.js ************************/
/*
 * Copyright 2012 Small Batch, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
;(function(window,document,undefined){
function i(a){return function(){return this[a]}}var j;function n(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):[];return function(){c.push.apply(c,arguments);return b.apply(a,c)}};function o(a,b){this.K=a;this.c=b}o.prototype.createElement=function(a,b,c){a=this.K.createElement(a);if(b)for(var d in b)if(b.hasOwnProperty(d))d=="style"?q(this,a,b[d]):a.setAttribute(d,b[d]);c&&a.appendChild(this.K.createTextNode(c));return a};function r(a,b,c){a=a.K.getElementsByTagName(b)[0];if(!a)a=document.documentElement;if(a&&a.lastChild){a.insertBefore(c,a.lastChild);return true}return false}function aa(a,b){function c(){document.body?b():setTimeout(c,0)}c()}
function s(a,b){if(b.parentNode){b.parentNode.removeChild(b);return true}return false}function t(a,b){return a.createElement("link",{rel:"stylesheet",href:b})}function u(a,b){return a.createElement("script",{src:b})}function v(a,b,c){a=b.className.split(/\s+/);for(var d=0,e=a.length;d<e;d++)if(a[d]==c)return;a.push(c);b.className=a.join(" ").replace(/^\s+/,"")}
function w(a,b,c){a=b.className.split(/\s+/);for(var d=[],e=0,f=a.length;e<f;e++)a[e]!=c&&d.push(a[e]);b.className=d.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")}function x(a,b,c){a=b.className.split(/\s+/);b=0;for(var d=a.length;b<d;b++)if(a[b]==c)return true;return false}function q(a,b,c){if(a.c.getName()=="MSIE")b.style.cssText=c;else b.setAttribute("style",c)};function y(a,b,c,d,e,f,g,h){this.Ba=a;this.Ha=b;this.oa=c;this.na=d;this.Ea=e;this.Da=f;this.ma=g;this.Ia=h}j=y.prototype;j.getName=i("Ba");j.xa=i("Ha");j.Y=i("oa");j.ua=i("na");j.va=i("Ea");j.wa=i("Da");j.ta=i("ma");j.w=i("Ia");function z(a,b){this.c=a;this.k=b}var ba=new y("Unknown","Unknown","Unknown","Unknown","Unknown","Unknown",undefined,false);z.prototype.parse=function(){return this.c.indexOf("MSIE")!=-1?ca(this):this.c.indexOf("Opera")!=-1?da(this):this.c.indexOf("AppleWebKit")!=-1?ea(this):this.c.indexOf("Gecko")!=-1?fa(this):ba};
function A(a){var b=C(a,a.c,/(iPod|iPad|iPhone|Android)/,1);if(b!="")return b;a=C(a,a.c,/(Linux|Mac_PowerPC|Macintosh|Windows)/,1);if(a!=""){if(a=="Mac_PowerPC")a="Macintosh";return a}return"Unknown"}function D(a){var b=C(a,a.c,/(OS X|Windows NT|Android) ([^;)]+)/,2);if(b)return b;if(b=C(a,a.c,/(iPhone )?OS ([\d_]+)/,2))return b;if(a=C(a,a.c,/Linux ([i\d]+)/,1))return a;return"Unknown"}
function ca(a){var b=C(a,a.c,/(MSIE [\d\w\.]+)/,1);if(b!=""){var c=b.split(" ");b=c[0];c=c[1];return new y(b,c,b,c,A(a),D(a),E(a,a.k),F(a,c)>=6)}return new y("MSIE","Unknown","MSIE","Unknown",A(a),D(a),E(a,a.k),false)}
function da(a){var b="Unknown",c="Unknown",d=C(a,a.c,/(Presto\/[\d\w\.]+)/,1);if(d!=""){c=d.split("/");b=c[0];c=c[1]}else{if(a.c.indexOf("Gecko")!=-1)b="Gecko";d=C(a,a.c,/rv:([^\)]+)/,1);if(d!="")c=d}if(a.c.indexOf("Version/")!=-1){d=C(a,a.c,/Version\/([\d\.]+)/,1);if(d!="")return new y("Opera",d,b,c,A(a),D(a),E(a,a.k),F(a,d)>=10)}d=C(a,a.c,/Opera[\/ ]([\d\.]+)/,1);if(d!="")return new y("Opera",d,b,c,A(a),D(a),E(a,a.k),F(a,d)>=10);return new y("Opera","Unknown",b,c,A(a),D(a),E(a,a.k),false)}
function ea(a){var b=A(a),c=D(a),d=C(a,a.c,/AppleWebKit\/([\d\.\+]+)/,1);if(d=="")d="Unknown";var e="Unknown";if(a.c.indexOf("Chrome")!=-1)e="Chrome";else if(a.c.indexOf("Safari")!=-1)e="Safari";else if(a.c.indexOf("AdobeAIR")!=-1)e="AdobeAIR";var f="Unknown";if(a.c.indexOf("Version/")!=-1)f=C(a,a.c,/Version\/([\d\.\w]+)/,1);else if(e=="Chrome")f=C(a,a.c,/Chrome\/([\d\.]+)/,1);else if(e=="AdobeAIR")f=C(a,a.c,/AdobeAIR\/([\d\.]+)/,1);var g=false;if(e=="AdobeAIR"){g=C(a,f,/\d+\.(\d+)/,1);g=F(a,f)>2||
F(a,f)==2&&parseInt(g,10)>=5}else{g=C(a,d,/\d+\.(\d+)/,1);g=F(a,d)>=526||F(a,d)>=525&&parseInt(g,10)>=13}return new y(e,f,"AppleWebKit",d,b,c,E(a,a.k),g)}
function fa(a){var b="Unknown",c="Unknown",d=false;if(a.c.indexOf("Firefox")!=-1){b="Firefox";var e=C(a,a.c,/Firefox\/([\d\w\.]+)/,1);if(e!=""){d=C(a,e,/\d+\.(\d+)/,1);c=e;d=e!=""&&F(a,e)>=3&&parseInt(d,10)>=5}}else if(a.c.indexOf("Mozilla")!=-1)b="Mozilla";e=C(a,a.c,/rv:([^\)]+)/,1);if(e=="")e="Unknown";else if(!d){d=F(a,e);var f=parseInt(C(a,e,/\d+\.(\d+)/,1),10),g=parseInt(C(a,e,/\d+\.\d+\.(\d+)/,1),10);d=d>1||d==1&&f>9||d==1&&f==9&&g>=2||e.match(/1\.9\.1b[123]/)!=null||e.match(/1\.9\.1\.[\d\.]+/)!=
null}return new y(b,c,"Gecko",e,A(a),D(a),E(a,a.k),d)}function F(a,b){a=C(a,b,/(\d+)/,1);if(a!="")return parseInt(a,10);return-1}function C(a,b,c,d){if((a=b.match(c))&&a[d])return a[d];return""}function E(a,b){if(b.documentMode)return b.documentMode};function ga(a,b,c,d){this.a=a;this.g=b;this.U=c;this.j=d||ha;this.h=new G("-")}var ha="wf";function H(a){v(a.a,a.g,a.h.e(a.j,"loading"));I(a,"loading")}function J(a){w(a.a,a.g,a.h.e(a.j,"loading"));x(a.a,a.g,a.h.e(a.j,"active"))||v(a.a,a.g,a.h.e(a.j,"inactive"));I(a,"inactive")}function ia(a){w(a.a,a.g,a.h.e(a.j,"loading"));w(a.a,a.g,a.h.e(a.j,"inactive"));v(a.a,a.g,a.h.e(a.j,"active"));I(a,"active")}function I(a,b,c,d){a.U[b]&&a.U[b](c,d)};function ja(){this.fa={}}function ka(a,b){var c=[];for(var d in b)if(b.hasOwnProperty(d)){var e=a.fa[d];e&&c.push(e(b[d]))}return c};function L(a,b,c,d,e){this.a=a;this.A=b;this.n=c;this.u=d;this.D=e;this.V=0;this.ja=this.ea=false}L.prototype.watch=function(a,b,c,d,e){for(var f=a.length,g=0;g<f;g++){var h=a[g];b[h]||(b[h]=["n4"]);this.V+=b[h].length}if(e)this.ea=e;for(g=0;g<f;g++){h=a[g];e=b[h];for(var l=c[h],k=0,m=e.length;k<m;k++){var B=e[k],p=this.A,K=h;v(p.a,p.g,p.h.e(p.j,K,B,"loading"));I(p,"fontloading",K,B);p=n(this,this.qa);K=n(this,this.ra);(new d(p,K,this.a,this.n,this.u,this.D,h,B,l)).start()}}};
L.prototype.qa=function(a,b){var c=this.A;w(c.a,c.g,c.h.e(c.j,a,b,"loading"));w(c.a,c.g,c.h.e(c.j,a,b,"inactive"));v(c.a,c.g,c.h.e(c.j,a,b,"active"));I(c,"fontactive",a,b);this.ja=true;M(this)};L.prototype.ra=function(a,b){var c=this.A;w(c.a,c.g,c.h.e(c.j,a,b,"loading"));x(c.a,c.g,c.h.e(c.j,a,b,"active"))||v(c.a,c.g,c.h.e(c.j,a,b,"inactive"));I(c,"fontinactive",a,b);M(this)};function M(a){if(--a.V==0&&a.ea)a.ja?ia(a.A):J(a.A)};function N(a,b,c,d,e,f,g,h,l){this.H=a;this.$=b;this.a=c;this.n=d;this.u=e;this.D=f;this.Aa=new la;this.v=new O;this.L=g;this.B=h;this.sa=l||ma;this.O=na(this,oa);this.P=na(this,pa);this.ca=this.O;this.da=this.P;this.Q=P(this,oa);this.R=P(this,pa)}var oa="arial,'URW Gothic L',sans-serif",pa="Georgia,'Century Schoolbook L',serif",ma="BESbswy";N.prototype.start=function(){this.ia=this.D();this.J()};
N.prototype.J=function(){var a=this.n.p(this.Q),b=this.n.p(this.R);if((this.O!=a||this.P!=b)&&this.ca==a&&this.da==b)Q(this,this.H);else if(this.D()-this.ia>=5E3)Q(this,this.$);else{this.ca=a;this.da=b;qa(this)}};function qa(a){a.u(function(b,c){return function(){c.call(b)}}(a,a.J),25)}function Q(a,b){s(a.a,a.Q);s(a.a,a.R);b(a.L,a.B)}function na(a,b){b=P(a,b,true);var c=a.n.p(b);s(a.a,b);return c}function P(a,b,c){b=a.a.createElement("span",{style:R(a,b,a.B,c)},a.sa);r(a.a,"body",b);return b}
function R(a,b,c,d){c=a.v.expand(c);return"position:absolute;top:-999px;left:-999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;font-family:"+(d?"":a.Aa.quote(a.L)+",")+b+";"+c};function S(a,b,c,d,e){this.a=a;this.X=b;this.g=c;this.u=d;this.c=e;this.M=this.N=0}S.prototype.q=function(a,b){this.X.fa[a]=b};S.prototype.load=function(a){var b=new ga(this.a,this.g,a);this.c.w()?ra(this,b,a):J(b)};S.prototype.ya=function(a,b,c,d){var e=a.Z?a.Z():N;if(d)a.load(n(this,this.Ca,b,c,e));else{a=--this.N==0;this.M--;if(a)this.M==0?J(b):H(b);c.watch([],{},{},e,a)}};
S.prototype.Ca=function(a,b,c,d,e,f){var g=--this.N==0;g&&H(a);this.u(n(this,function(h,l,k,m,B,p){h.watch(l,k||{},m||{},B,p)},b,d,e,f,c,g))};function ra(a,b,c){c=ka(a.X,c);a.M=a.N=c.length;for(var d=new L(a.a,b,{p:function(h){return h.offsetWidth}},a.u,function(){return(new Date).getTime()}),e=0,f=c.length;e<f;e++){var g=c[e];g.z(a.c,n(a,a.ya,g,b,d))}};function G(a){this.za=a||sa}var sa="-";G.prototype.e=function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return a.join(this.za)};function la(){this.ha="'"}la.prototype.quote=function(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");d.indexOf(" ")==-1?b.push(d):b.push(this.ha+d+this.ha)}return b.join(",")};function O(){this.G=ta;this.o=ua}var ta=["font-style","font-weight"],ua={"font-style":[["n","normal"],["i","italic"],["o","oblique"]],"font-weight":[["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]};function T(a,b,c){this.aa=a;this.Fa=b;this.o=c}T.prototype.compact=function(a,b){for(var c=0;c<this.o.length;c++)if(b==this.o[c][1]){a[this.aa]=this.o[c][0];return}};
T.prototype.expand=function(a,b){for(var c=0;c<this.o.length;c++)if(b==this.o[c][0]){a[this.aa]=this.Fa+":"+this.o[c][1];return}};O.prototype.compact=function(a){var b=["n","4"];a=a.split(";");for(var c=0,d=a.length;c<d;c++){var e=a[c].replace(/\s+/g,"").split(":");if(e.length==2){var f=e[1];a:{e=e[0];for(var g=0;g<this.G.length;g++)if(e==this.G[g]){e=new T(g,e,this.o[e]);break a}e=null}e&&e.compact(b,f)}}return b.join("")};
O.prototype.expand=function(a){if(a.length!=2)return null;for(var b=[null,null],c=0,d=this.G.length;c<d;c++){var e=this.G[c],f=a.substr(c,1);(new T(c,e,this.o[e])).expand(b,f)}return b[0]&&b[1]?b.join(";")+";":null};window.WebFont=function(){var a=(new z(navigator.userAgent,document)).parse();return new S(new o(document,a),new ja,document.documentElement,function(b,c){setTimeout(b,c)},a)}();window.WebFont.load=window.WebFont.load;window.WebFont.addModule=window.WebFont.q;y.prototype.getName=y.prototype.getName;y.prototype.getVersion=y.prototype.xa;y.prototype.getEngine=y.prototype.Y;y.prototype.getEngineVersion=y.prototype.ua;y.prototype.getPlatform=y.prototype.va;y.prototype.getPlatformVersion=y.prototype.wa;
y.prototype.getDocumentMode=y.prototype.ta;y.prototype.isSupportingWebFont=y.prototype.w;function U(a,b){this.a=a;this.d=b}var va={regular:"n4",bold:"n7",italic:"i4",bolditalic:"i7",r:"n4",b:"n7",i:"i4",bi:"i7"};U.prototype.z=function(a,b){return b(a.w())};
U.prototype.load=function(a){r(this.a,"head",t(this.a,("https:"==document.location.protocol?"https:":"http:")+"//webfonts.fontslive.com/css/"+this.d.key+".css"));var b;b=this.d.families;var c,d,e;c=[];d={};for(var f=0,g=b.length;f<g;f++){e=void 0;var h=void 0;h=void 0;h=b[f].split(":");e=h[0];h=h[1]?wa(this,h[1]):["n4"];e={W:e,T:h};c.push(e.W);d[e.W]=e.T}b={pa:c,T:d};a(b.pa,b.T)};
function wa(a,b){a=b.split(",");b=[];for(var c=0,d=a.length;c<d;c++){var e=a[c];if(e){var f=va[e];b.push(f?f:e)}}return b}window.WebFont.q("ascender",function(a){var b=(new z(navigator.userAgent,document)).parse();return new U(new o(document,b),a)});function V(a,b,c,d,e,f,g,h,l){V.Ga.call(this,a,b,c,d,e,f,g,h,l);a=["Times New Roman","Lucida Sans Unicode","Courier New","Tahoma","Arial","Microsoft Sans Serif","Times","Lucida Console","Sans","Serif","Monospace"];b=a.length;c={};d=P(this,a[0],true);c[this.n.p(d)]=true;for(e=1;e<b;e++){f=a[e];q(this.a,d,R(this,f,this.B,true));c[this.n.p(d)]=true;if(this.B[1]!="4"){q(this.a,d,R(this,f,this.B[0]+"4",true));c[this.n.p(d)]=true}}s(this.a,d);this.t=c;this.la=false}
(function(a,b){function c(){}c.prototype=a.prototype;b.prototype=new c;b.Ga=a;b.Ja=a.prototype})(N,V);var xa={Arimo:true,Cousine:true,Tinos:true};V.prototype.J=function(){var a=this.n.p(this.Q),b=this.n.p(this.R);if(!this.la&&a==b&&this.t[a]){this.t={};this.la=this.t[a]=true}if((this.O!=a||this.P!=b)&&!this.t[a]&&!this.t[b])Q(this,this.H);else if(this.D()-this.ia>=5E3)this.t[a]&&this.t[b]&&xa[this.L]?Q(this,this.H):Q(this,this.$);else qa(this)};function ya(a){this.I=a?a:("https:"==window.location.protocol?"https:":"http:")+za;this.f=[];this.S=[]}var za="//fonts.googleapis.com/css";ya.prototype.e=function(){if(this.f.length==0)throw new Error("No fonts to load !");if(this.I.indexOf("kit=")!=-1)return this.I;for(var a=this.f.length,b=[],c=0;c<a;c++)b.push(this.f[c].replace(/ /g,"+"));a=this.I+"?family="+b.join("%7C");if(this.S.length>0)a+="&subset="+this.S.join(",");return a};function Aa(a){this.f=a;this.ga=[];this.ka={};this.F={};this.v=new O}var Ba={ultralight:"n2",light:"n3",regular:"n4",bold:"n7",italic:"i4",bolditalic:"i7",ul:"n2",l:"n3",r:"n4",b:"n7",i:"i4",bi:"i7"},Ca={latin:ma,cyrillic:"&#1081;&#1103;&#1046;",greek:"&#945;&#946;&#931;",khmer:"&#x1780;&#x1781;&#x1782;",Hanuman:"&#x1780;&#x1781;&#x1782;"};
Aa.prototype.parse=function(){for(var a=this.f.length,b=0;b<a;b++){var c=this.f[b].split(":"),d=c[0],e=["n4"];if(c.length>=2){var f=c[1],g=[];if(f){f=f.split(",");for(var h=f.length,l=0;l<h;l++){var k;k=f[l];if(k.match(/^[\w ]+$/)){var m=Ba[k];if(m)k=m;else{m=k.match(/^(\d*)(\w*)$/);k=m[1];m=m[2];k=(k=this.v.expand([m?m:"n",k?k.substr(0,1):"4"].join("")))?this.v.compact(k):null}}else k="";k&&g.push(k)}}if(g.length>0)e=g;if(c.length==3){c=c[2];g=[];c=c?c.split(","):g;if(c.length>0)if(c=Ca[c[0]])this.F[d]=
c}}if(!this.F[d])if(c=Ca[d])this.F[d]=c;this.ga.push(d);this.ka[d]=e}};function W(a,b,c){this.c=a;this.a=b;this.d=c}W.prototype.z=function(a,b){b(a.w())};W.prototype.Z=function(){if(this.c.Y()=="AppleWebKit")return V;return N};W.prototype.load=function(a){var b=this.a;this.c.getName()=="MSIE"&&this.d.blocking!=true?aa(b,n(this,this.ba,a)):this.ba(a)};
W.prototype.ba=function(a){for(var b=this.a,c=new ya(this.d.api),d=this.d.families,e=d.length,f=0;f<e;f++){var g=d[f].split(":");g.length==3&&c.S.push(g.pop());c.f.push(g.join(":"))}d=new Aa(d);d.parse();r(b,"head",t(b,c.e()));a(d.ga,d.ka,d.F)};window.WebFont.q("google",function(a){var b=(new z(navigator.userAgent,document)).parse();return new W(b,new o(document,b),a)});function X(a,b){this.a=a;this.d=b}X.prototype.load=function(a){for(var b=this.d.urls||[],c=this.d.families||[],d=0,e=b.length;d<e;d++)r(this.a,"head",t(this.a,b[d]));a(c)};X.prototype.z=function(a,b){return b(a.w())};window.WebFont.q("custom",function(a){var b=(new z(navigator.userAgent,document)).parse();return new X(new o(document,b),a)});function Y(a,b,c){this.m=a;this.a=b;this.d=c;this.f=[];this.s={};this.v=new O}Y.prototype.C=function(a){return("https:"==this.m.location.protocol?"https:":"http:")+(this.d.api||"//f.fontdeck.com/s/css/js/")+this.m.document.location.hostname+"/"+a+".js"};
Y.prototype.z=function(a,b){a=this.d.id;var c=this;if(a){this.m.__webfontfontdeckmodule__||(this.m.__webfontfontdeckmodule__={});this.m.__webfontfontdeckmodule__[a]=function(d,e){for(var f=0,g=e.fonts.length;f<g;++f){var h=e.fonts[f];c.f.push(h.name);c.s[h.name]=[c.v.compact("font-weight:"+h.weight+";font-style:"+h.style)]}b(d)};r(this.a,"head",u(this.a,this.C(a)))}else b(true)};Y.prototype.load=function(a){a(this.f,this.s)};
window.WebFont.q("fontdeck",function(a){var b=(new z(navigator.userAgent,document)).parse();return new Y(window,new o(document,b),a)});function Z(a,b,c,d,e){this.m=a;this.c=b;this.a=c;this.k=d;this.d=e;this.f=[];this.s={}}
Z.prototype.z=function(a,b){var c=this,d=c.d.projectId;if(d){var e=u(c.a,c.C(d));e.id="__MonotypeAPIScript__"+d;e.onreadystatechange=function(f){if(e.readyState==="loaded"||e.readyState==="complete"){e.onreadystatechange=null;e.onload(f)}};e.onload=function(){if(c.m["__mti_fntLst"+d]){var f=c.m["__mti_fntLst"+d]();if(f&&f.length){var g;for(g=0;g<f.length;g++)c.f.push(f[g].fontfamily)}}b(a.w())};r(this.a,"head",e)}else b(true)};
Z.prototype.C=function(a){var b=this.protocol(),c=(this.d.api||"fast.fonts.com/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return b+"//"+c+"/"+a+".js"};Z.prototype.load=function(a){a(this.f,this.s)};Z.prototype.protocol=function(){var a=["http:","https:"],b=a[0];if(this.k&&this.k.location&&this.k.location.protocol){var c=0;for(c=0;c<a.length;c++)if(this.k.location.protocol===a[c])return this.k.location.protocol}return b};
window.WebFont.q("monotype",function(a){var b=(new z(navigator.userAgent,document)).parse();return new Z(window,b,new o(document,b),document,a)});function $(a,b,c){this.m=a;this.a=b;this.d=c;this.f=[];this.s={}}$.prototype.C=function(a){var b="https:"==window.location.protocol?"https:":"http:";return(this.d.api||b+"//use.typekit.com")+"/"+a+".js"};$.prototype.z=function(a,b){var c=this.d.id,d=this.d,e=this;if(c){this.m.__webfonttypekitmodule__||(this.m.__webfonttypekitmodule__={});this.m.__webfonttypekitmodule__[c]=function(f){f(a,d,function(g,h,l){e.f=h;e.s=l;b(g)})};r(this.a,"head",u(this.a,this.C(c)))}else b(true)};
$.prototype.load=function(a){a(this.f,this.s)};window.WebFont.q("typekit",function(a){var b=(new z(navigator.userAgent,document)).parse();return new $(window,new o(document,b),a)});window.WebFontConfig&&window.WebFont.load(window.WebFontConfig);
})(this,document);
/************************ 4. google.webfont.js ************************/

/************************ 5. jquery.mousewheel.js ************************/
﻿/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
* 
* Requires: 1.2.2+
*/

(function ($) {

    var types = ['DOMMouseScroll', 'mousewheel'];

    $.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) {
                for (var i = types.length; i; ) {
                    this.addEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function () {
            if (this.removeEventListener) {
                for (var i = types.length; i; ) {
                    this.removeEventListener(types[--i], handler, false);
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function (fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function (fn) {
            return this.unbind("mousewheel", fn);
        }
    });


    function handler(event) {
        var orgEvent = event || window.event, args = [].slice.call(arguments, 1), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if (event.wheelDelta) { delta = event.wheelDelta / 120; }
        if (event.detail) { delta = -event.detail / 3; }

        // New school multidimensional scroll (touchpads) deltas
        deltaY = delta;

        // Gecko
        if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
            deltaY = 0;
            deltaX = -1 * delta;
        }

        // Webkit
        if (orgEvent.wheelDeltaY !== undefined) { deltaY = orgEvent.wheelDeltaY / 120; }
        if (orgEvent.wheelDeltaX !== undefined) { deltaX = -1 * orgEvent.wheelDeltaX / 120; }

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        return $.event.handle.apply(this, args);
    }

})(jQuery);
/************************ 5. jquery.mousewheel.js ************************/

/************************ 6. jquery.jscrollpane.min.js ************************/
﻿/*
* jScrollPane - v2.0.0beta11 - 2011-07-04
* http://jscrollpane.kelvinluck.com/
*
* Copyright (c) 2010 Kelvin Luck
* Dual licensed under the MIT and GPL licenses.
*/
(function (b, a, c) {
    b.fn.jScrollPane = function (e) {
        function d(D, O) {
            var az, Q = this, Y, ak, v, am, T, Z, y, q, aA, aF, av, i, I, h, j, aa, U, aq, X, t, A, ar, af, an, G, l, au, ay, x, aw, aI, f, L, aj = true, P = true, aH = false, k = false, ap = D.clone(false, false).empty(), ac = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aI = D.css("paddingTop") + " " + D.css("paddingRight") + " " + D.css("paddingBottom") + " " + D.css("paddingLeft"); f = (parseInt(D.css("paddingLeft"), 10) || 0) + (parseInt(D.css("paddingRight"), 10) || 0); function at(aR) { var aM, aO, aN, aK, aJ, aQ, aP = false, aL = false; az = aR; if (Y === c) { aJ = D.scrollTop(); aQ = D.scrollLeft(); D.css({ overflow: "hidden", padding: 0 }); ak = D.innerWidth() + f; v = D.innerHeight(); D.width(ak); Y = b('<div class="jspPane" />').css("padding", aI).append(D.children()); am = b('<div class="jspContainer" />').css({ width: ak + "px", height: v + "px" }).append(Y).appendTo(D) } else { D.css("width", ""); aP = az.stickToBottom && K(); aL = az.stickToRight && B(); aK = D.innerWidth() + f != ak || D.outerHeight() != v; if (aK) { ak = D.innerWidth() + f; v = D.innerHeight(); am.css({ width: ak + "px", height: v + "px" }) } if (!aK && L == T && Y.outerHeight() == Z) { D.width(ak); return } L = T; Y.css("width", ""); D.width(ak); am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } Y.css("overflow", "auto"); if (aR.contentWidth) { T = aR.contentWidth } else { T = Y[0].scrollWidth } Z = Y[0].scrollHeight; Y.css("overflow", ""); y = T / ak; q = Z / v; aA = q > 1; aF = y > 1; if (!(aF || aA)) { D.removeClass("jspScrollable"); Y.css({ top: 0, width: am.width() - f }); n(); E(); R(); w(); ai() } else { D.addClass("jspScrollable"); aM = az.maintainPosition && (I || aa); if (aM) { aO = aD(); aN = aB() } aG(); z(); F(); if (aM) { N(aL ? (T - ak) : aO, false); M(aP ? (Z - v) : aN, false) } J(); ag(); ao(); if (az.enableKeyboardNavigation) { S() } if (az.clickOnTrack) { p() } C(); if (az.hijackInternalLinks) { m() } } if (az.autoReinitialise && !aw) { aw = setInterval(function () { at(az) }, az.autoReinitialiseDelay) } else { if (!az.autoReinitialise && aw) { clearInterval(aw) } } aJ && D.scrollTop(0) && M(aJ, false); aQ && D.scrollLeft(0) && N(aQ, false); D.trigger("jsp-initialised", [aF || aA]) } function aG() { if (aA) { am.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'), b('<div class="jspDragBottom" />'))), b('<div class="jspCap jspCapBottom" />'))); U = am.find(">.jspVerticalBar"); aq = U.find(">.jspTrack"); av = aq.find(">.jspDrag"); if (az.showArrows) { ar = b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp", aE(0, -1)).bind("click.jsp", aC); af = b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp", aE(0, 1)).bind("click.jsp", aC); if (az.arrowScrollOnHover) { ar.bind("mouseover.jsp", aE(0, -1, ar)); af.bind("mouseover.jsp", aE(0, 1, af)) } al(aq, az.verticalArrowPositions, ar, af) } t = v; am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function () { t -= b(this).outerHeight() }); av.hover(function () { av.addClass("jspHover") }, function () { av.removeClass("jspHover") }).bind("mousedown.jsp", function (aJ) { b("html").bind("dragstart.jsp selectstart.jsp", aC); av.addClass("jspActive"); var s = aJ.pageY - av.position().top; b("html").bind("mousemove.jsp", function (aK) { V(aK.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ax); return false }); o() } } function o() { aq.height(t + "px"); I = 0; X = az.verticalGutter + aq.outerWidth(); Y.width(ak - X - f); try { if (U.position().left === 0) { Y.css("margin-left", X + "px") } } catch (s) { } } function z() {
                if (aF) {
                    am.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'), b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'), b('<div class="jspDragRight" />'))), b('<div class="jspCap jspCapRight" />'))); an = am.find(">.jspHorizontalBar"); G = an.find(">.jspTrack"); h = G.find(">.jspDrag"); if (az.showArrows) {
                        ay = b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp", aE(-1, 0)).bind("click.jsp", aC); x = b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp", aE(1, 0)).bind("click.jsp", aC);
                        if (az.arrowScrollOnHover) { ay.bind("mouseover.jsp", aE(-1, 0, ay)); x.bind("mouseover.jsp", aE(1, 0, x)) } al(G, az.horizontalArrowPositions, ay, x)
                    } h.hover(function () { h.addClass("jspHover") }, function () { h.removeClass("jspHover") }).bind("mousedown.jsp", function (aJ) { b("html").bind("dragstart.jsp selectstart.jsp", aC); h.addClass("jspActive"); var s = aJ.pageX - h.position().left; b("html").bind("mousemove.jsp", function (aK) { W(aK.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ax); return false }); l = am.innerWidth(); ah()
                } 
            } function ah() { am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { l -= b(this).outerWidth() }); G.width(l + "px"); aa = 0 } function F() { if (aF && aA) { var aJ = G.outerHeight(), s = aq.outerWidth(); t -= aJ; b(an).find(">.jspCap:visible,>.jspArrow").each(function () { l += b(this).outerWidth() }); l -= s; v -= s; ak -= aJ; G.parent().append(b('<div class="jspCorner" />').css("width", aJ + "px")); o(); ah() } if (aF) { Y.width((am.outerWidth() - f) + "px") } Z = Y.outerHeight(); q = Z / v; if (aF) { au = Math.ceil(1 / y * l); if (au > az.horizontalDragMaxWidth) { au = az.horizontalDragMaxWidth } else { if (au < az.horizontalDragMinWidth) { au = az.horizontalDragMinWidth } } h.width(au + "px"); j = l - au; ae(aa) } if (aA) { A = Math.ceil(1 / q * t); if (A > az.verticalDragMaxHeight) { A = az.verticalDragMaxHeight } else { if (A < az.verticalDragMinHeight) { A = az.verticalDragMinHeight } } av.height(A + "px"); i = t - A; ad(I) } } function al(aK, aM, aJ, s) { var aO = "before", aL = "after", aN; if (aM == "os") { aM = /Mac/.test(navigator.platform) ? "after" : "split" } if (aM == aO) { aL = aM } else { if (aM == aL) { aO = aM; aN = aJ; aJ = s; s = aN } } aK[aO](aJ)[aL](s) } function aE(aJ, s, aK) { return function () { H(aJ, s, this, aK); this.blur(); return false } } function H(aM, aL, aP, aO) { aP = b(aP).addClass("jspActive"); var aN, aK, aJ = true, s = function () { if (aM !== 0) { Q.scrollByX(aM * az.arrowButtonSpeed) } if (aL !== 0) { Q.scrollByY(aL * az.arrowButtonSpeed) } aK = setTimeout(s, aJ ? az.initialDelay : az.arrowRepeatFreq); aJ = false }; s(); aN = aO ? "mouseout.jsp" : "mouseup.jsp"; aO = aO || b("html"); aO.bind(aN, function () { aP.removeClass("jspActive"); aK && clearTimeout(aK); aK = null; aO.unbind(aN) }) } function p() { w(); if (aA) { aq.bind("mousedown.jsp", function (aO) { if (aO.originalTarget === c || aO.originalTarget == aO.currentTarget) { var aM = b(this), aP = aM.offset(), aN = aO.pageY - aP.top - I, aK, aJ = true, s = function () { var aS = aM.offset(), aT = aO.pageY - aS.top - A / 2, aQ = v * az.scrollPagePercent, aR = i * aQ / (Z - v); if (aN < 0) { if (I - aR > aT) { Q.scrollByY(-aQ) } else { V(aT) } } else { if (aN > 0) { if (I + aR < aT) { Q.scrollByY(aQ) } else { V(aT) } } else { aL(); return } } aK = setTimeout(s, aJ ? az.initialDelay : az.trackClickRepeatFreq); aJ = false }, aL = function () { aK && clearTimeout(aK); aK = null; b(document).unbind("mouseup.jsp", aL) }; s(); b(document).bind("mouseup.jsp", aL); return false } }) } if (aF) { G.bind("mousedown.jsp", function (aO) { if (aO.originalTarget === c || aO.originalTarget == aO.currentTarget) { var aM = b(this), aP = aM.offset(), aN = aO.pageX - aP.left - aa, aK, aJ = true, s = function () { var aS = aM.offset(), aT = aO.pageX - aS.left - au / 2, aQ = ak * az.scrollPagePercent, aR = j * aQ / (T - ak); if (aN < 0) { if (aa - aR > aT) { Q.scrollByX(-aQ) } else { W(aT) } } else { if (aN > 0) { if (aa + aR < aT) { Q.scrollByX(aQ) } else { W(aT) } } else { aL(); return } } aK = setTimeout(s, aJ ? az.initialDelay : az.trackClickRepeatFreq); aJ = false }, aL = function () { aK && clearTimeout(aK); aK = null; b(document).unbind("mouseup.jsp", aL) }; s(); b(document).bind("mouseup.jsp", aL); return false } }) } } function w() { if (G) { G.unbind("mousedown.jsp") } if (aq) { aq.unbind("mousedown.jsp") } } function ax() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); if (av) { av.removeClass("jspActive") } if (h) { h.removeClass("jspActive") } } function V(s, aJ) { if (!aA) { return } if (s < 0) { s = 0 } else { if (s > i) { s = i } } if (aJ === c) { aJ = az.animateScroll } if (aJ) { Q.animate(av, "top", s, ad) } else { av.css("top", s); ad(s) } } function ad(aJ) { if (aJ === c) { aJ = av.position().top } am.scrollTop(0); I = aJ; var aM = I === 0, aK = I == i, aL = aJ / i, s = -aL * (Z - v); if (aj != aM || aH != aK) { aj = aM; aH = aK; D.trigger("jsp-arrow-change", [aj, aH, P, k]) } u(aM, aK); Y.css("top", s); D.trigger("jsp-scroll-y", [-s, aM, aK]).trigger("scroll") } function W(aJ, s) {
                if (!aF) { return } if (aJ < 0) { aJ = 0 } else { if (aJ > j) { aJ = j } } if (s === c) { s = az.animateScroll } if (s) {
                    Q.animate(h, "left", aJ, ae)
                } else { h.css("left", aJ); ae(aJ) } 
            } function ae(aJ) { if (aJ === c) { aJ = h.position().left } am.scrollTop(0); aa = aJ; var aM = aa === 0, aL = aa == j, aK = aJ / j, s = -aK * (T - ak); if (P != aM || k != aL) { P = aM; k = aL; D.trigger("jsp-arrow-change", [aj, aH, P, k]) } r(aM, aL); Y.css("left", s); D.trigger("jsp-scroll-x", [-s, aM, aL]).trigger("scroll") } function u(aJ, s) { if (az.showArrows) { ar[aJ ? "addClass" : "removeClass"]("jspDisabled"); af[s ? "addClass" : "removeClass"]("jspDisabled") } } function r(aJ, s) { if (az.showArrows) { ay[aJ ? "addClass" : "removeClass"]("jspDisabled"); x[s ? "addClass" : "removeClass"]("jspDisabled") } } function M(s, aJ) { var aK = s / (Z - v); V(aK * i, aJ) } function N(aJ, s) { var aK = aJ / (T - ak); W(aK * j, s) } function ab(aW, aR, aK) { var aO, aL, aM, s = 0, aV = 0, aJ, aQ, aP, aT, aS, aU; try { aO = b(aW) } catch (aN) { return } aL = aO.outerHeight(); aM = aO.outerWidth(); am.scrollTop(0); am.scrollLeft(0); while (!aO.is(".jspPane")) { s += aO.position().top; aV += aO.position().left; aO = aO.offsetParent(); if (/^body|html$/i.test(aO[0].nodeName)) { return } } aJ = aB(); aP = aJ + v; if (s < aJ || aR) { aS = s - az.verticalGutter } else { if (s + aL > aP) { aS = s - v + aL + az.verticalGutter } } if (aS) { M(aS, aK) } aQ = aD(); aT = aQ + ak; if (aV < aQ || aR) { aU = aV - az.horizontalGutter } else { if (aV + aM > aT) { aU = aV - ak + aM + az.horizontalGutter } } if (aU) { N(aU, aK) } } function aD() { return -Y.position().left } function aB() { return -Y.position().top } function K() { var s = Z - v; return (s > 20) && (s - aB() < 10) } function B() { var s = T - ak; return (s > 20) && (s - aD() < 10) } function ag() { am.unbind(ac).bind(ac, function (aM, aN, aL, aJ) { var aK = aa, s = I; Q.scrollBy(aL * az.mouseWheelSpeed, -aJ * az.mouseWheelSpeed, false); return aK == aa && s == I }) } function n() { am.unbind(ac) } function aC() { return false } function J() { Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp", function (s) { ab(s.target, false) }) } function E() { Y.find(":input,a").unbind("focus.jsp") } function S() { var s, aJ, aL = []; aF && aL.push(an[0]); aA && aL.push(U[0]); Y.focus(function () { D.focus() }); D.attr("tabindex", 0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp", function (aO) { if (aO.target !== this && !(aL.length && b(aO.target).closest(aL).length)) { return } var aN = aa, aM = I; switch (aO.keyCode) { case 40: case 38: case 34: case 32: case 33: case 39: case 37: s = aO.keyCode; aK(); break; case 35: M(Z - v); s = null; break; case 36: M(0); s = null; break } aJ = aO.keyCode == s && aN != aa || aM != I; return !aJ }).bind("keypress.jsp", function (aM) { if (aM.keyCode == s) { aK() } return !aJ }); if (az.hideFocus) { D.css("outline", "none"); if ("hideFocus" in am[0]) { D.attr("hideFocus", true) } } else { D.css("outline", ""); if ("hideFocus" in am[0]) { D.attr("hideFocus", false) } } function aK() { var aN = aa, aM = I; switch (s) { case 40: Q.scrollByY(az.keyboardSpeed, false); break; case 38: Q.scrollByY(-az.keyboardSpeed, false); break; case 34: case 32: Q.scrollByY(v * az.scrollPagePercent, false); break; case 33: Q.scrollByY(-v * az.scrollPagePercent, false); break; case 39: Q.scrollByX(az.keyboardSpeed, false); break; case 37: Q.scrollByX(-az.keyboardSpeed, false); break } aJ = aN != aa || aM != I; return aJ } } function R() { D.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp") } function C() { if (location.hash && location.hash.length > 1) { var aL, aJ, aK = escape(location.hash); try { aL = b(aK) } catch (s) { return } if (aL.length && Y.find(aK)) { if (am.scrollTop() === 0) { aJ = setInterval(function () { if (am.scrollTop() > 0) { ab(aK, true); b(document).scrollTop(am.position().top); clearInterval(aJ) } }, 50) } else { ab(aK, true); b(document).scrollTop(am.position().top) } } } } function ai() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function m() { ai(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aJ; if (s.length > 1) { aJ = s[1]; if (aJ.length > 0 && Y.find("#" + aJ).length > 0) { ab("#" + aJ, true); return false } } }) } function ao() {
                var aK, aJ, aM, aL, aN, s = false; am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp", function (aO) { var aP = aO.originalEvent.touches[0]; aK = aD(); aJ = aB(); aM = aP.pageX; aL = aP.pageY; aN = false; s = true }).bind("touchmove.jsp", function (aR) {
                    if (!s) { return } var aQ = aR.originalEvent.touches[0], aP = aa, aO = I; Q.scrollTo(aK + aM - aQ.pageX, aJ + aL - aQ.pageY); aN = aN || Math.abs(aM - aQ.pageX) > 5 || Math.abs(aL - aQ.pageY) > 5;
                    return aP == aa && aO == I
                }).bind("touchend.jsp", function (aO) { s = false }).bind("click.jsp-touchclick", function (aO) { if (aN) { aN = false; return false } })
            } function g() { var s = aB(), aJ = aD(); D.removeClass("jspScrollable").unbind(".jsp"); D.replaceWith(ap.append(Y.children())); ap.scrollTop(s); ap.scrollLeft(aJ) } b.extend(Q, { reinitialise: function (aJ) { aJ = b.extend({}, az, aJ); at(aJ) }, scrollToElement: function (aK, aJ, s) { ab(aK, aJ, s) }, scrollTo: function (aK, s, aJ) { N(aK, aJ); M(s, aJ) }, scrollToX: function (aJ, s) { N(aJ, s) }, scrollToY: function (s, aJ) { M(s, aJ) }, scrollToPercentX: function (aJ, s) { N(aJ * (T - ak), s) }, scrollToPercentY: function (aJ, s) { M(aJ * (Z - v), s) }, scrollBy: function (aJ, s, aK) { Q.scrollByX(aJ, aK); Q.scrollByY(s, aK) }, scrollByX: function (s, aK) { var aJ = aD() + Math[s < 0 ? "floor" : "ceil"](s), aL = aJ / (T - ak); W(aL * j, aK) }, scrollByY: function (s, aK) { var aJ = aB() + Math[s < 0 ? "floor" : "ceil"](s), aL = aJ / (Z - v); V(aL * i, aK) }, positionDragX: function (s, aJ) { W(s, aJ) }, positionDragY: function (aJ, s) { V(aJ, s) }, animate: function (aJ, aM, s, aL) { var aK = {}; aK[aM] = s; aJ.animate(aK, { duration: az.animateDuration, easing: az.animateEase, queue: false, step: aL }) }, getContentPositionX: function () { return aD() }, getContentPositionY: function () { return aB() }, getContentWidth: function () { return T }, getContentHeight: function () { return Z }, getPercentScrolledX: function () { return aD() / (T - ak) }, getPercentScrolledY: function () { return aB() / (Z - v) }, getIsScrollableH: function () { return aF }, getIsScrollableV: function () { return aA }, getContentPane: function () { return Y }, scrollToBottom: function (s) { V(i, s) }, hijackInternalLinks: function () { m() }, destroy: function () { g() } }); at(O)
        } e = b.extend({}, b.fn.jScrollPane.defaults, e); b.each(["mouseWheelSpeed", "arrowButtonSpeed", "trackClickSpeed", "keyboardSpeed"], function () { e[this] = e[this] || e.speed }); return this.each(function () { var f = b(this), g = f.data("jsp"); if (g) { g.reinitialise(e) } else { g = new d(f, e); f.data("jsp", g) } })
    }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, stickToBottom: false, stickToRight: false, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, contentWidth: c, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 0, arrowButtonSpeed: 0, arrowRepeatFreq: 50, arrowScrollOnHover: false, trackClickSpeed: 0, trackClickRepeatFreq: 70, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false, keyboardSpeed: 0, initialDelay: 300, speed: 30, scrollPagePercent: 0.8}
})(jQuery, this);
/************************ 6. jquery.jscrollpane.min.js ************************/

/************************ 7. jquery.autocomplete.js ************************/
/*
 * jQuery Autocomplete plugin 1.1
 *
 * Copyright (c) 2009 Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
 */

;(function($) {
	
$.fn.extend({
	autocomplete: function(urlOrData, options) {
		var isUrl = typeof urlOrData == "string";
		options = $.extend({}, $.Autocompleter.defaults, {
			url: isUrl ? urlOrData : null,
			data: isUrl ? null : urlOrData,
			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
			max: options && !options.scroll ? 10 : 150
		}, options);
		
		// if highlight is set to false, replace it with a do-nothing function
		options.highlight = options.highlight || function(value) { return value; };
		
		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
		options.formatMatch = options.formatMatch || options.formatItem;
		
		return this.each(function() {
			new $.Autocompleter(this, options);
		});
	},
	result: function(handler) {
		return this.bind("result", handler);
	},
	search: function(handler) {
		return this.trigger("search", [handler]);
	},
	flushCache: function() {
		return this.trigger("flushCache");
	},
	setOptions: function(options){
		return this.trigger("setOptions", [options]);
	},
	unautocomplete: function() {
		return this.trigger("unautocomplete");
	}
});

$.Autocompleter = function(input, options) {

	var KEY = {
		UP: 38,
		DOWN: 40,
		DEL: 46,
		TAB: 9,
		RETURN: 13,
		ESC: 27,
		COMMA: 188,
		PAGEUP: 33,
		PAGEDOWN: 34,
		BACKSPACE: 8
	};

	// Create $ object for input element
	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);

	var timeout;
	var previousValue = "";
	var cache = $.Autocompleter.Cache(options);
	var hasFocus = 0;
	var lastKeyPressCode;
	var config = {
		mouseDownOnSelect: false
	};
	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
	
	var blockSubmit;
	
	// prevent form submit in opera when selecting with return key
	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
		if (blockSubmit) {
			blockSubmit = false;
			return false;
		}
	});
	
	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
		// a keypress means the input has focus
		// avoids issue where input had focus before the autocomplete was applied
		hasFocus = 1;
		// track last key pressed
		lastKeyPressCode = event.keyCode;
		switch(event.keyCode) {
		
			case KEY.UP:
				event.preventDefault();
				if ( select.visible() ) {
					select.prev();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.DOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.next();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEUP:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageUp();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEDOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageDown();
				} else {
					onChange(0, true);
				}
				break;
			
			// matches also semicolon
			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
			case KEY.TAB:
			case KEY.RETURN:
				if( selectCurrent() ) {
					// stop default to prevent a form submit, Opera needs special handling
					event.preventDefault();
					blockSubmit = true;
					return false;
				}
				break;
				
			case KEY.ESC:
				select.hide();
				break;
				
			default:
				clearTimeout(timeout);
				timeout = setTimeout(onChange, options.delay);
				break;
		}
	}).focus(function(){
		// track whether the field has focus, we shouldn't process any
		// results if the field no longer has focus
		hasFocus++;
	}).blur(function() {
		hasFocus = 0;
		if (!config.mouseDownOnSelect) {
			hideResults();
		}
	}).click(function() {
		// show select when clicking in a focused field
		if ( hasFocus++ > 1 && !select.visible() ) {
			onChange(0, true);
		}
	}).bind("search", function() {
		// TODO why not just specifying both arguments?
		var fn = (arguments.length > 1) ? arguments[1] : null;
		function findValueCallback(q, data) {
			var result;
			if( data && data.length ) {
				for (var i=0; i < data.length; i++) {
					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
						result = data[i];
						break;
					}
				}
			}
			if( typeof fn == "function" ) fn(result);
			else $input.trigger("result", result && [result.data, result.value]);
		}
		$.each(trimWords($input.val()), function(i, value) {
			request(value, findValueCallback, findValueCallback);
		});
	}).bind("flushCache", function() {
		cache.flush();
	}).bind("setOptions", function() {
		$.extend(options, arguments[1]);
		// if we've updated the data, repopulate
		if ( "data" in arguments[1] )
			cache.populate();
	}).bind("unautocomplete", function() {
		select.unbind();
		$input.unbind();
		$(input.form).unbind(".autocomplete");
	});
	
	
	function selectCurrent() {
		var selected = select.selected();
		if( !selected )
			return false;
		
		var v = selected.result;
		previousValue = v;
		
		if ( options.multiple ) {
			var words = trimWords($input.val());
			if ( words.length > 1 ) {
				var seperator = options.multipleSeparator.length;
				var cursorAt = $(input).selection().start;
				var wordAt, progress = 0;
				$.each(words, function(i, word) {
					progress += word.length;
					if (cursorAt <= progress) {
						wordAt = i;
						return false;
					}
					progress += seperator;
				});
				words[wordAt] = v;
				// TODO this should set the cursor to the right position, but it gets overriden somewhere
				//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
				v = words.join( options.multipleSeparator );
			}
			v += options.multipleSeparator;
		}
		
		$input.val(v);
		hideResultsNow();
		$input.trigger("result", [selected.data, selected.value]);
		return true;
	}
	
	function onChange(crap, skipPrevCheck) {
		if( lastKeyPressCode == KEY.DEL ) {
			select.hide();
			return;
		}
		
		var currentValue = $input.val();
		
		if ( !skipPrevCheck && currentValue == previousValue )
			return;
		
		previousValue = currentValue;
		
		currentValue = lastWord(currentValue);
		if ( currentValue.length >= options.minChars) {
			$input.addClass(options.loadingClass);
			if (!options.matchCase)
				currentValue = currentValue.toLowerCase();
			request(currentValue, receiveData, hideResultsNow);
		} else {
			stopLoading();
			select.hide();
		}
	};
	
	function trimWords(value) {
		if (!value)
			return [""];
		if (!options.multiple)
			return [$.trim(value)];
		return $.map(value.split(options.multipleSeparator), function(word) {
			return $.trim(value).length ? $.trim(word) : null;
		});
	}
	
	function lastWord(value) {
		if ( !options.multiple )
			return value;
		var words = trimWords(value);
		if (words.length == 1) 
			return words[0];
		var cursorAt = $(input).selection().start;
		if (cursorAt == value.length) {
			words = trimWords(value)
		} else {
			words = trimWords(value.replace(value.substring(cursorAt), ""));
		}
		return words[words.length - 1];
	}
	
	// fills in the input box w/the first match (assumed to be the best match)
	// q: the term entered
	// sValue: the first matching result
	function autoFill(q, sValue){
		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
		// if the last user key pressed was backspace, don't autofill
		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
			// select the portion of the value not typed by the user (so the next character will erase)
			$(input).selection(previousValue.length, previousValue.length + sValue.length);
		}
	};

	function hideResults() {
		clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		var wasVisible = select.visible();
		select.hide();
		clearTimeout(timeout);
		stopLoading();
		if (options.mustMatch) {
			// call search and run callback
			$input.search(
				function (result){
					// if no value found, clear the input box
					if( !result ) {
						if (options.multiple) {
							var words = trimWords($input.val()).slice(0, -1);
							$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
						}
						else {
							$input.val( "" );
							$input.trigger("result", null);
						}
					}
				}
			);
		}
	};

	function receiveData(q, data) {
		if ( data && data.length && hasFocus ) {
			stopLoading();
			select.display(data, q);
			autoFill(q, data[0].value);
			select.show();
		} else {
			hideResultsNow();
		}
	};

	function request(term, success, failure) {
		if (!options.matchCase)
			term = term.toLowerCase();
		var data = cache.load(term);
		// recieve the cached data
		if (data && data.length) {
			success(term, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			
			var extraParams = {
				timestamp: +new Date()
			};
			$.each(options.extraParams, function(key, param) {
				extraParams[key] = typeof param == "function" ? param() : param;
			});
			
			$.ajax({
				// try to leverage ajaxQueue plugin to abort previous requests
				mode: "abort",
				// limit abortion to this input
				port: "autocomplete" + input.name,
				dataType: options.dataType,
				url: options.url,
				data: $.extend({
					q: lastWord(term),
					limit: options.max
				}, extraParams),
				success: function(data) {
					var parsed = options.parse && options.parse(data) || parse(data);
					cache.add(term, parsed);
					success(term, parsed);
				}
			});
		} else {
			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
			select.emptyList();
			failure(term);
		}
	};
	
	function parse(data) {
		var parsed = [];
		var rows = data;
        for (var item in rows) {
            var row = rows[item];
            if (row) {
                parsed[parsed.length] = {
					data: row,
					value: row.Name,
					result: options.formatResult && options.formatResult(row.Id, row.Name) || row.Id
				};            
            }
        }

		return parsed;
	};

	function stopLoading() {
		$input.removeClass(options.loadingClass);
	};

};

$.Autocompleter.defaults = {
	inputClass: "ac_input",
	resultsClass: "ac_results",
	loadingClass: "ac_loading",
	minChars: 1,
	delay: 400,
	matchCase: false,
	matchSubset: true,
	matchContains: false,
	cacheLength: 10,
	max: 100,
	mustMatch: false,
	extraParams: {},
	selectFirst: true,
	formatItem: function(row) { return row[0]; },
	formatMatch: null,
	autoFill: false,
	width: 0,
	multiple: false,
	multipleSeparator: ", ",
	highlight: function(value, term) {
		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
	},
    scroll: true,
    scrollHeight: 180
};

$.Autocompleter.Cache = function(options) {

	var data = {};
	var length = 0;
	
	function matchSubset(s, sub) {
		if (!options.matchCase) 
			s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (options.matchContains == "word"){
			i = s.toLowerCase().search("\\b" + sub.toLowerCase());
		}
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};
	
	function add(q, value) {
		if (length > options.cacheLength){
			flush();
		}
		if (!data[q]){ 
			length++;
		}
		data[q] = value;
	}
	
	function populate(){
		if( !options.data ) return false;
		// track the matches
		var stMatchSets = {},
			nullData = 0;

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( !options.url ) options.cacheLength = 1;
		
		// track all options for minChars = 0
		stMatchSets[""] = [];
		
		// loop through the array and create a lookup structure
		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
			var rawValue = options.data[i];
			// if rawValue is a string, make an array otherwise just reference the array
			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
			
			var value = options.formatMatch(rawValue, i+1, options.data.length);
			if ( value === false )
				continue;
				
			var firstChar = value.charAt(0).toLowerCase();
			// if no lookup array for this character exists, look it up now
			if( !stMatchSets[firstChar] ) 
				stMatchSets[firstChar] = [];

			// if the match is a string
			var row = {
				value: value,
				data: rawValue,
				result: options.formatResult && options.formatResult(rawValue) || value
			};
			
			// push the current match into the set list
			stMatchSets[firstChar].push(row);

			// keep track of minChars zero items
			if ( nullData++ < options.max ) {
				stMatchSets[""].push(row);
			}
		};

		// add the data items to the cache
		$.each(stMatchSets, function(i, value) {
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			add(i, value);
		});
	}
	
	// populate any existing data
	setTimeout(populate, 25);
	
	function flush(){
		data = {};
		length = 0;
	}
	
	return {
		flush: flush,
		add: add,
		populate: populate,
		load: function(q) {
			if (!options.cacheLength || !length)
				return null;
			/* 
			 * if dealing w/local data and matchContains than we must make sure
			 * to loop through all the data collections looking for matches
			 */
			if( !options.url && options.matchContains ){
				// track all matches
				var csub = [];
				// loop through all the data grids for matches
				for( var k in data ){
					// don't search through the stMatchSets[""] (minChars: 0) cache
					// this prevents duplicates
					if( k.length > 0 ){
						var c = data[k];
						$.each(c, function(i, x) {
							// if we've got a match, add it to the array
							if (matchSubset(x.value, q)) {
								csub.push(x);
							}
						});
					}
				}				
				return csub;
			} else 
			// if the exact item exists, use it
			if (data[q]){
				return data[q];
			} else
			if (options.matchSubset) {
				for (var i = q.length - 1; i >= options.minChars; i--) {
					var c = data[q.substr(0, i)];
					if (c) {
						var csub = [];
						$.each(c, function(i, x) {
							if (matchSubset(x.value, q)) {
								csub[csub.length] = x;
							}
						});
						return csub;
					}
				}
			}
			return null;
		}
	};
};

$.Autocompleter.Select = function (options, input, select, config) {
	var CLASSES = {
		ACTIVE: "ac_over"
	};
	
	var listItems,
		active = -1,
		data,
		term = "",
		needsInit = true,
		element,
		list;
	
	// Create results
	function init() {
		if (!needsInit)
			return;
		element = $("<div/>")
		.hide()
		.addClass(options.resultsClass)
		.css("position", "absolute")
		.appendTo(document.body);
	
		list = $("<ul/>").appendTo(element).mouseover( function(event) {
			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
			    $(target(event)).addClass(CLASSES.ACTIVE);            
	        }
		}).click(function(event) {
			$(target(event)).addClass(CLASSES.ACTIVE);
			select();
			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
			input.focus();
			return false;
		}).mousedown(function() {
			config.mouseDownOnSelect = true;
		}).mouseup(function() {
			config.mouseDownOnSelect = false;
		});
		
		if( options.width > 0 )
			element.css("width", options.width);
			
		needsInit = false;
	} 
	
	function target(event) {
		var element = event.target;
		while(element && element.tagName != "LI")
			element = element.parentNode;
		// more fun with IE, sometimes event.target is empty, just ignore it then
		if(!element)
			return [];
		return element;
	}

	function moveSelect(step) {
		listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
		movePosition(step);
        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
        if(options.scroll) {
            var offset = 0;
            listItems.slice(0, active).each(function() {
				offset += this.offsetHeight;
			});
            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
            } else if(offset < list.scrollTop()) {
                list.scrollTop(offset);
            }
        }
	};
	
	function movePosition(step) {
		active += step;
		if (active < 0) {
			active = listItems.size() - 1;
		} else if (active >= listItems.size()) {
			active = 0;
		}
	}
	
	function limitNumberOfItems(available) {
		return options.max && options.max < available
			? options.max
			: available;
	}
	
	function fillList() {
		list.empty();
		var max = limitNumberOfItems(data.length);
		for (var i=0; i < max; i++) {
			if (!data[i])
				continue;
			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
			if ( formatted === false )
				continue;
			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
			$.data(li, "ac_data", data[i]);
		}
		listItems = list.find("li");
		if ( options.selectFirst ) {
			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
			active = 0;
		}
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			list.bgiframe();
	}
	
	return {
		display: function(d, q) {
			init();
			data = d;
			term = q;
			fillList();
		},
		next: function() {
			moveSelect(1);
		},
		prev: function() {
			moveSelect(-1);
		},
		pageUp: function() {
			if (active != 0 && active - 8 < 0) {
				moveSelect( -active );
			} else {
				moveSelect(-8);
			}
		},
		pageDown: function() {
			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
				moveSelect( listItems.size() - 1 - active );
			} else {
				moveSelect(8);
			}
		},
		hide: function() {
			element && element.hide();
			listItems && listItems.removeClass(CLASSES.ACTIVE);
			active = -1;
		},
		visible : function() {
			return element && element.is(":visible");
		},
		current: function() {
			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
		},
		show: function() {
			var offset = $(input).offset(),
                inputItem = $("#dialog .list").offset(),
                leftLay = ($("#dialog .list").length>0)?inputItem.left:offset.left;

			element.css({
				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
				top: offset.top + input.offsetHeight,
				left: leftLay
			}).show();
            if(options.scroll) {
                list.scrollTop(0);
                list.css({
					maxHeight: options.scrollHeight,
					overflow: 'auto'
				});
				
                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
					var listHeight = 0;
					listItems.each(function() {
						listHeight += this.offsetHeight;
					});
					var scrollbarsVisible = listHeight > options.scrollHeight;
                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
					if (!scrollbarsVisible) {
						// IE doesn't recalculate width when scrollbar disappears
						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
					}
                }
                
            }
		},
		selected: function() {
			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
			return selected && selected.length && $.data(selected[0], "ac_data");
		},
		emptyList: function (){
			list && list.empty();
		},
		unbind: function() {
			element && element.remove();
		}
	};
};

$.fn.selection = function(start, end) {
	if (start !== undefined) {
		return this.each(function() {
			if( this.createTextRange ){
				var selRange = this.createTextRange();
				if (end === undefined || start == end) {
					selRange.move("character", start);
					selRange.select();
				} else {
					selRange.collapse(true);
					selRange.moveStart("character", start);
					selRange.moveEnd("character", end);
					selRange.select();
				}
			} else if( this.setSelectionRange ){
				this.setSelectionRange(start, end);
			} else if( this.selectionStart ){
				this.selectionStart = start;
				this.selectionEnd = end;
			}
		});
	}
	var field = this[0];
	if ( field.createTextRange ) {
		var range = document.selection.createRange(),
			orig = field.value,
			teststring = "<->",
			textLength = range.text.length;
		range.text = teststring;
		var caretAt = field.value.indexOf(teststring);
		field.value = orig;
		this.selection(caretAt, caretAt + textLength);
		return {
			start: caretAt,
			end: caretAt + textLength
		}
	} else if( field.selectionStart !== undefined ){
		return {
			start: field.selectionStart,
			end: field.selectionEnd
		}
	}
};

})(jQuery);
/************************ 7. jquery.autocomplete.js ************************/

/************************ 8. jquery.ui.core.js ************************/
/*!
 * jQuery UI 1.8.9
 *
 * 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( $, undefined ) {

// prevent duplicate loading
// this is only a problem because we proxy existing functions
// and we don't want to double proxy them
$.ui = $.ui || {};
if ( $.ui.version ) {
	return;
}

$.extend( $.ui, {
	version: "1.8.9",

	keyCode: {
		ALT: 18,
		BACKSPACE: 8,
		CAPS_LOCK: 20,
		COMMA: 188,
		COMMAND: 91,
		COMMAND_LEFT: 91, // COMMAND
		COMMAND_RIGHT: 93,
		CONTROL: 17,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		INSERT: 45,
		LEFT: 37,
		MENU: 93, // COMMAND_RIGHT
		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 // COMMAND
	}
});

// plugins
$.fn.extend({
	_focus: $.fn.focus,
	focus: function( delay, fn ) {
		return typeof delay === "number" ?
			this.each(function() {
				var elem = this;
				setTimeout(function() {
					$( elem ).focus();
					if ( fn ) {
						fn.call( elem );
					}
				}, delay );
			}) :
			this._focus.apply( this, arguments );
	},

	scrollParent: function() {
		var scrollParent;
		if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
			scrollParent = this.parents().filter(function() {
				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		} else {
			scrollParent = this.parents().filter(function() {
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		}

		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
	},

	zIndex: function( zIndex ) {
		if ( zIndex !== undefined ) {
			return this.css( "zIndex", zIndex );
		}

		if ( this.length ) {
			var elem = $( this[ 0 ] ), position, value;
			while ( elem.length && elem[ 0 ] !== document ) {
				// Ignore z-index if position is set to a value where z-index is ignored by the browser
				// This makes behavior of this function consistent across browsers
				// WebKit always returns auto if the element is positioned
				position = elem.css( "position" );
				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
					// IE returns 0 when zIndex is not specified
					// other browsers return a string
					// we ignore the case of nested elements with an explicit value of 0
					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
					value = parseInt( elem.css( "zIndex" ), 10 );
					if ( !isNaN( value ) && value !== 0 ) {
						return value;
					}
				}
				elem = elem.parent();
			}
		}

		return 0;
	},

	disableSelection: function() {
		return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
			".ui-disableSelection", function( event ) {
				event.preventDefault();
			});
	},

	enableSelection: function() {
		return this.unbind( ".ui-disableSelection" );
	}
});

$.each( [ "Width", "Height" ], function( i, name ) {
	var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
		type = name.toLowerCase(),
		orig = {
			innerWidth: $.fn.innerWidth,
			innerHeight: $.fn.innerHeight,
			outerWidth: $.fn.outerWidth,
			outerHeight: $.fn.outerHeight
		};

	function reduce( elem, size, border, margin ) {
		$.each( side, function() {
			size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
			if ( border ) {
				size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
			}
			if ( margin ) {
				size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
			}
		});
		return size;
	}

	$.fn[ "inner" + name ] = function( size ) {
		if ( size === undefined ) {
			return orig[ "inner" + name ].call( this );
		}

		return this.each(function() {
			$( this ).css( type, reduce( this, size ) + "px" );
		});
	};

	$.fn[ "outer" + name] = function( size, margin ) {
		if ( typeof size !== "number" ) {
			return orig[ "outer" + name ].call( this, size );
		}

		return this.each(function() {
			$( this).css( type, reduce( this, size, true, margin ) + "px" );
		});
	};
});

// selectors
function visible( element ) {
	return !$( element ).parents().andSelf().filter(function() {
		return $.curCSS( this, "visibility" ) === "hidden" ||
			$.expr.filters.hidden( this );
	}).length;
}

$.extend( $.expr[ ":" ], {
	data: function( elem, i, match ) {
		return !!$.data( elem, match[ 3 ] );
	},

	focusable: function( element ) {
		var nodeName = element.nodeName.toLowerCase(),
			tabIndex = $.attr( element, "tabindex" );
		if ( "area" === nodeName ) {
			var map = element.parentNode,
				mapName = map.name,
				img;
			if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
				return false;
			}
			img = $( "img[usemap=#" + mapName + "]" )[0];
			return !!img && visible( img );
		}
		return ( /input|select|textarea|button|object/.test( nodeName )
			? !element.disabled
			: "a" == nodeName
				? element.href || !isNaN( tabIndex )
				: !isNaN( tabIndex ))
			// the element and all of its ancestors must be visible
			&& visible( element );
	},

	tabbable: function( element ) {
		var tabIndex = $.attr( element, "tabindex" );
		return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" );
	}
});

// support
$(function() {
	var body = document.body,
		div = body.appendChild( div = document.createElement( "div" ) );

	$.extend( div.style, {
		minHeight: "100px",
		height: "auto",
		padding: 0,
		borderWidth: 0
	});

	$.support.minHeight = div.offsetHeight === 100;
	$.support.selectstart = "onselectstart" in div;

	// set display to none to avoid a layout bug in IE
	// http://dev.jquery.com/ticket/4014
	body.removeChild( div ).style.display = "none";
});





// deprecated
$.extend( $.ui, {
	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
	plugin: {
		add: function( module, option, set ) {
			var proto = $.ui[ module ].prototype;
			for ( var i in set ) {
				proto.plugins[ i ] = proto.plugins[ i ] || [];
				proto.plugins[ i ].push( [ option, set[ i ] ] );
			}
		},
		call: function( instance, name, args ) {
			var set = instance.plugins[ name ];
			if ( !set || !instance.element[ 0 ].parentNode ) {
				return;
			}
	
			for ( var i = 0; i < set.length; i++ ) {
				if ( instance.options[ set[ i ][ 0 ] ] ) {
					set[ i ][ 1 ].apply( instance.element, args );
				}
			}
		}
	},
	
	// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
	contains: function( a, b ) {
		return document.compareDocumentPosition ?
			a.compareDocumentPosition( b ) & 16 :
			a !== b && a.contains( b );
	},
	
	// only used by resizable
	hasScroll: function( el, a ) {
	
		//If overflow is hidden, the element might have extra content, but the user wants to hide it
		if ( $( el ).css( "overflow" ) === "hidden") {
			return false;
		}
	
		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
			has = false;
	
		if ( el[ scroll ] > 0 ) {
			return true;
		}
	
		// TODO: determine which cases actually cause this to happen
		// if the element doesn't have the scroll set, see if it's possible to
		// set the scroll
		el[ scroll ] = 1;
		has = ( el[ scroll ] > 0 );
		el[ scroll ] = 0;
		return has;
	},
	
	// these are odd functions, fix the API or move into individual plugins
	isOverAxis: function( x, reference, size ) {
		//Determines when x coordinate is over "b" element axis
		return ( x > reference ) && ( x < ( reference + size ) );
	},
	isOver: function( y, x, top, left, height, width ) {
		//Determines when x, y coordinates is over "b" element
		return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
	}
});

})( jQuery );

/************************ 8. jquery.ui.core.js ************************/

/************************ 9. jquery.ui.widget.js ************************/
/*!
 * jQuery UI Widget 1.8.9
 *
 * 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( $, undefined ) {

// jQuery 1.4+
if ( $.cleanData ) {
	var _cleanData = $.cleanData;
	$.cleanData = function( elems ) {
		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
			$( elem ).triggerHandler( "remove" );
		}
		_cleanData( elems );
	};
} else {
	var _remove = $.fn.remove;
	$.fn.remove = function( selector, keepData ) {
		return this.each(function() {
			if ( !keepData ) {
				if ( !selector || $.filter( selector, [ this ] ).length ) {
					$( "*", this ).add( [ this ] ).each(function() {
						$( this ).triggerHandler( "remove" );
					});
				}
			}
			return _remove.call( $(this), selector, keepData );
		});
	};
}

$.widget = function( name, base, prototype ) {
	var namespace = name.split( "." )[ 0 ],
		fullName;
	name = name.split( "." )[ 1 ];
	fullName = namespace + "-" + name;

	if ( !prototype ) {
		prototype = base;
		base = $.Widget;
	}

	// create selector for plugin
	$.expr[ ":" ][ fullName ] = function( elem ) {
		return !!$.data( elem, name );
	};

	$[ namespace ] = $[ namespace ] || {};
	$[ namespace ][ name ] = function( options, element ) {
		// allow instantiation without initializing for simple inheritance
		if ( arguments.length ) {
			this._createWidget( options, element );
		}
	};

	var basePrototype = new base();
	// we need to make the options hash a property directly on the new instance
	// otherwise we'll modify the options hash on the prototype that we're
	// inheriting from
//	$.each( basePrototype, function( key, val ) {
//		if ( $.isPlainObject(val) ) {
//			basePrototype[ key ] = $.extend( {}, val );
//		}
//	});
	basePrototype.options = $.extend( true, {}, basePrototype.options );
	$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
		namespace: namespace,
		widgetName: name,
		widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
		widgetBaseClass: fullName
	}, prototype );

	$.widget.bridge( name, $[ namespace ][ name ] );
};

$.widget.bridge = function( name, object ) {
	$.fn[ name ] = function( options ) {
		var isMethodCall = typeof options === "string",
			args = Array.prototype.slice.call( arguments, 1 ),
			returnValue = this;

		// allow multiple hashes to be passed on init
		options = !isMethodCall && args.length ?
			$.extend.apply( null, [ true, options ].concat(args) ) :
			options;

		// prevent calls to internal methods
		if ( isMethodCall && options.charAt( 0 ) === "_" ) {
			return returnValue;
		}

		if ( isMethodCall ) {
			this.each(function() {
				var instance = $.data( this, name ),
					methodValue = instance && $.isFunction( instance[options] ) ?
						instance[ options ].apply( instance, args ) :
						instance;
				// TODO: add this back in 1.9 and use $.error() (see #5972)
//				if ( !instance ) {
//					throw "cannot call methods on " + name + " prior to initialization; " +
//						"attempted to call method '" + options + "'";
//				}
//				if ( !$.isFunction( instance[options] ) ) {
//					throw "no such method '" + options + "' for " + name + " widget instance";
//				}
//				var methodValue = instance[ options ].apply( instance, args );
				if ( methodValue !== instance && methodValue !== undefined ) {
					returnValue = methodValue;
					return false;
				}
			});
		} else {
			this.each(function() {
				var instance = $.data( this, name );
				if ( instance ) {
					instance.option( options || {} )._init();
				} else {
					$.data( this, name, new object( options, this ) );
				}
			});
		}

		return returnValue;
	};
};

$.Widget = function( options, element ) {
	// allow instantiation without initializing for simple inheritance
	if ( arguments.length ) {
		this._createWidget( options, element );
	}
};

$.Widget.prototype = {
	widgetName: "widget",
	widgetEventPrefix: "",
	options: {
		disabled: false
	},
	_createWidget: function( options, element ) {
		// $.widget.bridge stores the plugin instance, but we do it anyway
		// so that it's stored even before the _create function runs
		$.data( element, this.widgetName, this );
		this.element = $( element );
		this.options = $.extend( true, {},
			this.options,
			this._getCreateOptions(),
			options );

		var self = this;
		this.element.bind( "remove." + this.widgetName, function() {
			self.destroy();
		});

		this._create();
		this._trigger( "create" );
		this._init();
	},
	_getCreateOptions: function() {
		return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
	},
	_create: function() {},
	_init: function() {},

	destroy: function() {
		this.element
			.unbind( "." + this.widgetName )
			.removeData( this.widgetName );
		this.widget()
			.unbind( "." + this.widgetName )
			.removeAttr( "aria-disabled" )
			.removeClass(
				this.widgetBaseClass + "-disabled " +
				"ui-state-disabled" );
	},

	widget: function() {
		return this.element;
	},

	option: function( key, value ) {
		var options = key;

		if ( arguments.length === 0 ) {
			// don't return a reference to the internal hash
			return $.extend( {}, this.options );
		}

		if  (typeof key === "string" ) {
			if ( value === undefined ) {
				return this.options[ key ];
			}
			options = {};
			options[ key ] = value;
		}

		this._setOptions( options );

		return this;
	},
	_setOptions: function( options ) {
		var self = this;
		$.each( options, function( key, value ) {
			self._setOption( key, value );
		});

		return this;
	},
	_setOption: function( key, value ) {
		this.options[ key ] = value;

		if ( key === "disabled" ) {
			this.widget()
				[ value ? "addClass" : "removeClass"](
					this.widgetBaseClass + "-disabled" + " " +
					"ui-state-disabled" )
				.attr( "aria-disabled", value );
		}

		return this;
	},

	enable: function() {
		return this._setOption( "disabled", false );
	},
	disable: function() {
		return this._setOption( "disabled", true );
	},

	_trigger: function( type, event, data ) {
		var callback = this.options[ type ];

		event = $.Event( event );
		event.type = ( type === this.widgetEventPrefix ?
			type :
			this.widgetEventPrefix + type ).toLowerCase();
		data = data || {};

		// copy original event properties over to the new event
		// this would happen if we could call $.event.fix instead of $.Event
		// but we don't have a way to force an event to be fixed multiple times
		if ( event.originalEvent ) {
			for ( var i = $.event.props.length, prop; i; ) {
				prop = $.event.props[ --i ];
				event[ prop ] = event.originalEvent[ prop ];
			}
		}

		this.element.trigger( event, data );

		return !( $.isFunction(callback) &&
			callback.call( this.element[0], event, data ) === false ||
			event.isDefaultPrevented() );
	}
};

})( jQuery );

/************************ 9. jquery.ui.widget.js ************************/

/************************ 10. jquery.ui.mouse.js ************************/
/*!
 * jQuery UI Mouse 1.8.9
 *
 * 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( $, undefined ) {

$.widget("ui.mouse", {
	options: {
		cancel: ':input,option',
		distance: 1,
		delay: 0
	},
	_mouseInit: function() {
		var self = this;

		this.element
			.bind('mousedown.'+this.widgetName, function(event) {
				return self._mouseDown(event);
			})
			.bind('click.'+this.widgetName, function(event) {
				if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
				    $.removeData(event.target, self.widgetName + '.preventClickEvent');
					event.stopImmediatePropagation();
					return false;
				}
			});

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);
	},

	_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		// TODO: figure out why we have to use originalEvent
		event.originalEvent = event.originalEvent || {};
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if (!this.mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self.mouseDelayMet = true;
			}, this.options.delay);
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted = (this._mouseStart(event) !== false);
			if (!this._mouseStarted) {
				event.preventDefault();
				return true;
			}
		}

		// these delegates are required to keep context
		this._mouseMoveDelegate = function(event) {
			return self._mouseMove(event);
		};
		this._mouseUpDelegate = function(event) {
			return self._mouseUp(event);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		event.preventDefault();
		event.originalEvent.mouseHandled = true;
		return true;
	},

	_mouseMove: function(event) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
			return this._mouseUp(event);
		}

		if (this._mouseStarted) {
			this._mouseDrag(event);
			return event.preventDefault();
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted =
				(this._mouseStart(this._mouseDownEvent, event) !== false);
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
		}

		return !this._mouseStarted;
	},

	_mouseUp: function(event) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		if (this._mouseStarted) {
			this._mouseStarted = false;

			if (event.target == this._mouseDownEvent.target) {
			    $.data(event.target, this.widgetName + '.preventClickEvent', true);
			}

			this._mouseStop(event);
		}

		return false;
	},

	_mouseDistanceMet: function(event) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function(event) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function(event) {},
	_mouseDrag: function(event) {},
	_mouseStop: function(event) {},
	_mouseCapture: function(event) { return true; }
});

})(jQuery);

/************************ 10. jquery.ui.mouse.js ************************/

/************************ 11. jquery.ui.slider.js ************************/
/*
 * jQuery UI Slider 1.8.9
 *
 * 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/Slider
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function( $, undefined ) {

// number of pages in a slider
// (how many times can you page up/down to go through the whole range)
var numPages = 5;

$.widget( "ui.slider", $.ui.mouse, {

	widgetEventPrefix: "slide",

	options: {
		animate: false,
		distance: 0,
		max: 100,
		min: 0,
		orientation: "horizontal",
		range: false,
		step: 1,
		value: 0,
		values: null
	},

	_create: function() {
		var self = this,
			o = this.options;

		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" );
		
		if ( o.disabled ) {
			this.element.addClass( "ui-slider-disabled ui-disabled" );
		}

		this.range = $([]);

		if ( o.range ) {
			if ( o.range === true ) {
				this.range = $( "<div></div>" );
				if ( !o.values ) {
					o.values = [ this._valueMin(), this._valueMin() ];
				}
				if ( o.values.length && o.values.length !== 2 ) {
					o.values = [ o.values[0], o.values[0] ];
				}
			} else {
				this.range = $( "<div></div>" );
			}

			this.range
				.appendTo( this.element )
				.addClass( "ui-slider-range" );

			if ( o.range === "min" || o.range === "max" ) {
				this.range.addClass( "ui-slider-range-" + o.range );
			}

			// note: this isn't the most fittingly semantic framework class for this element,
			// but worked best visually with a variety of themes
			this.range.addClass( "ui-widget-header" );
		}

		if ( $( ".ui-slider-handle", this.element ).length === 0 ) {
			$( "<a href='#'></a>" )
				.appendTo( this.element )
				.addClass( "ui-slider-handle" );
		}

		if ( o.values && o.values.length ) {
			while ( $(".ui-slider-handle", this.element).length < o.values.length ) {
				$( "<a href='#'></a>" )
					.appendTo( this.element )
					.addClass( "ui-slider-handle" );
			}
		}

		this.handles = $( ".ui-slider-handle", this.element )
			.addClass( "ui-state-default" +
				" ui-corner-all" );

		this.handle = this.handles.eq( 0 );

		this.handles.add( this.range ).filter( "a" )
			.click(function( event ) {
				event.preventDefault();
			})
			.hover(function() {
				if ( !o.disabled ) {
					$( this ).addClass( "ui-state-hover" );
				}
			}, function() {
				$( this ).removeClass( "ui-state-hover" );
			})
			.focus(function() {
				if ( !o.disabled ) {
					$( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
					$( this ).addClass( "ui-state-focus" );
				} else {
					$( this ).blur();
				}
			})
			.blur(function() {
				$( this ).removeClass( "ui-state-focus" );
			});

		this.handles.each(function( i ) {
			$( this ).data( "index.ui-slider-handle", i );
		});

		this.handles
			.keydown(function( event ) {
				var ret = true,
					index = $( this ).data( "index.ui-slider-handle" ),
					allowed,
					curVal,
					newVal,
					step;
	
				if ( self.options.disabled ) {
					return;
				}
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_UP:
					case $.ui.keyCode.PAGE_DOWN:
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						ret = false;
						if ( !self._keySliding ) {
							self._keySliding = true;
							$( this ).addClass( "ui-state-active" );
							allowed = self._start( event, index );
							if ( allowed === false ) {
								return;
							}
						}
						break;
				}
	
				step = self.options.step;
				if ( self.options.values && self.options.values.length ) {
					curVal = newVal = self.values( index );
				} else {
					curVal = newVal = self.value();
				}
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
						newVal = self._valueMin();
						break;
					case $.ui.keyCode.END:
						newVal = self._valueMax();
						break;
					case $.ui.keyCode.PAGE_UP:
						newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
						break;
					case $.ui.keyCode.PAGE_DOWN:
						newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
						break;
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
						if ( curVal === self._valueMax() ) {
							return;
						}
						newVal = self._trimAlignValue( curVal + step );
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						if ( curVal === self._valueMin() ) {
							return;
						}
						newVal = self._trimAlignValue( curVal - step );
						break;
				}
	
				self._slide( event, index, newVal );
	
				return ret;
	
			})
			.keyup(function( event ) {
				var index = $( this ).data( "index.ui-slider-handle" );
	
				if ( self._keySliding ) {
					self._keySliding = false;
					self._stop( event, index );
					self._change( event, index );
					$( 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( event ) {
		var o = this.options,
			position,
			normValue,
			distance,
			closestHandle,
			self,
			index,
			allowed,
			offset,
			mouseOverHandle;

		if ( o.disabled ) {
			return false;
		}

		this.elementSize = {
			width: this.element.outerWidth(),
			height: this.element.outerHeight()
		};
		this.elementOffset = this.element.offset();

		position = { x: event.pageX, y: event.pageY };
		normValue = this._normValueFromMouse( position );
		distance = this._valueMax() - this._valueMin() + 1;
		self = this;
		this.handles.each(function( i ) {
			var thisDistance = Math.abs( normValue - self.values(i) );
			if ( distance > thisDistance ) {
				distance = thisDistance;
				closestHandle = $( this );
				index = i;
			}
		});

		// workaround for bug #3736 (if both handles of a range are at 0,
		// the first is always used as the one with least distance,
		// and moving it is obviously prevented by preventing negative ranges)
		if( o.range === true && this.values(1) === o.min ) {
			index += 1;
			closestHandle = $( this.handles[index] );
		}

		allowed = this._start( event, index );
		if ( allowed === false ) {
			return false;
		}
		this._mouseSliding = true;

		self._handleIndex = index;

		closestHandle
			.addClass( "ui-state-active" )
			.focus();
		
		offset = closestHandle.offset();
		mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
			top: event.pageY - offset.top -
				( closestHandle.height() / 2 ) -
				( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
				( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
				( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
		};

		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
			this._slide( event, index, normValue );
		}
		this._animateOff = true;
		return true;
	},

	_mouseStart: function( event ) {
		return true;
	},

	_mouseDrag: function( event ) {
		var position = { x: event.pageX, y: event.pageY },
			normValue = this._normValueFromMouse( position );
		
		this._slide( event, this._handleIndex, normValue );

		return false;
	},

	_mouseStop: function( event ) {
		this.handles.removeClass( "ui-state-active" );
		this._mouseSliding = false;

		this._stop( event, this._handleIndex );
		this._change( event, 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( position ) {
		var pixelTotal,
			pixelMouse,
			percentMouse,
			valueTotal,
			valueMouse;

		if ( this.orientation === "horizontal" ) {
			pixelTotal = this.elementSize.width;
			pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
		} else {
			pixelTotal = this.elementSize.height;
			pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
		}

		percentMouse = ( pixelMouse / pixelTotal );
		if ( percentMouse > 1 ) {
			percentMouse = 1;
		}
		if ( percentMouse < 0 ) {
			percentMouse = 0;
		}
		if ( this.orientation === "vertical" ) {
			percentMouse = 1 - percentMouse;
		}

		valueTotal = this._valueMax() - this._valueMin();
		valueMouse = this._valueMin() + percentMouse * valueTotal;

		return this._trimAlignValue( valueMouse );
	},

	_start: function( event, index ) {
		var uiHash = {
			handle: this.handles[ index ],
			value: this.value()
		};
		if ( this.options.values && this.options.values.length ) {
			uiHash.value = this.values( index );
			uiHash.values = this.values();
		}
		return this._trigger( "start", event, uiHash );
	},

	_slide: function( event, index, newVal ) {
		var otherVal,
			newValues,
			allowed;

		if ( this.options.values && this.options.values.length ) {
			otherVal = this.values( index ? 0 : 1 );

			if ( ( this.options.values.length === 2 && this.options.range === true ) && 
					( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
				) {
				newVal = otherVal;
			}

			if ( newVal !== this.values( index ) ) {
				newValues = this.values();
				newValues[ index ] = newVal;
				// A slide can be canceled by returning false from the slide callback
				allowed = this._trigger( "slide", event, {
					handle: this.handles[ index ],
					value: newVal,
					values: newValues
				} );
				otherVal = this.values( index ? 0 : 1 );
				if ( allowed !== false ) {
					this.values( index, newVal, true );
				}
			}
		} else {
			if ( newVal !== this.value() ) {
				// A slide can be canceled by returning false from the slide callback
				allowed = this._trigger( "slide", event, {
					handle: this.handles[ index ],
					value: newVal
				} );
				if ( allowed !== false ) {
					this.value( newVal );
				}
			}
		}
	},

	_stop: function( event, index ) {
		var uiHash = {
			handle: this.handles[ index ],
			value: this.value()
		};
		if ( this.options.values && this.options.values.length ) {
			uiHash.value = this.values( index );
			uiHash.values = this.values();
		}

		this._trigger( "stop", event, uiHash );
	},

	_change: function( event, index ) {
		if ( !this._keySliding && !this._mouseSliding ) {
			var uiHash = {
				handle: this.handles[ index ],
				value: this.value()
			};
			if ( this.options.values && this.options.values.length ) {
				uiHash.value = this.values( index );
				uiHash.values = this.values();
			}

			this._trigger( "change", event, uiHash );
		}
	},

	value: function( newValue ) {
		if ( arguments.length ) {
			this.options.value = this._trimAlignValue( newValue );
			this._refreshValue();
			this._change( null, 0 );
		}

		return this._value();
	},

	values: function( index, newValue ) {
		var vals,
			newValues,
			i;

		if ( arguments.length > 1 ) {
			this.options.values[ index ] = this._trimAlignValue( newValue );
			this._refreshValue();
			this._change( null, index );
		}

		if ( arguments.length ) {
			if ( $.isArray( arguments[ 0 ] ) ) {
				vals = this.options.values;
				newValues = arguments[ 0 ];
				for ( i = 0; i < vals.length; i += 1 ) {
					vals[ i ] = this._trimAlignValue( newValues[ i ] );
					this._change( null, i );
				}
				this._refreshValue();
			} else {
				if ( this.options.values && this.options.values.length ) {
					return this._values( index );
				} else {
					return this.value();
				}
			}
		} else {
			return this._values();
		}
	},

	_setOption: function( key, value ) {
		var i,
			valsLength = 0;

		if ( $.isArray( this.options.values ) ) {
			valsLength = this.options.values.length;
		}

		$.Widget.prototype._setOption.apply( this, arguments );

		switch ( key ) {
			case "disabled":
				if ( value ) {
					this.handles.filter( ".ui-state-focus" ).blur();
					this.handles.removeClass( "ui-state-hover" );
					this.handles.attr( "disabled", "disabled" );
					this.element.addClass( "ui-disabled" );
				} else {
					this.handles.removeAttr( "disabled" );
					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 ( i = 0; i < valsLength; i += 1 ) {
					this._change( null, i );
				}
				this._animateOff = false;
				break;
		}
	},

	//internal value getter
	// _value() returns value trimmed by min and max, aligned by step
	_value: function() {
		var val = this.options.value;
		val = this._trimAlignValue( val );

		return val;
	},

	//internal values getter
	// _values() returns array of values trimmed by min and max, aligned by step
	// _values( index ) returns single value trimmed by min and max, aligned by step
	_values: function( index ) {
		var val,
			vals,
			i;

		if ( arguments.length ) {
			val = this.options.values[ index ];
			val = this._trimAlignValue( val );

			return val;
		} else {
			// .slice() creates a copy of the array
			// this copy gets trimmed by min and max and then returned
			vals = this.options.values.slice();
			for ( i = 0; i < vals.length; i+= 1) {
				vals[ i ] = this._trimAlignValue( vals[ i ] );
			}

			return vals;
		}
	},
	
	// returns the step-aligned value that val is closest to, between (inclusive) min and max
	_trimAlignValue: function( val ) {
		if ( val <= this._valueMin() ) {
			return this._valueMin();
		}
		if ( val >= this._valueMax() ) {
			return this._valueMax();
		}
		var step = ( this.options.step > 0 ) ? this.options.step : 1,
			valModStep = (val - this._valueMin()) % step;
			alignValue = val - valModStep;

		if ( Math.abs(valModStep) * 2 >= step ) {
			alignValue += ( valModStep > 0 ) ? step : ( -step );
		}

		// Since JavaScript has problems with large floats, round
		// the final value to 5 digits after the decimal point (see #4124)
		return parseFloat( alignValue.toFixed(5) );
	},

	_valueMin: function() {
		return this.options.min;
	},

	_valueMax: function() {
		return this.options.max;
	},
	
	_refreshValue: function() {
		var oRange = this.options.range,
			o = this.options,
			self = this,
			animate = ( !this._animateOff ) ? o.animate : false,
			valPercent,
			_set = {},
			lastValPercent,
			value,
			valueMin,
			valueMax;

		if ( this.options.values && this.options.values.length ) {
			this.handles.each(function( i, j ) {
				valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
				_set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
				if ( self.options.range === true ) {
					if ( self.orientation === "horizontal" ) {
						if ( i === 0 ) {
							self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
						}
						if ( i === 1 ) {
							self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
						}
					} else {
						if ( i === 0 ) {
							self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
						}
						if ( i === 1 ) {
							self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
						}
					}
				}
				lastValPercent = valPercent;
			});
		} else {
			value = this.value();
			valueMin = this._valueMin();
			valueMax = this._valueMax();
			valPercent = ( valueMax !== valueMin ) ?
					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
					0;
			_set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );

			if ( oRange === "min" && this.orientation === "horizontal" ) {
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
			}
			if ( oRange === "max" && this.orientation === "horizontal" ) {
				this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
			}
			if ( oRange === "min" && this.orientation === "vertical" ) {
				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
			}
			if ( oRange === "max" && this.orientation === "vertical" ) {
				this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
			}
		}
	}

});

$.extend( $.ui.slider, {
	version: "1.8.9"
});

}(jQuery));

/************************ 11. jquery.ui.slider.js ************************/

/************************ 12. jquery.textshadow.js ************************/
/* Created by Martin Hintzmann 2008 martin [a] hintzmann.dk
 * MIT (http://www.opensource.org/licenses/mit-license.php) licensed.
 *
 * Version: 0.2
 * Requires: jQuery 1.2+
 * http://plugins.jquery.com/project/textshadow
 *
 */
(function($) {
	$.fn.textShadow = function(option) {
		if (!$.browser.msie) return;
		var IE6 = $.browser.version < 7;
		return this.each(function() {
			var el = $(this);
			var shadow = el.textShadowParse(this.currentStyle["text-shadow"]);
			shadow = $.extend(shadow, option);

			el.textShadowRemove();

			if (shadow.x == 0 && shadow.y == 0 && shadow.radius == 0) return;

			if (el.css("position")=="static") {
				el.css({position:"relative"});
			}
			el.css({zIndex:"0"});
			if (IE6) {
				el.css({zoom:"1"});
			}
			
			var span=document.createElement("span");
			$(span).addClass("jQueryTextShadow");
			$(span).html(el.html());
			$(span).css({
				padding:		this.currentStyle["padding"],	
				width:		el.width(),
				position:	"absolute",
				zIndex:		"-1",
				opacity:  ".80",
				color:		shadow.color!=null?shadow.color:el.css("color"),
				left:			(-parseInt(shadow.radius)+parseInt(shadow.x))+"px",
				top:			(-parseInt(shadow.radius)+parseInt(shadow.y))+"px"
			});
			
			if (shadow.radius != 0) {
				if (shadow.opacity != null) {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true', makeShadow='true', ShadowOpacity="+shadow.opacity+")");
				} else {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true')");
				}
			}	
			el.append(span);
		
	  });
	};
	
	$.fn.textShadowParse = function(value) 
	{
		value = String(value)
			.replace(/^\s+|\s+$/gi, '')
			.replace(/\s*!\s*important/i, '')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3/$4)')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3)')
	
		var shadow = {
			x      : 0,
			y      : 0,
			radius : 0,
			color  : null
		};

		if (value.length > 1 || value[0].toLowerCase() != 'none') {
			value = value.replace(/\//g, ',');
			var color;
			if ( value.match(/(\#[0-9a-f]{6}|\#[0-9a-f]{3}|(rgb|hsb)a?\([^\)]*\)|\b[a-z]+\b)/i) && (color = RegExp.$1) ) {
				shadow.color = color.replace(/^\s+/, '');
				value = value.replace(shadow.color, '');
			}

			value = value
				.replace(/^\s+|\s+$/g, '')
				.split(/\s+/)
				.map(function(item) {
						return (item || '').replace(/^0[a-z]*$/, '') ? item : 0 ;
					});

			switch (value.length)
			{
				case 1:
					shadow.x = shadow.y = value[0];
					break;
				case 2:
					shadow.x = value[0];
					shadow.y = value[1];
					break;
				case 3:
					shadow.x = value[0];
					shadow.y = value[1];
					shadow.radius = value[2];
					break;
			}
			if ((!shadow.x && !shadow.y && !shadow.radius) || shadow.color == 'transparent') {
				shadow.x = shadow.y = shadow.radius = 0;
				shadow.color = null;
			}
		}

		return shadow;
	};

	$.fn.textShadowRemove = function() {
		if (!$.browser.msie) return;
		return this.each(function() {
			$(this).children("span.jQueryTextShadow").remove();
		});
	};
})(jQuery);

if(typeof Array.prototype.map == 'undefined') {
	Array.prototype.map = function(fnc) {
		var a = new Array(this.length);
		for (var i = 0; i < this.length; i++) {
			a[i] = fnc(this[i]);
		}
		return a;
	}
}
/************************ 12. jquery.textshadow.js ************************/


/************************ 12+1. Karira.APPPublic.API.js ************************/
/**
* PUBLIC API
*   
*   Agrupa todas las llamadas AJAX a APIs del Servidor en el proyecto PublicSite
*/

if (!Karira) {
    var Karira = { "APPPublic": { "API": {}} };
}

// API List
Karira.APPPublic.API.AuthenticateUser = {};
Karira.APPPublic.API.GetTokenInfo = {};
Karira.APPPublic.API.GetUserDetail = {};
// ....


// AUTHENTICATE USER
Karira.APPPublic.API.AuthenticateUser = function (loginPassword) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Authentication/AuthenticateUser",
        type: "POST",
        data: loginPassword,
        dataType: "json",
        showErrors: false,
        async: false,
        loading: true
    });
}

// QUERY FOLDER
Karira.APPPublic.API.QueryGalleryElements = function (filesystemId, folderId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryGalleryElements/" + filesystemId + "/" + folderId,
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//UserSocialLinked
Karira.APPPublic.API.UserSocialLinked = function (id) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/UserSocialLinked/"+id,
        dataType: "json",
        async: false,
        loading: true
    });
}

//FACEBOOK
Karira.APPPublic.API.GetFacebookLoginURL = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetFacebookLoginURL/",
        dataType: "json",
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.AuthenticateWithFacebook = function (uri) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AuthenticateWithFacebook?authenticationURL=" + uri,
        dataType: "json",
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.DeAuthenticateWithFacebook = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeAuthenticateWithFacebook/",
        dataType: "json",
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.AreFacebookFriends = function (id1, id2) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AreFacebookFriends/" + id1+"/"+id2,
        dataType: "json",
        async: false,
        loading: true
    });
}

//TWITTER
Karira.APPPublic.API.GetTwitterLoginURL = function (email) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetTwitterLoginURL?email=" + email,
        dataType: "json",
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.AuthenticateWithTwitter = function (uri) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AuthenticateWithTwitter?authenticationURL=" + uri,
        dataType: "json",
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.DeAuthenticateWithTwitter = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeAuthenticateWithTwitter/",
        dataType: "json",
        async: false,
        loading: true
    });
}


//WINDOWS LIVE
Karira.APPPublic.API.GetWindowsLiveLoginURL = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetWindowsLiveLoginURL/",
        dataType: "json",
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.AuthenticateWithWindowsLive = function (uri) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AuthenticateWithWindowsLive?authenticationURL=" + uri,
        dataType: "json",
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.DeAuthenticateWithWindowsLive = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeAuthenticateWithWindowsLive/",
        dataType: "json",
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.CheckUserPropertyExists = function (jsonData, item, fieldName, callBack) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/CheckUserPropertyExists",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            Zeppelin.Mods.Register[callBack](item, fieldName, data);
        },
        loading: true
    });
}

Karira.APPPublic.API.CheckUserExtendedInfoPropertyExists = function (jsonData, item, fieldName, callBack) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/CheckUserExtendedInfoPropertyExists",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            Zeppelin.Mods.Register[callBack](item, fieldName, data);
        },
        loading: true
    });
}



//UPDATE BLOG
Karira.APPPublic.API.UpdateBlog = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/UpdateBlog",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//UPDATE BLOG POST
Karira.APPPublic.API.AddOrUpdateBlogPost = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateBlogPost",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.GetBlogPosts = function (blodId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetBlogPosts/" + blodId,
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.AsyncGetBlogPosts = function (blodId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetBlogPosts/" + blodId,
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            Blog.Paint(data);
        },
        loading: true
    });
}

//DELETE BLOG POST
Karira.APPPublic.API.DeleteBlogPost = function (postId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteBlogPost/" + postId,
        dataType: "json",
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.GetBlogPostsExtended = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetBlogPostsExtended",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}


//BLOGS LIST
Karira.APPPublic.API.QueryBlogsAdvanced = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryBlogsAdvanced",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}


Karira.APPPublic.API.GetLastPostsFromConcursantes = function (websiteId, maxItems, callback) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetLastPostsFromConcursantes/"+websiteId+"/"+maxItems,
        dataType: "json",
        showErrors: false,
        async: true,
        callback: function (data) {            
            if(typeof callback !="undefined"){
                eval(callback + "(data)");
            }else{
                LastPostBlog.Paint(data);
            }
        },
        loading: true
    });
}

//MARK MESSAGE AS READ
Karira.APPPublic.API.MarkAsRead = function (messageId, userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/MarkAsRead/" + messageId + "/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//MARK MESSAGE AS NO READ
Karira.APPPublic.API.MarkAsNoRead = function (messageId, userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/MarkAsNoRead/" + messageId + "/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//MARK CONVERSATION AS READ
Karira.APPPublic.API.MarkConversationAsRead = function (messageId, userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/MarkConversationAsRead/" + messageId + "/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}
//MARK CONVERSATION AS NO READ
Karira.APPPublic.API.MarkConversationAsNoRead = function (messageId, userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/MarkConversationAsNoRead/" + messageId + "/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}



//MARK ALL AS READ
Karira.APPPublic.API.MarkAllAsRead = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/MarkAllAsRead",
        dataType: "json",
        async: false,
        loading: true
    });
}

//GET COUNTER MESSAGES
Karira.APPPublic.API.CountPendingMessages = function () {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/CountPendingMessages",
        dataType: "json",
        async: false,
        loading: true
    });
}

//DELETE MESSAGE
Karira.APPPublic.API.DeleteMessage = function (id) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteMessage/" + id,
        dataType: "json",
        async: false,
        loading: true
    });
}

//DELETE CONVERSATION
Karira.APPPublic.API.DeleteConversationForUser = function (id) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteConversationForUser/" + id,
        dataType: "json",
        async: false,
        loading: true
    });
}

//GET CONVERSATION
Karira.APPPublic.API.GetConversationsByUser = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetConversationsByUser",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}


// GET TOKEN INFO
Karira.APPPublic.API.GetTokenInfo = function (tokenId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetTokenInfo/" + tokenId,
        dataType: "json",
        async: false,
        showErrors: false,
        loading: true
    });
}

//ADD OR UPDATE USER
Karira.APPPublic.API.AddUser = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddUser",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        showErrors: false,
        loading: true
    });
}


Karira.APPPublic.API.UpdateUser = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/UpdateUser",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//CHANGE PASSWORD
Karira.APPPublic.API.SetUserPassword = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SetUserPassword",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//CAPTCHA
Karira.APPPublic.API.ValidateCaptcha = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Authentication/ValidateCaptcha",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        showErrors: false,
        loading: true
    });
}


//EXTENDED INFO
Karira.APPPublic.API.GetUserExtendedInfo = function (userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetUserExtendedInfo/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}
//ADD OR UPDATE EXTENDEDINFO
Karira.APPPublic.API.AddOrUpdateUserExtendedInfo = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateUserExtendedInfo",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.AddOrUpdateUserSharedContents = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateUserSharedContents",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//USER NOTIFICATIONS
Karira.APPPublic.API.AddOrUpdateUserNotificationsSettings = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateUserNotificationSettings",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}



//REST USER PASSWORD
Karira.APPPublic.API.ResetUserPassword = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/ResetUserPassword",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//SEND REGISTRATION MAIL
Karira.APPPublic.API.SendRegistrationMail = function (mail) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SendRegistrationMail/" + mail,
        dataType: "json",
        async: false,
        loading: true
    });
}

// GET USER DETAIL
Karira.APPPublic.API.GetUserDetail = function (userId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetUser/" + userId,
        dataType: "json",
        async: false,
        loading: true
    });
}


//USER WALL
Karira.APPPublic.API.GetWallPosts = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetWallPosts",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: true,
        callback: function (data) {
            var data = data;
            Wall.Paint(data);
        },
        loading: true
    });
}

//PROGRAM WALL
Karira.APPPublic.API.GetProgramWallPosts = function (jsonData, errorFunction) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Programs/GetWallPosts",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: true,
        callbackError: errorFunction,
        callback: function (data) {
            var data = data;
            
            if($("#main_body").find(".widgetWall").length>0){
                WidgetWall.Paint(data);
            }else{
                Wall.Paint(data);
            }
            
        },
        loading: true
    });
}

//ADD USER WALL POST
Karira.APPPublic.API.AddOrUpdateWallPost = function (fb, tw, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateWallPost?addToFacebook=" + fb + "&addToTwitter=" + tw,
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: false,
        loading: true
    });
}

//DELETE WALL POST
Karira.APPPublic.API.DeleteWallPost = function (id) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteWallPost/" + id,
        dataType: "json",
        async: false,
        loading: true
    });
}

//ADD OR UPDATE COMMENTS
Karira.APPPublic.API.AddOrUpdateComment = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateComment",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.QueryCommunityComments = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryCommunityComments",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.AsyncQueryCommunityComments = function (jsonData, item) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryCommunityComments",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            Zeppelin.Mods.Comments.AsyncPaint(data, item);
        },
        loading: true
    });
}

// DELTE WALL POST COMMENT
Karira.APPPublic.API.DeleteCommunityComment = function (id) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteCommunityComment/" + id,
        dataType: "json",
        async: false,
        loading: true
    });
}



Karira.APPPublic.API.GetCommentsFor = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetCommentsFor",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//USER FRIENDS
Karira.APPPublic.API.GetFriendsOf = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetFriendsOf",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}


//REQUEST FRIENDS
Karira.APPPublic.API.RequestFriendship = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/RequestFriendship",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

//DELETE FRIENDSHIP
Karira.APPPublic.API.DeleteFriendship = function (userId, DestinationUserID) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteFriendship/" + userId + "/" + DestinationUserID,
        dataType: "json",
        async: false,
        loading: true
    });
}

//GET FRIENSHIP USER
Karira.APPPublic.API.GetFriendshipRequestsToUser = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetFriendshipRequestsToUser",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}
//ACCEPT REQUEST FRIENDSHIP
Karira.APPPublic.API.AcceptFriendshipRequest = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AcceptFriendshipRequest/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//ACCEPT ALL REQUEST FRIENDSHIP
Karira.APPPublic.API.AcceptPendingFriendshipRequests = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AcceptPendingFriendshipRequests/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//IGNORE REQUEST FRIENDSHIP
Karira.APPPublic.API.RejectFriendshipRequest = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/RejectFriendshipRequest/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//USER LIKED CONTENTS
Karira.APPPublic.API.GetContentsByTaste = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetContentsByTaste",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

// GALLERY ITEM
Karira.APPPublic.API.GetGallery = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/WebsiteGalleries/GetGallery/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//GALLERY
Karira.APPPublic.API.GetItemsGalleryElements = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/WebsiteGalleries/GetGalleryElements",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

// DELETE GALLERY ELEMENT
Karira.APPPublic.API.DeleteGalleryElement = function (galId, elementId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteGalleryElement/" + galId + "/" + elementId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//GET THUMBNAIL
Karira.APPPublic.API.GetGalleryElementThumbnail = function (websiteId, idItem) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/WebsiteGalleries/GetGalleryElementThumbnail/" + websiteId + "/" + idItem,
        dataType: "json",
        async: false,
        loading: true
    });
}

//WALL
/*
Karira.APPPublic.API.GetWallPosts = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetWallPosts",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}
*/

//LIKES
Karira.APPPublic.API.AddOrUpdateCounter = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateCounter",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: false,
        loading: true
    });
}

// OEMBED
Karira.APPPublic.API.Oembed = function (linkHref, $link) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Medias/oembed?url=" + linkHref,
        dataType: "json",
        type: "POST",
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            if (typeof data == "string") {
                $link.hide("fast").after("<div class='media_container'>" + data + "</div>")
            }
            else {
                // Error dialog via Ajax.Call
            }
        },
        loading: true
    });
}

//PERSONS
Karira.APPPublic.API.QueryPersonsExtended = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/QueryPersonsExtended",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            PersonsManagement.Paint(data);
        },
        loading: true
    });
}

//GALERY IMAGES PERSONS
Karira.APPPublic.API.PersonsGetGalleryElements= function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetGalleryElements",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.GetFollowersDistributive= function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetFollowersDistributive",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.GetContentsByTasteFrom = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetContentsByTasteFrom",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: false,
        loading: true
    });
}

//Tabs
Karira.APPPublic.API.AsyncFollowersDistributive= function (jsonData, tabIndex) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetFollowersDistributive",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            WidgetTabsPerson.Paint(data, tabIndex);
        },
        loading: true
    });
}

Karira.APPPublic.API.AsyncContentsByTasteFrom = function (jsonData, tabIndex) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/GetContentsByTasteFrom",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            WidgetTabsPerson.Paint(data, tabIndex);
        },
        loading: true
    });
}

Karira.APPPublic.API.WidgetPersons = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Persons/QueryPersonsExtended",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            WidgetTabsPersonsList.Paint(data);
        },
        loading: true
    });
}
 


/*****************
***** MESSAGES ***
******************/
Karira.APPPublic.API.QueryMessages = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryMessages",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}
//ADD OR UPDATE MESSAGE
Karira.APPPublic.API.AddorUpdateMessage = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddorUpdateMessage",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.GetConversationMessages = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetConversationMessages",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}



// QUERY FOLDER
Karira.APPPublic.API.QueryFolder = function (filesystemId, folderId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryGalleryElements/" + filesystemId + "/" + folderId,
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

// GET ITEMS
Karira.APPPublic.API.GetGalleryElements = function (galleryId, listItemIds) {

    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Gallery/GetGalleryElements/" + galleryId,
        async: false,
        dataType: "json",
        type: "POST",
        data: listItemIds,
        loading: true
    });
}

// SET TITLES
Karira.APPPublic.API.SetGalleryElementsTitle = function (galleryId, listItemIds) {

    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SetGalleryElementsTitle/" + galleryId,
        async: false,
        dataType: "json",
        type: "POST",
        data: listItemIds,
        loading: true
    });
}

/****** GROUPS ******/

//ADD OR UPDATE
Karira.APPPublic.API.AddOrUpdateGroup = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateGroup",
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        loading: true
    });
}

Karira.APPPublic.API.GetUserGroups = function (userId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetUserGroups/" + userId,
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

//
Karira.APPPublic.API.RequestMembership = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/RequestMembership",
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

// MEMBERSHIP REQUESTS LIST
Karira.APPPublic.API.QueryMembershipRequests = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryMembershipRequests",
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

//
Karira.APPPublic.API.ManageGroupMembershipRequestsbyGroup = function (status, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/ManageGroupMembershipRequestsbyGroup/" + status,
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}


// ACCEPT REQUEST
Karira.APPPublic.API.AcceptMembershipRequest = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AcceptMembershipRequest/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

// IGNORE REQUEST
Karira.APPPublic.API.RejectMembershipRequest = function (requestId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/RejectMembershipRequest/" + requestId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//GROUP MEMBERS
Karira.APPPublic.API.GetGroupUsers = function (groupId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetGroupUsers/" + groupId,
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

//GROUP LIST
Karira.APPPublic.API.QueryGroupsAdvanced = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryGroupsAdvanced",
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

//LEAVE GROUP
Karira.APPPublic.API.LeaveGroup = function (userId, groupId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/LeaveGroup/" + userId + "/" + groupId,
        dataType: "json",
        async: false,
        loading: true
    });
}


//DELETE GROUP
Karira.APPPublic.API.DeleteGroup = function (groupId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/DeleteGroup/" + groupId,
        dataType: "json",
        async: false,
        loading: true
    });
}

//BLOG GROUP
Karira.APPPublic.API.GetGroupBlogPosts = function (groupId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetGroupBlogPosts/" + groupId,
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}

Karira.APPPublic.API.AsyncGetGroupBlogPosts = function (groupId, jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetGroupBlogPosts/" + groupId,
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            Blog.Paint(data);
        },
        loading: true
    });
}

//FOLLOW GROUP
Karira.APPPublic.API.AddOrRemoveFollowData = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrRemoveFollowData",
        async: false,
        dataType: "json",
        type: "POST",
        data: jsonData,
        loading: true
    });
}


//MEDIA DETAIL
Karira.APPPublic.API.GetGalleryElementHtml = function (galleryId, galleryElementId) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Medias/GetGalleryElementHtml/" + galleryId + "/" + galleryElementId,
        dataType: "json",
        async: false,
        loading: true
    });
}



// GET ITEMS
Karira.APPPublic.API.CommunityGetGalleryElements = function (json) {

    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetGalleryElements",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}



/************************
******** SEARCHS ********
************************/

//ADVANCED
Karira.APPPublic.API.SearchAdvanced = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Search/SearchAdvanced",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}

Karira.APPPublic.API.AsyncSearchAdvanced = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Search/SearchAdvanced",
        dataType: "json",
        type: "POST",
        data: json,
        async: true,
        callback: function (data) {
            Zeppelin.Pages.AdvancedSearch.Results(data);
        },
        loading: true
    });
}

//SIMPLY
Karira.APPPublic.API.Search = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Search/Search",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}



// GET PREV OR NEXT STEP
Karira.APPPublic.API.GetNextSurveyStep = function (jsonData, prev) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Surveys/GetNextSurveyStep" + (prev ? "?prev=true" : ""),
        dataType: "json",
        type: "POST",
        data: jsonData,
        async: false,
        showErrors: false,
        loading: true
    });
}

//Community Search
Karira.APPPublic.API.SearchUsers = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Search/SearchUsers",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}

Karira.APPPublic.API.AsyncCommunitySearchUsers= function (json, callback) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Search/SearchUsers",
        dataType: "json",
        type: "POST",
        data: json,
        async: true,
        callback: function (data) {            
            eval(callback + "(data)");
        },
        loading: true
    });
}

Karira.APPPublic.API.AsyncSearchUsers = function (json, callback) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/QueryUserExtendedInfoAdvanced",
        dataType: "json",
        type: "POST",
        data: json,
        async: true,
        callback: function (data) {            
            eval(callback + "(data)");
        },
        loading: true
    });
}


//CROP IMAGE
Karira.APPPublic.API.CropGalleryElement = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/CropGalleryElement",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}


//SEND INVITE FRIEND
Karira.APPPublic.API.SendInviteMail = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SendInviteMail",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}

Karira.APPPublic.API.AsyncSendInviteMail = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SendInviteMail",
        async: true,
        dataType: "json",
        type: "POST",
        data: json,
        callback: function (data) {            
            Zeppelin.Mods.SemdEmail.Response(data);
        },
        loading: true
    });
}

Karira.APPPublic.API.SendMail = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SendMail",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}



//INTERESTED USER
Karira.APPPublic.API.AddOrUpdateUserInterests = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/AddOrUpdateUserInterests",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}

//QUERY NEWS
Karira.APPPublic.API.QueryNews = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Content/QueryNews",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}

Karira.APPPublic.API.AsyncQueryNews = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Content/QueryNews",
        dataType: "json",
        type: "POST",
        data: json,
        async: true,
        callback: function (data) {            
            NewsList.Paint(data);
        },
        loading: true
    });
}

//CONTACT
Karira.APPPublic.API.SendContactForm = function (json) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/SendContactForm",
        async: false,
        dataType: "json",
        type: "POST",
        data: json,
        loading: true
    });
}


Karira.APPPublic.API.GetUsersGroupsBlogsData = function (jsonData) {
    return Zeppelin.PublicSite.Ajax.Call({
        url: "/Karira.ECM.PAPI/Community/GetUsersGroupsBlogsData",
        dataType: "json",
        type: "POST",
        data: jsonData,
        showErrors: false,
        async: true,
        callback: function (data) {
            // Sustituir el link por el codigo HTML y JS html del server 
            var data = data;
            WidgetTabsHome.Paint(data);
        },
        loading: true
    });
}




/************************ 12+1. Karira.APPPublic.API.js ************************/

/************************ 14. json2.js ************************/
/*
    http://www.JSON.org/json2.js
    2011-01-18

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html


    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.


    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.
*/

/*jslint evil: true, strict: false, regexp: false */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/


// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

var JSON;
if (!JSON) {
    JSON = {};
}

(function () {
    "use strict";

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function (key) {

            return isFinite(this.valueOf()) ?
                this.getUTCFullYear()     + '-' +
                f(this.getUTCMonth() + 1) + '-' +
                f(this.getUTCDate())      + 'T' +
                f(this.getUTCHours())     + ':' +
                f(this.getUTCMinutes())   + ':' +
                f(this.getUTCSeconds())   + 'Z' : null;
        };

        String.prototype.toJSON      =
            Number.prototype.toJSON  =
            Boolean.prototype.toJSON = function (key) {
                return this.valueOf();
            };
    }

    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        gap,
        indent,
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        escapable.lastIndex = 0;
        return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
            var c = meta[a];
            return typeof c === 'string' ? c :
                '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
        }) + '"' : '"' + string + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0 ? '[]' : gap ?
                    '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
                    '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    k = rep[i];
                    if (typeof k === 'string') {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0 ? '{}' : gap ?
                '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
                '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                    typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            text = String(text);
            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            if (/^[\],:{}\s]*$/
                    .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
                        .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
                        .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function' ?
                    walk({'': j}, '') : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
}());

/************************ 14. json2.js ************************/

/************************ 15. jquery.cookie.js ************************/
/*jslint browser: true */ /*global jQuery: true */

/**
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

// TODO JsDoc

/**
 * Create a cookie with the given key and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String key The key of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given key.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String key The key of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function (key, value, options) {

    // key and value given, set cookie...
    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
        options = jQuery.extend({}, options);

        if (value === null) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? String(value) : encodeURIComponent(String(value)),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};

/************************ 15. jquery.cookie.js ************************/

/************************ 16. flowplayer-3.2.6.min.js ************************/
/* 
 * flowplayer.js 3.2.6. The Flowplayer API
 * 
 * Copyright 2009-2011 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Date: 2011-02-04 05:45:28 -0500 (Fri, 04 Feb 2011)
 * Revision: 614 
 */
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.slice(0,q)||"*";var o=s.slice(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).slice(2,10)}var h=function(t,r,s){var q=this,p={},u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.slice(0,v.length-1);var w="onBefore"+v.slice(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var o=this,s={},u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var z=q._api().fp_getPlugin(p);if(!z){return}i(o,z);delete o.methods;if(!u){m(z.methods,function(){var B=""+this;o[B]=function(){var C=[].slice.call(arguments);var D=q._api().fp_invoke(p,B,C);return D==="undefined"||D===undefined?o:D}});u=true}}var A=s[w];if(A){var y=A.apply(o,v);if(w.slice(0,1)=="_"){delete s[w]}return y}return o}})};function b(q,G,t){var w=this,v=null,D=false,u,s,F=[],y={},x={},E,r,p,C,o,A;i(w,{id:function(){return E},isLoaded:function(){return(v!==null&&v.fp_play!==undefined&&!D)},getParent:function(){return q},hide:function(H){if(H){q.style.height="0px"}if(w.isLoaded()){v.style.height="0px"}return w},show:function(){q.style.height=A+"px";if(w.isLoaded()){v.style.height=o+"px"}return w},isHidden:function(){return w.isLoaded()&&parseInt(v.style.height,10)===0},load:function(J){if(!w.isLoaded()&&w._fireEvent("onBeforeLoad")!==false){var H=function(){u=q.innerHTML;if(u&&!flashembed.isSupported(G.version)){q.innerHTML=""}if(J){J.cached=true;j(x,"onLoad",J)}flashembed(q,G,{config:t})};var I=0;m(a,function(){this.unload(function(K){if(++I==a.length){H()}})})}return w},unload:function(J){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent)){if(J){J(false)}return w}if(u.replace(/\s/g,"")!==""){if(w._fireEvent("onBeforeUnload")===false){if(J){J(false)}return w}D=true;try{if(v){v.fp_close();w._fireEvent("onUnload")}}catch(H){}var I=function(){v=null;q.innerHTML=u;D=false;if(J){J(true)}};setTimeout(I,50)}else{if(J){J(false)}}return w},getClip:function(H){if(H===undefined){H=C}return F[H]},getCommonClip:function(){return s},getPlaylist:function(){return F},getPlugin:function(H){var J=y[H];if(!J&&w.isLoaded()){var I=w._api().fp_getPlugin(H);if(I){J=new l(H,I,w);y[H]=J}}return J},getScreen:function(){return w.getPlugin("screen")},getControls:function(){return w.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return w.getPlugin("logo")._fireEvent("onUpdate")}catch(H){}},getPlay:function(){return w.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(H){return H?k(t):t},getFlashParams:function(){return G},loadPlugin:function(K,J,M,L){if(typeof M=="function"){L=M;M={}}var I=L?e():"_";w._api().fp_loadPlugin(K,J,M,I);var H={};H[I]=L;var N=new l(K,null,w,H);y[K]=N;return N},getState:function(){return w.isLoaded()?v.fp_getState():-1},play:function(I,H){var J=function(){if(I!==undefined){w._api().fp_play(I,H)}else{w._api().fp_play()}};if(w.isLoaded()){J()}else{if(D){setTimeout(function(){w.play(I,H)},50)}else{w.load(function(){J()})}}return w},getVersion:function(){var I="flowplayer.js 3.2.6";if(w.isLoaded()){var H=v.fp_getVersion();H.push(I);return H}return I},_api:function(){if(!w.isLoaded()){throw"Flowplayer "+w.id()+" not loaded when calling an API method"}return v},setClip:function(H){w.setPlaylist([H]);return w},getIndex:function(){return p},_swfHeight:function(){return v.clientHeight}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var H="on"+this;if(H.indexOf("*")!=-1){H=H.slice(0,H.length-1);var I="onBefore"+H.slice(2);w[I]=function(J){j(x,I,J);return w}}w[H]=function(J){j(x,H,J);return w}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var H=this;w[H]=function(J,I){if(!w.isLoaded()){return w}var K=null;if(J!==undefined&&I!==undefined){K=v["fp_"+H](J,I)}else{K=(J===undefined)?v["fp_"+H]():v["fp_"+H](J)}return K==="undefined"||K===undefined?w:K}});w._fireEvent=function(Q){if(typeof Q=="string"){Q=[Q]}var R=Q[0],O=Q[1],M=Q[2],L=Q[3],K=0;if(t.debug){g(Q)}if(!w.isLoaded()&&R=="onLoad"&&O=="player"){v=v||c(r);o=w._swfHeight();m(F,function(){this._fireEvent("onLoad")});m(y,function(S,T){T._fireEvent("onUpdate")});s._fireEvent("onLoad")}if(R=="onLoad"&&O!="player"){return}if(R=="onError"){if(typeof O=="string"||(typeof O=="number"&&typeof M=="number")){O=M;M=L}}if(R=="onContextMenu"){m(t.contextMenu[O],function(S,T){T.call(w)});return}if(R=="onPluginEvent"||R=="onBeforePluginEvent"){var H=O.name||O;var I=y[H];if(I){I._fireEvent("onUpdate",O);return I._fireEvent(M,Q.slice(3))}return}if(R=="onPlaylistReplace"){F=[];var N=0;m(O,function(){F.push(new h(this,N++,w))})}if(R=="onClipAdd"){if(O.isInStream){return}O=new h(O,M,w);F.splice(M,0,O);for(K=M+1;K<F.length;K++){F[K].index++}}var P=true;if(typeof O=="number"&&O<F.length){C=O;var J=F[O];if(J){P=J._fireEvent(R,M,L)}if(!J||P!==false){P=s._fireEvent(R,M,L,J)}}m(x[R],function(){P=this.call(w,O,M);if(this.cached){x[R].splice(K,1)}if(P===false){return false}K++});return P};function B(){if($f(q)){$f(q).getParent().innerHTML="";p=$f(q).getIndex();a[p]=w}else{a.push(w);p=a.length-1}A=parseInt(q.style.height,10)||q.clientHeight;E=q.id||"fp"+e();r=G.id||E+"_api";G.id=r;t.playerId=E;if(typeof t=="string"){t={clip:{url:t}}}if(typeof t.clip=="string"){t.clip={url:t.clip}}t.clip=t.clip||{};if(q.getAttribute("href",2)&&!t.clip.url){t.clip.url=q.getAttribute("href",2)}s=new h(t.clip,-1,w);t.playlist=t.playlist||[t.clip];var I=0;m(t.playlist,function(){var K=this;if(typeof K=="object"&&K.length){K={url:""+K}}m(t.clip,function(L,M){if(M!==undefined&&K[L]===undefined&&typeof M!="function"){K[L]=M}});t.playlist[I]=K;K=new h(K,I,w);F.push(K);I++});m(t,function(K,L){if(typeof L=="function"){if(s[K]){s[K](L)}else{j(x,K,L)}delete t[K]}});m(t.plugins,function(K,L){if(L){y[K]=new l(K,L,w)}});if(!t.plugins||t.plugins.controls===undefined){y.controls=new l("controls",null,w)}y.canvas=new l("canvas",null,w);u=q.innerHTML;function J(L){var K=w.hasiPadSupport&&w.hasiPadSupport();if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(F[0].url)&&!K){return true}if(!w.isLoaded()&&w._fireEvent("onBeforeClick")!==false){w.load()}return f(L)}function H(){if(u.replace(/\s/g,"")!==""){if(q.addEventListener){q.addEventListener("click",J,false)}else{if(q.attachEvent){q.attachEvent("onclick",J)}}}else{if(q.addEventListener){q.addEventListener("click",f,false)}w.load()}}setTimeout(H,0)}if(typeof q=="string"){var z=c(q);if(!z){throw"Flowplayer cannot access element: "+q}q=z;B()}else{B()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var t=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeof t=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:false},t);if(typeof o=="string"){if(o.indexOf(".")!=-1){var s=[];m(n(o),function(){s.push(new b(this,k(t),k(q)))});return new d(s)}else{var r=c(o);return new b(r!==null?r:o,t,q)}}else{if(o){return new b(o,t,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(k){if(c.done){return k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return l}function g(k){switch(h(k)){case"string":k=k.replace(new RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var l=[];for(var m in k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return String(k).replace(/\s/g," ").replace(/\'/g,'"')}function h(l){if(l===null||l===undefined){return false}var k=typeof l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return m}function a(r,t){var q=f({},r);var s=document.all;var n='<object width="'+q.width+'" height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+=' id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+=' data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'" value="'+q[l]+'" />'}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();
/************************ 16. flowplayer-3.2.6.min.js ************************/

/************************ 17. jquery.anythingslider.js ************************/
﻿/*
	AnythingSlider v1.7.11
	Original by Chris Coyier: http://css-tricks.com
	Get the latest version: https://github.com/ProLoser/AnythingSlider

	To use the navigationFormatter function, you must have a function that
	accepts two paramaters, and returns a string of HTML text.

	index = integer index (1 based);
	panel = jQuery wrapped LI item this tab references
	@return = Must return a string of HTML/Text

	navigationFormatter: function(index, panel){
		return "Panel #" + index; // This would have each tab with the text 'Panel #X' where X = index
	}
*/

(function ($) {

    $.anythingSlider = function (el, options) {

        var base = this, o;

        // Wraps the ul in the necessary divs and then gives Access to jQuery element
        base.el = el;
        base.$el = $(el).addClass('anythingBase').wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');

        // Add a reverse reference to the DOM object
        base.$el.data("AnythingSlider", base);

        base.init = function () {

            // Added "o" to be used in the code instead of "base.options" which doesn't get modifed by the compiler - reduces size by ~1k
            base.options = o = $.extend({}, $.anythingSlider.defaults, options);

            base.initialized = false;
            if ($.isFunction(o.onBeforeInitialize)) { base.$el.bind('before_initialize', o.onBeforeInitialize); }
            base.$el.trigger('before_initialize', base);

            // Cache existing DOM elements for later
            // base.$el = original ul
            // for wrap - get parent() then closest in case the ul has "anythingSlider" class
            base.$wrapper = base.$el.parent().closest('div.anythingSlider').addClass('anythingSlider-' + o.theme);
            base.$window = base.$el.closest('div.anythingWindow');
            base.win = window;
            base.$win = $(base.win);

            base.$controls = $('<div class="anythingControls"></div>').appendTo((o.appendControlsTo !== null && $(o.appendControlsTo).length) ? $(o.appendControlsTo) : base.$wrapper);
            base.$startStop = $('<a href="#" class="start-stop"></a>');
            if (o.buildStartStop) {
                base.$startStop.appendTo((o.appendStartStopTo !== null && $(o.appendStartStopTo).length) ? $(o.appendStartStopTo) : base.$controls);
            }
            base.$nav = $('<ul class="thumbNav" />').appendTo((o.appendNavigationTo !== null && $(o.appendNavigationTo).length) ? $(o.appendNavigationTo) : base.$controls);

            // Set up a few defaults & get details
            base.flag = false; // event flag to prevent multiple calls (used in control click/focusin)
            base.playing = o.autoPlay; // slideshow state; removed "startStopped" option
            base.slideshow = false; // slideshow flag needed to correctly trigger slideshow events
            base.hovered = false; // actively hovering over the slider
            base.panelSize = [];  // will contain dimensions and left position of each panel
            base.currentPage = o.startPanel = parseInt(o.startPanel, 10) || 1; // make sure this isn't a string
            o.changeBy = parseInt(o.changeBy, 10) || 1;
            base.adj = (o.infiniteSlides) ? 0 : 1; // adjust page limits for infinite or limited modes
            base.width = base.$el.width();
            base.height = base.$el.height();
            base.outerPad = [base.$wrapper.innerWidth() - base.$wrapper.width(), base.$wrapper.innerHeight() - base.$wrapper.height()];
            if (o.playRtl) { base.$wrapper.addClass('rtl'); }

            // Expand slider to fit parent
            if (o.expand) {
                base.$outer = base.$wrapper.parent();
                base.$window.css({ width: '100%', height: '100%' }); // needed for Opera
                base.checkResize();
            }

            // Build start/stop button
            if (o.buildStartStop) { base.buildAutoPlay(); }

            // Build forwards/backwards buttons
            if (o.buildArrows) { base.buildNextBackButtons(); }

            // can't lock autoplay it if it's not enabled
            if (!o.autoPlay) { o.autoPlayLocked = false; }

            base.updateSlider();

            base.$lastPage = base.$currentPage;

            // Get index (run time) of this slider on the page
            base.runTimes = $('div.anythingSlider').index(base.$wrapper) + 1;
            base.regex = new RegExp('panel' + base.runTimes + '-(\\d+)', 'i'); // hash tag regex
            if (base.runTimes === 1) { base.makeActive(); } // make the first slider on the page active

            // Make sure easing function exists.
            if (!$.isFunction($.easing[o.easing])) { o.easing = "swing"; }

            // If pauseOnHover then add hover effects
            if (o.pauseOnHover) {
                base.$wrapper.hover(function () {
                    if (base.playing) {
                        base.$el.trigger('slideshow_paused', base);
                        base.clearTimer(true);
                    }
                }, function () {
                    if (base.playing) {
                        base.$el.trigger('slideshow_unpaused', base);
                        base.startStop(base.playing, true);
                    }
                });
            }

            // If a hash can not be used to trigger the plugin, then go to start panel
            base.setCurrentPage(base.gotoHash() || o.startPage, false);

            // Hide/Show navigation & play/stop controls
            base.slideControls(false);
            base.$wrapper.bind('mouseenter mouseleave', function (e) {
                base.hovered = (e.type === "mouseenter") ? true : false;
                base.slideControls(base.hovered, false);
            });

            // Add keyboard navigation
            $(document).keyup(function (e) {
                // Stop arrow keys from working when focused on form items
                if (o.enableKeyboard && base.$wrapper.is('.activeSlider') && !e.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
                    if (!o.vertical && (e.which === 38 || e.which === 40)) { return; }
                    switch (e.which) {
                        case 39: case 40: // right & down arrow
                            base.goForward();
                            break;
                        case 37: case 38: // left & up arrow
                            base.goBack();
                            break;
                    }
                }
            });

            // Fix tabbing through the page, but don't change the view if the link is in view (showMultiple = true)
            base.$items.delegate('a', 'focus.AnythingSlider', function (e) {
                var panel = $(this).closest('.panel'),
				 indx = base.$items.index(panel) + base.adj;
                base.$items.find('.focusedLink').removeClass('focusedLink');
                $(this).addClass('focusedLink');
                base.$window.scrollLeft(0);
                if (!panel.is('.activePage') && base.currentPage + o.showMultiple - 1 > indx) {
                    base.gotoPage(indx);
                    e.preventDefault();
                }
            });

            // Binds events
            var triggers = "slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");
            $.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "), function (i, f) {
                if ($.isFunction(o[f])) {
                    base.$el.bind(triggers[i], o[f]);
                }
            });
            if ($.isFunction(o.onSlideComplete)) {
                // Added setTimeout (zero time) to ensure animation is complete... see this bug report: http://bugs.jquery.com/ticket/7157
                base.$el.bind('slide_complete', function () {
                    setTimeout(function () { o.onSlideComplete(base); }, 0);
                });
            }
            base.initialized = true;
            base.$el.trigger('initialized', base);

            // trigger the slideshow
            base.startStop(base.playing);

        };

        // called during initialization & to update the slider if a panel is added or deleted
        base.updateSlider = function () {
            // needed for updating the slider
            base.$el.children('.cloned').remove();
            base.$nav.empty();
            // set currentPage to 1 in case it was zero - occurs when adding slides after removing them all
            base.currentPage = base.currentPage || 1;

            base.$items = base.$el.children();
            base.pages = base.$items.length;
            base.dir = (o.vertical) ? 'top' : 'left';
            o.showMultiple = (o.vertical) ? 1 : parseInt(o.showMultiple, 10) || 1; // only integers allowed

            if (o.showMultiple > 1) {
                if (o.showMultiple > base.pages) { o.showMultiple = base.pages; }
                base.adjustMultiple = (o.infiniteSlides && base.pages > 1) ? 0 : o.showMultiple - 1;
                base.pages = base.$items.length - base.adjustMultiple;
            }

            // Hide navigation & player if there is only one page
            base.$controls
				.add(base.$nav)
				.add(base.$startStop)
				.add(base.$forward)
				.add(base.$back)[(base.pages <= 1) ? 'hide' : 'show']();
            if (base.pages > 1) {
                // Build/update navigation tabs
                base.buildNavigation();
            }

            // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
            // This supports the "infinite" scrolling, also ensures any cloned elements don't duplicate an ID
            // Moved removeAttr before addClass otherwise IE7 ignores the addClass: http://bugs.jquery.com/ticket/9871
            if (o.infiniteSlides && base.pages > 1) {
                base.$el.prepend(base.$items.filter(':last').clone().removeAttr('id').addClass('cloned'));
                // Add support for multiple sliders shown at the same time
                if (o.showMultiple > 1) {
                    base.$el.append(base.$items.filter(':lt(' + o.showMultiple + ')').clone().removeAttr('id').addClass('cloned').addClass('multiple'));
                } else {
                    base.$el.append(base.$items.filter(':first').clone().removeAttr('id').addClass('cloned'));
                }
                base.$el.find('.cloned').each(function () {
                    // disable all focusable elements in cloned panels to prevent shifting the panels by tabbing
                    $(this).find('a,input,textarea,select,button,area').attr('disabled', 'disabled');
                    $(this).find('[id]').removeAttr('id');
                });
            }

            // We just added two items, time to re-cache the list, then get the dimensions of each panel
            base.$items = base.$el.children().addClass('panel' + (o.vertical ? ' vertical' : ''));
            base.setDimensions();

            // Set the dimensions of each panel
            if (o.resizeContents) {
                base.$items.css('width', base.width);
                base.$wrapper.css('width', base.getDim(base.currentPage)[0]);
                base.$wrapper.add(base.$items).css('height', base.height);
            } else {
                base.$win.load(function () { base.setDimensions(); }); // set dimensions after all images load
            }

            if (base.currentPage > base.pages) {
                base.currentPage = base.pages;
            }
            base.setCurrentPage(base.currentPage, false);
            base.$nav.find('a').eq(base.currentPage - 1).addClass('cur'); // update current selection
        };

        // Creates the numbered navigation links
        base.buildNavigation = function () {
            if (o.buildNavigation && (base.pages > 1)) {
                var t, $a;
                base.$items.filter(':not(.cloned)').each(function (i) {
                    var index = i + 1;
                    t = ((index === 1) ? 'first' : '') + ((index === base.pages) ? 'last' : '');
                    $a = $('<a href="#"></a>').addClass('panel' + index).wrap('<li class="' + t + '" />');
                    base.$nav.append($a.parent()); // use $a.parent() so it will add <li> instead of only the <a> to the <ul>

                    // If a formatter function is present, use it
                    if ($.isFunction(o.navigationFormatter)) {
                        t = o.navigationFormatter(index, $(this));
                        $a.html('<span>' + t + '</span>');
                        // Add formatting to title attribute if text is hidden
                        if (parseInt($a.find('span').css('text-indent'), 10) < 0) { $a.addClass(o.tooltipClass).attr('title', t); }
                    } else {
                        $a.html('<span>' + index + '</span>');
                    }

                    $a.bind(o.clickControls, function (e) {
                        if (!base.flag && o.enableNavigation) {
                            // prevent running functions twice (once for click, second time for focusin)
                            base.flag = true; setTimeout(function () { base.flag = false; }, 100);
                            base.gotoPage(index);
                            if (o.hashTags) { base.setHash(index); }
                        }
                        e.preventDefault();
                    });
                });

                // Add navigation tab scrolling
                if (o.navigationSize !== false && parseInt(o.navigationSize, 10) < base.pages) {
                    if (!base.$controls.find('.anythingNavWindow').length) {
                        base.$nav
							.before('<ul><li class="prev"><a href="#"><span>' + o.backText + '</span></a></li></ul>')
							.after('<ul><li class="next"><a href="#"><span>' + o.forwardText + '</span></a></li></ul>')
							.wrap('<div class="anythingNavWindow"></div>');
                    }
                    base.navWidths = base.$nav.find('li').map(function () { return $(this).innerWidth(); }).get();
                    base.navLeft = 1;
                    // add 5 pixels to make sure the tabs don't wrap to the next line
                    base.$nav.width(base.navWidth(1, base.pages + 1) + 5);
                    base.$controls.find('.anythingNavWindow')
						.width(base.navWidth(1, o.navigationSize + 1)).end()
						.find('.prev,.next').bind(o.clickControls, function (e) {
						    if (!base.flag) {
						        base.flag = true; setTimeout(function () { base.flag = false; }, 200);
						        base.navWindow(base.navLeft + o.navigationSize * ($(this).is('.prev') ? -1 : 1));
						    }
						    e.preventDefault();
						});
                }

            }
        };

        base.navWidth = function (x, y) {
            var s = Math.min(x, y),
				e = Math.max(x, y),
				w = 0;
            for (; s < e; s++) {
                w += base.navWidths[s - 1] || 0;
            }
            return w;
        };

        base.navWindow = function (n) {
            var p = base.pages - o.navigationSize + 1;
            n = (n <= 1) ? 1 : (n > 1 && n < p) ? n : p;
            if (n !== base.navLeft) {
                base.$controls.find('.anythingNavWindow').animate(
					{ scrollLeft: base.navWidth(1, n), width: base.navWidth(n, n + o.navigationSize) },
					{ queue: false, duration: o.animationTime });
                base.navLeft = n;
            }
        };

        // Creates the Forward/Backward buttons
        base.buildNextBackButtons = function () {
            base.$forward = $('<span class="arrow forward"><a href="#"><span>' + o.forwardText + '</span></a></span>');
            base.$back = $('<span class="arrow back"><a href="#"><span>' + o.backText + '</span></a></span>');

            // Bind to the forward and back buttons
            base.$back.bind(o.clickBackArrow, function (e) {
                // prevent running functions twice (once for click, second time for swipe)
                if (o.enableArrows && !base.flag) {
                    base.flag = true; setTimeout(function () { base.flag = false; }, 100);
                    base.goBack();
                }
                e.preventDefault();
            });
            base.$forward.bind(o.clickForwardArrow, function (e) {
                // prevent running functions twice (once for click, second time for swipe)
                if (o.enableArrows && !base.flag) {
                    base.flag = true; setTimeout(function () { base.flag = false; }, 100);
                    base.goForward();
                }
                e.preventDefault();
            });
            // using tab to get to arrow links will show they have focus (outline is disabled in css)
            base.$back.add(base.$forward).find('a').bind('focusin focusout', function () {
                $(this).toggleClass('hover');
            });

            // Append elements to page
            base.$back.appendTo((o.appendBackTo !== null && $(o.appendBackTo).length) ? $(o.appendBackTo) : base.$wrapper);
            base.$forward.appendTo((o.appendForwardTo !== null && $(o.appendForwardTo).length) ? $(o.appendForwardTo) : base.$wrapper);

            base.$arrowWidth = base.$forward.width(); // assuming the left & right arrows are the same width - used for toggle
        };

        // Creates the Start/Stop button
        base.buildAutoPlay = function () {
            base.$startStop
				.html('<span>' + (base.playing ? o.stopText : o.startText) + '</span>')
				.bind(o.clickSlideshow, function (e) {
				    if (o.enableStartStop) {
				        base.startStop(!base.playing);
				        base.makeActive();
				        if (base.playing && !o.autoPlayDelayed) {
				            base.goForward(true);
				        }
				    }
				    e.preventDefault();
				})
            // show button has focus while tabbing
				.bind('focusin focusout', function () {
				    $(this).toggleClass('hover');
				});
        };

        // Adjust slider dimensions on parent element resize
        base.checkResize = function (stopTimer) {
            clearTimeout(base.resizeTimer);
            base.resizeTimer = setTimeout(function () {
                var w = base.$outer.width() - base.outerPad[0],
					h = (base.$outer[0].tagName === "BODY" ? base.$win.height() : base.$outer.height()) - base.outerPad[1];
                // base.width = width of one panel, so multiply by # of panels; outerPad is padding added for arrows.
                if (base.width * o.showMultiple !== w || base.height !== h) {
                    base.setDimensions(); // adjust panel sizes
                    // make sure page is lined up (use -1 animation time, so we can differeniate it from when animationTime = 0)
                    base.gotoPage(base.currentPage, base.playing, null, -1);
                }
                if (typeof (stopTimer) === 'undefined') { base.checkResize(); }
            }, 500);
        };

        // Set panel dimensions to either resize content or adjust panel to content
        base.setDimensions = function () {
            var w, h, c, edge = 0,
            // determine panel width
				pw = (o.showMultiple > 1) ? base.width || base.$window.width() / o.showMultiple : base.$window.width(),
				winw = base.$win.width();
            if (o.expand) {
                w = base.$outer.width() - base.outerPad[0];
                base.height = h = base.$outer.height() - base.outerPad[1];
                base.$wrapper.add(base.$window).add(base.$items).css({ width: w, height: h });
                base.width = pw = (o.showMultiple > 1) ? w / o.showMultiple : w;
            }
            base.$items.each(function (i) {
                c = $(this).children();
                if (o.resizeContents) {
                    // resize panel
                    w = base.width;
                    h = base.height;
                    $(this).css({ width: w, height: h });
                    if (c.length && c[0].tagName === "EMBED") { c.attr({ width: '100%', height: '100%' }); } // needed for IE7; also c.length > 1 in IE7
                    // resize panel contents, if solitary (wrapped content or solitary image)
                    if (c.length === 1) {
                        c.css({ width: '100%', height: '100%' });
                    }
                } else {
                    // get panel width & height and save it
                    w = $(this).width(); // if not defined, it will return the width of the ul parent
                    if (c.length === 1 && w >= winw) {
                        w = (c.width() >= winw) ? pw : c.width(); // get width of solitary child
                        c.css('max-width', w);   // set max width for all children
                    }
                    $(this).css('width', w); // set width of panel
                    h = (c.length === 1) ? c.outerHeight(true) : $(this).height(); // get height after setting width
                    $(this).css('height', h);
                }
                base.panelSize[i] = [w, h, edge];
                edge += (o.vertical) ? h : w;
            });
            // Set total width of slider, Note that this is limited to 32766 by Opera - option removed
            base.$el.css((o.vertical ? 'height' : 'width'), edge);
        };

        // get dimension of multiple panels, as needed
        base.getDim = function (page) {
            if (base.pages < 1 || isNaN(page)) { return [base.width, base.height]; } // prevent errors when base.panelSize is empty
            page = (o.infiniteSlides && base.pages > 1) ? page : page - 1;
            var i,
				w = base.panelSize[page][0],
				h = base.panelSize[page][1];
            if (o.showMultiple > 1) {
                for (i = 1; i < o.showMultiple; i++) {
                    w += base.panelSize[(page + i) % o.showMultiple][0];
                    h = Math.max(h, base.panelSize[page + i][1]);
                }
            }
            return [w, h];
        };

        base.goForward = function (autoplay) {
            base.gotoPage(base.currentPage + o.changeBy * (o.playRtl ? -1 : 1), autoplay);
        };

        base.goBack = function (autoplay) {
            base.gotoPage(base.currentPage + o.changeBy * (o.playRtl ? 1 : -1), autoplay);
        };

        base.gotoPage = function (page, autoplay, callback, time) {
            if (autoplay !== true) {
                autoplay = false;
                base.startStop(false);
                base.makeActive();
            }
            // check if page is an id or class name
            if (/^[#|.]/.test(page) && $(page).length) {
                page = $(page).closest('.panel').index() + base.adj;
            }
            // rewind effect occurs here when changeBy > 1 
            if (o.changeBy !== 1) {
                if (page < 0) { page += base.pages; }
                if (page > base.pages) { page -= base.pages; }
            }
            if (base.pages <= 1) { return; } // prevents animation
            base.$lastPage = base.$currentPage;
            if (typeof (page) !== "number") {
                page = o.startPanel;
                base.setCurrentPage(page);
            }

            // pause YouTube videos before scrolling or prevent change if playing
            if (autoplay && o.isVideoPlaying(base)) { return; }

            if (page > base.pages + 1 - base.adj) { page = (!o.infiniteSlides && !o.stopAtEnd) ? 1 : base.pages; }
            if (page < base.adj) { page = (!o.infiniteSlides && !o.stopAtEnd) ? base.pages : 1; }
            base.currentPage = (page > base.pages) ? base.pages : (page < 1) ? 1 : base.currentPage;
            base.$currentPage = base.$items.eq(base.currentPage - base.adj);
            base.exactPage = page;
            base.$targetPage = base.$items.eq((page === 0) ? base.pages - base.adj : (page > base.pages) ? 1 - base.adj : page - base.adj);
            time = time || o.animationTime;
            // don't trigger events when time = 1 - to prevent FX from firing multiple times on page resize
            if (time >= 0) { base.$el.trigger('slide_init', base); }

            base.slideControls(true, false);

            // When autoplay isn't passed, we stop the timer
            if (autoplay !== true) { autoplay = false; }
            // Stop the slider when we reach the last page, if the option stopAtEnd is set to true
            if (!autoplay || (o.stopAtEnd && page === base.pages)) { base.startStop(false); }

            if (time >= 0) { base.$el.trigger('slide_begin', base); }

            // delay starting slide animation
            setTimeout(function (d) {
                // resize slider if content size varies
                if (!o.resizeContents) {
                    // animating the wrapper resize before the window prevents flickering in Firefox
                    d = base.getDim(page);
                    base.$wrapper.filter(':not(:animated)').animate(
                    // prevent animating a dimension to zero
						{width: d[0] || base.width, height: d[1] || base.height },
						{ queue: false, duration: (time < 0 ? 0 : time), easing: o.easing }
					);
                }
                d = {};
                d[base.dir] = -base.panelSize[(o.infiniteSlides && base.pages > 1) ? page : page - 1][2];
                // Animate Slider
                base.$el.filter(':not(:animated)').animate(
					d, { queue: false, duration: time, easing: o.easing, complete: function () { base.endAnimation(page, callback, time); } }
				);
            }, parseInt(o.delayBeforeAnimate, 10) || 0);
        };

        base.endAnimation = function (page, callback, time) {
            if (page === 0) {
                base.$el.css(base.dir, -base.panelSize[base.pages][2]);
                page = base.pages;
            } else if (page > base.pages) {
                // reset back to start position
                base.$el.css(base.dir, -base.panelSize[1][2]);
                page = 1;
            }
            base.exactPage = page;
            base.setCurrentPage(page, false);
            // Add active panel class
            base.$items.removeClass('activePage').eq(page - base.adj).addClass('activePage');

            if (!base.hovered) { base.slideControls(false); }

            if (time >= 0) { base.$el.trigger('slide_complete', base); }
            // callback from external slide control: $('#slider').anythingSlider(4, function(slider){ })
            if (typeof callback === 'function') { callback(base); }

            // Continue slideshow after a delay
            if (o.autoPlayLocked && !base.playing) {
                setTimeout(function () {
                    base.startStop(true);
                    // subtract out slide delay as the slideshow waits that additional time.
                }, o.resumeDelay - (o.autoPlayDelayed ? o.delay : 0));
            }
        };

        base.setCurrentPage = function (page, move) {
            page = parseInt(page, 10);
            if (base.pages < 1 || page === 0 || isNaN(page)) { return; }
            if (page > base.pages + 1 - base.adj) { page = base.pages - base.adj; }
            if (page < base.adj) { page = 1; }

            // Set visual
            if (o.buildNavigation) {
                base.$nav
					.find('.cur').removeClass('cur').end()
					.find('a').eq(page - 1).addClass('cur');
            }

            // hide/show arrows based on infinite scroll mode
            if (!o.infiniteSlides && o.stopAtEnd) {
                base.$wrapper
					.find('span.forward')[page === base.pages ? 'addClass' : 'removeClass']('disabled').end()
					.find('span.back')[page === 1 ? 'addClass' : 'removeClass']('disabled');
                if (page === base.pages && base.playing) { base.startStop(); }
            }

            // Only change left if move does not equal false
            if (!move) {
                var d = base.getDim(page);
                base.$wrapper
					.css({ width: d[0], height: d[1] })
					.add(base.$window).scrollLeft(0); // reset in case tabbing changed this scrollLeft - probably overly redundant
                base.$el.css(base.dir, -base.panelSize[(o.infiniteSlides && base.pages > 1) ? page : page - 1][2]);
            }
            // Update local variable
            base.currentPage = page;
            base.$currentPage = base.$items.removeClass('activePage').eq(page - base.adj).addClass('activePage');

        };

        base.makeActive = function () {
            // Set current slider as active so keyboard navigation works properly
            if (!base.$wrapper.is('.activeSlider')) {
                $('.activeSlider').removeClass('activeSlider');
                base.$wrapper.addClass('activeSlider');
            }
        };

        // This method tries to find a hash that matches an ID and panel-X
        // If either found, it tries to find a matching item
        // If that is found as well, then it returns the page number
        base.gotoHash = function () {
            var h = base.win.location.hash,
				i = h.indexOf('&'),
				n = h.match(base.regex);
            if (n === null && !/^#&/.test(h)) {
                // #quote2&panel1-3&panel3-3
                h = h.substring(0, (i >= 0 ? i : h.length));
                // ensure the element is in the same slider
                n = ($(h).closest('.anythingBase')[0] === base.el) ? $(h).closest('.panel').index() : null;
            } else if (n !== null) {
                // #&panel1-3&panel3-3
                n = (o.hashTags) ? parseInt(n[1], 10) : null;
            }
            return n;
        };

        base.setHash = function (n) {
            var s = 'panel' + base.runTimes + '-',
				h = base.win.location.hash;
            if (typeof h !== 'undefined') {
                base.win.location.hash = (h.indexOf(s) > 0) ? h.replace(base.regex, s + n) : h + "&" + s + n;
            }
        };

        // Slide controls (nav and play/stop button up or down)
        base.slideControls = function (toggle) {
            var dir = (toggle) ? 'slideDown' : 'slideUp',
				t1 = (toggle) ? 0 : o.animationTime,
				t2 = (toggle) ? o.animationTime : 0,
				op = (toggle) ? 1 : 0,
				sign = (toggle) ? 0 : 1; // 0 = visible, 1 = hidden
            if (o.toggleControls) {
                base.$controls.stop(true, true).delay(t1)[dir](o.animationTime / 2).delay(t2);
            }
            if (o.buildArrows && o.toggleArrows) {
                if (!base.hovered && base.playing) { sign = 1; op = 0; } // don't animate arrows during slideshow
                base.$forward.stop(true, true).delay(t1).animate({ right: sign * base.$arrowWidth, opacity: op }, o.animationTime / 2);
                base.$back.stop(true, true).delay(t1).animate({ left: sign * base.$arrowWidth, opacity: op }, o.animationTime / 2);
            }
        };

        base.clearTimer = function (paused) {
            // Clear the timer only if it is set
            if (base.timer) {
                base.win.clearInterval(base.timer);
                if (!paused && base.slideshow) {
                    base.$el.trigger('slideshow_stop', base);
                    base.slideshow = false;
                }
            }
        };

        // Pass startStop(false) to stop and startStop(true) to play
        base.startStop = function (playing, paused) {
            if (playing !== true) { playing = false; }  // Default if not supplied is false
            base.playing = playing;

            if (playing && !paused) {
                base.$el.trigger('slideshow_start', base);
                base.slideshow = true;
            }

            // Toggle playing and text
            if (o.buildStartStop) {
                base.$startStop.toggleClass('playing', playing).find('span').html(playing ? o.stopText : o.startText);
                // add button text to title attribute if it is hidden by text-indent
                if (parseInt(base.$startStop.find('span').css('text-indent'), 10) < 0) {
                    base.$startStop.addClass(o.tooltipClass).attr('title', playing ? o.stopText : o.startText);
                }
            }

            // Pause slideshow while video is playing
            if (playing) {
                base.clearTimer(true); // Just in case this was triggered twice in a row
                base.timer = base.win.setInterval(function () {
                    // prevent autoplay if video is playing
                    if (!o.isVideoPlaying(base)) {
                        base.goForward(true);
                        // stop slideshow if resume if false
                    } else if (!o.resumeOnVideoEnd) {
                        base.startStop();
                    }
                }, o.delay);
            } else {
                base.clearTimer();
            }
        };

        // Trigger the initialization
        base.init();
    };

    $.anythingSlider.defaults = {
        // Appearance
        theme: "default", // Theme name, add the css stylesheet manually
        expand: false,     // If true, the entire slider will expand to fit the parent element
        resizeContents: true,      // If true, solitary images/objects in the panel will expand to fit the viewport
        vertical: false,     // If true, all panels will slide vertically; they slide horizontally otherwise
        showMultiple: false,     // Set this value to a number and it will show that many slides at once
        easing: "swing",   // Anything other than "linear" or "swing" requires the easing plugin or jQuery UI

        buildArrows: true,      // If true, builds the forwards and backwards buttons
        buildNavigation: true,      // If true, builds a list of anchor links to link to each panel
        buildStartStop: true,      // ** If true, builds the start/stop button

        appendForwardTo: null,      // Append forward arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
        appendBackTo: null,      // Append back arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
        appendControlsTo: null,      // Append controls (navigation + start-stop) to a HTML element (jQuery Object, selector or HTMLNode), if not null
        appendNavigationTo: null,      // Append navigation buttons to a HTML element (jQuery Object, selector or HTMLNode), if not null
        appendStartStopTo: null,      // Append start-stop button to a HTML element (jQuery Object, selector or HTMLNode), if not null

        toggleArrows: false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
        toggleControls: false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times

        startText: "Start",   // Start button text
        stopText: "Stop",    // Stop button text
        forwardText: "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
        backText: "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
        tooltipClass: "tooltip", // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)

        // Function
        enableArrows: true,      // if false, arrows will be visible, but not clickable.
        enableNavigation: true,      // if false, navigation links will still be visible, but not clickable.
        enableStartStop: true,      // if false, the play/stop button will still be visible, but not clickable. Previously "enablePlay"
        enableKeyboard: true,      // if false, keyboard arrow keys will not work for this slider.

        // Navigation
        startPanel: 1,         // This sets the initial panel
        changeBy: 1,         // Amount to go forward or back when changing panels.
        hashTags: true,      // Should links change the hashtag in the URL?
        infiniteSlides: true,      // if false, the slider will not wrap & not clone any panels
        navigationFormatter: null,      // Details at the top of the file on this use (advanced use)
        navigationSize: false,     // Set this to the maximum number of visible navigation tabs; false to disable

        // Slideshow options
        autoPlay: false,     // If true, the slideshow will start running; replaces "startStopped" option
        autoPlayLocked: false,     // If true, user changing slides will not stop the slideshow
        autoPlayDelayed: false,     // If true, starting a slideshow will delay advancing slides; if false, the slider will immediately advance to the next slide when slideshow starts
        pauseOnHover: true,      // If true & the slideshow is active, the slideshow will pause on hover
        stopAtEnd: false,     // If true & the slideshow is active, the slideshow will stop on the last page. This also stops the rewind effect when infiniteSlides is false.
        playRtl: false,     // If true, the slideshow will move right-to-left

        // Times
        delay: 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
        resumeDelay: 15000,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
        animationTime: 600,       // How long the slideshow transition takes (in milliseconds)
        delayBeforeAnimate: 0,         // How long to pause slide animation before going to the desired slide (used if you want your "out" FX to show).

        // Callbacks - removed from options to reduce size - they still work

        // Interactivity
        clickForwardArrow: "click",         // Event used to activate forward arrow functionality (e.g. add jQuery mobile's "swiperight")
        clickBackArrow: "click",         // Event used to activate back arrow functionality (e.g. add jQuery mobile's "swipeleft")
        clickControls: "click focusin", // Events used to activate navigation control functionality
        clickSlideshow: "click",         // Event used to activate slideshow play/stop button

        // Video
        resumeOnVideoEnd: true,      // If true & the slideshow is active & a supported video is playing, it will pause the autoplay until the video is complete
        addWmodeToObject: "opaque",  // If your slider has an embedded object, the script will automatically add a wmode parameter with this setting
        isVideoPlaying: function (base) { return false; } // return true if video is playing or false if not - used by video extension

    };

    $.fn.anythingSlider = function (options, callback) {

        return this.each(function () {
            var page, anySlide = $(this).data('AnythingSlider');

            // initialize the slider but prevent multiple initializations
            if ((typeof (options)).match('object|undefined')) {
                if (!anySlide) {
                    (new $.anythingSlider(this, options));
                } else {
                    anySlide.updateSlider();
                }
                // If options is a number, process as an external link to page #: $(element).anythingSlider(#)
            } else if (/\d/.test(options) && !isNaN(options) && anySlide) {
                page = (typeof (options) === "number") ? options : parseInt($.trim(options), 10); // accepts "  2  "
                // ignore out of bound pages
                if (page >= 1 && page <= anySlide.pages) {
                    anySlide.gotoPage(page, false, callback); // page #, autoplay, one time callback
                }
                // Accept id or class name
            } else if (/^[#|.]/.test(options) && $(options).length) {
                anySlide.gotoPage(options, false, callback);
            }
        });
    };

})(jQuery);
/************************ 17. jquery.anythingslider.js ************************/
