// ColorBox v1.3.17.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function (b, C, fa) {
    function c(a, y, d) { d = C.createElement("div"); if (a) d.id = n + a; d.style.cssText = y || ""; return b(d) } function k(a, b) { return Math.round((/%/.test(a) ? (b === "x" ? j.width() : j.height()) / 100 : 1) * parseInt(a, 10)) } function O(e) { return a.photo || /\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(e) } function $(e) {
        a = b.extend({}, b.data(m, p)); for (e in a) b.isFunction(a[e]) && e !== "current" && e.substring(0, 2) !== "on" && (a[e] = a[e].call(m)); a.rel = a.rel || m.rel || "nofollow"; a.href = a.href || b(m).attr("href"); a.title =
a.title || m.title; if (typeof a.href === "string") a.href = b.trim(a.href)
    } function w(a, d) { d && d.call(m); b.event.trigger(a) } function ga() {
        var e, b = n + "Slideshow_", c = "click." + n, h, P; a.slideshow && i[1] ? (h = function () { D.text(a.slideshowStop).unbind(c).bind(Q, function () { if (f < i.length - 1 || a.loop) e = setTimeout(d.next, a.slideshowSpeed) }).bind(R, function () { clearTimeout(e) }).one(c + " " + J, P); g.removeClass(b + "off").addClass(b + "on"); e = setTimeout(d.next, a.slideshowSpeed) }, P = function () {
            clearTimeout(e); D.text(a.slideshowStart).unbind([Q,
R, J, c].join(" ")).one(c, h); g.removeClass(b + "on").addClass(b + "off")
        }, a.slideshowAuto ? h() : P()) : g.removeClass(b + "off " + b + "on")
    } function aa(e) {
        if (!K) {
            m = e; $(); i = b(m); f = 0; a.rel !== "nofollow" && (i = b("." + z).filter(function () { return (b.data(this, p).rel || this.rel) === a.rel }), f = i.index(m), f === -1 && (i = i.add(m), f = i.length - 1)); if (!q) {
                q = A = !0; g.show(); if (a.returnFocus) try { m.blur(), b(m).one(ba, function () { try { this.focus() } catch (a) { } }) } catch (c) { } t.css({ opacity: +a.opacity, cursor: a.overlayClose ? "pointer" : "auto" }).show(); a.w =
k(a.initialWidth, "x"); a.h = k(a.initialHeight, "y"); d.position(); E && j.bind("resize." + L + " scroll." + L, function () { t.css({ width: j.width(), height: j.height(), top: j.scrollTop(), left: j.scrollLeft() }) }).trigger("resize." + L); w(ca, a.onOpen); S.add(T).hide(); U.html(a.close).show()
            } d.load(!0)
        } 
    } var da = { transition: "elastic", speed: 300, width: !1, initialWidth: "600", innerWidth: !1, maxWidth: !1, height: !1, initialHeight: "450", innerHeight: !1, maxHeight: !1, scalePhotos: !0, scrolling: !0, inline: !1, html: !1, iframe: !1, fastIframe: !0, photo: !1,
        href: !1, title: !1, rel: !1, opacity: 0.9, preloading: !0, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: !1, returnFocus: !0, loop: !0, slideshow: !1, slideshowAuto: !0, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: !1, onLoad: !1, onComplete: !1, onCleanup: !1, onClosed: !1, overlayClose: !0, escKey: !0, arrowKey: !0, top: !1, bottom: !1, left: !1, right: !1, fixed: !1, data: !1
    }, p = "colorbox", n = "cbox", z = n + "Element", ca = n + "_open", R = n + "_load", Q = n + "_complete",
J = n + "_cleanup", ba = n + "_closed", M = n + "_purge", B = b.browser.msie && !b.support.opacity, E = B && b.browser.version < 7, L = n + "_IE6", t, g, x, l, V, W, X, Y, i, j, o, F, G, T, N, D, H, I, U, S, a, u, v, r, s, m, f, h, q, A, K, Z, ea, d; d = b.fn[p] = b[p] = function (a, d) { var c = this, a = a || {}; if (!c[0]) { if (c.selector) return c; c = b("<a/>"); a.open = !0 } if (d) a.onComplete = d; c.each(function () { b.data(this, p, b.extend({}, b.data(this, p) || da, a)); b(this).addClass(z) }); (b.isFunction(a.open) && a.open.call(c) || a.open) && aa(c[0]); return c }; d.init = function () {
    j = b(fa); g = c().attr({ id: p,
        "class": B ? n + (E ? "IE6" : "IE") : ""
    }); t = c("Overlay", E ? "position:absolute" : "").hide(); x = c("Wrapper"); l = c("Content").append(o = c("LoadedContent", "width:0; height:0; overflow:hidden"), G = c("LoadingOverlay").add(c("LoadingGraphic")), T = c("Title"), N = c("Current"), H = c("Next"), I = c("Previous"), D = c("Slideshow").bind(ca, ga), U = c("Close")); x.append(c().append(c("TopLeft"), V = c("TopCenter"), c("TopRight")), c(!1, "clear:left").append(W = c("MiddleLeft"), l, X = c("MiddleRight")), c(!1, "clear:left").append(c("BottomLeft"), Y = c("BottomCenter"),
c("BottomRight"))).children().children().css({ "float": "left" }); F = c(!1, "position:absolute; width:9999px; visibility:hidden; display:none"); b("body").prepend(t, g.append(x, F)); l.children().hover(function () { b(this).addClass("hover") }, function () { b(this).removeClass("hover") }).addClass("hover"); u = V.height() + Y.height() + l.outerHeight(!0) - l.height(); v = W.width() + X.width() + l.outerWidth(!0) - l.width(); r = o.outerHeight(!0); s = o.outerWidth(!0); g.css({ "padding-bottom": u, "padding-right": v }).hide(); H.click(function () { d.next() });
    I.click(function () { d.prev() }); U.click(function () { d.close() }); S = H.add(I).add(N).add(D); l.children().removeClass("hover"); t.click(function () { a.overlayClose && d.close() }); b(C).bind("keydown." + n, function (b) { var c = b.keyCode; q && a.escKey && c === 27 && (b.preventDefault(), d.close()); q && a.arrowKey && i[1] && (c === 37 ? (b.preventDefault(), I.click()) : c === 39 && (b.preventDefault(), H.click())) })
}; d.remove = function () { g.add(t).remove(); b("." + z).removeData(p).removeClass(z) }; d.position = function (b, c) {
    function h(a) {
        V[0].style.width =
Y[0].style.width = l[0].style.width = a.style.width; G[0].style.height = G[1].style.height = l[0].style.height = W[0].style.height = X[0].style.height = a.style.height
    } var f = 0, i = 0; j.unbind("resize." + n); g.hide(); a.fixed && !E ? g.css({ position: "fixed" }) : (f = j.scrollTop(), i = j.scrollLeft(), g.css({ position: "absolute" })); i += a.right !== !1 ? Math.max(j.width() - a.w - s - v - k(a.right, "x"), 0) : a.left !== !1 ? k(a.left, "x") : Math.round(Math.max(j.width() - a.w - s - v, 0) / 2); f += a.bottom !== !1 ? Math.max(C.documentElement.clientHeight - a.h - r - u - k(a.bottom,
"y"), 0) : a.top !== !1 ? k(a.top, "y") : Math.round(Math.max(C.documentElement.clientHeight - a.h - r - u, 0) / 2); g.show(); b = g.width() === a.w + s && g.height() === a.h + r ? 0 : b || 0; x[0].style.width = x[0].style.height = "9999px"; g.dequeue().animate({ width: a.w + s, height: a.h + r, top: f, left: i }, { duration: b, complete: function () { h(this); A = !1; x[0].style.width = a.w + s + v + "px"; x[0].style.height = a.h + r + u + "px"; c && c(); setTimeout(function () { j.bind("resize." + n, d.position) }, 1) }, step: function () { h(this) } })
}; d.resize = function (b) {
    if (q) {
        b = b || {}; if (b.width) a.w =
k(b.width, "x") - s - v; if (b.innerWidth) a.w = k(b.innerWidth, "x"); o.css({ width: a.w }); if (b.height) a.h = k(b.height, "y") - r - u; if (b.innerHeight) a.h = k(b.innerHeight, "y"); if (!b.innerHeight && !b.height) b = o.wrapInner("<div style='overflow:auto'></div>").children(), a.h = b.height(), b.replaceWith(b.children()); o.css({ height: a.h }); d.position(a.transition === "none" ? 0 : a.speed)
    } 
}; d.prep = function (e) {
    if (q) {
        var k, j = a.transition === "none" ? 0 : a.speed; o.remove(); o = c("LoadedContent").append(e); o.hide().appendTo(F.show()).css({ width: function () {
            a.w =
a.w || o.width(); a.w = a.mw && a.mw < a.w ? a.mw : a.w; return a.w
        } (), overflow: a.scrolling ? "auto" : "hidden"
        }).css({ height: function () { a.h = a.h || o.height(); a.h = a.mh && a.mh < a.h ? a.mh : a.h; return a.h } () }).prependTo(l); F.hide(); b(h).css({ "float": "none" }); if (E) b("select").not(g.find("select")).filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one(J, function () { this.style.visibility = "inherit" }); k = function () {
            function c() { B && g[0].style.removeAttribute("filter") } var d, e, k, m; e = i.length; var l,
y; if (q) {
                y = function () { clearTimeout(ea); G.hide(); w(Q, a.onComplete) }; B && h && o.fadeIn(100); T.html(a.title).add(o).show(); if (e > 1) {
                    if (typeof a.current === "string" ? N.html(a.current.replace("{current}", f + 1).replace("{total}", e)).show() : typeof a.current === "function" && N.html(a.current(f + 1, e)).show(), H[a.loop || f < e - 1 ? "show" : "hide"]().html(a.next), I[a.loop || f ? "show" : "hide"]().html(a.previous), d = f ? i[f - 1] : i[e - 1], k = f < e - 1 ? i[f + 1] : i[0], a.slideshow && D.show(), a.preloading) {
                        m = b.data(k, p).href || k.href; e = b.data(d, p).href ||
d.href; m = b.isFunction(m) ? m.call(k) : m; e = b.isFunction(e) ? e.call(d) : e; if (O(m)) b("<img/>")[0].src = m; if (O(e)) b("<img/>")[0].src = e
                    } 
                } else S.hide(); if (a.iframe) { l = b("<iframe/>").addClass(n + "Iframe")[0]; if (a.fastIframe) y(); else b(l).one("load", y); l.name = n + +new Date; l.src = a.href; if (!a.scrolling) l.scrolling = "no"; if (B) l.frameBorder = 0, l.allowTransparency = "true"; b(l).appendTo(o).one(M, function () { l.src = "//about:blank" }) } else y(); a.transition === "fade" ? g.fadeTo(j, 1, c) : c()
            } 
        }; a.transition === "fade" ? g.fadeTo(j, 0, function () {
            d.position(0,
k)
        }) : d.position(j, k)
    } 
}; d.load = function (e) {
    var g, l, j = d.prep; A = !0; h = !1; m = i[f]; e || $(); w(M); w(R, a.onLoad); a.h = a.height ? k(a.height, "y") - r - u : a.innerHeight && k(a.innerHeight, "y"); a.w = a.width ? k(a.width, "x") - s - v : a.innerWidth && k(a.innerWidth, "x"); a.mw = a.w; a.mh = a.h; if (a.maxWidth) a.mw = k(a.maxWidth, "x") - s - v, a.mw = a.w && a.w < a.mw ? a.w : a.mw; if (a.maxHeight) a.mh = k(a.maxHeight, "y") - r - u, a.mh = a.h && a.h < a.mh ? a.h : a.mh; g = a.href; ea = setTimeout(function () { G.show() }, 100); a.inline ? (c().hide().insertBefore(b(g)[0]).one(M, function () { b(this).replaceWith(o.children()) }),
j(b(g))) : a.iframe ? j(" ") : a.html ? j(a.html) : O(g) ? (b(h = new Image).addClass(n + "Photo").error(function () { a.title = !1; j(c("Error").text("This image could not be loaded")) }).load(function () {
    var b; h.onload = null; a.scalePhotos && (l = function () { h.height -= h.height * b; h.width -= h.width * b }, a.mw && h.width > a.mw && (b = (h.width - a.mw) / h.width, l()), a.mh && h.height > a.mh && (b = (h.height - a.mh) / h.height, l())); if (a.h) h.style.marginTop = Math.max(a.h - h.height, 0) / 2 + "px"; if (i[1] && (f < i.length - 1 || a.loop)) h.style.cursor = "pointer", h.onclick =
function () { d.next() }; if (B) h.style.msInterpolationMode = "bicubic"; setTimeout(function () { j(h) }, 1)
}), setTimeout(function () { h.src = g }, 1)) : g && F.load(g, a.data, function (a, d, e) { j(d === "error" ? c("Error").text("Request unsuccessful: " + e.statusText) : b(this).contents()) })
}; d.next = function () { if (!A && i[1] && (f < i.length - 1 || a.loop)) f = f < i.length - 1 ? f + 1 : 0, d.load() }; d.prev = function () { if (!A && i[1] && (f || a.loop)) f = f ? f - 1 : i.length - 1, d.load() }; d.moveTo = function (b) { if (!(b < 0 && b >= i.length) && !A && i[1] && (f || a.loop)) f = b, d.load() }; d.close =
function () { q && !K && (K = !0, q = !1, w(J, a.onCleanup), j.unbind("." + n + " ." + L), t.fadeTo(200, 0), g.stop().fadeTo(300, 0, function () { g.add(t).css({ opacity: 1, cursor: "auto" }).hide(); w(M); o.remove(); setTimeout(function () { K = !1; w(ba, a.onClosed) }, 1) })) }; d.element = function () { return b(m) }; d.settings = da; Z = function (a) { a.button !== 0 && typeof a.button !== "undefined" || a.ctrlKey || a.shiftKey || a.altKey || (a.preventDefault(), aa(this)) }; b.fn.delegate ? b(C).delegate("." + z, "click", Z) : b("." + z).live("click", Z); b(d.init)
})(jQuery, document,
this);
