3-js edit

wm-plugins-js  edit

Copy
Edit
<!-- components/3-js/wm-plugins-js.php -->
Copy
Copy
Edit
/* scss/3-js/_wm-plugins-js.scss */
Copy
Edit
/* js/wm-plugins-js.js */ /* * jQuery FlexSlider v2.6.1 * Copyright 2012 WooThemes * Contributing Author: Tyler Smith */ !(function ($) { var e = !0; ($.flexslider = function (t, a) { var n = $(t); n.vars = $.extend({}, $.flexslider.defaults, a); var i = n.vars.namespace, s = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, r = ("ontouchstart" in window || s || (window.DocumentTouch && document instanceof DocumentTouch)) && n.vars.touch, o = "click touchend MSPointerUp keyup", l = "", c, d = "vertical" === n.vars.direction, u = n.vars.reverse, v = n.vars.itemWidth > 0, p = "fade" === n.vars.animation, m = "" !== n.vars.asNavFor, f = {}; $.data(t, "flexslider", n), (f = { init: function () { (n.animating = !1), (n.currentSlide = parseInt( n.vars.startAt ? n.vars.startAt : 0, 10 )), isNaN(n.currentSlide) && (n.currentSlide = 0), (n.animatingTo = n.currentSlide), (n.atEnd = 0 === n.currentSlide || n.currentSlide === n.last), (n.containerSelector = n.vars.selector.substr( 0, n.vars.selector.search(" ") )), (n.slides = $(n.vars.selector, n)), (n.container = $(n.containerSelector, n)), (n.count = n.slides.length), (n.syncExists = $(n.vars.sync).length > 0), "slide" === n.vars.animation && (n.vars.animation = "swing"), (n.prop = d ? "top" : "marginLeft"), (n.args = {}), (n.manualPause = !1), (n.stopped = !1), (n.started = !1), (n.startTimeout = null), (n.transitions = !n.vars.video && !p && n.vars.useCSS && (function () { var e = document.createElement("div"), t = [ "perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective", ]; for (var a in t) if (void 0 !== e.style[t[a]]) return ( (n.pfx = t[a].replace("Perspective", "").toLowerCase()), (n.prop = "-" + n.pfx + "-transform"), !0 ); return !1; })()), (n.ensureAnimationEnd = ""), "" !== n.vars.controlsContainer && (n.controlsContainer = $(n.vars.controlsContainer).length > 0 && $(n.vars.controlsContainer)), "" !== n.vars.manualControls && (n.manualControls = $(n.vars.manualControls).length > 0 && $(n.vars.manualControls)), "" !== n.vars.customDirectionNav && (n.customDirectionNav = 2 === $(n.vars.customDirectionNav).length && $(n.vars.customDirectionNav)), n.vars.randomize && (n.slides.sort(function () { return Math.round(Math.random()) - 0.5; }), n.container.empty().append(n.slides)), n.doMath(), n.setup("init"), n.vars.controlNav && f.controlNav.setup(), n.vars.directionNav && f.directionNav.setup(), n.vars.keyboard && (1 === $(n.containerSelector).length || n.vars.multipleKeyboard) && $(document).bind("keyup", function (e) { var t = e.keyCode; if (!n.animating && (39 === t || 37 === t)) { var a = 39 === t ? n.getTarget("next") : 37 === t ? n.getTarget("prev") : !1; n.flexAnimate(a, n.vars.pauseOnAction); } }), n.vars.mousewheel && n.bind("mousewheel", function (e, t, a, i) { e.preventDefault(); var s = 0 > t ? n.getTarget("next") : n.getTarget("prev"); n.flexAnimate(s, n.vars.pauseOnAction); }), n.vars.pausePlay && f.pausePlay.setup(), n.vars.slideshow && n.vars.pauseInvisible && f.pauseInvisible.init(), n.vars.slideshow && (n.vars.pauseOnHover && n.hover( function () { n.manualPlay || n.manualPause || n.pause(); }, function () { n.manualPause || n.manualPlay || n.stopped || n.play(); } ), (n.vars.pauseInvisible && f.pauseInvisible.isHidden()) || (n.vars.initDelay > 0 ? (n.startTimeout = setTimeout(n.play, n.vars.initDelay)) : n.play())), m && f.asNav.setup(), r && n.vars.touch && f.touch(), (!p || (p && n.vars.smoothHeight)) && $(window).bind("resize orientationchange focus", f.resize), n.find("img").attr("draggable", "false"), setTimeout(function () { n.vars.start(n); }, 200); }, asNav: { setup: function () { (n.asNav = !0), (n.animatingTo = Math.floor(n.currentSlide / n.move)), (n.currentItem = n.currentSlide), n.slides .removeClass(i + "active-slide") .eq(n.currentItem) .addClass(i + "active-slide"), s ? ((t._slider = n), n.slides.each(function () { var e = this; (e._gesture = new MSGesture()), (e._gesture.target = e), e.addEventListener( "MSPointerDown", function (e) { e.preventDefault(), e.currentTarget._gesture && e.currentTarget._gesture.addPointer(e.pointerId); }, !1 ), e.addEventListener("MSGestureTap", function (e) { e.preventDefault(); var t = $(this), a = t.index(); $(n.vars.asNavFor).data("flexslider").animating || t.hasClass("active") || ((n.direction = n.currentItem < a ? "next" : "prev"), n.flexAnimate(a, n.vars.pauseOnAction, !1, !0, !0)); }); })) : n.slides.on(o, function (e) { e.preventDefault(); var t = $(this), a = t.index(), s = t.offset().left - $(n).scrollLeft(); 0 >= s && t.hasClass(i + "active-slide") ? n.flexAnimate(n.getTarget("prev"), !0) : $(n.vars.asNavFor).data("flexslider").animating || t.hasClass(i + "active-slide") || ((n.direction = n.currentItem < a ? "next" : "prev"), n.flexAnimate(a, n.vars.pauseOnAction, !1, !0, !0)); }); }, }, controlNav: { setup: function () { n.manualControls ? f.controlNav.setupManual() : f.controlNav.setupPaging(); }, setupPaging: function () { var e = "thumbnails" === n.vars.controlNav ? "control-thumbs" : "control-paging", t = 1, a, s; if ( ((n.controlNavScaffold = $( '<ol class="' + i + "control-nav " + i + e + '"></ol>' )), n.pagingCount > 1) ) for (var r = 0; r < n.pagingCount; r++) { (s = n.slides.eq(r)), void 0 === s.attr("data-thumb-alt") && s.attr("data-thumb-alt", ""); var c = "" !== s.attr("data-thumb-alt") ? (c = ' alt="' + s.attr("data-thumb-alt") + '"') : ""; if ( ((a = "thumbnails" === n.vars.controlNav ? '<img src="' + s.attr("data-thumb") + '"' + c + "/>" : '<a href="#">' + t + "</a>"), "thumbnails" === n.vars.controlNav && !0 === n.vars.thumbCaptions) ) { var d = s.attr("data-thumbcaption"); "" !== d && void 0 !== d && (a += '<span class="' + i + 'caption">' + d + "</span>"); } n.controlNavScaffold.append("<li>" + a + "</li>"), t++; } n.controlsContainer ? $(n.controlsContainer).append(n.controlNavScaffold) : n.append(n.controlNavScaffold), f.controlNav.set(), f.controlNav.active(), n.controlNavScaffold.delegate("a, img", o, function (e) { if ((e.preventDefault(), "" === l || l === e.type)) { var t = $(this), a = n.controlNav.index(t); t.hasClass(i + "active") || ((n.direction = a > n.currentSlide ? "next" : "prev"), n.flexAnimate(a, n.vars.pauseOnAction)); } "" === l && (l = e.type), f.setToClearWatchedEvent(); }); }, setupManual: function () { (n.controlNav = n.manualControls), f.controlNav.active(), n.controlNav.bind(o, function (e) { if ((e.preventDefault(), "" === l || l === e.type)) { var t = $(this), a = n.controlNav.index(t); t.hasClass(i + "active") || (a > n.currentSlide ? (n.direction = "next") : (n.direction = "prev"), n.flexAnimate(a, n.vars.pauseOnAction)); } "" === l && (l = e.type), f.setToClearWatchedEvent(); }); }, set: function () { var e = "thumbnails" === n.vars.controlNav ? "img" : "a"; n.controlNav = $( "." + i + "control-nav li " + e, n.controlsContainer ? n.controlsContainer : n ); }, active: function () { n.controlNav .removeClass(i + "active") .eq(n.animatingTo) .addClass(i + "active"); }, update: function (e, t) { n.pagingCount > 1 && "add" === e ? n.controlNavScaffold.append( $('<li><a href="#">' + n.count + "</a></li>") ) : 1 === n.pagingCount ? n.controlNavScaffold.find("li").remove() : n.controlNav.eq(t).closest("li").remove(), f.controlNav.set(), n.pagingCount > 1 && n.pagingCount !== n.controlNav.length ? n.update(t, e) : f.controlNav.active(); }, }, directionNav: { setup: function () { var e = $( '<ul class="' + i + 'direction-nav"><li class="' + i + 'nav-prev"><a class="' + i + 'prev" href="#">' + n.vars.prevText + '</a></li><li class="' + i + 'nav-next"><a class="' + i + 'next" href="#">' + n.vars.nextText + "</a></li></ul>" ); n.customDirectionNav ? (n.directionNav = n.customDirectionNav) : n.controlsContainer ? ($(n.controlsContainer).append(e), (n.directionNav = $( "." + i + "direction-nav li a", n.controlsContainer ))) : (n.append(e), (n.directionNav = $("." + i + "direction-nav li a", n))), f.directionNav.update(), n.directionNav.bind(o, function (e) { e.preventDefault(); var t; ("" === l || l === e.type) && ((t = $(this).hasClass(i + "next") ? n.getTarget("next") : n.getTarget("prev")), n.flexAnimate(t, n.vars.pauseOnAction)), "" === l && (l = e.type), f.setToClearWatchedEvent(); }); }, update: function () { var e = i + "disabled"; 1 === n.pagingCount ? n.directionNav.addClass(e).attr("tabindex", "-1") : n.vars.animationLoop ? n.directionNav.removeClass(e).removeAttr("tabindex") : 0 === n.animatingTo ? n.directionNav .removeClass(e) .filter("." + i + "prev") .addClass(e) .attr("tabindex", "-1") : n.animatingTo === n.last ? n.directionNav .removeClass(e) .filter("." + i + "next") .addClass(e) .attr("tabindex", "-1") : n.directionNav.removeClass(e).removeAttr("tabindex"); }, }, pausePlay: { setup: function () { var e = $('<div class="' + i + 'pauseplay"><a href="#"></a></div>'); n.controlsContainer ? (n.controlsContainer.append(e), (n.pausePlay = $("." + i + "pauseplay a", n.controlsContainer))) : (n.append(e), (n.pausePlay = $("." + i + "pauseplay a", n))), f.pausePlay.update(n.vars.slideshow ? i + "pause" : i + "play"), n.pausePlay.bind(o, function (e) { e.preventDefault(), ("" === l || l === e.type) && ($(this).hasClass(i + "pause") ? ((n.manualPause = !0), (n.manualPlay = !1), n.pause()) : ((n.manualPause = !1), (n.manualPlay = !0), n.play())), "" === l && (l = e.type), f.setToClearWatchedEvent(); }); }, update: function (e) { "play" === e ? n.pausePlay .removeClass(i + "pause") .addClass(i + "play") .html(n.vars.playText) : n.pausePlay .removeClass(i + "play") .addClass(i + "pause") .html(n.vars.pauseText); }, }, touch: function () { function e(e) { e.stopPropagation(), n.animating ? e.preventDefault() : (n.pause(), t._gesture.addPointer(e.pointerId), (T = 0), (c = d ? n.h : n.w), (f = Number(new Date())), (l = v && u && n.animatingTo === n.last ? 0 : v && u ? n.limit - (n.itemW + n.vars.itemMargin) * n.move * n.animatingTo : v && n.currentSlide === n.last ? n.limit : v ? (n.itemW + n.vars.itemMargin) * n.move * n.currentSlide : u ? (n.last - n.currentSlide + n.cloneOffset) * c : (n.currentSlide + n.cloneOffset) * c)); } function a(e) { e.stopPropagation(); var a = e.target._slider; if (a) { var n = -e.translationX, i = -e.translationY; return ( (T += d ? i : n), (m = T), (y = d ? Math.abs(T) < Math.abs(-n) : Math.abs(T) < Math.abs(-i)), e.detail === e.MSGESTURE_FLAG_INERTIA ? void setImmediate(function () { t._gesture.stop(); }) : void ( (!y || Number(new Date()) - f > 500) && (e.preventDefault(), !p && a.transitions && (a.vars.animationLoop || (m = T / ((0 === a.currentSlide && 0 > T) || (a.currentSlide === a.last && T > 0) ? Math.abs(T) / c + 2 : 1)), a.setProps(l + m, "setTouch"))) ) ); } } function i(e) { e.stopPropagation(); var t = e.target._slider; if (t) { if (t.animatingTo === t.currentSlide && !y && null !== m) { var a = u ? -m : m, n = a > 0 ? t.getTarget("next") : t.getTarget("prev"); t.canAdvance(n) && ((Number(new Date()) - f < 550 && Math.abs(a) > 50) || Math.abs(a) > c / 2) ? t.flexAnimate(n, t.vars.pauseOnAction) : p || t.flexAnimate(t.currentSlide, t.vars.pauseOnAction, !0); } (r = null), (o = null), (m = null), (l = null), (T = 0); } } var r, o, l, c, m, f, g, h, S, y = !1, x = 0, b = 0, T = 0; s ? ((t.style.msTouchAction = "none"), (t._gesture = new MSGesture()), (t._gesture.target = t), t.addEventListener("MSPointerDown", e, !1), (t._slider = n), t.addEventListener("MSGestureChange", a, !1), t.addEventListener("MSGestureEnd", i, !1)) : ((g = function (e) { n.animating ? e.preventDefault() : (window.navigator.msPointerEnabled || 1 === e.touches.length) && (n.pause(), (c = d ? n.h : n.w), (f = Number(new Date())), (x = e.touches[0].pageX), (b = e.touches[0].pageY), (l = v && u && n.animatingTo === n.last ? 0 : v && u ? n.limit - (n.itemW + n.vars.itemMargin) * n.move * n.animatingTo : v && n.currentSlide === n.last ? n.limit : v ? (n.itemW + n.vars.itemMargin) * n.move * n.currentSlide : u ? (n.last - n.currentSlide + n.cloneOffset) * c : (n.currentSlide + n.cloneOffset) * c), (r = d ? b : x), (o = d ? x : b), t.addEventListener("touchmove", h, !1), t.addEventListener("touchend", S, !1)); }), (h = function (e) { (x = e.touches[0].pageX), (b = e.touches[0].pageY), (m = d ? r - b : r - x), (y = d ? Math.abs(m) < Math.abs(x - o) : Math.abs(m) < Math.abs(b - o)); var t = 500; (!y || Number(new Date()) - f > t) && (e.preventDefault(), !p && n.transitions && (n.vars.animationLoop || (m /= (0 === n.currentSlide && 0 > m) || (n.currentSlide === n.last && m > 0) ? Math.abs(m) / c + 2 : 1), n.setProps(l + m, "setTouch"))); }), (S = function (e) { if ( (t.removeEventListener("touchmove", h, !1), n.animatingTo === n.currentSlide && !y && null !== m) ) { var a = u ? -m : m, i = a > 0 ? n.getTarget("next") : n.getTarget("prev"); n.canAdvance(i) && ((Number(new Date()) - f < 550 && Math.abs(a) > 50) || Math.abs(a) > c / 2) ? n.flexAnimate(i, n.vars.pauseOnAction) : p || n.flexAnimate(n.currentSlide, n.vars.pauseOnAction, !0); } t.removeEventListener("touchend", S, !1), (r = null), (o = null), (m = null), (l = null); }), t.addEventListener("touchstart", g, !1)); }, resize: function () { !n.animating && n.is(":visible") && (v || n.doMath(), p ? f.smoothHeight() : v ? (n.slides.width(n.computedW), n.update(n.pagingCount), n.setProps()) : d ? (n.viewport.height(n.h), n.setProps(n.h, "setTotal")) : (n.vars.smoothHeight && f.smoothHeight(), n.newSlides.width(n.computedW), n.setProps(n.computedW, "setTotal"))); }, smoothHeight: function (e) { if (!d || p) { var t = p ? n : n.viewport; e ? t.animate( { height: n.slides.eq(n.animatingTo).innerHeight() }, e ) : t.innerHeight(n.slides.eq(n.animatingTo).innerHeight()); } }, sync: function (e) { var t = $(n.vars.sync).data("flexslider"), a = n.animatingTo; switch (e) { case "animate": t.flexAnimate(a, n.vars.pauseOnAction, !1, !0); break; case "play": t.playing || t.asNav || t.play(); break; case "pause": t.pause(); } }, uniqueID: function (e) { return ( e .filter("[id]") .add(e.find("[id]")) .each(function () { var e = $(this); e.attr("id", e.attr("id") + "_clone"); }), e ); }, pauseInvisible: { visProp: null, init: function () { var e = f.pauseInvisible.getHiddenProp(); if (e) { var t = e.replace(/[H|h]idden/, "") + "visibilitychange"; document.addEventListener(t, function () { f.pauseInvisible.isHidden() ? n.startTimeout ? clearTimeout(n.startTimeout) : n.pause() : n.started ? n.play() : n.vars.initDelay > 0 ? setTimeout(n.play, n.vars.initDelay) : n.play(); }); } }, isHidden: function () { var e = f.pauseInvisible.getHiddenProp(); return e ? document[e] : !1; }, getHiddenProp: function () { var e = ["webkit", "moz", "ms", "o"]; if ("hidden" in document) return "hidden"; for (var t = 0; t < e.length; t++) if (e[t] + "Hidden" in document) return e[t] + "Hidden"; return null; }, }, setToClearWatchedEvent: function () { clearTimeout(c), (c = setTimeout(function () { l = ""; }, 3e3)); }, }), (n.flexAnimate = function (e, t, a, s, o) { if ( (n.vars.animationLoop || e === n.currentSlide || (n.direction = e > n.currentSlide ? "next" : "prev"), m && 1 === n.pagingCount && (n.direction = n.currentItem < e ? "next" : "prev"), !n.animating && (n.canAdvance(e, o) || a) && n.is(":visible")) ) { if (m && s) { var l = $(n.vars.asNavFor).data("flexslider"); if ( ((n.atEnd = 0 === e || e === n.count - 1), l.flexAnimate(e, !0, !1, !0, o), (n.direction = n.currentItem < e ? "next" : "prev"), (l.direction = n.direction), Math.ceil((e + 1) / n.visible) - 1 === n.currentSlide || 0 === e) ) return ( (n.currentItem = e), n.slides .removeClass(i + "active-slide") .eq(e) .addClass(i + "active-slide"), !1 ); (n.currentItem = e), n.slides .removeClass(i + "active-slide") .eq(e) .addClass(i + "active-slide"), (e = Math.floor(e / n.visible)); } if ( ((n.animating = !0), (n.animatingTo = e), t && n.pause(), n.vars.before(n), n.syncExists && !o && f.sync("animate"), n.vars.controlNav && f.controlNav.active(), v || n.slides .removeClass(i + "active-slide") .eq(e) .addClass(i + "active-slide"), (n.atEnd = 0 === e || e === n.last), n.vars.directionNav && f.directionNav.update(), e === n.last && (n.vars.end(n), n.vars.animationLoop || n.pause()), p) ) r ? (n.slides.eq(n.currentSlide).css({ opacity: 0, zIndex: 1 }), n.slides.eq(e).css({ opacity: 1, zIndex: 2 }), n.wrapup(c)) : (n.slides .eq(n.currentSlide) .css({ zIndex: 1 }) .animate( { opacity: 0 }, n.vars.animationSpeed, n.vars.easing ), n.slides .eq(e) .css({ zIndex: 2 }) .animate( { opacity: 1 }, n.vars.animationSpeed, n.vars.easing, n.wrapup )); else { var c = d ? n.slides.filter(":first").height() : n.computedW, g, h, S; v ? ((g = n.vars.itemMargin), (S = (n.itemW + g) * n.move * n.animatingTo), (h = S > n.limit && 1 !== n.visible ? n.limit : S)) : (h = 0 === n.currentSlide && e === n.count - 1 && n.vars.animationLoop && "next" !== n.direction ? u ? (n.count + n.cloneOffset) * c : 0 : n.currentSlide === n.last && 0 === e && n.vars.animationLoop && "prev" !== n.direction ? u ? 0 : (n.count + 1) * c : u ? (n.count - 1 - e + n.cloneOffset) * c : (e + n.cloneOffset) * c), n.setProps(h, "", n.vars.animationSpeed), n.transitions ? ((n.vars.animationLoop && n.atEnd) || ((n.animating = !1), (n.currentSlide = n.animatingTo)), n.container.unbind("webkitTransitionEnd transitionend"), n.container.bind( "webkitTransitionEnd transitionend", function () { clearTimeout(n.ensureAnimationEnd), n.wrapup(c); } ), clearTimeout(n.ensureAnimationEnd), (n.ensureAnimationEnd = setTimeout(function () { n.wrapup(c); }, n.vars.animationSpeed + 100))) : n.container.animate( n.args, n.vars.animationSpeed, n.vars.easing, function () { n.wrapup(c); } ); } n.vars.smoothHeight && f.smoothHeight(n.vars.animationSpeed); } }), (n.wrapup = function (e) { p || v || (0 === n.currentSlide && n.animatingTo === n.last && n.vars.animationLoop ? n.setProps(e, "jumpEnd") : n.currentSlide === n.last && 0 === n.animatingTo && n.vars.animationLoop && n.setProps(e, "jumpStart")), (n.animating = !1), (n.currentSlide = n.animatingTo), n.vars.after(n); }), (n.animateSlides = function () { !n.animating && e && n.flexAnimate(n.getTarget("next")); }), (n.pause = function () { clearInterval(n.animatedSlides), (n.animatedSlides = null), (n.playing = !1), n.vars.pausePlay && f.pausePlay.update("play"), n.syncExists && f.sync("pause"); }), (n.play = function () { n.playing && clearInterval(n.animatedSlides), (n.animatedSlides = n.animatedSlides || setInterval(n.animateSlides, n.vars.slideshowSpeed)), (n.started = n.playing = !0), n.vars.pausePlay && f.pausePlay.update("pause"), n.syncExists && f.sync("play"); }), (n.stop = function () { n.pause(), (n.stopped = !0); }), (n.canAdvance = function (e, t) { var a = m ? n.pagingCount - 1 : n.last; return t ? !0 : m && n.currentItem === n.count - 1 && 0 === e && "prev" === n.direction ? !0 : m && 0 === n.currentItem && e === n.pagingCount - 1 && "next" !== n.direction ? !1 : e !== n.currentSlide || m ? n.vars.animationLoop ? !0 : n.atEnd && 0 === n.currentSlide && e === a && "next" !== n.direction ? !1 : n.atEnd && n.currentSlide === a && 0 === e && "next" === n.direction ? !1 : !0 : !1; }), (n.getTarget = function (e) { return ( (n.direction = e), "next" === e ? n.currentSlide === n.last ? 0 : n.currentSlide + 1 : 0 === n.currentSlide ? n.last : n.currentSlide - 1 ); }), (n.setProps = function (e, t, a) { var i = (function () { var a = e ? e : (n.itemW + n.vars.itemMargin) * n.move * n.animatingTo, i = (function () { if (v) return "setTouch" === t ? e : u && n.animatingTo === n.last ? 0 : u ? n.limit - (n.itemW + n.vars.itemMargin) * n.move * n.animatingTo : n.animatingTo === n.last ? n.limit : a; switch (t) { case "setTotal": return u ? (n.count - 1 - n.currentSlide + n.cloneOffset) * e : (n.currentSlide + n.cloneOffset) * e; case "setTouch": return u ? e : e; case "jumpEnd": return u ? e : n.count * e; case "jumpStart": return u ? n.count * e : e; default: return e; } })(); return -1 * i + "px"; })(); n.transitions && ((i = d ? "translate3d(0," + i + ",0)" : "translate3d(" + i + ",0,0)"), (a = void 0 !== a ? a / 1e3 + "s" : "0s"), n.container.css("-" + n.pfx + "-transition-duration", a), n.container.css("transition-duration", a)), (n.args[n.prop] = i), (n.transitions || void 0 === a) && n.container.css(n.args), n.container.css("transform", i); }), (n.setup = function (e) { if (p) n.slides.css({ width: "100%", float: "left", marginRight: "-100%", position: "relative", }), "init" === e && (r ? n.slides .css({ opacity: 0, display: "block", webkitTransition: "opacity " + n.vars.animationSpeed / 1e3 + "s ease", zIndex: 1, }) .eq(n.currentSlide) .css({ opacity: 1, zIndex: 2 }) : 0 == n.vars.fadeFirstSlide ? n.slides .css({ opacity: 0, display: "block", zIndex: 1 }) .eq(n.currentSlide) .css({ zIndex: 2 }) .css({ opacity: 1 }) : n.slides .css({ opacity: 0, display: "block", zIndex: 1 }) .eq(n.currentSlide) .css({ zIndex: 2 }) .animate( { opacity: 1 }, n.vars.animationSpeed, n.vars.easing )), n.vars.smoothHeight && f.smoothHeight(); else { var t, a; "init" === e && ((n.viewport = $('<div class="' + i + 'viewport"></div>') .css({ overflow: "hidden", position: "relative" }) .appendTo(n) .append(n.container)), (n.cloneCount = 0), (n.cloneOffset = 0), u && ((a = $.makeArray(n.slides).reverse()), (n.slides = $(a)), n.container.empty().append(n.slides))), n.vars.animationLoop && !v && ((n.cloneCount = 2), (n.cloneOffset = 1), "init" !== e && n.container.find(".clone").remove(), n.container .append( f .uniqueID(n.slides.first().clone().addClass("clone")) .attr("aria-hidden", "true") ) .prepend( f .uniqueID(n.slides.last().clone().addClass("clone")) .attr("aria-hidden", "true") )), (n.newSlides = $(n.vars.selector, n)), (t = u ? n.count - 1 - n.currentSlide + n.cloneOffset : n.currentSlide + n.cloneOffset), d && !v ? (n.container .height(200 * (n.count + n.cloneCount) + "%") .css("position", "absolute") .width("100%"), setTimeout( function () { n.newSlides.css({ display: "block" }), n.doMath(), n.viewport.height(n.h), n.setProps(t * n.h, "init"); }, "init" === e ? 100 : 0 )) : (n.container.width(200 * (n.count + n.cloneCount) + "%"), n.setProps(t * n.computedW, "init"), setTimeout( function () { n.doMath(), n.newSlides.css({ width: n.computedW, marginRight: n.computedM, float: "left", display: "block", }), n.vars.smoothHeight && f.smoothHeight(); }, "init" === e ? 100 : 0 )); } v || n.slides .removeClass(i + "active-slide") .eq(n.currentSlide) .addClass(i + "active-slide"), n.vars.init(n); }), (n.doMath = function () { var e = n.slides.first(), t = n.vars.itemMargin, a = n.vars.minItems, i = n.vars.maxItems; (n.w = void 0 === n.viewport ? n.width() : n.viewport.width()), (n.h = e.height()), (n.boxPadding = e.outerWidth() - e.width()), v ? ((n.itemT = n.vars.itemWidth + t), (n.itemM = t), (n.minW = a ? a * n.itemT : n.w), (n.maxW = i ? i * n.itemT - t : n.w), (n.itemW = n.minW > n.w ? (n.w - t * (a - 1)) / a : n.maxW < n.w ? (n.w - t * (i - 1)) / i : n.vars.itemWidth > n.w ? n.w : n.vars.itemWidth), (n.visible = Math.floor(n.w / n.itemW)), (n.move = n.vars.move > 0 && n.vars.move < n.visible ? n.vars.move : n.visible), (n.pagingCount = Math.ceil((n.count - n.visible) / n.move + 1)), (n.last = n.pagingCount - 1), (n.limit = 1 === n.pagingCount ? 0 : n.vars.itemWidth > n.w ? n.itemW * (n.count - 1) + t * (n.count - 1) : (n.itemW + t) * n.count - n.w - t)) : ((n.itemW = n.w), (n.itemM = t), (n.pagingCount = n.count), (n.last = n.count - 1)), (n.computedW = n.itemW - n.boxPadding), (n.computedM = n.itemM); }), (n.update = function (e, t) { n.doMath(), v || (e < n.currentSlide ? (n.currentSlide += 1) : e <= n.currentSlide && 0 !== e && (n.currentSlide -= 1), (n.animatingTo = n.currentSlide)), n.vars.controlNav && !n.manualControls && (("add" === t && !v) || n.pagingCount > n.controlNav.length ? f.controlNav.update("add") : (("remove" === t && !v) || n.pagingCount < n.controlNav.length) && (v && n.currentSlide > n.last && ((n.currentSlide -= 1), (n.animatingTo -= 1)), f.controlNav.update("remove", n.last))), n.vars.directionNav && f.directionNav.update(); }), (n.addSlide = function (e, t) { var a = $(e); (n.count += 1), (n.last = n.count - 1), d && u ? void 0 !== t ? n.slides.eq(n.count - t).after(a) : n.container.prepend(a) : void 0 !== t ? n.slides.eq(t).before(a) : n.container.append(a), n.update(t, "add"), (n.slides = $(n.vars.selector + ":not(.clone)", n)), n.setup(), n.vars.added(n); }), (n.removeSlide = function (e) { var t = isNaN(e) ? n.slides.index($(e)) : e; (n.count -= 1), (n.last = n.count - 1), isNaN(e) ? $(e, n.slides).remove() : d && u ? n.slides.eq(n.last).remove() : n.slides.eq(e).remove(), n.doMath(), n.update(t, "remove"), (n.slides = $(n.vars.selector + ":not(.clone)", n)), n.setup(), n.vars.removed(n); }), f.init(); }), $(window) .blur(function (t) { e = !1; }) .focus(function (t) { e = !0; }), ($.flexslider.defaults = { namespace: "flex-", selector: ".slides > li", animation: "fade", easing: "swing", direction: "horizontal", reverse: !1, animationLoop: !0, smoothHeight: !1, startAt: 0, slideshow: !0, slideshowSpeed: 7e3, animationSpeed: 600, initDelay: 0, randomize: !1, fadeFirstSlide: !0, thumbCaptions: !1, pauseOnAction: !0, pauseOnHover: !1, pauseInvisible: !0, useCSS: !0, touch: !0, video: !1, controlNav: !0, directionNav: !0, prevText: "Previous", nextText: "Next", keyboard: !0, multipleKeyboard: !1, mousewheel: !1, pausePlay: !1, pauseText: "Pause", playText: "Play", controlsContainer: "", manualControls: "", customDirectionNav: "", sync: "", asNavFor: "", itemWidth: 0, itemMargin: 0, minItems: 1, maxItems: 0, move: 0, allowOneSlide: !0, start: function () {}, before: function () {}, after: function () {}, end: function () {}, added: function () {}, removed: function () {}, init: function () {}, }), ($.fn.flexslider = function (e) { if ((void 0 === e && (e = {}), "object" == typeof e)) return this.each(function () { var t = $(this), a = e.selector ? e.selector : ".slides > li", n = t.find(a); (1 === n.length && e.allowOneSlide === !1) || 0 === n.length ? (n.fadeIn(400), e.start && e.start(t)) : void 0 === t.data("flexslider") && new $.flexslider(this, e); }); var t = $(this).data("flexslider"); switch (e) { case "play": t.play(); break; case "pause": t.pause(); break; case "stop": t.stop(); break; case "next": t.flexAnimate(t.getTarget("next"), !0); break; case "prev": case "previous": t.flexAnimate(t.getTarget("prev"), !0); break; default: "number" == typeof e && t.flexAnimate(e, !0); } }); })(jQuery); /** * bxSlider v4.2.12 * Copyright 2013-2015 Steven Wanderski * Written while drinking Belgian ales and listening to jazz * Licensed under MIT (http://opensource.org/licenses/MIT) */ !(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, ariaLive: !0, ariaHidden: !0, 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", stopAutoOnClick: !1, autoHover: !1, autoDelay: 0, autoSlideForOnePage: !1, minSlides: 1, maxSlides: 1, moveSlides: 0, slideWidth: 0, shrinkItems: !1, 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 (n) { if (0 === this.length) return this; if (this.length > 1) return ( this.each(function () { t(this).bxSlider(n); }), this ); var s = {}, o = this, r = t(window).width(), a = t(window).height(); if (!t(o).data("bxSlider")) { var l = function () { t(o).data("bxSlider") || ((s.settings = t.extend({}, e, n)), (s.settings.slideWidth = parseInt(s.settings.slideWidth)), (s.children = o.children(s.settings.slideSelector)), s.children.length < s.settings.minSlides && (s.settings.minSlides = s.children.length), s.children.length < s.settings.maxSlides && (s.settings.maxSlides = s.children.length), s.settings.randomStart && (s.settings.startSlide = Math.floor( Math.random() * s.children.length )), (s.active = { index: s.settings.startSlide }), (s.carousel = s.settings.minSlides > 1 || s.settings.maxSlides > 1), s.carousel && (s.settings.preloadImages = "all"), (s.minThreshold = s.settings.minSlides * s.settings.slideWidth + (s.settings.minSlides - 1) * s.settings.slideMargin), (s.maxThreshold = s.settings.maxSlides * s.settings.slideWidth + (s.settings.maxSlides - 1) * s.settings.slideMargin), (s.working = !1), (s.controls = {}), (s.interval = null), (s.animProp = "vertical" === s.settings.mode ? "top" : "left"), (s.usingCSS = s.settings.useCSS && "fade" !== s.settings.mode && (function () { for ( var t = document.createElement("div"), e = [ "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective", ], i = 0; i < e.length; i++ ) if (void 0 !== t.style[e[i]]) return ( (s.cssPrefix = e[i] .replace("Perspective", "") .toLowerCase()), (s.animProp = "-" + s.cssPrefix + "-transform"), !0 ); return !1; })()), "vertical" === s.settings.mode && (s.settings.maxSlides = s.settings.minSlides), o.data("origStyle", o.attr("style")), o.children(s.settings.slideSelector).each(function () { t(this).data("origStyle", t(this).attr("style")); }), d()); }, d = function () { var e = s.children.eq(s.settings.startSlide); o.wrap( '<div class="' + s.settings.wrapperClass + '"><div class="bx-viewport"></div></div>' ), (s.viewport = o.parent()), s.settings.ariaLive && !s.settings.ticker && s.viewport.attr("aria-live", "polite"), (s.loader = t('<div class="bx-loading" />')), s.viewport.prepend(s.loader), o.css({ width: "horizontal" === s.settings.mode ? 1e3 * s.children.length + 215 + "%" : "auto", position: "relative", }), s.usingCSS && s.settings.easing ? o.css( "-" + s.cssPrefix + "-transition-timing-function", s.settings.easing ) : s.settings.easing || (s.settings.easing = "swing"), s.viewport.css({ width: "100%", overflow: "hidden", position: "relative", }), s.viewport.parent().css({ maxWidth: u() }), s.children.css({ float: "horizontal" === s.settings.mode ? "left" : "none", listStyle: "none", position: "relative", }), s.children.css("width", h()), "horizontal" === s.settings.mode && s.settings.slideMargin > 0 && s.children.css("marginRight", s.settings.slideMargin), "vertical" === s.settings.mode && s.settings.slideMargin > 0 && s.children.css("marginBottom", s.settings.slideMargin), "fade" === s.settings.mode && (s.children.css({ position: "absolute", zIndex: 0, display: "none", }), s.children .eq(s.settings.startSlide) .css({ zIndex: s.settings.slideZIndex, display: "block" })), (s.controls.el = t('<div class="bx-controls" />')), s.settings.captions && P(), (s.active.last = s.settings.startSlide === f() - 1), s.settings.video && o.fitVids(), ("all" === s.settings.preloadImages || s.settings.ticker) && (e = s.children), s.settings.ticker ? (s.settings.pager = !1) : (s.settings.controls && C(), s.settings.auto && s.settings.autoControls && T(), s.settings.pager && w(), (s.settings.controls || s.settings.autoControls || s.settings.pager) && s.viewport.after(s.controls.el)), c(e, g); }, c = function (e, i) { var n = e.find('img:not([src=""]), iframe').length, s = 0; return 0 === n ? void i() : void e.find('img:not([src=""]), iframe').each(function () { t(this) .one("load error", function () { ++s === n && i(); }) .each(function () { this.complete && t(this).trigger("load"); }); }); }, g = function () { if ( s.settings.infiniteLoop && "fade" !== s.settings.mode && !s.settings.ticker ) { var e = "vertical" === s.settings.mode ? s.settings.minSlides : s.settings.maxSlides, i = s.children.slice(0, e).clone(!0).addClass("bx-clone"), n = s.children.slice(-e).clone(!0).addClass("bx-clone"); s.settings.ariaHidden && (i.attr("aria-hidden", !0), n.attr("aria-hidden", !0)), o.append(i).prepend(n); } s.loader.remove(), m(), "vertical" === s.settings.mode && (s.settings.adaptiveHeight = !0), s.viewport.height(p()), o.redrawSlider(), s.settings.onSliderLoad.call(o, s.active.index), (s.initialized = !0), s.settings.responsive && t(window).bind("resize", Z), s.settings.auto && s.settings.autoStart && (f() > 1 || s.settings.autoSlideForOnePage) && H(), s.settings.ticker && W(), s.settings.pager && I(s.settings.startSlide), s.settings.controls && D(), s.settings.touchEnabled && !s.settings.ticker && N(), s.settings.keyboardEnabled && !s.settings.ticker && t(document).keydown(F); }, p = function () { var e = 0, n = t(); if ("vertical" === s.settings.mode || s.settings.adaptiveHeight) if (s.carousel) { var o = 1 === s.settings.moveSlides ? s.active.index : s.active.index * x(); for ( n = s.children.eq(o), i = 1; i <= s.settings.maxSlides - 1; i++ ) n = o + i >= s.children.length ? n.add(s.children.eq(i - 1)) : n.add(s.children.eq(o + i)); } else n = s.children.eq(s.active.index); else n = s.children; return ( "vertical" === s.settings.mode ? (n.each(function (i) { e += t(this).outerHeight(); }), s.settings.slideMargin > 0 && (e += s.settings.slideMargin * (s.settings.minSlides - 1))) : (e = Math.max.apply( Math, n .map(function () { return t(this).outerHeight(!1); }) .get() )), "border-box" === s.viewport.css("box-sizing") ? (e += parseFloat(s.viewport.css("padding-top")) + parseFloat(s.viewport.css("padding-bottom")) + parseFloat(s.viewport.css("border-top-width")) + parseFloat(s.viewport.css("border-bottom-width"))) : "padding-box" === s.viewport.css("box-sizing") && (e += parseFloat(s.viewport.css("padding-top")) + parseFloat(s.viewport.css("padding-bottom"))), e ); }, u = function () { var t = "100%"; return ( s.settings.slideWidth > 0 && (t = "horizontal" === s.settings.mode ? s.settings.maxSlides * s.settings.slideWidth + (s.settings.maxSlides - 1) * s.settings.slideMargin : s.settings.slideWidth), t ); }, h = function () { var t = s.settings.slideWidth, e = s.viewport.width(); if ( 0 === s.settings.slideWidth || (s.settings.slideWidth > e && !s.carousel) || "vertical" === s.settings.mode ) t = e; else if ( s.settings.maxSlides > 1 && "horizontal" === s.settings.mode ) { if (e > s.maxThreshold) return t; e < s.minThreshold ? (t = (e - s.settings.slideMargin * (s.settings.minSlides - 1)) / s.settings.minSlides) : s.settings.shrinkItems && (t = Math.floor( (e + s.settings.slideMargin) / Math.ceil( (e + s.settings.slideMargin) / (t + s.settings.slideMargin) ) - s.settings.slideMargin )); } return t; }, v = function () { var t = 1, e = null; return ( "horizontal" === s.settings.mode && s.settings.slideWidth > 0 ? s.viewport.width() < s.minThreshold ? (t = s.settings.minSlides) : s.viewport.width() > s.maxThreshold ? (t = s.settings.maxSlides) : ((e = s.children.first().width() + s.settings.slideMargin), (t = Math.floor( (s.viewport.width() + s.settings.slideMargin) / e ))) : "vertical" === s.settings.mode && (t = s.settings.minSlides), t ); }, f = function () { var t = 0, e = 0, i = 0; if (s.settings.moveSlides > 0) if (s.settings.infiniteLoop) t = Math.ceil(s.children.length / x()); else for (; e < s.children.length; ) ++t, (e = i + v()), (i += s.settings.moveSlides <= v() ? s.settings.moveSlides : v()); else t = Math.ceil(s.children.length / v()); return t; }, x = function () { return s.settings.moveSlides > 0 && s.settings.moveSlides <= v() ? s.settings.moveSlides : v(); }, m = function () { var t, e, i; s.children.length > s.settings.maxSlides && s.active.last && !s.settings.infiniteLoop ? "horizontal" === s.settings.mode ? ((e = s.children.last()), (t = e.position()), S( -(t.left - (s.viewport.width() - e.outerWidth())), "reset", 0 )) : "vertical" === s.settings.mode && ((i = s.children.length - s.settings.minSlides), (t = s.children.eq(i).position()), S(-t.top, "reset", 0)) : ((t = s.children.eq(s.active.index * x()).position()), s.active.index === f() - 1 && (s.active.last = !0), void 0 !== t && ("horizontal" === s.settings.mode ? S(-t.left, "reset", 0) : "vertical" === s.settings.mode && S(-t.top, "reset", 0))); }, S = function (e, i, n, r) { var a, l; s.usingCSS ? ((l = "vertical" === s.settings.mode ? "translate3d(0, " + e + "px, 0)" : "translate3d(" + e + "px, 0, 0)"), o.css("-" + s.cssPrefix + "-transition-duration", n / 1e3 + "s"), "slide" === i ? (o.css(s.animProp, l), 0 !== n ? o.bind( "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function (e) { t(e.target).is(o) && (o.unbind( "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd" ), q()); } ) : q()) : "reset" === i ? o.css(s.animProp, l) : "ticker" === i && (o.css( "-" + s.cssPrefix + "-transition-timing-function", "linear" ), o.css(s.animProp, l), 0 !== n ? o.bind( "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function (e) { t(e.target).is(o) && (o.unbind( "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd" ), S(r.resetValue, "reset", 0), L()); } ) : (S(r.resetValue, "reset", 0), L()))) : ((a = {}), (a[s.animProp] = e), "slide" === i ? o.animate(a, n, s.settings.easing, function () { q(); }) : "reset" === i ? o.css(s.animProp, e) : "ticker" === i && o.animate(a, n, "linear", function () { S(r.resetValue, "reset", 0), L(); })); }, b = function () { for (var e = "", i = "", n = f(), o = 0; o < n; o++) (i = ""), (s.settings.buildPager && t.isFunction(s.settings.buildPager)) || s.settings.pagerCustom ? ((i = s.settings.buildPager(o)), s.pagerEl.addClass("bx-custom-pager")) : ((i = o + 1), s.pagerEl.addClass("bx-default-pager")), (e += '<div class="bx-pager-item"><a href="" data-slide-index="' + o + '" class="bx-pager-link">' + i + "</a></div>"); s.pagerEl.html(e); }, w = function () { s.settings.pagerCustom ? (s.pagerEl = t(s.settings.pagerCustom)) : ((s.pagerEl = t('<div class="bx-pager" />')), s.settings.pagerSelector ? t(s.settings.pagerSelector).html(s.pagerEl) : s.controls.el.addClass("bx-has-pager").append(s.pagerEl), b()), s.pagerEl.on("click touchend", "a", z); }, C = function () { (s.controls.next = t( '<a class="bx-next" href="">' + s.settings.nextText + "</a>" )), (s.controls.prev = t( '<a class="bx-prev" href="">' + s.settings.prevText + "</a>" )), s.controls.next.bind("click touchend", E), s.controls.prev.bind("click touchend", k), s.settings.nextSelector && t(s.settings.nextSelector).append(s.controls.next), s.settings.prevSelector && t(s.settings.prevSelector).append(s.controls.prev), s.settings.nextSelector || s.settings.prevSelector || ((s.controls.directionEl = t( '<div class="bx-controls-direction" />' )), s.controls.directionEl .append(s.controls.prev) .append(s.controls.next), s.controls.el .addClass("bx-has-controls-direction") .append(s.controls.directionEl)); }, T = function () { (s.controls.start = t( '<div class="bx-controls-auto-item"><a class="bx-start" href="">' + s.settings.startText + "</a></div>" )), (s.controls.stop = t( '<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + s.settings.stopText + "</a></div>" )), (s.controls.autoEl = t('<div class="bx-controls-auto" />')), s.controls.autoEl.on("click", ".bx-start", M), s.controls.autoEl.on("click", ".bx-stop", y), s.settings.autoControlsCombine ? s.controls.autoEl.append(s.controls.start) : s.controls.autoEl .append(s.controls.start) .append(s.controls.stop), s.settings.autoControlsSelector ? t(s.settings.autoControlsSelector).html(s.controls.autoEl) : s.controls.el .addClass("bx-has-controls-auto") .append(s.controls.autoEl), A(s.settings.autoStart ? "stop" : "start"); }, P = function () { s.children.each(function (e) { var i = t(this).find("img:first").attr("title"); void 0 !== i && ("" + i).length && t(this).append( '<div class="bx-caption"><span>' + i + "</span></div>" ); }); }, E = function (t) { t.preventDefault(), s.controls.el.hasClass("disabled") || (s.settings.auto && s.settings.stopAutoOnClick && o.stopAuto(), o.goToNextSlide()); }, k = function (t) { t.preventDefault(), s.controls.el.hasClass("disabled") || (s.settings.auto && s.settings.stopAutoOnClick && o.stopAuto(), o.goToPrevSlide()); }, M = function (t) { o.startAuto(), t.preventDefault(); }, y = function (t) { o.stopAuto(), t.preventDefault(); }, z = function (e) { var i, n; e.preventDefault(), s.controls.el.hasClass("disabled") || (s.settings.auto && s.settings.stopAutoOnClick && o.stopAuto(), (i = t(e.currentTarget)), void 0 !== i.attr("data-slide-index") && ((n = parseInt(i.attr("data-slide-index"))), n !== s.active.index && o.goToSlide(n))); }, I = function (e) { var i = s.children.length; return "short" === s.settings.pagerType ? (s.settings.maxSlides > 1 && (i = Math.ceil(s.children.length / s.settings.maxSlides)), void s.pagerEl.html(e + 1 + s.settings.pagerShortSeparator + i)) : (s.pagerEl.find("a").removeClass("active"), void s.pagerEl.each(function (i, n) { t(n).find("a").eq(e).addClass("active"); })); }, q = function () { if (s.settings.infiniteLoop) { var t = ""; 0 === s.active.index ? (t = s.children.eq(0).position()) : s.active.index === f() - 1 && s.carousel ? (t = s.children.eq((f() - 1) * x()).position()) : s.active.index === s.children.length - 1 && (t = s.children.eq(s.children.length - 1).position()), t && ("horizontal" === s.settings.mode ? S(-t.left, "reset", 0) : "vertical" === s.settings.mode && S(-t.top, "reset", 0)); } (s.working = !1), s.settings.onSlideAfter.call( o, s.children.eq(s.active.index), s.oldIndex, s.active.index ); }, A = function (t) { s.settings.autoControlsCombine ? s.controls.autoEl.html(s.controls[t]) : (s.controls.autoEl.find("a").removeClass("active"), s.controls.autoEl .find("a:not(.bx-" + t + ")") .addClass("active")); }, D = function () { 1 === f() ? (s.controls.prev.addClass("disabled"), s.controls.next.addClass("disabled")) : !s.settings.infiniteLoop && s.settings.hideControlOnEnd && (0 === s.active.index ? (s.controls.prev.addClass("disabled"), s.controls.next.removeClass("disabled")) : s.active.index === f() - 1 ? (s.controls.next.addClass("disabled"), s.controls.prev.removeClass("disabled")) : (s.controls.prev.removeClass("disabled"), s.controls.next.removeClass("disabled"))); }, H = function () { if (s.settings.autoDelay > 0) { setTimeout(o.startAuto, s.settings.autoDelay); } else o.startAuto(), t(window) .focus(function () { o.startAuto(); }) .blur(function () { o.stopAuto(); }); s.settings.autoHover && o.hover( function () { s.interval && (o.stopAuto(!0), (s.autoPaused = !0)); }, function () { s.autoPaused && (o.startAuto(!0), (s.autoPaused = null)); } ); }, W = function () { var e, i, n, r, a, l, d, c, g = 0; "next" === s.settings.autoDirection ? o.append(s.children.clone().addClass("bx-clone")) : (o.prepend(s.children.clone().addClass("bx-clone")), (e = s.children.first().position()), (g = "horizontal" === s.settings.mode ? -e.left : -e.top)), S(g, "reset", 0), (s.settings.pager = !1), (s.settings.controls = !1), (s.settings.autoControls = !1), s.settings.tickerHover && (s.usingCSS ? ((r = "horizontal" === s.settings.mode ? 4 : 5), s.viewport.hover( function () { (i = o.css("-" + s.cssPrefix + "-transform")), (n = parseFloat(i.split(",")[r])), S(n, "reset", 0); }, function () { (c = 0), s.children.each(function (e) { c += "horizontal" === s.settings.mode ? t(this).outerWidth(!0) : t(this).outerHeight(!0); }), (a = s.settings.speed / c), (l = "horizontal" === s.settings.mode ? "left" : "top"), (d = a * (c - Math.abs(parseInt(n)))), L(d); } )) : s.viewport.hover( function () { o.stop(); }, function () { (c = 0), s.children.each(function (e) { c += "horizontal" === s.settings.mode ? t(this).outerWidth(!0) : t(this).outerHeight(!0); }), (a = s.settings.speed / c), (l = "horizontal" === s.settings.mode ? "left" : "top"), (d = a * (c - Math.abs(parseInt(o.css(l))))), L(d); } )), L(); }, L = function (t) { var e, i, n, r = t ? t : s.settings.speed, a = { left: 0, top: 0 }, l = { left: 0, top: 0 }; "next" === s.settings.autoDirection ? (a = o.find(".bx-clone").first().position()) : (l = s.children.first().position()), (e = "horizontal" === s.settings.mode ? -a.left : -a.top), (i = "horizontal" === s.settings.mode ? -l.left : -l.top), (n = { resetValue: i }), S(e, "ticker", r, n); }, O = function (e) { var i = t(window), n = { top: i.scrollTop(), left: i.scrollLeft() }, s = e.offset(); return ( (n.right = n.left + i.width()), (n.bottom = n.top + i.height()), (s.right = s.left + e.outerWidth()), (s.bottom = s.top + e.outerHeight()), !( n.right < s.left || n.left > s.right || n.bottom < s.top || n.top > s.bottom ) ); }, F = function (t) { var e = document.activeElement.tagName.toLowerCase(), i = "input|textarea", n = new RegExp(e, ["i"]), s = n.exec(i); if (null == s && O(o)) { if (39 === t.keyCode) return E(t), !1; if (37 === t.keyCode) return k(t), !1; } }, N = function () { (s.touch = { start: { x: 0, y: 0 }, end: { x: 0, y: 0 } }), s.viewport.bind("touchstart MSPointerDown pointerdown", X), s.viewport.on("click", ".bxslider a", function (t) { s.viewport.hasClass("click-disabled") && (t.preventDefault(), s.viewport.removeClass("click-disabled")); }); }, X = function (t) { if ((s.controls.el.addClass("disabled"), s.working)) t.preventDefault(), s.controls.el.removeClass("disabled"); else { s.touch.originalPos = o.position(); var e = t.originalEvent, i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e]; (s.touch.start.x = i[0].pageX), (s.touch.start.y = i[0].pageY), s.viewport.get(0).setPointerCapture && ((s.pointerId = e.pointerId), s.viewport.get(0).setPointerCapture(s.pointerId)), s.viewport.bind("touchmove MSPointerMove pointermove", V), s.viewport.bind("touchend MSPointerUp pointerup", R), s.viewport.bind("MSPointerCancel pointercancel", Y); } }, Y = function (t) { S(s.touch.originalPos.left, "reset", 0), s.controls.el.removeClass("disabled"), s.viewport.unbind("MSPointerCancel pointercancel", Y), s.viewport.unbind("touchmove MSPointerMove pointermove", V), s.viewport.unbind("touchend MSPointerUp pointerup", R), s.viewport.get(0).releasePointerCapture && s.viewport.get(0).releasePointerCapture(s.pointerId); }, V = function (t) { var e = t.originalEvent, i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e], n = Math.abs(i[0].pageX - s.touch.start.x), o = Math.abs(i[0].pageY - s.touch.start.y), r = 0, a = 0; 3 * n > o && s.settings.preventDefaultSwipeX ? t.preventDefault() : 3 * o > n && s.settings.preventDefaultSwipeY && t.preventDefault(), "fade" !== s.settings.mode && s.settings.oneToOneTouch && ("horizontal" === s.settings.mode ? ((a = i[0].pageX - s.touch.start.x), (r = s.touch.originalPos.left + a)) : ((a = i[0].pageY - s.touch.start.y), (r = s.touch.originalPos.top + a)), S(r, "reset", 0)); }, R = function (t) { s.viewport.unbind("touchmove MSPointerMove pointermove", V), s.controls.el.removeClass("disabled"); var e = t.originalEvent, i = "undefined" != typeof e.changedTouches ? e.changedTouches : [e], n = 0, r = 0; (s.touch.end.x = i[0].pageX), (s.touch.end.y = i[0].pageY), "fade" === s.settings.mode ? ((r = Math.abs(s.touch.start.x - s.touch.end.x)), r >= s.settings.swipeThreshold && (s.touch.start.x > s.touch.end.x ? o.goToNextSlide() : o.goToPrevSlide(), o.stopAuto())) : ("horizontal" === s.settings.mode ? ((r = s.touch.end.x - s.touch.start.x), (n = s.touch.originalPos.left)) : ((r = s.touch.end.y - s.touch.start.y), (n = s.touch.originalPos.top)), !s.settings.infiniteLoop && ((0 === s.active.index && r > 0) || (s.active.last && r < 0)) ? S(n, "reset", 200) : Math.abs(r) >= s.settings.swipeThreshold ? (r < 0 ? o.goToNextSlide() : o.goToPrevSlide(), o.stopAuto()) : S(n, "reset", 200)), s.viewport.unbind("touchend MSPointerUp pointerup", R), s.viewport.get(0).releasePointerCapture && s.viewport.get(0).releasePointerCapture(s.pointerId); }, Z = function (e) { if (s.initialized) if (s.working) window.setTimeout(Z, 10); else { var i = t(window).width(), n = t(window).height(); (r === i && a === n) || ((r = i), (a = n), o.redrawSlider(), s.settings.onSliderResize.call(o, s.active.index)); } }, B = function (t) { var e = v(); s.settings.ariaHidden && !s.settings.ticker && (s.children.attr("aria-hidden", "true"), s.children.slice(t, t + e).attr("aria-hidden", "false")); }, U = function (t) { return t < 0 ? s.settings.infiniteLoop ? f() - 1 : s.active.index : t >= f() ? s.settings.infiniteLoop ? 0 : s.active.index : t; }; return ( (o.goToSlide = function (e, i) { var n, r, a, l, d = !0, c = 0, g = { left: 0, top: 0 }, u = null; if ( ((s.oldIndex = s.active.index), (s.active.index = U(e)), !s.working && s.active.index !== s.oldIndex) ) { if ( ((s.working = !0), (d = s.settings.onSlideBefore.call( o, s.children.eq(s.active.index), s.oldIndex, s.active.index )), "undefined" != typeof d && !d) ) return (s.active.index = s.oldIndex), void (s.working = !1); "next" === i ? s.settings.onSlideNext.call( o, s.children.eq(s.active.index), s.oldIndex, s.active.index ) || (d = !1) : "prev" === i && (s.settings.onSlidePrev.call( o, s.children.eq(s.active.index), s.oldIndex, s.active.index ) || (d = !1)), (s.active.last = s.active.index >= f() - 1), (s.settings.pager || s.settings.pagerCustom) && I(s.active.index), s.settings.controls && D(), "fade" === s.settings.mode ? (s.settings.adaptiveHeight && s.viewport.height() !== p() && s.viewport.animate( { height: p() }, s.settings.adaptiveHeightSpeed ), s.children .filter(":visible") .fadeOut(s.settings.speed) .css({ zIndex: 0 }), s.children .eq(s.active.index) .css("zIndex", s.settings.slideZIndex + 1) .fadeIn(s.settings.speed, function () { t(this).css("zIndex", s.settings.slideZIndex), q(); })) : (s.settings.adaptiveHeight && s.viewport.height() !== p() && s.viewport.animate( { height: p() }, s.settings.adaptiveHeightSpeed ), !s.settings.infiniteLoop && s.carousel && s.active.last ? "horizontal" === s.settings.mode ? ((u = s.children.eq(s.children.length - 1)), (g = u.position()), (c = s.viewport.width() - u.outerWidth())) : ((n = s.children.length - s.settings.minSlides), (g = s.children.eq(n).position())) : s.carousel && s.active.last && "prev" === i ? ((r = 1 === s.settings.moveSlides ? s.settings.maxSlides - x() : (f() - 1) * x() - (s.children.length - s.settings.maxSlides)), (u = o.children(".bx-clone").eq(r)), (g = u.position())) : "next" === i && 0 === s.active.index ? ((g = o .find("> .bx-clone") .eq(s.settings.maxSlides) .position()), (s.active.last = !1)) : e >= 0 && ((l = e * parseInt(x())), (g = s.children.eq(l).position())), "undefined" != typeof g ? ((a = "horizontal" === s.settings.mode ? -(g.left - c) : -g.top), S(a, "slide", s.settings.speed)) : (s.working = !1)), s.settings.ariaHidden && B(s.active.index * x()); } }), (o.goToNextSlide = function () { if (s.settings.infiniteLoop || !s.active.last) { var t = parseInt(s.active.index) + 1; o.goToSlide(t, "next"); } }), (o.goToPrevSlide = function () { if (s.settings.infiniteLoop || 0 !== s.active.index) { var t = parseInt(s.active.index) - 1; o.goToSlide(t, "prev"); } }), (o.startAuto = function (t) { s.interval || ((s.interval = setInterval(function () { "next" === s.settings.autoDirection ? o.goToNextSlide() : o.goToPrevSlide(); }, s.settings.pause)), s.settings.autoControls && t !== !0 && A("stop")); }), (o.stopAuto = function (t) { s.interval && (clearInterval(s.interval), (s.interval = null), s.settings.autoControls && t !== !0 && A("start")); }), (o.getCurrentSlide = function () { return s.active.index; }), (o.getCurrentSlideElement = function () { return s.children.eq(s.active.index); }), (o.getSlideElement = function (t) { return s.children.eq(t); }), (o.getSlideCount = function () { return s.children.length; }), (o.isWorking = function () { return s.working; }), (o.redrawSlider = function () { s.children.add(o.find(".bx-clone")).outerWidth(h()), s.viewport.css("height", p()), s.settings.ticker || m(), s.active.last && (s.active.index = f() - 1), s.active.index >= f() && (s.active.last = !0), s.settings.pager && !s.settings.pagerCustom && (b(), I(s.active.index)), s.settings.ariaHidden && B(s.active.index * x()); }), (o.destroySlider = function () { s.initialized && ((s.initialized = !1), t(".bx-clone", this).remove(), s.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(), s.controls.el && s.controls.el.remove(), s.controls.next && s.controls.next.remove(), s.controls.prev && s.controls.prev.remove(), s.pagerEl && s.settings.controls && !s.settings.pagerCustom && s.pagerEl.remove(), t(".bx-caption", this).remove(), s.controls.autoEl && s.controls.autoEl.remove(), clearInterval(s.interval), s.settings.responsive && t(window).unbind("resize", Z), s.settings.keyboardEnabled && t(document).unbind("keydown", F), t(this).removeData("bxSlider")); }), (o.reloadSlider = function (e) { void 0 !== e && (n = e), o.destroySlider(), l(), t(o).data("bxSlider", this); }), l(), t(o).data("bxSlider", this), this ); } }; })(jQuery); /*! * imagesLoaded PACKAGED v4.1.0 * JavaScript is all like "You images are done yet or what?" * MIT License */ !(function (t, e) { "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? (module.exports = e()) : (t.EvEmitter = e()); })(this, function () { function t() {} var e = t.prototype; return ( (e.on = function (t, e) { if (t && e) { var i = (this._events = this._events || {}), n = (i[t] = i[t] || []); return -1 == n.indexOf(e) && n.push(e), this; } }), (e.once = function (t, e) { if (t && e) { this.on(t, e); var i = (this._onceEvents = this._onceEvents || {}), n = (i[t] = i[t] || []); return (n[e] = !0), this; } }), (e.off = function (t, e) { var i = this._events && this._events[t]; if (i && i.length) { var n = i.indexOf(e); return -1 != n && i.splice(n, 1), this; } }), (e.emitEvent = function (t, e) { var i = this._events && this._events[t]; if (i && i.length) { var n = 0, o = i[n]; e = e || []; for (var r = this._onceEvents && this._onceEvents[t]; o; ) { var s = r && r[o]; s && (this.off(t, o), delete r[o]), o.apply(this, e), (n += s ? 0 : 1), (o = i[n]); } return this; } }), t ); }), (function (t, e) { "use strict"; "function" == typeof define && define.amd ? define(["ev-emitter/ev-emitter"], function (i) { return e(t, i); }) : "object" == typeof module && module.exports ? (module.exports = e(t, require("ev-emitter"))) : (t.imagesLoaded = e(t, t.EvEmitter)); })(window, function (t, e) { function i(t, e) { for (var i in e) t[i] = e[i]; return t; } function n(t) { var e = []; if (Array.isArray(t)) e = t; else if ("number" == typeof t.length) for (var i = 0; i < t.length; i++) e.push(t[i]); else e.push(t); return e; } function o(t, e, r) { return this instanceof o ? ("string" == typeof t && (t = document.querySelectorAll(t)), (this.elements = n(t)), (this.options = i({}, this.options)), "function" == typeof e ? (r = e) : i(this.options, e), r && this.on("always", r), this.getImages(), h && (this.jqDeferred = new h.Deferred()), void setTimeout( function () { this.check(); }.bind(this) )) : new o(t, e, r); } function r(t) { this.img = t; } function s(t, e) { (this.url = t), (this.element = e), (this.img = new Image()); } var h = t.jQuery, a = t.console; (o.prototype = Object.create(e.prototype)), (o.prototype.options = {}), (o.prototype.getImages = function () { (this.images = []), this.elements.forEach(this.addElementImages, this); }), (o.prototype.addElementImages = function (t) { "IMG" == t.nodeName && this.addImage(t), this.options.background === !0 && this.addElementBackgroundImages(t); var e = t.nodeType; if (e && d[e]) { for (var i = t.querySelectorAll("img"), n = 0; n < i.length; n++) { var o = i[n]; this.addImage(o); } if ("string" == typeof this.options.background) { var r = t.querySelectorAll(this.options.background); for (n = 0; n < r.length; n++) { var s = r[n]; this.addElementBackgroundImages(s); } } } }); var d = { 1: !0, 9: !0, 11: !0 }; return ( (o.prototype.addElementBackgroundImages = function (t) { var e = getComputedStyle(t); if (e) for ( var i = /url\((['"])?(.*?)\1\)/gi, n = i.exec(e.backgroundImage); null !== n; ) { var o = n && n[2]; o && this.addBackground(o, t), (n = i.exec(e.backgroundImage)); } }), (o.prototype.addImage = function (t) { var e = new r(t); this.images.push(e); }), (o.prototype.addBackground = function (t, e) { var i = new s(t, e); this.images.push(i); }), (o.prototype.check = function () { function t(t, i, n) { setTimeout(function () { e.progress(t, i, n); }); } var e = this; return ( (this.progressedCount = 0), (this.hasAnyBroken = !1), this.images.length ? void this.images.forEach(function (e) { e.once("progress", t), e.check(); }) : void this.complete() ); }), (o.prototype.progress = function (t, e, i) { this.progressedCount++, (this.hasAnyBroken = this.hasAnyBroken || !t.isLoaded), this.emitEvent("progress", [this, t, e]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, t), this.progressedCount == this.images.length && this.complete(), this.options.debug && a && a.log("progress: " + i, t, e); }), (o.prototype.complete = function () { var t = this.hasAnyBroken ? "fail" : "done"; if ( ((this.isComplete = !0), this.emitEvent(t, [this]), this.emitEvent("always", [this]), this.jqDeferred) ) { var e = this.hasAnyBroken ? "reject" : "resolve"; this.jqDeferred[e](this); } }), (r.prototype = Object.create(e.prototype)), (r.prototype.check = function () { var t = this.getIsImageComplete(); return t ? void this.confirm(0 !== this.img.naturalWidth, "naturalWidth") : ((this.proxyImage = new Image()), this.proxyImage.addEventListener("load", this), this.proxyImage.addEventListener("error", this), this.img.addEventListener("load", this), this.img.addEventListener("error", this), void (this.proxyImage.src = this.img.src)); }), (r.prototype.getIsImageComplete = function () { return this.img.complete && void 0 !== this.img.naturalWidth; }), (r.prototype.confirm = function (t, e) { (this.isLoaded = t), this.emitEvent("progress", [this, this.img, e]); }), (r.prototype.handleEvent = function (t) { var e = "on" + t.type; this[e] && this[e](t); }), (r.prototype.onload = function () { this.confirm(!0, "onload"), this.unbindEvents(); }), (r.prototype.onerror = function () { this.confirm(!1, "onerror"), this.unbindEvents(); }), (r.prototype.unbindEvents = function () { this.proxyImage.removeEventListener("load", this), this.proxyImage.removeEventListener("error", this), this.img.removeEventListener("load", this), this.img.removeEventListener("error", this); }), (s.prototype = Object.create(r.prototype)), (s.prototype.check = function () { this.img.addEventListener("load", this), this.img.addEventListener("error", this), (this.img.src = this.url); var t = this.getIsImageComplete(); t && (this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), this.unbindEvents()); }), (s.prototype.unbindEvents = function () { this.img.removeEventListener("load", this), this.img.removeEventListener("error", this); }), (s.prototype.confirm = function (t, e) { (this.isLoaded = t), this.emitEvent("progress", [this, this.element, e]); }), (o.makeJQueryPlugin = function (e) { (e = e || t.jQuery), e && ((h = e), (h.fn.imagesLoaded = function (t, e) { var i = new o(this, t, e); return i.jqDeferred.promise(h(this)); })); }), o.makeJQueryPlugin(), o ); }); /* Ridiculously Responsive Social Sharing Buttons Team: @dbox, @joshuatuscan Site: http://www.kurtnoble.com/labs/rrssb Twitter: @therealkni ___ ___ /__/| /__/\ ___ | |:| \ \:\ / /\ | |:| \ \:\ / /:/ __| |:| _____\__\:\ /__/::\ /__/\_|:|____ /__/::::::::\ \__\/\:\__ \ \:\/:::::/ \ \:\~~\~~\/ \ \:\/\ \ \::/~~~~ \ \:\ ~~~ \__\::/ \ \:\ \ \:\ /__/:/ \ \:\ \ \:\ \__\/ \__\/ \__\/ */ (function ( e, t, n ) { "use strict"; var r = function () { t(".rrssb-buttons").each(function (e) { var n = t(this), r = t("li", n).length, i = 100 / r; t("li", n) .css("width", i + "%") .attr("data-initwidth", i); }); }, i = function () { t(".rrssb-buttons").each(function (e) { var n = t(this), r = parseFloat(t(n).width()), i = t("li", n).not(".small").first().width(), s = t("li.small", n).length; i > 170 && s < 1 ? t(n).addClass("large-format") : t(n).removeClass("large-format"); r < 200 ? t(n).removeClass("small-format").addClass("tiny-format") : t(n).removeClass("tiny-format"); }); }, s = function () { t(".rrssb-buttons").each(function (e) { var n = t(this), r = 0, i = 0, s, o, a = t("li.small", n).length; if (a === t("li", n).length) { var f = a * 42, l = parseFloat(t(n).width()); s = t("li.small", n).first(); o = parseFloat(t(s).attr("data-size")) + 55; if (f + o < l) { t(n).removeClass("small-format"); t("li.small", n).first().removeClass("small"); u(); } } else { t("li", n) .not(".small") .each(function (e) { var n = parseFloat(t(this).attr("data-size")) + 55, s = parseFloat(t(this).width()); r += s; i += n; }); var c = r - i; s = t("li.small", n).first(); o = parseFloat(t(s).attr("data-size")) + 55; if (o < c) { t(s).removeClass("small"); u(); } } }); }, o = function (e) { t(".rrssb-buttons").each(function (e) { var n = t(this), r = t("li", n).nextAll(), i = r.length; t(t("li", n).get().reverse()).each(function (e, r) { if (t(this).hasClass("small") === !1) { var i = parseFloat(t(this).attr("data-size")) + 55, o = parseFloat(t(this).width()); if (i > o) { var a = t("li", n).not(".small").last(); t(a).addClass("small"); u(); } } --r || s(); }); }); e === !0 && f(u); }, u = function () { t(".rrssb-buttons").each(function (e) { var n = t(this), i, s, o, u, a, f = t("li.small", n).length; if (f > 0 && f !== t("li", n).length) { t(n).removeClass("small-format"); t("li.small", n).css("width", "42px"); o = f * 42; i = t("li", n).not(".small").length; s = 100 / i; a = o / i; navigator.userAgent.indexOf("Chrome") >= 0 || navigator.userAgent.indexOf("Safari") >= 0 ? (u = "-webkit-calc(" + s + "% - " + a + "px)") : navigator.userAgent.indexOf("Firefox") >= 0 ? (u = "-moz-calc(" + s + "% - " + a + "px)") : (u = "calc(" + s + "% - " + a + "px)"); t("li", n).not(".small").css("width", u); } else if (f === t("li", n).length) { t(n).addClass("small-format"); r(); } else { t(n).removeClass("small-format"); r(); } }); i(); }, a = function () { t(".rrssb-buttons").each(function (e) { t(this).addClass("rrssb-" + (e + 1)); }); r(); t(".rrssb-buttons li .rrssb-text").each(function (e) { var n = parseFloat(t(this).width()); t(this).closest("li").attr("data-size", n); }); o(!0); }, f = function (e) { t(".rrssb-buttons li.small").removeClass("small"); o(); e(); }, l = function (t, r, i, s) { var o = e.screenLeft !== n ? e.screenLeft : screen.left, u = e.screenTop !== n ? e.screenTop : screen.top, a = e.innerWidth ? e.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width, f = e.innerHeight ? e.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height, l = a / 2 - i / 2 + o, c = f / 3 - s / 3 + u, h = e.open( t, r, "scrollbars=yes, width=" + i + ", height=" + s + ", top=" + c + ", left=" + l ); e.focus && h.focus(); }, c = (function () { var e = {}; return function (t, n, r) { r || (r = "Don't call this twice without a uniqueId"); e[r] && clearTimeout(e[r]); e[r] = setTimeout(t, n); }; })(); t(document).ready(function () { t(".rrssb-buttons a.popup").on("click", function (e) { var n = t(this); l(n.attr("href"), n.find(".rrssb-text").html(), 580, 470); e.preventDefault(); }); t(e).resize(function () { f(u); c( function () { f(u); }, 200, "finished resizing" ); }); a(); }); e.rrssbInit = a; })(window, jQuery); /* Load the YouTube API */ var ytTag = document.createElement("script"); ytTag.src = "https://www.youtube.com/player_api"; var ytFirstScriptTag = document.getElementsByTagName("script")[0]; ytFirstScriptTag.parentNode.insertBefore(ytTag, ytFirstScriptTag); // Replace the 'ytplayer_*' element(s) with an <iframe> and // YouTube player after the API code downloads. var ytPlayer; function onYouTubePlayerAPIReady() { $("[id^=ytplayer_]").each(function () { var varray = this.id.split("_"); // ignore varray[0] (ytplayer) we don't need it anymore var vwidth = varray[1]; var vheight = varray[2]; // since "_" is a valid yt video id character and javascript split's limit doesn't combine the leftovers we need to combine manually... var vidid = varray[3]; for (var i = 4; i < varray.length; i++) { vidid += "_" + varray[i]; } ytPlayer = new YT.Player(this.id, { width: vwidth, height: vheight, videoId: vidid, playerVars: { autohide: 1, showinfo: 0, rel: 0, wmode: "transparent", }, events: { onReady: onPlayerReady, }, }); }); } function onPlayerReady(event) { if (viewport().width > 990) { // adjust main content height if sidebar is longer if ($("#sidebar").length > 0) { if ($("#sidebar").height() > $("#main").height()) { maxColHeight = $("#sidebar").height(); $("#main").height(maxColHeight); } } } } /* function onPlayerStateChange(event) { if (event.data == YT.PlayerState.BUFFERING) { event.target.setPlaybackQuality('hd720'); } }*/ /*! * @fileOverview TouchSwipe - jQuery Plugin * @version 1.6.18 * * @author Matt Bryson http://www.github.com/mattbryson * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin * @see http://labs.rampinteractive.co.uk/touchSwipe/ * @see http://plugins.jquery.com/project/touchSwipe * @license * Copyright (c) 2010-2015 Matt Bryson * Dual licensed under the MIT or GPL Version 2 licenses. * */ !(function (factory) { "function" == typeof define && define.amd && define.amd.jQuery ? define(["jquery"], factory) : factory( "undefined" != typeof module && module.exports ? require("jquery") : jQuery ); })(function ($) { "use strict"; function init(options) { return ( !options || void 0 !== options.allowPageScroll || (void 0 === options.swipe && void 0 === options.swipeStatus) || (options.allowPageScroll = NONE), void 0 !== options.click && void 0 === options.tap && (options.tap = options.click), options || (options = {}), (options = $.extend({}, $.fn.swipe.defaults, options)), this.each(function () { var $this = $(this), plugin = $this.data(PLUGIN_NS); plugin || ((plugin = new TouchSwipe(this, options)), $this.data(PLUGIN_NS, plugin)); }) ); } function TouchSwipe(element, options) { function touchStart(jqEvent) { if ( !( getTouchInProgress() || $(jqEvent.target).closest(options.excludedElements, $element).length > 0 ) ) { var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; if ( !event.pointerType || "mouse" != event.pointerType || 0 != options.fallbackToMouseEvents ) { var ret, touches = event.touches, evt = touches ? touches[0] : event; return ( (phase = PHASE_START), touches ? (fingerCount = touches.length) : options.preventDefaultEvents !== !1 && jqEvent.preventDefault(), (distance = 0), (direction = null), (currentDirection = null), (pinchDirection = null), (duration = 0), (startTouchesDistance = 0), (endTouchesDistance = 0), (pinchZoom = 1), (pinchDistance = 0), (maximumsMap = createMaximumsData()), cancelMultiFingerRelease(), createFingerData(0, evt), !touches || fingerCount === options.fingers || options.fingers === ALL_FINGERS || hasPinches() ? ((startTime = getTimeStamp()), 2 == fingerCount && (createFingerData(1, touches[1]), (startTouchesDistance = endTouchesDistance = calculateTouchesDistance( fingerData[0].start, fingerData[1].start ))), (options.swipeStatus || options.pinchStatus) && (ret = triggerHandler(event, phase))) : (ret = !1), ret === !1 ? ((phase = PHASE_CANCEL), triggerHandler(event, phase), ret) : (options.hold && (holdTimeout = setTimeout( $.proxy(function () { $element.trigger("hold", [event.target]), options.hold && (ret = options.hold.call( $element, event, event.target )); }, this), options.longTapThreshold )), setTouchInProgress(!0), null) ); } } } function touchMove(jqEvent) { var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; if ( phase !== PHASE_END && phase !== PHASE_CANCEL && !inMultiFingerRelease() ) { var ret, touches = event.touches, evt = touches ? touches[0] : event, currentFinger = updateFingerData(evt); if ( ((endTime = getTimeStamp()), touches && (fingerCount = touches.length), options.hold && clearTimeout(holdTimeout), (phase = PHASE_MOVE), 2 == fingerCount && (0 == startTouchesDistance ? (createFingerData(1, touches[1]), (startTouchesDistance = endTouchesDistance = calculateTouchesDistance( fingerData[0].start, fingerData[1].start ))) : (updateFingerData(touches[1]), (endTouchesDistance = calculateTouchesDistance( fingerData[0].end, fingerData[1].end )), (pinchDirection = calculatePinchDirection( fingerData[0].end, fingerData[1].end ))), (pinchZoom = calculatePinchZoom( startTouchesDistance, endTouchesDistance )), (pinchDistance = Math.abs( startTouchesDistance - endTouchesDistance ))), fingerCount === options.fingers || options.fingers === ALL_FINGERS || !touches || hasPinches()) ) { if ( ((direction = calculateDirection( currentFinger.start, currentFinger.end )), (currentDirection = calculateDirection( currentFinger.last, currentFinger.end )), validateDefaultEvent(jqEvent, currentDirection), (distance = calculateDistance( currentFinger.start, currentFinger.end )), (duration = calculateDuration()), setMaxDistance(direction, distance), (ret = triggerHandler(event, phase)), !options.triggerOnTouchEnd || options.triggerOnTouchLeave) ) { var inBounds = !0; if (options.triggerOnTouchLeave) { var bounds = getbounds(this); inBounds = isInBounds(currentFinger.end, bounds); } !options.triggerOnTouchEnd && inBounds ? (phase = getNextPhase(PHASE_MOVE)) : options.triggerOnTouchLeave && !inBounds && (phase = getNextPhase(PHASE_END)), (phase != PHASE_CANCEL && phase != PHASE_END) || triggerHandler(event, phase); } } else (phase = PHASE_CANCEL), triggerHandler(event, phase); ret === !1 && ((phase = PHASE_CANCEL), triggerHandler(event, phase)); } } function touchEnd(jqEvent) { var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent, touches = event.touches; if (touches) { if (touches.length && !inMultiFingerRelease()) return startMultiFingerRelease(event), !0; if (touches.length && inMultiFingerRelease()) return !0; } return ( inMultiFingerRelease() && (fingerCount = fingerCountAtRelease), (endTime = getTimeStamp()), (duration = calculateDuration()), didSwipeBackToCancel() || !validateSwipeDistance() ? ((phase = PHASE_CANCEL), triggerHandler(event, phase)) : options.triggerOnTouchEnd || (options.triggerOnTouchEnd === !1 && phase === PHASE_MOVE) ? (options.preventDefaultEvents !== !1 && jqEvent.preventDefault(), (phase = PHASE_END), triggerHandler(event, phase)) : !options.triggerOnTouchEnd && hasTap() ? ((phase = PHASE_END), triggerHandlerForGesture(event, phase, TAP)) : phase === PHASE_MOVE && ((phase = PHASE_CANCEL), triggerHandler(event, phase)), setTouchInProgress(!1), null ); } function touchCancel() { (fingerCount = 0), (endTime = 0), (startTime = 0), (startTouchesDistance = 0), (endTouchesDistance = 0), (pinchZoom = 1), cancelMultiFingerRelease(), setTouchInProgress(!1); } function touchLeave(jqEvent) { var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent; options.triggerOnTouchLeave && ((phase = getNextPhase(PHASE_END)), triggerHandler(event, phase)); } function removeListeners() { $element.unbind(START_EV, touchStart), $element.unbind(CANCEL_EV, touchCancel), $element.unbind(MOVE_EV, touchMove), $element.unbind(END_EV, touchEnd), LEAVE_EV && $element.unbind(LEAVE_EV, touchLeave), setTouchInProgress(!1); } function getNextPhase(currentPhase) { var nextPhase = currentPhase, validTime = validateSwipeTime(), validDistance = validateSwipeDistance(), didCancel = didSwipeBackToCancel(); return ( !validTime || didCancel ? (nextPhase = PHASE_CANCEL) : !validDistance || currentPhase != PHASE_MOVE || (options.triggerOnTouchEnd && !options.triggerOnTouchLeave) ? !validDistance && currentPhase == PHASE_END && options.triggerOnTouchLeave && (nextPhase = PHASE_CANCEL) : (nextPhase = PHASE_END), nextPhase ); } function triggerHandler(event, phase) { var ret, touches = event.touches; return ( (didSwipe() || hasSwipes()) && (ret = triggerHandlerForGesture(event, phase, SWIPE)), (didPinch() || hasPinches()) && ret !== !1 && (ret = triggerHandlerForGesture(event, phase, PINCH)), didDoubleTap() && ret !== !1 ? (ret = triggerHandlerForGesture(event, phase, DOUBLE_TAP)) : didLongTap() && ret !== !1 ? (ret = triggerHandlerForGesture(event, phase, LONG_TAP)) : didTap() && ret !== !1 && (ret = triggerHandlerForGesture(event, phase, TAP)), phase === PHASE_CANCEL && touchCancel(event), phase === PHASE_END && (touches ? touches.length || touchCancel(event) : touchCancel(event)), ret ); } function triggerHandlerForGesture(event, phase, gesture) { var ret; if (gesture == SWIPE) { if ( ($element.trigger("swipeStatus", [ phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection, ]), options.swipeStatus && ((ret = options.swipeStatus.call( $element, event, phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection )), ret === !1)) ) return !1; if (phase == PHASE_END && validateSwipe()) { if ( (clearTimeout(singleTapTimeout), clearTimeout(holdTimeout), $element.trigger("swipe", [ direction, distance, duration, fingerCount, fingerData, currentDirection, ]), options.swipe && ((ret = options.swipe.call( $element, event, direction, distance, duration, fingerCount, fingerData, currentDirection )), ret === !1)) ) return !1; switch (direction) { case LEFT: $element.trigger("swipeLeft", [ direction, distance, duration, fingerCount, fingerData, currentDirection, ]), options.swipeLeft && (ret = options.swipeLeft.call( $element, event, direction, distance, duration, fingerCount, fingerData, currentDirection )); break; case RIGHT: $element.trigger("swipeRight", [ direction, distance, duration, fingerCount, fingerData, currentDirection, ]), options.swipeRight && (ret = options.swipeRight.call( $element, event, direction, distance, duration, fingerCount, fingerData, currentDirection )); break; case UP: $element.trigger("swipeUp", [ direction, distance, duration, fingerCount, fingerData, currentDirection, ]), options.swipeUp && (ret = options.swipeUp.call( $element, event, direction, distance, duration, fingerCount, fingerData, currentDirection )); break; case DOWN: $element.trigger("swipeDown", [ direction, distance, duration, fingerCount, fingerData, currentDirection, ]), options.swipeDown && (ret = options.swipeDown.call( $element, event, direction, distance, duration, fingerCount, fingerData, currentDirection )); } } } if (gesture == PINCH) { if ( ($element.trigger("pinchStatus", [ phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData, ]), options.pinchStatus && ((ret = options.pinchStatus.call( $element, event, phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData )), ret === !1)) ) return !1; if (phase == PHASE_END && validatePinch()) switch (pinchDirection) { case IN: $element.trigger("pinchIn", [ pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData, ]), options.pinchIn && (ret = options.pinchIn.call( $element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData )); break; case OUT: $element.trigger("pinchOut", [ pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData, ]), options.pinchOut && (ret = options.pinchOut.call( $element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData )); } } return ( gesture == TAP ? (phase !== PHASE_CANCEL && phase !== PHASE_END) || (clearTimeout(singleTapTimeout), clearTimeout(holdTimeout), hasDoubleTap() && !inDoubleTap() ? ((doubleTapStartTime = getTimeStamp()), (singleTapTimeout = setTimeout( $.proxy(function () { (doubleTapStartTime = null), $element.trigger("tap", [event.target]), options.tap && (ret = options.tap.call($element, event, event.target)); }, this), options.doubleTapThreshold ))) : ((doubleTapStartTime = null), $element.trigger("tap", [event.target]), options.tap && (ret = options.tap.call($element, event, event.target)))) : gesture == DOUBLE_TAP ? (phase !== PHASE_CANCEL && phase !== PHASE_END) || (clearTimeout(singleTapTimeout), clearTimeout(holdTimeout), (doubleTapStartTime = null), $element.trigger("doubletap", [event.target]), options.doubleTap && (ret = options.doubleTap.call($element, event, event.target))) : gesture == LONG_TAP && ((phase !== PHASE_CANCEL && phase !== PHASE_END) || (clearTimeout(singleTapTimeout), (doubleTapStartTime = null), $element.trigger("longtap", [event.target]), options.longTap && (ret = options.longTap.call($element, event, event.target)))), ret ); } function validateSwipeDistance() { var valid = !0; return ( null !== options.threshold && (valid = distance >= options.threshold), valid ); } function didSwipeBackToCancel() { var cancelled = !1; return ( null !== options.cancelThreshold && null !== direction && (cancelled = getMaxDistance(direction) - distance >= options.cancelThreshold), cancelled ); } function validatePinchDistance() { return null !== options.pinchThreshold ? pinchDistance >= options.pinchThreshold : !0; } function validateSwipeTime() { var result; return (result = options.maxTimeThreshold ? !(duration >= options.maxTimeThreshold) : !0); } function validateDefaultEvent(jqEvent, direction) { if (options.preventDefaultEvents !== !1) if (options.allowPageScroll === NONE) jqEvent.preventDefault(); else { var auto = options.allowPageScroll === AUTO; switch (direction) { case LEFT: ((options.swipeLeft && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) && jqEvent.preventDefault(); break; case RIGHT: ((options.swipeRight && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) && jqEvent.preventDefault(); break; case UP: ((options.swipeUp && auto) || (!auto && options.allowPageScroll != VERTICAL)) && jqEvent.preventDefault(); break; case DOWN: ((options.swipeDown && auto) || (!auto && options.allowPageScroll != VERTICAL)) && jqEvent.preventDefault(); break; case NONE: } } } function validatePinch() { var hasCorrectFingerCount = validateFingers(), hasEndPoint = validateEndPoint(), hasCorrectDistance = validatePinchDistance(); return hasCorrectFingerCount && hasEndPoint && hasCorrectDistance; } function hasPinches() { return !!(options.pinchStatus || options.pinchIn || options.pinchOut); } function didPinch() { return !(!validatePinch() || !hasPinches()); } function validateSwipe() { var hasValidTime = validateSwipeTime(), hasValidDistance = validateSwipeDistance(), hasCorrectFingerCount = validateFingers(), hasEndPoint = validateEndPoint(), didCancel = didSwipeBackToCancel(), valid = !didCancel && hasEndPoint && hasCorrectFingerCount && hasValidDistance && hasValidTime; return valid; } function hasSwipes() { return !!( options.swipe || options.swipeStatus || options.swipeLeft || options.swipeRight || options.swipeUp || options.swipeDown ); } function didSwipe() { return !(!validateSwipe() || !hasSwipes()); } function validateFingers() { return ( fingerCount === options.fingers || options.fingers === ALL_FINGERS || !SUPPORTS_TOUCH ); } function validateEndPoint() { return 0 !== fingerData[0].end.x; } function hasTap() { return !!options.tap; } function hasDoubleTap() { return !!options.doubleTap; } function hasLongTap() { return !!options.longTap; } function validateDoubleTap() { if (null == doubleTapStartTime) return !1; var now = getTimeStamp(); return ( hasDoubleTap() && now - doubleTapStartTime <= options.doubleTapThreshold ); } function inDoubleTap() { return validateDoubleTap(); } function validateTap() { return ( (1 === fingerCount || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold) ); } function validateLongTap() { return ( duration > options.longTapThreshold && DOUBLE_TAP_THRESHOLD > distance ); } function didTap() { return !(!validateTap() || !hasTap()); } function didDoubleTap() { return !(!validateDoubleTap() || !hasDoubleTap()); } function didLongTap() { return !(!validateLongTap() || !hasLongTap()); } function startMultiFingerRelease(event) { (previousTouchEndTime = getTimeStamp()), (fingerCountAtRelease = event.touches.length + 1); } function cancelMultiFingerRelease() { (previousTouchEndTime = 0), (fingerCountAtRelease = 0); } function inMultiFingerRelease() { var withinThreshold = !1; if (previousTouchEndTime) { var diff = getTimeStamp() - previousTouchEndTime; diff <= options.fingerReleaseThreshold && (withinThreshold = !0); } return withinThreshold; } function getTouchInProgress() { return !($element.data(PLUGIN_NS + "_intouch") !== !0); } function setTouchInProgress(val) { $element && (val === !0 ? ($element.bind(MOVE_EV, touchMove), $element.bind(END_EV, touchEnd), LEAVE_EV && $element.bind(LEAVE_EV, touchLeave)) : ($element.unbind(MOVE_EV, touchMove, !1), $element.unbind(END_EV, touchEnd, !1), LEAVE_EV && $element.unbind(LEAVE_EV, touchLeave, !1)), $element.data(PLUGIN_NS + "_intouch", val === !0)); } function createFingerData(id, evt) { var f = { start: { x: 0, y: 0 }, last: { x: 0, y: 0 }, end: { x: 0, y: 0 }, }; return ( (f.start.x = f.last.x = f.end.x = evt.pageX || evt.clientX), (f.start.y = f.last.y = f.end.y = evt.pageY || evt.clientY), (fingerData[id] = f), f ); } function updateFingerData(evt) { var id = void 0 !== evt.identifier ? evt.identifier : 0, f = getFingerData(id); return ( null === f && (f = createFingerData(id, evt)), (f.last.x = f.end.x), (f.last.y = f.end.y), (f.end.x = evt.pageX || evt.clientX), (f.end.y = evt.pageY || evt.clientY), f ); } function getFingerData(id) { return fingerData[id] || null; } function setMaxDistance(direction, distance) { direction != NONE && ((distance = Math.max(distance, getMaxDistance(direction))), (maximumsMap[direction].distance = distance)); } function getMaxDistance(direction) { return maximumsMap[direction] ? maximumsMap[direction].distance : void 0; } function createMaximumsData() { var maxData = {}; return ( (maxData[LEFT] = createMaximumVO(LEFT)), (maxData[RIGHT] = createMaximumVO(RIGHT)), (maxData[UP] = createMaximumVO(UP)), (maxData[DOWN] = createMaximumVO(DOWN)), maxData ); } function createMaximumVO(dir) { return { direction: dir, distance: 0 }; } function calculateDuration() { return endTime - startTime; } function calculateTouchesDistance(startPoint, endPoint) { var diffX = Math.abs(startPoint.x - endPoint.x), diffY = Math.abs(startPoint.y - endPoint.y); return Math.round(Math.sqrt(diffX * diffX + diffY * diffY)); } function calculatePinchZoom(startDistance, endDistance) { var percent = (endDistance / startDistance) * 1; return percent.toFixed(2); } function calculatePinchDirection() { return 1 > pinchZoom ? OUT : IN; } function calculateDistance(startPoint, endPoint) { return Math.round( Math.sqrt( Math.pow(endPoint.x - startPoint.x, 2) + Math.pow(endPoint.y - startPoint.y, 2) ) ); } function calculateAngle(startPoint, endPoint) { var x = startPoint.x - endPoint.x, y = endPoint.y - startPoint.y, r = Math.atan2(y, x), angle = Math.round((180 * r) / Math.PI); return 0 > angle && (angle = 360 - Math.abs(angle)), angle; } function calculateDirection(startPoint, endPoint) { if (comparePoints(startPoint, endPoint)) return NONE; var angle = calculateAngle(startPoint, endPoint); return 45 >= angle && angle >= 0 ? LEFT : 360 >= angle && angle >= 315 ? LEFT : angle >= 135 && 225 >= angle ? RIGHT : angle > 45 && 135 > angle ? DOWN : UP; } function getTimeStamp() { var now = new Date(); return now.getTime(); } function getbounds(el) { el = $(el); var offset = el.offset(), bounds = { left: offset.left, right: offset.left + el.outerWidth(), top: offset.top, bottom: offset.top + el.outerHeight(), }; return bounds; } function isInBounds(point, bounds) { return ( point.x > bounds.left && point.x < bounds.right && point.y > bounds.top && point.y < bounds.bottom ); } function comparePoints(pointA, pointB) { return pointA.x == pointB.x && pointA.y == pointB.y; } var options = $.extend({}, options), useTouchEvents = SUPPORTS_TOUCH || SUPPORTS_POINTER || !options.fallbackToMouseEvents, START_EV = useTouchEvents ? SUPPORTS_POINTER ? SUPPORTS_POINTER_IE10 ? "MSPointerDown" : "pointerdown" : "touchstart" : "mousedown", MOVE_EV = useTouchEvents ? SUPPORTS_POINTER ? SUPPORTS_POINTER_IE10 ? "MSPointerMove" : "pointermove" : "touchmove" : "mousemove", END_EV = useTouchEvents ? SUPPORTS_POINTER ? SUPPORTS_POINTER_IE10 ? "MSPointerUp" : "pointerup" : "touchend" : "mouseup", LEAVE_EV = useTouchEvents ? SUPPORTS_POINTER ? "mouseleave" : null : "mouseleave", CANCEL_EV = SUPPORTS_POINTER ? SUPPORTS_POINTER_IE10 ? "MSPointerCancel" : "pointercancel" : "touchcancel", distance = 0, direction = null, currentDirection = null, duration = 0, startTouchesDistance = 0, endTouchesDistance = 0, pinchZoom = 1, pinchDistance = 0, pinchDirection = 0, maximumsMap = null, $element = $(element), phase = "start", fingerCount = 0, fingerData = {}, startTime = 0, endTime = 0, previousTouchEndTime = 0, fingerCountAtRelease = 0, doubleTapStartTime = 0, singleTapTimeout = null, holdTimeout = null; try { $element.bind(START_EV, touchStart), $element.bind(CANCEL_EV, touchCancel); } catch (e) { $.error( "events not supported " + START_EV + "," + CANCEL_EV + " on jQuery.swipe" ); } (this.enable = function () { return ( this.disable(), $element.bind(START_EV, touchStart), $element.bind(CANCEL_EV, touchCancel), $element ); }), (this.disable = function () { return removeListeners(), $element; }), (this.destroy = function () { removeListeners(), $element.data(PLUGIN_NS, null), ($element = null); }), (this.option = function (property, value) { if ("object" == typeof property) options = $.extend(options, property); else if (void 0 !== options[property]) { if (void 0 === value) return options[property]; options[property] = value; } else { if (!property) return options; $.error( "Option " + property + " does not exist on jQuery.swipe.options" ); } return null; }); } var VERSION = "1.6.18", LEFT = "left", RIGHT = "right", UP = "up", DOWN = "down", IN = "in", OUT = "out", NONE = "none", AUTO = "auto", SWIPE = "swipe", PINCH = "pinch", TAP = "tap", DOUBLE_TAP = "doubletap", LONG_TAP = "longtap", HORIZONTAL = "horizontal", VERTICAL = "vertical", ALL_FINGERS = "all", DOUBLE_TAP_THRESHOLD = 10, PHASE_START = "start", PHASE_MOVE = "move", PHASE_END = "end", PHASE_CANCEL = "cancel", SUPPORTS_TOUCH = "ontouchstart" in window, SUPPORTS_POINTER_IE10 = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled && !SUPPORTS_TOUCH, SUPPORTS_POINTER = (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) && !SUPPORTS_TOUCH, PLUGIN_NS = "TouchSwipe", defaults = { fingers: 1, threshold: 75, cancelThreshold: null, pinchThreshold: 20, maxTimeThreshold: null, fingerReleaseThreshold: 250, longTapThreshold: 500, doubleTapThreshold: 200, swipe: null, swipeLeft: null, swipeRight: null, swipeUp: null, swipeDown: null, swipeStatus: null, pinchIn: null, pinchOut: null, pinchStatus: null, click: null, tap: null, doubleTap: null, longTap: null, hold: null, triggerOnTouchEnd: !0, triggerOnTouchLeave: !1, allowPageScroll: "auto", fallbackToMouseEvents: !0, excludedElements: ".noSwipe", preventDefaultEvents: !0, }; ($.fn.swipe = function (method) { var $this = $(this), plugin = $this.data(PLUGIN_NS); if (plugin && "string" == typeof method) { if (plugin[method]) return plugin[method].apply( plugin, Array.prototype.slice.call(arguments, 1) ); $.error("Method " + method + " does not exist on jQuery.swipe"); } else if (plugin && "object" == typeof method) plugin.option.apply(plugin, arguments); else if (!(plugin || ("object" != typeof method && method))) return init.apply(this, arguments); return $this; }), ($.fn.swipe.version = VERSION), ($.fn.swipe.defaults = defaults), ($.fn.swipe.phases = { PHASE_START: PHASE_START, PHASE_MOVE: PHASE_MOVE, PHASE_END: PHASE_END, PHASE_CANCEL: PHASE_CANCEL, }), ($.fn.swipe.directions = { LEFT: LEFT, RIGHT: RIGHT, UP: UP, DOWN: DOWN, IN: IN, OUT: OUT, }), ($.fn.swipe.pageScroll = { NONE: NONE, HORIZONTAL: HORIZONTAL, VERTICAL: VERTICAL, AUTO: AUTO, }), ($.fn.swipe.fingers = { ONE: 1, TWO: 2, THREE: 3, FOUR: 4, FIVE: 5, ALL: ALL_FINGERS, }); }); /*! http://tinynav.viljamis.com v1.2 by @viljamis */ (function (a, k, g) { a.fn.tinyNav = function (l) { var c = a.extend( { active: "selected", header: "", indent: "- ", label: "" }, l ); return this.each(function () { g++; var h = a(this), b = "tinynav" + g, f = ".l_" + b, e = a("<select/>") .attr("id", b) .addClass("tinynav " + b); if (h.is("ul,ol")) { "" !== c.header && e.append(a("<option/>").text(c.header)); var d = ""; h.addClass("l_" + b) .find("a") .each(function () { d += '<option value="' + a(this).attr("href") + '">'; var b; for (b = 0; b < a(this).parents("ul, ol").length - 1; b++) d += c.indent; d += a(this).text() + "</option>"; }); e.append(d); c.header || e .find(":eq(" + a(f + " li").index(a(f + " li." + c.active)) + ")") .attr("selected", !0); e.change(function () { k.location.href = a(this).val(); }); a(f).after(e); c.label && e.before( a("<label/>") .attr("for", b) .addClass("tinynav_label " + b + "_label") .append(c.label) ); } }); }; })(jQuery, this, 0); /* Chosen v1.5.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ (function () { var a, AbstractChosen, Chosen, SelectParser, b, c = {}.hasOwnProperty, d = function (a, b) { function d() { this.constructor = a; } for (var e in b) c.call(b, e) && (a[e] = b[e]); return ( (d.prototype = b.prototype), (a.prototype = new d()), (a.__super__ = b.prototype), a ); }; (SelectParser = (function () { function SelectParser() { (this.options_index = 0), (this.parsed = []); } return ( (SelectParser.prototype.add_node = function (a) { return "OPTGROUP" === a.nodeName.toUpperCase() ? this.add_group(a) : this.add_option(a); }), (SelectParser.prototype.add_group = function (a) { var b, c, d, e, f, g; for ( b = this.parsed.length, this.parsed.push({ array_index: b, group: !0, label: this.escapeExpression(a.label), title: a.title ? a.title : void 0, children: 0, disabled: a.disabled, classes: a.className, }), f = a.childNodes, g = [], d = 0, e = f.length; e > d; d++ ) (c = f[d]), g.push(this.add_option(c, b, a.disabled)); return g; }), (SelectParser.prototype.add_option = function (a, b, c) { return "OPTION" === a.nodeName.toUpperCase() ? ("" !== a.text ? (null != b && (this.parsed[b].children += 1), this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, value: a.value, text: a.text, html: a.innerHTML, title: a.title ? a.title : void 0, selected: a.selected, disabled: c === !0 ? c : a.disabled, group_array_index: b, group_label: null != b ? this.parsed[b].label : null, classes: a.className, style: a.style.cssText, })) : this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, empty: !0, }), (this.options_index += 1)) : void 0; }), (SelectParser.prototype.escapeExpression = function (a) { var b, c; return null == a || a === !1 ? "" : /[\&\<\>\"\'\`]/.test(a) ? ((b = { "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;", }), (c = /&(?!\w+;)|[\<\>\"\'\`]/g), a.replace(c, function (a) { return b[a] || "&amp;"; })) : a; }), SelectParser ); })()), (SelectParser.select_to_array = function (a) { var b, c, d, e, f; for ( c = new SelectParser(), f = a.childNodes, d = 0, e = f.length; e > d; d++ ) (b = f[d]), c.add_node(b); return c.parsed; }), (AbstractChosen = (function () { function AbstractChosen(a, b) { (this.form_field = a), (this.options = null != b ? b : {}), AbstractChosen.browser_is_supported() && ((this.is_multiple = this.form_field.multiple), this.set_default_text(), this.set_default_values(), this.setup(), this.set_up_html(), this.register_observers(), this.on_ready()); } return ( (AbstractChosen.prototype.set_default_values = function () { var a = this; return ( (this.click_test_action = function (b) { return a.test_active_click(b); }), (this.activate_action = function (b) { return a.activate_field(b); }), (this.active_field = !1), (this.mouse_on_container = !1), (this.results_showing = !1), (this.result_highlighted = null), (this.allow_single_deselect = null != this.options.allow_single_deselect && null != this.form_field.options[0] && "" === this.form_field.options[0].text ? this.options.allow_single_deselect : !1), (this.disable_search_threshold = this.options.disable_search_threshold || 0), (this.disable_search = this.options.disable_search || !1), (this.enable_split_word_search = null != this.options.enable_split_word_search ? this.options.enable_split_word_search : !0), (this.group_search = null != this.options.group_search ? this.options.group_search : !0), (this.search_contains = this.options.search_contains || !1), (this.single_backstroke_delete = null != this.options.single_backstroke_delete ? this.options.single_backstroke_delete : !0), (this.max_selected_options = this.options.max_selected_options || 1 / 0), (this.inherit_select_classes = this.options.inherit_select_classes || !1), (this.display_selected_options = null != this.options.display_selected_options ? this.options.display_selected_options : !0), (this.display_disabled_options = null != this.options.display_disabled_options ? this.options.display_disabled_options : !0), (this.include_group_label_in_selected = this.options.include_group_label_in_selected || !1), (this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY) ); }), (AbstractChosen.prototype.set_default_text = function () { return ( this.form_field.getAttribute("data-placeholder") ? (this.default_text = this.form_field.getAttribute( "data-placeholder" )) : this.is_multiple ? (this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text) : (this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text), (this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text) ); }), (AbstractChosen.prototype.choice_label = function (a) { return this.include_group_label_in_selected && null != a.group_label ? "<b class='group-name'>" + a.group_label + "</b>" + a.html : a.html; }), (AbstractChosen.prototype.mouse_enter = function () { return (this.mouse_on_container = !0); }), (AbstractChosen.prototype.mouse_leave = function () { return (this.mouse_on_container = !1); }), (AbstractChosen.prototype.input_focus = function (a) { var b = this; if (this.is_multiple) { if (!this.active_field) return setTimeout(function () { return b.container_mousedown(); }, 50); } else if (!this.active_field) return this.activate_field(); }), (AbstractChosen.prototype.input_blur = function (a) { var b = this; return this.mouse_on_container ? void 0 : ((this.active_field = !1), setTimeout(function () { return b.blur_test(); }, 100)); }), (AbstractChosen.prototype.results_option_build = function (a) { var b, c, d, e, f, g, h; for ( b = "", e = 0, h = this.results_data, f = 0, g = h.length; g > f && ((c = h[f]), (d = ""), (d = c.group ? this.result_add_group(c) : this.result_add_option(c)), "" !== d && (e++, (b += d)), (null != a ? a.first : void 0) && (c.selected && this.is_multiple ? this.choice_build(c) : c.selected && !this.is_multiple && this.single_set_selected_text(this.choice_label(c))), !(e >= this.max_shown_results)); f++ ); return b; }), (AbstractChosen.prototype.result_add_option = function (a) { var b, c; return a.search_match && this.include_option_in_results(a) ? ((b = []), a.disabled || (a.selected && this.is_multiple) || b.push("active-result"), !a.disabled || (a.selected && this.is_multiple) || b.push("disabled-result"), a.selected && b.push("result-selected"), null != a.group_array_index && b.push("group-option"), "" !== a.classes && b.push(a.classes), (c = document.createElement("li")), (c.className = b.join(" ")), (c.style.cssText = a.style), c.setAttribute("data-option-array-index", a.array_index), (c.innerHTML = a.search_text), a.title && (c.title = a.title), this.outerHTML(c)) : ""; }), (AbstractChosen.prototype.result_add_group = function (a) { var b, c; return (a.search_match || a.group_match) && a.active_options > 0 ? ((b = []), b.push("group-result"), a.classes && b.push(a.classes), (c = document.createElement("li")), (c.className = b.join(" ")), (c.innerHTML = a.search_text), a.title && (c.title = a.title), this.outerHTML(c)) : ""; }), (AbstractChosen.prototype.results_update_field = function () { return ( this.set_default_text(), this.is_multiple || this.results_reset_cleanup(), this.result_clear_highlight(), this.results_build(), this.results_showing ? this.winnow_results() : void 0 ); }), (AbstractChosen.prototype.reset_single_select_options = function () { var a, b, c, d, e; for (d = this.results_data, e = [], b = 0, c = d.length; c > b; b++) (a = d[b]), a.selected ? e.push((a.selected = !1)) : e.push(void 0); return e; }), (AbstractChosen.prototype.results_toggle = function () { return this.results_showing ? this.results_hide() : this.results_show(); }), (AbstractChosen.prototype.results_search = function (a) { return this.results_showing ? this.winnow_results() : this.results_show(); }), (AbstractChosen.prototype.winnow_results = function () { var a, b, c, d, e, f, g, h, i, j, k, l; for ( this.no_results_clear(), d = 0, f = this.get_search_text(), a = f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), i = new RegExp(a, "i"), c = this.get_search_regex(a), l = this.results_data, j = 0, k = l.length; k > j; j++ ) (b = l[j]), (b.search_match = !1), (e = null), this.include_option_in_results(b) && (b.group && ((b.group_match = !1), (b.active_options = 0)), null != b.group_array_index && this.results_data[b.group_array_index] && ((e = this.results_data[b.group_array_index]), 0 === e.active_options && e.search_match && (d += 1), (e.active_options += 1)), (b.search_text = b.group ? b.label : b.html), (!b.group || this.group_search) && ((b.search_match = this.search_string_match( b.search_text, c )), b.search_match && !b.group && (d += 1), b.search_match ? (f.length && ((g = b.search_text.search(i)), (h = b.search_text.substr(0, g + f.length) + "</em>" + b.search_text.substr(g + f.length)), (b.search_text = h.substr(0, g) + "<em>" + h.substr(g))), null != e && (e.group_match = !0)) : null != b.group_array_index && this.results_data[b.group_array_index].search_match && (b.search_match = !0))); return ( this.result_clear_highlight(), 1 > d && f.length ? (this.update_results_content(""), this.no_results(f)) : (this.update_results_content(this.results_option_build()), this.winnow_results_set_highlight()) ); }), (AbstractChosen.prototype.get_search_regex = function (a) { var b; return (b = this.search_contains ? "" : "^"), new RegExp(b + a, "i"); }), (AbstractChosen.prototype.search_string_match = function (a, b) { var c, d, e, f; if (b.test(a)) return !0; if ( this.enable_split_word_search && (a.indexOf(" ") >= 0 || 0 === a.indexOf("[")) && ((d = a.replace(/\[|\]/g, "").split(" ")), d.length) ) for (e = 0, f = d.length; f > e; e++) if (((c = d[e]), b.test(c))) return !0; }), (AbstractChosen.prototype.choices_count = function () { var a, b, c, d; if (null != this.selected_option_count) return this.selected_option_count; for ( this.selected_option_count = 0, d = this.form_field.options, b = 0, c = d.length; c > b; b++ ) (a = d[b]), a.selected && (this.selected_option_count += 1); return this.selected_option_count; }), (AbstractChosen.prototype.choices_click = function (a) { return ( a.preventDefault(), this.results_showing || this.is_disabled ? void 0 : this.results_show() ); }), (AbstractChosen.prototype.keyup_checker = function (a) { var b, c; switch ( ((b = null != (c = a.which) ? c : a.keyCode), this.search_field_scale(), b) ) { case 8: if ( this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0 ) return this.keydown_backstroke(); if (!this.pending_backstroke) return this.result_clear_highlight(), this.results_search(); break; case 13: if ((a.preventDefault(), this.results_showing)) return this.result_select(a); break; case 27: return this.results_showing && this.results_hide(), !0; case 9: case 38: case 40: case 16: case 91: case 17: case 18: break; default: return this.results_search(); } }), (AbstractChosen.prototype.clipboard_event_checker = function (a) { var b = this; return setTimeout(function () { return b.results_search(); }, 50); }), (AbstractChosen.prototype.container_width = function () { return null != this.options.width ? this.options.width : "" + this.form_field.offsetWidth + "px"; }), (AbstractChosen.prototype.include_option_in_results = function (a) { return this.is_multiple && !this.display_selected_options && a.selected ? !1 : !this.display_disabled_options && a.disabled ? !1 : a.empty ? !1 : !0; }), (AbstractChosen.prototype.search_results_touchstart = function (a) { return (this.touch_started = !0), this.search_results_mouseover(a); }), (AbstractChosen.prototype.search_results_touchmove = function (a) { return (this.touch_started = !1), this.search_results_mouseout(a); }), (AbstractChosen.prototype.search_results_touchend = function (a) { return this.touch_started ? this.search_results_mouseup(a) : void 0; }), (AbstractChosen.prototype.outerHTML = function (a) { var b; return a.outerHTML ? a.outerHTML : ((b = document.createElement("div")), b.appendChild(a), b.innerHTML); }), (AbstractChosen.browser_is_supported = function () { return /iP(od|hone)/i.test(window.navigator.userAgent) ? !1 : /Android/i.test(window.navigator.userAgent) && /Mobile/i.test(window.navigator.userAgent) ? !1 : /IEMobile/i.test(window.navigator.userAgent) ? !1 : /Windows Phone/i.test(window.navigator.userAgent) ? !1 : /BlackBerry/i.test(window.navigator.userAgent) ? !1 : /BB10/i.test(window.navigator.userAgent) ? !1 : "Microsoft Internet Explorer" === window.navigator.appName ? document.documentMode >= 8 : !0; }), (AbstractChosen.default_multiple_text = "Select Some Options"), (AbstractChosen.default_single_text = "Select an Option"), (AbstractChosen.default_no_result_text = "No results match"), AbstractChosen ); })()), (a = jQuery), a.fn.extend({ chosen: function (b) { return AbstractChosen.browser_is_supported() ? this.each(function (c) { var d, e; return ( (d = a(this)), (e = d.data("chosen")), "destroy" === b ? void (e instanceof Chosen && e.destroy()) : void ( e instanceof Chosen || d.data("chosen", new Chosen(this, b)) ) ); }) : this; }, }), (Chosen = (function (c) { function Chosen() { return (b = Chosen.__super__.constructor.apply(this, arguments)); } return ( d(Chosen, c), (Chosen.prototype.setup = function () { return ( (this.form_field_jq = a(this.form_field)), (this.current_selectedIndex = this.form_field.selectedIndex), (this.is_rtl = this.form_field_jq.hasClass("chosen-rtl")) ); }), (Chosen.prototype.set_up_html = function () { var b, c; return ( (b = ["chosen-container"]), b.push( "chosen-container-" + (this.is_multiple ? "multi" : "single") ), this.inherit_select_classes && this.form_field.className && b.push(this.form_field.className), this.is_rtl && b.push("chosen-rtl"), (c = { class: b.join(" "), style: "width: " + this.container_width() + ";", title: this.form_field.title, }), this.form_field.id.length && (c.id = this.form_field.id.replace(/[^\w]/g, "_") + "_chosen"), (this.container = a("<div />", c)), this.is_multiple ? this.container.html( '<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>' ) : this.container.html( '<a class="chosen-single chosen-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>' ), this.form_field_jq.hide().after(this.container), (this.dropdown = this.container.find("div.chosen-drop").first()), (this.search_field = this.container.find("input").first()), (this.search_results = this.container .find("ul.chosen-results") .first()), this.search_field_scale(), (this.search_no_results = this.container .find("li.no-results") .first()), this.is_multiple ? ((this.search_choices = this.container .find("ul.chosen-choices") .first()), (this.search_container = this.container .find("li.search-field") .first())) : ((this.search_container = this.container .find("div.chosen-search") .first()), (this.selected_item = this.container .find(".chosen-single") .first())), this.results_build(), this.set_tab_index(), this.set_label_behavior() ); }), (Chosen.prototype.on_ready = function () { return this.form_field_jq.trigger("chosen:ready", { chosen: this }); }), (Chosen.prototype.register_observers = function () { var a = this; return ( this.container.bind("touchstart.chosen", function (b) { return a.container_mousedown(b), b.preventDefault(); }), this.container.bind("touchend.chosen", function (b) { return a.container_mouseup(b), b.preventDefault(); }), this.container.bind("mousedown.chosen", function (b) { a.container_mousedown(b); }), this.container.bind("mouseup.chosen", function (b) { a.container_mouseup(b); }), this.container.bind("mouseenter.chosen", function (b) { a.mouse_enter(b); }), this.container.bind("mouseleave.chosen", function (b) { a.mouse_leave(b); }), this.search_results.bind("mouseup.chosen", function (b) { a.search_results_mouseup(b); }), this.search_results.bind("mouseover.chosen", function (b) { a.search_results_mouseover(b); }), this.search_results.bind("mouseout.chosen", function (b) { a.search_results_mouseout(b); }), this.search_results.bind( "mousewheel.chosen DOMMouseScroll.chosen", function (b) { a.search_results_mousewheel(b); } ), this.search_results.bind("touchstart.chosen", function (b) { a.search_results_touchstart(b); }), this.search_results.bind("touchmove.chosen", function (b) { a.search_results_touchmove(b); }), this.search_results.bind("touchend.chosen", function (b) { a.search_results_touchend(b); }), this.form_field_jq.bind("chosen:updated.chosen", function (b) { a.results_update_field(b); }), this.form_field_jq.bind("chosen:activate.chosen", function (b) { a.activate_field(b); }), this.form_field_jq.bind("chosen:open.chosen", function (b) { a.container_mousedown(b); }), this.form_field_jq.bind("chosen:close.chosen", function (b) { a.input_blur(b); }), this.search_field.bind("blur.chosen", function (b) { a.input_blur(b); }), this.search_field.bind("keyup.chosen", function (b) { a.keyup_checker(b); }), this.search_field.bind("keydown.chosen", function (b) { a.keydown_checker(b); }), this.search_field.bind("focus.chosen", function (b) { a.input_focus(b); }), this.search_field.bind("cut.chosen", function (b) { a.clipboard_event_checker(b); }), this.search_field.bind("paste.chosen", function (b) { a.clipboard_event_checker(b); }), this.is_multiple ? this.search_choices.bind("click.chosen", function (b) { a.choices_click(b); }) : this.container.bind("click.chosen", function (a) { a.preventDefault(); }) ); }), (Chosen.prototype.destroy = function () { return ( a(this.container[0].ownerDocument).unbind( "click.chosen", this.click_test_action ), this.search_field[0].tabIndex && (this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex), this.container.remove(), this.form_field_jq.removeData("chosen"), this.form_field_jq.show() ); }), (Chosen.prototype.search_field_disabled = function () { return ( (this.is_disabled = this.form_field_jq[0].disabled), this.is_disabled ? (this.container.addClass("chosen-disabled"), (this.search_field[0].disabled = !0), this.is_multiple || this.selected_item.unbind( "focus.chosen", this.activate_action ), this.close_field()) : (this.container.removeClass("chosen-disabled"), (this.search_field[0].disabled = !1), this.is_multiple ? void 0 : this.selected_item.bind( "focus.chosen", this.activate_action )) ); }), (Chosen.prototype.container_mousedown = function (b) { return this.is_disabled || (b && "mousedown" === b.type && !this.results_showing && b.preventDefault(), null != b && a(b.target).hasClass("search-choice-close")) ? void 0 : (this.active_field ? this.is_multiple || !b || (a(b.target)[0] !== this.selected_item[0] && !a(b.target).parents("a.chosen-single").length) || (b.preventDefault(), this.results_toggle()) : (this.is_multiple && this.search_field.val(""), a(this.container[0].ownerDocument).bind( "click.chosen", this.click_test_action ), this.results_show()), this.activate_field()); }), (Chosen.prototype.container_mouseup = function (a) { return "ABBR" !== a.target.nodeName || this.is_disabled ? void 0 : this.results_reset(a); }), (Chosen.prototype.search_results_mousewheel = function (a) { var b; return ( a.originalEvent && (b = a.originalEvent.deltaY || -a.originalEvent.wheelDelta || a.originalEvent.detail), null != b ? (a.preventDefault(), "DOMMouseScroll" === a.type && (b = 40 * b), this.search_results.scrollTop( b + this.search_results.scrollTop() )) : void 0 ); }), (Chosen.prototype.blur_test = function (a) { return !this.active_field && this.container.hasClass("chosen-container-active") ? this.close_field() : void 0; }), (Chosen.prototype.close_field = function () { return ( a(this.container[0].ownerDocument).unbind( "click.chosen", this.click_test_action ), (this.active_field = !1), this.results_hide(), this.container.removeClass("chosen-container-active"), this.clear_backstroke(), this.show_search_field_default(), this.search_field_scale() ); }), (Chosen.prototype.activate_field = function () { return ( this.container.addClass("chosen-container-active"), (this.active_field = !0), this.search_field.val(this.search_field.val()), this.search_field.focus() ); }), (Chosen.prototype.test_active_click = function (b) { var c; return ( (c = a(b.target).closest(".chosen-container")), c.length && this.container[0] === c[0] ? (this.active_field = !0) : this.close_field() ); }), (Chosen.prototype.results_build = function () { return ( (this.parsing = !0), (this.selected_option_count = null), (this.results_data = SelectParser.select_to_array(this.form_field)), this.is_multiple ? this.search_choices.find("li.search-choice").remove() : this.is_multiple || (this.single_set_selected_text(), this.disable_search || this.form_field.options.length <= this.disable_search_threshold ? ((this.search_field[0].readOnly = !0), this.container.addClass("chosen-container-single-nosearch")) : ((this.search_field[0].readOnly = !1), this.container.removeClass( "chosen-container-single-nosearch" ))), this.update_results_content( this.results_option_build({ first: !0 }) ), this.search_field_disabled(), this.show_search_field_default(), this.search_field_scale(), (this.parsing = !1) ); }), (Chosen.prototype.result_do_highlight = function (a) { var b, c, d, e, f; if (a.length) { if ( (this.result_clear_highlight(), (this.result_highlight = a), this.result_highlight.addClass("highlighted"), (d = parseInt(this.search_results.css("maxHeight"), 10)), (f = this.search_results.scrollTop()), (e = d + f), (c = this.result_highlight.position().top + this.search_results.scrollTop()), (b = c + this.result_highlight.outerHeight()), b >= e) ) return this.search_results.scrollTop(b - d > 0 ? b - d : 0); if (f > c) return this.search_results.scrollTop(c); } }), (Chosen.prototype.result_clear_highlight = function () { return ( this.result_highlight && this.result_highlight.removeClass("highlighted"), (this.result_highlight = null) ); }), (Chosen.prototype.results_show = function () { return this.is_multiple && this.max_selected_options <= this.choices_count() ? (this.form_field_jq.trigger("chosen:maxselected", { chosen: this, }), !1) : (this.container.addClass("chosen-with-drop"), (this.results_showing = !0), this.search_field.focus(), this.search_field.val(this.search_field.val()), this.winnow_results(), this.form_field_jq.trigger("chosen:showing_dropdown", { chosen: this, })); }), (Chosen.prototype.update_results_content = function (a) { return this.search_results.html(a); }), (Chosen.prototype.results_hide = function () { return ( this.results_showing && (this.result_clear_highlight(), this.container.removeClass("chosen-with-drop"), this.form_field_jq.trigger("chosen:hiding_dropdown", { chosen: this, })), (this.results_showing = !1) ); }), (Chosen.prototype.set_tab_index = function (a) { var b; return this.form_field.tabIndex ? ((b = this.form_field.tabIndex), (this.form_field.tabIndex = -1), (this.search_field[0].tabIndex = b)) : void 0; }), (Chosen.prototype.set_label_behavior = function () { var b = this; return ( (this.form_field_label = this.form_field_jq.parents("label")), !this.form_field_label.length && this.form_field.id.length && (this.form_field_label = a( "label[for='" + this.form_field.id + "']" )), this.form_field_label.length > 0 ? this.form_field_label.bind("click.chosen", function (a) { return b.is_multiple ? b.container_mousedown(a) : b.activate_field(); }) : void 0 ); }), (Chosen.prototype.show_search_field_default = function () { return this.is_multiple && this.choices_count() < 1 && !this.active_field ? (this.search_field.val(this.default_text), this.search_field.addClass("default")) : (this.search_field.val(""), this.search_field.removeClass("default")); }), (Chosen.prototype.search_results_mouseup = function (b) { var c; return ( (c = a(b.target).hasClass("active-result") ? a(b.target) : a(b.target).parents(".active-result").first()), c.length ? ((this.result_highlight = c), this.result_select(b), this.search_field.focus()) : void 0 ); }), (Chosen.prototype.search_results_mouseover = function (b) { var c; return ( (c = a(b.target).hasClass("active-result") ? a(b.target) : a(b.target).parents(".active-result").first()), c ? this.result_do_highlight(c) : void 0 ); }), (Chosen.prototype.search_results_mouseout = function (b) { return a(b.target).hasClass("active-result") ? this.result_clear_highlight() : void 0; }), (Chosen.prototype.choice_build = function (b) { var c, d, e = this; return ( (c = a("<li />", { class: "search-choice" }).html( "<span>" + this.choice_label(b) + "</span>" )), b.disabled ? c.addClass("search-choice-disabled") : ((d = a("<a />", { class: "search-choice-close", "data-option-array-index": b.array_index, })), d.bind("click.chosen", function (a) { return e.choice_destroy_link_click(a); }), c.append(d)), this.search_container.before(c) ); }), (Chosen.prototype.choice_destroy_link_click = function (b) { return ( b.preventDefault(), b.stopPropagation(), this.is_disabled ? void 0 : this.choice_destroy(a(b.target)) ); }), (Chosen.prototype.choice_destroy = function (a) { return this.result_deselect( a[0].getAttribute("data-option-array-index") ) ? (this.show_search_field_default(), this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1 && this.results_hide(), a.parents("li").first().remove(), this.search_field_scale()) : void 0; }), (Chosen.prototype.results_reset = function () { return ( this.reset_single_select_options(), (this.form_field.options[0].selected = !0), this.single_set_selected_text(), this.show_search_field_default(), this.results_reset_cleanup(), this.form_field_jq.trigger("change"), this.active_field ? this.results_hide() : void 0 ); }), (Chosen.prototype.results_reset_cleanup = function () { return ( (this.current_selectedIndex = this.form_field.selectedIndex), this.selected_item.find("abbr").remove() ); }), (Chosen.prototype.result_select = function (a) { var b, c; return this.result_highlight ? ((b = this.result_highlight), this.result_clear_highlight(), this.is_multiple && this.max_selected_options <= this.choices_count() ? (this.form_field_jq.trigger("chosen:maxselected", { chosen: this, }), !1) : (this.is_multiple ? b.removeClass("active-result") : this.reset_single_select_options(), b.addClass("result-selected"), (c = this.results_data[ b[0].getAttribute("data-option-array-index") ]), (c.selected = !0), (this.form_field.options[c.options_index].selected = !0), (this.selected_option_count = null), this.is_multiple ? this.choice_build(c) : this.single_set_selected_text(this.choice_label(c)), ((a.metaKey || a.ctrlKey) && this.is_multiple) || this.results_hide(), this.show_search_field_default(), (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) && this.form_field_jq.trigger("change", { selected: this.form_field.options[c.options_index].value, }), (this.current_selectedIndex = this.form_field.selectedIndex), a.preventDefault(), this.search_field_scale())) : void 0; }), (Chosen.prototype.single_set_selected_text = function (a) { return ( null == a && (a = this.default_text), a === this.default_text ? this.selected_item.addClass("chosen-default") : (this.single_deselect_control_build(), this.selected_item.removeClass("chosen-default")), this.selected_item.find("span").html(a) ); }), (Chosen.prototype.result_deselect = function (a) { var b; return ( (b = this.results_data[a]), this.form_field.options[b.options_index].disabled ? !1 : ((b.selected = !1), (this.form_field.options[b.options_index].selected = !1), (this.selected_option_count = null), this.result_clear_highlight(), this.results_showing && this.winnow_results(), this.form_field_jq.trigger("change", { deselected: this.form_field.options[b.options_index].value, }), this.search_field_scale(), !0) ); }), (Chosen.prototype.single_deselect_control_build = function () { return this.allow_single_deselect ? (this.selected_item.find("abbr").length || this.selected_item .find("span") .first() .after('<abbr class="search-choice-close"></abbr>'), this.selected_item.addClass("chosen-single-with-deselect")) : void 0; }), (Chosen.prototype.get_search_text = function () { return a("<div/>").text(a.trim(this.search_field.val())).html(); }), (Chosen.prototype.winnow_results_set_highlight = function () { var a, b; return ( (b = this.is_multiple ? [] : this.search_results.find(".result-selected.active-result")), (a = b.length ? b.first() : this.search_results.find(".active-result").first()), null != a ? this.result_do_highlight(a) : void 0 ); }), (Chosen.prototype.no_results = function (b) { var c; return ( (c = a( '<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>' )), c.find("span").first().html(b), this.search_results.append(c), this.form_field_jq.trigger("chosen:no_results", { chosen: this }) ); }), (Chosen.prototype.no_results_clear = function () { return this.search_results.find(".no-results").remove(); }), (Chosen.prototype.keydown_arrow = function () { var a; return this.results_showing && this.result_highlight ? (a = this.result_highlight.nextAll("li.active-result").first()) ? this.result_do_highlight(a) : void 0 : this.results_show(); }), (Chosen.prototype.keyup_arrow = function () { var a; return this.results_showing || this.is_multiple ? this.result_highlight ? ((a = this.result_highlight.prevAll("li.active-result")), a.length ? this.result_do_highlight(a.first()) : (this.choices_count() > 0 && this.results_hide(), this.result_clear_highlight())) : void 0 : this.results_show(); }), (Chosen.prototype.keydown_backstroke = function () { var a; return this.pending_backstroke ? (this.choice_destroy(this.pending_backstroke.find("a").first()), this.clear_backstroke()) : ((a = this.search_container.siblings("li.search-choice").last()), a.length && !a.hasClass("search-choice-disabled") ? ((this.pending_backstroke = a), this.single_backstroke_delete ? this.keydown_backstroke() : this.pending_backstroke.addClass("search-choice-focus")) : void 0); }), (Chosen.prototype.clear_backstroke = function () { return ( this.pending_backstroke && this.pending_backstroke.removeClass("search-choice-focus"), (this.pending_backstroke = null) ); }), (Chosen.prototype.keydown_checker = function (a) { var b, c; switch ( ((b = null != (c = a.which) ? c : a.keyCode), this.search_field_scale(), 8 !== b && this.pending_backstroke && this.clear_backstroke(), b) ) { case 8: this.backstroke_length = this.search_field.val().length; break; case 9: this.results_showing && !this.is_multiple && this.result_select(a), (this.mouse_on_container = !1); break; case 13: this.results_showing && a.preventDefault(); break; case 32: this.disable_search && a.preventDefault(); break; case 38: a.preventDefault(), this.keyup_arrow(); break; case 40: a.preventDefault(), this.keydown_arrow(); } }), (Chosen.prototype.search_field_scale = function () { var b, c, d, e, f, g, h, i, j; if (this.is_multiple) { for ( d = 0, h = 0, f = "position:absolute; left: -1000px; top: -1000px; display:none;", g = [ "font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing", ], i = 0, j = g.length; j > i; i++ ) (e = g[i]), (f += e + ":" + this.search_field.css(e) + ";"); return ( (b = a("<div />", { style: f })), b.text(this.search_field.val()), a("body").append(b), (h = b.width() + 25), b.remove(), (c = this.container.outerWidth()), h > c - 10 && (h = c - 10), this.search_field.css({ width: h + "px" }) ); } }), Chosen ); })(AbstractChosen)); }.call(this)); /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ (function (r, G, f, v) { var J = f("html"), n = f(r), p = f(G), b = (f.fancybox = function () { b.open.apply(this, arguments); }), I = navigator.userAgent.match(/msie/i), B = null, s = G.createTouch !== v, t = function (a) { return a && a.hasOwnProperty && a instanceof f; }, q = function (a) { return a && "string" === f.type(a); }, E = function (a) { return q(a) && 0 < a.indexOf("%"); }, l = function (a, d) { var e = parseInt(a, 10) || 0; d && E(a) && (e *= b.getViewport()[d] / 100); return Math.ceil(e); }, w = function (a, b) { return l(a, b) + "px"; }; f.extend(b, { version: "2.1.5", defaults: { padding: 15, margin: 20, width: 800, height: 600, minWidth: 100, minHeight: 100, maxWidth: 9999, maxHeight: 9999, pixelRatio: 1, autoSize: !0, autoHeight: !1, autoWidth: !1, autoResize: !0, autoCenter: !s, fitToView: !0, aspectRatio: !1, topRatio: 0.5, leftRatio: 0.5, scrolling: "auto", wrapCSS: "", arrows: !0, closeBtn: !0, closeClick: !1, nextClick: !1, mouseWheel: !0, autoPlay: !1, playSpeed: 3e3, preload: 3, modal: !1, loop: !0, ajax: { dataType: "html", headers: { "X-fancyBox": !0 } }, iframe: { scrolling: "auto", preload: !0 }, swf: { wmode: "transparent", allowfullscreen: "true", allowscriptaccess: "always", }, keys: { next: { 13: "left", 34: "up", 39: "left", 40: "up" }, prev: { 8: "right", 33: "down", 37: "right", 38: "down" }, close: [27], play: [32], toggle: [70], }, direction: { next: "left", prev: "right" }, scrollOutside: !0, index: 0, type: null, href: null, content: null, title: null, tpl: { wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', image: '<img class="fancybox-image" src="{href}" alt="" />', iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (I ? ' allowtransparency="true"' : "") + "></iframe>", error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', }, openEffect: "fade", openSpeed: 250, openEasing: "swing", openOpacity: !0, openMethod: "zoomIn", closeEffect: "fade", closeSpeed: 250, closeEasing: "swing", closeOpacity: !0, closeMethod: "zoomOut", nextEffect: "elastic", nextSpeed: 250, nextEasing: "swing", nextMethod: "changeIn", prevEffect: "elastic", prevSpeed: 250, prevEasing: "swing", prevMethod: "changeOut", helpers: { overlay: !0, title: !0 }, onCancel: f.noop, beforeLoad: f.noop, afterLoad: f.noop, beforeShow: f.noop, afterShow: f.noop, beforeChange: f.noop, beforeClose: f.noop, afterClose: f.noop, }, group: {}, opts: {}, previous: null, coming: null, current: null, isActive: !1, isOpen: !1, isOpened: !1, wrap: null, skin: null, outer: null, inner: null, player: { timer: null, isActive: !1 }, ajaxLoad: null, imgPreload: null, transitions: {}, helpers: {}, open: function (a, d) { if (a && (f.isPlainObject(d) || (d = {}), !1 !== b.close(!0))) return ( f.isArray(a) || (a = t(a) ? f(a).get() : [a]), f.each(a, function (e, c) { var k = {}, g, h, j, m, l; "object" === f.type(c) && (c.nodeType && (c = f(c)), t(c) ? ((k = { href: c.data("fancybox-href") || c.attr("href"), title: c.data("fancybox-title") || c.attr("title"), isDom: !0, element: c, }), f.metadata && f.extend(!0, k, c.metadata())) : (k = c)); g = d.href || k.href || (q(c) ? c : null); h = d.title !== v ? d.title : k.title || ""; m = (j = d.content || k.content) ? "html" : d.type || k.type; !m && k.isDom && ((m = c.data("fancybox-type")), m || (m = (m = c.prop("class").match(/fancybox\.(\w+)/)) ? m[1] : null)); q(g) && (m || (b.isImage(g) ? (m = "image") : b.isSWF(g) ? (m = "swf") : "#" === g.charAt(0) ? (m = "inline") : q(c) && ((m = "html"), (j = c))), "ajax" === m && ((l = g.split(/\s+/, 2)), (g = l.shift()), (l = l.shift()))); j || ("inline" === m ? g ? (j = f(q(g) ? g.replace(/.*(?=#[^\s]+$)/, "") : g)) : k.isDom && (j = c) : "html" === m ? (j = g) : !m && !g && k.isDom && ((m = "inline"), (j = c))); f.extend(k, { href: g, type: m, content: j, title: h, selector: l, }); a[e] = k; }), (b.opts = f.extend(!0, {}, b.defaults, d)), d.keys !== v && (b.opts.keys = d.keys ? f.extend({}, b.defaults.keys, d.keys) : !1), (b.group = a), b._start(b.opts.index) ); }, cancel: function () { var a = b.coming; a && !1 !== b.trigger("onCancel") && (b.hideLoading(), b.ajaxLoad && b.ajaxLoad.abort(), (b.ajaxLoad = null), b.imgPreload && (b.imgPreload.onload = b.imgPreload.onerror = null), a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(), (b.coming = null), b.current || b._afterZoomOut(a)); }, close: function (a) { b.cancel(); !1 !== b.trigger("beforeClose") && (b.unbindEvents(), b.isActive && (!b.isOpen || !0 === a ? (f(".fancybox-wrap").stop(!0).trigger("onReset").remove(), b._afterZoomOut()) : ((b.isOpen = b.isOpened = !1), (b.isClosing = !0), f(".fancybox-item, .fancybox-nav").remove(), b.wrap.stop(!0, !0).removeClass("fancybox-opened"), b.transitions[b.current.closeMethod]()))); }, play: function (a) { var d = function () { clearTimeout(b.player.timer); }, e = function () { d(); b.current && b.player.isActive && (b.player.timer = setTimeout(b.next, b.current.playSpeed)); }, c = function () { d(); p.unbind(".player"); b.player.isActive = !1; b.trigger("onPlayEnd"); }; if (!0 === a || (!b.player.isActive && !1 !== a)) { if ( b.current && (b.current.loop || b.current.index < b.group.length - 1) ) (b.player.isActive = !0), p.bind({ "onCancel.player beforeClose.player": c, "onUpdate.player": e, "beforeLoad.player": d, }), e(), b.trigger("onPlayStart"); } else c(); }, next: function (a) { var d = b.current; d && (q(a) || (a = d.direction.next), b.jumpto(d.index + 1, a, "next")); }, prev: function (a) { var d = b.current; d && (q(a) || (a = d.direction.prev), b.jumpto(d.index - 1, a, "prev")); }, jumpto: function (a, d, e) { var c = b.current; c && ((a = l(a)), (b.direction = d || c.direction[a >= c.index ? "next" : "prev"]), (b.router = e || "jumpto"), c.loop && (0 > a && (a = c.group.length + (a % c.group.length)), (a %= c.group.length)), c.group[a] !== v && (b.cancel(), b._start(a))); }, reposition: function (a, d) { var e = b.current, c = e ? e.wrap : null, k; c && ((k = b._getPosition(d)), a && "scroll" === a.type ? (delete k.position, c.stop(!0, !0).animate(k, 200)) : (c.css(k), (e.pos = f.extend({}, e.dim, k)))); }, update: function (a) { var d = a && a.type, e = !d || "orientationchange" === d; e && (clearTimeout(B), (B = null)); b.isOpen && !B && (B = setTimeout( function () { var c = b.current; c && !b.isClosing && (b.wrap.removeClass("fancybox-tmp"), (e || "load" === d || ("resize" === d && c.autoResize)) && b._setDimension(), ("scroll" === d && c.canShrink) || b.reposition(a), b.trigger("onUpdate"), (B = null)); }, e && !s ? 0 : 300 )); }, toggle: function (a) { b.isOpen && ((b.current.fitToView = "boolean" === f.type(a) ? a : !b.current.fitToView), s && (b.wrap.removeAttr("style").addClass("fancybox-tmp"), b.trigger("onUpdate")), b.update()); }, hideLoading: function () { p.unbind(".loading"); f("#fancybox-loading").remove(); }, showLoading: function () { var a, d; b.hideLoading(); a = f('<div id="fancybox-loading"><div></div></div>') .click(b.cancel) .appendTo("body"); p.bind("keydown.loading", function (a) { if (27 === (a.which || a.keyCode)) a.preventDefault(), b.cancel(); }); b.defaults.fixed || ((d = b.getViewport()), a.css({ position: "absolute", top: 0.5 * d.h + d.y, left: 0.5 * d.w + d.x, })); }, getViewport: function () { var a = (b.current && b.current.locked) || !1, d = { x: n.scrollLeft(), y: n.scrollTop() }; a ? ((d.w = a[0].clientWidth), (d.h = a[0].clientHeight)) : ((d.w = s && r.innerWidth ? r.innerWidth : n.width()), (d.h = s && r.innerHeight ? r.innerHeight : n.height())); return d; }, unbindEvents: function () { b.wrap && t(b.wrap) && b.wrap.unbind(".fb"); p.unbind(".fb"); n.unbind(".fb"); }, bindEvents: function () { var a = b.current, d; a && (n.bind( "orientationchange.fb" + (s ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), b.update ), (d = a.keys) && p.bind("keydown.fb", function (e) { var c = e.which || e.keyCode, k = e.target || e.srcElement; if (27 === c && b.coming) return !1; !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && (!k || (!k.type && !f(k).is("[contenteditable]"))) && f.each(d, function (d, k) { if (1 < a.group.length && k[c] !== v) return b[d](k[c]), e.preventDefault(), !1; if (-1 < f.inArray(c, k)) return b[d](), e.preventDefault(), !1; }); }), f.fn.mousewheel && a.mouseWheel && b.wrap.bind("mousewheel.fb", function (d, c, k, g) { for ( var h = f(d.target || null), j = !1; h.length && !j && !h.is(".fancybox-skin") && !h.is(".fancybox-wrap"); ) (j = h[0] && !(h[0].style.overflow && "hidden" === h[0].style.overflow) && ((h[0].clientWidth && h[0].scrollWidth > h[0].clientWidth) || (h[0].clientHeight && h[0].scrollHeight > h[0].clientHeight))), (h = f(h).parent()); if (0 !== c && !j && 1 < b.group.length && !a.canShrink) { if (0 < g || 0 < k) b.prev(0 < g ? "down" : "left"); else if (0 > g || 0 > k) b.next(0 > g ? "up" : "right"); d.preventDefault(); } })); }, trigger: function (a, d) { var e, c = d || b.coming || b.current; if (c) { f.isFunction(c[a]) && (e = c[a].apply(c, Array.prototype.slice.call(arguments, 1))); if (!1 === e) return !1; c.helpers && f.each(c.helpers, function (d, e) { if (e && b.helpers[d] && f.isFunction(b.helpers[d][a])) b.helpers[d][a](f.extend(!0, {}, b.helpers[d].defaults, e), c); }); p.trigger(a); } }, isImage: function (a) { return ( q(a) && a.match( /(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i ) ); }, isSWF: function (a) { return q(a) && a.match(/\.(swf)((\?|#).*)?$/i); }, _start: function (a) { var d = {}, e, c; a = l(a); e = b.group[a] || null; if (!e) return !1; d = f.extend(!0, {}, b.opts, e); e = d.margin; c = d.padding; "number" === f.type(e) && (d.margin = [e, e, e, e]); "number" === f.type(c) && (d.padding = [c, c, c, c]); d.modal && f.extend(!0, d, { closeBtn: !1, closeClick: !1, nextClick: !1, arrows: !1, mouseWheel: !1, keys: null, helpers: { overlay: { closeClick: !1 } }, }); d.autoSize && (d.autoWidth = d.autoHeight = !0); "auto" === d.width && (d.autoWidth = !0); "auto" === d.height && (d.autoHeight = !0); d.group = b.group; d.index = a; b.coming = d; if (!1 === b.trigger("beforeLoad")) b.coming = null; else { c = d.type; e = d.href; if (!c) return ( (b.coming = null), b.current && b.router && "jumpto" !== b.router ? ((b.current.index = a), b[b.router](b.direction)) : !1 ); b.isActive = !0; if ("image" === c || "swf" === c) (d.autoHeight = d.autoWidth = !1), (d.scrolling = "visible"); "image" === c && (d.aspectRatio = !0); "iframe" === c && s && (d.scrolling = "scroll"); d.wrap = f(d.tpl.wrap) .addClass( "fancybox-" + (s ? "mobile" : "desktop") + " fancybox-type-" + c + " fancybox-tmp " + d.wrapCSS ) .appendTo(d.parent || "body"); f.extend(d, { skin: f(".fancybox-skin", d.wrap), outer: f(".fancybox-outer", d.wrap), inner: f(".fancybox-inner", d.wrap), }); f.each(["Top", "Right", "Bottom", "Left"], function (a, b) { d.skin.css("padding" + b, w(d.padding[a])); }); b.trigger("onReady"); if ("inline" === c || "html" === c) { if (!d.content || !d.content.length) return b._error("content"); } else if (!e) return b._error("href"); "image" === c ? b._loadImage() : "ajax" === c ? b._loadAjax() : "iframe" === c ? b._loadIframe() : b._afterLoad(); } }, _error: function (a) { f.extend(b.coming, { type: "html", autoWidth: !0, autoHeight: !0, minWidth: 0, minHeight: 0, scrolling: "no", hasError: a, content: b.coming.tpl.error, }); b._afterLoad(); }, _loadImage: function () { var a = (b.imgPreload = new Image()); a.onload = function () { this.onload = this.onerror = null; b.coming.width = this.width / b.opts.pixelRatio; b.coming.height = this.height / b.opts.pixelRatio; b._afterLoad(); }; a.onerror = function () { this.onload = this.onerror = null; b._error("image"); }; a.src = b.coming.href; !0 !== a.complete && b.showLoading(); }, _loadAjax: function () { var a = b.coming; b.showLoading(); b.ajaxLoad = f.ajax( f.extend({}, a.ajax, { url: a.href, error: function (a, e) { b.coming && "abort" !== e ? b._error("ajax", a) : b.hideLoading(); }, success: function (d, e) { "success" === e && ((a.content = d), b._afterLoad()); }, }) ); }, _loadIframe: function () { var a = b.coming, d = f(a.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) .attr("scrolling", s ? "auto" : a.iframe.scrolling) .attr("src", a.href); f(a.wrap).bind("onReset", function () { try { f(this) .find("iframe") .hide() .attr("src", "//about:blank") .end() .empty(); } catch (a) {} }); a.iframe.preload && (b.showLoading(), d.one("load", function () { f(this).data("ready", 1); s || f(this).bind("load.fb", b.update); f(this) .parents(".fancybox-wrap") .width("100%") .removeClass("fancybox-tmp") .show(); b._afterLoad(); })); a.content = d.appendTo(a.inner); a.iframe.preload || b._afterLoad(); }, _preloadImages: function () { var a = b.group, d = b.current, e = a.length, c = d.preload ? Math.min(d.preload, e - 1) : 0, f, g; for (g = 1; g <= c; g += 1) (f = a[(d.index + g) % e]), "image" === f.type && f.href && (new Image().src = f.href); }, _afterLoad: function () { var a = b.coming, d = b.current, e, c, k, g, h; b.hideLoading(); if (a && !1 !== b.isActive) if (!1 === b.trigger("afterLoad", a, d)) a.wrap.stop(!0).trigger("onReset").remove(), (b.coming = null); else { d && (b.trigger("beforeChange", d), d.wrap .stop(!0) .removeClass("fancybox-opened") .find(".fancybox-item, .fancybox-nav") .remove()); b.unbindEvents(); e = a.content; c = a.type; k = a.scrolling; f.extend(b, { wrap: a.wrap, skin: a.skin, outer: a.outer, inner: a.inner, current: a, previous: d, }); g = a.href; switch (c) { case "inline": case "ajax": case "html": a.selector ? (e = f("<div>").html(e).find(a.selector)) : t(e) && (e.data("fancybox-placeholder") || e.data( "fancybox-placeholder", f('<div class="fancybox-placeholder"></div>') .insertAfter(e) .hide() ), (e = e.show().detach()), a.wrap.bind("onReset", function () { f(this).find(e).length && e .hide() .replaceAll(e.data("fancybox-placeholder")) .data("fancybox-placeholder", !1); })); break; case "image": e = a.tpl.image.replace("{href}", g); break; case "swf": (e = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + g + '"></param>'), (h = ""), f.each(a.swf, function (a, b) { e += '<param name="' + a + '" value="' + b + '"></param>'; h += " " + a + '="' + b + '"'; }), (e += '<embed src="' + g + '" type="application/x-shockwave-flash" width="100%" height="100%"' + h + "></embed></object>"); } (!t(e) || !e.parent().is(a.inner)) && a.inner.append(e); b.trigger("beforeShow"); a.inner.css( "overflow", "yes" === k ? "scroll" : "no" === k ? "hidden" : k ); b._setDimension(); b.reposition(); b.isOpen = !1; b.coming = null; b.bindEvents(); if (b.isOpened) { if (d.prevMethod) b.transitions[d.prevMethod](); } else f(".fancybox-wrap") .not(a.wrap) .stop(!0) .trigger("onReset") .remove(); b.transitions[b.isOpened ? a.nextMethod : a.openMethod](); b._preloadImages(); } }, _setDimension: function () { var a = b.getViewport(), d = 0, e = !1, c = !1, e = b.wrap, k = b.skin, g = b.inner, h = b.current, c = h.width, j = h.height, m = h.minWidth, u = h.minHeight, n = h.maxWidth, p = h.maxHeight, s = h.scrolling, q = h.scrollOutside ? h.scrollbarWidth : 0, x = h.margin, y = l(x[1] + x[3]), r = l(x[0] + x[2]), v, z, t, C, A, F, B, D, H; e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp"); x = l(k.outerWidth(!0) - k.width()); v = l(k.outerHeight(!0) - k.height()); z = y + x; t = r + v; C = E(c) ? ((a.w - z) * l(c)) / 100 : c; A = E(j) ? ((a.h - t) * l(j)) / 100 : j; if ("iframe" === h.type) { if (((H = h.content), h.autoHeight && 1 === H.data("ready"))) try { H[0].contentWindow.document.location && (g.width(C).height(9999), (F = H.contents().find("body")), q && F.css("overflow-x", "hidden"), (A = F.outerHeight(!0))); } catch (G) {} } else if (h.autoWidth || h.autoHeight) g.addClass("fancybox-tmp"), h.autoWidth || g.width(C), h.autoHeight || g.height(A), h.autoWidth && (C = g.width()), h.autoHeight && (A = g.height()), g.removeClass("fancybox-tmp"); c = l(C); j = l(A); D = C / A; m = l(E(m) ? l(m, "w") - z : m); n = l(E(n) ? l(n, "w") - z : n); u = l(E(u) ? l(u, "h") - t : u); p = l(E(p) ? l(p, "h") - t : p); F = n; B = p; h.fitToView && ((n = Math.min(a.w - z, n)), (p = Math.min(a.h - t, p))); z = a.w - y; r = a.h - r; h.aspectRatio ? (c > n && ((c = n), (j = l(c / D))), j > p && ((j = p), (c = l(j * D))), c < m && ((c = m), (j = l(c / D))), j < u && ((j = u), (c = l(j * D)))) : ((c = Math.max(m, Math.min(c, n))), h.autoHeight && "iframe" !== h.type && (g.width(c), (j = g.height())), (j = Math.max(u, Math.min(j, p)))); if (h.fitToView) if ( (g.width(c).height(j), e.width(c + x), (a = e.width()), (y = e.height()), h.aspectRatio) ) for (; (a > z || y > r) && c > m && j > u && !(19 < d++); ) (j = Math.max(u, Math.min(p, j - 10))), (c = l(j * D)), c < m && ((c = m), (j = l(c / D))), c > n && ((c = n), (j = l(c / D))), g.width(c).height(j), e.width(c + x), (a = e.width()), (y = e.height()); else (c = Math.max(m, Math.min(c, c - (a - z)))), (j = Math.max(u, Math.min(j, j - (y - r)))); q && "auto" === s && j < A && c + x + q < z && (c += q); g.width(c).height(j); e.width(c + x); a = e.width(); y = e.height(); e = (a > z || y > r) && c > m && j > u; c = h.aspectRatio ? c < F && j < B && c < C && j < A : (c < F || j < B) && (c < C || j < A); f.extend(h, { dim: { width: w(a), height: w(y) }, origWidth: C, origHeight: A, canShrink: e, canExpand: c, wPadding: x, hPadding: v, wrapSpace: y - k.outerHeight(!0), skinSpace: k.height() - j, }); !H && h.autoHeight && j > u && j < p && !c && g.height("auto"); }, _getPosition: function (a) { var d = b.current, e = b.getViewport(), c = d.margin, f = b.wrap.width() + c[1] + c[3], g = b.wrap.height() + c[0] + c[2], c = { position: "absolute", top: c[0], left: c[3] }; d.autoCenter && d.fixed && !a && g <= e.h && f <= e.w ? (c.position = "fixed") : d.locked || ((c.top += e.y), (c.left += e.x)); c.top = w(Math.max(c.top, c.top + (e.h - g) * d.topRatio)); c.left = w(Math.max(c.left, c.left + (e.w - f) * d.leftRatio)); return c; }, _afterZoomIn: function () { var a = b.current; a && ((b.isOpen = b.isOpened = !0), b.wrap.css("overflow", "visible").addClass("fancybox-opened"), b.update(), (a.closeClick || (a.nextClick && 1 < b.group.length)) && b.inner.css("cursor", "pointer").bind("click.fb", function (d) { !f(d.target).is("a") && !f(d.target).parent().is("a") && (d.preventDefault(), b[a.closeClick ? "close" : "next"]()); }), a.closeBtn && f(a.tpl.closeBtn) .appendTo(b.skin) .bind("click.fb", function (a) { a.preventDefault(); b.close(); }), a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), !a.loop && a.index === a.group.length - 1 ? b.play(!1) : b.opts.autoPlay && !b.player.isActive && ((b.opts.autoPlay = !1), b.play())); }, _afterZoomOut: function (a) { a = a || b.current; f(".fancybox-wrap").trigger("onReset").remove(); f.extend(b, { group: {}, opts: {}, router: !1, current: null, isActive: !1, isOpened: !1, isOpen: !1, isClosing: !1, wrap: null, skin: null, outer: null, inner: null, }); b.trigger("afterClose", a); }, }); b.transitions = { getOrigPosition: function () { var a = b.current, d = a.element, e = a.orig, c = {}, f = 50, g = 50, h = a.hPadding, j = a.wPadding, m = b.getViewport(); !e && a.isDom && d.is(":visible") && ((e = d.find("img:first")), e.length || (e = d)); t(e) ? ((c = e.offset()), e.is("img") && ((f = e.outerWidth()), (g = e.outerHeight()))) : ((c.top = m.y + (m.h - g) * a.topRatio), (c.left = m.x + (m.w - f) * a.leftRatio)); if ("fixed" === b.wrap.css("position") || a.locked) (c.top -= m.y), (c.left -= m.x); return (c = { top: w(c.top - h * a.topRatio), left: w(c.left - j * a.leftRatio), width: w(f + j), height: w(g + h), }); }, step: function (a, d) { var e, c, f = d.prop; c = b.current; var g = c.wrapSpace, h = c.skinSpace; if ("width" === f || "height" === f) (e = d.end === d.start ? 1 : (a - d.start) / (d.end - d.start)), b.isClosing && (e = 1 - e), (c = "width" === f ? c.wPadding : c.hPadding), (c = a - c), b.skin[f](l("width" === f ? c : c - g * e)), b.inner[f](l("width" === f ? c : c - g * e - h * e)); }, zoomIn: function () { var a = b.current, d = a.pos, e = a.openEffect, c = "elastic" === e, k = f.extend({ opacity: 1 }, d); delete k.position; c ? ((d = this.getOrigPosition()), a.openOpacity && (d.opacity = 0.1)) : "fade" === e && (d.opacity = 0.1); b.wrap.css(d).animate(k, { duration: "none" === e ? 0 : a.openSpeed, easing: a.openEasing, step: c ? this.step : null, complete: b._afterZoomIn, }); }, zoomOut: function () { var a = b.current, d = a.closeEffect, e = "elastic" === d, c = { opacity: 0.1 }; e && ((c = this.getOrigPosition()), a.closeOpacity && (c.opacity = 0.1)); b.wrap.animate(c, { duration: "none" === d ? 0 : a.closeSpeed, easing: a.closeEasing, step: e ? this.step : null, complete: b._afterZoomOut, }); }, changeIn: function () { var a = b.current, d = a.nextEffect, e = a.pos, c = { opacity: 1 }, f = b.direction, g; e.opacity = 0.1; "elastic" === d && ((g = "down" === f || "up" === f ? "top" : "left"), "down" === f || "right" === f ? ((e[g] = w(l(e[g]) - 200)), (c[g] = "+=200px")) : ((e[g] = w(l(e[g]) + 200)), (c[g] = "-=200px"))); "none" === d ? b._afterZoomIn() : b.wrap.css(e).animate(c, { duration: a.nextSpeed, easing: a.nextEasing, complete: b._afterZoomIn, }); }, changeOut: function () { var a = b.previous, d = a.prevEffect, e = { opacity: 0.1 }, c = b.direction; "elastic" === d && (e["down" === c || "up" === c ? "top" : "left"] = ("up" === c || "left" === c ? "-" : "+") + "=200px"); a.wrap.animate(e, { duration: "none" === d ? 0 : a.prevSpeed, easing: a.prevEasing, complete: function () { f(this).trigger("onReset").remove(); }, }); }, }; b.helpers.overlay = { defaults: { closeClick: !0, speedOut: 200, showEarly: !0, css: {}, locked: !s, fixed: !0, }, overlay: null, fixed: !1, el: f("html"), create: function (a) { a = f.extend({}, this.defaults, a); this.overlay && this.close(); this.overlay = f('<div class="fancybox-overlay"></div>').appendTo( b.coming ? b.coming.parent : a.parent ); this.fixed = !1; a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), (this.fixed = !0)); }, open: function (a) { var d = this; a = f.extend({}, this.defaults, a); this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a); this.fixed || (n.bind("resize.overlay", f.proxy(this.update, this)), this.update()); a.closeClick && this.overlay.bind("click.overlay", function (a) { if (f(a.target).hasClass("fancybox-overlay")) return b.isActive ? b.close() : d.close(), !1; }); this.overlay.css(a.css).show(); }, close: function () { var a, b; n.unbind("resize.overlay"); this.el.hasClass("fancybox-lock") && (f(".fancybox-margin").removeClass("fancybox-margin"), (a = n.scrollTop()), (b = n.scrollLeft()), this.el.removeClass("fancybox-lock"), n.scrollTop(a).scrollLeft(b)); f(".fancybox-overlay").remove().hide(); f.extend(this, { overlay: null, fixed: !1 }); }, update: function () { var a = "100%", b; this.overlay.width(a).height("100%"); I ? ((b = Math.max(G.documentElement.offsetWidth, G.body.offsetWidth)), p.width() > b && (a = p.width())) : p.width() > n.width() && (a = p.width()); this.overlay.width(a).height(p.height()); }, onReady: function (a, b) { var e = this.overlay; f(".fancybox-overlay").stop(!0, !0); e || this.create(a); a.locked && this.fixed && b.fixed && (e || (this.margin = p.height() > n.height() ? f("html").css("margin-right").replace("px", "") : !1), (b.locked = this.overlay.append(b.wrap)), (b.fixed = !1)); !0 === a.showEarly && this.beforeShow.apply(this, arguments); }, beforeShow: function (a, b) { var e, c; b.locked && (!1 !== this.margin && (f("*") .filter(function () { return ( "fixed" === f(this).css("position") && !f(this).hasClass("fancybox-overlay") && !f(this).hasClass("fancybox-wrap") ); }) .addClass("fancybox-margin"), this.el.addClass("fancybox-margin")), (e = n.scrollTop()), (c = n.scrollLeft()), this.el.addClass("fancybox-lock"), n.scrollTop(e).scrollLeft(c)); this.open(a); }, onUpdate: function () { this.fixed || this.update(); }, afterClose: function (a) { this.overlay && !b.coming && this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this)); }, }; b.helpers.title = { defaults: { type: "float", position: "bottom" }, beforeShow: function (a) { var d = b.current, e = d.title, c = a.type; f.isFunction(e) && (e = e.call(d.element, d)); if (q(e) && "" !== f.trim(e)) { d = f( '<div class="fancybox-title fancybox-title-' + c + '-wrap">' + e + "</div>" ); switch (c) { case "inside": c = b.skin; break; case "outside": c = b.wrap; break; case "over": c = b.inner; break; default: (c = b.skin), d.appendTo("body"), I && d.width(d.width()), d.wrapInner('<span class="child"></span>'), (b.current.margin[2] += Math.abs(l(d.css("margin-bottom")))); } d["top" === a.position ? "prependTo" : "appendTo"](c); } }, }; f.fn.fancybox = function (a) { var d, e = f(this), c = this.selector || "", k = function (g) { var h = f(this).blur(), j = d, k, l; !g.ctrlKey && !g.altKey && !g.shiftKey && !g.metaKey && !h.is(".fancybox-wrap") && ((k = a.groupAttr || "data-fancybox-group"), (l = h.attr(k)), l || ((k = "rel"), (l = h.get(0)[k])), l && "" !== l && "nofollow" !== l && ((h = c.length ? f(c) : e), (h = h.filter("[" + k + '="' + l + '"]')), (j = h.index(this))), (a.index = j), !1 !== b.open(h, a) && g.preventDefault()); }; a = a || {}; d = a.index || 0; !c || !1 === a.live ? e.unbind("click.fb-start").bind("click.fb-start", k) : p .undelegate(c, "click.fb-start") .delegate( c + ":not('.fancybox-item, .fancybox-nav')", "click.fb-start", k ); this.filter("[data-fancybox-start=1]").trigger("click"); return this; }; p.ready(function () { var a, d; f.scrollbarWidth === v && (f.scrollbarWidth = function () { var a = f( '<div style="width:50px;height:50px;overflow:auto"><div/></div>' ).appendTo("body"), b = a.children(), b = b.innerWidth() - b.height(99).innerWidth(); a.remove(); return b; }); if (f.support.fixedPosition === v) { a = f.support; d = f('<div style="position:fixed;top:20px;"></div>').appendTo("body"); var e = 20 === d[0].offsetTop || 15 === d[0].offsetTop; d.remove(); a.fixedPosition = e; } f.extend(b.defaults, { scrollbarWidth: f.scrollbarWidth(), fixed: f.support.fixedPosition, parent: f("body"), }); a = f(r).width(); J.addClass("fancybox-lock-test"); d = f(r).width(); J.removeClass("fancybox-lock-test"); f( "<style type='text/css'>.fancybox-margin{margin-right:" + (d - a) + "px;}</style>" ).appendTo("head"); }); })(window, document, jQuery);