(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("