(function (c) {
    function b(e, d) {
        return (typeof e == "function") ? (e.call(d)) : e
    }
    function a(e, d) {
        this.$element = c(e);
        this.options = d;
        this.enabled = true;
        this.fixTitle()
    }
    a.prototype = {
        show: function () {
            var g = this.getTitle();
            if (g && this.enabled) {
                var f = this.tip();
                f.find(".tipsy-inner")[this.options.html ? "html" : "text"](g);
                f[0].className = "tipsy";
                f.remove().css({
                    top: 0,
                    left: 0,
                    visibility: "hidden",
                    display: "block"
                }).prependTo(document.body);
                var j = c.extend({}, this.$element.offset(), {
                    width: this.$element[0].offsetWidth,
                    height: this.$element[0].offsetHeight
                });
                var d = f[0].offsetWidth,
                    i = f[0].offsetHeight,
                    h = b(this.options.gravity, this.$element[0]);
                var e;
                switch (h.charAt(0)) {
                case "n":
                    e = {
                        top: j.top + j.height + this.options.offset,
                        left: j.left + j.width / 2 - d / 2
                    };
                    break;
                case "s":
                    e = {
                        top: j.top - i - this.options.offset,
                        left: j.left + j.width / 2 - d / 2
                    };
                    break;
                case "e":
                    e = {
                        top: j.top + j.height / 2 - i / 2,
                        left: j.left - d - this.options.offset
                    };
                    break;
                case "w":
                    e = {
                        top: j.top + j.height / 2 - i / 2,
                        left: j.left + j.width + this.options.offset
                    };
                    break
                }
                if (h.length == 2) {
                    if (h.charAt(1) == "w") {
                        e.left = j.left + j.width / 2 - 15
                    } else {
                        e.left = j.left + j.width / 2 - d + 15
                    }
                }
                f.css(e).addClass("tipsy-" + h);
                f.find(".tipsy-arrow")[0].className = "tipsy-arrow tipsy-arrow-" + h.charAt(0);
                if (this.options.className) {
                    f.addClass(b(this.options.className, this.$element[0]))
                }
                if (this.options.fade) {
                    f.stop().css({
                        opacity: 0,
                        display: "block",
                        visibility: "visible"
                    }).animate({
                        opacity: this.options.opacity
                    })
                } else {
                    f.css({
                        visibility: "visible",
                        opacity: this.options.opacity
                    })
                }
            }
        },
        hide: function () {
            if (this.options.fade) {
                this.tip().stop().fadeOut(function () {
                    c(this).remove()
                })
            } else {
                this.tip().remove()
            }
        },
        fixTitle: function () {
            var d = this.$element;
            if (d.attr("title") || typeof (d.attr("original-title")) != "string") {
                d.attr("original-title", d.attr("title") || "").removeAttr("title")
            }
        },
        getTitle: function () {
            var f, d = this.$element,
                e = this.options;
            this.fixTitle();
            var f, e = this.options;
            if (typeof e.title == "string") {
                f = d.attr(e.title == "title" ? "original-title" : e.title)
            } else {
                if (typeof e.title == "function") {
                    f = e.title.call(d[0])
                }
            }
            f = ("" + f).replace(/(^\s*|\s*$)/, "");
            return f || e.fallback
        },
        tip: function () {
            if (!this.$tip) {
                this.$tip = c('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>')
            }
            return this.$tip
        },
        validate: function () {
            if (!this.$element[0].parentNode) {
                this.hide();
                this.$element = null;
                this.options = null
            }
        },
        enable: function () {
            this.enabled = true
        },
        disable: function () {
            this.enabled = false
        },
        toggleEnabled: function () {
            this.enabled = !this.enabled
        }
    };
    c.fn.tipsy = function (h) {
        if (h === true) {
            return this.data("tipsy")
        } else {
            if (typeof h == "string") {
                var j = this.data("tipsy");
                if (j) {
                    j[h]()
                }
                return this
            }
        }
        h = c.extend({}, c.fn.tipsy.defaults, h);

        function g(l) {
            var m = c.data(l, "tipsy");
            if (!m) {
                m = new a(l, c.fn.tipsy.elementOptions(l, h));
                c.data(l, "tipsy", m)
            }
            return m
        }
        function k() {
            var l = g(this);
            l.hoverState = "in";
            if (h.delayIn == 0) {
                l.show()
            } else {
                l.fixTitle();
                setTimeout(function () {
                    if (l.hoverState == "in") {
                        l.show()
                    }
                }, h.delayIn)
            }
        }
        function f() {
            var l = g(this);
            l.hoverState = "out";
            if (h.delayOut == 0) {
                l.hide()
            } else {
                setTimeout(function () {
                    if (l.hoverState == "out") {
                        l.hide()
                    }
                }, h.delayOut)
            }
        }
        if (!h.live) {
            this.each(function () {
                g(this)
            })
        }
        if (h.trigger != "manual") {
            var d = h.live ? "live" : "bind",
                i = h.trigger == "hover" ? "mouseenter" : "focus",
                e = h.trigger == "hover" ? "mouseleave" : "blur";
            this[d](i, k)[d](e, f)
        }
        return this
    };
    c.fn.tipsy.defaults = {
        className: null,
        delayIn: 0,
        delayOut: 0,
        fade: false,
        fallback: "",
        gravity: "n",
        html: false,
        live: false,
        offset: 0,
        opacity: 0.8,
        title: "title",
        trigger: "hover"
    };
    c.fn.tipsy.elementOptions = function (e, d) {
        return c.metadata ? c.extend({}, d, c(e).metadata()) : d
    };
    c.fn.tipsy.autoNS = function () {
        return c(this).offset().top > (c(document).scrollTop() + c(window).height() / 2) ? "s" : "n"
    };
    c.fn.tipsy.autoWE = function () {
        return c(this).offset().left > (c(document).scrollLeft() + c(window).width() / 2) ? "e" : "w"
    };
    c.fn.tipsy.autoBounds = function (e, d) {
        return function () {
            var f = {
                ns: d[0],
                ew: (d.length > 1 ? d[1] : false)
            },
                i = c(document).scrollTop() + e,
                g = c(document).scrollLeft() + e,
                h = c(this);
            if (h.offset().top < i) {
                f.ns = "n"
            }
            if (h.offset().left < g) {
                f.ew = "w"
            }
            if (c(window).width() + c(document).scrollLeft() - h.offset().left < e) {
                f.ew = "e"
            }
            if (c(window).height() + c(document).scrollTop() - h.offset().top < e) {
                f.ns = "s"
            }
            return f.ns + (f.ew ? f.ew : "")
        }
    }
})(jQuery);
jQuery.cookie = function (d, e, b) {
    if (arguments.length > 1 && String(e) !== "[object Object]") {
        b = jQuery.extend({}, b);
        if (e === null || e === undefined) {
            b.expires = -1
        }
        if (typeof b.expires === "number") {
            var g = b.expires,
                c = b.expires = new Date();
            c.setDate(c.getDate() + g)
        }
        e = String(e);
        return (document.cookie = [encodeURIComponent(d), "=", b.raw ? e : encodeURIComponent(e), b.expires ? "; expires=" + b.expires.toUTCString() : "", b.path ? "; path=" + b.path : "", b.domain ? "; domain=" + b.domain : "", b.secure ? "; secure" : ""].join(""))
    }
    b = e || {};
    var a, f = b.raw ?
    function (h) {
        return h
    } : decodeURIComponent;
    return (a = new RegExp("(?:^|; )" + encodeURIComponent(d) + "=([^;]*)").exec(document.cookie)) ? f(a[1]) : null
};
jQuery.effects ||
function (r, i) {
    function e(j) {
        var f;
        if (j && j.constructor == Array && j.length == 3) {
            return j
        }
        if (f = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j)) {
            return [parseInt(f[1], 10), parseInt(f[2], 10), parseInt(f[3], 10)]
        }
        if (f = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j)) {
            return [parseFloat(f[1]) * 2.55, parseFloat(f[2]) * 2.55, parseFloat(f[3]) * 2.55]
        }
        if (f = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j)) {
            return [parseInt(f[1], 16), parseInt(f[2], 16), parseInt(f[3], 16)]
        }
        if (f = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j)) {
            return [parseInt(f[1] + f[1], 16), parseInt(f[2] + f[2], 16), parseInt(f[3] + f[3], 16)]
        }
        if (/rgba\(0, 0, 0, 0\)/.exec(j)) {
            return d.transparent
        }
        return d[r.trim(j).toLowerCase()]
    }
    function x(k, j) {
        var f;
        do {
            f = r.curCSS(k, j);
            if (f != "" && f != "transparent" || r.nodeName(k, "body")) {
                break
            }
            j = "backgroundColor"
        } while (k = k.parentNode);
        return e(f)
    }
    function c() {
        var m = document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle,
            j = {},
            f, l;
        if (m && m.length && m[0] && m[m[0]]) {
            for (var k = m.length; k--;) {
                f = m[k];
                if (typeof m[f] == "string") {
                    l = f.replace(/\-(\w)/g, function (o, n) {
                        return n.toUpperCase()
                    });
                    j[l] = m[f]
                }
            }
        } else {
            for (f in m) {
                if (typeof m[f] === "string") {
                    j[f] = m[f]
                }
            }
        }
        return j
    }
    function b(k) {
        var j, f;
        for (j in k) {
            f = k[j];
            if (f == null || r.isFunction(f) || j in w || /scrollbar/.test(j) || !/color/i.test(j) && isNaN(parseFloat(f))) {
                delete k[j]
            }
        }
        return k
    }
    function v(l, j) {
        var f = {
            _: 0
        },
            k;
        for (k in j) {
            if (l[k] != j[k]) {
                f[k] = j[k]
            }
        }
        return f
    }
    function h(l, j, f, k) {
        if (typeof l == "object") {
            k = j;
            f = null;
            j = l;
            l = j.effect
        }
        if (r.isFunction(j)) {
            k = j;
            f = null;
            j = {}
        }
        if (typeof j == "number" || r.fx.speeds[j]) {
            k = f;
            f = j;
            j = {}
        }
        if (r.isFunction(f)) {
            k = f;
            f = null
        }
        j = j || {};
        f = f || j.duration;
        f = r.fx.off ? 0 : typeof f == "number" ? f : f in r.fx.speeds ? r.fx.speeds[f] : r.fx.speeds._default;
        k = k || j.complete;
        return [l, j, f, k]
    }
    function g(f) {
        if (!f || typeof f === "number" || r.fx.speeds[f]) {
            return true
        }
        if (typeof f === "string" && !r.effects[f]) {
            return true
        }
        return false
    }
    r.effects = {};
    r.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"], function (j, f) {
        r.fx.step[f] = function (k) {
            if (!k.colorInit) {
                k.start = x(k.elem, f);
                k.end = e(k.end);
                k.colorInit = true
            }
            k.elem.style[f] = "rgb(" + Math.max(Math.min(parseInt(k.pos * (k.end[0] - k.start[0]) + k.start[0], 10), 255), 0) + "," + Math.max(Math.min(parseInt(k.pos * (k.end[1] - k.start[1]) + k.start[1], 10), 255), 0) + "," + Math.max(Math.min(parseInt(k.pos * (k.end[2] - k.start[2]) + k.start[2], 10), 255), 0) + ")"
        }
    });
    var d = {
        aqua: [0, 255, 255],
        azure: [240, 255, 255],
        beige: [245, 245, 220],
        black: [0, 0, 0],
        blue: [0, 0, 255],
        brown: [165, 42, 42],
        cyan: [0, 255, 255],
        darkblue: [0, 0, 139],
        darkcyan: [0, 139, 139],
        darkgrey: [169, 169, 169],
        darkgreen: [0, 100, 0],
        darkkhaki: [189, 183, 107],
        darkmagenta: [139, 0, 139],
        darkolivegreen: [85, 107, 47],
        darkorange: [255, 140, 0],
        darkorchid: [153, 50, 204],
        darkred: [139, 0, 0],
        darksalmon: [233, 150, 122],
        darkviolet: [148, 0, 211],
        fuchsia: [255, 0, 255],
        gold: [255, 215, 0],
        green: [0, 128, 0],
        indigo: [75, 0, 130],
        khaki: [240, 230, 140],
        lightblue: [173, 216, 230],
        lightcyan: [224, 255, 255],
        lightgreen: [144, 238, 144],
        lightgrey: [211, 211, 211],
        lightpink: [255, 182, 193],
        lightyellow: [255, 255, 224],
        lime: [0, 255, 0],
        magenta: [255, 0, 255],
        maroon: [128, 0, 0],
        navy: [0, 0, 128],
        olive: [128, 128, 0],
        orange: [255, 165, 0],
        pink: [255, 192, 203],
        purple: [128, 0, 128],
        violet: [128, 0, 128],
        red: [255, 0, 0],
        silver: [192, 192, 192],
        white: [255, 255, 255],
        yellow: [255, 255, 0],
        transparent: [255, 255, 255]
    },
        a = ["add", "remove", "toggle"],
        w = {
            border: 1,
            borderBottom: 1,
            borderColor: 1,
            borderLeft: 1,
            borderRight: 1,
            borderTop: 1,
            borderWidth: 1,
            margin: 1,
            padding: 1
        };
    r.effects.animateClass = function (l, j, f, k) {
        if (r.isFunction(f)) {
            k = f;
            f = null
        }
        return this.queue(function () {
            var q = r(this),
                p = q.attr("style") || " ",
                n = b(c.call(this)),
                o, m = q.attr("class");
            r.each(a, function (s, t) {
                l[t] && q[t + "Class"](l[t])
            });
            o = b(c.call(this));
            q.attr("class", m);
            q.animate(v(n, o), {
                queue: false,
                duration: j,
                easing: f,
                complete: function () {
                    r.each(a, function (s, t) {
                        l[t] && q[t + "Class"](l[t])
                    });
                    if (typeof q.attr("style") == "object") {
                        q.attr("style").cssText = "";
                        q.attr("style").cssText = p
                    } else {
                        q.attr("style", p)
                    }
                    k && k.apply(this, arguments);
                    r.dequeue(this)
                }
            })
        })
    };
    r.fn.extend({
        _addClass: r.fn.addClass,
        addClass: function (l, j, f, k) {
            return j ? r.effects.animateClass.apply(this, [{
                add: l
            },
            j, f, k]) : this._addClass(l)
        },
        _removeClass: r.fn.removeClass,
        removeClass: function (l, j, f, k) {
            return j ? r.effects.animateClass.apply(this, [{
                remove: l
            },
            j, f, k]) : this._removeClass(l)
        },
        _toggleClass: r.fn.toggleClass,
        toggleClass: function (m, j, f, l, k) {
            return typeof j == "boolean" || j === i ? f ? r.effects.animateClass.apply(this, [j ? {
                add: m
            } : {
                remove: m
            },
            f, l, k]) : this._toggleClass(m, j) : r.effects.animateClass.apply(this, [{
                toggle: m
            },
            j, f, l])
        },
        switchClass: function (m, j, f, l, k) {
            return r.effects.animateClass.apply(this, [{
                add: j,
                remove: m
            },
            f, l, k])
        }
    });
    r.extend(r.effects, {
        version: "1.8.16",
        save: function (k, j) {
            for (var f = 0; f < j.length; f++) {
                j[f] !== null && k.data("ec.storage." + j[f], k[0].style[j[f]])
            }
        },
        restore: function (k, j) {
            for (var f = 0; f < j.length; f++) {
                j[f] !== null && k.css(j[f], k.data("ec.storage." + j[f]))
            }
        },
        setMode: function (j, f) {
            if (f == "toggle") {
                f = j.is(":hidden") ? "show" : "hide"
            }
            return f
        },
        getBaseline: function (k, j) {
            var f;
            switch (k[0]) {
            case "top":
                f = 0;
                break;
            case "middle":
                f = 0.5;
                break;
            case "bottom":
                f = 1;
                break;
            default:
                f = k[0] / j.height
            }
            switch (k[1]) {
            case "left":
                k = 0;
                break;
            case "center":
                k = 0.5;
                break;
            case "right":
                k = 1;
                break;
            default:
                k = k[1] / j.width
            }
            return {
                x: k,
                y: f
            }
        },
        createWrapper: function (l) {
            if (l.parent().is(".ui-effects-wrapper")) {
                return l.parent()
            }
            var j = {
                width: l.outerWidth(true),
                height: l.outerHeight(true),
                "float": l.css("float")
            },
                f = r("<div></div>").addClass("ui-effects-wrapper").css({
                    fontSize: "100%",
                    background: "transparent",
                    border: "none",
                    margin: 0,
                    padding: 0
                }),
                k = document.activeElement;
            l.wrap(f);
            if (l[0] === k || r.contains(l[0], k)) {
                r(k).focus()
            }
            f = l.parent();
            if (l.css("position") == "static") {
                f.css({
                    position: "relative"
                });
                l.css({
                    position: "relative"
                })
            } else {
                r.extend(j, {
                    position: l.css("position"),
                    zIndex: l.css("z-index")
                });
                r.each(["top", "left", "bottom", "right"], function (n, m) {
                    j[m] = l.css(m);
                    if (isNaN(parseInt(j[m], 10))) {
                        j[m] = "auto"
                    }
                });
                l.css({
                    position: "relative",
                    top: 0,
                    left: 0,
                    right: "auto",
                    bottom: "auto"
                })
            }
            return f.css(j).show()
        },
        removeWrapper: function (k) {
            var j, f = document.activeElement;
            if (k.parent().is(".ui-effects-wrapper")) {
                j = k.parent().replaceWith(k);
                if (k[0] === f || r.contains(k[0], f)) {
                    r(f).focus()
                }
                return j
            }
            return k
        },
        setTransition: function (l, j, f, k) {
            k = k || {};
            r.each(j, function (n, m) {
                unit = l.cssUnit(m);
                if (unit[0] > 0) {
                    k[m] = unit[0] * f + unit[1]
                }
            });
            return k
        }
    });
    r.fn.extend({
        effect: function (l) {
            var j = h.apply(this, arguments),
                f = {
                    options: j[1],
                    duration: j[2],
                    callback: j[3]
                };
            j = f.options.mode;
            var k = r.effects[l];
            if (r.fx.off || !k) {
                return j ? this[j](f.duration, f.callback) : this.each(function () {
                    f.callback && f.callback.call(this)
                })
            }
            return k.call(this, f)
        },
        _show: r.fn.show,
        show: function (j) {
            if (g(j)) {
                return this._show.apply(this, arguments)
            } else {
                var f = h.apply(this, arguments);
                f[1].mode = "show";
                return this.effect.apply(this, f)
            }
        },
        _hide: r.fn.hide,
        hide: function (j) {
            if (g(j)) {
                return this._hide.apply(this, arguments)
            } else {
                var f = h.apply(this, arguments);
                f[1].mode = "hide";
                return this.effect.apply(this, f)
            }
        },
        __toggle: r.fn.toggle,
        toggle: function (j) {
            if (g(j) || typeof j === "boolean" || r.isFunction(j)) {
                return this.__toggle.apply(this, arguments)
            } else {
                var f = h.apply(this, arguments);
                f[1].mode = "toggle";
                return this.effect.apply(this, f)
            }
        },
        cssUnit: function (k) {
            var j = this.css(k),
                f = [];
            r.each(["em", "px", "%", "pt"], function (m, l) {
                if (j.indexOf(l) > 0) {
                    f = [parseFloat(j), l]
                }
            });
            return f
        }
    });
    r.easing.jswing = r.easing.swing;
    r.extend(r.easing, {
        def: "easeOutQuad",
        swing: function (m, j, f, l, k) {
            return r.easing[r.easing.def](m, j, f, l, k)
        },
        easeInQuad: function (m, j, f, l, k) {
            return l * (j /= k) * j + f
        },
        easeOutQuad: function (m, j, f, l, k) {
            return -l * (j /= k) * (j - 2) + f
        },
        easeInOutQuad: function (m, j, f, l, k) {
            if ((j /= k / 2) < 1) {
                return l / 2 * j * j + f
            }
            return -l / 2 * (--j * (j - 2) - 1) + f
        },
        easeInCubic: function (m, j, f, l, k) {
            return l * (j /= k) * j * j + f
        },
        easeOutCubic: function (m, j, f, l, k) {
            return l * ((j = j / k - 1) * j * j + 1) + f
        },
        easeInOutCubic: function (m, j, f, l, k) {
            if ((j /= k / 2) < 1) {
                return l / 2 * j * j * j + f
            }
            return l / 2 * ((j -= 2) * j * j + 2) + f
        },
        easeInQuart: function (m, j, f, l, k) {
            return l * (j /= k) * j * j * j + f
        },
        easeOutQuart: function (m, j, f, l, k) {
            return -l * ((j = j / k - 1) * j * j * j - 1) + f
        },
        easeInOutQuart: function (m, j, f, l, k) {
            if ((j /= k / 2) < 1) {
                return l / 2 * j * j * j * j + f
            }
            return -l / 2 * ((j -= 2) * j * j * j - 2) + f
        },
        easeInQuint: function (m, j, f, l, k) {
            return l * (j /= k) * j * j * j * j + f
        },
        easeOutQuint: function (m, j, f, l, k) {
            return l * ((j = j / k - 1) * j * j * j * j + 1) + f
        },
        easeInOutQuint: function (m, j, f, l, k) {
            if ((j /= k / 2) < 1) {
                return l / 2 * j * j * j * j * j + f
            }
            return l / 2 * ((j -= 2) * j * j * j * j + 2) + f
        },
        easeInSine: function (m, j, f, l, k) {
            return -l * Math.cos(j / k * (Math.PI / 2)) + l + f
        },
        easeOutSine: function (m, j, f, l, k) {
            return l * Math.sin(j / k * (Math.PI / 2)) + f
        },
        easeInOutSine: function (m, j, f, l, k) {
            return -l / 2 * (Math.cos(Math.PI * j / k) - 1) + f
        },
        easeInExpo: function (m, j, f, l, k) {
            return j == 0 ? f : l * Math.pow(2, 10 * (j / k - 1)) + f
        },
        easeOutExpo: function (m, j, f, l, k) {
            return j == k ? f + l : l * (-Math.pow(2, -10 * j / k) + 1) + f
        },
        easeInOutExpo: function (m, j, f, l, k) {
            if (j == 0) {
                return f
            }
            if (j == k) {
                return f + l
            }
            if ((j /= k / 2) < 1) {
                return l / 2 * Math.pow(2, 10 * (j - 1)) + f
            }
            return l / 2 * (-Math.pow(2, -10 * --j) + 2) + f
        },
        easeInCirc: function (m, j, f, l, k) {
            return -l * (Math.sqrt(1 - (j /= k) * j) - 1) + f
        },
        easeOutCirc: function (m, j, f, l, k) {
            return l * Math.sqrt(1 - (j = j / k - 1) * j) + f
        },
        easeInOutCirc: function (m, j, f, l, k) {
            if ((j /= k / 2) < 1) {
                return -l / 2 * (Math.sqrt(1 - j * j) - 1) + f
            }
            return l / 2 * (Math.sqrt(1 - (j -= 2) * j) + 1) + f
        },
        easeInElastic: function (o, j, f, n, m) {
            o = 1.70158;
            var l = 0,
                k = n;
            if (j == 0) {
                return f
            }
            if ((j /= m) == 1) {
                return f + n
            }
            l || (l = m * 0.3);
            if (k < Math.abs(n)) {
                k = n;
                o = l / 4
            } else {
                o = l / (2 * Math.PI) * Math.asin(n / k)
            }
            return -(k * Math.pow(2, 10 * (j -= 1)) * Math.sin((j * m - o) * 2 * Math.PI / l)) + f
        },
        easeOutElastic: function (o, j, f, n, m) {
            o = 1.70158;
            var l = 0,
                k = n;
            if (j == 0) {
                return f
            }
            if ((j /= m) == 1) {
                return f + n
            }
            l || (l = m * 0.3);
            if (k < Math.abs(n)) {
                k = n;
                o = l / 4
            } else {
                o = l / (2 * Math.PI) * Math.asin(n / k)
            }
            return k * Math.pow(2, -10 * j) * Math.sin((j * m - o) * 2 * Math.PI / l) + n + f
        },
        easeInOutElastic: function (o, j, f, n, m) {
            o = 1.70158;
            var l = 0,
                k = n;
            if (j == 0) {
                return f
            }
            if ((j /= m / 2) == 2) {
                return f + n
            }
            l || (l = m * 0.3 * 1.5);
            if (k < Math.abs(n)) {
                k = n;
                o = l / 4
            } else {
                o = l / (2 * Math.PI) * Math.asin(n / k)
            }
            if (j < 1) {
                return -0.5 * k * Math.pow(2, 10 * (j -= 1)) * Math.sin((j * m - o) * 2 * Math.PI / l) + f
            }
            return k * Math.pow(2, -10 * (j -= 1)) * Math.sin((j * m - o) * 2 * Math.PI / l) * 0.5 + n + f
        },
        easeInBack: function (n, j, f, m, l, k) {
            if (k == i) {
                k = 1.70158
            }
            return m * (j /= l) * j * ((k + 1) * j - k) + f
        },
        easeOutBack: function (n, j, f, m, l, k) {
            if (k == i) {
                k = 1.70158
            }
            return m * ((j = j / l - 1) * j * ((k + 1) * j + k) + 1) + f
        },
        easeInOutBack: function (n, j, f, m, l, k) {
            if (k == i) {
                k = 1.70158
            }
            if ((j /= l / 2) < 1) {
                return m / 2 * j * j * (((k *= 1.525) + 1) * j - k) + f
            }
            return m / 2 * ((j -= 2) * j * (((k *= 1.525) + 1) * j + k) + 2) + f
        },
        easeInBounce: function (m, j, f, l, k) {
            return l - r.easing.easeOutBounce(m, k - j, 0, l, k) + f
        },
        easeOutBounce: function (m, j, f, l, k) {
            return (j /= k) < 1 / 2.75 ? l * 7.5625 * j * j + f : j < 2 / 2.75 ? l * (7.5625 * (j -= 1.5 / 2.75) * j + 0.75) + f : j < 2.5 / 2.75 ? l * (7.5625 * (j -= 2.25 / 2.75) * j + 0.9375) + f : l * (7.5625 * (j -= 2.625 / 2.75) * j + 0.984375) + f
        },
        easeInOutBounce: function (m, j, f, l, k) {
            if (j < k / 2) {
                return r.easing.easeInBounce(m, j * 2, 0, l, k) * 0.5 + f
            }
            return r.easing.easeOutBounce(m, j * 2 - k, 0, l, k) * 0.5 + l * 0.5 + f
        }
    })
}(jQuery);
jQuery.easing.jswing = jQuery.easing.swing;
jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (e, f, a, h, g) {
        return jQuery.easing[jQuery.easing.def](e, f, a, h, g)
    },
    easeInQuad: function (e, f, a, h, g) {
        return h * (f /= g) * f + a
    },
    easeOutQuad: function (e, f, a, h, g) {
        return -h * (f /= g) * (f - 2) + a
    },
    easeInOutQuad: function (e, f, a, h, g) {
        if ((f /= g / 2) < 1) {
            return h / 2 * f * f + a
        }
        return -h / 2 * ((--f) * (f - 2) - 1) + a
    },
    easeInCubic: function (e, f, a, h, g) {
        return h * (f /= g) * f * f + a
    },
    easeOutCubic: function (e, f, a, h, g) {
        return h * ((f = f / g - 1) * f * f + 1) + a
    },
    easeInOutCubic: function (e, f, a, h, g) {
        if ((f /= g / 2) < 1) {
            return h / 2 * f * f * f + a
        }
        return h / 2 * ((f -= 2) * f * f + 2) + a
    },
    easeInQuart: function (e, f, a, h, g) {
        return h * (f /= g) * f * f * f + a
    },
    easeOutQuart: function (e, f, a, h, g) {
        return -h * ((f = f / g - 1) * f * f * f - 1) + a
    },
    easeInOutQuart: function (e, f, a, h, g) {
        if ((f /= g / 2) < 1) {
            return h / 2 * f * f * f * f + a
        }
        return -h / 2 * ((f -= 2) * f * f * f - 2) + a
    },
    easeInQuint: function (e, f, a, h, g) {
        return h * (f /= g) * f * f * f * f + a
    },
    easeOutQuint: function (e, f, a, h, g) {
        return h * ((f = f / g - 1) * f * f * f * f + 1) + a
    },
    easeInOutQuint: function (e, f, a, h, g) {
        if ((f /= g / 2) < 1) {
            return h / 2 * f * f * f * f * f + a
        }
        return h / 2 * ((f -= 2) * f * f * f * f + 2) + a
    },
    easeInSine: function (e, f, a, h, g) {
        return -h * Math.cos(f / g * (Math.PI / 2)) + h + a
    },
    easeOutSine: function (e, f, a, h, g) {
        return h * Math.sin(f / g * (Math.PI / 2)) + a
    },
    easeInOutSine: function (e, f, a, h, g) {
        return -h / 2 * (Math.cos(Math.PI * f / g) - 1) + a
    },
    easeInExpo: function (e, f, a, h, g) {
        return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a
    },
    easeOutExpo: function (e, f, a, h, g) {
        return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a
    },
    easeInOutExpo: function (e, f, a, h, g) {
        if (f == 0) {
            return a
        }
        if (f == g) {
            return a + h
        }
        if ((f /= g / 2) < 1) {
            return h / 2 * Math.pow(2, 10 * (f - 1)) + a
        }
        return h / 2 * (-Math.pow(2, -10 * --f) + 2) + a
    },
    easeInCirc: function (e, f, a, h, g) {
        return -h * (Math.sqrt(1 - (f /= g) * f) - 1) + a
    },
    easeOutCirc: function (e, f, a, h, g) {
        return h * Math.sqrt(1 - (f = f / g - 1) * f) + a
    },
    easeInOutCirc: function (e, f, a, h, g) {
        if ((f /= g / 2) < 1) {
            return -h / 2 * (Math.sqrt(1 - f * f) - 1) + a
        }
        return h / 2 * (Math.sqrt(1 - (f -= 2) * f) + 1) + a
    },
    easeInElastic: function (f, h, e, l, k) {
        var i = 1.70158;
        var j = 0;
        var g = l;
        if (h == 0) {
            return e
        }
        if ((h /= k) == 1) {
            return e + l
        }
        if (!j) {
            j = k * 0.3
        }
        if (g < Math.abs(l)) {
            g = l;
            var i = j / 4
        } else {
            var i = j / (2 * Math.PI) * Math.asin(l / g)
        }
        return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
    },
    easeOutElastic: function (f, h, e, l, k) {
        var i = 1.70158;
        var j = 0;
        var g = l;
        if (h == 0) {
            return e
        }
        if ((h /= k) == 1) {
            return e + l
        }
        if (!j) {
            j = k * 0.3
        }
        if (g < Math.abs(l)) {
            g = l;
            var i = j / 4
        } else {
            var i = j / (2 * Math.PI) * Math.asin(l / g)
        }
        return g * Math.pow(2, -10 * h) * Math.sin((h * k - i) * (2 * Math.PI) / j) + l + e
    },
    easeInOutElastic: function (f, h, e, l, k) {
        var i = 1.70158;
        var j = 0;
        var g = l;
        if (h == 0) {
            return e
        }
        if ((h /= k / 2) == 2) {
            return e + l
        }
        if (!j) {
            j = k * (0.3 * 1.5)
        }
        if (g < Math.abs(l)) {
            g = l;
            var i = j / 4
        } else {
            var i = j / (2 * Math.PI) * Math.asin(l / g)
        }
        if (h < 1) {
            return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
        }
        return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j) * 0.5 + l + e
    },
    easeInBack: function (e, f, a, i, h, g) {
        if (g == undefined) {
            g = 1.70158
        }
        return i * (f /= h) * f * ((g + 1) * f - g) + a
    },
    easeOutBack: function (e, f, a, i, h, g) {
        if (g == undefined) {
            g = 1.70158
        }
        return i * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a
    },
    easeInOutBack: function (e, f, a, i, h, g) {
        if (g == undefined) {
            g = 1.70158
        }
        if ((f /= h / 2) < 1) {
            return i / 2 * (f * f * (((g *= (1.525)) + 1) * f - g)) + a
        }
        return i / 2 * ((f -= 2) * f * (((g *= (1.525)) + 1) * f + g) + 2) + a
    },
    easeInBounce: function (e, f, a, h, g) {
        return h - jQuery.easing.easeOutBounce(e, g - f, 0, h, g) + a
    },
    easeOutBounce: function (e, f, a, h, g) {
        if ((f /= g) < (1 / 2.75)) {
            return h * (7.5625 * f * f) + a
        } else {
            if (f < (2 / 2.75)) {
                return h * (7.5625 * (f -= (1.5 / 2.75)) * f + 0.75) + a
            } else {
                if (f < (2.5 / 2.75)) {
                    return h * (7.5625 * (f -= (2.25 / 2.75)) * f + 0.9375) + a
                } else {
                    return h * (7.5625 * (f -= (2.625 / 2.75)) * f + 0.984375) + a
                }
            }
        }
    },
    easeInOutBounce: function (e, f, a, h, g) {
        if (f < g / 2) {
            return jQuery.easing.easeInBounce(e, f * 2, 0, h, g) * 0.5 + a
        }
        return jQuery.easing.easeOutBounce(e, f * 2 - g, 0, h, g) * 0.5 + h * 0.5 + a
    }
});
(function (a) {
    a(document).ready(function () {
        a("body").append('<div id="supersized-loader"></div><ul id="supersized"></ul>')
    });
    a.supersized = function (b) {
        var c = "#supersized",
            d = this;
        d.$el = a(c);
        d.el = c;
        vars = a.supersized.vars;
        d.$el.data("supersized", d);
        api = d.$el.data("supersized");
        d.init = function () {
            a.supersized.vars = a.extend(a.supersized.vars, a.supersized.themeVars);
            a.supersized.vars.options = a.extend({}, a.supersized.defaultOptions, a.supersized.themeOptions, b);
            d.options = a.supersized.vars.options;
            d._build()
        };
        d._build = function () {
            var g = 0,
                e = "",
                j = "",
                h, f = "",
                i;
            while (g <= d.options.slides.length - 1) {
                switch (d.options.slide_links) {
                case "num":
                    h = g;
                    break;
                case "name":
                    h = d.options.slides[g].title;
                    break;
                case "blank":
                    h = "";
                    break
                }
                e = e + '<li class="slide-' + g + '"></li>';
                if (g == d.options.start_slide - 1) {
                    if (d.options.slide_links) {
                        j = j + '<li class="slide-link-' + g + ' current-slide"><a>' + h + "</a></li>"
                    }
                    if (d.options.thumb_links) {
                        d.options.slides[g].thumb ? i = d.options.slides[g].thumb : i = d.options.slides[g].image;
                        f = f + '<li class="thumb' + g + ' current-thumb"><img class=thumbo src="' + i + '"/></li>'
                    }
                } else {
                    if (d.options.slide_links) {
                        j = j + '<li class="slide-link-' + g + '" ><a>' + h + "</a></li>"
                    }
                    if (d.options.thumb_links) {
                        d.options.slides[g].thumb ? i = d.options.slides[g].thumb : i = d.options.slides[g].image;
                        f = f + '<li class="thumb' + g + '"><img class=thumbo src="' + i + '"/></li>'
                    }
                }
                g++
            }
            if (d.options.slide_links) {
                a(vars.slide_list).html(j)
            }
            if (d.options.thumb_links && vars.thumb_tray.length) {
                a(vars.thumb_tray).append('<ul id="' + vars.thumb_list.replace("#", "") + '">' + f + "</ul>")
            }
            a(d.el).append(e);
            if (d.options.thumbnail_navigation) {
                vars.current_slide - 1 < 0 ? prevThumb = d.options.slides.length - 1 : prevThumb = vars.current_slide - 1;
                a(vars.prev_thumb).show().html(a("<img/>").attr("src", d.options.slides[prevThumb].image));
                vars.current_slide == d.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1;
                a(vars.next_thumb).show().html(a("<img/>").attr("src", d.options.slides[nextThumb].image))
            }
            d._start()
        };
        d._start = function () {
            if (d.options.start_slide) {
                vars.current_slide = d.options.start_slide - 1
            } else {
                vars.current_slide = Math.floor(Math.random() * d.options.slides.length)
            }
            var o = d.options.new_window ? ' target="_blank"' : "";
            if (d.options.performance == 3) {
                d.$el.addClass("speed")
            } else {
                if ((d.options.performance == 1) || (d.options.performance == 2)) {
                    d.$el.addClass("quality")
                }
            }
            if (d.options.random) {
                arr = d.options.slides;
                for (var h, m, k = arr.length; k; h = parseInt(Math.random() * k), m = arr[--k], arr[k] = arr[h], arr[h] = m) {}
                d.options.slides = arr
            }
            if (d.options.slides.length > 1) {
                if (d.options.slides.length > 2) {
                    vars.current_slide - 1 < 0 ? loadPrev = d.options.slides.length - 1 : loadPrev = vars.current_slide - 1;
                    var g = (d.options.slides[loadPrev].url) ? "href='" + d.options.slides[loadPrev].url + "'" : "";
                    var q = a('<img class=thumbo src="' + d.options.slides[loadPrev].image + '"/>');
                    var n = d.el + " li:eq(" + loadPrev + ")";
                    q.appendTo(n).wrap("<a " + g + o + "></a>").parent().parent().addClass("image-loading prevslide");
                    q.load(function () {
                        a(this).data("origWidth", a(this).width()).data("origHeight", a(this).height());
                        d.resizeNow()
                    })
                }
            } else {
                d.options.slideshow = 0
            }
            g = (api.getField("url")) ? "href='" + api.getField("url") + "'" : "";
            var l = a('<img class=thumbo src="' + api.getField("image") + '"/>');
            var f = d.el + " li:eq(" + vars.current_slide + ")";
            l.appendTo(f).wrap("<a " + g + o + "></a>").parent().parent().addClass("image-loading activeslide");
            l.load(function () {
                d._origDim(a(this));
                d.resizeNow();
                d.launch();
                if (typeof theme != "undefined" && typeof theme._init == "function") {
                    theme._init()
                }
            });
            if (d.options.slides.length > 1) {
                vars.current_slide == d.options.slides.length - 1 ? loadNext = 0 : loadNext = vars.current_slide + 1;
                g = (d.options.slides[loadNext].url) ? "href='" + d.options.slides[loadNext].url + "'" : "";
                var e = a('<img class=thumbo src="' + d.options.slides[loadNext].image + '"/>');
                var p = d.el + " li:eq(" + loadNext + ")";
                e.appendTo(p).wrap("<a " + g + o + "></a>").parent().parent().addClass("image-loading");
                e.load(function () {
                    a(this).data("origWidth", a(this).width()).data("origHeight", a(this).height());
                    d.resizeNow()
                })
            }
            d.$el.css("visibility", "hidden");
            a(".load-item").hide()
        };
        d.launch = function () {
            d.$el.css("visibility", "visible");
            a("#supersized-loader").remove();
            if (typeof theme != "undefined" && typeof theme.beforeAnimation == "function") {
                theme.beforeAnimation("next")
            }
            a(".load-item").show();
            if (d.options.keyboard_nav) {
                a(document.documentElement).keyup(function (e) {
                    if (vars.in_animation) {
                        return false
                    }
                    if ((e.keyCode == 37) || (e.keyCode == 40)) {
                        clearInterval(vars.slideshow_interval);
                        d.prevSlide()
                    } else {
                        if ((e.keyCode == 39) || (e.keyCode == 38)) {
                            clearInterval(vars.slideshow_interval);
                            d.nextSlide()
                        } else {
                            if (e.keyCode == 32 && !vars.hover_pause) {}
                        }
                    }
                })
            }
            if (d.options.slideshow && d.options.pause_hover) {
                a(d.el).hover(function () {
                    if (vars.in_animation) {
                        return false
                    }
                    vars.hover_pause = true;
                    if (!vars.is_paused) {
                        vars.hover_pause = "resume";
                        d.playToggle()
                    }
                }, function () {
                    if (vars.hover_pause == "resume") {
                        d.playToggle();
                        vars.hover_pause = false
                    }
                })
            }
            if (d.options.slide_links) {
                a(vars.slide_list + "> li").click(function () {
                    index = a(vars.slide_list + "> li").index(this);
                    targetSlide = index + 1;
                    d.goTo(targetSlide);
                    return false
                })
            }
            if (d.options.thumb_links) {
                a(vars.thumb_list + "> li").click(function () {
                    index = a(vars.thumb_list + "> li").index(this);
                    targetSlide = index + 1;
                    api.goTo(targetSlide);
                    return false
                })
            }
            if (d.options.slideshow && d.options.slides.length > 1) {
                if (d.options.autoplay && d.options.slides.length > 1) {
                    vars.slideshow_interval = setInterval(d.nextSlide, d.options.slide_interval)
                } else {
                    vars.is_paused = true
                }
                a(".load-item img").bind("contextmenu mousedown", function () {
                    return false
                })
            }
            a(window).resize(function () {
                d.resizeNow()
            })
        };
        d.resizeNow = function () {
            return d.$el.each(function () {
                a("img", d.el).each(function () {
                    thisSlide = a(this);
                    var f = (thisSlide.data("origHeight") / thisSlide.data("origWidth")).toFixed(2);
                    var e = d.$el.width(),
                        h = d.$el.height(),
                        i;
                    if (d.options.fit_always) {
                        if ((h / e) > f) {
                            g()
                        } else {
                            j()
                        }
                    } else {
                        if ((h <= d.options.min_height) && (e <= d.options.min_width)) {
                            if ((h / e) > f) {
                                d.options.fit_landscape && f < 1 ? g(true) : j(true)
                            } else {
                                d.options.fit_portrait && f >= 1 ? j(true) : g(true)
                            }
                        } else {
                            if (e <= d.options.min_width) {
                                if ((h / e) > f) {
                                    d.options.fit_landscape && f < 1 ? g(true) : j()
                                } else {
                                    d.options.fit_portrait && f >= 1 ? j() : g(true)
                                }
                            } else {
                                if (h <= d.options.min_height) {
                                    if ((h / e) > f) {
                                        d.options.fit_landscape && f < 1 ? g() : j(true)
                                    } else {
                                        d.options.fit_portrait && f >= 1 ? j(true) : g()
                                    }
                                } else {
                                    if ((h / e) > f) {
                                        d.options.fit_landscape && f < 1 ? g() : j()
                                    } else {
                                        d.options.fit_portrait && f >= 1 ? j() : g()
                                    }
                                }
                            }
                        }
                    }
                    function g(k) {
                        if (k) {
                            if (thisSlide.width() < e || thisSlide.width() < d.options.min_width) {
                                if (thisSlide.width() * f >= d.options.min_height) {
                                    thisSlide.width(d.options.min_width);
                                    thisSlide.height(thisSlide.width() * f)
                                } else {
                                    j()
                                }
                            }
                        } else {
                            if (d.options.min_height >= h && !d.options.fit_landscape) {
                                if (e * f >= d.options.min_height || (e * f >= d.options.min_height && f <= 1)) {
                                    thisSlide.width(e);
                                    thisSlide.height(e * f)
                                } else {
                                    if (f > 1) {
                                        thisSlide.height(d.options.min_height);
                                        thisSlide.width(thisSlide.height() / f)
                                    } else {
                                        if (thisSlide.width() < e) {
                                            thisSlide.width(e);
                                            thisSlide.height(thisSlide.width() * f)
                                        }
                                    }
                                }
                            } else {
                                thisSlide.width(e);
                                thisSlide.height(e * f)
                            }
                        }
                    }
                    function j(k) {
                        if (k) {
                            if (thisSlide.height() < h) {
                                if (thisSlide.height() / f >= d.options.min_width) {
                                    thisSlide.height(d.options.min_height);
                                    thisSlide.width(thisSlide.height() / f)
                                } else {
                                    g(true)
                                }
                            }
                        } else {
                            if (d.options.min_width >= e) {
                                if (h / f >= d.options.min_width || f > 1) {
                                    thisSlide.height(h);
                                    thisSlide.width(h / f)
                                } else {
                                    if (f <= 1) {
                                        thisSlide.width(d.options.min_width);
                                        thisSlide.height(thisSlide.width() * f)
                                    }
                                }
                            } else {
                                thisSlide.height(h);
                                thisSlide.width(h / f)
                            }
                        }
                    }
                    if (thisSlide.parents("li").hasClass("image-loading")) {
                        a(".image-loading").removeClass("image-loading")
                    }
                    if (d.options.horizontal_center) {
                        a(this).css("left", (e - a(this).width()) / 2)
                    }
                    if (d.options.vertical_center) {
                        a(this).css("top", (h - a(this).height()) / 2)
                    }
                });
                if (d.options.image_protect) {
                    a("img", d.el).bind("contextmenu mousedown", function () {
                        return false
                    })
                }
                return false
            })
        };
        d.nextSlide = function () {
            if (vars.in_animation || !api.options.slideshow) {
                return false
            } else {
                vars.in_animation = true
            }
            clearInterval(vars.slideshow_interval);
            var h = d.options.slides,
                e = d.$el.find(".activeslide");
            a(".prevslide").removeClass("prevslide");
            e.removeClass("activeslide").addClass("prevslide");
            vars.current_slide + 1 == d.options.slides.length ? vars.current_slide = 0 : vars.current_slide++;
            var g = a(d.el + " li:eq(" + vars.current_slide + ")"),
                i = d.$el.find(".prevslide");
            if (d.options.performance == 1) {
                d.$el.removeClass("quality").addClass("speed")
            }
            loadSlide = false;
            vars.current_slide == d.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1;
            var k = d.el + " li:eq(" + loadSlide + ")";
            if (!a(k).html()) {
                var j = d.options.new_window ? ' target="_blank"' : "";
                imageLink = (d.options.slides[loadSlide].url) ? "href='" + d.options.slides[loadSlide].url + "'" : "";
                var f = a('<img class=thumbo src="' + d.options.slides[loadSlide].image + '"/>');
                f.appendTo(k).wrap("<a " + imageLink + j + "></a>").parent().parent().addClass("image-loading").css("visibility", "hidden");
                f.load(function () {
                    d._origDim(a(this));
                    d.resizeNow()
                })
            }
            if (d.options.thumbnail_navigation == 1) {
                vars.current_slide - 1 < 0 ? prevThumb = d.options.slides.length - 1 : prevThumb = vars.current_slide - 1;
                a(vars.prev_thumb).html(a("<img/>").attr("src", d.options.slides[prevThumb].image));
                nextThumb = loadSlide;
                a(vars.next_thumb).html(a("<img/>").attr("src", d.options.slides[nextThumb].image))
            }
            if (typeof theme != "undefined" && typeof theme.beforeAnimation == "function") {
                theme.beforeAnimation("next")
            }
            if (d.options.slide_links) {
                a(".current-slide").removeClass("current-slide");
                a(vars.slide_list + "> li").eq(vars.current_slide).addClass("current-slide")
            }
            g.css("visibility", "hidden").addClass("activeslide");
            switch (d.options.transition) {
            case 0:
            case "none":
                g.css("visibility", "visible");
                vars.in_animation = false;
                break;
            case 1:
            case "fade":
                g.animate({
                    opacity: 0
                }, 0).css("visibility", "visible").animate({
                    opacity: 1,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 2:
            case "slideTop":
                g.animate({
                    top: -d.$el.height()
                }, 0).css("visibility", "visible").animate({
                    top: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 3:
            case "slideRight":
                g.animate({
                    left: d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 4:
            case "slideBottom":
                g.animate({
                    top: d.$el.height()
                }, 0).css("visibility", "visible").animate({
                    top: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 5:
            case "slideLeft":
                g.animate({
                    left: -d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 6:
            case "carouselRight":
                g.animate({
                    left: d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                e.animate({
                    left: -d.$el.width(),
                    avoidTransforms: false
                }, d.options.transition_speed);
                break;
            case 7:
            case "carouselLeft":
                g.animate({
                    left: -d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                e.animate({
                    left: d.$el.width(),
                    avoidTransforms: false
                }, d.options.transition_speed);
                break
            }
            return false
        };
        d.prevSlide = function () {
            if (vars.in_animation || !api.options.slideshow) {
                return false
            } else {
                vars.in_animation = true
            }
            clearInterval(vars.slideshow_interval);
            var h = d.options.slides,
                e = d.$el.find(".activeslide");
            a(".prevslide").removeClass("prevslide");
            e.removeClass("activeslide").addClass("prevslide");
            vars.current_slide == 0 ? vars.current_slide = d.options.slides.length - 1 : vars.current_slide--;
            var g = a(d.el + " li:eq(" + vars.current_slide + ")"),
                i = d.$el.find(".prevslide");
            if (d.options.performance == 1) {
                d.$el.removeClass("quality").addClass("speed")
            }
            loadSlide = false;
            vars.current_slide - 1 < 0 ? loadSlide = d.options.slides.length - 1 : loadSlide = vars.current_slide - 1;
            var k = d.el + " li:eq(" + loadSlide + ")";
            if (!a(k).html()) {
                var j = d.options.new_window ? ' target="_blank"' : "";
                imageLink = (d.options.slides[loadSlide].url) ? "href='" + d.options.slides[loadSlide].url + "'" : "";
                var f = a('<img class=thumbo src="' + d.options.slides[loadSlide].image + '"/>');
                f.appendTo(k).wrap("<a " + imageLink + j + "></a>").parent().parent().addClass("image-loading").css("visibility", "hidden");
                f.load(function () {
                    d._origDim(a(this));
                    d.resizeNow()
                })
            }
            if (d.options.thumbnail_navigation == 1) {
                prevThumb = loadSlide;
                a(vars.prev_thumb).html(a("<img/>").attr("src", d.options.slides[prevThumb].image));
                vars.current_slide == d.options.slides.length - 1 ? nextThumb = 0 : nextThumb = vars.current_slide + 1;
                a(vars.next_thumb).html(a("<img/>").attr("src", d.options.slides[nextThumb].image))
            }
            if (typeof theme != "undefined" && typeof theme.beforeAnimation == "function") {
                theme.beforeAnimation("prev")
            }
            if (d.options.slide_links) {
                a(".current-slide").removeClass("current-slide");
                a(vars.slide_list + "> li").eq(vars.current_slide).addClass("current-slide")
            }
            g.css("visibility", "hidden").addClass("activeslide");
            switch (d.options.transition) {
            case 0:
            case "none":
                g.css("visibility", "visible");
                vars.in_animation = false;
                d.afterAnimation();
                break;
            case 1:
            case "fade":
                g.animate({
                    opacity: 0
                }, 0).css("visibility", "visible").animate({
                    opacity: 1,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 2:
            case "slideTop":
                g.animate({
                    top: d.$el.height()
                }, 0).css("visibility", "visible").animate({
                    top: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 3:
            case "slideRight":
                g.animate({
                    left: -d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 4:
            case "slideBottom":
                g.animate({
                    top: -d.$el.height()
                }, 0).css("visibility", "visible").animate({
                    top: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 5:
            case "slideLeft":
                g.animate({
                    left: d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                break;
            case 6:
            case "carouselRight":
                g.animate({
                    left: -d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                e.animate({
                    left: 0
                }, 0).animate({
                    left: d.$el.width(),
                    avoidTransforms: false
                }, d.options.transition_speed);
                break;
            case 7:
            case "carouselLeft":
                g.animate({
                    left: d.$el.width()
                }, 0).css("visibility", "visible").animate({
                    left: 0,
                    avoidTransforms: false
                }, d.options.transition_speed, function () {
                    d.afterAnimation()
                });
                e.animate({
                    left: 0
                }, 0).animate({
                    left: -d.$el.width(),
                    avoidTransforms: false
                }, d.options.transition_speed);
                break
            }
            return false
        };
        d.playToggle = function () {
            if (vars.in_animation || !api.options.slideshow) {
                return false
            }
            if (vars.is_paused) {
                vars.is_paused = false;
                if (typeof theme != "undefined" && typeof theme.playToggle == "function") {
                    theme.playToggle("play")
                }
                vars.slideshow_interval = setInterval(d.nextSlide, d.options.slide_interval)
            } else {
                vars.is_paused = true;
                if (typeof theme != "undefined" && typeof theme.playToggle == "function") {
                    theme.playToggle("pause")
                }
                clearInterval(vars.slideshow_interval)
            }
            return false
        };
        d.goTo = function (f) {
            if (vars.in_animation || !api.options.slideshow) {
                return false
            }
            var e = d.options.slides.length;
            if (f < 0) {
                f = e
            } else {
                if (f > e) {
                    f = 1
                }
            }
            f = e - f + 1;
            clearInterval(vars.slideshow_interval);
            if (typeof theme != "undefined" && typeof theme.goTo == "function") {
                theme.goTo()
            }
            if (vars.current_slide == e - f) {
                if (!(vars.is_paused)) {
                    vars.slideshow_interval = setInterval(d.nextSlide, d.options.slide_interval)
                }
                return false
            }
            if (e - f > vars.current_slide) {
                vars.current_slide = e - f - 1;
                vars.update_images = "next";
                d._placeSlide(vars.update_images)
            } else {
                if (e - f < vars.current_slide) {
                    vars.current_slide = e - f + 1;
                    vars.update_images = "prev";
                    d._placeSlide(vars.update_images)
                }
            }
            if (d.options.slide_links) {
                a(vars.slide_list + "> .current-slide").removeClass("current-slide");
                a(vars.slide_list + "> li").eq((e - f)).addClass("current-slide")
            }
            if (d.options.thumb_links) {
                a(vars.thumb_list + "> .current-thumb").removeClass("current-thumb");
                a(vars.thumb_list + "> li").eq((e - f)).addClass("current-thumb")
            }
        };
        d._placeSlide = function (e) {
            var h = d.options.new_window ? ' target="_blank"' : "";
            loadSlide = false;
            if (e == "next") {
                vars.current_slide == d.options.slides.length - 1 ? loadSlide = 0 : loadSlide = vars.current_slide + 1;
                var g = d.el + " li:eq(" + loadSlide + ")";
                if (!a(g).html()) {
                    var h = d.options.new_window ? ' target="_blank"' : "";
                    imageLink = (d.options.slides[loadSlide].url) ? "href='" + d.options.slides[loadSlide].url + "'" : "";
                    var f = a('<img class=thumbo src="' + d.options.slides[loadSlide].image + '"/>');
                    f.appendTo(g).wrap("<a " + imageLink + h + "></a>").parent().parent().addClass("image-loading").css("visibility", "hidden");
                    f.load(function () {
                        d._origDim(a(this));
                        d.resizeNow()
                    })
                }
                d.nextSlide()
            } else {
                if (e == "prev") {
                    vars.current_slide - 1 < 0 ? loadSlide = d.options.slides.length - 1 : loadSlide = vars.current_slide - 1;
                    var g = d.el + " li:eq(" + loadSlide + ")";
                    if (!a(g).html()) {
                        var h = d.options.new_window ? ' target="_blank"' : "";
                        imageLink = (d.options.slides[loadSlide].url) ? "href='" + d.options.slides[loadSlide].url + "'" : "";
                        var f = a('<img class=thumbo src="' + d.options.slides[loadSlide].image + '"/>');
                        f.appendTo(g).wrap("<a " + imageLink + h + "></a>").parent().parent().addClass("image-loading").css("visibility", "hidden");
                        f.load(function () {
                            d._origDim(a(this));
                            d.resizeNow()
                        })
                    }
                    d.prevSlide()
                }
            }
        };
        d._origDim = function (e) {
            e.data("origWidth", e.width()).data("origHeight", e.height())
        };
        d.afterAnimation = function () {
            if (d.options.performance == 1) {
                d.$el.removeClass("speed").addClass("quality")
            }
            if (vars.update_images) {
                vars.current_slide - 1 < 0 ? setPrev = d.options.slides.length - 1 : setPrev = vars.current_slide - 1;
                vars.update_images = false;
                a(".prevslide").removeClass("prevslide");
                a(d.el + " li:eq(" + setPrev + ")").addClass("prevslide")
            }
            vars.in_animation = false;
            if (!vars.is_paused && d.options.slideshow) {
                vars.slideshow_interval = setInterval(d.nextSlide, d.options.slide_interval);
                if (d.options.stop_loop && vars.current_slide == d.options.slides.length - 1) {
                    d.playToggle()
                }
            }
            if (typeof theme != "undefined" && typeof theme.afterAnimation == "function") {
                theme.afterAnimation()
            }
            return false
        };
        d.getField = function (e) {
            return d.options.slides[vars.current_slide][e]
        };
        d.init()
    };
    a.supersized.vars = {
        thumb_tray: "#thumb-tray",
        thumb_list: "#thumb-list",
        slide_list: "#slide-list",
        current_slide: 0,
        in_animation: false,
        is_paused: false,
        hover_pause: false,
        slideshow_interval: false,
        update_images: false,
        options: {}
    };
    a.supersized.defaultOptions = {
        slideshow: 1,
        autoplay: 1,
        start_slide: 1,
        stop_loop: 0,
        random: 0,
        slide_interval: 5000,
        transition: 1,
        transition_speed: 750,
        new_window: 1,
        pause_hover: 0,
        keyboard_nav: 1,
        performance: 1,
        image_protect: 1,
        fit_always: 0,
        fit_landscape: 0,
        fit_portrait: 1,
        min_width: 0,
        min_height: 0,
        horizontal_center: 1,
        vertical_center: 1,
        slide_links: 1,
        thumb_links: 1,
        thumbnail_navigation: 0
    };
    a.fn.supersized = function (b) {
        return this.each(function () {
            (new a.supersized(b))
        })
    }
})(jQuery);
(function (a) {
    theme = {
        _init: function () {
            if (api.options.slide_links) {
                a(vars.slide_list).css("margin-left", -a(vars.slide_list).width() / 2)
            }
            if (api.options.autoplay) {
                if (api.options.progress_bar) {
                    theme.progressBar()
                }
            } else {
                if (a(vars.play_button).attr("src")) {
                    a(vars.play_button).attr("src", vars.image_path + "play.png")
                }
                if (api.options.progress_bar) {
                    a(vars.progress_bar).stop().animate({
                        left: -a(window).width()
                    }, 0)
                }
            }
            if (a(vars.slide_total).length) {
                a(vars.slide_total).html(api.options.slides.length)
            }
            if (api.options.thumb_links) {
                if (a(vars.thumb_list).width() <= a(vars.thumb_tray).width()) {
                    a(vars.thumb_back + "," + vars.thumb_forward).fadeOut(0)
                }
                vars.thumb_interval = Math.floor(a(vars.thumb_tray).width() / a("> li", vars.thumb_list).outerWidth(true)) * a("> li", vars.thumb_list).outerWidth(true);
                vars.thumb_page = 0;
                a(vars.thumb_forward).click(function () {
                    if (vars.thumb_page - vars.thumb_interval <= -a(vars.thumb_list).width()) {
                        vars.thumb_page = 0;
                        a(vars.thumb_list).stop().animate({
                            left: vars.thumb_page
                        }, {
                            duration: 500,
                            easing: "easeOutExpo"
                        })
                    } else {
                        vars.thumb_page = vars.thumb_page - vars.thumb_interval;
                        a(vars.thumb_list).stop().animate({
                            left: vars.thumb_page
                        }, {
                            duration: 500,
                            easing: "easeOutExpo"
                        })
                    }
                });
                a(vars.thumb_back).click(function () {
                    if (vars.thumb_page + vars.thumb_interval > 0) {
                        vars.thumb_page = Math.floor(a(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval;
                        if (a(vars.thumb_list).width() <= -vars.thumb_page) {
                            vars.thumb_page = vars.thumb_page + vars.thumb_interval
                        }
                        a(vars.thumb_list).stop().animate({
                            left: vars.thumb_page
                        }, {
                            duration: 500,
                            easing: "easeOutExpo"
                        })
                    } else {
                        vars.thumb_page = vars.thumb_page + vars.thumb_interval;
                        a(vars.thumb_list).stop().animate({
                            left: vars.thumb_page
                        }, {
                            duration: 500,
                            easing: "easeOutExpo"
                        })
                    }
                })
            }
            a(vars.next_slide).click(function () {
                api.nextSlide()
            });
            a(vars.prev_slide).click(function () {
                api.prevSlide()
            });
            if (jQuery.support.opacity) {
                a(vars.prev_slide + "," + vars.next_slide).mouseover(function () {
                    a(this).stop().animate({
                        opacity: 1
                    }, 100)
                }).mouseout(function () {
                    a(this).stop().animate({
                        opacity: 0.6
                    }, 100)
                })
            }
            if (api.options.thumbnail_navigation) {
                a(vars.next_thumb).click(function () {
                    api.nextSlide()
                });
                a(vars.prev_thumb).click(function () {
                    api.prevSlide()
                })
            }
            a(vars.play_button).click(function () {
                api.playToggle()
            });
            if (api.options.mouse_scrub) {
                a(vars.thumb_tray).mousemove(function (g) {
                    var d = a(vars.thumb_tray).width(),
                        h = a(vars.thumb_list).width();
                    if (h > d) {
                        var c = 1,
                            f = g.pageX - c;
                        if (f > 10 || f < -10) {
                            c = g.pageX;
                            newX = (d - h) * (g.pageX / d);
                            f = parseInt(Math.abs(parseInt(a(vars.thumb_list).css("left")) - newX)).toFixed(0);
                            a(vars.thumb_list).stop().animate({
                                left: newX
                            }, {
                                duration: f * 3,
                                easing: "easeOutExpo"
                            })
                        }
                    }
                })
            }
            a(window).resize(function () {
                if (api.options.progress_bar && !vars.in_animation) {
                    if (vars.slideshow_interval) {
                        clearInterval(vars.slideshow_interval)
                    }
                    if (api.options.slides.length - 1 > 0) {
                        clearInterval(vars.slideshow_interval)
                    }
                    a(vars.progress_bar).stop().animate({
                        left: -a(window).width()
                    }, 0);
                    if (!vars.progressDelay && api.options.slideshow) {
                        vars.progressDelay = setTimeout(function () {
                            if (!vars.is_paused) {
                                theme.progressBar();
                                vars.slideshow_interval = setInterval(api.nextSlide, api.options.slide_interval)
                            }
                            vars.progressDelay = false
                        }, 1000)
                    }
                }
                if (api.options.thumb_links && vars.thumb_tray.length) {
                    vars.thumb_page = 0;
                    vars.thumb_interval = Math.floor(a(vars.thumb_tray).width() / a("> li", vars.thumb_list).outerWidth(true)) * a("> li", vars.thumb_list).outerWidth(true);
                    if (a(vars.thumb_list).width() > a(vars.thumb_tray).width()) {
                        a(vars.thumb_back + "," + vars.thumb_forward).fadeIn("fast");
                        a(vars.thumb_list).stop().animate({
                            left: 0
                        }, 200)
                    } else {
                        a(vars.thumb_back + "," + vars.thumb_forward).fadeOut("fast")
                    }
                }
            });
            var b = a.cookie("slideshow-state") || autoplay;
            if (b == 1) {
                setTimeout(function () {
                    api.playToggle()
                }, 1500)
            }
        },
        goTo: function () {
            if (api.options.progress_bar && !vars.is_paused) {
                a(vars.progress_bar).stop().animate({
                    left: -a(window).width()
                }, 0);
                theme.progressBar()
            }
        },
        playToggle: function (b) {
            if (b == "play") {
                if (a(vars.play_button).attr("src")) {
                    a(vars.play_button).attr("src", vars.image_path + "pause.png")
                }
                if (api.options.progress_bar && !vars.is_paused) {
                    theme.progressBar()
                }
            } else {
                if (b == "pause") {
                    if (a(vars.play_button).attr("src")) {
                        a(vars.play_button).attr("src", vars.image_path + "play.png")
                    }
                    if (api.options.progress_bar && vars.is_paused) {
                        a(vars.progress_bar).stop().animate({
                            left: -a(window).width()
                        }, 0)
                    }
                }
            }
        },
        beforeAnimation: function (b) {
            if (api.options.progress_bar && !vars.is_paused) {
                a(vars.progress_bar).stop().animate({
                    left: -a(window).width()
                }, 0)
            }
            if (a(vars.slide_caption).length) {
                (api.getField("title")) ? a(vars.slide_caption).html(api.getField("title")) : a(vars.slide_caption).html("")
            }
            if (vars.slide_current.length) {
                a(vars.slide_current).html(vars.current_slide + 1)
            }
            a(".slide_pos").text((vars.current_slide + 1) + "/" + vars.options.slides.length);
            if (api.options.thumb_links) {
                a(".current-thumb").removeClass("current-thumb");
                a("li", vars.thumb_list).eq(vars.current_slide).addClass("current-thumb");
                if (a(vars.thumb_list).width() > a(vars.thumb_tray).width()) {
                    if (b == "next") {
                        if (vars.current_slide == 0) {
                            vars.thumb_page = 0;
                            a(vars.thumb_list).stop().animate({
                                left: vars.thumb_page
                            }, {
                                duration: 500,
                                easing: "easeOutExpo"
                            })
                        } else {
                            if (a(".current-thumb").offset().left - a(vars.thumb_tray).offset().left >= vars.thumb_interval) {
                                vars.thumb_page = vars.thumb_page - vars.thumb_interval;
                                a(vars.thumb_list).stop().animate({
                                    left: vars.thumb_page
                                }, {
                                    duration: 500,
                                    easing: "easeOutExpo"
                                })
                            }
                        }
                    } else {
                        if (b == "prev") {
                            if (vars.current_slide == api.options.slides.length - 1) {
                                vars.thumb_page = Math.floor(a(vars.thumb_list).width() / vars.thumb_interval) * -vars.thumb_interval;
                                if (a(vars.thumb_list).width() <= -vars.thumb_page) {
                                    vars.thumb_page = vars.thumb_page + vars.thumb_interval
                                }
                                a(vars.thumb_list).stop().animate({
                                    left: vars.thumb_page
                                }, {
                                    duration: 500,
                                    easing: "easeOutExpo"
                                })
                            } else {
                                if (a(".current-thumb").offset().left - a(vars.thumb_tray).offset().left < 0) {
                                    if (vars.thumb_page + vars.thumb_interval > 0) {
                                        return false
                                    }
                                    vars.thumb_page = vars.thumb_page + vars.thumb_interval;
                                    a(vars.thumb_list).stop().animate({
                                        left: vars.thumb_page
                                    }, {
                                        duration: 500,
                                        easing: "easeOutExpo"
                                    })
                                }
                            }
                        }
                    }
                }
            }
            a.cookie("slideshow-index", (vars.current_slide + 1), {
                expires: 100,
                path: "/"
            })
        },
        afterAnimation: function () {
            if (api.options.progress_bar && !vars.is_paused) {
                theme.progressBar()
            }
        },
        progressBar: function () {
            a(vars.progress_bar).stop().animate({
                left: -a(window).width()
            }, 0).animate({
                left: 0
            }, api.options.slide_interval)
        }
    };
    a.supersized.themeVars = {
        progress_delay: false,
        thumb_page: false,
        thumb_interval: false,
        image_path: "img/",
        play_button: "#pauseplay",
        next_slide: "#nextslide",
        prev_slide: "#prevslide",
        next_thumb: "#nextthumb",
        prev_thumb: "#prevthumb",
        slide_caption: "#slidecaption",
        slide_current: ".slidenumber",
        slide_total: ".totalslides",
        slide_list: "#slide-list",
        thumb_tray: "#thumb-tray",
        thumb_list: "#thumb-list",
        thumb_forward: "#thumb-forward",
        thumb_back: "#thumb-back",
        tray_arrow: "#tray-arrow",
        tray_button: "#tray-button",
        progress_bar: "#progress-bar"
    };
    a.supersized.themeOptions = {
        progress_bar: 1,
        mouse_scrub: 0
    }
})(jQuery);

