/*! fancyBox v2.1.7 fancyapps.com | fancyapps.com/fancybox/#license */
(function(t, J, f, x) {
var L = f("html"),
q = f(t),
p = f(J),
b = f.fancybox = function() {
b.open.apply(this, arguments)
},
K = navigator.userAgent.match(/msie/i),
D = null,
u = J.createTouch !== x,
v = function(a) {
return a && a.hasOwnProperty && a instanceof f
},
r = function(a) {
return a && "string" === f.type(a)
},
G = function(a) {
return r(a) && 0 < a.indexOf("%")
},
m = function(a, c) {
var d = parseInt(a, 10) || 0;
c && G(a) && (d *= b.getViewport()[c] / 100);
return Math.ceil(d)
},
y = function(a, b) {
return m(a, b) + "px"
};
f.extend(b, {
version: "2.1.7",
defaults: {
padding: 15,
margin: 20,
width: 800,
height: 600,
minWidth: 100,
minHeight: 100,
maxWidth: 9999,
maxHeight: 9999,
pixelRatio: 1,
autoSize: !0,
autoHeight: !1,
autoWidth: !1,
autoResize: !0,
autoCenter: !u,
fitToView: !0,
aspectRatio: !1,
topRatio: .5,
leftRatio: .5,
scrolling: "auto",
wrapCSS: "",
arrows: !0,
closeBtn: !0,
closeClick: !1,
nextClick: !1,
mouseWheel: !0,
autoPlay: !1,
playSpeed: 3E3,
preload: 3,
modal: !1,
loop: !0,
ajax: {
dataType: "html",
headers: {
"X-fancyBox": !0
}
},
iframe: {
scrolling: "auto",
preload: !0
},
swf: {
wmode: "transparent",
allowfullscreen: "true",
allowscriptaccess: "always"
},
keys: {
next: {
13: "left",
34: "up",
39: "left",
40: "up"
},
prev: {
8: "right",
33: "down",
37: "right",
38: "down"
},
close: [27],
play: [32],
toggle: [70]
},
direction: {
next: "left",
prev: "right"
},
scrollOutside: !0,
index: 0,
type: null,
href: null,
content: null,
title: null,
tpl: {
wrap: '
The requested content cannot be loaded.
Please try again later.
',
closeBtn: '").html(d).find(a.selector) : v(d) && (d.data("fancybox-placeholder") || d.data("fancybox-placeholder", f('
').insertAfter(d).hide()), d = d.show().detach(), a.wrap.bind("onReset", function() {
f(this).find(d).length && d.hide().replaceAll(d.data("fancybox-placeholder")).data("fancybox-placeholder", !1)
}));
break;
case "image":
d = a.tpl.image.replace(/\{href\}/g, g);
break;
case "swf":
d = '
"
}
v(d) && d.parent().is(a.inner) || a.inner.append(d);
b.trigger("beforeShow");
a.inner.css("overflow", "yes" === k ? "scroll" : "no" === k ? "hidden" : k);
b._setDimension();
b.reposition();
b.isOpen = !1;
b.coming = null;
b.bindEvents();
if (!b.isOpened) f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();
else if (c.prevMethod) b.transitions[c.prevMethod]();
b.transitions[b.isOpened ? a.nextMethod : a.openMethod]();
b._preloadImages()
}
},
_setDimension: function() {
var a = b.getViewport(),
c = 0,
d, e = b.wrap,
k = b.skin,
g = b.inner,
l = b.current;
d = l.width;
var h = l.height,
n = l.minWidth,
w = l.minHeight,
p = l.maxWidth,
q = l.maxHeight,
u = l.scrolling,
r = l.scrollOutside ? l.scrollbarWidth : 0,
z = l.margin,
A = m(z[1] + z[3]),
t = m(z[0] + z[2]),
x, B, v, E, C, H, D, F, I;
e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");
z = m(k.outerWidth(!0) - k.width());
x = m(k.outerHeight(!0) - k.height());
B = A + z;
v = t + x;
E = G(d) ? (a.w - B) * m(d) / 100 : d;
C = G(h) ? (a.h - v) * m(h) / 100 : h;
if ("iframe" === l.type) {
if (I = l.content, l.autoHeight && I && 1 === I.data("ready")) try {
I[0].contentWindow.document.location && (g.width(E).height(9999), H = I.contents().find("body"), r && H.css("overflow-x",
"hidden"), C = H.outerHeight(!0))
} catch (M) {}
} else if (l.autoWidth || l.autoHeight) g.addClass("fancybox-tmp"), l.autoWidth || g.width(E), l.autoHeight || g.height(C), l.autoWidth && (E = g.width()), l.autoHeight && (C = g.height()), g.removeClass("fancybox-tmp");
d = m(E);
h = m(C);
F = E / C;
n = m(G(n) ? m(n, "w") - B : n);
p = m(G(p) ? m(p, "w") - B : p);
w = m(G(w) ? m(w, "h") - v : w);
q = m(G(q) ? m(q, "h") - v : q);
H = p;
D = q;
l.fitToView && (p = Math.min(a.w - B, p), q = Math.min(a.h - v, q));
B = a.w - A;
t = a.h - t;
l.aspectRatio ? (d > p && (d = p, h = m(d / F)), h > q && (h = q, d = m(h * F)), d < n && (d = n, h = m(d /
F)), h < w && (h = w, d = m(h * F))) : (d = Math.max(n, Math.min(d, p)), l.autoHeight && "iframe" !== l.type && (g.width(d), h = g.height()), h = Math.max(w, Math.min(h, q)));
if (l.fitToView)
if (g.width(d).height(h), e.width(d + z), a = e.width(), A = e.height(), l.aspectRatio)
for (;
(a > B || A > t) && d > n && h > w && !(19 < c++);) h = Math.max(w, Math.min(q, h - 10)), d = m(h * F), d < n && (d = n, h = m(d / F)), d > p && (d = p, h = m(d / F)), g.width(d).height(h), e.width(d + z), a = e.width(), A = e.height();
else d = Math.max(n, Math.min(d, d - (a - B))), h = Math.max(w, Math.min(h, h - (A - t)));
r && "auto" === u && h < C &&
d + z + r < B && (d += r);
g.width(d).height(h);
e.width(d + z);
a = e.width();
A = e.height();
c = (a > B || A > t) && d > n && h > w;
d = l.aspectRatio ? d < H && h < D && d < E && h < C : (d < H || h < D) && (d < E || h < C);
f.extend(l, {
dim: {
width: y(a),
height: y(A)
},
origWidth: E,
origHeight: C,
canShrink: c,
canExpand: d,
wPadding: z,
hPadding: x,
wrapSpace: A - k.outerHeight(!0),
skinSpace: k.height() - h
});
!I && l.autoHeight && h > w && h < q && !d && g.height("auto")
},
_getPosition: function(a) {
var c = b.current,
d = b.getViewport(),
e = c.margin,
f = b.wrap.width() + e[1] + e[3],
g = b.wrap.height() + e[0] + e[2],
e = {
position: "absolute",
top: e[0],
left: e[3]
};
c.autoCenter && c.fixed && !a && g <= d.h && f <= d.w ? e.position = "fixed" : c.locked || (e.top += d.y, e.left += d.x);
e.top = y(Math.max(e.top, e.top + (d.h - g) * c.topRatio));
e.left = y(Math.max(e.left, e.left + (d.w - f) * c.leftRatio));
return e
},
_afterZoomIn: function() {
var a = b.current;
a && ((b.isOpen = b.isOpened = !0, b.wrap.css("overflow", "visible").addClass("fancybox-opened").hide().show(0), b.update(), (a.closeClick || a.nextClick && 1 < b.group.length) && b.inner.css("cursor", "pointer").bind("click.fb", function(c) {
f(c.target).is("a") ||
f(c.target).parent().is("a") || (c.preventDefault(), b[a.closeClick ? "close" : "next"]())
}), a.closeBtn && f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb", function(a) {
a.preventDefault();
b.close()
}), a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), a.loop || a.index !== a.group.length - 1) ? b.opts.autoPlay && !b.player.isActive && (b.opts.autoPlay = !1, b.play(!0)) : b.play(!1))
},
_afterZoomOut: function(a) {
a = a || b.current;
f(".fancybox-wrap").trigger("onReset").remove();
f.extend(b, {
group: {},
opts: {},
router: !1,
current: null,
isActive: !1,
isOpened: !1,
isOpen: !1,
isClosing: !1,
wrap: null,
skin: null,
outer: null,
inner: null
});
b.trigger("afterClose", a)
}
});
b.transitions = {
getOrigPosition: function() {
var a = b.current,
c = a.element,
d = a.orig,
e = {},
f = 50,
g = 50,
l = a.hPadding,
h = a.wPadding,
n = b.getViewport();
!d && a.isDom && c.is(":visible") && (d = c.find("img:first"), d.length || (d = c));
v(d) ?
(e = d.offset(), d.is("img") && (f = d.outerWidth(), g = d.outerHeight())) : (e.top = n.y + (n.h - g) * a.topRatio, e.left = n.x + (n.w - f) * a.leftRatio);
if ("fixed" === b.wrap.css("position") || a.locked) e.top -= n.y, e.left -= n.x;
return e = {
top: y(e.top - l * a.topRatio),
left: y(e.left - h * a.leftRatio),
width: y(f + h),
height: y(g + l)
}
},
step: function(a, c) {
var d, e, f = c.prop;
e = b.current;
var g = e.wrapSpace,
l = e.skinSpace;
if ("width" === f || "height" === f) d = c.end === c.start ? 1 : (a - c.start) / (c.end - c.start), b.isClosing && (d = 1 - d), e = "width" === f ? e.wPadding : e.hPadding,
e = a - e, b.skin[f](m("width" === f ? e : e - g * d)), b.inner[f](m("width" === f ? e : e - g * d - l * d))
},
zoomIn: function() {
var a = b.current,
c = a.pos,
d = a.openEffect,
e = "elastic" === d,
k = f.extend({
opacity: 1
}, c);
delete k.position;
e ? (c = this.getOrigPosition(), a.openOpacity && (c.opacity = .1)) : "fade" === d && (c.opacity = .1);
b.wrap.css(c).animate(k, {
duration: "none" === d ? 0 : a.openSpeed,
easing: a.openEasing,
step: e ? this.step : null,
complete: b._afterZoomIn
})
},
zoomOut: function() {
var a = b.current,
c = a.closeEffect,
d = "elastic" === c,
e = {
opacity: .1
};
d && (e = this.getOrigPosition(),
a.closeOpacity && (e.opacity = .1));
b.wrap.animate(e, {
duration: "none" === c ? 0 : a.closeSpeed,
easing: a.closeEasing,
step: d ? this.step : null,
complete: b._afterZoomOut
})
},
changeIn: function() {
var a = b.current,
c = a.nextEffect,
d = a.pos,
e = {
opacity: 1
},
f = b.direction,
g;
d.opacity = .1;
"elastic" === c && (g = "down" === f || "up" === f ? "top" : "left", "down" === f || "right" === f ? (d[g] = y(m(d[g]) - 200), e[g] = "+=200px") : (d[g] = y(m(d[g]) + 200), e[g] = "-=200px"));
"none" === c ? b._afterZoomIn() : b.wrap.css(d).animate(e, {
duration: a.nextSpeed,
easing: a.nextEasing,
complete: b._afterZoomIn
})
},
changeOut: function() {
var a = b.previous,
c = a.prevEffect,
d = {
opacity: .1
},
e = b.direction;
"elastic" === c && (d["down" === e || "up" === e ? "top" : "left"] = ("up" === e || "left" === e ? "-" : "+") + "=200px");
a.wrap.animate(d, {
duration: "none" === c ? 0 : a.prevSpeed,
easing: a.prevEasing,
complete: function() {
f(this).trigger("onReset").remove()
}
})
}
};
b.helpers.overlay = {
defaults: {
closeClick: !0,
speedOut: 200,
showEarly: !0,
css: {},
locked: !u,
fixed: !0
},
overlay: null,
fixed: !1,
el: f("html"),
create: function(a) {
var c;
a = f.extend({},
this.defaults, a);
this.overlay && this.close();
c = b.coming ? b.coming.parent : a.parent;
this.overlay = f('
').appendTo(c && c.length ? c : "body");
this.fixed = !1;
a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !0)
},
open: function(a) {
var c = this;
a = f.extend({}, this.defaults, a);
this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a);
this.fixed || (q.bind("resize.overlay", f.proxy(this.update, this)), this.update());
a.closeClick &&
this.overlay.bind("click.overlay", function(a) {
if (f(a.target).hasClass("fancybox-overlay")) return b.isActive ? b.close() : c.close(), !1
});
this.overlay.css(a.css).show()
},
close: function() {
q.unbind("resize.overlay");
this.el.hasClass("fancybox-lock") && (f(".fancybox-margin").removeClass("fancybox-margin"), this.el.removeClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
f(".fancybox-overlay").remove().hide();
f.extend(this, {
overlay: null,
fixed: !1
})
},
update: function() {
var a = "100%",
b;
this.overlay.width(a).height("100%");
K ? (b = Math.max(J.documentElement.offsetWidth, J.body.offsetWidth), p.width() > b && (a = p.width())) : p.width() > q.width() && (a = p.width());
this.overlay.width(a).height(p.height())
},
onReady: function(a, b) {
var d = this.overlay;
f(".fancybox-overlay").stop(!0, !0);
d || this.create(a);
a.locked && this.fixed && b.fixed && (b.locked = this.overlay.append(b.wrap), b.fixed = !1);
!0 === a.showEarly && this.beforeShow.apply(this, arguments)
},
beforeShow: function(a, b) {
b.locked && !this.el.hasClass("fancybox-lock") && (!1 !== this.fixPosition && f("*:not(object)").filter(function() {
return "fixed" ===
f(this).css("position") && !f(this).hasClass("fancybox-overlay") && !f(this).hasClass("fancybox-wrap")
}).addClass("fancybox-margin"), this.el.addClass("fancybox-margin"), this.scrollV = q.scrollTop(), this.scrollH = q.scrollLeft(), this.el.addClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
this.open(a)
},
onUpdate: function() {
this.fixed || this.update()
},
afterClose: function(a) {
this.overlay && !b.coming && this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this))
}
};
b.helpers.title = {
defaults: {
type: "float",
position: "bottom"
},
beforeShow: function(a) {
var c = b.current,
d = c.title,
e = a.type;
f.isFunction(d) && (d = d.call(c.element, c));
if (r(d) && "" !== f.trim(d)) {
c = f('
' + d + "
");
switch (e) {
case "inside":
e = b.skin;
break;
case "outside":
e = b.wrap;
break;
case "over":
e = b.inner;
break;
default:
e = b.skin, c.appendTo("body"), K && c.width(c.width()), c.wrapInner('
'), b.current.margin[2] += Math.abs(m(c.css("margin-bottom")))
}
c["top" === a.position ? "prependTo" :
"appendTo"](e)
}
}
};
f.fn.fancybox = function(a) {
var c, d = f(this),
e = this.selector || "",
k = function(g) {
var l = f(this).blur(),
h = c,
k, m;
g.ctrlKey || g.altKey || g.shiftKey || g.metaKey || l.is(".fancybox-wrap") || (k = a.groupAttr || "data-fancybox-group", m = l.attr(k), m || (k = "rel", m = l.get(0)[k]), m && "" !== m && "nofollow" !== m && (l = e.length ? f(e) : d, l = l.filter("[" + k + '="' + m + '"]'), h = l.index(this)), a.index = h, !1 !== b.open(l, a) && g.preventDefault())
};
a = a || {};
c = a.index || 0;
e && !1 !== a.live ? p.undelegate(e, "click.fb-start").delegate(e + ":not('.fancybox-item, .fancybox-nav')",
"click.fb-start", k) : d.unbind("click.fb-start").bind("click.fb-start", k);
this.filter("[data-fancybox-start=1]").trigger("click");
return this
};
p.ready(function() {
var a, c;
f.scrollbarWidth === x && (f.scrollbarWidth = function() {
var a = f('
').appendTo("body"),
b = a.children(),
b = b.innerWidth() - b.height(99).innerWidth();
a.remove();
return b
});
f.support.fixedPosition === x && (f.support.fixedPosition = function() {
var a = f('
').appendTo("body"),
b = 20 === a[0].offsetTop || 15 === a[0].offsetTop;
a.remove();
return b
}());
f.extend(b.defaults, {
scrollbarWidth: f.scrollbarWidth(),
fixed: f.support.fixedPosition,
parent: f("body")
});
a = f(t).width();
L.addClass("fancybox-lock-test");
c = f(t).width();
L.removeClass("fancybox-lock-test");
f("").appendTo("head")
})
})(window, document, jQuery);