<\/div>'), u.append(p)), y.length && (y[0].style.opacity = Math.max( - v, 0)), p.length && (p[0].style.opacity = Math.max(v, 0)))
}
if (k.css({
"-webkit-transform-origin": "50% 50% -" + i / 2 + "px",
"-moz-transform-origin": "50% 50% -" + i / 2 + "px",
"-ms-transform-origin": "50% 50% -" + i / 2 + "px",
"transform-origin": "50% 50% -" + i / 2 + "px"
}), h.shadow) if (f) r.transform("translate3d(0px, " + (d / 2 + h.shadowOffset) + "px, " + -d / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + h.shadowScale + ")");
else {
var ft = Math.abs(l) - Math.floor(Math.abs(l) / 90) * 90,
ht = 1.5 - (Math.sin(ft * 2 * Math.PI / 360) / 2 + Math.cos(ft * 2 * Math.PI / 360) / 2),
ct = h.shadowScale,
et = h.shadowScale / ht,
lt = h.shadowOffset;
r.transform("scale3d(" + ct + ", 1, " + et + ") translate3d(0px, " + (it / 2 + lt) + "px, " + -it / 2 / et + "px) rotateX(-90deg)")
}
ot = o.isSafari || o.isUiWebView ? -i / 2 : 0;
k.transform("translate3d(0px,0," + ot + "px) rotateX(" + (t.isHorizontal() ? 0 : l) + "deg) rotateY(" + (t.isHorizontal() ? -l: 0) + "deg)")
},
setTransition: function(n) {
var t = this,
i = t.$el,
r = t.slides;
r.transition(n).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(n);
t.params.cubeEffect.shadow && !t.isHorizontal() && i.find(".swiper-cube-shadow").transition(n)
}
},
ce = {
name: "effect-cube",
params: {
cubeEffect: {
slideShadows: !0,
shadow: !0,
shadowOffset: 20,
shadowScale: .94
}
},
create: function() {
var n = this;
t.extend(n, {
cubeEffect: {
setTranslate: wt.setTranslate.bind(n),
setTransition: wt.setTransition.bind(n)
}
})
},
on: {
beforeInit: function() {
var n = this,
i;
n.params.effect === "cube" && (n.classNames.push(n.params.containerModifierClass + "cube"), n.classNames.push(n.params.containerModifierClass + "3d"), i = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: !0,
resistanceRatio: 0,
spaceBetween: 0,
centeredSlides: !1,
virtualTranslate: !0
},
t.extend(n.params, i), t.extend(n.originalParams, i))
},
setTranslate: function() {
var n = this;
n.params.effect === "cube" && n.cubeEffect.setTranslate()
},
setTransition: function(n) {
var t = this;
t.params.effect === "cube" && t.cubeEffect.setTransition(n)
}
}
},
bt = {
setTranslate: function() {
for (var g, o, s, nt, f = this,
tt = f.width,
it = f.height,
p = f.slides,
rt = f.$wrapperEl,
ut = f.slidesSizesGrid,
e = f.params.coverflowEffect,
t = f.isHorizontal(), w = f.translate, b = t ? -w + tt / 2 : -w + it / 2, k = t ? e.rotate: -e.rotate, ft = e.depth, h = 0, et = p.length; h < et; h += 1) {
var r = p.eq(h),
d = ut[h],
ot = r[0].swiperSlideOffset,
i = (b - ot - d / 2) / d * e.modifier,
c = t ? k * i: 0,
l = t ? 0 : k * i,
a = -ft * Math.abs(i),
v = t ? 0 : e.stretch * i,
y = t ? e.stretch * i: 0;
Math.abs(y) < .001 && (y = 0);
Math.abs(v) < .001 && (v = 0);
Math.abs(a) < .001 && (a = 0);
Math.abs(c) < .001 && (c = 0);
Math.abs(l) < .001 && (l = 0);
g = "translate3d(" + y + "px," + v + "px," + a + "px) rotateX(" + l + "deg) rotateY(" + c + "deg)";
r.transform(g);
r[0].style.zIndex = -Math.abs(Math.round(i)) + 1;
e.slideShadows && (o = t ? r.find(".swiper-slide-shadow-left") : r.find(".swiper-slide-shadow-top"), s = t ? r.find(".swiper-slide-shadow-right") : r.find(".swiper-slide-shadow-bottom"), o.length === 0 && (o = n('
<\/div>'), r.append(o)), s.length === 0 && (s = n('
<\/div>'), r.append(s)), o.length && (o[0].style.opacity = i > 0 ? i: 0), s.length && (s[0].style.opacity = -i > 0 ? -i: 0))
} (u.pointerEvents || u.prefixedPointerEvents) && (nt = rt[0].style, nt.perspectiveOrigin = b + "px 50%")
},
setTransition: function(n) {
var t = this;
t.slides.transition(n).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(n)
}
},
le = {
name: "effect-coverflow",
params: {
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: !0
}
},
create: function() {
var n = this;
t.extend(n, {
coverflowEffect: {
setTranslate: bt.setTranslate.bind(n),
setTransition: bt.setTransition.bind(n)
}
})
},
on: {
beforeInit: function() {
var n = this;
n.params.effect === "coverflow" && (n.classNames.push(n.params.containerModifierClass + "coverflow"), n.classNames.push(n.params.containerModifierClass + "3d"), n.params.watchSlidesProgress = !0, n.originalParams.watchSlidesProgress = !0)
},
setTranslate: function() {
var n = this;
n.params.effect === "coverflow" && n.coverflowEffect.setTranslate()
},
setTransition: function(n) {
var t = this;
t.params.effect === "coverflow" && t.coverflowEffect.setTransition(n)
}
}
},
g = {
init: function() {
var n = this,
u = n.params,
i = u.thumbs,
r = n.constructor;
i.swiper instanceof r ? (n.thumbs.swiper = i.swiper, t.extend(n.thumbs.swiper.originalParams, {
watchSlidesProgress: !0,
slideToClickedSlide: !1
}), t.extend(n.thumbs.swiper.params, {
watchSlidesProgress: !0,
slideToClickedSlide: !1
})) : t.isObject(i.swiper) && (n.thumbs.swiper = new r(t.extend({},
i.swiper, {
watchSlidesVisibility: !0,
watchSlidesProgress: !0,
slideToClickedSlide: !1
})), n.thumbs.swiperCreated = !0);
n.thumbs.swiper.$el.addClass(n.params.thumbs.thumbsContainerClass);
n.thumbs.swiper.on("tap", n.thumbs.onThumbClick)
},
onThumbClick: function() {
var t = this,
r = t.thumbs.swiper,
o, s, u, i, f, e;
r && ((o = r.clickedIndex, s = r.clickedSlide, s && n(s).hasClass(t.params.thumbs.slideThumbActiveClass)) || typeof o != "undefined" && o !== null && (u = r.params.loop ? parseInt(n(r.clickedSlide).attr("data-swiper-slide-index"), 10) : o, t.params.loop && (i = t.activeIndex, t.slides.eq(i).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, i = t.activeIndex), f = t.slides.eq(i).prevAll('[data-swiper-slide-index="' + u + '"]').eq(0).index(), e = t.slides.eq(i).nextAll('[data-swiper-slide-index="' + u + '"]').eq(0).index(), u = typeof f == "undefined" ? e: typeof e == "undefined" ? f: e - i < i - f ? e: f), t.slideTo(u)))
},
update: function(n) {
var r = this,
t = r.thumbs.swiper,
o, i, u, f, e, s, h, c, l;
if (t) if (o = t.params.slidesPerView === "auto" ? t.slidesPerViewDynamic() : t.params.slidesPerView, r.realIndex !== t.realIndex && (i = t.activeIndex, t.params.loop ? (t.slides.eq(i).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, i = t.activeIndex), f = t.slides.eq(i).prevAll('[data-swiper-slide-index="' + r.realIndex + '"]').eq(0).index(), e = t.slides.eq(i).nextAll('[data-swiper-slide-index="' + r.realIndex + '"]').eq(0).index(), u = typeof f == "undefined" ? e: typeof e == "undefined" ? f: e - i == i - f ? i: e - i < i - f ? e: f) : u = r.realIndex, t.visibleSlidesIndexes && t.visibleSlidesIndexes.indexOf(u) < 0 && (t.params.centeredSlides ? u = u > i ? u - Math.floor(o / 2) + 1 : u + Math.floor(o / 2) - 1 : u > i && (u = u - o + 1), t.slideTo(u, n ? 0 : undefined))), s = 1, h = r.params.thumbs.slideThumbActiveClass, r.params.slidesPerView > 1 && !r.params.centeredSlides && (s = r.params.slidesPerView), t.slides.removeClass(h), t.params.loop || t.params.virtual) for (c = 0; c < s; c += 1) t.$wrapperEl.children('[data-swiper-slide-index="' + (r.realIndex + c) + '"]').addClass(h);
else for (l = 0; l < s; l += 1) t.slides.eq(r.realIndex + l).addClass(h)
}
},
ae = {
name: "thumbs",
params: {
thumbs: {
swiper: null,
slideThumbActiveClass: "swiper-slide-thumb-active",
thumbsContainerClass: "swiper-container-thumbs"
}
},
create: function() {
var n = this;
t.extend(n, {
thumbs: {
swiper: null,
init: g.init.bind(n),
update: g.update.bind(n),
onThumbClick: g.onThumbClick.bind(n)
}
})
},
on: {
beforeInit: function() {
var n = this,
i = n.params,
t = i.thumbs;
t && t.swiper && (n.thumbs.init(), n.thumbs.update(!0))
},
slideChange: function() {
var n = this;
n.thumbs.swiper && n.thumbs.update()
},
update: function() {
var n = this;
n.thumbs.swiper && n.thumbs.update()
},
resize: function() {
var n = this;
n.thumbs.swiper && n.thumbs.update()
},
observerUpdate: function() {
var n = this;
n.thumbs.swiper && n.thumbs.update()
},
setTransition: function(n) {
var i = this,
t = i.thumbs.swiper;
t && t.setTransition(n)
},
beforeDestroy: function() {
var t = this,
n = t.thumbs.swiper;
n && t.thumbs.swiperCreated && n && n.destroy()
}
}
},
ve = [gf, ne, te, ie, re, ue, fe, ee, oe, se, he, ce, le, ae];
return typeof h.use == "undefined" && (h.use = h.Class.use, h.installModule = h.Class.installModule),
h.use(ve),
h
}),
function(n, t) {
typeof exports == "object" && typeof module != "undefined" ? module.exports = t() : typeof define == "function" && define.amd ? define(t) : (n = n || self, n.LazyLoad = t())
} (this,
function() {
"use strict";
function l() {
return l = Object.assign ||
function(n) {
for (var i, r, t = 1; t < arguments.length; t++) {
i = arguments[t];
for (r in i) Object.prototype.hasOwnProperty.call(i, r) && (n[r] = i[r])
}
return n
},
l.apply(this, arguments)
}
var u = typeof window != "undefined",
it = u && !("onscroll" in window) || typeof navigator != "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),
rt = u && "IntersectionObserver" in window,
ut = u && "classList" in document.createElement("p"),
ft = u && window.devicePixelRatio > 1,
ai = {
elements_selector: ".lazy",
container: it || u ? document: null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
data_bg_hidpi: "bg-hidpi",
data_bg_multi: "bg-multi",
data_bg_multi_hidpi: "bg-multi-hidpi",
data_poster: "poster",
class_applied: "applied",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
unobserve_completed: !0,
unobserve_entered: !1,
cancel_on_exit: !0,
callback_enter: null,
callback_exit: null,
callback_applied: null,
callback_loading: null,
callback_loaded: null,
callback_error: null,
callback_finish: null,
callback_cancel: null,
use_native: !1
},
et = function(n) {
return l({},
ai, n)
},
ot = function(n, t) {
var i, r = "LazyLoad::Initialized",
u = new n(t);
try {
i = new CustomEvent(r, {
detail: {
instance: u
}
})
} catch(f) {
i = document.createEvent("CustomEvent");
i.initCustomEvent(r, !1, !1, {
instance: u
})
}
window.dispatchEvent(i)
},
vi = function(n, t) {
if (t) if (t.length) for (var i = 0,
r; r = t[i]; i += 1) ot(n, r);
else ot(n, t)
},
a = "loading",
st = "loaded",
ht = "applied",
yi = "entered",
v = "error",
ct = "native",
lt = "data-",
at = "ll-status",
t = function(n, t) {
return n.getAttribute(lt + t)
},
n = function(n, t, i) {
var r = lt + t;
if (i === null) {
n.removeAttribute(r);
return
}
n.setAttribute(r, i)
},
e = function(n) {
return t(n, at)
},
f = function(t, i) {
return n(t, at, i)
},
y = function(n) {
return f(n, null)
},
vt = function(n) {
return e(n) === null
},
pi = function(n) {
return e(n) === a
},
wi = function(n) {
return e(n) === v
},
yt = function(n) {
return e(n) === ct
},
bi = [a, st, ht, v],
ki = function(n) {
return bi.indexOf(e(n)) >= 0
},
r = function(n, t, i, r) {
if (n) {
if (r !== undefined) {
n(t, i, r);
return
}
if (i !== undefined) {
n(t, i);
return
}
n(t)
}
},
s = function(n, t) {
if (ut) {
n.classList.add(t);
return
}
n.className += (n.className ? " ": "") + t
},
p = function(n, t) {
if (ut) {
n.classList.remove(t);
return
}
n.className = n.className.replace(new RegExp("(^|\\s+)" + t + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "")
},
di = function(n) {
n.llTempImage = document.createElement("IMG")
},
gi = function(n) {
delete n.llTempImage
},
pt = function(n) {
return n.llTempImage
},
h = function(n, t) {
if (t) {
var i = t._observer;
i && i.unobserve(n)
}
},
nr = function(n) {
n.disconnect()
},
tr = function(n, t, i) {
t.unobserve_entered && h(n, i)
},
w = function(n, t) {
n && (n.loadingCount += t)
},
ir = function(n) {
n && (n.toLoadCount -= 1)
},
wt = function(n, t) {
n && (n.toLoadCount = t)
},
rr = function(n) {
return n.loadingCount > 0
},
ur = function(n) {
return n.toLoadCount > 0
},
bt = function(n) {
for (var i = [], r = 0, t; t = n.children[r]; r += 1) t.tagName === "SOURCE" && i.push(t);
return i
},
i = function(n, t, i) {
i && n.setAttribute(t, i)
},
b = function(n, t) {
n.removeAttribute(t)
},
kt = function(n) {
return !! n.llOriginalAttrs
},
dt = function(n) {
if (!kt(n)) {
var t = {};
t.src = n.getAttribute("src");
t.srcset = n.getAttribute("srcset");
t.sizes = n.getAttribute("sizes");
n.llOriginalAttrs = t
}
},
gt = function(n) {
if (kt(n)) {
var t = n.llOriginalAttrs;
i(n, "src", t.src);
i(n, "srcset", t.srcset);
i(n, "sizes", t.sizes)
}
},
ni = function(n, r) {
i(n, "sizes", t(n, r.data_sizes));
i(n, "srcset", t(n, r.data_srcset));
i(n, "src", t(n, r.data_src))
},
ti = function(n) {
b(n, "src");
b(n, "srcset");
b(n, "sizes")
},
c = function(n, t) {
var i = n.parentNode,
r;
i && i.tagName === "PICTURE" && (r = bt(i), r.forEach(t))
},
ii = function(n, t) {
var i = bt(n);
i.forEach(t)
},
fr = function(n) {
c(n,
function(n) {
gt(n)
});
gt(n)
},
er = function(n, t) {
c(n,
function(n) {
dt(n);
ni(n, t)
});
dt(n);
ni(n, t)
},
or = function(n) {
c(n,
function(n) {
ti(n)
});
ti(n)
},
sr = function(n, r) {
i(n, "src", t(n, r.data_src))
},
hr = function(n, r) {
ii(n,
function(n) {
i(n, "src", t(n, r.data_src))
});
i(n, "poster", t(n, r.data_poster));
i(n, "src", t(n, r.data_src));
n.load()
},
cr = {
IMG: er,
IFRAME: sr,
VIDEO: hr
},
lr = function(n, i, r) {
var e = t(n, i.data_bg),
f = t(n, i.data_bg_hidpi),
u = ft && f ? f: e;
u && (n.style.backgroundImage = 'url("'.concat(u, '")'), pt(n).setAttribute("src", u), ui(n, i, r))
},
ar = function(n, i, r) {
var e = t(n, i.data_bg_multi),
u = t(n, i.data_bg_multi_hidpi),
f = ft && u ? u: e;
f && (n.style.backgroundImage = f, vr(n, i, r))
},
ri = function(n, t) {
var i = cr[n.tagName];
i && i(n, t)
},
vr = function(n, t, i) {
s(n, t.class_applied);
f(n, ht);
dr(n, t);
t.unobserve_completed && h(n, t);
r(t.callback_applied, n, i)
},
ui = function(n, t, i) {
w(i, 1);
s(n, t.class_loading);
f(n, a);
r(t.callback_loading, n, i)
},
yr = function(t, i) {
n(t, i.data_src, null);
n(t, i.data_srcset, null);
n(t, i.data_sizes, null);
c(t,
function(t) {
n(t, i.data_srcset, null);
n(t, i.data_sizes, null)
})
},
pr = function(t, i) {
n(t, i.data_src, null)
},
wr = function(t, i) {
n(t, i.data_src, null);
n(t, i.data_poster, null);
ii(t,
function(t) {
n(t, i.data_src, null)
})
},
br = {
IMG: yr,
IFRAME: pr,
VIDEO: wr
},
kr = function(t, i) {
n(t, i.data_bg, null);
n(t, i.data_bg_hidpi, null)
},
dr = function(t, i) {
n(t, i.data_bg_multi, null);
n(t, i.data_bg_multi_hidpi, null)
},
fi = function(n, t) {
var i = br[n.tagName];
if (i) {
i(n, t);
return
}
kr(n, t)
},
gr = ["IMG", "IFRAME", "VIDEO"],
nu = function(n) {
return gr.indexOf(n.tagName) > -1
},
ei = function(n, t) { ! t || rr(t) || ur(t) || r(n.callback_finish, t)
},
oi = function(n, t, i) {
n.addEventListener(t, i);
n.llEvLisnrs[t] = i
},
tu = function(n, t, i) {
n.removeEventListener(t, i)
},
k = function(n) {
return !! n.llEvLisnrs
},
iu = function(n, t, i) {
k(n) || (n.llEvLisnrs = {});
var r = n.tagName === "VIDEO" ? "loadeddata": "load";
oi(n, r, t);
oi(n, "error", i)
},
d = function(n) {
var t, i, r;
if (k(n)) {
t = n.llEvLisnrs;
for (i in t) r = t[i],
tu(n, i, r);
delete n.llEvLisnrs
}
},
si = function(n, t, i) {
gi(n);
w(i, -1);
ir(i);
p(n, t.class_loading);
t.unobserve_completed && h(n, i)
},
ru = function(n, t, i, u) {
var e = yt(t);
si(t, i, u);
s(t, i.class_loaded);
f(t, st);
fi(t, i);
r(i.callback_loaded, t, u);
e || ei(i, u)
},
uu = function(n, t, i, u) {
var e = yt(t);
si(t, i, u);
s(t, i.class_error);
f(t, v);
r(i.callback_error, t, u);
e || ei(i, u)
},
g = function(n, t, i) {
var r = pt(n) || n,
u,
f;
k(r) || (u = function(u) {
ru(u, n, t, i);
d(r)
},
f = function(u) {
uu(u, n, t, i);
d(r)
},
iu(r, u, f))
},
fu = function(n, t, i) {
di(n);
g(n, t, i);
lr(n, t, i);
ar(n, t, i)
},
eu = function(n, t, i) {
g(n, t, i);
ri(n, t);
ui(n, t, i)
},
nt = function(n, t, i) {
nu(n) ? eu(n, t, i) : fu(n, t, i)
},
ou = function(n, t, i) {
g(n, t, i);
ri(n, t);
fi(n, t);
f(n, ct)
},
su = function(n, t, i, u) {
i.cancel_on_exit && pi(n) && n.tagName === "IMG" && (d(n), or(n), fr(n), p(n, i.class_loading), w(u, -1), y(n), r(i.callback_cancel, n, t, u))
},
hu = function(n, t, i, u) { (f(n, yi), tr(n, i, u), r(i.callback_enter, n, t, u), ki(n)) || nt(n, i, u)
},
cu = function(n, t, i, u) {
vt(n) || (su(n, t, i, u), r(i.callback_exit, n, t, u))
},
lu = ["IMG", "IFRAME"],
hi = function(n) {
return n.use_native && "loading" in HTMLImageElement.prototype
},
au = function(n, t, i) {
n.forEach(function(n) {
lu.indexOf(n.tagName) !== -1 && (n.setAttribute("loading", "lazy"), ou(n, t, i))
});
wt(i, 0)
},
vu = function(n) {
return n.isIntersecting || n.intersectionRatio > 0
},
yu = function(n) {
return {
root: n.container === document ? null: n.container,
rootMargin: n.thresholds || n.threshold + "px"
}
},
pu = function(n, t, i) {
n.forEach(function(n) {
return vu(n) ? hu(n.target, n, t, i) : cu(n.target, n, t, i)
})
},
wu = function(n, t) {
t.forEach(function(t) {
n.observe(t)
})
},
bu = function(n, t) {
nr(n);
wu(n, t)
},
ku = function(n, t) {
rt && !hi(n) && (t._observer = new IntersectionObserver(function(i) {
pu(i, n, t)
},
yu(n)))
},
ci = function(n) {
return Array.prototype.slice.call(n)
},
tt = function(n) {
return n.container.querySelectorAll(n.elements_selector)
},
du = function(n) {
return ci(n).filter(vt)
},
gu = function(n) {
return wi(n)
},
nf = function(n) {
return ci(n).filter(gu)
},
li = function(n, t) {
return du(n || tt(t))
},
tf = function(n, t) {
var i = nf(tt(n));
i.forEach(function(t) {
p(t, n.class_error);
y(t)
});
t.update()
},
rf = function(n, t) {
u && window.addEventListener("online",
function() {
tf(n, t)
})
},
o = function(n, t) {
var i = et(n);
this._settings = i;
this.loadingCount = 0;
ku(i, this);
rf(i, this);
this.update(t)
};
return o.prototype = {
update: function(n) {
var i = this._settings,
t = li(n, i);
if (wt(this, t.length), it || !rt) {
this.loadAll(t);
return
}
if (hi(i)) {
au(t, i, this);
return
}
bu(this._observer, t)
},
destroy: function() {
this._observer && this._observer.disconnect();
tt(this._settings).forEach(function(n) {
delete n.llOriginalAttrs
});
delete this._observer;
delete this._settings;
delete this.loadingCount;
delete this.toLoadCount
},
loadAll: function(n) {
var t = this,
i = this._settings,
r = li(n, i);
r.forEach(function(n) {
h(n, t);
nt(n, i, t)
})
}
},
o.load = function(n, t) {
var i = et(t);
nt(n, i)
},
o.resetStatus = function(n) {
y(n)
},
u && vi(o, window.lazyLoadOptions),
o
});
var Sticky = function() {
function n() {
var i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "",
t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, n);
this.selector = i;
this.elements = [];
this.version = "1.3.0";
this.vp = this.getViewportSize();
this.body = document.querySelector("body");
this.options = {
wrap: t.wrap || !1,
wrapWith: t.wrapWith || "<\/span>",
marginTop: t.marginTop || 0,
marginBottom: t.marginBottom || 0,
stickyFor: t.stickyFor || 0,
stickyClass: t.stickyClass || null,
stickyContainer: t.stickyContainer || "body"
};
this.updateScrollTopPosition = this.updateScrollTopPosition.bind(this);
this.updateScrollTopPosition();
window.addEventListener("load", this.updateScrollTopPosition);
window.addEventListener("scroll", this.updateScrollTopPosition);
this.run()
}
return _createClass(n, [{
key: "run",
value: function() {
var n = this,
t = setInterval(function() {
if (document.readyState === "complete") {
clearInterval(t);
var i = document.querySelectorAll(n.selector);
n.forEach(i,
function(t) {
return n.renderElement(t)
})
}
},
10)
}
},
{
key: "renderElement",
value: function(n) {
var t = this;
n.sticky = {};
n.sticky.active = !1;
n.sticky.marginTop = parseInt(n.getAttribute("data-margin-top")) || this.options.marginTop;
n.sticky.marginBottom = parseInt(n.getAttribute("data-margin-bottom")) || this.options.marginBottom;
n.sticky.stickyFor = parseInt(n.getAttribute("data-sticky-for")) || this.options.stickyFor;
n.sticky.stickyClass = n.getAttribute("data-sticky-class") || this.options.stickyClass;
n.sticky.wrap = n.hasAttribute("data-sticky-wrap") ? !0 : this.options.wrap;
n.sticky.stickyContainer = this.options.stickyContainer;
n.sticky.container = this.getStickyContainer(n);
n.sticky.container.rect = this.getRectangle(n.sticky.container);
n.sticky.rect = this.getRectangle(n);
n.tagName.toLowerCase() === "img" && (n.onload = function() {
return n.sticky.rect = t.getRectangle(n)
});
n.sticky.wrap && this.wrapElement(n);
this.activate(n)
}
},
{
key: "wrapElement",
value: function(n) {
n.insertAdjacentHTML("beforebegin", n.getAttribute("data-sticky-wrapWith") || this.options.wrapWith);
n.previousSibling.appendChild(n)
}
},
{
key: "activate",
value: function(n) {
n.sticky.rect.top + n.sticky.rect.height < n.sticky.container.rect.top + n.sticky.container.rect.height && n.sticky.stickyFor < this.vp.width && !n.sticky.active && (n.sticky.active = !0);
this.elements.indexOf(n) < 0 && this.elements.push(n);
n.sticky.resizeEvent || (this.initResizeEvents(n), n.sticky.resizeEvent = !0);
n.sticky.scrollEvent || (this.initScrollEvents(n), n.sticky.scrollEvent = !0);
this.setPosition(n)
}
},
{
key: "initResizeEvents",
value: function(n) {
var t = this;
n.sticky.resizeListener = function() {
return t.onResizeEvents(n)
};
window.addEventListener("resize", n.sticky.resizeListener)
}
},
{
key: "destroyResizeEvents",
value: function(n) {
window.removeEventListener("resize", n.sticky.resizeListener)
}
},
{
key: "onResizeEvents",
value: function(n) {
this.vp = this.getViewportSize();
n.sticky.rect = this.getRectangle(n);
n.sticky.container.rect = this.getRectangle(n.sticky.container);
n.sticky.rect.top + n.sticky.rect.height < n.sticky.container.rect.top + n.sticky.container.rect.height && n.sticky.stickyFor < this.vp.width && !n.sticky.active ? n.sticky.active = !0 : (n.sticky.rect.top + n.sticky.rect.height >= n.sticky.container.rect.top + n.sticky.container.rect.height || n.sticky.stickyFor >= this.vp.width && n.sticky.active) && (n.sticky.active = !1);
this.setPosition(n)
}
},
{
key: "initScrollEvents",
value: function(n) {
var t = this;
n.sticky.scrollListener = function() {
return t.onScrollEvents(n)
};
window.addEventListener("scroll", n.sticky.scrollListener)
}
},
{
key: "destroyScrollEvents",
value: function(n) {
window.removeEventListener("scroll", n.sticky.scrollListener)
}
},
{
key: "onScrollEvents",
value: function(n) {
n.sticky && n.sticky.active && this.setPosition(n)
}
},
{
key: "setPosition",
value: function(n) { (this.css(n, {
position: "",
width: "",
top: "",
left: ""
}), this.vp.height < n.sticky.rect.height || !n.sticky.active) || (n.sticky.rect.width || (n.sticky.rect = this.getRectangle(n)), n.sticky.wrap && this.css(n.parentNode, {
display: "block",
width: n.sticky.rect.width + "px",
height: n.sticky.rect.height + "px"
}), n.sticky.rect.top === 0 && n.sticky.container === this.body ? (this.css(n, {
position: "fixed",
top: n.sticky.rect.top + "px",
left: n.sticky.rect.left + "px",
width: n.sticky.rect.width + "px"
}), n.sticky.stickyClass && n.classList.add(n.sticky.stickyClass)) : this.scrollTop > n.sticky.rect.top - n.sticky.marginTop ? (this.css(n, {
position: "fixed",
width: n.sticky.rect.width + "px",
left: n.sticky.rect.left + "px"
}), this.scrollTop + n.sticky.rect.height + n.sticky.marginTop > n.sticky.container.rect.top + n.sticky.container.offsetHeight - n.sticky.marginBottom ? (n.sticky.stickyClass && n.classList.remove(n.sticky.stickyClass), this.css(n, {
top: n.sticky.container.rect.top + n.sticky.container.offsetHeight - (this.scrollTop + n.sticky.rect.height + n.sticky.marginBottom) + "px"
})) : (n.sticky.stickyClass && n.classList.add(n.sticky.stickyClass), this.css(n, {
top: n.sticky.marginTop + "px"
}))) : (n.sticky.stickyClass && n.classList.remove(n.sticky.stickyClass), this.css(n, {
position: "",
width: "",
top: "",
left: ""
}), n.sticky.wrap && this.css(n.parentNode, {
display: "",
width: "",
height: ""
})))
}
},
{
key: "update",
value: function() {
var n = this;
this.forEach(this.elements,
function(t) {
t.sticky.rect = n.getRectangle(t);
t.sticky.container.rect = n.getRectangle(t.sticky.container);
n.activate(t);
n.setPosition(t)
})
}
},
{
key: "destroy",
value: function() {
var n = this;
window.removeEventListener("load", this.updateScrollTopPosition);
window.removeEventListener("scroll", this.updateScrollTopPosition);
this.forEach(this.elements,
function(t) {
n.destroyResizeEvents(t);
n.destroyScrollEvents(t);
delete t.sticky
})
}
},
{
key: "getStickyContainer",
value: function(n) {
for (var t = n.parentNode; ! t.hasAttribute("data-sticky-container") && !t.parentNode.querySelector(n.sticky.stickyContainer) && t !== this.body;) t = t.parentNode;
return t
}
},
{
key: "getRectangle",
value: function(n) {
this.css(n, {
position: "",
width: "",
top: "",
left: ""
});
var r = Math.max(n.offsetWidth, n.clientWidth, n.scrollWidth),
u = Math.max(n.offsetHeight, n.clientHeight, n.scrollHeight),
t = 0,
i = 0;
do t += n.offsetTop || 0,
i += n.offsetLeft || 0,
n = n.offsetParent;
while (n);
return {
top: t,
left: i,
width: r,
height: u
}
}
},
{
key: "getViewportSize",
value: function() {
return {
width: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
height: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
}
}
},
{
key: "updateScrollTopPosition",
value: function() {
this.scrollTop = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) || 0
}
},
{
key: "forEach",
value: function(n, t) {
for (var i = 0,
r = n.length; i < r; i++) t(n[i])
}
},
{
key: "css",
value: function(n, t) {
for (var i in t) t.hasOwnProperty(i) && (n.style[i] = t[i])
}
}]),
n
} (); (function(n, t) {
typeof exports != "undefined" ? module.exports = t: typeof define == "function" && define.amd ? define([],
function() {
return t
}) : n.Sticky = t
})(this, Sticky);
window.MagicZoom = function() {
function r(n) {
var i = [],
r = null;
return n && (r = t(n)) && (i = u.filter(function(n) {
return n.placeholder === r
})),
i.length ? i[0] : null
}
function et(n) {
var i = t(window).jGetSize(),
r = t(window).jGetScroll();
return n = n || 0,
{
left: n,
right: i.width - n,
top: n,
bottom: i.height - n,
x: r.x,
y: r.y
}
}
function d(n) {
return Object.assign({},
n, {
type: n.type,
pageX: n.pageX,
pageY: n.pageY,
screenX: n.screenX,
screenY: n.screenY,
clientX: n.clientX,
clientY: n.clientY,
cloned: !0
})
}
function f() {
var r = n.$A(arguments),
u = r.shift(),
i = c[u],
t;
if (i) for (t = 0; t < i.length; t++) i[t].apply(null, r)
}
function ot() {
var t = arguments[0],
u,
r,
i = [];
try {
do r = t.tagName,
/^[A-Za-z]*$/.test(r) && ((u = t.getAttribute("id")) && /^[A-Za-z][-A-Za-z0-9_]*/.test(u) && (r += "#" + u), i.push(r)),
t = t.parentNode;
while (t && t !== document.documentElement);
i = i.reverse();
n.addCSS(i.join(" ") + "> .mz-figure > img", {
transition: "none",
transform: "none"
},
"mz-runtime-css", !0);
n.addCSS(i.join(" ") + ":not(.mz-no-rt-width-css)> .mz-figure:not(.mz-no-rt-width-css) > img", {
width: "100% !important;"
},
"mz-runtime-css", !0)
} catch(f) {}
}
function st() {
n.addCSS(".magic-hidden-wrapper, .magic-temporary-img", {
display: "block !important",
"min-height": "0 !important",
"min-width": "0 !important",
"max-height": "none !important",
"max-width": "none !important",
width: "10px !important",
height: "10px !important",
position: "absolute !important",
top: "-10000px !important",
left: "0 !important",
overflow: "hidden !important",
"-webkit-transform": "none !important",
transform: "none !important",
"-webkit-transition": "none !important",
transition: "none !important"
},
"magiczoom-reset-css");
n.addCSS(".magic-temporary-img img, .magic-temporary-img picture", {
display: "inline-block !important",
border: "0 !important",
padding: "0 !important",
"min-height": "0 !important",
"min-width": "0 !important",
"max-height": "none !important",
"max-width": "none !important",
"-webkit-transform": "none !important",
transform: "none !important",
"-webkit-transition": "none !important",
transition: "none !important"
},
"magiczoom-reset-css");
n.addCSS(".magic-temporary-img picture, .magic-temporary-img picture > img", {
width: "auto !important",
height: "auto !important"
},
"magiczoom-reset-css");
n.browser.androidBrowser && n.addCSS(".mobile-magic .mz-expand .mz-expand-bg", {
display: "none !important"
},
"magiczoom-reset-css");
n.browser.androidBrowser && (n.browser.uaName !== "chrome" || n.browser.uaVersion === 44) && n.addCSS(".mobile-magic .mz-zoom-window.mz-magnifier, .mobile-magic .mz-zoom-window.mz-magnifier:before", {
"border-radius": "0 !important"
},
"magiczoom-reset-css")
}
var i, n, t, s, p;
i = n = function() {
function s(n) {
var t = n.charAt(0).toUpperCase() + n.slice(1);
return n in r || "Webkit" + t in r || "Moz" + t in r || "ms" + t in r || "O" + t in r
}
function l(t) {
var i, u;
return (u = n.browser.webkit && "filter" == t ? !1 : t in r, !u && (i = n.browser.cssDomPrefix + t.charAt(0).toUpperCase() + t.slice(1), i in r)) ? i: t
}
var t = {
version: "v3.3.4",
UUID: 0,
storage: {},
$uuid: function(t) {
return t.$J_UUID || (t.$J_UUID = ++n.UUID)
},
getStorage: function(t) {
return n.storage[t] || (n.storage[t] = {})
},
$F: function() {},
$false: function() {
return ! 1
},
$true: function() {
return ! 0
},
stylesId: "mjs-" + Math.floor(Math.random() * (new Date).getTime()),
defined: function(n) {
return undefined != n
},
ifndef: function(n, t) {
return undefined != n ? n: t
},
exists: function(n) {
return !! n
},
jTypeOf: function(t) {
if (!n.defined(t)) return ! 1;
if (t.$J_TYPE) return t.$J_TYPE;
if ( !! t.nodeType) {
if (1 == t.nodeType) return "element";
if (3 == t.nodeType) return "textnode"
}
if (t.length && t.item) return "collection";
if (t.length && t.callee) return "arguments";
if ((t instanceof window.Object || t instanceof window.Function) && t.constructor === n.Class) return "class";
if (t instanceof window.Array) return "array";
if (t instanceof window.Function) return "function";
if (t instanceof window.String) return "string";
if (n.browser.trident) {
if (n.defined(t.cancelBubble)) return "event"
} else if (t === window.event || t.constructor == window.Event || t.constructor == window.MouseEvent || t.constructor == window.UIEvent || t.constructor == window.KeyboardEvent || t.constructor == window.KeyEvent) return "event";
return t instanceof window.Date ? "date": t instanceof window.RegExp ? "regexp": t === window ? "window": t === document ? "document": typeof t
},
extend: function(t, i) {
var r, f, u;
if (t instanceof window.Array || (t = [t]), !i) return t[0];
for (r = 0, f = t.length; r < f; r++) if (n.defined(t)) for (u in i) if (Object.prototype.hasOwnProperty.call(i, u)) try {
t[r][u] = i[u]
} catch(e) {}
return t[0]
},
implement: function(t, i) {
var r, f, u;
for (t instanceof window.Array || (t = [t]), r = 0, f = t.length; r < f; r++) if (n.defined(t[r]) && t[r].prototype) for (u in i || {}) t[r].prototype[u] || (t[r].prototype[u] = i[u]);
return t[0]
},
nativize: function(t, i) {
if (!n.defined(t)) return t;
for (var r in i || {}) t[r] || (t[r] = i[r]);
return t
},
$try: function() {
for (var n = 0,
t = arguments.length; n < t; n++) try {
return arguments[n]()
} catch(i) {}
return null
},
$A: function(t) {
if (!n.defined(t)) return n.$([]);
if (t.toArray) return n.$(t.toArray());
if (t.item) {
for (var i = t.length || 0,
r = new Array(i); i--;) r[i] = t[i];
return n.$(r)
}
return n.$(Array.prototype.slice.call(t))
},
now: function() {
return (new Date).getTime()
},
detach: function(t) {
var i, u, r, f;
switch (n.jTypeOf(t)) {
case "object":
i = {};
for (u in t) i[u] = n.detach(t[u]);
break;
case "array":
for (i = [], r = 0, f = t.length; r < f; r++) i[r] = n.detach(t[r]);
break;
default:
return t
}
return n.$(i)
},
$: function(t) {
var r = !0,
i;
if (!n.defined(t)) return null;
if (t.$J_EXT) return t;
switch (n.jTypeOf(t)) {
case "array":
return t = n.nativize(t, n.extend(n.Array, {
$J_EXT: n.$F
})),
t.jEach = t.forEach,
t.contains = n.Array.contains,
t;
case "string":
return (i = document.getElementById(t), n.defined(i)) ? n.$(i) : null;
case "window":
case "document":
n.$uuid(t);
t = n.extend(t, n.Doc);
break;
case "element":
n.$uuid(t);
t = n.extend(t, n.Element);
break;
case "event":
t = n.extend(t, n.Event);
break;
case "textnode":
case "function":
case "array":
case "date":
default:
r = !1
}
return r ? n.extend(t, {
$J_EXT: n.$F
}) : t
},
$new: function(t, i, r) {
return n.$(n.doc.createElement(t)).setProps(i || {}).jSetCss(r || {})
},
addCSS: function(t, i, r) {
var f, u, s = [],
o = -1,
e;
if (r || (r = n.stylesId), f = n.$(r) || n.$new("style", {
id: r,
type: "text/css"
}).jAppendTo(document.head || document.body, "top"), u = f.sheet || f.styleSheet, "string" != n.jTypeOf(i)) {
for (e in i) s.push(e + ":" + i[e]);
i = s.join(";")
}
if (u.insertRule) o = u.insertRule(t + " {" + i + "}", u.cssRules.length);
else try {
o = u.addRule(t, i, u.rules.length)
} catch(h) {}
return o
},
removeCSS: function(t, i) {
var u, r; (u = n.$(t), "element" === n.jTypeOf(u)) && (r = u.sheet || u.styleSheet, r.deleteRule ? r.deleteRule(i) : r.removeRule && r.removeRule(i))
},
generateUUID: function() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(n) {
var t = Math.random() * 16 | 0,
i = n == "x" ? t: t & 3 | 8;
return i.toString(16)
}).toUpperCase()
},
getAbsoluteURL: function() {
var n;
return function(t) {
return n || (n = document.createElement("a")),
n.setAttribute("href", t),
("!!" + n.href).replace("!!", "")
}
} (),
getHashCode: function(n) {
for (var t = 0,
r = n.length,
i = 0; i < r; ++i) t = (31 * t + n.charCodeAt(i)) % 4294967296;
return t
}
},
n = t,
p = t.$;
window.magicJS || (window.magicJS = t, window.$mjs = t.$);
n.Array = {
$J_TYPE: "array",
indexOf: function(n, t) {
for (var u = this.length,
r = this.length,
i = t < 0 ? Math.max(0, r + t) : t || 0; i < r; i++) if (this[i] === n) return i;
return - 1
},
contains: function(n, t) {
return this.indexOf(n, t) != -1
},
forEach: function(n, t) {
for (var i = 0,
r = this.length; i < r; i++) i in this && n.call(t, this[i], i, this)
},
filter: function(n, t) {
for (var u, r = [], i = 0, f = this.length; i < f; i++) i in this && (u = this[i], n.call(t, this[i], i, this) && r.push(u));
return r
},
map: function(n, t) {
for (var r = [], i = 0, u = this.length; i < u; i++) i in this && (r[i] = n.call(t, this[i], i, this));
return r
}
};
n.implement(String, {
$J_TYPE: "string",
jTrim: function() {
return this.replace(/^\s+|\s+$/g, "")
},
eq: function(n, t) {
return t || !1 ? this.toString() === n.toString() : this.toLowerCase().toString() === n.toLowerCase().toString()
},
jCamelize: function() {
return this.replace(/-\D/g,
function(n) {
return n.charAt(1).toUpperCase()
})
},
dashize: function() {
return this.replace(/[A-Z]/g,
function(n) {
return "-" + n.charAt(0).toLowerCase()
})
},
jToInt: function(n) {
return parseInt(this, n || 10)
},
toFloat: function() {
return parseFloat(this)
},
jToBool: function() {
return ! this.replace(/true/i, "").jTrim()
},
has: function(n, t) {
return t = t || "",
(t + this + t).indexOf(t + n + t) > -1
}
});
t.implement(Function, {
$J_TYPE: "function",
jBind: function() {
var t = n.$A(arguments),
i = this,
r = t.shift();
return function() {
return i.apply(r || null, t.concat(n.$A(arguments)))
}
},
jBindAsEvent: function() {
var t = n.$A(arguments),
i = this,
r = t.shift();
return function(u) {
return i.apply(r || null, n.$([u || (n.browser.ieMode ? window.event: null)]).concat(t))
}
},
jDelay: function() {
var t = n.$A(arguments),
i = this,
r = t.shift();
return window.setTimeout(function() {
return i.apply(i, t)
},
r || 0)
},
jDefer: function() {
var i = n.$A(arguments),
t = this;
return function() {
return t.jDelay.apply(t, i)
}
},
interval: function() {
var t = n.$A(arguments),
i = this,
r = t.shift();
return window.setInterval(function() {
return i.apply(i, t)
},
r || 0)
}
});
var f = {},
u = navigator.userAgent.toLowerCase(),
e = u.match(/(webkit|gecko|trident|presto)\/(\d+\.?\d*)/i),
i = u.match(/(edge|opr)\/(\d+\.?\d*)/i) || u.match(/(crios|chrome|safari|firefox|opera|opr)\/(\d+\.?\d*)/i),
o = u.match(/version\/(\d+\.?\d*)/i),
r = document.documentElement.style;
n.browser = {
features: {
xpath: !!document.evaluate,
air: !!window.runtime,
query: !!document.querySelector,
fullScreen: !!(document.fullscreenEnabled || document.msFullscreenEnabled || document.exitFullscreen || document.cancelFullScreen || document.webkitexitFullscreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.oCancelFullScreen || document.msCancelFullScreen),
xhr2: !!window.ProgressEvent && !!window.FormData && window.XMLHttpRequest && "withCredentials" in new XMLHttpRequest,
transition: s("transition"),
transform: s("transform"),
perspective: s("perspective"),
animation: s("animation"),
requestAnimationFrame: !1,
multibackground: !1,
cssFilters: !1,
canvas: !1,
svg: function() {
return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")
} ()
},
touchScreen: function() {
return "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0
} (),
mobile: !!u.match(/(android|bb\d+|meego).+|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/),
engine: e && e[1] ? e[1].toLowerCase() : window.opera ? "presto": !window.ActiveXObject ? document.getBoxObjectFor !== undefined || window.mozInnerScreenY !== null ? "gecko": window.WebKitPoint !== null || !navigator.taintEnabled ? "webkit": "unknown": "trident",
version: e && e[2] ? parseFloat(e[2]) : 0,
uaName: i && i[1] ? i[1].toLowerCase() : "",
uaVersion: i && i[2] ? parseFloat(i[2]) : 0,
cssPrefix: "",
cssDomPrefix: "",
domPrefix: "",
ieMode: 0,
platform: u.match(/ip(?:ad|od|hone)/) ? "ios": (u.match(/(?:webos|android)/) || navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(),
backCompat: document.compatMode && document.compatMode.toLowerCase() === "backcompat",
scrollbarsWidth: 0,
getDoc: function() {
return document.compatMode && document.compatMode.toLowerCase() === "backcompat" ? document.body: document.documentElement
},
requestAnimationFrame: window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || undefined,
cancelAnimationFrame: window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || undefined,
ready: !1,
onready: function() {
var t, i, r;
if (!n.browser.ready) {
n.browser.ready = !0;
n.body = n.$(document.body);
n.win = n.$(window);
try {
r = n.$new("div").jSetCss({
width: 100,
height: 100,
overflow: "scroll",
position: "absolute",
top: -9999
}).jAppendTo(document.body);
n.browser.scrollbarsWidth = r.offsetWidth - r.clientWidth;
r.jRemove()
} catch(u) {}
try {
t = n.$new("div");
i = t.style;
i.cssText = "background:url(https://),url(https://),red url(https://)";
n.browser.features.multibackground = /(url\s*\(.*?){3}/.test(i.background);
i = null;
t = null
} catch(u) {}
n.browser.cssTransformProp || (n.browser.cssTransformProp = n.normalizeCSS("transform").dashize());
try {
t = n.$new("div");
t.style.cssText = n.normalizeCSS("filter").dashize() + ":blur(2px);";
n.browser.features.cssFilters = !!t.style.length && (!n.browser.ieMode || n.browser.ieMode > 9);
t = null
} catch(u) {}
n.browser.features.cssFilters || n.$(document.documentElement).jAddClass("no-cssfilters-magic");
try {
n.browser.features.canvas = function() {
var t = n.$new("canvas");
return !! (t.getContext && t.getContext("2d"))
} ()
} catch(u) {}
window.TransitionEvent === undefined && window.WebKitTransitionEvent !== undefined && (f.transitionend = "webkitTransitionEnd");
n.Doc.jCallEvent.call(n.$(document), "domready")
}
}
},
function() {
var t, r;
switch (n.browser.engine) {
case "trident":
n.browser.version || (n.browser.version = !window.XMLHttpRequest ? 2 : 3);
break;
case "gecko":
n.browser.version = i && i[2] ? parseFloat(i[2]) : 0
}
n.browser[n.browser.engine] = !0;
i && i[1] === "crios" && (n.browser.uaName = "chrome"); ! window.chrome || (n.browser.chrome = !0);
i && i[1] === "opr" && (n.browser.uaName = "opera", n.browser.opera = !0);
n.browser.uaName === "safari" && o && o[1] && (n.browser.uaVersion = parseFloat(o[1]));
n.browser.platform === "android" && n.browser.webkit && o && o[1] && (n.browser.androidBrowser = !0);
t = {
gecko: ["-moz-", "Moz", "moz"],
webkit: ["-webkit-", "Webkit", "webkit"],
trident: ["-ms-", "ms", "ms"],
presto: ["-o-", "O", "o"]
} [n.browser.engine] || ["", "", ""];
n.browser.cssPrefix = t[0];
n.browser.cssDomPrefix = t[1];
n.browser.domPrefix = t[2];
n.browser.ieMode = n.browser.trident ? document.documentMode ? document.documentMode: function() {
var t = 0;
if (n.browser.backCompat) return 5;
switch (n.browser.version) {
case 2:
t = 6;
break;
case 3:
t = 7
}
return t
} () : undefined; ! n.browser.mobile && n.browser.platform === "mac" && n.browser.touchScreen && (n.browser.mobile = !0, n.browser.platform = "ios");
n.browser.webkit && n.browser.version < 536 && (n.browser.features.fullScreen = !1);
n.browser.requestAnimationFrame && n.browser.requestAnimationFrame.call(window,
function() {
n.browser.features.requestAnimationFrame = !0
});
r = (document.documentElement.className || "").match(/\S+/g) || [];
document.documentElement.className = n.$(r).concat([]).join(" ");
n.browser.ieMode && n.browser.ieMode < 9 && (document.createElement("figure"), document.createElement("figcaption"));
window.navigator.pointerEnabled || n.$(["Down", "Up", "Move", "Over", "Out"]).jEach(function(n) {
f["pointer" + n.toLowerCase()] = window.navigator.msPointerEnabled ? "MSPointer" + n: -1
})
} (),
function() {
n.browser.fullScreen = {
capable: n.browser.features.fullScreen,
enabled: function() {
return !! (document.fullscreenElement || document[n.browser.domPrefix + "FullscreenElement"] || document.fullScreen || document.webkitIsFullScreen || document[n.browser.domPrefix + "FullScreen"])
},
request: function(t, i) {
i || (i = {});
this.capable ? (n.$(document).jAddEvent(this.changeEventName, this.onchange = function() {
this.enabled() ? i.onEnter && i.onEnter() : (n.$(document).jRemoveEvent(this.changeEventName, this.onchange), i.onExit && i.onExit())
}.jBindAsEvent(this)), n.$(document).jAddEvent(this.errorEventName, this.onerror = function() {
i.fallback && i.fallback();
n.$(document).jRemoveEvent(this.errorEventName, this.onerror)
}.jBindAsEvent(this)), (t.requestFullscreen || t[n.browser.domPrefix + "RequestFullscreen"] || t[n.browser.domPrefix + "RequestFullScreen"] ||
function() {}).call(t)) : i.fallback && i.fallback()
},
cancel: (document.exitFullscreen || document.cancelFullScreen || document[n.browser.domPrefix + "ExitFullscreen"] || document[n.browser.domPrefix + "CancelFullScreen"] ||
function() {}).jBind(document),
changeEventName: document.msExitFullscreen ? "MSFullscreenChange": (document.exitFullscreen ? "": n.browser.domPrefix) + "fullscreenchange",
errorEventName: document.msExitFullscreen ? "MSFullscreenError": (document.exitFullscreen ? "": n.browser.domPrefix) + "fullscreenerror",
prefix: n.browser.domPrefix,
activeElement: null
}
} ();
var h = /\S+/g,
a = /^(border(Top|Bottom|Left|Right)Width)|((padding|margin)(Top|Bottom|Left|Right))$/,
c = {
float: "undefined" == typeof r.styleFloat ? "cssFloat": "styleFloat"
},
v = {
fontWeight: !0,
lineHeight: !0,
opacity: !0,
zIndex: !0,
zoom: !0
},
y = window.getComputedStyle ?
function(n, t) {
var i = window.getComputedStyle(n, null);
return i ? i.getPropertyValue(t) || i[t] : null
}: function(n, t) {
var r = n.currentStyle,
i = null;
return i = r ? r[t] : null,
null == i && n.style && n.style[t] && (i = n.style[t]),
i
};
return n.normalizeCSS = l,
n.Element = {
jHasClass: function(n) {
return ! (n || "").has(" ") && (this.className || "").has(n, " ")
},
jAddClass: function(t) {
for (var r = (this.className || "").match(h) || [], u = (t || "").match(h) || [], f = u.length, i = 0; i < f; i++) n.$(r).contains(u[i]) || r.push(u[i]);
return this.className = r.join(" "),
this
},
jRemoveClass: function(t) {
for (var i = (this.className || "").match(h) || [], u = (t || "").match(h) || [], e = u.length, r = 0, f; r < e; r++)(f = n.$(i).indexOf(u[r])) > -1 && i.splice(f, 1);
return this.className = t ? i.join(" ") : "",
this
},
jToggleClass: function(n) {
return this.jHasClass(n) ? this.jRemoveClass(n) : this.jAddClass(n)
},
jGetCss: function(t) {
var r = t.jCamelize(),
i = null;
if (t = c[r] || (c[r] = l(r)), i = y(this, t), "auto" === i && (i = null), null !== i) {
if ("opacity" == t) return n.defined(i) ? parseFloat(i) : 1;
a.test(t) && (i = parseInt(i, 10) ? i: "0px")
}
return i
},
jSetCssProp: function(t, i) {
var r = t.jCamelize();
try {
if ("opacity" == t) return this.jSetOpacity(i),
this;
t = c[r] || (c[r] = l(r));
this.style[t] = i + ("number" == n.jTypeOf(i) && !v[r] ? "px": "")
} catch(u) {}
return this
},
jSetCss: function(n) {
for (var t in n) this.jSetCssProp(t, n[t]);
return this
},
jGetStyles: function() {
var t = {};
return n.$A(arguments).jEach(function(n) {
t[n] = this.jGetCss(n)
},
this),
t
},
jSetOpacity: function(t, i) {
return i = i || !1,
this.style.opacity = t,
t = parseInt(parseFloat(t) * 100),
i && (0 === t ? "hidden" != this.style.visibility && (this.style.visibility = "hidden") : "visible" != this.style.visibility && (this.style.visibility = "visible")),
n.browser.ieMode && n.browser.ieMode < 9 && (isNaN(t) ? (this.style.filter = this.style.filter.replace(/progid:DXImageTransform.Microsoft.Alpha\(Opacity=\d*\)/i, "").jTrim(), "" === this.style.filter && this.style.removeAttribute("filter")) : ~this.style.filter.indexOf("Alpha") ? this.style.filter = this.style.filter.replace(/Opacity=\d*/i, "Opacity=" + t) : this.style.filter += " progid:DXImageTransform.Microsoft.Alpha(Opacity=" + t + ")"),
this
},
setProps: function(n) {
for (var t in n)"class" === t ? this.jAddClass("" + n[t]) : this.setAttribute(t, "" + n[t]);
return this
},
jGetTransitionDuration: function() {
var n = 0,
t = 0;
return n = this.jGetCss("transition-duration"),
t = this.jGetCss("transition-delay"),
n = n.indexOf("ms") > -1 ? parseFloat(n) : n.indexOf("s") > -1 ? parseFloat(n) * 1e3: 0,
t = t.indexOf("ms") > -1 ? parseFloat(t) : t.indexOf("s") > -1 ? parseFloat(t) * 1e3: 0,
n + t
},
hide: function() {
return this.jSetCss({
display: "none",
visibility: "hidden"
})
},
show: function() {
return this.jSetCss({
display: "",
visibility: "visible"
})
},
jGetSize: function() {
return {
width: this.offsetWidth,
height: this.offsetHeight
}
},
getInnerSize: function(n) {
var t = this.jGetSize();
return t.width -= parseFloat(this.jGetCss("border-left-width") || 0) + parseFloat(this.jGetCss("border-right-width") || 0),
t.height -= parseFloat(this.jGetCss("border-top-width") || 0) + parseFloat(this.jGetCss("border-bottom-width") || 0),
n || (t.width -= parseFloat(this.jGetCss("padding-left") || 0) + parseFloat(this.jGetCss("padding-right") || 0), t.height -= parseFloat(this.jGetCss("padding-top") || 0) + parseFloat(this.jGetCss("padding-bottom") || 0)),
t
},
jGetScroll: function() {
return {
top: this.scrollTop,
left: this.scrollLeft
}
},
jGetFullScroll: function() {
var n = this,
t = {
top: 0,
left: 0
};
do t.left += n.scrollLeft || 0,
t.top += n.scrollTop || 0,
n = n.parentNode;
while (n);
return t
},
jGetPosition: function() {
var t = this,
i = 0,
r = 0;
if (n.defined(document.documentElement.getBoundingClientRect)) {
var u = this.getBoundingClientRect(),
f = n.$(document).jGetScroll(),
e = n.browser.getDoc();
return {
top: u.top + f.y - e.clientTop,
left: u.left + f.x - e.clientLeft
}
}
do i += t.offsetLeft || 0,
r += t.offsetTop || 0,
t = t.offsetParent;
while (t && !/^(?:body|html)$/i.test(t.tagName));
return {
top: r,
left: i
}
},
jGetRect: function() {
var n = this.jGetPosition(),
t = this.jGetSize();
return {
top: n.top,
bottom: n.top + t.height,
left: n.left,
right: n.left + t.width
}
},
changeContent: function(n) {
try {
this.innerHTML = n
} catch(t) {
this.innerText = n
}
return this
},
jRemove: function() {
return this.parentNode ? this.parentNode.removeChild(this) : this
},
kill: function() {
return n.$A(this.childNodes).jEach(function(t) {
3 != t.nodeType && 8 != t.nodeType && n.$(t).kill()
}),
this.jRemove(),
this.jClearEvents(),
this.$J_UUID && (n.storage[this.$J_UUID] = null, delete n.storage[this.$J_UUID]),
null
},
append: function(n, t) {
t = t || "bottom";
var i = this.firstChild;
return "top" == t && i ? this.insertBefore(n, i) : this.appendChild(n),
this
},
jAppendTo: function(t, i) {
var r = n.$(t).append(this, i);
return this
},
enclose: function(n) {
return this.append(n.parentNode.replaceChild(this, n)),
this
},
hasChild: function(t) {
return "element" !== n.jTypeOf("string" == n.jTypeOf(t) ? t = document.getElementById(t) : t) ? !1 : this == t ? !1 : this.contains && !n.browser.webkit419 ? this.contains(t) : this.compareDocumentPosition ? !!(this.compareDocumentPosition(t) & 16) : n.$A(this.byTag(t.tagName)).contains(t)
}
},
n.Element.jGetStyle = n.Element.jGetCss,
n.Element.jSetStyle = n.Element.jSetCss,
window.Element || (window.Element = n.$F, n.browser.engine.webkit && window.document.createElement("iframe"), window.Element.prototype = n.browser.engine.webkit ? window["[[DOMElement.prototype]]"] : {}),
n.implement(window.Element, {
$J_TYPE: "element"
}),
n.Doc = {
jGetSize: function() {
return n.browser.touchScreen || n.browser.presto925 || n.browser.webkit419 ? {
width: window.innerWidth,
height: window.innerHeight
}: {
width: n.browser.getDoc().clientWidth,
height: n.browser.getDoc().clientHeight
}
},
jGetScroll: function() {
return {
x: window.pageXOffset || n.browser.getDoc().scrollLeft,
y: window.pageYOffset || n.browser.getDoc().scrollTop
}
},
jGetFullSize: function() {
var t = this.jGetSize();
return {
width: Math.max(n.browser.getDoc().scrollWidth, t.width),
height: Math.max(n.browser.getDoc().scrollHeight, t.height)
}
}
},
n.extend(document, {
$J_TYPE: "document"
}),
n.extend(window, {
$J_TYPE: "window"
}),
n.extend([n.Element, n.Doc], {
jFetch: function(t, i) {
var u = n.getStorage(this.$J_UUID),
r = u[t];
return undefined !== i && undefined === r && (r = u[t] = i),
n.defined(r) ? r: null
},
jStore: function(t, i) {
var r = n.getStorage(this.$J_UUID);
return r[t] = i,
this
},
jDel: function(t) {
var i = n.getStorage(this.$J_UUID);
return delete i[t],
this
}
}),
window.HTMLElement && window.HTMLElement.prototype && window.HTMLElement.prototype.getElementsByClassName || n.extend([n.Element, n.Doc], {
getElementsByClassName: function(t) {
return n.$A(this.getElementsByTagName("*")).filter(function(n) {
try {
return 1 == n.nodeType && n.className.has(t, " ")
} catch(i) {}
})
}
}),
n.extend([n.Element, n.Doc], {
byClass: function() {
return this.getElementsByClassName(arguments[0])
},
byTag: function() {
return this.getElementsByTagName(arguments[0])
}
}),
n.browser.fullScreen.capable && !document.requestFullScreen && (n.Element.requestFullScreen = function() {
n.browser.fullScreen.request(this)
}),
n.Event = {
$J_TYPE: "event",
isQueueStopped: n.$false,
stop: function() {
return this.stopDistribution().stopDefaults()
},
stopDistribution: function() {
return this.stopPropagation ? this.stopPropagation() : this.cancelBubble = !0,
this
},
stopDefaults: function() {
return this.preventDefault ? this.preventDefault() : this.returnValue = !1,
this
},
stopQueue: function() {
return this.isQueueStopped = n.$true,
this
},
getClientXY: function() {
var t = /touch/i.test(this.type) ? this.changedTouches[0] : this;
return n.defined(t) ? {
x: t.clientX,
y: t.clientY
}: {
x: 0,
y: 0
}
},
jGetPageXY: function() {
var t = /touch/i.test(this.type) ? this.changedTouches[0] : this;
return n.defined(t) ? {
x: t.pageX || t.clientX + n.browser.getDoc().scrollLeft,
y: t.pageY || t.clientY + n.browser.getDoc().scrollTop
}: {
x: 0,
y: 0
}
},
getTarget: function() {
for (var n = this.target || this.srcElement; n && n.nodeType === 3;) n = n.parentNode;
return n
},
getRelated: function() {
var n = null;
switch (this.type) {
case "mouseover":
case "pointerover":
case "MSPointerOver":
n = this.relatedTarget || this.fromElement;
break;
case "mouseout":
case "pointerout":
case "MSPointerOut":
n = this.relatedTarget || this.toElement;
break;
default:
return n
}
try {
while (n && n.nodeType === 3) n = n.parentNode
} catch(t) {
n = null
}
return n
},
getButton: function() {
return ! this.which && this.button !== undefined ? this.button & 1 ? 1 : this.button & 2 ? 3 : this.button & 4 ? 2 : 0 : this.which
},
isTouchEvent: function() {
return this.pointerType && (this.pointerType === "touch" || this.pointerType === this.MSPOINTER_TYPE_TOUCH) || /touch/i.test(this.type)
},
isPrimaryTouch: function() {
return this.pointerType ? (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) && this.isPrimary: this instanceof window.TouchEvent ? this.changedTouches.length === 1 && (this.targetTouches.length ? this.targetTouches.length === 1 && this.targetTouches[0].identifier === this.changedTouches[0].identifier: !0) : !1
},
getPrimaryTouch: function() {
return this.pointerType ? this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this: null: this instanceof window.TouchEvent ? this.changedTouches[0] : null
},
getPrimaryTouchId: function() {
return this.pointerType ? this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this.pointerId: null: this instanceof window.TouchEvent ? this.changedTouches[0].identifier: null
}
},
n._event_add_ = "addEventListener",
n._event_del_ = "removeEventListener",
n._event_prefix_ = "",
document.addEventListener || (n._event_add_ = "attachEvent", n._event_del_ = "detachEvent", n._event_prefix_ = "on"),
n.Event.Custom = {
type: "",
x: null,
y: null,
timeStamp: null,
button: null,
target: null,
relatedTarget: null,
$J_TYPE: "event.custom",
isQueueStopped: n.$false,
events: n.$([]),
pushToEvents: function(n) {
var t = n;
this.events.push(t)
},
stop: function() {
return this.stopDistribution().stopDefaults()
},
stopDistribution: function() {
return this.events.jEach(function(n) {
try {
n.stopDistribution()
} catch(t) {}
}),
this
},
stopDefaults: function() {
return this.events.jEach(function(n) {
try {
n.stopDefaults()
} catch(t) {}
}),
this
},
stopQueue: function() {
return this.isQueueStopped = n.$true,
this
},
getClientXY: function() {
return {
x: this.clientX,
y: this.clientY
}
},
jGetPageXY: function() {
return {
x: this.x,
y: this.y
}
},
getTarget: function() {
return this.target
},
getRelated: function() {
return this.relatedTarget
},
getButton: function() {
return this.button
},
getOriginalTarget: function() {
return this.events.length > 0 ? this.events[0].getTarget() : undefined
},
isTouchEvent: function() {
return this.pointerType && (this.pointerType === "touch" || this.pointerType === this.MSPOINTER_TYPE_TOUCH) || /touch/i.test(this.type)
},
isPrimaryTouch: function() {
return this.pointerType ? (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) && this.isPrimary: this instanceof window.TouchEvent ? this.changedTouches.length === 1 && (this.targetTouches.length ? this.targetTouches[0].identifier === this.changedTouches[0].identifier: !0) : !1
},
getPrimaryTouch: function() {
return this.pointerType ? this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this: null: this instanceof window.TouchEvent ? this.changedTouches[0] : null
},
getPrimaryTouchId: function() {
return this.pointerType ? this.isPrimary && (this.pointerType === "touch" || this.MSPOINTER_TYPE_TOUCH === this.pointerType) ? this.pointerId: null: this instanceof window.TouchEvent ? this.changedTouches[0].identifier: null
}
},
n.extend([n.Element, n.Doc], {
jAddEvent: function(t, i, r, u) {
var o, e, h, c, s;
return (n.jTypeOf(t) === "string" && (s = t.split(" "), s.length > 1 && (t = s)), n.jTypeOf(t) === "array") ? (n.$(t).jEach(this.jAddEvent.jBindAsEvent(this, i, r, u)), this) : (t = f[t] || t, !t || !i || n.jTypeOf(t) !== "string" || n.jTypeOf(i) !== "function") ? this: t === "domready" && n.browser.ready ? (i.call(this), this) : (r = parseInt(r || 50, 10), i.$J_EUID || (i.$J_EUID = Math.floor(Math.random() * n.now())), o = n.Doc.jFetch.call(this, "_EVENTS_", {}), e = o[t], e || (o[t] = e = n.$([]), h = this, n.Event.Custom[t] ? n.Event.Custom[t].handler.add.call(this, u) : (e.handle = function(i) {
i = n.extend(i || window.e, {
$J_TYPE: "event"
});
n.Doc.jCallEvent.call(h, t, n.$(i))
},
this[n._event_add_](n._event_prefix_ + t, e.handle, !1))), c = {
type: t,
fn: i,
priority: r,
euid: i.$J_EUID
},
e.push(c), e.sort(function(n, t) {
return n.priority - t.priority
}), this)
},
jRemoveEvent: function(t) {
var e = n.Doc.jFetch.call(this, "_EVENTS_", {}),
i,
s,
r,
h,
u,
o;
if (u = arguments.length > 1 ? arguments[1] : -100, n.jTypeOf(t) === "string" && (o = t.split(" "), o.length > 1 && (t = o)), n.jTypeOf(t) === "array") return n.$(t).jEach(this.jRemoveEvent.jBindAsEvent(this, u)),
this;
if (t = f[t] || t, !t || n.jTypeOf(t) !== "string" || !e || !e[t]) return this;
for (i = e[t] || [], r = 0; r < i.length; r++) s = i[r],
u !== -100 && (!u || u.$J_EUID !== s.euid) || (h = i.splice(r--, 1));
return i.length === 0 && (n.Event.Custom[t] ? n.Event.Custom[t].handler.jRemove.call(this) : this[n._event_del_](n._event_prefix_ + t, i.handle, !1), delete e[t]),
this
},
jCallEvent: function(t, i) {
var u = n.Doc.jFetch.call(this, "_EVENTS_", {}),
e,
r;
if (t = f[t] || t, !t || n.jTypeOf(t) !== "string" || !u || !u[t]) return this;
try {
i = n.extend(i || {},
{
type: t
})
} catch(o) {}
for (i.timeStamp === undefined && (i.timeStamp = n.now()), e = u[t] || [], r = 0; r < e.length && !(i.isQueueStopped && i.isQueueStopped()); r++) e[r].fn.call(this, i)
},
jRaiseEvent: function(t, i) {
var e = t !== "domready",
u = this,
r;
return (t = f[t] || t, !e) ? (n.Doc.jCallEvent.call(this, t), this) : (u === document && document.createEvent && !u.dispatchEvent && (u = document.documentElement), document.createEvent ? (r = document.createEvent(t), r.initEvent(i, !0, !0)) : (r = document.createEventObject(), r.eventType = t), document.createEvent ? u.dispatchEvent(r) : u.fireEvent("on" + i, r), r)
},
jClearEvents: function() {
var t = n.Doc.jFetch.call(this, "_EVENTS_"),
i;
if (!t) return this;
for (i in t) n.Doc.jRemoveEvent.call(this, i);
return n.Doc.jDel.call(this, "_EVENTS_"),
this
}
}),
function(n) {
if (document.readyState === "complete") return n.browser.onready.jDelay(1);
n.browser.webkit && n.browser.version < 420 ?
function() {
n.$(["loaded", "complete"]).contains(document.readyState) ? n.browser.onready() : arguments.callee.jDelay(50)
} () : n.browser.trident && n.browser.ieMode < 9 && window === top ?
function() {
n.$try(function() {
return n.browser.getDoc().doScroll("left"),
!0
}) ? n.browser.onready() : arguments.callee.jDelay(50)
} () : (n.Doc.jAddEvent.call(n.$(document), "DOMContentLoaded", n.browser.onready), n.Doc.jAddEvent.call(n.$(window), "load", n.browser.onready))
} (t),
n.Class = function() {
var i = null,
r = n.$A(arguments),
t,
u,
f;
if ("class" == n.jTypeOf(r[0]) && (i = r.shift()), t = function() {
var r, u, t, i, f;
for (r in this) this[r] = n.detach(this[r]);
if (this.constructor.$parent) {
this.$parent = {};
u = this.constructor.$parent;
for (t in u) {
i = u[t];
switch (n.jTypeOf(i)) {
case "function":
this.$parent[t] = n.Class.wrap(this, i);
break;
case "object":
this.$parent[t] = n.detach(i);
break;
case "array":
this.$parent[t] = n.detach(i)
}
}
}
return f = this.init ? this.init.apply(this, arguments) : this,
delete this.caller,
f
},
t.prototype.init || (t.prototype.init = n.$F), i) {
u = function() {};
u.prototype = i.prototype;
t.prototype = new u;
t.$parent = {};
for (f in i.prototype) t.$parent[f] = i.prototype[f]
} else t.$parent = null;
return t.constructor = n.Class,
t.prototype.constructor = t,
n.extend(t.prototype, r[0]),
n.extend(t, {
$J_TYPE: "class"
}),
t
},
t.Class.wrap = function(n, t) {
return function() {
var i = this.caller;
return t.apply(n, arguments)
}
},
function(n) {
var i = n.$,
t = 5;
n.Event.Custom.btnclick = new n.Class(n.extend(n.Event.Custom, {
type: "btnclick",
init: function(n, t) {
var i = t.jGetPageXY();
this.x = i.x;
this.y = i.y;
this.clientX = t.clientX;
this.clientY = t.clientY;
this.timeStamp = t.timeStamp;
this.button = t.getButton();
this.target = n;
this.pushToEvents(t)
}
}));
n.Event.Custom.btnclick.handler = {
options: {
threshold: 300,
button: 1
},
add: function(t) {
this.jStore("event:btnclick:options", n.extend(n.detach(n.Event.Custom.btnclick.handler.options), t || {}));
this.jAddEvent("mousedown", n.Event.Custom.btnclick.handler.handle, 1);
this.jAddEvent("mouseup", n.Event.Custom.btnclick.handler.handle, 1);
this.jAddEvent("click", n.Event.Custom.btnclick.handler.onclick, 1);
n.browser.trident && n.browser.ieMode < 9 && this.jAddEvent("dblclick", n.Event.Custom.btnclick.handler.handle, 1)
},
jRemove: function() {
this.jRemoveEvent("mousedown", n.Event.Custom.btnclick.handler.handle);
this.jRemoveEvent("mouseup", n.Event.Custom.btnclick.handler.handle);
this.jRemoveEvent("click", n.Event.Custom.btnclick.handler.onclick);
n.browser.trident && n.browser.ieMode < 9 && this.jRemoveEvent("dblclick", n.Event.Custom.btnclick.handler.handle)
},
onclick: function(n) {
n.stopDefaults()
},
handle: function(i) {
var r, u, f;
if (u = this.jFetch("event:btnclick:options"), i.type == "dblclick" || i.getButton() == u.button) {
if (this.jFetch("event:btnclick:ignore")) {
this.jDel("event:btnclick:ignore");
return
}
if ("mousedown" == i.type) r = new n.Event.Custom.btnclick(this, i),
this.jStore("event:btnclick:btnclickEvent", r);
else if ("mouseup" == i.type) {
if (r = this.jFetch("event:btnclick:btnclickEvent"), !r) return;
f = i.jGetPageXY();
this.jDel("event:btnclick:btnclickEvent");
r.pushToEvents(i);
i.timeStamp - r.timeStamp <= u.threshold && Math.sqrt(Math.pow(f.x - r.x, 2) + Math.pow(f.y - r.y, 2)) <= t && this.jCallEvent("btnclick", r);
document.jCallEvent("mouseup", i)
} else i.type == "dblclick" && (r = new n.Event.Custom.btnclick(this, i), this.jCallEvent("btnclick", r))
}
}
}
} (t),
function(n) {
var t = n.$;
n.Event.Custom.mousedrag = new n.Class(n.extend(n.Event.Custom, {
type: "mousedrag",
state: "dragstart",
dragged: !1,
init: function(n, t, i) {
var r = t.jGetPageXY();
this.x = r.x;
this.y = r.y;
this.clientX = t.clientX;
this.clientY = t.clientY;
this.timeStamp = t.timeStamp;
this.button = t.getButton();
this.target = n;
this.pushToEvents(t);
this.state = i
}
}));
n.Event.Custom.mousedrag.handler = {
add: function() {
var t = n.Event.Custom.mousedrag.handler.handleMouseMove.jBindAsEvent(this),
i = n.Event.Custom.mousedrag.handler.handleMouseUp.jBindAsEvent(this);
this.jAddEvent("mousedown", n.Event.Custom.mousedrag.handler.handleMouseDown, 1);
this.jAddEvent("mouseup", n.Event.Custom.mousedrag.handler.handleMouseUp, 1);
document.jAddEvent("mousemove", t, 1);
document.jAddEvent("mouseup", i, 1);
this.jStore("event:mousedrag:listeners:document:move", t);
this.jStore("event:mousedrag:listeners:document:end", i)
},
jRemove: function() {
this.jRemoveEvent("mousedown", n.Event.Custom.mousedrag.handler.handleMouseDown);
this.jRemoveEvent("mouseup", n.Event.Custom.mousedrag.handler.handleMouseUp);
t(document).jRemoveEvent("mousemove", this.jFetch("event:mousedrag:listeners:document:move") || n.$F);
t(document).jRemoveEvent("mouseup", this.jFetch("event:mousedrag:listeners:document:end") || n.$F);
this.jDel("event:mousedrag:listeners:document:move");
this.jDel("event:mousedrag:listeners:document:end")
},
handleMouseDown: function(t) {
var i;
t.getButton() === 1 && (i = new n.Event.Custom.mousedrag(this, t, "dragstart"), this.jStore("event:mousedrag:dragstart", i))
},
handleMouseUp: function(t) {
var i; (i = this.jFetch("event:mousedrag:dragstart"), i) && (i.dragged && t.stopDefaults(), i = new n.Event.Custom.mousedrag(this, t, "dragend"), this.jDel("event:mousedrag:dragstart"), this.jCallEvent("mousedrag", i))
},
handleMouseMove: function(t) {
var i; (i = this.jFetch("event:mousedrag:dragstart"), i) && (t.stopDefaults(), i.dragged || (i.dragged = !0, this.jCallEvent("mousedrag", i)), i = new n.Event.Custom.mousedrag(this, t, "dragmove"), this.jCallEvent("mousedrag", i))
}
}
} (t),
function(n) {
var t = n.$;
n.Event.Custom.dblbtnclick = new n.Class(n.extend(n.Event.Custom, {
type: "dblbtnclick",
timedout: !1,
tm: null,
init: function(n, t) {
var i = t.jGetPageXY();
this.x = i.x;
this.y = i.y;
this.clientX = t.clientX;
this.clientY = t.clientY;
this.timeStamp = t.timeStamp;
this.button = t.getButton();
this.target = n;
this.pushToEvents(t)
}
}));
n.Event.Custom.dblbtnclick.handler = {
options: {
threshold: 200
},
add: function(t) {
this.jStore("event:dblbtnclick:options", n.extend(n.detach(n.Event.Custom.dblbtnclick.handler.options), t || {}));
this.jAddEvent("btnclick", n.Event.Custom.dblbtnclick.handler.handle, 1)
},
jRemove: function() {
this.jRemoveEvent("btnclick", n.Event.Custom.dblbtnclick.handler.handle)
},
handle: function(t) {
var i, r;
i = this.jFetch("event:dblbtnclick:event");
r = this.jFetch("event:dblbtnclick:options");
i ? (clearTimeout(i.tm), this.jDel("event:dblbtnclick:event"), i.timedout || (i.pushToEvents(t), t.stopQueue().stop(), this.jCallEvent("dblbtnclick", i))) : (i = new n.Event.Custom.dblbtnclick(this, t), i.tm = setTimeout(function() {
i.timedout = !0;
t.isQueueStopped = n.$false;
this.jCallEvent("btnclick", t);
this.jDel("event:dblbtnclick:event")
}.jBind(this), r.threshold + 10), this.jStore("event:dblbtnclick:event", i), t.stopQueue())
}
}
} (t),
function(n) {
var r = n.$,
t = 10,
i = 200;
n.Event.Custom.tap = new n.Class(n.extend(n.Event.Custom, {
type: "tap",
id: null,
init: function(n, t) {
var i = t.getPrimaryTouch();
this.id = i.pointerId || i.identifier;
this.x = i.pageX;
this.y = i.pageY;
this.pageX = i.pageX;
this.pageY = i.pageY;
this.clientX = i.clientX;
this.clientY = i.clientY;
this.timeStamp = t.timeStamp;
this.button = 0;
this.target = n;
this.pushToEvents(t)
}
}));
n.Event.Custom.tap.handler = {
add: function() {
this.jAddEvent(["touchstart", "pointerdown"], n.Event.Custom.tap.handler.onTouchStart, 1);
this.jAddEvent(["touchend", "pointerup"], n.Event.Custom.tap.handler.onTouchEnd, 1);
this.jAddEvent("click", n.Event.Custom.tap.handler.onClick, 1)
},
jRemove: function() {
this.jRemoveEvent(["touchstart", "pointerdown"], n.Event.Custom.tap.handler.onTouchStart);
this.jRemoveEvent(["touchend", "pointerup"], n.Event.Custom.tap.handler.onTouchEnd);
this.jRemoveEvent("click", n.Event.Custom.tap.handler.onClick)
},
onClick: function(n) {
n.stopDefaults()
},
onTouchStart: function(t) {
if (!t.isPrimaryTouch()) {
this.jDel("event:tap:event");
return
}
this.jStore("event:tap:event", new n.Event.Custom.tap(this, t));
this.jStore("event:btnclick:ignore", !0)
},
onTouchEnd: function(r) {
var f = n.now(),
u = this.jFetch("event:tap:event"),
e = this.jFetch("event:tap:options");
u && r.isPrimaryTouch() && (this.jDel("event:tap:event"), u.id === r.getPrimaryTouchId() && r.timeStamp - u.timeStamp <= i && Math.sqrt(Math.pow(r.getPrimaryTouch().pageX - u.x, 2) + Math.pow(r.getPrimaryTouch().pageY - u.y, 2)) <= t && (this.jDel("event:btnclick:btnclickEvent"), r.stop(), u.pushToEvents(r), this.jCallEvent("tap", u)))
}
}
} (t),
n.Event.Custom.dbltap = new n.Class(n.extend(n.Event.Custom, {
type: "dbltap",
timedout: !1,
tm: null,
init: function(n, t) {
this.x = t.x;
this.y = t.y;
this.clientX = t.clientX;
this.clientY = t.clientY;
this.timeStamp = t.timeStamp;
this.button = 0;
this.target = n;
this.pushToEvents(t)
}
})),
n.Event.Custom.dbltap.handler = {
options: {
threshold: 300
},
add: function(t) {
this.jStore("event:dbltap:options", n.extend(n.detach(n.Event.Custom.dbltap.handler.options), t || {}));
this.jAddEvent("tap", n.Event.Custom.dbltap.handler.handle, 1)
},
jRemove: function() {
this.jRemoveEvent("tap", n.Event.Custom.dbltap.handler.handle)
},
handle: function(t) {
var i, r;
i = this.jFetch("event:dbltap:event");
r = this.jFetch("event:dbltap:options");
i ? (clearTimeout(i.tm), this.jDel("event:dbltap:event"), i.timedout || (i.pushToEvents(t), t.stopQueue().stop(), this.jCallEvent("dbltap", i))) : (i = new n.Event.Custom.dbltap(this, t), i.tm = setTimeout(function() {
i.timedout = !0;
t.isQueueStopped = n.$false;
this.jCallEvent("tap", t)
}.jBind(this), r.threshold + 10), this.jStore("event:dbltap:event", i), t.stopQueue())
}
},
function(n) {
var t = n.$,
i = 10;
n.Event.Custom.touchdrag = new n.Class(n.extend(n.Event.Custom, {
type: "touchdrag",
state: "dragstart",
id: null,
dragged: !1,
init: function(n, t, i) {
var r = t.getPrimaryTouch();
this.id = r.pointerId || r.identifier;
this.clientX = r.clientX;
this.clientY = r.clientY;
this.pageX = r.pageX;
this.pageY = r.pageY;
this.x = r.pageX;
this.y = r.pageY;
this.timeStamp = t.timeStamp;
this.button = 0;
this.target = n;
this.pushToEvents(t);
this.state = i
}
}));
n.Event.Custom.touchdrag.handler = {
add: function() {
var i = n.Event.Custom.touchdrag.handler.onTouchMove.jBind(this),
r = n.Event.Custom.touchdrag.handler.onTouchEnd.jBind(this);
this.jAddEvent(["touchstart", "pointerdown"], n.Event.Custom.touchdrag.handler.onTouchStart, 1);
this.jAddEvent(["touchend", "pointerup"], n.Event.Custom.touchdrag.handler.onTouchEnd, 1);
this.jAddEvent(["touchmove", "pointermove"], n.Event.Custom.touchdrag.handler.onTouchMove, 1);
this.jStore("event:touchdrag:listeners:document:move", i);
this.jStore("event:touchdrag:listeners:document:end", r);
t(document).jAddEvent("pointermove", i, 1);
t(document).jAddEvent("pointerup", r, 1)
},
jRemove: function() {
this.jRemoveEvent(["touchstart", "pointerdown"], n.Event.Custom.touchdrag.handler.onTouchStart);
this.jRemoveEvent(["touchend", "pointerup"], n.Event.Custom.touchdrag.handler.onTouchEnd);
this.jRemoveEvent(["touchmove", "pointermove"], n.Event.Custom.touchdrag.handler.onTouchMove);
t(document).jRemoveEvent("pointermove", this.jFetch("event:touchdrag:listeners:document:move") || n.$F, 1);
t(document).jRemoveEvent("pointerup", this.jFetch("event:touchdrag:listeners:document:end") || n.$F, 1);
this.jDel("event:touchdrag:listeners:document:move");
this.jDel("event:touchdrag:listeners:document:end")
},
onTouchStart: function(t) {
var i;
t.isPrimaryTouch() && (i = new n.Event.Custom.touchdrag(this, t, "dragstart"), this.jStore("event:touchdrag:dragstart", i))
},
onTouchEnd: function(t) {
var i; (i = this.jFetch("event:touchdrag:dragstart"), i && i.dragged && i.id === t.getPrimaryTouchId()) && (i = new n.Event.Custom.touchdrag(this, t, "dragend"), this.jDel("event:touchdrag:dragstart"), this.jCallEvent("touchdrag", i))
},
onTouchMove: function(t) {
var r;
if (r = this.jFetch("event:touchdrag:dragstart"), r && t.isPrimaryTouch()) {
if (r.id !== t.getPrimaryTouchId()) {
this.jDel("event:touchdrag:dragstart");
return
} (!r.dragged && Math.sqrt(Math.pow(t.getPrimaryTouch().pageX - r.x, 2) + Math.pow(t.getPrimaryTouch().pageY - r.y, 2)) > i && (r.dragged = !0, this.jCallEvent("touchdrag", r)), r.dragged) && (r = new n.Event.Custom.touchdrag(this, t, "dragmove"), this.jCallEvent("touchdrag", r))
}
}
}
} (t),
function(n) {
function e(n, t) {
var i = t.x - n.x,
r = t.y - n.y;
return Math.sqrt(i * i + r * r)
}
function h(n, t) {
var i = Array.prototype.slice.call(n),
u = Math.abs(i[1].pageX - i[0].pageX),
f = Math.abs(i[1].pageY - i[0].pageY),
o = Math.min(i[1].pageX, i[0].pageX) + u / 2,
s = Math.min(i[1].pageY, i[0].pageY) + f / 2,
r = 0;
return t.points = [i[0], i[1]],
r = Math.pow(e({
x: i[0].pageX,
y: i[0].pageY
},
{
x: i[1].pageX,
y: i[1].pageY
}), 2),
t.centerPoint = {
x: o,
y: s
},
t.x = t.centerPoint.x,
t.y = t.centerPoint.y,
r
}
function c(n) {
return n / i
}
function r(n, t) {
var i;
return n.targetTouches && n.changedTouches ? (i = n.targetTouches ? n.targetTouches: n.changedTouches, i = Array.prototype.slice.call(i)) : (i = [], t && t.forEach(function(n) {
i.push(n)
})),
i
}
function o(n, t, i) {
var r = !1;
return n.pointerId && n.pointerType === "touch" && (!i || t.has(n.pointerId)) && (t.set(n.pointerId, n), r = !0),
r
}
function l(n, t) {
n.pointerId && n.pointerType === "touch" && t && t.has(n.pointerId) && t["delete"](n.pointerId)
}
function u(n) {
return n.pointerId && n.pointerType === "touch" ? n.pointerId: n.identifier
}
function s(n, t) {
for (var r, f = !1,
i = 0; i < n.length; i++) if (t.length === 2) break;
else r = u(n[i]),
t.contains(r) || (t.push(r), f = !0);
return f
}
function a(n) {
var i = t([]);
return n.forEach(function(n) {
i.push(u(n))
}),
i
}
function v(n, t) {
var i, r, u = !1;
if (t) for (r = a(n), i = 0; i < t.length; i++) if (!r.contains(t[i])) {
t.splice(i, 1);
u = !0;
break
}
return u
}
function f(n, i) {
for (var f = t([]), r = 0; r < n.length; r++) if (i.contains(u(n[r])) && (f.push(n[r]), f.length === 2)) break;
return f
}
var t = n.$,
i = null;
n.Event.Custom.pinch = new n.Class(n.extend(n.Event.Custom, {
type: "pinch",
state: "pinchstart",
init: function(n, t, i, r) {
this.target = n;
this.state = i;
this.x = r.x;
this.y = r.y;
this.timeStamp = t.timeStamp;
this.scale = r.scale;
this.space = r.space;
this.zoom = r.zoom;
this.state = i;
this.centerPoint = r.centerPoint;
this.points = r.points;
this.pushToEvents(t)
}
}));
n.Event.Custom.pinch.handler = {
variables: {
x: 0,
y: 0,
space: 0,
scale: 1,
zoom: 0,
startSpace: 0,
startScale: 1,
started: !1,
dragged: !1,
points: [],
centerPoint: {
x: 0,
y: 0
}
},
add: function() {
i || (i = function() {
var n = t(window).jGetSize();
return n.width = Math.min(n.width, n.height),
n.height = n.width,
Math.pow(e({
x: 0,
y: 0
},
{
x: n.width,
y: n.height
}), 2)
} ());
var r = n.Event.Custom.pinch.handler.onTouchMove.jBind(this),
u = n.Event.Custom.pinch.handler.onTouchEnd.jBind(this);
this.jAddEvent(["click", "tap"], n.Event.Custom.pinch.handler.onClick, 1);
this.jAddEvent(["touchstart", "pointerdown"], n.Event.Custom.pinch.handler.onTouchStart, 1);
this.jAddEvent(["touchend", "pointerup"], n.Event.Custom.pinch.handler.onTouchEnd, 1);
this.jAddEvent(["touchmove", "pointermove"], n.Event.Custom.pinch.handler.onTouchMove, 1);
this.jStore("event:pinch:listeners:touchmove", r);
this.jStore("event:pinch:listeners:touchend", u);
n.doc.jAddEvent("pointermove", r, 1);
n.doc.jAddEvent("pointerup", u, 1)
},
jRemove: function() {
this.jRemoveEvent(["click", "tap"], n.Event.Custom.pinch.handler.onClick);
this.jRemoveEvent(["touchstart", "pointerdown"], n.Event.Custom.pinch.handler.onTouchStart);
this.jRemoveEvent(["touchend", "pointerup"], n.Event.Custom.pinch.handler.onTouchEnd);
this.jRemoveEvent(["touchmove", "pointermove"], n.Event.Custom.pinch.handler.onTouchMove);
n.doc.jRemoveEvent("pointermove", this.jFetch("event:pinch:listeners:touchmove"));
n.doc.jRemoveEvent("pointerup", this.jFetch("event:pinch:listeners:touchend"));
this.jDel("event:pinch:listeners:touchmove");
this.jDel("event:pinch:listeners:touchend");
this.jDel("event:pinch:pinchstart");
this.jDel("event:pinch:variables");
this.jDel("event:pinch:activepoints");
var t = this.jFetch("event:pinch:cache");
t && t.clear();
this.jDel("event:pinch:cache")
},
onClick: function(n) {
n.stop()
},
setVariables: function(n, t) {
var i = t.space;
n.length > 1 ? (t.space = h(n, t), t.startSpace || (t.startSpace = t.space), t.zoom = i > t.space ? -1 : i < t.space ? 1 : 0, t.scale = c(t.space)) : t.points = Array.prototype.slice.call(n, 0, 2)
},
onTouchMove: function(t) {
var u, e = this.jFetch("event:pinch:cache"),
i = this.jFetch("event:pinch:variables") || n.extend({},
n.Event.Custom.pinch.handler.variables),
s = this.jFetch("event:pinch:activepoints");
if (i.started) {
if (t.pointerId && !o(t, e, !0)) return;
t.stop();
n.Event.Custom.pinch.handler.setVariables(f(r(t, e), s), i);
u = new n.Event.Custom.pinch(this, t, "pinchmove", i);
this.jCallEvent("pinch", u)
}
},
onTouchStart: function(u) {
var c, e, a, l = this.jFetch("event:pinch:cache"),
h = this.jFetch("event:pinch:activepoints");
u.pointerType !== "mouse" && (h || (h = t([]), this.jStore("event:pinch:activepoints", h)), h.length || t(u.target).jAddEvent(["touchend", "pointerup"], this.jFetch("event:pinch:listeners:touchend"), 1), l || (l = new Map, this.jStore("event:pinch:cache", l)), o(u, l), a = r(u, l), s(a, h), a.length === 2 && (c = this.jFetch("event:pinch:pinchstart"), e = this.jFetch("event:pinch:variables") || n.extend({},
n.Event.Custom.pinch.handler.variables), n.Event.Custom.pinch.handler.setVariables(f(a, h), e), c || (c = new n.Event.Custom.pinch(this, u, "pinchstart", e), this.jStore("event:pinch:pinchstart", c), this.jStore("event:pinch:variables", e), i = e.space, this.jCallEvent("pinch", c), e.started = !0)))
},
onTouchEnd: function(t) {
var u, h, e, c, i = this.jFetch("event:pinch:cache"),
o,
a;
t.pointerType !== "mouse" && (!t.pointerId || i && i.has(t.pointerId)) && (h = this.jFetch("event:pinch:pinchstart"), e = this.jFetch("event:pinch:variables"), o = this.jFetch("event:pinch:activepoints"), u = r(t, i), l(t, i), a = v(u, o), h && e && e.started && a && o) && (a && s(u, o), c = "pinchend", u.length > 1 ? c = "pinchresize": (t.target.jRemoveEvent(["touchend", "pointerup"], this.jFetch("event:pinch:listeners:touchend")), i && i.clear(), this.jDel("event:pinch:pinchstart"), this.jDel("event:pinch:variables"), this.jDel("event:pinch:cache"), this.jDel("event:pinch:activepoints")), n.Event.Custom.pinch.handler.setVariables(f(u, o), e), h = new n.Event.Custom.pinch(this, t, c, e), this.jCallEvent("pinch", h))
}
}
} (t),
function(n) {
function r() {
t = null
}
function u(t, i) {
return t > 50 || 1 === i && !("win" == n.browser.platform && t < 1) || 0 == t % 12 || 0 == t % 4.000244140625
}
var f = n.$,
t, i;
n.Event.Custom.mousescroll = new n.Class(n.extend(n.Event.Custom, {
type: "mousescroll",
init: function(n, t, i, r, u, f, e) {
var o = t.jGetPageXY();
this.x = o.x;
this.y = o.y;
this.timeStamp = t.timeStamp;
this.target = n;
this.delta = i || 0;
this.deltaX = r || 0;
this.deltaY = u || 0;
this.deltaZ = f || 0;
this.deltaFactor = e || 0;
this.deltaMode = t.deltaMode || 0;
this.isMouse = !1;
this.pushToEvents(t)
}
}));
n.Event.Custom.mousescroll.handler = {
eventType: "onwheel" in document || n.browser.ieMode > 8 ? "wheel": "mousewheel",
add: function() {
this.jAddEvent(n.Event.Custom.mousescroll.handler.eventType, n.Event.Custom.mousescroll.handler.handle, 1)
},
jRemove: function() {
this.jRemoveEvent(n.Event.Custom.mousescroll.handler.eventType, n.Event.Custom.mousescroll.handler.handle, 1)
},
handle: function(f) {
var s = 0,
o = 0,
e = 0,
c = 0,
h, l; (f.detail && (e = f.detail * -1), f.wheelDelta !== undefined && (e = f.wheelDelta), f.wheelDeltaY !== undefined && (e = f.wheelDeltaY), f.wheelDeltaX !== undefined && (o = f.wheelDeltaX * -1), f.deltaY && (e = -1 * f.deltaY), f.deltaX && (o = f.deltaX), 0 !== e || 0 !== o) && (s = 0 === e ? o: e, c = Math.max(Math.abs(e), Math.abs(o)), (!t || c < t) && (t = c), h = s > 0 ? "floor": "ceil", s = Math[h](s / t), o = Math[h](o / t), e = Math[h](e / t), i && clearTimeout(i), i = setTimeout(r, 200), l = new n.Event.Custom.mousescroll(this, f, s, o, e, 0, t), l.isMouse = u(t, f.deltaMode || 0), this.jCallEvent("mousescroll", l))
}
}
} (t),
n.win = n.$(window),
n.doc = n.$(document),
t
} (),
function(n) {
if (!n) throw "MagicJS not found";
var t = n.$,
r = window.URL || window.webkitURL || null;
i.ImageLoader = new n.Class({
img: null,
ready: !1,
options: {
onprogress: n.$F,
onload: n.$F,
onabort: n.$F,
onerror: n.$F,
oncomplete: n.$F,
onxhrerror: n.$F,
xhr: !1,
progressiveLoad: !0
},
size: null,
_timer: null,
loadedBytes: 0,
_handlers: {
onprogress: function(n) {
n.target && (200 === n.target.status || 304 === n.target.status) && n.lengthComputable && (this.options.onprogress.jBind(null, (n.loaded - (this.options.progressiveLoad ? this.loadedBytes: 0)) / n.total).jDelay(1), this.loadedBytes = n.loaded)
},
onload: function(n) { (n && t(n).stop(), this._unbind(), this.ready) || (this.ready = !0, this._cleanup(), this.options.xhr || this.options.onprogress.jBind(null, 1).jDelay(1), this.options.onload.jBind(null, this).jDelay(1), this.options.oncomplete.jBind(null, this).jDelay(1))
},
onabort: function(n) {
n && t(n).stop();
this._unbind();
this.ready = !1;
this._cleanup();
this.options.onabort.jBind(null, this).jDelay(1);
this.options.oncomplete.jBind(null, this).jDelay(1)
},
onerror: function(n) {
n && t(n).stop();
this._unbind();
this.ready = !1;
this._cleanup();
this.options.onerror.jBind(null, this).jDelay(1);
this.options.oncomplete.jBind(null, this).jDelay(1)
}
},
_bind: function() {
t(["load", "abort", "error"]).jEach(function(n) {
this.img.jAddEvent(n, this._handlers["on" + n].jBindAsEvent(this).jDefer(1))
},
this)
},
_unbind: function() {
if (this._timer) {
try {
clearTimeout(this._timer)
} catch(n) {}
this._timer = null
}
t(["load", "abort", "error"]).jEach(function(n) {
this.img.jRemoveEvent(n)
},
this)
},
_cleanup: function() {
if (this.jGetSize(), this.img.jFetch("new")) {
var n = this.img.parentNode;
this.img.jRemove().jDel("new").jSetCss({
position: "static",
top: "auto"
});
n.kill()
}
},
loadBlob: function(i) {
var u = new XMLHttpRequest,
f;
t(["abort", "progress"]).jEach(function(n) {
u["on" + n] = t(function(t) {
this._handlers["on" + n].call(this, t)
}).jBind(this)
},
this);
u.onerror = t(function() {
this.options.onxhrerror.jBind(null, this).jDelay(1);
this.options.xhr = !1;
this._bind();
this.img.src = i
}).jBind(this);
u.onload = t(function() {
if (200 !== u.status && 304 !== u.status) {
this._handlers.onerror.call(this);
return
}
f = u.response;
this._bind(); ! r || n.browser.trident || "ios" === n.browser.platform && n.browser.version < 537 ? this.img.src = i: this.img.setAttribute("src", r.createObjectURL(f))
}).jBind(this);
u.open("GET", i);
u.responseType = "blob";
u.send()
},
init: function(i, r) {
if (this.options = n.extend(this.options, r), this.img = t(i) || n.$new("img", {},
{
"max-width": "none",
"max-height": "none"
}).jAppendTo(n.$new("div").jAddClass("magic-temporary-img").jSetCss({
position: "absolute",
top: -1e4,
width: 10,
height: 10,
overflow: "hidden"
}).jAppendTo(document.body)).jStore("new", !0), n.browser.features.xhr2 && this.options.xhr && "string" == n.jTypeOf(i)) {
this.loadBlob(i);
return
}
var u = function() {
this.isReady() ? this._handlers.onload.call(this) : this._handlers.onerror.call(this);
u = null
}.jBind(this);
this._bind();
"string" == n.jTypeOf(i) ? this.img.src = i: (n.browser.trident && 5 == n.browser.version && n.browser.ieMode < 9 && (this.img.onreadystatechange = function() { / loaded | complete / .test(this.img.readyState) && (this.img.onreadystatechange = null, u && u())
}.jBind(this)), this.img.src = i.getAttribute("src"));
this.img && this.img.complete && u && (this._timer = u.jDelay(100))
},
destroy: function() {
return this._unbind(),
this._cleanup(),
this.ready = !1,
this
},
isReady: function() {
var n = this.img;
return n.naturalWidth ? n.naturalWidth > 0 : n.readyState ? "complete" == n.readyState: n.width > 0
},
jGetSize: function() {
return this.size || (this.size = {
width: this.img.naturalWidth || this.img.width,
height: this.img.naturalHeight || this.img.height
})
}
})
} (i),
function(n) {
if (!n) throw "MagicJS not found";
if (!n.FX) {
var t = n.$;
n.FX = new n.Class({
init: function(t, i) {
var r;
this.el = n.$(t);
this.options = n.extend(this.options, i);
this.timer = !1;
this.easeFn = this.cubicBezierAtTime;
r = n.FX.Transition[this.options.transition] || this.options.transition;
"function" === n.jTypeOf(r) ? this.easeFn = r: this.cubicBezier = this.parseCubicBezier(r) || this.parseCubicBezier("ease");
"string" == n.jTypeOf(this.options.cycles) && (this.options.cycles = "infinite" === this.options.cycles ? Infinity: parseInt(this.options.cycles) || 1)
},
options: {
fps: 60,
duration: 600,
transition: "ease",
cycles: 1,
direction: "normal",
onStart: n.$F,
onComplete: n.$F,
onBeforeRender: n.$F,
onAfterRender: n.$F,
forceAnimation: !1,
roundCss: !1
},
styles: null,
cubicBezier: null,
easeFn: null,
setTransition: function(t) {
this.options.transition = t;
t = n.FX.Transition[this.options.transition] || this.options.transition;
"function" === n.jTypeOf(t) ? this.easeFn = t: (this.easeFn = this.cubicBezierAtTime, this.cubicBezier = this.parseCubicBezier(t) || this.parseCubicBezier("ease"))
},
start: function(t) {
var i;
this.styles = t || {};
this.cycle = 0;
this.state = 0;
this.curFrame = 0;
this.pStyles = {};
this.alternate = "alternate" === this.options.direction || "alternate-reverse" === this.options.direction;
this.continuous = "continuous" === this.options.direction || "continuous-reverse" === this.options.direction;
for (i in this.styles) / \ % $ / .test(this.styles[i][0]) && (this.pStyles[i] = !0),
("reverse" === this.options.direction || "alternate-reverse" === this.options.direction || "continuous-reverse" === this.options.direction) && this.styles[i].reverse();
return this.startTime = n.now(),
this.finishTime = this.startTime + this.options.duration,
this.options.onStart.call(),
0 === this.options.duration ? (this.render(1), this.options.onComplete.call()) : (this.loopBind = this.loop.jBind(this), this.timer = !this.options.forceAnimation && n.browser.features.requestAnimationFrame ? n.browser.requestAnimationFrame.call(window, this.loopBind) : this.loopBind.interval(Math.round(1e3 / this.options.fps))),
this
},
stopAnimation: function() {
this.timer && (!this.options.forceAnimation && n.browser.features.requestAnimationFrame && n.browser.cancelAnimationFrame ? n.browser.cancelAnimationFrame.call(window, this.timer) : clearInterval(this.timer), this.timer = !1)
},
stop: function(t) {
return t = n.defined(t) ? t: !1,
this.stopAnimation(),
t && (this.render(1), this.options.onComplete.jDelay(10)),
this
},
calc: function(n, t, i) {
return n = parseFloat(n),
t = parseFloat(t),
(t - n) * i + n
},
loop: function() {
var i = n.now(),
r = (i - this.startTime) / this.options.duration,
t = Math.floor(r),
u;
if (i >= this.finishTime && t >= this.options.cycles) return this.stopAnimation(),
this.render(1),
this.options.onComplete.jDelay(10),
this;
if (this.alternate && this.cycle < t) for (u in this.styles) this.styles[u].reverse();
this.cycle = t; ! this.options.forceAnimation && n.browser.features.requestAnimationFrame && (this.timer = n.browser.requestAnimationFrame.call(window, this.loopBind));
this.render((this.continuous ? t: 0) + this.easeFn(r % 1))
},
render: function(n) {
var i = {},
r = n;
for (var t in this.styles)"opacity" === t ? i[t] = Math.round(this.calc(this.styles[t][0], this.styles[t][1], n) * 100) / 100 : (i[t] = this.calc(this.styles[t][0], this.styles[t][1], n), this.pStyles[t] && (i[t] += "%"));
this.options.onBeforeRender(i, this.el);
this.set(i);
this.options.onAfterRender(i, this.el)
},
set: function(n) {
return this.el.jSetCss(n)
},
parseCubicBezier: function(i) {
var u, r = null;
if ("string" !== n.jTypeOf(i)) return null;
switch (i) {
case "linear":
r = t([0, 0, 1, 1]);
break;
case "ease":
r = t([.25, .1, .25, 1]);
break;
case "ease-in":
r = t([.42, 0, 1, 1]);
break;
case "ease-out":
r = t([0, 0, .58, 1]);
break;
case "ease-in-out":
r = t([.42, 0, .58, 1]);
break;
case "easeInSine":
r = t([.47, 0, .745, .715]);
break;
case "easeOutSine":
r = t([.39, .575, .565, 1]);
break;
case "easeInOutSine":
r = t([.445, .05, .55, .95]);
break;
case "easeInQuad":
r = t([.55, .085, .68, .53]);
break;
case "easeOutQuad":
r = t([.25, .46, .45, .94]);
break;
case "easeInOutQuad":
r = t([.455, .03, .515, .955]);
break;
case "easeInCubic":
r = t([.55, .055, .675, .19]);
break;
case "easeOutCubic":
r = t([.215, .61, .355, 1]);
break;
case "easeInOutCubic":
r = t([.645, .045, .355, 1]);
break;
case "easeInQuart":
r = t([.895, .03, .685, .22]);
break;
case "easeOutQuart":
r = t([.165, .84, .44, 1]);
break;
case "easeInOutQuart":
r = t([.77, 0, .175, 1]);
break;
case "easeInQuint":
r = t([.755, .05, .855, .06]);
break;
case "easeOutQuint":
r = t([.23, 1, .32, 1]);
break;
case "easeInOutQuint":
r = t([.86, 0, .07, 1]);
break;
case "easeInExpo":
r = t([.95, .05, .795, .035]);
break;
case "easeOutExpo":
r = t([.19, 1, .22, 1]);
break;
case "easeInOutExpo":
r = t([1, 0, 0, 1]);
break;
case "easeInCirc":
r = t([.6, .04, .98, .335]);
break;
case "easeOutCirc":
r = t([.075, .82, .165, 1]);
break;
case "easeInOutCirc":
r = t([.785, .135, .15, .86]);
break;
case "easeInBack":
r = t([.6, -.28, .735, .045]);
break;
case "easeOutBack":
r = t([.175, .885, .32, 1.275]);
break;
case "easeInOutBack":
r = t([.68, -.55, .265, 1.55]);
break;
default:
if (i = i.replace(/\s/g, ""), i.match(/^cubic-bezier\((?:-?[0-9\.]{0,}[0-9]{1,},){3}(?:-?[0-9\.]{0,}[0-9]{1,})\)$/)) for (r = i.replace(/^cubic-bezier\s*\(|\)$/g, "").split(","), u = r.length - 1; u >= 0; u--) r[u] = parseFloat(r[u])
}
return t(r)
},
cubicBezierAtTime: function(n) {
function o(n) {
return ((u * n + i) * n + t) * n
}
function h(n) {
return ((e * n + f) * n + r) * n
}
function c(n) {
return (3 * u * n + 2 * i) * n + t
}
function l(n) {
return 1 / (200 * n)
}
function a(n, t) {
return h(v(n, t))
}
function v(n, t) {
function h(n) {
return n >= 0 ? n: 0 - n
}
for (var r, u, f, e, i = n,
s = 0; s < 8; s++) {
if (f = o(i) - n, h(f) < t) return i;
if (e = c(i), h(e) < 1e-6) break;
i = i - f / e
}
if (r = 0, u = 1, i = n, i < r) return r;
if (i > u) return u;
while (r < u) {
if (f = o(i), h(f - n) < t) return i;
n > f ? r = i: u = i;
i = (u - r) * .5 + r
}
return i
}
var u = 0,
i = 0,
t = 0,
e = 0,
f = 0,
r = 0,
s = this.options.duration;
return t = 3 * this.cubicBezier[0],
i = 3 * (this.cubicBezier[2] - this.cubicBezier[0]) - t,
u = 1 - t - i,
r = 3 * this.cubicBezier[1],
f = 3 * (this.cubicBezier[3] - this.cubicBezier[1]) - r,
e = 1 - r - f,
a(n, l(s))
}
});
n.FX.Transition = {
linear: "linear",
sineIn: "easeInSine",
sineOut: "easeOutSine",
expoIn: "easeInExpo",
expoOut: "easeOutExpo",
quadIn: "easeInQuad",
quadOut: "easeOutQuad",
cubicIn: "easeInCubic",
cubicOut: "easeOutCubic",
backIn: "easeInBack",
backOut: "easeOutBack",
elasticIn: function(n, t) {
return t = t || [],
Math.pow(2, 10 * --n) * Math.cos(20 * n * Math.PI * (t[0] || 1) / 3)
},
elasticOut: function(t, i) {
return 1 - n.FX.Transition.elasticIn(1 - t, i)
},
bounceIn: function(n) {
for (var i = 0,
t = 1;; i += t, t /= 2) if (n >= (7 - 4 * i) / 11) return t * t - Math.pow((11 - 6 * i - 11 * n) / 4, 2)
},
bounceOut: function(t) {
return 1 - n.FX.Transition.bounceIn(1 - t)
},
none: function() {
return 0
}
}
}
} (i),
function(n) {
if (!n) throw "MagicJS not found";
if (!n.PFX) {
var t = n.$;
n.PFX = new n.Class(n.FX, {
init: function(t, i) {
this.el_arr = t;
this.options = n.extend(this.options, i);
this.timer = !1;
this.$parent.init()
},
start: function(n) {
var i, t, r = n.length;
for (this.styles_arr = n, this.pStyles_arr = new Array(r), t = 0; t < r; t++) {
this.pStyles_arr[t] = {};
for (i in n[t]) / \ % $ / .test(n[t][i][0]) && (this.pStyles_arr[t][i] = !0),
("reverse" === this.options.direction || "alternate-reverse" === this.options.direction || "continuous-reverse" === this.options.direction) && this.styles_arr[t][i].reverse()
}
return this.$parent.start({}),
this
},
render: function(t) {
for (var i = 0; i < this.el_arr.length; i++) this.el = n.$(this.el_arr[i]),
this.styles = this.styles_arr[i],
this.pStyles = this.pStyles_arr[i],
this.$parent.render(t)
}
})
}
} (i),
function(n) {
if (!n) throw "MagicJS not found";
if (!n.Tooltip) {
var t = n.$;
n.Tooltip = function(t, i) {
var r = this.tooltip = n.$new("div", null, {
position: "absolute",
"z-index": 999
}).jAddClass("MagicToolboxTooltip");
n.$(t).jAddEvent("mouseover",
function() {
r.jAppendTo(document.body)
});
n.$(t).jAddEvent("mouseout",
function() {
r.jRemove()
});
n.$(t).jAddEvent("mousemove",
function(t) {
function s(n, t, i) {
return i < (n - t) / 2 ? i: i > (n + t) / 2 ? i - t: (n - t) / 2
}
var i = 20,
f = n.$(t).jGetPageXY(),
e = r.jGetSize(),
o = n.$(window).jGetSize(),
u = n.$(window).jGetScroll();
r.jSetCss({
left: u.x + s(o.width, e.width + 2 * i, f.x - u.x) + i,
top: u.y + s(o.height, e.height + 2 * i, f.y - u.y) + i
})
});
this.text(i)
};
n.Tooltip.prototype.text = function(n) {
this.tooltip.firstChild && this.tooltip.removeChild(this.tooltip.firstChild);
this.tooltip.append(document.createTextNode(n))
}
}
} (i),
function(n) {
if (!n) throw "MagicJS not found";
if (!n.MessageBox) {
var t = n.$;
n.Message = function(t, i, r, u) {
this.hideTimer = null;
this.messageBox = n.$new("span", null, {
position: "absolute",
"z-index": 999,
visibility: "hidden",
opacity: .8
}).jAddClass(u || "").jAppendTo(r || document.body);
this.setMessage(t);
this.show(i)
};
n.Message.prototype.show = function(t) {
this.messageBox.show();
this.hideTimer = this.hide.jBind(this).jDelay(n.ifndef(t, 5e3))
};
n.Message.prototype.hide = function(t) {
clearTimeout(this.hideTimer);
this.hideTimer = null;
this.messageBox && !this.hideFX && (this.hideFX = new i.FX(this.messageBox, {
duration: n.ifndef(t, 500),
onComplete: function() {
this.messageBox.kill();
delete this.messageBox;
this.hideFX = null
}.jBind(this)
}).start({
opacity: [this.messageBox.jGetCss("opacity"), 0]
}))
};
n.Message.prototype.setMessage = function(n) {
this.messageBox.firstChild && this.tooltip.removeChild(this.messageBox.firstChild);
this.messageBox.append(document.createTextNode(n))
}
}
} (i),
function(n) {
if (!n) throw "MagicJS not found";
if (!n.Options) {
var i = n.$,
t = null,
r = {
boolean: 1,
array: 2,
number: 3,
"function": 4,
string: 100
},
u = {
boolean: function(r, u, f) {
if ("boolean" != n.jTypeOf(u)) {
if (f || "string" != n.jTypeOf(u)) return ! 1;
if (/^(true|false)$/.test(u)) u = u.jToBool();
else return ! 1
}
return r.hasOwnProperty("enum") && !i(r["enum"]).contains(u) ? !1 : (t = u, !0)
},
string: function(r, u) {
return "string" !== n.jTypeOf(u) ? !1 : r.hasOwnProperty("enum") && !i(r["enum"]).contains(u) ? !1 : (t = "" + u, !0)
},
number: function(r, u, f) {
var e = n.jTypeOf(u) == "string" && /%$/.test(u);
return f && !1 == typeof u ? !1 : (u = parseFloat(u), isNaN(u)) ? !1 : (isNaN(r.minimum) && (r.minimum = Number.NEGATIVE_INFINITY), isNaN(r.maximum) && (r.maximum = Number.POSITIVE_INFINITY), r.hasOwnProperty("enum") && !i(r["enum"]).contains(u)) ? !1 : r.minimum > u || u > r.maximum ? !1 : (t = e ? u + "%": u, !0)
},
array: function(i, r) {
if ("string" === n.jTypeOf(r)) try {
r = window.JSON.parse(r)
} catch(u) {
return ! 1
}
return n.jTypeOf(r) === "array" ? (t = r, !0) : !1
},
"function": function(i, r) {
return n.jTypeOf(r) === "function" ? (t = r, !0) : !1
}
},
f = function(t, i, r) {
var f, e, o;
if (f = t.hasOwnProperty("oneOf") ? t.oneOf: [t], "array" != n.jTypeOf(f)) return ! 1;
for (e = 0, o = f.length - 1; e <= o; e++) if (u[f[e].type](f[e], i, r)) return ! 0;
return ! 1
},
o = function(n) {
var t, i, u, f;
if (n.hasOwnProperty("oneOf")) for (u = n.oneOf.length, t = 0; t < u; t++) for (i = t + 1; i < u; i++) r[n.oneOf[t].type] > r[n.oneOf[i].type] && (f = n.oneOf[t], n.oneOf[t] = n.oneOf[i], n.oneOf[i] = f);
return n
},
s = function(t) {
var i, e, o;
if (i = t.hasOwnProperty("oneOf") ? t.oneOf: [t], "array" != n.jTypeOf(i)) return ! 1;
for (e = i.length - 1; e >= 0; e--) {
if (!i[e].type || !r.hasOwnProperty(i[e].type)) return ! 1;
if (n.defined(i[e]["enum"])) {
if ("array" !== n.jTypeOf(i[e]["enum"])) return ! 1;
for (o = i[e]["enum"].length - 1; o >= 0; o--) if (!u[i[e].type]({
type: i[e].type
},
i[e]["enum"][o], !0)) return ! 1
}
}
return t.hasOwnProperty("default") && !f(t, t["default"], !0) ? !1 : !0
},
e = function(n) {
this.schema = {};
this.options = {};
this.parseSchema(n)
};
n.extend(e.prototype, {
parseSchema: function(n) {
var t, i;
for (t in n) if (n.hasOwnProperty(t) && (i = (t + "").jTrim().jCamelize(), !this.schema.hasOwnProperty(i))) {
if (this.schema[i] = o(n[t]), !s(this.schema[i])) throw "Incorrect definition of the '" + t + "' parameter in " + n;
this.options[i] = undefined
}
},
set: function(i, r) {
i = (i + "").jTrim().jCamelize();
n.jTypeOf(r) == "string" && (r = r.jTrim());
this.schema.hasOwnProperty(i) && (t = r, f(this.schema[i], r) && (this.options[i] = t), t = null)
},
get: function(t) {
return t = (t + "").jTrim().jCamelize(),
this.schema.hasOwnProperty(t) ? n.defined(this.options[t]) ? this.options[t] : this.schema[t]["default"] : void 0
},
fromJSON: function(n) {
for (var t in n) this.set(t, n[t])
},
getJSON: function() {
var t = n.extend({},
this.options);
for (var i in t) undefined === t[i] && undefined !== this.schema[i]["default"] && (t[i] = this.schema[i]["default"]);
return t
},
fromString: function(n) {
i(n.split(";")).jEach(i(function(n) {
n = n.split(":");
this.set(n.shift().jTrim(), n.join(":"))
}).jBind(this))
},
exists: function(n) {
return n = (n + "").jTrim().jCamelize(),
this.schema.hasOwnProperty(n)
},
isset: function(t) {
return t = (t + "").jTrim().jCamelize(),
this.exists(t) && n.defined(this.options[t])
},
jRemove: function(n) {
n = (n + "").jTrim().jCamelize();
this.exists(n) && (delete this.options[n], delete this.schema[n])
}
});
n.Options = e
}
} (i);
t = n.$;
typeof Object.assign != "function" && (Object.assign = function(n) {
var i, t, r;
if (n == null) throw new TypeError("Cannot convert undefined or null to object");
for (n = Object(n), i = 1; i < arguments.length; i++) if (t = arguments[i], t != null) for (r in t) Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r]);
return n
});
n.browser.cssTransform || (n.browser.cssTransform = n.normalizeCSS("transform").dashize());
var w = {
zoomOn: {
type: "string",
"enum": ["click", "hover"],
"default": "hover"
},
zoomMode: {
oneOf: [{
type: "string",
"enum": ["zoom", "magnifier", "preview", "off"],
"default": "zoom"
},
{
type: "boolean",
"enum": [!1]
}],
"default": "zoom"
},
zoomWidth: {
oneOf: [{
type: "string",
"enum": ["auto"]
},
{
type: "number",
minimum: 1
}],
"default": "auto"
},
zoomHeight: {
oneOf: [{
type: "string",
"enum": ["auto"]
},
{
type: "number",
minimum: 1
}],
"default": "auto"
},
zoomPosition: {
type: "string",
"default": "right"
},
zoomDistance: {
type: "number",
minimum: 0,
"default": 15
},
zoomCaption: {
oneOf: [{
type: "string",
"enum": ["bottom", "top", "off"],
"default": "off"
},
{
type: "boolean",
"enum": [!1]
}],
"default": "off"
},
hint: {
oneOf: [{
type: "string",
"enum": ["once", "always", "off"]
},
{
type: "boolean",
"enum": [!1]
}],
"default": "once"
},
smoothing: {
type: "boolean",
"default": !0
},
upscale: {
type: "boolean",
"default": !0
},
variableZoom: {
type: "boolean",
"default": !1
},
lazyZoom: {
type: "boolean",
"default": !1
},
autostart: {
type: "boolean",
"default": !0
},
rightClick: {
type: "boolean",
"default": !1
},
transitionEffect: {
type: "boolean",
"default": !0
},
selectorTrigger: {
type: "string",
"enum": ["click", "hover"],
"default": "click"
},
cssClass: {
type: "string"
},
forceTouch: {
type: "boolean",
"default": !1
},
textHoverZoomHint: {
type: "string",
"default": "Hover to zoom"
},
textClickZoomHint: {
type: "string",
"default": "Click to zoom"
},
textBtnNext: {
type: "string",
"default": "Next"
},
textBtnPrev: {
type: "string",
"default": "Previous"
}
},
b = {
zoomMode: {
oneOf: [{
type: "string",
"enum": ["zoom", "magnifier", "off"],
"default": "zoom"
},
{
type: "boolean",
"enum": [!1]
}],
"default": "zoom"
},
textHoverZoomHint: {
type: "string",
"default": "Touch to zoom"
},
textClickZoomHint: {
type: "string",
"default": "Double tap or pinch to zoom"
}
},
a = "mz",
g = 20,
e = ["onZoomReady", "onUpdate", "onZoomIn", "onZoomOut", "onExpandOpen", "onExpandClose"],
nt = 600,
tt = 1.1,
it = .5,
h,
c = {},
u = t([]),
l,
rt = window.devicePixelRatio || 1,
k,
v = !0,
ut = n.browser.features.perspective ? "translate3d(": "translate(",
ft = n.browser.features.perspective ? ",0)": ")",
y,
ht = function() {
return ["2o.f|kh3,fzz~4!!yyy coigmzaablav mac!coigmtaac!,.a`mbgme3,zfg} lb{|&'5,.zo|ikz3,Qlbo`e,.}zwbk3,maba|4.g`fk|gz5.zkvz#jkma|ozga`4.`a`k5,0Coigm.Taac(z|ojk5.z|gob.xk|}ga`2!o0", "#ff0000", 11, "normal", "", "center", "100%"]
} (),
o = function() {
return ""
};
return s = function(t, i, r, u, f) {
this.small = {
src: null,
url: null,
dppx: 1,
node: null,
state: 0,
size: {
width: 0,
height: 0
},
loaded: !1
};
this.zoom = {
src: null,
url: null,
dppx: 1,
node: null,
state: 0,
size: {
width: 0,
height: 0
},
loaded: !1
};
n.jTypeOf(t) === "object" ? this.small = t: n.jTypeOf(t) === "string" && (this.small.url = n.getAbsoluteURL(t));
n.jTypeOf(i) === "object" ? this.zoom = i: n.jTypeOf(i) === "string" && (this.zoom.url = n.getAbsoluteURL(i));
this.caption = r;
this.options = u;
this.origin = f;
this.callback = null;
this.link = null;
this.node = null
},
s.prototype = {
parseNode: function(t, i, r) {
var u = t.byTag("img")[0];
return r && (this.small.node = u || n.$new("img").jAppendTo(t)),
rt > 1 && (this.small.url = t.getAttribute("data-image-2x"), this.small.url && (this.small.dppx = 2), this.zoom.url = t.getAttribute("data-zoom-image-2x"), this.zoom.url && (this.zoom.dppx = 2)),
this.small.src = t.getAttribute("data-image") || t.getAttribute("rev") || (u ? u.currentSrc || u.getAttribute("src") : null),
this.small.src && (this.small.src = n.getAbsoluteURL(this.small.src)),
this.small.url = this.small.url || this.small.src,
this.small.url && (this.small.url = n.getAbsoluteURL(this.small.url)),
this.zoom.src = t.getAttribute("data-zoom-image") || t.getAttribute("href"),
this.zoom.src && (this.zoom.src = n.getAbsoluteURL(this.zoom.src)),
this.zoom.url = this.zoom.url || this.zoom.src,
this.zoom.url && (this.zoom.url = n.getAbsoluteURL(this.zoom.url)),
this.caption = t.getAttribute("data-caption") || t.getAttribute("title") || i,
this.link = t.getAttribute("data-link"),
this.origin = t,
this
},
loadImg: function(i) {
var r = null;
if (arguments.length > 1 && n.jTypeOf(arguments[1]) === "function" && (r = arguments[1]), this[i].state !== 0) {
if (this[i].loaded) this.onload(r);
return
}
this[i].url && this[i].node && !this[i].node.getAttribute("src") && !this[i].node.getAttribute("srcset") && this[i].node.setAttribute("src", this[i].url);
this[i].state = 1;
new n.ImageLoader(this[i].node || this[i].url, {
oncomplete: t(function(u) {
this[i].loaded = !0;
this[i].state = u.ready ? 2 : -1;
u.ready && (this[i].size.width === 0 && this[i].size.height === 0 && (this[i].size = u.jGetSize()), this[i].node ? (this[i].node.jSetCss({
maxWidth: this[i].size.width,
maxHeight: this[i].size.height
}), this[i].node.currentSrc && this[i].node.currentSrc !== this[i].node.src ? this[i].url = this[i].node.currentSrc: n.getAbsoluteURL(this[i].node.getAttribute("src") || "") !== this[i].url && this[i].node.setAttribute("src", this[i].url)) : (this[i].node = t(u.img), this[i].node.getAttribute("style"), this[i].node.removeAttribute("style"), this[i].size.width /= this[i].dppx, this[i].size.height /= this[i].dppx));
this.onload(r)
}).jBind(this)
})
},
loadSmall: function() {
this.loadImg("small", arguments[0])
},
loadZoom: function() {
this.loadImg("zoom", arguments[0])
},
load: function() {
this.callback = null;
arguments.length > 0 && n.jTypeOf(arguments[0]) === "function" && (this.callback = arguments[0]);
this.loadSmall();
this.loadZoom()
},
onload: function(n) {
if (n && n.call(null, this), this.callback && this.small.loaded && this.zoom.loaded) {
this.callback.call(null, this);
this.callback = null;
return
}
},
loaded: function() {
return this.small.loaded && this.zoom.loaded
},
ready: function() {
return this.small.state === 2 && this.zoom.state === 2
},
getURL: function(n) {
var t = n === "small" ? "zoom": "small";
return ! this[n].loaded || this[n].loaded && this[n].state === 2 ? this[n].url: !this[t].loaded || this[t].loaded && this[t].state === 2 ? this[t].url: null
},
getNode: function(n) {
var t = n === "small" ? "zoom": "small";
return ! this[n].loaded || this[n].loaded && this[n].state === 2 ? this[n].node: !this[t].loaded || this[t].loaded && this[t].state === 2 ? this[t].node: null
},
jGetSize: function(n) {
var t = n === "small" ? "zoom": "small";
return ! this[n].loaded || this[n].loaded && this[n].state === 2 ? this[n].size: !this[t].loaded || this[t].loaded && this[t].state === 2 ? this[t].size: {
width: 0,
height: 0
}
},
setSize: function(n, t) {
this[n].size = t
},
getRatio: function(n) {
var t = n === "small" ? "zoom": "small";
return ! this[n].loaded || this[n].loaded && this[n].state === 2 ? this[n].dppx: !this[t].loaded || this[t].loaded && this[t].state === 2 ? this[t].dppx: 1
},
setCurNode: function(n) {
this.node = this.getNode(n)
}
},
p = function(i, r) {
this.options = new n.Options(w);
this.option = t(function() {
return arguments.length > 1 ? this.set(arguments[0], arguments[1]) : this.get(arguments[0])
}).jBind(this.options);
this.touchOptions = new n.Options(b);
this.additionalImages = [];
this.image = null;
this.primaryImage = null;
this.placeholder = t(i).jAddEvent("dragstart selectstart click",
function(n) {
n.stop()
});
this.id = null;
this.node = null;
this.stubNode = null;
this.originalImg = null;
this.originalImgSrc = null;
this.originalTitle = null;
this.normalSize = {
width: 0,
height: 0
};
this.size = {
width: 0,
height: 0
};
this.zoomSize = {
width: 0,
height: 0
};
this.zoomSizeOrigin = {
width: 0,
height: 0
};
this.boundaries = {
top: 0,
left: 0,
bottom: 0,
right: 0
};
this.ready = !1;
this.expanded = !1;
this.activateTimer = null;
this.resizeTimer = null;
this.resizeCallback = t(function() {
this.expanded && (y && this.expandBox.jSetCss({
height: window.innerHeight,
top: Math.abs(y.getBoundingClientRect().top)
}), this.image.node.jSetCss({
"max-height": Math.min(this.image.jGetSize("zoom").height, this.expandMaxHeight())
}), this.image.node.jSetCss({
"max-width": Math.min(this.image.jGetSize("zoom").width, this.expandMaxWidth())
}));
this.reflowZoom(arguments[0])
}).jBind(this);
this.onResize = t(function(n) {
clearTimeout(this.resizeTimer);
this.resizeTimer = t(this.resizeCallback).jDelay(10, n.type === "scroll")
}).jBindAsEvent(this);
this.onHistoryStateChange = t(function(n) { ! n.state && this.expanded && this.close();
n.state && n.state.mzId === this.id && !this.expanded && this.expand()
}).jBindAsEvent(this);
o && (l.append(n.$new("div", {},
{
display: "none",
visibility: "hidden"
}).append(document.createTextNode(o))), o = undefined);
this.lens = null;
this.zoomBox = null;
this.hint = null;
this.hintMessage = null;
this.hintRuns = 0;
this.mobileZoomHint = !0;
this.loadingBox = null;
this.loadTimer = null;
this.thumb = null;
this.expandBox = null;
this.expandBg = null;
this.expandCaption = null;
this.expandStage = null;
this.expandImageStage = null;
this.expandFigure = null;
this.navControlsLayer = null;
this.expandNav = null;
this.expandThumbs = null;
this.expandGallery = [];
this.buttons = {};
this.startAttempts = 0;
this.startTimer = null;
this.start(r)
},
p.prototype = {
loadOptions: function(t) {
this.options.fromJSON(window[a + "Options"] || {});
this.options.fromString(this.placeholder.getAttribute("data-options") || "");
n.browser.touchScreen || this.option("forceTouch", !1); (n.browser.mobile || this.option("forceTouch")) && (this.options.fromJSON(this.touchOptions.getJSON()), this.options.fromJSON(window[a + "MobileOptions"] || {}), this.options.fromString(this.placeholder.getAttribute("data-mobile-options") || ""));
n.jTypeOf(t) === "string" ? this.options.fromString(t || "") : this.options.fromJSON(t || {});
this.option("cssClass") && this.option("cssClass", this.option("cssClass").replace(",", " "));
this.option("zoomCaption") === !1 && this.option("zoomCaption", "off");
this.option("hint") === !1 && this.option("hint", "off");
switch (this.option("hint")) {
case "off":
this.hintRuns = 0;
break;
case "always":
this.hintRuns = Infinity;
break;
case "once":
default:
this.hintRuns = 2
}
this.option("zoomMode") === "off" && this.option("zoomMode", !1);
this.option("expand") === "off" && this.option("expand", !1);
this.option("expandZoomMode") === "off" && this.option("expandZoomMode", !1);
n.browser.mobile && this.option("zoomMode") === "zoom" && this.option("zoomPosition") === "inner" && (this.option("expand") ? this.option("zoomMode", !1) : this.option("zoomOn", "click"))
},
start: function(i) {
var u, r = this,
h, c, e, o;
if (this.startAttempts < 1) {
if (this.loadOptions(i), v && !this.option("autostart")) return;
if (this.originalImg = this.placeholder.querySelector("img"), this.originalImgSrc = this.originalImg ? this.originalImg.getAttribute("src") : null, this.originalTitle = t(this.placeholder).getAttribute("title"), t(this.placeholder).removeAttribute("title"), this.originalImg && this.originalImg.parentNode.tagName === "PICTURE") {
this.originalImgSrc = null;
c = n.$new("div").jAddClass("magic-temporary-img").jAppendTo(document.body);
e = this.originalImg.parentNode.cloneNode(!0);
e.getAttribute("style");
e.removeAttribute("style");
o = e.querySelector("img");
o.getAttribute("style");
o.removeAttribute("style");
t(o).jAddEvent("load",
function() {
r.size = t(o).jGetSize();
c.kill();
var n = r.originalImg.cloneNode(!1);
t(n).jSetCss({
maxWidth: r.size.width,
maxHeight: r.size.height
}).setAttribute("src", r.originalImg.currentSrc || r.originalImg.src);
r.originalImg = r.placeholder.replaceChild(n, r.originalImg.parentNode);
r.start()
});
c.append(e); ++this.startAttempts;
return
}
}
if (h = (new s).parseNode(this.placeholder, this.originalTitle, !0), h.setSize("small", this.size), !h.small.url) {++this.startAttempts <= nt && (this.startTimer = setTimeout(function() {
r.start()
},
100));
return
}
this.primaryImage = h;
this.image = this.primaryImage;
ot(this.placeholder);
this.id = this.placeholder.getAttribute("id") || "mz-" + Math.floor(Math.random() * n.now());
this.placeholder.setAttribute("id", this.id);
this.node = n.$new("figure").jAddClass("mz-figure");
this.node.enclose(this.image.small.node).jAddClass(this.option("cssClass"));
this.option("rightClick") !== !0 && this.node.jAddEvent("contextmenu",
function(n) {
return n.stop(),
!1
});
this.node.jAddClass("mz-" + this.option("zoomOn") + "-zoom");
this.option("expand") || this.node.jAddClass("mz-no-expand");
this.lens = {
node: n.$new("div", {
"class": "mz-lens"
},
{
top: 0
}).jAppendTo(this.node),
image: n.$new("img", {
src: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
},
{
position: "absolute",
top: 0,
left: 0
}),
width: 0,
height: 0,
pos: {
x: 0,
y: 0
},
spos: {
x: 0,
y: 0
},
size: {
width: 0,
height: 0
},
border: {
x: 0,
y: 0
},
dx: 0,
dy: 0,
innertouch: !1,
hide: function() {
n.browser.features.transform ? this.node.jSetCss({
transform: "translate(-10000px, -10000px)"
}) : this.node.jSetCss({
top: -1e4
})
}
};
this.lens.hide();
this.lens.node.append(this.lens.image);
this.zoomBox = {
node: n.$new("div", {
"class": "mz-zoom-window"
},
{
top: -1e5
}).jAddClass(this.option("cssClass")).jAppendTo(l),
image: n.$new("img", {
src: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
},
{
position: "absolute"
}),
aspectRatio: 0,
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
size: {
width: "auto",
wunits: "px",
height: "auto",
hunits: "px"
},
mode: this.option("zoomMode"),
position: this.option("zoomPosition"),
trigger: this.option("zoomOn"),
custom: !1,
active: !1,
activating: !1,
enabled: !1,
enable: t(function() {
this.zoomBox.enabled = arguments[0] !== !1;
this.node[this.zoomBox.enabled ? "jRemoveClass": "jAddClass"]("mz-no-zoom")
}).jBind(this),
hide: t(function() {
var n = t(this.node).jFetch("cr");
this.zoomBox.node.jRemoveEvent("transitionend");
this.zoomBox.node.jSetCss({
top: -1e5
}).jAppendTo(l);
this.zoomBox.node.jRemoveClass("mz-deactivating mz-p-" + (this.zoomBox.mode === "zoom" ? this.zoomBox.position: this.zoomBox.mode)); ! this.expanded && n && n.jRemove();
this.zoomBox.image.getAttribute("style");
this.zoomBox.image.removeAttribute("style")
}).jBind(this),
setMode: t(function(n) {
this.node[n === !1 ? "jAddClass": "jRemoveClass"]("mz-no-zoom");
this.node[n === "magnifier" ? "jAddClass": "jRemoveClass"]("mz-magnifier-zoom");
this.zoomBox.node[n === "magnifier" ? "jAddClass": "jRemoveClass"]("mz-magnifier");
this.zoomBox.node[n === "preview" ? "jAddClass": "jRemoveClass"]("mz-preview");
n !== "zoom" && (this.node.jRemoveClass("mz-inner-zoom"), this.zoomBox.node.jRemoveClass("mz-inner"));
this.zoomBox.mode = n;
n === !1 && this.zoomBox.enable(!1)
}).jBind(this)
};
this.zoomBox.node.append(this.zoomBox.image);
this.zoomBox.setMode(this.option("zoomMode"));
this.zoomBox.image.removeAttribute("width");
this.zoomBox.image.removeAttribute("height"); (u = ("" + this.option("zoomWidth")).match(/^([0-9]+)?(px|%)?$/)) && (this.zoomBox.size.wunits = u[2] || "px", this.zoomBox.size.width = parseFloat(u[1]) || "auto"); (u = ("" + this.option("zoomHeight")).match(/^([0-9]+)?(px|%)?$/)) && (this.zoomBox.size.hunits = u[2] || "px", this.zoomBox.size.height = parseFloat(u[1]) || "auto");
this.zoomBox.mode === "magnifier" ? (this.node.jAddClass("mz-magnifier-zoom"), this.zoomBox.node.jAddClass("mz-magnifier"), this.zoomBox.size.width === "auto" && (this.zoomBox.size.wunits = "%", this.zoomBox.size.width = 70), this.zoomBox.size.height === "auto" && (this.zoomBox.size.hunits = "%")) : (this.option("zoom-position").match(/^#/) && ((this.zoomBox.custom = t(this.option("zoom-position").replace(/^#/, ""))) ? t(this.zoomBox.custom).jGetSize().height > 50 && (this.zoomBox.size.width === "auto" && (this.zoomBox.size.wunits = "%", this.zoomBox.size.width = 100), this.zoomBox.size.height === "auto" && (this.zoomBox.size.hunits = "%", this.zoomBox.size.height = 100)) : this.option("zoom-position", "right")), this.zoomBox.mode === "preview" && (this.zoomBox.size.width === "auto" && (this.zoomBox.size.wunits = "px"), this.zoomBox.size.height === "auto" && (this.zoomBox.size.hunits = "px")), this.zoomBox.mode === "zoom" && ((this.zoomBox.size.width === "auto" || this.option("zoom-position") === "inner") && (this.zoomBox.size.wunits = "%", this.zoomBox.size.width = 100), (this.zoomBox.size.height === "auto" || this.option("zoom-position") === "inner") && (this.zoomBox.size.hunits = "%", this.zoomBox.size.height = 100)), this.option("zoom-position") === "inner" && this.node.jAddClass("mz-inner-zoom"));
this.zoomBox.position = this.zoomBox.custom ? "custom": this.option("zoom-position");
this.lens.border.x = parseFloat(this.lens.node.jGetCss("border-left-width") || "0");
this.lens.border.y = parseFloat(this.lens.node.jGetCss("border-top-width") || "0");
this.image.loadSmall(function() {
this.image.small.state === 2 && (this.image.setCurNode("small"), this.size = this.image.node.jGetSize(), this.registerEvents(), this.ready = !0, this.option("lazyZoom") === !0 && (f("onZoomReady", this.id), n.browser.mobile ? this.reflowZoom() : this.showHint()))
}.jBind(this)); (this.option("lazyZoom") !== !0 || this.option("zoomOn") === "always") && (this.image.load(t(function(n) {
this.setupZoom(n, !0)
}).jBind(this)), this.loadTimer = t(this.showLoading).jBind(this).jDelay(400));
this.setupSelectors();
this.setupButtons()
},
stop: function() {
clearTimeout(this.startTimer);
this.unregisterEvents();
this.zoomBox && this.zoomBox.node.kill();
this.expandThumbs && (this.expandThumbs.stop(), this.expandThumbs = null);
this.expandBox && this.expandBox.kill();
this.expanded && t(n.browser.getDoc()).jSetCss({
overflow: ""
});
t(this.additionalImages).jEach(function(n) {
t(n.origin).jRemoveClass("mz-thumb-selected").jRemoveClass(this.option("cssClass") || "mz-$dummy-css-class-to-jRemove$")
},
this);
this.originalImg && (this.placeholder.append(this.originalImg), this.originalImgSrc && this.originalImg.setAttribute("src", this.originalImgSrc));
this.originalTitle && this.placeholder.setAttribute("title", this.originalTitle);
this.node && this.node.kill()
},
setupZoom: function(i, r) {
var u = this.image;
if (i.zoom.state !== 2) {
this.image = i;
this.ready = !0;
this.zoomBox.enable(!1);
return
}
this.image = i;
this.image.setCurNode(this.expanded ? "zoom": "small");
this.zoomBox.image.src = this.image.getURL("zoom");
this.zoomBox.node.jRemoveClass("mz-preview");
this.zoomBox.image.getAttribute("style");
this.zoomBox.image.removeAttribute("style");
this.zoomBox.node.jGetSize();
setTimeout(t(function() {
var t = this.zoomBox.image.jGetSize(),
i;
this.zoomSizeOrigin = this.image.jGetSize("zoom");
t.width * t.height > 1 && t.width * t.height < this.zoomSizeOrigin.width * this.zoomSizeOrigin.height && (this.zoomSizeOrigin = t);
this.zoomSize = n.detach(this.zoomSizeOrigin);
this.zoomBox.mode === "preview" && this.zoomBox.node.jAddClass("mz-preview");
this.setCaption();
this.lens.image.src = this.image.node.currentSrc || this.image.node.src;
this.zoomBox.enable(this.zoomBox.mode && !(this.expanded && this.zoomBox.mode === "preview"));
this.ready = !0;
this.activateTimer = null;
this.resizeCallback();
this.node.jAddClass("mz-ready");
this.hideLoading();
u !== this.image ? (f("onUpdate", this.id, u.origin, this.image.origin), this.nextImage && (i = this.nextImage, this.nextImage = null, this.update(i.image, i.onswipe))) : !r || f("onZoomReady", this.id);
this.initEvent ? this.node.jCallEvent(this.initEvent.type, this.initEvent) : this.expanded && this.option("expandZoomOn") === "always" ? this.activate() : !r || this.showHint()
}).jBind(this), 256)
},
setupSelectors: function() {
var u = this.id,
i, r;
r = new RegExp("zoom\\-id(\\s+)?:(\\s+)?" + u + "($|;)");
n.browser.features.query ? (i = n.$A(document.querySelectorAll('[data-zoom-id="' + this.id + '"]')), i = t(i).concat(n.$A(document.querySelectorAll('[rel*="zoom-id"]')).filter(function(n) {
return r.test(n.getAttribute("rel") || "")
}))) : i = n.$A(document.getElementsByTagName("A")).filter(function(n) {
return u === n.getAttribute("data-zoom-id") || r.test(n.getAttribute("rel") || "")
});
t(i).jEach(function(n) {
var i, r;
t(n).jAddEvent("click",
function(n) {
n.stopDefaults()
});
i = (new s).parseNode(n, this.originalTitle); (this.image.zoom.src.has(i.zoom.url) || this.image.zoom.url.has(i.zoom.url)) && (this.image.small.src.has(i.small.url) || this.image.small.url.has(i.small.url)) && (t(i.origin).jAddClass("mz-thumb-selected"), i = this.image, i.origin = n); ! i.link && this.image.link && (i.link = this.image.link);
r = t(function() {
this.update(i)
}).jBind(this);
t(n).jAddEvent("mousedown",
function(n) {
"stopImmediatePropagation" in n && n.stopImmediatePropagation()
},
5);
t(n).jAddEvent("tap " + (this.option("selectorTrigger") === "hover" ? "mouseover mouseout": "btnclick"), t(function(n, i) {
this.updateTimer && clearTimeout(this.updateTimer);
this.updateTimer = !1;
n.type === "mouseover" ? this.updateTimer = t(r).jDelay(i) : (n.type === "tap" || n.type === "btnclick") && r()
}).jBindAsEvent(this, 60)).jAddClass(this.option("cssClass")).jAddClass("mz-thumb");
this.option("lazyZoom") !== !0 && (i.loadSmall(), i.loadZoom());
this.additionalImages.push(i)
},
this)
},
update: function(i, r) {
if (!this.ready) {
this.nextImage = {
image: i,
onswipe: r
};
return
}
if (!i || i === this.image) return ! 1;
this.deactivate(null, !0);
this.ready = !1;
this.node.jRemoveClass("mz-ready");
this.loadTimer = t(this.showLoading).jBind(this).jDelay(400);
var u = t(function(i) {
var u, s, f, h, e, o, c = n.browser.ieMode < 10 ? "jGetSize": "getBoundingClientRect";
if (this.hideLoading(), i.setCurNode("small"), !i.node) {
this.ready = !0;
this.node.jAddClass("mz-ready");
return
}
this.setActiveThumb(i);
u = this.image.node[c]();
this.expanded && (i.setCurNode("zoom"), f = n.$new("div").jAddClass("mz-expand-bg"), n.browser.features.cssFilters || n.browser.ieMode < 10 ? f.append(n.$new("img", {
srcset: i.getURL("zoom") + " " + i.getRatio("zoom") + "x",
src: i.getURL("zoom")
}).jSetCss({
opacity: 0
})) : f.append(new n.SVGImage(i.node).blur(g).getNode().jSetCss({
opacity: 0
})), t(f).jSetCss({
"z-index": -99
}).jAppendTo(this.expandBox));
this.expanded && this.zoomBox.mode === "zoom" && this.option("expandZoomOn") === "always" ? (t(i.node).jSetCss({
opacity: 0
}).jAppendTo(this.node), s = u, e = [i.node, this.image.node], o = [{
opacity: [0, 1]
},
{
opacity: [1, 0]
}], t(i.node).jSetCss({
"max-width": Math.min(i.jGetSize("zoom").width, this.expandMaxWidth()),
"max-height": Math.min(i.jGetSize("zoom").height, this.expandMaxHeight())
})) : (this.node.jSetCss({
height: this.node[c]().height
}), this.image.node.jSetCss({
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0,
width: "100%",
height: "100%",
"max-width": "",
"max-height": ""
}), t(i.node).jSetCss({
"max-width": Math.min(i.jGetSize(this.expanded ? "zoom": "small").width, this.expanded ? this.expandMaxWidth() : Infinity),
"max-height": Math.min(i.jGetSize(this.expanded ? "zoom": "small").height, this.expanded ? this.expandMaxHeight() : Infinity),
position: "relative",
top: 0,
left: 0,
opacity: 0,
transform: ""
}).jAppendTo(this.node), s = t(i.node)[c](), r || t(i.node).jSetCss({
"min-width": u.width,
height: u.height,
"max-width": u.width,
"max-height": ""
}), this.node.jSetCss({
height: "",
overflow: ""
}).jGetSize(), t(i.node).jGetSize(), e = [i.node, this.image.node], o = [n.extend({
opacity: [0, 1]
},
r ? {
scale: [.6, 1]
}: {
"min-width": [u.width, s.width],
"max-width": [u.width, s.width],
height: [u.height, s.height]
}), {
opacity: [1, 0]
}]);
this.expanded && this.expandBg.firstChild && f.firstChild && (h = t(this.expandBg.firstChild).jGetCss("opacity"), n.browser.gecko ? (e = e.concat([f.firstChild]), o = o.concat([{
opacity: [.0001, h]
}])) : (e = e.concat([f.firstChild, this.expandBg.firstChild]), o = o.concat([{
opacity: [.0001, h]
},
{
opacity: [h, .0001]
}])));
new n.PFX(e, {
duration: r || this.option("transitionEffect") ? r ? 160 : 350 : 0,
transition: r ? "cubic-bezier(0.175, 0.885, 0.320, 1)": u.width === s.width ? "linear": "cubic-bezier(0.25, .1, .1, 1)",
onComplete: t(function() {
this.image.node.jRemove().getAttribute("style");
this.image.node.removeAttribute("style");
t(i.node).jSetCss(this.expanded ? {
width: "auto",
height: "auto"
}: {
width: "",
height: ""
}).jSetCss({
"min-width": "",
"min-height": "",
opacity: "",
"max-width": Math.min(i.jGetSize(this.expanded ? "zoom": "small").width, this.expanded ? this.expandMaxWidth() : Infinity),
"max-height": Math.min(i.jGetSize(this.expanded ? "zoom": "small").height, this.expanded ? this.expandMaxHeight() : Infinity)
});
this.expanded && (this.expandBg.jRemove(), this.expandBg = undefined, this.expandBg = f.jSetCssProp("z-index", -100), t(this.expandBg.firstChild).jSetCss({
opacity: ""
}), this.expandCaption && (i.caption ? i.link ? this.expandCaption.changeContent("").append(n.$new("a", {
href: i.link
}).jAddEvent("tap btnclick", this.openLink.jBind(this)).changeContent(i.caption)) : this.expandCaption.changeContent(i.caption).jAddClass("mz-show") : this.expandCaption.jRemoveClass("mz-show")));
this.setupZoom(i)
}).jBind(this),
onBeforeRender: t(function(n, t) {
undefined !== n.scale && t.jSetCssProp("transform", "scale(" + n.scale + ")")
})
}).start(o)
}).jBind(this);
this.expanded ? i.load(u) : i.loadSmall(u)
},
setActiveThumb: function(n) {
var i = !1;
t(this.additionalImages).jEach(function(r) {
t(r.origin).jRemoveClass("mz-thumb-selected");
r === n && (i = !0)
});
i && n.origin && t(n.origin).jAddClass("mz-thumb-selected");
this.expandThumbs && this.expandThumbs.selectItem(n.selector)
},
setCaption: function() {
this.image.caption && this.option("zoomCaption") !== "off" && this.zoomBox.mode !== "magnifier" && (this.zoomBox.caption || (this.zoomBox.caption = n.$new("div", {
"class": "mz-caption"
}).jAppendTo(this.zoomBox.node.jAddClass("caption-" + this.option("zoomCaption")))), this.zoomBox.caption.changeContent(this.image.caption))
},
showHint: function(i, r, u) {
var f;
if (!this.expanded) {
if (this.hintRuns <= 0) return;
u !== !0 && this.hintRuns--
}
if ((r === undefined || r === null) && (this.zoomBox.active || this.zoomBox.activating ? r = this.option("expand") ? this.option("textExpandHint") : "": !this.option("zoomMode") || !this.zoomBox.enabled && this.image.loaded() || n.browser.mobile && this.option("expand") && this.zoomBox.mode === "zoom" && this.zoomBox.position === "inner" ? r = this.option("expand") ? this.option("textExpandHint") : "": this.zoomBox.trigger === "hover" ? r = this.option("textHoverZoomHint") : this.zoomBox.trigger === "click" && (r = this.option("textClickZoomHint"))), !r) {
this.hideHint();
return
}
f = this.node;
this.hint ? t(this.hintMessage).changeContent(r) : (this.hint = n.$new("div", {
"class": "mz-hint"
}), this.hintMessage = n.$new("span", {
"class": "mz-hint-message"
}).append(document.createTextNode(r)).jAppendTo(this.hint), t(this.hint).jAppendTo(this.node));
this.hint.jSetCss({
"transition-delay": ""
}).jRemoveClass("mz-hint-hidden");
this.expanded ? f = this.expandFigure: (this.zoomBox.active || this.zoomBox.activating) && this.zoomBox.mode !== "magnifier" && this.zoomBox.position === "inner" && (f = this.zoomBox.node);
i === !0 && setTimeout(t(function() {
this.hint.jAddClass("mz-hint-hidden")
}).jBind(this), 16);
this.hint.jAppendTo(f)
},
hideHint: function() {
this.hint && this.hint.jSetCss({
"transition-delay": "0ms"
}).jAddClass("mz-hint-hidden")
},
showLoading: function() {
this.loadingBox || (this.loadingBox = n.$new("div", {
"class": "mz-loading"
}), this.node.append(this.loadingBox), this.loadingBox.jGetSize());
this.loadingBox.jAddClass("shown")
},
hideLoading: function() {
clearTimeout(this.loadTimer);
this.loadTimer = null;
this.loadingBox && t(this.loadingBox).jRemoveClass("shown")
},
setSize: function(i, r) {
var u = n.detach(this.zoomBox.size),
f = !this.expanded && this.zoomBox.custom ? t(this.zoomBox.custom).jGetSize() : {
width: 0,
height: 0
},
s,
h,
o = this.size,
e = {
x: 0,
y: 0
};
r = r || this.zoomBox.position;
this.normalSize = this.image.node.jGetSize();
this.size = this.image.node.jGetSize();
this.boundaries = this.image.node.getBoundingClientRect();
f.height || (f = this.size); (this.option("upscale") === !1 || this.zoomBox.mode === !1 || this.zoomBox.mode === "preview") && (i = !1);
this.zoomBox.mode === "preview" && (u.width === "auto" && (u.width = this.zoomSizeOrigin.width), u.height === "auto" && (u.height = this.zoomSizeOrigin.height));
this.expanded && this.zoomBox.mode === "magnifier" && (u.width = 70, u.height = "auto");
this.zoomBox.mode === "magnifier" && u.height === "auto" ? (this.zoomBox.width = parseFloat(u.width / 100) * Math.min(f.width, f.height), this.zoomBox.height = this.zoomBox.width) : this.zoomBox.mode === "zoom" && r === "inner" ? (this.size = this.node.jGetSize(), f = this.size, this.boundaries = this.node.getBoundingClientRect(), this.zoomBox.width = f.width, this.zoomBox.height = f.height) : (this.zoomBox.width = u.wunits === "%" ? parseFloat(u.width / 100) * f.width: parseInt(u.width), this.zoomBox.height = u.hunits === "%" ? parseFloat(u.height / 100) * f.height: parseInt(u.height));
this.zoomBox.mode === "preview" && (h = Math.min(Math.min(this.zoomBox.width / this.zoomSizeOrigin.width, this.zoomBox.height / this.zoomSizeOrigin.height), 1), this.zoomBox.width = this.zoomSizeOrigin.width * h, this.zoomBox.height = this.zoomSizeOrigin.height * h);
this.zoomBox.width = Math.ceil(this.zoomBox.width);
this.zoomBox.height = Math.ceil(this.zoomBox.height);
this.zoomBox.aspectRatio = this.zoomBox.width / this.zoomBox.height;
this.zoomBox.node.jSetCss({
width: this.zoomBox.width,
height: this.zoomBox.height
});
i && (f = this.expanded ? this.expandBox.jGetSize() : this.zoomBox.node.jGetSize(), !this.expanded && this.normalSize.width * this.normalSize.height / (this.zoomSizeOrigin.width * this.zoomSizeOrigin.height) > .8 ? (this.zoomSize.width = 1.5 * this.zoomSizeOrigin.width, this.zoomSize.height = 1.5 * this.zoomSizeOrigin.height) : this.zoomSize = n.detach(this.zoomSizeOrigin));
this.zoomBox.mode === !1 || this.zoomBox.active || this.expanded && this.option("expandZoomOn") === "always" || (this.normalSize.width * this.normalSize.height / (this.zoomSize.width * this.zoomSize.height) > .8 ? (this.zoomSize = n.detach(this.zoomSizeOrigin), this.zoomBox.enable(!1)) : this.zoomBox.enable(!0));
this.zoomBox.image.jSetCss({
width: this.zoomSize.width,
height: this.zoomSize.height
});
this.zoomSize.maxWidth = this.zoomSize.width;
this.zoomSize.maxHeight = this.zoomSize.height;
s = this.zoomBox.node.getInnerSize();
this.zoomBox.innerWidth = Math.ceil(s.width);
this.zoomBox.innerHeight = Math.ceil(s.height);
this.lens.width = Math.ceil(this.zoomBox.innerWidth / (this.zoomSize.width / this.size.width));
this.lens.height = Math.ceil(this.zoomBox.innerHeight / (this.zoomSize.height / this.size.height));
this.lens.node.jSetCss({
width: this.lens.width,
height: this.lens.height
});
this.lens.image.jSetCss(this.size);
n.extend(this.lens, this.lens.node.jGetSize());
this.zoomBox.active && (clearTimeout(this.moveTimer), this.moveTimer = null, this.lens.innertouch ? (this.lens.pos.x *= this.size.width / o.width, this.lens.pos.y *= this.size.height / o.height, e.x = this.lens.spos.x, e.y = this.lens.spos.y) : (e.x = this.boundaries.left + this.lens.width / 2 + this.lens.pos.x * (this.size.width / o.width), e.y = this.boundaries.top + this.lens.height / 2 + this.lens.pos.y * (this.size.height / o.height)), this.animate(null, e))
},
reflowZoom: function(i) {
var e, u, r, f, h, o, s = t(this.node).jFetch("cr");
if (r = et(5), h = this.zoomBox.position, f = this.expanded ? "inner": this.zoomBox.custom ? "custom": this.option("zoom-position"), o = this.expanded && this.zoomBox.mode === "zoom" ? this.expandImageStage: document.body, this.expanded && (r.y = 0, r.x = 0), i || this.setSize(!0, f), e = this.boundaries.top, this.zoomBox.mode !== "magnifier") {
if (i) {
this.setSize(!1);
return
}
switch (f) {
case "inner":
case "custom":
e = 0;
u = 0;
break;
case "top":
e = this.boundaries.top - this.zoomBox.height - this.option("zoom-distance");
r.top > e && (e = this.boundaries.bottom + this.option("zoom-distance"), f = "bottom");
u = this.boundaries.left;
break;
case "bottom":
e = this.boundaries.bottom + this.option("zoom-distance");
r.bottom < e + this.zoomBox.height && (e = this.boundaries.top - this.zoomBox.height - this.option("zoom-distance"), f = "top");
u = this.boundaries.left;
break;
case "left":
u = this.boundaries.left - this.zoomBox.width - this.option("zoom-distance");
r.left > u && r.right >= this.boundaries.right + this.option("zoom-distance") + this.zoomBox.width && (u = this.boundaries.right + this.option("zoom-distance"), f = "right");
break;
case "right":
default:
u = this.boundaries.right + this.option("zoom-distance");
r.right < u + this.zoomBox.width && r.left <= this.boundaries.left - this.zoomBox.width - this.option("zoom-distance") && (u = this.boundaries.left - this.zoomBox.width - this.option("zoom-distance"), f = "left")
}
switch (this.option("zoom-position")) {
case "top":
case "bottom":
(r.top > e || r.bottom < e + this.zoomBox.height) && (f = "inner");
break;
case "left":
case "right":
(r.left > u || r.right < u + this.zoomBox.width) && (f = "inner")
}
if (this.zoomBox.position = f, !this.zoomBox.activating && !this.zoomBox.active) {
n.browser.mobile && !this.expanded && (this.zoomBox.mode === "zoom" || this.zoomBox.mode === !1 && this.option("expand")) && (this.option("expand") ? this.zoomBox.enable(f !== "inner") : this.option("zoomOn") !== "click" && (this.zoomBox.trigger = f === "inner" ? "click": this.option("zoomOn"), this.unregisterActivateEvent(), this.unregisterDeactivateEvent(), this.registerActivateEvent(this.zoomBox.trigger === "click"), this.registerDeactivateEvent(this.zoomBox.trigger === "click" && !this.option("expand"))), this.showHint(!1, null, !this.image.loaded()));
return
}
if (this.setSize(!1), i) return;
f === "custom" && (o = this.zoomBox.custom, r.y = 0, r.x = 0);
f === "inner" ? (this.zoomBox.mode !== "preview" && (this.zoomBox.node.jAddClass("mz-inner"), this.node.jAddClass("mz-inner-zoom")), this.lens.hide(), e = this.boundaries.top + r.y, u = this.boundaries.left + r.x, e = 0, u = 0, this.expanded || (o = this.node)) : (e += r.y, u += r.x, this.node.jRemoveClass("mz-inner-zoom"), this.zoomBox.node.jRemoveClass("mz-inner"));
this.zoomBox.node.jSetCss({
top: e,
left: u
})
} else this.setSize(!1),
o = this.node,
!n.browser.mobile || this.expanded || this.zoomBox.activating || this.zoomBox.active || this.showHint(!1, null, !(this.option("lazyZoom") && this.image.loaded()));
this.zoomBox.node[this.expanded ? "jAddClass": "jRemoveClass"]("mz-expanded"); ! this.expanded && s && s.jAppendTo(this.zoomBox.mode === "zoom" && f === "inner" ? this.zoomBox.node: this.node, (Math.floor(Math.random() * 101) + 1) % 2 ? "top": "bottom");
this.zoomBox.node.jAppendTo(o)
},
changeZoomLevel: function(i) {
var e, r, f, o, s = !1,
u = i.isMouse ? 5 : 3 / 54;
if (this.zoomBox.active) {
if (t(i).stop(), u = (100 + u * Math.abs(i.deltaY)) / 100, i.deltaY < 0 && (u = 1 / u), this.zoomBox.mode === "magnifier") r = Math.max(100, Math.round(this.zoomBox.width * u)),
r = Math.min(r, this.size.width * .9),
f = r / this.zoomBox.aspectRatio,
this.zoomBox.width = Math.ceil(r),
this.zoomBox.height = Math.ceil(f),
this.zoomBox.node.jSetCss({
width: this.zoomBox.width,
height: this.zoomBox.height
}),
e = this.zoomBox.node.getInnerSize(),
this.zoomBox.innerWidth = Math.ceil(e.width),
this.zoomBox.innerHeight = Math.ceil(e.height),
s = !0;
else {
if (this.expanded || this.zoomBox.mode !== "zoom") return;
r = Math.max(this.size.width, Math.round(this.zoomSize.width * u));
r = Math.min(r, this.zoomSize.maxWidth);
f = r / (this.zoomSize.maxWidth / this.zoomSize.maxHeight);
this.zoomSize.width = Math.ceil(r);
this.zoomSize.height = Math.ceil(f)
}
o = t(window).jGetScroll();
this.lens.width = this.zoomBox.innerWidth / (this.zoomSize.width / this.size.width);
this.lens.height = this.zoomBox.innerHeight / (this.zoomSize.height / this.size.height);
this.lens.node.jSetCss({
width: this.lens.width,
height: this.lens.height
});
n.extend(this.lens, this.lens.node.jGetSize());
this.zoomBox.active && (clearTimeout(this.moveTimer), this.moveTimer = null, s && (this.moveTimer = !0), this.animate(null, {
x: i.x - o.x,
y: i.y - o.y
}), s && (this.moveTimer = null))
}
},
registerActivateEvent: function(i) {
var r, u = i ? "dbltap btnclick": "touchstart" + (window.navigator.pointerEnabled ? " pointerdown": window.navigator.msPointerEnabled ? " MSPointerDown": "") + (window.navigator.pointerEnabled ? " pointermove": window.navigator.msPointerEnabled ? " MSPointerMove": " mousemove"),
f = this.node.jFetch("mz:handlers:activate:fn", i ? t(this.activate).jBindAsEvent(this) : t(function(i) { (!i.isTouchEvent() || i.isPrimaryTouch()) && (i && i.pointerType === "touch" && i.type !== "pointerdown" || (r = n.browser.ieMode < 9 ? n.extend({},
i) : i, this.activateTimer || (clearTimeout(this.activateTimer), this.activateTimer = setTimeout(t(function() {
this.activate(r)
}).jBind(this), 120))))
}).jBindAsEvent(this));
this.node.jStore("mz:handlers:activate:event", u).jAddEvent(u, f, 10)
},
unregisterActivateEvent: function() {
var n = this.node.jFetch("mz:handlers:activate:event"),
t = this.node.jFetch("mz:handlers:activate:fn");
this.node.jRemoveEvent(n, t);
this.node.jDel("mz:handlers:activate:fn")
},
registerDeactivateEvent: function(i) {
var r = "touchend",
u;
r += window.navigator.pointerEnabled ? " pointerup pointerout pointermove": window.navigator.msPointerEnabled ? " MSPointerUp MSPointerOut MSPointerMove": " mouseout mousemove";
i && (this.expanded || n.browser.mobile ? r = "dbltap btnclick": r += " dbltap btnclick");
u = this.node.jFetch("mz:handlers:deactivate:fn", t(function(n) {
if ((!n.isTouchEvent() || n.isPrimaryTouch()) && (!n || n.type !== "pointerup" || n.pointerType === "touch")) if (n && (n.type === "pointermove" || n.type === "MSPointerMove" || n.type === "mousemove")) {
if (!this.ready || !this.zoomBox.enabled || !this.zoomBox.active) return;
var t = n.getClientXY();
if (t.x < this.boundaries.left || t.x > this.boundaries.right || t.y < this.boundaries.top || t.y > this.boundaries.bottom) {
this.deactivate(n);
return
}
} else if (this.zoomBox.node !== n.getRelated() && !((this.zoomBox.position === "inner" || this.zoomBox.mode === "magnifier") && this.zoomBox.node.hasChild(n.getRelated())) && !this.node.hasChild(n.getRelated())) {
this.deactivate(n);
return
}
}).jBindAsEvent(this));
this.node.jStore("mz:handlers:deactivate:event", r).jAddEvent(r, u, 20)
},
unregisterDeactivateEvent: function() {
var n = this.node.jFetch("mz:handlers:deactivate:event"),
t = this.node.jFetch("mz:handlers:deactivate:fn");
this.node.jRemoveEvent(n, t);
this.node.jDel("mz:handlers:deactivate:fn")
},
registerAnimateEvent: function() {
var i = "touchmove",
r;
n.browser.platform !== "android" && (i += window.navigator.pointerEnabled ? " pointermove": window.navigator.msPointerEnabled ? " MSPointerMove": " mousemove");
r = this.node.jFetch("mz:handlers:animate:fn", t(this.animate).jBindAsEvent(this));
this.node.jStore("mz:handlers:animate:event", i).jAddEvent(i, r)
},
unregisterAnimateEvent: function() {
var n = this.node.jFetch("mz:handlers:animate:event"),
t = this.node.jFetch("mz:handlers:animate:fn");
this.node.jRemoveEvent(n, t)
},
registerEvents: function() {
this.moveBind = this.move.jBind(this);
this.node.jAddEvent(["touchstart", window.navigator.pointerEnabled ? "pointerdown": "MSPointerDown"], t(function(t) { (n.browser.androidBrowser && this.option("zoomMode") && this.option("zoomOn") !== "click" && t.type === "touchstart" && (t.stopDefaults(), n.browser.gecko && t.stopDistribution()), this.zoomBox.active) && this.zoomBox.position === "inner" && t.isPrimaryTouch() && (this.lens.spos = t.getClientXY())
}).jBindAsEvent(this), 10);
this.node.jAddEvent(["touchend", window.navigator.pointerEnabled ? "pointerup": "MSPointerUp"], t(function(n) {
n.isTouchEvent() && n.isPrimaryTouch() && (this.lens.touchmovement = !1)
}).jBindAsEvent(this), 10);
this.registerAnimateEvent();
this.option("zoomMode") && (this.registerActivateEvent(this.option("zoomOn") === "click"), this.registerDeactivateEvent(this.option("zoomOn") === "click"));
this.node.jAddEvent("mousedown",
function(n) {
n.stopDistribution()
},
10).jAddEvent("btnclick", t(function(n) {
this.node.jRaiseEvent("MouseEvent", "click");
this.expanded && this.expandBox.jCallEvent("btnclick", n)
}).jBind(this), 15);
this.option("expand") ? this.node.jAddEvent("tap btnclick", t(this.expand).jBindAsEvent(this), 15) : this.node.jAddEvent("tap btnclick", t(this.openLink).jBindAsEvent(this), 15);
this.additionalImages.length > 1 && this.swipe(); ! n.browser.mobile && this.option("variableZoom") && this.node.jAddEvent("mousescroll", this.changeZoomLevel.jBindAsEvent(this));
n.browser.mobile && this.pinchToZoom();
t(window).jAddEvent(n.browser.mobile ? "resize": "resize scroll", this.onResize);
this.option("history") && t(window).jAddEvent("popstate", this.onHistoryStateChange)
},
unregisterEvents: function() {
this.node && this.node.jRemoveEvent("mousescroll");
t(window).jRemoveEvent("resize scroll", this.onResize);
this.option("history") && t(window).jRemoveEvent("popstate", this.onHistoryStateChange);
t(this.additionalImages).jEach(function(n) {
t(n.origin).jClearEvents()
})
},
activate: function(i) {
var r, u, s, e, o, h = 0,
c = 0;
if (!this.image.loaded() || !this.ready || !this.zoomBox.enabled || this.zoomBox.active || this.zoomBox.activating) {
this.image.loaded() || this.initEvent || (i && (this.initEvent = d(i), i.stopQueue()), this.image.load(this.setupZoom.jBind(this)), this.loadTimer || (this.loadTimer = t(this.showLoading).jBind(this).jDelay(400)));
return
}
if (!i || i.type !== "pointermove" || i.pointerType !== "touch") {
if (!this.option("zoomMode") && this.option("expand") && !this.expanded) {
this.zoomBox.active = !0;
return
}
this.zoomBox.activating = !0;
this.expanded && this.zoomBox.mode === "zoom" && (e = this.image.node.jGetRect(), this.expandStage.jAddClass("mz-zoom-in"), o = this.expandFigure.jGetRect(), c = (e.left + e.right) / 2 - (o.left + o.right) / 2, h = (e.top + e.bottom) / 2 - (o.top + o.bottom) / 2);
this.zoomBox.image.jRemoveEvent("transitionend");
this.zoomBox.node.jRemoveClass("mz-deactivating").jRemoveEvent("transitionend");
this.zoomBox.node.jAddClass("mz-activating");
this.node.jAddClass("mz-activating");
this.reflowZoom();
u = this.zoomBox.mode === "zoom" ? this.zoomBox.position: this.zoomBox.mode; ! n.browser.features.transition || this.expanded && this.option("expandZoomOn") === "always" ? (this.zoomBox.node.jRemoveClass("mz-activating"), this.zoomBox.activating = !1, this.zoomBox.active = !0) : u === "inner" ? (s = this.image.node.jGetSize(), this.zoomBox.image.jSetCss({
transform: "translate3d(0," + h + "px, 0) scale(" + s.width / this.zoomSize.width + ", " + s.height / this.zoomSize.height + ")"
}).jGetSize(), this.zoomBox.image.jAddEvent("transitionend", t(function() {
this.zoomBox.image.jRemoveEvent("transitionend");
this.zoomBox.node.jRemoveClass("mz-activating mz-p-" + u);
this.zoomBox.activating = !1;
this.zoomBox.active = !0
}).jBind(this)), this.zoomBox.node.jAddClass("mz-p-" + u).jGetSize(), !n.browser.mobile && n.browser.chrome && (n.browser.uaName === "chrome" || n.browser.uaName === "opera") && (this.zoomBox.activating = !1, this.zoomBox.active = !0)) : (this.zoomBox.node.jAddEvent("transitionend", t(function() {
this.zoomBox.node.jRemoveEvent("transitionend");
this.zoomBox.node.jRemoveClass("mz-activating mz-p-" + u)
}).jBind(this)), this.zoomBox.node.jSetCss({
transition: "none"
}), this.zoomBox.node.jAddClass("mz-p-" + u).jGetSize(), this.zoomBox.node.jSetCss({
transition: ""
}).jGetSize(), this.zoomBox.node.jRemoveClass("mz-p-" + u), this.zoomBox.activating = !1, this.zoomBox.active = !0);
this.expanded || this.showHint(!0);
i ? (i.stop().stopQueue(), r = i.getClientXY(), this.zoomBox.mode === "magnifier" && /tap/i.test(i.type) && (r.y -= this.zoomBox.height / 2 + 10), u === "inner" && (/tap/i.test(i.type) || i.isTouchEvent()) && (this.lens.pos = {
x: 0,
y: 0
},
r.x = -(r.x - this.boundaries.left - this.size.width / 2) * (this.zoomSize.width / this.size.width), r.y = -(r.y - this.boundaries.top - this.size.height / 2) * (this.zoomSize.height / this.size.height))) : (r = {
x: this.boundaries.left + (this.boundaries.right - this.boundaries.left) / 2,
y: this.boundaries.top + (this.boundaries.bottom - this.boundaries.top) / 2
},
n.browser.mobile && this.expanded && this.option("expandZoomOn") === "always" && (this.lens.innertouch = !0, this.lens.pos = {
x: 0,
y: 0
},
r.x = -(r.x - this.boundaries.left - this.size.width / 2) * (this.zoomSize.width / this.size.width), r.y = -(r.y - this.boundaries.top - this.size.height / 2) * (this.zoomSize.height / this.size.height)));
this.node.jRemoveClass("mz-activating").jAddClass("mz-active");
r.x += -c;
r.y += -h;
this.lens.spos = {
x: 0,
y: 0
};
this.lens.dx = 0;
this.lens.dy = 0;
this.animate(i, r, !0);
f("onZoomIn", this.id)
}
},
deactivate: function(i, r) {
var o, s, u, e, h = 0,
l = 0,
c = this.zoomBox.active; (this.initEvent = null, this.ready) && (i && i.type === "pointerout" && i.pointerType === "touch" || (clearTimeout(this.moveTimer), this.moveTimer = null, clearTimeout(this.activateTimer), this.activateTimer = null, this.zoomBox.activating = !1, this.zoomBox.active = !1, r === !0 || this.expanded || c && (n.browser.mobile && !this.expanded && this.zoomBox.mode === "zoom" ? this.reflowZoom() : this.showHint()), this.zoomBox.enabled) && (i && i.stop(), this.zoomBox.image.jRemoveEvent("transitionend"), this.zoomBox.node.jRemoveClass("mz-activating").jRemoveEvent("transitionend"), this.expanded && (e = this.expandFigure.jGetRect(), this.option("expandZoomOn") !== "always" && this.expandStage.jRemoveClass("mz-zoom-in"), this.image.node.jSetCss({
"max-height": this.expandMaxHeight()
}), u = this.image.node.jGetRect(), l = (u.left + u.right) / 2 - (e.left + e.right) / 2, h = (u.top + u.bottom) / 2 - (e.top + e.bottom) / 2), o = this.zoomBox.mode === "zoom" ? this.zoomBox.position: this.zoomBox.mode, !n.browser.features.transition || !i || this.expanded && this.option("expandZoomOn") === "always" ? (this.zoomBox.hide(), this.node.jRemoveClass("mz-active")) : o === "inner" ? (this.zoomBox.image.jAddEvent("transitionend", t(function() {
this.zoomBox.image.jRemoveEvent("transitionend");
this.node.jRemoveClass("mz-active");
setTimeout(t(function() {
this.zoomBox.hide()
}).jBind(this), 32)
}).jBind(this)), s = this.image.node.jGetSize(), this.zoomBox.node.jAddClass("mz-deactivating mz-p-" + o).jGetSize(), this.zoomBox.image.jSetCss({
transform: "translate3d(0," + h + "px,0) scale(" + s.width / this.zoomSize.maxWidth + ", " + s.height / this.zoomSize.maxHeight + ")"
})) : (this.zoomBox.node.jAddEvent("transitionend", t(function() {
this.zoomBox.hide();
this.node.jRemoveClass("mz-active")
}).jBind(this)), this.zoomBox.node.jGetCss("opacity"), this.zoomBox.node.jAddClass("mz-deactivating mz-p-" + o), this.node.jRemoveClass("mz-active")), this.lens.dx = 0, this.lens.dy = 0, this.lens.spos = {
x: 0,
y: 0
},
this.lens.hide(), c && f("onZoomOut", this.id)))
},
animate: function(i, r, u) {
var f = r,
e, o, h = 0,
c, l = 0,
a, s = !1;
if (this.zoomBox.active || u) {
if (i) {
if (t(i).stopDefaults().stopDistribution(), i.isTouchEvent() && !i.isPrimaryTouch()) return;
s = /tap/i.test(i.type) || i.isTouchEvent();
s && !this.lens.touchmovement && (this.lens.touchmovement = s);
f || (f = i.getClientXY())
}
this.zoomBox.mode !== "preview" && (this.zoomBox.mode === "zoom" && this.zoomBox.position === "inner" && (i && s || !i && this.lens.innertouch) ? (this.lens.innertouch = !0, e = this.lens.pos.x + (f.x - this.lens.spos.x), o = this.lens.pos.y + (f.y - this.lens.spos.y), this.lens.spos = f, h = Math.min(0, this.zoomBox.innerWidth - this.zoomSize.width) / 2, c = -h, l = Math.min(0, this.zoomBox.innerHeight - this.zoomSize.height) / 2, a = -l) : (this.lens.innertouch = !1, this.zoomBox.mode === "magnifier" && (f.y = Math.max(this.boundaries.top, Math.min(f.y, this.boundaries.bottom)), f.x = Math.max(this.boundaries.left, Math.min(f.x, this.boundaries.right))), e = f.x - this.boundaries.left, o = f.y - this.boundaries.top, c = this.size.width - this.lens.width, a = this.size.height - this.lens.height, e -= this.lens.width / 2, o -= this.lens.height / 2), this.zoomBox.mode !== "magnifier" && (e = Math.max(h, Math.min(e, c)), o = Math.max(l, Math.min(o, a))), this.lens.pos.x = e, this.lens.pos.y = o, this.zoomBox.mode === "zoom" && (n.browser.features.transform ? (this.lens.node.jSetCss({
transform: "translate(" + this.lens.pos.x + "px," + this.lens.pos.y + "px)"
}), this.lens.image.jSetCss({
transform: "translate(" + -(this.lens.pos.x + this.lens.border.x) + "px, " + -(this.lens.pos.y + this.lens.border.y) + "px)"
})) : (this.lens.node.jSetCss({
top: this.lens.pos.y,
left: this.lens.pos.x
}), this.lens.image.jSetCss({
top: -(this.lens.pos.y + this.lens.border.y),
left: -(this.lens.pos.x + this.lens.border.x)
}))), this.zoomBox.mode === "magnifier" && (!this.lens.touchmovement || i && i.type === "dbltap" || (f.y -= this.zoomBox.height / 2 + 10), this.zoomBox.node.jSetCss({
top: f.y - this.boundaries.top - this.zoomBox.height / 2,
left: f.x - this.boundaries.left - this.zoomBox.width / 2
})), this.moveTimer || (this.lens.dx = 0, this.lens.dy = 0, this.move(1)))
}
},
move: function(t) {
var u, f, i, r, e, o; (isFinite(t) || (t = this.lens.innertouch ? this.lens.touchmovement ? .4 : .16 : this.option("smoothing") ? .2 : this.lens.touchmovement ? .4 : .8), u = (this.lens.pos.x - this.lens.dx) * t, f = (this.lens.pos.y - this.lens.dy) * t, this.lens.dx += u, this.lens.dy += f, (!this.moveTimer || Math.abs(u) > 1e-6 || Math.abs(f) > 1e-6) && (this.lens.innertouch ? (i = this.lens.dx, r = this.lens.dy) : (i = this.lens.dx * (this.zoomSize.width / this.size.width) - Math.max(0, this.zoomSize.width - this.zoomBox.innerWidth) / 2, r = this.lens.dy * (this.zoomSize.height / this.size.height) - Math.max(0, this.zoomSize.height - this.zoomBox.innerHeight) / 2, this.zoomBox.mode === "magnifier" && (i = Math.round(i), r = Math.round(r)), i = -i, r = -r), e = this.zoomSize.width / this.zoomSize.maxWidth, o = this.zoomSize.height / this.zoomSize.maxHeight, this.zoomBox.image.jSetCss(n.browser.features.transform ? {
transform: ut + i + "px," + r + "px" + ft + " scale(" + e + "," + o + ")"
}: {
width: this.zoomSize.width,
height: this.zoomSize.height,
left: -(this.lens.dx * (this.zoomSize.width / this.size.width) + Math.min(0, this.zoomSize.width - this.zoomBox.innerWidth) / 2),
top: -(this.lens.dy * (this.zoomSize.height / this.size.height) + Math.min(0, this.zoomSize.height - this.zoomBox.innerHeight) / 2)
})), this.zoomBox.mode !== "magnifier") && (this.moveTimer = setTimeout(this.moveBind, 16))
},
swipe: function() {
var u, f, a = 30,
v = 201,
c, l = "",
e = {},
r, i, o = 0,
y = {
transition: n.browser.cssTransform + String.fromCharCode(32) + "300ms cubic-bezier(.18,.35,.58,1)"
},
s,
h,
p = t(function(n) {
if (this.ready && !this.zoomBox.active) if (n.state === "dragstart") clearTimeout(this.activateTimer),
this.activateTimer = null,
o = 0,
e = {
x: n.x,
y: n.y,
ts: n.timeStamp
},
u = this.size.width,
f = u / 2,
this.image.node.jRemoveEvent("transitionend"),
this.image.node.jSetCssProp("transition", ""),
this.image.node.jSetCssProp("transform", "translate3d(0, 0, 0)"),
h = null;
else {
if (r = n.x - e.x, i = {
x: 0,
y: 0,
z: 0
},
h === null && (h = Math.abs(n.x - e.x) < Math.abs(n.y - e.y)), h) return;
if (n.stop(), n.state === "dragend") {
o = 0;
s = null;
c = n.timeStamp - e.ts; (Math.abs(r) > f || c < v && Math.abs(r) > a) && (l = r > 0 ? "backward": r <= 0 ? "forward": "") && (l === "backward" ? (s = this.getPrev(), o += u * 10) : (s = this.getNext(), o -= u * 10));
i.x = o;
i.deg = -90 * (i.x / u);
this.image.node.jAddEvent("transitionend", t(function() {
this.image.node.jRemoveEvent("transitionend");
this.image.node.jSetCssProp("transition", "");
s && (this.image.node.jSetCss({
transform: "translate3d(" + i.x + "px, 0px, 0px)"
}), this.update(s, !0))
}).jBind(this));
this.image.node.jSetCss(y);
this.image.node.jSetCss({
"transition-duration": i.x ? "100ms": "300ms",
opacity: 1 - .2 * Math.abs(i.x / u),
transform: "translate3d(" + i.x + "px, 0px, 0px)"
});
r = 0;
return
}
i.x = r;
i.z = -50 * Math.abs(i.x / f);
i.deg = -60 * (i.x / f);
this.image.node.jSetCss({
opacity: 1 - .2 * Math.abs(i.x / f),
transform: "translate3d(" + i.x + "px, 0px, " + i.z + "px)"
})
}
}).jBind(this);
this.node.jAddEvent("touchdrag", p)
},
pinchToZoom: function() {
var u = {
width: 0,
height: 0
},
r = !1,
i,
e = t(function(t, r, f) {
var e, s, o; (this.zoomBox.active || f) && (o = n.detach(this.zoomSize), e = Math.max(i.width, Math.round(u.width * t)), e = Math.min(e, this.zoomSize.maxWidth), s = e / (this.zoomSize.maxWidth / this.zoomSize.maxHeight), this.zoomSize.width = Math.floor(e), this.zoomSize.height = Math.floor(s), this.lens.width = Math.ceil(this.zoomBox.innerWidth / (this.zoomSize.width / i.width)), this.lens.height = Math.ceil(this.zoomBox.innerHeight / (this.zoomSize.height / i.height)), this.lens.node.jSetCss({
width: this.lens.width,
height: this.lens.height
}), n.extend(this.lens, this.lens.node.jGetSize()), clearTimeout(this.moveTimer), this.moveTimer = null, r.x = this.lens.spos.x * (this.zoomSize.width / o.width) + (r.x - this.boundaries.left - this.size.width / 2) * (1 - this.zoomSize.width / o.width), r.y = this.lens.spos.y * (this.zoomSize.height / o.height) + (r.y - this.boundaries.top - this.size.height / 2) * (1 - this.zoomSize.height / o.height), this.lens.spos = {
x: 0,
y: 0
},
this.lens.pos = {
x: 0,
y: 0
},
this.lens.innertouch = !0, this.animate(null, {
x: r.x,
y: r.y
}), clearTimeout(this.moveTimer), this.moveTimer = null)
}).jBind(this),
o = t(function(o) {
if (r || o.state === "pinchstart" || o.cloned) {
o.stop();
var h = t(window).jGetScroll(),
s = !1,
c = {
x: o.centerPoint.x - h.x,
y: o.centerPoint.y - h.y
};
switch (o.state) {
case "pinchstart":
this.unregisterAnimateEvent();
u = n.detach(this.zoomSize);
i = this.expanded ? this.image.node.jGetSize() : this.size;
clearTimeout(this.moveTimer);
this.moveTimer = null;
this.zoomBox.active && (this.lens.spos = n.detach(this.lens.pos));
r = !0;
break;
case "pinchend":
r = !1;
this.zoomBox.active && (this.option("expandZoomOn") !== "always" && this.zoomSize.width <= i.width && this.zoomSize.height <= i.height ? (r = !1, this.deactivate(null)) : o.points.length > 0 && (this.lens.spos = {
x: o.points[0].clientX,
y: o.points[0].clientY
}));
this.registerAnimateEvent();
break;
case "pinchmove":
if (this.expanded && o.zoom === -1 && (!this.zoomBox.active || this.option("expandZoomOn") === "always")) o.scale < it && this.close();
else if (!this.expanded || o.zoom !== 1 || this.option("expandZoomOn") !== "always") if (this.option("expand") && !this.expanded) {
if (o.scale > tt) {
r = !1;
this.registerAnimateEvent();
this.expand(o);
return
}
} else {
if (o.zoom === 1 && !this.zoomBox.active) {
if (!this.image.loaded() || !this.ready || !this.zoomBox.enabled) {
this.image.loaded() || this.initEvent || (o && (this.initEvent = d(o), o.stopQueue()), this.image.load(this.setupZoom.jBind(this)), this.loadTimer || (this.loadTimer = t(this.showLoading).jBind(this).jDelay(400)));
return
}
this.zoomBox.activating = !0;
this.expanded && this.zoomBox.mode === "zoom" && this.expandStage.jAddClass("mz-zoom-in");
this.zoomBox.image.jRemoveEvent("transitionend");
this.zoomBox.node.jRemoveClass("mz-deactivating").jRemoveEvent("transitionend");
this.zoomBox.node.jAddClass("mz-activating");
this.node.jAddClass("mz-activating");
this.reflowZoom();
this.zoomSize.width = i.width;
this.zoomSize.height = i.height;
this.zoomBox.activating = !1;
this.zoomBox.active = !0;
u = n.detach(this.zoomSize);
this.zoomBox.node.jRemoveClass("mz-activating");
this.node.jRemoveClass("mz-activating").jAddClass("mz-active");
this.lens.spos = {
x: 0,
y: 0
};
this.lens.pos = {
x: 0,
y: 0
};
s = !0
}
e(o.scale, c, s);
s && f("onZoomIn", this.id)
}
}
}
}).jBind(this);
this.node.jAddEvent("pinch", o)
},
setupButtons: function() {
var i = document.createDocumentFragment();
t(["prev", "next", "close"]).jEach(function(t) {
var r = "mz-button";
this.buttons[t] = n.$new("button", {
type: "button",
title: this.option("text-btn-" + t)
}).jAddClass(r).jAddClass(r + "-" + t);
i.appendChild(this.buttons[t]);
switch (t) {
case "prev":
this.buttons[t].jAddEvent("tap btnclick",
function(n) {
n.stop();
this.update(this.getPrev())
}.jBindAsEvent(this));
break;
case "next":
this.buttons[t].jAddEvent("tap btnclick",
function(n) {
n.stop();
this.update(this.getNext())
}.jBindAsEvent(this));
break;
case "close":
this.buttons[t].jAddEvent("tap btnclick",
function(n) {
n.stop();
this.close()
}.jBindAsEvent(this)).hide()
}
},
this);
this.toggleNavButtons(this.additionalImages.length > 1);
this.navControlsLayer = n.$new("div").jAddClass("mz-nav-controls").append(i).jAppendTo(this.node)
},
toggleNavButtons: function(n) {
n ? (this.buttons.next.show(), this.buttons.prev.show()) : (this.buttons.next.hide(), this.buttons.prev.hide())
},
openLink: function() {
this.image.link && window.open(this.image.link, "_self")
},
getNext: function() {
var n = (this.expanded ? this.expandGallery: this.additionalImages).filter(function(n) {
return n.small.state !== -1 || n.zoom.state !== -1
}),
i = n.length,
r = t(n).indexOf(this.image) + 1;
return i <= 1 ? null: n[r >= i ? 0 : r]
},
getPrev: function() {
var n = (this.expanded ? this.expandGallery: this.additionalImages).filter(function(n) {
return n.small.state !== -1 || n.zoom.state !== -1
}),
i = n.length,
r = t(n).indexOf(this.image) - 1;
return i <= 1 ? null: n[r < 0 ? i - 1 : r]
},
imageByURL: function(t, i) {
var r = this.additionalImages.filter(function(n) {
return (n.zoom.src.has(t) || n.zoom.url.has(t)) && (n.small.src.has(i) || n.small.url.has(i))
}) || [];
return r[0] || (i && t && n.jTypeOf(i) === "string" && n.jTypeOf(t) === "string" ? new s(i, t) : null)
},
imageByOrigin: function(n) {
var t = this.additionalImages.filter(function(t) {
return t.origin === n
}) || [];
return t[0]
},
imageByIndex: function(n) {
return this.additionalImages[n]
}
},
h = {
version: "v5.3.3 DEMO",
start: function(i, f) {
var e = null,
o = [];
return n.$A(i ? [t(i)] : n.$A(document.byClass("magiczoom")).concat(n.$A(document.byClass("magiczoomPlus")))).jEach(t(function(n) {
t(n) && (r(n) || (e = new p(n, f), v && !e.option("autostart") ? (e.stop(), e = null) : (u.push(e), o.push(e))))
}).jBind(this)),
i ? o[0] : o
},
stop: function(n) {
var i, t;
if (n) { (t = r(n)) && (t = u.splice(u.indexOf(t), 1)) && t[0].stop() && delete t[0];
return
}
while (i = u.length) t = u.splice(i - 1, 1),
t[0].stop(),
delete t[0]
},
refresh: function(n) {
return this.stop(n),
this.start(n)
},
update: function(t, i, u) {
var f = r(t),
e;
f && (e = n.jTypeOf(i) === "element" ? f.imageByOrigin(i) : f.imageByURL(i, u), e && f.update(e))
},
switchTo: function(t, i) {
var u = r(t),
f;
if (u) {
switch (n.jTypeOf(i)) {
case "element":
f = u.imageByOrigin(i);
break;
case "number":
f = u.imageByIndex(i)
}
f && u.update(f)
}
},
prev: function(n) {
var t; (t = r(n)) && t.update(t.getPrev())
},
next: function(n) {
var t; (t = r(n)) && t.update(t.getNext())
},
zoomIn: function(n) {
var t; (t = r(n)) && t.activate()
},
zoomOut: function(n) {
var t; (t = r(n)) && t.deactivate()
},
registerCallback: function(t, i) {
c[t] || (c[t] = []);
n.jTypeOf(i) === "function" && c[t].push(i)
},
running: function(n) {
return !! r(n)
}
},
t(document).jAddEvent("domready",
function() {
var i = window[a + "Options"] || {},
t;
for (o = o(), st(), l = n.$new("div", {
"class": "magic-hidden-wrapper"
}).jAppendTo(document.body), k = n.browser.mobile && window.matchMedia && window.matchMedia("(max-device-width: 767px), (max-device-height: 767px)").matches, n.browser.mobile && n.extend(w, b), k && n.browser.platform === "ios" && (y = n.$new("div").jSetCss({
position: "fixed",
top: 0,
width: 0,
height: "100vh"
})), t = 0; t < e.length; t++) i[e[t]] && n.$F !== i[e[t]] && h.registerCallback(e[t], i[e[t]]);
h.start();
v = !1
}),
window.MagicZoomPlus = window.MagicZoomPlus || {},
h
} (),
function() {
var n = function() {};
n.version = "20200509";
n.query = function(n) {
n = n.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var i = new RegExp("[\\?&]" + n + "=([^]*)"),
t = i.exec(window.location.href);
return t === null ? "": decodeURIComponent(t[1])
};
n.isNullOrEmpty = function(n) {
if (n === null || n === undefined) return ! 0;
var t = n.replace(/^\s+|\s+$/g, "");
return t === "" || t.length === 0
};
n.closest = function(n, t) {
for (var i = n.matches || n.webkitMatchesSelector || n.mozMatchesSelector || n.msMatchesSelector; n;) {
if (i.call(n, t)) break;
n = n.parentElement
}
return n
};
n.serializeForm = function(n) {
for (var f = [], t = null, u, s, i, e, h = n, r = 0, o = h.elements.length; r < o; r++) if (t = h.elements[r], !t.disabled) switch (t.type) {
case "file":
case "submit":
case "button":
case "image":
case "reset":
case undefined:
break;
case "select-one":
case "select-multiple":
if (t.name && t.name.length) for (u = 0, s = t.options.length; u < s; u++) i = t.options[u],
e = "",
i.selected && (e = i.hasAttribute ? i.hasAttribute("value") ? i.value: i.text: i.attributes("value").specified ? i.value: i.text, f.push(encodeURIComponent(t.name) + "=" + encodeURIComponent(e)));
break;
case "radio":
case "checkbox":
if (!t.checked) break;
default:
t.name && t.name.length && f.push(encodeURIComponent(t.name) + "=" + encodeURIComponent(t.value))
}
return f.join("&")
};
n.serialize = function(n) {
var i = [];
for (var t in n) n.hasOwnProperty(t) && i.push(encodeURIComponent(t) + "=" + encodeURIComponent(n[t]));
return i.join("&")
};
n.ajax = function(n, t, i, r) {
var u = new XMLHttpRequest;
u.ontimeout = function() {
console.error("The request for " + n + " timed out.")
};
u.onreadystatechange = function() {
if (r) switch (u.readyState) {
case 1:
r.beforeSend && r.beforeSend();
break;
case 4:
u.status === 200 ? r.success && r.success(u.responseText) : r.error && r.error(u.responseText);
r.complete && r.complete()
}
};
u.open(t, n, !0);
u.timeout = 5e3;
u.setRequestHeader("X-Requested-With", "XMLHttpRequest");
u.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
u.send(i)
};
n.search = function(n) {
var t = n,
r, f;
if (event.type === "click" || event.type === "keyup" && event.keyCode === 13) {
if (event.keyCode !== 13 && (r = n.getAttribute("data-control-id"), t = document.getElementById(r)), t === null || t === undefined || t.value === "") return;
var u = t.getAttribute("data-pagesize"),
e = t.getAttribute("data-type"),
o = t.value,
i = "/search/" + e + "?q=" + o;
t.hasAttribute("data-categoryid") && (f = t.getAttribute("data-categoryid"), i += "&cid=" + f);
u != null && (i += "&s=" + u);
location.href = i
}
};
n.download = function(t, i, r) {
var u = {};
u.type = t;
u.cid = i;
u.key = r;
n.ajax("/do_down/beforeprocess", "POST", n.serialize(u), {
success: function(n) {
var t = JSON.parse(n);
switch (t.Status) {
case "Error":
alert(t.Message);
window.location.href = "/user/login";
break;
case "Warning":
alert(t.Message);
break;
case "Success":
window.location.target = "_blank";
window.location.href = "/do_down/get?key=" + t.Content
}
}
})
};
n.bannerInit = function() {
var r = document.getElementsByClassName("swiper-container"),
u,
i,
n,
t,
f;
if (r.length > 0) for (u = [], i = 0; i < r.length; i++) n = r[i],
n.hasAttribute("data-thumbs") || (t = n.getAttribute("data-ident"), f = new Swiper(n, {
autoplay: n.hasAttribute("data-autoplay") ? {
delay: parseInt(n.getAttribute("data-delay")),
disableOnInteraction: n.hasAttribute("data-disableOnInteraction")
}: !1,
initialSlide: n.getAttribute("data-initialSlide") !== null ? parseInt(n.getAttribute("data-initialSlide")) : 0,
centeredSlides: n.hasAttribute("data-centeredSlides"),
centeredSlidesBounds: !0,
loop: n.hasAttribute("data-loop"),
direction: n.getAttribute("data-direction") || "horizontal",
speed: parseInt(n.getAttribute("data-speed")),
parallax: n.hasAttribute("data-parallax"),
autoHeight: !1,
roundLengths: !0,
keyboard: {
enabled: !0,
onlyInViewport: !0
},
lazy: n.hasAttribute("data-lazy"),
effect: n.getAttribute("data-effect") || "slide",
fadeEffect: {
crossFade: !0
},
cubeEffect: {
slideShadows: !1,
shadow: !1,
shadowOffset: 100,
shadowScale: .6
},
breakpoints: n.getAttribute("data-breakpoints") !== null ? JSON.parse(n.getAttribute("data-breakpoints")) : "",
slidesPerColumnFill: "row",
spaceBetween: n.getAttribute("data-spaceBetween") !== null ? parseInt(n.getAttribute("data-spaceBetween")) : 0,
slidesPerView: n.getAttribute("data-slidesPerView") !== null ? n.getAttribute("data-slidesPerView") : 1,
watchSlide: n.hasAttribute("data-watchSlide"),
watchSlidesProgress: n.hasAttribute("data-watchSlide"),
watchSlidesVisibility: !0,
observer: !0,
observeParents: !0,
pagination: {
el: "#swiper-pagination-" + t,
type: n.getAttribute("data-paginationType") || "bullets",
clickable: !0
},
navigation: {
nextEl: "#swiper-button-next-" + t,
prevEl: "#swiper-button-prev-" + t
},
thumbs: {
swiper: n.hasAttribute("data-thumb-enable") ? {
el: ".gallery-thumb-" + t,
watchSlidesVisibility: !0,
slidesPerView: document.getElementsByClassName("gallery-thumb-" + t)[0].getAttribute("data-slidesPerView"),
spaceBetween: document.getElementsByClassName("gallery-thumb-" + t)[0].getAttribute("data-spaceBetween"),
breakpoints: JSON.parse(document.getElementsByClassName("gallery-thumb-" + t)[0].getAttribute("data-breakpoints"))
}: null
},
on: {
init: function() {
var i = this,
r = document.getElementById("swiper-button-prev-custom-" + t),
n;
r != null && r.addEventListener("click",
function() {
i.slidePrev()
});
n = document.getElementById("swiper-button-next-custom-" + t);
n != null && n.addEventListener("click",
function() {
i.slideNext()
})
},
progress: function() {
var r, t;
if (this.params.watchSlide === !0 && this.slides.length > 0) for (r = this.slides.eq(0)[0].clientWidth, t = 0; t < this.slides.length; t++) {
var i = this.slides.eq(t),
n = this.slides[t].progress,
u = 1;
Math.abs(n) > 1 && (u = (Math.abs(n) - 1) * .15 + 1);
var f = n * u * (r / 2) + "px",
e = 1 - Math.abs(n) / 5,
o = 999 - Math.abs(Math.round(10 * n));
i.transform("translateX(" + f + ") scale(" + e + ")");
i.css("zIndex", o);
i.css("opacity", 1);
Math.abs(n) > 5 && i.css("opacity", 0)
}
},
setTransition: function(n) {
for (var i, t = 0; t < this.slides.length; t++) i = this.slides.eq(t),
i.transition(n)
}
}
}))
};
n.postMessageInit = function() {
var i = document.querySelectorAll('input[data-provider="post-message"],button[data-provider="post-message"]'),
t;
if (i.length > 0) for (t = 0; t < i.length; t++) i[t].addEventListener("click",
function(t) {
var i = this,
u = i.nextElementSibling,
r = n.closest(this, "form");
r.checkValidity() === !1 ? (t.preventDefault(), t.stopPropagation(), r.classList.add("was-validated")) : n.ajax("/enquiry/post", "POST", n.serializeForm(r), {
beforeSend: function() {
i.setAttribute("disabled", "disabled")
},
success: function(t) {
var c = JSON.parse(t),
o,
r,
f,
e;
if (u.innerHTML = c.Message, c.Success) {
for (o = document.querySelectorAll("form input[type='text'],form textarea,form input[type='email']"), r = 0; r < o.length; r++) o[r].value = "";
if (f = document.querySelectorAll("form img[data-name='captchacode']"), f.length > 0) for (e = 0; e < f.length; e++) f[e].src = "/validate/captcha?t=" + Math.random();
var l = i.getAttribute("data-track"),
s = i.getAttribute("data-track-category"),
h = i.getAttribute("data-track-action"),
a = i.getAttribute("data-track-opt");
if (!n.isNullOrEmpty(l) && !n.isNullOrEmpty(s) && !n.isNullOrEmpty(h)) switch (l.toLowerCase()) {
case "google":
gtag("event", h, {
event_category: s,
event_label: a
});
break;
case "baidu":
_hmt.push(["_trackEvent", s, h, a]);
break;
default:
return
}
}
},
error: function(n) {
u.innerHTML = n
},
complete: function() {
i.removeAttribute("disabled")
}
})
})
};
n.initShare = function() {
var t = encodeURIComponent(location.href),
s = (window.screen.width - 410) / 2,
i = "width=400,height=400,top=100,left=" + s,
r = document.getElementsByClassName("share-facebook"),
u = document.getElementsByClassName("share-linkedin"),
f = document.getElementsByClassName("share-twitter"),
e = document.getElementsByClassName("share-qq"),
o = document.getElementsByClassName("share-weibo"),
n;
if (r.length > 0) for (n = 0; n < r.length; n++) r[n].addEventListener("click",
function() {
window.open("https://www.facebook.com/sharer/sharer.php?u=" + t, "", i)
});
if (u.length > 0) for (n = 0; n < u.length; n++) u[n].addEventListener("click",
function() {
window.open("https://www.linkedin.com/shareArticle?mini=true&url=" + t, "", i)
});
if (f.length > 0) for (n = 0; n < f.length; n++) f[n].addEventListener("click",
function() {
window.open("https://twitter.com/intent/tweet?url=" + t, "", i)
});
if (o.length > 0) for (n = 0; n < o.length; n++) o[n].addEventListener("click",
function() {
window.open("http://service.weibo.com/share/share.php?url=" + t, "", i)
});
if (e.length > 0) for (n = 0; n < e.length; n++) e[n].addEventListener("click",
function() {
window.open("http://connect.qq.com/widget/shareqq/index.html?url=" + t, "", i)
})
};
n.sticky = function() {
var n = document.querySelectorAll('[data-provider="sticky"]'),
t;
n.length > 0 && (t = new Sticky(n))
};
n.responsiveTable = function() {
var n = document.getElementById("license"),
r,
t,
u,
i;
if (n !== null && (r = n.getAttribute("data-responsive-table"), t = n.getAttribute("data-container"), r === "true" && t !== "")) for (u = document.querySelectorAll(t + "table"), i = 0; i < u.length; i++);
};
n.scrollTop = function() {
var n = document.getElementById("scroll-top");
if (n != null) {
var i = null,
t = 0,
r = n.getAttribute("data-top") || 500;
window.addEventListener("scroll",
function() {
t = document.documentElement.scrollTop || document.body.scrollTop;
n.style.display = t > r ? "block": "none"
});
n.addEventListener("click",
function() {
i = setInterval(function() {
var n = Math.floor( - t / 10);
document.documentElement.scrollTop = t + n;
t <= 0 && clearInterval(i)
},
5)
})
}
};
n.auth = function() {
var n = document.getElementById("license"),
i = md5(document.domain).split("").reverse().join("").substring(10, 20),
t;
if (n == null || n.content !== i) {
//alert("您正在使用未经授权的模板");
return
}
t = n.getAttribute("data-menu");
t === "true" && (document.oncontextmenu = function() {
return ! 1
})
};
n.track = function(n, t) {
typeof gtag == "function" && gtag("event", n, {
event_category: t
})
};
window.cms = n
} (),
function() {
window.addEventListener("DOMContentLoaded",
function() {
var n = new LazyLoad({
elements_selector: ".lazy"
});
window.setTimeout(function() {
cms.sticky();
cms.bannerInit()
},
20);
window.setTimeout(function() {
cms.postMessageInit()
},
30);
window.setTimeout(function() {
cms.initShare()
},
40);
window.setTimeout(function() {
cms.auth()
},
50);
window.setTimeout(function() {
cms.scrollTop()
},
60)
})
} ();