jQuery.cookie = function (l, a, c) {
    if (typeof a != "undefined") {
        c = c || {};
        if (a === null) {
            a = "";
            c.expires = -1
        }
        var b = "";
        if (c.expires && (typeof c.expires == "number" || c.expires.toUTCString)) {
            var f;
            if (typeof c.expires == "number") {
                f = new Date();
                f.setTime(f.getTime() + (c.expires * 24 * 60 * 60 * 1000))
            } else {
                f = c.expires
            }
            b = "; expires=" + f.toUTCString()
        }
        var g = c.path ? "; path=" + c.path : "";
        var j = c.domain ? "; domain=" + c.domain : "";
        var n = c.secure ? "; secure" : "";
        document.cookie = [l, "=", encodeURIComponent(a), b, g, j, n].join("")
    } else {
        var m = null;
        if (document.cookie && document.cookie != "") {
            var h = document.cookie.split(";");
            for (var d = 0; d < h.length; d++) {
                var e = jQuery.trim(h[d]);
                if (e.substring(0, l.length + 1) == (l + "=")) {
                    m = decodeURIComponent(e.substring(l.length + 1));
                    break
                }
            }
        }
        return m
    }
};
(function (a) {
    a.fn.alphanumeric = function (b) {
        b = a.extend({
            ichars: "!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- ",
            nchars: "",
            allow: ""
        }, b);
        return this.each(function () {
            if (b.nocaps) {
                b.nchars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
            }
            if (b.allcaps) {
                b.nchars += "abcdefghijklmnopqrstuvwxyz"
            }
            s = b.allow.split("");
            for (i = 0; i < s.length; i++) {
                if (b.ichars.indexOf(s[i]) != -1) {
                    s[i] = "\\" + s[i]
                }
            }
            b.allow = s.join("|");
            var d = new RegExp(b.allow, "gi");
            var c = b.ichars + b.nchars;
            c = c.replace(d, "");
            a(this).keypress(function (f) {
                if (!f.charCode) {
                    k = String.fromCharCode(f.which)
                } else {
                    k = String.fromCharCode(f.charCode)
                }
                if (c.indexOf(k) != -1) {
                    f.preventDefault()
                }
                if (f.ctrlKey && k == "v") {
                    f.preventDefault()
                }
            });
            a(this).bind("contextmenu", function () {
                return false
            })
        })
    };
    a.fn.numeric = function (c) {
        var b = "abcdefghijklmnopqrstuvwxyz";
        b += b.toUpperCase();
        c = a.extend({
            nchars: b
        }, c);
        return this.each(function () {
            a(this).alphanumeric(c)
        })
    };
    a.fn.alpha = function (b) {
        var c = "1234567890";
        b = a.extend({
            nchars: c
        }, b);
        return this.each(function () {
            a(this).alphanumeric(b)
        })
    }
})(jQuery);
(function (d) {
    var c = d.browser.msie && parseInt(d.browser.version) == 6 && typeof window.XMLHttpRequest != "object",
        a = null,
        b = [];
    d.modal = function (e, f) {
        return d.modal.impl.init(e, f)
    };
    d.modal.close = function () {
        d.modal.impl.close()
    };
    d.fn.modal = function (e) {
        return d.modal.impl.init(this, e)
    };
    d.modal.defaults = {
        opacity: 50,
        overlayId: "simplemodal-overlay",
        overlayCss: {},
        containerId: "simplemodal-container",
        containerCss: {},
        dataCss: {},
        zIndex: 1000,
        close: true,
        closeHTML: '<a class="modalCloseImg" title="Close"></a>',
        closeClass: "simplemodal-close",
        position: null,
        persist: false,
        onOpen: null,
        onShow: null,
        onClose: null
    };
    d.modal.impl = {
        opts: null,
        dialog: {},
        init: function (e, f) {
            if (this.dialog.data) {
                return false
            }
            a = d.browser.msie && !d.boxModel;
            this.opts = d.extend({}, d.modal.defaults, f);
            this.zIndex = this.opts.zIndex;
            this.occb = false;
            if (typeof e == "object") {
                e = e instanceof jQuery ? e : d(e);
                if (e.parent().parent().size() > 0) {
                    this.dialog.parentNode = e.parent();
                    if (!this.opts.persist) {
                        this.dialog.orig = e.clone(true)
                    }
                }
            } else {
                if (typeof e == "string" || typeof e == "number") {
                    e = d("<div/>").html(e)
                } else {
                    alert("SimpleModal Error: Unsupported data type: " + typeof e);
                    return false
                }
            }
            this.dialog.data = e.addClass("simplemodal-data").css(this.opts.dataCss);
            e = null;
            this.create();
            this.open();
            if (d.isFunction(this.opts.onShow)) {
                this.opts.onShow.apply(this, [this.dialog])
            }
            return this
        },
        create: function () {
            b = this.getDimensions();
            if (c) {
                this.dialog.iframe = d('<iframe src="javascript:false;"/>').css(d.extend(this.opts.iframeCss, {
                    display: "none",
                    opacity: 0,
                    position: "fixed",
                    height: b[0],
                    width: b[1],
                    zIndex: this.opts.zIndex,
                    top: 0,
                    left: 0
                })).appendTo("body")
            }
            this.dialog.overlay = d("<div/>").attr("id", this.opts.overlayId).addClass("simplemodal-overlay").css(d.extend(this.opts.overlayCss, {
                display: "none",
                opacity: this.opts.opacity / 100,
                height: b[0],
                width: b[1],
                position: "fixed",
                left: 0,
                top: 0,
                zIndex: this.opts.zIndex + 1
            })).appendTo("body");
            this.dialog.container = d("<div/>").attr("id", this.opts.containerId).addClass("simplemodal-container").css(d.extend(this.opts.containerCss, {
                display: "none",
                position: "fixed",
                zIndex: this.opts.zIndex + 2
            })).append(this.opts.close ? d(this.opts.closeHTML).addClass(this.opts.closeClass) : "").appendTo("body");
            this.setPosition();
            if (c || a) {
                this.fixIE()
            }
            this.dialog.container.append(this.dialog.data.hide())
        },
        bindEvents: function () {
            var e = this;
            d("." + this.opts.closeClass).bind("click.simplemodal", function (f) {
                f.preventDefault();
                e.close()
            });
            d(window).bind("resize.simplemodal", function () {
                b = e.getDimensions();
                e.setPosition();
                if (c || a) {
                    e.fixIE()
                } else {
                    e.dialog.iframe && e.dialog.iframe.css({
                        height: b[0],
                        width: b[1]
                    });
                    e.dialog.overlay.css({
                        height: b[0],
                        width: b[1]
                    })
                }
            })
        },
        unbindEvents: function () {
            d("." + this.opts.closeClass).unbind("click.simplemodal");
            d(window).unbind("resize.simplemodal")
        },
        fixIE: function () {
            var e = this.opts.position;
            d.each([this.dialog.iframe || null, this.dialog.overlay, this.dialog.container], function (p, h) {
                if (h) {
                    var x = "document.body.clientHeight",
                        q = "document.body.clientWidth",
                        g = "document.body.scrollHeight",
                        l = "document.body.scrollLeft",
                        v = "document.body.scrollTop",
                        t = "document.body.scrollWidth",
                        m = "document.documentElement.clientHeight",
                        u = "document.documentElement.clientWidth",
                        r = "document.documentElement.scrollLeft",
                        y = "document.documentElement.scrollTop",
                        n = h[0].style;
                    n.position = "absolute";
                    if (p < 2) {
                        n.removeExpression("height");
                        n.removeExpression("width");
                        n.setExpression("height", "" + g + " > " + x + " ? " + g + " : " + x + ' + "px"');
                        n.setExpression("width", "" + t + " > " + q + " ? " + t + " : " + q + ' + "px"')
                    } else {
                        var o, f;
                        if (e && e.constructor == Array) {
                            var j = e[0] ? typeof e[0] == "number" ? e[0].toString() : e[0].replace(/px/, "") : h.css("top").replace(/px/, "");
                            o = j.indexOf("%") == -1 ? j + " + (t = " + y + " ? " + y + " : " + v + ') + "px"' : parseInt(j.replace(/%/, "")) + " * ((" + m + " || " + x + ") / 100) + (t = " + y + " ? " + y + " : " + v + ') + "px"';
                            if (e[1]) {
                                var w = typeof e[1] == "number" ? e[1].toString() : e[1].replace(/px/, "");
                                f = w.indexOf("%") == -1 ? w + " + (t = " + r + " ? " + r + " : " + l + ') + "px"' : parseInt(w.replace(/%/, "")) + " * ((" + u + " || " + q + ") / 100) + (t = " + r + " ? " + r + " : " + l + ') + "px"'
                            }
                        } else {
                            o = "(" + m + " || " + x + ") / 2 - (this.offsetHeight / 2) + (t = " + y + " ? " + y + " : " + v + ') + "px"';
                            f = "(" + u + " || " + q + ") / 2 - (this.offsetWidth / 2) + (t = " + r + " ? " + r + " : " + l + ') + "px"'
                        }
                        n.removeExpression("top");
                        n.removeExpression("left");
                        n.setExpression("top", o);
                        n.setExpression("left", f)
                    }
                }
            })
        },
        getDimensions: function () {
            var f = d(window);
            var e = d.browser.opera && d.browser.version > "9.5" && d.fn.jquery <= "1.2.6" ? document.documentElement.clientHeight : f.height();
            return [e, f.width()]
        },
        setPosition: function () {
            var h, g, f = (b[0] / 2) - ((this.dialog.container.height() || this.dialog.data.height()) / 2),
                e = (b[1] / 2) - ((this.dialog.container.width() || this.dialog.data.width()) / 2);
            if (this.opts.position && this.opts.position.constructor == Array) {
                h = this.opts.position[0] || f;
                g = this.opts.position[1] || e
            } else {
                h = f;
                g = e
            }
            this.dialog.container.css({
                left: g,
                top: h
            })
        },
        open: function () {
            this.dialog.iframe && this.dialog.iframe.show();
            if (d.isFunction(this.opts.onOpen)) {
                this.opts.onOpen.apply(this, [this.dialog])
            } else {
                this.dialog.overlay.show();
                this.dialog.container.show();
                this.dialog.data.show()
            }
            this.bindEvents()
        },
        close: function () {
            if (!this.dialog.data) {
                return false
            }
            if (d.isFunction(this.opts.onClose) && !this.occb) {
                this.occb = true;
                this.opts.onClose.apply(this, [this.dialog])
            } else {
                if (this.dialog.parentNode) {
                    if (this.opts.persist) {
                        this.dialog.data.hide().appendTo(this.dialog.parentNode)
                    } else {
                        this.dialog.data.remove();
                        this.dialog.orig.appendTo(this.dialog.parentNode)
                    }
                } else {
                    this.dialog.data.remove()
                }
                this.dialog.container.remove();
                this.dialog.overlay.remove();
                this.dialog.iframe && this.dialog.iframe.remove();
                this.dialog = {}
            }
            this.unbindEvents()
        }
    }
})(jQuery);
(function (e) {
    e.listen = function (h, f, j, l) {
        if (e.listen.illegal(h)) {
            throw 'jQuery.Listen > "' + h + "\" can't be handled because it doesn't bubble"
        }
        if (typeof f != "object") {
            l = j, j = f, f = document
        }
        var g = jQuery.data(f, "indexer-" + h) || jQuery.data(f, "indexer-" + h, new c(h, f));
        switch (j) {
        case undefined:
        case false:
            g.stop();
            break;
        default:
            g.append(j, l);
        case true:
            g.start();
            break
        }
    };
    e.fn.listen = function (g, h, f) {
        return this.each(function () {
            e.listen(g, this, h, f)
        })
    };
    e.extend(e.listen, {
        strict: true,
        bubbles: {},
        illegal: function (f) {
            return this.strict && !this.bubbles[f]
        }
    });
    e.each(("click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,keydown,keypress,keyup").split(","), function (g, f) {
        e.listen.bubbles[f] = true
    });

    function c(f, g) {
        this.ids = {};
        this.names = {};
        this.listener = g;
        this.event = f;
        c.instances.push(this)
    }
    c.instances = [];
    c.prototype = {
        constructor: c,
        handler: function (f) {
            var g = f.data;
            f.data = null;
            g.parse.apply(g, arguments)
        },
        running: false,
        start: function () {
            if (this.running) {
                return
            }
            e.event.add(this.listener, this.event, this.handler, this);
            this.running = true
        },
        stop: function () {
            if (!this.running) {
                return
            }
            e.event.remove(this.listener, this.event, this.handler);
            this.running = false
        },
        parse: function (h) {
            var g = h.target,
                f = [];
            if (g.id && this.ids[g.id]) {
                b(f, this.ids[g.id])
            }
            a([g.nodeName, "*"], function (l) {
                var j = this.names[l];
                if (j) {
                    a(b(g.className.split(" "), ["*"]), function (m) {
                        if (j[m]) {
                            b(f, j[m])
                        }
                    })
                }
            }, this);
            this.execute(g, f, arguments);
            g = f = h = null
        },
        append: function (h, f) {
            var g = new d(h);
            if (g.id) {
                (this.ids[g.id] || (this.ids[g.id] = [])).push(f)
            } else {
                if (g.nodeName) {
                    var j = this.names[g.nodeName] || (this.names[g.nodeName] = {});
                    (j[g.className] || (j[g.className] = [])).push(f)
                } else {
                    throw 'jQuery.Listen > "' + h + '" was not recognized as a valid selector.'
                }
            }
        },
        execute: function (g, h, f) {
            if (h.length) {
                a(h, function (j) {
                    j.apply(g, f)
                })
            }
        }
    };

    function d(f) {
        var g = d.regex.exec(f) || [];
        if (g[1]) {
            this.id = g[1]
        } else {
            if (g[2] || g[3]) {
                this.nodeName = g[2] ? g[2].toUpperCase() : "*";
                this.className = g[3] ? g[3].substring(1) : "*"
            }
        }
    }
    d.regex = /#([\w\d_-]+)$|(\w*)(\.[\w_]+)?$/;

    function a(m, h, f) {
        for (var g = 0, j = m.length; g < j; g++) {
            h.call(f, m[g], g)
        }
    }
    function b(f, g) {
        Array.prototype.push.apply(f, g);
        return f
    }
    e.event.add(window, "unload", function () {
        if (c) {
            e.each(c.instances, function (f, g) {
                g.stop();
                g.listener = null
            })
        }
    })
})(jQuery);
/*
 * jQuery blockUI plugin
 * Version 2.39 (23-MAY-2011)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2010 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
(function (n) {
    if (/1\.(0|1|2)\.(0|1|2)/.test(n.fn.jquery) || /^1.1/.test(n.fn.jquery)) {
        alert("blockUI requires jQuery v1.2.3 or later! You are using v" + n.fn.jquery);
        return
    }
    n.fn._fadeIn = n.fn.fadeIn;
    var b = function () {};
    var a = document.documentMode || 0;
    var m = n.browser.msie && ((n.browser.version < 8 && !a) || a < 8);
    var l = n.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !a;
    n.blockUI = function (r) {
        h(window, r)
    };
    n.unblockUI = function (r) {
        c(window, r)
    };
    n.growlUI = function (w, v, t, r) {
        var u = n('<div class="growlUI"></div>');
        if (w) {
            u.append("<h1>" + w + "</h1>")
        }
        if (v) {
            u.append("<h2>" + v + "</h2>")
        }
        if (t == undefined) {
            t = 3000
        }
        n.blockUI({
            message: u,
            fadeIn: 700,
            fadeOut: 1000,
            centerY: false,
            timeout: t,
            showOverlay: false,
            onUnblock: r,
            css: n.blockUI.defaults.growlCSS
        })
    };
    n.fn.block = function (r) {
        return this.unblock({
            fadeOut: 0
        }).each(function () {
            if (n.css(this, "position") == "static") {
                this.style.position = "relative"
            }
            if (n.browser.msie) {
                this.style.zoom = 1
            }
            h(this, r)
        })
    };
    n.fn.unblock = function (r) {
        return this.each(function () {
            c(this, r)
        })
    };
    n.blockUI.version = 2.39;
    n.blockUI.defaults = {
        message: "<h1>Please wait...</h1>",
        title: null,
        draggable: true,
        theme: false,
        css: {
            padding: 0,
            margin: 0,
            width: "600px",
            top: "40%",
            left: "35%",
            textAlign: "center",
            color: "#000",
            border: "1px solid #000",
            backgroundColor: "#fff",
            cursor: "wait"
        },
        themedCSS: {
            width: "30%",
            top: "40%",
            left: "35%"
        },
        overlayCSS: {
            backgroundColor: "#000",
            opacity: 0.6,
            cursor: "wait"
        },
        growlCSS: {
            width: "350px",
            top: "10px",
            left: "",
            right: "10px",
            border: "none",
            padding: "5px",
            opacity: 0.6,
            cursor: "default",
            color: "#fff",
            backgroundColor: "#000",
            "-webkit-border-radius": "10px",
            "-moz-border-radius": "10px",
            "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,
        onBlock: null,
        onUnblock: null,
        quirksmodeOffsetHack: 4,
        blockMsgClass: "blockMsg"
    };
    var d = null;
    var o = [];

    function h(u, r) {
        var x = (u == window);
        var D = r && r.message !== undefined ? r.message : undefined;
        r = n.extend({}, n.blockUI.defaults, r || {});
        r.overlayCSS = n.extend({}, n.blockUI.defaults.overlayCSS, r.overlayCSS || {});
        var N = n.extend({}, n.blockUI.defaults.css, r.css || {});
        var F = n.extend({}, n.blockUI.defaults.themedCSS, r.themedCSS || {});
        D = D === undefined ? r.message : D;
        if (x && d) {
            c(window, {
                fadeOut: 0
            })
        }
        if (D && typeof D != "string" && (D.parentNode || D.jquery)) {
            var v = D.jquery ? D[0] : D;
            var K = {};
            n(u).data("blockUI.history", K);
            K.el = v;
            K.parent = v.parentNode;
            K.display = v.style.display;
            K.position = v.style.position;
            if (K.parent) {
                K.parent.removeChild(v)
            }
        }
        n(u).data("blockUI.onUnblock", r.onUnblock);
        var O = r.baseZ;
        var E = (n.browser.msie || r.forceIframe) ? n('<iframe class="blockUI" style="z-index:' + (O++) + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + r.iframeSrc + '"></iframe>') : n('<div class="blockUI" style="display:none"></div>');
        var Q = r.theme ? n('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:' + (O++) + ';display:none"></div>') : n('<div class="blockUI blockOverlay" style="z-index:' + (O++) + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
        var P, C;
        if (r.theme && x) {
            C = '<div class="blockUI ' + r.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + (O + 10) + ';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (r.title || "&nbsp;") + '</div><div class="ui-widget-content ui-dialog-content"></div></div>'
        } else {
            if (r.theme) {
                C = '<div class="blockUI ' + r.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:' + (O + 10) + ';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (r.title || "&nbsp;") + '</div><div class="ui-widget-content ui-dialog-content"></div></div>'
            } else {
                if (x) {
                    C = '<div class="blockUI ' + r.blockMsgClass + ' blockPage" style="z-index:' + (O + 10) + ';display:none;position:fixed"></div>'
                } else {
                    C = '<div class="blockUI ' + r.blockMsgClass + ' blockElement" style="z-index:' + (O + 10) + ';display:none;position:absolute"></div>'
                }
            }
        }
        P = n(C);
        if (D) {
            if (r.theme) {
                P.css(F);
                P.addClass("ui-widget-content")
            } else {
                P.css(N)
            }
        }
        if (!r.theme && (!r.applyPlatformOpacityRules || !(n.browser.mozilla && /Linux/.test(navigator.platform)))) {
            Q.css(r.overlayCSS)
        }
        Q.css("position", x ? "fixed" : "absolute");
        if (n.browser.msie || r.forceIframe) {
            E.css("opacity", 0)
        }
        var y = [E, Q, P],
            R = x ? n("body") : n(u);
        n.each(y, function () {
            this.appendTo(R)
        });
        if (r.theme && r.draggable && n.fn.draggable) {
            P.draggable({
                handle: ".ui-dialog-titlebar",
                cancel: "li"
            })
        }
        var I = m && (!n.boxModel || n("object,embed", x ? null : u).length > 0);
        if (l || I) {
            if (x && r.allowBodyStretch && n.boxModel) {
                n("html,body").css("height", "100%")
            }
            if ((l || !n.boxModel) && !x) {
                var w = e(u, "borderTopWidth"),
                    J = e(u, "borderLeftWidth");
                var A = w ? "(0 - " + w + ")" : 0;
                var H = J ? "(0 - " + J + ")" : 0
            }
            n.each([E, Q, P], function (z, t) {
                var S = t[0].style;
                S.position = "absolute";
                if (z < 2) {
                    x ? S.setExpression("height", "Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:" + r.quirksmodeOffsetHack + ') + "px"') : S.setExpression("height", 'this.parentNode.offsetHeight + "px"');
                    x ? S.setExpression("width", 'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : S.setExpression("width", 'this.parentNode.offsetWidth + "px"');
                    if (H) {
                        S.setExpression("left", H)
                    }
                    if (A) {
                        S.setExpression("top", A)
                    }
                } else {
                    if (r.centerY) {
                        if (x) {
                            S.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
                        }
                        S.marginTop = 0
                    } else {
                        if (!r.centerY && x) {
                            var T = (r.css && r.css.top) ? parseInt(r.css.top) : 0;
                            var U = "((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + " + T + ') + "px"';
                            S.setExpression("top", U)
                        }
                    }
                }
            })
        }
        if (D) {
            if (r.theme) {
                P.find(".ui-widget-content").append(D)
            } else {
                P.append(D)
            }
            if (D.jquery || D.nodeType) {
                n(D).show()
            }
        }
        if ((n.browser.msie || r.forceIframe) && r.showOverlay) {
            E.show()
        }
        if (r.fadeIn) {
            var G = r.onBlock ? r.onBlock : b;
            var L = (r.showOverlay && !D) ? G : b;
            var B = D ? G : b;
            if (r.showOverlay) {
                Q._fadeIn(r.fadeIn, L)
            }
            if (D) {
                P._fadeIn(r.fadeIn, B)
            }
        } else {
            if (r.showOverlay) {
                Q.show()
            }
            if (D) {
                P.show()
            }
            if (r.onBlock) {
                r.onBlock()
            }
        }
        p(1, u, r);
        if (x) {
            d = P[0];
            o = n(":input:enabled:visible", d);
            if (r.focusInput) {
                setTimeout(j, 20)
            }
        } else {
            g(P[0], r.centerX, r.centerY)
        }
        if (r.timeout) {
            var M = setTimeout(function () {
                x ? n.unblockUI(r) : n(u).unblock(r)
            }, r.timeout);
            n(u).data("blockUI.timeout", M)
        }
    }
    function c(x, w) {
        var r = (x == window);
        var u = n(x);
        var t = u.data("blockUI.history");
        var y = u.data("blockUI.timeout");
        if (y) {
            clearTimeout(y);
            u.removeData("blockUI.timeout")
        }
        w = n.extend({}, n.blockUI.defaults, w || {});
        p(0, x, w);
        if (w.onUnblock === null) {
            w.onUnblock = u.data("blockUI.onUnblock");
            u.removeData("blockUI.onUnblock")
        }
        var v;
        if (r) {
            v = n("body").children().filter(".blockUI").add("body > .blockUI")
        } else {
            v = n(".blockUI", x)
        }
        if (r) {
            d = o = null
        }
        if (w.fadeOut) {
            v.fadeOut(w.fadeOut);
            setTimeout(function () {
                q(v, t, w, x)
            }, w.fadeOut)
        } else {
            q(v, t, w, x)
        }
    }
    function q(t, r, v, u) {
        t.each(function (w, x) {
            if (this.parentNode) {
                this.parentNode.removeChild(this)
            }
        });
        if (r && r.el) {
            r.el.style.display = r.display;
            r.el.style.position = r.position;
            if (r.parent) {
                r.parent.appendChild(r.el)
            }
            n(u).removeData("blockUI.history")
        }
        if (typeof v.onUnblock == "function") {
            v.onUnblock(u, v)
        }
    }
    function p(v, w, u) {
        var r = w == window,
            t = n(w);
        if (!v && (r && !d || !r && !t.data("blockUI.isBlocked"))) {
            return
        }
        if (!r) {
            t.data("blockUI.isBlocked", v)
        }
        if (!u.bindEvents || (v && !u.showOverlay)) {
            return
        }
        var x = "mousedown mouseup keydown keypress";
        v ? n(document).bind(x, u, f) : n(document).unbind(x, f)
    }
    function f(w) {
        if (w.keyCode && w.keyCode == 9) {
            if (d && w.data.constrainTabKey) {
                var t = o;
                var u = !w.shiftKey && w.target === t[t.length - 1];
                var v = w.shiftKey && w.target === t[0];
                if (u || v) {
                    setTimeout(function () {
                        j(v)
                    }, 10);
                    return false
                }
            }
        }
        var r = w.data;
        if (n(w.target).parents("div." + r.blockMsgClass).length > 0) {
            return true
        }
        return n(w.target).parents().children().filter("div.blockUI").length == 0
    }
    function j(t) {
        if (!o) {
            return
        }
        var r = o[t === true ? o.length - 1 : 0];
        if (r) {
            r.focus()
        }
    }
    function g(z, r, u) {
        var w = z.parentNode,
            A = z.style;
        var v = ((w.offsetWidth - z.offsetWidth) / 2) - e(w, "borderLeftWidth");
        var B = ((w.offsetHeight - z.offsetHeight) / 2) - e(w, "borderTopWidth");
        if (r) {
            A.left = v > 0 ? (v + "px") : "0"
        }
        if (u) {
            A.top = B > 0 ? (B + "px") : "0"
        }
    }
    function e(r, t) {
        return parseInt(n.css(r, t)) || 0
    }
})(jQuery);
(function (b) {
    var a = b.scrollTo = function (f, d, g) {
            b(window).scrollTo(f, d, g)
        };
    a.defaults = {
        axis: "xy",
        duration: parseFloat(b.fn.jquery) >= 1.3 ? 0 : 1
    };
    a.window = function (d) {
        return b(window)._scrollable()
    };
    b.fn._scrollable = function () {
        return this.map(function () {
            var f = this,
                d = !f.nodeName || b.inArray(f.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1;
            if (!d) {
                return f
            }
            var g = (f.contentWindow || f).document || f.ownerDocument || f;
            return b.browser.safari || g.compatMode == "BackCompat" ? g.body : g.documentElement
        })
    };
    b.fn.scrollTo = function (f, d, e) {
        if (typeof d == "object") {
            e = d;
            d = 0
        }
        if (typeof e == "function") {
            e = {
                onAfter: e
            }
        }
        if (f == "max") {
            f = 9000000000
        }
        e = b.extend({}, a.defaults, e);
        d = d || e.speed || e.duration;
        e.queue = e.queue && e.axis.length > 1;
        if (e.queue) {
            d /= 2
        }
        e.offset = c(e.offset);
        e.over = c(e.over);
        return this._scrollable().each(function () {
            var h = this,
                j = b(h),
                n = f,
                l, o = {},
                p = j.is("html,body");
            switch (typeof n) {
            case "number":
            case "string":
                if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(n)) {
                    n = c(n);
                    break
                }
                n = b(n, this);
            case "object":
                if (n.is || n.style) {
                    l = (n = b(n)).offset()
                }
            }
            b.each(e.axis.split(""), function (v, q) {
                var x = q == "x" ? "Left" : "Top",
                    g = x.toLowerCase(),
                    w = "scroll" + x,
                    r = h[w],
                    t = a.max(h, q);
                if (l) {
                    o[w] = l[g] + (p ? 0 : r - j.offset()[g]);
                    if (e.margin) {
                        o[w] -= parseInt(n.css("margin" + x)) || 0;
                        o[w] -= parseInt(n.css("border" + x + "Width")) || 0
                    }
                    o[w] += e.offset[g] || 0;
                    if (e.over[g]) {
                        o[w] += n[q == "x" ? "width" : "height"]() * e.over[g]
                    }
                } else {
                    var u = n[g];
                    o[w] = u.slice && u.slice(-1) == "%" ? parseFloat(u) / 100 * t : u
                }
                if (/^\d+$/.test(o[w])) {
                    o[w] = o[w] <= 0 ? 0 : Math.min(o[w], t)
                }
                if (!v && e.queue) {
                    if (r != o[w]) {
                        m(e.onAfterFirst)
                    }
                    delete o[w]
                }
            });
            m(e.onAfter);

            function m(g) {
                j.animate(o, d, e.easing, g &&
                function () {
                    g.call(this, f, e)
                })
            }
        }).end()
    };
    a.max = function (n, f) {
        var p = f == "x" ? "Width" : "Height",
            d = "scroll" + p;
        if (!b(n).is("html,body")) {
            return n[d] - b(n)[p.toLowerCase()]()
        }
        var o = "client" + p,
            g = n.ownerDocument.documentElement,
            j = n.ownerDocument.body;
        return Math.max(g[d], j[d]) - Math.min(g[o], j[o])
    };

    function c(d) {
        return typeof d == "object" ? d : {
            top: d,
            left: d
        }
    }
})(jQuery);
(function (a) {
    a.extend(a.fn, {
        validate: function (b) {
            if (!this.length) {
                b && b.debug && window.console && console.warn("nothing selected, can't validate, returning nothing");
                return
            }
            var c = a.data(this[0], "validator");
            if (c) {
                return c
            }
            c = new a.validator(b, this[0]);
            a.data(this[0], "validator", c);
            if (c.settings.onsubmit) {
                this.find("input, button").filter(".cancel").click(function () {
                    c.cancelSubmit = true
                });
                if (c.settings.submitHandler) {
                    this.find("input, button").filter(":submit").click(function () {
                        c.submitButton = this
                    })
                }
                this.submit(function (d) {
                    if (c.settings.debug) {
                        d.preventDefault()
                    }
                    function e() {
                        if (c.settings.submitHandler) {
                            if (c.submitButton) {
                                var f = a("<input type='hidden'/>").attr("name", c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)
                            }
                            c.settings.submitHandler.call(c, c.currentForm);
                            if (c.submitButton) {
                                f.remove()
                            }
                            return false
                        }
                        return true
                    }
                    if (c.cancelSubmit) {
                        c.cancelSubmit = false;
                        return e()
                    }
                    if (c.form()) {
                        if (c.pendingRequest) {
                            c.formSubmitted = true;
                            return false
                        }
                        return e()
                    } else {
                        c.focusInvalid();
                        return false
                    }
                })
            }
            return c
        },
        valid: function () {
            if (a(this[0]).is("form")) {
                return this.validate().form()
            } else {
                var c = true;
                var b = a(this[0].form).validate();
                this.each(function () {
                    c &= b.element(this)
                });
                return c
            }
        },
        removeAttrs: function (c) {
            var b = {},
                d = this;
            a.each(c.split(/\s/), function (e, f) {
                b[f] = d.attr(f);
                d.removeAttr(f)
            });
            return b
        },
        rules: function (j, g) {
            var c = this[0];
            if (j) {
                var b = a.data(c.form, "validator").settings;
                var d = b.rules;
                var e = a.validator.staticRules(c);
                switch (j) {
                case "add":
                    a.extend(e, a.validator.normalizeRule(g));
                    d[c.name] = e;
                    if (g.messages) {
                        b.messages[c.name] = a.extend(b.messages[c.name], g.messages)
                    }
                    break;
                case "remove":
                    if (!g) {
                        delete d[c.name];
                        return e
                    }
                    var h = {};
                    a.each(g.split(/\s/), function (n, m) {
                        h[m] = e[m];
                        delete e[m]
                    });
                    return h
                }
            }
            var f = a.validator.normalizeRules(a.extend({}, a.validator.metadataRules(c), a.validator.classRules(c), a.validator.attributeRules(c), a.validator.staticRules(c)), c);
            if (f.required) {
                var l = f.required;
                delete f.required;
                f = a.extend({
                    required: l
                }, f)
            }
            return f
        }
    });
    a.extend(a.expr[":"], {
        blank: function (b) {
            return !a.trim("" + b.value)
        },
        filled: function (b) {
            return !!a.trim("" + b.value)
        },
        unchecked: function (b) {
            return !b.checked
        }
    });
    a.validator = function (b, c) {
        this.settings = a.extend(true, {}, a.validator.defaults, b);
        this.currentForm = c;
        this.init()
    };
    a.validator.format = function (b, c) {
        if (arguments.length == 1) {
            return function () {
                var d = a.makeArray(arguments);
                d.unshift(b);
                return a.validator.format.apply(this, d)
            }
        }
        if (arguments.length > 2 && c.constructor != Array) {
            c = a.makeArray(arguments).slice(1)
        }
        if (c.constructor != Array) {
            c = [c]
        }
        a.each(c, function (e, d) {
            b = b.replace(new RegExp("\\{" + e + "\\}", "g"), d)
        });
        return b
    };
    a.extend(a.validator, {
        defaults: {
            messages: {},
            groups: {},
            rules: {},
            errorClass: "errorMessageValidation",
            validClass: "valid",
            errorElement: "label",
            focusInvalid: true,
            errorContainer: a([]),
            errorLabelContainer: a([]),
            onsubmit: true,
            ignore: [],
            ignoreTitle: false,
            onfocusin: function (b) {
                this.lastActive = b;
                if (this.settings.focusCleanup && !this.blockFocusCleanup) {
                    this.settings.unhighlight && this.settings.unhighlight.call(this, b, this.settings.errorClass, this.settings.validClass);
                    this.errorsFor(b).hide()
                }
            },
            onfocusout: function (b) {
                if (!this.checkable(b) && (b.name in this.submitted || !this.optional(b))) {
                    this.element(b)
                }
            },
            onkeyup: function (b) {
                if (b.name in this.submitted || b == this.lastElement) {
                    this.element(b)
                }
            },
            onclick: function (b) {
                if (b.name in this.submitted) {
                    this.element(b)
                } else {
                    if (b.parentNode.name in this.submitted) {
                        this.element(b.parentNode)
                    }
                }
            },
            highlight: function (b, c, d) {
                a(b).addClass(c).removeClass(d)
            },
            unhighlight: function (b, c, d) {
                a(b).removeClass(c).addClass(d)
            }
        },
        setDefaults: function (b) {
            a.extend(a.validator.defaults, b)
        },
        messages: {
            required: "This field is required.",
            remote: "Please fix this field.",
            email: "Please enter a valid email address.",
            url: "Please enter a valid URL.",
            date: "Please enter a valid date.",
            dateISO: "Please enter a valid date (ISO).",
            number: "Please enter a valid number.",
            digits: "Please enter only digits.",
            creditcard: "Please enter a valid credit card number.",
            equalTo: "Please enter the same value again.",
            accept: "Please enter a value with a valid extension.",
            maxlength: a.validator.format("Please enter no more than {0} characters."),
            minlength: a.validator.format("Please enter at least {0} characters."),
            rangelength: a.validator.format("Please enter a value between {0} and {1} characters long."),
            range: a.validator.format("Please enter a value between {0} and {1}."),
            max: a.validator.format("Please enter a value less than or equal to {0}."),
            min: a.validator.format("Please enter a value greater than or equal to {0}.")
        },
        autoCreateRanges: false,
        prototype: {
            init: function () {
                this.labelContainer = a(this.settings.errorLabelContainer);
                this.errorContext = this.labelContainer.length && this.labelContainer || a(this.currentForm);
                this.containers = a(this.settings.errorContainer).add(this.settings.errorLabelContainer);
                this.submitted = {};
                this.valueCache = {};
                this.pendingRequest = 0;
                this.pending = {};
                this.invalid = {};
                this.reset();
                var d = (this.groups = {});
                a.each(this.settings.groups, function (e, f) {
                    a.each(f.split(/\s/), function (h, g) {
                        d[g] = e
                    })
                });
                var b = this.settings.rules;
                a.each(b, function (e, f) {
                    b[e] = a.validator.normalizeRule(f)
                });

                function c(e) {
                    var g = a.data(this[0].form, "validator"),
                        f = "on" + e.type.replace(/^validate/, "");
                    g.settings[f] && g.settings[f].call(g, this[0])
                }
                a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", c).validateDelegate(":radio, :checkbox, select, option", "click", c);
                if (this.settings.invalidHandler) {
                    a(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
                }
            },
            form: function () {
                this.checkForm();
                a.extend(this.submitted, this.errorMap);
                this.invalid = a.extend({}, this.errorMap);
                if (!this.valid()) {
                    a(this.currentForm).triggerHandler("invalid-form", [this])
                }
                this.showErrors();
                return this.valid()
            },
            checkForm: function () {
                this.prepareForm();
                for (var c = 0, b = (this.currentElements = this.elements()); b[c]; c++) {
                    this.check(b[c])
                }
                return this.valid()
            },
            element: function (b) {
                b = this.clean(b);
                this.lastElement = b;
                this.prepareElement(b);
                this.currentElements = a(b);
                var c = this.check(b);
                if (c) {
                    delete this.invalid[b.name]
                } else {
                    this.invalid[b.name] = true
                }
                if (!this.numberOfInvalids()) {
                    this.toHide = this.toHide.add(this.containers)
                }
                this.showErrors();
                return c
            },
            showErrors: function (b) {
                if (b) {
                    a.extend(this.errorMap, b);
                    this.errorList = [];
                    for (var c in b) {
                        this.errorList.push({
                            message: b[c],
                            element: this.findByName(c)[0]
                        })
                    }
                    this.successList = a.grep(this.successList, function (d) {
                        return !(d.name in b)
                    })
                }
                this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
            },
            resetForm: function () {
                if (a.fn.resetForm) {
                    a(this.currentForm).resetForm()
                }
                this.submitted = {};
                this.prepareForm();
                this.hideErrors();
                this.elements().removeClass(this.settings.errorClass)
            },
            numberOfInvalids: function () {
                return this.objectLength(this.invalid)
            },
            objectLength: function (c) {
                var b = 0;
                for (var d in c) {
                    b++
                }
                return b
            },
            hideErrors: function () {
                this.addWrapper(this.toHide).hide()
            },
            valid: function () {
                return this.size() == 0
            },
            size: function () {
                return this.errorList.length
            },
            focusInvalid: function () {
                if (this.settings.focusInvalid) {
                    try {
                        a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
                    } catch (b) {}
                }
            },
            findLastActive: function () {
                var b = this.lastActive;
                return b && a.grep(this.errorList, function (c) {
                    return c.element.name == b.name
                }).length == 1 && b
            },
            elements: function () {
                var c = this,
                    b = {};
                return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () {
                    !this.name && c.settings.debug && window.console && console.error("%o has no name assigned", this);
                    if (this.name in b || !c.objectLength(a(this).rules())) {
                        return false
                    }
                    b[this.name] = true;
                    return true
                })
            },
            clean: function (b) {
                return a(b)[0]
            },
            errors: function () {
                return a(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
            },
            reset: function () {
                this.successList = [];
                this.errorList = [];
                this.errorMap = {};
                this.toShow = a([]);
                this.toHide = a([]);
                this.currentElements = a([])
            },
            prepareForm: function () {
                this.reset();
                this.toHide = this.errors().add(this.containers)
            },
            prepareElement: function (b) {
                this.reset();
                this.toHide = this.errorsFor(b)
            },
            check: function (c) {
                c = this.clean(c);
                if (this.checkable(c)) {
                    c = this.findByName(c.name)[0]
                }
                var f = a(c).rules();
                var b = false;
                for (method in f) {
                    var d = {
                        method: method,
                        parameters: f[method]
                    };
                    try {
                        var g = a.validator.methods[method].call(this, c.value.replace(/\r/g, ""), c, d.parameters);
                        if (g == "dependency-mismatch") {
                            b = true;
                            continue
                        }
                        b = false;
                        if (g == "pending") {
                            this.toHide = this.toHide.not(this.errorsFor(c));
                            return
                        }
                        if (!g) {
                            this.formatAndAdd(c, d);
                            return false
                        }
                    } catch (h) {
                        this.settings.debug && window.console && console.log("exception occured when checking element " + c.id + ", check the '" + d.method + "' method", h);
                        throw h
                    }
                }
                if (b) {
                    return
                }
                if (this.objectLength(f)) {
                    this.successList.push(c)
                }
                return true
            },
            customMetaMessage: function (b, d) {
                if (!a.metadata) {
                    return
                }
                var c = this.settings.meta ? a(b).metadata()[this.settings.meta] : a(b).metadata();
                return c && c.messages && c.messages[d]
            },
            customMessage: function (d, b) {
                var c = this.settings.messages[d];
                return c && (c.constructor == String ? c : c[b])
            },
            findDefined: function () {
                for (var b = 0; b < arguments.length; b++) {
                    if (arguments[b] !== undefined) {
                        return arguments[b]
                    }
                }
                return undefined
            },
            defaultMessage: function (b, c) {
                return this.findDefined(this.customMessage(b.name, c), this.customMetaMessage(b, c), !this.settings.ignoreTitle && b.title || undefined, a.validator.messages[c], "<strong>Warning: No message defined for " + b.name + "</strong>")
            },
            formatAndAdd: function (e, d) {
                var c = this.defaultMessage(e, d.method),
                    b = /\$?\{(\d+)\}/g;
                if (typeof c == "function") {
                    c = c.call(this, d.parameters, e)
                } else {
                    if (b.test(c)) {
                        c = jQuery.format(c.replace(b, "{$1}"), d.parameters)
                    }
                }
                this.errorList.push({
                    message: c,
                    element: e
                });
                this.errorMap[e.name] = c;
                this.submitted[e.name] = c
            },
            addWrapper: function (b) {
                if (this.settings.wrapper) {
                    b = b.add(b.parent(this.settings.wrapper))
                }
                return b
            },
            defaultShowErrors: function () {
                for (var c = 0; this.errorList[c]; c++) {
                    var b = this.errorList[c];
                    this.settings.highlight && this.settings.highlight.call(this, b.element, this.settings.errorClass, this.settings.validClass);
                    this.showLabel(b.element, b.message)
                }
                if (this.errorList.length) {
                    this.toShow = this.toShow.add(this.containers)
                }
                if (this.settings.success) {
                    for (var c = 0; this.successList[c]; c++) {
                        this.showLabel(this.successList[c])
                    }
                }
                if (this.settings.unhighlight) {
                    for (var c = 0, d = this.validElements(); d[c]; c++) {
                        this.settings.unhighlight.call(this, d[c], this.settings.errorClass, this.settings.validClass)
                    }
                }
                this.toHide = this.toHide.not(this.toShow);
                this.hideErrors();
                this.addWrapper(this.toShow).show()
            },
            validElements: function () {
                return this.currentElements.not(this.invalidElements())
            },
            invalidElements: function () {
                return a(this.errorList).map(function () {
                    return this.element
                })
            },
            showLabel: function (b, d) {
                var c = this.errorsFor(b);
                if (c.length) {
                    c.removeClass().addClass(this.settings.errorClass);
                    c.attr("generated") && c.html(d)
                } else {
                    c = a("<" + this.settings.errorElement + "/>").attr({
                        "for": this.idOrName(b),
                        generated: true
                    }).addClass(this.settings.errorClass).html(d || "");
                    if (this.settings.wrapper) {
                        c = c.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()
                    }
                    if (!this.labelContainer.append(c).length) {
                        this.settings.errorPlacement ? this.settings.errorPlacement(c, a(b)) : c.insertAfter(b)
                    }
                }
                if (!d && this.settings.success) {
                    c.text("");
                    typeof this.settings.success == "string" ? c.addClass(this.settings.success) : this.settings.success(c)
                }
                this.toShow = this.toShow.add(c)
            },
            errorsFor: function (b) {
                var c = this.idOrName(b);
                return this.errors().filter(function () {
                    return a(this).attr("for") == c
                })
            },
            idOrName: function (b) {
                return this.groups[b.name] || (this.checkable(b) ? b.name : b.id || b.name)
            },
            checkable: function (b) {
                return /radio|checkbox/i.test(b.type)
            },
            findByName: function (b) {
                var c = this.currentForm;
                return a(document.getElementsByName(b)).map(function (e, d) {
                    return d.form == c && d.name == b && d || null
                })
            },
            getLength: function (c, b) {
                switch (b.nodeName.toLowerCase()) {
                case "select":
                    return a("option:selected", b).length;
                case "input":
                    if (this.checkable(b)) {
                        return this.findByName(b.name).filter(":checked").length
                    }
                }
                return c.length
            },
            depend: function (c, b) {
                return this.dependTypes[typeof c] ? this.dependTypes[typeof c](c, b) : true
            },
            dependTypes: {
                "boolean": function (c, b) {
                    return c
                },
                string: function (c, b) {
                    return !!a(c, b.form).length
                },
                "function": function (c, b) {
                    return c(b)
                }
            },
            optional: function (b) {
                return !a.validator.methods.required.call(this, a.trim(b.value), b) && "dependency-mismatch"
            },
            startRequest: function (b) {
                if (!this.pending[b.name]) {
                    this.pendingRequest++;
                    this.pending[b.name] = true
                }
            },
            stopRequest: function (b, c) {
                this.pendingRequest--;
                if (this.pendingRequest < 0) {
                    this.pendingRequest = 0
                }
                delete this.pending[b.name];
                if (c && this.pendingRequest == 0 && this.formSubmitted && this.form()) {
                    a(this.currentForm).submit();
                    this.formSubmitted = false
                } else {
                    if (!c && this.pendingRequest == 0 && this.formSubmitted) {
                        a(this.currentForm).triggerHandler("invalid-form", [this]);
                        this.formSubmitted = false
                    }
                }
            },
            previousValue: function (b) {
                return a.data(b, "previousValue") || a.data(b, "previousValue", {
                    old: null,
                    valid: true,
                    message: this.defaultMessage(b, "remote")
                })
            }
        },
        classRuleSettings: {
            required: {
                required: true
            },
            email: {
                email: true
            },
            url: {
                url: true
            },
            date: {
                date: true
            },
            dateISO: {
                dateISO: true
            },
            dateDE: {
                dateDE: true
            },
            number: {
                number: true
            },
            numberDE: {
                numberDE: true
            },
            digits: {
                digits: true
            },
            creditcard: {
                creditcard: true
            }
        },
        addClassRules: function (b, c) {
            b.constructor == String ? this.classRuleSettings[b] = c : a.extend(this.classRuleSettings, b)
        },
        classRules: function (d) {
            var b = {};
            var c = a(d).attr("class");
            c && a.each(c.split(" "), function () {
                if (this in a.validator.classRuleSettings) {
                    a.extend(b, a.validator.classRuleSettings[this])
                }
            });
            return b
        },
        attributeRules: function (d) {
            var b = {};
            var e = a(d);
            for (method in a.validator.methods) {
                var c = e.attr(method);
                if (c) {
                    b[method] = c
                }
            }
            if (b.maxlength && /-1|2147483647|524288/.test(b.maxlength)) {
                delete b.maxlength
            }
            return b
        },
        metadataRules: function (b) {
            if (!a.metadata) {
                return {}
            }
            var c = a.data(b.form, "validator").settings.meta;
            return c ? a(b).metadata()[c] : a(b).metadata()
        },
        staticRules: function (c) {
            var b = {};
            var d = a.data(c.form, "validator");
            if (d.settings.rules) {
                b = a.validator.normalizeRule(d.settings.rules[c.name]) || {}
            }
            return b
        },
        normalizeRules: function (c, b) {
            a.each(c, function (e, f) {
                if (f === false) {
                    delete c[e];
                    return
                }
                if (f.param || f.depends) {
                    var d = true;
                    switch (typeof f.depends) {
                    case "string":
                        d = !! a(f.depends, b.form).length;
                        break;
                    case "function":
                        d = f.depends.call(b, b);
                        break
                    }
                    if (d) {
                        c[e] = f.param !== undefined ? f.param : true
                    } else {
                        delete c[e]
                    }
                }
            });
            a.each(c, function (d, e) {
                c[d] = a.isFunction(e) ? e(b) : e
            });
            a.each(["minlength", "maxlength", "min", "max"], function () {
                if (c[this]) {
                    c[this] = Number(c[this])
                }
            });
            a.each(["rangelength", "range"], function () {
                if (c[this]) {
                    c[this] = [Number(c[this][0]), Number(c[this][1])]
                }
            });
            if (a.validator.autoCreateRanges) {
                if (c.min && c.max) {
                    c.range = [c.min, c.max];
                    delete c.min;
                    delete c.max
                }
                if (c.minlength && c.maxlength) {
                    c.rangelength = [c.minlength, c.maxlength];
                    delete c.minlength;
                    delete c.maxlength
                }
            }
            if (c.messages) {
                delete c.messages
            }
            return c
        },
        normalizeRule: function (b) {
            if (typeof b == "string") {
                var c = {};
                a.each(b.split(/\s/), function () {
                    c[this] = true
                });
                b = c
            }
            return b
        },
        addMethod: function (d, c, b) {
            a.validator.methods[d] = c;
            a.validator.messages[d] = b != undefined ? b : a.validator.messages[d];
            if (c.length < 3) {
                a.validator.addClassRules(d, a.validator.normalizeRule(d))
            }
        },
        methods: {
            required: function (b, d, c) {
                if (!this.depend(c, d)) {
                    return "dependency-mismatch"
                }
                switch (d.nodeName.toLowerCase()) {
                case "select":
                    var e = a(d).val();
                    return e && e.length > 0;
                case "input":
                    if (this.checkable(d)) {
                        return this.getLength(b, d) > 0
                    }
                default:
                    return a.trim(b).length > 0
                }
            },
            remote: function (b, c, g) {
                if (this.optional(c)) {
                    return "dependency-mismatch"
                }
                var e = this.previousValue(c);
                if (!this.settings.messages[c.name]) {
                    this.settings.messages[c.name] = {}
                }
                e.originalMessage = this.settings.messages[c.name].remote;
                this.settings.messages[c.name].remote = e.message;
                g = typeof g == "string" && {
                    url: g
                } || g;
                if (e.old !== b) {
                    e.old = b;
                    var d = this;
                    this.startRequest(c);
                    var f = {};
                    f[c.name] = b;
                    a.ajax(a.extend(true, {
                        url: g,
                        mode: "abort",
                        port: "validate" + c.name,
                        dataType: "json",
                        data: f,
                        success: function (m) {
                            d.settings.messages[c.name].remote = e.originalMessage;
                            var l = m === true;
                            if (l) {
                                var n = d.formSubmitted;
                                d.prepareElement(c);
                                d.formSubmitted = n;
                                d.successList.push(c);
                                d.showErrors()
                            } else {
                                var h = {};
                                var j = (e.message = m || d.defaultMessage(c, "remote"));
                                h[c.name] = a.isFunction(j) ? j(b) : j;
                                d.showErrors(h)
                            }
                            e.valid = l;
                            d.stopRequest(c, l)
                        }
                    }, g));
                    return "pending"
                } else {
                    if (this.pending[c.name]) {
                        return "pending"
                    }
                }
                return e.valid
            },
            minlength: function (b, d, c) {
                return this.optional(d) || this.getLength(a.trim(b), d) >= c
            },
            maxlength: function (b, d, c) {
                return this.optional(d) || this.getLength(a.trim(b), d) <= c
            },
            rangelength: function (b, d, c) {
                var e = this.getLength(a.trim(b), d);
                return this.optional(d) || (e >= c[0] && e <= c[1])
            },
            min: function (b, d, c) {
                return this.optional(d) || b >= c
            },
            max: function (b, d, c) {
                return this.optional(d) || b <= c
            },
            range: function (b, d, c) {
                return this.optional(d) || (b >= c[0] && b <= c[1])
            },
            email: function (c, b) {
                return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(c)
            },
            url: function (c, b) {
                return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)
            },
            date: function (c, b) {
                return this.optional(b) || !/Invalid|NaN/.test(new Date(c))
            },
            dateISO: function (c, b) {
                return this.optional(b) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)
            },
            number: function (c, b) {
                return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)
            },
            digits: function (c, b) {
                return this.optional(b) || /^\d+$/.test(c)
            },
            creditcard: function (b, c) {
                if (this.optional(c)) {
                    return "dependency-mismatch"
                }
                if (/[^0-9-]+/.test(b)) {
                    return false
                }
                var g = 0,
                    d = 0,
                    f = false;
                b = b.replace(/\D/g, "");
                for (var e = b.length - 1; e >= 0; e--) {
                    var h = b.charAt(e);
                    var d = parseInt(h, 10);
                    if (f) {
                        if ((d *= 2) > 9) {
                            d -= 9
                        }
                    }
                    g += d;
                    f = !f
                }
                return (g % 10) == 0
            },
            accept: function (b, d, c) {
                c = typeof c == "string" ? c.replace(/,/g, "|") : "png|jpe?g|gif";
                return this.optional(d) || b.match(new RegExp(".(" + c + ")$", "i"))
            },
            equalTo: function (b, d, c) {
                var e = a(c).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () {
                    a(d).valid()
                });
                return b == e.val()
            }
        }
    });
    a.format = a.validator.format
})(jQuery);
(function (c) {
    var b = c.ajax;
    var a = {};
    c.ajax = function (d) {
        d = c.extend(d, c.extend({}, c.ajaxSettings, d));
        var e = d.port;
        if (d.mode == "abort") {
            if (a[e]) {
                a[e].abort()
            }
            return (a[e] = b.apply(this, arguments))
        }
        return b.apply(this, arguments)
    }
})(jQuery);
(function (a) {
    if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) {
        a.each({
            focus: "focusin",
            blur: "focusout"
        }, function (c, d) {
            a.event.special[d] = {
                setup: function () {
                    this.addEventListener(c, b, true)
                },
                teardown: function () {
                    this.removeEventListener(c, b, true)
                },
                handler: function (f) {
                    arguments[0] = a.event.fix(f);
                    arguments[0].type = d;
                    return a.event.handle.apply(this, arguments)
                }
            };

            function b(f) {
                f = a.event.fix(f);
                f.type = d;
                return a.event.handle.call(this, f)
            }
        })
    }
    a.extend(a.fn, {
        validateDelegate: function (c, d, b) {
            return this.bind(d, function (e) {
                var f = a(e.target);
                if (f.is(c)) {
                    return b.apply(f, arguments)
                }
            })
        }
    })
})(jQuery);
(function (a) {
    a.fn.extend({
        textBoxWithDefault: function (c) {
            var b = {
                defaultValue: "",
                defaultColor: "#000",
                color: "#000"
            };
            var c = a.extend(b, c);
            return this.each(function () {
                var d = a(this);
                d.click(function () {
                    if (c.defaultValue != "" && c.defaultValue == d.val()) {
                        d.val("");
                        d.css("color", c.color)
                    }
                });
                d.blur(function () {
                    if (d.val() == "") {
                        d.val(c.defaultValue);
                        d.css("color", c.defaultColor)
                    }
                })
            })
        }
    })
})(jQuery);
