﻿jQuery.ui || (function(p) {
    var j = p.fn.remove,
        o = p.browser.mozilla && (parseFloat(p.browser.version) < 1.9);
    p.ui = {
        version: "1.7.2",
        plugin: {
            add: function(c, b, e) {
                var a = p.ui[c].prototype;
                for (var d in e) {
                    a.plugins[d] = a.plugins[d] || [];
                    a.plugins[d].push([b, e[d]])
                }
            }, call: function(d, b, c) {
                var e = d.plugins[b];
                if (!e || !d.element[0].parentNode) {
                    return
                }
                for (var a = 0; a < e.length; a++) {
                    if (d.options[e[a][0]]) {
                        e[a][1].apply(d.element, c)
                    }
                }
            }
        }, contains: function(a, b) {
            return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b)
        }, hasScroll: function(a, c) {
            if (p(a).css("overflow") == "hidden") {
                return false
            }
            var d = (c && c == "left") ? "scrollLeft" : "scrollTop",
                b = false;
            if (a[d] > 0) {
                return true
            }
            a[d] = 1;
            b = (a[d] > 0);
            a[d] = 0;
            return b
        }, isOverAxis: function(b, c, a) {
            return (b > c) && (b < (c + a))
        }, isOver: function(e, c, f, a, d, b) {
            return p.ui.isOverAxis(e, f, d) && p.ui.isOverAxis(c, a, b)
        }, keyCode: {
            BACKSPACE: 8,
            CAPS_LOCK: 20,
            COMMA: 188,
            CONTROL: 17,
            DELETE: 46,
            DOWN: 40,
            END: 35,
            ENTER: 13,
            ESCAPE: 27,
            HOME: 36,
            INSERT: 45,
            LEFT: 37,
            NUMPAD_ADD: 107,
            NUMPAD_DECIMAL: 110,
            NUMPAD_DIVIDE: 111,
            NUMPAD_ENTER: 108,
            NUMPAD_MULTIPLY: 106,
            NUMPAD_SUBTRACT: 109,
            PAGE_DOWN: 34,
            PAGE_UP: 33,
            PERIOD: 190,
            RIGHT: 39,
            SHIFT: 16,
            SPACE: 32,
            TAB: 9,
            UP: 38
        }
    };
    if (o) {
        var m = p.attr,
            n = p.fn.removeAttr,
            k = "http://www.w3.org/2005/07/aaa",
            r = /^aria-/,
            q = /^wairole:/;
        p.attr = function(c, d, b) {
            var a = b !== undefined;
            return (d == "role" ? (a ? m.call(this, c, d, "wairole:" + b) : (m.apply(this, arguments) || "").replace(q, "")) : (r.test(d) ? (a ? c.setAttributeNS(k, d.replace(r, "aaa:"), b) : m.call(this, c, d.replace(r, "aaa:"))) : m.apply(this, arguments)))
        };
        p.fn.removeAttr = function(a) {
            return (r.test(a) ? this.each(function() {
                this.removeAttributeNS(k, a.replace(r, ""))
            }) : n.call(this, a))
        }
    }
    p.fn.extend({
        remove: function() {
            p("*", this).add(this).each(function() {
                p(this).triggerHandler("remove")
            });
            return j.apply(this, arguments)
        }, enableSelection: function() {
            return this.attr("unselectable", "off").css("MozUserSelect", "").unbind("selectstart.ui")
        }, disableSelection: function() {
            return this.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function() {
                return false
            })
        }, scrollParent: function() {
            var a;
            if ((p.browser.msie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
                a = this.parents().filter(function() {
                    return (/(relative|absolute|fixed)/).test(p.curCSS(this, "position", 1)) && (/(auto|scroll)/).test(p.curCSS(this, "overflow", 1) + p.curCSS(this, "overflow-y", 1) + p.curCSS(this, "overflow-x", 1))
                }).eq(0)
            } else {
                a = this.parents().filter(function() {
                    return (/(auto|scroll)/).test(p.curCSS(this, "overflow", 1) + p.curCSS(this, "overflow-y", 1) + p.curCSS(this, "overflow-x", 1))
                }).eq(0)
            }
            return (/fixed/).test(this.css("position")) || !a.length ? p(document) : a
        }
    });
    p.extend(p.expr[":"], {
        data: function(a, b, c) {
            return !!p.data(a, c[3])
        }, focusable: function(b) {
            var a = b.nodeName.toLowerCase(),
                c = p.attr(b, "tabindex");
            return (/input|select|textarea|button|object/.test(a) ? !b.disabled : "a" == a || "area" == a ? b.href || !isNaN(c) : !isNaN(c)) && !p(b)["area" == a ? "parents" : "closest"](":hidden").length
        }, tabbable: function(a) {
            var b = p.attr(a, "tabindex");
            return (isNaN(b) || b >= 0) && p(a).is(":focusable")
        }
    });

    function l(a, f, e, b) {
        function c(g) {
            var h = p[a][f][g] || [];
            return (typeof h == "string" ? h.split(/,?\s+/) : h)
        }
        var d = c("getter");
        if (b.length == 1 && typeof b[0] == "string") {
            d = d.concat(c("getterSetter"))
        }
        return (p.inArray(e, d) != -1)
    }
    p.widget = function(b, c) {
        var a = b.split(".")[0];
        b = b.split(".")[1];
        p.fn[b] = function(e) {
            var g = (typeof e == "string"),
                f = Array.prototype.slice.call(arguments, 1);
            if (g && e.substring(0, 1) == "_") {
                return this
            }
            if (g && l(a, b, e, f)) {
                var d = p.data(this[0], b);
                return (d ? d[e].apply(d, f) : undefined)
            }
            return this.each(function() {
                var h = p.data(this, b);
                (!h && !g && p.data(this, b, new p[a][b](this, e))._init());
                (h && g && p.isFunction(h[e]) && h[e].apply(h, f))
            })
        };
        p[a] = p[a] || {};
        p[a][b] = function(e, f) {
            var d = this;
            this.namespace = a;
            this.widgetName = b;
            this.widgetEventPrefix = p[a][b].eventPrefix || b;
            this.widgetBaseClass = a + "-" + b;
            this.options = p.extend({}, p.widget.defaults, p[a][b].defaults, p.metadata && p.metadata.get(e)[b], f);
            this.element = p(e).bind("setData." + b, function(h, s, g) {
                if (h.target == e) {
                    return d._setData(s, g)
                }
            }).bind("getData." + b, function(g, h) {
                if (g.target == e) {
                    return d._getData(h)
                }
            }).bind("remove", function() {
                return d.destroy()
            })
        };
        p[a][b].prototype = p.extend({}, p.widget.prototype, c);
        p[a][b].getterSetter = "option"
    };
    p.widget.prototype = {
        _init: function() { }, destroy: function() {
            this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").removeAttr("aria-disabled")
        }, option: function(b, a) {
            var c = b,
                d = this;
            if (typeof b == "string") {
                if (a === undefined) {
                    return this._getData(b)
                }
                c = {};
                c[b] = a
            }
            p.each(c, function(f, e) {
                d._setData(f, e)
            })
        }, _getData: function(a) {
            return this.options[a]
        }, _setData: function(b, a) {
            this.options[b] = a;
            if (b == "disabled") {
                this.element[a ? "addClass" : "removeClass"](this.widgetBaseClass + "-disabled " + this.namespace + "-state-disabled").attr("aria-disabled", a)
            }
        }, enable: function() {
            this._setData("disabled", false)
        }, disable: function() {
            this._setData("disabled", true)
        }, _trigger: function(b, a, g) {
            var e = this.options[b],
                d = (b == this.widgetEventPrefix ? b : this.widgetEventPrefix + b);
            a = p.Event(a);
            a.type = d;
            if (a.originalEvent) {
                for (var c = p.event.props.length, f; c; ) {
                    f = p.event.props[--c];
                    a[f] = a.originalEvent[f]
                }
            }
            this.element.trigger(a, g);
            return !(p.isFunction(e) && e.call(this.element[0], a, g) === false || a.isDefaultPrevented())
        }
    };
    p.widget.defaults = {
        disabled: false
    };
    p.ui.mouse = {
        _mouseInit: function() {
            var a = this;
            this.element.bind("mousedown." + this.widgetName, function(b) {
                return a._mouseDown(b)
            }).bind("click." + this.widgetName, function(b) {
                if (a._preventClickEvent) {
                    a._preventClickEvent = false;
                    b.stopImmediatePropagation();
                    return false
                }
            });
            if (p.browser.msie) {
                this._mouseUnselectable = this.element.attr("unselectable");
                this.element.attr("unselectable", "on")
            }
            this.started = false
        }, _mouseDestroy: function() {
            this.element.unbind("." + this.widgetName);
            (p.browser.msie && this.element.attr("unselectable", this._mouseUnselectable))
        }, _mouseDown: function(b) {
            b.originalEvent = b.originalEvent || {};
            if (b.originalEvent.mouseHandled) {
                return
            } (this._mouseStarted && this._mouseUp(b));
            this._mouseDownEvent = b;
            var c = this,
                a = (b.which == 1),
                d = (typeof this.options.cancel == "string" ? p(b.target).parents().add(b.target).filter(this.options.cancel).length : false);
            if (!a || d || !this._mouseCapture(b)) {
                return true
            }
            this.mouseDelayMet = !this.options.delay;
            if (!this.mouseDelayMet) {
                this._mouseDelayTimer = setTimeout(function() {
                    c.mouseDelayMet = true
                }, this.options.delay)
            }
            if (this._mouseDistanceMet(b) && this._mouseDelayMet(b)) {
                this._mouseStarted = (this._mouseStart(b) !== false);
                if (!this._mouseStarted) {
                    b.preventDefault();
                    return true
                }
            }
            this._mouseMoveDelegate = function(e) {
                return c._mouseMove(e)
            };
            this._mouseUpDelegate = function(e) {
                return c._mouseUp(e)
            };
            p(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate);
            (p.browser.safari || b.preventDefault());
            b.originalEvent.mouseHandled = true;
            return true
        }, _mouseMove: function(a) {
            if (p.browser.msie && !a.button) {
                return this._mouseUp(a)
            }
            if (this._mouseStarted) {
                this._mouseDrag(a);
                return a.preventDefault()
            }
            if (this._mouseDistanceMet(a) && this._mouseDelayMet(a)) {
                this._mouseStarted = (this._mouseStart(this._mouseDownEvent, a) !== false);
                (this._mouseStarted ? this._mouseDrag(a) : this._mouseUp(a))
            }
            return !this._mouseStarted
        }, _mouseUp: function(a) {
            p(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
            if (this._mouseStarted) {
                this._mouseStarted = false;
                this._preventClickEvent = (a.target == this._mouseDownEvent.target);
                this._mouseStop(a)
            }
            return false
        }, _mouseDistanceMet: function(a) {
            return (Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance)
        }, _mouseDelayMet: function(a) {
            return this.mouseDelayMet
        }, _mouseStart: function(a) { }, _mouseDrag: function(a) { }, _mouseStop: function(a) { }, _mouseCapture: function(a) {
            return true
        }
    };
    p.ui.mouse.defaults = {
        cancel: null,
        distance: 1,
        delay: 0
    }
})(jQuery);
(function(b) {
    b.widget("ui.draggable", b.extend({}, b.ui.mouse, {
        _init: function() {
            if (this.options.helper == "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
                this.element[0].style.position = "relative"
            } (this.options.addClasses && this.element.addClass("ui-draggable"));
            (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
            this._mouseInit()
        }, destroy: function() {
            if (!this.element.data("draggable")) {
                return
            }
            this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
            this._mouseDestroy()
        }, _mouseCapture: function(a) {
            var d = this.options;
            if (this.helper || d.disabled || b(a.target).is(".ui-resizable-handle")) {
                return false
            }
            this.handle = this._getHandle(a);
            if (!this.handle) {
                return false
            }
            return true
        }, _mouseStart: function(a) {
            var d = this.options;
            this.helper = this._createHelper(a);
            this._cacheHelperProportions();
            if (b.ui.ddmanager) {
                b.ui.ddmanager.current = this
            }
            this._cacheMargins();
            this.cssPosition = this.helper.css("position");
            this.scrollParent = this.helper.scrollParent();
            this.offset = this.element.offset();
            this.offset = {
                top: this.offset.top - this.margins.top,
                left: this.offset.left - this.margins.left
            };
            b.extend(this.offset, {
                click: {
                    left: a.pageX - this.offset.left,
                    top: a.pageY - this.offset.top
                }, parent: this._getParentOffset(),
                relative: this._getRelativeOffset()
            });
            this.originalPosition = this._generatePosition(a);
            this.originalPageX = a.pageX;
            this.originalPageY = a.pageY;
            if (d.cursorAt) {
                this._adjustOffsetFromHelper(d.cursorAt)
            }
            if (d.containment) {
                this._setContainment()
            }
            this._trigger("start", a);
            this._cacheHelperProportions();
            if (b.ui.ddmanager && !d.dropBehaviour) {
                b.ui.ddmanager.prepareOffsets(this, a)
            }
            this.helper.addClass("ui-draggable-dragging");
            this._mouseDrag(a, true);
            return true
        }, _mouseDrag: function(a, e) {
            this.position = this._generatePosition(a);
            this.positionAbs = this._convertPositionTo("absolute");
            if (!e) {
                var f = this._uiHash();
                this._trigger("drag", a, f);
                this.position = f.position
            }
            if (!this.options.axis || this.options.axis != "y") {
                this.helper[0].style.left = this.position.left + "px"
            }
            if (!this.options.axis || this.options.axis != "x") {
                this.helper[0].style.top = this.position.top + "px"
            }
            if (b.ui.ddmanager) {
                b.ui.ddmanager.drag(this, a)
            }
            return false
        }, _mouseStop: function(f) {
            var e = false;
            if (b.ui.ddmanager && !this.options.dropBehaviour) {
                e = b.ui.ddmanager.drop(this, f)
            }
            if (this.dropped) {
                e = this.dropped;
                this.dropped = false
            }
            if ((this.options.revert == "invalid" && !e) || (this.options.revert == "valid" && e) || this.options.revert === true || (b.isFunction(this.options.revert) && this.options.revert.call(this.element, e))) {
                var a = this;
                b(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                    a._trigger("stop", f);
                    a._clear()
                })
            } else {
                this._trigger("stop", f);
                this._clear()
            }
            return false
        }, _getHandle: function(a) {
            var d = !this.options.handle || !b(this.options.handle, this.element).length ? true : false;
            b(this.options.handle, this.element).find("*").andSelf().each(function() {
                if (this == a.target) {
                    d = true
                }
            });
            return d
        }, _createHelper: function(f) {
            var e = this.options;
            var a = b.isFunction(e.helper) ? b(e.helper.apply(this.element[0], [f])) : (e.helper == "clone" ? this.element.clone() : this.element);
            if (!a.parents("body").length) {
                a.appendTo((e.appendTo == "parent" ? this.element[0].parentNode : e.appendTo))
            }
            if (a[0] != this.element[0] && !(/(fixed|absolute)/).test(a.css("position"))) {
                a.css("position", "absolute")
            }
            return a
        }, _adjustOffsetFromHelper: function(a) {
            if (a.left != undefined) {
                this.offset.click.left = a.left + this.margins.left
            }
            if (a.right != undefined) {
                this.offset.click.left = this.helperProportions.width - a.right + this.margins.left
            }
            if (a.top != undefined) {
                this.offset.click.top = a.top + this.margins.top
            }
            if (a.bottom != undefined) {
                this.offset.click.top = this.helperProportions.height - a.bottom + this.margins.top
            }
        }, _getParentOffset: function() {
            this.offsetParent = this.helper.offsetParent();
            var a = this.offsetParent.offset();
            if (this.cssPosition == "absolute" && this.scrollParent[0] != document && b.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
                a.left += this.scrollParent.scrollLeft();
                a.top += this.scrollParent.scrollTop()
            }
            if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && b.browser.msie)) {
                a = {
                    top: 0,
                    left: 0
                }
            }
            return {
                top: a.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
                left: a.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
            }
        }, _getRelativeOffset: function() {
            if (this.cssPosition == "relative") {
                var a = this.element.position();
                return {
                    top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
                    left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
                }
            } else {
                return {
                    top: 0,
                    left: 0
                }
            }
        }, _cacheMargins: function() {
            this.margins = {
                left: (parseInt(this.element.css("marginLeft"), 10) || 0),
                top: (parseInt(this.element.css("marginTop"), 10) || 0)
            }
        }, _cacheHelperProportions: function() {
            this.helperProportions = {
                width: this.helper.outerWidth(),
                height: this.helper.outerHeight()
            }
        }, _setContainment: function() {
            var f = this.options;
            if (f.containment == "parent") {
                f.containment = this.helper[0].parentNode
            }
            if (f.containment == "document" || f.containment == "window") {
                this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, b(f.containment == "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (b(f.containment == "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]
            }
            if (!(/^(document|window|parent)$/).test(f.containment) && f.containment.constructor != Array) {
                var h = b(f.containment)[0];
                if (!h) {
                    return
                }
                var g = b(f.containment).offset();
                var a = (b(h).css("overflow") != "hidden");
                this.containment = [g.left + (parseInt(b(h).css("borderLeftWidth"), 10) || 0) + (parseInt(b(h).css("paddingLeft"), 10) || 0) - this.margins.left, g.top + (parseInt(b(h).css("borderTopWidth"), 10) || 0) + (parseInt(b(h).css("paddingTop"), 10) || 0) - this.margins.top, g.left + (a ? Math.max(h.scrollWidth, h.offsetWidth) : h.offsetWidth) - (parseInt(b(h).css("borderLeftWidth"), 10) || 0) - (parseInt(b(h).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, g.top + (a ? Math.max(h.scrollHeight, h.offsetHeight) : h.offsetHeight) - (parseInt(b(h).css("borderTopWidth"), 10) || 0) - (parseInt(b(h).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]
            } else {
                if (f.containment.constructor == Array) {
                    this.containment = f.containment
                }
            }
        }, _convertPositionTo: function(k, d) {
            if (!d) {
                d = this.position
            }
            var m = k == "absolute" ? 1 : -1;
            var l = this.options,
                a = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && b.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
                j = (/(html|body)/i).test(a[0].tagName);
            return {
                top: (d.top + this.offset.relative.top * m + this.offset.parent.top * m - (b.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (j ? 0 : a.scrollTop())) * m)),
                left: (d.left + this.offset.relative.left * m + this.offset.parent.left * m - (b.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : j ? 0 : a.scrollLeft()) * m))
            }
        }, _generatePosition: function(n) {
            var k = this.options,
                a = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && b.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
                j = (/(html|body)/i).test(a[0].tagName);
            if (this.cssPosition == "relative" && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
                this.offset.relative = this._getRelativeOffset()
            }
            var o = n.pageX;
            var p = n.pageY;
            if (this.originalPosition) {
                if (this.containment) {
                    if (n.pageX - this.offset.click.left < this.containment[0]) {
                        o = this.containment[0] + this.offset.click.left
                    }
                    if (n.pageY - this.offset.click.top < this.containment[1]) {
                        p = this.containment[1] + this.offset.click.top
                    }
                    if (n.pageX - this.offset.click.left > this.containment[2]) {
                        o = this.containment[2] + this.offset.click.left
                    }
                    if (n.pageY - this.offset.click.top > this.containment[3]) {
                        p = this.containment[3] + this.offset.click.top
                    }
                }
                if (k.grid) {
                    var l = this.originalPageY + Math.round((p - this.originalPageY) / k.grid[1]) * k.grid[1];
                    p = this.containment ? (!(l - this.offset.click.top < this.containment[1] || l - this.offset.click.top > this.containment[3]) ? l : (!(l - this.offset.click.top < this.containment[1]) ? l - k.grid[1] : l + k.grid[1])) : l;
                    var m = this.originalPageX + Math.round((o - this.originalPageX) / k.grid[0]) * k.grid[0];
                    o = this.containment ? (!(m - this.offset.click.left < this.containment[0] || m - this.offset.click.left > this.containment[2]) ? m : (!(m - this.offset.click.left < this.containment[0]) ? m - k.grid[0] : m + k.grid[0])) : m
                }
            }
            return {
                top: (p - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (b.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (j ? 0 : a.scrollTop())))),
                left: (o - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (b.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : j ? 0 : a.scrollLeft())))
            }
        }, _clear: function() {
            this.helper.removeClass("ui-draggable-dragging");
            if (this.helper[0] != this.element[0] && !this.cancelHelperRemoval) {
                this.helper.remove()
            }
            this.helper = null;
            this.cancelHelperRemoval = false
        }, _trigger: function(a, f, e) {
            e = e || this._uiHash();
            b.ui.plugin.call(this, a, [f, e]);
            if (a == "drag") {
                this.positionAbs = this._convertPositionTo("absolute")
            }
            return b.widget.prototype._trigger.call(this, a, f, e)
        }, plugins: {}, _uiHash: function(a) {
            return {
                helper: this.helper,
                position: this.position,
                absolutePosition: this.positionAbs,
                offset: this.positionAbs
            }
        }
    }));
    b.extend(b.ui.draggable, {
        version: "1.7.2",
        eventPrefix: "drag",
        defaults: {
            addClasses: true,
            appendTo: "parent",
            axis: false,
            cancel: ":input,option",
            connectToSortable: false,
            containment: false,
            cursor: "auto",
            cursorAt: false,
            delay: 0,
            distance: 1,
            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
        }
    });
    b.ui.plugin.add("draggable", "connectToSortable", {
        start: function(k, h) {
            var j = b(this).data("draggable"),
                g = j.options,
                a = b.extend({}, h, {
                    item: j.element
                });
            j.sortables = [];
            b(g.connectToSortable).each(function() {
                var c = b.data(this, "sortable");
                if (c && !c.options.disabled) {
                    j.sortables.push({
                        instance: c,
                        shouldRevert: c.options.revert
                    });
                    c._refreshItems();
                    c._trigger("activate", k, a)
                }
            })
        }, stop: function(h, f) {
            var g = b(this).data("draggable"),
                a = b.extend({}, f, {
                    item: g.element
                });
            b.each(g.sortables, function() {
                if (this.instance.isOver) {
                    this.instance.isOver = 0;
                    g.cancelHelperRemoval = true;
                    this.instance.cancelHelperRemoval = false;
                    if (this.shouldRevert) {
                        this.instance.options.revert = true
                    }
                    this.instance._mouseStop(h);
                    this.instance.options.helper = this.instance.options._helper;
                    if (g.options.helper == "original") {
                        this.instance.currentItem.css({
                            top: "auto",
                            left: "auto"
                        })
                    }
                } else {
                    this.instance.cancelHelperRemoval = false;
                    this.instance._trigger("deactivate", h, a)
                }
            })
        }, drag: function(k, g) {
            var h = b(this).data("draggable"),
                a = this;
            var j = function(r) {
                var d = this.offset.click.top,
                    e = this.offset.click.left;
                var t = this.positionAbs.top,
                    o = this.positionAbs.left;
                var q = r.height,
                    f = r.width;
                var c = r.top,
                    s = r.left;
                return b.ui.isOver(t + d, o + e, c, s, q, f)
            };
            b.each(h.sortables, function(c) {
                this.instance.positionAbs = h.positionAbs;
                this.instance.helperProportions = h.helperProportions;
                this.instance.offset.click = h.offset.click;
                if (this.instance._intersectsWith(this.instance.containerCache)) {
                    if (!this.instance.isOver) {
                        this.instance.isOver = 1;
                        this.instance.currentItem = b(a).clone().appendTo(this.instance.element).data("sortable-item", true);
                        this.instance.options._helper = this.instance.options.helper;
                        this.instance.options.helper = function() {
                            return g.helper[0]
                        };
                        k.target = this.instance.currentItem[0];
                        this.instance._mouseCapture(k, true);
                        this.instance._mouseStart(k, true, true);
                        this.instance.offset.click.top = h.offset.click.top;
                        this.instance.offset.click.left = h.offset.click.left;
                        this.instance.offset.parent.left -= h.offset.parent.left - this.instance.offset.parent.left;
                        this.instance.offset.parent.top -= h.offset.parent.top - this.instance.offset.parent.top;
                        h._trigger("toSortable", k);
                        h.dropped = this.instance.element;
                        h.currentItem = h.element;
                        this.instance.fromOutside = h
                    }
                    if (this.instance.currentItem) {
                        this.instance._mouseDrag(k)
                    }
                } else {
                    if (this.instance.isOver) {
                        this.instance.isOver = 0;
                        this.instance.cancelHelperRemoval = true;
                        this.instance.options.revert = false;
                        this.instance._trigger("out", k, this.instance._uiHash(this.instance));
                        this.instance._mouseStop(k, true);
                        this.instance.options.helper = this.instance.options._helper;
                        this.instance.currentItem.remove();
                        if (this.instance.placeholder) {
                            this.instance.placeholder.remove()
                        }
                        h._trigger("fromSortable", k);
                        h.dropped = false
                    }
                }
            })
        }
    });
    b.ui.plugin.add("draggable", "cursor", {
        start: function(h, g) {
            var a = b("body"),
                f = b(this).data("draggable").options;
            if (a.css("cursor")) {
                f._cursor = a.css("cursor")
            }
            a.css("cursor", f.cursor)
        }, stop: function(a, f) {
            var e = b(this).data("draggable").options;
            if (e._cursor) {
                b("body").css("cursor", e._cursor)
            }
        }
    });
    b.ui.plugin.add("draggable", "iframeFix", {
        start: function(a, f) {
            var e = b(this).data("draggable").options;
            b(e.iframeFix === true ? "iframe" : e.iframeFix).each(function() {
                b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({
                    width: this.offsetWidth + "px",
                    height: this.offsetHeight + "px",
                    position: "absolute",
                    opacity: "0.001",
                    zIndex: 1000
                }).css(b(this).offset()).appendTo("body")
            })
        }, stop: function(a, d) {
            b("div.ui-draggable-iframeFix").each(function() {
                this.parentNode.removeChild(this)
            })
        }
    });
    b.ui.plugin.add("draggable", "opacity", {
        start: function(h, g) {
            var a = b(g.helper),
                f = b(this).data("draggable").options;
            if (a.css("opacity")) {
                f._opacity = a.css("opacity")
            }
            a.css("opacity", f.opacity)
        }, stop: function(a, f) {
            var e = b(this).data("draggable").options;
            if (e._opacity) {
                b(f.helper).css("opacity", e._opacity)
            }
        }
    });
    b.ui.plugin.add("draggable", "scroll", {
        start: function(f, e) {
            var a = b(this).data("draggable");
            if (a.scrollParent[0] != document && a.scrollParent[0].tagName != "HTML") {
                a.overflowOffset = a.scrollParent.offset()
            }
        }, drag: function(j, h) {
            var k = b(this).data("draggable"),
                g = k.options,
                a = false;
            if (k.scrollParent[0] != document && k.scrollParent[0].tagName != "HTML") {
                if (!g.axis || g.axis != "x") {
                    if ((k.overflowOffset.top + k.scrollParent[0].offsetHeight) - j.pageY < g.scrollSensitivity) {
                        k.scrollParent[0].scrollTop = a = k.scrollParent[0].scrollTop + g.scrollSpeed
                    } else {
                        if (j.pageY - k.overflowOffset.top < g.scrollSensitivity) {
                            k.scrollParent[0].scrollTop = a = k.scrollParent[0].scrollTop - g.scrollSpeed
                        }
                    }
                }
                if (!g.axis || g.axis != "y") {
                    if ((k.overflowOffset.left + k.scrollParent[0].offsetWidth) - j.pageX < g.scrollSensitivity) {
                        k.scrollParent[0].scrollLeft = a = k.scrollParent[0].scrollLeft + g.scrollSpeed
                    } else {
                        if (j.pageX - k.overflowOffset.left < g.scrollSensitivity) {
                            k.scrollParent[0].scrollLeft = a = k.scrollParent[0].scrollLeft - g.scrollSpeed
                        }
                    }
                }
            } else {
                if (!g.axis || g.axis != "x") {
                    if (j.pageY - b(document).scrollTop() < g.scrollSensitivity) {
                        a = b(document).scrollTop(b(document).scrollTop() - g.scrollSpeed)
                    } else {
                        if (b(window).height() - (j.pageY - b(document).scrollTop()) < g.scrollSensitivity) {
                            a = b(document).scrollTop(b(document).scrollTop() + g.scrollSpeed)
                        }
                    }
                }
                if (!g.axis || g.axis != "y") {
                    if (j.pageX - b(document).scrollLeft() < g.scrollSensitivity) {
                        a = b(document).scrollLeft(b(document).scrollLeft() - g.scrollSpeed)
                    } else {
                        if (b(window).width() - (j.pageX - b(document).scrollLeft()) < g.scrollSensitivity) {
                            a = b(document).scrollLeft(b(document).scrollLeft() + g.scrollSpeed)
                        }
                    }
                }
            }
            if (a !== false && b.ui.ddmanager && !g.dropBehaviour) {
                b.ui.ddmanager.prepareOffsets(k, j)
            }
        }
    });
    b.ui.plugin.add("draggable", "snap", {
        start: function(h, g) {
            var a = b(this).data("draggable"),
                f = a.options;
            a.snapElements = [];
            b(f.snap.constructor != String ? (f.snap.items || ":data(draggable)") : f.snap).each(function() {
                var c = b(this);
                var d = c.offset();
                if (this != a.element[0]) {
                    a.snapElements.push({
                        item: this,
                        width: c.outerWidth(),
                        height: c.outerHeight(),
                        top: d.top,
                        left: d.left
                    })
                }
            })
        }, drag: function(t, E) {
            var K = b(this).data("draggable"),
                C = K.options;
            var d = C.snapTolerance;
            var l = E.offset.left,
                o = l + K.helperProportions.width,
                L = E.offset.top,
                M = L + K.helperProportions.height;
            for (var r = K.snapElements.length - 1; r >= 0; r--) {
                var B = K.snapElements[r].left,
                    F = B + K.snapElements[r].width,
                    G = K.snapElements[r].top,
                    D = G + K.snapElements[r].height;
                if (!((B - d < l && l < F + d && G - d < L && L < D + d) || (B - d < l && l < F + d && G - d < M && M < D + d) || (B - d < o && o < F + d && G - d < L && L < D + d) || (B - d < o && o < F + d && G - d < M && M < D + d))) {
                    if (K.snapElements[r].snapping) {
                        (K.options.snap.release && K.options.snap.release.call(K.element, t, b.extend(K._uiHash(), {
                            snapItem: K.snapElements[r].item
                        })))
                    }
                    K.snapElements[r].snapping = false;
                    continue
                }
                if (C.snapMode != "inner") {
                    var O = Math.abs(G - M) <= d;
                    var a = Math.abs(D - L) <= d;
                    var I = Math.abs(B - o) <= d;
                    var H = Math.abs(F - l) <= d;
                    if (O) {
                        E.position.top = K._convertPositionTo("relative", {
                            top: G - K.helperProportions.height,
                            left: 0
                        }).top - K.margins.top
                    }
                    if (a) {
                        E.position.top = K._convertPositionTo("relative", {
                            top: D,
                            left: 0
                        }).top - K.margins.top
                    }
                    if (I) {
                        E.position.left = K._convertPositionTo("relative", {
                            top: 0,
                            left: B - K.helperProportions.width
                        }).left - K.margins.left
                    }
                    if (H) {
                        E.position.left = K._convertPositionTo("relative", {
                            top: 0,
                            left: F
                        }).left - K.margins.left
                    }
                }
                var J = (O || a || I || H);
                if (C.snapMode != "outer") {
                    var O = Math.abs(G - L) <= d;
                    var a = Math.abs(D - M) <= d;
                    var I = Math.abs(B - l) <= d;
                    var H = Math.abs(F - o) <= d;
                    if (O) {
                        E.position.top = K._convertPositionTo("relative", {
                            top: G,
                            left: 0
                        }).top - K.margins.top
                    }
                    if (a) {
                        E.position.top = K._convertPositionTo("relative", {
                            top: D - K.helperProportions.height,
                            left: 0
                        }).top - K.margins.top
                    }
                    if (I) {
                        E.position.left = K._convertPositionTo("relative", {
                            top: 0,
                            left: B
                        }).left - K.margins.left
                    }
                    if (H) {
                        E.position.left = K._convertPositionTo("relative", {
                            top: 0,
                            left: F - K.helperProportions.width
                        }).left - K.margins.left
                    }
                }
                if (!K.snapElements[r].snapping && (O || a || I || H || J)) {
                    (K.options.snap.snap && K.options.snap.snap.call(K.element, t, b.extend(K._uiHash(), {
                        snapItem: K.snapElements[r].item
                    })))
                }
                K.snapElements[r].snapping = (O || a || I || H || J)
            }
        }
    });
    b.ui.plugin.add("draggable", "stack", {
        start: function(a, h) {
            var f = b(this).data("draggable").options;
            var g = b.makeArray(b(f.stack.group)).sort(function(c, d) {
                return (parseInt(b(c).css("zIndex"), 10) || f.stack.min) - (parseInt(b(d).css("zIndex"), 10) || f.stack.min)
            });
            b(g).each(function(c) {
                this.style.zIndex = f.stack.min + c
            });
            this[0].style.zIndex = f.stack.min + g.length
        }
    });
    b.ui.plugin.add("draggable", "zIndex", {
        start: function(h, g) {
            var a = b(g.helper),
                f = b(this).data("draggable").options;
            if (a.css("zIndex")) {
                f._zIndex = a.css("zIndex")
            }
            a.css("zIndex", f.zIndex)
        }, stop: function(a, f) {
            var e = b(this).data("draggable").options;
            if (e._zIndex) {
                b(f.helper).css("zIndex", e._zIndex)
            }
        }
    })
})(jQuery);
(function(b) {
    b.widget("ui.droppable", {
        _init: function() {
            var d = this.options,
                a = d.accept;
            this.isover = 0;
            this.isout = 1;
            this.options.accept = this.options.accept && b.isFunction(this.options.accept) ? this.options.accept : function(c) {
                return c.is(a)
            };
            this.proportions = {
                width: this.element[0].offsetWidth,
                height: this.element[0].offsetHeight
            };
            b.ui.ddmanager.droppables[this.options.scope] = b.ui.ddmanager.droppables[this.options.scope] || [];
            b.ui.ddmanager.droppables[this.options.scope].push(this);
            (this.options.addClasses && this.element.addClass("ui-droppable"))
        }, destroy: function() {
            var a = b.ui.ddmanager.droppables[this.options.scope];
            for (var d = 0; d < a.length; d++) {
                if (a[d] == this) {
                    a.splice(d, 1)
                }
            }
            this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")
        }, _setData: function(a, d) {
            if (a == "accept") {
                this.options.accept = d && b.isFunction(d) ? d : function(c) {
                    return c.is(d)
                }
            } else {
                b.widget.prototype._setData.apply(this, arguments)
            }
        }, _activate: function(d) {
            var a = b.ui.ddmanager.current;
            if (this.options.activeClass) {
                this.element.addClass(this.options.activeClass)
            } (a && this._trigger("activate", d, this.ui(a)))
        }, _deactivate: function(d) {
            var a = b.ui.ddmanager.current;
            if (this.options.activeClass) {
                this.element.removeClass(this.options.activeClass)
            } (a && this._trigger("deactivate", d, this.ui(a)))
        }, _over: function(d) {
            var a = b.ui.ddmanager.current;
            if (!a || (a.currentItem || a.element)[0] == this.element[0]) {
                return
            }
            if (this.options.accept.call(this.element[0], (a.currentItem || a.element))) {
                if (this.options.hoverClass) {
                    this.element.addClass(this.options.hoverClass)
                }
                this._trigger("over", d, this.ui(a))
            }
        }, _out: function(d) {
            var a = b.ui.ddmanager.current;
            if (!a || (a.currentItem || a.element)[0] == this.element[0]) {
                return
            }
            if (this.options.accept.call(this.element[0], (a.currentItem || a.element))) {
                if (this.options.hoverClass) {
                    this.element.removeClass(this.options.hoverClass)
                }
                this._trigger("out", d, this.ui(a))
            }
        }, _drop: function(h, g) {
            var a = g || b.ui.ddmanager.current;
            if (!a || (a.currentItem || a.element)[0] == this.element[0]) {
                return false
            }
            var f = false;
            this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
                var c = b.data(this, "droppable");
                if (c.options.greedy && b.ui.intersect(a, b.extend(c, {
                    offset: c.element.offset()
                }), c.options.tolerance)) {
                    f = true;
                    return false
                }
            });
            if (f) {
                return false
            }
            if (this.options.accept.call(this.element[0], (a.currentItem || a.element))) {
                if (this.options.activeClass) {
                    this.element.removeClass(this.options.activeClass)
                }
                if (this.options.hoverClass) {
                    this.element.removeClass(this.options.hoverClass)
                }
                this._trigger("drop", h, this.ui(a));
                return this.element
            }
            return false
        }, ui: function(a) {
            return {
                draggable: (a.currentItem || a.element),
                helper: a.helper,
                position: a.position,
                absolutePosition: a.positionAbs,
                offset: a.positionAbs
            }
        }
    });
    b.extend(b.ui.droppable, {
        version: "1.7.2",
        eventPrefix: "drop",
        defaults: {
            accept: "*",
            activeClass: false,
            addClasses: true,
            greedy: false,
            hoverClass: false,
            scope: "default",
            tolerance: "intersect"
        }
    });
    b.ui.intersect = function(a, v, r) {
        if (!v.offset) {
            return false
        }
        var B = (a.positionAbs || a.position.absolute).left,
            C = B + a.helperProportions.width,
            s = (a.positionAbs || a.position.absolute).top,
            t = s + a.helperProportions.height;
        var y = v.offset.left,
            D = y + v.proportions.width,
            l = v.offset.top,
            u = l + v.proportions.height;
        switch (r) {
            case "fit":
                return (y < B && C < D && l < s && t < u);
                break;
            case "intersect":
                return (y < B + (a.helperProportions.width / 2) && C - (a.helperProportions.width / 2) < D && l < s + (a.helperProportions.height / 2) && t - (a.helperProportions.height / 2) < u);
                break;
            case "pointer":
                var x = ((a.positionAbs || a.position.absolute).left + (a.clickOffset || a.offset.click).left),
                w = ((a.positionAbs || a.position.absolute).top + (a.clickOffset || a.offset.click).top),
                A = b.ui.isOver(w, x, l, y, v.proportions.height, v.proportions.width);
                return A;
                break;
            case "touch":
                return ((s >= l && s <= u) || (t >= l && t <= u) || (s < l && t > u)) && ((B >= y && B <= D) || (C >= y && C <= D) || (B < y && C > D));
                break;
            default:
                return false;
                break
        }
    };
    b.ui.ddmanager = {
        current: null,
        droppables: {
            "default": []
        }, prepareOffsets: function(m, k) {
            var a = b.ui.ddmanager.droppables[m.options.scope];
            var l = k ? k.type : null;
            var j = (m.currentItem || m.element).find(":data(droppable)").andSelf();
            droppablesLoop: for (var n = 0; n < a.length; n++) {
                if (a[n].options.disabled || (m && !a[n].options.accept.call(a[n].element[0], (m.currentItem || m.element)))) {
                    continue
                }
                for (var o = 0; o < j.length; o++) {
                    if (j[o] == a[n].element[0]) {
                        a[n].proportions.height = 0;
                        continue droppablesLoop
                    }
                }
                a[n].visible = a[n].element.css("display") != "none";
                if (!a[n].visible) {
                    continue
                }
                a[n].offset = a[n].element.offset();
                a[n].proportions = {
                    width: a[n].element[0].offsetWidth,
                    height: a[n].element[0].offsetHeight
                };
                if (l == "mousedown") {
                    a[n]._activate.call(a[n], k)
                }
            }
        }, drop: function(a, f) {
            var e = false;
            b.each(b.ui.ddmanager.droppables[a.options.scope], function() {
                if (!this.options) {
                    return
                }
                if (!this.options.disabled && this.visible && b.ui.intersect(a, this, this.options.tolerance)) {
                    e = this._drop.call(this, f)
                }
                if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0], (a.currentItem || a.element))) {
                    this.isout = 1;
                    this.isover = 0;
                    this._deactivate.call(this, f)
                }
            });
            return e
        }, drag: function(a, d) {
            if (a.options.refreshPositions) {
                b.ui.ddmanager.prepareOffsets(a, d)
            }
            b.each(b.ui.ddmanager.droppables[a.options.scope], function() {
                if (this.options.disabled || this.greedyChild || !this.visible) {
                    return
                }
                var j = b.ui.intersect(a, this, this.options.tolerance);
                var c = !j && this.isover == 1 ? "isout" : (j && this.isover == 0 ? "isover" : null);
                if (!c) {
                    return
                }
                var h;
                if (this.options.greedy) {
                    var k = this.element.parents(":data(droppable):eq(0)");
                    if (k.length) {
                        h = b.data(k[0], "droppable");
                        h.greedyChild = (c == "isover" ? 1 : 0)
                    }
                }
                if (h && c == "isover") {
                    h.isover = 0;
                    h.isout = 1;
                    h._out.call(h, d)
                }
                this[c] = 1;
                this[c == "isout" ? "isover" : "isout"] = 0;
                this[c == "isover" ? "_over" : "_out"].call(this, d);
                if (h && c == "isout") {
                    h.isout = 0;
                    h.isover = 1;
                    h._over.call(h, d)
                }
            })
        }
    }
})(jQuery);
(function(g) {
    if (/1\.(0|1|2)\.(0|1|2)/.test(g.fn.jquery) || /^1.1/.test(g.fn.jquery)) {
        alert("blockUI requires jQuery v1.2.3 or later!  You are using v" + g.fn.jquery);
        return
    }
    g.fn._fadeIn = g.fn.fadeIn;
    var j = document.documentMode || 0;
    var d = g.browser.msie && ((g.browser.version < 8 && !j) || j < 8);
    var e = g.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !j;
    g.blockUI = function(p) {
        c(window, p)
    };
    g.unblockUI = function(p) {
        h(window, p)
    };
    g.growlUI = function(t, r, s, p) {
        var q = g('<div class="growlUI"></div>');
        if (t) {
            q.append("<h1>" + t + "</h1>")
        }
        if (r) {
            q.append("<h2>" + r + "</h2>")
        }
        if (s == undefined) {
            s = 3000
        }
        g.blockUI({
            message: q,
            fadeIn: 700,
            fadeOut: 1000,
            centerY: false,
            timeout: s,
            showOverlay: false,
            onUnblock: p,
            css: g.blockUI.defaults.growlCSS
        })
    };
    g.fn.block = function(p) {
        return this.unblock({
            fadeOut: 0
        }).each(function() {
            if (g.css(this, "position") == "static") {
                this.style.position = "relative"
            }
            if (g.browser.msie) {
                this.style.zoom = 1
            }
            c(this, p)
        })
    };
    g.fn.unblock = function(p) {
        return this.each(function() {
            h(this, p)
        })
    };
    g.blockUI.version = 2.23;
    g.blockUI.defaults = {
        message: "<h1>Please wait...</h1>",
        css: {
            padding: 0,
            margin: 0,
            width: "30%",
            top: "40%",
            left: "35%",
            textAlign: "center",
            color: "#000",
            border: "3px solid #aaa",
            backgroundColor: "#fff",
            cursor: "wait"
        }, overlayCSS: {
            backgroundColor: "#000",
            opacity: 0.6,
            cursor: "wait"
        }, growlCSS: {
            width: "350px",
            top: "10px",
            left: "",
            right: "10px",
            border: "none",
            padding: "5px",
            opacity: 0.6,
            cursor: null,
            color: "#fff",
            backgroundColor: "#000",
            "-webkit-border-radius": "10px",
            "-moz-border-radius": "10px"
        }, iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank",
        forceIframe: false,
        baseZ: 1000,
        centerX: true,
        centerY: true,
        allowBodyStretch: true,
        bindEvents: true,
        constrainTabKey: true,
        fadeIn: 200,
        fadeOut: 400,
        timeout: 0,
        showOverlay: true,
        focusInput: true,
        applyPlatformOpacityRules: true,
        onUnblock: null,
        quirksmodeOffsetHack: 4
    };
    var b = null;
    var f = [];

    function c(r, p) {
        var C = (r == window);
        var s = p && p.message !== undefined ? p.message : undefined;
        p = g.extend({}, g.blockUI.defaults, p || {});
        p.overlayCSS = g.extend({}, g.blockUI.defaults.overlayCSS, p.overlayCSS || {});
        var B = g.extend({}, g.blockUI.defaults.css, p.css || {});
        s = s === undefined ? p.message : s;
        if (C && b) {
            h(window, {
                fadeOut: 0
            })
        }
        if (s && typeof s != "string" && (s.parentNode || s.jquery)) {
            var v = s.jquery ? s[0] : s;
            var A = {};
            g(r).data("blockUI.history", A);
            A.el = v;
            A.parent = v.parentNode;
            A.display = v.style.display;
            A.position = v.style.position;
            if (A.parent) {
                A.parent.removeChild(v)
            }
        }
        var D = p.baseZ;
        var y = (g.browser.msie || p.forceIframe) ? g('<iframe class="blockUI" style="z-index:' + (D++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + p.iframeSrc + '"></iframe>') : g('<div class="blockUI" style="display:none"></div>');
        var x = g('<div class="blockUI blockOverlay" style="z-index:' + (D++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
        var u = C ? g('<div class="blockUI blockMsg blockPage" style="z-index:' + D + ';display:none;position:fixed"></div>') : g('<div class="blockUI blockMsg blockElement" style="z-index:' + D + ';display:none;position:absolute"></div>');
        if (s) {
            u.css(B)
        }
        if (!p.applyPlatformOpacityRules || !(g.browser.mozilla && /Linux/.test(navigator.platform))) {
            x.css(p.overlayCSS)
        }
        x.css("position", C ? "fixed" : "absolute");
        if (g.browser.msie || p.forceIframe) {
            y.css("opacity", 0)
        }
        g([y[0], x[0], u[0]]).appendTo(C ? "body" : r);
        var G = d && (!g.boxModel || g("object,embed", C ? null : r).length > 0);
        if (e || G) {
            if (C && p.allowBodyStretch && g.boxModel) {
                g("html,body").css("height", "100%")
            }
            if ((e || !g.boxModel) && !C) {
                var H = m(r, "borderTopWidth"),
                    w = m(r, "borderLeftWidth");
                var F = H ? "(0 - " + H + ")" : 0;
                var q = w ? "(0 - " + w + ")" : 0
            }
            g.each([y, x, u], function(t, L) {
                var I = L[0].style;
                I.position = "absolute";
                if (t < 2) {
                    C ? I.setExpression("height", "Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:" + p.quirksmodeOffsetHack + ') + "px"') : I.setExpression("height", 'this.parentNode.offsetHeight + "px"');
                    C ? I.setExpression("width", 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : I.setExpression("width", 'this.parentNode.offsetWidth + "px"');
                    if (q) {
                        I.setExpression("left", q)
                    }
                    if (F) {
                        I.setExpression("top", F)
                    }
                } else {
                    if (p.centerY) {
                        if (C) {
                            I.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
                        }
                        I.marginTop = 0
                    } else {
                        if (!p.centerY && C) {
                            var J = (p.css && p.css.top) ? parseInt(p.css.top) : 0;
                            var K = "((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + " + J + ') + "px"';
                            I.setExpression("top", K)
                        }
                    }
                }
            })
        }
        if (s) {
            u.append(s);
            if (s.jquery || s.nodeType) {
                g(s).show()
            }
        }
        if ((g.browser.msie || p.forceIframe) && p.showOverlay) {
            y.show()
        }
        if (p.fadeIn) {
            if (p.showOverlay) {
                x._fadeIn(p.fadeIn)
            }
            if (s) {
                u.fadeIn(p.fadeIn)
            }
        } else {
            if (p.showOverlay) {
                x.show()
            }
            if (s) {
                u.show()
            }
        }
        l(1, r, p);
        if (C) {
            b = u[0];
            f = g(":input:enabled:visible", b);
            if (p.focusInput) {
                setTimeout(o, 20)
            }
        } else {
            a(u[0], p.centerX, p.centerY)
        }
        if (p.timeout) {
            var E = setTimeout(function() {
                C ? g.unblockUI(p) : g(r).unblock(p)
            }, p.timeout);
            g(r).data("blockUI.timeout", E)
        }
    }
    function h(s, t) {
        var r = s == window;
        var q = g(s);
        var u = q.data("blockUI.history");
        var v = q.data("blockUI.timeout");
        if (v) {
            clearTimeout(v);
            q.removeData("blockUI.timeout")
        }
        t = g.extend({}, g.blockUI.defaults, t || {});
        l(0, s, t);
        var p = r ? g("body").children().filter(".blockUI") : g(".blockUI", s);
        if (r) {
            b = f = null
        }
        if (t.fadeOut) {
            p.fadeOut(t.fadeOut);
            setTimeout(function() {
                k(p, u, t, s)
            }, t.fadeOut)
        } else {
            k(p, u, t, s)
        }
    }
    function k(p, s, r, q) {
        p.each(function(t, u) {
            if (this.parentNode) {
                this.parentNode.removeChild(this)
            }
        });
        if (s && s.el) {
            s.el.style.display = s.display;
            s.el.style.position = s.position;
            if (s.parent) {
                s.parent.appendChild(s.el)
            }
            g(s.el).removeData("blockUI.history")
        }
        if (typeof r.onUnblock == "function") {
            r.onUnblock(q, r)
        }
    }
    function l(p, t, u) {
        var s = t == window,
            r = g(t);
        if (!p && (s && !b || !s && !r.data("blockUI.isBlocked"))) {
            return
        }
        if (!s) {
            r.data("blockUI.isBlocked", p)
        }
        if (!u.bindEvents || (p && !u.showOverlay)) {
            return
        }
        var q = "mousedown mouseup keydown keypress";
        p ? g(document).bind(q, u, n) : g(document).unbind(q, n)
    }
    function n(s) {
        if (s.keyCode && s.keyCode == 9) {
            if (b && s.data.constrainTabKey) {
                var r = f;
                var q = !s.shiftKey && s.target == r[r.length - 1];
                var p = s.shiftKey && s.target == r[0];
                if (q || p) {
                    setTimeout(function() {
                        o(p)
                    }, 10);
                    return false
                }
            }
        }
        if (g(s.target).parents("div.blockMsg").length > 0) {
            return true
        }
        return g(s.target).parents().children().filter("div.blockUI").length == 0
    }
    function o(p) {
        if (!f) {
            return
        }
        var q = f[p === true ? f.length - 1 : 0];
        if (q) {
            q.focus()
        }
    }
    function a(w, q, B) {
        var A = w.parentNode,
            v = w.style;
        var r = ((A.offsetWidth - w.offsetWidth) / 2) - m(A, "borderLeftWidth");
        var u = ((A.offsetHeight - w.offsetHeight) / 2) - m(A, "borderTopWidth");
        if (q) {
            v.left = r > 0 ? (r + "px") : "0"
        }
        if (B) {
            v.top = u > 0 ? (u + "px") : "0"
        }
    }
    function m(q, r) {
        return parseInt(g.css(q, r)) || 0
    }
})(jQuery);
jQuery.fn.addColorPicker = function(b) {
    if (!b) {
        b = []
    }
    b = jQuery.extend({
        colors: ["#000000", "#000033", "#000066", "#000099", "#0000CC", "#0000FF", "#330000", "#330033", "#330066", "#330099", "#3300CC", "#3300FF", "#660000", "#660033", "#660066", "#660099", "#6600CC", "#6600FF", "#990000", "#990033", "#990066", "#990099", "#9900CC", "#9900FF", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#003300", "#003333", "#003366", "#003399", "#0033CC", "#0033FF", "#333300", "#333333", "#333366", "#333399", "#3333CC", "#3333FF", "#663300", "#663333", "#663366", "#663399", "#6633CC", "#6633FF", "#993300", "#993333", "#993366", "#993399", "#9933CC", "#9933FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#006600", "#006633", "#006666", "#006699", "#0066CC", "#0066FF", "#336600", "#336633", "#336666", "#336699", "#3366CC", "#3366FF", "#666600", "#666633", "#666666", "#666699", "#6666CC", "#6666FF", "#996600", "#996633", "#996666", "#996699", "#9966CC", "#9966FF", "#CC6600", "#CC6633", "#CC6666", "#CC6699", "#CC66CC", "#CC66FF", "#FF6600", "#FF6633", "#FF6666", "#FF6699", "#FF66CC", "#FF66FF", "#009900", "#009933", "#009966", "#009999", "#0099CC", "#0099FF", "#339900", "#339933", "#339966", "#339999", "#3399CC", "#3399FF", "#669900", "#669933", "#669966", "#669999", "#6699CC", "#6699FF", "#999900", "#999933", "#999966", "#999999", "#9999CC", "#9999FF", "#CC9900", "#CC9933", "#CC9966", "#CC9999", "#CC99CC", "#CC99FF", "#FF9900", "#FF9933", "#FF9966", "#FF9999", "#FF99CC", "#FF99FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#66CC00", "#66CC33", "#66CC66", "#66CC99", "#66CCCC", "#66CCFF", "#99CC00", "#99CC33", "#99CC66", "#99CC99", "#99CCCC", "#99CCFF", "#CCCC00", "#CCCC33", "#CCCC66", "#CCCC99", "#CCCCCC", "#CCCCFF", "#FFCC00", "#FFCC33", "#FFCC66", "#FFCC99", "#FFCCCC", "#FFCCFF", "#00FF00", "#00FF33", "#00FF66", "#00FF99", "#00FFCC", "#00FFFF", "#33FF00", "#33FF33", "#33FF66", "#33FF99", "#33FFCC", "#33FFFF", "#66FF00", "#66FF33", "#66FF66", "#66FF99", "#66FFCC", "#66FFFF", "#99FF00", "#99FF33", "#99FF66", "#99FF99", "#99FFCC", "#99FFFF", "#CCFF00", "#CCFF33", "#CCFF66", "#CCFF99", "#CCFFCC", "#CCFFFF", "#FFFF00", "#FFFF33", "#FFFF66", "#FFFF99", "#FFFFCC", "#FFFFFF"],
        width: "36",
        autoClose: "yes",
        colorBg: "yes",
        showCode: "yes",
        cursor: "crosshair",
        bgColor: "#000000",
        closeText: "Close",
        callback: ""
    }, b);

    function a(f) {
        var d = /\d+/g;
        var e = f.match(d);
        for (var c = 0; c < e.length; c++) {
            e[c] = parseInt(e[c]).toString(16);
            if (e[c].length < 2) {
                e[c] = "0" + e[c]
            }
        }
        return "#" + e[0] + e[1] + e[2]
    }
    $(this).click(function() {
        var k = b.colors.length;
        var f = jQuery('<div id="col_container"></div>').hide().css({
            "border-color": "#000000",
            "border-style": "solid",
            "border-width": "1px",
            "z-index": 2
        }).html("");
        f.css({
            cursor: b.cursor
        });
        f.css({
            "background-color": b.bgColor
        });
        var e = $(this);
        for (i = 0; i < k; i++) {
            if ((i % b.width) == 0) {
                if (i > 0) {
                    f.append("<br />")
                }
            }
            var d = jQuery("<span style='background-color:" + b.colors[i] + "; class='all_colors'>&nbsp;</span>");
            d.appendTo(f);
            d.click(function() {
                var n = $(this).css("background-color");
                if (n.indexOf("rgb") != -1) {
                    var m = a(n)
                } else {
                    m = n
                }
                if (b.colorBg == "yes") {
                    e.css({
                        "background-color": m
                    })
                }
                if (b.showCode == "yes") {
                    e.val(m)
                }
                if (b.autoClose == "yes") {
                    f.hide()
                }
                if (b.callback) {
                    b.callback(m)
                }
            });
            d.mouseover(function() {
                var n = $(this).css("background-color");
                if (n.indexOf("rgb") != -1) {
                    var m = a(n)
                } else {
                    m = n
                }
                if (b.colorBg == "yes") {
                    e.css({
                        "background-color": m
                    })
                }
                if (b.showCode == "yes") {
                    e.val(m)
                }
                if (b.callback) {
                    b.callback(m)
                }
            })
        }
        f.insertAfter($(this));
        var h = $(this).position();
        var g = h.top;
        var j = h.left;
        var l = $(this).width();
        f.css({
            position: "absolute",
            top: g - 20,
            left: l + j
        });
        f.show();
        if (b.autoClose !== "yes") {
            var c = jQuery("<br /> <a href='#' id='link_close'>" + b.closeText + "</a>");
            c.appendTo(f);
            c.click(function() {
                f.hide()
            })
        }
    });
    return this
};
if (jQuery) {
    (function() {
        $.extend($.fn, {
            contextMenu: function(a, b) {
                if (a.menu == undefined) {
                    return false
                }
                if (a.inSpeed == undefined) {
                    a.inSpeed = 150
                }
                if (a.outSpeed == undefined) {
                    a.outSpeed = 75
                }
                if (a.inSpeed == 0) {
                    a.inSpeed = -1
                }
                if (a.outSpeed == 0) {
                    a.outSpeed = -1
                }
                $(this).each(function() {
                    var c = $(this);
                    var d = $(c).offset();
                    $("#" + a.menu).addClass("contextMenu");
                    $(this).mousedown(function(g) {
                        var f = g;
                        $(this).mouseup(function(k) {
                            var j = $(this);
                            $(this).unbind("mouseup");
                            if (f.button == 2) {
                                $(".contextMenu").hide();
                                var m = $("#" + a.menu);
                                if ($(c).hasClass("disabled")) {
                                    return false
                                }
                                var l = {},
                                    h, n;
                                if (self.innerHeight) {
                                    l.pageYOffset = self.pageYOffset;
                                    l.pageXOffset = self.pageXOffset;
                                    l.innerHeight = self.innerHeight;
                                    l.innerWidth = self.innerWidth
                                } else {
                                    if (document.documentElement && document.documentElement.clientHeight) {
                                        l.pageYOffset = document.documentElement.scrollTop;
                                        l.pageXOffset = document.documentElement.scrollLeft;
                                        l.innerHeight = document.documentElement.clientHeight;
                                        l.innerWidth = document.documentElement.clientWidth
                                    } else {
                                        if (document.body) {
                                            l.pageYOffset = document.body.scrollTop;
                                            l.pageXOffset = document.body.scrollLeft;
                                            l.innerHeight = document.body.clientHeight;
                                            l.innerWidth = document.body.clientWidth
                                        }
                                    }
                                } (k.pageX) ? h = k.pageX : h = k.clientX + l.scrollLeft;
                                (k.pageY) ? n = k.pageY : h = k.clientY + l.scrollTop;
                                $(document).unbind("click");
                                $(m).css({
                                    top: n,
                                    left: h
                                }).fadeIn(a.inSpeed);
                                $(m).find("A").mouseover(function() {
                                    $(m).find("LI.hover").removeClass("hover");
                                    $(this).parent().addClass("hover")
                                }).mouseout(function() {
                                    $(m).find("LI.hover").removeClass("hover")
                                });
                                $(document).keypress(function(o) {
                                    switch (o.keyCode) {
                                        case 38:
                                            if ($(m).find("LI.hover").size() == 0) {
                                                $(m).find("LI:last").addClass("hover")
                                            } else {
                                                $(m).find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");
                                                if ($(m).find("LI.hover").size() == 0) {
                                                    $(m).find("LI:last").addClass("hover")
                                                }
                                            }
                                            break;
                                        case 40:
                                            if ($(m).find("LI.hover").size() == 0) {
                                                $(m).find("LI:first").addClass("hover")
                                            } else {
                                                $(m).find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");
                                                if ($(m).find("LI.hover").size() == 0) {
                                                    $(m).find("LI:first").addClass("hover")
                                                }
                                            }
                                            break;
                                        case 13:
                                            $(m).find("LI.hover A").trigger("click");
                                            break;
                                        case 27:
                                            $(document).trigger("click");
                                            break
                                    }
                                });
                                $("#" + a.menu).find("A").unbind("click");
                                $("#" + a.menu).find("LI:not(.disabled) A").click(function() {
                                    $(document).unbind("click").unbind("keypress");
                                    $(".contextMenu").hide();
                                    if (b) {
                                        b($(this).attr("href").substr(1), $(j), {
                                            x: h - d.left,
                                            y: n - d.top,
                                            docX: h,
                                            docY: n
                                        })
                                    }
                                    return false
                                });
                                setTimeout(function() {
                                    $(document).click(function() {
                                        $(document).unbind("click").unbind("keypress");
                                        $(m).fadeOut(a.outSpeed);
                                        return false
                                    })
                                }, 0)
                            }
                        })
                    });
                    if ($.browser.mozilla) {
                        $("#" + a.menu).each(function() {
                            $(this).css({
                                MozUserSelect: "none"
                            })
                        })
                    } else {
                        if ($.browser.msie) {
                            $("#" + a.menu).each(function() {
                                $(this).bind("selectstart.disableTextSelect", function() {
                                    return false
                                })
                            })
                        } else {
                            $("#" + a.menu).each(function() {
                                $(this).bind("mousedown.disableTextSelect", function() {
                                    return false
                                })
                            })
                        }
                    }
                    $(c).add("UL.contextMenu").bind("contextmenu", function() {
                        return false
                    })
                });
                return $(this)
            }, disableContextMenuItems: function(a) {
                if (a == undefined) {
                    $(this).find("LI").addClass("disabled");
                    return ($(this))
                }
                $(this).each(function() {
                    if (a != undefined) {
                        var c = a.split(",");
                        for (var b = 0; b < c.length; b++) {
                            $(this).find('A[href="' + c[b] + '"]').parent().addClass("disabled")
                        }
                    }
                });
                return ($(this))
            }, enableContextMenuItems: function(a) {
                if (a == undefined) {
                    $(this).find("LI.disabled").removeClass("disabled");
                    return ($(this))
                }
                $(this).each(function() {
                    if (a != undefined) {
                        var c = a.split(",");
                        for (var b = 0; b < c.length; b++) {
                            $(this).find('A[href="' + c[b] + '"]').parent().removeClass("disabled")
                        }
                    }
                });
                return ($(this))
            }, disableContextMenu: function() {
                $(this).each(function() {
                    $(this).addClass("disabled")
                });
                return ($(this))
            }, enableContextMenu: function() {
                $(this).each(function() {
                    $(this).removeClass("disabled")
                });
                return ($(this))
            }, destroyContextMenu: function() {
                $(this).each(function() {
                    $(this).unbind("mousedown").unbind("mouseup")
                });
                return ($(this))
            }
        })
    })(jQuery)
}
jQuery.cookie = function(b, j, m) {
    if (typeof j != "undefined") {
        m = m || {};
        if (j === null) {
            j = "";
            m = $.extend({}, m);
            m.expires = -1
        }
        var e = "";
        if (m.expires && (typeof m.expires == "number" || m.expires.toUTCString)) {
            var f;
            if (typeof m.expires == "number") {
                f = new Date();
                f.setTime(f.getTime() + (m.expires * 24 * 60 * 60 * 1000))
            } else {
                f = m.expires
            }
            e = "; expires=" + f.toUTCString()
        }
        var l = m.path ? "; path=" + (m.path) : "";
        var g = m.domain ? "; domain=" + (m.domain) : "";
        var a = m.secure ? "; secure" : "";
        document.cookie = [b, "=", encodeURIComponent(j), e, l, g, a].join("")
    } else {
        var d = null;
        if (document.cookie && document.cookie != "") {
            var k = document.cookie.split(";");
            for (var h = 0; h < k.length; h++) {
                var c = jQuery.trim(k[h]);
                if (c.substring(0, b.length + 1) == (b + "=")) {
                    d = decodeURIComponent(c.substring(b.length + 1));
                    break
                }
            }
        }
        return d
    }
};
(function(b) {
    b.fn.ajaxSubmit = function(t) {
        if (!this.length) {
            a("ajaxSubmit: skipping submit process - no element selected");
            return this
        }
        if (typeof t == "function") {
            t = {
                success: t
            }
        }
        var e = b.trim(this.attr("action"));
        if (e) {
            e = (e.match(/^([^#]+)/) || [])[1]
        }
        e = e || window.location.href || "";
        t = b.extend({
            url: e,
            type: this.attr("method") || "GET"
        }, t || {});
        var v = {};
        this.trigger("form-pre-serialize", [this, t, v]);
        if (v.veto) {
            a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");
            return this
        }
        if (t.beforeSerialize && t.beforeSerialize(this, t) === false) {
            a("ajaxSubmit: submit aborted via beforeSerialize callback");
            return this
        }
        var o = this.formToArray(t.semantic);
        if (t.data) {
            t.extraData = t.data;
            for (var f in t.data) {
                if (t.data[f] instanceof Array) {
                    for (var g in t.data[f]) {
                        o.push({
                            name: f,
                            value: t.data[f][g]
                        })
                    }
                } else {
                    o.push({
                        name: f,
                        value: t.data[f]
                    })
                }
            }
        }
        if (t.beforeSubmit && t.beforeSubmit(o, this, t) === false) {
            a("ajaxSubmit: submit aborted via beforeSubmit callback");
            return this
        }
        this.trigger("form-submit-validate", [o, this, t, v]);
        if (v.veto) {
            a("ajaxSubmit: submit vetoed via form-submit-validate trigger");
            return this
        }
        var d = b.param(o);
        if (t.type.toUpperCase() == "GET") {
            t.url += (t.url.indexOf("?") >= 0 ? "&" : "?") + d;
            t.data = null
        } else {
            t.data = d
        }
        var u = this,
            m = [];
        if (t.resetForm) {
            m.push(function() {
                u.resetForm()
            })
        }
        if (t.clearForm) {
            m.push(function() {
                u.clearForm()
            })
        }
        if (!t.dataType && t.target) {
            var r = t.success ||
            function() { };
            m.push(function(j) {
                b(t.target).html(j).each(r, arguments)
            })
        } else {
            if (t.success) {
                m.push(t.success)
            }
        }
        t.success = function(q, k) {
            for (var n = 0, j = m.length; n < j; n++) {
                m[n].apply(t, [q, k, u])
            }
        };
        var c = b("input:file", this).fieldValue();
        var s = false;
        for (var l = 0; l < c.length; l++) {
            if (c[l]) {
                s = true
            }
        }
        var h = false;
        if (t.iframe || s || h) {
            if (t.closeKeepAlive) {
                b.get(t.closeKeepAlive, p)
            } else {
                p()
            }
        } else {
            b.ajax(t)
        }
        this.trigger("form-submit-notify", [this, t]);
        return this;

        function p() {
            var x = u[0];
            if (b(":input[name=submit]", x).length) {
                alert('Error: Form elements must not be named "submit".');
                return
            }
            var q = b.extend({}, b.ajaxSettings, t);
            var I = b.extend(true, {}, b.extend(true, {}, b.ajaxSettings), q);
            var w = "jqFormIO" + (new Date().getTime());
            var E = b('<iframe id="' + w + '" name="' + w + '" src="about:blank" />');
            var G = E[0];
            E.css({
                position: "absolute",
                top: "-1000px",
                left: "-1000px"
            });
            var H = {
                aborted: 0,
                responseText: null,
                responseXML: null,
                status: 0,
                statusText: "n/a",
                getAllResponseHeaders: function() { }, getResponseHeader: function() { }, setRequestHeader: function() { }, abort: function() {
                    this.aborted = 1;
                    E.attr("src", "about:blank")
                }
            };
            var F = q.global;
            if (F && !b.active++) {
                b.event.trigger("ajaxStart")
            }
            if (F) {
                b.event.trigger("ajaxSend", [H, q])
            }
            if (I.beforeSend && I.beforeSend(H, I) === false) {
                I.global && b.active--;
                return
            }
            if (H.aborted) {
                return
            }
            var k = 0;
            var A = 0;
            var j = x.clk;
            if (j) {
                var y = j.name;
                if (y && !j.disabled) {
                    t.extraData = t.extraData || {};
                    t.extraData[y] = j.value;
                    if (j.type == "image") {
                        t.extraData[name + ".x"] = x.clk_x;
                        t.extraData[name + ".y"] = x.clk_y
                    }
                }
            }
            setTimeout(function() {
                var L = u.attr("target"),
                    J = u.attr("action");
                x.setAttribute("target", w);
                if (x.getAttribute("method") != "POST") {
                    x.setAttribute("method", "POST")
                }
                if (x.getAttribute("action") != q.url) {
                    x.setAttribute("action", q.url)
                }
                if (!t.skipEncodingOverride) {
                    u.attr({
                        encoding: "multipart/form-data",
                        enctype: "multipart/form-data"
                    })
                }
                if (q.timeout) {
                    setTimeout(function() {
                        A = true;
                        B()
                    }, q.timeout)
                }
                var K = [];
                try {
                    if (t.extraData) {
                        for (var M in t.extraData) {
                            K.push(b('<input type="hidden" name="' + M + '" value="' + t.extraData[M] + '" />').appendTo(x)[0])
                        }
                    }
                    E.appendTo("body");
                    G.attachEvent ? G.attachEvent("onload", B) : G.addEventListener("load", B, false);
                    x.submit()
                } finally {
                    x.setAttribute("action", J);
                    L ? x.setAttribute("target", L) : u.removeAttr("target");
                    b(K).remove()
                }
            }, 10);
            var C = 0;

            function B() {
                if (k++) {
                    return
                }
                G.detachEvent ? G.detachEvent("onload", B) : G.removeEventListener("load", B, false);
                var J = true;
                try {
                    if (A) {
                        throw "timeout"
                    }
                    var K, M;
                    M = G.contentWindow ? G.contentWindow.document : G.contentDocument ? G.contentDocument : G.document;
                    if ((M.body == null || M.body.innerHTML == "") && !C) {
                        C = 1;
                        k--;
                        setTimeout(B, 100);
                        return
                    }
                    H.responseText = M.body ? M.body.innerHTML : null;
                    H.responseXML = M.XMLDocument ? M.XMLDocument : M;
                    H.getResponseHeader = function(P) {
                        var O = {
                            "content-type": q.dataType
                        };
                        return O[P]
                    };
                    if (q.dataType == "json" || q.dataType == "script") {
                        var n = M.getElementsByTagName("textarea")[0];
                        H.responseText = n ? n.value : H.responseText
                    } else {
                        if (q.dataType == "xml" && !H.responseXML && H.responseText != null) {
                            H.responseXML = D(H.responseText)
                        }
                    }
                    K = b.httpData(H, q.dataType)
                } catch (L) {
                    J = false;
                    b.handleError(q, H, "error", L)
                }
                if (J) {
                    q.success(K, "success");
                    if (F) {
                        b.event.trigger("ajaxSuccess", [H, q])
                    }
                }
                if (F) {
                    b.event.trigger("ajaxComplete", [H, q])
                }
                if (F && ! --b.active) {
                    b.event.trigger("ajaxStop")
                }
                if (q.complete) {
                    q.complete(H, J ? "success" : "error")
                }
                setTimeout(function() {
                    E.remove();
                    H.responseXML = null
                }, 100)
            }
            function D(n, J) {
                if (window.ActiveXObject) {
                    J = new ActiveXObject("Microsoft.XMLDOM");
                    J.async = "false";
                    J.loadXML(n)
                } else {
                    J = (new DOMParser()).parseFromString(n, "text/xml")
                }
                return (J && J.documentElement && J.documentElement.tagName != "parsererror") ? J : null
            }
        }
    };
    b.fn.ajaxForm = function(c) {
        return this.ajaxFormUnbind().bind("submit.form-plugin", function() {
            b(this).ajaxSubmit(c);
            return false
        }).each(function() {
            b(":submit,input:image", this).bind("click.form-plugin", function(f) {
                var d = this.form;
                d.clk = this;
                if (this.type == "image") {
                    if (f.offsetX != undefined) {
                        d.clk_x = f.offsetX;
                        d.clk_y = f.offsetY
                    } else {
                        if (typeof b.fn.offset == "function") {
                            var g = b(this).offset();
                            d.clk_x = f.pageX - g.left;
                            d.clk_y = f.pageY - g.top
                        } else {
                            d.clk_x = f.pageX - this.offsetLeft;
                            d.clk_y = f.pageY - this.offsetTop
                        }
                    }
                }
                setTimeout(function() {
                    d.clk = d.clk_x = d.clk_y = null
                }, 10)
            })
        })
    };
    b.fn.ajaxFormUnbind = function() {
        this.unbind("submit.form-plugin");
        return this.each(function() {
            b(":submit,input:image", this).unbind("click.form-plugin")
        })
    };
    b.fn.formToArray = function(q) {
        var p = [];
        if (this.length == 0) {
            return p
        }
        var d = this[0];
        var h = q ? d.getElementsByTagName("*") : d.elements;
        if (!h) {
            return p
        }
        for (var k = 0, m = h.length; k < m; k++) {
            var e = h[k];
            var f = e.name;
            if (!f) {
                continue
            }
            if (q && d.clk && e.type == "image") {
                if (!e.disabled && d.clk == e) {
                    p.push({
                        name: f,
                        value: b(e).val()
                    });
                    p.push({
                        name: f + ".x",
                        value: d.clk_x
                    }, {
                        name: f + ".y",
                        value: d.clk_y
                    })
                }
                continue
            }
            var r = b.fieldValue(e, true);
            if (r && r.constructor == Array) {
                for (var g = 0, c = r.length; g < c; g++) {
                    p.push({
                        name: f,
                        value: r[g]
                    })
                }
            } else {
                if (r !== null && typeof r != "undefined") {
                    p.push({
                        name: f,
                        value: r
                    })
                }
            }
        }
        if (!q && d.clk) {
            var l = b(d.clk),
                o = l[0],
                f = o.name;
            if (f && !o.disabled && o.type == "image") {
                p.push({
                    name: f,
                    value: l.val()
                });
                p.push({
                    name: f + ".x",
                    value: d.clk_x
                }, {
                    name: f + ".y",
                    value: d.clk_y
                })
            }
        }
        return p
    };
    b.fn.formSerialize = function(c) {
        return b.param(this.formToArray(c))
    };
    b.fn.fieldSerialize = function(d) {
        var c = [];
        this.each(function() {
            var h = this.name;
            if (!h) {
                return
            }
            var f = b.fieldValue(this, d);
            if (f && f.constructor == Array) {
                for (var g = 0, e = f.length; g < e; g++) {
                    c.push({
                        name: h,
                        value: f[g]
                    })
                }
            } else {
                if (f !== null && typeof f != "undefined") {
                    c.push({
                        name: this.name,
                        value: f
                    })
                }
            }
        });
        return b.param(c)
    };
    b.fn.fieldValue = function(h) {
        for (var g = [], e = 0, c = this.length; e < c; e++) {
            var f = this[e];
            var d = b.fieldValue(f, h);
            if (d === null || typeof d == "undefined" || (d.constructor == Array && !d.length)) {
                continue
            }
            d.constructor == Array ? b.merge(g, d) : g.push(d)
        }
        return g
    };
    b.fieldValue = function(c, j) {
        var e = c.name,
            p = c.type,
            q = c.tagName.toLowerCase();
        if (typeof j == "undefined") {
            j = true
        }
        if (j && (!e || c.disabled || p == "reset" || p == "button" || (p == "checkbox" || p == "radio") && !c.checked || (p == "submit" || p == "image") && c.form && c.form.clk != c || q == "select" && c.selectedIndex == -1)) {
            return null
        }
        if (q == "select") {
            var k = c.selectedIndex;
            if (k < 0) {
                return null
            }
            var m = [],
                d = c.options;
            var g = (p == "select-one");
            var l = (g ? k + 1 : d.length);
            for (var f = (g ? k : 0); f < l; f++) {
                var h = d[f];
                if (h.selected) {
                    var o = h.value;
                    if (!o) {
                        o = (h.attributes && h.attributes.value && !(h.attributes.value.specified)) ? h.text : h.value
                    }
                    if (g) {
                        return o
                    }
                    m.push(o)
                }
            }
            return m
        }
        return c.value
    };
    b.fn.clearForm = function() {
        return this.each(function() {
            b("input,select,textarea", this).clearFields()
        })
    };
    b.fn.clearFields = b.fn.clearInputs = function() {
        return this.each(function() {
            var d = this.type,
                c = this.tagName.toLowerCase();
            if (d == "text" || d == "password" || c == "textarea") {
                this.value = ""
            } else {
                if (d == "checkbox" || d == "radio") {
                    this.checked = false
                } else {
                    if (c == "select") {
                        this.selectedIndex = -1
                    }
                }
            }
        })
    };
    b.fn.resetForm = function() {
        return this.each(function() {
            if (typeof this.reset == "function" || (typeof this.reset == "object" && !this.reset.nodeType)) {
                this.reset()
            }
        })
    };
    b.fn.enable = function(c) {
        if (c == undefined) {
            c = true
        }
        return this.each(function() {
            this.disabled = !c
        })
    };
    b.fn.selected = function(c) {
        if (c == undefined) {
            c = true
        }
        return this.each(function() {
            var d = this.type;
            if (d == "checkbox" || d == "radio") {
                this.checked = c
            } else {
                if (this.tagName.toLowerCase() == "option") {
                    var e = b(this).parent("select");
                    if (c && e[0] && e[0].type == "select-one") {
                        e.find("option").selected(false)
                    }
                    this.selected = c
                }
            }
        })
    };

    function a() {
        if (b.fn.ajaxSubmit.debug && window.console && window.console.log) {
            window.console.log("[jquery.form] " + Array.prototype.join.call(arguments, ""))
        }
    }
})(jQuery);
jQuery(function(K) {
    var L = navigator.userAgent.toLowerCase();
    var V = (L.match(/.+(?:rv|webkit|khtml|opera|msie)[\/: ]([\d.]+)/) || [0, "0"])[1];
    var ag = (/msie/.test(L) && !/opera/.test(L) && parseInt(V) < 7 && (!window.XMLHttpRequest || typeof (XMLHttpRequest) === "function"));
    var y = K("body");
    var an;
    var j;
    var W = false;
    var af = {};
    var Q = false;
    var ah;
    var m;
    var t = {
        started: false,
        ready: false,
        dataReady: false,
        anim: false,
        animContent: false,
        loadingShown: false,
        transition: false,
        resizing: false,
        closing: false,
        error: false,
        blocker: null,
        blockerVars: null,
        full: null,
        bg: null,
        loading: null,
        tmp: null,
        content: null,
        wrapper: null,
        contentWrapper: null,
        scripts: new Array(),
        scriptsShown: new Array()
    };
    var ae = {
        width: false,
        height: false,
        windowResizing: false
    };
    var O = {
        width: null,
        height: null,
        windowResizing: true
    };
    var S;
    K.fn.nyroModal = function(ao) {
        if (!this) {
            return false
        }
        return this.each(function() {
            var ap = K(this);
            if (this.nodeName.toLowerCase() == "form") {
                ap.unbind("submit.nyroModal").bind("submit.nyroModal", function(aq) {
                    if (aq.isDefaultPrevented()) {
                        return false
                    }
                    if (ap.data("nyroModalprocessing")) {
                        return true
                    }
                    if (this.enctype == "multipart/form-data") {
                        b(K.extend(ao, {
                            from: this
                        }));
                        return true
                    }
                    aq.preventDefault();
                    b(K.extend(ao, {
                        from: this
                    }));
                    return false
                })
            } else {
                ap.unbind("click.nyroModal").bind("click.nyroModal", function(aq) {
                    if (aq.isDefaultPrevented()) {
                        return false
                    }
                    aq.preventDefault();
                    b(K.extend(ao, {
                        from: this
                    }));
                    return false
                })
            }
        })
    };
    K.fn.nyroModalManual = function(ao) {
        if (!this.length) {
            b(ao)
        }
        return this.each(function() {
            b(K.extend(ao, {
                from: this
            }))
        })
    };
    K.nyroModalManual = function(ao) {
        b(ao)
    };
    K.nyroModalSettings = function(aq, ap, ao) {
        Y(aq, ap, ao);
        if (!ap && t.started) {
            if (t.bg && aq.bgColor) {
                an.updateBgColor(t, an, function() { })
            }
            if (t.contentWrapper && aq.title) {
                D()
            }
            if (!t.error && (aq.windowResizing || (!t.resizing && (("width" in aq && aq.width == an.width) || ("height" in aq && aq.height == an.height))))) {
                t.resizing = true;
                if (t.contentWrapper) {
                    h(true)
                }
                if (t.contentWrapper && t.contentWrapper.is(":visible") && !t.animContent) {
                    if (Q) {
                        t.content.css({
                            position: ""
                        })
                    }
                    an.resize(t, an, function() {
                        an.windowResizing = false;
                        t.resizing = false;
                        if (Q) {
                            t.content.css({
                                position: "fixed"
                            })
                        }
                        if (K.isFunction(an.endResize)) {
                            an.endResize(t, an)
                        }
                    })
                }
            }
        }
    };
    K.nyroModalRemove = function() {
        u()
    };
    K.nyroModalNext = function() {
        var ao = c(1);
        if (ao) {
            return ao.nyroModalManual(d())
        }
        return false
    };
    K.nyroModalPrev = function() {
        var ao = c(-1);
        if (ao) {
            return ao.nyroModalManual(d())
        }
        return false
    };
    K.fn.nyroModal.settings = {
        debug: false,
        blocker: false,
        windowResize: true,
        modal: false,
        type: "",
        forceType: null,
        from: "",
        hash: "",
        processHandler: null,
        selIndicator: "nyroModalSel",
        formIndicator: "nyroModal",
        content: null,
        bgColor: "#000000",
        ajax: {}, swf: {
            wmode: "transparent"
        }, width: null,
        height: null,
        minWidth: 400,
        minHeight: 300,
        resizable: true,
        autoSizable: true,
        padding: 25,
        regexImg: "[^.].(jpg|jpeg|png|tiff|gif|bmp)s*$",
        addImageDivTitle: false,
        defaultImgAlt: "Image",
        setWidthImgTitle: true,
        ltr: true,
        gallery: null,
        galleryLinks: '<a href="#" class="nyroModalPrev">Prev</a><a href="#"  class="nyroModalNext">Next</a>',
        galleryCounts: P,
        galleryLoop: false,
        zIndexStart: 100,
        cssOpt: {
            bg: {
                position: "absolute",
                overflow: "hidden",
                top: 0,
                left: 0,
                height: "100%",
                width: "100%"
            }, wrapper: {
                position: "absolute",
                top: "50%",
                left: "50%"
            }, wrapper2: {}, content: {}, loading: {
                position: "absolute",
                top: "50%",
                left: "50%",
                marginTop: "-50px",
                marginLeft: "-50px"
            }
        }, wrap: {
            div: '<div class="wrapper"></div>',
            ajax: '<div class="wrapper"></div>',
            form: '<div class="wrapper"></div>',
            formData: '<div class="wrapper"></div>',
            image: '<div class="wrapperImg"></div>',
            swf: '<div class="wrapperSwf"></div>',
            iframe: '<div class="wrapperIframe"></div>',
            iframeForm: '<div class="wrapperIframe"></div>',
            manual: '<div class="wrapper"></div>'
        }, closeButton: '<a href="#" class="nyroModalClose" id="closeBut" title="close">关闭</a>',
        title: null,
        titleFromIframe: true,
        openSelector: ".nyroModal",
        closeSelector: ".nyroModalClose",
        contentLoading: '<a href="#" class="nyroModalClose">取消</a>',
        errorClass: "error",
        contentError: '您访问的内容暂时不可用。<br />请稍后再试。<br /><a href="#" class="nyroModalClose">关闭</a>',
        handleError: null,
        showBackground: M,
        hideBackground: E,
        endFillContent: null,
        showContent: H,
        endShowContent: null,
        beforeHideContent: null,
        hideContent: ac,
        showTransition: f,
        hideTransition: a,
        showLoading: o,
        hideLoading: I,
        resize: s,
        endResize: null,
        updateBgColor: g,
        endRemove: null
    };

    function b(aq) {
        if (t.loadingShown || t.transition || t.anim) {
            return
        }
        A("processModal");
        t.started = true;
        j = K.extend(true, aq);
        T(aq);
        if (!t.full) {
            t.blockerVars = t.blocker = null
        }
        t.error = false;
        t.closing = false;
        t.dataReady = false;
        t.scripts = new Array();
        t.scriptsShown = new Array();
        an.type = k();
        if (an.forceType) {
            if (!an.content) {
                an.from = true
            }
            an.type = an.forceType;
            an.forceType = null
        }
        if (K.isFunction(an.processHandler)) {
            an.processHandler(an)
        }
        var aw = an.from;
        var ap = an.url;
        O.width = an.width;
        O.height = an.height;
        if (an.type == "swf") {
            Y({
                overflow: "visible"
            }, "cssOpt", "content");
            an.content = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + an.width + '" height="' + an.height + '"><param name="movie" value="' + ap + '"></param>';
            var at = "";
            K.each(an.swf, function(az, aA) {
                an.content += '<param name="' + az + '" value="' + aA + '"></param>';
                at += " " + az + '="' + aA + '"'
            });
            an.content += '<embed src="' + ap + '" type="application/x-shockwave-flash" width="' + an.width + '" height="' + an.height + '"' + at + "></embed></object>"
        }
        if (aw) {
            var ay = K(aw).blur();
            if (an.type == "form") {
                var ar = K(aw).serializeArray();
                ar.push({
                    name: an.formIndicator,
                    value: 1
                });
                if (an.selector) {
                    ar.push({
                        name: an.selIndicator,
                        value: an.selector.substring(1)
                    })
                }
                aj();
                K.ajax(K.extend({}, an.ajax, {
                    url: ap,
                    data: ar,
                    type: ay.attr("method") ? ay.attr("method") : "get",
                    success: p,
                    error: r
                }));
                A("Form Ajax Load: " + ay.attr("action"))
            } else {
                if (an.type == "formData") {
                    J();
                    ay.attr("target", "nyroModalIframe");
                    ay.attr("action", ap);
                    ay.prepend('<input type="hidden" name="' + an.formIndicator + '" value="1" />');
                    if (an.selector) {
                        ay.prepend('<input type="hidden" name="' + an.selIndicator + '" value="' + an.selector.substring(1) + '" />')
                    }
                    t.tmp.html('<iframe frameborder="0" hspace="0" name="nyroModalIframe" src="javascript:\'\';"></iframe>');
                    K("iframe", t.tmp).css({
                        width: an.width,
                        height: an.height
                    }).error(r).load(e);
                    A("Form Data Load: " + ay.attr("action"));
                    aj();
                    v()
                } else {
                    if (an.type == "image") {
                        A("Image Load: " + ap);
                        var av = ay.attr("title") || an.defaultImgAlt;
                        J();
                        t.tmp.html('<img id="nyroModalImg" />').find("img").attr("alt", av);
                        t.tmp.css({
                            lineHeight: 0
                        });
                        K("img", t.tmp).error(r).load(function() {
                            A("Image Loaded: " + this.src);
                            K(this).unbind("load");
                            var az = t.tmp.width();
                            var aA = t.tmp.height();
                            t.tmp.css({
                                lineHeight: ""
                            });
                            ae.width = az;
                            ae.height = aA;
                            Y({
                                width: az,
                                height: aA,
                                imgWidth: az,
                                imgHeight: aA
                            });
                            O.width = az;
                            O.height = aA;
                            Y({
                                overflow: "visible"
                            }, "cssOpt", "content");
                            t.dataReady = true;
                            if (t.loadingShown || t.transition) {
                                v()
                            }
                        }).attr("src", ap);
                        aj()
                    } else {
                        if (an.type == "iframeForm") {
                            J();
                            t.tmp.html('<iframe frameborder="0" hspace="0" src="javascript:\'\';" name="nyroModalIframe" id="nyroModalIframe"></iframe>');
                            A("Iframe Form Load: " + ap);
                            K("iframe", t.tmp).eq(0).css({
                                width: "100%",
                                height: K.support.boxModel ? "99%" : "100%"
                            }).load(ak);
                            t.dataReady = true;
                            aj()
                        } else {
                            if (an.type == "iframe") {
                                J();
                                t.tmp.html('<iframe frameborder="0" hspace="0" src="javascript:\'\';" name="nyroModalIframe" id="nyroModalIframe"></iframe>');
                                A("Iframe Load: " + ap);
                                K("iframe", t.tmp).eq(0).css({
                                    width: "100%",
                                    height: K.support.boxModel ? "99%" : "100%"
                                }).load(ak);
                                t.dataReady = true;
                                aj()
                            } else {
                                if (an.type) {
                                    A("Content: " + an.type);
                                    J();
                                    t.tmp.html(an.content);
                                    var ax = t.tmp.width();
                                    var au = t.tmp.height();
                                    var ao = K(an.type);
                                    if (ao.length) {
                                        Y({
                                            type: "div"
                                        });
                                        ax = ao.width();
                                        au = ao.height();
                                        if (ah) {
                                            m = ah
                                        }
                                        ah = ao;
                                        t.tmp.append(ao.contents())
                                    }
                                    O.width = ax;
                                    O.height = au;
                                    Y({
                                        width: ax,
                                        height: au
                                    });
                                    if (t.tmp.html()) {
                                        t.dataReady = true
                                    } else {
                                        r()
                                    }
                                    if (!t.ready) {
                                        aj()
                                    } else {
                                        G()
                                    }
                                } else {
                                    A("Ajax Load: " + ap);
                                    Y({
                                        type: "ajax"
                                    });
                                    var ar = an.ajax.data || {};
                                    if (an.selector) {
                                        if (typeof ar == "string") {
                                            ar += "&" + an.selIndicator + "=" + an.selector.substring(1)
                                        } else {
                                            ar[an.selIndicator] = an.selector.substring(1)
                                        }
                                    }
                                    aj();
                                    K.ajax(K.extend(true, an.ajax, {
                                        url: ap,
                                        success: p,
                                        error: r,
                                        data: ar
                                    }))
                                }
                            }
                        }
                    }
                }
            }
        } else {
            if (an.content) {
                A("Content: " + an.type);
                Y({
                    type: "manual"
                });
                J();
                t.tmp.html(K("<div/>").html(an.content).contents());
                if (t.tmp.html()) {
                    t.dataReady = true
                } else {
                    r()
                }
                aj()
            } else { }
        }
    }
    function T(ao) {
        A("setDefaultCurrentSettings");
        an = K.extend(true, {}, K.fn.nyroModal.settings, ao);
        X()
    }
    function Y(aq, ap, ao) {
        if (t.started) {
            if (ap && ao) {
                K.extend(true, an[ap][ao], aq)
            } else {
                if (ap) {
                    K.extend(true, an[ap], aq)
                } else {
                    if (t.animContent) {
                        if ("width" in aq) {
                            if (!t.resizing) {
                                aq.setWidth = aq.width;
                                W = true
                            }
                            delete aq.width
                        }
                        if ("height" in aq) {
                            if (!t.resizing) {
                                aq.setHeight = aq.height;
                                W = true
                            }
                            delete aq.height
                        }
                    }
                    K.extend(true, an, aq)
                }
            }
        } else {
            if (ap && ao) {
                K.extend(true, K.fn.nyroModal.settings[ap][ao], aq)
            } else {
                if (ap) {
                    K.extend(true, K.fn.nyroModal.settings[ap], aq)
                } else {
                    K.extend(true, K.fn.nyroModal.settings, aq)
                }
            }
        }
    }
    function F() {
        if (ag && !t.blocker) {
            if (document.documentElement) {
                an.marginScrollLeft = document.documentElement.scrollLeft;
                an.marginScrollTop = document.documentElement.scrollTop
            } else {
                an.marginScrollLeft = document.body.scrollLeft;
                an.marginScrollTop = document.body.scrollTop
            }
        } else {
            an.marginScrollLeft = 0;
            an.marginScrollTop = 0
        }
    }
    function X() {
        F();
        an.marginLeft = -(an.width + an.borderW) / 2;
        an.marginTop = -(an.height + an.borderH) / 2;
        if (!t.blocker) {
            an.marginLeft += an.marginScrollLeft;
            an.marginTop += an.marginScrollTop
        }
    }
    function C() {
        F();
        var ao = al(t.loading);
        an.marginTopLoading = -(t.loading.height() + ao.h.border + ao.h.padding) / 2;
        an.marginLeftLoading = -(t.loading.width() + ao.w.border + ao.w.padding) / 2;
        if (!t.blocker) {
            an.marginLeftLoading += an.marginScrollLeft;
            an.marginTopLoading += an.marginScrollTop
        }
    }
    function D() {
        var ao = K("h1#nyroModalTitle", t.contentWrapper);
        if (ao.length) {
            ao.text(an.title)
        } else {
            t.contentWrapper.prepend('<h1 id="nyroModalTitle">' + an.title + "</h1>")
        }
    }
    function J() {
        A("initModal");
        if (!t.full) {
            if (an.debug) {
                Y({
                    color: "white"
                }, "cssOpt", "bg")
            }
            var ap = {
                zIndex: an.zIndexStart,
                position: "fixed",
                top: 0,
                left: 0,
                width: "100%",
                height: "100%"
            };
            var at = y;
            var ar = "";
            if (an.blocker) {
                t.blocker = at = K(an.blocker);
                var aw = t.blocker.offset();
                var ao = t.blocker.outerWidth();
                var aq = t.blocker.outerHeight();
                if (ag) {
                    Y({
                        height: "100%",
                        width: "100%",
                        top: 0,
                        left: 0
                    }, "cssOpt", "bg")
                }
                t.blockerVars = {
                    top: aw.top,
                    left: aw.left,
                    width: ao,
                    height: aq
                };
                var av = (/msie/.test(L) ? 0 : R(y.get(0), "borderTopWidth"));
                var au = (/msie/.test(L) ? 0 : R(y.get(0), "borderLeftWidth"));
                ap = {
                    position: "absolute",
                    top: aw.top + av,
                    left: aw.left + au,
                    width: ao,
                    height: aq
                }
            } else {
                if (ag) {
                    y.css({
                        marginLeft: 0,
                        marginRight: 0
                    });
                    var ao = y.width();
                    var aq = K(window).height() + "px";
                    if (K(window).height() >= y.outerHeight()) {
                        aq = y.outerHeight() + "px"
                    } else {
                        ao += 20
                    }
                    ao += "px";
                    y.css({
                        width: ao,
                        height: aq,
                        position: "static",
                        overflow: "hidden"
                    });
                    K("html").css({
                        overflow: "hidden"
                    });
                    Y({
                        cssOpt: {
                            bg: {
                                position: "absolute",
                                zIndex: an.zIndexStart + 1,
                                height: "110%",
                                width: "110%",
                                top: an.marginScrollTop + "px",
                                left: an.marginScrollLeft + "px"
                            }, wrapper: {
                                zIndex: an.zIndexStart + 2
                            }, loading: {
                                zIndex: an.zIndexStart + 3
                            }
                        }
                    });
                    ar = K('<iframe id="nyroModalIframeHideIe" src="javascript:\'\';"></iframe>').css(K.extend({}, an.cssOpt.bg, {
                        opacity: 0,
                        zIndex: 50,
                        border: "none"
                    }))
                }
            }
            at.append(K('<div id="nyroModalFull"><div id="nyroModalBg"></div><div id="nyroModalWrapper"><div id="nyroModalContent"></div></div><div id="nyrModalTmp"></div><div id="nyroModalLoading"></div></div>').hide());
            t.full = K("#nyroModalFull").css(ap).show();
            t.bg = K("#nyroModalBg").css(K.extend({
                backgroundColor: an.bgColor
            }, an.cssOpt.bg)).before(ar);
            t.bg.bind("click.nyroModal", aa);
            t.loading = K("#nyroModalLoading").css(an.cssOpt.loading).hide();
            t.contentWrapper = K("#nyroModalWrapper").css(an.cssOpt.wrapper).hide();
            t.content = K("#nyroModalContent");
            t.tmp = K("#nyrModalTmp").hide();
            if (K.isFunction(K.fn.mousewheel)) {
                t.content.mousewheel(function(ay, az) {
                    var ax = t.content.get(0);
                    if ((az > 0 && ax.scrollTop == 0) || (az < 0 && ax.scrollHeight - ax.scrollTop == ax.clientHeight)) {
                        ay.preventDefault();
                        ay.stopPropagation()
                    }
                })
            }
            K(document).bind("keydown.nyroModal", l);
            t.content.css({
                width: "auto",
                height: "auto"
            });
            t.contentWrapper.css({
                width: "auto",
                height: "auto"
            });
            if (!an.blocker && an.windowResize) {
                K(window).bind("resize.nyroModal", function() {
                    window.clearTimeout(S);
                    S = window.setTimeout(B, 200)
                })
            }
        }
    }
    function B() {
        K.nyroModalSettings(O)
    }
    function aj() {
        A("showModal");
        if (!t.ready) {
            J();
            t.anim = true;
            an.showBackground(t, an, U)
        } else {
            t.anim = true;
            t.transition = true;
            an.showTransition(t, an, function() {
                G();
                t.anim = false;
                v()
            })
        }
    }
    function aa(ao) {
        if (!an.modal) {
            u()
        }
    }
    function l(ao) {
        if (ao.keyCode == 27) {
            if (!an.modal) {
                u()
            }
        } else {
            if (an.gallery && t.ready && t.dataReady && !t.anim && !t.transition) {
                if (ao.keyCode == 39 || ao.keyCode == 40) {
                    ao.preventDefault();
                    K.nyroModalNext();
                    return false
                } else {
                    if (ao.keyCode == 37 || ao.keyCode == 38) {
                        ao.preventDefault();
                        K.nyroModalPrev();
                        return false
                    }
                }
            }
        }
    }
    function k() {
        var aw = an.from;
        var ap;
        if (aw && aw.nodeName) {
            var au = K(aw);
            ap = au.attr(aw.nodeName.toLowerCase() == "form" ? "action" : "href");
            if (!ap) {
                ap = location.href.substring(window.location.host.length + 7)
            }
            an.url = ap;
            if (au.attr("rev") == "modal") {
                an.modal = true
            }
            an.title = au.attr("title");
            if (aw && aw.rel && aw.rel.toLowerCase() != "nofollow") {
                var ao = aw.rel.indexOf(" ");
                an.gallery = ao > 0 ? aw.rel.substr(0, ao) : aw.rel
            }
            var av = ab(ap, aw);
            if (av) {
                return av
            }
            if (ai(ap)) {
                return "swf"
            }
            var at = false;
            if (aw.target && aw.target.toLowerCase() == "_blank" || (aw.hostname && aw.hostname.replace(/:\d*$/, "") != window.location.hostname.replace(/:\d*$/, ""))) {
                at = true
            }
            if (aw.nodeName.toLowerCase() == "form") {
                if (at) {
                    return "iframeForm"
                }
                Y(w(ap));
                if (au.attr("enctype") == "multipart/form-data") {
                    return "formData"
                }
                return "form"
            }
            if (at) {
                return "iframe"
            }
        } else {
            ap = an.url;
            if (!an.content) {
                an.from = true
            }
            if (!ap) {
                return null
            }
            if (ai(ap)) {
                return "swf"
            }
            var ar = new RegExp("^http://|https://", "g");
            if (ap.match(ar)) {
                return "iframe"
            }
        }
        var av = ab(ap, aw);
        if (av) {
            return av
        }
        var aq = w(ap);
        Y(aq);
        if (!aq.url) {
            return aq.selector
        }
    }
    function ab(ao, aq) {
        var ap = new RegExp(an.regexImg, "i");
        if (ap.test(ao)) {
            return "image"
        }
    }
    function ai(ao) {
        var ap = new RegExp("[^.].(swf)s*$", "i");
        return ap.test(ao)
    }
    function w(ap) {
        var ao = {
            url: null,
            selector: null
        };
        if (ap) {
            var at = q(ap);
            var au = q(window.location.href);
            var aq = window.location.href.substring(0, window.location.href.length - au.length);
            var ar = ap.substring(0, ap.length - at.length);
            if (ar == aq || ar == K("base").attr("href")) {
                ao.selector = at
            } else {
                ao.url = ar;
                ao.selector = at
            }
        }
        return ao
    }
    function r() {
        A("loadingError");
        t.error = true;
        if (!t.ready) {
            return
        }
        if (K.isFunction(an.handleError)) {
            an.handleError(t, an)
        }
        t.loading.addClass(an.errorClass).html(an.contentError);
        K(an.closeSelector, t.loading).unbind("click.nyroModal").bind("click.nyroModal", u);
        C();
        t.loading.css({
            marginTop: an.marginTopLoading + "px",
            marginLeft: an.marginLeftLoading + "px"
        })
    }
    function am() {
        A("fillContent");
        if (!t.tmp.html()) {
            return
        }
        t.content.html(t.tmp.contents());
        t.tmp.empty();
        ad();
        if (an.type == "iframeForm") {
            K(an.from).attr("target", "nyroModalIframe").data("nyroModalprocessing", 1).submit().attr("target", "_blank").removeData("nyroModalprocessing")
        }
        if (!an.modal) {
            t.wrapper.prepend(an.closeButton)
        }
        if (K.isFunction(an.endFillContent)) {
            an.endFillContent(t, an)
        }
        t.content.append(t.scripts);
        K(an.closeSelector, t.contentWrapper).unbind("click.nyroModal").bind("click.nyroModal", u);
        K(an.openSelector, t.contentWrapper).nyroModal(d())
    }
    function d() {
        return j;
        var ao = K.extend(true, {}, an);
        if (ae.width) {
            ao.width = null
        } else {
            ao.width = O.width
        }
        if (ae.height) {
            ao.height = null
        } else {
            ao.height = O.height
        }
        ao.cssOpt.content.overflow = "auto";
        return ao
    }
    function ad() {
        A("wrapContent");
        var at = K(an.wrap[an.type]);
        t.content.append(at.children().remove());
        t.contentWrapper.wrapInner(at);
        if (an.gallery) {
            t.content.append(an.galleryLinks);
            af.links = K('[rel="' + an.gallery + '"], [rel^="' + an.gallery + ' "]');
            af.index = af.links.index(an.from);
            if (an.galleryCounts && K.isFunction(an.galleryCounts)) {
                an.galleryCounts(af.index + 1, af.links.length, t, an)
            }
            var ar = d();
            var ap = c(-1);
            if (ap) {
                var au = K(".nyroModalPrev", t.contentWrapper).attr("href", ap.attr("href")).click(function(av) {
                    av.preventDefault();
                    K.nyroModalPrev();
                    return false
                });
                if (ag && an.type == "swf") {
                    au.before(K('<iframe id="nyroModalIframeHideIeGalleryPrev" src="javascript:\'\';"></iframe>').css({
                        position: au.css("position"),
                        top: au.css("top"),
                        left: au.css("left"),
                        width: au.width(),
                        height: au.height(),
                        opacity: 0,
                        border: "none"
                    }))
                }
            } else {
                K(".nyroModalPrev", t.contentWrapper).remove()
            }
            var ao = c(1);
            if (ao) {
                var aq = K(".nyroModalNext", t.contentWrapper).attr("href", ao.attr("href")).click(function(av) {
                    av.preventDefault();
                    K.nyroModalNext();
                    return false
                });
                if (ag && an.type == "swf") {
                    aq.before(K('<iframe id="nyroModalIframeHideIeGalleryNext" src="javascript:\'\';"></iframe>').css(K.extend({}, {
                        position: aq.css("position"),
                        top: aq.css("top"),
                        left: aq.css("left"),
                        width: aq.width(),
                        height: aq.height(),
                        opacity: 0,
                        border: "none"
                    })))
                }
            } else {
                K(".nyroModalNext", t.contentWrapper).remove()
            }
        }
        h()
    }
    function c(ap) {
        if (an.gallery) {
            if (!an.ltr) {
                ap *= -1
            }
            var ao = af.index + ap;
            if (ao >= 0 && ao < af.links.length) {
                return af.links.eq(ao)
            } else {
                if (an.galleryLoop) {
                    if (ao < 0) {
                        return af.links.eq(af.links.length - 1)
                    } else {
                        return af.links.eq(0)
                    }
                }
            }
        }
        return false
    }
    function h(az) {
        A("calculateSize");
        t.wrapper = t.contentWrapper.children("div:first");
        ae.width = false;
        ae.height = false;
        if (false && !an.windowResizing) {
            O.width = an.width;
            O.height = an.height
        }
        if (an.autoSizable && (!an.width || !an.height)) {
            t.contentWrapper.css({
                opacity: 0,
                width: "auto",
                height: "auto"
            }).show();
            var at = {
                width: "auto",
                height: "auto"
            };
            if (an.width) {
                at.width = an.width
            } else {
                if (an.type == "iframe") {
                    at.width = an.minWidth
                }
            }
            if (an.height) {
                at.height = an.height
            } else {
                if (an.type == "iframe") {
                    at.height = an.minHeight
                }
            }
            t.content.css(at);
            if (!an.width) {
                an.width = t.content.outerWidth(true);
                ae.width = true
            }
            if (!an.height) {
                an.height = t.content.outerHeight(true);
                ae.height = true
            }
            t.contentWrapper.css({
                opacity: 1
            });
            if (!az) {
                t.contentWrapper.hide()
            }
        }
        if (an.type != "image" && an.type != "swf") {
            an.width = Math.max(an.width, an.minWidth);
            an.height = Math.max(an.height, an.minHeight)
        }
        var ar = al(t.contentWrapper);
        var ap = al(t.wrapper);
        var ay = al(t.content);
        var at = {
            content: {
                width: an.width,
                height: an.height
            }, wrapper2: {
                width: an.width + ay.w.total,
                height: an.height + ay.h.total
            }, wrapper: {
                width: an.width + ay.w.total + ap.w.total,
                height: an.height + ay.h.total + ap.h.total
            }
        };
        if (an.resizable) {
            var aC = t.blockerVars ? t.blockerVars.height : K(window).height() - ar.h.border - (at.wrapper.height - an.height);
            var aD = t.blockerVars ? t.blockerVars.width : K(window).width() - ar.w.border - (at.wrapper.width - an.width);
            aC -= an.padding * 2;
            aD -= an.padding * 2;
            if (at.content.height > aC || at.content.width > aD) {
                if (an.type == "image" || an.type == "swf") {
                    var av = an.imgWidth ? an.imgWidth : an.width;
                    var ao = an.imgHeight ? an.imgHeight : an.height;
                    var aA = at.content.width - av;
                    var au = at.content.height - ao;
                    if (au < 0) {
                        au = 0
                    }
                    if (aA < 0) {
                        aA = 0
                    }
                    var aE = aC - au;
                    var aq = aD - aA;
                    var ax = Math.min(aE / ao, aq / av);
                    aq = Math.floor(av * ax);
                    aE = Math.floor(ao * ax);
                    at.content.height = aE + au;
                    at.content.width = aq + aA
                } else {
                    at.content.height = Math.min(at.content.height, aC);
                    at.content.width = Math.min(at.content.width, aD)
                }
                at.wrapper2 = {
                    width: at.content.width + ay.w.total,
                    height: at.content.height + ay.h.total
                };
                at.wrapper = {
                    width: at.content.width + ay.w.total + ap.w.total,
                    height: at.content.height + ay.h.total + ap.h.total
                }
            }
        }
        if (an.type == "swf") {
            K("object, embed", t.content).attr("width", at.content.width).attr("height", at.content.height)
        } else {
            if (an.type == "image") {
                K("img", t.content).css({
                    width: at.content.width,
                    height: at.content.height
                })
            }
        }
        t.content.css(K.extend({}, at.content, an.cssOpt.content));
        t.wrapper.css(K.extend({}, at.wrapper2, an.cssOpt.wrapper2));
        if (!az) {
            t.contentWrapper.css(K.extend({}, at.wrapper, an.cssOpt.wrapper))
        }
        if (an.type == "image" && an.addImageDivTitle) {
            K("img", t.content).removeAttr("alt");
            var aB = K("div", t.content);
            if (an.title != an.defaultImgAlt && an.title) {
                if (aB.length == 0) {
                    aB = K("<div>" + an.title + "</div>");
                    t.content.append(aB)
                }
                if (an.setWidthImgTitle) {
                    var aw = al(aB);
                    aB.css({
                        width: (at.content.width + ay.w.padding - aw.w.total) + "px"
                    })
                }
            } else {
                if (aB.length = 0) {
                    aB.remove()
                }
            }
        }
        if (an.title) {
            D()
        }
        at.wrapper.borderW = ar.w.border;
        at.wrapper.borderH = ar.h.border;
        Y(at.wrapper);
        X()
    }
    function u(ao) {
        A("removeModal");
        if (ao) {
            ao.preventDefault()
        }
        if (t.full && t.ready) {
            K(document).unbind("keydown.nyroModal");
            if (!an.blocker) {
                K(window).unbind("resize.nyroModal")
            }
            t.ready = false;
            t.anim = true;
            t.closing = true;
            if (t.loadingShown || t.transition) {
                an.hideLoading(t, an, function() {
                    t.loading.hide();
                    t.loadingShown = false;
                    t.transition = false;
                    an.hideBackground(t, an, Z)
                })
            } else {
                if (Q) {
                    t.content.css({
                        position: ""
                    })
                }
                t.wrapper.css({
                    overflow: "hidden"
                });
                t.content.css({
                    overflow: "hidden"
                });
                K("iframe", t.content).hide();
                if (K.isFunction(an.beforeHideContent)) {
                    an.beforeHideContent(t, an, function() {
                        an.hideContent(t, an, function() {
                            G();
                            an.hideBackground(t, an, Z)
                        })
                    })
                } else {
                    an.hideContent(t, an, function() {
                        G();
                        an.hideBackground(t, an, Z)
                    })
                }
            }
        }
        if (ao) {
            return false
        }
    }
    function v() {
        A("showContentOrLoading");
        if (t.ready && !t.anim) {
            if (t.dataReady) {
                if (t.tmp.html()) {
                    t.anim = true;
                    if (t.transition) {
                        am();
                        t.animContent = true;
                        an.hideTransition(t, an, function() {
                            t.loading.hide();
                            t.transition = false;
                            t.loadingShown = false;
                            n()
                        })
                    } else {
                        an.hideLoading(t, an, function() {
                            t.loading.hide();
                            t.loadingShown = false;
                            am();
                            C();
                            X();
                            t.animContent = true;
                            an.showContent(t, an, n)
                        })
                    }
                }
            } else {
                if (!t.loadingShown && !t.transition) {
                    t.anim = true;
                    t.loadingShown = true;
                    if (t.error) {
                        r()
                    } else {
                        t.loading.html(an.contentLoading)
                    }
                    K(an.closeSelector, t.loading).unbind("click.nyroModal").bind("click.nyroModal", u);
                    C();
                    an.showLoading(t, an, function() {
                        t.anim = false;
                        v()
                    })
                }
            }
        }
    }
    function p(aq) {
        A("AjaxLoaded: " + this.url);
        if (an.selector) {
            var ap = {};
            var ao = 0;
            aq = aq.replace(/\r\n/gi, "nyroModalLN").replace(/<script(.|\s)*?\/script>/gi, function(ar) {
                ap[ao] = ar;
                return '<pre style="display: none" class=nyroModalScript rel="' + (ao++) + '"></pre>'
            });
            aq = K("<div>" + aq + "</div>").find(an.selector).html().replace(/<pre style="display: none;?" class="?nyroModalScript"? rel="(.?)"><\/pre>/gi, function(ar, au, at) {
                return ap[au]
            }).replace(/nyroModalLN/gi, "\r\n")
        }
        t.tmp.html(x(aq));
        if (t.tmp.html()) {
            t.dataReady = true;
            v()
        } else {
            r()
        }
    }
    function e() {
        A("formDataLoaded");
        var aq = K(an.from);
        aq.attr("action", aq.attr("action") + an.selector);
        aq.attr("target", "");
        K("input[name=" + an.formIndicator + "]", an.from).remove();
        var ap = t.tmp.children("iframe");
        var ao = ap.unbind("load").contents().find(an.selector || "body").not("script[src]");
        ap.attr("src", "about:blank");
        t.tmp.html(ao.html());
        if (t.tmp.html()) {
            t.dataReady = true;
            v()
        } else {
            r()
        }
    }
    function ak() {
        if ((window.location.hostname && an.url.indexOf(window.location.hostname) > -1) || an.url.indexOf("http://")) {
            var aq = K("iframe", t.full).contents();
            var ap = {};
            if (an.titleFromIframe) {
                ap.title = aq.find("title").text();
                if (!ap.title) {
                    try {
                        ap.title = aq.find("title").html()
                    } catch (ar) { }
                }
            }
            var ao = aq.find("body");
            if (!an.height && ao.height()) {
                ap.height = ao.height()
            }
            if (!an.width && ao.width()) {
                ap.width = ao.width()
            }
            K.extend(O, ap);
            K.nyroModalSettings(ap)
        }
    }
    function P(ao, aq, ar, ap) {
        if (aq > 1) {
            ap.title += (ap.title ? " - " : "") + ao + "/" + aq
        }
    }
    function G() {
        A("endHideContent");
        t.anim = false;
        if (m) {
            m.append(t.content.contents());
            m = null
        } else {
            if (ah) {
                ah.append(t.content.contents());
                ah = null
            }
        }
        t.content.empty();
        af = {};
        t.contentWrapper.hide().children().remove().empty().attr("style", "").hide();
        if (t.closing || t.transition) {
            t.contentWrapper.hide()
        }
        t.contentWrapper.css(an.cssOpt.wrapper).append(t.content);
        v()
    }
    function Z() {
        A("endRemove");
        K(document).unbind("keydown", l);
        t.anim = false;
        t.full.remove();
        t.full = null;
        if (ag) {
            y.css({
                height: "",
                width: "",
                position: "",
                overflow: "",
                marginLeft: "",
                marginRight: ""
            });
            K("html").css({
                overflow: ""
            })
        }
        if (K.isFunction(an.endRemove)) {
            an.endRemove(t, an)
        }
    }
    function U() {
        A("endBackground");
        t.ready = true;
        t.anim = false;
        v()
    }
    function n() {
        A("endShowContent");
        t.anim = false;
        t.animContent = false;
        t.contentWrapper.css({
            opacity: ""
        });
        Q = /mozilla/.test(L) && !/(compatible|webkit)/.test(L) && parseFloat(V) < 1.9 && an.type != "image";
        if (Q) {
            t.content.css({
                position: "fixed"
            })
        }
        t.content.append(t.scriptsShown);
        if (an.type == "iframe") {
            t.content.find("iframe").attr("src", an.url)
        }
        if (K.isFunction(an.endShowContent)) {
            an.endShowContent(t, an)
        }
        if (W) {
            W = false;
            K.nyroModalSettings({
                width: an.setWidth,
                height: an.setHeight
            });
            delete an.setWidth;
            delete an.setHeight
        }
        if (ae.width) {
            Y({
                width: null
            })
        }
        if (ae.height) {
            Y({
                height: null
            })
        }
    }
    function q(ap) {
        if (typeof ap == "string") {
            var ao = ap.indexOf("#");
            if (ao > -1) {
                return ap.substring(ao)
            }
        }
        return ""
    }
    function x(ap) {
        if (typeof ap == "string") {
            ap = ap.replace(/<\/?(html|head|body)([^>]*)>/gi, "")
        }
        var ao = new Array();
        K.each(K.clean({
            0: ap
        }, this.ownerDocument), function() {
            if (K.nodeName(this, "script")) {
                if (!this.src || K(this).attr("rel") == "forceLoad") {
                    if (K(this).attr("rev") == "shown") {
                        t.scriptsShown.push(this)
                    } else {
                        t.scripts.push(this)
                    }
                }
            } else {
                ao.push(this)
            }
        });
        return ao
    }
    function al(ap) {
        ap = ap.get(0);
        var ao = {
            h: {
                margin: R(ap, "marginTop") + R(ap, "marginBottom"),
                border: R(ap, "borderTopWidth") + R(ap, "borderBottomWidth"),
                padding: R(ap, "paddingTop") + R(ap, "paddingBottom")
            }, w: {
                margin: R(ap, "marginLeft") + R(ap, "marginRight"),
                border: R(ap, "borderLeftWidth") + R(ap, "borderRightWidth"),
                padding: R(ap, "paddingLeft") + R(ap, "paddingRight")
            }
        };
        ao.h.outer = ao.h.margin + ao.h.border;
        ao.w.outer = ao.w.margin + ao.w.border;
        ao.h.inner = ao.h.padding + ao.h.border;
        ao.w.inner = ao.w.padding + ao.w.border;
        ao.h.total = ao.h.outer + ao.h.padding;
        ao.w.total = ao.w.outer + ao.w.padding;
        return ao
    }
    function R(aq, ap) {
        var ao = parseInt(K.curCSS(aq, ap, true));
        if (isNaN(ao)) {
            ao = 0
        }
        return ao
    }
    function A(ao) {
        if (K.fn.nyroModal.settings.debug || an && an.debug) {
            nyroModalDebug(ao, t, an || {})
        }
    }
    function M(ap, ao, aq) {
        ap.bg.css({
            opacity: 0
        }).fadeTo(500, 0.75, aq)
    }
    function E(ap, ao, aq) {
        ap.bg.fadeOut(300, aq)
    }
    function o(ap, ao, aq) {
        ap.loading.css({
            marginTop: ao.marginTopLoading + "px",
            marginLeft: ao.marginLeftLoading + "px",
            opacity: 0
        }).show().animate({
            opacity: 1
        }, {
            complete: aq,
            duration: 400
        })
    }
    function I(ap, ao, aq) {
        aq()
    }
    function H(ap, ao, aq) {
        ap.loading.css({
            marginTop: ao.marginTopLoading + "px",
            marginLeft: ao.marginLeftLoading + "px"
        }).show().animate({
            width: ao.width + "px",
            height: ao.height + "px",
            marginTop: ao.marginTop + "px",
            marginLeft: ao.marginLeft + "px"
        }, {
            duration: 350,
            complete: function() {
                ap.contentWrapper.css({
                    width: ao.width + "px",
                    height: ao.height + "px",
                    marginTop: ao.marginTop + "px",
                    marginLeft: ao.marginLeft + "px"
                }).show();
                ap.loading.fadeOut(200, aq)
            }
        })
    }
    function ac(ap, ao, aq) {
        ap.contentWrapper.animate({
            height: "50px",
            width: "50px",
            marginTop: (-(25 + ao.borderH) / 2 + ao.marginScrollTop) + "px",
            marginLeft: (-(25 + ao.borderW) / 2 + ao.marginScrollLeft) + "px"
        }, {
            duration: 350,
            complete: function() {
                ap.contentWrapper.hide();
                aq()
            }
        })
    }
    function f(ap, ao, aq) {
        ap.loading.css({
            marginTop: ap.contentWrapper.css("marginTop"),
            marginLeft: ap.contentWrapper.css("marginLeft"),
            height: ap.contentWrapper.css("height"),
            width: ap.contentWrapper.css("width"),
            opacity: 0
        }).show().fadeTo(400, 1, function() {
            ap.contentWrapper.hide();
            aq()
        })
    }
    function a(ap, ao, aq) {
        ap.contentWrapper.hide().css({
            width: ao.width + "px",
            height: ao.height + "px",
            marginLeft: ao.marginLeft + "px",
            marginTop: ao.marginTop + "px",
            opacity: 1
        });
        ap.loading.animate({
            width: ao.width + "px",
            height: ao.height + "px",
            marginLeft: ao.marginLeft + "px",
            marginTop: ao.marginTop + "px"
        }, {
            complete: function() {
                ap.contentWrapper.show();
                ap.loading.fadeOut(400, function() {
                    ap.loading.hide();
                    aq()
                })
            }, duration: 350
        })
    }
    function s(ap, ao, aq) {
        ap.contentWrapper.animate({
            width: ao.width + "px",
            height: ao.height + "px",
            marginLeft: ao.marginLeft + "px",
            marginTop: ao.marginTop + "px"
        }, {
            complete: aq,
            duration: 400
        })
    }
    function g(ap, ao, aq) {
        if (!K.fx.step.backgroundColor) {
            ap.bg.css({
                backgroundColor: ao.bgColor
            });
            aq()
        } else {
            ap.bg.animate({
                backgroundColor: ao.bgColor
            }, {
                complete: aq,
                duration: 400
            })
        }
    }
    K(K.fn.nyroModal.settings.openSelector).nyroModal()
});
var tmpDebug = "";

function nyroModalDebug(c, b, a) {
    if (b.full && b.bg) {
        b.bg.prepend(c + "<br />" + tmpDebug);
        tmpDebug = ""
    } else {
        tmpDebug += c + "<br />"
    }
}
var N = {};
N.url = "http://www.p.c";
N.weekday = ["日", "一", "二", "三", "四", "五", "六"];
N.faviconAPI = {
    google: "http://www.google.com/s2/favicons?domain_url="
};
Date.prototype.format = function(b) {
    var c = {
        "M+": this.getMonth() + 1,
        "d+": this.getDate(),
        "h+": this.getHours(),
        "m+": this.getMinutes(),
        "s+": this.getSeconds(),
        "q+": Math.floor((this.getMonth() + 3) / 3),
        S: this.getMilliseconds()
    };
    if (/(y|Y+)/.test(b)) {
        b = b.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
    }
    for (var a in c) {
        if (new RegExp("(" + a + ")").test(b)) {
            b = b.replace(RegExp.$1, RegExp.$1.length == 1 ? c[a] : ("00" + c[a]).substr(("" + c[a]).length))
        }
    }
    return b
};

function isMail(b) {
    var a = /^([a-zA-Z0-9]+[-_.])*[a-zA-Z0-9]+@\w+\.([a-zA-Z]{2,4}|\w+\.[a-zA-Z]{2,4})$/;
    return (b.search(a) >= 0)
}
function _go(a) {
    var b = (arguments.length > 1) ? arguments[1] : window;
    b.location.href = a
}
function gp(c) {
    var f = (arguments.length > 1) ? arguments[1] : window.location.search;
    if (f != null || f != "") {
        f = f.replace(/^\?+/, "");
        var e = f.split("&");
        var a = e.length;
        if (a > 0) {
            for (var d = 0; d < a; d++) {
                var b = e[d].split("=", 2);
                if (b[0] && b[1] && b[0] == c) {
                    return unescape(b[1])
                }
            }
        }
    }
    return null
}
function addFav(a, b) {
    if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) {
        window.sidebar.addPanel(b, a, "")
    } else {
        window.external.AddFavorite(a, b)
    }
}
function setHomepage(b) {
    if (document.all) {
        document.body.style.behavior = "url(#default#homepage)";
        document.body.setHomePage(b)
    } else {
        if (window.sidebar) {
            if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
                } catch (c) { }
            }
            var a = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
            a.setCharPref("browser.startup.homepage", b)
        }
    }
}
Array.prototype.remove = function(c, b) {
    var a = this.slice((b || c) + 1 || this.length);
    this.length = c < 0 ? this.length + c : c;
    return this.push.apply(this, a)
};

function isArray(b) {
    return b.constructor == Array
}
function get_extname(a) {
    var a = new String(a).toLowerCase();
    return ((a.lastIndexOf(".") > -1) && ((a.length - 1) > a.lastIndexOf("."))) ? a.substring(a.lastIndexOf(".") + 1) : false
}
var z = {};
z.heightlight = function(e, b) {
    b = b || {};
    b.times = b.times || 20;
    var d = e.offset();
    var c = $("#HLB");
    c.css({
        left: d.left - 2,
        top: d.top - 2,
        width: e.width(),
        height: e.height()
    }).show();
    var f = 0;
    var a = window.setInterval(function() {
        if (f >= b.times) {
            window.clearInterval(a);
            c.fadeOut("slow")
        }
        if (c.css("borderColor") == "red red red red") {
            c.css("borderColor", "#ccc")
        } else {
            c.css("borderColor", "red")
        }
        f++
    }, 500)
};

function RGBColor(g) {
    this.ok = false;
    if (g.charAt(0) == "#") {
        g = g.substr(1, 6)
    }
    g = g.replace(/ /g, "");
    g = g.toLowerCase();
    var a = {
        aliceblue: "f0f8ff",
        antiquewhite: "faebd7",
        aqua: "00ffff",
        aquamarine: "7fffd4",
        azure: "f0ffff",
        beige: "f5f5dc",
        bisque: "ffe4c4",
        black: "000000",
        blanchedalmond: "ffebcd",
        blue: "0000ff",
        blueviolet: "8a2be2",
        brown: "a52a2a",
        burlywood: "deb887",
        cadetblue: "5f9ea0",
        chartreuse: "7fff00",
        chocolate: "d2691e",
        coral: "ff7f50",
        cornflowerblue: "6495ed",
        cornsilk: "fff8dc",
        crimson: "dc143c",
        cyan: "00ffff",
        darkblue: "00008b",
        darkcyan: "008b8b",
        darkgoldenrod: "b8860b",
        darkgray: "a9a9a9",
        darkgreen: "006400",
        darkkhaki: "bdb76b",
        darkmagenta: "8b008b",
        darkolivegreen: "556b2f",
        darkorange: "ff8c00",
        darkorchid: "9932cc",
        darkred: "8b0000",
        darksalmon: "e9967a",
        darkseagreen: "8fbc8f",
        darkslateblue: "483d8b",
        darkslategray: "2f4f4f",
        darkturquoise: "00ced1",
        darkviolet: "9400d3",
        deeppink: "ff1493",
        deepskyblue: "00bfff",
        dimgray: "696969",
        dodgerblue: "1e90ff",
        feldspar: "d19275",
        firebrick: "b22222",
        floralwhite: "fffaf0",
        forestgreen: "228b22",
        fuchsia: "ff00ff",
        gainsboro: "dcdcdc",
        ghostwhite: "f8f8ff",
        gold: "ffd700",
        goldenrod: "daa520",
        gray: "808080",
        green: "008000",
        greenyellow: "adff2f",
        honeydew: "f0fff0",
        hotpink: "ff69b4",
        indianred: "cd5c5c",
        indigo: "4b0082",
        ivory: "fffff0",
        khaki: "f0e68c",
        lavender: "e6e6fa",
        lavenderblush: "fff0f5",
        lawngreen: "7cfc00",
        lemonchiffon: "fffacd",
        lightblue: "add8e6",
        lightcoral: "f08080",
        lightcyan: "e0ffff",
        lightgoldenrodyellow: "fafad2",
        lightgrey: "d3d3d3",
        lightgreen: "90ee90",
        lightpink: "ffb6c1",
        lightsalmon: "ffa07a",
        lightseagreen: "20b2aa",
        lightskyblue: "87cefa",
        lightslateblue: "8470ff",
        lightslategray: "778899",
        lightsteelblue: "b0c4de",
        lightyellow: "ffffe0",
        lime: "00ff00",
        limegreen: "32cd32",
        linen: "faf0e6",
        magenta: "ff00ff",
        maroon: "800000",
        mediumaquamarine: "66cdaa",
        mediumblue: "0000cd",
        mediumorchid: "ba55d3",
        mediumpurple: "9370d8",
        mediumseagreen: "3cb371",
        mediumslateblue: "7b68ee",
        mediumspringgreen: "00fa9a",
        mediumturquoise: "48d1cc",
        mediumvioletred: "c71585",
        midnightblue: "191970",
        mintcream: "f5fffa",
        mistyrose: "ffe4e1",
        moccasin: "ffe4b5",
        navajowhite: "ffdead",
        navy: "000080",
        oldlace: "fdf5e6",
        olive: "808000",
        olivedrab: "6b8e23",
        orange: "ffa500",
        orangered: "ff4500",
        orchid: "da70d6",
        palegoldenrod: "eee8aa",
        palegreen: "98fb98",
        paleturquoise: "afeeee",
        palevioletred: "d87093",
        papayawhip: "ffefd5",
        peachpuff: "ffdab9",
        peru: "cd853f",
        pink: "ffc0cb",
        plum: "dda0dd",
        powderblue: "b0e0e6",
        purple: "800080",
        red: "ff0000",
        rosybrown: "bc8f8f",
        royalblue: "4169e1",
        saddlebrown: "8b4513",
        salmon: "fa8072",
        sandybrown: "f4a460",
        seagreen: "2e8b57",
        seashell: "fff5ee",
        sienna: "a0522d",
        silver: "c0c0c0",
        skyblue: "87ceeb",
        slateblue: "6a5acd",
        slategray: "708090",
        snow: "fffafa",
        springgreen: "00ff7f",
        steelblue: "4682b4",
        tan: "d2b48c",
        teal: "008080",
        thistle: "d8bfd8",
        tomato: "ff6347",
        turquoise: "40e0d0",
        violet: "ee82ee",
        violetred: "d02090",
        wheat: "f5deb3",
        white: "ffffff",
        whitesmoke: "f5f5f5",
        yellow: "ffff00",
        yellowgreen: "9acd32"
    };
    for (var c in a) {
        if (g == c) {
            g = a[c]
        }
    }
    var h = [{
        re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
        example: ["rgb(123, 234, 45)", "rgb(255,234,245)"],
        process: function(j) {
            return [parseInt(j[1]), parseInt(j[2]), parseInt(j[3])]
        }
    }, {
        re: /^(\w{2})(\w{2})(\w{2})$/,
        example: ["#00ff00", "336699"],
        process: function(j) {
            return [parseInt(j[1], 16), parseInt(j[2], 16), parseInt(j[3], 16)]
        }
    }, {
        re: /^(\w{1})(\w{1})(\w{1})$/,
        example: ["#fb0", "f0f"],
        process: function(j) {
            return [parseInt(j[1] + j[1], 16), parseInt(j[2] + j[2], 16), parseInt(j[3] + j[3], 16)]
        }
}];
        for (var b = 0; b < h.length; b++) {
            var e = h[b].re;
            var d = h[b].process;
            var f = e.exec(g);
            if (f) {
                channels = d(f);
                this.r = channels[0];
                this.g = channels[1];
                this.b = channels[2];
                this.ok = true
            }
        }
        this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
        this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
        this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
        this.toRGB = function() {
            return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")"
        };
        this.toHex = function() {
            var l = this.r.toString(16);
            var k = this.g.toString(16);
            var j = this.b.toString(16);
            if (l.length == 1) {
                l = "0" + l
            }
            if (k.length == 1) {
                k = "0" + k
            }
            if (j.length == 1) {
                j = "0" + j
            }
            return "#" + l + k + j
        };
        this.getHelpXML = function() {
            var m = new Array();
            for (var o = 0; o < h.length; o++) {
                var l = h[o].example;
                for (var n = 0; n < l.length; n++) {
                    m[m.length] = l[n]
                }
            }
            for (var t in a) {
                m[m.length] = t
            }
            var p = document.createElement("ul");
            p.setAttribute("id", "rgbcolor-examples");
            for (var o = 0; o < m.length; o++) {
                try {
                    var q = document.createElement("li");
                    var s = new RGBColor(m[o]);
                    var u = document.createElement("div");
                    u.style.cssText = "margin: 3px; border: 1px solid black; background:" + s.toHex() + "; color:" + s.toHex();
                    u.appendChild(document.createTextNode("test"));
                    var k = document.createTextNode(" " + m[o] + " -> " + s.toRGB() + " -> " + s.toHex());
                    q.appendChild(u);
                    q.appendChild(k);
                    p.appendChild(q)
                } catch (r) { }
            }
            return p
        }
    };