Skip to content

Instantly share code, notes, and snippets.

Created April 1, 2016 14:36
Show Gist options
  • Save anonymous/08ab6aa4f362490eb591fec1fb1d363b to your computer and use it in GitHub Desktop.
Save anonymous/08ab6aa4f362490eb591fec1fb1d363b to your computer and use it in GitHub Desktop.
function addEvent(t, e, i) {
t.attachEvent ? (t["e" + e + i] = i, t[e + i] = function() {
t["e" + e + i](window.event)
}, t.attachEvent("on" + e, t[e + i])) : t.addEventListener(e, i, !1)
}
function removeEvent(t, e, i) {
t.detachEvent ? (t.detachEvent("on" + e, t[e + i]), t[e + i] = null) : t.removeEventListener(e, i, !1)
}
if (! function(t) {
var e = {
mode: "horizontal",
slideSelector: "",
infiniteLoop: !0,
hideControlOnEnd: !1,
speed: 500,
easing: null,
slideMargin: 0,
startSlide: 0,
randomStart: !1,
captions: !1,
ticker: !1,
tickerHover: !1,
adaptiveHeight: !1,
adaptiveHeightSpeed: 500,
video: !1,
useCSS: !0,
preloadImages: "visible",
responsive: !0,
slideZIndex: 50,
wrapperClass: "bx-wrapper",
touchEnabled: !0,
swipeThreshold: 50,
oneToOneTouch: !0,
preventDefaultSwipeX: !0,
preventDefaultSwipeY: !1,
keyboardEnabled: !1,
pager: !0,
pagerType: "full",
pagerShortSeparator: " / ",
pagerSelector: null,
buildPager: null,
pagerCustom: null,
controls: !0,
nextText: "Next",
prevText: "Prev",
nextSelector: null,
prevSelector: null,
autoControls: !1,
startText: "Start",
stopText: "Stop",
autoControlsCombine: !1,
autoControlsSelector: null,
auto: !1,
pause: 4e3,
autoStart: !0,
autoDirection: "next",
autoHover: !1,
autoDelay: 0,
autoSlideForOnePage: !1,
minSlides: 1,
maxSlides: 1,
moveSlides: 0,
slideWidth: 0,
onSliderLoad: function() {
return !0
},
onSlideBefore: function() {
return !0
},
onSlideAfter: function() {
return !0
},
onSlideNext: function() {
return !0
},
onSlidePrev: function() {
return !0
},
onSliderResize: function() {
return !0
}
};
t.fn.bxSlider = function(o) {
if (0 === this.length) return this;
if (this.length > 1) return this.each(function() {
t(this).bxSlider(o)
}), this;
var n = {},
s = this,
r = t(window).width(),
a = t(window).height(),
l = function() {
n.settings = t.extend({}, e, o), n.settings.slideWidth = parseInt(n.settings.slideWidth), n.children = s.children(n.settings.slideSelector), n.children.length < n.settings.minSlides && (n.settings.minSlides = n.children.length), n.children.length < n.settings.maxSlides && (n.settings.maxSlides = n.children.length), n.settings.randomStart && (n.settings.startSlide = Math.floor(Math.random() * n.children.length)), n.active = {
index: n.settings.startSlide
}, n.carousel = n.settings.minSlides > 1 || n.settings.maxSlides > 1 ? !0 : !1, n.carousel && (n.settings.preloadImages = "all"), n.minThreshold = n.settings.minSlides * n.settings.slideWidth + (n.settings.minSlides - 1) * n.settings.slideMargin, n.maxThreshold = n.settings.maxSlides * n.settings.slideWidth + (n.settings.maxSlides - 1) * n.settings.slideMargin, n.working = !1, n.controls = {}, n.interval = null, n.animProp = "vertical" === n.settings.mode ? "top" : "left", n.usingCSS = n.settings.useCSS && "fade" !== n.settings.mode && function() {
var t = document.createElement("div"),
e = ["WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"];
for (var i in e)
if (void 0 !== t.style[e[i]]) return n.cssPrefix = e[i].replace("Perspective", "").toLowerCase(), n.animProp = "-" + n.cssPrefix + "-transform", !0;
return !1
}(), "vertical" === n.settings.mode && (n.settings.maxSlides = n.settings.minSlides), s.data("origStyle", s.attr("style")), s.children(n.settings.slideSelector).each(function() {
t(this).data("origStyle", t(this).attr("style"))
}), c()
},
c = function() {
s.wrap('<div class="' + n.settings.wrapperClass + '"><div class="bx-viewport"></div></div>'), n.viewport = s.parent(), n.loader = t('<div class="bx-loading" />'), n.viewport.prepend(n.loader), s.css({
width: "horizontal" === n.settings.mode ? 1e3 * n.children.length + 215 + "%" : "auto",
position: "absolute"
}), n.usingCSS && n.settings.easing ? s.css("-" + n.cssPrefix + "-transition-timing-function", n.settings.easing) : n.settings.easing || (n.settings.easing = "swing"), m(), n.viewport.css({
width: "100%",
overflow: "hidden",
position: "relative"
}), n.viewport.parent().css({
maxWidth: p()
}), n.settings.pager || n.settings.controls || n.viewport.parent().css({
margin: "0 auto 0px"
}), n.children.css({
"float": "horizontal" === n.settings.mode ? "left" : "none",
listStyle: "none",
position: "relative"
}), n.children.css("width", f()), "horizontal" === n.settings.mode && n.settings.slideMargin > 0 && n.children.css("marginRight", n.settings.slideMargin), "vertical" === n.settings.mode && n.settings.slideMargin > 0 && n.children.css("marginBottom", n.settings.slideMargin), "fade" === n.settings.mode && (n.children.css({
position: "absolute",
zIndex: 0,
display: "none"
}), n.children.eq(n.settings.startSlide).css({
zIndex: n.settings.slideZIndex,
display: "block"
})), n.controls.el = t('<div class="bx-controls" />'), n.settings.captions && C(), n.active.last = n.settings.startSlide === g() - 1, n.settings.video && s.fitVids();
var e = n.children.eq(n.settings.startSlide);
("all" === n.settings.preloadImages || n.settings.ticker) && (e = n.children), n.settings.ticker ? n.settings.pager = !1 : (n.settings.controls && S(), n.settings.auto && n.settings.autoControls && T(), n.settings.pager && x(), (n.settings.controls || n.settings.autoControls || n.settings.pager) && n.viewport.after(n.controls.el)), d(e, h)
},
d = function(e, i) {
var o = e.find('img:not([src=""]), iframe').length;
if (0 === o) return void i();
var n = 0;
e.find('img:not([src=""]), iframe').each(function() {
t(this).one("load error", function() {
++n === o && i()
}).each(function() {
this.complete && t(this).load()
})
})
},
h = function() {
if (n.settings.infiniteLoop && "fade" !== n.settings.mode && !n.settings.ticker) {
var e = "vertical" === n.settings.mode ? n.settings.minSlides : n.settings.maxSlides,
i = n.children.slice(0, e).clone(!0).addClass("bx-clone"),
o = n.children.slice(-e).clone(!0).addClass("bx-clone");
s.append(i).prepend(o)
}
n.loader.remove(), w(), "vertical" === n.settings.mode && (n.settings.adaptiveHeight = !0), n.viewport.height(u()), s.redrawSlider(), n.settings.onSliderLoad(n, n.active.index), n.initialized = !0, n.settings.responsive && t(window).bind("resize", q), n.settings.auto && n.settings.autoStart && (g() > 1 || n.settings.autoSlideForOnePage) && O(), n.settings.ticker && L(), n.settings.pager && M(n.settings.startSlide), n.settings.controls && A(), n.settings.touchEnabled && !n.settings.ticker && H(), n.settings.keyboardEnabled && !n.settings.ticker && t(document).keydown(R)
},
u = function() {
var e = 0,
o = t();
if ("vertical" === n.settings.mode || n.settings.adaptiveHeight)
if (n.carousel) {
var s = 1 === n.settings.moveSlides ? n.active.index : n.active.index * v();
for (o = n.children.eq(s), i = 1; i <= n.settings.maxSlides - 1; i++) o = o.add(n.children.eq(s + i >= n.children.length ? i - 1 : s + i))
} else o = n.children.eq(n.active.index);
else o = n.children;
return "vertical" === n.settings.mode ? (o.each(function() {
e += t(this).outerHeight()
}), n.settings.slideMargin > 0 && (e += n.settings.slideMargin * (n.settings.minSlides - 1))) : e = Math.max.apply(Math, o.map(function() {
return t(this).outerHeight(!1)
}).get()), "border-box" === n.viewport.css("box-sizing") ? e += parseFloat(n.viewport.css("padding-top")) + parseFloat(n.viewport.css("padding-bottom")) + parseFloat(n.viewport.css("border-top-width")) + parseFloat(n.viewport.css("border-bottom-width")) : "padding-box" === n.viewport.css("box-sizing") && (e += parseFloat(n.viewport.css("padding-top")) + parseFloat(n.viewport.css("padding-bottom"))), e
},
p = function() {
var t = "100%";
return n.settings.slideWidth > 0 && (t = "horizontal" === n.settings.mode ? n.settings.maxSlides * n.settings.slideWidth + (n.settings.maxSlides - 1) * n.settings.slideMargin : n.settings.slideWidth), t
},
f = function() {
var t = n.settings.slideWidth,
e = n.viewport.width();
return 0 === n.settings.slideWidth || n.settings.slideWidth > e && !n.carousel || "vertical" === n.settings.mode ? t = e : n.settings.maxSlides > 1 && "horizontal" === n.settings.mode && (e > n.maxThreshold || e < n.minThreshold && (t = (e - n.settings.slideMargin * (n.settings.minSlides - 1)) / n.settings.minSlides)), t
},
m = function() {
var t = 1;
if ("horizontal" === n.settings.mode && n.settings.slideWidth > 0)
if (n.viewport.width() < n.minThreshold) t = n.settings.minSlides;
else if (n.viewport.width() > n.maxThreshold) t = n.settings.maxSlides;
else {
var e = n.children.first().width() + n.settings.slideMargin;
t = Math.floor((n.viewport.width() + n.settings.slideMargin) / e)
} else "vertical" === n.settings.mode && (t = n.settings.minSlides);
return t
},
g = function() {
var t = 0;
if (n.settings.moveSlides > 0)
if (n.settings.infiniteLoop) t = Math.ceil(n.children.length / v());
else
for (var e = 0, i = 0; e < n.children.length;) ++t, e = i + m(), i += n.settings.moveSlides <= m() ? n.settings.moveSlides : m();
else t = Math.ceil(n.children.length / m());
return t
},
v = function() {
return n.settings.moveSlides > 0 && n.settings.moveSlides <= m() ? n.settings.moveSlides : m()
},
w = function() {
var t;
if (n.children.length > n.settings.maxSlides && n.active.last && !n.settings.infiniteLoop) {
if ("horizontal" === n.settings.mode) {
var e = n.children.last();
t = e.position(), y(-(t.left - (n.viewport.width() - e.outerWidth())), "reset", 0)
} else if ("vertical" === n.settings.mode) {
var i = n.children.length - n.settings.minSlides;
t = n.children.eq(i).position(), y(-t.top, "reset", 0)
}
} else t = n.children.eq(n.active.index * v()).position(), n.active.index === g() - 1 && (n.active.last = !0), void 0 !== t && ("horizontal" === n.settings.mode ? y(-t.left, "reset", 0) : "vertical" === n.settings.mode && y(-t.top, "reset", 0))
},
y = function(t, e, i, o) {
if (n.usingCSS) {
var r = "vertical" === n.settings.mode ? "translate3d(0, " + t + "px, 0)" : "translate3d(" + t + "px, 0, 0)";
s.css("-" + n.cssPrefix + "-transition-duration", i / 1e3 + "s"), "slide" === e ? setTimeout(function() {
s.css(n.animProp, r), 0 === t ? $() : s.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function() {
s.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"), $()
})
}, 0) : "reset" === e ? s.css(n.animProp, r) : "ticker" === e && (s.css("-" + n.cssPrefix + "-transition-timing-function", "linear"), s.css(n.animProp, r), s.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function() {
s.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"), y(o.resetValue, "reset", 0), N()
}))
} else {
var a = {};
a[n.animProp] = t, "slide" === e ? s.animate(a, i, n.settings.easing, function() {
$()
}) : "reset" === e ? s.css(n.animProp, t) : "ticker" === e && s.animate(a, speed, "linear", function() {
y(o.resetValue, "reset", 0), N()
})
}
},
b = function() {
for (var e = "", i = g(), o = 0; i > o; o++) {
var s = "";
n.settings.buildPager && t.isFunction(n.settings.buildPager) || n.settings.pagerCustom ? (s = n.settings.buildPager(o), n.pagerEl.addClass("bx-custom-pager")) : (s = o + 1, n.pagerEl.addClass("bx-default-pager")), e += '<div class="bx-pager-item"><a href="" data-slide-index="' + o + '" class="bx-pager-link">' + s + "</a></div>"
}
n.pagerEl.html(e)
},
x = function() {
n.settings.pagerCustom ? n.pagerEl = t(n.settings.pagerCustom) : (n.pagerEl = t('<div class="bx-pager" />'), n.settings.pagerSelector ? t(n.settings.pagerSelector).html(n.pagerEl) : n.controls.el.addClass("bx-has-pager").append(n.pagerEl), b()), n.pagerEl.on("click touchend", "a", _)
},
S = function() {
n.controls.next = t('<a class="bx-next" href="">' + n.settings.nextText + "</a>"), n.controls.prev = t('<a class="bx-prev" href="">' + n.settings.prevText + "</a>"), n.controls.next.bind("click touchend", k), n.controls.prev.bind("click touchend", E), n.settings.nextSelector && t(n.settings.nextSelector).append(n.controls.next), n.settings.prevSelector && t(n.settings.prevSelector).append(n.controls.prev), n.settings.nextSelector || n.settings.prevSelector || (n.controls.directionEl = t('<div class="bx-controls-direction" />'), n.controls.directionEl.append(n.controls.prev).append(n.controls.next), n.controls.el.addClass("bx-has-controls-direction").append(n.controls.directionEl))
},
T = function() {
n.controls.start = t('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + n.settings.startText + "</a></div>"), n.controls.stop = t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + n.settings.stopText + "</a></div>"), n.controls.autoEl = t('<div class="bx-controls-auto" />'), n.controls.autoEl.on("click", ".bx-start", z), n.controls.autoEl.on("click", ".bx-stop", I), n.settings.autoControlsCombine ? n.controls.autoEl.append(n.controls.start) : n.controls.autoEl.append(n.controls.start).append(n.controls.stop), n.settings.autoControlsSelector ? t(n.settings.autoControlsSelector).html(n.controls.autoEl) : n.controls.el.addClass("bx-has-controls-auto").append(n.controls.autoEl), P(n.settings.autoStart ? "stop" : "start")
},
C = function() {
n.children.each(function() {
var e = t(this).find("img:first").attr("title");
void 0 !== e && ("" + e).length && t(this).append('<div class="bx-caption"><span>' + e + "</span></div>")
})
},
k = function(t) {
t.preventDefault(), n.controls.el.hasClass("disabled") || (n.settings.auto && s.stopAuto(), s.goToNextSlide())
},
E = function(t) {
t.preventDefault(), n.controls.el.hasClass("disabled") || (n.settings.auto && s.stopAuto(), s.goToPrevSlide())
},
z = function(t) {
s.startAuto(), t.preventDefault()
},
I = function(t) {
s.stopAuto(), t.preventDefault()
},
_ = function(e) {
if (e.preventDefault(), !n.controls.el.hasClass("disabled")) {
n.settings.auto && s.stopAuto();
var i = t(e.currentTarget);
if (void 0 !== i.attr("data-slide-index")) {
var o = parseInt(i.attr("data-slide-index"));
o !== n.active.index && s.goToSlide(o)
}
}
},
M = function(e) {
var i = n.children.length;
return "short" === n.settings.pagerType ? (n.settings.maxSlides > 1 && (i = Math.ceil(n.children.length / n.settings.maxSlides)), void n.pagerEl.html(e + 1 + n.settings.pagerShortSeparator + i)) : (n.pagerEl.find("a").removeClass("active"), void n.pagerEl.each(function(i, o) {
t(o).find("a").eq(e).addClass("active")
}))
},
$ = function() {
if (n.settings.infiniteLoop) {
var t = "";
0 === n.active.index ? t = n.children.eq(0).position() : n.active.index === g() - 1 && n.carousel ? t = n.children.eq((g() - 1) * v()).position() : n.active.index === n.children.length - 1 && (t = n.children.eq(n.children.length - 1).position()), t && ("horizontal" === n.settings.mode ? y(-t.left, "reset", 0) : "vertical" === n.settings.mode && y(-t.top, "reset", 0))
}
n.working = !1, n.settings.onSlideAfter(n.children.eq(n.active.index), n.oldIndex, n.active.index)
},
P = function(t) {
n.settings.autoControlsCombine ? n.controls.autoEl.html(n.controls[t]) : (n.controls.autoEl.find("a").removeClass("active"), n.controls.autoEl.find("a:not(.bx-" + t + ")").addClass("active"))
},
A = function() {
1 === g() ? (n.controls.prev.addClass("disabled"), n.controls.next.addClass("disabled")) : !n.settings.infiniteLoop && n.settings.hideControlOnEnd && (0 === n.active.index ? (n.controls.prev.addClass("disabled"), n.controls.next.removeClass("disabled")) : n.active.index === g() - 1 ? (n.controls.next.addClass("disabled"), n.controls.prev.removeClass("disabled")) : (n.controls.prev.removeClass("disabled"), n.controls.next.removeClass("disabled")))
},
O = function() {
n.settings.autoDelay > 0 ? setTimeout(s.startAuto, n.settings.autoDelay) : (s.startAuto(), t(window).focus(function() {
s.startAuto()
}).blur(function() {
s.stopAuto()
})), n.settings.autoHover && s.hover(function() {
n.interval && (s.stopAuto(!0), n.autoPaused = !0)
}, function() {
n.autoPaused && (s.startAuto(!0), n.autoPaused = null)
})
},
L = function() {
var e = 0;
if ("next" === n.settings.autoDirection) s.append(n.children.clone().addClass("bx-clone"));
else {
s.prepend(n.children.clone().addClass("bx-clone"));
var i = n.children.first().position();
e = "horizontal" === n.settings.mode ? -i.left : -i.top
}
if (y(e, "reset", 0), n.settings.pager = !1, n.settings.controls = !1, n.settings.autoControls = !1, n.settings.tickerHover)
if (n.usingCSS) {
var o, r = "horizontal" == n.settings.mode ? 4 : 5;
n.viewport.hover(function() {
var t = s.css("-" + n.cssPrefix + "-transform");
o = parseFloat(t.split(",")[r]), y(o, "reset", 0)
}, function() {
var e = 0;
n.children.each(function() {
e += "horizontal" == n.settings.mode ? t(this).outerWidth(!0) : t(this).outerHeight(!0)
});
var i = n.settings.speed / e,
s = ("horizontal" == n.settings.mode ? "left" : "top", i * (e - Math.abs(parseInt(o))));
N(s)
})
} else n.viewport.hover(function() {
s.stop()
}, function() {
var e = 0;
n.children.each(function() {
e += "horizontal" == n.settings.mode ? t(this).outerWidth(!0) : t(this).outerHeight(!0)
});
var i = n.settings.speed / e,
o = "horizontal" == n.settings.mode ? "left" : "top",
r = i * (e - Math.abs(parseInt(s.css(o))));
N(r)
});
N()
},
N = function(t) {
speed = t ? t : n.settings.speed;
var e = {
left: 0,
top: 0
},
i = {
left: 0,
top: 0
};
"next" === n.settings.autoDirection ? e = s.find(".bx-clone").first().position() : i = n.children.first().position();
var o = "horizontal" === n.settings.mode ? -e.left : -e.top,
r = "horizontal" === n.settings.mode ? -i.left : -i.top,
a = {
resetValue: r
};
y(o, "ticker", speed, a)
},
D = function(e) {
var i = t(window),
o = {
top: i.scrollTop(),
left: i.scrollLeft()
};
o.right = o.left + i.width(), o.bottom = o.top + i.height();
var n = e.offset();
return n.right = n.left + e.outerWidth(), n.bottom = n.top + e.outerHeight(), !(o.right < n.left || o.left > n.right || o.bottom < n.top || o.top > n.bottom)
},
R = function(t) {
var e = document.activeElement.tagName.toLowerCase(),
i = "input|textarea",
o = new RegExp(e, ["i"]),
n = o.exec(i);
if (null == n && D(s)) {
if (39 == t.keyCode) return k(t), !1;
if (37 == t.keyCode) return E(t), !1
}
},
H = function() {
n.touch = {
start: {
x: 0,
y: 0
},
end: {
x: 0,
y: 0
}
}, n.viewport.bind("touchstart MSPointerDown pointerdown", B), n.viewport.on("click", ".bxslider a", function(t) {
n.viewport.hasClass("click-disabled") && (t.preventDefault(), n.viewport.removeClass("click-disabled"))
})
},
B = function(t) {
if (n.controls.el.addClass("disabled"), n.working) t.preventDefault(), n.controls.el.removeClass("disabled");
else {
n.touch.originalPos = s.position();
var e = t.originalEvent,
i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e];
n.touch.start.x = i[0].pageX, n.touch.start.y = i[0].pageY, n.viewport.get(0).setPointerCapture && (n.pointerId = e.pointerId, n.viewport.get(0).setPointerCapture(n.pointerId)), n.viewport.bind("touchmove MSPointerMove pointermove", W), n.viewport.bind("touchend MSPointerUp pointerup", F), n.viewport.bind("MSPointerCancel pointercancel", j)
}
},
j = function() {
y(n.touch.originalPos.left, "reset", 0), n.controls.el.removeClass("disabled"), n.viewport.unbind("MSPointerCancel pointercancel", j), n.viewport.unbind("touchmove MSPointerMove pointermove", W), n.viewport.unbind("touchend MSPointerUp pointerup", F), n.viewport.get(0).releasePointerCapture && n.viewport.get(0).releasePointerCapture(n.pointerId)
},
W = function(t) {
var e = t.originalEvent,
i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e],
o = Math.abs(i[0].pageX - n.touch.start.x),
s = Math.abs(i[0].pageY - n.touch.start.y);
if (3 * o > s && n.settings.preventDefaultSwipeX ? t.preventDefault() : 3 * s > o && n.settings.preventDefaultSwipeY && t.preventDefault(), "fade" !== n.settings.mode && n.settings.oneToOneTouch) {
var r = 0,
a = 0;
"horizontal" === n.settings.mode ? (a = i[0].pageX - n.touch.start.x, r = n.touch.originalPos.left + a) : (a = i[0].pageY - n.touch.start.y, r = n.touch.originalPos.top + a), y(r, "reset", 0)
}
},
F = function(t) {
n.viewport.unbind("touchmove MSPointerMove pointermove", W), n.controls.el.removeClass("disabled");
var e = t.originalEvent,
i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e],
o = 0,
r = 0;
n.touch.end.x = i[0].pageX, n.touch.end.y = i[0].pageY, "fade" === n.settings.mode ? (r = Math.abs(n.touch.start.x - n.touch.end.x), r >= n.settings.swipeThreshold && (n.touch.start.x > n.touch.end.x ? s.goToNextSlide() : s.goToPrevSlide(), s.stopAuto())) : ("horizontal" === n.settings.mode ? (r = n.touch.end.x - n.touch.start.x, o = n.touch.originalPos.left) : (r = n.touch.end.y - n.touch.start.y, o = n.touch.originalPos.top), !n.settings.infiniteLoop && (0 === n.active.index && r > 0 || n.active.last && 0 > r) ? y(o, "reset", 200) : Math.abs(r) >= n.settings.swipeThreshold ? (0 > r ? s.goToNextSlide() : s.goToPrevSlide(), s.stopAuto()) : y(o, "reset", 200)), n.viewport.unbind("touchend MSPointerUp pointerup", F), n.viewport.get(0).releasePointerCapture && n.viewport.get(0).releasePointerCapture(n.pointerId)
},
q = function() {
if (n.initialized)
if (n.working) window.setTimeout(q, 10);
else {
var e = t(window).width(),
i = t(window).height();
(r !== e || a !== i) && (r = e, a = i, s.redrawSlider(), n.settings.onSliderResize.call(s, n.active.index))
}
};
return s.goToSlide = function(e, i) {
if (!n.working && n.active.index !== e) {
n.working = !0, n.oldIndex = n.active.index, n.active.index = 0 > e ? g() - 1 : e >= g() ? 0 : e;
var o = !0;
if (o = n.settings.onSlideBefore(n.children.eq(n.active.index), n.oldIndex, n.active.index), "undefined" != typeof o && !o) return n.active.index = n.oldIndex, void(n.working = !1);
if ("next" === i ? n.settings.onSlideNext(n.children.eq(n.active.index), n.oldIndex, n.active.index) || (o = !1) : "prev" === i && (n.settings.onSlidePrev(n.children.eq(n.active.index), n.oldIndex, n.active.index) || (o = !1)), "undefined" != typeof o && !o) return n.active.index = n.oldIndex, void(n.working = !1);
if (n.active.last = n.active.index >= g() - 1, (n.settings.pager || n.settings.pagerCustom) && M(n.active.index), n.settings.controls && A(), "fade" === n.settings.mode) n.settings.adaptiveHeight && n.viewport.height() !== u() && n.viewport.animate({
height: u()
}, n.settings.adaptiveHeightSpeed), n.children.filter(":visible").fadeOut(n.settings.speed).css({
zIndex: 0
}), n.children.eq(n.active.index).css("zIndex", n.settings.slideZIndex + 1).fadeIn(n.settings.speed, function() {
t(this).css("zIndex", n.settings.slideZIndex), $()
});
else {
n.settings.adaptiveHeight && n.viewport.height() !== u() && n.viewport.animate({
height: u()
}, n.settings.adaptiveHeightSpeed);
var r = 0,
a = {
left: 0,
top: 0
},
l = null;
if (!n.settings.infiniteLoop && n.carousel && n.active.last)
if ("horizontal" === n.settings.mode) l = n.children.eq(n.children.length - 1), a = l.position(), r = n.viewport.width() - l.outerWidth();
else {
var c = n.children.length - n.settings.minSlides;
a = n.children.eq(c).position()
}
else if (n.carousel && n.active.last && "prev" === i) {
var d = 1 === n.settings.moveSlides ? n.settings.maxSlides - v() : (g() - 1) * v() - (n.children.length - n.settings.maxSlides);
l = s.children(".bx-clone").eq(d), a = l.position()
} else if ("next" === i && 0 === n.active.index) a = s.find("> .bx-clone").eq(n.settings.maxSlides).position(), n.active.last = !1;
else if (e >= 0) {
var h = e * v();
a = n.children.eq(h).position()
}
if ("undefined" != typeof a) {
var p = "horizontal" === n.settings.mode ? -(a.left - r) : -a.top;
y(p, "slide", n.settings.speed)
}
}
}
}, s.goToNextSlide = function() {
if (n.settings.infiniteLoop || !n.active.last) {
var t = parseInt(n.active.index) + 1;
s.goToSlide(t, "next")
}
}, s.goToPrevSlide = function() {
if (n.settings.infiniteLoop || 0 !== n.active.index) {
var t = parseInt(n.active.index) - 1;
s.goToSlide(t, "prev")
}
}, s.startAuto = function(t) {
n.interval || (n.interval = setInterval(function() {
"next" === n.settings.autoDirection ? s.goToNextSlide() : s.goToPrevSlide()
}, n.settings.pause), n.settings.autoControls && t !== !0 && P("stop"))
}, s.stopAuto = function(t) {
n.interval && (clearInterval(n.interval), n.interval = null, n.settings.autoControls && t !== !0 && P("start"))
}, s.getCurrentSlide = function() {
return n.active.index
}, s.getCurrentSlideElement = function() {
return n.children.eq(n.active.index)
}, s.getSlideCount = function() {
return n.children.length
}, s.isWorking = function() {
return n.working
}, s.redrawSlider = function() {
n.children.add(s.find(".bx-clone")).outerWidth(f()), n.viewport.css("height", u()), n.settings.ticker || w(), n.active.last && (n.active.index = g() - 1), n.active.index >= g() && (n.active.last = !0), n.settings.pager && !n.settings.pagerCustom && (b(), M(n.active.index))
}, s.destroySlider = function() {
n.initialized && (n.initialized = !1, t(".bx-clone", this).remove(), n.children.each(function() {
void 0 !== t(this).data("origStyle") ? t(this).attr("style", t(this).data("origStyle")) : t(this).removeAttr("style")
}), void 0 !== t(this).data("origStyle") ? this.attr("style", t(this).data("origStyle")) : t(this).removeAttr("style"), t(this).unwrap().unwrap(), n.controls.el && n.controls.el.remove(), n.controls.next && n.controls.next.remove(), n.controls.prev && n.controls.prev.remove(), n.pagerEl && n.settings.controls && !n.settings.pagerCustom && n.pagerEl.remove(), t(".bx-caption", this).remove(), n.controls.autoEl && n.controls.autoEl.remove(), clearInterval(n.interval), n.settings.responsive && t(window).unbind("resize", q), n.settings.keyboardEnabled && t(document).unbind("keydown", R))
}, s.reloadSlider = function(t) {
void 0 !== t && (o = t), s.destroySlider(), l()
}, l(), this
}
}(jQuery), ! function(t, e, i, o) {
function n(e, i) {
this.element = e, this.options = t.extend({}, r, i), this._defaults = r, this._name = s, this.init()
}
var s = "stellar",
r = {
scrollProperty: "scroll",
positionProperty: "position",
horizontalScrolling: !0,
verticalScrolling: !0,
horizontalOffset: 0,
verticalOffset: 0,
responsive: !1,
parallaxBackgrounds: !0,
parallaxElements: !0,
hideDistantElements: !0,
hideElement: function(t) {
t.hide()
},
showElement: function(t) {
t.show()
}
},
a = {
scroll: {
getLeft: function(t) {
return t.scrollLeft()
},
setLeft: function(t, e) {
t.scrollLeft(e)
},
getTop: function(t) {
return t.scrollTop()
},
setTop: function(t, e) {
t.scrollTop(e)
}
},
position: {
getLeft: function(t) {
return -1 * parseInt(t.css("left"), 10)
},
getTop: function(t) {
return -1 * parseInt(t.css("top"), 10)
}
},
margin: {
getLeft: function(t) {
return -1 * parseInt(t.css("margin-left"), 10)
},
getTop: function(t) {
return -1 * parseInt(t.css("margin-top"), 10)
}
},
transform: {
getLeft: function(t) {
var e = getComputedStyle(t[0])[d];
return "none" !== e ? -1 * parseInt(e.match(/(-?[0-9]+)/g)[4], 10) : 0
},
getTop: function(t) {
var e = getComputedStyle(t[0])[d];
return "none" !== e ? -1 * parseInt(e.match(/(-?[0-9]+)/g)[5], 10) : 0
}
}
},
l = {
position: {
setLeft: function(t, e) {
t.css("left", e)
},
setTop: function(t, e) {
t.css("top", e)
}
},
transform: {
setPosition: function(t, e, i, o, n) {
t[0].style[d] = "translate3d(" + (e - i) + "px, " + (o - n) + "px, 0)"
}
}
},
c = function() {
var e, i = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,
o = t("script")[0].style,
n = "";
for (e in o)
if (i.test(e)) {
n = e.match(i)[0];
break
}
return "WebkitOpacity" in o && (n = "Webkit"), "KhtmlOpacity" in o && (n = "Khtml"),
function(t) {
return n + (n.length > 0 ? t.charAt(0).toUpperCase() + t.slice(1) : t)
}
}(),
d = c("transform"),
h = t("<div />", {
style: "background:#fff"
}).css("background-position-x") !== o,
u = h ? function(t, e, i) {
t.css({
"background-position-x": e,
"background-position-y": i
})
} : function(t, e, i) {
t.css("background-position", e + " " + i)
},
p = h ? function(t) {
return [t.css("background-position-x"), t.css("background-position-y")]
} : function(t) {
return t.css("background-position").split(" ")
},
f = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function(t) {
setTimeout(t, 1e3 / 60)
};
n.prototype = {
init: function() {
this.options.name = s + "_" + Math.floor(1e9 * Math.random()), this._defineElements(), this._defineGetters(), this._defineSetters(), this._handleWindowLoadAndResize(), this._detectViewport(), this.refresh({
firstLoad: !0
}), "scroll" === this.options.scrollProperty ? this._handleScrollEvent() : this._startAnimationLoop()
},
_defineElements: function() {
this.element === i.body && (this.element = e), this.$scrollElement = t(this.element), this.$element = this.element === e ? t("body") : this.$scrollElement, this.$viewportElement = this.options.viewportElement !== o ? t(this.options.viewportElement) : this.$scrollElement[0] === e || "scroll" === this.options.scrollProperty ? this.$scrollElement : this.$scrollElement.parent()
},
_defineGetters: function() {
var t = this,
e = a[t.options.scrollProperty];
this._getScrollLeft = function() {
return e.getLeft(t.$scrollElement)
}, this._getScrollTop = function() {
return e.getTop(t.$scrollElement)
}
},
_defineSetters: function() {
var e = this,
i = a[e.options.scrollProperty],
o = l[e.options.positionProperty],
n = i.setLeft,
s = i.setTop;
this._setScrollLeft = "function" == typeof n ? function(t) {
n(e.$scrollElement, t)
} : t.noop, this._setScrollTop = "function" == typeof s ? function(t) {
s(e.$scrollElement, t)
} : t.noop, this._setPosition = o.setPosition || function(t, i, n, s, r) {
e.options.horizontalScrolling && o.setLeft(t, i, n), e.options.verticalScrolling && o.setTop(t, s, r)
}
},
_handleWindowLoadAndResize: function() {
var i = this,
o = t(e);
i.options.responsive && o.bind("load." + this.name, function() {
i.refresh()
}), o.bind("resize." + this.name, function() {
i._detectViewport(), i.options.responsive && i.refresh()
})
},
refresh: function(i) {
var o = this,
n = o._getScrollLeft(),
s = o._getScrollTop();
i && i.firstLoad || this._reset(), this._setScrollLeft(0), this._setScrollTop(0), this._setOffsets(), this._findParticles(), this._findBackgrounds(), i && i.firstLoad && /WebKit/.test(navigator.userAgent) && t(e).load(function() {
var t = o._getScrollLeft(),
e = o._getScrollTop();
o._setScrollLeft(t + 1), o._setScrollTop(e + 1), o._setScrollLeft(t), o._setScrollTop(e)
}), this._setScrollLeft(n), this._setScrollTop(s)
},
_detectViewport: function() {
var t = this.$viewportElement.offset(),
e = null !== t && t !== o;
this.viewportWidth = this.$viewportElement.width(), this.viewportHeight = this.$viewportElement.height(), this.viewportOffsetTop = e ? t.top : 0, this.viewportOffsetLeft = e ? t.left : 0
},
_findParticles: function() {
var e = this;
if (this._getScrollLeft(), this._getScrollTop(), this.particles !== o)
for (var i = this.particles.length - 1; i >= 0; i--) this.particles[i].$element.data("stellar-elementIsActive", o);
this.particles = [], this.options.parallaxElements && this.$element.find("[data-stellar-ratio]").each(function() {
var i, n, s, r, a, l, c, d, h, u = t(this),
p = 0,
f = 0,
m = 0,
g = 0;
if (u.data("stellar-elementIsActive")) {
if (u.data("stellar-elementIsActive") !== this) return
} else u.data("stellar-elementIsActive", this);
e.options.showElement(u), u.data("stellar-startingLeft") ? (u.css("left", u.data("stellar-startingLeft")), u.css("top", u.data("stellar-startingTop"))) : (u.data("stellar-startingLeft", u.css("left")), u.data("stellar-startingTop", u.css("top"))), s = u.position().left, r = u.position().top, a = "auto" === u.css("margin-left") ? 0 : parseInt(u.css("margin-left"), 10), l = "auto" === u.css("margin-top") ? 0 : parseInt(u.css("margin-top"), 10), d = u.offset().left - a, h = u.offset().top - l, u.parents().each(function() {
var e = t(this);
return e.data("stellar-offset-parent") === !0 ? (p = m, f = g, c = e, !1) : (m += e.position().left, void(g += e.position().top))
}), i = u.data("stellar-horizontal-offset") !== o ? u.data("stellar-horizontal-offset") : c !== o && c.data("stellar-horizontal-offset") !== o ? c.data("stellar-horizontal-offset") : e.horizontalOffset, n = u.data("stellar-vertical-offset") !== o ? u.data("stellar-vertical-offset") : c !== o && c.data("stellar-vertical-offset") !== o ? c.data("stellar-vertical-offset") : e.verticalOffset, e.particles.push({
$element: u,
$offsetParent: c,
isFixed: "fixed" === u.css("position"),
horizontalOffset: i,
verticalOffset: n,
startingPositionLeft: s,
startingPositionTop: r,
startingOffsetLeft: d,
startingOffsetTop: h,
parentOffsetLeft: p,
parentOffsetTop: f,
stellarRatio: u.data("stellar-ratio") !== o ? u.data("stellar-ratio") : 1,
width: u.outerWidth(!0),
height: u.outerHeight(!0),
isHidden: !1
})
})
},
_findBackgrounds: function() {
var e, i = this,
n = this._getScrollLeft(),
s = this._getScrollTop();
this.backgrounds = [], this.options.parallaxBackgrounds && (e = this.$element.find("[data-stellar-background-ratio]"), this.$element.data("stellar-background-ratio") && (e = e.add(this.$element)), e.each(function() {
var e, r, a, l, c, d, h, f = t(this),
m = p(f),
g = 0,
v = 0,
w = 0,
y = 0;
if (f.data("stellar-backgroundIsActive")) {
if (f.data("stellar-backgroundIsActive") !== this) return
} else f.data("stellar-backgroundIsActive", this);
f.data("stellar-backgroundStartingLeft") ? u(f, f.data("stellar-backgroundStartingLeft"), f.data("stellar-backgroundStartingTop")) : (f.data("stellar-backgroundStartingLeft", m[0]), f.data("stellar-backgroundStartingTop", m[1])), a = "auto" === f.css("margin-left") ? 0 : parseInt(f.css("margin-left"), 10), l = "auto" === f.css("margin-top") ? 0 : parseInt(f.css("margin-top"), 10), c = f.offset().left - a - n, d = f.offset().top - l - s, f.parents().each(function() {
var e = t(this);
return e.data("stellar-offset-parent") === !0 ? (g = w, v = y, h = e, !1) : (w += e.position().left, void(y += e.position().top))
}), e = f.data("stellar-horizontal-offset") !== o ? f.data("stellar-horizontal-offset") : h !== o && h.data("stellar-horizontal-offset") !== o ? h.data("stellar-horizontal-offset") : i.horizontalOffset, r = f.data("stellar-vertical-offset") !== o ? f.data("stellar-vertical-offset") : h !== o && h.data("stellar-vertical-offset") !== o ? h.data("stellar-vertical-offset") : i.verticalOffset, i.backgrounds.push({
$element: f,
$offsetParent: h,
isFixed: "fixed" === f.css("background-attachment"),
horizontalOffset: e,
verticalOffset: r,
startingValueLeft: m[0],
startingValueTop: m[1],
startingBackgroundPositionLeft: isNaN(parseInt(m[0], 10)) ? 0 : parseInt(m[0], 10),
startingBackgroundPositionTop: isNaN(parseInt(m[1], 10)) ? 0 : parseInt(m[1], 10),
startingPositionLeft: f.position().left,
startingPositionTop: f.position().top,
startingOffsetLeft: c,
startingOffsetTop: d,
parentOffsetLeft: g,
parentOffsetTop: v,
stellarRatio: f.data("stellar-background-ratio") === o ? 1 : f.data("stellar-background-ratio")
})
}))
},
_reset: function() {
var t, e, i, o, n;
for (n = this.particles.length - 1; n >= 0; n--) t = this.particles[n], e = t.$element.data("stellar-startingLeft"), i = t.$element.data("stellar-startingTop"), this._setPosition(t.$element, e, e, i, i), this.options.showElement(t.$element), t.$element.data("stellar-startingLeft", null).data("stellar-elementIsActive", null).data("stellar-backgroundIsActive", null);
for (n = this.backgrounds.length - 1; n >= 0; n--) o = this.backgrounds[n], o.$element.data("stellar-backgroundStartingLeft", null).data("stellar-backgroundStartingTop", null), u(o.$element, o.startingValueLeft, o.startingValueTop)
},
destroy: function() {
this._reset(), this.$scrollElement.unbind("resize." + this.name).unbind("scroll." + this.name), this._animationLoop = t.noop, t(e).unbind("load." + this.name).unbind("resize." + this.name)
},
_setOffsets: function() {
var i = this,
o = t(e);
o.unbind("resize.horizontal-" + this.name).unbind("resize.vertical-" + this.name), "function" == typeof this.options.horizontalOffset ? (this.horizontalOffset = this.options.horizontalOffset(), o.bind("resize.horizontal-" + this.name, function() {
i.horizontalOffset = i.options.horizontalOffset()
})) : this.horizontalOffset = this.options.horizontalOffset, "function" == typeof this.options.verticalOffset ? (this.verticalOffset = this.options.verticalOffset(), o.bind("resize.vertical-" + this.name, function() {
i.verticalOffset = i.options.verticalOffset()
})) : this.verticalOffset = this.options.verticalOffset
},
_repositionElements: function() {
var t, e, i, o, n, s, r, a, l, c, d = this._getScrollLeft(),
h = this._getScrollTop(),
p = !0,
f = !0;
if (this.currentScrollLeft !== d || this.currentScrollTop !== h || this.currentWidth !== this.viewportWidth || this.currentHeight !== this.viewportHeight) {
for (this.currentScrollLeft = d, this.currentScrollTop = h, this.currentWidth = this.viewportWidth, this.currentHeight = this.viewportHeight, c = this.particles.length - 1; c >= 0; c--) t = this.particles[c], e = t.isFixed ? 1 : 0, this.options.horizontalScrolling ? (s = (d + t.horizontalOffset + this.viewportOffsetLeft + t.startingPositionLeft - t.startingOffsetLeft + t.parentOffsetLeft) * -(t.stellarRatio + e - 1) + t.startingPositionLeft, a = s - t.startingPositionLeft + t.startingOffsetLeft) : (s = t.startingPositionLeft, a = t.startingOffsetLeft), this.options.verticalScrolling ? (r = (h + t.verticalOffset + this.viewportOffsetTop + t.startingPositionTop - t.startingOffsetTop + t.parentOffsetTop) * -(t.stellarRatio + e - 1) + t.startingPositionTop, l = r - t.startingPositionTop + t.startingOffsetTop) : (r = t.startingPositionTop, l = t.startingOffsetTop), this.options.hideDistantElements && (f = !this.options.horizontalScrolling || a + t.width > (t.isFixed ? 0 : d) && a < (t.isFixed ? 0 : d) + this.viewportWidth + this.viewportOffsetLeft, p = !this.options.verticalScrolling || l + t.height > (t.isFixed ? 0 : h) && l < (t.isFixed ? 0 : h) + this.viewportHeight + this.viewportOffsetTop), f && p ? (t.isHidden && (this.options.showElement(t.$element), t.isHidden = !1), this._setPosition(t.$element, s, t.startingPositionLeft, r, t.startingPositionTop)) : t.isHidden || (this.options.hideElement(t.$element), t.isHidden = !0);
for (c = this.backgrounds.length - 1; c >= 0; c--) i = this.backgrounds[c], e = i.isFixed ? 0 : 1, o = this.options.horizontalScrolling ? (d + i.horizontalOffset - this.viewportOffsetLeft - i.startingOffsetLeft + i.parentOffsetLeft - i.startingBackgroundPositionLeft) * (e - i.stellarRatio) + "px" : i.startingValueLeft, n = this.options.verticalScrolling ? (h + i.verticalOffset - this.viewportOffsetTop - i.startingOffsetTop + i.parentOffsetTop - i.startingBackgroundPositionTop) * (e - i.stellarRatio) + "px" : i.startingValueTop, u(i.$element, o, n)
}
},
_handleScrollEvent: function() {
var t = this,
e = !1,
i = function() {
t._repositionElements(), e = !1
},
o = function() {
e || (f(i), e = !0)
};
this.$scrollElement.bind("scroll." + this.name, o), o()
},
_startAnimationLoop: function() {
var t = this;
this._animationLoop = function() {
f(t._animationLoop), t._repositionElements()
}, this._animationLoop()
}
}, t.fn[s] = function(e) {
var i = arguments;
return e === o || "object" == typeof e ? this.each(function() {
t.data(this, "plugin_" + s) || t.data(this, "plugin_" + s, new n(this, e))
}) : "string" == typeof e && "_" !== e[0] && "init" !== e ? this.each(function() {
var o = t.data(this, "plugin_" + s);
o instanceof n && "function" == typeof o[e] && o[e].apply(o, Array.prototype.slice.call(i, 1)), "destroy" === e && t.data(this, "plugin_" + s, null)
}) : void 0
}, t[s] = function() {
var i = t(e);
return i.stellar.apply(i, Array.prototype.slice.call(arguments, 0))
}, t[s].scrollProperty = a, t[s].positionProperty = l, e.Stellar = n
}(jQuery, this, document), function(t) {
"use strict";
t.fn.counterUp = function(e) {
var i = t.extend({
time: 400,
delay: 10
}, e);
return this.each(function() {
var e = t(this),
o = i,
n = function() {
var t = [],
i = o.time / o.delay,
n = e.text(),
s = /[0-9]+,[0-9]+/.test(n);
n = n.replace(/,/g, "");
for (var r = (/^[0-9]+$/.test(n), /^[0-9]+\.[0-9]+$/.test(n)), a = r ? (n.split(".")[1] || []).length : 0, l = i; l >= 1; l--) {
var c = parseInt(n / i * l);
if (r && (c = parseFloat(n / i * l).toFixed(a)), s)
for (;
/(\d+)(\d{3})/.test(c.toString());) c = c.toString().replace(/(\d+)(\d{3})/, "$1,$2");
t.unshift(c)
}
e.data("counterup-nums", t), e.text("0");
var d = function() {
e.text(e.data("counterup-nums").shift()), e.data("counterup-nums").length ? setTimeout(e.data("counterup-func"), o.delay) : (delete e.data("counterup-nums"), e.data("counterup-nums", null), e.data("counterup-func", null))
};
e.data("counterup-func", d), setTimeout(e.data("counterup-func"), o.delay)
};
e.waypoint(n, {
offset: "100%",
triggerOnce: !0
})
})
}
}(jQuery), "undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery");
if (+ function(t) {
"use strict";
var e = t.fn.jquery.split(" ")[0].split(".");
if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1) throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")
}(jQuery), + function(t) {
"use strict";
function e() {
var t = document.createElement("bootstrap"),
e = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
};
for (var i in e)
if (void 0 !== t.style[i]) return {
end: e[i]
};
return !1
}
t.fn.emulateTransitionEnd = function(e) {
var i = !1,
o = this;
t(this).one("bsTransitionEnd", function() {
i = !0
});
var n = function() {
i || t(o).trigger(t.support.transition.end)
};
return setTimeout(n, e), this
}, t(function() {
t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = {
bindType: t.support.transition.end,
delegateType: t.support.transition.end,
handle: function(e) {
return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0
}
})
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var i = t(this),
n = i.data("bs.alert");
n || i.data("bs.alert", n = new o(this)), "string" == typeof e && n[e].call(i)
})
}
var i = '[data-dismiss="alert"]',
o = function(e) {
t(e).on("click", i, this.close)
};
o.VERSION = "3.3.4", o.TRANSITION_DURATION = 150, o.prototype.close = function(e) {
function i() {
r.detach().trigger("closed.bs.alert").remove()
}
var n = t(this),
s = n.attr("data-target");
s || (s = n.attr("href"), s = s && s.replace(/.*(?=#[^\s]*$)/, ""));
var r = t(s);
e && e.preventDefault(), r.length || (r = n.closest(".alert")), r.trigger(e = t.Event("close.bs.alert")), e.isDefaultPrevented() || (r.removeClass("in"), t.support.transition && r.hasClass("fade") ? r.one("bsTransitionEnd", i).emulateTransitionEnd(o.TRANSITION_DURATION) : i())
};
var n = t.fn.alert;
t.fn.alert = e, t.fn.alert.Constructor = o, t.fn.alert.noConflict = function() {
return t.fn.alert = n, this
}, t(document).on("click.bs.alert.data-api", i, o.prototype.close)
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.button"),
s = "object" == typeof e && e;
n || o.data("bs.button", n = new i(this, s)), "toggle" == e ? n.toggle() : e && n.setState(e)
})
}
var i = function(e, o) {
this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, o), this.isLoading = !1
};
i.VERSION = "3.3.4", i.DEFAULTS = {
loadingText: "loading..."
}, i.prototype.setState = function(e) {
var i = "disabled",
o = this.$element,
n = o.is("input") ? "val" : "html",
s = o.data();
e += "Text", null == s.resetText && o.data("resetText", o[n]()), setTimeout(t.proxy(function() {
o[n](null == s[e] ? this.options[e] : s[e]), "loadingText" == e ? (this.isLoading = !0, o.addClass(i).attr(i, i)) : this.isLoading && (this.isLoading = !1, o.removeClass(i).removeAttr(i))
}, this), 0)
}, i.prototype.toggle = function() {
var t = !0,
e = this.$element.closest('[data-toggle="buttons"]');
if (e.length) {
var i = this.$element.find("input");
"radio" == i.prop("type") && (i.prop("checked") && this.$element.hasClass("active") ? t = !1 : e.find(".active").removeClass("active")), t && i.prop("checked", !this.$element.hasClass("active")).trigger("change")
} else this.$element.attr("aria-pressed", !this.$element.hasClass("active"));
t && this.$element.toggleClass("active")
};
var o = t.fn.button;
t.fn.button = e, t.fn.button.Constructor = i, t.fn.button.noConflict = function() {
return t.fn.button = o, this
}, t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(i) {
var o = t(i.target);
o.hasClass("btn") || (o = o.closest(".btn")), e.call(o, "toggle"), i.preventDefault()
}).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(e) {
t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type))
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.carousel"),
s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof e && e),
r = "string" == typeof e ? e : s.slide;
n || o.data("bs.carousel", n = new i(this, s)), "number" == typeof e ? n.to(e) : r ? n[r]() : s.interval && n.pause().cycle()
})
}
var i = function(e, i) {
this.$element = t(e), this.$indicators = this.$element.find(".carousel-indicators"), this.options = i, this.paused = null, this.sliding = null, this.interval = null, this.$active = null, this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this))
};
i.VERSION = "3.3.4", i.TRANSITION_DURATION = 600, i.DEFAULTS = {
interval: 5e3,
pause: "hover",
wrap: !0,
keyboard: !0
}, i.prototype.keydown = function(t) {
if (!/input|textarea/i.test(t.target.tagName)) {
switch (t.which) {
case 37:
this.prev();
break;
case 39:
this.next();
break;
default:
return
}
t.preventDefault()
}
}, i.prototype.cycle = function(e) {
return e || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)), this
}, i.prototype.getItemIndex = function(t) {
return this.$items = t.parent().children(".item"), this.$items.index(t || this.$active)
}, i.prototype.getItemForDirection = function(t, e) {
var i = this.getItemIndex(e),
o = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1;
if (o && !this.options.wrap) return e;
var n = "prev" == t ? -1 : 1,
s = (i + n) % this.$items.length;
return this.$items.eq(s)
}, i.prototype.to = function(t) {
var e = this,
i = this.getItemIndex(this.$active = this.$element.find(".item.active"));
return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() {
e.to(t)
}) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t))
}, i.prototype.pause = function(e) {
return e || (this.paused = !0), this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this
}, i.prototype.next = function() {
return this.sliding ? void 0 : this.slide("next")
}, i.prototype.prev = function() {
return this.sliding ? void 0 : this.slide("prev")
}, i.prototype.slide = function(e, o) {
var n = this.$element.find(".item.active"),
s = o || this.getItemForDirection(e, n),
r = this.interval,
a = "next" == e ? "left" : "right",
l = this;
if (s.hasClass("active")) return this.sliding = !1;
var c = s[0],
d = t.Event("slide.bs.carousel", {
relatedTarget: c,
direction: a
});
if (this.$element.trigger(d), !d.isDefaultPrevented()) {
if (this.sliding = !0, r && this.pause(), this.$indicators.length) {
this.$indicators.find(".active").removeClass("active");
var h = t(this.$indicators.children()[this.getItemIndex(s)]);
h && h.addClass("active")
}
var u = t.Event("slid.bs.carousel", {
relatedTarget: c,
direction: a
});
return t.support.transition && this.$element.hasClass("slide") ? (s.addClass(e), s[0].offsetWidth, n.addClass(a), s.addClass(a), n.one("bsTransitionEnd", function() {
s.removeClass([e, a].join(" ")).addClass("active"), n.removeClass(["active", a].join(" ")), l.sliding = !1, setTimeout(function() {
l.$element.trigger(u)
}, 0)
}).emulateTransitionEnd(i.TRANSITION_DURATION)) : (n.removeClass("active"), s.addClass("active"), this.sliding = !1, this.$element.trigger(u)), r && this.cycle(), this
}
};
var o = t.fn.carousel;
t.fn.carousel = e, t.fn.carousel.Constructor = i, t.fn.carousel.noConflict = function() {
return t.fn.carousel = o, this
};
var n = function(i) {
var o, n = t(this),
s = t(n.attr("data-target") || (o = n.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, ""));
if (s.hasClass("carousel")) {
var r = t.extend({}, s.data(), n.data()),
a = n.attr("data-slide-to");
a && (r.interval = !1), e.call(s, r), a && s.data("bs.carousel").to(a), i.preventDefault()
}
};
t(document).on("click.bs.carousel.data-api", "[data-slide]", n).on("click.bs.carousel.data-api", "[data-slide-to]", n), t(window).on("load", function() {
t('[data-ride="carousel"]').each(function() {
var i = t(this);
e.call(i, i.data())
})
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
var i, o = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, "");
return t(o)
}
function i(e) {
return this.each(function() {
var i = t(this),
n = i.data("bs.collapse"),
s = t.extend({}, o.DEFAULTS, i.data(), "object" == typeof e && e);
!n && s.toggle && /show|hide/.test(e) && (s.toggle = !1), n || i.data("bs.collapse", n = new o(this, s)), "string" == typeof e && n[e]()
})
}
var o = function(e, i) {
this.$element = t(e), this.options = t.extend({}, o.DEFAULTS, i), this.$trigger = t('[data-toggle="collapse"][href="#' + e.id + '"],[data-toggle="collapse"][data-target="#' + e.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle()
};
o.VERSION = "3.3.4", o.TRANSITION_DURATION = 350, o.DEFAULTS = {
toggle: !0
}, o.prototype.dimension = function() {
var t = this.$element.hasClass("width");
return t ? "width" : "height"
}, o.prototype.show = function() {
if (!this.transitioning && !this.$element.hasClass("in")) {
var e, n = this.$parent && this.$parent.children(".panel").children(".in, .collapsing");
if (!(n && n.length && (e = n.data("bs.collapse"), e && e.transitioning))) {
var s = t.Event("show.bs.collapse");
if (this.$element.trigger(s), !s.isDefaultPrevented()) {
n && n.length && (i.call(n, "hide"), e || n.data("bs.collapse", null));
var r = this.dimension();
this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1;
var a = function() {
this.$element.removeClass("collapsing").addClass("collapse in")[r](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse")
};
if (!t.support.transition) return a.call(this);
var l = t.camelCase(["scroll", r].join("-"));
this.$element.one("bsTransitionEnd", t.proxy(a, this)).emulateTransitionEnd(o.TRANSITION_DURATION)[r](this.$element[0][l])
}
}
}
}, o.prototype.hide = function() {
if (!this.transitioning && this.$element.hasClass("in")) {
var e = t.Event("hide.bs.collapse");
if (this.$element.trigger(e), !e.isDefaultPrevented()) {
var i = this.dimension();
this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1;
var n = function() {
this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")
};
return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(n, this)).emulateTransitionEnd(o.TRANSITION_DURATION) : n.call(this)
}
}
}, o.prototype.toggle = function() {
this[this.$element.hasClass("in") ? "hide" : "show"]()
}, o.prototype.getParent = function() {
return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function(i, o) {
var n = t(o);
this.addAriaAndCollapsedClass(e(n), n)
}, this)).end()
}, o.prototype.addAriaAndCollapsedClass = function(t, e) {
var i = t.hasClass("in");
t.attr("aria-expanded", i), e.toggleClass("collapsed", !i).attr("aria-expanded", i)
};
var n = t.fn.collapse;
t.fn.collapse = i, t.fn.collapse.Constructor = o, t.fn.collapse.noConflict = function() {
return t.fn.collapse = n, this
}, t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(o) {
var n = t(this);
n.attr("data-target") || o.preventDefault();
var s = e(n),
r = s.data("bs.collapse"),
a = r ? "toggle" : n.data();
i.call(s, a)
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
e && 3 === e.which || (t(n).remove(), t(s).each(function() {
var o = t(this),
n = i(o),
s = {
relatedTarget: this
};
n.hasClass("open") && (n.trigger(e = t.Event("hide.bs.dropdown", s)), e.isDefaultPrevented() || (o.attr("aria-expanded", "false"), n.removeClass("open").trigger("hidden.bs.dropdown", s)))
}))
}
function i(e) {
var i = e.attr("data-target");
i || (i = e.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, ""));
var o = i && t(i);
return o && o.length ? o : e.parent()
}
function o(e) {
return this.each(function() {
var i = t(this),
o = i.data("bs.dropdown");
o || i.data("bs.dropdown", o = new r(this)), "string" == typeof e && o[e].call(i)
})
}
var n = ".dropdown-backdrop",
s = '[data-toggle="dropdown"]',
r = function(e) {
t(e).on("click.bs.dropdown", this.toggle)
};
r.VERSION = "3.3.4", r.prototype.toggle = function(o) {
var n = t(this);
if (!n.is(".disabled, :disabled")) {
var s = i(n),
r = s.hasClass("open");
if (e(), !r) {
"ontouchstart" in document.documentElement && !s.closest(".navbar-nav").length && t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click", e);
var a = {
relatedTarget: this
};
if (s.trigger(o = t.Event("show.bs.dropdown", a)), o.isDefaultPrevented()) return;
n.trigger("focus").attr("aria-expanded", "true"), s.toggleClass("open").trigger("shown.bs.dropdown", a)
}
return !1
}
}, r.prototype.keydown = function(e) {
if (/(38|40|27|32)/.test(e.which) && !/input|textarea/i.test(e.target.tagName)) {
var o = t(this);
if (e.preventDefault(), e.stopPropagation(), !o.is(".disabled, :disabled")) {
var n = i(o),
r = n.hasClass("open");
if (!r && 27 != e.which || r && 27 == e.which) return 27 == e.which && n.find(s).trigger("focus"), o.trigger("click");
var a = " li:not(.disabled):visible a",
l = n.find('[role="menu"]' + a + ', [role="listbox"]' + a);
if (l.length) {
var c = l.index(e.target);
38 == e.which && c > 0 && c--, 40 == e.which && c < l.length - 1 && c++, ~c || (c = 0), l.eq(c).trigger("focus")
}
}
}
};
var a = t.fn.dropdown;
t.fn.dropdown = o, t.fn.dropdown.Constructor = r, t.fn.dropdown.noConflict = function() {
return t.fn.dropdown = a, this
}, t(document).on("click.bs.dropdown.data-api", e).on("click.bs.dropdown.data-api", ".dropdown form", function(t) {
t.stopPropagation()
}).on("click.bs.dropdown.data-api", s, r.prototype.toggle).on("keydown.bs.dropdown.data-api", s, r.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="menu"]', r.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="listbox"]', r.prototype.keydown)
}(jQuery), + function(t) {
"use strict";
function e(e, o) {
return this.each(function() {
var n = t(this),
s = n.data("bs.modal"),
r = t.extend({}, i.DEFAULTS, n.data(), "object" == typeof e && e);
s || n.data("bs.modal", s = new i(this, r)), "string" == typeof e ? s[e](o) : r.show && s.show(o)
})
}
var i = function(e, i) {
this.options = i, this.$body = t(document.body), this.$element = t(e), this.$dialog = this.$element.find(".modal-dialog"), this.$backdrop = null, this.isShown = null, this.originalBodyPad = null, this.scrollbarWidth = 0, this.ignoreBackdropClick = !1, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, t.proxy(function() {
this.$element.trigger("loaded.bs.modal")
}, this))
};
i.VERSION = "3.3.4", i.TRANSITION_DURATION = 300, i.BACKDROP_TRANSITION_DURATION = 150, i.DEFAULTS = {
backdrop: !0,
keyboard: !0,
show: !0
}, i.prototype.toggle = function(t) {
return this.isShown ? this.hide() : this.show(t)
}, i.prototype.show = function(e) {
var o = this,
n = t.Event("show.bs.modal", {
relatedTarget: e
});
this.$element.trigger(n), this.isShown || n.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.setScrollbar(), this.$body.addClass("modal-open"), this.escape(), this.resize(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', t.proxy(this.hide, this)), this.$dialog.on("mousedown.dismiss.bs.modal", function() {
o.$element.one("mouseup.dismiss.bs.modal", function(e) {
t(e.target).is(o.$element) && (o.ignoreBackdropClick = !0)
})
}), this.backdrop(function() {
var n = t.support.transition && o.$element.hasClass("fade");
o.$element.parent().length || o.$element.appendTo(o.$body), o.$element.show().scrollTop(0), o.adjustDialog(), n && o.$element[0].offsetWidth, o.$element.addClass("in").attr("aria-hidden", !1), o.enforceFocus();
var s = t.Event("shown.bs.modal", {
relatedTarget: e
});
n ? o.$dialog.one("bsTransitionEnd", function() {
o.$element.trigger("focus").trigger(s)
}).emulateTransitionEnd(i.TRANSITION_DURATION) : o.$element.trigger("focus").trigger(s)
}))
}, i.prototype.hide = function(e) {
e && e.preventDefault(), e = t.Event("hide.bs.modal"), this.$element.trigger(e), this.isShown && !e.isDefaultPrevented() && (this.isShown = !1, this.escape(), this.resize(), t(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), this.$dialog.off("mousedown.dismiss.bs.modal"), t.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", t.proxy(this.hideModal, this)).emulateTransitionEnd(i.TRANSITION_DURATION) : this.hideModal())
}, i.prototype.enforceFocus = function() {
t(document).off("focusin.bs.modal").on("focusin.bs.modal", t.proxy(function(t) {
this.$element[0] === t.target || this.$element.has(t.target).length || this.$element.trigger("focus")
}, this))
}, i.prototype.escape = function() {
this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", t.proxy(function(t) {
27 == t.which && this.hide()
}, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal")
}, i.prototype.resize = function() {
this.isShown ? t(window).on("resize.bs.modal", t.proxy(this.handleUpdate, this)) : t(window).off("resize.bs.modal")
}, i.prototype.hideModal = function() {
var t = this;
this.$element.hide(), this.backdrop(function() {
t.$body.removeClass("modal-open"), t.resetAdjustments(), t.resetScrollbar(), t.$element.trigger("hidden.bs.modal")
})
}, i.prototype.removeBackdrop = function() {
this.$backdrop && this.$backdrop.remove(), this.$backdrop = null
}, i.prototype.backdrop = function(e) {
var o = this,
n = this.$element.hasClass("fade") ? "fade" : "";
if (this.isShown && this.options.backdrop) {
var s = t.support.transition && n;
if (this.$backdrop = t('<div class="modal-backdrop ' + n + '" />').appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", t.proxy(function(t) {
return this.ignoreBackdropClick ? void(this.ignoreBackdropClick = !1) : void(t.target === t.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide()))
}, this)), s && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !e) return;
s ? this.$backdrop.one("bsTransitionEnd", e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : e()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass("in");
var r = function() {
o.removeBackdrop(), e && e()
};
t.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", r).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : r()
} else e && e()
}, i.prototype.handleUpdate = function() {
this.adjustDialog()
}, i.prototype.adjustDialog = function() {
var t = this.$element[0].scrollHeight > document.documentElement.clientHeight;
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && t ? this.scrollbarWidth : "",
paddingRight: this.bodyIsOverflowing && !t ? this.scrollbarWidth : ""
})
}, i.prototype.resetAdjustments = function() {
this.$element.css({
paddingLeft: "",
paddingRight: ""
})
}, i.prototype.checkScrollbar = function() {
var t = window.innerWidth;
if (!t) {
var e = document.documentElement.getBoundingClientRect();
t = e.right - Math.abs(e.left)
}
this.bodyIsOverflowing = document.body.clientWidth < t, this.scrollbarWidth = this.measureScrollbar()
}, i.prototype.setScrollbar = function() {
var t = parseInt(this.$body.css("padding-right") || 0, 10);
this.originalBodyPad = document.body.style.paddingRight || "", this.bodyIsOverflowing && this.$body.css("padding-right", t + this.scrollbarWidth)
}, i.prototype.resetScrollbar = function() {
this.$body.css("padding-right", this.originalBodyPad)
}, i.prototype.measureScrollbar = function() {
var t = document.createElement("div");
t.className = "modal-scrollbar-measure", this.$body.append(t);
var e = t.offsetWidth - t.clientWidth;
return this.$body[0].removeChild(t), e
};
var o = t.fn.modal;
t.fn.modal = e, t.fn.modal.Constructor = i, t.fn.modal.noConflict = function() {
return t.fn.modal = o, this
}, t(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(i) {
var o = t(this),
n = o.attr("href"),
s = t(o.attr("data-target") || n && n.replace(/.*(?=#[^\s]+$)/, "")),
r = s.data("bs.modal") ? "toggle" : t.extend({
remote: !/#/.test(n) && n
}, s.data(), o.data());
o.is("a") && i.preventDefault(), s.one("show.bs.modal", function(t) {
t.isDefaultPrevented() || s.one("hidden.bs.modal", function() {
o.is(":visible") && o.trigger("focus")
})
}), e.call(s, r, this)
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.tooltip"),
s = "object" == typeof e && e;
(n || !/destroy|hide/.test(e)) && (n || o.data("bs.tooltip", n = new i(this, s)), "string" == typeof e && n[e]())
})
}
var i = function(t, e) {
this.type = null, this.options = null, this.enabled = null, this.timeout = null, this.hoverState = null, this.$element = null, this.init("tooltip", t, e)
};
i.VERSION = "3.3.4", i.TRANSITION_DURATION = 150, i.DEFAULTS = {
animation: !0,
placement: "top",
selector: !1,
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: "hover focus",
title: "",
delay: 0,
html: !1,
container: !1,
viewport: {
selector: "body",
padding: 0
}
}, i.prototype.init = function(e, i, o) {
if (this.enabled = !0, this.type = e, this.$element = t(i), this.options = this.getOptions(o), this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport), this.$element[0] instanceof document.constructor && !this.options.selector) throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!");
for (var n = this.options.trigger.split(" "), s = n.length; s--;) {
var r = n[s];
if ("click" == r) this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
else if ("manual" != r) {
var a = "hover" == r ? "mouseenter" : "focusin",
l = "hover" == r ? "mouseleave" : "focusout";
this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
}
}
this.options.selector ? this._options = t.extend({}, this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle()
}, i.prototype.getDefaults = function() {
return i.DEFAULTS
}, i.prototype.getOptions = function(e) {
return e = t.extend({}, this.getDefaults(), this.$element.data(), e), e.delay && "number" == typeof e.delay && (e.delay = {
show: e.delay,
hide: e.delay
}), e
}, i.prototype.getDelegateOptions = function() {
var e = {},
i = this.getDefaults();
return this._options && t.each(this._options, function(t, o) {
i[t] != o && (e[t] = o)
}), e
}, i.prototype.enter = function(e) {
var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
return i && i.$tip && i.$tip.is(":visible") ? void(i.hoverState = "in") : (i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), clearTimeout(i.timeout), i.hoverState = "in", i.options.delay && i.options.delay.show ? void(i.timeout = setTimeout(function() {
"in" == i.hoverState && i.show()
}, i.options.delay.show)) : i.show())
}, i.prototype.leave = function(e) {
var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
return i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), clearTimeout(i.timeout), i.hoverState = "out", i.options.delay && i.options.delay.hide ? void(i.timeout = setTimeout(function() {
"out" == i.hoverState && i.hide()
}, i.options.delay.hide)) : i.hide()
}, i.prototype.show = function() {
var e = t.Event("show.bs." + this.type);
if (this.hasContent() && this.enabled) {
this.$element.trigger(e);
var o = t.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
if (e.isDefaultPrevented() || !o) return;
var n = this,
s = this.tip(),
r = this.getUID(this.type);
this.setContent(), s.attr("id", r), this.$element.attr("aria-describedby", r), this.options.animation && s.addClass("fade");
var a = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement,
l = /\s?auto?\s?/i,
c = l.test(a);
c && (a = a.replace(l, "") || "top"), s.detach().css({
top: 0,
left: 0,
display: "block"
}).addClass(a).data("bs." + this.type, this), this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
var d = this.getPosition(),
h = s[0].offsetWidth,
u = s[0].offsetHeight;
if (c) {
var p = a,
f = this.options.container ? t(this.options.container) : this.$element.parent(),
m = this.getPosition(f);
a = "bottom" == a && d.bottom + u > m.bottom ? "top" : "top" == a && d.top - u < m.top ? "bottom" : "right" == a && d.right + h > m.width ? "left" : "left" == a && d.left - h < m.left ? "right" : a, s.removeClass(p).addClass(a)
}
var g = this.getCalculatedOffset(a, d, h, u);
this.applyPlacement(g, a);
var v = function() {
var t = n.hoverState;
n.$element.trigger("shown.bs." + n.type), n.hoverState = null, "out" == t && n.leave(n)
};
t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", v).emulateTransitionEnd(i.TRANSITION_DURATION) : v()
}
}, i.prototype.applyPlacement = function(e, i) {
var o = this.tip(),
n = o[0].offsetWidth,
s = o[0].offsetHeight,
r = parseInt(o.css("margin-top"), 10),
a = parseInt(o.css("margin-left"), 10);
isNaN(r) && (r = 0), isNaN(a) && (a = 0), e.top = e.top + r, e.left = e.left + a, t.offset.setOffset(o[0], t.extend({
using: function(t) {
o.css({
top: Math.round(t.top),
left: Math.round(t.left)
})
}
}, e), 0), o.addClass("in");
var l = o[0].offsetWidth,
c = o[0].offsetHeight;
"top" == i && c != s && (e.top = e.top + s - c);
var d = this.getViewportAdjustedDelta(i, e, l, c);
d.left ? e.left += d.left : e.top += d.top;
var h = /top|bottom/.test(i),
u = h ? 2 * d.left - n + l : 2 * d.top - s + c,
p = h ? "offsetWidth" : "offsetHeight";
o.offset(e), this.replaceArrow(u, o[0][p], h)
}, i.prototype.replaceArrow = function(t, e, i) {
this.arrow().css(i ? "left" : "top", 50 * (1 - t / e) + "%").css(i ? "top" : "left", "")
}, i.prototype.setContent = function() {
var t = this.tip(),
e = this.getTitle();
t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e), t.removeClass("fade in top bottom left right")
}, i.prototype.hide = function(e) {
function o() {
"in" != n.hoverState && s.detach(), n.$element.removeAttr("aria-describedby").trigger("hidden.bs." + n.type), e && e()
}
var n = this,
s = t(this.$tip),
r = t.Event("hide.bs." + this.type);
return this.$element.trigger(r), r.isDefaultPrevented() ? void 0 : (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one("bsTransitionEnd", o).emulateTransitionEnd(i.TRANSITION_DURATION) : o(), this.hoverState = null, this)
}, i.prototype.fixTitle = function() {
var t = this.$element;
(t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
}, i.prototype.hasContent = function() {
return this.getTitle()
}, i.prototype.getPosition = function(e) {
e = e || this.$element;
var i = e[0],
o = "BODY" == i.tagName,
n = i.getBoundingClientRect();
null == n.width && (n = t.extend({}, n, {
width: n.right - n.left,
height: n.bottom - n.top
}));
var s = o ? {
top: 0,
left: 0
} : e.offset(),
r = {
scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop()
},
a = o ? {
width: t(window).width(),
height: t(window).height()
} : null;
return t.extend({}, n, r, a, s)
}, i.prototype.getCalculatedOffset = function(t, e, i, o) {
return "bottom" == t ? {
top: e.top + e.height,
left: e.left + e.width / 2 - i / 2
} : "top" == t ? {
top: e.top - o,
left: e.left + e.width / 2 - i / 2
} : "left" == t ? {
top: e.top + e.height / 2 - o / 2,
left: e.left - i
} : {
top: e.top + e.height / 2 - o / 2,
left: e.left + e.width
}
}, i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
var n = {
top: 0,
left: 0
};
if (!this.$viewport) return n;
var s = this.options.viewport && this.options.viewport.padding || 0,
r = this.getPosition(this.$viewport);
if (/right|left/.test(t)) {
var a = e.top - s - r.scroll,
l = e.top + s - r.scroll + o;
a < r.top ? n.top = r.top - a : l > r.top + r.height && (n.top = r.top + r.height - l)
} else {
var c = e.left - s,
d = e.left + s + i;
c < r.left ? n.left = r.left - c : d > r.width && (n.left = r.left + r.width - d)
}
return n
}, i.prototype.getTitle = function() {
var t, e = this.$element,
i = this.options;
return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
}, i.prototype.getUID = function(t) {
do t += ~~(1e6 * Math.random()); while (document.getElementById(t));
return t
}, i.prototype.tip = function() {
return this.$tip = this.$tip || t(this.options.template)
}, i.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
}, i.prototype.enable = function() {
this.enabled = !0
}, i.prototype.disable = function() {
this.enabled = !1
}, i.prototype.toggleEnabled = function() {
this.enabled = !this.enabled
}, i.prototype.toggle = function(e) {
var i = this;
e && (i = t(e.currentTarget).data("bs." + this.type), i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i))), i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
}, i.prototype.destroy = function() {
var t = this;
clearTimeout(this.timeout), this.hide(function() {
t.$element.off("." + t.type).removeData("bs." + t.type)
})
};
var o = t.fn.tooltip;
t.fn.tooltip = e, t.fn.tooltip.Constructor = i, t.fn.tooltip.noConflict = function() {
return t.fn.tooltip = o, this
}
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.popover"),
s = "object" == typeof e && e;
(n || !/destroy|hide/.test(e)) && (n || o.data("bs.popover", n = new i(this, s)), "string" == typeof e && n[e]())
})
}
var i = function(t, e) {
this.init("popover", t, e)
};
if (!t.fn.tooltip) throw new Error("Popover requires tooltip.js");
i.VERSION = "3.3.4", i.DEFAULTS = t.extend({}, t.fn.tooltip.Constructor.DEFAULTS, {
placement: "right",
trigger: "click",
content: "",
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}), i.prototype = t.extend({}, t.fn.tooltip.Constructor.prototype), i.prototype.constructor = i, i.prototype.getDefaults = function() {
return i.DEFAULTS
}, i.prototype.setContent = function() {
var t = this.tip(),
e = this.getTitle(),
i = this.getContent();
t.find(".popover-title")[this.options.html ? "html" : "text"](e), t.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof i ? "html" : "append" : "text"](i), t.removeClass("fade top bottom left right in"), t.find(".popover-title").html() || t.find(".popover-title").hide()
}, i.prototype.hasContent = function() {
return this.getTitle() || this.getContent()
}, i.prototype.getContent = function() {
var t = this.$element,
e = this.options;
return t.attr("data-content") || ("function" == typeof e.content ? e.content.call(t[0]) : e.content)
}, i.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".arrow")
};
var o = t.fn.popover;
t.fn.popover = e, t.fn.popover.Constructor = i, t.fn.popover.noConflict = function() {
return t.fn.popover = o, this
}
}(jQuery), + function(t) {
"use strict";
function e(i, o) {
this.$body = t(document.body), this.$scrollElement = t(t(i).is(document.body) ? window : i), this.options = t.extend({}, e.DEFAULTS, o), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", t.proxy(this.process, this)), this.refresh(), this.process()
}
function i(i) {
return this.each(function() {
var o = t(this),
n = o.data("bs.scrollspy"),
s = "object" == typeof i && i;
n || o.data("bs.scrollspy", n = new e(this, s)), "string" == typeof i && n[i]()
})
}
e.VERSION = "3.3.4", e.DEFAULTS = {
offset: 10
}, e.prototype.getScrollHeight = function() {
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}, e.prototype.refresh = function() {
var e = this,
i = "offset",
o = 0;
this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight(), t.isWindow(this.$scrollElement[0]) || (i = "position", o = this.$scrollElement.scrollTop()), this.$body.find(this.selector).map(function() {
var e = t(this),
n = e.data("target") || e.attr("href"),
s = /^#./.test(n) && t(n);
return s && s.length && s.is(":visible") && [
[s[i]().top + o, n]
] || null
}).sort(function(t, e) {
return t[0] - e[0]
}).each(function() {
e.offsets.push(this[0]), e.targets.push(this[1])
})
}, e.prototype.process = function() {
var t, e = this.$scrollElement.scrollTop() + this.options.offset,
i = this.getScrollHeight(),
o = this.options.offset + i - this.$scrollElement.height(),
n = this.offsets,
s = this.targets,
r = this.activeTarget;
if (this.scrollHeight != i && this.refresh(), e >= o) return r != (t = s[s.length - 1]) && this.activate(t);
if (r && e < n[0]) return this.activeTarget = null, this.clear();
for (t = n.length; t--;) r != s[t] && e >= n[t] && (void 0 === n[t + 1] || e < n[t + 1]) && this.activate(s[t])
}, e.prototype.activate = function(e) {
this.activeTarget = e, this.clear();
var i = this.selector + '[data-target="' + e + '"],' + this.selector + '[href="' + e + '"]',
o = t(i).parents("li").addClass("active");
o.parent(".dropdown-menu").length && (o = o.closest("li.dropdown").addClass("active")), o.trigger("activate.bs.scrollspy")
}, e.prototype.clear = function() {
t(this.selector).parentsUntil(this.options.target, ".active").removeClass("active")
};
var o = t.fn.scrollspy;
t.fn.scrollspy = i, t.fn.scrollspy.Constructor = e, t.fn.scrollspy.noConflict = function() {
return t.fn.scrollspy = o, this
}, t(window).on("load.bs.scrollspy.data-api", function() {
t('[data-spy="scroll"]').each(function() {
var e = t(this);
i.call(e, e.data())
})
})
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.tab");
n || o.data("bs.tab", n = new i(this)), "string" == typeof e && n[e]()
})
}
var i = function(e) {
this.element = t(e)
};
i.VERSION = "3.3.4", i.TRANSITION_DURATION = 150, i.prototype.show = function() {
var e = this.element,
i = e.closest("ul:not(.dropdown-menu)"),
o = e.data("target");
if (o || (o = e.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, "")), !e.parent("li").hasClass("active")) {
var n = i.find(".active:last a"),
s = t.Event("hide.bs.tab", {
relatedTarget: e[0]
}),
r = t.Event("show.bs.tab", {
relatedTarget: n[0]
});
if (n.trigger(s), e.trigger(r), !r.isDefaultPrevented() && !s.isDefaultPrevented()) {
var a = t(o);
this.activate(e.closest("li"), i), this.activate(a, a.parent(), function() {
n.trigger({
type: "hidden.bs.tab",
relatedTarget: e[0]
}), e.trigger({
type: "shown.bs.tab",
relatedTarget: n[0]
})
})
}
}
}, i.prototype.activate = function(e, o, n) {
function s() {
r.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), a ? (e[0].offsetWidth, e.addClass("in")) : e.removeClass("fade"), e.parent(".dropdown-menu").length && e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), n && n()
}
var r = o.find("> .active"),
a = n && t.support.transition && (r.length && r.hasClass("fade") || !!o.find("> .fade").length);
r.length && a ? r.one("bsTransitionEnd", s).emulateTransitionEnd(i.TRANSITION_DURATION) : s(), r.removeClass("in")
};
var o = t.fn.tab;
t.fn.tab = e, t.fn.tab.Constructor = i, t.fn.tab.noConflict = function() {
return t.fn.tab = o, this
};
var n = function(i) {
i.preventDefault(), e.call(t(this), "show")
};
t(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', n).on("click.bs.tab.data-api", '[data-toggle="pill"]', n)
}(jQuery), + function(t) {
"use strict";
function e(e) {
return this.each(function() {
var o = t(this),
n = o.data("bs.affix"),
s = "object" == typeof e && e;
n || o.data("bs.affix", n = new i(this, s)), "string" == typeof e && n[e]()
})
}
var i = function(e, o) {
this.options = t.extend({}, i.DEFAULTS, o), this.$target = t(this.options.target).on("scroll.bs.affix.data-api", t.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", t.proxy(this.checkPositionWithEventLoop, this)), this.$element = t(e), this.affixed = null, this.unpin = null, this.pinnedOffset = null, this.checkPosition()
};
i.VERSION = "3.3.4", i.RESET = "affix affix-top affix-bottom", i.DEFAULTS = {
offset: 0,
target: window
}, i.prototype.getState = function(t, e, i, o) {
var n = this.$target.scrollTop(),
s = this.$element.offset(),
r = this.$target.height();
if (null != i && "top" == this.affixed) return i > n ? "top" : !1;
if ("bottom" == this.affixed) return null != i ? n + this.unpin <= s.top ? !1 : "bottom" : t - o >= n + r ? !1 : "bottom";
var a = null == this.affixed,
l = a ? n : s.top,
c = a ? r : e;
return null != i && i >= n ? "top" : null != o && l + c >= t - o ? "bottom" : !1
}, i.prototype.getPinnedOffset = function() {
if (this.pinnedOffset) return this.pinnedOffset;
this.$element.removeClass(i.RESET).addClass("affix");
var t = this.$target.scrollTop(),
e = this.$element.offset();
return this.pinnedOffset = e.top - t
}, i.prototype.checkPositionWithEventLoop = function() {
setTimeout(t.proxy(this.checkPosition, this), 1)
}, i.prototype.checkPosition = function() {
if (this.$element.is(":visible")) {
var e = this.$element.height(),
o = this.options.offset,
n = o.top,
s = o.bottom,
r = t(document.body).height();
"object" != typeof o && (s = n = o), "function" == typeof n && (n = o.top(this.$element)), "function" == typeof s && (s = o.bottom(this.$element));
var a = this.getState(r, e, n, s);
if (this.affixed != a) {
null != this.unpin && this.$element.css("top", "");
var l = "affix" + (a ? "-" + a : ""),
c = t.Event(l + ".bs.affix");
if (this.$element.trigger(c), c.isDefaultPrevented()) return;
this.affixed = a, this.unpin = "bottom" == a ? this.getPinnedOffset() : null, this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix", "affixed") + ".bs.affix")
}
"bottom" == a && this.$element.offset({
top: r - e - s
})
}
};
var o = t.fn.affix;
t.fn.affix = e, t.fn.affix.Constructor = i, t.fn.affix.noConflict = function() {
return t.fn.affix = o, this
}, t(window).on("load", function() {
t('[data-spy="affix"]').each(function() {
var i = t(this),
o = i.data();
o.offset = o.offset || {}, null != o.offsetBottom && (o.offset.bottom = o.offsetBottom), null != o.offsetTop && (o.offset.top = o.offsetTop), e.call(i, o)
})
})
}(jQuery), function() {
$(".footer-bottom").parent().is(".copy-right.pull-right") ? alert("You Cannot remove Copyrights. Please Contact us " + window.location.assign("http://jeweltheme.com/product/polmo")) : $(".copy-right").append('© <a href="http://demos.jeweltheme.com/polmo" target="_blank">Polmo</a> 2015 - All Reserves. Developed by <a href="http://jeweltheme.com/" target="_blank">Jewel Theme</a>. Designed by <a href="https://www.facebook.com/dinmuhammadsumon" target="_blank">D.M.S</a>')
}(jQuery), function(t) {
t.fn.touchwipe = function(e) {
var i = {
min_move_x: 20,
min_move_y: 20,
wipeLeft: function() {},
wipeRight: function() {},
wipeUp: function() {},
wipeDown: function() {},
preventDefaultEvents: !0
};
return e && t.extend(i, e), this.each(function() {
function t() {
this.removeEventListener("touchmove", e), n = null, r = !1
}
function e(e) {
if (i.preventDefaultEvents && e.preventDefault(), r) {
var o = e.touches[0].pageX,
a = e.touches[0].pageY,
l = n - o,
c = s - a;
Math.abs(l) >= i.min_move_x ? (t(), l > 0 ? i.wipeLeft() : i.wipeRight()) : Math.abs(c) >= i.min_move_y && (t(), c > 0 ? i.wipeDown() : i.wipeUp())
}
}
function o(t) {
1 == t.touches.length && (n = t.touches[0].pageX, s = t.touches[0].pageY, r = !0, this.addEventListener("touchmove", e, !1))
}
var n, s, r = !1;
"ontouchstart" in document.documentElement && this.addEventListener("touchstart", o, !1)
}), this
}
}(jQuery), ! function(t) {
"function" == typeof define && define.amd ? define(["jquery"], t) : t("object" == typeof exports ? require("jquery") : window.jQuery || window.Zepto)
}(function(t) {
var e, i, o, n, s, r, a = "Close",
l = "BeforeClose",
c = "AfterClose",
d = "BeforeAppend",
h = "MarkupParse",
u = "Open",
p = "Change",
f = "mfp",
m = "." + f,
g = "mfp-ready",
v = "mfp-removing",
w = "mfp-prevent-close",
y = function() {},
b = !!window.jQuery,
x = t(window),
S = function(t, i) {
e.ev.on(f + t + m, i)
},
T = function(e, i, o, n) {
var s = document.createElement("div");
return s.className = "mfp-" + e, o && (s.innerHTML = o), n ? i && i.appendChild(s) : (s = t(s), i && s.appendTo(i)), s
},
C = function(i, o) {
e.ev.triggerHandler(f + i, o), e.st.callbacks && (i = i.charAt(0).toLowerCase() + i.slice(1), e.st.callbacks[i] && e.st.callbacks[i].apply(e, t.isArray(o) ? o : [o]))
},
k = function(i) {
return i === r && e.currTemplate.closeBtn || (e.currTemplate.closeBtn = t(e.st.closeMarkup.replace("%title%", e.st.tClose)), r = i), e.currTemplate.closeBtn
},
E = function() {
t.magnificPopup.instance || (e = new y, e.init(), t.magnificPopup.instance = e)
},
z = function() {
var t = document.createElement("p").style,
e = ["ms", "O", "Moz", "Webkit"];
if (void 0 !== t.transition) return !0;
for (; e.length;)
if (e.pop() + "Transition" in t) return !0;
return !1
};
y.prototype = {
constructor: y,
init: function() {
var i = navigator.appVersion;
e.isIE7 = -1 !== i.indexOf("MSIE 7."), e.isIE8 = -1 !== i.indexOf("MSIE 8."), e.isLowIE = e.isIE7 || e.isIE8, e.isAndroid = /android/gi.test(i), e.isIOS = /iphone|ipad|ipod/gi.test(i), e.supportsTransition = z(), e.probablyMobile = e.isAndroid || e.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), o = t(document), e.popupsCache = {}
},
open: function(i) {
var n;
if (i.isObj === !1) {
e.items = i.items.toArray(), e.index = 0;
var r, a = i.items;
for (n = 0; n < a.length; n++)
if (r = a[n], r.parsed && (r = r.el[0]), r === i.el[0]) {
e.index = n;
break
}
} else e.items = t.isArray(i.items) ? i.items : [i.items], e.index = i.index || 0;
if (e.isOpen) return void e.updateItemHTML();
e.types = [], s = "", e.ev = i.mainEl && i.mainEl.length ? i.mainEl.eq(0) : o, i.key ? (e.popupsCache[i.key] || (e.popupsCache[i.key] = {}), e.currTemplate = e.popupsCache[i.key]) : e.currTemplate = {}, e.st = t.extend(!0, {}, t.magnificPopup.defaults, i), e.fixedContentPos = "auto" === e.st.fixedContentPos ? !e.probablyMobile : e.st.fixedContentPos, e.st.modal && (e.st.closeOnContentClick = !1, e.st.closeOnBgClick = !1, e.st.showCloseBtn = !1, e.st.enableEscapeKey = !1), e.bgOverlay || (e.bgOverlay = T("bg").on("click" + m, function() {
e.close()
}), e.wrap = T("wrap").attr("tabindex", -1).on("click" + m, function(t) {
e._checkIfClose(t.target) && e.close()
}), e.container = T("container", e.wrap)), e.contentContainer = T("content"), e.st.preloader && (e.preloader = T("preloader", e.container, e.st.tLoading));
var l = t.magnificPopup.modules;
for (n = 0; n < l.length; n++) {
var c = l[n];
c = c.charAt(0).toUpperCase() + c.slice(1), e["init" + c].call(e)
}
C("BeforeOpen"), e.st.showCloseBtn && (e.st.closeBtnInside ? (S(h, function(t, e, i, o) {
i.close_replaceWith = k(o.type)
}), s += " mfp-close-btn-in") : e.wrap.append(k())), e.st.alignTop && (s += " mfp-align-top"), e.wrap.css(e.fixedContentPos ? {
overflow: e.st.overflowY,
overflowX: "hidden",
overflowY: e.st.overflowY
} : {
top: x.scrollTop(),
position: "absolute"
}), (e.st.fixedBgPos === !1 || "auto" === e.st.fixedBgPos && !e.fixedContentPos) && e.bgOverlay.css({
height: o.height(),
position: "absolute"
}), e.st.enableEscapeKey && o.on("keyup" + m, function(t) {
27 === t.keyCode && e.close()
}), x.on("resize" + m, function() {
e.updateSize()
}), e.st.closeOnContentClick || (s += " mfp-auto-cursor"), s && e.wrap.addClass(s);
var d = e.wH = x.height(),
p = {};
if (e.fixedContentPos && e._hasScrollBar(d)) {
var f = e._getScrollbarSize();
f && (p.marginRight = f)
}
e.fixedContentPos && (e.isIE7 ? t("body, html").css("overflow", "hidden") : p.overflow = "hidden");
var v = e.st.mainClass;
return e.isIE7 && (v += " mfp-ie7"), v && e._addClassToMFP(v), e.updateItemHTML(), C("BuildControls"), t("html").css(p), e.bgOverlay.add(e.wrap).prependTo(e.st.prependTo || t(document.body)), e._lastFocusedEl = document.activeElement, setTimeout(function() {
e.content ? (e._addClassToMFP(g), e._setFocus()) : e.bgOverlay.addClass(g), o.on("focusin" + m, e._onFocusIn)
}, 16), e.isOpen = !0, e.updateSize(d), C(u), i
},
close: function() {
e.isOpen && (C(l), e.isOpen = !1, e.st.removalDelay && !e.isLowIE && e.supportsTransition ? (e._addClassToMFP(v), setTimeout(function() {
e._close()
}, e.st.removalDelay)) : e._close())
},
_close: function() {
C(a);
var i = v + " " + g + " ";
if (e.bgOverlay.detach(), e.wrap.detach(), e.container.empty(), e.st.mainClass && (i += e.st.mainClass + " "), e._removeClassFromMFP(i), e.fixedContentPos) {
var n = {
marginRight: ""
};
e.isIE7 ? t("body, html").css("overflow", "") : n.overflow = "", t("html").css(n)
}
o.off("keyup" + m + " focusin" + m), e.ev.off(m), e.wrap.attr("class", "mfp-wrap").removeAttr("style"), e.bgOverlay.attr("class", "mfp-bg"), e.container.attr("class", "mfp-container"), !e.st.showCloseBtn || e.st.closeBtnInside && e.currTemplate[e.currItem.type] !== !0 || e.currTemplate.closeBtn && e.currTemplate.closeBtn.detach(), e._lastFocusedEl && t(e._lastFocusedEl).focus(), e.currItem = null, e.content = null, e.currTemplate = null, e.prevHeight = 0, C(c)
},
updateSize: function(t) {
if (e.isIOS) {
var i = document.documentElement.clientWidth / window.innerWidth,
o = window.innerHeight * i;
e.wrap.css("height", o), e.wH = o
} else e.wH = t || x.height();
e.fixedContentPos || e.wrap.css("height", e.wH), C("Resize")
},
updateItemHTML: function() {
var i = e.items[e.index];
e.contentContainer.detach(), e.content && e.content.detach(), i.parsed || (i = e.parseEl(e.index));
var o = i.type;
if (C("BeforeChange", [e.currItem ? e.currItem.type : "", o]), e.currItem = i, !e.currTemplate[o]) {
var s = e.st[o] ? e.st[o].markup : !1;
C("FirstMarkupParse", s), e.currTemplate[o] = s ? t(s) : !0
}
n && n !== i.type && e.container.removeClass("mfp-" + n + "-holder");
var r = e["get" + o.charAt(0).toUpperCase() + o.slice(1)](i, e.currTemplate[o]);
e.appendContent(r, o), i.preloaded = !0, C(p, i), n = i.type, e.container.prepend(e.contentContainer), C("AfterChange")
},
appendContent: function(t, i) {
e.content = t, t ? e.st.showCloseBtn && e.st.closeBtnInside && e.currTemplate[i] === !0 ? e.content.find(".mfp-close").length || e.content.append(k()) : e.content = t : e.content = "", C(d), e.container.addClass("mfp-" + i + "-holder"), e.contentContainer.append(e.content)
},
parseEl: function(i) {
var o, n = e.items[i];
if (n.tagName ? n = {
el: t(n)
} : (o = n.type, n = {
data: n,
src: n.src
}), n.el) {
for (var s = e.types, r = 0; r < s.length; r++)
if (n.el.hasClass("mfp-" + s[r])) {
o = s[r];
break
}
n.src = n.el.attr("data-mfp-src"), n.src || (n.src = n.el.attr("href"))
}
return n.type = o || e.st.type || "inline", n.index = i, n.parsed = !0, e.items[i] = n, C("ElementParse", n), e.items[i]
},
addGroup: function(t, i) {
var o = function(o) {
o.mfpEl = this, e._openClick(o, t, i)
};
i || (i = {});
var n = "click.magnificPopup";
i.mainEl = t, i.items ? (i.isObj = !0, t.off(n).on(n, o)) : (i.isObj = !1, i.delegate ? t.off(n).on(n, i.delegate, o) : (i.items = t, t.off(n).on(n, o)))
},
_openClick: function(i, o, n) {
var s = void 0 !== n.midClick ? n.midClick : t.magnificPopup.defaults.midClick;
if (s || 2 !== i.which && !i.ctrlKey && !i.metaKey) {
var r = void 0 !== n.disableOn ? n.disableOn : t.magnificPopup.defaults.disableOn;
if (r)
if (t.isFunction(r)) {
if (!r.call(e)) return !0
} else if (x.width() < r) return !0;
i.type && (i.preventDefault(), e.isOpen && i.stopPropagation()), n.el = t(i.mfpEl), n.delegate && (n.items = o.find(n.delegate)), e.open(n)
}
},
updateStatus: function(t, o) {
if (e.preloader) {
i !== t && e.container.removeClass("mfp-s-" + i), o || "loading" !== t || (o = e.st.tLoading);
var n = {
status: t,
text: o
};
C("UpdateStatus", n), t = n.status, o = n.text, e.preloader.html(o), e.preloader.find("a").on("click", function(t) {
t.stopImmediatePropagation()
}), e.container.addClass("mfp-s-" + t), i = t
}
},
_checkIfClose: function(i) {
if (!t(i).hasClass(w)) {
var o = e.st.closeOnContentClick,
n = e.st.closeOnBgClick;
if (o && n) return !0;
if (!e.content || t(i).hasClass("mfp-close") || e.preloader && i === e.preloader[0]) return !0;
if (i === e.content[0] || t.contains(e.content[0], i)) {
if (o) return !0
} else if (n && t.contains(document, i)) return !0;
return !1
}
},
_addClassToMFP: function(t) {
e.bgOverlay.addClass(t), e.wrap.addClass(t)
},
_removeClassFromMFP: function(t) {
this.bgOverlay.removeClass(t), e.wrap.removeClass(t)
},
_hasScrollBar: function(t) {
return (e.isIE7 ? o.height() : document.body.scrollHeight) > (t || x.height())
},
_setFocus: function() {
(e.st.focus ? e.content.find(e.st.focus).eq(0) : e.wrap).focus()
},
_onFocusIn: function(i) {
return i.target === e.wrap[0] || t.contains(e.wrap[0], i.target) ? void 0 : (e._setFocus(), !1)
},
_parseMarkup: function(e, i, o) {
var n;
o.data && (i = t.extend(o.data, i)), C(h, [e, i, o]), t.each(i, function(t, i) {
if (void 0 === i || i === !1) return !0;
if (n = t.split("_"), n.length > 1) {
var o = e.find(m + "-" + n[0]);
if (o.length > 0) {
var s = n[1];
"replaceWith" === s ? o[0] !== i[0] && o.replaceWith(i) : "img" === s ? o.is("img") ? o.attr("src", i) : o.replaceWith('<img src="' + i + '" class="' + o.attr("class") + '" />') : o.attr(n[1], i)
}
} else e.find(m + "-" + t).html(i)
})
},
_getScrollbarSize: function() {
if (void 0 === e.scrollbarSize) {
var t = document.createElement("div");
t.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(t), e.scrollbarSize = t.offsetWidth - t.clientWidth, document.body.removeChild(t)
}
return e.scrollbarSize
}
}, t.magnificPopup = {
instance: null,
proto: y.prototype,
modules: [],
open: function(e, i) {
return E(), e = e ? t.extend(!0, {}, e) : {}, e.isObj = !0, e.index = i || 0, this.instance.open(e)
},
close: function() {
return t.magnificPopup.instance && t.magnificPopup.instance.close()
},
registerModule: function(e, i) {
i.options && (t.magnificPopup.defaults[e] = i.options), t.extend(this.proto, i.proto), this.modules.push(e)
},
defaults: {
disableOn: 0,
key: null,
midClick: !1,
mainClass: "",
preloader: !0,
focus: "",
closeOnContentClick: !1,
closeOnBgClick: !0,
closeBtnInside: !0,
showCloseBtn: !0,
enableEscapeKey: !0,
modal: !1,
alignTop: !1,
removalDelay: 0,
prependTo: null,
fixedContentPos: "auto",
fixedBgPos: "auto",
overflowY: "auto",
closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
tClose: "Close (Esc)",
tLoading: "Loading..."
}
}, t.fn.magnificPopup = function(i) {
E();
var o = t(this);
if ("string" == typeof i)
if ("open" === i) {
var n, s = b ? o.data("magnificPopup") : o[0].magnificPopup,
r = parseInt(arguments[1], 10) || 0;
s.items ? n = s.items[r] : (n = o, s.delegate && (n = n.find(s.delegate)), n = n.eq(r)), e._openClick({
mfpEl: n
}, o, s)
} else e.isOpen && e[i].apply(e, Array.prototype.slice.call(arguments, 1));
else i = t.extend(!0, {}, i), b ? o.data("magnificPopup", i) : o[0].magnificPopup = i, e.addGroup(o, i);
return o
};
var I, _, M, $ = "inline",
P = function() {
M && (_.after(M.addClass(I)).detach(), M = null)
};
t.magnificPopup.registerModule($, {
options: {
hiddenClass: "hide",
markup: "",
tNotFound: "Content not found"
},
proto: {
initInline: function() {
e.types.push($), S(a + "." + $, function() {
P()
})
},
getInline: function(i, o) {
if (P(), i.src) {
var n = e.st.inline,
s = t(i.src);
if (s.length) {
var r = s[0].parentNode;
r && r.tagName && (_ || (I = n.hiddenClass, _ = T(I), I = "mfp-" + I), M = s.after(_).detach().removeClass(I)), e.updateStatus("ready")
} else e.updateStatus("error", n.tNotFound), s = t("<div>");
return i.inlineElement = s, s
}
return e.updateStatus("ready"), e._parseMarkup(o, {}, i), o
}
}
});
var A, O = "ajax",
L = function() {
A && t(document.body).removeClass(A)
},
N = function() {
L(), e.req && e.req.abort()
};
t.magnificPopup.registerModule(O, {
options: {
settings: null,
cursor: "mfp-ajax-cur",
tError: '<a href="%url%">The content</a> could not be loaded.'
},
proto: {
initAjax: function() {
e.types.push(O), A = e.st.ajax.cursor, S(a + "." + O, N), S("BeforeChange." + O, N)
},
getAjax: function(i) {
A && t(document.body).addClass(A), e.updateStatus("loading");
var o = t.extend({
url: i.src,
success: function(o, n, s) {
var r = {
data: o,
xhr: s
};
C("ParseAjax", r), e.appendContent(t(r.data), O), i.finished = !0, L(), e._setFocus(), setTimeout(function() {
e.wrap.addClass(g)
}, 16), e.updateStatus("ready"), C("AjaxContentAdded")
},
error: function() {
L(), i.finished = i.loadError = !0, e.updateStatus("error", e.st.ajax.tError.replace("%url%", i.src))
}
}, e.st.ajax.settings);
return e.req = t.ajax(o), ""
}
}
});
var D, R = function(i) {
if (i.data && void 0 !== i.data.title) return i.data.title;
var o = e.st.image.titleSrc;
if (o) {
if (t.isFunction(o)) return o.call(e, i);
if (i.el) return i.el.attr(o) || ""
}
return ""
};
t.magnificPopup.registerModule("image", {
options: {
markup: '<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',
cursor: "mfp-zoom-out-cur",
titleSrc: "title",
verticalFit: !0,
tError: '<a href="%url%">The image</a> could not be loaded.'
},
proto: {
initImage: function() {
var i = e.st.image,
o = ".image";
e.types.push("image"), S(u + o, function() {
"image" === e.currItem.type && i.cursor && t(document.body).addClass(i.cursor)
}), S(a + o, function() {
i.cursor && t(document.body).removeClass(i.cursor), x.off("resize" + m)
}), S("Resize" + o, e.resizeImage), e.isLowIE && S("AfterChange", e.resizeImage)
},
resizeImage: function() {
var t = e.currItem;
if (t && t.img && e.st.image.verticalFit) {
var i = 0;
e.isLowIE && (i = parseInt(t.img.css("padding-top"), 10) + parseInt(t.img.css("padding-bottom"), 10)), t.img.css("max-height", e.wH - i)
}
},
_onImageHasSize: function(t) {
t.img && (t.hasSize = !0, D && clearInterval(D), t.isCheckingImgSize = !1, C("ImageHasSize", t), t.imgHidden && (e.content && e.content.removeClass("mfp-loading"), t.imgHidden = !1))
},
findImageSize: function(t) {
var i = 0,
o = t.img[0],
n = function(s) {
D && clearInterval(D), D = setInterval(function() {
return o.naturalWidth > 0 ? void e._onImageHasSize(t) : (i > 200 && clearInterval(D), i++, void(3 === i ? n(10) : 40 === i ? n(50) : 100 === i && n(500)))
}, s)
};
n(1)
},
getImage: function(i, o) {
var n = 0,
s = function() {
i && (i.img[0].complete ? (i.img.off(".mfploader"), i === e.currItem && (e._onImageHasSize(i), e.updateStatus("ready")), i.hasSize = !0, i.loaded = !0, C("ImageLoadComplete")) : (n++, 200 > n ? setTimeout(s, 100) : r()))
},
r = function() {
i && (i.img.off(".mfploader"), i === e.currItem && (e._onImageHasSize(i), e.updateStatus("error", a.tError.replace("%url%", i.src))), i.hasSize = !0, i.loaded = !0, i.loadError = !0)
},
a = e.st.image,
l = o.find(".mfp-img");
if (l.length) {
var c = document.createElement("img");
c.className = "mfp-img", i.el && i.el.find("img").length && (c.alt = i.el.find("img").attr("alt")), i.img = t(c).on("load.mfploader", s).on("error.mfploader", r), c.src = i.src, l.is("img") && (i.img = i.img.clone()), c = i.img[0], c.naturalWidth > 0 ? i.hasSize = !0 : c.width || (i.hasSize = !1)
}
return e._parseMarkup(o, {
title: R(i),
img_replaceWith: i.img
}, i), e.resizeImage(), i.hasSize ? (D && clearInterval(D), i.loadError ? (o.addClass("mfp-loading"), e.updateStatus("error", a.tError.replace("%url%", i.src))) : (o.removeClass("mfp-loading"), e.updateStatus("ready")), o) : (e.updateStatus("loading"), i.loading = !0, i.hasSize || (i.imgHidden = !0, o.addClass("mfp-loading"), e.findImageSize(i)), o)
}
}
});
var H, B = function() {
return void 0 === H && (H = void 0 !== document.createElement("p").style.MozTransform), H
};
t.magnificPopup.registerModule("zoom", {
options: {
enabled: !1,
easing: "ease-in-out",
duration: 300,
opener: function(t) {
return t.is("img") ? t : t.find("img")
}
},
proto: {
initZoom: function() {
var t, i = e.st.zoom,
o = ".zoom";
if (i.enabled && e.supportsTransition) {
var n, s, r = i.duration,
c = function(t) {
var e = t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
o = "all " + i.duration / 1e3 + "s " + i.easing,
n = {
position: "fixed",
zIndex: 9999,
left: 0,
top: 0,
"-webkit-backface-visibility": "hidden"
},
s = "transition";
return n["-webkit-" + s] = n["-moz-" + s] = n["-o-" + s] = n[s] = o, e.css(n), e
},
d = function() {
e.content.css("visibility", "visible")
};
S("BuildControls" + o, function() {
if (e._allowZoom()) {
if (clearTimeout(n), e.content.css("visibility", "hidden"), t = e._getItemToZoom(), !t) return void d();
s = c(t), s.css(e._getOffset()), e.wrap.append(s), n = setTimeout(function() {
s.css(e._getOffset(!0)), n = setTimeout(function() {
d(), setTimeout(function() {
s.remove(), t = s = null, C("ZoomAnimationEnded")
}, 16)
}, r)
}, 16)
}
}), S(l + o, function() {
if (e._allowZoom()) {
if (clearTimeout(n), e.st.removalDelay = r, !t) {
if (t = e._getItemToZoom(), !t) return;
s = c(t)
}
s.css(e._getOffset(!0)), e.wrap.append(s), e.content.css("visibility", "hidden"), setTimeout(function() {
s.css(e._getOffset())
}, 16)
}
}), S(a + o, function() {
e._allowZoom() && (d(), s && s.remove(), t = null)
})
}
},
_allowZoom: function() {
return "image" === e.currItem.type
},
_getItemToZoom: function() {
return e.currItem.hasSize ? e.currItem.img : !1
},
_getOffset: function(i) {
var o;
o = i ? e.currItem.img : e.st.zoom.opener(e.currItem.el || e.currItem);
var n = o.offset(),
s = parseInt(o.css("padding-top"), 10),
r = parseInt(o.css("padding-bottom"), 10);
n.top -= t(window).scrollTop() - s;
var a = {
width: o.width(),
height: (b ? o.innerHeight() : o[0].offsetHeight) - r - s
};
return B() ? a["-moz-transform"] = a.transform = "translate(" + n.left + "px," + n.top + "px)" : (a.left = n.left, a.top = n.top), a
}
}
});
var j = "iframe",
W = "//about:blank",
F = function(t) {
if (e.currTemplate[j]) {
var i = e.currTemplate[j].find("iframe");
i.length && (t || (i[0].src = W), e.isIE8 && i.css("display", t ? "block" : "none"))
}
};
t.magnificPopup.registerModule(j, {
options: {
markup: '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',
srcAction: "iframe_src",
patterns: {
youtube: {
index: "youtube.com",
id: "v=",
src: "//www.youtube.com/embed/%id%?autoplay=1"
},
vimeo: {
index: "vimeo.com/",
id: "/",
src: "//player.vimeo.com/video/%id%?autoplay=1"
},
gmaps: {
index: "//maps.google.",
src: "%id%&output=embed"
}
}
},
proto: {
initIframe: function() {
e.types.push(j), S("BeforeChange", function(t, e, i) {
e !== i && (e === j ? F() : i === j && F(!0))
}), S(a + "." + j, function() {
F()
})
},
getIframe: function(i, o) {
var n = i.src,
s = e.st.iframe;
t.each(s.patterns, function() {
return n.indexOf(this.index) > -1 ? (this.id && (n = "string" == typeof this.id ? n.substr(n.lastIndexOf(this.id) + this.id.length, n.length) : this.id.call(this, n)), n = this.src.replace("%id%", n), !1) : void 0
});
var r = {};
return s.srcAction && (r[s.srcAction] = n), e._parseMarkup(o, r, i), e.updateStatus("ready"), o
}
}
});
var q = function(t) {
var i = e.items.length;
return t > i - 1 ? t - i : 0 > t ? i + t : t
},
Q = function(t, e, i) {
return t.replace(/%curr%/gi, e + 1).replace(/%total%/gi, i)
};
t.magnificPopup.registerModule("gallery", {
options: {
enabled: !1,
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
preload: [0, 2],
navigateByImgClick: !0,
arrows: !0,
tPrev: "Previous (Left arrow key)",
tNext: "Next (Right arrow key)",
tCounter: "%curr% of %total%"
},
proto: {
initGallery: function() {
var i = e.st.gallery,
n = ".mfp-gallery",
r = Boolean(t.fn.mfpFastClick);
return e.direction = !0, i && i.enabled ? (s += " mfp-gallery", S(u + n, function() {
i.navigateByImgClick && e.wrap.on("click" + n, ".mfp-img", function() {
return e.items.length > 1 ? (e.next(), !1) : void 0
}), o.on("keydown" + n, function(t) {
37 === t.keyCode ? e.prev() : 39 === t.keyCode && e.next()
})
}), S("UpdateStatus" + n, function(t, i) {
i.text && (i.text = Q(i.text, e.currItem.index, e.items.length))
}), S(h + n, function(t, o, n, s) {
var r = e.items.length;
n.counter = r > 1 ? Q(i.tCounter, s.index, r) : ""
}), S("BuildControls" + n, function() {
if (e.items.length > 1 && i.arrows && !e.arrowLeft) {
var o = i.arrowMarkup,
n = e.arrowLeft = t(o.replace(/%title%/gi, i.tPrev).replace(/%dir%/gi, "left")).addClass(w),
s = e.arrowRight = t(o.replace(/%title%/gi, i.tNext).replace(/%dir%/gi, "right")).addClass(w),
a = r ? "mfpFastClick" : "click";
n[a](function() {
e.prev()
}), s[a](function() {
e.next()
}), e.isIE7 && (T("b", n[0], !1, !0), T("a", n[0], !1, !0), T("b", s[0], !1, !0), T("a", s[0], !1, !0)), e.container.append(n.add(s))
}
}), S(p + n, function() {
e._preloadTimeout && clearTimeout(e._preloadTimeout), e._preloadTimeout = setTimeout(function() {
e.preloadNearbyImages(), e._preloadTimeout = null
}, 16)
}), void S(a + n, function() {
o.off(n), e.wrap.off("click" + n), e.arrowLeft && r && e.arrowLeft.add(e.arrowRight).destroyMfpFastClick(), e.arrowRight = e.arrowLeft = null
})) : !1
},
next: function() {
e.direction = !0, e.index = q(e.index + 1), e.updateItemHTML()
},
prev: function() {
e.direction = !1, e.index = q(e.index - 1), e.updateItemHTML()
},
goTo: function(t) {
e.direction = t >= e.index, e.index = t, e.updateItemHTML()
},
preloadNearbyImages: function() {
var t, i = e.st.gallery.preload,
o = Math.min(i[0], e.items.length),
n = Math.min(i[1], e.items.length);
for (t = 1; t <= (e.direction ? n : o); t++) e._preloadItem(e.index + t);
for (t = 1; t <= (e.direction ? o : n); t++) e._preloadItem(e.index - t)
},
_preloadItem: function(i) {
if (i = q(i), !e.items[i].preloaded) {
var o = e.items[i];
o.parsed || (o = e.parseEl(i)), C("LazyLoad", o), "image" === o.type && (o.img = t('<img class="mfp-img" />').on("load.mfploader", function() {
o.hasSize = !0
}).on("error.mfploader", function() {
o.hasSize = !0, o.loadError = !0, C("LazyLoadError", o)
}).attr("src", o.src)), o.preloaded = !0
}
}
}
});
var U = "retina";
t.magnificPopup.registerModule(U, {
options: {
replaceSrc: function(t) {
return t.src.replace(/\.\w+$/, function(t) {
return "@2x" + t
})
},
ratio: 1
},
proto: {
initRetina: function() {
if (window.devicePixelRatio > 1) {
var t = e.st.retina,
i = t.ratio;
i = isNaN(i) ? i() : i, i > 1 && (S("ImageHasSize." + U, function(t, e) {
e.img.css({
"max-width": e.img[0].naturalWidth / i,
width: "100%"
})
}), S("ElementParse." + U, function(e, o) {
o.src = t.replaceSrc(o, i)
}))
}
}
}
}),
function() {
var e = 1e3,
i = "ontouchstart" in window,
o = function() {
x.off("touchmove" + s + " touchend" + s)
},
n = "mfpFastClick",
s = "." + n;
t.fn.mfpFastClick = function(n) {
return t(this).each(function() {
var r, a = t(this);
if (i) {
var l, c, d, h, u, p;
a.on("touchstart" + s, function(t) {
h = !1, p = 1, u = t.originalEvent ? t.originalEvent.touches[0] : t.touches[0], c = u.clientX, d = u.clientY, x.on("touchmove" + s, function(t) {
u = t.originalEvent ? t.originalEvent.touches : t.touches, p = u.length, u = u[0], (Math.abs(u.clientX - c) > 10 || Math.abs(u.clientY - d) > 10) && (h = !0, o())
}).on("touchend" + s, function(t) {
o(), h || p > 1 || (r = !0, t.preventDefault(), clearTimeout(l), l = setTimeout(function() {
r = !1
}, e), n())
})
})
}
a.on("click" + s, function() {
r || n()
})
})
}, t.fn.destroyMfpFastClick = function() {
t(this).off("touchstart" + s + " click" + s), i && x.off("touchmove" + s + " touchend" + s)
}
}(), E()
}), ! function() {
function t() {}
function e(t) {
return s.retinaImageSuffix + t
}
function i(t, i) {
if (this.path = t || "", "undefined" != typeof i && null !== i) this.at_2x_path = i, this.perform_check = !1;
else {
if (void 0 !== document.createElement) {
var o = document.createElement("a");
o.href = this.path, o.pathname = o.pathname.replace(r, e), this.at_2x_path = o.href
} else {
var n = this.path.split("?");
n[0] = n[0].replace(r, e), this.at_2x_path = n.join("?")
}
this.perform_check = !0
}
}
function o(t) {
this.el = t, this.path = new i(this.el.getAttribute("src"), this.el.getAttribute("data-at2x"));
var e = this;
this.path.check_2x_variant(function(t) {
t && e.swap()
})
}
var n = "undefined" == typeof exports ? window : exports,
s = {
retinaImageSuffix: "@2x",
check_mime_type: !0,
force_original_dimensions: !0
};
n.Retina = t, t.configure = function(t) {
null === t && (t = {});
for (var e in t) t.hasOwnProperty(e) && (s[e] = t[e])
}, t.init = function(t) {
null === t && (t = n);
var e = t.onload || function() {};
t.onload = function() {
var t, i, n = document.getElementsByTagName("img"),
s = [];
for (t = 0; t < n.length; t += 1) i = n[t], i.getAttributeNode("data-no-retina") || s.push(new o(i));
e()
}
}, t.isRetina = function() {
var t = "(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
return n.devicePixelRatio > 1 ? !0 : n.matchMedia && n.matchMedia(t).matches ? !0 : !1
};
var r = /\.\w+$/;
n.RetinaImagePath = i, i.confirmed_paths = [], i.prototype.is_external = function() {
return !(!this.path.match(/^https?\:/i) || this.path.match("//" + document.domain))
}, i.prototype.check_2x_variant = function(t) {
var e, o = this;
return this.is_external() ? t(!1) : this.perform_check || "undefined" == typeof this.at_2x_path || null === this.at_2x_path ? this.at_2x_path in i.confirmed_paths ? t(!0) : (e = new XMLHttpRequest, e.open("HEAD", this.at_2x_path), e.onreadystatechange = function() {
if (4 !== e.readyState) return t(!1);
if (e.status >= 200 && e.status <= 399) {
if (s.check_mime_type) {
var n = e.getResponseHeader("Content-Type");
if (null === n || !n.match(/^image/i)) return t(!1)
}
return i.confirmed_paths.push(o.at_2x_path), t(!0)
}
return t(!1)
}, void e.send()) : t(!0)
}, n.RetinaImage = o, o.prototype.swap = function(t) {
function e() {
i.el.complete ? (s.force_original_dimensions && (i.el.setAttribute("width", i.el.offsetWidth), i.el.setAttribute("height", i.el.offsetHeight)), i.el.setAttribute("src", t)) : setTimeout(e, 5)
}
"undefined" == typeof t && (t = this.path.at_2x_path);
var i = this;
e()
}, t.isRetina() && t.init(n)
}(), eval(function(t, e) {
"use strict";
var i, o = t.document,
n = t.Modernizr,
s = function(t) {
return t.charAt(0).toUpperCase() + t.slice(1)
},
r = "Moz Webkit O Ms".split(" "),
a = function(t) {
var e, i = o.documentElement.style;
if ("string" == typeof i[t]) return t;
t = s(t);
for (var n = 0, a = r.length; a > n; n++)
if (e = r[n] + t, "string" == typeof i[e]) return e
},
l = a("transform"),
c = a("transitionProperty"),
d = {
csstransforms: function() {
return !!l
},
csstransforms3d: function() {
var t = !!a("perspective");
if (t) {
var i = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
o = "@media (" + i.join("transform-3d),(") + "modernizr)",
n = e("<style>" + o + "{#modernizr{height:3px}}</style>").appendTo("head"),
s = e('<div id="modernizr" />').appendTo("html");
t = 3 === s.height(), s.remove(), n.remove()
}
return t
},
csstransitions: function() {
return !!c
}
};
if (n)
for (i in d) n.hasOwnProperty(i) || n.addTest(i, d[i]);
else {
n = t.Modernizr = {
_version: "1.6ish: miniModernizr for Isotope"
};
var h, u = " ";
for (i in d) h = d[i](), n[i] = h, u += " " + (h ? "" : "no-") + i;
e("html").addClass(u)
}
if (n.csstransforms) {
var p = n.csstransforms3d ? {
translate: function(t) {
return "translate3d(" + t[0] + "px, " + t[1] + "px, 0) "
},
scale: function(t) {
return "scale3d(" + t + ", " + t + ", 1) "
}
} : {
translate: function(t) {
return "translate(" + t[0] + "px, " + t[1] + "px) "
},
scale: function(t) {
return "scale(" + t + ") "
}
},
f = function(t, i, o) {
var n, s, r = e.data(t, "isoTransform") || {},
a = {},
c = {};
a[i] = o, e.extend(r, a);
for (n in r) s = r[n], c[n] = p[n](s);
var d = c.translate || "",
h = c.scale || "",
u = d + h;
e.data(t, "isoTransform", r), t.style[l] = u
};
e.cssNumber.scale = !0, e.cssHooks.scale = {
set: function(t, e) {
f(t, "scale", e)
},
get: function(t) {
var i = e.data(t, "isoTransform");
return i && i.scale ? i.scale : 1
}
}, e.fx.step.scale = function(t) {
e.cssHooks.scale.set(t.elem, t.now + t.unit)
}, e.cssNumber.translate = !0, e.cssHooks.translate = {
set: function(t, e) {
f(t, "translate", e)
},
get: function(t) {
var i = e.data(t, "isoTransform");
return i && i.translate ? i.translate : [0, 0]
}
}
}
var m, g;
n.csstransitions && (m = {
WebkitTransitionProperty: "webkitTransitionEnd",
MozTransitionProperty: "transitionend",
OTransitionProperty: "oTransitionEnd otransitionend",
transitionProperty: "transitionend"
}[c], g = a("transitionDuration"));
var v, w = e.event,
y = e.event.handle ? "handle" : "dispatch";
w.special.smartresize = {
setup: function() {
e(this).bind("resize", w.special.smartresize.handler)
},
teardown: function() {
e(this).unbind("resize", w.special.smartresize.handler)
},
handler: function(t, e) {
var i = this,
o = arguments;
t.type = "smartresize", v && clearTimeout(v), v = setTimeout(function() {
w[y].apply(i, o)
}, "execAsap" === e ? 0 : 100)
}
}, e.fn.smartresize = function(t) {
return t ? this.bind("smartresize", t) : this.trigger("smartresize", ["execAsap"])
}, e.Isotope = function(t, i, o) {
this.element = e(i), this._create(t), this._init(o)
};
var b = ["width", "height"],
x = e(t);
e.Isotope.settings = {
resizable: !0,
layoutMode: "masonry",
containerClass: "isotope",
itemClass: "isotope-item",
hiddenClass: "isotope-hidden",
hiddenStyle: {
opacity: 0,
scale: .001
},
visibleStyle: {
opacity: 1,
scale: 1
},
containerStyle: {
position: "relative",
overflow: "hidden"
},
animationEngine: "best-available",
animationOptions: {
queue: !1,
duration: 800
},
sortBy: "original-order",
sortAscending: !0,
resizesContainer: !0,
transformsEnabled: !0,
itemPositionDataEnabled: !1
}, e.Isotope.prototype = {
_create: function(t) {
this.options = e.extend({}, e.Isotope.settings, t), this.styleQueue = [], this.elemCount = 0;
var i = this.element[0].style;
this.originalStyle = {};
var o = b.slice(0);
for (var n in this.options.containerStyle) o.push(n);
for (var s = 0, r = o.length; r > s; s++) n = o[s], this.originalStyle[n] = i[n] || "";
this.element.css(this.options.containerStyle), this._updateAnimationEngine(), this._updateUsingTransforms();
var a = {
"original-order": function(t, e) {
return e.elemCount++, e.elemCount
},
random: function() {
return Math.random()
}
};
this.options.getSortData = e.extend(this.options.getSortData, a), this.reloadItems(), this.offset = {
left: parseInt(this.element.css("padding-left") || 0, 10),
top: parseInt(this.element.css("padding-top") || 0, 10)
};
var l = this;
setTimeout(function() {
l.element.addClass(l.options.containerClass)
}, 0), this.options.resizable && x.bind("smartresize.isotope", function() {
l.resize()
}), this.element.delegate("." + this.options.hiddenClass, "click", function() {
return !1
})
},
_getAtoms: function(t) {
var e = this.options.itemSelector,
i = e ? t.filter(e).add(t.find(e)) : t,
o = {
position: "absolute"
};
return i = i.filter(function(t, e) {
return 1 === e.nodeType
}), this.usingTransforms && (o.left = 0, o.top = 0), i.css(o).addClass(this.options.itemClass), this.updateSortData(i, !0), i
},
_init: function(t) {
this.$filteredAtoms = this._filter(this.$allAtoms), this._sort(), this.reLayout(t)
},
option: function(t) {
if (e.isPlainObject(t)) {
this.options = e.extend(!0, this.options, t);
var i;
for (var o in t) i = "_update" + s(o), this[i] && this[i]()
}
},
_updateAnimationEngine: function() {
var t, e = this.options.animationEngine.toLowerCase().replace(/[ _\-]/g, "");
switch (e) {
case "css":
case "none":
t = !1;
break;
case "jquery":
t = !0;
break;
default:
t = !n.csstransitions
}
this.isUsingJQueryAnimation = t, this._updateUsingTransforms()
},
_updateTransformsEnabled: function() {
this._updateUsingTransforms()
},
_updateUsingTransforms: function() {
var t = this.usingTransforms = this.options.transformsEnabled && n.csstransforms && n.csstransitions && !this.isUsingJQueryAnimation;
t || (delete this.options.hiddenStyle.scale, delete this.options.visibleStyle.scale), this.getPositionStyles = t ? this._translate : this._positionAbs
},
_filter: function(t) {
var e = "" === this.options.filter ? "*" : this.options.filter;
if (!e) return t;
var i = this.options.hiddenClass,
o = "." + i,
n = t.filter(o),
s = n;
if ("*" !== e) {
s = n.filter(e);
var r = t.not(o).not(e).addClass(i);
this.styleQueue.push({
$el: r,
style: this.options.hiddenStyle
})
}
return this.styleQueue.push({
$el: s,
style: this.options.visibleStyle
}), s.removeClass(i), t.filter(e)
},
updateSortData: function(t, i) {
var o, n, s = this,
r = this.options.getSortData;
t.each(function() {
o = e(this), n = {};
for (var t in r) n[t] = i || "original-order" !== t ? r[t](o, s) : e.data(this, "isotope-sort-data")[t];
e.data(this, "isotope-sort-data", n)
})
},
_sort: function() {
var t = this.options.sortBy,
e = this._getSorter,
i = this.options.sortAscending ? 1 : -1,
o = function(o, n) {
var s = e(o, t),
r = e(n, t);
return s === r && "original-order" !== t && (s = e(o, "original-order"), r = e(n, "original-order")), (s > r ? 1 : r > s ? -1 : 0) * i
};
this.$filteredAtoms.sort(o)
},
_getSorter: function(t, i) {
return e.data(t, "isotope-sort-data")[i]
},
_translate: function(t, e) {
return {
translate: [t, e]
}
},
_positionAbs: function(t, e) {
return {
left: t,
top: e
}
},
_pushPosition: function(t, e, i) {
e = Math.round(e + this.offset.left), i = Math.round(i + this.offset.top);
var o = this.getPositionStyles(e, i);
this.styleQueue.push({
$el: t,
style: o
}), this.options.itemPositionDataEnabled && t.data("isotope-item-position", {
x: e,
y: i
})
},
layout: function(t, e) {
var i = this.options.layoutMode;
if (this["_" + i + "Layout"](t), this.options.resizesContainer) {
var o = this["_" + i + "GetContainerSize"]();
this.styleQueue.push({
$el: this.element,
style: o
})
}
this._processStyleQueue(t, e), this.isLaidOut = !0
},
_processStyleQueue: function(t, i) {
var o, s, r, a, l = this.isLaidOut && this.isUsingJQueryAnimation ? "animate" : "css",
c = this.options.animationOptions,
d = this.options.onLayout;
if (s = function(t, e) {
e.$el[l](e.style, c)
}, this._isInserting && this.isUsingJQueryAnimation) s = function(t, e) {
o = e.$el.hasClass("no-transition") ? "css" : l, e.$el[o](e.style, c)
};
else if (i || d || c.complete) {
var h = !1,
u = [i, d, c.complete],
p = this;
if (r = !0, a = function() {
if (!h) {
for (var e, i = 0, o = u.length; o > i; i++) e = u[i], "function" == typeof e && e.call(p.element, t, p);
h = !0
}
}, this.isUsingJQueryAnimation && "animate" === l) c.complete = a, r = !1;
else if (n.csstransitions) {
for (var f, v = 0, w = this.styleQueue[0], y = w && w.$el; !y || !y.length;) {
if (f = this.styleQueue[v++], !f) return;
y = f.$el
}
var b = parseFloat(getComputedStyle(y[0])[g]);
b > 0 && (s = function(t, e) {
e.$el[l](e.style, c).one(m, a)
}, r = !1)
}
}
e.each(this.styleQueue, s), r && a(), this.styleQueue = []
},
resize: function() {
this["_" + this.options.layoutMode + "ResizeChanged"]() && this.reLayout()
},
reLayout: function(t) {
this["_" + this.options.layoutMode + "Reset"](), this.layout(this.$filteredAtoms, t)
},
addItems: function(t, e) {
var i = this._getAtoms(t);
this.$allAtoms = this.$allAtoms.add(i), e && e(i)
},
insert: function(t, e) {
this.element.append(t);
var i = this;
this.addItems(t, function(t) {
var o = i._filter(t);
i._addHideAppended(o), i._sort(), i.reLayout(), i._revealAppended(o, e)
})
},
appended: function(t, e) {
var i = this;
this.addItems(t, function(t) {
i._addHideAppended(t), i.layout(t), i._revealAppended(t, e)
})
},
_addHideAppended: function(t) {
this.$filteredAtoms = this.$filteredAtoms.add(t), t.addClass("no-transition"), this._isInserting = !0, this.styleQueue.push({
$el: t,
style: this.options.hiddenStyle
})
},
_revealAppended: function(t, e) {
var i = this;
setTimeout(function() {
t.removeClass("no-transition"), i.styleQueue.push({
$el: t,
style: i.options.visibleStyle
}), i._isInserting = !1, i._processStyleQueue(t, e)
}, 10)
},
reloadItems: function() {
this.$allAtoms = this._getAtoms(this.element.children())
},
remove: function(t, e) {
this.$allAtoms = this.$allAtoms.not(t), this.$filteredAtoms = this.$filteredAtoms.not(t);
var i = this,
o = function() {
t.remove(), e && e.call(i.element)
};
t.filter(":not(." + this.options.hiddenClass + ")").length ? (this.styleQueue.push({
$el: t,
style: this.options.hiddenStyle
}), this._sort(), this.reLayout(o)) : o()
},
shuffle: function(t) {
this.updateSortData(this.$allAtoms), this.options.sortBy = "random", this._sort(), this.reLayout(t)
},
destroy: function() {
var t = this.usingTransforms,
e = this.options;
this.$allAtoms.removeClass(e.hiddenClass + " " + e.itemClass).each(function() {
var e = this.style;
e.position = "", e.top = "", e.left = "", e.opacity = "", t && (e[l] = "")
});
var i = this.element[0].style;
for (var o in this.originalStyle) i[o] = this.originalStyle[o];
this.element.unbind(".isotope").undelegate("." + e.hiddenClass, "click").removeClass(e.containerClass).removeData("isotope"), x.unbind(".isotope")
},
_getSegments: function(t) {
var e, i = this.options.layoutMode,
o = t ? "rowHeight" : "columnWidth",
n = t ? "height" : "width",
r = t ? "rows" : "cols",
a = this.element[n](),
l = this.options[i] && this.options[i][o] || this.$filteredAtoms["outer" + s(n)](!0) || a;
e = Math.floor(a / l), e = Math.max(e, 1), this[i][r] = e, this[i][o] = l
},
_checkIfSegmentsChanged: function(t) {
var e = this.options.layoutMode,
i = t ? "rows" : "cols",
o = this[e][i];
return this._getSegments(t), this[e][i] !== o
},
_masonryReset: function() {
this.masonry = {}, this._getSegments();
var t = this.masonry.cols;
for (this.masonry.colYs = []; t--;) this.masonry.colYs.push(0)
},
_masonryLayout: function(t) {
var i = this,
o = i.masonry;
t.each(function() {
var t = e(this),
n = Math.ceil(t.outerWidth(!0) / o.columnWidth);
if (n = Math.min(n, o.cols), 1 === n) i._masonryPlaceBrick(t, o.colYs);
else {
var s, r, a = o.cols + 1 - n,
l = [];
for (r = 0; a > r; r++) s = o.colYs.slice(r, r + n), l[r] = Math.max.apply(Math, s);
i._masonryPlaceBrick(t, l)
}
})
},
_masonryPlaceBrick: function(t, e) {
for (var i = Math.min.apply(Math, e), o = 0, n = 0, s = e.length; s > n; n++)
if (e[n] === i) {
o = n;
break
}
var r = this.masonry.columnWidth * o,
a = i;
this._pushPosition(t, r, a);
var l = i + t.outerHeight(!0),
c = this.masonry.cols + 1 - s;
for (n = 0; c > n; n++) this.masonry.colYs[o + n] = l
},
_masonryGetContainerSize: function() {
var t = Math.max.apply(Math, this.masonry.colYs);
return {
height: t
}
},
_masonryResizeChanged: function() {
return this._checkIfSegmentsChanged()
},
_fitRowsReset: function() {
this.fitRows = {
x: 0,
y: 0,
height: 0
}
},
_fitRowsLayout: function(t) {
var i = this,
o = this.element.width(),
n = this.fitRows;
t.each(function() {
var t = e(this),
s = t.outerWidth(!0),
r = t.outerHeight(!0);
0 !== n.x && s + n.x > o && (n.x = 0, n.y = n.height), i._pushPosition(t, n.x, n.y), n.height = Math.max(n.y + r, n.height), n.x += s
})
},
_fitRowsGetContainerSize: function() {
return {
height: this.fitRows.height
}
},
_fitRowsResizeChanged: function() {
return !0
},
_cellsByRowReset: function() {
this.cellsByRow = {
index: 0
}, this._getSegments(), this._getSegments(!0)
},
_cellsByRowLayout: function(t) {
var i = this,
o = this.cellsByRow;
t.each(function() {
var t = e(this),
n = o.index % o.cols,
s = Math.floor(o.index / o.cols),
r = (n + .5) * o.columnWidth - t.outerWidth(!0) / 2,
a = (s + .5) * o.rowHeight - t.outerHeight(!0) / 2;
i._pushPosition(t, r, a), o.index++
})
},
_cellsByRowGetContainerSize: function() {
return {
height: Math.ceil(this.$filteredAtoms.length / this.cellsByRow.cols) * this.cellsByRow.rowHeight + this.offset.top
}
},
_cellsByRowResizeChanged: function() {
return this._checkIfSegmentsChanged()
},
_straightDownReset: function() {
this.straightDown = {
y: 0
}
},
_straightDownLayout: function(t) {
var i = this;
t.each(function() {
var t = e(this);
i._pushPosition(t, 0, i.straightDown.y), i.straightDown.y += t.outerHeight(!0)
})
},
_straightDownGetContainerSize: function() {
return {
height: this.straightDown.y
}
},
_straightDownResizeChanged: function() {
return !0
},
_masonryHorizontalReset: function() {
this.masonryHorizontal = {}, this._getSegments(!0);
var t = this.masonryHorizontal.rows;
for (this.masonryHorizontal.rowXs = []; t--;) this.masonryHorizontal.rowXs.push(0)
},
_masonryHorizontalLayout: function(t) {
var i = this,
o = i.masonryHorizontal;
t.each(function() {
var t = e(this),
n = Math.ceil(t.outerHeight(!0) / o.rowHeight);
if (n = Math.min(n, o.rows), 1 === n) i._masonryHorizontalPlaceBrick(t, o.rowXs);
else {
var s, r, a = o.rows + 1 - n,
l = [];
for (r = 0; a > r; r++) s = o.rowXs.slice(r, r + n), l[r] = Math.max.apply(Math, s);
i._masonryHorizontalPlaceBrick(t, l)
}
})
},
_masonryHorizontalPlaceBrick: function(t, e) {
for (var i = Math.min.apply(Math, e), o = 0, n = 0, s = e.length; s > n; n++)
if (e[n] === i) {
o = n;
break
}
var r = i,
a = this.masonryHorizontal.rowHeight * o;
this._pushPosition(t, r, a);
var l = i + t.outerWidth(!0),
c = this.masonryHorizontal.rows + 1 - s;
for (n = 0; c > n; n++) this.masonryHorizontal.rowXs[o + n] = l
},
_masonryHorizontalGetContainerSize: function() {
var t = Math.max.apply(Math, this.masonryHorizontal.rowXs);
return {
width: t
}
},
_masonryHorizontalResizeChanged: function() {
return this._checkIfSegmentsChanged(!0)
},
_fitColumnsReset: function() {
this.fitColumns = {
x: 0,
y: 0,
width: 0
}
},
_fitColumnsLayout: function(t) {
var i = this,
o = this.element.height(),
n = this.fitColumns;
t.each(function() {
var t = e(this),
s = t.outerWidth(!0),
r = t.outerHeight(!0);
0 !== n.y && r + n.y > o && (n.x = n.width, n.y = 0), i._pushPosition(t, n.x, n.y), n.width = Math.max(n.x + s, n.width), n.y += r
})
},
_fitColumnsGetContainerSize: function() {
return {
width: this.fitColumns.width
}
},
_fitColumnsResizeChanged: function() {
return !0
},
_cellsByColumnReset: function() {
this.cellsByColumn = {
index: 0
}, this._getSegments(), this._getSegments(!0)
},
_cellsByColumnLayout: function(t) {
var i = this,
o = this.cellsByColumn;
t.each(function() {
var t = e(this),
n = Math.floor(o.index / o.rows),
s = o.index % o.rows,
r = (n + .5) * o.columnWidth - t.outerWidth(!0) / 2,
a = (s + .5) * o.rowHeight - t.outerHeight(!0) / 2;
i._pushPosition(t, r, a), o.index++
})
},
_cellsByColumnGetContainerSize: function() {
return {
width: Math.ceil(this.$filteredAtoms.length / this.cellsByColumn.rows) * this.cellsByColumn.columnWidth
}
},
_cellsByColumnResizeChanged: function() {
return this._checkIfSegmentsChanged(!0)
},
_straightAcrossReset: function() {
this.straightAcross = {
x: 0
}
},
_straightAcrossLayout: function(t) {
var i = this;
t.each(function() {
var t = e(this);
i._pushPosition(t, i.straightAcross.x, 0), i.straightAcross.x += t.outerWidth(!0)
})
},
_straightAcrossGetContainerSize: function() {
return {
width: this.straightAcross.x
}
},
_straightAcrossResizeChanged: function() {
return !0
}
}, e.fn.imagesLoaded = function(t) {
function i() {
t.call(n, s)
}
function o(t) {
var n = t.target;
n.src !== a && -1 === e.inArray(n, l) && (l.push(n), --r <= 0 && (setTimeout(i), s.unbind(".imagesLoaded", o)))
}
var n = this,
s = n.find("img").add(n.filter("img")),
r = s.length,
a = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",
l = [];
return r || i(), s.bind("load.imagesLoaded error.imagesLoaded", o).each(function() {
var t = this.src;
this.src = a, this.src = t
}), n
};
var S = function(e) {
t.console && t.console.error(e)
};
e.fn.isotope = function(t, i) {
if ("string" == typeof t) {
var o = Array.prototype.slice.call(arguments, 1);
this.each(function() {
var i = e.data(this, "isotope");
return i ? e.isFunction(i[t]) && "_" !== t.charAt(0) ? void i[t].apply(i, o) : void S("no such method '" + t + "' for isotope instance") : void S("cannot call methods on isotope prior to initialization; attempted to call method '" + t + "'")
})
} else this.each(function() {
var o = e.data(this, "isotope");
o ? (o.option(t), o._init(i)) : e.data(this, "isotope", new e.Isotope(t, this, i))
});
return this
}
})(window, jQuery), function(t) {
"use strict";
t.fn.counterUp = function(e) {
var i = t.extend({
time: 400,
delay: 10
}, e);
return this.each(function() {
var e = t(this),
o = i,
n = function() {
var t = [],
i = o.time / o.delay,
n = e.text(),
s = /[0-9]+,[0-9]+/.test(n);
n = n.replace(/,/g, "");
for (var r = (/^[0-9]+$/.test(n), /^[0-9]+\.[0-9]+$/.test(n)), a = r ? (n.split(".")[1] || []).length : 0, l = i; l >= 1; l--) {
var c = parseInt(n / i * l);
if (r && (c = parseFloat(n / i * l).toFixed(a)), s)
for (;
/(\d+)(\d{3})/.test(c.toString());) c = c.toString().replace(/(\d+)(\d{3})/, "$1,$2");
t.unshift(c)
}
e.data("counterup-nums", t), e.text("0");
var d = function() {
e.text(e.data("counterup-nums").shift()), e.data("counterup-nums").length ? setTimeout(e.data("counterup-func"), o.delay) : (delete e.data("counterup-nums"), e.data("counterup-nums", null), e.data("counterup-func", null))
};
e.data("counterup-func", d), setTimeout(e.data("counterup-func"), o.delay)
};
e.waypoint(n, {
offset: "100%",
triggerOnce: !0
})
})
}
}(jQuery), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
def: "easeOutQuad",
swing: function(t, e, i, o, n) {
return jQuery.easing[jQuery.easing.def](t, e, i, o, n)
},
easeInQuad: function(t, e, i, o, n) {
return o * (e /= n) * e + i
},
easeOutQuad: function(t, e, i, o, n) {
return -o * (e /= n) * (e - 2) + i
},
easeInOutQuad: function(t, e, i, o, n) {
return (e /= n / 2) < 1 ? o / 2 * e * e + i : -o / 2 * (--e * (e - 2) - 1) + i
},
easeInCubic: function(t, e, i, o, n) {
return o * (e /= n) * e * e + i
},
easeOutCubic: function(t, e, i, o, n) {
return o * ((e = e / n - 1) * e * e + 1) + i
},
easeInOutCubic: function(t, e, i, o, n) {
return (e /= n / 2) < 1 ? o / 2 * e * e * e + i : o / 2 * ((e -= 2) * e * e + 2) + i
},
easeInQuart: function(t, e, i, o, n) {
return o * (e /= n) * e * e * e + i
},
easeOutQuart: function(t, e, i, o, n) {
return -o * ((e = e / n - 1) * e * e * e - 1) + i
},
easeInOutQuart: function(t, e, i, o, n) {
return (e /= n / 2) < 1 ? o / 2 * e * e * e * e + i : -o / 2 * ((e -= 2) * e * e * e - 2) + i
},
easeInQuint: function(t, e, i, o, n) {
return o * (e /= n) * e * e * e * e + i
},
easeOutQuint: function(t, e, i, o, n) {
return o * ((e = e / n - 1) * e * e * e * e + 1) + i
},
easeInOutQuint: function(t, e, i, o, n) {
return (e /= n / 2) < 1 ? o / 2 * e * e * e * e * e + i : o / 2 * ((e -= 2) * e * e * e * e + 2) + i
},
easeInSine: function(t, e, i, o, n) {
return -o * Math.cos(e / n * (Math.PI / 2)) + o + i
},
easeOutSine: function(t, e, i, o, n) {
return o * Math.sin(e / n * (Math.PI / 2)) + i
},
easeInOutSine: function(t, e, i, o, n) {
return -o / 2 * (Math.cos(Math.PI * e / n) - 1) + i
},
easeInExpo: function(t, e, i, o, n) {
return 0 == e ? i : o * Math.pow(2, 10 * (e / n - 1)) + i
},
easeOutExpo: function(t, e, i, o, n) {
return e == n ? i + o : o * (-Math.pow(2, -10 * e / n) + 1) + i
},
easeInOutExpo: function(t, e, i, o, n) {
return 0 == e ? i : e == n ? i + o : (e /= n / 2) < 1 ? o / 2 * Math.pow(2, 10 * (e - 1)) + i : o / 2 * (-Math.pow(2, -10 * --e) + 2) + i
},
easeInCirc: function(t, e, i, o, n) {
return -o * (Math.sqrt(1 - (e /= n) * e) - 1) + i
},
easeOutCirc: function(t, e, i, o, n) {
return o * Math.sqrt(1 - (e = e / n - 1) * e) + i
},
easeInOutCirc: function(t, e, i, o, n) {
return (e /= n / 2) < 1 ? -o / 2 * (Math.sqrt(1 - e * e) - 1) + i : o / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + i
},
easeInElastic: function(t, e, i, o, n) {
var s = 1.70158,
r = 0,
a = o;
if (0 == e) return i;
if (1 == (e /= n)) return i + o;
if (r || (r = .3 * n), a < Math.abs(o)) {
a = o;
var s = r / 4
} else var s = r / (2 * Math.PI) * Math.asin(o / a);
return -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(2 * (e * n - s) * Math.PI / r)) + i
},
easeOutElastic: function(t, e, i, o, n) {
var s = 1.70158,
r = 0,
a = o;
if (0 == e) return i;
if (1 == (e /= n)) return i + o;
if (r || (r = .3 * n), a < Math.abs(o)) {
a = o;
var s = r / 4
} else var s = r / (2 * Math.PI) * Math.asin(o / a);
return a * Math.pow(2, -10 * e) * Math.sin(2 * (e * n - s) * Math.PI / r) + o + i
},
easeInOutElastic: function(t, e, i, o, n) {
var s = 1.70158,
r = 0,
a = o;
if (0 == e) return i;
if (2 == (e /= n / 2)) return i + o;
if (r || (r = .3 * n * 1.5), a < Math.abs(o)) {
a = o;
var s = r / 4
} else var s = r / (2 * Math.PI) * Math.asin(o / a);
return 1 > e ? -.5 * a * Math.pow(2, 10 * (e -= 1)) * Math.sin(2 * (e * n - s) * Math.PI / r) + i : a * Math.pow(2, -10 * (e -= 1)) * Math.sin(2 * (e * n - s) * Math.PI / r) * .5 + o + i
},
easeInBack: function(t, e, i, o, n, s) {
return void 0 == s && (s = 1.70158), o * (e /= n) * e * ((s + 1) * e - s) + i
},
easeOutBack: function(t, e, i, o, n, s) {
return void 0 == s && (s = 1.70158), o * ((e = e / n - 1) * e * ((s + 1) * e + s) + 1) + i
},
easeInOutBack: function(t, e, i, o, n, s) {
return void 0 == s && (s = 1.70158), (e /= n / 2) < 1 ? o / 2 * e * e * (((s *= 1.525) + 1) * e - s) + i : o / 2 * ((e -= 2) * e * (((s *= 1.525) + 1) * e + s) + 2) + i
},
easeInBounce: function(t, e, i, o, n) {
return o - jQuery.easing.easeOutBounce(t, n - e, 0, o, n) + i
},
easeOutBounce: function(t, e, i, o, n) {
return (e /= n) < 1 / 2.75 ? 7.5625 * o * e * e + i : 2 / 2.75 > e ? o * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + i : 2.5 / 2.75 > e ? o * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + i : o * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + i
},
easeInOutBounce: function(t, e, i, o, n) {
return n / 2 > e ? .5 * jQuery.easing.easeInBounce(t, 2 * e, 0, o, n) + i : .5 * jQuery.easing.easeOutBounce(t, 2 * e - n, 0, o, n) + .5 * o + i
}
}), function(t) {
"use strict";
t.fn.fitVids = function(e) {
var i = {
customSelector: null
},
o = document.createElement("div"),
n = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0];
return o.className = "fit-vids-style", o.innerHTML = "&shy;<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>", n.parentNode.insertBefore(o, n), e && t.extend(i, e), this.each(function() {
var e = ["iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed"];
i.customSelector && e.push(i.customSelector);
var o = t(this).find(e.join(","));
o.each(function() {
var e = t(this);
if (!("embed" === this.tagName.toLowerCase() && e.parent("object").length || e.parent(".fluid-width-video-wrapper").length)) {
var i = "object" === this.tagName.toLowerCase() || e.attr("height") && !isNaN(parseInt(e.attr("height"), 10)) ? parseInt(e.attr("height"), 10) : e.height(),
o = isNaN(parseInt(e.attr("width"), 10)) ? e.width() : parseInt(e.attr("width"), 10),
n = i / o;
if (!e.attr("id")) {
var s = "fitvid" + Math.floor(999999 * Math.random());
e.attr("id", s)
}
e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", 100 * n + "%"), e.removeAttr("height").removeAttr("width")
}
})
})
}
}(jQuery), function(t) {
"function" == typeof define && define.amd ? define(["jquery"], t) : t(jQuery)
}(function(t) {
var e = !1,
i = !1,
o = 5e3,
n = 2e3,
s = 0,
r = ["ms", "moz", "webkit", "o"],
a = window.requestAnimationFrame || !1,
l = window.cancelAnimationFrame || !1;
if (!a)
for (var c in r) {
var d = r[c];
a || (a = window[d + "RequestAnimationFrame"]), l || (l = window[d + "CancelAnimationFrame"] || window[d + "CancelRequestAnimationFrame"])
}
var h = window.MutationObserver || window.WebKitMutationObserver || !1,
u = {
zindex: "auto",
cursoropacitymin: 0,
cursoropacitymax: 1,
cursorcolor: "#424242",
cursorwidth: "5px",
cursorborder: "1px solid #fff",
cursorborderradius: "5px",
scrollspeed: 60,
mousescrollstep: 24,
touchbehavior: !1,
hwacceleration: !0,
usetransition: !0,
boxzoom: !1,
dblclickzoom: !0,
gesturezoom: !0,
grabcursorenabled: !0,
autohidemode: !0,
background: "",
iframeautoresize: !0,
cursorminheight: 32,
preservenativescrolling: !0,
railoffset: !1,
bouncescroll: !0,
spacebarenabled: !0,
railpadding: {
top: 0,
right: 0,
left: 0,
bottom: 0
},
disableoutline: !0,
horizrailenabled: !0,
railalign: "right",
railvalign: "bottom",
enabletranslate3d: !0,
enablemousewheel: !0,
enablekeyboard: !0,
smoothscroll: !0,
sensitiverail: !0,
enablemouselockapi: !0,
cursorfixedheight: !1,
directionlockdeadzone: 6,
hidecursordelay: 400,
nativeparentscrolling: !0,
enablescrollonselection: !0,
overflowx: !0,
overflowy: !0,
cursordragspeed: .3,
rtlmode: "auto",
cursordragontouch: !1,
oneaxismousemode: "auto",
scriptpath: function() {
var t = document.getElementsByTagName("script"),
t = t[t.length - 1].src.split("?")[0];
return 0 < t.split("/").length ? t.split("/").slice(0, -1).join("/") + "/" : ""
}()
},
p = !1,
f = function() {
if (p) return p;
var t = document.createElement("DIV"),
e = {
haspointerlock: "pointerLockElement" in document || "mozPointerLockElement" in document || "webkitPointerLockElement" in document
};
e.isopera = "opera" in window, e.isopera12 = e.isopera && "getUserMedia" in navigator, e.isoperamini = "[object OperaMini]" === Object.prototype.toString.call(window.operamini), e.isie = "all" in document && "attachEvent" in t && !e.isopera, e.isieold = e.isie && !("msInterpolationMode" in t.style), e.isie7 = !(!e.isie || e.isieold || "documentMode" in document && 7 != document.documentMode), e.isie8 = e.isie && "documentMode" in document && 8 == document.documentMode, e.isie9 = e.isie && "performance" in window && 9 <= document.documentMode, e.isie10 = e.isie && "performance" in window && 10 <= document.documentMode, e.isie9mobile = /iemobile.9/i.test(navigator.userAgent), e.isie9mobile && (e.isie9 = !1), e.isie7mobile = !e.isie9mobile && e.isie7 && /iemobile/i.test(navigator.userAgent), e.ismozilla = "MozAppearance" in t.style, e.iswebkit = "WebkitAppearance" in t.style, e.ischrome = "chrome" in window, e.ischrome22 = e.ischrome && e.haspointerlock, e.ischrome26 = e.ischrome && "transition" in t.style, e.cantouch = "ontouchstart" in document.documentElement || "ontouchstart" in window, e.hasmstouch = window.navigator.msPointerEnabled || !1, e.ismac = /^mac$/i.test(navigator.platform), e.isios = e.cantouch && /iphone|ipad|ipod/i.test(navigator.platform), e.isios4 = e.isios && !("seal" in Object), e.isandroid = /android/i.test(navigator.userAgent), e.trstyle = !1, e.hastransform = !1, e.hastranslate3d = !1, e.transitionstyle = !1, e.hastransition = !1, e.transitionend = !1;
for (var i = ["transform", "msTransform", "webkitTransform", "MozTransform", "OTransform"], o = 0; o < i.length; o++)
if ("undefined" != typeof t.style[i[o]]) {
e.trstyle = i[o];
break
}
e.hastransform = 0 != e.trstyle, e.hastransform && (t.style[e.trstyle] = "translate3d(1px,2px,3px)", e.hastranslate3d = /translate3d/.test(t.style[e.trstyle])), e.transitionstyle = !1, e.prefixstyle = "", e.transitionend = !1;
for (var i = "transition webkitTransition MozTransition OTransition OTransition msTransition KhtmlTransition".split(" "), n = " -webkit- -moz- -o- -o -ms- -khtml-".split(" "), s = "transitionend webkitTransitionEnd transitionend otransitionend oTransitionEnd msTransitionEnd KhtmlTransitionEnd".split(" "), o = 0; o < i.length; o++)
if (i[o] in t.style) {
e.transitionstyle = i[o], e.prefixstyle = n[o], e.transitionend = s[o];
break
}
e.ischrome26 && (e.prefixstyle = n[1]), e.hastransition = e.transitionstyle;
t: {
for (i = ["-moz-grab", "-webkit-grab", "grab"], (e.ischrome && !e.ischrome22 || e.isie) && (i = []), o = 0; o < i.length; o++)
if (n = i[o], t.style.cursor = n, t.style.cursor == n) {
i = n;
break t
}
i = "url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"
}
return e.cursorgrabvalue = i, e.hasmousecapture = "setCapture" in t, e.hasMutationObserver = !1 !== h, p = e
},
m = function(r, c) {
function d() {
var t = w.win;
if ("zIndex" in t) return t.zIndex();
for (; 0 < t.length && 9 != t[0].nodeType;) {
var e = t.css("zIndex");
if (!isNaN(e) && 0 != e) return parseInt(e);
t = t.parent()
}
return !1
}
function p(t, e, i) {
return e = t.css(e), t = parseFloat(e), isNaN(t) ? (t = T[e] || 0, i = 3 == t ? i ? w.win.outerHeight() - w.win.innerHeight() : w.win.outerWidth() - w.win.innerWidth() : 1, w.isie8 && t && (t += 1), i ? t : 0) : t
}
function m(t, e, i, o) {
w._bind(t, e, function(o) {
o = o ? o : window.event;
var n = {
original: o,
target: o.target || o.srcElement,
type: "wheel",
deltaMode: "MozMousePixelScroll" == o.type ? 0 : 1,
deltaX: 0,
deltaZ: 0,
preventDefault: function() {
return o.preventDefault ? o.preventDefault() : o.returnValue = !1, !1
},
stopImmediatePropagation: function() {
o.stopImmediatePropagation ? o.stopImmediatePropagation() : o.cancelBubble = !0
}
};
return "mousewheel" == e ? (n.deltaY = -.025 * o.wheelDelta, o.wheelDeltaX && (n.deltaX = -.025 * o.wheelDeltaX)) : n.deltaY = o.detail, i.call(t, n)
}, o)
}
function v(t, e, i) {
var o, n;
if (0 == t.deltaMode ? (o = -Math.floor(t.deltaX * (w.opt.mousescrollstep / 54)), n = -Math.floor(t.deltaY * (w.opt.mousescrollstep / 54))) : 1 == t.deltaMode && (o = -Math.floor(t.deltaX * w.opt.mousescrollstep), n = -Math.floor(t.deltaY * w.opt.mousescrollstep)), e && w.opt.oneaxismousemode && 0 == o && n && (o = n, n = 0), o && (w.scrollmom && w.scrollmom.stop(), w.lastdeltax += o, w.debounced("mousewheelx", function() {
var t = w.lastdeltax;
w.lastdeltax = 0, w.rail.drag || w.doScrollLeftBy(t)
}, 15)), n) {
if (w.opt.nativeparentscrolling && i && !w.ispage && !w.zoomactive)
if (0 > n) {
if (w.getScrollTop() >= w.page.maxh) return !0
} else if (0 >= w.getScrollTop()) return !0;
w.scrollmom && w.scrollmom.stop(), w.lastdeltay += n, w.debounced("mousewheely", function() {
var t = w.lastdeltay;
w.lastdeltay = 0, w.rail.drag || w.doScrollBy(t)
}, 15)
}
return t.stopImmediatePropagation(), t.preventDefault()
}
var w = this;
if (this.version = "3.5.4", this.name = "nicescroll", this.me = c, this.opt = {
doc: t("body"),
win: !1
}, t.extend(this.opt, u), this.opt.snapbackspeed = 80, r)
for (var y in w.opt) "undefined" != typeof r[y] && (w.opt[y] = r[y]);
this.iddoc = (this.doc = w.opt.doc) && this.doc[0] ? this.doc[0].id || "" : "", this.ispage = /^BODY|HTML/.test(w.opt.win ? w.opt.win[0].nodeName : this.doc[0].nodeName), this.haswrapper = !1 !== w.opt.win, this.win = w.opt.win || (this.ispage ? t(window) : this.doc), this.docscroll = this.ispage && !this.haswrapper ? t(window) : this.win, this.body = t("body"), this.iframe = this.isfixed = this.viewport = !1, this.isiframe = "IFRAME" == this.doc[0].nodeName && "IFRAME" == this.win[0].nodeName, this.istextarea = "TEXTAREA" == this.win[0].nodeName, this.forcescreen = !1, this.canshowonmouseevent = "scroll" != w.opt.autohidemode, this.page = this.view = this.onzoomout = this.onzoomin = this.onscrollcancel = this.onscrollend = this.onscrollstart = this.onclick = this.ongesturezoom = this.onkeypress = this.onmousewheel = this.onmousemove = this.onmouseup = this.onmousedown = !1, this.scroll = {
x: 0,
y: 0
}, this.scrollratio = {
x: 0,
y: 0
}, this.cursorheight = 20, this.scrollvaluemax = 0, this.observerremover = this.observer = this.scrollmom = this.scrollrunning = this.isrtlmode = !1;
do this.id = "ascrail" + n++; while (document.getElementById(this.id));
this.hasmousefocus = this.hasfocus = this.zoomactive = this.zoom = this.selectiondrag = this.cursorfreezed = this.cursor = this.rail = !1, this.visibility = !0, this.hidden = this.locked = !1, this.cursoractive = !0, this.wheelprevented = !1, this.overflowx = w.opt.overflowx, this.overflowy = w.opt.overflowy, this.nativescrollingarea = !1, this.checkarea = 0, this.events = [], this.saved = {}, this.delaylist = {}, this.synclist = {}, this.lastdeltay = this.lastdeltax = 0, this.detected = f();
var b = t.extend({}, this.detected);
this.ishwscroll = (this.canhwscroll = b.hastransform && w.opt.hwacceleration) && w.haswrapper, this.istouchcapable = !1, b.cantouch && b.ischrome && !b.isios && !b.isandroid && (this.istouchcapable = !0, b.cantouch = !1), b.cantouch && b.ismozilla && !b.isios && !b.isandroid && (this.istouchcapable = !0, b.cantouch = !1), w.opt.enablemouselockapi || (b.hasmousecapture = !1, b.haspointerlock = !1), this.delayed = function(t, e, i, o) {
var n = w.delaylist[t],
s = (new Date).getTime();
return !o && n && n.tt ? !1 : (n && n.tt && clearTimeout(n.tt), void(n && n.last + i > s && !n.tt ? w.delaylist[t] = {
last: s + i,
tt: setTimeout(function() {
w && (w.delaylist[t].tt = 0, e.call())
}, i)
} : n && n.tt || (w.delaylist[t] = {
last: s,
tt: 0
}, setTimeout(function() {
e.call()
}, 0))))
}, this.debounced = function(t, e, i) {
var o = w.delaylist[t];
(new Date).getTime(), w.delaylist[t] = e, o || setTimeout(function() {
var e = w.delaylist[t];
w.delaylist[t] = !1, e.call()
}, i)
};
var x = !1;
if (this.synched = function(t, e) {
return w.synclist[t] = e,
function() {
x || (a(function() {
x = !1;
for (t in w.synclist) {
var e = w.synclist[t];
e && e.call(w), w.synclist[t] = !1
}
}), x = !0)
}(), t
}, this.unsynched = function(t) {
w.synclist[t] && (w.synclist[t] = !1)
}, this.css = function(t, e) {
for (var i in e) w.saved.css.push([t, i, t.css(i)]), t.css(i, e[i])
}, this.scrollTop = function(t) {
return "undefined" == typeof t ? w.getScrollTop() : w.setScrollTop(t)
}, this.scrollLeft = function(t) {
return "undefined" == typeof t ? w.getScrollLeft() : w.setScrollLeft(t)
}, BezierClass = function(t, e, i, o, n, s, r) {
this.st = t, this.ed = e, this.spd = i, this.p1 = o || 0, this.p2 = n || 1, this.p3 = s || 0, this.p4 = r || 1, this.ts = (new Date).getTime(), this.df = this.ed - this.st
}, BezierClass.prototype = {
B2: function(t) {
return 3 * t * t * (1 - t)
},
B3: function(t) {
return 3 * t * (1 - t) * (1 - t)
},
B4: function(t) {
return (1 - t) * (1 - t) * (1 - t)
},
getNow: function() {
var t = 1 - ((new Date).getTime() - this.ts) / this.spd,
e = this.B2(t) + this.B3(t) + this.B4(t);
return 0 > t ? this.ed : this.st + Math.round(this.df * e)
},
update: function(t, e) {
return this.st = this.getNow(), this.ed = t, this.spd = e, this.ts = (new Date).getTime(), this.df = this.ed - this.st, this
}
}, this.ishwscroll) {
this.doc.translate = {
x: 0,
y: 0,
tx: "0px",
ty: "0px"
}, b.hastranslate3d && b.isios && this.doc.css("-webkit-backface-visibility", "hidden");
var S = function() {
var t = w.doc.css(b.trstyle);
return t && "matrix" == t.substr(0, 6) ? t.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, "").split(/, +/) : !1
};
this.getScrollTop = function(t) {
if (!t) {
if (t = S()) return 16 == t.length ? -t[13] : -t[5];
if (w.timerscroll && w.timerscroll.bz) return w.timerscroll.bz.getNow()
}
return w.doc.translate.y
}, this.getScrollLeft = function(t) {
if (!t) {
if (t = S()) return 16 == t.length ? -t[12] : -t[4];
if (w.timerscroll && w.timerscroll.bh) return w.timerscroll.bh.getNow()
}
return w.doc.translate.x
}, this.notifyScrollEvent = document.createEvent ? function(t) {
var e = document.createEvent("UIEvents");
e.initUIEvent("scroll", !1, !0, window, 1), t.dispatchEvent(e)
} : document.fireEvent ? function(t) {
var e = document.createEventObject();
t.fireEvent("onscroll"), e.cancelBubble = !0
} : function() {}, b.hastranslate3d && w.opt.enabletranslate3d ? (this.setScrollTop = function(t, e) {
w.doc.translate.y = t, w.doc.translate.ty = -1 * t + "px", w.doc.css(b.trstyle, "translate3d(" + w.doc.translate.tx + "," + w.doc.translate.ty + ",0px)"), e || w.notifyScrollEvent(w.win[0])
}, this.setScrollLeft = function(t, e) {
w.doc.translate.x = t, w.doc.translate.tx = -1 * t + "px", w.doc.css(b.trstyle, "translate3d(" + w.doc.translate.tx + "," + w.doc.translate.ty + ",0px)"), e || w.notifyScrollEvent(w.win[0])
}) : (this.setScrollTop = function(t, e) {
w.doc.translate.y = t, w.doc.translate.ty = -1 * t + "px", w.doc.css(b.trstyle, "translate(" + w.doc.translate.tx + "," + w.doc.translate.ty + ")"), e || w.notifyScrollEvent(w.win[0])
}, this.setScrollLeft = function(t, e) {
w.doc.translate.x = t, w.doc.translate.tx = -1 * t + "px", w.doc.css(b.trstyle, "translate(" + w.doc.translate.tx + "," + w.doc.translate.ty + ")"), e || w.notifyScrollEvent(w.win[0])
})
} else this.getScrollTop = function() {
return w.docscroll.scrollTop()
}, this.setScrollTop = function(t) {
return w.docscroll.scrollTop(t)
}, this.getScrollLeft = function() {
return w.docscroll.scrollLeft()
}, this.setScrollLeft = function(t) {
return w.docscroll.scrollLeft(t)
};
this.getTarget = function(t) {
return t ? t.target ? t.target : t.srcElement ? t.srcElement : !1 : !1
}, this.hasParent = function(t, e) {
if (!t) return !1;
for (var i = t.target || t.srcElement || t || !1; i && i.id != e;) i = i.parentNode || !1;
return !1 !== i
};
var T = {
thin: 1,
medium: 3,
thick: 5
};
this.getOffset = function() {
if (w.isfixed) return {
top: parseFloat(w.win.css("top")),
left: parseFloat(w.win.css("left"))
};
if (!w.viewport) return w.win.offset();
var t = w.win.offset(),
e = w.viewport.offset();
return {
top: t.top - e.top + w.viewport.scrollTop(),
left: t.left - e.left + w.viewport.scrollLeft()
}
}, this.updateScrollBar = function(t) {
if (w.ishwscroll) w.rail.css({
height: w.win.innerHeight()
}), w.railh && w.railh.css({
width: w.win.innerWidth()
});
else {
var e = w.getOffset(),
i = e.top,
o = e.left,
i = i + p(w.win, "border-top-width", !0);
w.win.outerWidth(), w.win.innerWidth();
var o = o + (w.rail.align ? w.win.outerWidth() - p(w.win, "border-right-width") - w.rail.width : p(w.win, "border-left-width")),
n = w.opt.railoffset;
n && (n.top && (i += n.top), w.rail.align && n.left && (o += n.left)), w.locked || w.rail.css({
top: i,
left: o,
height: t ? t.h : w.win.innerHeight()
}), w.zoom && w.zoom.css({
top: i + 1,
left: 1 == w.rail.align ? o - 20 : o + w.rail.width + 4
}), w.railh && !w.locked && (i = e.top, o = e.left, t = w.railh.align ? i + p(w.win, "border-top-width", !0) + w.win.innerHeight() - w.railh.height : i + p(w.win, "border-top-width", !0), o += p(w.win, "border-left-width"), w.railh.css({
top: t,
left: o,
width: w.railh.width
}))
}
}, this.doRailClick = function(t, e, i) {
var o;
w.locked || (w.cancelEvent(t), e ? (e = i ? w.doScrollLeft : w.doScrollTop, o = i ? (t.pageX - w.railh.offset().left - w.cursorwidth / 2) * w.scrollratio.x : (t.pageY - w.rail.offset().top - w.cursorheight / 2) * w.scrollratio.y, e(o)) : (e = i ? w.doScrollLeftBy : w.doScrollBy, o = i ? w.scroll.x : w.scroll.y, t = i ? t.pageX - w.railh.offset().left : t.pageY - w.rail.offset().top, i = i ? w.view.w : w.view.h, e(o >= t ? i : -i)))
}, w.hasanimationframe = a, w.hascancelanimationframe = l, w.hasanimationframe ? w.hascancelanimationframe || (l = function() {
w.cancelAnimationFrame = !0
}) : (a = function(t) {
return setTimeout(t, 15 - Math.floor(+new Date / 1e3) % 16)
}, l = clearInterval), this.init = function() {
if (w.saved.css = [], b.isie7mobile || b.isoperamini) return !0;
if (b.hasmstouch && w.css(w.ispage ? t("html") : w.win, {
"-ms-touch-action": "none"
}), w.zindex = "auto", w.zindex = w.ispage || "auto" != w.opt.zindex ? w.opt.zindex : d() || "auto", !w.ispage && "auto" != w.zindex && w.zindex > s && (s = w.zindex), w.isie && 0 == w.zindex && "auto" == w.opt.zindex && (w.zindex = "auto"), !w.ispage || !b.cantouch && !b.isieold && !b.isie9mobile) {
var n = w.docscroll;
w.ispage && (n = w.haswrapper ? w.win : w.doc), b.isie9mobile || w.css(n, {
"overflow-y": "hidden"
}), w.ispage && b.isie7 && ("BODY" == w.doc[0].nodeName ? w.css(t("html"), {
"overflow-y": "hidden"
}) : "HTML" == w.doc[0].nodeName && w.css(t("body"), {
"overflow-y": "hidden"
})), b.isios && !w.ispage && !w.haswrapper && w.css(t("body"), {
"-webkit-overflow-scrolling": "touch"
});
var r = t(document.createElement("div"));
r.css({
position: "relative",
top: 0,
"float": "right",
width: w.opt.cursorwidth,
height: "0px",
"background-color": w.opt.cursorcolor,
border: w.opt.cursorborder,
"background-clip": "padding-box",
"-webkit-border-radius": w.opt.cursorborderradius,
"-moz-border-radius": w.opt.cursorborderradius,
"border-radius": w.opt.cursorborderradius
}), r.hborder = parseFloat(r.outerHeight() - r.innerHeight()), w.cursor = r;
var a = t(document.createElement("div"));
a.attr("id", w.id), a.addClass("nicescroll-rails");
var l, c, u, p = ["left", "right"];
for (u in p) c = p[u], (l = w.opt.railpadding[c]) ? a.css("padding-" + c, l + "px") : w.opt.railpadding[c] = 0;
if (a.append(r), a.width = Math.max(parseFloat(w.opt.cursorwidth), r.outerWidth()) + w.opt.railpadding.left + w.opt.railpadding.right, a.css({
width: a.width + "px",
zIndex: w.zindex,
background: w.opt.background,
cursor: "default"
}), a.visibility = !0, a.scrollable = !0, a.align = "left" == w.opt.railalign ? 0 : 1, w.rail = a, r = w.rail.drag = !1, w.opt.boxzoom && !w.ispage && !b.isieold && (r = document.createElement("div"), w.bind(r, "click", w.doZoom), w.zoom = t(r), w.zoom.css({
cursor: "pointer",
"z-index": w.zindex,
backgroundImage: "url(" + w.opt.scriptpath + "zoomico.png)",
height: 18,
width: 18,
backgroundPosition: "0px 0px"
}), w.opt.dblclickzoom && w.bind(w.win, "dblclick", w.doZoom), b.cantouch && w.opt.gesturezoom && (w.ongesturezoom = function(t) {
return 1.5 < t.scale && w.doZoomIn(t), .8 > t.scale && w.doZoomOut(t), w.cancelEvent(t)
}, w.bind(w.win, "gestureend", w.ongesturezoom))), w.railh = !1, w.opt.horizrailenabled) {
w.css(n, {
"overflow-x": "hidden"
}), r = t(document.createElement("div")), r.css({
position: "relative",
top: 0,
height: w.opt.cursorwidth,
width: "0px",
"background-color": w.opt.cursorcolor,
border: w.opt.cursorborder,
"background-clip": "padding-box",
"-webkit-border-radius": w.opt.cursorborderradius,
"-moz-border-radius": w.opt.cursorborderradius,
"border-radius": w.opt.cursorborderradius
}), r.wborder = parseFloat(r.outerWidth() - r.innerWidth()), w.cursorh = r;
var f = t(document.createElement("div"));
f.attr("id", w.id + "-hr"), f.addClass("nicescroll-rails"), f.height = Math.max(parseFloat(w.opt.cursorwidth), r.outerHeight()), f.css({
height: f.height + "px",
zIndex: w.zindex,
background: w.opt.background
}), f.append(r), f.visibility = !0, f.scrollable = !0, f.align = "top" == w.opt.railvalign ? 0 : 1, w.railh = f, w.railh.drag = !1
}
if (w.ispage ? (a.css({
position: "fixed",
top: "0px",
height: "100%"
}), a.css(a.align ? {
right: "0px"
} : {
left: "0px"
}), w.body.append(a), w.railh && (f.css({
position: "fixed",
left: "0px",
width: "100%"
}), f.css(f.align ? {
bottom: "0px"
} : {
top: "0px"
}), w.body.append(f))) : (w.ishwscroll ? ("static" == w.win.css("position") && w.css(w.win, {
position: "relative"
}), n = "HTML" == w.win[0].nodeName ? w.body : w.win, w.zoom && (w.zoom.css({
position: "absolute",
top: 1,
right: 0,
"margin-right": a.width + 4
}), n.append(w.zoom)), a.css({
position: "absolute",
top: 0
}), a.css(a.align ? {
right: 0
} : {
left: 0
}), n.append(a), f && (f.css({
position: "absolute",
left: 0,
bottom: 0
}), f.css(f.align ? {
bottom: 0
} : {
top: 0
}), n.append(f))) : (w.isfixed = "fixed" == w.win.css("position"), n = w.isfixed ? "fixed" : "absolute", w.isfixed || (w.viewport = w.getViewport(w.win[0])), w.viewport && (w.body = w.viewport, 0 == /fixed|relative|absolute/.test(w.viewport.css("position")) && w.css(w.viewport, {
position: "relative"
})), a.css({
position: n
}), w.zoom && w.zoom.css({
position: n
}), w.updateScrollBar(), w.body.append(a), w.zoom && w.body.append(w.zoom), w.railh && (f.css({
position: n
}), w.body.append(f))), b.isios && w.css(w.win, {
"-webkit-tap-highlight-color": "rgba(0,0,0,0)",
"-webkit-touch-callout": "none"
}), b.isie && w.opt.disableoutline && w.win.attr("hideFocus", "true"), b.iswebkit && w.opt.disableoutline && w.win.css({
outline: "none"
})), !1 === w.opt.autohidemode ? (w.autohidedom = !1, w.rail.css({
opacity: w.opt.cursoropacitymax
}), w.railh && w.railh.css({
opacity: w.opt.cursoropacitymax
})) : !0 === w.opt.autohidemode || "leave" === w.opt.autohidemode ? (w.autohidedom = t().add(w.rail), b.isie8 && (w.autohidedom = w.autohidedom.add(w.cursor)), w.railh && (w.autohidedom = w.autohidedom.add(w.railh)), w.railh && b.isie8 && (w.autohidedom = w.autohidedom.add(w.cursorh))) : "scroll" == w.opt.autohidemode ? (w.autohidedom = t().add(w.rail), w.railh && (w.autohidedom = w.autohidedom.add(w.railh))) : "cursor" == w.opt.autohidemode ? (w.autohidedom = t().add(w.cursor), w.railh && (w.autohidedom = w.autohidedom.add(w.cursorh))) : "hidden" == w.opt.autohidemode && (w.autohidedom = !1, w.hide(), w.locked = !1), b.isie9mobile) w.scrollmom = new g(w), w.onmangotouch = function(t) {
t = w.getScrollTop();
var e = w.getScrollLeft();
if (t == w.scrollmom.lastscrolly && e == w.scrollmom.lastscrollx) return !0;
var i = t - w.mangotouch.sy,
o = e - w.mangotouch.sx;
if (0 != Math.round(Math.sqrt(Math.pow(o, 2) + Math.pow(i, 2)))) {
var n = 0 > i ? -1 : 1,
s = 0 > o ? -1 : 1,
r = +new Date;
w.mangotouch.lazy && clearTimeout(w.mangotouch.lazy), 80 < r - w.mangotouch.tm || w.mangotouch.dry != n || w.mangotouch.drx != s ? (w.scrollmom.stop(), w.scrollmom.reset(e, t), w.mangotouch.sy = t, w.mangotouch.ly = t, w.mangotouch.sx = e, w.mangotouch.lx = e, w.mangotouch.dry = n, w.mangotouch.drx = s, w.mangotouch.tm = r) : (w.scrollmom.stop(), w.scrollmom.update(w.mangotouch.sx - o, w.mangotouch.sy - i), w.mangotouch.tm = r, i = Math.max(Math.abs(w.mangotouch.ly - t), Math.abs(w.mangotouch.lx - e)), w.mangotouch.ly = t, w.mangotouch.lx = e, i > 2 && (w.mangotouch.lazy = setTimeout(function() {
w.mangotouch.lazy = !1, w.mangotouch.dry = 0, w.mangotouch.drx = 0, w.mangotouch.tm = 0, w.scrollmom.doMomentum(30)
}, 100)))
}
}, a = w.getScrollTop(), f = w.getScrollLeft(), w.mangotouch = {
sy: a,
ly: a,
dry: 0,
sx: f,
lx: f,
drx: 0,
lazy: !1,
tm: 0
}, w.bind(w.docscroll, "scroll", w.onmangotouch);
else {
if (b.cantouch || w.istouchcapable || w.opt.touchbehavior || b.hasmstouch) {
w.scrollmom = new g(w), w.ontouchstart = function(e) {
if (e.pointerType && 2 != e.pointerType) return !1;
if (w.hasmoving = !1, !w.locked) {
if (b.hasmstouch)
for (var i = e.target ? e.target : !1; i;) {
var o = t(i).getNiceScroll();
if (0 < o.length && o[0].me == w.me) break;
if (0 < o.length) return !1;
if ("DIV" == i.nodeName && i.id == w.id) break;
i = i.parentNode ? i.parentNode : !1
}
if (w.cancelScroll(), (i = w.getTarget(e)) && /INPUT/i.test(i.nodeName) && /range/i.test(i.type)) return w.stopPropagation(e);
if (!("clientX" in e) && "changedTouches" in e && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), w.forcescreen && (o = e, e = {
original: e.original ? e.original : e
}, e.clientX = o.screenX, e.clientY = o.screenY), w.rail.drag = {
x: e.clientX,
y: e.clientY,
sx: w.scroll.x,
sy: w.scroll.y,
st: w.getScrollTop(),
sl: w.getScrollLeft(),
pt: 2,
dl: !1
}, w.ispage || !w.opt.directionlockdeadzone) w.rail.drag.dl = "f";
else {
var o = t(window).width(),
n = t(window).height(),
s = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth),
r = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
n = Math.max(0, r - n),
o = Math.max(0, s - o);
w.rail.drag.ck = !w.rail.scrollable && w.railh.scrollable ? n > 0 ? "v" : !1 : w.rail.scrollable && !w.railh.scrollable && o > 0 ? "h" : !1, w.rail.drag.ck || (w.rail.drag.dl = "f")
}
if (w.opt.touchbehavior && w.isiframe && b.isie && (o = w.win.position(), w.rail.drag.x += o.left, w.rail.drag.y += o.top), w.hasmoving = !1, w.lastmouseup = !1, w.scrollmom.reset(e.clientX, e.clientY), !b.cantouch && !this.istouchcapable && !b.hasmstouch) {
if (!i || !/INPUT|SELECT|TEXTAREA/i.test(i.nodeName)) return !w.ispage && b.hasmousecapture && i.setCapture(), w.opt.touchbehavior ? (i.onclick && !i._onclick && (i._onclick = i.onclick, i.onclick = function(t) {
return w.hasmoving ? !1 : void i._onclick.call(this, t)
}), w.cancelEvent(e)) : w.stopPropagation(e);
/SUBMIT|CANCEL|BUTTON/i.test(t(i).attr("type")) && (pc = {
tg: i,
click: !1
}, w.preventclick = pc)
}
}
}, w.ontouchend = function(t) {
return t.pointerType && 2 != t.pointerType ? !1 : w.rail.drag && 2 == w.rail.drag.pt && (w.scrollmom.doMomentum(), w.rail.drag = !1, w.hasmoving && (w.lastmouseup = !0, w.hideCursor(), b.hasmousecapture && document.releaseCapture(), !b.cantouch)) ? w.cancelEvent(t) : void 0
};
var m = w.opt.touchbehavior && w.isiframe && !b.hasmousecapture;
w.ontouchmove = function(e, i) {
if (e.pointerType && 2 != e.pointerType) return !1;
if (w.rail.drag && 2 == w.rail.drag.pt) {
if (b.cantouch && "undefined" == typeof e.original) return !0;
if (w.hasmoving = !0, w.preventclick && !w.preventclick.click && (w.preventclick.click = w.preventclick.tg.onclick || !1, w.preventclick.tg.onclick = w.onpreventclick), e = t.extend({
original: e
}, e), "changedTouches" in e && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), w.forcescreen) {
var o = e;
e = {
original: e.original ? e.original : e
}, e.clientX = o.screenX, e.clientY = o.screenY
}
if (o = ofy = 0, m && !i) {
var n = w.win.position(),
o = -n.left;
ofy = -n.top
}
var s = e.clientY + ofy,
n = s - w.rail.drag.y,
r = e.clientX + o,
a = r - w.rail.drag.x,
l = w.rail.drag.st - n;
if (w.ishwscroll && w.opt.bouncescroll ? 0 > l ? l = Math.round(l / 2) : l > w.page.maxh && (l = w.page.maxh + Math.round((l - w.page.maxh) / 2)) : (0 > l && (s = l = 0), l > w.page.maxh && (l = w.page.maxh, s = 0)), w.railh && w.railh.scrollable) {
var c = w.rail.drag.sl - a;
w.ishwscroll && w.opt.bouncescroll ? 0 > c ? c = Math.round(c / 2) : c > w.page.maxw && (c = w.page.maxw + Math.round((c - w.page.maxw) / 2)) : (0 > c && (r = c = 0), c > w.page.maxw && (c = w.page.maxw, r = 0))
}
if (o = !1, w.rail.drag.dl) o = !0, "v" == w.rail.drag.dl ? c = w.rail.drag.sl : "h" == w.rail.drag.dl && (l = w.rail.drag.st);
else {
var n = Math.abs(n),
a = Math.abs(a),
d = w.opt.directionlockdeadzone;
if ("v" == w.rail.drag.ck) {
if (n > d && .3 * n >= a) return w.rail.drag = !1, !0;
a > d && (w.rail.drag.dl = "f", t("body").scrollTop(t("body").scrollTop()))
} else if ("h" == w.rail.drag.ck) {
if (a > d && .3 * a >= n) return w.rail.drag = !1, !0;
n > d && (w.rail.drag.dl = "f", t("body").scrollLeft(t("body").scrollLeft()))
}
}
if (w.synched("touchmove", function() {
w.rail.drag && 2 == w.rail.drag.pt && (w.prepareTransition && w.prepareTransition(0), w.rail.scrollable && w.setScrollTop(l), w.scrollmom.update(r, s), w.railh && w.railh.scrollable ? (w.setScrollLeft(c), w.showCursor(l, c)) : w.showCursor(l), b.isie10 && document.selection.clear())
}), b.ischrome && w.istouchcapable && (o = !1), o) return w.cancelEvent(e)
}
}
}
if (w.onmousedown = function(t, e) {
if (!w.rail.drag || 1 == w.rail.drag.pt) {
if (w.locked) return w.cancelEvent(t);
w.cancelScroll(), w.rail.drag = {
x: t.clientX,
y: t.clientY,
sx: w.scroll.x,
sy: w.scroll.y,
pt: 1,
hr: !!e
};
var i = w.getTarget(t);
return !w.ispage && b.hasmousecapture && i.setCapture(), w.isiframe && !b.hasmousecapture && (w.saved.csspointerevents = w.doc.css("pointer-events"), w.css(w.doc, {
"pointer-events": "none"
})), w.hasmoving = !1, w.cancelEvent(t)
}
}, w.onmouseup = function(t) {
return w.rail.drag && (b.hasmousecapture && document.releaseCapture(), w.isiframe && !b.hasmousecapture && w.doc.css("pointer-events", w.saved.csspointerevents), 1 == w.rail.drag.pt) ? (w.rail.drag = !1, w.hasmoving && w.triggerScrollEnd(), w.cancelEvent(t)) : void 0
}, w.onmousemove = function(t) {
if (w.rail.drag && 1 == w.rail.drag.pt) {
if (b.ischrome && 0 == t.which) return w.onmouseup(t);
if (w.cursorfreezed = !0, w.hasmoving = !0, w.rail.drag.hr) {
w.scroll.x = w.rail.drag.sx + (t.clientX - w.rail.drag.x), 0 > w.scroll.x && (w.scroll.x = 0);
var e = w.scrollvaluemaxw;
w.scroll.x > e && (w.scroll.x = e)
} else w.scroll.y = w.rail.drag.sy + (t.clientY - w.rail.drag.y), 0 > w.scroll.y && (w.scroll.y = 0), e = w.scrollvaluemax, w.scroll.y > e && (w.scroll.y = e);
return w.synched("mousemove", function() {
w.rail.drag && 1 == w.rail.drag.pt && (w.showCursor(), w.rail.drag.hr ? w.doScrollLeft(Math.round(w.scroll.x * w.scrollratio.x), w.opt.cursordragspeed) : w.doScrollTop(Math.round(w.scroll.y * w.scrollratio.y), w.opt.cursordragspeed))
}), w.cancelEvent(t)
}
}, b.cantouch || w.opt.touchbehavior) w.onpreventclick = function(t) {
return w.preventclick ? (w.preventclick.tg.onclick = w.preventclick.click, w.preventclick = !1, w.cancelEvent(t)) : void 0
}, w.bind(w.win, "mousedown", w.ontouchstart), w.onclick = b.isios ? !1 : function(t) {
return w.lastmouseup ? (w.lastmouseup = !1, w.cancelEvent(t)) : !0
}, w.opt.grabcursorenabled && b.cursorgrabvalue && (w.css(w.ispage ? w.doc : w.win, {
cursor: b.cursorgrabvalue
}), w.css(w.rail, {
cursor: b.cursorgrabvalue
}));
else {
var v = function(t) {
if (w.selectiondrag) {
if (t) {
var e = w.win.outerHeight();
t = t.pageY - w.selectiondrag.top, t > 0 && e > t && (t = 0), t >= e && (t -= e), w.selectiondrag.df = t
}
0 != w.selectiondrag.df && (w.doScrollBy(2 * -Math.floor(w.selectiondrag.df / 6)), w.debounced("doselectionscroll", function() {
v()
}, 50))
}
};
w.hasTextSelected = "getSelection" in document ? function() {
return 0 < document.getSelection().rangeCount
} : "selection" in document ? function() {
return "None" != document.selection.type
} : function() {
return !1
}, w.onselectionstart = function() {
w.ispage || (w.selectiondrag = w.win.offset())
}, w.onselectionend = function() {
w.selectiondrag = !1
}, w.onselectiondrag = function(t) {
w.selectiondrag && w.hasTextSelected() && w.debounced("selectionscroll", function() {
v(t)
}, 250)
}
}
b.hasmstouch && (w.css(w.rail, {
"-ms-touch-action": "none"
}), w.css(w.cursor, {
"-ms-touch-action": "none"
}), w.bind(w.win, "MSPointerDown", w.ontouchstart), w.bind(document, "MSPointerUp", w.ontouchend), w.bind(document, "MSPointerMove", w.ontouchmove), w.bind(w.cursor, "MSGestureHold", function(t) {
t.preventDefault()
}), w.bind(w.cursor, "contextmenu", function(t) {
t.preventDefault()
})), this.istouchcapable && (w.bind(w.win, "touchstart", w.ontouchstart), w.bind(document, "touchend", w.ontouchend), w.bind(document, "touchcancel", w.ontouchend), w.bind(document, "touchmove", w.ontouchmove)), w.bind(w.cursor, "mousedown", w.onmousedown), w.bind(w.cursor, "mouseup", w.onmouseup), w.railh && (w.bind(w.cursorh, "mousedown", function(t) {
w.onmousedown(t, !0)
}), w.bind(w.cursorh, "mouseup", w.onmouseup)), (w.opt.cursordragontouch || !b.cantouch && !w.opt.touchbehavior) && (w.rail.css({
cursor: "default"
}), w.railh && w.railh.css({
cursor: "default"
}), w.jqbind(w.rail, "mouseenter", function() {
return w.win.is(":visible") ? (w.canshowonmouseevent && w.showCursor(), void(w.rail.active = !0)) : !1
}), w.jqbind(w.rail, "mouseleave", function() {
w.rail.active = !1, w.rail.drag || w.hideCursor()
}), w.opt.sensitiverail && (w.bind(w.rail, "click", function(t) {
w.doRailClick(t, !1, !1)
}), w.bind(w.rail, "dblclick", function(t) {
w.doRailClick(t, !0, !1)
}), w.bind(w.cursor, "click", function(t) {
w.cancelEvent(t)
}), w.bind(w.cursor, "dblclick", function(t) {
w.cancelEvent(t)
})), w.railh && (w.jqbind(w.railh, "mouseenter", function() {
return w.win.is(":visible") ? (w.canshowonmouseevent && w.showCursor(), void(w.rail.active = !0)) : !1
}), w.jqbind(w.railh, "mouseleave", function() {
w.rail.active = !1, w.rail.drag || w.hideCursor()
}), w.opt.sensitiverail && (w.bind(w.railh, "click", function(t) {
w.doRailClick(t, !1, !0)
}), w.bind(w.railh, "dblclick", function(t) {
w.doRailClick(t, !0, !0)
}), w.bind(w.cursorh, "click", function(t) {
w.cancelEvent(t)
}), w.bind(w.cursorh, "dblclick", function(t) {
w.cancelEvent(t)
})))), b.cantouch || w.opt.touchbehavior ? (w.bind(b.hasmousecapture ? w.win : document, "mouseup", w.ontouchend), w.bind(document, "mousemove", w.ontouchmove), w.onclick && w.bind(document, "click", w.onclick), w.opt.cursordragontouch && (w.bind(w.cursor, "mousedown", w.onmousedown), w.bind(w.cursor, "mousemove", w.onmousemove), w.cursorh && w.bind(w.cursorh, "mousedown", function(t) {
w.onmousedown(t, !0)
}), w.cursorh && w.bind(w.cursorh, "mousemove", w.onmousemove))) : (w.bind(b.hasmousecapture ? w.win : document, "mouseup", w.onmouseup), w.bind(document, "mousemove", w.onmousemove), w.onclick && w.bind(document, "click", w.onclick), !w.ispage && w.opt.enablescrollonselection && (w.bind(w.win[0], "mousedown", w.onselectionstart), w.bind(document, "mouseup", w.onselectionend), w.bind(w.cursor, "mouseup", w.onselectionend), w.cursorh && w.bind(w.cursorh, "mouseup", w.onselectionend), w.bind(document, "mousemove", w.onselectiondrag)), w.zoom && (w.jqbind(w.zoom, "mouseenter", function() {
w.canshowonmouseevent && w.showCursor(), w.rail.active = !0
}), w.jqbind(w.zoom, "mouseleave", function() {
w.rail.active = !1, w.rail.drag || w.hideCursor()
}))), w.opt.enablemousewheel && (w.isiframe || w.bind(b.isie && w.ispage ? document : w.win, "mousewheel", w.onmousewheel), w.bind(w.rail, "mousewheel", w.onmousewheel), w.railh && w.bind(w.railh, "mousewheel", w.onmousewheelhr)), !w.ispage && !b.cantouch && !/HTML|^BODY/.test(w.win[0].nodeName) && (w.win.attr("tabindex") || w.win.attr({
tabindex: o++
}), w.jqbind(w.win, "focus", function(t) {
e = w.getTarget(t).id || !0, w.hasfocus = !0, w.canshowonmouseevent && w.noticeCursor()
}), w.jqbind(w.win, "blur", function() {
e = !1, w.hasfocus = !1
}), w.jqbind(w.win, "mouseenter", function(t) {
i = w.getTarget(t).id || !0, w.hasmousefocus = !0, w.canshowonmouseevent && w.noticeCursor()
}), w.jqbind(w.win, "mouseleave", function() {
i = !1, w.hasmousefocus = !1, w.rail.drag || w.hideCursor()
}))
}
if (w.onkeypress = function(o) {
if (w.locked && 0 == w.page.maxh) return !0;
o = o ? o : window.e;
var n = w.getTarget(o);
if (n && /INPUT|TEXTAREA|SELECT|OPTION/.test(n.nodeName) && (!n.getAttribute("type") && !n.type || !/submit|button|cancel/i.tp) || t(n).attr("contenteditable")) return !0;
if (w.hasfocus || w.hasmousefocus && !e || w.ispage && !e && !i) {
if (n = o.keyCode, w.locked && 27 != n) return w.cancelEvent(o);
var s = o.ctrlKey || !1,
r = o.shiftKey || !1,
a = !1;
switch (n) {
case 38:
case 63233:
w.doScrollBy(72), a = !0;
break;
case 40:
case 63235:
w.doScrollBy(-72), a = !0;
break;
case 37:
case 63232:
w.railh && (s ? w.doScrollLeft(0) : w.doScrollLeftBy(72), a = !0);
break;
case 39:
case 63234:
w.railh && (s ? w.doScrollLeft(w.page.maxw) : w.doScrollLeftBy(-72), a = !0);
break;
case 33:
case 63276:
w.doScrollBy(w.view.h), a = !0;
break;
case 34:
case 63277:
w.doScrollBy(-w.view.h), a = !0;
break;
case 36:
case 63273:
w.railh && s ? w.doScrollPos(0, 0) : w.doScrollTo(0), a = !0;
break;
case 35:
case 63275:
w.railh && s ? w.doScrollPos(w.page.maxw, w.page.maxh) : w.doScrollTo(w.page.maxh), a = !0;
break;
case 32:
w.opt.spacebarenabled && (w.doScrollBy(r ? w.view.h : -w.view.h), a = !0);
break;
case 27:
w.zoomactive && (w.doZoom(), a = !0)
}
if (a) return w.cancelEvent(o)
}
}, w.opt.enablekeyboard && w.bind(document, b.isopera && !b.isopera12 ? "keypress" : "keydown", w.onkeypress), w.bind(document, "keydown", function(t) {
t.ctrlKey && (w.wheelprevented = !0)
}), w.bind(document, "keyup", function(t) {
t.ctrlKey || (w.wheelprevented = !1)
}), w.bind(window, "resize", w.lazyResize), w.bind(window, "orientationchange", w.lazyResize), w.bind(window, "load", w.lazyResize), b.ischrome && !w.ispage && !w.haswrapper) {
var y = w.win.attr("style"),
a = parseFloat(w.win.css("width")) + 1;
w.win.css("width", a), w.synched("chromefix", function() {
w.win.attr("style", y)
})
}
w.onAttributeChange = function() {
w.lazyResize(250)
}, !w.ispage && !w.haswrapper && (!1 !== h ? (w.observer = new h(function(t) {
t.forEach(w.onAttributeChange)
}), w.observer.observe(w.win[0], {
childList: !0,
characterData: !1,
attributes: !0,
subtree: !1
}), w.observerremover = new h(function(t) {
t.forEach(function(t) {
if (0 < t.removedNodes.length)
for (var e in t.removedNodes)
if (t.removedNodes[e] == w.win[0]) return w.remove()
})
}), w.observerremover.observe(w.win[0].parentNode, {
childList: !0,
characterData: !1,
attributes: !1,
subtree: !1
})) : (w.bind(w.win, b.isie && !b.isie9 ? "propertychange" : "DOMAttrModified", w.onAttributeChange), b.isie9 && w.win[0].attachEvent("onpropertychange", w.onAttributeChange), w.bind(w.win, "DOMNodeRemoved", function(t) {
t.target == w.win[0] && w.remove()
}))), !w.ispage && w.opt.boxzoom && w.bind(window, "resize", w.resizeZoom), w.istextarea && w.bind(w.win, "mouseup", w.lazyResize), w.lazyResize(30)
}
if ("IFRAME" == this.doc[0].nodeName) {
var x = function(e) {
w.iframexd = !1;
try {
var i = "contentDocument" in this ? this.contentDocument : this.contentWindow.document
} catch (o) {
w.iframexd = !0, i = !1
}
return w.iframexd ? ("console" in window && console.log("NiceScroll error: policy restriced iframe"), !0) : (w.forcescreen = !0, w.isiframe && (w.iframe = {
doc: t(i),
html: w.doc.contents().find("html")[0],
body: w.doc.contents().find("body")[0]
}, w.getContentSize = function() {
return {
w: Math.max(w.iframe.html.scrollWidth, w.iframe.body.scrollWidth),
h: Math.max(w.iframe.html.scrollHeight, w.iframe.body.scrollHeight)
}
}, w.docscroll = t(w.iframe.body)), !b.isios && w.opt.iframeautoresize && !w.isiframe && (w.win.scrollTop(0), w.doc.height(""), e = Math.max(i.getElementsByTagName("html")[0].scrollHeight, i.body.scrollHeight), w.doc.height(e)), w.lazyResize(30), b.isie7 && w.css(t(w.iframe.html), {
"overflow-y": "hidden"
}), w.css(t(w.iframe.body), {
"overflow-y": "hidden"
}), b.isios && w.haswrapper && w.css(t(i.body), {
"-webkit-transform": "translate3d(0,0,0)"
}), "contentWindow" in this ? w.bind(this.contentWindow, "scroll", w.onscroll) : w.bind(i, "scroll", w.onscroll), w.opt.enablemousewheel && w.bind(i, "mousewheel", w.onmousewheel), w.opt.enablekeyboard && w.bind(i, b.isopera ? "keypress" : "keydown", w.onkeypress), (b.cantouch || w.opt.touchbehavior) && (w.bind(i, "mousedown", w.ontouchstart), w.bind(i, "mousemove", function(t) {
w.ontouchmove(t, !0)
}), w.opt.grabcursorenabled && b.cursorgrabvalue && w.css(t(i.body), {
cursor: b.cursorgrabvalue
})), w.bind(i, "mouseup", w.ontouchend), void(w.zoom && (w.opt.dblclickzoom && w.bind(i, "dblclick", w.doZoom), w.ongesturezoom && w.bind(i, "gestureend", w.ongesturezoom))))
};
this.doc[0].readyState && "complete" == this.doc[0].readyState && setTimeout(function() {
x.call(w.doc[0], !1)
}, 500), w.bind(this.doc, "load", x)
}
}, this.showCursor = function(t, e) {
w.cursortimeout && (clearTimeout(w.cursortimeout), w.cursortimeout = 0), w.rail && (w.autohidedom && (w.autohidedom.stop().css({
opacity: w.opt.cursoropacitymax
}), w.cursoractive = !0), w.rail.drag && 1 == w.rail.drag.pt || ("undefined" != typeof t && !1 !== t && (w.scroll.y = Math.round(1 * t / w.scrollratio.y)), "undefined" != typeof e && (w.scroll.x = Math.round(1 * e / w.scrollratio.x))), w.cursor.css({
height: w.cursorheight,
top: w.scroll.y
}), w.cursorh && (w.cursorh.css(!w.rail.align && w.rail.visibility ? {
width: w.cursorwidth,
left: w.scroll.x + w.rail.width
} : {
width: w.cursorwidth,
left: w.scroll.x
}), w.cursoractive = !0), w.zoom && w.zoom.stop().css({
opacity: w.opt.cursoropacitymax
}))
}, this.hideCursor = function(t) {
!w.cursortimeout && w.rail && w.autohidedom && !(w.hasmousefocus && "leave" == w.opt.autohidemode) && (w.cursortimeout = setTimeout(function() {
w.rail.active && w.showonmouseevent || (w.autohidedom.stop().animate({
opacity: w.opt.cursoropacitymin
}), w.zoom && w.zoom.stop().animate({
opacity: w.opt.cursoropacitymin
}), w.cursoractive = !1), w.cursortimeout = 0
}, t || w.opt.hidecursordelay))
}, this.noticeCursor = function(t, e, i) {
w.showCursor(e, i), w.rail.active || w.hideCursor(t)
}, this.getContentSize = w.ispage ? function() {
return {
w: Math.max(document.body.scrollWidth, document.documentElement.scrollWidth),
h: Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)
}
} : w.haswrapper ? function() {
return {
w: w.doc.outerWidth() + parseInt(w.win.css("paddingLeft")) + parseInt(w.win.css("paddingRight")),
h: w.doc.outerHeight() + parseInt(w.win.css("paddingTop")) + parseInt(w.win.css("paddingBottom"))
}
} : function() {
return {
w: w.docscroll[0].scrollWidth,
h: w.docscroll[0].scrollHeight
}
}, this.onResize = function(t, e) {
if (!w || !w.win) return !1;
if (!w.haswrapper && !w.ispage) {
if ("none" == w.win.css("display")) return w.visibility && w.hideRail().hideRailHr(), !1;
!w.hidden && !w.visibility && w.showRail().showRailHr()
}
var i = w.page.maxh,
o = w.page.maxw,
n = w.view.w;
if (w.view = {
w: w.ispage ? w.win.width() : parseInt(w.win[0].clientWidth),
h: w.ispage ? w.win.height() : parseInt(w.win[0].clientHeight)
}, w.page = e ? e : w.getContentSize(), w.page.maxh = Math.max(0, w.page.h - w.view.h), w.page.maxw = Math.max(0, w.page.w - w.view.w), w.page.maxh == i && w.page.maxw == o && w.view.w == n) {
if (w.ispage) return w;
if (i = w.win.offset(), w.lastposition && (o = w.lastposition, o.top == i.top && o.left == i.left)) return w;
w.lastposition = i
}
return 0 == w.page.maxh ? (w.hideRail(), w.scrollvaluemax = 0, w.scroll.y = 0, w.scrollratio.y = 0, w.cursorheight = 0, w.setScrollTop(0), w.rail.scrollable = !1) : w.rail.scrollable = !0, 0 == w.page.maxw ? (w.hideRailHr(), w.scrollvaluemaxw = 0, w.scroll.x = 0, w.scrollratio.x = 0, w.cursorwidth = 0, w.setScrollLeft(0), w.railh.scrollable = !1) : w.railh.scrollable = !0, w.locked = 0 == w.page.maxh && 0 == w.page.maxw, w.locked ? (w.ispage || w.updateScrollBar(w.view), !1) : (w.hidden || w.visibility ? !w.hidden && !w.railh.visibility && w.showRailHr() : w.showRail().showRailHr(), w.istextarea && w.win.css("resize") && "none" != w.win.css("resize") && (w.view.h -= 20), w.cursorheight = Math.min(w.view.h, Math.round(w.view.h * (w.view.h / w.page.h))), w.cursorheight = w.opt.cursorfixedheight ? w.opt.cursorfixedheight : Math.max(w.opt.cursorminheight, w.cursorheight), w.cursorwidth = Math.min(w.view.w, Math.round(w.view.w * (w.view.w / w.page.w))), w.cursorwidth = w.opt.cursorfixedheight ? w.opt.cursorfixedheight : Math.max(w.opt.cursorminheight, w.cursorwidth), w.scrollvaluemax = w.view.h - w.cursorheight - w.cursor.hborder, w.railh && (w.railh.width = 0 < w.page.maxh ? w.view.w - w.rail.width : w.view.w, w.scrollvaluemaxw = w.railh.width - w.cursorwidth - w.cursorh.wborder), w.ispage || w.updateScrollBar(w.view), w.scrollratio = {
x: w.page.maxw / w.scrollvaluemaxw,
y: w.page.maxh / w.scrollvaluemax
}, w.getScrollTop() > w.page.maxh ? w.doScrollTop(w.page.maxh) : (w.scroll.y = Math.round(w.getScrollTop() * (1 / w.scrollratio.y)), w.scroll.x = Math.round(w.getScrollLeft() * (1 / w.scrollratio.x)), w.cursoractive && w.noticeCursor()), w.scroll.y && 0 == w.getScrollTop() && w.doScrollTo(Math.floor(w.scroll.y * w.scrollratio.y)), w)
}, this.resize = w.onResize, this.lazyResize = function(t) {
return t = isNaN(t) ? 30 : t, w.delayed("resize", w.resize, t), w
}, this._bind = function(t, e, i, o) {
w.events.push({
e: t,
n: e,
f: i,
b: o,
q: !1
}), t.addEventListener ? t.addEventListener(e, i, o || !1) : t.attachEvent ? t.attachEvent("on" + e, i) : t["on" + e] = i
}, this.jqbind = function(e, i, o) {
w.events.push({
e: e,
n: i,
f: o,
q: !0
}), t(e).bind(i, o)
}, this.bind = function(t, e, i, o) {
var n = "jquery" in t ? t[0] : t;
"mousewheel" == e ? "onwheel" in w.win ? w._bind(n, "wheel", i, o || !1) : (t = "undefined" != typeof document.onmousewheel ? "mousewheel" : "DOMMouseScroll", m(n, t, i, o || !1), "DOMMouseScroll" == t && m(n, "MozMousePixelScroll", i, o || !1)) : n.addEventListener ? (b.cantouch && /mouseup|mousedown|mousemove/.test(e) && w._bind(n, "mousedown" == e ? "touchstart" : "mouseup" == e ? "touchend" : "touchmove", function(t) {
if (t.touches) {
if (2 > t.touches.length) {
var e = t.touches.length ? t.touches[0] : t;
e.original = t, i.call(this, e)
}
} else t.changedTouches && (e = t.changedTouches[0], e.original = t, i.call(this, e))
}, o || !1), w._bind(n, e, i, o || !1), b.cantouch && "mouseup" == e && w._bind(n, "touchcancel", i, o || !1)) : w._bind(n, e, function(t) {
return (t = t || window.event || !1) && t.srcElement && (t.target = t.srcElement), "pageY" in t || (t.pageX = t.clientX + document.documentElement.scrollLeft, t.pageY = t.clientY + document.documentElement.scrollTop), !1 === i.call(n, t) || !1 === o ? w.cancelEvent(t) : !0
})
}, this._unbind = function(t, e, i, o) {
t.removeEventListener ? t.removeEventListener(e, i, o) : t.detachEvent ? t.detachEvent("on" + e, i) : t["on" + e] = !1
}, this.unbindAll = function() {
for (var t = 0; t < w.events.length; t++) {
var e = w.events[t];
e.q ? e.e.unbind(e.n, e.f) : w._unbind(e.e, e.n, e.f, e.b)
}
}, this.cancelEvent = function(t) {
return (t = t.original ? t.original : t ? t : window.event || !1) ? (t.preventDefault && t.preventDefault(), t.stopPropagation && t.stopPropagation(), t.preventManipulation && t.preventManipulation(), t.cancelBubble = !0, t.cancel = !0, t.returnValue = !1) : !1
}, this.stopPropagation = function(t) {
return (t = t.original ? t.original : t ? t : window.event || !1) ? t.stopPropagation ? t.stopPropagation() : (t.cancelBubble && (t.cancelBubble = !0), !1) : !1
}, this.showRail = function() {
return 0 == w.page.maxh || !w.ispage && "none" == w.win.css("display") || (w.visibility = !0, w.rail.visibility = !0, w.rail.css("display", "block")), w
}, this.showRailHr = function() {
return w.railh ? (0 == w.page.maxw || !w.ispage && "none" == w.win.css("display") || (w.railh.visibility = !0, w.railh.css("display", "block")), w) : w
}, this.hideRail = function() {
return w.visibility = !1, w.rail.visibility = !1, w.rail.css("display", "none"), w
}, this.hideRailHr = function() {
return w.railh ? (w.railh.visibility = !1, w.railh.css("display", "none"), w) : w
}, this.show = function() {
return w.hidden = !1, w.locked = !1, w.showRail().showRailHr()
}, this.hide = function() {
return w.hidden = !0, w.locked = !0, w.hideRail().hideRailHr()
}, this.toggle = function() {
return w.hidden ? w.show() : w.hide()
}, this.remove = function() {
w.stop(), w.cursortimeout && clearTimeout(w.cursortimeout), w.doZoomOut(), w.unbindAll(), b.isie9 && w.win[0].detachEvent("onpropertychange", w.onAttributeChange), !1 !== w.observer && w.observer.disconnect(), !1 !== w.observerremover && w.observerremover.disconnect(), w.events = null, w.cursor && w.cursor.remove(), w.cursorh && w.cursorh.remove(), w.rail && w.rail.remove(), w.railh && w.railh.remove(), w.zoom && w.zoom.remove();
for (var e = 0; e < w.saved.css.length; e++) {
var i = w.saved.css[e];
i[0].css(i[1], "undefined" == typeof i[2] ? "" : i[2])
}
w.saved = !1, w.me.data("__nicescroll", "");
var o = t.nicescroll;
o.each(function(t) {
if (this && this.id === w.id) {
delete o[t];
for (var e = ++t; e < o.length; e++, t++) o[t] = o[e];
o.length--, o.length && delete o[o.length]
}
});
for (var n in w) w[n] = null, delete w[n];
w = null
}, this.scrollstart = function(t) {
return this.onscrollstart = t, w
}, this.scrollend = function(t) {
return this.onscrollend = t, w
}, this.scrollcancel = function(t) {
return this.onscrollcancel = t, w
}, this.zoomin = function(t) {
return this.onzoomin = t, w
}, this.zoomout = function(t) {
return this.onzoomout = t, w
}, this.isScrollable = function(e) {
if (e = e.target ? e.target : e, "OPTION" == e.nodeName) return !0;
for (; e && 1 == e.nodeType && !/^BODY|HTML/.test(e.nodeName);) {
var i = t(e),
i = i.css("overflowY") || i.css("overflowX") || i.css("overflow") || "";
if (/scroll|auto/.test(i)) return e.clientHeight != e.scrollHeight;
e = e.parentNode ? e.parentNode : !1
}
return !1
}, this.getViewport = function(e) {
for (e = e && e.parentNode ? e.parentNode : !1; e && 1 == e.nodeType && !/^BODY|HTML/.test(e.nodeName);) {
var i = t(e);
if (/fixed|absolute/.test(i.css("position"))) return i;
var o = i.css("overflowY") || i.css("overflowX") || i.css("overflow") || "";
if (/scroll|auto/.test(o) && e.clientHeight != e.scrollHeight || 0 < i.getNiceScroll().length) return i;
e = e.parentNode ? e.parentNode : !1
}
return e ? t(e) : !1
}, this.triggerScrollEnd = function() {
if (w.onscrollend) {
var t = w.getScrollLeft(),
e = w.getScrollTop();
w.onscrollend.call(w, {
type: "scrollend",
current: {
x: t,
y: e
},
end: {
x: t,
y: e
}
})
}
}, this.onmousewheel = function(t) {
if (!w.wheelprevented) {
if (w.locked) return w.debounced("checkunlock", w.resize, 250), !0;
if (w.rail.drag) return w.cancelEvent(t);
if ("auto" == w.opt.oneaxismousemode && 0 != t.deltaX && (w.opt.oneaxismousemode = !1), w.opt.oneaxismousemode && 0 == t.deltaX && !w.rail.scrollable) return w.railh && w.railh.scrollable ? w.onmousewheelhr(t) : !0;
var e = +new Date,
i = !1;
return w.opt.preservenativescrolling && w.checkarea + 600 < e && (w.nativescrollingarea = w.isScrollable(t), i = !0), w.checkarea = e, w.nativescrollingarea ? !0 : ((t = v(t, !1, i)) && (w.checkarea = 0), t)
}
}, this.onmousewheelhr = function(t) {
if (!w.wheelprevented) {
if (w.locked || !w.railh.scrollable) return !0;
if (w.rail.drag) return w.cancelEvent(t);
var e = +new Date,
i = !1;
return w.opt.preservenativescrolling && w.checkarea + 600 < e && (w.nativescrollingarea = w.isScrollable(t), i = !0), w.checkarea = e, w.nativescrollingarea ? !0 : w.locked ? w.cancelEvent(t) : v(t, !0, i)
}
}, this.stop = function() {
return w.cancelScroll(), w.scrollmon && w.scrollmon.stop(), w.cursorfreezed = !1, w.scroll.y = Math.round(w.getScrollTop() * (1 / w.scrollratio.y)), w.noticeCursor(), w
}, this.getTransitionSpeed = function(t) {
var e = Math.round(10 * w.opt.scrollspeed);
return t = Math.min(e, Math.round(t / 20 * w.opt.scrollspeed)), t > 20 ? t : 0
}, w.opt.smoothscroll ? w.ishwscroll && b.hastransition && w.opt.usetransition ? (this.prepareTransition = function(t, e) {
var i = e ? t > 20 ? t : 0 : w.getTransitionSpeed(t),
o = i ? b.prefixstyle + "transform " + i + "ms ease-out" : "";
return w.lasttransitionstyle && w.lasttransitionstyle == o || (w.lasttransitionstyle = o, w.doc.css(b.transitionstyle, o)), i
}, this.doScrollLeft = function(t, e) {
var i = w.scrollrunning ? w.newscrolly : w.getScrollTop();
w.doScrollPos(t, i, e)
}, this.doScrollTop = function(t, e) {
var i = w.scrollrunning ? w.newscrollx : w.getScrollLeft();
w.doScrollPos(i, t, e)
}, this.doScrollPos = function(t, e, i) {
var o = w.getScrollTop(),
n = w.getScrollLeft();
return (0 > (w.newscrolly - o) * (e - o) || 0 > (w.newscrollx - n) * (t - n)) && w.cancelScroll(), 0 == w.opt.bouncescroll && (0 > e ? e = 0 : e > w.page.maxh && (e = w.page.maxh), 0 > t ? t = 0 : t > w.page.maxw && (t = w.page.maxw)), w.scrollrunning && t == w.newscrollx && e == w.newscrolly ? !1 : (w.newscrolly = e, w.newscrollx = t, w.newscrollspeed = i || !1, w.timer ? !1 : void(w.timer = setTimeout(function() {
var i, o, n = w.getScrollTop(),
s = w.getScrollLeft();
i = t - s, o = e - n, i = Math.round(Math.sqrt(Math.pow(i, 2) + Math.pow(o, 2))), i = w.newscrollspeed && 1 < w.newscrollspeed ? w.newscrollspeed : w.getTransitionSpeed(i), w.newscrollspeed && 1 >= w.newscrollspeed && (i *= w.newscrollspeed), w.prepareTransition(i, !0), w.timerscroll && w.timerscroll.tm && clearInterval(w.timerscroll.tm), i > 0 && (!w.scrollrunning && w.onscrollstart && w.onscrollstart.call(w, {
type: "scrollstart",
current: {
x: s,
y: n
},
request: {
x: t,
y: e
},
end: {
x: w.newscrollx,
y: w.newscrolly
},
speed: i
}), b.transitionend ? w.scrollendtrapped || (w.scrollendtrapped = !0, w.bind(w.doc, b.transitionend, w.onScrollTransitionEnd, !1)) : (w.scrollendtrapped && clearTimeout(w.scrollendtrapped), w.scrollendtrapped = setTimeout(w.onScrollTransitionEnd, i)), w.timerscroll = {
bz: new BezierClass(n, w.newscrolly, i, 0, 0, .58, 1),
bh: new BezierClass(s, w.newscrollx, i, 0, 0, .58, 1)
}, w.cursorfreezed || (w.timerscroll.tm = setInterval(function() {
w.showCursor(w.getScrollTop(), w.getScrollLeft())
}, 60))), w.synched("doScroll-set", function() {
w.timer = 0, w.scrollendtrapped && (w.scrollrunning = !0), w.setScrollTop(w.newscrolly), w.setScrollLeft(w.newscrollx), w.scrollendtrapped || w.onScrollTransitionEnd()
})
}, 50)))
}, this.cancelScroll = function() {
if (!w.scrollendtrapped) return !0;
var t = w.getScrollTop(),
e = w.getScrollLeft();
return w.scrollrunning = !1, b.transitionend || clearTimeout(b.transitionend), w.scrollendtrapped = !1, w._unbind(w.doc, b.transitionend, w.onScrollTransitionEnd), w.prepareTransition(0), w.setScrollTop(t), w.railh && w.setScrollLeft(e), w.timerscroll && w.timerscroll.tm && clearInterval(w.timerscroll.tm), w.timerscroll = !1, w.cursorfreezed = !1, w.showCursor(t, e), w
}, this.onScrollTransitionEnd = function() {
w.scrollendtrapped && w._unbind(w.doc, b.transitionend, w.onScrollTransitionEnd), w.scrollendtrapped = !1, w.prepareTransition(0), w.timerscroll && w.timerscroll.tm && clearInterval(w.timerscroll.tm), w.timerscroll = !1;
var t = w.getScrollTop(),
e = w.getScrollLeft();
return w.setScrollTop(t), w.railh && w.setScrollLeft(e), w.noticeCursor(!1, t, e), w.cursorfreezed = !1, 0 > t ? t = 0 : t > w.page.maxh && (t = w.page.maxh), 0 > e ? e = 0 : e > w.page.maxw && (e = w.page.maxw), t != w.newscrolly || e != w.newscrollx ? w.doScrollPos(e, t, w.opt.snapbackspeed) : (w.onscrollend && w.scrollrunning && w.triggerScrollEnd(), void(w.scrollrunning = !1))
}) : (this.doScrollLeft = function(t, e) {
var i = w.scrollrunning ? w.newscrolly : w.getScrollTop();
w.doScrollPos(t, i, e)
}, this.doScrollTop = function(t, e) {
var i = w.scrollrunning ? w.newscrollx : w.getScrollLeft();
w.doScrollPos(i, t, e)
}, this.doScrollPos = function(t, e, i) {
function o() {
if (w.cancelAnimationFrame) return !0;
if (w.scrollrunning = !0, h = 1 - h) return w.timer = a(o) || 1;
var t = 0,
e = sy = w.getScrollTop();
if (w.dst.ay) {
var e = w.bzscroll ? w.dst.py + w.bzscroll.getNow() * w.dst.ay : w.newscrolly,
i = e - sy;
(0 > i && e < w.newscrolly || i > 0 && e > w.newscrolly) && (e = w.newscrolly), w.setScrollTop(e), e == w.newscrolly && (t = 1)
} else t = 1;
var n = sx = w.getScrollLeft();
w.dst.ax ? (n = w.bzscroll ? w.dst.px + w.bzscroll.getNow() * w.dst.ax : w.newscrollx, i = n - sx, (0 > i && n < w.newscrollx || i > 0 && n > w.newscrollx) && (n = w.newscrollx), w.setScrollLeft(n), n == w.newscrollx && (t += 1)) : t += 1, 2 == t ? (w.timer = 0, w.cursorfreezed = !1, w.bzscroll = !1, w.scrollrunning = !1, 0 > e ? e = 0 : e > w.page.maxh && (e = w.page.maxh), 0 > n ? n = 0 : n > w.page.maxw && (n = w.page.maxw), n != w.newscrollx || e != w.newscrolly ? w.doScrollPos(n, e) : w.onscrollend && w.triggerScrollEnd()) : w.timer = a(o) || 1
}
if (e = "undefined" == typeof e || !1 === e ? w.getScrollTop(!0) : e, w.timer && w.newscrolly == e && w.newscrollx == t) return !0;
w.timer && l(w.timer), w.timer = 0;
var n = w.getScrollTop(),
s = w.getScrollLeft();
(0 > (w.newscrolly - n) * (e - n) || 0 > (w.newscrollx - s) * (t - s)) && w.cancelScroll(), w.newscrolly = e, w.newscrollx = t, w.bouncescroll && w.rail.visibility || (0 > w.newscrolly ? w.newscrolly = 0 : w.newscrolly > w.page.maxh && (w.newscrolly = w.page.maxh)), w.bouncescroll && w.railh.visibility || (0 > w.newscrollx ? w.newscrollx = 0 : w.newscrollx > w.page.maxw && (w.newscrollx = w.page.maxw)), w.dst = {}, w.dst.x = t - s, w.dst.y = e - n, w.dst.px = s, w.dst.py = n;
var r = Math.round(Math.sqrt(Math.pow(w.dst.x, 2) + Math.pow(w.dst.y, 2)));
w.dst.ax = w.dst.x / r, w.dst.ay = w.dst.y / r;
var c = 0,
d = r;
if (0 == w.dst.x ? (c = n, d = e, w.dst.ay = 1, w.dst.py = 0) : 0 == w.dst.y && (c = s, d = t, w.dst.ax = 1, w.dst.px = 0), r = w.getTransitionSpeed(r), i && 1 >= i && (r *= i), w.bzscroll = r > 0 ? w.bzscroll ? w.bzscroll.update(d, r) : new BezierClass(c, d, r, 0, 1, 0, 1) : !1, !w.timer) {
(n == w.page.maxh && e >= w.page.maxh || s == w.page.maxw && t >= w.page.maxw) && w.checkContentSize();
var h = 1;
w.cancelAnimationFrame = !1, w.timer = 1, w.onscrollstart && !w.scrollrunning && w.onscrollstart.call(w, {
type: "scrollstart",
current: {
x: s,
y: n
},
request: {
x: t,
y: e
},
end: {
x: w.newscrollx,
y: w.newscrolly
},
speed: r
}), o(), (n == w.page.maxh && e >= n || s == w.page.maxw && t >= s) && w.checkContentSize(), w.noticeCursor()
}
}, this.cancelScroll = function() {
return w.timer && l(w.timer), w.timer = 0, w.bzscroll = !1, w.scrollrunning = !1, w
}) : (this.doScrollLeft = function(t, e) {
var i = w.getScrollTop();
w.doScrollPos(t, i, e)
}, this.doScrollTop = function(t, e) {
var i = w.getScrollLeft();
w.doScrollPos(i, t, e)
}, this.doScrollPos = function(t, e) {
var i = t > w.page.maxw ? w.page.maxw : t;
0 > i && (i = 0);
var o = e > w.page.maxh ? w.page.maxh : e;
0 > o && (o = 0), w.synched("scroll", function() {
w.setScrollTop(o), w.setScrollLeft(i)
})
}, this.cancelScroll = function() {}), this.doScrollBy = function(t, e) {
var i = 0,
i = e ? Math.floor((w.scroll.y - t) * w.scrollratio.y) : (w.timer ? w.newscrolly : w.getScrollTop(!0)) - t;
if (w.bouncescroll) {
var o = Math.round(w.view.h / 2); - o > i ? i = -o : i > w.page.maxh + o && (i = w.page.maxh + o)
}
return w.cursorfreezed = !1, py = w.getScrollTop(!0), 0 > i && 0 >= py ? w.noticeCursor() : i > w.page.maxh && py >= w.page.maxh ? (w.checkContentSize(), w.noticeCursor()) : void w.doScrollTop(i)
}, this.doScrollLeftBy = function(t, e) {
var i = 0,
i = e ? Math.floor((w.scroll.x - t) * w.scrollratio.x) : (w.timer ? w.newscrollx : w.getScrollLeft(!0)) - t;
if (w.bouncescroll) {
var o = Math.round(w.view.w / 2); - o > i ? i = -o : i > w.page.maxw + o && (i = w.page.maxw + o)
}
return w.cursorfreezed = !1, px = w.getScrollLeft(!0), 0 > i && 0 >= px || i > w.page.maxw && px >= w.page.maxw ? w.noticeCursor() : void w.doScrollLeft(i)
}, this.doScrollTo = function(t, e) {
e && Math.round(t * w.scrollratio.y), w.cursorfreezed = !1, w.doScrollTop(t)
}, this.checkContentSize = function() {
var t = w.getContentSize();
(t.h != w.page.h || t.w != w.page.w) && w.resize(!1, t)
}, w.onscroll = function() {
w.rail.drag || w.cursorfreezed || w.synched("scroll", function() {
w.scroll.y = Math.round(w.getScrollTop() * (1 / w.scrollratio.y)), w.railh && (w.scroll.x = Math.round(w.getScrollLeft() * (1 / w.scrollratio.x))), w.noticeCursor()
})
}, w.bind(w.docscroll, "scroll", w.onscroll), this.doZoomIn = function(e) {
if (!w.zoomactive) {
w.zoomactive = !0, w.zoomrestore = {
style: {}
};
var i, o = "position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),
n = w.win[0].style;
for (i in o) {
var r = o[i];
w.zoomrestore.style[r] = "undefined" != typeof n[r] ? n[r] : ""
}
return w.zoomrestore.style.width = w.win.css("width"), w.zoomrestore.style.height = w.win.css("height"), w.zoomrestore.padding = {
w: w.win.outerWidth() - w.win.width(),
h: w.win.outerHeight() - w.win.height()
}, b.isios4 && (w.zoomrestore.scrollTop = t(window).scrollTop(), t(window).scrollTop(0)), w.win.css({
position: b.isios4 ? "absolute" : "fixed",
top: 0,
left: 0,
"z-index": s + 100,
margin: "0px"
}), o = w.win.css("backgroundColor"), ("" == o || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(o)) && w.win.css("backgroundColor", "#fff"), w.rail.css({
"z-index": s + 101
}), w.zoom.css({
"z-index": s + 102
}), w.zoom.css("backgroundPosition", "0px -18px"), w.resizeZoom(), w.onzoomin && w.onzoomin.call(w), w.cancelEvent(e)
}
}, this.doZoomOut = function(e) {
return w.zoomactive ? (w.zoomactive = !1, w.win.css("margin", ""), w.win.css(w.zoomrestore.style), b.isios4 && t(window).scrollTop(w.zoomrestore.scrollTop), w.rail.css({
"z-index": w.zindex
}), w.zoom.css({
"z-index": w.zindex
}), w.zoomrestore = !1, w.zoom.css("backgroundPosition", "0px 0px"), w.onResize(), w.onzoomout && w.onzoomout.call(w), w.cancelEvent(e)) : void 0
}, this.doZoom = function(t) {
return w.zoomactive ? w.doZoomOut(t) : w.doZoomIn(t)
}, this.resizeZoom = function() {
if (w.zoomactive) {
var e = w.getScrollTop();
w.win.css({
width: t(window).width() - w.zoomrestore.padding.w + "px",
height: t(window).height() - w.zoomrestore.padding.h + "px"
}), w.onResize(), w.setScrollTop(Math.min(w.page.maxh, e))
}
}, this.init(), t.nicescroll.push(this)
},
g = function(t) {
var e = this;
this.nc = t, this.steptime = this.lasttime = this.speedy = this.speedx = this.lasty = this.lastx = 0, this.snapy = this.snapx = !1, this.demuly = this.demulx = 0, this.lastscrolly = this.lastscrollx = -1, this.timer = this.chky = this.chkx = 0, this.time = function() {
return +new Date
}, this.reset = function(t, i) {
e.stop();
var o = e.time();
e.steptime = 0, e.lasttime = o, e.speedx = 0, e.speedy = 0, e.lastx = t, e.lasty = i, e.lastscrollx = -1, e.lastscrolly = -1
}, this.update = function(t, i) {
var o = e.time();
e.steptime = o - e.lasttime, e.lasttime = o;
var o = i - e.lasty,
n = t - e.lastx,
s = e.nc.getScrollTop(),
r = e.nc.getScrollLeft(),
s = s + o,
r = r + n;
e.snapx = 0 > r || r > e.nc.page.maxw, e.snapy = 0 > s || s > e.nc.page.maxh, e.speedx = n, e.speedy = o, e.lastx = t, e.lasty = i
}, this.stop = function() {
e.nc.unsynched("domomentum2d"), e.timer && clearTimeout(e.timer), e.timer = 0, e.lastscrollx = -1, e.lastscrolly = -1
}, this.doSnapy = function(t, i) {
var o = !1;
0 > i ? (i = 0, o = !0) : i > e.nc.page.maxh && (i = e.nc.page.maxh, o = !0), 0 > t ? (t = 0, o = !0) : t > e.nc.page.maxw && (t = e.nc.page.maxw, o = !0), o ? e.nc.doScrollPos(t, i, e.nc.opt.snapbackspeed) : e.nc.triggerScrollEnd()
}, this.doMomentum = function(t) {
var i = e.time(),
o = t ? i + t : e.lasttime;
t = e.nc.getScrollLeft();
var n = e.nc.getScrollTop(),
s = e.nc.page.maxh,
r = e.nc.page.maxw;
if (e.speedx = r > 0 ? Math.min(60, e.speedx) : 0, e.speedy = s > 0 ? Math.min(60, e.speedy) : 0, o = o && 60 >= i - o, (0 > n || n > s || 0 > t || t > r) && (o = !1), t = e.speedx && o ? e.speedx : !1, e.speedy && o && e.speedy || t) {
var a = Math.max(16, e.steptime);
a > 50 && (t = a / 50, e.speedx *= t, e.speedy *= t, a = 50), e.demulxy = 0, e.lastscrollx = e.nc.getScrollLeft(), e.chkx = e.lastscrollx, e.lastscrolly = e.nc.getScrollTop(), e.chky = e.lastscrolly;
var l = e.lastscrollx,
c = e.lastscrolly,
d = function() {
var t = 600 < e.time() - i ? .04 : .02;
e.speedx && (l = Math.floor(e.lastscrollx - e.speedx * (1 - e.demulxy)), e.lastscrollx = l, 0 > l || l > r) && (t = .1), e.speedy && (c = Math.floor(e.lastscrolly - e.speedy * (1 - e.demulxy)), e.lastscrolly = c, 0 > c || c > s) && (t = .1), e.demulxy = Math.min(1, e.demulxy + t), e.nc.synched("domomentum2d", function() {
e.speedx && (e.nc.getScrollLeft() != e.chkx && e.stop(), e.chkx = l, e.nc.setScrollLeft(l)), e.speedy && (e.nc.getScrollTop() != e.chky && e.stop(), e.chky = c, e.nc.setScrollTop(c)), e.timer || (e.nc.hideCursor(), e.doSnapy(l, c))
}), 1 > e.demulxy ? e.timer = setTimeout(d, a) : (e.stop(), e.nc.hideCursor(), e.doSnapy(l, c))
};
d()
} else e.doSnapy(e.nc.getScrollLeft(), e.nc.getScrollTop())
}
},
v = t.fn.scrollTop;
t.cssHooks.pageYOffset = {
get: function(e, i) {
return (i = t.data(e, "__nicescroll") || !1) && i.ishwscroll ? i.getScrollTop() : v.call(e)
},
set: function(e, i) {
var o = t.data(e, "__nicescroll") || !1;
return o && o.ishwscroll ? o.setScrollTop(parseInt(i)) : v.call(e, i), this
}
}, t.fn.scrollTop = function(e) {
if ("undefined" == typeof e) {
var i = this[0] ? t.data(this[0], "__nicescroll") || !1 : !1;
return i && i.ishwscroll ? i.getScrollTop() : v.call(this)
}
return this.each(function() {
var i = t.data(this, "__nicescroll") || !1;
i && i.ishwscroll ? i.setScrollTop(parseInt(e)) : v.call(t(this), e)
})
};
var w = t.fn.scrollLeft;
t.cssHooks.pageXOffset = {
get: function(e, i) {
return (i = t.data(e, "__nicescroll") || !1) && i.ishwscroll ? i.getScrollLeft() : w.call(e)
},
set: function(e, i) {
var o = t.data(e, "__nicescroll") || !1;
return o && o.ishwscroll ? o.setScrollLeft(parseInt(i)) : w.call(e, i), this
}
}, t.fn.scrollLeft = function(e) {
if ("undefined" == typeof e) {
var i = this[0] ? t.data(this[0], "__nicescroll") || !1 : !1;
return i && i.ishwscroll ? i.getScrollLeft() : w.call(this)
}
return this.each(function() {
var i = t.data(this, "__nicescroll") || !1;
i && i.ishwscroll ? i.setScrollLeft(parseInt(e)) : w.call(t(this), e)
})
};
var y = function(e) {
var i = this;
if (this.length = 0, this.name = "nicescrollarray", this.each = function(t) {
for (var e = 0, o = 0; e < i.length; e++) t.call(i[e], o++);
return i
}, this.push = function(t) {
i[i.length] = t, i.length++
}, this.eq = function(t) {
return i[t]
}, e)
for (var o = 0; o < e.length; o++) {
var n = t.data(e[o], "__nicescroll") || !1;
n && (this[this.length] = n, this.length++)
}
return this
};
! function(t, e, i) {
for (var o = 0; o < e.length; o++) i(t, e[o])
}(y.prototype, "show hide toggle onResize resize remove stop doScrollPos".split(" "), function(t, e) {
t[e] = function() {
var t = arguments;
return this.each(function() {
this[e].apply(this, t)
})
}
}), t.fn.getNiceScroll = function(e) {
return "undefined" == typeof e ? new y(this) : this[e] && t.data(this[e], "__nicescroll") || !1
}, t.extend(t.expr[":"], {
nicescroll: function(e) {
return t.data(e, "__nicescroll") ? !0 : !1
}
}), t.fn.niceScroll = function(e, i) {
"undefined" == typeof i && "object" == typeof e && !("jquery" in e) && (i = e, e = !1);
var o = new y;
"undefined" == typeof i && (i = {}), e && (i.doc = t(e), i.win = t(this));
var n = !("doc" in i);
return !n && !("win" in i) && (i.win = t(this)), this.each(function() {
var e = t(this).data("__nicescroll") || !1;
e || (i.doc = n ? t(this) : i.doc, e = new m(i, t(this)), t(this).data("__nicescroll", e)), o.push(e)
}), 1 == o.length ? o[0] : o
}, window.NiceScroll = {
getjQuery: function() {
return t
}
}, t.nicescroll || (t.nicescroll = new y, t.nicescroll.options = u)
}), function(t, e, i) {
var o = function(o, n) {
this.elem = o, this.$elem = t(o), this.options = n, this.metadata = this.$elem.data("plugin-options"), this.$win = t(e), this.sections = {}, this.didScroll = !1, this.$doc = t(i), this.docHeight = this.$doc.height()
};
o.prototype = {
defaults: {
navItems: "a",
currentClass: "current",
changeHash: !1,
easing: "swing",
filter: "",
scrollSpeed: 750,
scrollOffset: 95,
begin: !1,
end: !1,
scrollChange: !1
},
init: function() {
return this.config = t.extend({}, this.defaults, this.options, this.metadata), this.$nav = this.$elem.find(this.config.navItems), "" !== this.config.filter && (this.$nav = this.$nav.filter(this.config.filter)), this.$nav.on("click.onePageNav", t.proxy(this.handleClick, this)), this.getPositions(), this.bindInterval(), this.$win.on("resize.onePageNav", t.proxy(this.getPositions, this)), this
},
adjustNav: function(t, e) {
t.$elem.find("." + t.config.currentClass).removeClass(t.config.currentClass), e.addClass(t.config.currentClass)
},
bindInterval: function() {
var t, e = this;
e.$win.on("scroll.onePageNav", function() {
e.didScroll = !0
}), e.t = setInterval(function() {
t = e.$doc.height(), e.didScroll && (e.didScroll = !1, e.scrollChange()), t !== e.docHeight && (e.docHeight = t, e.getPositions())
}, 250)
},
getHash: function(t) {
return t.attr("href").split("#")[1]
},
getPositions: function() {
var e, i, o, n = this;
n.$nav.each(function() {
e = n.getHash(t(this)), o = t("#" + e), o.length && (i = o.offset().top, n.sections[e] = Math.round(i))
})
},
getSection: function(t) {
var e = null,
i = Math.round(this.$win.height() * this.config.scrollThreshold);
for (var o in this.sections) this.sections[o] - i < t && (e = o);
return e
},
handleClick: function(i) {
var o = this,
n = t(i.currentTarget),
s = n.parent(),
r = "#" + o.getHash(n);
s.hasClass(o.config.currentClass) || (o.config.begin && o.config.begin(), o.adjustNav(o, s), o.unbindInterval(), o.scrollTo(r, function() {
o.config.changeHash && (e.location.hash = r), o.bindInterval(), o.config.end && o.config.end()
})), i.preventDefault()
},
scrollChange: function() {
var t, e = this.$win.scrollTop(),
i = this.getSection(e);
null !== i && (t = this.$elem.find('a[href$="#' + i + '"]').parent(), t.hasClass(this.config.currentClass) || (this.adjustNav(this, t), this.config.scrollChange && this.config.scrollChange(t)))
},
scrollTo: function(e, i) {
var o = t(e).offset().top;
t("html, body").animate({
scrollTop: o
}, this.config.scrollSpeed, this.config.easing, i)
},
unbindInterval: function() {
clearInterval(this.t), this.$win.unbind("scroll.onePageNav")
}
}, o.defaults = o.prototype.defaults, t.fn.onePageNav = function(t) {
return this.each(function() {
new o(this, t).init()
})
}
}(jQuery, window, document), function() {
var t = $(".navbar"),
e = !1;
$(window).scroll(function() {
300 < $(window).scrollTop() && !e && (t.addClass("bg-change animated"), e = !0), 300 > $(window).scrollTop() && e && (t.removeClass("bg-change animated"), e = !1)
})
}(), jQuery(window).on("scroll", function() {
"use strict";
jQuery(this).scrollTop() > 100 ? jQuery("#scroll-to-top").fadeIn("slow") : jQuery("#scroll-to-top").fadeOut("slow")
}), $("#scroll-to-top").click(function() {
return $("html,body").animate({
scrollTop: 0
}, 1500), !1
}), jQuery(window).load(function() {
$(window).stellar({
horizontalScrolling: !1,
responsive: !0
})
}), jQuery(document).ready(function() {
"use strict";
function t() {
return navigator.userAgent.match(/Trident\/7\./) ? 11 : void 0
}
$(".counter").counterUp({
delay: 10,
time: 3e3
}), $(".image-popup-vertical-fit").magnificPopup({
type: "image",
gallery: {
enabled: !0
}
});
var e = new WOW({
boxClass: "wow",
animateClass: "animated",
offset: 0,
mobile: !1
});
e.init(), 11 != t() && $("html").niceScroll({
cursorcolor: "#e74c3c",
zindex: "99999",
cursorminheight: 60,
scrollspeed: 80,
cursorwidth: 7,
autohidemode: !0,
background: "#aaa",
cursorborder: "none",
cursoropacitymax: .7,
cursorborderradius: 0,
horizrailenabled: !1
});
var i = $("#project-items"),
o = function() {
var t = i.width(),
e = 1,
o = 0;
return t > 960 ? e = 4 : t > 640 ? e = 2 : t > 480 ? e = 2 : t > 360 && (e = 1), o = Math.floor(t / e), i.find(".item").each(function() {
var t = $(this),
e = t.attr("class").match(/item-w(\d)/),
i = t.attr("class").match(/item-h(\d)/),
n = e ? o * e[1] : o,
s = i ? o * i[1] * .7 - 10 : .7 * o - 10;
t.css({
width: n,
height: s
})
}), o
},
n = function() {
i.isotope({
resizable: !0,
itemSelector: ".item",
masonry: {
columnWidth: o(),
gutterWidth: 10
}
})
};
n(), $(window).smartresize(n), $(".itemFilter a").click(function() {
$(".itemFilter .current").removeClass("current"), $(this).addClass("current");
var t = $(this).attr("data-filter");
return i.isotope({
filter: t,
animationOptions: {
duration: 750,
easing: "linear",
queue: !1
}
}), !1
})
}), navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")), document.querySelector("head").appendChild(msViewportStyle)
}! function() {
for (var t, e = function() {}, i = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeline", "timelineEnd", "timeStamp", "trace", "warn"], o = i.length, n = window.console = window.console || {}; o--;) t = i[o], n[t] || (n[t] = e)
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment