(function (o, y, Ab) { var S = { html: false, photo: false, iframe: false, inline: false, transition: "elastic", speed: 300, fadeOut: 300, width: false, initialWidth: "600", innerWidth: false, maxWidth: false, height: false, initialHeight: "450", innerHeight: false, maxHeight: false, scalePhotos: true, scrolling: true, opacity: 0.9, preloading: true, className: false, overlayClose: true, escKey: true, arrowKey: true, top: false, bottom: false, left: false, right: false, fixed: false, data: undefined, closeButton: true, fastIframe: true, open: false, reposition: true, loop: true, slideshow: false, slideshowAuto: true, slideshowSpeed: 2500, slideshowStart: "开启自动播放", slideshowStop: "关闭自动播放", photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, retinaImage: false, retinaUrl: false, retinaSuffix: "@2x.$1", current: T("当前") + ": {current} / {total}", previous: T("上一个") + " ", next: T("下一个") + " ", close: T("关闭"), xhrError: "加载内容失败.", imgError: "加载图片失败.", returnFocus: true, trapFocus: true, onOpen: false, onLoad: false, onComplete: false, onCleanup: false, onClosed: false, rel: function () { return this.rel }, href: function () { return o(this).children("img").attr("src") }, title: function () { return this.title }, createImg: function () { var Aq = new Image(); var Ap = o(this).data("cbox-img-attrs"); if (typeof Ap === "object") { o.each(Ap, function (Ar, As) { Aq[Ar] = As }) } return Aq }, createIframe: function () { var Ap = y.createElement("iframe"); var Aq = o(this).data("cbox-iframe-attrs"); if (typeof Aq === "object") { o.each(Aq, function (Ar, As) { Ap[Ar] = As }) } if ("frameBorder" in Ap) { Ap.frameBorder = 0 } if ("allowTransparency" in Ap) { Ap.allowTransparency = "true" } Ap.name = (new Date()).getTime(); Ap.allowFullScreen = true; return Ap } }, j = "colorbox", G = "cbox", H = G + "Element", R = G + "_open", W = G + "_load", Al = G + "_complete", D = G + "_cleanup", k = G + "_closed", t = G + "_purge", Z, s, f, C, J, N, Af, w, An, F, V, Q, Ad, B, a, K, Ae, n, Ao, E, u = o(""), Aa, g, c, Ac, i, Ai, O, A, p, Aj, h, r, P = "div", Ak = 0, v = {}, q; function Ag(Ap, As, Aq) { var Ar = y.createElement(Ap); if (As) { Ar.id = G + As } if (Aq) { Ar.style.cssText = Aq } return o(Ar) } function X() { return Ab.innerHeight ? Ab.innerHeight : o(Ab).height() } function Ah(Aq, Ap) { if (Ap !== Object(Ap)) { Ap = {} } this.cache = {}; this.el = Aq; this.value = function (Ar) { var As; if (this.cache[Ar] === undefined) { As = o(this.el).attr("data-cbox-" + Ar); if (As !== undefined) { this.cache[Ar] = As } else { if (Ap[Ar] !== undefined) { this.cache[Ar] = Ap[Ar] } else { if (S[Ar] !== undefined) { this.cache[Ar] = S[Ar] } } } } return this.cache[Ar] }; this.get = function (Ar) { var As = this.value(Ar); return o.isFunction(As) ? As.call(this.el, this) : As } } function I(Ap) { var Ar = An.length, Aq = (Ai + Ap) % Ar; return (Aq < 0) ? Ar + Aq : Aq } function e(Ap, Aq) { return Math.round((/%/.test(Ap) ? ((Aq === "x" ? F.width() : X()) / 100) : 1) * parseInt(Ap, 10)) } function Am(Aq, Ap) { return Aq.get("photo") || Aq.get("photoRegex").test(Ap) } function Y(Aq, Ap) { return Aq.get("retinaUrl") && Ab.devicePixelRatio > 1 ? Ap.replace(Aq.get("photoRegex"), Aq.get("retinaSuffix")) : Ap } function L(Ap) { if ("contains" in s[0] && !s[0].contains(Ap.target) && Ap.target !== Z[0]) { Ap.stopPropagation(); s.focus() } } function U(Ap) { if (U.str !== Ap) { s.add(Z).removeClass(U.str).addClass(Ap); U.str = Ap } } function z(Ap) { Ai = 0; if (Ap && Ap !== false && Ap !== "nofollow") { An = o("." + H).filter(function () { var Aq = o.data(this, j); var Ar = new Ah(this, Aq); return (Ar.get("rel") === Ap) }); Ai = An.index(Aa.el); if (Ai === -1) { An = An.add(Aa.el); Ai = An.length - 1 } } else { An = o(Aa.el) } } function x(Ap) { o(y).trigger(Ap); u.triggerHandler(Ap) } var b = (function () { var Au, Av = G + "Slideshow_", Aw = "click." + G, As; function Ax() { clearTimeout(As) } function At() { if (Aa.get("loop") || An[Ai + 1]) { Ax(); As = setTimeout(r.next, Aa.get("slideshowSpeed")) } } function Aq() { K.html(Aa.get("slideshowStop")).unbind(Aw).one(Aw, Ap); u.bind(Al, At).bind(W, Ax); s.removeClass(Av + "off").addClass(Av + "on") } function Ap() { Ax(); u.unbind(Al, At).unbind(W, Ax); K.html(Aa.get("slideshowStart")).unbind(Aw).one(Aw, function () { r.next(); Aq() }); s.removeClass(Av + "on").addClass(Av + "off") } function Ar() { Au = false; K.hide(); Ax(); u.unbind(Al, At).unbind(W, Ax); s.removeClass(Av + "off " + Av + "on") } return function () { if (Au) { if (!Aa.get("slideshow")) { u.unbind(D, Ar); Ar() } } else { if (Aa.get("slideshow") && An[1]) { Au = true; u.one(D, Ar); if (Aa.get("slideshowAuto")) { Aq() } else { Ap() } K.show() } } } }()); function m(Au) { var Ar; if (!Aj) { Ar = o(Au).data(j); Aa = new Ah(Au, Ar); z(Aa.get("rel")); if (!A) { A = p = true; U(Aa.get("className")); s.css({ visibility: "hidden", display: "block", opacity: "" }); V = Ag(P, "LoadedContent", "width:0; height:0; overflow:hidden; visibility:hidden"); C.css({ width: "", height: "" }).append(V); g = J.height() + w.height() + C.outerHeight(true) - C.height(); c = N.width() + Af.width() + C.outerWidth(true) - C.width(); Ac = V.outerHeight(true); i = V.outerWidth(true); var Ap = e(Aa.get("initialWidth"), "x"); var Av = e(Aa.get("initialHeight"), "y"); var At = Aa.get("maxWidth"); var As = Aa.get("maxHeight"); Aa.w = (At !== false ? Math.min(Ap, e(At, "x")) : Ap) - i - c; Aa.h = (As !== false ? Math.min(Av, e(As, "y")) : Av) - Ac - g; V.css({ width: "", height: Aa.h }); r.position(); x(R); Aa.get("onOpen"); E.add(B).hide(); s.focus(); if (Aa.get("trapFocus")) { if (y.addEventListener) { y.addEventListener("focus", L, true); u.one(k, function () { y.removeEventListener("focus", L, true) }) } } if (Aa.get("returnFocus")) { u.one(k, function () { o(Aa.el).focus() }) } } var Aq = parseFloat(Aa.get("opacity")); Z.css({ opacity: Aq === Aq ? Aq : "", cursor: Aa.get("overlayClose") ? "pointer" : "", visibility: "visible" }).show(); if (Aa.get("closeButton")) { Ao.html(Aa.get("close")).appendTo(C) } else { Ao.appendTo("
") } d() } } function l() { if (!s) { q = false; F = o(Ab); s = Ag(P).attr({ id: j, "class": o.support.opacity === false ? G + "IE" : "", role: "dialog", tabindex: "-1" }).hide(); Z = Ag(P, "Overlay").hide(); Ad = o([Ag(P, "LoadingOverlay")[0], Ag(P, "LoadingGraphic")[0]]); f = Ag(P, "Wrapper"); C = Ag(P, "Content").append(B = Ag(P, "Title"), a = Ag(P, "Current"), n = o('').attr({ id: G + "Previous" }), Ae = o('').attr({ id: G + "Next" }), K = Ag("button", "Slideshow"), Ad); Ao = o('').attr({ id: G + "Close" }); f.append(Ag(P).append(Ag(P, "TopLeft"), J = Ag(P, "TopCenter"), Ag(P, "TopRight")), Ag(P, false, "clear:left").append(N = Ag(P, "MiddleLeft"), C, Af = Ag(P, "MiddleRight")), Ag(P, false, "clear:left").append(Ag(P, "BottomLeft"), w = Ag(P, "BottomCenter"), Ag(P, "BottomRight"))).find("div div").css({ "float": "left" }); Q = Ag(P, false, "position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"); E = Ae.add(n).add(a).add(K) } if (y.body && !s.parent().length) { o(y.body).append(Z, s.append(f, Q)) } } function M() { function Ap(Aq) { if (!(Aq.which > 1 || Aq.shiftKey || Aq.altKey || Aq.metaKey || Aq.ctrlKey)) { Aq.preventDefault(); m(this) } } if (s) { if (!q) { q = true; Ae.click(function () { r.next() }); n.click(function () { r.prev() }); Ao.click(function () { r.close() }); Z.click(function () { if (Aa.get("overlayClose")) { r.close() } }); o(y).bind("keydown." + G, function (Ar) { var Aq = Ar.keyCode; if (A && Aa.get("escKey") && Aq === 27) { Ar.preventDefault(); r.close() } if (A && Aa.get("arrowKey") && An[1] && !Ar.altKey) { if (Aq === 37) { Ar.preventDefault(); n.click() } else { if (Aq === 39) { Ar.preventDefault(); Ae.click() } } } }); if (o.isFunction(o.fn.on)) { o(y).on("click." + G, "." + H, Ap) } else { o("." + H).live("click." + G, Ap) } } return true } return false } if (o[j]) { return } o(l); r = o.fn[j] = o[j] = function (Aq, Ap) { var Ar; var As = this; Aq = Aq || {}; if (o.isFunction(As)) { As = o(""); Aq.open = true } if (!As[0]) { return As } l(); if (M()) { if (Ap) { Aq.onComplete = Ap } As.each(function () { var At = o.data(this, j) || {}; o.data(this, j, o.extend(At, Aq)) }).addClass(H); Ar = new Ah(As[0], Aq); if (Ar.get("open")) { m(As[0]) } } return As }; r.position = function (At, Ay) { var As, Av = 0, Aw = 0, Aq = s.offset(), Au, Ax; F.unbind("resize." + G); s.css({ top: -90000, left: -90000 }); Au = F.scrollTop(); Ax = F.scrollLeft(); if (Aa.get("fixed")) { Aq.top -= Au; Aq.left -= Ax; s.css({ position: "fixed" }) } else { Av = Au; Aw = Ax; s.css({ position: "absolute" }) } if (Aa.get("right") !== false) { Aw += Math.max(F.width() - Aa.w - i - c - e(Aa.get("right"), "x"), 0) } else { if (Aa.get("left") !== false) { Aw += e(Aa.get("left"), "x") } else { Aw += Math.round(Math.max(F.width() - Aa.w - i - c, 0) / 2) } } if (Aa.get("bottom") !== false) { Av += Math.max(X() - Aa.h - Ac - g - e(Aa.get("bottom"), "y"), 0) } else { if (Aa.get("top") !== false) { Av += e(Aa.get("top"), "y") } else { Av += Math.round(Math.max(X() - Aa.h - Ac - g, 0) / 2) } } s.css({ top: Aq.top, left: Aq.left, visibility: "visible" }); f[0].style.width = f[0].style.height = "9999px"; function Ap() { J[0].style.width = w[0].style.width = C[0].style.width = (parseInt(s[0].style.width, 10) - c) + "px"; C[0].style.height = N[0].style.height = Af[0].style.height = (parseInt(s[0].style.height, 10) - g) + "px" } As = { width: Aa.w + i + c, height: Aa.h + Ac + g, top: Av, left: Aw }; if (At) { var Ar = 0; o.each(As, function (Az) { if (As[Az] !== v[Az]) { Ar = At; return } }); At = Ar } v = As; if (!At) { s.css(As) } s.dequeue().animate(As, { duration: At || 0, complete: function () { Ap(); p = false; f[0].style.width = (Aa.w + i + c) + "px"; f[0].style.height = (Aa.h + Ac + g) + "px"; if (Aa.get("reposition")) { setTimeout(function () { F.bind("resize." + G, r.position) }, 1) } if (o.isFunction(Ay)) { Ay() } }, step: Ap }) }; r.resize = function (Aq) { var Ap; if (A) { Aq = Aq || {}; if (Aq.width) { Aa.w = e(Aq.width, "x") - i - c } if (Aq.innerWidth) { Aa.w = e(Aq.innerWidth, "x") } V.css({ width: Aa.w }); if (Aq.height) { Aa.h = e(Aq.height, "y") - Ac - g } if (Aq.innerHeight) { Aa.h = e(Aq.innerHeight, "y") } if (!Aq.innerHeight && !Aq.height) { Ap = V.scrollTop(); V.css({ height: "auto" }); Aa.h = V.height() } V.css({ height: Aa.h }); if (Ap) { V.scrollTop(Ap) } r.position(Aa.get("transition") === "none" ? 0 : Aa.get("speed")) } }; r.prep = function (Ar) { if (!A) { return } var Ap, Aq = Aa.get("transition") === "none" ? 0 : Aa.get("speed"); V.remove(); V = Ag(P, "LoadedContent").append(Ar); function At() { Aa.w = Aa.w || V.width(); Aa.w = Aa.mw && Aa.mw < Aa.w ? Aa.mw : Aa.w; if (Aa.w < 250) { Aa.w = 250 } return Aa.w } function As() { Aa.h = Aa.h || V.height(); Aa.h = Aa.mh && Aa.mh < Aa.h ? Aa.mh : Aa.h; return Aa.h } V.hide().appendTo(Q.show()).css({ width: At(), overflow: Aa.get("scrolling") ? "auto" : "hidden" }).css({ height: As() }).prependTo(C); Q.hide(); o(O).css({ "float": "none" }); U(Aa.get("className")); Ap = function () { var Av = An.length, Au, Ax; if (!A) { return } function Aw() { if (o.support.opacity === false) { s[0].style.removeAttribute("filter") } } Ax = function () { clearTimeout(h); Ad.hide(); x(Al); Aa.get("onComplete") }; B.html(Aa.get("title")).show(); V.show(); if (Av > 1) { if (typeof Aa.get("current") === "string") { a.html(Aa.get("current").replace("{current}", Ai + 1).replace("{total}", Av)).show() } Ae[(Aa.get("loop") || Ai < Av - 1) ? "show" : "hide"]().html(Aa.get("next")); n[(Aa.get("loop") || Ai) ? "show" : "hide"]().html(Aa.get("previous")); b(); if (Aa.get("preloading")) { o.each([I(-1), I(1)], function () { var AB, Ay = An[this], Az = new Ah(Ay, o.data(Ay, j)), AA = Az.get("href"); if (AA && Am(Az, AA)) { AA = Y(Az, AA); AB = y.createElement("img"); AB.src = AA } }) } } else { E.hide() } if (Aa.get("iframe")) { Au = Aa.get("createIframe"); if (!Aa.get("scrolling")) { Au.scrolling = "no" } o(Au).attr({ src: Aa.get("href"), "class": G + "Iframe" }).one("load", Ax).appendTo(V); u.one(t, function () { Au.src = "//about:blank" }); if (Aa.get("fastIframe")) { o(Au).trigger("load") } } else { Ax() } if (Aa.get("transition") === "fade") { s.fadeTo(Aq, 1, Aw) } else { Aw() } }; if (Aa.get("transition") === "fade") { s.fadeTo(Aq, 0, function () { r.position(0, Ap) }) } else { r.position(Aq, Ap) } }; function d() { var Ap, Au, Ar = r.prep, As, Aq = ++Ak; p = true; O = false; x(t); x(W); Aa.get("onLoad"); Aa.h = Aa.get("height") ? e(Aa.get("height"), "y") - Ac - g : Aa.get("innerHeight") && e(Aa.get("innerHeight"), "y"); Aa.w = Aa.get("width") ? e(Aa.get("width"), "x") - i - c : Aa.get("innerWidth") && e(Aa.get("innerWidth"), "x"); Aa.mw = Aa.w; Aa.mh = Aa.h; if (Aa.get("maxWidth")) { Aa.mw = e(Aa.get("maxWidth"), "x") - i - c; Aa.mw = Aa.w && Aa.w < Aa.mw ? Aa.w : Aa.mw } if (Aa.get("maxHeight")) { Aa.mh = e(Aa.get("maxHeight"), "y") - Ac - g; Aa.mh = Aa.h && Aa.h < Aa.mh ? Aa.h : Aa.mh } Ap = Aa.get("href"); h = setTimeout(function () { Ad.show() }, 100); if (Aa.get("inline")) { var At = o(Ap); As = o("