/*! Slimbox v2.05 - The ultimate lightweight Lightbox clone for jQuery (c) 2007-2013 Christophe Beyls MIT-style license. */ (function (ab) { var T = ab(window), ad, at, S = -1, ak, aa, U, ac, Z, M, ag, al = !window.XMLHttpRequest, af = [], am = document.documentElement, an = {}, ae = new Image(), O = new Image(), Q, ay, ar, ai, P, av, R, aw, X, N; ab(function () { ab("body").append(ab([Q = ab('
').click(V)[0], ay = ab('
')[0], R = ab('
')[0]]).css("display", "none")); ar = ab('
').appendTo(ay).append(ai = ab('
').append([P = ab('').click(W)[0], av = ab('').click(au)[0]])[0])[0]; aw = ab('
').appendTo(R).append([ab('').click(V)[0], X = ab('
')[0], N = ab('
')[0], ab('
')[0]])[0] }); ab.slimbox = function (a, b, c) { ad = ab.extend({loop: false, overlayOpacity: 0.8, overlayFadeDuration: 400, resizeDuration: 400, resizeEasing: "swing", initialWidth: 250, initialHeight: 250, imageFadeDuration: 400, captionAnimationDuration: 400, counterText: "Image {x} of {y}", closeKeys: [27, 88, 67], previousKeys: [37, 80], nextKeys: [39, 78]}, c); if (typeof a == "string") { a = [ [a, b] ]; b = 0 } Z = T.scrollTop() + (T.height() / 2); M = ad.initialWidth; ag = ad.initialHeight; ab(ay).css({top: Math.max(0, Z - (ag / 2)), width: M, height: ag, marginLeft: -M / 2}).show(); ac = al || (Q.currentStyle && (Q.currentStyle.position != "fixed")); if (ac) { Q.style.position = "absolute" } ab(Q).css("opacity", ad.overlayOpacity).fadeIn(ad.overlayFadeDuration); Y(); ao(1); at = a; ad.loop = ad.loop && (at.length > 1); return ax(b) }; ab.fn.slimbox = function (d, a, b) { a = a || function (e) { return[e.href, e.title] }; b = b || function () { return true }; var c = this; return c.unbind("click").click(function () { var g = this, e = 0, f, i = 0, h; f = ab.grep(c, function (j, k) { return b.call(g, j, k) }); for (h = f.length; i < h; ++i) { if (f[i] == g) { e = i } f[i] = a(f[i], i) } return ab.slimbox(f, e, d) }) }; function Y() { var a = T.scrollLeft(), b = T.width(); ab([ay, R]).css("left", a + (b / 2)); if (ac) { ab(Q).css({left: a, top: T.scrollTop(), width: b, height: T.height()}) } } function ao(b) { if (b) { ab("object").add(al ? "select" : "embed").each(function (d, c) { af[d] = [c, c.style.visibility]; c.style.visibility = "hidden" }) } else { ab.each(af, function (d, c) { c[0].style.visibility = c[1] }); af = [] } var a = b ? "bind" : "unbind"; T[a]("scroll resize", Y); ab(document)[a]("keydown", aj) } function aj(a) { var b = a.which, c = ab.inArray; return(c(b, ad.closeKeys) >= 0) ? V() : (c(b, ad.nextKeys) >= 0) ? au() : (c(b, ad.previousKeys) >= 0) ? W() : null } function W() { return ax(aa) } function au() { return ax(U) } function ax(a) { if (a >= 0) { S = a; ak = at[S][0]; aa = (S || (ad.loop ? at.length : 0)) - 1; U = ((S + 1) % at.length) || (ad.loop ? 0 : -1); ah(); ay.className = "lbLoading"; an = new Image(); an.onload = ap; an.src = ak } return false } function ap() { ay.className = ""; ab(ar).css({backgroundImage: "url(" + ak + ")", visibility: "hidden", display: ""}); ab(ai).width(an.width); ab([ai, P, av]).height(an.height); ab(X).html(at[S][1] || ""); ab(N).html((((at.length > 1) && ad.counterText) || "").replace(/{x}/, S + 1).replace(/{y}/, at.length)); if (aa >= 0) { ae.src = at[aa][0] } if (U >= 0) { O.src = at[U][0] } M = ar.offsetWidth; ag = ar.offsetHeight; var a = Math.max(0, Z - (ag / 2)); if (ay.offsetHeight != ag) { ab(ay).animate({height: ag, top: a}, ad.resizeDuration, ad.resizeEasing) } if (ay.offsetWidth != M) { ab(ay).animate({width: M, marginLeft: -M / 2}, ad.resizeDuration, ad.resizeEasing) } ab(ay).queue(function () { ab(R).css({width: M, top: a + ag, marginLeft: -M / 2, visibility: "hidden", display: ""}); ab(ar).css({display: "none", visibility: "", opacity: ""}).fadeIn(ad.imageFadeDuration, aq) }) } function aq() { if (aa >= 0) { ab(P).show() } if (U >= 0) { ab(av).show() } ab(aw).css("marginTop", -aw.offsetHeight).animate({marginTop: 0}, ad.captionAnimationDuration); R.style.visibility = "" } function ah() { an.onload = null; an.src = ae.src = O.src = ak; ab([ay, ar, aw]).stop(true); ab([P, av, ar, R]).hide() } function V() { if (S >= 0) { ah(); S = aa = U = -1; ab(ay).hide(); ab(Q).stop().fadeOut(ad.overlayFadeDuration, ao) } return false } })(jQuery); if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) { jQuery(function (a) { a("a[rel^='cyberchimps-lightbox']").slimbox({}, null, function (b) { return(this == b) || ((this.rel.length > 8) && (this.rel == b.rel)) }) }) } else { jQuery(function (a) { a("a[rel^='cyberchimps-lightbox']").click(function (b) { b.preventDefault() }); a("a[rel^='cyberchimps-lightbox']").click(function (g) { var f = a(this).attr("href"); var d = f.lastIndexOf("."); var c = f.substring(d + 1); var b = ["jpg", "png", "gif", "jpeg"]; if (a.inArray(c, b) >= 0) { g.preventDefault() } }) }) } ;