!function(e, n) {
e.wp = e.wp || {},
e.wp.mediaelement = new function() {
var e = {};
return {
initialize: function() {
(e = “undefined” != typeof wpmejsSettings ? n.extend(!0, {}, _wpmejsSettings) : e).classPrefix = “mejs-“, e.success = e.success || function(e) { var n, t; e.rendererName && -1 !== e.rendererName.indexOf(“flash”) && (n = e.attributes.autoplay && “false” !== e.attributes.autoplay, t = e.attributes.loop && “false” !== e.attributes.loop, n && e.addEventListener(“canplay”, function() { e.play() }, !1), t && e.addEventListener(“ended”, function() { e.play() }, !1)) } , e.customError = function(e, n) { if (-1 !== e.rendererName.indexOf(“flash”) || -1 !== e.rendererName.indexOf(“flv”)) return ‘‘ + mejsL10n.strings[“mejs.download-file”] + “” } , n(“.wp-audio-shortcode, .wp-video-shortcode”).not(“.mejs-container”).filter(function() { return !n(this).parent().hasClass(“mejs-mediaelement”) }).mediaelementplayer(e) } } } , n(e.wp.mediaelement.initialize) }(window, jQuery); ;function uncode_progress_bar() { jQuery.each(jQuery(“.vc_progress_bar”), function(index, val) { if (!UNCODE.isMobile) new Waypoint({ element: val, handler: function() { var element = jQuery(this.element); element.find(“.vc_single_bar”).each(function(index) { var $this = jQuery(this) , bar = $this.find(“.vc_bar”) , val = bar.data(“percentage-value”); setTimeout(function() { bar.css({ width: val + “%” }) }, index * 200) }) }, offset: “80%” }); else { var element = jQuery(val); element.find(“.vc_single_bar”).each(function(index) { var $this = jQuery(this) , bar = $this.find(“.vc_bar”) , val = bar.data(“percentage-value”); setTimeout(function() { bar.css({ width: val + “%” }) }, index * 200) }) } }) } (function(window, $) { “use strict”; function testLineDimensions($line, maxWidth, property, size, interval, units, previousWidth) { var width; previousWidth = typeof previousWidth == “number” ? previousWidth : 0, $line.css(property, size + units), width = $line.width(); if (width >= maxWidth) { $line.css(property, “”); if (width === maxWidth) return { match: “exact”, size: parseFloat((parseFloat(size) – .1).toFixed(3)) }; var under = maxWidth – previousWidth , over = width – maxWidth; return { match: “estimate”, size: parseFloat((parseFloat(size) – (property === “word-spacing” && previousWidth && over < under ? 0 : interval)).toFixed(3)) } } return width } function calculateSizes($t, $children, maxWidth, maxFontSize, minFontSize) { var $c = $t.clone(!0).addClass(“bigtext-cloned”).css({ fontFamily: $t.css(“font-family”), textTransform: $t.css(“text-transform”), wordSpacing: $t.css(“word-spacing”), letterSpacing: $t.css(“letter-spacing”), position: “absolute”, left: BigText.DEBUG_MODE ? 0 : -9999, top: BigText.DEBUG_MODE ? 0 : -9999 }).appendTo(document.body) , fontSizes = [] , wordSpacings = [] , minFontSizes = [] , ratios = []; return $children.css(“float”, “left”).each(function() { var $line = $(this), intervals = BigText.supports.wholeNumberFontSizeOnly ? [8, 4, 1] : [8, 4, 1, .1], lineMax, newFontSize; if ($line.hasClass(BigText.EXEMPT_CLASS)) { fontSizes.push(null), ratios.push(null), minFontSizes.push(!1); return } var autoGuessSubtraction = 32 , currentFontSize = parseFloat($line.css(“font-size”)) , ratio = ($line.width() / currentFontSize).toFixed(6); newFontSize = parseInt(maxWidth / ratio, 10) – autoGuessSubtraction; e: for (var m = 0, n = intervals.length; m < n; m++) t: for (var j = 1, k = 10; j <= k; j++) { if (newFontSize + j * intervals[m] > maxFontSize) { newFontSize = maxFontSize; break e } lineMax = testLineDimensions($line, maxWidth, “font-size”, newFontSize + j * intervals[m], intervals[m], “px”, lineMax); if (typeof lineMax != “number”) { newFontSize = lineMax.size; if (lineMax.match === “exact”) break e; break t } } ratios.push(maxWidth / newFontSize), newFontSize > maxFontSize ? (fontSizes.push(maxFontSize), minFontSizes.push(!1)) : !!minFontSize && newFontSize < minFontSize ? (fontSizes.push(minFontSize), minFontSizes.push(!0)) : (fontSizes.push(newFontSize), minFontSizes.push(!1)) }).each(function(lineNumber) { var $line = $(this), wordSpacing = 0, interval = 1, maxWordSpacing; if ($line.hasClass(BigText.EXEMPT_CLASS)) { wordSpacings.push(null); return } $line.css(“font-size”, fontSizes[lineNumber] + “px”); for (var m = 1, n = 3; m < n; m += interval) { maxWordSpacing = testLineDimensions($line, maxWidth, “word-spacing”, m, interval, “px”, maxWordSpacing); if (typeof maxWordSpacing != “number”) { wordSpacing = maxWordSpacing.size; break } } $line.css(“font-size”, “”), wordSpacings.push(wordSpacing) }).removeAttr(“style”), BigText.DEBUG_MODE ? $c.css({ “background-color”: “rgba(255,255,255,.4)” }) : $c.remove(), { fontSizes: fontSizes, wordSpacings: wordSpacings, ratios: ratios, minFontSizes: minFontSizes } } var counter = 0 , $headCache = $(“head”) , oldBigText = window.BigText , oldjQueryMethod = $.fn.bigtext , BigText = { DEBUG_MODE: !1, DEFAULT_MIN_FONT_SIZE_PX: null, DEFAULT_MAX_FONT_SIZE_PX: 528, GLOBAL_STYLE_ID: “bigtext-style”, STYLE_ID: “bigtext-id”, LINE_CLASS_PREFIX: “bigtext-line”, EXEMPT_CLASS: “bigtext-exempt”, noConflict: function(restore) { return restore && ($.fn.bigtext = oldjQueryMethod, window.BigText = oldBigText), BigText }, supports: { wholeNumberFontSizeOnly: function() { if (“getComputedStyle”in window) { var test = $(“

“).css({ position: “absolute”, “font-size”: “14.1px” }).insertBefore($(“script”).eq(0)) , computedStyle = window.getComputedStyle(test[0], null) , ret = computedStyle && computedStyle.getPropertyValue(“font-size”) === “14px”; return test.remove(), ret } return !0 }() }, init: function() { $(“#” + BigText.GLOBAL_STYLE_ID).length || $headCache.append(BigText.generateStyleTag(BigText.GLOBAL_STYLE_ID, [“.bigtext * { white-space: nowrap; } .bigtext > * { display: block; }”, “.bigtext .” + BigText.EXEMPT_CLASS + “, .bigtext .” + BigText.EXEMPT_CLASS + ” * { white-space: normal; }”])) }, bindResize: function(eventName, resizeFunction) { var timeoutId; $(window).unbind(eventName).bind(eventName, function() { timeoutId && clearTimeout(timeoutId), timeoutId = setTimeout(resizeFunction, 300) }) }, getStyleId: function(id) { return BigText.STYLE_ID + “-” + id }, generateStyleTag: function(id, css) { return $(“”).attr(“id”, id) }, clearCss: function(id) { var styleId = BigText.getStyleId(id); $(“#” + styleId).remove() }, generateCss: function(id, linesFontSizes, lineWordSpacings, minFontSizes) { var css = []; BigText.clearCss(id); for (var j = 0, k = linesFontSizes.length; j < k; j++) css.push(“#” + id + ” .” + BigText.LINE_CLASS_PREFIX + j + ” {” + (minFontSizes[j] ? ” white-space: normal;” : “”) + (linesFontSizes[j] ? ” font-size: ” + linesFontSizes[j] + “px;” : “”) + (lineWordSpacings[j] ? ” word-spacing: ” + lineWordSpacings[j] + “px;” : “”) + “}”); return BigText.generateStyleTag(BigText.getStyleId(id), css) }, jQueryMethod: function(options) { return BigText.init(), options = $.extend({ minfontsize: BigText.DEFAULT_MIN_FONT_SIZE_PX, maxfontsize: BigText.DEFAULT_MAX_FONT_SIZE_PX, childSelector: “”, resize: !0 }, options || {}), this.each(function() { var $t = $(this).addClass(“bigtext”) , maxWidth = $t.width() , id = $t.attr(“id”) , $children = options.childSelector ? $t.find(options.childSelector) : $t.children(); id || (id = “bigtext-id” + counter++, $t.attr(“id”, id)), options.resize && BigText.bindResize(“resize.bigtext-event-” + id, function() { BigText.jQueryMethod.call($(“#” + id), options) }), BigText.clearCss(id), $children.addClass(function(lineNumber, className) { return [className.replace(new RegExp(“\b” + BigText.LINE_CLASS_PREFIX + “\d+\b”), “”), BigText.LINE_CLASS_PREFIX + lineNumber].join(” “) }); var sizes = calculateSizes($t, $children, maxWidth, options.maxfontsize, options.minfontsize); $headCache.append(BigText.generateCss(id, sizes.fontSizes, sizes.wordSpacings, sizes.minFontSizes)) }), this.trigger(“bigtext:complete”) } }; $.fn.bigtext = BigText.jQueryMethod, window.BigText = BigText } )(this, jQuery), function(window) { function noop() {} function defineBridget($) { function addOptionMethod(PluginClass) { if (PluginClass.prototype.option) return; PluginClass.prototype.option = function(opts) { if (!$.isPlainObject(opts)) return; this.options = $.extend(!0, this.options, opts) } } function bridge(namespace, PluginClass) { $.fn[namespace] = function(options) { if (typeof options == “string”) { var args = slice.call(arguments, 1); for (var i = 0, len = this.length; i < len; i++) { var elem = this[i] , instance = $.data(elem, namespace); if (!instance) { logError(“cannot call methods on ” + namespace + ” prior to initialization; ” + “attempted to call ‘” + options + “‘”); continue } if (!$.isFunction(instance[options]) || options.charAt(0) === ““) {
logError(“no such method ‘” + options + “‘ for ” + namespace + ” instance”);
continue
}
var returnValue = instance[options].apply(instance, args);
if (returnValue !== undefined)
return returnValue
}
return this
}
return this.each(function() {
var instance = $.data(this, namespace);
instance ? (instance.option(options),
instance.init()) : (instance = new PluginClass(this,options), $.data(this, namespace, instance)) }) } } if (!$) return; var logError = typeof console == “undefined” ? noop : function(message) { console.error(message) } ; return $.bridget = function(namespace, PluginClass) { addOptionMethod(PluginClass), bridge(namespace, PluginClass) } , $.bridget } var slice = Array.prototype.slice; typeof define == “function” && define.amd ? define(“jquery-bridget/jquery.bridget”, [“jquery”], defineBridget) : typeof exports == “object” ? defineBridget(require(“jquery”)) : defineBridget(window.jQuery) }(window), function(window) { function getIEEvent(obj) { var event = window.event; return event.target = event.target || event.srcElement || obj, event } var docElem = document.documentElement , bind = function() {}; docElem.addEventListener ? bind = function(obj, type, fn) { obj.addEventListener(type, fn, !1) } : docElem.attachEvent && (bind = function(obj, type, fn) { obj[type + fn] = fn.handleEvent ? function() { var event = getIEEvent(obj); fn.handleEvent.call(fn, event) } : function() { var event = getIEEvent(obj); fn.call(obj, event) } , obj.attachEvent(“on” + type, obj[type + fn]) } ); var unbind = function() {}; docElem.removeEventListener ? unbind = function(obj, type, fn) { obj.removeEventListener(type, fn, !1) } : docElem.detachEvent && (unbind = function(obj, type, fn) { obj.detachEvent(“on” + type, obj[type + fn]); try { delete obj[type + fn] } catch (err) { obj[type + fn] = undefined } } ); var eventie = { bind: bind, unbind: unbind }; typeof define == “function” && define.amd ? define(“eventie/eventie”, eventie) : typeof exports == “object” ? module.exports = eventie : window.eventie = eventie }(window), function() { “use strict”; function EventEmitter() {} function indexOfListener(listeners, listener) { var i = listeners.length; while (i–) if (listeners[i].listener === listener) return i; return -1 } function alias(name) { return function aliasClosure() { return this[name].apply(this, arguments) } } var proto = EventEmitter.prototype , exports = this , originalGlobalValue = exports.EventEmitter; proto.getListeners = function getListeners(evt) { var events = this._getEvents(), response, key; if (evt instanceof RegExp) { response = {}; for (key in events) events.hasOwnProperty(key) && evt.test(key) && (response[key] = events[key]) } else response = events[evt] || (events[evt] = []); return response } , proto.flattenListeners = function flattenListeners(listeners) { var flatListeners = [], i; for (i = 0; i < listeners.length; i += 1) flatListeners.push(listeners[i].listener); return flatListeners } , proto.getListenersAsObject = function getListenersAsObject(evt) { var listeners = this.getListeners(evt), response; return listeners instanceof Array && (response = {}, response[evt] = listeners), response || listeners } , proto.addListener = function addListener(evt, listener) { var listeners = this.getListenersAsObject(evt), listenerIsWrapped = typeof listener == “object”, key; for (key in listeners) listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1 && listeners[key].push(listenerIsWrapped ? listener : { listener: listener, once: !1 }); return this } , proto.on = alias(“addListener”), proto.addOnceListener = function addOnceListener(evt, listener) { return this.addListener(evt, { listener: listener, once: !0 }) } , proto.once = alias(“addOnceListener”), proto.defineEvent = function defineEvent(evt) { return this.getListeners(evt), this } , proto.defineEvents = function defineEvents(evts) { for (var i = 0; i < evts.length; i += 1) this.defineEvent(evts[i]); return this } , proto.removeListener = function removeListener(evt, listener) { var listeners = this.getListenersAsObject(evt), index, key; for (key in listeners) listeners.hasOwnProperty(key) && (index = indexOfListener(listeners[key], listener), index !== -1 && listeners[key].splice(index, 1)); return this } , proto.off = alias(“removeListener”), proto.addListeners = function addListeners(evt, listeners) { return this.manipulateListeners(!1, evt, listeners) } , proto.removeListeners = function removeListeners(evt, listeners) { return this.manipulateListeners(!0, evt, listeners) } , proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { var i, value, single = remove ? this.removeListener : this.addListener, multiple = remove ? this.removeListeners : this.addListeners; if (typeof evt != “object” || evt instanceof RegExp) { i = listeners.length; while (i–) single.call(this, evt, listeners[i]) } else for (i in evt) evt.hasOwnProperty(i) && (value = evt[i]) && (typeof value == “function” ? single.call(this, i, value) : multiple.call(this, i, value)); return this } , proto.removeEvent = function removeEvent(evt) { var type = typeof evt, events = this._getEvents(), key; if (type === “string”) delete events[evt]; else if (evt instanceof RegExp) for (key in events) events.hasOwnProperty(key) && evt.test(key) && delete events[key]; else delete this._events; return this } , proto.removeAllListeners = alias(“removeEvent”), proto.emitEvent = function emitEvent(evt, args) { var listeners = this.getListenersAsObject(evt), listener, i, key, response; for (key in listeners) if (listeners.hasOwnProperty(key)) { i = listeners[key].length; while (i–) listener = listeners[key][i], listener.once === !0 && this.removeListener(evt, listener.listener), response = listener.listener.apply(this, args || []), response === this._getOnceReturnValue() && this.removeListener(evt, listener.listener) } return this } , proto.trigger = alias(“emitEvent”), proto.emit = function emit(evt) { var args = Array.prototype.slice.call(arguments, 1); return this.emitEvent(evt, args) } , proto.setOnceReturnValue = function setOnceReturnValue(value) { return this._onceReturnValue = value, this } , proto._getOnceReturnValue = function _getOnceReturnValue() { return this.hasOwnProperty(“_onceReturnValue”) ? this._onceReturnValue : !0 } , proto._getEvents = function _getEvents() { return this._events || (this._events = {}) } , EventEmitter.noConflict = function noConflict() { return exports.EventEmitter = originalGlobalValue, EventEmitter } , typeof define == “function” && define.amd ? define(“eventEmitter/EventEmitter”, [], function() { return EventEmitter }) : typeof module == “object” && module.exports ? module.exports = EventEmitter : exports.EventEmitter = EventEmitter } .call(this), function(window) { function getStyleProperty(propName) { if (!propName) return; if (typeof docElemStyle[propName] == “string”) return propName; propName = propName.charAt(0).toUpperCase() + propName.slice(1); var prefixed; for (var i = 0, len = prefixes.length; i < len; i++) { prefixed = prefixes[i] + propName; if (typeof docElemStyle[prefixed] == “string”) return prefixed } } var prefixes = “Webkit Moz ms Ms O”.split(” “) , docElemStyle = document.documentElement.style; typeof define == “function” && define.amd ? define(“get-style-property/get-style-property”, [], function() { return getStyleProperty }) : typeof exports == “object” ? module.exports = getStyleProperty : window.getStyleProperty = getStyleProperty }(window), function(window, undefined) { function getStyleSize(value) { var num = parseFloat(value) , isValid = value.indexOf(“%”) === -1 && !isNaN(num); return isValid && num } function noop() {} function getZeroSize() { var size = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }; for (var i = 0, len = measurements.length; i < len; i++) { var measurement = measurements[i]; size[measurement] = 0 } return size } function defineGetSize(getStyleProperty) { function setup() { if (isSetup) return; isSetup = !0; var getComputedStyle = window.getComputedStyle; getStyle = function() { var getStyleFn = getComputedStyle ? function(elem) { return getComputedStyle(elem, null) } : function(elem) { return elem.currentStyle } ; return function getStyle(elem) { var style = getStyleFn(elem); return style || logError(“Style returned ” + style + “. Are you running this code in a hidden iframe on Firefox? ” + “See http://bit.ly/getsizebug1”), style } }(), boxSizingProp = getStyleProperty(“boxSizing”); if (boxSizingProp) { var div = document.createElement(“div”); div.style.width = “200px”, div.style.padding = “1px 2px 3px 4px”, div.style.borderStyle = “solid”, div.style.borderWidth = “1px 2px 3px 4px”, div.style[boxSizingProp] = “border-box”; var body = document.body || document.documentElement; body.appendChild(div); var style = getStyle(div); isBoxSizeOuter = getStyleSize(style.width) === 200, body.removeChild(div) } } function getSize(elem) { setup(), typeof elem == “string” && (elem = document.querySelector(elem)); if (!elem || typeof elem != “object” || !elem.nodeType) return; var style = getStyle(elem); if (style.display === “none”) return getZeroSize(); var size = {}; size.width = elem.offsetWidth, size.height = elem.offsetHeight; var isBorderBox = size.isBorderBox = !!boxSizingProp && !!style[boxSizingProp] && style[boxSizingProp] === “border-box”; for (var i = 0, len = measurements.length; i < len; i++) { var measurement = measurements[i] , value = style[measurement]; value = mungeNonPixel(elem, value); var num = parseFloat(value); size[measurement] = isNaN(num) ? 0 : num } var paddingWidth = size.paddingLeft + size.paddingRight , paddingHeight = size.paddingTop + size.paddingBottom , marginWidth = size.marginLeft + size.marginRight , marginHeight = size.marginTop + size.marginBottom , borderWidth = size.borderLeftWidth + size.borderRightWidth , borderHeight = size.borderTopWidth + size.borderBottomWidth , isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter , styleWidth = getStyleSize(style.width); styleWidth !== !1 && (size.width = styleWidth + (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth)); var styleHeight = getStyleSize(style.height); return styleHeight !== !1 && (size.height = styleHeight + (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight)), size.innerWidth = size.width – (paddingWidth + borderWidth), size.innerHeight = size.height – (paddingHeight + borderHeight), size.outerWidth = size.width + marginWidth, size.outerHeight = size.height + marginHeight, size } function mungeNonPixel(elem, value) { if (window.getComputedStyle || value.indexOf(“%”) === -1) return value; var style = elem.style , left = style.left , rs = elem.runtimeStyle , rsLeft = rs && rs.left; return rsLeft && (rs.left = elem.currentStyle.left), style.left = value, value = style.pixelLeft, style.left = left, rsLeft && (rs.left = rsLeft), value } var isSetup = !1, getStyle, boxSizingProp, isBoxSizeOuter; return getSize } var logError = typeof console == “undefined” ? noop : function(message) { console.error(message) } , measurements = [“paddingLeft”, “paddingRight”, “paddingTop”, “paddingBottom”, “marginLeft”, “marginRight”, “marginTop”, “marginBottom”, “borderLeftWidth”, “borderRightWidth”, “borderTopWidth”, “borderBottomWidth”]; typeof define == “function” && define.amd ? define(“get-size/get-size”, [“get-style-property/get-style-property”], defineGetSize) : typeof exports == “object” ? module.exports = defineGetSize(require(“desandro-get-style-property”)) : window.getSize = defineGetSize(window.getStyleProperty) }(window), function(window) { function docReady(fn) { if (typeof fn != “function”) return; docReady.isReady ? fn() : queue.push(fn) } function onReady(event) { var isIE8NotReady = event.type === “readystatechange” && document.readyState !== “complete”; if (docReady.isReady || isIE8NotReady) return; trigger() } function trigger() { docReady.isReady = !0; for (var i = 0, len = queue.length; i < len; i++) { var fn = queue[i]; fn() } } function defineDocReady(eventie) { return document.readyState === “complete” ? trigger() : (eventie.bind(document, “DOMContentLoaded”, onReady), eventie.bind(document, “readystatechange”, onReady), eventie.bind(window, “load”, onReady)), docReady } var document = window.document , queue = []; docReady.isReady = !1, typeof define == “function” && define.amd ? define(“doc-ready/doc-ready”, [“eventie/eventie”], defineDocReady) : typeof exports == “object” ? module.exports = defineDocReady(require(“eventie”)) : window.docReady = defineDocReady(window.eventie) }(window), function(ElemProto) { “use strict”; function match(elem, selector) { return elemmatchesMethod } function checkParent(elem) { if (elem.parentNode) return; var fragment = document.createDocumentFragment(); fragment.appendChild(elem) } function query(elem, selector) { checkParent(elem); var elems = elem.parentNode.querySelectorAll(selector); for (var i = 0, len = elems.length; i < len; i++) if (elems[i] === elem) return !0; return !1 } function matchChild(elem, selector) { return checkParent(elem), match(elem, selector) } var matchesMethod = function() { if (ElemProto.matches) return “matches”; if (ElemProto.matchesSelector) return “matchesSelector”; var prefixes = [“webkit”, “moz”, “ms”, “o”]; for (var i = 0, len = prefixes.length; i < len; i++) { var prefix = prefixes[i] , method = prefix + “MatchesSelector”; if (ElemProto[method]) return method } }(), matchesSelector; if (matchesMethod) { var div = document.createElement(“div”) , supportsOrphans = match(div, “div”); matchesSelector = supportsOrphans ? match : matchChild } else matchesSelector = query; typeof define == “function” && define.amd ? define(“matches-selector/matches-selector”, [], function() { return matchesSelector }) : typeof exports == “object” ? module.exports = matchesSelector : window.matchesSelector = matchesSelector }(Element.prototype), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“fizzy-ui-utils/utils”, [“doc-ready/doc-ready”, “matches-selector/matches-selector”], function(docReady, matchesSelector) { return factory(window, docReady, matchesSelector) }) : typeof exports == “object” ? module.exports = factory(window, require(“doc-ready”), require(“desandro-matches-selector”)) : window.fizzyUIUtils = factory(window, window.docReady, window.matchesSelector) }(window, function factory(window, docReady, matchesSelector) { var utils = {}; utils.extend = function(a, b) { for (var prop in b) a[prop] = b[prop]; return a } , utils.modulo = function(num, div) { return (num % div + div) % div } ; var objToString = Object.prototype.toString; utils.isArray = function(obj) { return objToString.call(obj) == “[object Array]” } , utils.makeArray = function(obj) { var ary = []; if (utils.isArray(obj)) ary = obj; else if (obj && typeof obj.length == “number”) for (var i = 0, len = obj.length; i < len; i++) ary.push(obj[i]); else ary.push(obj); return ary } , utils.indexOf = Array.prototype.indexOf ? function(ary, obj) { return ary.indexOf(obj) } : function(ary, obj) { for (var i = 0, len = ary.length; i < len; i++) if (ary[i] === obj) return i; return -1 } , utils.removeFrom = function(ary, obj) { var index = utils.indexOf(ary, obj); index != -1 && ary.splice(index, 1) } , utils.isElement = typeof HTMLElement == “function” || typeof HTMLElement == “object” ? function isElementDOM2(obj) { return obj instanceof HTMLElement } : function isElementQuirky(obj) { return obj && typeof obj == “object” && obj.nodeType == 1 && typeof obj.nodeName == “string” } , utils.setText = function() { function setText(elem, text) { setTextProperty = setTextProperty || (document.documentElement.textContent !== undefined ? “textContent” : “innerText”), elem[setTextProperty] = text } var setTextProperty; return setText }(), utils.getParent = function(elem, selector) { while (elem != document.body) { elem = elem.parentNode; if (matchesSelector(elem, selector)) return elem } } , utils.getQueryElement = function(elem) { return typeof elem == “string” ? document.querySelector(elem) : elem } , utils.handleEvent = function(event) { var method = “on” + event.type; this[method] && thismethod } , utils.filterFindElements = function(elems, selector) { elems = utils.makeArray(elems); var ffElems = []; for (var i = 0, len = elems.length; i < len; i++) { var elem = elems[i]; if (!utils.isElement(elem) && !SiteParameters.is_frontend_editor) continue; if (selector) { matchesSelector(elem, selector) && ffElems.push(elem); var childElems = elem.querySelectorAll(selector); for (var j = 0, jLen = childElems.length; j < jLen; j++) ffElems.push(childElems[j]) } else ffElems.push(elem) } return ffElems } , utils.debounceMethod = function(_class, methodName, threshold) { var method = _class.prototype[methodName] , timeoutName = methodName + “Timeout”; _class.prototype[methodName] = function() { var timeout = this[timeoutName]; timeout && clearTimeout(timeout); var args = arguments , _this = this; this[timeoutName] = setTimeout(function() { method.apply(_this, args), delete _this[timeoutName] }, threshold || 100) } } , utils.toDashed = function(str) { return str.replace(/(.)([A-Z])/g, function(match, $1, $2) { return $1 + “-” + $2 }).toLowerCase() } ; var console = window.console; return utils.htmlInit = function(WidgetClass, namespace) { docReady(function() { var dashedNamespace = utils.toDashed(namespace) , elems = document.querySelectorAll(“.js-” + dashedNamespace) , dataAttr = “data-” + dashedNamespace + “-options”; for (var i = 0, len = elems.length; i < len; i++) { var elem = elems[i], attr = elem.getAttribute(dataAttr), options; try { options = attr && JSON.parse(attr) } catch (error) { console && console.error(“Error parsing ” + dataAttr + ” on ” + elem.nodeName.toLowerCase() + (elem.id ? “#” + elem.id : “”) + “: ” + error); continue } var instance = new WidgetClass(elem,options) , jQuery = window.jQuery; jQuery && jQuery.data(elem, namespace, instance) } }) } , utils }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“outlayer/item”, [“eventEmitter/EventEmitter”, “get-size/get-size”, “get-style-property/get-style-property”, “fizzy-ui-utils/utils”], function(EventEmitter, getSize, getStyleProperty, utils) { return factory(window, EventEmitter, getSize, getStyleProperty, utils) }) : typeof exports == “object” ? module.exports = factory(window, require(“wolfy87-eventemitter”), require(“get-size”), require(“desandro-get-style-property”), require(“fizzy-ui-utils”)) : (window.Outlayer = {}, window.Outlayer.Item = factory(window, window.EventEmitter, window.getSize, window.getStyleProperty, window.fizzyUIUtils)) }(window, function factory(window, EventEmitter, getSize, getStyleProperty, utils) { “use strict”; function isEmptyObj(obj) { for (var prop in obj) return !1; return prop = null, !0 } function Item(element, layout) { if (!element) return; this.element = element, this.layout = layout, this.position = { x: 0, y: 0 }, this._create() } function toDashedAll(str) { return str.replace(/([A-Z])/g, function($1) { return “-” + $1.toLowerCase() }) } var getComputedStyle = window.getComputedStyle , getStyle = getComputedStyle ? function(elem) { return getComputedStyle(elem, null) } : function(elem) { return elem.currentStyle } , transitionProperty = getStyleProperty(“transition”) , transformProperty = getStyleProperty(“transform”) , supportsCSS3 = transitionProperty && transformProperty , is3d = !!getStyleProperty(“perspective”) , transitionEndEvent = { WebkitTransition: “webkitTransitionEnd”, MozTransition: “transitionend”, OTransition: “otransitionend”, transition: “transitionend” }[transitionProperty] , prefixableProperties = [“transform”, “transition”, “transitionDuration”, “transitionProperty”] , vendorProperties = function() { var cache = {}; for (var i = 0, len = prefixableProperties.length; i < len; i++) { var prop = prefixableProperties[i] , supportedProp = getStyleProperty(prop); supportedProp && supportedProp !== prop && (cache[prop] = supportedProp) } return cache }(); utils.extend(Item.prototype, EventEmitter.prototype), Item.prototype._create = function() { this._transn = { ingProperties: {}, clean: {}, onEnd: {} }, this.css({ position: “absolute” }) } , Item.prototype.handleEvent = function(event) { var method = “on” + event.type; this[method] && thismethod } , Item.prototype.getSize = function() { this.size = getSize(this.element) } , Item.prototype.css = function(style) { var elemStyle = this.element.style; for (var prop in style) { var supportedProp = vendorProperties[prop] || prop; elemStyle[supportedProp] = style[prop] } } , Item.prototype.getPosition = function() { var style = getStyle(this.element) , layoutOptions = this.layout.options , isOriginLeft = layoutOptions.isOriginLeft , isOriginTop = layoutOptions.isOriginTop , xValue = style[isOriginLeft ? “left” : “right”] , yValue = style[isOriginTop ? “top” : “bottom”] , layoutSize = this.layout.size , x = xValue.indexOf(“%”) != -1 ? parseFloat(xValue) / 100 * layoutSize.width : parseInt(xValue, 10) , y = yValue.indexOf(“%”) != -1 ? parseFloat(yValue) / 100 * layoutSize.height : parseInt(yValue, 10); x = isNaN(x) ? 0 : x, y = isNaN(y) ? 0 : y, x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight, y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom, this.position.x = x, this.position.y = y } , Item.prototype.layoutPosition = function() { var layoutSize = this.layout.size , layoutOptions = this.layout.options , style = {} , xPadding = layoutOptions.isOriginLeft ? “paddingLeft” : “paddingRight” , xProperty = layoutOptions.isOriginLeft ? “left” : “right” , xResetProperty = layoutOptions.isOriginLeft ? “right” : “left” , x = this.position.x + layoutSize[xPadding]; style[xProperty] = this.getXValue(x), style[xResetProperty] = “”; var yPadding = layoutOptions.isOriginTop ? “paddingTop” : “paddingBottom” , yProperty = layoutOptions.isOriginTop ? “top” : “bottom” , yResetProperty = layoutOptions.isOriginTop ? “bottom” : “top” , y = this.position.y + layoutSize[yPadding]; style[yProperty] = this.getYValue(y), style[yResetProperty] = “”, this.css(style), this.emitEvent(“layout”, [this]) } , Item.prototype.getXValue = function(x) { var layoutOptions = this.layout.options; return layoutOptions.percentPosition && !layoutOptions.isHorizontal ? x / this.layout.size.width * 100 + “%” : x + “px” } , Item.prototype.getYValue = function(y) { var layoutOptions = this.layout.options; return layoutOptions.percentPosition && layoutOptions.isHorizontal ? y / this.layout.size.height * 100 + “%” : y + “px” } , Item.prototype._transitionTo = function(x, y) { this.getPosition(); var curX = this.position.x , curY = this.position.y , compareX = parseInt(x, 10) , compareY = parseInt(y, 10) , didNotMove = compareX === this.position.x && compareY === this.position.y; this.setPosition(x, y); if (didNotMove && !this.isTransitioning) { this.layoutPosition(); return } var transX = x – curX , transY = y – curY , transitionStyle = {}; transitionStyle.transform = this.getTranslate(transX, transY), this.transition({ to: transitionStyle, onTransitionEnd: { transform: this.layoutPosition }, isCleaning: !0 }) } , Item.prototype.getTranslate = function(x, y) { var layoutOptions = this.layout.options; return x = layoutOptions.isOriginLeft ? x : -x, y = layoutOptions.isOriginTop ? y : -y, is3d ? “translate3d(” + x + “px, ” + y + “px, 0)” : “translate(” + x + “px, ” + y + “px)” } , Item.prototype.goTo = function(x, y) { this.setPosition(x, y), this.layoutPosition() } , Item.prototype.moveTo = supportsCSS3 ? Item.prototype._transitionTo : Item.prototype.goTo, Item.prototype.setPosition = function(x, y) { this.position.x = parseInt(x, 10), this.position.y = parseInt(y, 10) } , Item.prototype._nonTransition = function(args) { this.css(args.to), args.isCleaning && this._removeStyles(args.to); for (var prop in args.onTransitionEnd) args.onTransitionEnd[prop].call(this) } , Item.prototype._transition = function(args) { if (!parseFloat(this.layout.options.transitionDuration)) { this._nonTransition(args); return } var _transition = this._transn; for (var prop in args.onTransitionEnd) _transition.onEnd[prop] = args.onTransitionEnd[prop]; for (prop in args.to) _transition.ingProperties[prop] = !0, args.isCleaning && (_transition.clean[prop] = !0); if (args.from) { this.css(args.from); var h = this.element.offsetHeight; h = null } this.enableTransition(args.to), this.css(args.to), this.isTransitioning = !0 } ; var transitionProps = “opacity,” + toDashedAll(vendorProperties.transform || “transform”); Item.prototype.enableTransition = function() { if (this.isTransitioning) return; this.css({ transitionProperty: transitionProps, transitionDuration: this.layout.options.transitionDuration }), this.element.addEventListener(transitionEndEvent, this, !1) } , Item.prototype.transition = Item.prototype[transitionProperty ? “_transition” : “_nonTransition”], Item.prototype.onwebkitTransitionEnd = function(event) { this.ontransitionend(event) } , Item.prototype.onotransitionend = function(event) { this.ontransitionend(event) } ; var dashedVendorProperties = { “-webkit-transform”: “transform”, “-moz-transform”: “transform”, “-o-transform”: “transform” }; Item.prototype.ontransitionend = function(event) { if (event.target !== this.element) return; var _transition = this._transn , propertyName = dashedVendorProperties[event.propertyName] || event.propertyName; delete _transition.ingProperties[propertyName], isEmptyObj(_transition.ingProperties) && this.disableTransition(), propertyName in _transition.clean && (this.element.style[event.propertyName] = “”, delete _transition.clean[propertyName]); if (propertyName in _transition.onEnd) { var onTransitionEnd = _transition.onEnd[propertyName]; onTransitionEnd.call(this), delete _transition.onEnd[propertyName] } this.emitEvent(“transitionEnd”, [this]) } , Item.prototype.disableTransition = function() { this.removeTransitionStyles(), this.element.removeEventListener(transitionEndEvent, this, !1), this.isTransitioning = !1 } , Item.prototype._removeStyles = function(style) { var cleanStyle = {}; for (var prop in style) cleanStyle[prop] = “”; this.css(cleanStyle) } ; var cleanTransitionStyle = { transitionProperty: “”, transitionDuration: “” }; return Item.prototype.removeTransitionStyles = function() { this.css(cleanTransitionStyle) } , Item.prototype.removeElem = function() { this.element.parentNode.removeChild(this.element), this.css({ display: “” }), this.emitEvent(“remove”, [this]) } , Item.prototype.remove = function() { if (!transitionProperty || !parseFloat(this.layout.options.transitionDuration)) { this.removeElem(); return } var _this = this; this.once(“transitionEnd”, function() { _this.removeElem() }), this.hide() } , Item.prototype.reveal = function() { delete this.isHidden, this.css({ display: “” }); var options = this.layout.options , onTransitionEnd = {} , transitionEndProperty = this.getHideRevealTransitionEndProperty(“visibleStyle”); onTransitionEnd[transitionEndProperty] = this.onRevealTransitionEnd, this.transition({ from: options.hiddenStyle, to: options.visibleStyle, isCleaning: !0, onTransitionEnd: onTransitionEnd }) } , Item.prototype.onRevealTransitionEnd = function() { this.isHidden || this.emitEvent(“reveal”) } , Item.prototype.getHideRevealTransitionEndProperty = function(styleProperty) { var optionStyle = this.layout.options[styleProperty]; if (optionStyle.opacity) return “opacity”; for (var prop in optionStyle) return prop } , Item.prototype.hide = function() { this.isHidden = !0, this.css({ display: “” }); var options = this.layout.options , onTransitionEnd = {} , transitionEndProperty = this.getHideRevealTransitionEndProperty(“hiddenStyle”); onTransitionEnd[transitionEndProperty] = this.onHideTransitionEnd, this.transition({ from: options.visibleStyle, to: options.hiddenStyle, isCleaning: !0, onTransitionEnd: onTransitionEnd }) } , Item.prototype.onHideTransitionEnd = function() { this.isHidden && (this.css({ display: “none” }), this.emitEvent(“hide”)) } , Item.prototype.destroy = function() { this.css({ position: “”, left: “”, right: “”, top: “”, bottom: “”, transition: “”, transform: “” }) } , Item }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“outlayer/outlayer”, [“eventie/eventie”, “eventEmitter/EventEmitter”, “get-size/get-size”, “fizzy-ui-utils/utils”, “./item”], function(eventie, EventEmitter, getSize, utils, Item) { return factory(window, eventie, EventEmitter, getSize, utils, Item) }) : typeof exports == “object” ? module.exports = factory(window, require(“eventie”), require(“wolfy87-eventemitter”), require(“get-size”), require(“fizzy-ui-utils”), require(“./item”)) : window.Outlayer = factory(window, window.eventie, window.EventEmitter, window.getSize, window.fizzyUIUtils, window.Outlayer.Item) }(window, function factory(window, eventie, EventEmitter, getSize, utils, Item) { “use strict”; function Outlayer(element, options) { var queryElement = utils.getQueryElement(element); if (!queryElement) { console && console.error(“Bad element for ” + this.constructor.namespace + “: ” + (queryElement || element)); return } this.element = queryElement, jQuery && (this.$element = jQuery(this.element)), this.options = utils.extend({}, this.constructor.defaults), this.option(options); var id = ++GUID; this.element.outlayerGUID = id, instances[id] = this, this._create(), this.options.isInitLayout && this.layout() } var console = window.console , jQuery = window.jQuery , noop = function() {} , GUID = 0 , instances = {}; return Outlayer.namespace = “outlayer”, Outlayer.Item = Item, Outlayer.defaults = { containerStyle: { position: “relative” }, isInitLayout: !0, isOriginLeft: !0, isOriginTop: !0, isResizeBound: !0, isResizingContainer: !0, transitionDuration: “0.4s”, hiddenStyle: { opacity: 0, transform: “scale(0.001)” }, visibleStyle: { opacity: 1, transform: “scale(1)” } }, utils.extend(Outlayer.prototype, EventEmitter.prototype), Outlayer.prototype.option = function(opts) { utils.extend(this.options, opts) } , Outlayer.prototype._create = function() { this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), utils.extend(this.element.style, this.options.containerStyle), this.options.isResizeBound && this.bindResize() } , Outlayer.prototype.reloadItems = function() { this.items = this._itemize(this.element.children) } , Outlayer.prototype._itemize = function(elems) { var itemElems = this._filterFindItemElements(elems) , Item = this.constructor.Item , items = []; for (var i = 0, len = itemElems.length; i < len; i++) { var elem = itemElems[i] , item = new Item(elem,this); items.push(item) } return items } , Outlayer.prototype._filterFindItemElements = function(elems) { return utils.filterFindElements(elems, this.options.itemSelector) } , Outlayer.prototype.getItemElements = function() { var elems = []; for (var i = 0, len = this.items.length; i < len; i++) elems.push(this.items[i].element); return elems } , Outlayer.prototype.layout = function() { this._resetLayout(), this._manageStamps(); var isInstant = this.options.isLayoutInstant !== undefined ? this.options.isLayoutInstant : !this._isLayoutInited; this.layoutItems(this.items, isInstant), this._isLayoutInited = !0 } , Outlayer.prototype._init = Outlayer.prototype.layout, Outlayer.prototype._resetLayout = function() { this.getSize() } , Outlayer.prototype.getSize = function() { this.size = getSize(this.element) } , Outlayer.prototype._getMeasurement = function(measurement, size) { var option = this.options[measurement], elem; option ? (typeof option == “string” ? elem = this.element.querySelector(option) : utils.isElement(option) && (elem = option), this[measurement] = elem ? getSize(elem)[size] : option) : this[measurement] = 0 } , Outlayer.prototype.layoutItems = function(items, isInstant) { items = this._getItemsForLayout(items), this._layoutItems(items, isInstant), this._postLayout() } , Outlayer.prototype._getItemsForLayout = function(items) { var layoutItems = []; for (var i = 0, len = items.length; i < len; i++) { var item = items[i]; item.isIgnored || layoutItems.push(item) } return layoutItems } , Outlayer.prototype._layoutItems = function(items, isInstant) { this._emitCompleteOnItems(“layout”, items); if (!items || !items.length) return; var queue = []; for (var i = 0, len = items.length; i < len; i++) { var item = items[i] , position = this._getItemLayoutPosition(item); position.item = item, position.isInstant = isInstant || item.isLayoutInstant, queue.push(position) } this._processLayoutQueue(queue) } , Outlayer.prototype._getItemLayoutPosition = function() { return { x: 0, y: 0 } } , Outlayer.prototype._processLayoutQueue = function(queue) { for (var i = 0, len = queue.length; i < len; i++) { var obj = queue[i]; this._positionItem(obj.item, obj.x, obj.y, obj.isInstant) } } , Outlayer.prototype._positionItem = function(item, x, y, isInstant) { isInstant ? item.goTo(x, y) : item.moveTo(x, y) } , Outlayer.prototype._postLayout = function() { this.resizeContainer() } , Outlayer.prototype.resizeContainer = function() { if (!this.options.isResizingContainer) return; var size = this._getContainerSize(); size && (this._setContainerMeasure(size.width, !0), this._setContainerMeasure(size.height, !1)) } , Outlayer.prototype._getContainerSize = noop, Outlayer.prototype._setContainerMeasure = function(measure, isWidth) { if (measure === undefined) return; var elemSize = this.size; elemSize.isBorderBox && (measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth), measure = Math.max(measure, 0), this.element.style[isWidth ? “width” : “height”] = measure + “px” } , Outlayer.prototype._emitCompleteOnItems = function(eventName, items) { function onComplete() { _this.dispatchEvent(eventName + “Complete”, null, [items]) } function tick() { doneCount++, doneCount === count && onComplete() } var _this = this , count = items.length; if (!items || !count) { onComplete(); return } var doneCount = 0; for (var i = 0, len = items.length; i < len; i++) { var item = items[i]; item.once(eventName, tick) } } , Outlayer.prototype.dispatchEvent = function(type, event, args) { var emitArgs = event ? [event].concat(args) : args; this.emitEvent(type, emitArgs); if (jQuery) { this.$element = this.$element || jQuery(this.element); if (event) { var $event = jQuery.Event(event); $event.type = type, this.$element.trigger($event, args) } else this.$element.trigger(type, args) } } , Outlayer.prototype.ignore = function(elem) { var item = this.getItem(elem); item && (item.isIgnored = !0) } , Outlayer.prototype.unignore = function(elem) { var item = this.getItem(elem); item && delete item.isIgnored } , Outlayer.prototype.stamp = function(elems) { elems = this._find(elems); if (!elems) return; this.stamps = this.stamps.concat(elems); for (var i = 0, len = elems.length; i < len; i++) { var elem = elems[i]; this.ignore(elem) } } , Outlayer.prototype.unstamp = function(elems) { elems = this._find(elems); if (!elems) return; for (var i = 0, len = elems.length; i < len; i++) { var elem = elems[i]; utils.removeFrom(this.stamps, elem), this.unignore(elem) } } , Outlayer.prototype._find = function(elems) { if (!elems) return; return typeof elems == “string” && (elems = this.element.querySelectorAll(elems)), elems = utils.makeArray(elems), elems } , Outlayer.prototype._manageStamps = function() { if (!this.stamps || !this.stamps.length) return; this._getBoundingRect(); for (var i = 0, len = this.stamps.length; i < len; i++) { var stamp = this.stamps[i]; this._manageStamp(stamp) } } , Outlayer.prototype._getBoundingRect = function() { var boundingRect = this.element.getBoundingClientRect() , size = this.size; this._boundingRect = { left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, top: boundingRect.top + size.paddingTop + size.borderTopWidth, right: boundingRect.right – (size.paddingRight + size.borderRightWidth), bottom: boundingRect.bottom – (size.paddingBottom + size.borderBottomWidth) } } , Outlayer.prototype._manageStamp = noop, Outlayer.prototype._getElementOffset = function(elem) { var boundingRect = elem.getBoundingClientRect() , thisRect = this._boundingRect , size = getSize(elem) , offset = { left: boundingRect.left – thisRect.left – size.marginLeft, top: boundingRect.top – thisRect.top – size.marginTop, right: thisRect.right – boundingRect.right – size.marginRight, bottom: thisRect.bottom – boundingRect.bottom – size.marginBottom }; return offset } , Outlayer.prototype.handleEvent = function(event) { var method = “on” + event.type; this[method] && thismethod } , Outlayer.prototype.bindResize = function() { if (this.isResizeBound) return; eventie.bind(window, “resize”, this), this.isResizeBound = !0 } , Outlayer.prototype.unbindResize = function() { this.isResizeBound && eventie.unbind(window, “resize”, this), this.isResizeBound = !1 } , Outlayer.prototype.onresize = function() { function delayed() { _this.resize(), delete _this.resizeTimeout } this.resizeTimeout && clearTimeout(this.resizeTimeout); var _this = this; this.resizeTimeout = setTimeout(delayed, 100) } , Outlayer.prototype.resize = function() { if (!this.isResizeBound || !this.needsResizeLayout()) return; this.layout() } , Outlayer.prototype.needsResizeLayout = function() { var size = getSize(this.element) , hasSizes = this.size && size; return hasSizes && size.innerWidth !== this.size.innerWidth } , Outlayer.prototype.addItems = function(elems) { var items = this._itemize(elems); return items.length && (this.items = this.items.concat(items)), items } , Outlayer.prototype.appended = function(elems) { var items = this.addItems(elems); if (!items.length) return; this.layoutItems(items, !0), this.reveal(items) } , Outlayer.prototype.prepended = function(elems) { var items = this._itemize(elems); if (!items.length) return; var previousItems = this.items.slice(0); this.items = items.concat(previousItems), this._resetLayout(), this._manageStamps(), this.layoutItems(items, !0), this.reveal(items), this.layoutItems(previousItems) } , Outlayer.prototype.reveal = function(items) { this._emitCompleteOnItems(“reveal”, items); var len = items && items.length; for (var i = 0; len && i < len; i++) { var item = items[i]; item.reveal() } } , Outlayer.prototype.hide = function(items) { this._emitCompleteOnItems(“hide”, items); var len = items && items.length; for (var i = 0; len && i < len; i++) { var item = items[i]; item.hide() } } , Outlayer.prototype.revealItemElements = function(elems) { var items = this.getItems(elems); this.reveal(items) } , Outlayer.prototype.hideItemElements = function(elems) { var items = this.getItems(elems); this.hide(items) } , Outlayer.prototype.getItem = function(elem) { for (var i = 0, len = this.items.length; i < len; i++) { var item = this.items[i]; if (item.element === elem) return item } } , Outlayer.prototype.getItems = function(elems) { elems = utils.makeArray(elems); var items = []; for (var i = 0, len = elems.length; i < len; i++) { var elem = elems[i] , item = this.getItem(elem); item && items.push(item) } return items } , Outlayer.prototype.remove = function(elems) { var removeItems = this.getItems(elems); this._emitCompleteOnItems(“remove”, removeItems); if (!removeItems || !removeItems.length) return; for (var i = 0, len = removeItems.length; i < len; i++) { var item = removeItems[i]; item.remove(), utils.removeFrom(this.items, item) } } , Outlayer.prototype.destroy = function() { var style = this.element.style; style.height = “”, style.position = “”, style.width = “”; for (var i = 0, len = this.items.length; i < len; i++) { var item = this.items[i]; item.destroy() } this.unbindResize(); var id = this.element.outlayerGUID; delete instances[id], delete this.element.outlayerGUID, jQuery && jQuery.removeData(this.element, this.constructor.namespace) } , Outlayer.data = function(elem) { elem = utils.getQueryElement(elem); var id = elem && elem.outlayerGUID; return id && instances[id] } , Outlayer.create = function(namespace, options) { function Layout() { Outlayer.apply(this, arguments) } return Object.create ? Layout.prototype = Object.create(Outlayer.prototype) : utils.extend(Layout.prototype, Outlayer.prototype), Layout.prototype.constructor = Layout, Layout.defaults = utils.extend({}, Outlayer.defaults), utils.extend(Layout.defaults, options), Layout.prototype.settings = {}, Layout.namespace = namespace, Layout.data = Outlayer.data, Layout.Item = function LayoutItem() { Item.apply(this, arguments) } , Layout.Item.prototype = new Item, utils.htmlInit(Layout, namespace), jQuery && jQuery.bridget && jQuery.bridget(namespace, Layout), Layout } , Outlayer.Item = Item, Outlayer }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“isotope/js/item”, [“outlayer/outlayer”], factory) : typeof exports == “object” ? module.exports = factory(require(“outlayer”)) : (window.Isotope = window.Isotope || {}, window.Isotope.Item = factory(window.Outlayer)) }(window, function factory(Outlayer) { “use strict”; function Item() { Outlayer.Item.apply(this, arguments) } Item.prototype = new Outlayer.Item, Item.prototype._create = function() { this.id = this.layout.itemGUID++, Outlayer.Item.prototype._create.call(this), this.sortData = {} } , Item.prototype.updateSortData = function() { if (this.isIgnored) return; this.sortData.id = this.id, this.sortData[“original-order”] = this.id, this.sortData.random = Math.random(); var getSortData = this.layout.options.getSortData , sorters = this.layout._sorters; for (var key in getSortData) { var sorter = sorters[key]; this.sortData[key] = sorter(this.element, this) } } ; var _destroy = Item.prototype.destroy; return Item.prototype.destroy = function() { _destroy.apply(this, arguments), this.css({ display: “” }) } , Item }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“isotope/js/layout-mode”, [“get-size/get-size”, “outlayer/outlayer”], factory) : typeof exports == “object” ? module.exports = factory(require(“get-size”), require(“outlayer”)) : (window.Isotope = window.Isotope || {}, window.Isotope.LayoutMode = factory(window.getSize, window.Outlayer)) }(window, function factory(getSize, Outlayer) { “use strict”; function LayoutMode(isotope) { this.isotope = isotope, isotope && (this.options = isotope.options[this.namespace], this.element = isotope.element, this.items = isotope.filteredItems, this.size = isotope.size) } return function() { function getOutlayerMethod(methodName) { return function() { return Outlayer.prototype[methodName].apply(this.isotope, arguments) } } var facadeMethods = [“_resetLayout”, “_getItemLayoutPosition”, “_manageStamp”, “_getContainerSize”, “_getElementOffset”, “needsResizeLayout”]; for (var i = 0, len = facadeMethods.length; i < len; i++) { var methodName = facadeMethods[i]; LayoutMode.prototype[methodName] = getOutlayerMethod(methodName) } }(), LayoutMode.prototype.needsVerticalResizeLayout = function() { var size = getSize(this.isotope.element) , hasSizes = this.isotope.size && size; return hasSizes && size.innerHeight != this.isotope.size.innerHeight } , LayoutMode.prototype._getMeasurement = function() { this.isotope._getMeasurement.apply(this, arguments) } , LayoutMode.prototype.getColumnWidth = function() { this.getSegmentSize(“column”, “Width”) } , LayoutMode.prototype.getRowHeight = function() { this.getSegmentSize(“row”, “Height”) } , LayoutMode.prototype.getSegmentSize = function(segment, size) { var segmentName = segment + size , outerSize = “outer” + size; this._getMeasurement(segmentName, outerSize); if (this[segmentName]) return; var firstItemSize = this.getFirstItemSize(); this[segmentName] = firstItemSize && firstItemSize[outerSize] || this.isotope.size[“inner” + size] } , LayoutMode.prototype.getFirstItemSize = function() { var firstItem = this.isotope.filteredItems[0]; return firstItem && firstItem.element && getSize(firstItem.element) } , LayoutMode.prototype.layout = function() { this.isotope.layout.apply(this.isotope, arguments) } , LayoutMode.prototype.getSize = function() { this.isotope.getSize(), this.size = this.isotope.size } , LayoutMode.modes = {}, LayoutMode.create = function(namespace, options) { function Mode() { LayoutMode.apply(this, arguments) } return Mode.prototype = new LayoutMode, options && (Mode.options = options), Mode.prototype.namespace = namespace, LayoutMode.modes[namespace] = Mode, Mode } , LayoutMode }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“masonry/masonry”, [“outlayer/outlayer”, “get-size/get-size”, “fizzy-ui-utils/utils”], factory) : typeof exports == “object” ? module.exports = factory(require(“outlayer”), require(“get-size”), require(“fizzy-ui-utils”)) : window.Masonry = factory(window.Outlayer, window.getSize, window.fizzyUIUtils) }(window, function factory(Outlayer, getSize, utils) { var Masonry = Outlayer.create(“masonry”); return Masonry.prototype._resetLayout = function() { this.getSize(), this._getMeasurement(“columnWidth”, “outerWidth”), this._getMeasurement(“gutter”, “outerWidth”), this.measureColumns(); var i = this.cols; this.colYs = []; while (i–) this.colYs.push(0); this.maxY = 0 } , Masonry.prototype.measureColumns = function() { this.getContainerWidth(); if (!this.columnWidth) { var firstItem = this.items[0] , firstItemElem = firstItem && firstItem.element; this.columnWidth = firstItemElem && getSize(firstItemElem).outerWidth || this.containerWidth } var columnWidth = this.columnWidth += this.gutter , containerWidth = this.containerWidth + this.gutter , cols = containerWidth / columnWidth , excess = columnWidth – containerWidth % columnWidth , mathMethod = excess && excess < 1 ? “round” : “floor”; cols = MathmathMethod, this.cols = Math.max(cols, 1) } , Masonry.prototype.getContainerWidth = function() { var container = this.options.isFitWidth ? this.element.parentNode : this.element , size = getSize(container); this.containerWidth = size && size.innerWidth } , Masonry.prototype._getItemLayoutPosition = function(item) { item.getSize(); var remainder = item.size.outerWidth % this.columnWidth , mathMethod = remainder && remainder < 1 ? “round” : “ceil” , colSpan = Math[mathMethod](item.size.outerWidth / this.columnWidth); colSpan = Math.min(colSpan, this.cols); var colGroup = this._getColGroup(colSpan) , minimumY = Math.min.apply(Math, colGroup) , shortColIndex = utils.indexOf(colGroup, minimumY) , position = { x: this.columnWidth * shortColIndex, y: minimumY } , setHeight = minimumY + item.size.outerHeight , setSpan = this.cols + 1 – colGroup.length; for (var i = 0; i < setSpan; i++) this.colYs[shortColIndex + i] = setHeight; return position } , Masonry.prototype._getColGroup = function(colSpan) { if (colSpan < 2) return this.colYs; var colGroup = [] , groupCount = this.cols + 1 – colSpan; for (var i = 0; i < groupCount; i++) { var groupColYs = this.colYs.slice(i, i + colSpan); colGroup[i] = Math.max.apply(Math, groupColYs) } return colGroup } , Masonry.prototype._manageStamp = function(stamp) { var stampSize = getSize(stamp) , offset = this._getElementOffset(stamp) , firstX = this.options.isOriginLeft ? offset.left : offset.right , lastX = firstX + stampSize.outerWidth , firstCol = Math.floor(firstX / this.columnWidth); firstCol = Math.max(0, firstCol); var lastCol = Math.floor(lastX / this.columnWidth); lastCol -= lastX % this.columnWidth ? 0 : 1, lastCol = Math.min(this.cols – 1, lastCol); var stampMaxY = (this.options.isOriginTop ? offset.top : offset.bottom) + stampSize.outerHeight; for (var i = firstCol; i <= lastCol; i++) this.colYs[i] = Math.max(stampMaxY, this.colYs[i]) } , Masonry.prototype._getContainerSize = function() { this.maxY = Math.max.apply(Math, this.colYs); var size = { height: this.maxY }; return this.options.isFitWidth && (size.width = this._getContainerFitWidth()), size } , Masonry.prototype._getContainerFitWidth = function() { var unusedCols = 0 , i = this.cols; while (–i) { if (this.colYs[i] !== 0) break; unusedCols++ } return (this.cols – unusedCols) * this.columnWidth – this.gutter } , Masonry.prototype.needsResizeLayout = function() { var previousWidth = this.containerWidth; return this.getContainerWidth(), previousWidth !== this.containerWidth } , Masonry }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“isotope/js/layout-modes/masonry”, [“../layout-mode”, “masonry/masonry”], factory) : typeof exports == “object” ? module.exports = factory(require(“../layout-mode”), require(“masonry-layout”)) : factory(window.Isotope.LayoutMode, window.Masonry) }(window, function factory(LayoutMode, Masonry) { “use strict”; function extend(a, b) { for (var prop in b) a[prop] = b[prop]; return a } var MasonryMode = LayoutMode.create(“masonry”) , _getElementOffset = MasonryMode.prototype._getElementOffset , layout = MasonryMode.prototype.layout , _getMeasurement = MasonryMode.prototype._getMeasurement; extend(MasonryMode.prototype, Masonry.prototype), MasonryMode.prototype._getElementOffset = _getElementOffset, MasonryMode.prototype.layout = layout, MasonryMode.prototype._getMeasurement = _getMeasurement; var measureColumns = MasonryMode.prototype.measureColumns; MasonryMode.prototype.measureColumns = function() { this.items = this.isotope.filteredItems, measureColumns.call(this) } ; var _manageStamp = MasonryMode.prototype._manageStamp; return MasonryMode.prototype._manageStamp = function() { this.options.isOriginLeft = this.isotope.options.isOriginLeft, this.options.isOriginTop = this.isotope.options.isOriginTop, _manageStamp.apply(this, arguments) } , MasonryMode }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“isotope/js/layout-modes/fit-rows”, [“../layout-mode”], factory) : typeof exports == “object” ? module.exports = factory(require(“../layout-mode”)) : factory(window.Isotope.LayoutMode) }(window, function factory(LayoutMode) { “use strict”; var FitRows = LayoutMode.create(“fitRows”); return FitRows.prototype._resetLayout = function() { this.x = 0, this.y = 0, this.maxY = 0, this._getMeasurement(“gutter”, “outerWidth”) } , FitRows.prototype._getItemLayoutPosition = function(item) { item.getSize(); var itemWidth = item.size.outerWidth + this.gutter , containerWidth = this.isotope.size.innerWidth + this.gutter; this.x !== 0 && itemWidth + this.x > containerWidth && (this.x = 0, this.y = this.maxY); var position = { x: this.x, y: this.y }; return this.maxY = Math.max(this.maxY, this.y + item.size.outerHeight), this.x += itemWidth, position } , FitRows.prototype._getContainerSize = function() { return { height: this.maxY } } , FitRows }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define(“isotope/js/layout-modes/vertical”, [“../layout-mode”], factory) : typeof exports == “object” ? module.exports = factory(require(“../layout-mode”)) : factory(window.Isotope.LayoutMode) }(window, function factory(LayoutMode) { “use strict”; var Vertical = LayoutMode.create(“vertical”, { horizontalAlignment: 0 }); return Vertical.prototype._resetLayout = function() { this.y = 0 } , Vertical.prototype._getItemLayoutPosition = function(item) { item.getSize(); var x = (this.isotope.size.innerWidth – item.size.outerWidth) * this.options.horizontalAlignment , y = this.y; return this.y += item.size.outerHeight, { x: x, y: y } } , Vertical.prototype._getContainerSize = function() { return { height: this.y } } , Vertical }), function(window, factory) { “use strict”; typeof define == “function” && define.amd ? define([“outlayer/outlayer”, “get-size/get-size”, “matches-selector/matches-selector”, “fizzy-ui-utils/utils”, “isotope/js/item”, “isotope/js/layout-mode”, “isotope/js/layout-modes/masonry”, “isotope/js/layout-modes/fit-rows”, “isotope/js/layout-modes/vertical”], function(Outlayer, getSize, matchesSelector, utils, Item, LayoutMode) { return factory(window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode) }) : typeof exports == “object” ? module.exports = factory(window, require(“outlayer”), require(“get-size”), require(“desandro-matches-selector”), require(“fizzy-ui-utils”), require(“./item”), require(“./layout-mode”), require(“./layout-modes/masonry”), require(“./layout-modes/fit-rows”), require(“./layout-modes/vertical”)) : window.Isotope = factory(window, window.Outlayer, window.getSize, window.matchesSelector, window.fizzyUIUtils, window.Isotope.Item, window.Isotope.LayoutMode) }(window, function factory(window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode) { function getItemSorter(sortBys, sortAsc) { return function sorter(itemA, itemB) { for (var i = 0, len = sortBys.length; i < len; i++) { var sortBy = sortBys[i] , a = itemA.sortData[sortBy] , b = itemB.sortData[sortBy]; if (a > b || a < b) { var isAscending = sortAsc[sortBy] !== undefined ? sortAsc[sortBy] : sortAsc , direction = isAscending ? 1 : -1; return (a > b ? 1 : -1) * direction } } return 0 } } var jQuery = window.jQuery , trim = String.prototype.trim ? function(str) { return str.trim() } : function(str) { return str.replace(/^\s+|\s+$/g, “”) } , docElem = document.documentElement , getText = docElem.textContent ? function(elem) { return elem.textContent } : function(elem) { return elem.innerText } , Isotope = Outlayer.create(“isotope”, { layoutMode: “masonry”, isJQueryFiltering: !0, sortAscending: !0 }); Isotope.Item = Item, Isotope.LayoutMode = LayoutMode, Isotope.prototype._create = function() { this.itemGUID = 0, this._sorters = {}, this._getSorters(), Outlayer.prototype._create.call(this), this.modes = {}, this.filteredItems = this.items, this.sortHistory = [“original-order”]; for (var name in LayoutMode.modes) this._initLayoutMode(name) } , Isotope.prototype.reloadItems = function() { this.itemGUID = 0, Outlayer.prototype.reloadItems.call(this) } , Isotope.prototype._itemize = function() { var items = Outlayer.prototype._itemize.apply(this, arguments); for (var i = 0, len = items.length; i < len; i++) { var item = items[i]; item.id = this.itemGUID++ } return this._updateItemsSortData(items), items } , Isotope.prototype._initLayoutMode = function(name) { var Mode = LayoutMode.modes[name] , initialOpts = this.options[name] || {}; this.options[name] = Mode.options ? utils.extend(Mode.options, initialOpts) : initialOpts, this.modes[name] = new Mode(this) } , Isotope.prototype.layout = function() { if (!this._isLayoutInited && this.options.isInitLayout) { this.arrange(); return } this._layout() } , Isotope.prototype._layout = function() { var isInstant = this._getIsInstant(); this._resetLayout(), this._manageStamps(), this.layoutItems(this.filteredItems, isInstant), this._isLayoutInited = !0 } , Isotope.prototype.arrange = function(opts) { function hideReveal() { _this.reveal(filtered.needReveal), _this.hide(filtered.needHide) } this.option(opts), this._getIsInstant(); var filtered = this._filter(this.items); this.filteredItems = filtered.matches; var _this = this; this._bindArrangeComplete(), this._isInstant ? this._noTransition(hideReveal) : hideReveal(), this._sort(), this._layout() } , Isotope.prototype._init = Isotope.prototype.arrange, Isotope.prototype._getIsInstant = function() { var isInstant = this.options.isLayoutInstant !== undefined ? this.options.isLayoutInstant : !this._isLayoutInited; return this._isInstant = isInstant, isInstant } , Isotope.prototype._bindArrangeComplete = function() { function arrangeParallelCallback() { isLayoutComplete && isHideComplete && isRevealComplete && _this.dispatchEvent(“arrangeComplete”, null, [_this.filteredItems]) } var isLayoutComplete, isHideComplete, isRevealComplete, _this = this; this.once(“layoutComplete”, function() { isLayoutComplete = !0, arrangeParallelCallback() }), this.once(“hideComplete”, function() { isHideComplete = !0, arrangeParallelCallback() }), this.once(“revealComplete”, function() { isRevealComplete = !0, arrangeParallelCallback() }) } , Isotope.prototype._filter = function(items) { var filter = this.options.filter; filter = filter || “*”; var matches = [] , hiddenMatched = [] , visibleUnmatched = [] , test = this._getFilterTest(filter); for (var i = 0, len = items.length; i < len; i++) { var item = items[i]; if (item.isIgnored) continue; var isMatched = test(item); isMatched && matches.push(item), isMatched && item.isHidden ? hiddenMatched.push(item) : !isMatched && !item.isHidden && visibleUnmatched.push(item) } return { matches: matches, needReveal: hiddenMatched, needHide: visibleUnmatched } } , Isotope.prototype._getFilterTest = function(filter) { return jQuery && this.options.isJQueryFiltering ? function(item) { return jQuery(item.element).is(filter) } : typeof filter == “function” ? function(item) { return filter(item.element) } : function(item) { return matchesSelector(item.element, filter) } } , Isotope.prototype.updateSortData = function(elems) { var items; elems ? (elems = utils.makeArray(elems), items = this.getItems(elems)) : items = this.items, this._getSorters(), this._updateItemsSortData(items) } , Isotope.prototype._getSorters = function() { var getSortData = this.options.getSortData; for (var key in getSortData) { var sorter = getSortData[key]; this._sorters[key] = mungeSorter(sorter) } } , Isotope.prototype._updateItemsSortData = function(items) { var len = items && items.length; for (var i = 0; len && i < len; i++) { var item = items[i]; item.updateSortData() } } ; var mungeSorter = function() { function mungeSorter(sorter) { if (typeof sorter != “string”) return sorter; var args = trim(sorter).split(” “) , query = args[0] , attrMatch = query.match(/^[(.+)]$/) , attr = attrMatch && attrMatch[1] , getValue = getValueGetter(attr, query) , parser = Isotope.sortDataParsers[args[1]]; return sorter = parser ? function(elem) { return elem && parser(getValue(elem)) } : function(elem) { return elem && getValue(elem) } , sorter } function getValueGetter(attr, query) { var getValue; return attr ? getValue = function(elem) { return elem.getAttribute(attr) } : getValue = function(elem) { var child = elem.querySelector(query); return child && getText(child) } , getValue } return mungeSorter }(); Isotope.sortDataParsers = { parseInt: function(val) { return parseInt(val, 10) }, parseFloat: function(val) { return parseFloat(val) } }, Isotope.prototype._sort = function() { var sortByOpt = this.options.sortBy; if (!sortByOpt) return; var sortBys = [].concat.apply(sortByOpt, this.sortHistory) , itemSorter = getItemSorter(sortBys, this.options.sortAscending); this.filteredItems.sort(itemSorter), sortByOpt != this.sortHistory[0] && this.sortHistory.unshift(sortByOpt) } , Isotope.prototype._mode = function() { var layoutMode = this.options.layoutMode , mode = this.modes[layoutMode]; if (!mode) throw new Error(“No layout mode: ” + layoutMode); return mode.options = this.options[layoutMode], mode } , Isotope.prototype._resetLayout = function() { Outlayer.prototype._resetLayout.call(this), this._mode()._resetLayout() } , Isotope.prototype._getItemLayoutPosition = function(item) { return this._mode()._getItemLayoutPosition(item) } , Isotope.prototype._manageStamp = function(stamp) { this._mode()._manageStamp(stamp) } , Isotope.prototype._getContainerSize = function() { return this._mode()._getContainerSize() } , Isotope.prototype.needsResizeLayout = function() { return this._mode().needsResizeLayout() } , Isotope.prototype.appended = function(elems) { var items = this.addItems(elems); if (!items.length) return; var filteredItems = this._filterRevealAdded(items); this.filteredItems = this.filteredItems.concat(filteredItems) } , Isotope.prototype.prepended = function(elems) { var items = this._itemize(elems); if (!items.length) return; this._resetLayout(), this._manageStamps(); var filteredItems = this._filterRevealAdded(items); this.layoutItems(this.filteredItems), this.filteredItems = filteredItems.concat(this.filteredItems), this.items = items.concat(this.items) } , Isotope.prototype._filterRevealAdded = function(items) { var filtered = this._filter(items); return this.hide(filtered.needHide), this.reveal(filtered.matches), this.layoutItems(filtered.matches, !0), filtered.matches } , Isotope.prototype.insert = function(elems) { var items = this.addItems(elems); if (!items.length) return; var i, item, len = items.length; for (i = 0; i < len; i++) item = items[i], this.element.appendChild(item.element); var filteredInsertItems = this._filter(items).matches; for (i = 0; i < len; i++) items[i].isLayoutInstant = !0; this.arrange(); for (i = 0; i < len; i++) delete items[i].isLayoutInstant; this.reveal(filteredInsertItems) } ; var _remove = Isotope.prototype.remove; return Isotope.prototype.remove = function(elems) { elems = utils.makeArray(elems); var removeItems = this.getItems(elems); _remove.call(this, elems); var len = removeItems && removeItems.length; if (!len) return; for (var i = 0; i < len; i++) { var item = removeItems[i]; utils.removeFrom(this.filteredItems, item) } } , Isotope.prototype.shuffle = function() { for (var i = 0, len = this.items.length; i < len; i++) { var item = this.items[i]; item.sortData.random = Math.random() } this.options.sortBy = “random”, this._sort(), this._layout() } , Isotope.prototype._noTransition = function(fn) { var transitionDuration = this.options.transitionDuration; this.options.transitionDuration = 0; var returnValue = fn.call(this); return this.options.transitionDuration = transitionDuration, returnValue } , Isotope.prototype.getFilteredItemElements = function() { var elems = []; for (var i = 0, len = this.filteredItems.length; i < len; i++) elems.push(this.filteredItems[i].element); return elems } , Isotope }), function(window, factory) { typeof define == “function” && define.amd ? define(“packery/js/rect”, factory) : typeof module == “object” && module.exports ? module.exports = factory() : (window.Packery = window.Packery || {}, window.Packery.Rect = factory()) }(window, function factory() { function Rect(props) { for (var prop in Rect.defaults) this[prop] = Rect.defaults[prop]; for (prop in props) this[prop] = props[prop] } Rect.defaults = { x: 0, y: 0, width: 0, height: 0 }; var proto = Rect.prototype; return proto.contains = function(rect) { var otherWidth = rect.width || 0 , otherHeight = rect.height || 0; return this.x <= rect.x && this.y <= rect.y && this.x + this.width >= rect.x + otherWidth && this.y + this.height >= rect.y + otherHeight } , proto.overlaps = function(rect) { var thisRight = this.x + this.width , thisBottom = this.y + this.height , rectRight = rect.x + rect.width , rectBottom = rect.y + rect.height; return this.x < rectRight && thisRight > rect.x && this.y < rectBottom && thisBottom > rect.y } , proto.getMaximalFreeRects = function(rect) { if (!this.overlaps(rect)) return !1; var freeRects = [], freeRect, thisRight = this.x + this.width, thisBottom = this.y + this.height, rectRight = rect.x + rect.width, rectBottom = rect.y + rect.height; return this.y < rect.y && (freeRect = new Rect({ x: this.x, y: this.y, width: this.width, height: rect.y – this.y }), freeRects.push(freeRect)), thisRight > rectRight && (freeRect = new Rect({ x: rectRight, y: this.y, width: thisRight – rectRight, height: this.height }), freeRects.push(freeRect)), thisBottom > rectBottom && (freeRect = new Rect({ x: this.x, y: rectBottom, width: this.width, height: thisBottom – rectBottom }), freeRects.push(freeRect)), this.x < rect.x && (freeRect = new Rect({ x: this.x, y: this.y, width: rect.x – this.x, height: this.height }), freeRects.push(freeRect)), freeRects } , proto.canFit = function(rect) { return this.width >= rect.width && this.height >= rect.height } , Rect }), function(window, factory) { if (typeof define == “function” && define.amd) define(“packery/js/packer”, [“./rect”], factory); else if (typeof module == “object” && module.exports) module.exports = factory(require(“./rect”)); else { var Packery = window.Packery = window.Packery || {}; Packery.Packer = factory(Packery.Rect) } }(window, function factory(Rect) { function Packer(width, height, sortDirection) { this.width = width || 0, this.height = height || 0, this.sortDirection = sortDirection || “downwardLeftToRight”, this.reset() } var proto = Packer.prototype; proto.reset = function() { this.spaces = []; var initialSpace = new Rect({ x: 0, y: 0, width: this.width, height: this.height }); this.spaces.push(initialSpace), this.sorter = sorters[this.sortDirection] || sorters.downwardLeftToRight } , proto.pack = function(rect) { for (var i = 0; i < this.spaces.length; i++) { var space = this.spaces[i]; if (space.canFit(rect)) { this.placeInSpace(rect, space); break } } } , proto.columnPack = function(rect) { for (var i = 0; i < this.spaces.length; i++) { var space = this.spaces[i] , canFitInSpaceColumn = space.x <= rect.x && space.x + space.width >= rect.x + rect.width && space.height >= rect.height – .01; if (canFitInSpaceColumn) { rect.y = space.y, this.placed(rect); break } } } , proto.rowPack = function(rect) { for (var i = 0; i < this.spaces.length; i++) { var space = this.spaces[i] , canFitInSpaceRow = space.y <= rect.y && space.y + space.height >= rect.y + rect.height && space.width >= rect.width – .01; if (canFitInSpaceRow) { rect.x = space.x, this.placed(rect); break } } } , proto.placeInSpace = function(rect, space) { rect.x = space.x, rect.y = space.y, this.placed(rect) } , proto.placed = function(rect) { var revisedSpaces = []; for (var i = 0; i < this.spaces.length; i++) { var space = this.spaces[i] , newSpaces = space.getMaximalFreeRects(rect); newSpaces ? revisedSpaces.push.apply(revisedSpaces, newSpaces) : revisedSpaces.push(space) } this.spaces = revisedSpaces, this.mergeSortSpaces() } , proto.mergeSortSpaces = function() { Packer.mergeRects(this.spaces), this.spaces.sort(this.sorter) } , proto.addSpace = function(rect) { this.spaces.push(rect), this.mergeSortSpaces() } , Packer.mergeRects = function(rects) { var i = 0 , rect = rects[i]; e: while (rect) { var j = 0 , compareRect = rects[i + j]; while (compareRect) { if (compareRect == rect) j++; else { if (compareRect.contains(rect)) { rects.splice(i, 1), rect = rects[i]; continue e } rect.contains(compareRect) ? rects.splice(i + j, 1) : j++ } compareRect = rects[i + j] } i++, rect = rects[i] } return rects } ; var sorters = { downwardLeftToRight: function(a, b) { return a.y – b.y || a.x – b.x }, rightwardTopToBottom: function(a, b) { return a.x – b.x || a.y – b.y } }; return Packer }), function(window, factory) { typeof define == “function” && define.amd ? define(“packery/js/item”, [“outlayer/outlayer”, “./rect”], factory) : typeof module == “object” && module.exports ? module.exports = factory(require(“outlayer”), require(“./rect”)) : window.Packery.Item = factory(window.Outlayer, window.Packery.Rect) }(window, function factory(Outlayer, Rect) { var docElemStyle = document.documentElement.style , transformProperty = typeof docElemStyle.transform == “string” ? “transform” : “WebkitTransform” , Item = function PackeryItem() { Outlayer.Item.apply(this, arguments) } , proto = Item.prototype = Object.create(Outlayer.Item.prototype) , create = proto._create; proto._create = function() { __create.call(this), this.rect = new Rect } ; var _moveTo = proto.moveTo; return proto.moveTo = function(x, y) { var dx = Math.abs(this.position.x – x) , dy = Math.abs(this.position.y – y) , canHackGoTo = this.layout.dragItemCount && !this.isPlacing && !this.isTransitioning && dx < 1 && dy < 1; if (canHackGoTo) { this.goTo(x, y); return } _moveTo.apply(this, arguments) } , proto.enablePlacing = function() { this.removeTransitionStyles(), this.isTransitioning && transformProperty && (this.element.style[transformProperty] = “none”), this.isTransitioning = !1, this.getSize(), this.layout._setRectSize(this.element, this.rect), this.isPlacing = !0 } , proto.disablePlacing = function() { this.isPlacing = !1 } , proto.removeElem = function() { this.element.parentNode.removeChild(this.element), this.layout.packer.addSpace(this.rect), this.emitEvent(“remove”, [this]) } , proto.showDropPlaceholder = function() { var dropPlaceholder = this.dropPlaceholder; dropPlaceholder || (dropPlaceholder = this.dropPlaceholder = document.createElement(“div”), dropPlaceholder.className = “packery-drop-placeholder”, dropPlaceholder.style.position = “absolute”), dropPlaceholder.style.width = this.size.width + “px”, dropPlaceholder.style.height = this.size.height + “px”, this.positionDropPlaceholder(), this.layout.element.appendChild(dropPlaceholder) } , proto.positionDropPlaceholder = function() { this.dropPlaceholder.style[transformProperty] = “translate(” + this.rect.x + “px, ” + this.rect.y + “px)” } , proto.hideDropPlaceholder = function() { this.layout.element.removeChild(this.dropPlaceholder) } , Item }), function(window, factory) { typeof define == “function” && define.amd ? define(“packery/js/packery”, [“get-size/get-size”, “outlayer/outlayer”, “./rect”, “./packer”, “./item”], factory) : typeof module == “object” && module.exports ? module.exports = factory(require(“get-size”), require(“outlayer”), require(“./rect”), require(“./packer”), require(“./item”)) : window.Packery = factory(window.getSize, window.Outlayer, window.Packery.Rect, window.Packery.Packer, window.Packery.Item) }(window, function factory(getSize, Outlayer, Rect, Packer, Item) { function verticalSorter(a, b) { return a.position.y – b.position.y || a.position.x – b.position.x } function horizontalSorter(a, b) { return a.position.x – b.position.x || a.position.y – b.position.y } function getDistance(a, b) { var dx = b.x – a.x , dy = b.y – a.y; return Math.sqrt(dx * dx + dy * dy) } Rect.prototype.canFit = function(rect) { return this.width >= rect.width – 1 && this.height >= rect.height – 1 } ; var Packery = Outlayer.create(“packery”); Packery.Item = Item; var proto = Packery.prototype; proto._create = function() { Outlayer.prototype._create.call(this), this.packer = new Packer, this.shiftPacker = new Packer, this.isEnabled = !0, this.dragItemCount = 0; var _this = this; this.handleDraggabilly = { dragStart: function() { _this.itemDragStart(this.element) }, dragMove: function() { _this.itemDragMove(this.element, this.position.x, this.position.y) }, dragEnd: function() { _this.itemDragEnd(this.element) } }, this.handleUIDraggable = { start: function handleUIDraggableStart(event, ui) { if (!ui) return; _this.itemDragStart(event.currentTarget) }, drag: function handleUIDraggableDrag(event, ui) { if (!ui) return; _this.itemDragMove(event.currentTarget, ui.position.left, ui.position.top) }, stop: function handleUIDraggableStop(event, ui) { if (!ui) return; _this.itemDragEnd(event.currentTarget) } } } , proto._resetLayout = function() { this.getSize(), this._getMeasurements(); var width, height, sortDirection; this._getOption(“horizontal”) ? (width = Infinity, height = this.size.innerHeight + this.gutter, sortDirection = “rightwardTopToBottom”) : (width = this.size.innerWidth + this.gutter, height = Infinity, sortDirection = “downwardLeftToRight”), this.packer.width = this.shiftPacker.width = width, this.packer.height = this.shiftPacker.height = height, this.packer.sortDirection = this.shiftPacker.sortDirection = sortDirection, this.packer.reset(), this.maxY = 0, this.maxX = 0 } , proto._getMeasurements = function() { this._getMeasurement(“columnWidth”, “width”), this._getMeasurement(“rowHeight”, “height”), this._getMeasurement(“gutter”, “width”) } , proto._getItemLayoutPosition = function(item) { this._setRectSize(item.element, item.rect); if (this.isShifting || this.dragItemCount > 0) { var packMethod = this._getPackMethod(); this.packerpackMethod } else this.packer.pack(item.rect); return this._setMaxXY(item.rect), item.rect } , proto.shiftLayout = function() { this.isShifting = !0, this.layout(), delete this.isShifting } , proto._getPackMethod = function() { return this._getOption(“horizontal”) ? “rowPack” : “columnPack” } , proto._setMaxXY = function(rect) { this.maxX = Math.max(rect.x + rect.width, this.maxX), this.maxY = Math.max(rect.y + rect.height, this.maxY) } , proto._setRectSize = function(elem, rect) { var size = getSize(elem) , w = size.outerWidth , h = size.outerHeight; if (w || h) w = this._applyGridGutter(w, this.columnWidth), h = this._applyGridGutter(h, this.rowHeight); rect.width = Math.min(w, this.packer.width), rect.height = Math.min(h, this.packer.height) } , proto._applyGridGutter = function(measurement, gridSize) { if (!gridSize) return measurement + this.gutter; gridSize += this.gutter; var remainder = measurement % gridSize , mathMethod = remainder && remainder < 1 ? “round” : “ceil”; return measurement = Math[mathMethod](measurement / gridSize) * gridSize, measurement } , proto._getContainerSize = function() { return this._getOption(“horizontal”) ? { width: this.maxX – this.gutter } : { height: this.maxY – this.gutter } } , proto._manageStamp = function(elem) { var item = this.getItem(elem), rect; if (item && item.isPlacing) rect = item.rect; else { var offset = this._getElementOffset(elem); rect = new Rect({ x: this._getOption(“originLeft”) ? offset.left : offset.right, y: this._getOption(“originTop”) ? offset.top : offset.bottom }) } this._setRectSize(elem, rect), this.packer.placed(rect), this._setMaxXY(rect) } , proto.sortItemsByPosition = function() { var sorter = this._getOption(“horizontal”) ? horizontalSorter : verticalSorter; this.items.sort(sorter) } , proto.fit = function(elem, x, y) { var item = this.getItem(elem); if (!item) return; this.stamp(item.element), item.enablePlacing(), this.updateShiftTargets(item), x = x === undefined ? item.rect.x : x, y = y === undefined ? item.rect.y : y, this.shift(item, x, y), this._bindFitEvents(item), item.moveTo(item.rect.x, item.rect.y), this.shiftLayout(), this.unstamp(item.element), this.sortItemsByPosition(), item.disablePlacing() } , proto._bindFitEvents = function(item) { function onLayout() { ticks++; if (ticks != 2) return; _this.dispatchEvent(“fitComplete”, null, [item]) } var _this = this , ticks = 0; item.once(“layout”, onLayout), this.once(“layoutComplete”, onLayout) } , proto.resize = function() { if (!this.isResizeBound || !this.needsResizeLayout()) return; this.options.shiftPercentResize ? this.resizeShiftPercentLayout() : this.layout() } , proto.needsResizeLayout = function() { var size = getSize(this.element) , innerSize = this._getOption(“horizontal”) ? “innerHeight” : “innerWidth”; return size[innerSize] != this.size[innerSize] } , proto.resizeShiftPercentLayout = function() { var items = this._getItemsForLayout(this.items) , isHorizontal = this._getOption(“horizontal”) , coord = isHorizontal ? “y” : “x” , measure = isHorizontal ? “height” : “width” , segmentName = isHorizontal ? “rowHeight” : “columnWidth” , innerSize = isHorizontal ? “innerHeight” : “innerWidth” , previousSegment = this[segmentName]; previousSegment = previousSegment && previousSegment + this.gutter; if (previousSegment) { this._getMeasurements(); var currentSegment = this[segmentName] + this.gutter; items.forEach(function(item) { var seg = Math.round(item.rect[coord] / previousSegment); item.rect[coord] = seg * currentSegment }) } else { var currentSize = getSize(this.element)[innerSize] + this.gutter , previousSize = this.packer[measure]; items.forEach(function(item) { item.rect[coord] = item.rect[coord] / previousSize * currentSize }) } this.shiftLayout() } , proto.itemDragStart = function(elem) { if (!this.isEnabled) return; this.stamp(elem); var item = this.getItem(elem); if (!item) return; item.enablePlacing(), item.showDropPlaceholder(), this.dragItemCount++, this.updateShiftTargets(item) } , proto.updateShiftTargets = function(dropItem) { this.shiftPacker.reset(), this._getBoundingRect(); var isOriginLeft = this._getOption(“originLeft”) , isOriginTop = this._getOption(“originTop”); this.stamps.forEach(function(stamp) { var item = this.getItem(stamp); if (item && item.isPlacing) return; var offset = this._getElementOffset(stamp) , rect = new Rect({ x: isOriginLeft ? offset.left : offset.right, y: isOriginTop ? offset.top : offset.bottom }); this._setRectSize(stamp, rect), this.shiftPacker.placed(rect) }, this); var isHorizontal = this._getOption(“horizontal”) , segmentName = isHorizontal ? “rowHeight” : “columnWidth” , measure = isHorizontal ? “height” : “width”; this.shiftTargetKeys = [], this.shiftTargets = []; var boundsSize, segment = this[segmentName]; segment = segment && segment + this.gutter; if (segment) { var segmentSpan = Math.ceil(dropItem.rect[measure] / segment) , segs = Math.floor((this.shiftPacker[measure] + this.gutter) / segment); boundsSize = (segs – segmentSpan) * segment; for (var i = 0; i < segs; i++) this._addShiftTarget(i * segment, 0, boundsSize) } else boundsSize = this.shiftPacker[measure] + this.gutter – dropItem.rect[measure], this._addShiftTarget(0, 0, boundsSize); var items = this._getItemsForLayout(this.items) , packMethod = this._getPackMethod(); items.forEach(function(item) { var rect = item.rect; this._setRectSize(item.element, rect), this.shiftPackerpackMethod, this._addShiftTarget(rect.x, rect.y, boundsSize); var cornerX = isHorizontal ? rect.x + rect.width : rect.x , cornerY = isHorizontal ? rect.y : rect.y + rect.height; this._addShiftTarget(cornerX, cornerY, boundsSize); if (segment) { var segSpan = Math.round(rect[measure] / segment); for (var i = 1; i < segSpan; i++) { var segX = isHorizontal ? cornerX : rect.x + segment * i , segY = isHorizontal ? rect.y + segment * i : cornerY; this._addShiftTarget(segX, segY, boundsSize) } } }, this) } , proto._addShiftTarget = function(x, y, boundsSize) { var checkCoord = this._getOption(“horizontal”) ? y : x; if (checkCoord !== 0 && checkCoord > boundsSize) return; var key = x + “,” + y , hasKey = this.shiftTargetKeys.indexOf(key) != -1; if (hasKey) return; this.shiftTargetKeys.push(key), this.shiftTargets.push({ x: x, y: y }) } , proto.shift = function(item, x, y) { var shiftPosition, minDistance = Infinity, position = { x: x, y: y }; this.shiftTargets.forEach(function(target) { var distance = getDistance(target, position); distance < minDistance && (shiftPosition = target, minDistance = distance) }), item.rect.x = shiftPosition.x, item.rect.y = shiftPosition.y } ; var DRAG_THROTTLE_TIME = 120; proto.itemDragMove = function(elem, x, y) { function onDrag() { _this.shift(item, x, y), item.positionDropPlaceholder(), _this.layout() } var item = this.isEnabled && this.getItem(elem); if (!item) return; x -= this.size.paddingLeft, y -= this.size.paddingTop; var _this = this , now = new Date; this._itemDragTime && now – this._itemDragTime < DRAG_THROTTLE_TIME ? (clearTimeout(this.dragTimeout), this.dragTimeout = setTimeout(onDrag, DRAG_THROTTLE_TIME)) : (onDrag(), this._itemDragTime = now) } , proto.itemDragEnd = function(elem) { function onDragEndLayoutComplete() { completeCount++; if (completeCount != 2) return; item.element.classList.remove(“is-positioning-post-drag”), item.hideDropPlaceholder(), _this.dispatchEvent(“dragItemPositioned”, null, [item]) } var item = this.isEnabled && this.getItem(elem); if (!item) return; clearTimeout(this.dragTimeout), item.element.classList.add(“is-positioning-post-drag”); var completeCount = 0 , _this = this; item.once(“layout”, onDragEndLayoutComplete), this.once(“layoutComplete”, onDragEndLayoutComplete), item.moveTo(item.rect.x, item.rect.y), this.layout(), this.dragItemCount = Math.max(0, this.dragItemCount – 1), this.sortItemsByPosition(), item.disablePlacing(), this.unstamp(item.element) } , proto.bindDraggabillyEvents = function(draggie) { this._bindDraggabillyEvents(draggie, “on”) } , proto.unbindDraggabillyEvents = function(draggie) { this._bindDraggabillyEvents(draggie, “off”) } , proto._bindDraggabillyEvents = function(draggie, method) { var handlers = this.handleDraggabilly; draggie[method](“dragStart”, handlers.dragStart), draggie[method](“dragMove”, handlers.dragMove), draggie[method](“dragEnd”, handlers.dragEnd) } , proto.bindUIDraggableEvents = function($elems) { this._bindUIDraggableEvents($elems, “on”) } , proto.unbindUIDraggableEvents = function($elems) { this._bindUIDraggableEvents($elems, “off”) } , proto._bindUIDraggableEvents = function($elems, method) { var handlers = this.handleUIDraggable; $elems[method](“dragstart”, handlers.start)[method](“drag”, handlers.drag)[method](“dragstop”, handlers.stop) } ; var _destroy = proto.destroy; return proto.destroy = function() { _destroy.apply(this, arguments), this.isEnabled = !1 } , Packery.Rect = Rect, Packery.Packer = Packer, Packery }), function(window, factory) { typeof define == “function” && define.amd ? define([“isotope-layout/js/layout-mode”, “packery/js/packery”], factory) : typeof module == “object” && module.exports ? module.exports = factory(require(“isotope-layout/js/layout-mode”), require(“packery”)) : factory(window.Isotope.LayoutMode, window.Packery) }(window, function factor(LayoutMode, Packery) { var PackeryMode = LayoutMode.create(“packery”) , proto = PackeryMode.prototype , keepModeMethods = { _getElementOffset: !0, _getMeasurement: !0 }; for (var method in Packery.prototype) keepModeMethods[method] || (proto[method] = Packery.prototype[method]); var _resetLayout = proto._resetLayout; proto._resetLayout = function() { this.packer = this.packer || new Packery.Packer, this.shiftPacker = this.shiftPacker || new Packery.Packer, _resetLayout.apply(this, arguments) } ; var _getItemLayoutPosition = proto._getItemLayoutPosition; proto._getItemLayoutPosition = function(item) { return item.rect = item.rect || new Packery.Rect, _getItemLayoutPosition.call(this, item) } ; var _needsResizeLayout = proto.needsResizeLayout; proto.needsResizeLayout = function() { return this._getOption(“horizontal”) ? this.needsVerticalResizeLayout() : _needsResizeLayout.call(this) } ; var _getOption = proto._getOption; return proto._getOption = function(option) { return option == “horizontal” ? this.options.isHorizontal !== undefined ? this.options.isHorizontal : this.options.horizontal : _getOption.apply(this.isotope, arguments) } , PackeryMode }), function(window, factory) { typeof define == “function” && define.amd ? define([“isotope/js/layout-mode”], factory) : typeof exports == “object” ? module.exports = factory(require(“isotope-layout/js/layout-mode”)) : factory(window.Isotope.LayoutMode) }(window, function factory(LayoutMode) { “use strict”; var CellsByRow = LayoutMode.create(“cellsByRow”) , proto = CellsByRow.prototype; return proto._resetLayout = function() { this.itemIndex = 0, this.getColumnWidth(), this.getRowHeight(), this.cols = Math.floor(this.isotope.size.innerWidth / this.columnWidth), this.cols = Math.max(this.cols, 1) } , proto._getItemLayoutPosition = function(item) { item.getSize(); var col = this.itemIndex % this.cols , row = Math.floor(this.itemIndex / this.cols) , x = (col + .5) * this.columnWidth – item.size.outerWidth / 2 , y = (row + .5) * this.rowHeight – item.size.outerHeight / 2; return this.itemIndex++, { x: x, y: y } } , proto._getContainerSize = function() { return { height: Math.ceil(this.itemIndex / this.cols) * this.rowHeight } } , CellsByRow }), function(factory) { typeof define == “function” && define.amd ? define([“jquery”], factory) : factory(jQuery) }(function($, undefined) { “use strict”; $.infinitescroll = function infscr(options, callback, element) { this.element = $(element), this._create(options, callback) || (this.failed = !0) } , $.infinitescroll.defaults = { loading: { finished: undefined, finishedMsg: “Congratulations, you’ve reached the end of the internet.“,
img: “data:image/gif;base64,R0lGODlh3AATAPQeAPDy+MnQ6LW/4N3h8MzT6rjC4sTM5r/I5NHX7N7j8c7U6tvg8OLl8uXo9Ojr9b3G5MfP6Ovu9tPZ7PT1+vX2+tbb7vf4+8/W69jd7rC73vn5/O/x+K243ai02////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQECgD/ACwAAAAA3AATAAAF/6AnjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEj0BAScpHLJbDqf0Kh0Sq1ar9isdioItAKGw+MAKYMFhbF63CW438f0mg1R2O8EuXj/aOPtaHx7fn96goR4hmuId4qDdX95c4+RBIGCB4yAjpmQhZN0YGYGXitdZBIVGAsLoq4BBKQDswm1CQRkcG6ytrYKubq8vbfAcMK9v7q7EMO1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQkCLBwHCgsMDQ4RDAYIqfYSFxDxEfz88/X38Onr16+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdFf9chIeBg7oA7gjaWUWTVQAGE3LqBDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKzggYBBB5y1acFNZmEvXAoN2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCbYMNFCzwLEqLgE4NsDWs/tvqdezZf13Hvk2A9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebd3A8vjf5QWfH6Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrA1ANoCDGrgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBFAJNv1DVV01MAdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJghQSwT40PgfAl4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA40AqVCIhG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAUKABwALAcABADOAAsAAAX/IPd0D2dyRCoUp/k8gpHOKtseR9yiSmGbuBykler9XLAhkbDavXTL5k2oqFqNOxzUZPU5YYZd1XsD72rZpBjbeh52mSNnMSC8lwblKZGwi+0QfIJ8CncnCoCDgoVnBHmKfByGJimPkIwtiAeBkH6ZHJaKmCeVnKKTHIihg5KNq4uoqmEtcRUtEREMBggtEr4QDrjCuRC8h7/BwxENeicSF8DKy82pyNLMOxzWygzFmdvD2L3P0dze4+Xh1Arkyepi7dfFvvTtLQkZBC0T/FX3CRgCMOBHsJ+EHYQY7OinAGECgQsB+Lu3AOK+CewcWjwxQeJBihtNGHSoQOE+iQ3//4XkwBBhRZMcUS6YSXOAwIL8PGqEaSJCiYt9SNoCmnJPAgUVLChdaoFBURN8MAzl2PQphwQLfDFd6lTowglHve6rKpbjhK7/pG5VinZP1qkiz1rl4+tr2LRwWU64cFEihwEtZgbgR1UiHaMVvxpOSwBA37kzGz9e8G+B5MIEKLutOGEsAH2ATQwYfTmuX8aETWdGPZmiZcccNSzeTCA1Sw0bdiitC7LBWgu8jQr8HRzqgpK6gX88QbrB14z/kF+ELpwB8eVQj/JkqdylAudji/+ts3039vEEfK8Vz2dlvxZKG0CmbkKDBvllRd6fCzDvBLKBDSCeffhRJEFebFk1k/Mv9jVIoIJZSeBggwUaNeB+Qk34IE0cXlihcfRxkOAJFFhwGmKlmWDiakZhUJtnLBpnWWcnKaAZcxI0piFGGLBm1mc90kajSCveeBVWKeYEoU2wqeaQi0PetoE+rr14EpVC7oAbAUHqhYExbn2XHHsVqbcVew9tx8+XJKk5AZsqqdlddGpqAKdbAYBn1pcczmSTdWvdmZ17c1b3FZ99vnTdCRFM8OEcAhLwm1NdXnWcBBSMRWmfkWZqVlsmLIiAp/o1gGV2vpS4lalGYsUOqXrddcKCmK61aZ8SjEpUpVFVoCpTj4r661Km7kBHjrDyc1RAIQAAIfkEBQoAGwAsBwAEAM4ACwAABf/gtmUCd4goQQgFKj6PYKi0yrrbc8i4ohQt12EHcal+MNSQiCP8gigdz7iCioaCIvUmZLp8QBzW0EN2vSlCuDtFKaq4RyHzQLEKZNdiQDhRDVooCwkbfm59EAmKi4SGIm+AjIsKjhsqB4mSjT2IOIOUnICeCaB/mZKFNTSRmqVpmJqklSqskq6PfYYCDwYHDC4REQwGCBLGxxIQDsHMwhAIX8bKzcENgSLGF9PU1j3Sy9zX2NrgzQziChLk1BHWxcjf7N046tvN82715czn9Pryz6Ilc4ACj4EBOCZM8KEnAYYADBRKnACAYUMFv1wotIhCEcaJCisqwJFgAUSQGyX/kCSVUUTIdKMwJlyo0oXHlhskwrTJciZHEXsgaqS4s6PJiCAr1uzYU8kBBSgnWFqpoMJMUjGtDmUwkmfVmVypakWhEKvXsS4nhLW5wNjVroJIoc05wSzTr0PtiigpYe4EC2vj4iWrFu5euWIMRBhacaVJhYQBEFjA9jHjyQ0xEABwGceGAZYjY0YBOrRLCxUp29QM+bRkx5s7ZyYgVbTqwwti2ybJ+vLtDYpycyZbYOlptxdx0kV+V7lC5iJAyyRrwYKxAdiz82ng0/jnAdMJFz0cPi104Ec1Vj9/M6F173vKL/feXv156dw11tlqeMMnv4V5Ap53GmjQQH97nFfg+IFiucfgRX5Z8KAgbUlQ4IULIlghhhdOSB6AgX0IVn8eReghen3NRIBsRgnH4l4LuEidZBjwRpt6NM5WGwoW0KSjCwX6yJSMab2GwwAPDXfaBCtWpluRTQqC5JM5oUZAjUNS+VeOLWpJEQ7VYQANW0INJSZVDFSnZphjSikfmzE5N4EEbQI1QJmnWXCmHulRp2edwDXF43txukenJwvI9xyg9Q26Z3MzGUcBYFEChZh6DVTq34AU8Iflh51Sd+CnKFYQ6mmZkhqfBKfSxZWqA9DZanWjxmhrWwi0qtCrt/43K6WqVjjpmhIqgEGvculaGKklKstAACEAACH5BAUKABwALAcABADOAAsAAAX/ICdyQmaMYyAUqPgIBiHPxNpy79kqRXH8wAPsRmDdXpAWgWdEIYm2llCHqjVHU+jjJkwqBTecwItShMXkEfNWSh8e1NGAcLgpDGlRgk7EJ/6Ae3VKfoF/fDuFhohVeDeCfXkcCQqDVQcQhn+VNDOYmpSWaoqBlUSfmowjEA+iEAEGDRGztAwGCDcXEA60tXEiCrq8vREMEBLIyRLCxMWSHMzExnbRvQ2Sy7vN0zvVtNfU2tLY3rPgLdnDvca4VQS/Cpk3ABwSLQkYAQwT/P309vcI7OvXr94jBQMJ/nskkGA/BQBRLNDncAIAiDcG6LsxAWOLiQzmeURBKWSLCQbv/1F0eDGinJUKR47YY1IEgQASKk7Yc7ACRwZm7mHweRJoz59BJUogisKCUaFMR0x4SlJBVBFTk8pZivTR0K73rN5wqlXEAq5Fy3IYgHbEzQ0nLy4QSoCjXLoom96VOJEeCosK5n4kkFfqXjl94wa+l1gvAcGICbewAOAxY8l/Ky/QhAGz4cUkGxu2HNozhwMGBnCUqUdBg9UuW9eUynqSwLHIBujePef1ZGQZXcM+OFuEBeBhi3OYgLyqcuaxbT9vLkf4SeqyWxSQpKGB2gQpm1KdWbu72rPRzR9Ne2Nu9Kzr/1Jqj0yD/fvqP4aXOt5sW/5qsXXVcv1Nsp8IBUAmgswGF3llGgeU1YVXXKTN1FlhWFXW3gIE+DVChApysACHHo7Q4A35lLichh+ROBmLKAzgYmYEYDAhCgxKGOOMn4WR4kkDaoBBOxJtdNKQxFmg5JIWIBnQc07GaORfUY4AEkdV6jHlCEISSZ5yTXpp1pbGZbkWmcuZmQCaE6iJ0FhjMaDjTMsgZaNEHFRAQVp3bqXnZED1qYcECOz5V6BhSWCoVJQIKuKQi2KFKEkEFAqoAo7uYSmO3jk61wUUMKmknJ4SGimBmAa0qVQBhAAAIfkEBQoAGwAsBwAEAM4ACwAABf/gJm5FmRlEqhJC+bywgK5pO4rHI0D3pii22+Mg6/0Ej96weCMAk7cDkXf7lZTTnrMl7eaYoy10JN0ZFdco0XAuvKI6qkgVFJXYNwjkIBcNBgR8TQoGfRsJCRuCYYQQiI+ICosiCoGOkIiKfSl8mJkHZ4U9kZMbKaI3pKGXmJKrngmug4WwkhA0lrCBWgYFCCMQFwoQDRHGxwwGCBLMzRLEx8iGzMMO0cYNeCMKzBDW19lnF9DXDIY/48Xg093f0Q3s1dcR8OLe8+Y91OTv5wrj7o7B+7VNQqABIoRVCMBggsOHE36kSoCBIcSH3EbFangxogJYFi8CkJhqQciLJEf/LDDJEeJIBT0GsOwYUYJGBS0fjpQAMidGmyVP6sx4Y6VQhzs9VUwkwqaCCh0tmKoFtSMDmBOf9phg4SrVrROuasRQAaxXpVUhdsU6IsECZlvX3kwLUWzRt0BHOLTbNlbZG3vZinArge5Dvn7wbqtQkSYAAgtKmnSsYKVKo2AfW048uaPmG386i4Q8EQMBAIAnfB7xBxBqvapJ9zX9WgRS2YMpnvYMGdPK3aMjt/3dUcNI4blpj7iwkMFWDXDvSmgAlijrt9RTR78+PS6z1uAJZIe93Q8g5zcsWCi/4Y+C8bah5zUv3vv89uft30QP23punGCx5954oBBwnwYaNCDY/wYrsYeggnM9B2Fpf8GG2CEUVWhbWAtGouEGDy7Y4IEJVrbSiXghqGKIo7z1IVcXIkKWWR361QOLWWnIhwERpLaaCCee5iMBGJQmJGyPFTnbkfHVZGRtIGrg5HALEJAZbu39BuUEUmq1JJQIPtZilY5hGeSWsSk52G9XqsmgljdIcABytq13HyIM6RcUA+r1qZ4EBF3WHWB29tBgAzRhEGhig8KmqKFv8SeCeo+mgsF7YFXa1qWSbkDpom/mqR1PmHCqJ3fwNRVXjC7S6CZhFVCQ2lWvZiirhQq42SACt25IK2hv8TprriUV1usGgeka7LFcNmCldMLi6qZMgFLgpw16Cipb7bC1knXsBiEAACH5BAUKABsALAcABADOAAsAAAX/4FZsJPkUmUGsLCEUTywXglFuSg7fW1xAvNWLF6sFFcPb42C8EZCj24EJdCp2yoegWsolS0Uu6fmamg8n8YYcLU2bXSiRaXMGvqV6/KAeJAh8VgZqCX+BexCFioWAYgqNi4qAR4ORhRuHY408jAeUhAmYYiuVlpiflqGZa5CWkzc5fKmbbhIpsAoQDRG8vQwQCBLCwxK6vb5qwhfGxxENahvCEA7NzskSy7vNzzzK09W/PNHF1NvX2dXcN8K55cfh69Luveol3vO8zwi4Yhj+AQwmCBw4IYclDAAJDlQggVOChAoLKkgFkSCAHDwWLKhIEOONARsDKryogFPIiAUb/95gJNIiw4wnI778GFPhzBKFOAq8qLJEhQpiNArjMcHCmlTCUDIouTKBhApELSxFWiGiVKY4E2CAekPgUphDu0742nRrVLJZnyrFSqKQ2ohoSYAMW6IoDpNJ4bLdILTnAj8KUF7UeENjAKuDyxIgOuGiOI0EBBMgLNew5AUrDTMGsFixwBIaNCQuAXJB57qNJ2OWm2Aj4skwCQCIyNkhhtMkdsIuodE0AN4LJDRgfLPtn5YDLdBlraAByuUbBgxQwICxMOnYpVOPej074OFdlfc0TqC62OIbcppHjV4o+LrieWhfT8JC/I/T6W8oCl29vQ0XjLdBaA3s1RcPBO7lFvpX8BVoG4O5jTXRQRDuJ6FDTzEWF1/BCZhgbyAKE9qICYLloQYOFtahVRsWYlZ4KQJHlwHS/IYaZ6sZd9tmu5HQm2xi1UaTbzxYwJk/wBF5g5EEYOBZeEfGZmNdFyFZmZIR4jikbLThlh5kUUVJGmRT7sekkziRWUIACABk3T4qCsedgO4xhgGcY7q5pHJ4klBBTQRJ0CeHcoYHHUh6wgfdn9uJdSdMiebGJ0zUPTcoS286FCkrZxnYoYYKWLkBowhQoBeaOlZAgVhLidrXqg2GiqpQpZ4apwSwRtjqrB3muoF9BboaXKmshlqWqsWiGt2wphJkQbAU5hoCACH5BAUKABsALAcABADOAAsAAAX/oGFw2WZuT5oZROsSQnGaKjRvilI893MItlNOJ5v5gDcFrHhKIWcEYu/xFEqNv6B1N62aclysF7fsZYe5aOx2yL5aAUGSaT1oTYMBwQ5VGCAJgYIJCnx1gIOBhXdwiIl7d0p2iYGQUAQBjoOFSQR/lIQHnZ+Ue6OagqYzSqSJi5eTpTxGcjcSChANEbu8DBAIEsHBChe5vL13G7fFuscRDcnKuM3H0La3EA7Oz8kKEsXazr7Cw9/Gztar5uHHvte47MjktznZ2w0G1+D3BgirAqJmJMAQgMGEgwgn5Ei0gKDBhBMALGRYEOJBb5QcWlQo4cbAihZz3GgIMqFEBSM1/4ZEOWPAgpIIJXYU+PIhRG8ja1qU6VHlzZknJNQ6UanCjQkWCIGSUGEjAwVLjc44+DTqUQtPPS5gejUrTa5TJ3g9sWCr1BNUWZI161StiQUDmLYdGfesibQ3XMq1OPYthrwuA2yU2LBs2cBHIypYQPPlYAKFD5cVvNPtW8eVGbdcQADATsiNO4cFAPkvHpedPzc8kUcPgNGgZ5RNDZG05reoE9s2vSEP79MEGiQGy1qP8LA4ZcdtsJE48ONoLTBtTV0B9LsTnPceoIDBDQvS7W7vfjVY3q3eZ4A339J4eaAmKqU/sV58HvJh2RcnIBsDUw0ABqhBA5aV5V9XUFGiHfVeAiWwoFgJJrIXRH1tEMiDFV4oHoAEGlaWhgIGSGBO2nFomYY3mKjVglidaNYJGJDkWW2xxTfbjCbVaOGNqoX2GloR8ZeTaECS9pthRGJH2g0b3Agbk6hNANtteHD2GJUucfajCQBy5OOTQ25ZgUPvaVVQmbKh9510/qQpwXx3SQdfk8tZJOd5b6JJFplT3ZnmmX3qd5l1eg5q00HrtUkUn0AKaiGjClSAgKLYZcgWXwocGRcCFGCKwSB6ceqphwmYRUFYT/1WKlOdUpipmxW0mlCqHjYkAaeoZlqrqZ4qd+upQKaapn/AmgAegZ8KUtYtFAQQAgAh+QQFCgAbACwHAAQAzgALAAAF/+C2PUcmiCiZGUTrEkKBis8jQEquKwU5HyXIbEPgyX7BYa5wTNmEMwWsSXsqFbEh8DYs9mrgGjdK6GkPY5GOeU6ryz7UFopSQEzygOGhJBjoIgMDBAcBM0V/CYqLCQqFOwobiYyKjn2TlI6GKC2YjJZknouaZAcQlJUHl6eooJwKooobqoewrJSEmyKdt59NhRKFMxLEEA4RyMkMEAjDEhfGycqAG8TQx9IRDRDE3d3R2ctD1RLg0ttKEnbY5wZD3+zJ6M7X2RHi9Oby7u/r9g38UFjTh2xZJBEBMDAboogAgwkQI07IMUORwocSJwCgWDFBAIwZOaJIsOBjRogKJP8wTODw5ESVHVtm3AhzpEeQElOuNDlTZ0ycEUWKWFASqEahGwYUPbnxoAgEdlYSqDBkgoUNClAlIHbSAoOsqCRQnQHxq1axVb06FWFxLIqyaze0Tft1JVqyE+pWXMD1pF6bYl3+HTqAWNW8cRUFzmih0ZAAB2oGKukSAAGGRHWJgLiR6AylBLpuHKKUMlMCngMpDSAa9QIUggZVVvDaJobLeC3XZpvgNgCmtPcuwP3WgmXSq4do0DC6o2/guzcseECtUoO0hmcsGKDgOt7ssBd07wqesAIGZC1YIBa7PQHvb1+SFo+++HrJSQfB33xfav3i5eX3Hnb4CTJgegEq8tH/YQEOcIJzbm2G2EoYRLgBXFpVmFYDcREV4HIcnmUhiGBRouEMJGJGzHIspqgdXxK0yCKHRNXoIX4uorCdTyjkyNtdPWrA4Up82EbAbzMRxxZRR54WXVLDIRmRcag5d2R6ugl3ZXzNhTecchpMhIGVAKAYpgJjjsSklBEd99maZoo535ZvdamjBEpusJyctg3h4X8XqodBMx0tiNeg/oGJaKGABpogS40KSqiaEgBqlQWLUtqoVQnytekEjzo0hHqhRorppOZt2p923M2AAV+oBtpAnnPNoB6HaU6mAAIU+IXmi3j2mtFXuUoHKwXpzVrsjcgGOauKEjQrwq157hitGq2NoWmjh7z6Wmxb0m5w66+2VRAuXN/yFUAIACH5BAUKABsALAcABADOAAsAAAX/4CZuRiaM45MZqBgIRbs9AqTcuFLE7VHLOh7KB5ERdjJaEaU4ClO/lgKWjKKcMiJQ8KgumcieVdQMD8cbBeuAkkC6LYLhOxoQ2PF5Ys9PKPBMen17f0CCg4VSh32JV4t8jSNqEIOEgJKPlkYBlJWRInKdiJdkmQlvKAsLBxdABA4RsbIMBggtEhcQsLKxDBC2TAS6vLENdJLDxMZAubu8vjIbzcQRtMzJz79S08oQEt/guNiyy7fcvMbh4OezdAvGrakLAQwyABsELQkY9BP+//ckyPDD4J9BfAMh1GsBoImMeQUN+lMgUJ9CiRMa5msxoB9Gh/o8GmxYMZXIgxtR/yQ46S/gQAURR0pDwYDfywoyLPip5AdnCwsMFPBU4BPFhKBDi444quCmDKZOfwZ9KEGpCKgcN1jdALSpPqIYsabS+nSqvqplvYqQYAeDPgwKwjaMtiDl0oaqUAyo+3TuWwUAMPpVCfee0cEjVBGQq2ABx7oTWmQk4FglZMGN9fGVDMCuiH2AOVOu/PmyxM630gwM0CCn6q8LjVJ8GXvpa5Uwn95OTC/nNxkda1/dLSK475IjCD6dHbK1ZOa4hXP9DXs5chJ00UpVm5xo2qRpoxptwF2E4/IbJpB/SDz9+q9b1aNfQH08+p4a8uvX8B53fLP+ycAfemjsRUBgp1H20K+BghHgVgt1GXZXZpZ5lt4ECjxYR4ScUWiShEtZqBiIInRGWnERNnjiBglw+JyGnxUmGowsyiiZg189lNtPGACjV2+S9UjbU0JWF6SPvEk3QZEqsZYTk3UAaRSUnznJI5LmESCdBVSyaOWUWLK4I5gDUYVeV1T9l+FZClCAUVA09uSmRHBCKAECFEhW51ht6rnmWBXkaR+NjuHpJ40D3DmnQXt2F+ihZxlqVKOfQRACACH5BAUKABwALAcABADOAAsAAAX/ICdyUCkUo/g8mUG8MCGkKgspeC6j6XEIEBpBUeCNfECaglBcOVfJFK7YQwZHQ6JRZBUqTrSuVEuD3nI45pYjFuWKvjjSkCoRaBUMWxkwBGgJCXspQ36Bh4EEB0oKhoiBgyNLjo8Ki4QElIiWfJqHnISNEI+Ql5J9o6SgkqKkgqYihamPkW6oNBgSfiMMDQkGCBLCwxIQDhHIyQwQCGMKxsnKVyPCF9DREQ3MxMPX0cu4wt7J2uHWx9jlKd3o39MiuefYEcvNkuLt5O8c1ePI2tyELXGQwoGDAQf+iEC2xByDCRAjTlAgIUWCBRgCPJQ4AQBFXAs0coT40WLIjRxL/47AcHLkxIomRXL0CHPERZkpa4q4iVKiyp0tR/7kwHMkTUBBJR5dOCEBAVcKKtCAyOHpowXCpk7goABqBZdcvWploACpBKkpIJI1q5OD2rIWE0R1uTZu1LFwbWL9OlKuWb4c6+o9i3dEgw0RCGDUG9KlRw56gDY2qmCByZBaASi+TACA0TucAaTteCcy0ZuOK3N2vJlx58+LRQyY3Xm0ZsgjZg+oPQLi7dUcNXi0LOJw1pgNtB7XG6CBy+U75SYfPTSQAgZTNUDnQHt67wnbZyvwLgKiMN3oCZB3C76tdewpLFgIP2C88rbi4Y+QT3+8S5USMICZXWj1pkEDeUU3lOYGB3alSoEiMIjgX4WlgNF2EibIwQIXauWXSRg2SAOHIU5IIIMoZkhhWiJaiFVbKo6AQEgQXrTAazO1JhkBrBG3Y2Y6EsUhaGn95hprSN0oWpFE7rhkeaQBchGOEWnwEmc0uKWZj0LeuNV3W4Y2lZHFlQCSRjTIl8uZ+kG5HU/3sRlnTG2ytyadytnD3HrmuRcSn+0h1dycexIK1KCjYaCnjCCVqOFFJTZ5GkUUjESWaUIKU2lgCmAKKQIUjHapXRKE+t2og1VgankNYnohqKJ2CmKplso6GKz7WYCgqxeuyoF8u9IQAgA7”,
msg: null,
msgText: “Loading the next set of posts…“,
selector: null,
speed: “fast”,
start: undefined
},
state: {
isDuringAjax: !1,
isInvalidPage: !1,
isDestroyed: !1,
isDone: !1,
isPaused: !1,
isBeyondMaxPage: !1,
currPage: 1
},
debug: !1,
behavior: undefined,
binder: $(window),
nextSelector: “div.navigation a:first”,
navSelector: “div.navigation”,
contentSelector: null,
extraScrollPx: 150,
itemSelector: “div.post”,
animate: !1,
pathParse: undefined,
dataType: “html”,
appendCallback: !0,
bufferPx: 40,
errorCallback: function() {},
infid: 0,
pixelsFromNavToBottom: undefined,
path: undefined,
prefill: !1,
maxPage: undefined
},
$.infinitescroll.prototype = {
_binding: function infscr_binding(binding) {
var instance = this
, opts = instance.options;
opts.v = “2.0b2.120520”;
if (!!opts.behavior && this[“_binding
” + opts.behavior] !== undefined) {
this[“binding” + opts.behavior].call(this);
return
}
if (binding !== “bind” && binding !== “unbind”)
return this.debug(“Binding value ” + binding + ” not valid”), !1; binding === “unbind” ? this.options.binder.unbind(“smartscroll.infscr.” + instance.options.infid) : this.options.binder[binding](“smartscroll.infscr.” + instance.options.infid, function() { instance.scroll() }), this._debug(“Binding”, binding) }, _create: function infscr_create(options, callback) { var opts = $.extend(!0, {}, $.infinitescroll.defaults, options); this.options = opts; var $window = $(window) , instance = this; if (!instance._validate(options)) return !1; var path = $(opts.nextSelector).attr(“href”); if (!path) return this._debug(“Navigation selector not found”), !1; opts.path = opts.path || this._determinepath(path), opts.contentSelector = opts.contentSelector || this.element, opts.loading.selector = opts.loading.selector || opts.contentSelector, opts.loading.msg = opts.loading.msg || $(‘

‘ + opts.loading.msgText + ““), (new Image).src = opts.loading.img, opts.pixelsFromNavToBottom === undefined && (opts.pixelsFromNavToBottom = $(document).height() – $(opts.navSelector).offset().top, this._debug(“pixelsFromNavToBottom: ” + opts.pixelsFromNavToBottom)); var self = this; return opts.loading.start = opts.loading.start || function() { $(opts.navSelector).hide(), opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed, $.proxy(function() { this.beginAjax(opts) }, self)) } , opts.loading.finished = opts.loading.finished || function() { opts.state.isBeyondMaxPage || opts.loading.msg.fadeOut(opts.loading.speed) } , opts.callback = function(instance, data, url) { !!opts.behavior && instance[“_callback” + opts.behavior] !== undefined && instance[“callback” + opts.behavior].call($(opts.contentSelector)[0], data, url),
callback && callback.call($(opts.contentSelector)[0], data, opts, url),
opts.prefill && $window.bind(“resize.infinite-scroll”, instance.prefill) } , options.debug && Function.prototype.bind && (typeof console == “object” || typeof console == “function”) && typeof console.log == “object” && [“log”, “info”, “warn”, “error”, “assert”, “dir”, “clear”, “profile”, “profileEnd”].forEach(function(method) { console[method] = this.call(console[method], console) }, Function.prototype.bind), this._setup(), opts.prefill && this._prefill(), !0 }, _prefill: function infscr_prefill() { function needsPrefill() { return $(instance.options.contentSelector).height() <= $window.height() } var instance = this , $window = $(window); this._prefill = function() { needsPrefill() && instance.scroll(), $window.bind(“resize.infinite-scroll”, function() { needsPrefill() && ($window.unbind(“resize.infinite-scroll”), instance.scroll()) }) } , this._prefill() }, _debug: function infscr_debug() { if (!0 !== this.options.debug) return; typeof console != “undefined” && typeof console.log == “function” ? Array.prototype.slice.call(arguments).length === 1 && typeof Array.prototype.slice.call(arguments)[0] == “string” ? console.log(Array.prototype.slice.call(arguments).toString()) : console.log(Array.prototype.slice.call(arguments)) : !Function.prototype.bind && typeof console != “undefined” && typeof console.log == “object” && Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments)) }, _determinepath: function infscr_determinepath(path) { var opts = this.options; if (!opts.behavior || this[“_determinepath” + opts.behavior] === undefined) {
if (!opts.pathParse) {
if (path.match(/^(.?)\b2\b(.?$)/))
path = path.match(/^(.?)\b2\b(.?$)/).slice(1);
else if (path.match(/^(.?)2(.?$)/)) {
if (path.match(/^(.?page=)2(\/.|$)/))
return path = path.match(/^(.?page=)2(\/.|$)/).slice(1),
path;
path = path.match(/^(.?)2(.?$)/).slice(1)
} else {
if (path.match(/^(.?page=)1(\/.|$)/))
return path = path.match(/^(.?page=)1(\/.|$)/).slice(1),
path;
this.debug(“Sorry, we couldn’t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.”), opts.state.isInvalidPage = !0 } return this._debug(“determinePath”, path), path } return this._debug(“pathParse manual”), opts.pathParse(path, this.options.state.currPage + 1) } return this[“_determinepath” + opts.behavior].call(this, path)
},
error: function infscr_error(xhr) { var opts = this.options; if (!!opts.behavior && this[“_error” + opts.behavior] !== undefined) {
this[“error” + opts.behavior].call(this, xhr);
return
}
xhr !== “destroy” && xhr !== “end” && (xhr = “unknown”),
this.debug(“Error”, xhr), (xhr === “end” || opts.state.isBeyondMaxPage) && this._showdonemsg(), opts.state.isDone = !0, opts.state.currPage = 1, opts.state.isPaused = !1, opts.state.isBeyondMaxPage = !1, this._binding(“unbind”) }, _loadcallback: function infscr_loadcallback(box, data, url) { var opts = this.options, callback = this.options.callback, result = opts.state.isDone ? “done” : opts.appendCallback ? “append” : “no-append”, frag; if (!!opts.behavior && this[“_loadcallback” + opts.behavior] !== undefined) {
this[“loadcallback” + opts.behavior].call(this, box, data);
return
}
switch (result) {
case “done”:
return this.showdonemsg(), !1; case “no-append”: opts.dataType === “html” && (data = “” + data + “”, data = $(data).find(opts.itemSelector)); if (data.length === 0) return this._error(“end”); break; case “append”: var children = box.children(); if (children.length === 0) return this._error(“end”); frag = document.createDocumentFragment(); while (box[0].firstChild) frag.appendChild(box[0].firstChild); this._debug(“contentSelector”, $(opts.contentSelector)[0]), $(opts.contentSelector)[0].appendChild(frag), data = children.get() } opts.loading.finished.call($(opts.contentSelector)[0], opts); if (opts.animate) { var scrollTo = $(window).scrollTop() + $(opts.loading.msg).height() + opts.extraScrollPx + “px”; $(“html,body”).animate({ scrollTop: scrollTo }, 800, function() { opts.state.isDuringAjax = !1 }) } opts.animate || (opts.state.isDuringAjax = !1), callback(this, data, url), opts.prefill && this._prefill() }, _nearbottom: function infscr_nearbottom() { var opts = this.options , pixelsFromWindowBottomToBottom = 0 + $(document).height() – opts.binder.scrollTop() – $(window).height(); return !opts.behavior || this[“_nearbottom” + opts.behavior] === undefined ? (this.debug(“math:”, pixelsFromWindowBottomToBottom, opts.pixelsFromNavToBottom), pixelsFromWindowBottomToBottom – opts.bufferPx < opts.pixelsFromNavToBottom) : this[“_nearbottom” + opts.behavior].call(this)
},
pausing: function infscr_pausing(pause) { var opts = this.options; if (!opts.behavior || this[“_pausing” + opts.behavior] === undefined) {
pause !== “pause” && pause !== “resume” && pause !== null && this.debug(“Invalid argument. Toggling pause value instead”), pause = !pause || pause !== “pause” && pause !== “resume” ? “toggle” : pause; switch (pause) { case “pause”: opts.state.isPaused = !0; break; case “resume”: opts.state.isPaused = !1; break; case “toggle”: opts.state.isPaused = !opts.state.isPaused } return this._debug(“Paused”, opts.state.isPaused), !1 } this[“_pausing” + opts.behavior].call(this, pause);
return
},
setup: function infscr_setup() { var opts = this.options; if (!opts.behavior || this[“_setup” + opts.behavior] === undefined)
return this.binding(“bind”), !1; this[“_setup” + opts.behavior].call(this);
return
},
showdonemsg: function infscr_showdonemsg() { var opts = this.options; if (!!opts.behavior && this[“_showdonemsg” + opts.behavior] !== undefined) {
this[“showdonemsg” + opts.behavior].call(this);
return
}
opts.loading.msg.find(“img”).hide().parent().find(“div”).html(opts.loading.finishedMsg).animate({
opacity: 1
}, 2e3, function() {
$(this).parent().fadeOut(opts.loading.speed)
}),
opts.errorCallback.call($(opts.contentSelector)[0], “done”)
},
validate: function infscr_validate(opts) { for (var key in opts) if (key.indexOf && key.indexOf(“Selector”) > -1 && $(opts[key]).length === 0) return this._debug(“Your ” + key + ” found no elements.”), !1; return !0 }, bind: function infscr_bind() { this._binding(“bind”) }, destroy: function infscr_destroy() { return this.options.state.isDestroyed = !0, this.options.loading.finished(), this._error(“destroy”) }, pause: function infscr_pause() { this._pausing(“pause”) }, resume: function infscr_resume() { this._pausing(“resume”) }, beginAjax: function infscr_ajax(opts) { var instance = this, path = opts.path, box, desturl, method, condition; opts.state.currPage++; if (opts.maxPage !== undefined && opts.state.currPage > opts.maxPage) { opts.state.isBeyondMaxPage = !0, this.destroy(); return } box = $(opts.contentSelector).is(“table, tbody”) ? $(“”) : $(“

“), desturl = typeof path == “function” ? path(opts.state.currPage) : path.join(opts.state.currPage), instance._debug(“heading into ajax”, desturl), method = opts.dataType === “html” || opts.dataType === “json” ? opts.dataType : “html+callback”, opts.appendCallback && opts.dataType === “html” && (method += “+callback”); switch (method) { case “html+callback”: instance._debug(“Using HTML via .load() method”), box.load(desturl + ” ” + opts.itemSelector, undefined, function infscr_ajax_callback(responseText) { instance._loadcallback(box, responseText, desturl) }); break; case “html”: instance._debug(“Using ” + method.toUpperCase() + ” via $.ajax() method”), $.ajax({ url: desturl, dataType: opts.dataType, complete: function infscr_ajax_callback(jqXHR, textStatus) { condition = typeof jqXHR.isResolved != “undefined” ? jqXHR.isResolved() : textStatus === “success” || textStatus === “notmodified”, condition ? instance._loadcallback(box, jqXHR.responseText, desturl) : instance._error(“end”) } }); break; case “json”: instance._debug(“Using ” + method.toUpperCase() + ” via $.ajax() method”), $.ajax({ dataType: “json”, type: “GET”, url: desturl, success: function(data, textStatus, jqXHR) { condition = typeof jqXHR.isResolved != “undefined” ? jqXHR.isResolved() : textStatus === “success” || textStatus === “notmodified”; if (opts.appendCallback) if (opts.template !== undefined) { var theData = opts.template(data); box.append(theData), condition ? instance._loadcallback(box, theData) : instance._error(“end”) } else instance._debug(“template must be defined.”), instance._error(“end”); else condition ? instance._loadcallback(box, data, desturl) : instance._error(“end”) }, error: function() { instance._debug(“JSON ajax request failed.”), instance._error(“end”) } }) } }, retrieve: function infscr_retrieve(pageNum) { pageNum = pageNum || null; var instance = this , opts = instance.options; if (!!opts.behavior && this[“retrieve” + opts.behavior] !== undefined) {
this[“retrieve_” + opts.behavior].call(this, pageNum);
return
}
if (opts.state.isDestroyed)
return this.debug(“Instance is destroyed”), !1; opts.state.isDuringAjax = !0, opts.loading.start.call($(opts.contentSelector)[0], opts) }, scroll: function infscr_scroll() { var opts = this.options , state = opts.state; if (!!opts.behavior && this[“scroll” + opts.behavior] !== undefined) {
this[“scroll_” + opts.behavior].call(this);
return
}
if (state.isDuringAjax || state.isInvalidPage || state.isDone || state.isDestroyed || state.isPaused)
return;
if (!this.nearbottom()) return; this.retrieve() }, toggle: function infscr_toggle() { this._pausing() }, unbind: function infscr_unbind() { this._binding(“unbind”) }, update: function infscr_options(key) { $.isPlainObject(key) && (this.options = $.extend(!0, this.options, key)) } }, $.fn.infinitescroll = function infscr_init(options, callback) { var thisCall = typeof options; switch (thisCall) { case “string”: var args = Array.prototype.slice.call(arguments, 1); this.each(function() { var instance = $.data(this, “infinitescroll”); if (!instance) return !1; if (!$.isFunction(instance[options]) || options.charAt(0) === ““)
return !1;
instance[options].apply(instance, args)
});
break;
case “object”:
this.each(function() {
var instance = $.data(this, “infinitescroll”);
instance ? instance.update(options) : (instance = new $.infinitescroll(options,callback,this),
instance.failed || $.data(this, “infinitescroll”, instance))
})
}
return this
}
;
var event = $.event, scrollTimeout;
event.special.smartscroll = {
setup: function() {
$(this).bind(“scroll”, event.special.smartscroll.handler)
},
teardown: function() {
$(this).unbind(“scroll”, event.special.smartscroll.handler)
},
handler: function(event, execAsap) {
var context = this
, args = arguments;
event.type = “smartscroll”,
scrollTimeout && clearTimeout(scrollTimeout),
scrollTimeout = setTimeout(function() {
$(context).trigger(“smartscroll”, args)
}, execAsap === “execAsap” ? 0 : 100)
}
},
$.fn.smartscroll = function(fn) {
return fn ? this.bind(“smartscroll”, fn) : this.trigger(“smartscroll”, [“execAsap”])
}
}),
function() {
“use strict”;
function Waypoint(options) {
if (!options)
throw new Error(“No options passed to Waypoint constructor”);
if (!options.element)
throw new Error(“No element option passed to Waypoint constructor”);
if (!options.handler)
throw new Error(“No handler option passed to Waypoint constructor”);
this.key = “waypoint-” + keyCounter,
this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options),
this.element = this.options.element,
this.adapter = new Waypoint.Adapter(this.element),
this.callback = options.handler,
this.axis = this.options.horizontal ? “horizontal” : “vertical”,
this.enabled = this.options.enabled,
this.triggerPoint = null,
this.group = Waypoint.Group.findOrCreate({
name: this.options.group,
axis: this.axis
}),
this.context = Waypoint.Context.findOrCreateByElement(this.options.context),
Waypoint.offsetAliases[this.options.offset] && (this.options.offset = Waypoint.offsetAliases[this.options.offset]),
this.group.add(this),
this.context.add(this),
allWaypoints[this.key] = this,
keyCounter += 1
}
var keyCounter = 0
, allWaypoints = {};
Waypoint.prototype.queueTrigger = function(direction) {
this.group.queueTrigger(this, direction)
}
,
Waypoint.prototype.trigger = function(args) {
if (!this.enabled)
return;
this.callback && this.callback.apply(this, args)
}
,
Waypoint.prototype.destroy = function() {
this.context.remove(this),
this.group.remove(this),
delete allWaypoints[this.key]
}
,
Waypoint.prototype.disable = function() {
return this.enabled = !1,
this
}
,
Waypoint.prototype.enable = function() {
return this.context.refresh(),
this.enabled = !0,
this
}
,
Waypoint.prototype.next = function() {
return this.group.next(this)
}
,
Waypoint.prototype.previous = function() {
return this.group.previous(this)
}
,
Waypoint.invokeAll = function(method) {
var allWaypointsArray = [];
for (var waypointKey in allWaypoints)
allWaypointsArray.push(allWaypoints[waypointKey]);
for (var i = 0, end = allWaypointsArray.length; i < end; i++) allWaypointsArray[i][method]() } , Waypoint.destroyAll = function() { Waypoint.invokeAll(“destroy”) } , Waypoint.disableAll = function() { Waypoint.invokeAll(“disable”) } , Waypoint.enableAll = function() { Waypoint.Context.refreshAll(); for (var waypointKey in allWaypoints) allWaypoints[waypointKey].enabled = !0; return this } , Waypoint.refreshAll = function() { Waypoint.Context.refreshAll() } , Waypoint.viewportHeight = function() { return window.innerHeight || document.documentElement.clientHeight } , Waypoint.viewportWidth = function() { return document.documentElement.clientWidth } , Waypoint.adapters = [], Waypoint.defaults = { context: window, continuous: !0, enabled: !0, group: “default”, horizontal: !1, offset: 0 }, Waypoint.offsetAliases = { “bottom-in-view”: function() { return this.context.innerHeight() – this.adapter.outerHeight() }, “right-in-view”: function() { return this.context.innerWidth() – this.adapter.outerWidth() } }, window.Waypoint = Waypoint }(), function() { “use strict”; function requestAnimationFrameShim(callback) { window.setTimeout(callback, 1e3 / 60) } function Context(element) { this.element = element, this.Adapter = Waypoint.Adapter, this.adapter = new this.Adapter(element), this.key = “waypoint-context-” + keyCounter, this.didScroll = !1, this.didResize = !1, this.oldScroll = { x: this.adapter.scrollLeft(), y: this.adapter.scrollTop() }, this.waypoints = { vertical: {}, horizontal: {} }, element.waypointContextKey = this.key, contexts[element.waypointContextKey] = this, keyCounter += 1, Waypoint.windowContext || (Waypoint.windowContext = !0, Waypoint.windowContext = new Context(window)), this.createThrottledScrollHandler(), this.createThrottledResizeHandler() } var keyCounter = 0 , contexts = {} , Waypoint = window.Waypoint , oldWindowLoad = window.onload; Context.prototype.add = function(waypoint) { var axis = waypoint.options.horizontal ? “horizontal” : “vertical”; this.waypoints[axis][waypoint.key] = waypoint, this.refresh() } , Context.prototype.checkEmpty = function() { var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal) , verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical) , isWindow = this.element == this.element.window; horizontalEmpty && verticalEmpty && !isWindow && (this.adapter.off(“.waypoints”), delete contexts[this.key]) } , Context.prototype.createThrottledResizeHandler = function() { function resizeHandler() { self.handleResize(), self.didResize = !1 } var self = this; this.adapter.on(“resize.waypoints”, function() { self.didResize || (self.didResize = !0, Waypoint.requestAnimationFrame(resizeHandler)) }) } , Context.prototype.createThrottledScrollHandler = function() { function scrollHandler() { self.handleScroll(), self.didScroll = !1 } var self = this; this.adapter.on(“scroll.waypoints”, function() { if (!self.didScroll || Waypoint.isTouch) self.didScroll = !0, Waypoint.requestAnimationFrame(scrollHandler) }) } , Context.prototype.handleResize = function() { Waypoint.Context.refreshAll() } , Context.prototype.handleScroll = function() { var triggeredGroups = {} , axes = { horizontal: { newScroll: this.adapter.scrollLeft(), oldScroll: this.oldScroll.x, forward: “right”, backward: “left” }, vertical: { newScroll: this.adapter.scrollTop(), oldScroll: this.oldScroll.y, forward: “down”, backward: “up” } }; for (var axisKey in axes) { var axis = axes[axisKey] , isForward = axis.newScroll > axis.oldScroll
, direction = isForward ? axis.forward : axis.backward;
for (var waypointKey in this.waypoints[axisKey]) {
var waypoint = this.waypoints[axisKey][waypointKey];
if (waypoint.triggerPoint === null)
continue;
var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint , nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint
, crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint
, crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint;
if (crossedForward || crossedBackward)
waypoint.queueTrigger(direction),
triggeredGroups[waypoint.group.id] = waypoint.group
}
}
for (var groupKey in triggeredGroups)
triggeredGroups[groupKey].flushTriggers();
this.oldScroll = {
x: axes.horizontal.newScroll,
y: axes.vertical.newScroll
}
}
,
Context.prototype.innerHeight = function() {
return this.element == this.element.window ? Waypoint.viewportHeight() : this.adapter.innerHeight()
}
,
Context.prototype.remove = function(waypoint) {
delete this.waypoints[waypoint.axis][waypoint.key],
this.checkEmpty()
}
,
Context.prototype.innerWidth = function() {
return this.element == this.element.window ? Waypoint.viewportWidth() : this.adapter.innerWidth()
}
,
Context.prototype.destroy = function() {
var allWaypoints = [];
for (var axis in this.waypoints)
for (var waypointKey in this.waypoints[axis])
allWaypoints.push(this.waypoints[axis][waypointKey]);
for (var i = 0, end = allWaypoints.length; i < end; i++) allWaypoints[i].destroy() } , Context.prototype.refresh = function() { var isWindow = this.element == this.element.window, contextOffset = isWindow ? undefined : this.adapter.offset(), triggeredGroups = {}, axes; this.handleScroll(), axes = { horizontal: { contextOffset: isWindow ? 0 : contextOffset.left, contextScroll: isWindow ? 0 : this.oldScroll.x, contextDimension: this.innerWidth(), oldScroll: this.oldScroll.x, forward: “right”, backward: “left”, offsetProp: “left” }, vertical: { contextOffset: isWindow ? 0 : contextOffset.top, contextScroll: isWindow ? 0 : this.oldScroll.y, contextDimension: this.innerHeight(), oldScroll: this.oldScroll.y, forward: “down”, backward: “up”, offsetProp: “top” } }; for (var axisKey in axes) { var axis = axes[axisKey]; for (var waypointKey in this.waypoints[axisKey]) { var waypoint = this.waypoints[axisKey][waypointKey], adjustment = waypoint.options.offset, oldTriggerPoint = waypoint.triggerPoint, elementOffset = 0, freshWaypoint = oldTriggerPoint == null, contextModifier, wasBeforeScroll, nowAfterScroll, triggeredBackward, triggeredForward; waypoint.element !== waypoint.element.window && (elementOffset = waypoint.adapter.offset()[axis.offsetProp]), typeof adjustment == “function” ? adjustment = adjustment.apply(waypoint) : typeof adjustment == “string” && (adjustment = parseFloat(adjustment), waypoint.options.offset.indexOf(“%”) > -1 && (adjustment = Math.ceil(axis.contextDimension * adjustment / 100))),
contextModifier = axis.contextScroll – axis.contextOffset,
waypoint.triggerPoint = Math.floor(elementOffset + contextModifier – adjustment),
wasBeforeScroll = oldTriggerPoint < axis.oldScroll, nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll,
triggeredBackward = wasBeforeScroll && nowAfterScroll,
triggeredForward = !wasBeforeScroll && !nowAfterScroll,
!freshWaypoint && triggeredBackward ? (waypoint.queueTrigger(axis.backward),
triggeredGroups[waypoint.group.id] = waypoint.group) : !freshWaypoint && triggeredForward ? (waypoint.queueTrigger(axis.forward),
triggeredGroups[waypoint.group.id] = waypoint.group) : freshWaypoint && axis.oldScroll >= waypoint.triggerPoint && (waypoint.queueTrigger(axis.forward),
triggeredGroups[waypoint.group.id] = waypoint.group)
}
}
return Waypoint.requestAnimationFrame(function() {
for (var groupKey in triggeredGroups)
triggeredGroups[groupKey].flushTriggers()
}),
this
}
,
Context.findOrCreateByElement = function(element) {
return Context.findByElement(element) || new Context(element)
}
,
Context.refreshAll = function() {
for (var contextId in contexts)
contexts[contextId].refresh()
}
,
Context.findByElement = function(element) {
return contexts[element.waypointContextKey]
}
,
window.onload = function() {
oldWindowLoad && oldWindowLoad(),
Context.refreshAll()
}
,
Waypoint.requestAnimationFrame = function(callback) {
var requestFn = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || requestAnimationFrameShim;
requestFn.call(window, callback)
}
,
Waypoint.Context = Context
}(),
function() {
“use strict”;
function byTriggerPoint(a, b) {
return a.triggerPoint – b.triggerPoint
}
function byReverseTriggerPoint(a, b) {
return b.triggerPoint – a.triggerPoint
}
function Group(options) {
this.name = options.name,
this.axis = options.axis,
this.id = this.name + “-” + this.axis,
this.waypoints = [],
this.clearTriggerQueues(),
groups[this.axis][this.name] = this
}
var groups = {
vertical: {},
horizontal: {}
}
, Waypoint = window.Waypoint;
Group.prototype.add = function(waypoint) {
this.waypoints.push(waypoint)
}
,
Group.prototype.clearTriggerQueues = function() {
this.triggerQueues = {
up: [],
down: [],
left: [],
right: []
}
}
,
Group.prototype.flushTriggers = function() {
for (var direction in this.triggerQueues) {
var waypoints = this.triggerQueues[direction]
, reverse = direction === “up” || direction === “left”;
waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint);
for (var i = 0, end = waypoints.length; i < end; i += 1) { var waypoint = waypoints[i]; (waypoint.options.continuous || i === waypoints.length – 1) && waypoint.trigger([direction]) } } this.clearTriggerQueues() } , Group.prototype.next = function(waypoint) { this.waypoints.sort(byTriggerPoint); var index = Waypoint.Adapter.inArray(waypoint, this.waypoints) , isLast = index === this.waypoints.length – 1; return isLast ? null : this.waypoints[index + 1] } , Group.prototype.previous = function(waypoint) { this.waypoints.sort(byTriggerPoint); var index = Waypoint.Adapter.inArray(waypoint, this.waypoints); return index ? this.waypoints[index – 1] : null } , Group.prototype.queueTrigger = function(waypoint, direction) { this.triggerQueues[direction].push(waypoint) } , Group.prototype.remove = function(waypoint) { var index = Waypoint.Adapter.inArray(waypoint, this.waypoints); index > -1 && this.waypoints.splice(index, 1)
}
,
Group.prototype.first = function() {
return this.waypoints[0]
}
,
Group.prototype.last = function() {
return this.waypoints[this.waypoints.length – 1]
}
,
Group.findOrCreate = function(options) {
return groups[options.axis][options.name] || new Group(options)
}
,
Waypoint.Group = Group
}(),
function() {
“use strict”;
function JQueryAdapter(element) {
this.$element = $(element)
}
var $ = window.jQuery
, Waypoint = window.Waypoint;
$.each([“innerHeight”, “innerWidth”, “off”, “offset”, “on”, “outerHeight”, “outerWidth”, “scrollLeft”, “scrollTop”], function(i, method) {
JQueryAdapter.prototype[method] = function() {
var args = Array.prototype.slice.call(arguments);
return this.$element[method].apply(this.$element, args)
}
}),
$.each([“extend”, “inArray”, “isEmptyObject”], function(i, method) {
JQueryAdapter[method] = $[method]
}),
Waypoint.adapters.push({
name: “jquery”,
Adapter: JQueryAdapter
}),
Waypoint.Adapter = JQueryAdapter
}(),
function() {
“use strict”;
function createExtension(framework) {
return function() {
var waypoints = []
, overrides = arguments[0];
return framework.isFunction(arguments[0]) && (overrides = framework.extend({}, arguments[1]),
overrides.handler = arguments[0]),
this.each(function() {
var options = framework.extend({}, overrides, {
element: this
});
typeof options.context == “string” && (options.context = framework(this).closest(options.context)[0]),
waypoints.push(new Waypoint(options))
}),
waypoints
}
}
var Waypoint = window.Waypoint;
window.jQuery && (window.jQuery.fn.waypoint = createExtension(window.jQuery)),
window.Zepto && (window.Zepto.fn.waypoint = createExtension(window.Zepto))
}(),
function() {
“use strict”;
function noop() {}
function Inview(options) {
this.options = Waypoint.Adapter.extend({}, Inview.defaults, options),
this.axis = this.options.horizontal ? “horizontal” : “vertical”,
this.waypoints = [],
this.element = this.options.element,
this.createWaypoints()
}
var Waypoint = window.Waypoint;
Inview.prototype.createWaypoints = function() {
var configs = {
vertical: { down: “enter”, up: “exited”, offset: “100%” }, { down: “entered”, up: “exit”, offset: “bottom-in-view” }, { down: “exit”, up: “entered”, offset: 0 }, { down: “exited”, up: “enter”, offset: function() { return -this.adapter.outerHeight() } },
horizontal: { right: “enter”, left: “exited”, offset: “100%” }, { right: “entered”, left: “exit”, offset: “right-in-view” }, { right: “exit”, left: “entered”, offset: 0 }, { right: “exited”, left: “enter”, offset: function() { return -this.adapter.outerWidth() } }
};
for (var i = 0, end = configs[this.axis].length; i < end; i++) { var config = configs[this.axis][i]; this.createWaypoint(config) } } , Inview.prototype.createWaypoint = function(config) { var self = this; this.waypoints.push(new Waypoint({ context: this.options.context, element: this.options.element, enabled: this.options.enabled, handler: function(config) { return function(direction) { self.options[config[direction]].call(self, direction) } }(config), offset: config.offset, horizontal: this.options.horizontal })) } , Inview.prototype.destroy = function() { for (var i = 0, end = this.waypoints.length; i < end; i++) this.waypoints[i].destroy(); this.waypoints = [] } , Inview.prototype.disable = function() { for (var i = 0, end = this.waypoints.length; i < end; i++) this.waypoints[i].disable() } , Inview.prototype.enable = function() { for (var i = 0, end = this.waypoints.length; i < end; i++) this.waypoints[i].enable() } , Inview.defaults = { context: window, enabled: !0, enter: noop, entered: noop, exit: noop, exited: noop }, Waypoint.Inview = Inview }(), function($) { function initMouseDetection(disable) { if (!mouseDetectionEnabled && !disable) { var firstTime = !0 , lastMove = null; $(document).bind({ “mousemove.smartmenus_mouse”: function(e) { var thisMove = { x: e.pageX, y: e.pageY, timeStamp: (new Date).getTime() }; if (lastMove) { var deltaX = Math.abs(lastMove.x – thisMove.x) , deltaY = Math.abs(lastMove.y – thisMove.y); if ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp – lastMove.timeStamp <= 300) { mouse = !0; if (firstTime) { var $a = $(e.target).closest(“a”); $a.is(“a”) && $.each(menuTrees, function() { if ($.contains(this.$root[0], $a[0])) return this.itemEnter({ currentTarget: $a[0] }), !1 }), firstTime = !1 } } } lastMove = thisMove }, “touchstart.smartmenus_mouse pointerover.smartmenus_mouse MSPointerOver.smartmenus_mouse”: function(e) { /^(4|mouse)$/.test(e.originalEvent.pointerType) || (mouse = !1) } }), mouseDetectionEnabled = !0 } else mouseDetectionEnabled && disable && ($(document).unbind(“.smartmenus_mouse”), mouseDetectionEnabled = !1) } var menuTrees = [] , IE = !!window.createPopup , IElt9 = IE && !document.defaultView , IElt8 = IE && !document.querySelector , IE6 = IE && typeof document.documentElement.currentStyle.minWidth == “undefined” , mouse = !1 , mouseDetectionEnabled = !1; $.SmartMenus = function(elm, options) { this.$root = $(elm), this.opts = options, this.rootId = “”, this.$subArrow = null, this.subMenus = [], this.activatedItems = [], this.visibleSubMenus = [], this.showTimeout = 0, this.hideTimeout = 0, this.scrollTimeout = 0, this.clickActivated = !1, this.zIndexInc = 0, this.$firstLink = null, this.$firstSub = null, this.disabled = !1, this.$disableOverlay = null, this.init() } , $.extend($.SmartMenus, { hideAll: function() { $.each(menuTrees, function() { this.menuHideAll() }) }, destroy: function() { while (menuTrees.length) menuTrees[0].destroy(); initMouseDetection(!0) }, prototype: { init: function(refresh) { var self = this; if (!refresh) { menuTrees.push(this), this.rootId = ((new Date).getTime() + Math.random() + “”).replace(/\D/g, “”), this.$root.hasClass(“sm-rtl”) && (this.opts.rightToLeftSubMenus = !0), this.$root.data(“smartmenus”, this).attr(“data-smartmenus-id”, this.rootId).dataSM(“level”, 1).bind({ “mouseover.smartmenus focusin.smartmenus”: $.proxy(this.rootOver, this), “mouseout.smartmenus focusout.smartmenus”: $.proxy(this.rootOut, this) }).delegate(“a”, { “mouseenter.smartmenus”: $.proxy(this.itemEnter, this), “mouseleave.smartmenus”: $.proxy(this.itemLeave, this), “mousedown.smartmenus”: $.proxy(this.itemDown, this), “focus.smartmenus”: $.proxy(this.itemFocus, this), “blur.smartmenus”: $.proxy(this.itemBlur, this), “click.smartmenus”: $.proxy(this.itemClick, this), “touchend.smartmenus”: $.proxy(this.itemTouchEnd, this) }); var eNamespace = “.smartmenus” + this.rootId; this.opts.hideOnClick && $(document).bind(“touchstart” + eNamespace, $.proxy(this.docTouchStart, this)).bind(“touchmove” + eNamespace, $.proxy(this.docTouchMove, this)).bind(“touchend” + eNamespace, $.proxy(this.docTouchEnd, this)).bind(“click” + eNamespace, $.proxy(this.docClick, this)), $(window).bind(“resize” + eNamespace + ” orientationchange” + eNamespace, $.proxy(this.winResize, this)), $(window).bind(“scroll” + eNamespace + ” orientationchange” + eNamespace, $.proxy(this.winResize, this)), this.opts.subIndicators && (this.$subArrow = $(“”).addClass(“sub-arrow”),
this.opts.subIndicatorsText && this.$subArrow.html(this.opts.subIndicatorsText)),
initMouseDetection()
}
this.$firstSub = this.$root.find(“ul”).each(function() {
self.menuInit($(this))
}).eq(0),
this.$firstLink = this.$root.find(“a”).eq(0);
if (this.opts.markCurrentItem) {
var reDefaultDoc = /(index|default).[^#\?\/]/i , reHash = /#./
, locHref = window.location.href.replace(reDefaultDoc, “”)
, locHrefNoHash = locHref.replace(reHash, “”);
this.$root.find(“a”).each(function() {
var href = this.href.replace(reDefaultDoc, “”)
, $this = $(this);
if (href == locHref || href == locHrefNoHash)
$this.addClass(“current”),
self.opts.markCurrentTree && $this.parents(“li”).each(function() {
var $this = $(this);
$this.dataSM(“sub”) && $this.children(“a”).addClass(“current”)
})
})
}
},
destroy: function() {
this.menuHideAll(),
this.$root.removeData(“smartmenus”).removeAttr(“data-smartmenus-id”).removeDataSM(“level”).unbind(“.smartmenus”).undelegate(“.smartmenus”);
var eNamespace = “.smartmenus” + this.rootId;
$(document).unbind(eNamespace),
$(window).unbind(eNamespace),
this.opts.subIndicators && (this.$subArrow = null);
var self = this;
$.each(this.subMenus, function() {
this.hasClass(“mega-menu”) && this.find(“ul”).removeDataSM(“in-mega”);
if (this.dataSM(“shown-before”)) {
IElt8 && this.children().css({
styleFloat: “”,
width: “”
});
if (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth)
IE6 ? this.css({
width: “”,
overflowX: “”,
overflowY: “”
}).children().children(“a”).css(“white-space”, “”) : this.css({
width: “”,
minWidth: “”,
maxWidth: “”
}).removeClass(“sm-nowrap”);
this.dataSM(“scroll-arrows”) && this.dataSM(“scroll-arrows”).remove(),
this.css({
zIndex: “”,
top: “”,
left: “”,
marginLeft: “”,
marginTop: “”,
display: “”
})
}
self.opts.subIndicators && this.dataSM(“parent-a”).removeClass(“has-submenu”).children(“span.sub-arrow”).remove(),
this.removeDataSM(“shown-before”).removeDataSM(“ie-shim”).removeDataSM(“scroll-arrows”).removeDataSM(“parent-a”).removeDataSM(“level”).removeDataSM(“beforefirstshowfired”).parent().removeDataSM(“sub”)
}),
this.opts.markCurrentItem && this.$root.find(“a.current”).removeClass(“current”),
this.$root = null,
this.$firstLink = null,
this.$firstSub = null,
this.$disableOverlay && (this.$disableOverlay.remove(),
this.$disableOverlay = null),
menuTrees.splice($.inArray(this, menuTrees), 1)
},
disable: function(noOverlay) {
if (!this.disabled) {
this.menuHideAll();
if (!noOverlay && !this.opts.isPopup && this.$root.is(“:visible”)) {
var pos = this.$root.offset();
this.$disableOverlay = $(‘

‘).css({
position: “absolute”,
top: pos.top,
left: pos.left,
width: this.$root.outerWidth(),
height: this.$root.outerHeight(),
zIndex: this.getStartZIndex() + 1,
opacity: 0
}).appendTo(document.body)
}
this.disabled = !0
}
},
docClick: function(e) {
(this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).is(“a”)) && this.menuHideAll($(e.target))
},
docTouchEnd: function(e) {
if (!this.lastTouch)
return;
if (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) {
this.hideTimeout && (clearTimeout(this.hideTimeout),
this.hideTimeout = 0);
var self = this;
this.hideTimeout = setTimeout(function() {
self.menuHideAll($(e.target))
}, 350)
}
this.lastTouch = null
},
docTouchMove: function(e) {
if (!this.lastTouch)
return;
var touchPoint = e.originalEvent.touches[0];
this.lastTouch.x2 = touchPoint.pageX,
this.lastTouch.y2 = touchPoint.pageY
},
docTouchStart: function(e) {
var touchPoint = e.originalEvent.touches[0];
this.lastTouch = {
x1: touchPoint.pageX,
y1: touchPoint.pageY,
target: touchPoint.target
}
},
enable: function() {
this.disabled && (this.$disableOverlay && (this.$disableOverlay.remove(),
this.$disableOverlay = null),
this.disabled = !1)
},
getHeight: function($elm) {
return this.getOffset($elm, !0)
},
getOffset: function($elm, height) {
var old;
$elm.css(“display”) == “none” && (old = {
position: $elm[0].style.position,
visibility: $elm[0].style.visibility
},
$elm.css({
position: “absolute”,
visibility: “hidden”
}).show());
var defaultView = $elm[0].ownerDocument.defaultView
, compStyle = defaultView && defaultView.getComputedStyle && defaultView.getComputedStyle($elm[0], null)
, val = compStyle && parseFloat(compStyle[height ? “height” : “width”]);
return val ? val += parseFloat(compStyle[height ? “paddingTop” : “paddingLeft”]) + parseFloat(compStyle[height ? “paddingBottom” : “paddingRight”]) + parseInt(compStyle[height ? “borderTopWidth” : “borderLeftWidth”]) + parseInt(compStyle[height ? “borderBottomWidth” : “borderRightWidth”]) : val = height ? $elm[0].offsetHeight : $elm[0].offsetWidth,
old && $elm.hide().css(old),
val
},
getWidth: function($elm) {
return this.getOffset($elm)
},
getStartZIndex: function() {
var zIndex = parseInt(this.$root.css(“z-index”));
return isNaN(zIndex) ? 1 : zIndex
},
handleEvents: function() {
return !this.disabled && this.isCSSOn()
},
handleItemEvents: function($a) {
return this.handleEvents() && !this.isLinkInMegaMenu($a)
},
isCollapsible: function() {
return this.$firstSub.css(“position”) == “static”
},
isCSSOn: function() {
return this.$firstLink.css(“display”) == “block” || this.$firstLink.css(“display”) == “inline”
},
isFixed: function() {
return this.$root.css(“position”) == “fixed”
},
isLinkInMegaMenu: function($a) {
return !$a.parent().parent().dataSM(“level”)
},
isTouchMode: function() {
return !mouse || this.isCollapsible()
},
itemActivate: function($a) {
var $li = $a.parent()
, $ul = $li.parent()
, level = $ul.dataSM(“level”);
if (level > 1 && (!this.activatedItems[level – 2] || this.activatedItems[level – 2][0] != $ul.dataSM(“parent-a”)[0])) {
var self = this;
$($ul.parentsUntil(“[data-smartmenus-id]”, “ul”).get().reverse()).add($ul).each(function() {
self.itemActivate($(this).dataSM(“parent-a”))
})
}
if (this.visibleSubMenus.length > level)
for (var i = this.visibleSubMenus.length – 1, l = !this.activatedItems[level – 1] || this.activatedItems[level – 1][0] != $a[0] ? level – 1 : level; i > l; i–)
this.menuHide(this.visibleSubMenus[i]);
this.activatedItems[level – 1] = $a,
this.visibleSubMenus[level – 1] = $ul;
if (this.$root.triggerHandler(“activate.smapi”, $a[0]) === !1)
return;
var $sub = $li.dataSM(“sub”);
$sub && (this.isTouchMode() || !this.opts.showOnClick || this.clickActivated) && this.menuShow($sub)
},
itemBlur: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
this.$root.triggerHandler(“blur.smapi”, $a[0])
},
itemClick: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
$a.removeDataSM(“mousedown”);
if (this.$root.triggerHandler(“click.smapi”, $a[0]) === !1)
return !1;
var $sub = $a.parent().dataSM(“sub”);
if (this.isTouchMode()) {
$a.dataSM(“href”) && $a.attr(“href”, $a.dataSM(“href”)).removeDataSM(“href”);
if ($sub && (!$sub.dataSM(“shown-before”) || !$sub.is(“:visible”))) {
this.itemActivate($a);
if ($sub.is(“:visible”))
return !1
}
} else if (this.opts.showOnClick && $a.parent().parent().dataSM(“level”) == 1 && $sub)
return this.clickActivated = !0,
this.menuShow($sub),
!1;
if ($a.hasClass(“disabled”))
return !1;
if (this.$root.triggerHandler(“select.smapi”, $a[0]) === !1)
return !1
},
itemDown: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
$a.dataSM(“mousedown”, !0)
},
itemEnter: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
if (!this.isTouchMode()) {
this.showTimeout && (clearTimeout(this.showTimeout),
this.showTimeout = 0);
var self = this;
this.showTimeout = setTimeout(function() {
self.itemActivate($a)
}, this.opts.showOnClick && $a.parent().parent().dataSM(“level”) == 1 ? 1 : this.opts.showTimeout)
}
this.$root.triggerHandler(“mouseenter.smapi”, $a[0])
},
itemFocus: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
(!this.isTouchMode() || !$a.dataSM(“mousedown”)) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length – 1][0] != $a[0]) && this.itemActivate($a),
this.$root.triggerHandler(“focus.smapi”, $a[0])
},
itemLeave: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
this.isTouchMode() || ($a[0].blur && $a[0].blur(),
this.showTimeout && (clearTimeout(this.showTimeout),
this.showTimeout = 0)),
$a.removeDataSM(“mousedown”),
this.$root.triggerHandler(“mouseleave.smapi”, $a[0])
},
itemTouchEnd: function(e) {
var $a = $(e.currentTarget);
if (!this.handleItemEvents($a))
return;
var $sub = $a.parent().dataSM(“sub”);
$a.attr(“href”).charAt(0) !== “#” && $sub && (!$sub.dataSM(“shown-before”) || !$sub.is(“:visible”)) && ($a.dataSM(“href”, $a.attr(“href”)),
$a.attr(“href”, “#”))
},
menuFixLayout: function($ul) {
$ul.dataSM(“shown-before”) || ($ul.hide().dataSM(“shown-before”, !0),
IElt8 && $ul.children().css({
styleFloat: “left”,
width: “100%”
}))
},
menuHide: function($sub) {
if (this.$root.triggerHandler(“beforehide.smapi”, $sub[0]) === !1)
return;
$sub.stop(!0, !0);
if ($sub.is(“:visible”)) {
var complete = function() {
IElt9 ? $sub.parent().css(“z-index”, “”) : $sub.css(“z-index”, “”)
};
this.isCollapsible() ? this.opts.collapsibleHideFunction ? this.opts.collapsibleHideFunction.call(this, $sub, complete) : $sub.hide(this.opts.collapsibleHideDuration, complete) : this.opts.hideFunction ? this.opts.hideFunction.call(this, $sub, complete) : $sub.hide(this.opts.hideDuration, complete),
$sub.dataSM(“ie-shim”) && $sub.dataSM(“ie-shim”).remove(),
$sub.dataSM(“scroll”) && $sub.unbind(“.smartmenus_scroll”).removeDataSM(“scroll”).dataSM(“scroll-arrows”).hide(),
$sub.dataSM(“parent-a”).removeClass(“highlighted”);
var level = $sub.dataSM(“level”);
this.activatedItems.splice(level – 1, 1),
this.visibleSubMenus.splice(level – 1, 1),
this.$root.triggerHandler(“hide.smapi”, $sub[0])
}
},
menuHideAll: function($item) {
if ($item != undefined && $item.parent().hasClass(“menu-item”) && !$item.parent().hasClass(“menu-item-has-children”))
return;
if ($(“body”).hasClass(“vmenu”))
return;
this.showTimeout && (clearTimeout(this.showTimeout),
this.showTimeout = 0);
for (var i = this.visibleSubMenus.length – 1; i > 0; i–)
this.menuHide(this.visibleSubMenus[i]);
this.opts.isPopup && (this.$root.stop(!0, !0),
this.$root.is(“:visible”) && (this.opts.hideFunction ? this.opts.hideFunction.call(this, this.$root) : this.$root.hide(this.opts.hideDuration),
this.$root.dataSM(“ie-shim”) && this.$root.dataSM(“ie-shim”).remove())),
this.activatedItems = [],
this.visibleSubMenus = [],
this.clickActivated = !1,
this.zIndexInc = 0
},
menuIframeShim: function($ul) {
IE && this.opts.overlapControlsInIE && !$ul.dataSM(“ie-shim”) && $ul.dataSM(“ie-shim”, $(“‘ : video.type === “vimeo” && (html = ‘//player.vimeo.com/video/’ + video.id + ‘?autoplay=1’), $(‘

‘ + html + ““).insertAfter(item.find(“.owl-video”)), this._playing = item.addClass(“owl-video-playing”) } , Video.prototype.isInFullScreen = function() { var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; return element && $(element).parent().hasClass(“owl-video-frame”) } , Video.prototype.destroy = function() { var handler, property; this._core.$element.off(“click.owl.video”); for (handler in this._handlers) this._core.$element.off(handler, this._handlers[handler]); for (property in Object.getOwnPropertyNames(this)) typeof this[property] != “function” && (this[property] = null) } , $.fn.owlCarousel.Constructor.Plugins.Video = Video }(window.Zepto || window.jQuery, window, document), function($, window, document, undefined) { var Animate = function(scope) { this.core = scope, this.core.options = $.extend({}, Animate.Defaults, this.core.options), this.swapping = !0, this.previous = undefined, this.next = undefined, this.handlers = { “change.owl.carousel”: $.proxy(function(e) { e.namespace && e.property.name == “position” && (this.previous = this.core.current(), this.next = e.property.value) }, this), “drag.owl.carousel dragged.owl.carousel translated.owl.carousel”: $.proxy(function(e) { e.namespace && (this.swapping = e.type == “translated”) }, this), “translate.owl.carousel”: $.proxy(function(e) { e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() }, this) }, this.core.$element.on(this.handlers) }; Animate.Defaults = { animateOut: !1, animateIn: !1 }, Animate.prototype.swap = function() { if (this.core.settings.items !== 1) return; if (!$.support.animation || !$.support.transition) return; this.core.speed(0); var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; if (this.core.current() === this.previous) return; outgoing && (left = this.core.coordinates(this.previous) – this.core.coordinates(this.next), previous.css({ left: left + “px” }).addClass(“animated owl-animated-out”).addClass(outgoing).on($.support.animation.end, clear)), incoming && next.addClass(“animated owl-animated-in”).addClass(incoming).on($.support.animation.end, clear) } , Animate.prototype.clear = function(e) { $(e.target).hasClass(“animated”) && ($(e.target).css({ left: “” }).removeClass(“animated owl-animated-out owl-animated-in”).removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), this.core.onTransitionEnd()) } , Animate.prototype.destroy = function() { var handler, property; for (handler in this.handlers) this.core.$element.off(handler, this.handlers[handler]); for (property in Object.getOwnPropertyNames(this)) typeof this[property] != “function” && (this[property] = null) } , $.fn.owlCarousel.Constructor.Plugins.Animate = Animate }(window.Zepto || window.jQuery, window, document), function($, window, document, undefined) { var Autoplay = function(carousel) { this._core = carousel, this._interval = null, this._paused = !1, this._handlers = { “changed.owl.carousel”: $.proxy(function(e) { e.namespace && e.property.name === “settings” && (this._core.settings.autoplay ? this.play() : this.stop()) }, this), “initialized.owl.carousel”: $.proxy(function(e) { e.namespace && this._core.settings.autoplay && this.play() }, this), “play.owl.autoplay”: $.proxy(function(e, t, s) { e.namespace && this.play(t, s) }, this), “stop.owl.autoplay”: $.proxy(function(e) { e.namespace && this.stop() }, this), “mouseover.owl.autoplay”: $.proxy(function() { this._core.settings.autoplayHoverPause && this._core.is(“rotating”) && this.pause() }, this), “mouseleave.owl.autoplay”: $.proxy(function() { this._core.settings.autoplayHoverPause && this._core.is(“rotating”) && this.play() }, this) }, this._core.$element.on(this._handlers), this._core.options = $.extend({}, Autoplay.Defaults, this._core.options) }; Autoplay.Defaults = { autoplay: !1, autoplayTimeout: 5e3, autoplayHoverPause: !1, autoplaySpeed: !1 }, Autoplay.prototype.play = function(timeout, speed) { this._paused = !1; if (this._core.is(“rotating”)) return; this._core.enter(“rotating”), this._interval = window.setInterval($.proxy(function() { if (this._paused || this._core.is(“busy”) || this._core.is(“interacting”) || document.hidden) return; this._core.next(speed || this._core.settings.autoplaySpeed) }, this), timeout || this._core.settings.autoplayTimeout) } , Autoplay.prototype.stop = function() { if (!this._core.is(“rotating”)) return; window.clearInterval(this._interval), this._core.leave(“rotating”) } , Autoplay.prototype.pause = function() { if (!this._core.is(“rotating”)) return; this._paused = !0 } , Autoplay.prototype.destroy = function() { var handler, property; this.stop(); for (handler in this._handlers) this._core.$element.off(handler, this._handlers[handler]); for (property in Object.getOwnPropertyNames(this)) typeof this[property] != “function” && (this[property] = null) } , $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay }(window.Zepto || window.jQuery, window, document), function($, window, document, undefined) { “use strict”; var Navigation = function(carousel) { this._core = carousel, this._initialized = !1, this._pages = [], this._controls = {}, this._templates = [], this.$element = this._core.$element, this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }, this._handlers = { “prepared.owl.carousel”: $.proxy(function(e) { e.namespace && this._core.settings.dotsData && this._templates.push(” + $(e.content).find(“[data-dot]”).andSelf(“[data-dot]”).attr(“data-dot”) + “”) }, this), “added.owl.carousel”: $.proxy(function(e) { e.namespace && this._core.settings.dotsData && this._templates.splice(e.position, 0, this._templates.pop()) }, this), “remove.owl.carousel”: $.proxy(function(e) { e.namespace && this._core.settings.dotsData && this._templates.splice(e.position, 1) }, this), “changed.owl.carousel”: $.proxy(function(e) { e.namespace && e.property.name == “position” && this.draw() }, this), “initialized.owl.carousel”: $.proxy(function(e) { e.namespace && !this._initialized && (this._core.trigger(“initialize”, null, “navigation”), this.initialize(), this.update(), this.draw(), this._initialized = !0, this._core.trigger(“initialized”, null, “navigation”)) }, this), “refreshed.owl.carousel”: $.proxy(function(e) { e.namespace && this._initialized && (this._core.trigger(“refresh”, null, “navigation”), this.update(), this.draw(), this._core.trigger(“refreshed”, null, “navigation”)) }, this) }, this._core.options = $.extend({}, Navigation.Defaults, this._core.options), this.$element.on(this._handlers) }; Navigation.Defaults = { nav: !1, navText: [“prev”, “next”], navSpeed: !1, navElement: “div”, navContainer: !1, navContainerClass: “owl-nav”, navClass: [“owl-prev”, “owl-next”], slideBy: 1, dotClass: “owl-dot”, dotsClass: “owl-dots”, dots: !0, dotsEach: !1, dotsData: !1, dotsSpeed: !1, dotsContainer: !1 }, Navigation.prototype.initialize = function() { var override, settings = this._core.settings; this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $(“

“).addClass(settings.navContainerClass).appendTo(this.$element)).addClass(“disabled”), this._controls.$previous = $(“<” + settings.navElement + “>”).addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on(“click”, $.proxy(function(e) { this.prev(settings.navSpeed) }, this)), this._controls.$next = $(“<” + settings.navElement + “>”).addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on(“click”, $.proxy(function(e) { this.next(settings.navSpeed) }, this)), settings.dotsData || (this._templates = [$(“

“).addClass(settings.dotClass).append($(“”)).prop(“outerHTML”)]), this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) : $(“

“).addClass(settings.dotsClass).appendTo(this.$element)).addClass(“disabled”), this._controls.$absolute.on(“click”, “div”, $.proxy(function(e) { var index = $(e.target).parent().is(this._controls.$absolute) ? $(e.target).index() : $(e.target).parent().index(); e.preventDefault(), this.to(index, settings.dotsSpeed) }, this)); for (override in this._overrides) this._core[override] = $.proxy(this[override], this) } , Navigation.prototype.destroy = function() { var handler, control, property, override; for (handler in this._handlers) this.$element.off(handler, this._handlers[handler]); for (control in this._controls) this._controls[control].remove(); for (override in this.overides) this._core[override] = this._overrides[override]; for (property in Object.getOwnPropertyNames(this)) typeof this[property] != “function” && (this[property] = null) } , Navigation.prototype.update = function() { var i, j, k, lower = this._core.clones().length / 2, upper = lower + this._core.items().length, maximum = this._core.maximum(!0), settings = this._core.settings, size = settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items; settings.slideBy !== “page” && (settings.slideBy = Math.min(settings.slideBy, settings.items)); if (settings.dots || settings.slideBy == “page”) { this._pages = []; for (i = lower, j = 0, k = 0; i < upper; i++) { if (j >= size || j === 0) { this._pages.push({ start: Math.min(maximum, i – lower), end: i – lower + size – 1 }); if (Math.min(maximum, i – lower) === maximum) break; j = 0, ++k } j += this._core.mergers(this._core.relative(i)) } } } , Navigation.prototype.draw = function() { var difference, settings = this._core.settings, disabled = this._core.items().length <= settings.items, index = this._core.relative(this._core.current()), loop = settings.loop || settings.rewind; this._controls.$relative.toggleClass(“disabled”, !settings.nav || disabled), settings.nav && (this._controls.$previous.toggleClass(“disabled”, !loop && index <= this._core.minimum(!0)), this._controls.$next.toggleClass(“disabled”, !loop && index >= this._core.maximum(!0))), this._controls.$absolute.toggleClass(“disabled”, !settings.dots || disabled), settings.dots && (difference = this._pages.length – this._controls.$absolute.children().length, settings.dotsData && difference !== 0 ? this._controls.$absolute.html(this._templates.join(“”)) : difference > 0 ? this._controls.$absolute.append((new Array(difference + 1)).join(this._templates[0])) : difference < 0 && this._controls.$absolute.children().slice(difference).remove(), this._controls.$absolute.find(“.active”).removeClass(“active”), this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass(“active”)) } , Navigation.prototype.onTrigger = function(event) { var settings = this._core.settings; event.page = { index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings && (settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items) } } , Navigation.prototype.current = function() { var current = this._core.relative(this._core.current()); return $.grep(this._pages, $.proxy(function(page, index) { return page.start <= current && page.end >= current }, this)).pop() } , Navigation.prototype.getPosition = function(successor) { var position, length, settings = this._core.settings; return settings.slideBy == “page” ? (position = $.inArray(this.current(), this._pages), length = this._pages.length, successor ? ++position : –position, position = this._pages[(position % length + length) % length].start) : (position = this._core.relative(this._core.current()), length = this._core.items().length, successor ? position += settings.slideBy : position -= settings.slideBy), position } , Navigation.prototype.next = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(!0), speed) } , Navigation.prototype.prev = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(!1), speed) } , Navigation.prototype.to = function(position, speed, standard) { var length; standard ? $.proxy(this._overrides.to, this._core)(position, speed) : (length = this._pages.length, $.proxy(this._overrides.to, this._core)(this._pages[(position % length + length) % length].start, speed)) } , $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation }(window.Zepto || window.jQuery, window, document), function($, window, document, undefined) { “use strict”; var Hash = function(carousel) { this._core = carousel, this._hashes = {}, this.$element = this._core.$element, this._handlers = { “prepared.owl.carousel”: $.proxy(function(e) { if (e.namespace) { var hash = $(e.content).find(“[data-hash]”).addBack(“[data-hash]”).attr(“data-hash”); if (!hash) return; this._hashes[hash] = e.content } }, this), “changed.owl.carousel”: $.proxy(function(e) { if (e.namespace && e.property.name === “position”) { var current = this._core.items(this._core.relative(this._core.current())) , hash = $.map(this._hashes, function(item, hash) { return item === current ? hash : null }).join(); if (!hash || window.location.hash.slice(1) === hash) return; window.location.hash = hash } }, this) }, this._core.options = $.extend({}, Hash.Defaults, this._core.options), this.$element.on(this._handlers) }; Hash.Defaults = { URLhashListener: !1 }, Hash.prototype.destroy = function() { var handler, property; $(window).off(“hashchange.owl.navigation”); for (handler in this._handlers) this._core.$element.off(handler, this._handlers[handler]); for (property in Object.getOwnPropertyNames(this)) typeof this[property] != “function” && (this[property] = null) } , $.fn.owlCarousel.Constructor.Plugins.Hash = Hash }(window.Zepto || window.jQuery, window, document), function($, window, document, undefined) { function test(property, prefixed) { var result = !1 , upper = property.charAt(0).toUpperCase() + property.slice(1); return $.each((property + ” ” + prefixes.join(upper + ” “) + upper).split(” “), function(i, property) { if (style[property] !== undefined) return result = prefixed ? property : !0, !1 }), result } function prefixed(property) { return test(property, !0) } var style = $(“”).get(0).style , prefixes = “Webkit Moz O ms”.split(” “) , events = { transition: { end: { WebkitTransition: “webkitTransitionEnd”, MozTransition: “transitionend”, OTransition: “oTransitionEnd”, transition: “transitionend” } }, animation: { end: { WebkitAnimation: “webkitAnimationEnd”, MozAnimation: “animationend”, OAnimation: “oAnimationEnd”, animation: “animationend” } } } , tests = { csstransforms: function() { return !!test(“transform”) }, csstransforms3d: function() { return !!test(“perspective”) }, csstransitions: function() { return !!test(“transition”) }, cssanimations: function() { return !!test(“animation”) } }; tests.csstransitions() && ($.support.transition = new String(prefixed(“transition”)), $.support.transition.end = events.transition.end[$.support.transition]), tests.cssanimations() && ($.support.animation = new String(prefixed(“animation”)), $.support.animation.end = events.animation.end[$.support.animation]), tests.csstransforms() && ($.support.transform = new String(prefixed(“transform”)), $.support.transform3d = tests.csstransforms3d()) }(window.Zepto || window.jQuery, window, document), function(window, document, undefined) { var absPos = function(element) { var offsetLeft, offsetTop; offsetLeft = offsetTop = 0; if (element.offsetParent) do offsetLeft += element.offsetLeft, offsetTop += element.offsetTop; while (element = element.offsetParent); return [offsetLeft, offsetTop] } , ProgressCircle = function(params) { this.canvas = params.canvas, this.minRadius = params.minRadius || 15, this.arcWidth = params.arcWidth || 5, this.gapWidth = params.gapWidth || 3, this.centerX = params.centerX || this.canvas.width / 2, this.centerY = params.centerY || this.canvas.height / 2, this.infoLineLength = params.infoLineLength || 60, this.horizLineLength = params.horizLineLength || 10, this.infoLineAngleInterval = params.infoLineAngleInterval || Math.PI / 8, this.infoLineBaseAngle = params.infoLineBaseAngle || Math.PI / 6, this.context = this.canvas.getContext(“2d”), this.width = this.canvas.width, this.height = this.canvas.height, this.circles = [], this.runningCount = 0 }; ProgressCircle.prototype = { constructor: ProgressCircle, addEntry: function(params) { return this.circles.push(new Circle({ canvas: this.canvas, context: this.context, centerX: this.centerX, centerY: this.centerY, innerRadius: this.minRadius + this.circles.length * (this.gapWidth + this.arcWidth), arcWidth: this.arcWidth, infoLineLength: this.infoLineLength, horizLineLength: this.horizLineLength, id: this.circles.length, fillColor: params.fillColor, outlineColor: params.outlineColor, progressListener: params.progressListener, infoListener: params.infoListener, infoLineAngle: this.infoLineBaseAngle + this.circles.length * this.infoLineAngleInterval })), this }, start: function(interval) { var self = this; return this.timer = setInterval(function() { self._update() }, interval || 33), this }, stop: function() { clearTimeout(this.timer) }, _update: function() { return this._clear(), this.circles.forEach(function(circle, idx, array) { circle.update() }), this }, _clear: function() { return this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), this } }; var Circle = function(params) { this.id = params.id, this.canvas = params.canvas, this.context = params.context, this.centerX = params.centerX, this.centerY = params.centerY, this.arcWidth = params.arcWidth, this.innerRadius = params.innerRadius || 0, this.fillColor = params.fillColor || “#fff”, this.outlineColor = params.outlineColor || this.fillColor, this.progressListener = params.progressListener, this.infoLineLength = params.infoLineLength || 250, this.horizLineLength = params.horizLineLength || 50, this.infoListener = params.infoListener, this.infoLineAngle = params.infoLineAngle, this.outerRadius = this.innerRadius + this.arcWidth; if (!this.infoListener) return; var angle = this.infoLineAngle , arcDistance = (this.innerRadius + this.outerRadius) / 2 , sinA = Math.sin(angle) , cosA = Math.cos(angle); this.infoLineStartX = this.centerX + sinA * arcDistance, this.infoLineStartY = this.centerY – cosA * arcDistance, this.infoLineMidX = this.centerX + sinA * this.infoLineLength, this.infoLineMidY = this.centerY – cosA * this.infoLineLength, this.infoLineEndX = this.infoLineMidX + (sinA < 0 ? -this.horizLineLength : this.horizLineLength), this.infoLineEndY = this.infoLineMidY; var infoText = document.createElement(“div”) , style = infoText.style; style.color = this.fillColor, style.position = “absolute”, style.left = this.infoLineEndX + absPos(this.canvas)[0] + “px”, infoText.className = “ProgressCircleInfo”, infoText.id = “progress_circle_info” + this.id,
document.body.appendChild(infoText),
this.infoText = infoText
};
Circle.prototype = {
constructor: Circle,
update: function() {
this.progress = this.progressListener(),
this.draw(), this.infoListener && (this.info = this.infoListener(), this._drawInfo()) }, _draw: function() { var ctx = this.context , ANGLE_OFFSET = -Math.PI / 2 , startAngle = 0 + ANGLE_OFFSET , endAngle = startAngle + this.progress * Math.PI * 2 , x = this.centerX , y = this.centerY , innerRadius = this.innerRadius – this.arcWidth – 1 , outerRadius = this.outerRadius – this.arcWidth – 1; if (innerRadius < 0) return; return ctx.fillStyle = this.fillColor, ctx.strokeStyle = this.outlineColor, ctx.beginPath(), ctx.arc(x, y, innerRadius, startAngle, endAngle, !1), ctx.arc(x, y, outerRadius, endAngle, startAngle, !0), ctx.closePath(), ctx.stroke(), ctx.fill(), this }, _drawInfo: function() { var pointList, lineHeight; return pointList = [[this.infoLineStartX, this.infoLineStartY], [this.infoLineMidX, this.infoLineMidY], [this.infoLineEndX, this.infoLineEndY]], this._drawSegments(pointList, !1), this.infoText.innerHTML = this.info, lineHeight = this.infoText.offsetHeight, this.infoText.style.top = this.infoLineEndY + absPos(this.canvas)[1] – lineHeight / 2 + “px”, this }, _drawSegments: function(pointList, close) { var ctx = this.context; ctx.beginPath(), ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < pointList.length; ++i) ctx.lineTo(pointList[i][0], pointList[i][1]); close && ctx.closePath(), ctx.stroke() } }, window.ProgressCircle = ProgressCircle }(window, document), function($) { var VcChart = function(element, options) { this.el = element, this.$el = $(this.el); var $this = this; $this.options = $.extend({ color: “wpb_button”, units: “”, width: “”, label_selector: “.vc_pie_chart_value”, back_selector: “.vc_pie_chart_back”, responsive: !0 }, options), $this.init() }; VcChart.prototype = { constructor: VcChart, _progress_v: 0, animated: !1, colors: { wpb_button: “rgba(247, 247, 247, 1)”, “btn-primary”: “rgba(0, 136, 204, 1)”, “btn-info”: “rgba(88, 185, 218, 1)”, “btn-success”: “rgba(106, 177, 101, 1)”, “btn-warning”: “rgba(255, 153, 0, 1)”, “btn-danger”: “rgba(255, 103, 91, 1)”, “btn-inverse”: “rgba(85, 85, 85, 1)” }, init: function() { this.setupColor(), this.value = this.$el.data(“pie-value”) / 100, this.label_value = this.$el.data(“pie-label-value”) || this.$el.data(“pie-value”), this.$wrapper = $(“.vc_pie_wrapper”, this.$el), this.$label = $(this.options.label_selector, this.$el), this.$back = $(this.options.back_selector, this.$el), this.$canvas = this.$el.find(“canvas”), this.arcWidth = this.$el.data(“pie-width”) * 2, this.draw(), this.setWayPoint(), this.options.responsive === !0 && this.setResponsive(), UNCODE.isMobile && (this._progress_v = this.value) }, setupColor: function() { typeof this.options.color != “undefined” ? this.color = this.options.color : this.color = “rgba(247, 247, 247, 0.2)” }, setResponsive: function() { var that = this; UNCODE.isMobile || $(window).resize(function() { that.animated === !0 && that.circle.stop(), that.draw(!0) }) }, draw: function(redraw) { var w = this.$el.addClass(“vc_ready”).width() * 2, border_w = this.arcWidth, radius; w || (w = this.$el.parents(“:visible”).first().width() – 2), radius = w / 2, this.$wrapper.css({ width: w / 2 + “px” }), this.$label.css({ width: w / 2, height: w / 2, “line-height”: w / 2 + “px” }), this.$back.css({ width: w / 2, height: w / 2 }), this.$canvas.attr({ width: w + “px”, height: w + “px” }), this.$el.addClass(“vc_ready”), this.circle = new ProgressCircle({ canvas: this.$canvas.get(0), minRadius: radius, arcWidth: border_w }), redraw === !0 && this.animated === !0 && (this._progress_v = this.value, this.circle.addEntry({ fillColor: this.color, progressListener: $.proxy(this.setProgress, this) }).start()) }, setProgress: function() { if (this._progress_v >= this.value) return this.circle.stop(), this.animated = !0, this.$label.html(this.label_value + this.options.units), this._progress_v; this._progress_v += .01; if (!isNaN(this.label_value)) { var label_value = this._progress_v / this.value * this.label_value , val = Math.round(label_value) + this.options.units; this.$label.html(val) } else this.$label.html(this.label_value + this.options.units); return this._progress_v }, animate: function() { this.animated !== !0 && this.circle.addEntry({ fillColor: this.color, progressListener: $.proxy(this.setProgress, this) }).start(10) }, setWayPoint: function() { typeof $.fn.waypoint != “undefined” && !UNCODE.isMobile ? this.$el.waypoint($.proxy(this.animate, this), { offset: “85%” }) : this.animate() } }, $.fn.vcChat = function(option, value) { return this.each(function() { var $this = $(this) , data = $this.data(“vc_chart”) , options = typeof option == “object” ? option : { color: $this.data(“pie-color”), units: $this.data(“pie-units”) }; typeof option == “undefined” && $this.data(“vc_chart”, data = new VcChart(this,options)), typeof option == “string” && dataoption }) } , typeof window[“vc_pieChart”] != “function” && (window.vc_pieChart = function() { $(“.vc_pie_chart:visible:not(.vc_ready)”).vcChat() } ), $(document).ready(function() { !window.vc_iframe && vc_pieChart() }) }(window.jQuery), uncode_progress_bar(), function($) { “use strict”; $.fn.counterUp = function(options) { var settings = $.extend({ time: 400, delay: 10 }, options); return this.each(function() { var $this = $(this) , $settings = settings , counterUpper = function() { var nums = [] , divisions = $settings.time / $settings.delay , numReal = $this.attr(“data-val”) , num = numReal , isComma = /[0-9]+,[0-9]+/.test(num); num = num.replace(/,/g, “”); var isInt = /^[0-9]+$/.test(num) , isFloat = /^[0-9]+.[0-9]+$/.test(num) , decimalPlaces = isFloat ? (num.split(“.”)[1] || []).length : 0; for (var i = divisions; i >= 1; i–) { var newNum = parseInt(num / divisions * i); isFloat && (newNum = parseFloat(num / divisions * i).toFixed(decimalPlaces)); if (isComma) while (/(\d+)(\d{3})/.test(newNum.toString())) newNum = newNum.toString().replace(/(\d+)(\d{3})/, “$1,$2”); nums.unshift(newNum) } nums.push(numReal), $this.data(“counterup-nums”, nums), $this.text(“0”); var f = function() { $this.data(“counterup-nums”) != null && ($this.text($this.data(“counterup-nums”).shift()), $this.data(“counterup-nums”).length ? setTimeout($this.data(“counterup-func”), $settings.delay) : (delete $this.data(“counterup-nums”), $this.data(“counterup-nums”, null), $this.data(“counterup-func”, null))) }; $this.data(“counterup-func”, f), setTimeout($this.data(“counterup-func”), $settings.delay) }; new Waypoint({ element: this, handler: function() { counterUpper(), this.destroy() }, offset: “100%” }) }) } }(jQuery), function(factory) { “use strict”; typeof define == “function” && define.amd ? define([“jquery”], factory) : factory(jQuery) }(function($) { “use strict”; function parseDateString(dateString) { if (dateString instanceof Date) return dateString; if (String(dateString).match(matchers)) return String(dateString).match(/^[0-9]$/) && (dateString = Number(dateString)), String(dateString).match(/-/) && (dateString = String(dateString).replace(/-/g, “/”)), new Date(dateString); throw new Error(“Couldn’t cast " + dateString + " to a date object.”) } function strftime(offsetObject) { return function(format) { var directives = format.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi); if (directives) for (var i = 0, len = directives.length; i < len; ++i) { var directive = directives[i].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/) , regexp = new RegExp(directive[0]) , modifier = directive[1] || “” , plural = directive[3] || “” , value = null; directive = directive[2], DIRECTIVE_KEY_MAP.hasOwnProperty(directive) && (value = DIRECTIVE_KEY_MAP[directive], value = Number(offsetObject[value])), value !== null && (modifier === “!” && (value = pluralize(plural, value)), modifier === “” && value < 10 && (value = “0” + value.toString()), format = format.replace(regexp, value.toString())) } return format = format.replace(/%%/, “%”), format } } function pluralize(format, count) { var plural = “s” , singular = “”; return format && (format = format.replace(/(:|;|\s)/gi, “”).split(/\,/), format.length === 1 ? plural = format[0] : (singular = format[0], plural = format[1])), Math.abs(count) === 1 ? singular : plural } var PRECISION = 100 , instances = [] , matchers = []; matchers.push(/^[0-9]$/.source),
matchers.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),
matchers.push(/[0-9]{4}([\/-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),
matchers = new RegExp(matchers.join(“|”));
var DIRECTIVE_KEY_MAP = {
Y: “years”,
m: “months”,
w: “weeks”,
d: “days”,
D: “totalDays”,
H: “hours”,
M: “minutes”,
S: “seconds”
}
, Countdown = function(el, finalDate, callback) {
this.el = el,
this.$el = $(el),
this.interval = null,
this.offset = {},
this.instanceNumber = instances.length,
instances.push(this),
this.$el.data(“countdown-instance”, this.instanceNumber),
callback && (this.$el.on(“update.countdown”, callback),
this.$el.on(“stoped.countdown”, callback),
this.$el.on(“finish.countdown”, callback)),
this.setFinalDate(finalDate),
this.start()
};
$.extend(Countdown.prototype, {
start: function() {
this.interval !== null && clearInterval(this.interval);
var self = this;
this.update(),
this.interval = setInterval(function() {
self.update.call(self)
}, PRECISION)
},
stop: function() {
clearInterval(this.interval),
this.interval = null,
this.dispatchEvent(“stoped”)
},
pause: function() {
this.stop.call(this)
},
resume: function() {
this.start.call(this)
},
remove: function() {
this.stop(),
instances[this.instanceNumber] = null,
delete this.$el.data().countdownInstance
},
setFinalDate: function(value) {
this.finalDate = parseDateString(value)
},
update: function() {
if (this.$el.closest(“html”).length === 0) {
this.remove();
return
}
this.totalSecsLeft = this.finalDate.getTime() – (new Date).getTime(),
this.totalSecsLeft = Math.ceil(this.totalSecsLeft / 1e3),
this.totalSecsLeft = this.totalSecsLeft < 0 ? 0 : this.totalSecsLeft, this.offset = { seconds: this.totalSecsLeft % 60, minutes: Math.floor(this.totalSecsLeft / 60) % 60, hours: Math.floor(this.totalSecsLeft / 60 / 60) % 24, days: Math.floor(this.totalSecsLeft / 60 / 60 / 24) % 7, totalDays: Math.floor(this.totalSecsLeft / 60 / 60 / 24), weeks: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 7), months: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30), years: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 365) }, this.totalSecsLeft === 0 ? (this.stop(), this.dispatchEvent(“finish”)) : this.dispatchEvent(“update”) }, dispatchEvent: function(eventName) { var event = $.Event(eventName + “.countdown”); event.finalDate = this.finalDate, event.offset = $.extend({}, this.offset), event.strftime = strftime(this.offset), this.$el.trigger(event) } }), $.fn.countdown = function() { var argumentsArray = Array.prototype.slice.call(arguments, 0); return this.each(function() { var instanceNumber = $(this).data(“countdown-instance”); if (instanceNumber !== undefined) { var instance = instances[instanceNumber] , method = argumentsArray[0]; Countdown.prototype.hasOwnProperty(method) ? instance[method].apply(instance, argumentsArray.slice(1)) : String(method).match(/^[$A-Z
][0-9A-Z_$]$/i) === null ? (instance.setFinalDate.call(instance, method), instance.start()) : $.error(“Method %s does not exist on jQuery.countdown”.replace(/\%s/gi, method)) } else new Countdown(this,argumentsArray[0],argumentsArray[1]) }) } }), function(factory) { typeof define == “function” && define.amd ? define([“jquery”], factory) : typeof exports == “object” ? module.exports = factory(require(“jquery”)) : factory(jQuery) }(function($) { var eventNamespace = “waitForImages”; $.waitForImages = { hasImageProperties: [“backgroundImage”, “listStyleImage”, “borderImage”, “borderCornerImage”, “cursor”], hasImageAttributes: [“srcset”] }, $.expr[“:”].uncached = function(obj) { return $(obj).is(‘img[src][src!=””]’) ? !obj.complete : !1 } , $.fn.waitForImages = function() { var allImgsLength = 0, allImgsLoaded = 0, deferred = $.Deferred(), finishedCallback, eachCallback, waitForAll; $.isPlainObject(arguments[0]) ? (waitForAll = arguments[0].waitForAll, eachCallback = arguments[0].each, finishedCallback = arguments[0].finished) : arguments.length === 1 && $.type(arguments[0]) === “boolean” ? waitForAll = arguments[0] : (finishedCallback = arguments[0], eachCallback = arguments[1], waitForAll = arguments[2]), finishedCallback = finishedCallback || $.noop, eachCallback = eachCallback || $.noop, waitForAll = !!waitForAll; if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) throw new TypeError(“An invalid callback was supplied.”); return this.each(function() { var obj = $(this) , allImgs = [] , hasImgProperties = $.waitForImages.hasImageProperties || [] , hasImageAttributes = $.waitForImages.hasImageAttributes || [] , matchUrl = /url(\s([‘”]?)(.?)\1\s)/g;
waitForAll ? obj.find(““).addBack().each(function() { var element = $(this); element.is(“img:uncached”) && allImgs.push({ src: element.attr(“src”), element: element[0] }), $.each(hasImgProperties, function(i, property) { var propertyValue = element.css(property), match; if (!propertyValue) return !0; while (match = matchUrl.exec(propertyValue)) allImgs.push({ src: match[2], element: element[0] }) }), $.each(hasImageAttributes, function(i, attribute) { var attributeValue = element.attr(attribute), attributeValues; if (!attributeValue) return !0; attributeValues = attributeValue.split(“,”), $.each(attributeValues, function(i, value) { value = $.trim(value).split(” “)[0], allImgs.push({ src: value, element: element[0] }) }) }) }) : obj.find(“img:uncached”).each(function() { allImgs.push({ src: this.src, element: this }) }), allImgsLength = allImgs.length, allImgsLoaded = 0, allImgsLength === 0 && (finishedCallback.call(obj[0]), deferred.resolveWith(obj[0])), $.each(allImgs, function(i, img) { var image = new Image , events = “load.” + eventNamespace + ” error.” + eventNamespace; $(image).one(events, function me(event) { var eachArguments = [allImgsLoaded, allImgsLength, event.type == “load”]; allImgsLoaded++, eachCallback.apply(img.element, eachArguments), deferred.notifyWith(img.element, eachArguments), $(this).off(events, me); if (allImgsLoaded == allImgsLength) return finishedCallback.call(obj[0]), deferred.resolveWith(obj[0]), !1 }), image.src = img.src }) }), deferred.promise() } }), function($) { $.fn.textfill = function(options) { function debug() { if (!Opts.debug || typeof console == “undefined” || typeof console.debug == “undefined”) return; console.debug.apply(console, arguments) } function _warn() { if (typeof console == “undefined” || typeof console.warn == “undefined”) return; console.warn.apply(console, arguments) } function _debug_sizing(prefix, ourText, maxHeight, maxWidth, minFontPixels, maxFontPixels) { function _m(v1, v2) { var marker = ” / “; return v1 > v2 ? marker = ” > ” : v1 == v2 && (marker = ” = “), marker } _debug(“[TextFill] ” + prefix + ” { ” + “font-size: ” + ourText.css(“font-size”) + “,” + “Height: ” + ourText.height() + “px ” + _m(ourText.height(), maxHeight) + maxHeight + “px,” + “Width: ” + ourText.width() + _m(ourText.width(), maxWidth) + maxWidth + “,” + “minFontPixels: ” + minFontPixels + “px, ” + “maxFontPixels: ” + maxFontPixels + “px }”) } function _sizing(prefix, ourText, func, max, maxHeight, maxWidth, minFontPixels, maxFontPixels) { _debug_sizing(prefix, ourText, maxHeight, maxWidth, minFontPixels, maxFontPixels); while (minFontPixels < maxFontPixels – 1) { var fontSize = Math.floor((minFontPixels + maxFontPixels) / 2); ourText.css(“font-size”, fontSize); if (func.call(ourText) <= max) { minFontPixels = fontSize; if (func.call(ourText) == max) break } else maxFontPixels = fontSize; _debug_sizing(prefix, ourText, maxHeight, maxWidth, minFontPixels, maxFontPixels) } return ourText.css(“font-size”, maxFontPixels), func.call(ourText) <= max && (minFontPixels = maxFontPixels, _debug_sizing(prefix + ” “, ourText, maxHeight, maxWidth, minFontPixels, maxFontPixels)),
minFontPixels
}
var defaults = {
debug: !1,
maxFontPixels: 40,
minFontPixels: 4,
innerTag: “span”,
widthOnly: !1,
success: null,
callback: null,
fail: null,
complete: null,
explicitWidth: null,
explicitHeight: null,
changeLineHeight: !1
}
, Opts = $.extend(defaults, options);
return _debug(“[TextFill] Start Debug”),
this.each(function() {
var ourText = $(Opts.innerTag + “:visible:first”, this)
, maxHeight = Opts.explicitHeight || $(this).height()
, maxWidth = Opts.explicitWidth || $(this).width()
, oldFontSize = ourText.css(“font-size”)
, lineHeight = parseFloat(ourText.css(“line-height”)) / parseFloat(oldFontSize);
_debug(“[TextFill] Inner text: ” + ourText.text()),
_debug(“[TextFill] All options: “, Opts),
_debug(“[TextFill] Maximum sizes: { Height: ” + maxHeight + “px, ” + “Width: ” + maxWidth + “px” + ” }”);
var minFontPixels = Opts.minFontPixels
, maxFontPixels = Opts.maxFontPixels <= 0 ? maxHeight : Opts.maxFontPixels , fontSizeHeight = undefined; Opts.widthOnly || (fontSizeHeight = _sizing(“Height”, ourText, $.fn.height, maxHeight, maxHeight, maxWidth, minFontPixels, maxFontPixels)); var fontSizeWidth = undefined; fontSizeWidth = _sizing(“Width”, ourText, $.fn.width, maxWidth, maxHeight, maxWidth, minFontPixels, maxFontPixels); if (Opts.widthOnly) ourText.css({ “font-size”: fontSizeWidth, “white-space”: “nowrap” }), Opts.changeLineHeight && ourText.parent().css(“line-height”, lineHeight * fontSizeWidth + “px”); else { var fontSizeFinal = Math.min(fontSizeHeight, fontSizeWidth); ourText.css(“font-size”, fontSizeFinal), Opts.changeLineHeight && ourText.parent().css(“line-height”, lineHeight * fontSizeFinal + “px”) } _debug(“[TextFill] Finished { Old font-size: ” + oldFontSize + “, ” + “New font-size: ” + ourText.css(“font-size”) + ” }”), ourText.width() > maxWidth || ourText.height() > maxHeight && !Opts.widthOnly ? (ourText.css(“font-size”, oldFontSize),
Opts.fail && Opts.fail(this),
_debug(“[TextFill] Failure { Current Width: ” + ourText.width() + “, ” + “Maximum Width: ” + maxWidth + “, ” + “Current Height: ” + ourText.height() + “, ” + “Maximum Height: ” + maxHeight + ” }”)) : Opts.success ? Opts.success(this) : Opts.callback && (_warn(“callback is deprecated, use success, instead”),
Opts.callback(this))
}),
Opts.complete && Opts.complete(this),
_debug(“[TextFill] End Debug”),
this
}
}(window.jQuery),
!function(e) {
if (“object” == typeof exports && “undefined” != typeof module)
module.exports = e();
else if (“function” == typeof define && define.amd)
define([], e);
else {
var f;
“undefined” != typeof window ? f = window : “undefined” != typeof global ? f = global : “undefined” != typeof self && (f = self),
f.Share = e()
}
}(function() {
function getStyles(config) {}
var define, module, exports, ShareUtils;
!(“classList”in document.documentElement) && Object.defineProperty && typeof HTMLElement != “undefined” && Object.defineProperty(HTMLElement.prototype, “classList”, {
get: function() {
var ret, self, update;
return update = function(fn) {
return function(value) {
var classes, index;
classes = self.className.split(/\s+/),
index = classes.indexOf(value),
fn(classes, index, value),
self.className = classes.join(” “)
}
}
,
self = this,
ret = {
add: update(function(classes, index, value) {
~index || classes.push(value)
}),
remove: update(function(classes, index) {
~index && classes.splice(index, 1)
}),
toggle: update(function(classes, index, value) {
~index ? classes.splice(index, 1) : classes.push(value)
}),
contains: function(value) {
return !!~self.className.split(/\s+/).indexOf(value)
},
item: function(i) {
return self.className.split(/\s+/)[i] || null
}
},
Object.defineProperty(ret, “length”, {
get: function() {
return self.className.split(/\s+/).length
}
}),
ret
}
}),
String.prototype.to_rfc3986 = function() {
var tmp;
return tmp = encodeURIComponent(this),
tmp.replace(/[!'()*]/g, function(c) {
return “%” + c.charCodeAt(0).toString(16)
})
}
,
ShareUtils = function() {
function ShareUtils() {}
return ShareUtils.prototype.extend = function(to, from, overwrite) {
var hasProp, prop;
for (prop in from) {
hasProp = to[prop] !== undefined;
if (hasProp && typeof from[prop] == “object”)
this.extend(to[prop], from[prop], overwrite);
else if (overwrite || !hasProp)
to[prop] = from[prop]
}
}
,
ShareUtils.prototype.hide = function(el) {
return el.style.display = “none”
}
,
ShareUtils.prototype.show = function(el) {
return el.style.display = “block”
}
,
ShareUtils.prototype.has_class = function(el, class_name) {
return el.classList.contains(class_name)
}
,
ShareUtils.prototype.add_class = function(el, class_name) {
return el.classList.add(class_name)
}
,
ShareUtils.prototype.remove_class = function(el, class_name) {
return el.classList.remove(class_name)
}
,
ShareUtils.prototype.is_encoded = function(str) {
return str = str.to_rfc3986(),
decodeURIComponent(str) !== str
}
,
ShareUtils.prototype.encode = function(str) {
return typeof str == “undefined” || this.is_encoded(str) ? str : str.to_rfc3986()
}
,
ShareUtils.prototype.popup = function(url, params) {
var k, popup, qs, v;
return params == null && (params = {}),
popup = {
width: 500,
height: 350
},
popup.top = screen.height / 2 – popup.height / 2,
popup.left = screen.width / 2 – popup.width / 2,
qs = function() {
var _results;
_results = [];
for (k in params)
v = params[k],
_results.push(“” + k + “=” + this.encode(v));
return _results
}
.call(this).join(“&”),
qs && (qs = “?” + qs),
window.open(url + qs, “targetWindow”, “toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=” + popup.left + “,top=” + popup.top + “,width=” + popup.width + “,height=” + popup.height)
}
,
ShareUtils
}();
var Share, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) {
function ctor() {
this.constructor = child
}
for (var key in parent)
__hasProp.call(parent, key) && (child[key] = parent[key]);
return ctor.prototype = parent.prototype,
child.prototype = new ctor,
child.__super
= parent.prototype,
child
};
return Share = function(_super) {
function Share(element, options) {
return this.element = element,
this.el = {
head: document.getElementsByTagName(“head”)[0],
body: document.getElementsByTagName(“body”)[0]
},
this.config = {
enabled_networks: 0,
protocol: [“http”, “https”].indexOf(window.location.href.split(“:”)[0]) === -1 ? “https://” : “//”,
url: window.location.href.replace(“&”, “%26”),
caption: null,
title: this.default_title(),
image: this.default_image(),
description: this.default_description(),
ui: {
flyout: “top center”,
button_text: “Share”,
button_font: !0,
icon_font: !0
},
networks: {
google_plus: {
enabled: !0,
url: null
},
twitter: {
enabled: !0,
url: null,
title: null,
description: null
},
facebook: {
enabled: !0,
load_sdk: !0,
url: null,
app_id: null,
title: null,
caption: null,
description: null,
image: null
},
pinterest: {
enabled: !0,
url: null,
image: null,
description: null
},
reddit: {
enabled: !0,
url: null,
title: null
},
linkedin: {
enabled: !0,
url: null,
title: null,
description: null
},
xing: {
enabled: !0,
url: null,
title: null,
image: null,
description: null
},
whatsapp: {
enabled: !0,
description: null,
url: null
},
email: {
enabled: !0,
title: null,
description: null,
url: null
}
}
},
this.setup(element, options),
this
}
return __extends(Share, _super),
Share.prototype.setup = function(element, opts) {
var index, instance, instances, _i, _len;
instances = document.querySelectorAll(element),
this.extend(this.config, opts, !0),
this.set_global_configuration(),
this.normalize_network_configuration(),
this.config.ui.icon_font && this.inject_icons(),
this.config.ui.button_font && this.inject_fonts(),
this.config.networks.facebook.enabled && this.config.networks.facebook.load_sdk && this.inject_facebook_sdk();
for (index = _i = 0,
_len = instances.length; _i < _len; index = ++_i) instance = instances[index], this.setup_instance(element, index) } , Share.prototype.setup_instance = function(element, index) { var button, instance, label, network, networks, _i, _len, _results, _this = this; instance = document.querySelectorAll(element)[index], this.hide(instance), this.add_class(instance, “sharer-” + index), instance = document.querySelectorAll(element)[index], this.inject_css(instance), this.inject_html(instance), this.show(instance), label = instance.getElementsByTagName(“label”)[0], button = instance.getElementsByClassName(“social”)[0], networks = instance.getElementsByTagName(“li”), this.add_class(button, “networks-” + this.config.enabled_networks), label.addEventListener(“click”, function() { return _this.event_toggle(button) }), _this = this, _results = []; for (index = _i = 0, _len = networks.length; _i < _len; index = ++_i) network = networks[index], _results.push(network.addEventListener(“click”, function() { return _this.event_network(instance, this), _this.event_close(button) })); return _results } , Share.prototype.event_toggle = function(button) { return this.has_class(button, “active”) ? this.event_close(button) : this.event_open(button) } , Share.prototype.event_open = function(button) { return this.has_class(button, “load”) && this.remove_class(button, “load”), this.add_class(button, “active”) } , Share.prototype.event_close = function(button) { return this.remove_class(button, “active”) } , Share.prototype.event_network = function(instance, network) { var name; return name = network.getAttribute(“data-network”), this.hook(“before”, name, instance), this[“network
” + name](),
this.hook(“after”, name, instance)
}
,
Share.prototype.open = function() {
return this“public”
}
,
Share.prototype.close = function() {
return this“public”
}
,
Share.prototype.toggle = function() {
return this“public”
}
,
Share.prototype[“public”] = function(action) {
var button, index, instance, i, _len, _ref, _results; _ref = document.querySelectorAll(this.element), _results = []; for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) instance = _ref[index], button = instance.getElementsByClassName(“social”)[0], _results.push(this“event” + action);
return results } , Share.prototype.network_facebook = function() { return this.config.networks.facebook.load_sdk ? window.FB ? FB.ui({ method: “feed”, name: this.config.networks.facebook.title, link: this.config.networks.facebook.url, picture: this.config.networks.facebook.image, caption: this.config.networks.facebook.caption, description: this.config.networks.facebook.description }) : console.error(“The Facebook JS SDK hasn’t loaded yet.”) : this.popup(“https://www.facebook.com/sharer/sharer.php”, { u: this.config.networks.facebook.url }) } , Share.prototype.network_twitter = function() { return this.popup(“https://twitter.com/intent/tweet”, { text: this.config.networks.twitter.title, url: this.config.networks.twitter.url }) } , Share.prototype.network_google_plus = function() { return this.popup(“https://plus.google.com/share”, { url: this.config.networks.google_plus.url }) } , Share.prototype.network_pinterest = function() { return this.popup(“https://www.pinterest.com/pin/create/button”, { url: this.config.networks.pinterest.url, media: this.config.networks.pinterest.image, description: this.config.networks.pinterest.description }) } , Share.prototype.network_linkedin = function() { return this.popup(“https://www.linkedin.com/shareArticle”, { url: this.config.networks.linkedin.url, title: this.config.networks.linkedin.title, summary: this.config.networks.linkedin.description }) } , Share.prototype.network_xing = function() { return this.popup(“https://www.xing.com/spi/shares/new”, { url: this.config.networks.xing.url, image: this.config.networks.xing.image, title: this.config.networks.xing.title, summary: this.config.networks.xing.description }) } , Share.prototype.network_email = function() { return this.popup(“mailto:”, { subject: this.config.networks.email.title, body: this.config.networks.email.url + “%0A%0A” + this.config.networks.email.description }) } , Share.prototype.inject_icons = function() {} , Share.prototype.inject_fonts = function() {} , Share.prototype.inject_stylesheet = function(url) { var link; if (!this.el.head.querySelector(‘link[href=”‘ + url + ‘”]’)) return link = document.createElement(“link”), link.setAttribute(“rel”, “stylesheet”), link.setAttribute(“href”, url), this.el.head.appendChild(link) } , Share.prototype.inject_css = function(instance) { var css, meta, selector, style; selector = “.” + instance.getAttribute(“class”).split(” “).join(“.”); if (!this.el.head.querySelector(“meta[name=’sharer” + selector + “‘]”)) return this.config.selector = selector, css = getStyles(this.config), style = document.createElement(“style”), style.type = “text/css”, style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css)), this.el.head.appendChild(style), delete this.config.selector, meta = document.createElement(“meta”), meta.setAttribute(“name”, “sharer” + selector), this.el.head.appendChild(meta) } , Share.prototype.inject_html = function(instance) { return instance.innerHTML = “” + this.config.ui.button_text + “

” } , Share.prototype.inject_facebook_sdk = function() { var fb_root, script; if (!window.FB && this.config.networks.facebook.app_id && !this.el.body.querySelector(“#fb-root”)) return script = document.createElement(“script”), script.text = “window.fbAsyncInit=function(){FB.init({appId:'” + this.config.networks.facebook.app_id + “‘,status:true,xfbml:true})};(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n)){return}r=e.createElement(t);r.id=n;r.src='” + this.config.protocol + “connect.facebook.net/en_US/all.js’;i.parentNode.insertBefore(r,i)})(document,’script’,’facebook-jssdk’)”, fb_root = document.createElement(“div”), fb_root.id = “fb-root”, this.el.body.appendChild(fb_root), this.el.body.appendChild(script) } , Share.prototype.hook = function(type, network, instance) { var fn, opts; fn = this.config.networks[network][type], typeof fn == “function” && (opts = fn.call(this.config.networks[network], instance), opts !== void 0 && (opts = this.normalize_filter_config_updates(opts), this.extend(this.config.networks[network], opts, !0), this.normalize_network_configuration())) } , Share.prototype.default_title = function() { var content; if (content = document.querySelector(‘meta[property=”og:title”]’) || document.querySelector(‘meta[name=”twitter:title”]’)) return encodeURIComponent(content.getAttribute(“content”)); if (content = document.querySelector(“title”)) return encodeURIComponent(content.innerText) } , Share.prototype.default_image = function() { var content; if (content = document.querySelector(‘meta[property=”og:image”]’) || document.querySelector(‘meta[name=”twitter:image”]’)) return content.getAttribute(“content”) } , Share.prototype.default_description = function() { var content; return (content = document.querySelector(‘meta[property=”og:description”]’) || document.querySelector(‘meta[name=”twitter:description”]’) || document.querySelector(‘meta[name=”description”]’)) ? encodeURIComponent(content.getAttribute(“content”)) : “” } , Share.prototype.set_global_configuration = function() { var display, network, option, options, _ref, _results; _ref = this.config.networks, _results = []; for (network in _ref) { options = _ref[network]; for (option in options) this.config.networks[network][option] == null && (this.config.networks[network][option] = this.config[option]); this.config.networks[network].enabled ? (display = “block”, this.config.enabled_networks += 1) : display = “none”, _results.push(this.config.networks[network].display = display) } return _results } , Share.prototype.normalize_network_configuration = function() { this.config.networks.facebook.app_id || (this.config.networks.facebook.load_sdk = !1), this.is_encoded(this.config.networks.twitter.description) || (this.config.networks.twitter.description = encodeURIComponent(this.config.networks.twitter.description)); if (typeof this.config.networks.facebook.app_id == “number”) return this.config.networks.facebook.app_id = this.config.networks.facebook.app_id.toString() } , Share.prototype.normalize_filter_config_updates = function(opts) { return this.config.networks.facebook.app_id !== opts.app_id && (console.warn(“You are unable to change the Facebook app_id after the button has been initialized. Please-in-out update your Facebook filters accordingly.”), delete opts.app_id), this.config.networks.facebook.load_sdk !== opts.load_sdk && (console.warn(“You are unable to change the Facebook load_sdk option after the button has been initialized. Please-in-out update your Facebook filters accordingly.”), delete opts.app_id), opts } , Share }(ShareUtils), Share }), function() { var $, win; $ = this.jQuery || window.jQuery, win = $(window), $.fn.stick_in_parent = function(opts) { var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, outer_width, parent_selector, recalc_every, sticky_class; opts == null && (opts = {}), sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming, offset_top == null && (offset_top = 0), parent_selector == null && (parent_selector = void 0), inner_scrolling == null && (inner_scrolling = !0), sticky_class == null && (sticky_class = “is_stuck”), doc = $(document), enable_bottoming == null && (enable_bottoming = !0), outer_width = function(el) { var _el, computed, w; return window.getComputedStyle ? (_el = el[0], computed = window.getComputedStyle(el[0]), w = parseFloat(computed.getPropertyValue(“width”)) + parseFloat(computed.getPropertyValue(“margin-left”)) + parseFloat(computed.getPropertyValue(“margin-right”)), computed.getPropertyValue(“box-sizing”) !== “border-box” && (w += parseFloat(computed.getPropertyValue(“border-left-width”)) + parseFloat(computed.getPropertyValue(“border-right-width”)) + parseFloat(computed.getPropertyValue(“padding-left”)) + parseFloat(computed.getPropertyValue(“padding-right”))), w) : el.outerWidth(!0) } , fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) { var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick; if (elm.data(“sticky_kit”)) return; elm.data(“sticky_kit”, !0), last_scroll_height = doc.height(), parent = elm.parent(), parent_selector != null && (parent = parent.closest(parent_selector)); if (!parent.length) throw “failed to find stick parent”; fixed = !1, bottomed = !1, spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $(“

“), spacer && spacer.css(“position”, elm.css(“position”)), recalc = function() { var border_top, padding_top, restore; if (detached) return; last_scroll_height = doc.height(), border_top = parseInt(parent.css(“border-top-width”), 10), padding_top = parseInt(parent.css(“padding-top”), 10), padding_bottom = parseInt(parent.css(“padding-bottom”), 10), parent_top = parent.offset().top + border_top + padding_top, parent_height = parent.height(), fixed && (fixed = !1, bottomed = !1, manual_spacer == null && (elm.insertAfter(spacer), spacer.detach()), elm.css({ position: “”, top: “”, width: “”, bottom: “” }).removeClass(sticky_class), restore = !0), top = elm.offset().top – (parseInt(elm.css(“margin-top”), 10) || 0) – offset_top, height = elm.outerHeight(!0), el_float = elm.css(“float”), spacer && spacer.css({ width: outer_width(elm), height: height, display: elm.css(“display”), “vertical-align”: elm.css(“vertical-align”), “float”: el_float }); if (restore) return tick() } , recalc(); if (height === parent_height) return; return last_pos = void 0, offset = offset_top, recalc_counter = recalc_every, tick = function() { var css, delta, recalced, scroll, will_bottom, win_height; if (detached) return; recalced = !1, recalc_counter != null && (recalc_counter -= 1, recalc_counter <= 0 && (recalc_counter = recalc_every, recalc(), recalced = !0)), !recalced && doc.height() !== last_scroll_height && (recalc(), recalced = !0), scroll = win.scrollTop(), last_pos != null && (delta = scroll – last_pos), last_pos = scroll, fixed ? (enable_bottoming && (will_bottom = scroll + height + offset > parent_height + parent_top, bottomed && !will_bottom && (bottomed = !1, elm.css({ position: “fixed”, bottom: “”, top: offset }).trigger(“sticky_kit:unbottom”))), scroll < top && (fixed = !1, offset = offset_top, manual_spacer == null && ((el_float === “left” || el_float === “right”) && elm.insertAfter(spacer), spacer.detach()), css = { position: “”, width: “”, top: “” }, elm.css(css).removeClass(sticky_class).trigger(“sticky_kit:unstick”)), inner_scrolling && (win_height = win.height(), height + offset_top > win_height && (bottomed || (offset -= delta, offset = Math.max(win_height – height, offset), offset = Math.min(offset_top, offset), fixed && elm.css({ top: offset + “px” }))))) : scroll > top && (fixed = !0, css = { position: “fixed”, top: offset }, css.width = elm.css(“box-sizing”) === “border-box” ? elm.outerWidth() + “px” : elm.width() + “px”, elm.css(css).addClass(sticky_class), manual_spacer == null && (elm.after(spacer), (el_float === “left” || el_float === “right”) && spacer.append(elm)), elm.trigger(“sticky_kit:stick”)); if (fixed && enable_bottoming) { will_bottom == null && (will_bottom = scroll + height + offset > parent_height + parent_top); if (!bottomed && will_bottom) return bottomed = !0, parent.css(“position”) === “static” && parent.css({ position: “relative” }), elm.css({ position: “absolute”, bottom: padding_bottom, top: “auto” }).trigger(“sticky_kit:bottom”) } } , recalc_and_tick = function() { return recalc(), tick() } , detach = function() { detached = !0, win.off(“touchmove”, tick), win.off(“scroll”, tick), win.off(“resize”, recalc_and_tick), $(document.body).off(“sticky_kit:recalc”, recalc_and_tick), elm.off(“sticky_kit:detach”, detach), elm.removeData(“sticky_kit”), elm.css({ position: “”, bottom: “”, top: “”, width: “” }), parent.position(“position”, “”); if (fixed) return manual_spacer == null && ((el_float === “left” || el_float === “right”) && elm.insertAfter(spacer), spacer.remove()), elm.removeClass(sticky_class) } , win.on(“touchmove”, tick), win.on(“scroll”, tick), win.on(“resize”, recalc_and_tick), $(document.body).on(“sticky_kit:recalc”, recalc_and_tick), elm.on(“sticky_kit:detach”, detach), setTimeout(tick, 0) } ; for (i = 0, len = this.length; i < len; i++) elm = this[i], fn($(elm)); return this } } .call(this), BootstrapTabHistory = { options: { defaultAnchorYOffset: 0, defaultChanger: “replace”, defaultUpdateURL: !1, showTabsBasedOnAnchor: !0 } }, function() { “use strict”; function backfillHistoryState() { var newState = null; jQuery(“li.active > [data-tab-history], .panel-title.active [data-tab-history]”).each(function() { var $activeTabElement = jQuery(this) , selector = getTabSelector($activeTabElement); if (selector) { var tabGroup = getTabGroup($activeTabElement); tabGroup && (newState = createNewHistoryState(newState || history.state, tabGroup, selector)) } }), newState && history.replaceState(newState, “”, null) } function createNewHistoryState(existingState, tabGroup, selector) { var newState = jQuery.extend(!0, {}, existingState, { bootstrapTabHistory: {} }); return newState.bootstrapTabHistory[tabGroup] = selector, newState } function getTabGroup($tab) { return parseTruthyAttributeValue($tab.data(“tab-history”)) } function getTabSelector($tab) { return $tab.data(“target”) || $tab.attr(“href”) } function onShownTab(shownEvt) { if (!showingTabsBasedOnState) { var $activatedTab = jQuery(shownEvt.target); $activatedTab.hasClass(“panel-collapse”) && ($activatedTab = $activatedTab.closest(“.panel”).find(“a”)); var selector = getTabSelector($activatedTab); if (selector) { var tabGroup = getTabGroup($activatedTab); if (tabGroup) { var historyChanger = $activatedTab.data(“tab-history-changer”) || BootstrapTabHistory.options.defaultChanger , newState = createNewHistoryState(history.state, tabGroup, selector) , updateURL = function($activatedTab) { if (selector[0] === “#”) { var elementUpdateURLOption = parseTruthyAttributeValue($activatedTab.data(“tab-history-update-url”)); return elementUpdateURLOption === undefined ? BootstrapTabHistory.options.defaultUpdateURL : elementUpdateURLOption } return !1 }($activatedTab); switch (historyChanger) { case “push”: history.pushState(newState, “”, updateURL ? selector : null); break; case “replace”: history.replaceState(newState, “”, updateURL ? selector : null); break; default: throw new Error(“Unknown tab-history-changer: ” + historyChanger) } } } } } function onPopState() { var bootstrapTabHistory = history.state && history.state.bootstrapTabHistory; bootstrapTabHistory && showTabsBasedOnState(bootstrapTabHistory) } function parseTruthyAttributeValue(value) { return value ? value : value === “” ? !0 : value } function showTabsBasedOnAnchor() { if (BootstrapTabHistory.options.showTabsBasedOnAnchor) { var anchor = window.location && window.location.hash; if (anchor) { var $tabElement = showTabForSelector(anchor); if ($tabElement && window.addEventListener && window.removeEventListener) { var anchorYOffset = function($tabElement) { var elementSetting = $tabElement.data(“tab-history-anchor-y-offset”); return elementSetting === undefined ? BootstrapTabHistory.options.defaultAnchorYOffset : elementSetting }($tabElement); if (anchorYOffset || anchorYOffset === 0) { var scrollListener = function resetAnchorScroll() { window.removeEventListener(“scroll”, scrollListener), window.scrollTo(0, anchorYOffset) }; window.addEventListener(“scroll”, scrollListener) } } } } } function showTabForSelector(selector) { var $tabElement = function(selector) { var $ret = null; return jQuery(‘[data-toggle=”tab”], [data-toggle=”pill”], [data-toggle=”collapse”]’).each(function() { var $potentialTab = jQuery(this); return $potentialTab.attr(“href”) !== selector && $potentialTab.data(“target”) !== selector || !getTabGroup($potentialTab) ? null : ($ret = $potentialTab, !1) }), $ret }(selector); return $tabElement && $tabElement.trigger(“click”), $tabElement } function showTabsBasedOnState(bootstrapTabHistory) { showingTabsBasedOnState = !0; try { for (var k in bootstrapTabHistory) bootstrapTabHistory.hasOwnProperty(k) && showTabForSelector(bootstrapTabHistory[k]) } finally { showingTabsBasedOnState = !1 } } jQuery(function() { if (history && history.pushState && history.replaceState) { var bootstrapTabHistory = history.state && history.state.bootstrapTabHistory; bootstrapTabHistory ? showTabsBasedOnState(bootstrapTabHistory) : showTabsBasedOnAnchor(), backfillHistoryState(), jQuery(document).on(“shown.bs.tab show.bs.collapse”, onShownTab), jQuery(window).on(“popstate”, onPopState) } else showTabsBasedOnAnchor() }); var showingTabsBasedOnState = !1 }(), function($) { function hasScrollBar() { return $(“body”).height() > $(window).height() } var JustifiedGallery = function($gallery, settings) { this.settings = settings, this.checkSettings(), this.imgAnalyzerTimeout = null, this.entries = null, this.buildingRow = { entriesBuff: [], width: 0, height: 0, aspectRatio: 0 }, this.lastFetchedEntry = null, this.lastAnalyzedIndex = -1, this.yield = { every: 2, flushed: 0 }, this.border = settings.border >= 0 ? settings.border : settings.margins, this.maxRowHeight = this.retrieveMaxRowHeight(), this.suffixRanges = this.retrieveSuffixRanges(), this.offY = this.border, this.rows = 0, this.spinner = { phase: 0, timeSlot: 150, $el: $(‘‘), intervalId: null }, this.checkWidthIntervalId = null, this.galleryWidth = $gallery.width(), this.$gallery = $gallery }; JustifiedGallery.prototype.getSuffix = function(width, height) { var longestSide, i; longestSide = width > height ? width : height; for (i = 0; i < this.suffixRanges.length; i++) if (longestSide <= this.suffixRanges[i]) return this.settings.sizeRangeSuffixes[this.suffixRanges[i]]; return this.settings.sizeRangeSuffixes[this.suffixRanges[i – 1]] } , JustifiedGallery.prototype.removeSuffix = function(str, suffix) { return str.substring(0, str.length – suffix.length) } , JustifiedGallery.prototype.endsWith = function(str, suffix) { return str.indexOf(suffix, str.length – suffix.length) !== -1 } , JustifiedGallery.prototype.getUsedSuffix = function(str) { for (var si in this.settings.sizeRangeSuffixes) if (this.settings.sizeRangeSuffixes.hasOwnProperty(si)) { if (this.settings.sizeRangeSuffixes[si].length === 0) continue; if (this.endsWith(str, this.settings.sizeRangeSuffixes[si])) return this.settings.sizeRangeSuffixes[si] } return “” } , JustifiedGallery.prototype.newSrc = function(imageSrc, imgWidth, imgHeight, image) { var newImageSrc; if (this.settings.thumbnailPath) newImageSrc = this.settings.thumbnailPath(imageSrc, imgWidth, imgHeight, image); else { var matchRes = imageSrc.match(this.settings.extension) , ext = matchRes !== null ? matchRes[0] : “”; newImageSrc = imageSrc.replace(this.settings.extension, “”), newImageSrc = this.removeSuffix(newImageSrc, this.getUsedSuffix(newImageSrc)), newImageSrc += this.getSuffix(imgWidth, imgHeight) + ext } return newImageSrc } , JustifiedGallery.prototype.showImg = function($entry, callback) { this.settings.cssAnimation ? ($entry.addClass(“entry-visible”), callback && callback()) : ($entry.stop().fadeTo(this.settings.imagesAnimationDuration, 1, callback), $entry.find(“> img, > a > img”).stop().fadeTo(this.settings.imagesAnimationDuration, 1, callback)) } , JustifiedGallery.prototype.extractImgSrcFromImage = function($image) { var imageSrc = typeof $image.data(“safe-src”) != “undefined” ? $image.data(“safe-src”) : $image.attr(“src”); return $image.data(“jg.originalSrc”, imageSrc), imageSrc } , JustifiedGallery.prototype.imgFromEntry = function($entry) { var $img = $entry.find(“> img”); return $img.length === 0 && ($img = $entry.find(“> a > img”)), $img.length === 0 && ($img = $entry.find(“.t-entry-visual-cont img”)), $img.length === 0 ? null : $img } , JustifiedGallery.prototype.captionFromEntry = function($entry) { var $caption = $entry.find(“> .caption”); return $caption.length === 0 ? null : $caption } , JustifiedGallery.prototype.displayEntry = function($entry, x, y, imgWidth, imgHeight, rowHeight) { $entry.width(imgWidth), $entry.height(Math.floor(rowHeight)), $entry.css(“top”, Math.floor(y)), $entry.css(“left”, x); var $image = this.imgFromEntry($entry); if ($image !== null) { $image.css(“width”, imgWidth), $image.css(“height”, imgHeight), $image.css(“margin-left”, -imgWidth / 2), $image.css(“margin-top”, -imgHeight / 2); var imageSrc = $image.attr(“src”) , newImageSrc = this.newSrc(imageSrc, imgWidth, imgHeight, $image[0]); $image.one(“error”, function() { $image.attr(“src”, $image.data(“jg.originalSrc”)) }); var loadNewImage = function() { imageSrc !== newImageSrc && $image.attr(“src”, newImageSrc) }; $entry.data(“jg.loaded”) === “skipped” ? this.onImageEvent(imageSrc, $.proxy(function() { this.showImg($entry, loadNewImage), $entry.data(“jg.loaded”, !0) }, this)) : this.showImg($entry, loadNewImage) } else this.showImg($entry); this.displayEntryCaption($entry) } , JustifiedGallery.prototype.displayEntryCaption = function($entry) { var $image = this.imgFromEntry($entry); if ($image !== null && this.settings.captions) { var $imgCaption = this.captionFromEntry($entry); if ($imgCaption === null) { var caption = $image.attr(“alt”); this.isValidCaption(caption) || (caption = $entry.attr(“title”)), this.isValidCaption(caption) && ($imgCaption = $(” + caption + “”), $entry.append($imgCaption), $entry.data(“jg.createdCaption”, !0)) } $imgCaption !== null && (this.settings.cssAnimation || $imgCaption.stop().fadeTo(0, this.settings.captionSettings.nonVisibleOpacity), this.addCaptionEventsHandlers($entry)) } else this.removeCaptionEventsHandlers($entry) } , JustifiedGallery.prototype.isValidCaption = function(caption) { return typeof caption != “undefined” && caption.length > 0 } , JustifiedGallery.prototype.onEntryMouseEnterForCaption = function(eventObject) { var $caption = this.captionFromEntry($(eventObject.currentTarget)); this.settings.cssAnimation ? $caption.addClass(“caption-visible”).removeClass(“caption-hidden”) : $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, this.settings.captionSettings.visibleOpacity) } , JustifiedGallery.prototype.onEntryMouseLeaveForCaption = function(eventObject) { var $caption = this.captionFromEntry($(eventObject.currentTarget)); this.settings.cssAnimation ? $caption.removeClass(“caption-visible”).removeClass(“caption-hidden”) : $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, this.settings.captionSettings.nonVisibleOpacity) } , JustifiedGallery.prototype.addCaptionEventsHandlers = function($entry) { var captionMouseEvents = $entry.data(“jg.captionMouseEvents”); typeof captionMouseEvents == “undefined” && (captionMouseEvents = { mouseenter: $.proxy(this.onEntryMouseEnterForCaption, this), mouseleave: $.proxy(this.onEntryMouseLeaveForCaption, this) }, $entry.on(“mouseenter”, undefined, undefined, captionMouseEvents.mouseenter), $entry.on(“mouseleave”, undefined, undefined, captionMouseEvents.mouseleave), $entry.data(“jg.captionMouseEvents”, captionMouseEvents)) } , JustifiedGallery.prototype.removeCaptionEventsHandlers = function($entry) { var captionMouseEvents = $entry.data(“jg.captionMouseEvents”); typeof captionMouseEvents != “undefined” && ($entry.off(“mouseenter”, undefined, captionMouseEvents.mouseenter), $entry.off(“mouseleave”, undefined, captionMouseEvents.mouseleave), $entry.removeData(“jg.captionMouseEvents”)) } , JustifiedGallery.prototype.prepareBuildingRow = function(isLastRow) { var i, $entry, imgAspectRatio, newImgW, newImgH, justify = !0, minHeight = 0, availableWidth = this.galleryWidth – 2 * this.border – (this.buildingRow.entriesBuff.length – 1) * this.settings.margins, rowHeight = Math.floor(availableWidth / this.buildingRow.aspectRatio), defaultRowHeight = this.settings.rowHeight, justifiable = this.buildingRow.width / availableWidth > this.settings.justifyThreshold; if (isLastRow && this.settings.lastRow === “hide” && !justifiable) { for (i = 0; i < this.buildingRow.entriesBuff.length; i++) $entry = this.buildingRow.entriesBuff[i], this.settings.cssAnimation ? $entry.removeClass(“entry-visible”) : ($entry.stop().fadeTo(0, .1), $entry.find(“> img, > a > img”).fadeTo(0, 0)); return -1 } isLastRow && !justifiable && this.settings.lastRow !== “justify” && this.settings.lastRow !== “hide” && (justify = !1, this.rows > 0 && (defaultRowHeight = (this.offY – this.border – this.settings.margins * this.rows) / this.rows, justify = defaultRowHeight * this.buildingRow.aspectRatio / availableWidth > this.settings.justifyThreshold)); for (i = 0; i < this.buildingRow.entriesBuff.length; i++) { $entry = this.buildingRow.entriesBuff[i], imgAspectRatio = $entry.data(“jg.width”) / $entry.data(“jg.height”), justify ? (newImgW = i === this.buildingRow.entriesBuff.length – 1 ? availableWidth : rowHeight * imgAspectRatio, newImgH = rowHeight) : (newImgW = defaultRowHeight * imgAspectRatio, newImgH = defaultRowHeight), availableWidth -= Math.round(newImgW), $entry.data(“jg.jwidth”, Math.round(newImgW)), $entry.data(“jg.jheight”, Math.ceil(newImgH)); if (i === 0 || minHeight > newImgH) minHeight = newImgH } return this.buildingRow.height = minHeight, justify } , JustifiedGallery.prototype.clearBuildingRow = function() { this.buildingRow.entriesBuff = [], this.buildingRow.aspectRatio = 0, this.buildingRow.width = 0 } , JustifiedGallery.prototype.flushRow = function(isLastRow) { var settings = this.settings, $entry, buildingRowRes, offX = this.border, i; buildingRowRes = this.prepareBuildingRow(isLastRow); if (isLastRow && settings.lastRow === “hide” && buildingRowRes === -1) { this.clearBuildingRow(); return } this.maxRowHeight && (this.maxRowHeight.isPercentage && this.maxRowHeight.value * settings.rowHeight < this.buildingRow.height ? this.buildingRow.height = this.maxRowHeight.value * settings.rowHeight : this.maxRowHeight.value >= settings.rowHeight && this.maxRowHeight.value < this.buildingRow.height && (this.buildingRow.height = this.maxRowHeight.value)); if (settings.lastRow === “center” || settings.lastRow === “right”) { var availableWidth = this.galleryWidth – 2 * this.border – (this.buildingRow.entriesBuff.length – 1) * settings.margins; for (i = 0; i < this.buildingRow.entriesBuff.length; i++) $entry = this.buildingRow.entriesBuff[i], availableWidth -= $entry.data(“jg.jwidth”); settings.lastRow === “center” ? offX += availableWidth / 2 : settings.lastRow === “right” && (offX += availableWidth) } for (i = 0; i < this.buildingRow.entriesBuff.length; i++) $entry = this.buildingRow.entriesBuff[i], this.displayEntry($entry, offX, this.offY, $entry.data(“jg.jwidth”), $entry.data(“jg.jheight”), this.buildingRow.height), offX += $entry.data(“jg.jwidth”) + settings.margins; this.galleryHeightToSet = this.offY + this.buildingRow.height + this.border, this.$gallery.height(this.galleryHeightToSet + this.getSpinnerHeight()); if (!isLastRow || this.buildingRow.height <= settings.rowHeight && buildingRowRes) this.offY += this.buildingRow.height + settings.margins, this.rows += 1, this.clearBuildingRow(), this.$gallery.trigger(“jg.rowflush”) } ; var scrollBarOn = !1; JustifiedGallery.prototype.checkWidth = function() { this.checkWidthIntervalId = setInterval($.proxy(function() { var galleryWidth = parseFloat(this.$gallery.width()); hasScrollBar() === scrollBarOn ? Math.abs(galleryWidth – this.galleryWidth) > this.settings.refreshSensitivity && (this.galleryWidth = galleryWidth, this.rewind(), this.startImgAnalyzer(!0)) : (scrollBarOn = hasScrollBar(), this.galleryWidth = galleryWidth) }, this), this.settings.refreshTime) } , JustifiedGallery.prototype.isSpinnerActive = function() { return this.spinner.intervalId !== null } , JustifiedGallery.prototype.getSpinnerHeight = function() { return this.spinner.$el.innerHeight() } , JustifiedGallery.prototype.stopLoadingSpinnerAnimation = function() { clearInterval(this.spinner.intervalId), this.spinner.intervalId = null, this.$gallery.height(this.$gallery.height() – this.getSpinnerHeight()), this.spinner.$el.detach() } , JustifiedGallery.prototype.startLoadingSpinnerAnimation = function() { var spinnerContext = this.spinner , $spinnerPoints = spinnerContext.$el.find(“span”); clearInterval(spinnerContext.intervalId), this.$gallery.append(spinnerContext.$el), this.$gallery.height(this.offY + this.buildingRow.height + this.getSpinnerHeight()), spinnerContext.intervalId = setInterval(function() { spinnerContext.phase < $spinnerPoints.length ? $spinnerPoints.eq(spinnerContext.phase).fadeTo(spinnerContext.timeSlot, 1) : $spinnerPoints.eq(spinnerContext.phase – $spinnerPoints.length).fadeTo(spinnerContext.timeSlot, 0), spinnerContext.phase = (spinnerContext.phase + 1) % ($spinnerPoints.length * 2) }, spinnerContext.timeSlot) } , JustifiedGallery.prototype.rewind = function() { this.lastFetchedEntry = null, this.lastAnalyzedIndex = -1, this.offY = this.border, this.rows = 0, this.clearBuildingRow() } , JustifiedGallery.prototype.updateEntries = function(norewind) { var newEntries; return norewind && this.lastFetchedEntry != null ? newEntries = $(this.lastFetchedEntry).nextAll(this.settings.selector).toArray() : (this.entries = [], newEntries = this.$gallery.children(this.settings.selector).toArray()), newEntries.length > 0 && ($.isFunction(this.settings.sort) ? newEntries = this.sortArray(newEntries) : this.settings.randomize && (newEntries = this.shuffleArray(newEntries)), this.lastFetchedEntry = newEntries[newEntries.length – 1], this.settings.filter ? newEntries = this.filterArray(newEntries) : this.resetFilters(newEntries)), this.entries = this.entries.concat(newEntries), !0 } , JustifiedGallery.prototype.insertToGallery = function(entries) { var that = this; $.each(entries, function() { $(this).appendTo(that.$gallery) }) } , JustifiedGallery.prototype.shuffleArray = function(a) { var i, j, temp; for (i = a.length – 1; i > 0; i–) j = Math.floor(Math.random() * (i + 1)), temp = a[i], a[i] = a[j], a[j] = temp; return this.insertToGallery(a), a } , JustifiedGallery.prototype.sortArray = function(a) { return a.sort(this.settings.sort), this.insertToGallery(a), a } , JustifiedGallery.prototype.resetFilters = function(a) { for (var i = 0; i < a.length; i++) $(a[i]).removeClass(“jg-filtered”) } , JustifiedGallery.prototype.filterArray = function(a) { var settings = this.settings; if ($.type(settings.filter) === “string”) return a.filter(function(el) { var $el = $(el); return $el.is(settings.filter) ? ($el.removeClass(“jg-filtered”), !0) : ($el.addClass(“jg-filtered”).removeClass(“jg-visible”), !1) }); if ($.isFunction(settings.filter)) { var filteredArr = a.filter(settings.filter); for (var i = 0; i < a.length; i++) filteredArr.indexOf(a[i]) == -1 ? $(a[i]).addClass(“jg-filtered”).removeClass(“jg-visible”) : $(a[i]).removeClass(“jg-filtered”); return filteredArr } } , JustifiedGallery.prototype.destroy = function() { clearInterval(this.checkWidthIntervalId), $.each(this.entries, $.proxy(function(, entry) {
var $entry = $(entry);
$entry.css(“width”, “”),
$entry.css(“height”, “”),
$entry.css(“top”, “”),
$entry.css(“left”, “”),
$entry.data(“jg.loaded”, undefined),
$entry.removeClass(“jg-entry”);
var $img = this.imgFromEntry($entry);
$img.css(“width”, “”),
$img.css(“height”, “”),
$img.css(“margin-left”, “”),
$img.css(“margin-top”, “”),
$img.attr(“src”, $img.data(“jg.originalSrc”)),
$img.data(“jg.originalSrc”, undefined),
this.removeCaptionEventsHandlers($entry);
var $caption = this.captionFromEntry($entry);
$entry.data(“jg.createdCaption”) ? ($entry.data(“jg.createdCaption”, undefined),
$caption !== null && $caption.remove()) : $caption !== null && $caption.fadeTo(0, 1)
}, this)),
this.$gallery.css(“height”, “”),
this.$gallery.removeClass(“justified-gallery”),
this.$gallery.data(“jg.controller”, undefined)
}
,
JustifiedGallery.prototype.analyzeImages = function(isForResize) {
for (var i = this.lastAnalyzedIndex + 1; i < this.entries.length; i++) { var $entry = $(this.entries[i]); if ($entry.data(“jg.loaded”) === !0 || $entry.data(“jg.loaded”) === “skipped”) { var availableWidth = this.galleryWidth – 2 * this.border – (this.buildingRow.entriesBuff.length – 1) * this.settings.margins , imgAspectRatio = $entry.data(“jg.width”) / $entry.data(“jg.height”); if (availableWidth / (this.buildingRow.aspectRatio + imgAspectRatio) < this.settings.rowHeight) { this.flushRow(!1); if (++this.yield.flushed >= this.yield.every) {
this.startImgAnalyzer(isForResize);
return
}
}
this.buildingRow.entriesBuff.push($entry),
this.buildingRow.aspectRatio += imgAspectRatio,
this.buildingRow.width += imgAspectRatio * this.settings.rowHeight,
this.lastAnalyzedIndex = i
} else if ($entry.data(“jg.loaded”) !== “error”)
return
}
this.buildingRow.entriesBuff.length > 0 && this.flushRow(!0),
this.isSpinnerActive() && this.stopLoadingSpinnerAnimation(),
this.stopImgAnalyzerStarter(),
this.$gallery.trigger(isForResize ? “jg.resize” : “jg.complete”),
this.$gallery.height(this.galleryHeightToSet)
}
,
JustifiedGallery.prototype.stopImgAnalyzerStarter = function() {
this.yield.flushed = 0,
this.imgAnalyzerTimeout !== null && clearTimeout(this.imgAnalyzerTimeout)
}
,
JustifiedGallery.prototype.startImgAnalyzer = function(isForResize) {
var that = this;
this.stopImgAnalyzerStarter(),
this.imgAnalyzerTimeout = setTimeout(function() {
that.analyzeImages(isForResize)
}, .001)
}
,
JustifiedGallery.prototype.onImageEvent = function(imageSrc, onLoad, onError) {
if (!onLoad && !onError)
return;
var memImage = new Image
, $memImage = $(memImage);
onLoad && $memImage.one(“load”, function() {
$memImage.off(“load error”),
onLoad(memImage)
}),
onError && $memImage.one(“error”, function() {
$memImage.off(“load error”),
onError(memImage)
}),
memImage.src = imageSrc
}
,
JustifiedGallery.prototype.init = function() {
var imagesToLoad = !1
, skippedImages = !1
, that = this;
$.each(this.entries, function(index, entry) {
var $entry = $(entry)
, $image = that.imgFromEntry($entry);
$entry.addClass(“jg-entry”);
if ($entry.data(“jg.loaded”) !== !0 && $entry.data(“jg.loaded”) !== “skipped”) {
that.settings.rel !== null && $entry.attr(“rel”, that.settings.rel),
that.settings.target !== null && $entry.attr(“target”, that.settings.target);
if ($image !== null) {
var imageSrc = that.extractImgSrcFromImage($image);
$image.attr(“src”, imageSrc);
if (that.settings.waitThumbnailsLoad === !1) {
var width = parseFloat($image.attr(“width”))
, height = parseFloat($image.attr(“height”));
if (!isNaN(width) && !isNaN(height))
return $entry.data(“jg.width”, width),
$entry.data(“jg.height”, height),
$entry.data(“jg.loaded”, “skipped”),
skippedImages = !0,
that.startImgAnalyzer(!1),
!0
}
$entry.data(“jg.loaded”, !1),
imagesToLoad = !0,
that.isSpinnerActive() || that.startLoadingSpinnerAnimation(),
that.onImageEvent(imageSrc, function(loadImg) {
$entry.data(“jg.width”, loadImg.width),
$entry.data(“jg.height”, loadImg.height),
$entry.data(“jg.loaded”, !0),
that.startImgAnalyzer(!1)
}, function() {
$entry.data(“jg.loaded”, “error”),
that.startImgAnalyzer(!1)
})
} else
$entry.data(“jg.loaded”, !0),
$entry.data(“jg.width”, $entry.width() | parseFloat($entry.css(“width”)) | 1),
$entry.data(“jg.height”, $entry.height() | parseFloat($entry.css(“height”)) | 1)
}
}),
!imagesToLoad && !skippedImages && this.startImgAnalyzer(!1),
this.checkWidth()
}
,
JustifiedGallery.prototype.checkOrConvertNumber = function(settingContainer, settingName) {
$.type(settingContainer[settingName]) === “string” && (settingContainer[settingName] = parseFloat(settingContainer[settingName]));
if ($.type(settingContainer[settingName]) !== “number”)
throw settingName + ” must be a number”;
if (isNaN(settingContainer[settingName]))
throw “invalid number for ” + settingName
}
,
JustifiedGallery.prototype.checkSizeRangesSuffixes = function() {
if ($.type(this.settings.sizeRangeSuffixes) !== “object”)
throw “sizeRangeSuffixes must be defined and must be an object”;
var suffixRanges = [];
for (var rangeIdx in this.settings.sizeRangeSuffixes)
this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx) && suffixRanges.push(rangeIdx);
var newSizeRngSuffixes = {
0: “”
};
for (var i = 0; i < suffixRanges.length; i++) if ($.type(suffixRanges[i]) === “string”) try { var numIdx = parseInt(suffixRanges[i].replace(/^[a-z]+/, “”), 10); newSizeRngSuffixes[numIdx] = this.settings.sizeRangeSuffixes[suffixRanges[i]] } catch (e) { throw “sizeRangeSuffixes keys must contains correct numbers (” + e + “)” } else newSizeRngSuffixes[suffixRanges[i]] = this.settings.sizeRangeSuffixes[suffixRanges[i]]; this.settings.sizeRangeSuffixes = newSizeRngSuffixes } , JustifiedGallery.prototype.retrieveMaxRowHeight = function() { var newMaxRowHeight = {}; if ($.type(this.settings.maxRowHeight) === “string”) this.settings.maxRowHeight.match(/^[0-9]+%$/) ? (newMaxRowHeight.value = parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1]) / 100, newMaxRowHeight.isPercentage = !1) : (newMaxRowHeight.value = parseFloat(this.settings.maxRowHeight), newMaxRowHeight.isPercentage = !0); else { if ($.type(this.settings.maxRowHeight) !== “number”) { if (this.settings.maxRowHeight === !1 || this.settings.maxRowHeight === null || typeof this.settings.maxRowHeight == “undefined”) return null; throw “maxRowHeight must be a number or a percentage” } newMaxRowHeight.value = this.settings.maxRowHeight, newMaxRowHeight.isPercentage = !1 } if (isNaN(newMaxRowHeight.value)) throw “invalid number for maxRowHeight”; return newMaxRowHeight.isPercentage && newMaxRowHeight.value < 100 && (newMaxRowHeight.value = 100), newMaxRowHeight } , JustifiedGallery.prototype.checkSettings = function() { this.checkSizeRangesSuffixes(), this.checkOrConvertNumber(this.settings, “rowHeight”), this.checkOrConvertNumber(this.settings, “margins”), this.checkOrConvertNumber(this.settings, “border”); var lastRowModes = [“justify”, “nojustify”, “left”, “center”, “right”, “hide”]; if (lastRowModes.indexOf(this.settings.lastRow) === -1) throw “lastRow must be one of: ” + lastRowModes.join(“, “); this.checkOrConvertNumber(this.settings, “justifyThreshold”); if (this.settings.justifyThreshold < 0 || this.settings.justifyThreshold > 1)
throw “justifyThreshold must be in the interval [0,1]”;
if ($.type(this.settings.cssAnimation) !== “boolean”)
throw “cssAnimation must be a boolean”;
if ($.type(this.settings.captions) !== “boolean”)
throw “captions must be a boolean”;
this.checkOrConvertNumber(this.settings.captionSettings, “animationDuration”),
this.checkOrConvertNumber(this.settings.captionSettings, “visibleOpacity”);
if (this.settings.captionSettings.visibleOpacity < 0 || this.settings.captionSettings.visibleOpacity > 1)
throw “captionSettings.visibleOpacity must be in the interval [0, 1]”;
this.checkOrConvertNumber(this.settings.captionSettings, “nonVisibleOpacity”);
if (this.settings.captionSettings.nonVisibleOpacity < 0 || this.settings.captionSettings.nonVisibleOpacity > 1)
throw “captionSettings.nonVisibleOpacity must be in the interval [0, 1]”;
this.checkOrConvertNumber(this.settings, “imagesAnimationDuration”),
this.checkOrConvertNumber(this.settings, “refreshTime”),
this.checkOrConvertNumber(this.settings, “refreshSensitivity”);
if ($.type(this.settings.randomize) !== “boolean”)
throw “randomize must be a boolean”;
if ($.type(this.settings.selector) !== “string”)
throw “selector must be a string”;
if (this.settings.sort !== !1 && !$.isFunction(this.settings.sort))
throw “sort must be false or a comparison function”;
if (this.settings.filter !== !1 && !$.isFunction(this.settings.filter) && $.type(this.settings.filter) !== “string”)
throw “filter must be false, a string or a filter function”
}
,
JustifiedGallery.prototype.retrieveSuffixRanges = function() {
var suffixRanges = [];
for (var rangeIdx in this.settings.sizeRangeSuffixes)
this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx) && suffixRanges.push(parseInt(rangeIdx, 10));
return suffixRanges.sort(function(a, b) {
return a > b ? 1 : a < b ? -1 : 0 }), suffixRanges } , JustifiedGallery.prototype.updateSettings = function(newSettings) { this.settings = $.extend({}, this.settings, newSettings), this.checkSettings(), this.border = this.settings.border >= 0 ? this.settings.border : this.settings.margins,
this.maxRowHeight = this.retrieveMaxRowHeight(),
this.suffixRanges = this.retrieveSuffixRanges()
}
,
$.fn.justifiedGallery = function(arg) {
return this.each(function(index, gallery) {
var $gallery = $(gallery);
$gallery.addClass(“justified-gallery”);
var controller = $gallery.data(“jg.controller”);
if (typeof controller == “undefined”) {
if (typeof arg != “undefined” && arg !== null && $.type(arg) !== “object”) {
if (arg === “destroy”)
return;
throw “The argument must be an object”
}
controller = new JustifiedGallery($gallery,$.extend({}, $.fn.justifiedGallery.defaults, arg)),
$gallery.data(“jg.controller”, controller)
} else if (arg !== “norewind”) {
if (arg === “destroy”) {
controller.destroy();
return
}
controller.updateSettings(arg),
controller.rewind()
}
if (!controller.updateEntries(arg === “norewind”))
return;
controller.init()
})
}
,
$.fn.justifiedGallery.defaults = {
sizeRangeSuffixes: {},
thumbnailPath: undefined,
rowHeight: 120,
maxRowHeight: !1,
margins: 1,
border: -1,
lastRow: “nojustify”,
justifyThreshold: .9,
waitThumbnailsLoad: !0,
captions: !0,
cssAnimation: !0,
imagesAnimationDuration: 500,
captionSettings: {
animationDuration: 500,
visibleOpacity: .7,
nonVisibleOpacity: 0
},
rel: null,
target: null,
extension: /.[^.\/]+$/,
refreshTime: 200,
refreshSensitivity: 0,
randomize: !1,
sort: !1,
filter: !1,
selector: “a, div:not(.spinner)”
}
}(jQuery),
function(window, document, Math) {
function IScroll(el, options) {
this.wrapper = typeof el == “string” ? document.querySelector(el) : el,
this.scroller = this.wrapper.children[0],
this.scrollerStyle = this.scroller.style,
this.options = {
resizeScrollbars: !0,
mouseWheelSpeed: 20,
snapThreshold: .334,
disablePointer: !utils.hasPointer,
disableTouch: utils.hasPointer || !utils.hasTouch,
disableMouse: utils.hasPointer || utils.hasTouch,
startX: 0,
startY: 0,
scrollY: !0,
directionLockThreshold: 5,
momentum: !0,
bounce: !0,
bounceTime: 600,
bounceEasing: “”,
preventDefault: !0,
preventDefaultException: {
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|LABEL)$/
},
HWCompositing: !0,
useTransition: !0,
useTransform: !0,
bindToWrapper: typeof window.onmousedown == “undefined”
};
for (var i in options)
this.options[i] = options[i];
this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ” translateZ(0)” : “”,
this.options.useTransition = utils.hasTransition && this.options.useTransition,
this.options.useTransform = utils.hasTransform && this.options.useTransform,
this.options.eventPassthrough = this.options.eventPassthrough === !0 ? “vertical” : this.options.eventPassthrough,
this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault,
this.options.scrollY = this.options.eventPassthrough == “vertical” ? !1 : this.options.scrollY,
this.options.scrollX = this.options.eventPassthrough == “horizontal” ? !1 : this.options.scrollX,
this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough,
this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold,
this.options.bounceEasing = typeof this.options.bounceEasing == “string” ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing,
this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling,
this.options.tap === !0 && (this.options.tap = “tap”),
!this.options.useTransition && !this.options.useTransform && (/relative|absolute/i.test(this.scrollerStyle.position) || (this.scrollerStyle.position = “relative”)),
this.options.shrinkScrollbars == “scale” && (this.options.useTransition = !1),
this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1,
this.x = 0,
this.y = 0,
this.directionX = 0,
this.directionY = 0,
this.events = {}, this._init(), this.refresh(), this.scrollTo(this.options.startX, this.options.startY), this.enable() } function createDefaultScrollbar(direction, interactive, type) { var scrollbar = document.createElement(“div”) , indicator = document.createElement(“div”); return type === !0 && (scrollbar.style.cssText = “position:absolute;z-index:9999”, indicator.style.cssText = “-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px”), indicator.className = “iScrollIndicator”, direction == “h” ? (type === !0 && (scrollbar.style.cssText += “;height:7px;left:2px;right:2px;bottom:0”, indicator.style.height = “100%”), scrollbar.className = “iScrollHorizontalScrollbar”) : (type === !0 && (scrollbar.style.cssText += “;width:7px;bottom:2px;top:2px;right:1px”, indicator.style.width = “100%”), scrollbar.className = “iScrollVerticalScrollbar”), scrollbar.style.cssText += “;overflow:hidden”, interactive || (scrollbar.style.pointerEvents = “none”), scrollbar.appendChild(indicator), scrollbar } function Indicator(scroller, options) { this.wrapper = typeof options.el == “string” ? document.querySelector(options.el) : options.el, this.wrapperStyle = this.wrapper.style, this.indicator = this.wrapper.children[0], this.indicatorStyle = this.indicator.style, this.scroller = scroller, this.options = { listenX: !0, listenY: !0, interactive: !1, resize: !0, defaultScrollbars: !1, shrink: !1, fade: !1, speedRatioX: 0, speedRatioY: 0 }; for (var i in options) this.options[i] = options[i]; this.sizeRatioX = 1, this.sizeRatioY = 1, this.maxPosX = 0, this.maxPosY = 0, this.options.interactive && (this.options.disableTouch || (utils.addEvent(this.indicator, “touchstart”, this), utils.addEvent(window, “touchend”, this)), this.options.disablePointer || (utils.addEvent(this.indicator, utils.prefixPointerEvent(“pointerdown”), this), utils.addEvent(window, utils.prefixPointerEvent(“pointerup”), this)), this.options.disableMouse || (utils.addEvent(this.indicator, “mousedown”, this), utils.addEvent(window, “mouseup”, this))); if (this.options.fade) { this.wrapperStyle[utils.style.transform] = this.scroller.translateZ; var durationProp = utils.style.transitionDuration; if (!durationProp) return; this.wrapperStyle[durationProp] = utils.isBadAndroid ? “0.0001ms” : “0ms”; var self = this; utils.isBadAndroid && rAF(function() { self.wrapperStyle[durationProp] === “0.0001ms” && (self.wrapperStyle[durationProp] = “0s”) }), this.wrapperStyle.opacity = “0” } } var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1e3 / 60) } , utils = function() { function _prefixStyle(style) { return _vendor === !1 ? !1 : _vendor === “” ? style : _vendor + style.charAt(0).toUpperCase() + style.substr(1) } var me = {} , _elementStyle = document.createElement(“div”).style , _vendor = function() { var vendors = [“t”, “webkitT”, “MozT”, “msT”, “OT”], transform, i = 0, l = vendors.length; for (; i < l; i++) { transform = vendors[i] + “ransform”; if (transform in _elementStyle) return vendors[i].substr(0, vendors[i].length – 1) } return !1 }(); me.getTime = Date.now || function getTime() { return (new Date).getTime() } , me.extend = function(target, obj) { for (var i in obj) target[i] = obj[i] } , me.addEvent = function(el, type, fn, capture) { el.addEventListener(type, fn, !!capture) } , me.removeEvent = function(el, type, fn, capture) { el.removeEventListener(type, fn, !!capture) } , me.prefixPointerEvent = function(pointerEvent) { return window.MSPointerEvent ? “MSPointer” + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8) : pointerEvent } , me.momentum = function(current, start, time, lowerMargin, wrapperSize, deceleration) { var distance = current – start, speed = Math.abs(distance) / time, destination, duration; return deceleration = deceleration === undefined ? 6e-4 : deceleration, destination = current + speed * speed / (2 * deceleration) * (distance < 0 ? -1 : 1), duration = speed / deceleration, destination < lowerMargin ? (destination = wrapperSize ? lowerMargin – wrapperSize / 2.5 * (speed / 8) : lowerMargin, distance = Math.abs(destination – current), duration = distance / speed) : destination > 0 && (destination = wrapperSize ? wrapperSize / 2.5 * (speed / 8) : 0, distance = Math.abs(current) + destination, duration = distance / speed), { destination: Math.round(destination), duration: duration } } ; var _transform = _prefixStyle(“transform”); return me.extend(me, { hasTransform: _transform !== !1, hasPerspective: _prefixStyle(“perspective”)in _elementStyle, hasTouch: “ontouchstart”in window, hasPointer: !!window.PointerEvent || !!window.MSPointerEvent, hasTransition: _prefixStyle(“transition”)in _elementStyle }), me.isBadAndroid = function() { var appVersion = window.navigator.appVersion; if (/Android/.test(appVersion) && !/Chrome\/\d/.test(appVersion)) { var safariVersion = appVersion.match(/Safari\/(\d+.\d)/); return safariVersion && typeof safariVersion == “object” && safariVersion.length >= 2 ? parseFloat(safariVersion[1]) < 535.19 : !0 } return !1 }(), me.extend(me.style = {}, { transform: _transform, transitionTimingFunction: _prefixStyle(“transitionTimingFunction”), transitionDuration: _prefixStyle(“transitionDuration”), transitionDelay: _prefixStyle(“transitionDelay”), transformOrigin: _prefixStyle(“transformOrigin”) }), me.hasClass = function(e, c) { var re = new RegExp(“(^|\s)” + c + “(\s|$)”); return re.test(e.className) } , me.addClass = function(e, c) { if (me.hasClass(e, c)) return; var newclass = e.className.split(” “); newclass.push(c), e.className = newclass.join(” “) } , me.removeClass = function(e, c) { if (!me.hasClass(e, c)) return; var re = new RegExp(“(^|\s)” + c + “(\s|$)”,”g”); e.className = e.className.replace(re, ” “) } , me.offset = function(el) { var left = -el.offsetLeft , top = -el.offsetTop; while (el = el.offsetParent) left -= el.offsetLeft, top -= el.offsetTop; return { left: left, top: top } } , me.preventDefaultException = function(el, exceptions) { for (var i in exceptions) if (exceptions[i].test(el[i])) return !0; return !1 } , me.extend(me.eventType = {}, { touchstart: 1, touchmove: 1, touchend: 1, mousedown: 2, mousemove: 2, mouseup: 2, pointerdown: 3, pointermove: 3, pointerup: 3, MSPointerDown: 3, MSPointerMove: 3, MSPointerUp: 3 }), me.extend(me.ease = {}, { quadratic: { style: “cubic-bezier(0.25, 0.46, 0.45, 0.94)”, fn: function(k) { return k * (2 – k) } }, circular: { style: “cubic-bezier(0.1, 0.57, 0.1, 1)”, fn: function(k) { return Math.sqrt(1 – –k * k) } }, back: { style: “cubic-bezier(0.175, 0.885, 0.32, 1.275)”, fn: function(k) { var b = 4; return (k -= 1) * k * ((b + 1) * k + b) + 1 } }, bounce: { style: “”, fn: function(k) { return (k /= 1) < 1 / 2.75 ? 7.5625 * k * k : k < 2 / 2.75 ? 7.5625 * (k -= 1.5 / 2.75) * k + .75 : k < 2.5 / 2.75 ? 7.5625 * (k -= 2.25 / 2.75) * k + .9375 : 7.5625 * (k -= 2.625 / 2.75) * k + .984375 } }, elastic: { style: “”, fn: function(k) { var f = .22 , e = .4; return k === 0 ? 0 : k == 1 ? 1 : e * Math.pow(2, -10 * k) * Math.sin((k – f / 4) * 2 * Math.PI / f) + 1 } } }), me.tap = function(e, eventName) { var ev = document.createEvent(“Event”); ev.initEvent(eventName, !0, !0), ev.pageX = e.pageX, ev.pageY = e.pageY, e.target.dispatchEvent(ev) } , me.click = function(e) { var target = e.target, ev; /(SELECT|INPUT|TEXTAREA)/i.test(target.tagName) || (ev = document.createEvent(window.MouseEvent ? “MouseEvents” : “Event”), ev.initEvent(“click”, !0, !0), ev.view = e.view || window, ev.detail = 1, ev.screenX = target.screenX || 0, ev.screenY = target.screenY || 0, ev.clientX = target.clientX || 0, ev.clientY = target.clientY || 0, ev.ctrlKey = !!e.ctrlKey, ev.altKey = !!e.altKey, ev.shiftKey = !!e.shiftKey, ev.metaKey = !!e.metaKey, ev.button = 0, ev.relatedTarget = null, ev._constructed = !0, target.dispatchEvent(ev)) } , me }(); IScroll.prototype = { version: “5.2.0”, _init: function() { this._initEvents(), (this.options.scrollbars || this.options.indicators) && this._initIndicators(), this.options.mouseWheel && this._initWheel(), this.options.snap && this._initSnap(), this.options.keyBindings && this._initKeys() }, destroy: function() { this._initEvents(!0), clearTimeout(this.resizeTimeout), this.resizeTimeout = null, this._execEvent(“destroy”) }, _transitionEnd: function(e) { if (e.target != this.scroller || !this.isInTransition) return; this._transitionTime(), this.resetPosition(this.options.bounceTime) || (this.isInTransition = !1, this._execEvent(“scrollEnd”)) }, _start: function(e) { if (utils.eventType[e.type] != 1) { var button; e.which ? button = e.button : button = e.button < 2 ? 0 : e.button == 4 ? 1 : 2; if (button !== 0) return } if (!this.enabled || this.initiated && utils.eventType[e.type] !== this.initiated) return; this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault(); var point = e.touches ? e.touches[0] : e, pos; this.initiated = utils.eventType[e.type], this.moved = !1, this.distX = 0, this.distY = 0, this.directionX = 0, this.directionY = 0, this.directionLocked = 0, this.startTime = utils.getTime(), this.options.useTransition && this.isInTransition ? (this._transitionTime(), this.isInTransition = !1, pos = this.getComputedPosition(), this._translate(Math.round(pos.x), Math.round(pos.y)), this._execEvent(“scrollEnd”)) : !this.options.useTransition && this.isAnimating && (this.isAnimating = !1, this._execEvent(“scrollEnd”)), this.startX = this.x, this.startY = this.y, this.absStartX = this.x, this.absStartY = this.y, this.pointX = point.pageX, this.pointY = point.pageY, this._execEvent(“beforeScrollStart”) }, _move: function(e) { if (!this.enabled || utils.eventType[e.type] !== this.initiated) return; this.options.preventDefault && e.preventDefault(); var point = e.touches ? e.touches[0] : e, deltaX = point.pageX – this.pointX, deltaY = point.pageY – this.pointY, timestamp = utils.getTime(), newX, newY, absDistX, absDistY; this.pointX = point.pageX, this.pointY = point.pageY, this.distX += deltaX, this.distY += deltaY, absDistX = Math.abs(this.distX), absDistY = Math.abs(this.distY); if (timestamp – this.endTime > 300 && absDistX < 10 && absDistY < 10) return; !this.directionLocked && !this.options.freeScroll && (absDistX > absDistY + this.options.directionLockThreshold ? this.directionLocked = “h” : absDistY >= absDistX + this.options.directionLockThreshold ? this.directionLocked = “v” : this.directionLocked = “n”); if (this.directionLocked == “h”) { if (this.options.eventPassthrough == “vertical”) e.preventDefault(); else if (this.options.eventPassthrough == “horizontal”) { this.initiated = !1; return } deltaY = 0 } else if (this.directionLocked == “v”) { if (this.options.eventPassthrough == “horizontal”) e.preventDefault(); else if (this.options.eventPassthrough == “vertical”) { this.initiated = !1; return } deltaX = 0 } deltaX = this.hasHorizontalScroll ? deltaX : 0, deltaY = this.hasVerticalScroll ? deltaY : 0, newX = this.x + deltaX, newY = this.y + deltaY; if (newX > 0 || newX < this.maxScrollX) newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX; if (newY > 0 || newY < this.maxScrollY) newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY; this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0, this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0, this.moved || this._execEvent(“scrollStart”), this.moved = !0, this._translate(newX, newY), timestamp – this.startTime > 300 && (this.startTime = timestamp, this.startX = this.x, this.startY = this.y) }, _end: function(e) { if (!this.enabled || utils.eventType[e.type] !== this.initiated) return; this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault(); var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, duration = utils.getTime() – this.startTime, newX = Math.round(this.x), newY = Math.round(this.y), distanceX = Math.abs(newX – this.startX), distanceY = Math.abs(newY – this.startY), time = 0, easing = “”; this.isInTransition = 0, this.initiated = 0, this.endTime = utils.getTime(); if (this.resetPosition(this.options.bounceTime)) return; this.scrollTo(newX, newY); if (!this.moved) { this.options.tap && utils.tap(e, this.options.tap), this.options.click && utils.click(e), this._execEvent(“scrollCancel”); return } if (this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100) { this._execEvent(“flick”); return } this.options.momentum && duration < 300 && (momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 }, momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 }, newX = momentumX.destination, newY = momentumY.destination, time = Math.max(momentumX.duration, momentumY.duration), this.isInTransition = 1); if (this.options.snap) { var snap = this._nearestSnap(newX, newY); this.currentPage = snap, time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(newX – snap.x), 1e3), Math.min(Math.abs(newY – snap.y), 1e3)), 300), newX = snap.x, newY = snap.y, this.directionX = 0, this.directionY = 0, easing = this.options.bounceEasing } if (newX != this.x || newY != this.y) { if (newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY) easing = utils.ease.quadratic; this.scrollTo(newX, newY, time, easing); return } this._execEvent(“scrollEnd”) }, _resize: function() { var that = this; clearTimeout(this.resizeTimeout), this.resizeTimeout = setTimeout(function() { that.refresh() }, this.options.resizePolling) }, resetPosition: function(time) { var x = this.x , y = this.y; return time = time || 0, !this.hasHorizontalScroll || this.x > 0 ? x = 0 : this.x < this.maxScrollX && (x = this.maxScrollX), !this.hasVerticalScroll || this.y > 0 ? y = 0 : this.y < this.maxScrollY && (y = this.maxScrollY), x == this.x && y == this.y ? !1 : (this.scrollTo(x, y, time, this.options.bounceEasing), !0) }, disable: function() { this.enabled = !1 }, enable: function() { this.enabled = !0 }, refresh: function() { var rf = this.wrapper.offsetHeight; this.wrapperWidth = this.wrapper.clientWidth, this.wrapperHeight = this.wrapper.clientHeight, this.scrollerWidth = this.scroller.offsetWidth, this.scrollerHeight = this.scroller.offsetHeight, this.maxScrollX = this.wrapperWidth – this.scrollerWidth, this.maxScrollY = this.wrapperHeight – this.scrollerHeight, this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0, this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0, this.hasHorizontalScroll || (this.maxScrollX = 0, this.scrollerWidth = this.wrapperWidth), this.hasVerticalScroll || (this.maxScrollY = 0, this.scrollerHeight = this.wrapperHeight), this.endTime = 0, this.directionX = 0, this.directionY = 0, this.wrapperOffset = utils.offset(this.wrapper), this._execEvent(“refresh”), this.resetPosition() }, on: function(type, fn) { this._events[type] || (this._events[type] = []), this._events[type].push(fn) }, off: function(type, fn) { if (!this._events[type]) return; var index = this._events[type].indexOf(fn); index > -1 && this._events[type].splice(index, 1) }, _execEvent: function(type) { if (!this._events[type]) return; var i = 0 , l = this._events[type].length; if (!l) return; for (; i < l; i++) this._events[type][i].apply(this, [].slice.call(arguments, 1)) }, scrollBy: function(x, y, time, easing) { x = this.x + x, y = this.y + y, time = time || 0, this.scrollTo(x, y, time, easing) }, scrollTo: function(x, y, time, easing) { easing = easing || utils.ease.circular, this.isInTransition = this.options.useTransition && time > 0; var transitionType = this.options.useTransition && easing.style; !time || transitionType ? (transitionType && (this._transitionTimingFunction(easing.style), this._transitionTime(time)), this._translate(x, y)) : this._animate(x, y, time, easing.fn) }, scrollToElement: function(el, time, offsetX, offsetY, easing) { el = el.nodeType ? el : this.scroller.querySelector(el); if (!el) return; var pos = utils.offset(el); pos.left -= this.wrapperOffset.left, pos.top -= this.wrapperOffset.top, offsetX === !0 && (offsetX = Math.round(el.offsetWidth / 2 – this.wrapper.offsetWidth / 2)), offsetY === !0 && (offsetY = Math.round(el.offsetHeight / 2 – this.wrapper.offsetHeight / 2)), pos.left -= offsetX || 0, pos.top -= offsetY || 0, pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left, pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top, time = time === undefined || time === null || time === “auto” ? Math.max(Math.abs(this.x – pos.left), Math.abs(this.y – pos.top)) : time, this.scrollTo(pos.left, pos.top, time, easing) }, _transitionTime: function(time) { if (!this.options.useTransition) return; time = time || 0; var durationProp = utils.style.transitionDuration; if (!durationProp) return; this.scrollerStyle[durationProp] = time + “ms”; if (!time && utils.isBadAndroid) { this.scrollerStyle[durationProp] = “0.0001ms”; var self = this; rAF(function() { self.scrollerStyle[durationProp] === “0.0001ms” && (self.scrollerStyle[durationProp] = “0s”) }) } if (this.indicators) for (var i = this.indicators.length; i–; ) this.indicators[i].transitionTime(time) }, _transitionTimingFunction: function(easing) { this.scrollerStyle[utils.style.transitionTimingFunction] = easing; if (this.indicators) for (var i = this.indicators.length; i–; ) this.indicators[i].transitionTimingFunction(easing) }, _translate: function(x, y) { if ((” ” + this.wrapper.className + ” “).replace(/[\n\t]/g, ” “).indexOf(” no-scrolloverflow “) > -1) return !1; this.options.useTransform ? this.scrollerStyle[utils.style.transform] = “translate(” + x + “px,” + y + “px)” + this.translateZ : (x = Math.round(x), y = Math.round(y), this.scrollerStyle.left = x + “px”, this.scrollerStyle.top = y + “px”), this.x = x, this.y = y; if (this.indicators) for (var i = this.indicators.length; i–; ) this.indicators[i].updatePosition(); var uncodevent = new CustomEvent(“fp-slide-scroll”); window.dispatchEvent(uncodevent) }, _initEvents: function(remove) { var eventType = remove ? utils.removeEvent : utils.addEvent , target = this.options.bindToWrapper ? this.wrapper : window; eventType(window, “orientationchange”, this), eventType(window, “resize”, this), this.options.click && eventType(this.wrapper, “click”, this, !0), this.options.disableMouse || (eventType(this.wrapper, “mousedown”, this), eventType(target, “mousemove”, this), eventType(target, “mousecancel”, this), eventType(target, “mouseup”, this)), utils.hasPointer && !this.options.disablePointer && (eventType(this.wrapper, utils.prefixPointerEvent(“pointerdown”), this), eventType(target, utils.prefixPointerEvent(“pointermove”), this), eventType(target, utils.prefixPointerEvent(“pointercancel”), this), eventType(target, utils.prefixPointerEvent(“pointerup”), this)), utils.hasTouch && !this.options.disableTouch && (eventType(this.wrapper, “touchstart”, this), eventType(target, “touchmove”, this), eventType(target, “touchcancel”, this), eventType(target, “touchend”, this)), eventType(this.scroller, “transitionend”, this), eventType(this.scroller, “webkitTransitionEnd”, this), eventType(this.scroller, “oTransitionEnd”, this), eventType(this.scroller, “MSTransitionEnd”, this) }, getComputedPosition: function() { var matrix = window.getComputedStyle(this.scroller, null), x, y; return this.options.useTransform ? (matrix = matrix[utils.style.transform].split(“)”)[0].split(“, “), x = +(matrix[12] || matrix[4]), y = +(matrix[13] || matrix[5])) : (x = +matrix.left.replace(/[^-\d.]/g, “”), y = +matrix.top.replace(/[^-\d.]/g, “”)), { x: x, y: y } }, _initIndicators: function() { function _indicatorsMap(fn) { if (that.indicators) for (var i = that.indicators.length; i–; ) fn.call(that.indicators[i]) } var interactive = this.options.interactiveScrollbars, customStyle = typeof this.options.scrollbars != “string”, indicators = [], indicator, that = this; this.indicators = [], this.options.scrollbars && (this.options.scrollY && (indicator = { el: createDefaultScrollbar(“v”, interactive, this.options.scrollbars), interactive: interactive, defaultScrollbars: !0, customStyle: customStyle, resize: this.options.resizeScrollbars, shrink: this.options.shrinkScrollbars, fade: this.options.fadeScrollbars, listenX: !1 }, this.wrapper.appendChild(indicator.el), indicators.push(indicator)), this.options.scrollX && (indicator = { el: createDefaultScrollbar(“h”, interactive, this.options.scrollbars), interactive: interactive, defaultScrollbars: !0, customStyle: customStyle, resize: this.options.resizeScrollbars, shrink: this.options.shrinkScrollbars, fade: this.options.fadeScrollbars, listenY: !1 }, this.wrapper.appendChild(indicator.el), indicators.push(indicator))), this.options.indicators && (indicators = indicators.concat(this.options.indicators)); for (var i = indicators.length; i–; ) this.indicators.push(new Indicator(this,indicators[i])); this.options.fadeScrollbars && (this.on(“scrollEnd”, function() { _indicatorsMap(function() { this.fade() }) }), this.on(“scrollCancel”, function() { _indicatorsMap(function() { this.fade() }) }), this.on(“scrollStart”, function() { _indicatorsMap(function() { this.fade(1) }) }), this.on(“beforeScrollStart”, function() { _indicatorsMap(function() { this.fade(1, !0) }) })), this.on(“refresh”, function() { _indicatorsMap(function() { this.refresh() }) }), this.on(“destroy”, function() { _indicatorsMap(function() { this.destroy() }), delete this.indicators }) }, _initWheel: function() { utils.addEvent(this.wrapper, “wheel”, this), utils.addEvent(this.wrapper, “mousewheel”, this), utils.addEvent(this.wrapper, “DOMMouseScroll”, this), this.on(“destroy”, function() { clearTimeout(this.wheelTimeout), this.wheelTimeout = null, utils.removeEvent(this.wrapper, “wheel”, this), utils.removeEvent(this.wrapper, “mousewheel”, this), utils.removeEvent(this.wrapper, “DOMMouseScroll”, this) }) }, _wheel: function(e) { if (!this.enabled) return; var wheelDeltaX, wheelDeltaY, newX, newY, that = this; this.wheelTimeout === undefined && that._execEvent(“scrollStart”), clearTimeout(this.wheelTimeout), this.wheelTimeout = setTimeout(function() { that.options.snap || that._execEvent(“scrollEnd”), that.wheelTimeout = undefined }, 400); if (“deltaX”in e) e.deltaMode === 1 ? (wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed, wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed) : (wheelDeltaX = -e.deltaX, wheelDeltaY = -e.deltaY); else if (“wheelDeltaX”in e) wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed, wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed; else if (“wheelDelta”in e) wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed; else { if (!(“detail”in e)) return; wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed } wheelDeltaX *= this.options.invertWheelDirection, wheelDeltaY *= this.options.invertWheelDirection, this.hasVerticalScroll || (wheelDeltaX = wheelDeltaY, wheelDeltaY = 0); if (this.options.snap) { newX = this.currentPage.pageX, newY = this.currentPage.pageY, wheelDeltaX > 0 ? newX– : wheelDeltaX < 0 && newX++, wheelDeltaY > 0 ? newY– : wheelDeltaY < 0 && newY++, this.goToPage(newX, newY); return } newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0), newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0), this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0, this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0, newX > 0 ? newX = 0 : newX < this.maxScrollX && (newX = this.maxScrollX), newY > 0 ? newY = 0 : newY < this.maxScrollY && (newY = this.maxScrollY), this.scrollTo(newX, newY, 0) }, _initSnap: function() { this.currentPage = {}, typeof this.options.snap == “string” && (this.options.snap = this.scroller.querySelectorAll(this.options.snap)), this.on(“refresh”, function() { var i = 0, l, m = 0, n, cx, cy, x = 0, y, stepX = this.options.snapStepX || this.wrapperWidth, stepY = this.options.snapStepY || this.wrapperHeight, el; this.pages = []; if (!this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight) return; if (this.options.snap === !0) { cx = Math.round(stepX / 2), cy = Math.round(stepY / 2); while (x > -this.scrollerWidth) { this.pages[i] = [], l = 0, y = 0; while (y > -this.scrollerHeight) this.pages[i][l] = { x: Math.max(x, this.maxScrollX), y: Math.max(y, this.maxScrollY), width: stepX, height: stepY, cx: x – cx, cy: y – cy }, y -= stepY, l++; x -= stepX, i++ } } else { el = this.options.snap, l = el.length, n = -1; for (; i < l; i++) { if (i === 0 || el[i].offsetLeft <= el[i – 1].offsetLeft) m = 0, n++; this.pages[m] || (this.pages[m] = []), x = Math.max(-el[i].offsetLeft, this.maxScrollX), y = Math.max(-el[i].offsetTop, this.maxScrollY), cx = x – Math.round(el[i].offsetWidth / 2), cy = y – Math.round(el[i].offsetHeight / 2), this.pages[m][n] = { x: x, y: y, width: el[i].offsetWidth, height: el[i].offsetHeight, cx: cx, cy: cy }, x > this.maxScrollX && m++ } } this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0), this.options.snapThreshold % 1 === 0 ? (this.snapThresholdX = this.options.snapThreshold, this.snapThresholdY = this.options.snapThreshold) : (this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold), this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold)) }), this.on(“flick”, function() { var time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(this.x – this.startX), 1e3), Math.min(Math.abs(this.y – this.startY), 1e3)), 300); this.goToPage(this.currentPage.pageX + this.directionX, this.currentPage.pageY + this.directionY, time) }) }, _nearestSnap: function(x, y) { if (!this.pages.length) return { x: 0, y: 0, pageX: 0, pageY: 0 }; var i = 0 , l = this.pages.length , m = 0; if (Math.abs(x – this.absStartX) < this.snapThresholdX && Math.abs(y – this.absStartY) < this.snapThresholdY) return this.currentPage; x > 0 ? x = 0 : x < this.maxScrollX && (x = this.maxScrollX), y > 0 ? y = 0 : y < this.maxScrollY && (y = this.maxScrollY); for (; i < l; i++) if (x >= this.pages[i][0].cx) { x = this.pages[i][0].x; break } l = this.pages[i].length; for (; m < l; m++) if (y >= this.pages[0][m].cy) { y = this.pages[0][m].y; break } return i == this.currentPage.pageX && (i += this.directionX, i < 0 ? i = 0 : i >= this.pages.length && (i = this.pages.length – 1), x = this.pages[i][0].x), m == this.currentPage.pageY && (m += this.directionY, m < 0 ? m = 0 : m >= this.pages[0].length && (m = this.pages[0].length – 1), y = this.pages[0][m].y), { x: x, y: y, pageX: i, pageY: m } }, goToPage: function(x, y, time, easing) { easing = easing || this.options.bounceEasing, x >= this.pages.length ? x = this.pages.length – 1 : x < 0 && (x = 0), y >= this.pages[x].length ? y = this.pages[x].length – 1 : y < 0 && (y = 0); var posX = this.pages[x][y].x , posY = this.pages[x][y].y; time = time === undefined ? this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(posX – this.x), 1e3), Math.min(Math.abs(posY – this.y), 1e3)), 300) : time, this.currentPage = { x: posX, y: posY, pageX: x, pageY: y }, this.scrollTo(posX, posY, time, easing) }, next: function(time, easing) { var x = this.currentPage.pageX , y = this.currentPage.pageY; x++, x >= this.pages.length && this.hasVerticalScroll && (x = 0, y++), this.goToPage(x, y, time, easing) }, prev: function(time, easing) { var x = this.currentPage.pageX , y = this.currentPage.pageY; x–, x < 0 && this.hasVerticalScroll && (x = 0, y–), this.goToPage(x, y, time, easing) }, _initKeys: function(e) { var keys = { pageUp: 33, pageDown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40 }, i; if (typeof this.options.keyBindings == “object”) for (i in this.options.keyBindings) typeof this.options.keyBindings[i] == “string” && (this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0)); else this.options.keyBindings = {}; for (i in keys) this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i]; utils.addEvent(window, “keydown”, this), this.on(“destroy”, function() { utils.removeEvent(window, “keydown”, this) }) }, _key: function(e) { if (!this.enabled) return; var snap = this.options.snap, newX = snap ? this.currentPage.pageX : this.x, newY = snap ? this.currentPage.pageY : this.y, now = utils.getTime(), prevTime = this.keyTime || 0, acceleration = .25, pos; this.options.useTransition && this.isInTransition && (pos = this.getComputedPosition(), this._translate(Math.round(pos.x), Math.round(pos.y)), this.isInTransition = !1), this.keyAcceleration = now – prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0; switch (e.keyCode) { case this.options.keyBindings.pageUp: this.hasHorizontalScroll && !this.hasVerticalScroll ? newX += snap ? 1 : this.wrapperWidth : newY += snap ? 1 : this.wrapperHeight; break; case this.options.keyBindings.pageDown: this.hasHorizontalScroll && !this.hasVerticalScroll ? newX -= snap ? 1 : this.wrapperWidth : newY -= snap ? 1 : this.wrapperHeight; break; case this.options.keyBindings.end: newX = snap ? this.pages.length – 1 : this.maxScrollX, newY = snap ? this.pages[0].length – 1 : this.maxScrollY; break; case this.options.keyBindings.home: newX = 0, newY = 0; break; case this.options.keyBindings.left: newX += snap ? -1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.up: newY += snap ? 1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.right: newX -= snap ? -1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.down: newY -= snap ? 1 : 5 + this.keyAcceleration >> 0; break; default: return } if (snap) { this.goToPage(newX, newY); return } newX > 0 ? (newX = 0, this.keyAcceleration = 0) : newX < this.maxScrollX && (newX = this.maxScrollX, this.keyAcceleration = 0), newY > 0 ? (newY = 0, this.keyAcceleration = 0) : newY < this.maxScrollY && (newY = this.maxScrollY, this.keyAcceleration = 0), this.scrollTo(newX, newY, 0), this.keyTime = now }, _animate: function(destX, destY, duration, easingFn) { function step() { var now = utils.getTime(), newX, newY, easing; if (now >= destTime) { that.isAnimating = !1, that._translate(destX, destY), that.resetPosition(that.options.bounceTime) || that._execEvent(“scrollEnd”); return } now = (now – startTime) / duration, easing = easingFn(now), newX = (destX – startX) * easing + startX, newY = (destY – startY) * easing + startY, that._translate(newX, newY), that.isAnimating && rAF(step) } var that = this , startX = this.x , startY = this.y , startTime = utils.getTime() , destTime = startTime + duration; this.isAnimating = !0, step() }, handleEvent: function(e) { switch (e.type) { case “touchstart”: case “pointerdown”: case “MSPointerDown”: case “mousedown”: this._start(e); break; case “touchmove”: case “pointermove”: case “MSPointerMove”: case “mousemove”: this._move(e); break; case “touchend”: case “pointerup”: case “MSPointerUp”: case “mouseup”: case “touchcancel”: case “pointercancel”: case “MSPointerCancel”: case “mousecancel”: this._end(e); break; case “orientationchange”: case “resize”: this._resize(); break; case “transitionend”: case “webkitTransitionEnd”: case “oTransitionEnd”: case “MSTransitionEnd”: this._transitionEnd(e); break; case “wheel”: case “DOMMouseScroll”: case “mousewheel”: this._wheel(e); break; case “keydown”: this._key(e); break; case “click”: this.enabled && !e._constructed && (e.preventDefault(), e.stopPropagation()) } } }, Indicator.prototype = { handleEvent: function(e) { switch (e.type) { case “touchstart”: case “pointerdown”: case “MSPointerDown”: case “mousedown”: this._start(e); break; case “touchmove”: case “pointermove”: case “MSPointerMove”: case “mousemove”: this._move(e); break; case “touchend”: case “pointerup”: case “MSPointerUp”: case “mouseup”: case “touchcancel”: case “pointercancel”: case “MSPointerCancel”: case “mousecancel”: this._end(e) } }, destroy: function() { this.options.fadeScrollbars && (clearTimeout(this.fadeTimeout), this.fadeTimeout = null), this.options.interactive && (utils.removeEvent(this.indicator, “touchstart”, this), utils.removeEvent(this.indicator, utils.prefixPointerEvent(“pointerdown”), this), utils.removeEvent(this.indicator, “mousedown”, this), utils.removeEvent(window, “touchmove”, this), utils.removeEvent(window, utils.prefixPointerEvent(“pointermove”), this), utils.removeEvent(window, “mousemove”, this), utils.removeEvent(window, “touchend”, this), utils.removeEvent(window, utils.prefixPointerEvent(“pointerup”), this), utils.removeEvent(window, “mouseup”, this)), this.options.defaultScrollbars && this.wrapper.parentNode.removeChild(this.wrapper) }, _start: function(e) { var point = e.touches ? e.touches[0] : e; e.preventDefault(), e.stopPropagation(), this.transitionTime(), this.initiated = !0, this.moved = !1, this.lastPointX = point.pageX, this.lastPointY = point.pageY, this.startTime = utils.getTime(), this.options.disableTouch || utils.addEvent(window, “touchmove”, this), this.options.disablePointer || utils.addEvent(window, utils.prefixPointerEvent(“pointermove”), this), this.options.disableMouse || utils.addEvent(window, “mousemove”, this), this.scroller._execEvent(“beforeScrollStart”) }, _move: function(e) { var point = e.touches ? e.touches[0] : e, deltaX, deltaY, newX, newY, timestamp = utils.getTime(); this.moved || this.scroller._execEvent(“scrollStart”), this.moved = !0, deltaX = point.pageX – this.lastPointX, this.lastPointX = point.pageX, deltaY = point.pageY – this.lastPointY, this.lastPointY = point.pageY, newX = this.x + deltaX, newY = this.y + deltaY, this._pos(newX, newY), e.preventDefault(), e.stopPropagation() }, _end: function(e) { if (!this.initiated) return; this.initiated = !1, e.preventDefault(), e.stopPropagation(), utils.removeEvent(window, “touchmove”, this), utils.removeEvent(window, utils.prefixPointerEvent(“pointermove”), this), utils.removeEvent(window, “mousemove”, this); if (this.scroller.options.snap) { var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y) , time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(this.scroller.x – snap.x), 1e3), Math.min(Math.abs(this.scroller.y – snap.y), 1e3)), 300); if (this.scroller.x != snap.x || this.scroller.y != snap.y) this.scroller.directionX = 0, this.scroller.directionY = 0, this.scroller.currentPage = snap, this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing) } this.moved && this.scroller._execEvent(“scrollEnd”) }, transitionTime: function(time) { time = time || 0; var durationProp = utils.style.transitionDuration; if (!durationProp) return; this.indicatorStyle[durationProp] = time + “ms”; if (!time && utils.isBadAndroid) { this.indicatorStyle[durationProp] = “0.0001ms”; var self = this; rAF(function() { self.indicatorStyle[durationProp] === “0.0001ms” && (self.indicatorStyle[durationProp] = “0s”) }) } }, transitionTimingFunction: function(easing) { this.indicatorStyle[utils.style.transitionTimingFunction] = easing }, refresh: function() { this.transitionTime(), this.options.listenX && !this.options.listenY ? this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? “block” : “none” : this.options.listenY && !this.options.listenX ? this.indicatorStyle.display = this.scroller.hasVerticalScroll ? “block” : “none” : this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? “block” : “none”, this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ? (utils.addClass(this.wrapper, “iScrollBothScrollbars”), utils.removeClass(this.wrapper, “iScrollLoneScrollbar”), this.options.defaultScrollbars && this.options.customStyle && (this.options.listenX ? this.wrapper.style.right = “8px” : this.wrapper.style.bottom = “8px”)) : (utils.removeClass(this.wrapper, “iScrollBothScrollbars”), utils.addClass(this.wrapper, “iScrollLoneScrollbar”), this.options.defaultScrollbars && this.options.customStyle && (this.options.listenX ? this.wrapper.style.right = “2px” : this.wrapper.style.bottom = “2px”)); var r = this.wrapper.offsetHeight; this.options.listenX && (this.wrapperWidth = this.wrapper.clientWidth, this.options.resize ? (this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8), this.indicatorStyle.width = this.indicatorWidth + “px”) : this.indicatorWidth = this.indicator.clientWidth, this.maxPosX = this.wrapperWidth – this.indicatorWidth, this.options.shrink == “clip” ? (this.minBoundaryX = -this.indicatorWidth + 8, this.maxBoundaryX = this.wrapperWidth – 8) : (this.minBoundaryX = 0, this.maxBoundaryX = this.maxPosX), this.sizeRatioX = this.options.speedRatioX || this.scroller.maxScrollX && this.maxPosX / this.scroller.maxScrollX), this.options.listenY && (this.wrapperHeight = this.wrapper.clientHeight, this.options.resize ? (this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8), this.indicatorStyle.height = this.indicatorHeight + “px”) : this.indicatorHeight = this.indicator.clientHeight, this.maxPosY = this.wrapperHeight – this.indicatorHeight, this.options.shrink == “clip” ? (this.minBoundaryY = -this.indicatorHeight + 8, this.maxBoundaryY = this.wrapperHeight – 8) : (this.minBoundaryY = 0, this.maxBoundaryY = this.maxPosY), this.maxPosY = this.wrapperHeight – this.indicatorHeight, this.sizeRatioY = this.options.speedRatioY || this.scroller.maxScrollY && this.maxPosY / this.scroller.maxScrollY), this.updatePosition() }, updatePosition: function() { var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0 , y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0; this.options.ignoreBoundaries || (x < this.minBoundaryX ? (this.options.shrink == “scale” && (this.width = Math.max(this.indicatorWidth + x, 8), this.indicatorStyle.width = this.width + “px”), x = this.minBoundaryX) : x > this.maxBoundaryX ? this.options.shrink == “scale” ? (this.width = Math.max(this.indicatorWidth – (x – this.maxPosX), 8), this.indicatorStyle.width = this.width + “px”, x = this.maxPosX + this.indicatorWidth – this.width) : x = this.maxBoundaryX : this.options.shrink == “scale” && this.width != this.indicatorWidth && (this.width = this.indicatorWidth, this.indicatorStyle.width = this.width + “px”), y < this.minBoundaryY ? (this.options.shrink == “scale” && (this.height = Math.max(this.indicatorHeight + y * 3, 8), this.indicatorStyle.height = this.height + “px”), y = this.minBoundaryY) : y > this.maxBoundaryY ? this.options.shrink == “scale” ? (this.height = Math.max(this.indicatorHeight – (y – this.maxPosY) * 3, 8), this.indicatorStyle.height = this.height + “px”, y = this.maxPosY + this.indicatorHeight – this.height) : y = this.maxBoundaryY : this.options.shrink == “scale” && this.height != this.indicatorHeight && (this.height = this.indicatorHeight, this.indicatorStyle.height = this.height + “px”)), this.x = x, this.y = y, this.scroller.options.useTransform ? this.indicatorStyle[utils.style.transform] = “translate(” + x + “px,” + y + “px)” + this.scroller.translateZ : (this.indicatorStyle.left = x + “px”, this.indicatorStyle.top = y + “px”) }, _pos: function(x, y) { x < 0 ? x = 0 : x > this.maxPosX && (x = this.maxPosX), y < 0 ? y = 0 : y > this.maxPosY && (y = this.maxPosY), x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x, y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y, this.scroller.scrollTo(x, y) }, fade: function(val, hold) { if (hold && !this.visible) return; clearTimeout(this.fadeTimeout), this.fadeTimeout = null; var time = val ? 250 : 500 , delay = val ? 0 : 300; val = val ? “1” : “0”, this.wrapperStyle[utils.style.transitionDuration] = time + “ms”, this.fadeTimeout = setTimeout(function(val) { this.wrapperStyle.opacity = val, this.visible = +val } .bind(this, val), delay) } }, IScroll.utils = utils, typeof module != “undefined” && module.exports ? module.exports = IScroll : typeof define == “function” && define.amd ? define(function() { return IScroll }) : window.IScroll = IScroll }(window, document, Math), function(global, factory) { “use strict”; typeof define == “function” && define.amd ? define([“jquery”], function($) { return factory($, global, global.document, global.Math) }) : typeof exports == “object” && exports ? module.exports = factory(require(“jquery”), global, global.document, global.Math) : factory(jQuery, global, global.document, global.Math) }(typeof window != “undefined” ? window : this, function($, window, document, Math, undefined) { “use strict”; var WRAPPER = “fullpage-wrapper” , WRAPPER_SEL = “.” + WRAPPER , SCROLLABLE = “fp-scrollable” , SCROLLABLE_SEL = “.” + SCROLLABLE , RESPONSIVE = “fp-responsive” , NO_TRANSITION = “fp-notransition” , DESTROYED = “fp-destroyed” , ENABLED = “fp-enabled” , VIEWING_PREFIX = “fp-viewing” , ACTIVE = “active” , ACTIVE_SEL = “.” + ACTIVE , COMPLETELY = “fp-completely” , COMPLETELY_SEL = “.” + COMPLETELY , SECTION_DEFAULT_SEL = “.section” , SECTION = “fp-section” , SECTION_SEL = “.” + SECTION , SECTION_ACTIVE_SEL = SECTION_SEL + ACTIVE_SEL , SECTION_FIRST_SEL = SECTION_SEL + “:first” , SECTION_LAST_SEL = SECTION_SEL + “:last” , TABLE_CELL = “fp-tableCell” , TABLE_CELL_SEL = “.” + TABLE_CELL , AUTO_HEIGHT = “fp-auto-height” , AUTO_HEIGHT_SEL = “.fp-auto-height” , NORMAL_SCROLL = “fp-normal-scroll” , NORMAL_SCROLL_SEL = “.fp-normal-scroll” , SECTION_NAV = “fp-nav” , SECTION_NAV_SEL = “#” + SECTION_NAV , SECTION_NAV_TOOLTIP = “fp-tooltip” , SECTION_NAV_TOOLTIP_SEL = “.” + SECTION_NAV_TOOLTIP , SHOW_ACTIVE_TOOLTIP = “fp-show-active” , SLIDE_DEFAULT_SEL = “.slide” , SLIDE = “fp-slide” , SLIDE_SEL = “.” + SLIDE , SLIDE_ACTIVE_SEL = SLIDE_SEL + ACTIVE_SEL , SLIDES_WRAPPER = “fp-slides” , SLIDES_WRAPPER_SEL = “.” + SLIDES_WRAPPER , SLIDES_CONTAINER = “fp-slidesContainer” , SLIDES_CONTAINER_SEL = “.” + SLIDES_CONTAINER , TABLE = “fp-table” , SLIDES_NAV = “fp-slidesNav” , SLIDES_NAV_SEL = “.” + SLIDES_NAV , SLIDES_NAV_LINK_SEL = SLIDES_NAV_SEL + ” a” , SLIDES_ARROW = “fp-controlArrow” , SLIDES_ARROW_SEL = “.” + SLIDES_ARROW , SLIDES_PREV = “fp-prev” , SLIDES_PREV_SEL = “.” + SLIDES_PREV , SLIDES_ARROW_PREV = SLIDES_ARROW + ” ” + SLIDES_PREV , SLIDES_ARROW_PREV_SEL = SLIDES_ARROW_SEL + SLIDES_PREV_SEL , SLIDES_NEXT = “fp-next” , SLIDES_NEXT_SEL = “.” + SLIDES_NEXT , SLIDES_ARROW_NEXT = SLIDES_ARROW + ” ” + SLIDES_NEXT , SLIDES_ARROW_NEXT_SEL = SLIDES_ARROW_SEL + SLIDES_NEXT_SEL , $window = $(window) , $document = $(document) , iscrollOptions = { scrollbars: !0, mouseWheel: !0, hideScrollbars: !1, fadeScrollbars: !1, disableMouse: !0, interactiveScrollbars: !0, bounce: !1 }; $.fn.fullpage = function(options) { function setAutoScrolling(value, type) { value || silentScroll(0), setVariableState(“autoScrolling”, value, type); var element = $(SECTION_ACTIVE_SEL); options.autoScrolling && !options.scrollBar ? ($htmlBody.css({ overflow: “hidden !important”, height: “100%” }), container.css({ “-ms-touch-action”: “none”, “touch-action”: “none” }), element.length && silentScroll(element.position().top)) : ($htmlBody.css({ overflow: “visible !important”, height: “initial” }), container.css({ “-ms-touch-action”: “”, “touch-action”: “” }), element.length && $htmlBody.scrollTop(element.position().top)) } function setRecordHistory(value, type) { setVariableState(“recordHistory”, value, type) } function setScrollingSpeed(value, type) { setVariableState(“scrollingSpeed”, value, type) } function setFitToSection(value, type) { setVariableState(“fitToSection”, value, type) } function setLockAnchors(value) { options.lockAnchors = value } function setMouseWheelScrolling(value) { value ? (addMouseWheelHandler(), addMiddleWheelHandler()) : (removeMouseWheelHandler(), removeMiddleWheelHandler()) } function setAllowScrolling(value, directions) { typeof directions != “undefined” ? (directions = directions.replace(/ /g, “”).split(“,”), $.each(directions, function(index, direction) { setIsScrollAllowed(value, direction, “m”) })) : value ? (setMouseWheelScrolling(!0), addTouchHandler()) : (setMouseWheelScrolling(!1), removeTouchHandler()) } function setKeyboardScrolling(value, directions) { typeof directions != “undefined” ? (directions = directions.replace(/ /g, “”).split(“,”), $.each(directions, function(index, direction) { setIsScrollAllowed(value, direction, “k”) })) : options.keyboardScrolling = value } function moveSectionUp() { var prev = $(SECTION_ACTIVE_SEL).prev(SECTION_SEL); !prev.length && (options.loopTop || options.continuousVertical) && (prev = $(SECTION_SEL).last()), prev.length && scrollPage(prev, null, !0) } function moveSectionDown() { var next = $(SECTION_ACTIVE_SEL).next(SECTION_SEL); !next.length && (options.loopBottom || options.continuousVertical) && (next = $(SECTION_SEL).first()), next.length && scrollPage(next, null, !1) } function silentMoveTo(sectionAnchor, slideAnchor) { setScrollingSpeed(0, “internal”), moveTo(sectionAnchor, slideAnchor), setScrollingSpeed(originals.scrollingSpeed, “internal”) } function moveTo(sectionAnchor, slideAnchor) { var destiny = getSectionByAnchor(sectionAnchor); typeof slideAnchor != “undefined” ? scrollPageAndSlide(sectionAnchor, slideAnchor) : destiny.length > 0 && scrollPage(destiny) } function moveSlideRight(section) { moveSlide(“right”, section) } function moveSlideLeft(section) { moveSlide(“left”, section) } function reBuild(resizing) { if (container.hasClass(DESTROYED)) return; isResizing = !0, windowsHeight = $window.height(), $(SECTION_SEL).each(function() { var slidesWrap = $(this).find(SLIDES_WRAPPER_SEL) , slides = $(this).find(SLIDE_SEL); options.verticalCentered && $(this).find(TABLE_CELL_SEL).css(“height”, getTableHeight($(this)) + “px”), $(this).css(“height”, windowsHeight + “px”), options.scrollOverflow && (slides.length ? slides.each(function() { createScrollBar($(this)) }) : createScrollBar($(this))), slides.length > 1 && landscapeScroll(slidesWrap, slidesWrap.find(SLIDE_ACTIVE_SEL)) }); var activeSection = $(SECTION_ACTIVE_SEL) , sectionIndex = activeSection.index(SECTION_SEL); sectionIndex && silentMoveTo(sectionIndex + 1), isResizing = !1, $.isFunction(options.afterResize) && resizing && options.afterResize.call(container), $.isFunction(options.afterReBuild) && !resizing && options.afterReBuild.call(container) } function setResponsive(active) { var isResponsive = $body.hasClass(RESPONSIVE); active ? isResponsive || (setAutoScrolling(!1, “internal”), setFitToSection(!1, “internal”), $(SECTION_NAV_SEL).hide(), $body.addClass(RESPONSIVE), $.isFunction(options.afterResponsive) && options.afterResponsive.call(container, active)) : isResponsive && (setAutoScrolling(originals.autoScrolling, “internal”), setFitToSection(originals.autoScrolling, “internal”), $(SECTION_NAV_SEL).show(), $body.removeClass(RESPONSIVE), $.isFunction(options.afterResponsive) && options.afterResponsive.call(container, active)) } function init() { options.css3 && (options.css3 = support3d()), options.scrollBar = options.scrollBar || options.hybrid, setOptionsFromDOM(), prepareDom(), setAllowScrolling(!0), setAutoScrolling(options.autoScrolling, “internal”), responsive(), setBodyClass() } function bindEvents() { $window.on(“hashchange”, hashChangeHandler).blur(blurHandler).resize(resizeHandler), $document.keydown(keydownHandler).keyup(keyUpHandler).on(“click touchstart”, SECTION_NAV_SEL + ” a”, sectionBulletHandler).on(“click touchstart”, SLIDES_NAV_LINK_SEL, slideBulletHandler).on(“click”, SECTION_NAV_TOOLTIP_SEL, tooltipTextHandler), $(SECTION_SEL).on(“click touchstart”, SLIDES_ARROW_SEL, slideArrowHandler), options.normalScrollElements && ($document.on(“mouseenter”, options.normalScrollElements, function() { setMouseWheelScrolling(!1) }), $document.on(“mouseleave”, options.normalScrollElements, function() { setMouseWheelScrolling(!0) })) } function setOptionsFromDOM() { var sections = container.find(options.sectionSelector); options.anchors.length || (options.anchors = sections.filter(“[data-anchor]”).map(function() { return $(this).data(“anchor”).toString() }).get()), options.navigationTooltips.length || (options.navigationTooltips = sections.filter(“[data-tooltip]”).map(function() { return $(this).data(“tooltip”).toString() }).get()) } function prepareDom() { container.css({ height: “100%”, position: “relative” }), container.addClass(WRAPPER), $(“html”).addClass(ENABLED), windowsHeight = $window.height(), container.removeClass(DESTROYED), addInternalSelectors(), $(SECTION_SEL).each(function(index) { var section = $(this) , slides = section.find(SLIDE_SEL) , numSlides = slides.length; styleSection(section, index), styleMenu(section, index), numSlides > 0 ? styleSlides(section, slides, numSlides) : options.verticalCentered && addTableClass(section) }), options.fixedElements && options.css3 && $(options.fixedElements).appendTo($body), options.navigation && addVerticalNavigation(), enableYoutubeAPI(), options.scrollOverflow ? (document.readyState === “complete” && createScrollBarHandler(), $window.on(“load”, createScrollBarHandler)) : afterRenderActions() } function styleSlides(section, slides, numSlides) { var sliderWidth = numSlides * 100 , slideWidth = 100 / numSlides; slides.wrapAll(‘

‘), slides.parent().wrap(‘

‘), section.find(SLIDES_CONTAINER_SEL).css(“width”, sliderWidth + “%”), numSlides > 1 && (options.controlArrows && createSlideArrows(section), options.slidesNavigation && addSlidesNavigation(section, numSlides)), slides.each(function(index) { $(this).css(“width”, slideWidth + “%”), options.verticalCentered && addTableClass($(this)) }); var startingSlide = section.find(SLIDE_ACTIVE_SEL); startingSlide.length && ($(SECTION_ACTIVE_SEL).index(SECTION_SEL) !== 0 || $(SECTION_ACTIVE_SEL).index(SECTION_SEL) === 0 && startingSlide.index() !== 0) ? silentLandscapeScroll(startingSlide, “internal”) : slides.eq(0).addClass(ACTIVE) } function styleSection(section, index) { !index && $(SECTION_ACTIVE_SEL).length === 0 && section.addClass(ACTIVE), startingSection = $(SECTION_ACTIVE_SEL), section.css(“height”, windowsHeight + “px”), options.paddingTop && section.css(“padding-top”, options.paddingTop), options.paddingBottom && section.css(“padding-bottom”, options.paddingBottom), typeof options.sectionsColor[index] != “undefined” && section.css(“background-color”, options.sectionsColor[index]), typeof options.anchors[index] != “undefined” && section.attr(“data-anchor”, options.anchors[index]) } function styleMenu(section, index) { typeof options.anchors[index] != “undefined” && section.hasClass(ACTIVE) && activateMenuAndNav(options.anchors[index], index), options.menu && options.css3 && $(options.menu).closest(WRAPPER_SEL).length && $(options.menu).appendTo($body) } function addInternalSelectors() { container.find(options.sectionSelector).addClass(SECTION), container.find(options.slideSelector).addClass(SLIDE) } function createSlideArrows(section) { section.find(SLIDES_WRAPPER_SEL).after(‘‘), options.controlArrowColor != “#fff” && (section.find(SLIDES_ARROW_NEXT_SEL).css(“border-color”, “transparent transparent transparent ” + options.controlArrowColor), section.find(SLIDES_ARROW_PREV_SEL).css(“border-color”, “transparent ” + options.controlArrowColor + ” transparent transparent”)), options.loopHorizontal || section.find(SLIDES_ARROW_PREV_SEL).hide() } function addVerticalNavigation() { $body.append(”); var nav = $(SECTION_NAV_SEL); nav.addClass(function() { return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ” ” + options.navigationPosition : options.navigationPosition }); for (var i = 0; i < $(SECTION_SEL).length; i++) { var link = “”; options.anchors.length && (link = options.anchors[i]); var li = ‘‘ , tooltip = options.navigationTooltips[i]; typeof tooltip != “undefined” && tooltip !== “” && (li += ” + tooltip + “”), li += “”, nav.find(“ul”).append(li) } $(SECTION_NAV_SEL).css(“margin-top”, “-” + $(SECTION_NAV_SEL).height() / 2 + “px”), $(SECTION_NAV_SEL).find(“li”).eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find(“a”).addClass(ACTIVE) } function createScrollBarHandler() { $(SECTION_SEL).each(function() { var slides = $(this).find(SLIDE_SEL); slides.length ? slides.each(function() { createScrollBar($(this)) }) : createScrollBar($(this)) }), afterRenderActions() } function enableYoutubeAPI() { container.find(‘iframe[src*=”youtube.com/embed/”]’).each(function() { addURLParam($(this), “enablejsapi=1”) }) } function addURLParam(element, newParam) { var originalSrc = element.attr(“src”); element.attr(“src”, originalSrc + getUrlParamSign(originalSrc) + newParam) } function getUrlParamSign(url) { return /\?/.test(url) ? “&” : “?” } function afterRenderActions() { var section = $(SECTION_ACTIVE_SEL); section.addClass(COMPLETELY), options.scrollOverflowHandler.afterRender && options.scrollOverflowHandler.afterRender(section), lazyLoad(section), playMedia(section), options.scrollOverflowHandler.afterLoad(), isDestinyTheStartingSection() && $.isFunction(options.afterLoad) && options.afterLoad.call(section, section.data(“anchor”), section.index(SECTION_SEL) + 1), $.isFunction(options.afterRender) && options.afterRender.call(container) } function isDestinyTheStartingSection() { var anchors = window.location.hash.replace(“#”, “”).split(“/”) , destinationSection = getSectionByAnchor(decodeURIComponent(anchors[0])); return !destinationSection.length || destinationSection.length && destinationSection.index() === startingSection.index() } function scrollHandler() { var currentSection; if (!options.autoScrolling || options.scrollBar) { var currentScroll = $window.scrollTop() , scrollDirection = getScrollDirection(currentScroll) , visibleSectionIndex = 0 , screen_mid = currentScroll + $window.height() / 2 , isAtBottom = $body.height() – $window.height() === currentScroll , sections = document.querySelectorAll(SECTION_SEL); if (isAtBottom) visibleSectionIndex = sections.length – 1; else if (!currentScroll) visibleSectionIndex = 0; else for (var i = 0; i < sections.length; ++i) { var section = sections[i]; section.offsetTop <= screen_mid && (visibleSectionIndex = i) } isCompletelyInViewPort(scrollDirection) && ($(SECTION_ACTIVE_SEL).hasClass(COMPLETELY) || $(SECTION_ACTIVE_SEL).addClass(COMPLETELY).siblings().removeClass(COMPLETELY)), currentSection = $(sections).eq(visibleSectionIndex); if (!currentSection.hasClass(ACTIVE)) { isScrolling = !0; var leavingSection = $(SECTION_ACTIVE_SEL), leavingSectionIndex = leavingSection.index(SECTION_SEL) + 1, yMovement = getYmovement(currentSection), anchorLink = currentSection.data(“anchor”), sectionIndex = currentSection.index(SECTION_SEL) + 1, activeSlide = currentSection.find(SLIDE_ACTIVE_SEL), slideIndex, slideAnchorLink; activeSlide.length && (slideAnchorLink = activeSlide.data(“anchor”), slideIndex = activeSlide.index()), canScroll && (currentSection.addClass(ACTIVE).siblings().removeClass(ACTIVE), $.isFunction(options.onLeave) && options.onLeave.call(leavingSection, leavingSectionIndex, sectionIndex, yMovement), $.isFunction(options.afterLoad) && options.afterLoad.call(currentSection, anchorLink, sectionIndex), stopMedia(leavingSection), lazyLoad(currentSection), playMedia(currentSection), activateMenuAndNav(anchorLink, sectionIndex – 1), options.anchors.length && (lastScrolledDestiny = anchorLink), setState(slideIndex, slideAnchorLink, anchorLink, sectionIndex)), clearTimeout(scrollId), scrollId = setTimeout(function() { isScrolling = !1 }, 100) } options.fitToSection && (clearTimeout(scrollId2), scrollId2 = setTimeout(function() { options.fitToSection && fitToSection() }, options.fitToSectionDelay)) } } function fitToSection() { canScroll && (isResizing = !0, scrollPage($(SECTION_ACTIVE_SEL)), isResizing = !1) } function isCompletelyInViewPort(movement) { var top = $(SECTION_ACTIVE_SEL).position().top , bottom = top + $window.height(); return movement == “up” ? bottom >= $window.scrollTop() + $window.height() : top <= $window.scrollTop() } function getScrollDirection(currentScroll) { var direction = currentScroll > lastScroll ? “down” : “up”; return lastScroll = currentScroll, previousDestTop = currentScroll, direction } function scrolling(type, scrollable) { if (!isScrollAllowed.m[type]) return; var check = type === “down” ? “bottom” : “top” , scrollSection = type === “down” ? moveSectionDown : moveSectionUp; if (scrollable.length > 0) { if (!options.scrollOverflowHandler.isScrolled(check, scrollable)) return !0; scrollSection() } else scrollSection() } function preventBouncing(event) { var e = event.originalEvent; !checkParentForNormalScrollElement(event.target) && options.autoScrolling && isReallyTouch(e) && isScrollAllowed.m.up && event.preventDefault() } function touchMoveHandler(event) { var e = event.originalEvent , activeSection = $(e.target).closest(SECTION_SEL); if (!checkParentForNormalScrollElement(event.target) && isReallyTouch(e)) { options.autoScrolling && event.preventDefault(); var scrollable = options.scrollOverflowHandler.scrollable(activeSection) , touchEvents = getEventsPage(e); touchEndY = touchEvents.y, touchEndX = touchEvents.x, activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX – touchEndX) > Math.abs(touchStartY – touchEndY) ? !slideMoving && Math.abs(touchStartX – touchEndX) > $window.outerWidth() / 100 * options.touchSensitivity && (touchStartX > touchEndX ? isScrollAllowed.m.right && moveSlideRight(activeSection) : isScrollAllowed.m.left && moveSlideLeft(activeSection)) : options.autoScrolling && canScroll && Math.abs(touchStartY – touchEndY) > $window.height() / 100 * options.touchSensitivity && (touchStartY > touchEndY ? scrolling(“down”, scrollable) : touchEndY > touchStartY && scrolling(“up”, scrollable)) } } function checkParentForNormalScrollElement(el, hop) { hop = hop || 0; var parent = $(el).parent(); return hop < options.normalScrollElementTouchThreshold && parent.is(options.normalScrollElements) ? !0 : hop == options.normalScrollElementTouchThreshold ? !1 : checkParentForNormalScrollElement(parent, ++hop) } function isReallyTouch(e) { return typeof e.pointerType == “undefined” || e.pointerType != “mouse” } function touchStartHandler(event) { var e = event.originalEvent; options.fitToSection && $htmlBody.stop(); if (isReallyTouch(e)) { var touchEvents = getEventsPage(e); touchStartY = touchEvents.y, touchStartX = touchEvents.x } } function getAverage(elements, number) { var sum = 0 , lastElements = elements.slice(Math.max(elements.length – number, 1)); for (var i = 0; i < lastElements.length; i++) sum += lastElements[i]; return Math.ceil(sum / number) } function MouseWheelHandler(e) { var curTime = (new Date).getTime() , isNormalScroll = $(COMPLETELY_SEL).hasClass(NORMAL_SCROLL); if (options.autoScrolling && !controlPressed && !isNormalScroll) { e = e || window.event; var value = e.wheelDelta || -e.deltaY || -e.detail , delta = Math.max(-1, Math.min(1, value)) , horizontalDetection = typeof e.wheelDeltaX != “undefined” || typeof e.deltaX != “undefined” , isScrollingVertically = Math.abs(e.wheelDeltaX) < Math.abs(e.wheelDelta) || Math.abs(e.deltaX) < Math.abs(e.deltaY) || !horizontalDetection; scrollings.length > 149 && scrollings.shift(), scrollings.push(Math.abs(value)), options.scrollBar && (e.preventDefault ? e.preventDefault() : e.returnValue = !1); var activeSection = $(SECTION_ACTIVE_SEL) , scrollable = options.scrollOverflowHandler.scrollable(activeSection) , timeDiff = curTime – prevTime; prevTime = curTime, timeDiff > 200 && (scrollings = []); if (canScroll) { var averageEnd = getAverage(scrollings, 10) , averageMiddle = getAverage(scrollings, 70) , isAccelerating = averageEnd >= averageMiddle; isAccelerating && isScrollingVertically && (delta < 0 ? scrolling(“down”, scrollable) : scrolling(“up”, scrollable)) } return !1 } options.fitToSection && $htmlBody.stop() } function moveSlide(direction, section) { var activeSection = typeof section == “undefined” ? $(SECTION_ACTIVE_SEL) : section , slides = activeSection.find(SLIDES_WRAPPER_SEL) , numSlides = slides.find(SLIDE_SEL).length; if (!slides.length || slideMoving || numSlides < 2) return; var currentSlide = slides.find(SLIDE_ACTIVE_SEL) , destiny = null; direction === “left” ? destiny = currentSlide.prev(SLIDE_SEL) : destiny = currentSlide.next(SLIDE_SEL); if (!destiny.length) { if (!options.loopHorizontal) return; direction === “left” ? destiny = currentSlide.siblings(“:last”) : destiny = currentSlide.siblings(“:first”) } slideMoving = !0, landscapeScroll(slides, destiny, direction) } function keepSlidesPosition() { $(SLIDE_ACTIVE_SEL).each(function() { silentLandscapeScroll($(this), “internal”) }) } function getDestinationPosition(element) { var elemPosition = element.position() , position = elemPosition.top , isScrollingDown = elemPosition.top > previousDestTop , sectionBottom = position – windowsHeight + element.outerHeight() , bigSectionsDestination = options.bigSectionsDestination , containerH = container.outerHeight() , containerPosition = container.offset(); !$masthead.hasClass(“menu-transparent”) && $(“body”).hasClass(“uncode-fp-menu-shrink”) && !element.is(“:first-child”) && (position += 18); if (containerH + menuHeight + bodyBorder + adminBarHeight – windowsHeight < position || isResizing && element.is(“:last-child”)) position = sectionBottom + menuHeight + bodyBorder * 2 + adminBarHeight; return previousDestTop = position, position } function scrollPage(element, callback, isMovementUp) { if (typeof element == “undefined”) return; var dtop = getDestinationPosition(element), slideAnchorLink, slideIndex, v = { element: element, callback: callback, isMovementUp: isMovementUp, dtop: dtop, yMovement: getYmovement(element), anchorLink: element.data(“anchor”), sectionIndex: element.index(SECTION_SEL), activeSlide: element.find(SLIDE_ACTIVE_SEL), activeSection: $(SECTION_ACTIVE_SEL), leavingSection: $(SECTION_ACTIVE_SEL).index(SECTION_SEL) + 1, localIsResizing: isResizing }; if (v.activeSection.is(element) && !isResizing || options.scrollBar && $window.scrollTop() === v.dtop && !element.hasClass(AUTO_HEIGHT)) return; v.activeSlide.length && (slideAnchorLink = v.activeSlide.data(“anchor”), slideIndex = v.activeSlide.index()), options.autoScrolling && options.continuousVertical && typeof v.isMovementUp != “undefined” && (!v.isMovementUp && v.yMovement == “up” || v.isMovementUp && v.yMovement == “down”) && (v = createInfiniteSections(v)); if ($.isFunction(options.onLeave) && !v.localIsResizing && options.onLeave.call(v.activeSection, v.leavingSection, v.sectionIndex + 1, v.yMovement) === !1) return; v.localIsResizing || stopMedia(v.activeSection), options.scrollOverflowHandler.beforeLeave(), element.addClass(ACTIVE).siblings().removeClass(ACTIVE), lazyLoad(element), options.scrollOverflowHandler.onLeave(), canScroll = !1, setState(slideIndex, slideAnchorLink, v.anchorLink, v.sectionIndex), performMovement(v), lastScrolledDestiny = v.anchorLink, activateMenuAndNav(v.anchorLink, v.sectionIndex) } function performMovement(v) { if (options.css3 && options.autoScrolling && !options.scrollBar) { var translate3d = “translate3d(0px, -” + Math.round(v.dtop) + “px, 0px)”; transformContainer(translate3d, !0), options.scrollingSpeed ? (clearTimeout(afterSectionLoadsId), afterSectionLoadsId = setTimeout(function() { afterSectionLoads(v) }, options.scrollingSpeed)) : afterSectionLoads(v) } else { var scrollSettings = getScrollSettings(v); $(scrollSettings.element).animate(scrollSettings.options, options.scrollingSpeed, options.easing).promise().done(function() { options.scrollBar ? setTimeout(function() { afterSectionLoads(v) }, 30) : afterSectionLoads(v) }) } } function getScrollSettings(v) { var scroll = {}; return options.autoScrolling && !options.scrollBar ? (scroll.options = { top: -v.dtop }, scroll.element = WRAPPER_SEL) : (scroll.options = { scrollTop: v.dtop }, scroll.element = “html, body”), scroll } function createInfiniteSections(v) { return v.isMovementUp ? $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL)) : $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse()), silentScroll($(SECTION_ACTIVE_SEL).position().top), keepSlidesPosition(), v.wrapAroundElements = v.activeSection, v.dtop = v.element.position().top, v.yMovement = getYmovement(v.element), v } function continuousVerticalFixSectionOrder(v) { if (!v.wrapAroundElements || !v.wrapAroundElements.length) return; v.isMovementUp ? $(SECTION_FIRST_SEL).before(v.wrapAroundElements) : $(SECTION_LAST_SEL).after(v.wrapAroundElements), silentScroll($(SECTION_ACTIVE_SEL).position().top), keepSlidesPosition() } function afterSectionLoads(v) { continuousVerticalFixSectionOrder(v), $.isFunction(options.afterLoad) && !v.localIsResizing && options.afterLoad.call(v.element, v.anchorLink, v.sectionIndex + 1), options.scrollOverflowHandler.afterLoad(), v.localIsResizing || playMedia(v.element), v.element.addClass(COMPLETELY).siblings().removeClass(COMPLETELY), canScroll = !0, $.isFunction(v.callback) && v.callback.call(this) } function setSrc(element, attribute) { element.attr(attribute, element.data(attribute)).removeAttr(“data-” + attribute) } function lazyLoad(destiny) { if (!options.lazyLoading) return; var panel = getSlideOrSection(destiny), element; panel.find(“img[data-src], img[data-srcset], source[data-src], audio[data-src], iframe[data-src]”).each(function() { element = $(this), $.each([“src”, “srcset”], function(index, type) { var attribute = element.attr(“data-” + type); typeof attribute != “undefined” && attribute && setSrc(element, type) }), element.is(“source”) && element.closest(“video”).get(0).load() }) } function playMedia(destiny) { var panel = getSlideOrSection(destiny); panel.find(“video, audio”).each(function() { var element = $(this).get(0); element.hasAttribute(“data-autoplay”) && typeof element.play == “function” && element.play() }), panel.find(‘iframe[src=”youtube.com/embed/”]’).each(function() { var element = $(this).get(0); element.hasAttribute(“data-autoplay”) && playYoutube(element), element.onload = function() { element.hasAttribute(“data-autoplay”) && playYoutube(element) } }) } function playYoutube(element) { element.contentWindow.postMessage(‘{“event”:”command”,”func”:”playVideo”,”args”:””}’, “”)
}
function stopMedia(destiny) {
var panel = getSlideOrSection(destiny);
panel.find(“video, audio”).each(function() {
var element = $(this).get(0);
!element.hasAttribute(“data-keepplaying”) && typeof element.pause == “function” && element.pause()
}),
panel.find(‘iframe[src=”youtube.com/embed/”]’).each(function() { var element = $(this).get(0); /youtube.com\/embed\//.test($(this).attr(“src”)) && !element.hasAttribute(“data-keepplaying”) && $(this).get(0).contentWindow.postMessage(‘{“event”:”command”,”func”:”pauseVideo”,”args”:””}’, “”)
})
}
function getSlideOrSection(destiny) {
var slide = destiny.find(SLIDE_ACTIVE_SEL);
return slide.length && (destiny = $(slide)),
destiny
}
function scrollToAnchor() {
var value = window.location.hash.replace(“#”, “”).split(“/”)
, sectionAnchor = decodeURIComponent(value[0])
, slideAnchor = decodeURIComponent(value[1]);
sectionAnchor && (options.animateAnchor ? scrollPageAndSlide(sectionAnchor, slideAnchor) : silentMoveTo(sectionAnchor, slideAnchor))
}
function hashChangeHandler() {
if (!isScrolling && !options.lockAnchors) {
var value = window.location.hash.replace(“#”, “”).split(“/”)
, sectionAnchor = decodeURIComponent(value[0])
, slideAnchor = decodeURIComponent(value[1])
, isFirstSlideMove = typeof lastScrolledDestiny == “undefined”
, isFirstScrollMove = typeof lastScrolledDestiny == “undefined” && typeof slideAnchor == “undefined” && !slideMoving;
sectionAnchor.length && (sectionAnchor && sectionAnchor !== lastScrolledDestiny && !isFirstSlideMove || isFirstScrollMove || !slideMoving && lastScrolledSlide != slideAnchor) && scrollPageAndSlide(sectionAnchor, slideAnchor)
}
}
function keydownHandler(e) {
clearTimeout(keydownId);
var activeElement = $(“:focus”);
if (!activeElement.is(“textarea”) && !activeElement.is(“input”) && !activeElement.is(“select”) && activeElement.attr(“contentEditable”) !== “true” && activeElement.attr(“contentEditable”) !== “” && options.keyboardScrolling && options.autoScrolling) {
var keyCode = e.which
, keyControls = [40, 38, 32, 33, 34];
$.inArray(keyCode, keyControls) > -1 && e.preventDefault(),
controlPressed = e.ctrlKey,
keydownId = setTimeout(function() {
onkeydown(e)
}, 150)
}
}
function tooltipTextHandler() {
$(this).prev().trigger(“click”)
}
function keyUpHandler(e) {
isWindowFocused && (controlPressed = e.ctrlKey)
}
function mouseDownHandler(e) {
e.which == 2 && (oldPageY = e.pageY,
container.on(“mousemove”, mouseMoveHandler))
}
function mouseUpHandler(e) {
e.which == 2 && container.off(“mousemove”)
}
function slideArrowHandler() {
var section = $(this).closest(SECTION_SEL);
$(this).hasClass(SLIDES_PREV) ? isScrollAllowed.m.left && moveSlideLeft(section) : isScrollAllowed.m.right && moveSlideRight(section)
}
function blurHandler() {
isWindowFocused = !1,
controlPressed = !1
}
function sectionBulletHandler(e) {
e.preventDefault();
var index = $(this).parent().index();
scrollPage($(SECTION_SEL).eq(index))
}
function slideBulletHandler(e) {
e.preventDefault();
var slides = $(this).closest(SECTION_SEL).find(SLIDES_WRAPPER_SEL)
, destiny = slides.find(SLIDE_SEL).eq($(this).closest(“li”).index());
landscapeScroll(slides, destiny)
}
function onkeydown(e) {
var shiftPressed = e.shiftKey;
if (!canScroll && [37, 39].indexOf(e.which) < 0) return; switch (e.which) { case 38: case 33: isScrollAllowed.k.up && moveSectionUp(); break; case 32: if (shiftPressed && isScrollAllowed.k.up) { moveSectionUp(); break } ; case 40: case 34: isScrollAllowed.k.down && moveSectionDown(); break; case 36: isScrollAllowed.k.up && moveTo(1); break; case 35: isScrollAllowed.k.down && moveTo($(SECTION_SEL).length); break; case 37: isScrollAllowed.k.left && moveSlideLeft(); break; case 39: isScrollAllowed.k.right && moveSlideRight(); break; default: return } } function mouseMoveHandler(e) { canScroll && (e.pageY < oldPageY && isScrollAllowed.m.up ? moveSectionUp() : e.pageY > oldPageY && isScrollAllowed.m.down && moveSectionDown()),
oldPageY = e.pageY
}
function landscapeScroll(slides, destiny, direction) {
var section = slides.closest(SECTION_SEL)
, v = {
slides: slides,
destiny: destiny,
direction: direction,
destinyPos: destiny.position(),
slideIndex: destiny.index(),
section: section,
sectionIndex: section.index(SECTION_SEL),
anchorLink: section.data(“anchor”),
slidesNav: section.find(SLIDES_NAV_SEL),
slideAnchor: getAnchor(destiny),
prevSlide: section.find(SLIDE_ACTIVE_SEL),
prevSlideIndex: section.find(SLIDE_ACTIVE_SEL).index(),
localIsResizing: isResizing
};
v.xMovement = getXmovement(v.prevSlideIndex, v.slideIndex),
v.direction = v.direction ? v.direction : v.xMovement,
v.localIsResizing || (canScroll = !1);
if (options.onSlideLeave && !v.localIsResizing && v.xMovement !== “none” && $.isFunction(options.onSlideLeave) && options.onSlideLeave.call(v.prevSlide, v.anchorLink, v.sectionIndex + 1, v.prevSlideIndex, v.xMovement, v.slideIndex) === !1) {
slideMoving = !1;
return
}
destiny.addClass(ACTIVE).siblings().removeClass(ACTIVE),
v.localIsResizing || (stopMedia(v.prevSlide),
lazyLoad(destiny)),
!options.loopHorizontal && options.controlArrows && (section.find(SLIDES_ARROW_PREV_SEL).toggle(v.slideIndex !== 0),
section.find(SLIDES_ARROW_NEXT_SEL).toggle(!destiny.is(“:last-child”))),
section.hasClass(ACTIVE) && !v.localIsResizing && setState(v.slideIndex, v.slideAnchor, v.anchorLink, v.sectionIndex),
performHorizontalMove(slides, v, !0)
}
function afterSlideLoads(v) {
activeSlidesNavigation(v.slidesNav, v.slideIndex),
v.localIsResizing || ($.isFunction(options.afterSlideLoad) && options.afterSlideLoad.call(v.destiny, v.anchorLink, v.sectionIndex + 1, v.slideAnchor, v.slideIndex),
canScroll = !0,
playMedia(v.destiny)),
slideMoving = !1
}
function performHorizontalMove(slides, v, fireCallback) {
var destinyPos = v.destinyPos;
if (options.css3) {
var translate3d = “translate3d(-” + Math.round(destinyPos.left) + “px, 0px, 0px)”;
addAnimation(slides.find(SLIDES_CONTAINER_SEL)).css(getTransforms(translate3d), v),
afterSlideLoadsId = setTimeout(function() {
fireCallback && afterSlideLoads(v)
}, options.scrollingSpeed, options.easing)
} else
slides.animate({
scrollLeft: Math.round(destinyPos.left)
}, options.scrollingSpeed, options.easing, function() {
fireCallback && afterSlideLoads(v)
})
}
function activeSlidesNavigation(slidesNav, slideIndex) {
slidesNav.find(ACTIVE_SEL).removeClass(ACTIVE),
slidesNav.find(“li”).eq(slideIndex).find(“a”).addClass(ACTIVE)
}
function resizeHandler() {
responsive();
if (isTouchDevice) {
var activeElement = $(document.activeElement);
if (!activeElement.is(“textarea”) && !activeElement.is(“input”) && !activeElement.is(“select”)) {
var currentHeight = $window.height();
Math.abs(currentHeight – previousHeight) > 20 * Math.max(previousHeight, currentHeight) / 100 && (reBuild(!0),
previousHeight = currentHeight)
}
} else
clearTimeout(resizeId),
resizeId = setTimeout(function() {
reBuild(!0)
}, 350)
}
function responsive() {
var widthLimit = options.responsive || options.responsiveWidth
, heightLimit = options.responsiveHeight
, isBreakingPointWidth = widthLimit && $window.outerWidth() < widthLimit , isBreakingPointHeight = heightLimit && $window.height() < heightLimit; widthLimit && heightLimit ? setResponsive(isBreakingPointWidth || isBreakingPointHeight) : widthLimit ? setResponsive(isBreakingPointWidth) : heightLimit && setResponsive(isBreakingPointHeight) } function addAnimation(container, element) { var transition = “all ” + options.scrollingSpeed + “ms ” + options.easingcss3; return container.removeClass(NO_TRANSITION), container.css({ “-webkit-transition”: transition, transition: transition }) } function removeAnimation(element) { return element.addClass(NO_TRANSITION) } function activateNavDots(name, sectionIndex) { options.navigation && ($(SECTION_NAV_SEL).find(ACTIVE_SEL).removeClass(ACTIVE), name ? $(SECTION_NAV_SEL).find(‘a[href=”#’ + name + ‘”]’).addClass(ACTIVE) : $(SECTION_NAV_SEL).find(“li”).eq(sectionIndex).find(“a”).addClass(ACTIVE)) } function activateMenuElement(name) { options.menu && ($(options.menu).find(ACTIVE_SEL).removeClass(ACTIVE), $(options.menu).find(‘[data-menuanchor=”‘ + name + ‘”]’).addClass(ACTIVE)) } function activateMenuAndNav(anchor, index) { activateMenuElement(anchor), activateNavDots(anchor, index) } function getYmovement(destiny) { var fromIndex = $(SECTION_ACTIVE_SEL).index(SECTION_SEL) , toIndex = destiny.index(SECTION_SEL); return fromIndex == toIndex ? “none” : fromIndex > toIndex ? “up” : “down”
}
function getXmovement(fromIndex, toIndex) {
return fromIndex == toIndex ? “none” : fromIndex > toIndex ? “left” : “right”
}
function createScrollBar(element) {
if (element.hasClass(“fp-noscroll”))
return;
element.css(“overflow”, “hidden”);
var scrollOverflowHandler = options.scrollOverflowHandler, wrap = scrollOverflowHandler.wrapContent(), section = element.closest(SECTION_SEL), scrollable = scrollOverflowHandler.scrollable(element), contentHeight;
scrollable.length ? contentHeight = scrollOverflowHandler.scrollHeight(element) : (contentHeight = element.get(0).scrollHeight,
options.verticalCentered && (contentHeight = element.find(TABLE_CELL_SEL).get(0).scrollHeight));
var scrollHeight = windowsHeight – parseInt(section.css(“padding-bottom”)) – parseInt(section.css(“padding-top”));
contentHeight > scrollHeight ? scrollable.length ? scrollOverflowHandler.update(element, scrollHeight) : (options.verticalCentered ? element.find(TABLE_CELL_SEL).wrapInner(wrap) : element.wrapInner(wrap),
scrollOverflowHandler.create(element, scrollHeight)) : scrollOverflowHandler.remove(element),
element.css(“overflow”, “”)
}
function addTableClass(element) {
element.hasClass(TABLE) || element.addClass(TABLE).wrapInner(‘

‘)
}
function getTableHeight(element) {
var sectionHeight = windowsHeight;
if (options.paddingTop || options.paddingBottom) {
var section = element;
section.hasClass(SECTION) || (section = element.closest(SECTION_SEL));
var paddings = parseInt(section.css(“padding-top”)) + parseInt(section.css(“padding-bottom”));
sectionHeight = windowsHeight – paddings
}
return sectionHeight
}
function transformContainer(translate3d, animated) {
animated ? addAnimation(container) : removeAnimation(container),
container.css(getTransforms(translate3d)),
setTimeout(function() {
container.removeClass(NO_TRANSITION)
}, 10)
}
function getSectionByAnchor(sectionAnchor) {
if (!sectionAnchor)
return [];
var section = container.find(SECTION_SEL + ‘[data-anchor=”‘ + sectionAnchor + ‘”]’);
return section.length || (section = $(SECTION_SEL).eq(sectionAnchor – 1)),
section
}
function getSlideByAnchor(slideAnchor, section) {
var slides = section.find(SLIDES_WRAPPER_SEL)
, slide = slides.find(SLIDE_SEL + ‘[data-anchor=”‘ + slideAnchor + ‘”]’);
return slide.length || (slide = slides.find(SLIDE_SEL).eq(slideAnchor)),
slide
}
function scrollPageAndSlide(destiny, slide) {
var section = getSectionByAnchor(destiny);
if (!section.length)
return;
typeof slide == “undefined” && (slide = 0),
destiny !== lastScrolledDestiny && !section.hasClass(ACTIVE) ? scrollPage(section, function() {
scrollSlider(section, slide)
}) : scrollSlider(section, slide)
}
function scrollSlider(section, slideAnchor) {
if (typeof slideAnchor != “undefined”) {
var slides = section.find(SLIDES_WRAPPER_SEL)
, destiny = getSlideByAnchor(slideAnchor, section);
destiny.length && landscapeScroll(slides, destiny)
}
}
function addSlidesNavigation(section, numSlides) {
section.append(‘
‘);
var nav = section.find(SLIDES_NAV_SEL);
nav.addClass(options.slidesNavPosition);
for (var i = 0; i < numSlides; i++) nav.find(“ul”).append(‘‘); nav.css(“margin-left”, “-” + nav.width() / 2 + “px”), nav.find(“li”).first().find(“a”).addClass(ACTIVE) } function setState(slideIndex, slideAnchor, anchorLink, sectionIndex) { var sectionHash = “”; options.anchors.length && !options.lockAnchors && (slideIndex ? (typeof anchorLink != “undefined” && (sectionHash = anchorLink), typeof slideAnchor == “undefined” && (slideAnchor = slideIndex), lastScrolledSlide = slideAnchor, setUrlHash(sectionHash + “/” + slideAnchor)) : typeof slideIndex != “undefined” ? (lastScrolledSlide = slideAnchor, setUrlHash(anchorLink)) : setUrlHash(anchorLink)), setBodyClass() } function setUrlHash(url) { if (typeof SiteParameters.slide_footer != “undefined” && url == SiteParameters.slide_footer) return !1; if (!options.recordHistory) return !1; location.hash = url } function getAnchor(element) { var anchor = element.data(“anchor”) , index = element.index(); return typeof anchor == “undefined” && (anchor = index), anchor } function setBodyClass() { var section = $(SECTION_ACTIVE_SEL) , slide = section.find(SLIDE_ACTIVE_SEL) , sectionAnchor = getAnchor(section) , slideAnchor = getAnchor(slide) , text = String(sectionAnchor); slide.length && (text = text + “-” + slideAnchor), text = text.replace(“/”, “-“).replace(“#”, “”); var classRe = new RegExp(“\b\s?” + VIEWING_PREFIX + “-[^\s]+\b”,”g”); $body[0].className = $body[0].className.replace(classRe, “”), $body.addClass(VIEWING_PREFIX + “-” + text) } function support3d() { var el = document.createElement(“p”), has3d, transforms = { webkitTransform: “-webkit-transform”, OTransform: “-o-transform”, msTransform: “-ms-transform”, MozTransform: “-moz-transform”, transform: “transform” }; document.body.insertBefore(el, null); for (var t in transforms) el.style[t] !== undefined && (el.style[t] = “translate3d(1px,1px,1px)”, has3d = window.getComputedStyle(el).getPropertyValue(transforms[t])); return document.body.removeChild(el), has3d !== undefined && has3d.length > 0 && has3d !== “none”
}
function removeMouseWheelHandler() {
document.addEventListener ? (document.removeEventListener(“mousewheel”, MouseWheelHandler, !1),
document.removeEventListener(“wheel”, MouseWheelHandler, !1),
document.removeEventListener(“MozMousePixelScroll”, MouseWheelHandler, !1)) : document.detachEvent(“onmousewheel”, MouseWheelHandler)
}
function addMouseWheelHandler() {
var prefix = “”, _addEventListener;
window.addEventListener ? _addEventListener = “addEventListener” : (_addEventListener = “attachEvent”,
prefix = “on”);
var support = “onwheel”in document.createElement(“div”) ? “wheel” : document.onmousewheel !== undefined ? “mousewheel” : “DOMMouseScroll”
, passiveEvent = g_supportsPassive ? {
passive: !1
} : !1;
support == “DOMMouseScroll” ? document[_addEventListener](prefix + “MozMousePixelScroll”, MouseWheelHandler, passiveEvent) : document[_addEventListener](prefix + support, MouseWheelHandler, passiveEvent)
}
function addMiddleWheelHandler() {
container.on(“mousedown”, mouseDownHandler).on(“mouseup”, mouseUpHandler)
}
function removeMiddleWheelHandler() {
container.off(“mousedown”, mouseDownHandler).off(“mouseup”, mouseUpHandler)
}
function addTouchHandler() {
if (isTouchDevice || isTouch)
options.autoScrolling && $body.off(events.touchmove).on(events.touchmove, preventBouncing),
$(WRAPPER_SEL).off(events.touchstart).on(events.touchstart, touchStartHandler).off(events.touchmove).on(events.touchmove, touchMoveHandler)
}
function removeTouchHandler() {
(isTouchDevice || isTouch) && $(WRAPPER_SEL).off(events.touchstart).off(events.touchmove)
}
function getMSPointer() {
var pointer;
return window.PointerEvent ? pointer = {
down: “pointerdown”,
move: “pointermove”
} : pointer = {
down: “MSPointerDown”,
move: “MSPointerMove”
},
pointer
}
function getEventsPage(e) {
var events = [];
return events.y = typeof e.pageY != “undefined” && (e.pageY || e.pageX) ? e.pageY : e.touches[0].pageY,
events.x = typeof e.pageX != “undefined” && (e.pageY || e.pageX) ? e.pageX : e.touches[0].pageX,
isTouch && isReallyTouch(e) && options.scrollBar && (events.y = e.touches[0].pageY,
events.x = e.touches[0].pageX),
events
}
function silentLandscapeScroll(activeSlide, noCallbacks) {
setScrollingSpeed(0, “internal”),
typeof noCallbacks != “undefined” && (isResizing = !0),
landscapeScroll(activeSlide.closest(SLIDES_WRAPPER_SEL), activeSlide),
typeof noCallbacks != “undefined” && (isResizing = !1),
setScrollingSpeed(originals.scrollingSpeed, “internal”)
}
function silentScroll(top) {
var roundedTop = Math.round(top);
if (options.css3 && options.autoScrolling && !options.scrollBar) {
var translate3d = “translate3d(0px, -” + roundedTop + “px, 0px)”;
transformContainer(translate3d, !1)
} else
options.autoScrolling && !options.scrollBar ? container.css(“top”, -roundedTop) : $htmlBody.scrollTop(roundedTop)
}
function getTransforms(translate3d) {
return {
“-webkit-transform”: translate3d,
“-moz-transform”: translate3d,
“-ms-transform”: translate3d,
transform: translate3d
}
}
function setIsScrollAllowed(value, direction, type) {
switch (direction) {
case “up”:
isScrollAllowed[type].up = value;
break;
case “down”:
isScrollAllowed[type].down = value;
break;
case “left”:
isScrollAllowed[type].left = value;
break;
case “right”:
isScrollAllowed[type].right = value;
break;
case “all”:
type == “m” ? setAllowScrolling(value) : setKeyboardScrolling(value)
}
}
function destroy(all) {
setAutoScrolling(!1, “internal”),
setAllowScrolling(!1),
setKeyboardScrolling(!1),
container.addClass(DESTROYED),
clearTimeout(afterSlideLoadsId),
clearTimeout(afterSectionLoadsId),
clearTimeout(resizeId),
clearTimeout(scrollId),
clearTimeout(scrollId2),
$window.off(“scroll”, scrollHandler).off(“hashchange”, hashChangeHandler).off(“resize”, resizeHandler),
$document.off(“click touchstart”, SECTION_NAV_SEL + ” a”).off(“mouseenter”, SECTION_NAV_SEL + ” li”).off(“mouseleave”, SECTION_NAV_SEL + ” li”).off(“click touchstart”, SLIDES_NAV_LINK_SEL).off(“mouseover”, options.normalScrollElements).off(“mouseout”, options.normalScrollElements),
$(SECTION_SEL).off(“click touchstart”, SLIDES_ARROW_SEL),
clearTimeout(afterSlideLoadsId),
clearTimeout(afterSectionLoadsId),
all && destroyStructure()
}
function destroyStructure() {
silentScroll(0),
container.find(“img[data-src], source[data-src], audio[data-src], iframe[data-src]”).each(function() {
setSrc($(this), “src”)
}),
container.find(“img[data-srcset]”).each(function() {
setSrc($(this), “srcset”)
}),
$(SECTION_NAV_SEL + “, ” + SLIDES_NAV_SEL + “, ” + SLIDES_ARROW_SEL).remove(),
$(SECTION_SEL).css({
height: “”,
“background-color”: “”,
padding: “”
}),
$(SLIDE_SEL).css({
width: “”
}),
container.css({
height: “”,
position: “”,
“-ms-touch-action”: “”,
“touch-action”: “”
}),
$htmlBody.css({
overflow: “”,
height: “”
}),
$(“html”).removeClass(ENABLED),
$body.removeClass(RESPONSIVE),
$.each($body.get(0).className.split(/\s+/), function(index, className) {
className.indexOf(VIEWING_PREFIX) === 0 && $body.removeClass(className)
}),
$(SECTION_SEL + “, ” + SLIDE_SEL).each(function() {
options.scrollOverflowHandler.remove($(this)),
$(this).removeClass(TABLE + ” ” + ACTIVE)
}),
removeAnimation(container),
container.find(TABLE_CELL_SEL + “, ” + SLIDES_CONTAINER_SEL + “, ” + SLIDES_WRAPPER_SEL).each(function() {
$(this).replaceWith(this.childNodes)
}),
container.css({
“-webkit-transition”: “none”,
transition: “none”
}),
$htmlBody.scrollTop(0);
var usedSelectors = [SECTION, SLIDE, SLIDES_CONTAINER];
$.each(usedSelectors, function(index, value) {
$(“.” + value).removeClass(value)
})
}
function setVariableState(variable, value, type) {
options[variable] = value,
type !== “internal” && (originals[variable] = value)
}
function displayWarnings() {
var extensions = [“fadingEffect”, “continuousHorizontal”, “scrollHorizontally”, “interlockedSlides”, “resetSliders”, “responsiveSlides”, “offsetSections”, “dragAndMove”, “scrollOverflowReset”, “parallax”];
$.each(extensions, function(index, extension) {
options[extension] && showError(“warn”, “fullpage.js extensions require jquery.fullpage.extensions.min.js file instead of the usual jquery.fullpage.js. Requested: ” + extension)
}),
$.each(options.anchors, function(index, name) {
var nameAttr = $document.find(“[name]”).filter(function() {
return $(this).attr(“name”) && $(this).attr(“name”).toLowerCase() == name.toLowerCase()
})
, idAttr = $document.find(“[id]”).filter(function() {
return $(this).attr(“id”) && $(this).attr(“id”).toLowerCase() == name.toLowerCase()
});
if (idAttr.length || nameAttr.length)
showError(“error”, “data-anchor tags can not have the same value as any id element on the site (or name element for IE).”),
idAttr.length && showError(“error”, ‘”‘ + name + ‘” is is being used by another element id property’),
nameAttr.length && showError(“error”, ‘”‘ + name + ‘” is is being used by another element name property’)
})
}
function showError(type, text) {
console && console[type] && console[type](“fullPage: ” + text)
}
if ($(“html”).hasClass(ENABLED)) {
displayWarnings();
return
}
var $htmlBody = $(“html, body”)
, $body = $(“body”)
, FP = $.fn.fullpage;
options = $.extend({
menu: !1,
anchors: [],
lockAnchors: !1,
navigation: !1,
navigationPosition: “right”,
navigationTooltips: [],
showActiveTooltip: !1,
slidesNavigation: !1,
slidesNavPosition: “bottom”,
scrollBar: !1,
hybrid: !1,
css3: !0,
scrollingSpeed: 700,
autoScrolling: !0,
fitToSection: !0,
fitToSectionDelay: 1e3,
easing: “easeInOutCubic”,
easingcss3: “ease”,
loopBottom: !1,
loopTop: !1,
loopHorizontal: !0,
continuousVertical: !1,
continuousHorizontal: !1,
scrollHorizontally: !1,
interlockedSlides: !1,
dragAndMove: !1,
offsetSections: !1,
resetSliders: !1,
fadingEffect: !1,
normalScrollElements: null,
scrollOverflow: !1,
scrollOverflowReset: !1,
scrollOverflowHandler: iscrollHandler,
scrollOverflowOptions: null,
touchSensitivity: 5,
normalScrollElementTouchThreshold: 5,
bigSectionsDestination: null,
keyboardScrolling: !0,
animateAnchor: !0,
recordHistory: !0,
controlArrows: !0,
controlArrowColor: “#fff”,
verticalCentered: !0,
sectionsColor: [],
paddingTop: 0,
paddingBottom: 0,
fixedElements: null,
responsive: 0,
responsiveWidth: 0,
responsiveHeight: 0,
responsiveSlides: !1,
parallax: !1,
parallaxOptions: {
type: “reveal”,
percentage: 62,
property: “translate”
},
sectionSelector: SECTION_DEFAULT_SEL,
slideSelector: SLIDE_DEFAULT_SEL,
afterLoad: null,
onLeave: null,
afterRender: null,
afterResize: null,
afterReBuild: null,
afterSlideLoad: null,
onSlideLeave: null,
afterResponsive: null,
lazyLoading: !0
}, options);
var slideMoving = !1, isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/), isTouch = “ontouchstart”in window || navigator.msMaxTouchPoints > 0 || navigator.maxTouchPoints, container = $(this), windowsHeight = $window.height(), isResizing = !1, isWindowFocused = !0, lastScrolledDestiny, lastScrolledSlide, canScroll = !0, scrollings = [], controlPressed, startingSection, isScrollAllowed = {};
isScrollAllowed.m = {
up: !0,
down: !0,
left: !0,
right: !0
},
isScrollAllowed.k = $.extend(!0, {}, isScrollAllowed.m);
var MSPointer = getMSPointer()
, events = {
touchmove: “ontouchmove”in window ? “touchmove” : MSPointer.move,
touchstart: “ontouchstart”in window ? “touchstart” : MSPointer.down
}
, g_supportsPassive = !1;
try {
var opts = Object.defineProperty({}, “passive”, {
get: function() {
g_supportsPassive = !0
}
});
window.addEventListener(“testPassive”, null, opts),
window.removeEventListener(“testPassive”, null, opts)
} catch (e) {}
var resizeId, afterSectionLoadsId, afterSlideLoadsId, scrollId, scrollId2, keydownId, originals = $.extend(!0, {}, options), $masthead = $(“#masthead”), hideMenu = !$(“body”).hasClass(“vmenu”) && $(“body”).hasClass(“uncode-fp-menu-hide”) ? !0 : !1, menuHeight = $masthead.hasClass(“menu-transparent”) || hideMenu ? 0 : UNCODE.menuHeight, bodyBorder = UNCODE.bodyBorder, adminBarHeight = UNCODE.adminBarHeight;
displayWarnings(),
iscrollOptions.click = isTouch,
iscrollOptions = $.extend(iscrollOptions, options.scrollOverflowOptions),
$.extend($.easing, {
easeInOutCubic: function(x, t, b, c, d) {
return (t /= d / 2) < 1 ? c / 2 * t * t * t + b : c / 2 * ((t -= 2) * t * t + 2) + b } }), $(this).length && (FP.setAutoScrolling = setAutoScrolling, FP.setRecordHistory = setRecordHistory, FP.setScrollingSpeed = setScrollingSpeed, FP.setFitToSection = setFitToSection, FP.setLockAnchors = setLockAnchors, FP.setMouseWheelScrolling = setMouseWheelScrolling, FP.setAllowScrolling = setAllowScrolling, FP.setKeyboardScrolling = setKeyboardScrolling, FP.moveSectionUp = moveSectionUp, FP.moveSectionDown = moveSectionDown, FP.silentMoveTo = silentMoveTo, FP.moveTo = moveTo, FP.moveSlideRight = moveSlideRight, FP.moveSlideLeft = moveSlideLeft, FP.fitToSection = fitToSection, FP.reBuild = reBuild, FP.setResponsive = setResponsive, FP.destroy = destroy, init(), bindEvents()); var isScrolling = !1 , lastScroll = 0 , touchStartY = 0 , touchStartX = 0 , touchEndY = 0 , touchEndX = 0 , prevTime = (new Date).getTime() , previousDestTop = 0 , oldPageY = 0 , previousHeight = windowsHeight } , typeof IScroll != “undefined” && (IScroll.prototype.wheelOn = function() { this.wrapper.addEventListener(“wheel”, this), this.wrapper.addEventListener(“mousewheel”, this), this.wrapper.addEventListener(“DOMMouseScroll”, this) } , IScroll.prototype.wheelOff = function() { this.wrapper.removeEventListener(“wheel”, this), this.wrapper.removeEventListener(“mousewheel”, this), this.wrapper.removeEventListener(“DOMMouseScroll”, this) } ); var iscrollHandler = { refreshId: null, iScrollInstances: [], toggleWheel: function(value) { var scrollable = $(SECTION_ACTIVE_SEL).find(SCROLLABLE_SEL); scrollable.each(function() { var iScrollInstance = $(this).data(“iscrollInstance”); typeof iScrollInstance != “undefined” && iScrollInstance && (value ? iScrollInstance.wheelOn() : iScrollInstance.wheelOff()) }) }, onLeave: function() { iscrollHandler.toggleWheel(!1) }, beforeLeave: function() { iscrollHandler.onLeave() }, afterLoad: function() { iscrollHandler.toggleWheel(!0) }, create: function(element, scrollHeight) { var scrollable = element.find(SCROLLABLE_SEL); scrollable.height(scrollHeight), scrollable.each(function() { var $this = $(this) , iScrollInstance = $this.data(“iscrollInstance”); iScrollInstance && $.each(iscrollHandler.iScrollInstances, function() { $(this).destroy() }), iScrollInstance = new IScroll($this.get(0),iscrollOptions), iscrollHandler.iScrollInstances.push(iScrollInstance), iScrollInstance.wheelOff(), $this.data(“iscrollInstance”, iScrollInstance) }) }, isScrolled: function(type, scrollable) { var scroller = scrollable.data(“iscrollInstance”); if (!scroller) return !0; if (type === “top”) return scroller.y >= 0 && !scrollable.scrollTop();
if (type === “bottom”)
return 0 – scroller.y + scrollable.scrollTop() + 1 + scrollable.innerHeight() >= scrollable[0].scrollHeight
},
scrollable: function(activeSection) {
return activeSection.find(SLIDES_WRAPPER_SEL).length ? activeSection.find(SLIDE_ACTIVE_SEL).find(SCROLLABLE_SEL) : activeSection.find(SCROLLABLE_SEL)
},
scrollHeight: function(element) {
return element.find(SCROLLABLE_SEL).children().first().get(0).scrollHeight
},
remove: function(element) {
var scrollable = element.find(SCROLLABLE_SEL);
if (scrollable.length) {
var iScrollInstance = scrollable.data(“iscrollInstance”);
iScrollInstance.destroy(),
scrollable.data(“iscrollInstance”, null)
}
element.find(SCROLLABLE_SEL).children().first().children().first().unwrap().unwrap()
},
update: function(element, scrollHeight) {
clearTimeout(iscrollHandler.refreshId),
iscrollHandler.refreshId = setTimeout(function() {
$.each(iscrollHandler.iScrollInstances, function() {
$(this).get(0).refresh()
})
}, 150),
element.find(SCROLLABLE_SEL).css(“height”, scrollHeight + “px”).parent().css(“height”, scrollHeight + “px”)
},
wrapContent: function() {
return ”
}
}
}),
+function($) {
“use strict”;
var Collapse = function(element, options) {
this.$element = $(element),
this.options = $.extend({}, Collapse.DEFAULTS, options),
this.transitioning = null,
this.options.parent && (this.$parent = $(this.options.parent)),
this.options.toggle && this.toggle()
};
Collapse.DEFAULTS = {
toggle: !0
},
Collapse.prototype.dimension = function() {
var hasWidth = this.$element.hasClass(“width”);
return hasWidth ? “width” : “height”
}
,
Collapse.prototype.show = function() {
if (this.transitioning || this.$element.hasClass(“in”))
return;
var startEvent = $.Event(“show.bs.collapse”);
this.$element.trigger(startEvent);
if (startEvent.isDefaultPrevented())
return;
var actives = this.$parent && this.$parent.find(“> .panel > .in”);
if (actives && actives.length) {
var hasData = actives.data(“bs.collapse”);
if (hasData && hasData.transitioning)
return;
actives.collapse(“hide”),
hasData || actives.data(“bs.collapse”, null)
}
var dimension = this.dimension();
this.$element.removeClass(“collapse”).addClass(“collapsing”)dimension,
this.transitioning = 1;
var complete = function(e) {
if (e && e.target != this.$element[0])
return;
this.$element.removeClass(“collapsing”).addClass(“collapse in”)dimension,
this.transitioning = 0,
this.$element.trigger(“shown.bs.collapse”)
};
if (!$.support.transition)
return complete.call(this);
var scrollSize = $.camelCase([“scroll”, dimension].join(“-“));
this.$element.one($.support.transition.end, $.proxy(complete, this)).emulateTransitionEnd(350)dimension
}
,
Collapse.prototype.hide = function() {
if (this.transitioning || !this.$element.hasClass(“in”))
return;
var startEvent = $.Event(“hide.bs.collapse”);
this.$element.trigger(startEvent);
if (startEvent.isDefaultPrevented())
return;
var dimension = this.dimension();
this.$elementdimension[0].offsetHeight,
this.$element.addClass(“collapsing”).removeClass(“collapse”).removeClass(“in”),
this.transitioning = 1;
var complete = function(e) {
if (e && e.target != this.$element[0])
return;
this.transitioning = 0,
this.$element.trigger(“hidden.bs.collapse”).removeClass(“collapsing”).addClass(“collapse”)
};
if (!$.support.transition)
return complete.call(this);
this.$elementdimension.one($.support.transition.end, $.proxy(complete, this)).emulateTransitionEnd(350)
}
,
Collapse.prototype.toggle = function() {
this[this.$element.hasClass(“in”) ? “hide” : “show”]()
}
;
var old = $.fn.collapse;
$.fn.collapse = function(option) {
return this.each(function() {
var $this = $(this)
, data = $this.data(“bs.collapse”)
, options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == “object” && option);
!data && options.toggle && option == “show” && (option = !option),
data || $this.data(“bs.collapse”, data = new Collapse(this,options)),
typeof option == “string” && data[option]()
})
}
,
$.fn.collapse.Constructor = Collapse,
$.fn.collapse.noConflict = function() {
return $.fn.collapse = old,
this
}
,
$(document).on(“click.bs.collapse.data-api”, ‘[data-toggle=”collapse”]’, function(e) {
var $this = $(this), href, target = $this.attr(“data-target”) || e.preventDefault() || (href = $this.attr(“href”)) && href.replace(/.(?=#[^\s]+$)/, “”), _target = href.replace(/^#/, “”); if ($(‘[data-id=”‘ + _target + ‘”]’).length) var $target = $(‘[data-id=”‘ + _target + ‘”]’); else var $target = $(target); var data = $target.data(“bs.collapse”) , option = data ? “toggle” : $this.data() , parent = $this.attr(“data-parent”) , $parent = parent && $(parent); if (!data || !data.transitioning) $parent && $parent.find(‘[data-toggle=”collapse”][data-parent=”‘ + parent + ‘”]’).not($this).addClass(“collapsed”), $this$target.hasClass(“in”) ? “addClass” : “removeClass”; $target.collapse(option) }) }(jQuery), +function($) { “use strict”; var Tab = function(element) { this.element = $(element) }; Tab.prototype.show = function() { var $this = this.element , $ul = $this.closest(“ul:not(.dropdown-menu)”) , selector = $this.data(“target”); selector || (selector = $this.attr(“href”), selector = selector && selector.replace(/.(?=#[^\s]*$)/, “”));
if ($this.parent(“li”).hasClass(“active”))
return;
var previous = $ul.find(“.active:last a”)[0]
, e = $.Event(“show.bs.tab”, {
relatedTarget: previous
});
$this.trigger(e);
if (e.isDefaultPrevented())
return;
var _target = selector.replace(/^#/, “”);
if ($(‘[data-id=”‘ + _target + ‘”]’).length)
var $target = $(‘[data-id=”‘ + _target + ‘”]’);
else
var $target = $(selector);
this.activate($this.parent(“li”), $ul),
this.activate($target, $target.parent(), function() {
$this.trigger({
type: “shown.bs.tab”,
relatedTarget: previous
})
})
}
,
Tab.prototype.activate = function(element, container, callback) {
function next() {
$active.removeClass(“active”).find(“> .dropdown-menu > .active”).removeClass(“active”),
element.addClass(“active”),
transition ? (element[0].offsetWidth,
element.addClass(“in”)) : element.removeClass(“fade”),
element.parent(“.dropdown-menu”) && element.closest(“li.dropdown”).addClass(“active”),
callback && callback()
}
var $active = container.find(“> .active”)
, transition = callback && $.support.transition && $active.hasClass(“fade”);
transition ? $active.one($.support.transition.end, next).emulateTransitionEnd(150) : next(),
$active.removeClass(“in”)
}
;
var old = $.fn.tab;
$.fn.tab = function(option) {
return this.each(function() {
var $this = $(this)
, data = $this.data(“bs.tab”);
data || $this.data(“bs.tab”, data = new Tab(this)),
typeof option == “string” && data[option]()
})
}
,
$.fn.tab.Constructor = Tab,
$.fn.tab.noConflict = function() {
return $.fn.tab = old,
this
}
,
$(document).on(“click.bs.tab.data-api”, ‘[data-toggle=”tab”], [data-toggle=”pill”]’, function(e) {
e.preventDefault(),
$(this).tab(“show”)
})
}(jQuery),
+function($) {
“use strict”;
var Tooltip = function(element, options) {
this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
this.init(“tooltip”, element, options)
};
Tooltip.DEFAULTS = {
animation: !0,
placement: “top”,
selector: !1,
template: ”,
trigger: “hover focus”,
title: “”,
delay: 0,
html: !1,
container: !1,
viewport: {
selector: “body”,
padding: 0
}
},
Tooltip.prototype.init = function(type, element, options) {
this.enabled = !0,
this.type = type,
this.$element = $(element),
this.options = this.getOptions(options),
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport);
var triggers = this.options.trigger.split(” “);
for (var i = triggers.length; i–; ) {
var trigger = triggers[i];
if (trigger == “click”)
this.$element.on(“click.” + this.type, this.options.selector, $.proxy(this.toggle, this));
else if (trigger != “manual”) {
var eventIn = trigger == “hover” ? “mouseenter” : “focusin”
, eventOut = trigger == “hover” ? “mouseleave” : “focusout”;
this.$element.on(eventIn + “.” + this.type, this.options.selector, $.proxy(this.enter, this)),
this.$element.on(eventOut + “.” + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ? this._options = $.extend({}, this.options, {
trigger: “manual”,
selector: “”
}) : this.fixTitle()
}
,
Tooltip.prototype.getDefaults = function() {
return Tooltip.DEFAULTS
}
,
Tooltip.prototype.getOptions = function(options) {
return options = $.extend({}, this.getDefaults(), this.$element.data(), options),
options.delay && typeof options.delay == “number” && (options.delay = {
show: options.delay,
hide: options.delay
}),
options
}
,
Tooltip.prototype.getDelegateOptions = function() {
var options = {}
, defaults = this.getDefaults();
return this._options && $.each(this._options, function(key, value) {
defaults[key] != value && (options[key] = value)
}),
options
}
,
Tooltip.prototype.enter = function(obj) {
var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)this.type.data(“bs.” + this.type);
clearTimeout(self.timeout),
self.hoverState = “in”;
if (!self.options.delay || !self.options.delay.show)
return self.show();
self.timeout = setTimeout(function() {
self.hoverState == “in” && self.show()
}, self.options.delay.show)
}
,
Tooltip.prototype.leave = function(obj) {
var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)this.type.data(“bs.” + this.type);
clearTimeout(self.timeout),
self.hoverState = “out”;
if (!self.options.delay || !self.options.delay.hide)
return self.hide();
self.timeout = setTimeout(function() {
self.hoverState == “out” && self.hide()
}, self.options.delay.hide)
}
,
Tooltip.prototype.show = function() {
var e = $.Event(“show.bs.” + this.type);
if (this.hasContent() && this.enabled) {
this.$element.trigger(e);
if (e.isDefaultPrevented())
return;
var that = this
, $tip = this.tip();
this.setContent(),
this.options.animation && $tip.addClass(“fade”);
var placement = typeof this.options.placement == “function” ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement
, autoToken = /\s?auto?\s?/i
, autoPlace = autoToken.test(placement);
autoPlace && (placement = placement.replace(autoToken, “”) || “top”),
$tip.detach().css({
top: 0,
left: 0,
display: “block”
}).addClass(placement),
this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element);
var pos = this.getPosition()
, actualWidth = $tip[0].offsetWidth
, actualHeight = $tip[0].offsetHeight;
if (autoPlace) {
var orgPlacement = placement
, $parent = this.$element.parent()
, parentDim = this.getPosition($parent);
placement = placement == “bottom” && pos.top + pos.height + actualHeight – parentDim.scroll > parentDim.height ? “top” : placement == “top” && pos.top – parentDim.scroll – actualHeight < 0 ? “bottom” : placement == “right” && pos.right + actualWidth > parentDim.width ? “left” : placement == “left” && pos.left – actualWidth < parentDim.left ? “right” : placement, $tip.removeClass(orgPlacement).addClass(placement) } var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight); this.applyPlacement(calculatedOffset, placement), this.hoverState = null; var complete = function() { that.$element.trigger(“shown.bs.” + that.type) }; $.support.transition && this.$tip.hasClass(“fade”) ? $tip.one($.support.transition.end, complete).emulateTransitionEnd(150) : complete() } } , Tooltip.prototype.applyPlacement = function(offset, placement) { var $tip = this.tip() , width = $tip[0].offsetWidth , height = $tip[0].offsetHeight , marginTop = parseInt($tip.css(“margin-top”), 10) , marginLeft = parseInt($tip.css(“margin-left”), 10); isNaN(marginTop) && (marginTop = 0), isNaN(marginLeft) && (marginLeft = 0), offset.top = offset.top + marginTop, offset.left = offset.left + marginLeft, $.offset.setOffset($tip[0], $.extend({ using: function(props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0), $tip.addClass(“in”); var actualWidth = $tip[0].offsetWidth , actualHeight = $tip[0].offsetHeight; placement == “top” && actualHeight != height && (offset.top = offset.top + height – actualHeight); var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight); delta.left ? offset.left += delta.left : offset.top += delta.top; var arrowDelta = delta.left ? delta.left * 2 – width + actualWidth : delta.top * 2 – height + actualHeight , arrowPosition = delta.left ? “left” : “top” , arrowOffsetPosition = delta.left ? “offsetWidth” : “offsetHeight”; $tip.offset(offset), this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition) } , Tooltip.prototype.replaceArrow = function(delta, dimension, position) { this.arrow().css(position, delta ? 50 * (1 – delta / dimension) + “%” : “”) } , Tooltip.prototype.setContent = function() { var $tip = this.tip() , title = this.getTitle(); $tip.find(“.tooltip-inner”)this.options.html ? “html” : “text”, $tip.removeClass(“fade in top bottom left right”) } , Tooltip.prototype.hide = function() { function complete() { that.hoverState != “in” && $tip.detach(), that.$element.trigger(“hidden.bs.” + that.type) } var that = this , $tip = this.tip() , e = $.Event(“hide.bs.” + this.type); this.$element.trigger(e); if (e.isDefaultPrevented()) return; return $tip.removeClass(“in”), $.support.transition && this.$tip.hasClass(“fade”) ? $tip.one($.support.transition.end, complete).emulateTransitionEnd(150) : complete(), this.hoverState = null, this } , Tooltip.prototype.fixTitle = function() { var $e = this.$element; ($e.attr(“title”) || typeof $e.attr(“data-original-title”) != “string”) && $e.attr(“data-original-title”, $e.attr(“title”) || “”).attr(“title”, “”) } , Tooltip.prototype.hasContent = function() { return this.getTitle() } , Tooltip.prototype.getPosition = function($element) { $element = $element || this.$element; var el = $element[0] , isBody = el.tagName == “BODY”; return $.extend({}, typeof el.getBoundingClientRect == “function” ? el.getBoundingClientRect() : null, { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(), width: isBody ? $(window).width() : $element.outerWidth(), height: isBody ? $(window).height() : $element.outerHeight() }, isBody ? { top: 0, left: 0 } : $element.offset()) } , Tooltip.prototype.getCalculatedOffset = function(placement, pos, actualWidth, actualHeight) { return placement == “bottom” ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 – actualWidth / 2 } : placement == “top” ? { top: pos.top – actualHeight, left: pos.left + pos.width / 2 – actualWidth / 2 } : placement == “left” ? { top: pos.top + pos.height / 2 – actualHeight / 2, left: pos.left – actualWidth } : { top: pos.top + pos.height / 2 – actualHeight / 2, left: pos.left + pos.width } } , Tooltip.prototype.getViewportAdjustedDelta = function(placement, pos, actualWidth, actualHeight) { var delta = { top: 0, left: 0 }; if (!this.$viewport) return delta; var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 , viewportDimensions = this.getPosition(this.$viewport); if (/right|left/.test(placement)) { var topEdgeOffset = pos.top – viewportPadding – viewportDimensions.scroll , bottomEdgeOffset = pos.top + viewportPadding – viewportDimensions.scroll + actualHeight; topEdgeOffset < viewportDimensions.top ? delta.top = viewportDimensions.top – topEdgeOffset : bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height && (delta.top = viewportDimensions.top + viewportDimensions.height – bottomEdgeOffset)
} else {
var leftEdgeOffset = pos.left – viewportPadding
, rightEdgeOffset = pos.left + viewportPadding + actualWidth;
leftEdgeOffset < viewportDimensions.left ? delta.left = viewportDimensions.left – leftEdgeOffset : rightEdgeOffset > viewportDimensions.width && (delta.left = viewportDimensions.left + viewportDimensions.width – rightEdgeOffset)
}
return delta
}
,
Tooltip.prototype.getTitle = function() {
var title, $e = this.$element, o = this.options;
return title = $e.attr(“data-original-title”) || (typeof o.title == “function” ? o.title.call($e[0]) : o.title),
title
}
,
Tooltip.prototype.tip = function() {
return this.$tip = this.$tip || $(this.options.template)
}
,
Tooltip.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(“.tooltip-arrow”)
}
,
Tooltip.prototype.validate = function() {
this.$element[0].parentNode || (this.hide(),
this.$element = null,
this.options = null)
}
,
Tooltip.prototype.enable = function() {
this.enabled = !0
}
,
Tooltip.prototype.disable = function() {
this.enabled = !1
}
,
Tooltip.prototype.toggleEnabled = function() {
this.enabled = !this.enabled
}
,
Tooltip.prototype.toggle = function(e) {
var self = e ? $(e.currentTarget)this.type.data(“bs.” + this.type) : this;
self.tip().hasClass(“in”) ? self.leave(self) : self.enter(self)
}
,
Tooltip.prototype.destroy = function() {
clearTimeout(this.timeout),
this.hide().$element.off(“.” + this.type).removeData(“bs.” + this.type)
}
;
var old = $.fn.tooltip;
$.fn.tooltip = function(option) {
return this.each(function() {
var $this = $(this)
, data = $this.data(“bs.tooltip”)
, options = typeof option == “object” && option;
if (!data && option == “destroy”)
return;
data || $this.data(“bs.tooltip”, data = new Tooltip(this,options)),
typeof option == “string” && data[option]()
})
}
,
$.fn.tooltip.Constructor = Tooltip,
$.fn.tooltip.noConflict = function() {
return $.fn.tooltip = old,
this
}
}(jQuery),
+function($) {
“use strict”;
function transitionEnd() {
var el = document.createElement(“bootstrap”)
, transEndEventNames = {
WebkitTransition: “webkitTransitionEnd”,
MozTransition: “transitionend”,
OTransition: “oTransitionEnd otransitionend”,
transition: “transitionend”
};
for (var name in transEndEventNames)
if (el.style[name] !== undefined)
return {
end: transEndEventNames[name]
};
return !1
}
$.fn.emulateTransitionEnd = function(duration) {
var called = !1
, $el = this;
$(this).one($.support.transition.end, function() {
called = !0
});
var callback = function() {
called || $($el).trigger($.support.transition.end)
};
return setTimeout(callback, duration),
this
}
,
$(function() {
$.support.transition = transitionEnd()
})
}(jQuery);
(function($) {
“use strict”;
var UNCODE = window.UNCODE || {};
window.UNCODE = UNCODE,
window.requestAnimFrame = function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback, element) {
window.setTimeout(callback, 1e3 / 60)
}
}(),
window.requestTimeout = function(fn, delay) {
function loop() {
var current = (new Date).getTime()
, delta = current – start;
delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop)
}
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame && (!window.mozRequestAnimationFrame || !window.mozCancelRequestAnimationFrame) && !window.oRequestAnimationFrame && !window.msRequestAnimationFrame)
return window.setTimeout(fn, delay);
var start = (new Date).getTime()
, handle = new Object;
return handle.value = requestAnimFrame(loop),
handle
}
,
window.clearRequestTimeout = function(handle) {
typeof handle != “undefined” && (window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) : window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) : window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) : window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) : window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) : clearTimeout(handle))
}
,
UNCODE.utils = function() {
$(“.btn-tooltip”).tooltip(),
$(“a”).hover(function() {
$(this).attr(“data-title”, $(this).attr(“title”)),
$(this).removeAttr(“title”)
}, function() {
$(this).attr(“title”, $(this).attr(“data-title”))
});
var $counters = $(“.counter:not(.counter-init)”);
$counters.each(function() {
var $counter = $(this).addClass(“counter-init”);
if ($counter.closest(“.owl-carousel”).length)
return;
$counter.addClass(“started”).counterUp({
delay: 10,
time: 1500
})
});
var $countdowns = $(“[data-countdown]:not(.counter-init)”);
$countdowns.each(function() {
var $this = $(this).addClass(“counter-init”)
, finalDate = $(this).data(“countdown”);
$this.countdown(finalDate, function(event) {
$this.html(event.strftime(“%D ” + SiteParameters.days + “ %H ” + SiteParameters.hours + “ %M ” + SiteParameters.minutes + “ %S ” + SiteParameters.seconds + ““))
})
});
var share_button_top = new Share(“.share-button”,{
ui: {
flyout: “top center”,
button_font: !1,
button_text: “”,
icon_font: !1
}
});
this.get_scroll_offset = function(target) {
var scroll_offset = 0
, is_first_link = !1;
return ($(“.menu-hide”).length || $(“.menu-hide-vertical”).length) && UNCODE.bodyTop > UNCODE.wheight / 2 && UNCODE.hideMenu(100),
$(“.menu-sticky .menu-container:not(.menu-hide)”).length && !$(“.menu-shrink”).length ? scroll_offset += $(“.menu-sticky .menu-container”).outerHeight() : $(“.menu-sticky”).length && !$(“.menu-hide”).length || $(“.menu-sticky-vertical”).length && !$(“.menu-hide-vertical”).length ? scroll_offset += UNCODE.menuMobileHeight : UNCODE.wwidth < UNCODE.mediaQuery && (scroll_offset += $(“.main-menu-container.open-items”).height()), scroll_offset += UNCODE.bodyBorder, scroll_offset } , UNCODE.isFullPage || ($(document).on(“click”, ‘a[href*=”#”]’, function(e) { var hash = e.currentTarget.hash , is_scrolltop = $(e.currentTarget).hasClass(“scroll-top”) ? !0 : !1 , anchor = “”; if ($(e.currentTarget).data(“toggle”) == “tab” || $(e.currentTarget).data(“toggle”) == “collapse”) return; if ($(e.currentTarget).hasClass(“woocommerce-review-link”)) { e.preventDefault(), $(“#tab-reviews”).is(“:visible”) || $(‘a[href=”#tab-reviews”]’).trigger(“click”); var calc_scroll = $(“.wootabs .tab-content”).offset().top; calc_scroll -= UNCODE.get_scroll_offset(e.target); var shrink = typeof $(“.navbar-brand”).data(“padding-shrink”) != “undefined” ? $(“.navbar-brand”).data(“padding-shrink”) * 2 : 36; $(“.menu-sticky .menu-container:not(.menu-hide)”).length && $(“.menu-shrink”).length && (scrollTo += UNCODE.menuHeight – ($(“.navbar-brand”).data(“minheight”) + shrink)); var bodyTop = document.documentElement.scrollTop || document.body.scrollTop , delta = bodyTop – calc_scroll , scrollSpeed = SiteParameters.constant_scroll == “on” ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; scrollSpeed < 1e3 && SiteParameters.constant_scroll == “on” && (scrollSpeed = 1e3), requestTimeout(function() { scrollSpeed == 0 ? ($(“html, body”).scrollTop(calc_scroll), UNCODE.scrolling = !1) : $(“html, body”).animate({ scrollTop: calc_scroll }, scrollSpeed, “easeInOutCubic”, function() { UNCODE.scrolling = !1 }) }, 200); return } if (hash != undefined) { var specialFormat = /[ !@#$%^&*()
+-=[]{};’:”\|,.<>\/?]/
, anchor = this.hash.slice(1);
!specialFormat.test(hash) && location.pathname.replace(/^\//g, “”) == this.pathname.replace(/^\//g, “”) && location.hostname == this.hostname && (specialFormat.test(hash) || $(hash).length && (anchor = $(hash)))
}
if (is_scrolltop || anchor != “”)
if (is_scrolltop) {
e.preventDefault();
var bodyTop = document.documentElement.scrollTop || document.body.scrollTop
, scrollSpeed = SiteParameters.constant_scroll == “on” ? Math.abs(bodyTop) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
scrollSpeed < 1e3 && SiteParameters.constant_scroll == “on” && (scrollSpeed = 1e3), scrollSpeed == 0 ? ($(“html, body”).scrollTop(0), UNCODE.scrolling = !1) : $(“html, body”).animate({ scrollTop: 0 }, scrollSpeed, “easeInOutCubic”, function() { UNCODE.scrolling = !1 }) } else { var scrollSection = typeof anchor == “string” ? $(“[data-name=” + anchor + “]”) : anchor; $.each($(“.menu-container .menu-item > a, .widget_nav_menu .menu-smart .menu-item > a”), function(index, val) {
var get_href = $(val).attr(“href”);
get_href != undefined && (get_href.substring(get_href.indexOf(“#”) + 1) == anchor ? $(val).parent().addClass(“active”) : $(val).parent().removeClass(“active”))
});
if (scrollSection.length) {
$(“body”).hasClass(“uncode-scroll-no-history”) && e.preventDefault(),
UNCODE.menuOpened && (UNCODE.wwidth < UNCODE.mediaQuery ? window.dispatchEvent(UNCODE.menuMobileTriggerEvent) : $(“.mmb-container-overlay .overlay-close”).trigger(“click”)); var calc_scroll = scrollSection.offset().top, getOffset = UNCODE.get_scroll_offset(), $logo = $(“#logo-container-mobile”), logoH, $menu = $(“#masthead .menu-container”), menuH; calc_scroll -= getOffset; var bodyTop = document.documentElement.scrollTop || document.body.scrollTop , delta = bodyTop – calc_scroll , scrollSpeed = SiteParameters.constant_scroll == “on” ? Math.abs(delta) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed; scrollSpeed < 1e3 && SiteParameters.constant_scroll == “on” && (scrollSpeed = 1e3), $(“.menu-sticky .menu-container:not(.menu-hide)”).length && !$(“.menu-shrink”).length && (logoH = $logo.outerHeight(), menuH = $menu.outerHeight(), calc_scroll < logoH + menuH && (calc_scroll = 0)), scrollSpeed == 0 ? ($(“html, body”).scrollTop(calc_scroll), UNCODE.scrolling = !1) : $(“html, body”).animate({ scrollTop: delta > 0 ? calc_scroll – .1 : calc_scroll
}, scrollSpeed, “easeInOutCubic”, function() {
UNCODE.scrolling = !1,
getOffset != UNCODE.get_scroll_offset(e.target) && (calc_scroll = scrollSection.offset().top,
getOffset = UNCODE.get_scroll_offset(e.target),
calc_scroll -= getOffset,
$(“html, body”).animate({
scrollTop: delta > 0 ? calc_scroll – .1 : calc_scroll
}, scrollSpeed, “easeInOutCubic”, function() {
UNCODE.scrolling = !1
}))
})
}
}
}),
$(“.header-scrolldown”).on(“click”, function(event) {
event.preventDefault();
var pageHeader = $(event.target).closest(“#page-header”)
, pageHeaderTop = pageHeader.offset().top
, pageHeaderHeight = pageHeader.outerHeight()
, scrollSpeed = SiteParameters.constant_scroll == “on” ? Math.abs(pageHeaderTop + pageHeaderHeight) / parseFloat(SiteParameters.scroll_speed) : SiteParameters.scroll_speed;
scrollSpeed < 1e3 && SiteParameters.constant_scroll == “on” && (scrollSpeed = 1e3); var calc_scroll = pageHeaderTop + pageHeaderHeight , getOffset = UNCODE.get_scroll_offset(event.target); calc_scroll -= getOffset; var shrink = typeof $(“.navbar-brand”).data(“padding-shrink”) != “undefined” ? $(“.navbar-brand”).data(“padding-shrink”) * 2 : 36; $(“.menu-sticky .menu-container:not(.menu-hide)”).length && $(“.menu-shrink”).length && (scrollTo += UNCODE.menuHeight – ($(“.navbar-brand”).data(“minheight”) + shrink)), scrollSpeed == 0 ? ($(“html, body”).scrollTop(calc_scroll), UNCODE.scrolling = !1) : $(“html, body”).animate({ scrollTop: calc_scroll }, scrollSpeed, “easeInOutCubic”, function() { UNCODE.scrolling = !1, getOffset != UNCODE.get_scroll_offset(event.target) && (calc_scroll = pageHeaderTop + pageHeaderHeight, getOffset = UNCODE.get_scroll_offset(e.target), calc_scroll -= getOffset, $(“html, body”).animate({ scrollTop: calc_scroll }, scrollSpeed, “easeInOutCubic”, function() { UNCODE.scrolling = !1 })) }) })), $(document).on(“click.bs.tab.data-api”, ‘[data-toggle=”tab”], [data-toggle=”pill”]’, function(e) { e.preventDefault(), $(this).tab(“show”), requestTimeout(function() { window.dispatchEvent(UNCODE.boxEvent) }, 300) }), $(document).on(“click.bs.collapse.data-api”, ‘[data-toggle=”collapse”]’, function(e) { var $this = $(this), href, target = $this.attr(“data-target”) || e.preventDefault() || (href = $this.attr(“href”)) && href.replace(/.*(?=#[^\s]+$)/, “”), $target = $(target), data = $target.data(“bs.collapse”), option = data ? “toggle” : $this.data(), parent = $this.attr(“data-parent”), $parent = parent && $(parent), $title = $(this).parent(); $parent && ($parent.find(‘[data-toggle=”collapse”][data-parent=”‘ + parent + ‘”]’).not($this).addClass(“collapsed”), $title.hasClass(“active”) ? $title.removeClass(“active”) : ($parent.find(“.panel-title”).removeClass(“active”), $title$target.hasClass(“in”) ? “removeClass” : “addClass”)), $this$target.hasClass(“in”) ? “addClass” : “removeClass” }), window.uncode_textfill = function(el, loaded) { el == undefined && (el = $(“body”)), $.each($(“.bigtext”, el), function(index, val) { $(val).bigtext({ minfontsize: 24 }), !$(val).parent().hasClass(“blocks-animation”) && !$(val).hasClass(“animate_when_almost_visible”) && $(val).css({ opacity: 1 }), requestTimeout(function() { $(val).find(“.animate_when_almost_visible”).length != 0 && $(val).css({ opacity: 1 }) }, 400) }) } , window.uncode_textfill(), $(document).on(“mouseenter”, “.col-link”, function(e) { var uncol = $(e.target).prev(“.uncol”) , el = uncol.find(“.column-background”); if (el) { $(“.btn-container .btn”, uncol).toggleClass(“active”); var elOverlay = $(el[0]).find(“.block-bg-overlay”); if (elOverlay.length) { var getOpacity = $(elOverlay).css(“opacity”); if (getOpacity != 1) { getOpacity = Math.round(getOpacity * 100) / 100; var newOpacity = getOpacity + .1; $(elOverlay).data(“data-opacity”, getOpacity), $(elOverlay).css(“opacity”, newOpacity) } } } }).on(“mouseleave”, “.col-link”, function(e) { var uncol = $(e.target).prev(“.uncol”) , el = uncol.find(“.column-background”); $(“.btn-container .btn”, uncol).toggleClass(“active”); if (el) { var elOverlay = $(el[0]).find(“.block-bg-overlay”); if (elOverlay.length) { var getOpacity = $(elOverlay).data(“data-opacity”); $(elOverlay).css(“opacity”, getOpacity) } } }), $(window).on(“load”, function() { $(“.rev_slider_wrapper, rs-module-wrap”).each(function() { var $this = jQuery(this) , id_array = $this.attr(“id”).split(““) , id = id_array[2]; id != undefined && id != “” && ($.globalEval(“revapi” + id + ‘.bind(“revolution.slide.onloaded”,function (e, data) { if (jQuery(e.currentTarget).closest(“.header-revslider”).length) { var style = jQuery(e.currentTarget).find(“li, rs-slide”).eq(0).attr(“data-skin”), scrolltop = jQuery(document).scrollTop(); if (style != undefined) UNCODE.switchColorsMenu(scrolltop, style);}})’), $.globalEval(“revapi” + id + ‘.bind(“revolution.slide.onchange”,function (e,data) { if (jQuery(e.currentTarget).closest(“.header-revslider”).length) { var style = jQuery(e.currentTarget).find(“li, rs-slide”).eq(data.slideIndex – 1).attr(“data-skin”), scrolltop = jQuery(document).scrollTop(); if (style != undefined) UNCODE.switchColorsMenu(scrolltop, style);}})’)) }) }), $(window).on(“load”, function() { $(“.ls-wp-container”).on(“slideTimelineDidStart”, function(event, slider) { var slideData = slider.slides.current.data , scrolltop = $(document).scrollTop(); slideData && slideData.skin && UNCODE.switchColorsMenu(scrolltop, slideData.skin) }) }), $(window).resize(function() { if ($(“html”).hasClass(“admin-mode”) && !SiteParameters.is_frontend_editor) { var getAdminBar = $(“#wpadminbar”); if (getAdminBar.length && getAdminBar.css(“position”) !== “hidden”) { var getAdminBarHeight = getAdminBar.height(); getAdminBar.css(“position”) === “fixed” ? ($(“html”).css({ “margin-top”: getAdminBarHeight + “px”, “padding-top”: UNCODE.bodyBorder + “px” }), $(“.body-borders .top-border”).css({ “margin-top”: getAdminBarHeight + “px” })) : ($(“html”).css({ “padding-top”: UNCODE.bodyBorder + “px”, “margin-top”: “0px” }), $(“.body-borders .top-border”).css({ “margin-top”: “0px” })) } } }), this.fb_timeout = undefined, $(window).resize(function() { $(“.facebook-object”).each(function(index, el) { var el = $(el) , parentWidth = el.closest(“.tmb”).width(); el.width(parentWidth) }), this.fb_timeout == undefined && $(“.facebook-object”).length && (window.clearTimeout(this.fb_timeout), this.fb_timeout = window.setTimeout(function(msg) { window.dispatchEvent(UNCODE.boxEvent) }, 1e3)) }); var beforePrint = function() { window.dispatchEvent(new CustomEvent(“resize”)), window.dispatchEvent(UNCODE.boxEvent) }; if (window.matchMedia) { var mediaQueryList = window.matchMedia(“print”); mediaQueryList.addListener(function(mql) { mql.matches && beforePrint() }) } window.onbeforeprint = beforePrint } , UNCODE.lettering = function() { var setCTA, highlightStill = function() { var $heading_texts = $(“.heading-text:not(.animate_inner_when_almost_visible)”); $.each($heading_texts, function(key, el) { var $heading = $(el); if (!$(‘.heading-text-highlight-inner[data-animated=”yes”]’, $heading).length) return; var waypoint = new Waypoint({ element: el, handler: function() { var $anims = $(‘.heading-text-highlight-inner[data-animated=”yes”]’, this.element) , anims_l = $anims.length; $anims.each(function(_key, el) { var $anim = $(el); $anim.hasClass(“heading-text-highlight-animated”) || ($anim.addClass(“heading-text-highlight-animated”), $heading.data(“animate”) === !0 ? $anim.css({ “-webkit-transition-duration”: “0ms”, “-moz-transition-duration”: “0ms”, “-o-transition-duration”: “0ms”, “transition-duration”: “0ms” }) : $anim.css({ “-webkit-transition-delay”: (key + 2) * 200 + “ms”, “-moz-transition-delay”: (key + 2) * 200 + “ms”, “-o-transition-delay”: (key + 2) * 200 + “ms”, “transition-delay”: (key + 2) * 200 + “ms” })) }), $anims.last().one(“webkitTransitionEnd oTransitionEnd mozTransitionEnd msTransitionEnd transitionEnd”, function(e) { $heading.data(“animate”, !0) }), $anims.removeAttr(“data-animated”) }, offset: “100%” }) }), Waypoint.refreshAll(), $(document.body).trigger(“uncode_waypoints”) }; requestTimeout(function() { highlightStill(), $(window).on(“resize”, function() { clearRequestTimeout(setCTA), setCTA = requestTimeout(highlightStill, 100) }) }, 400) } , UNCODE.menuSystem = function() { function menuMobile() { var $body = $(“body”), $mobileToggleButton = $(“.mobile-menu-button”), $box, $el, $el_transp, elHeight, check, animating = !1, stickyMobile = !1, menuClose = new CustomEvent(“menuMobileClose”), menuOpen = new CustomEvent(“menuMobileOpen”); UNCODE.menuOpened = !1, $mobileToggleButton.on(“click”, function(event) { var btn = this; if ($(btn).hasClass(“overlay-close”)) return; event.preventDefault(); if (UNCODE.wwidth < UNCODE.mediaQuery) { $box = $(this).closest(“.box-container”).find(“.main-menu-container”), $el = $(this).closest(“.box-container”).find(“.menu-horizontal-inner:not(.row-brand), .menu-sidebar-inner”), $el_transp = $(“.menu-absolute.menu-transparent”), UNCODE.isMobile && $(“.menu-wrapper.menu-sticky, .menu-wrapper.menu-hide-only, .main-header .menu-sticky-vertical, .main-header .menu-hide-only-vertical”).length ? (stickyMobile = !0, elHeight = window.innerHeight – UNCODE.menuMobileHeight – UNCODE.bodyBorder * 2 – UNCODE.adminBarHeight + 1) : (elHeight = 0, $.each($el, function(index, val) { elHeight += $(val).outerHeight() })); var open = function() { animating || ($body.addClass(“open-overlay-menu”), window.dispatchEvent(menuOpen), animating = !0, UNCODE.menuOpened = !0, $(‘body[class=”vmenu-“], body.hmenu-center’).length && $(“.menu-hide, .menu-sticky, .menu-transparent”).length && ($(“.main-header > .vmenu-container”).css({ position: “fixed”, top: $(“.menu-container”).outerHeight() + UNCODE.bodyBorder + UNCODE.adminBarHeight + “px” }), $(“body.menu-offcanvas”).length ? ($(“.menu-container:not(.sticky-element):not(.isotope-filters)”).css({ position: “fixed” }), $(“.vmenu-container.menu-container:not(.sticky-element):not(.isotope-filters)”).css({ position: “fixed”, top: UNCODE.menuMobileHeight + UNCODE.bodyBorder + UNCODE.adminBarHeight + “px” })) : $(“.menu-hide, .menu-sticky”).length && $(“.menu-container:not(.sticky-element):not(.isotope-filters)”).css({ position: “fixed” })), $(“body.hmenu-center”).length && $(“.menu-hide, .menu-sticky”).length && $(“.menu-container:not(.sticky-element):not(.isotope-filters)”).css({ position: “fixed”, top: UNCODE.menuMobileHeight + UNCODE.bodyBorder + UNCODE.adminBarHeight + “px” }), btn.classList.add(“close”), $box.addClass(“open-items”), $el_transp.length && $(“body.menu-mobile-transparent”).length && $el_transp.addClass(“is_mobile_open”), $box.animate({ height: elHeight }, 600, “easeInOutCirc”, function() { animating = !1, stickyMobile || $box.css(“height”, “auto”) })) } , close = function() { animating || (window.dispatchEvent(menuClose), animating = !0, UNCODE.menuOpened = !1, btn.classList.remove(“close”), btn.classList.add(“closing”), $box.addClass(“close”), requestTimeout(function() { $box.removeClass(“close”), $box.removeClass(“open-items”), btn.classList.remove(“closing”), $el_transp.length && $el_transp.removeClass(“is_mobile_open”) }, 500), $box.animate({ height: 0 }, { duration: 600, easing: “easeInOutCirc”, complete: function(elements) { $(elements).css(“height”, “”), animating = !1, $(‘body[class=”vmenu-“]’).length && UNCODE.wwidth >= 960 && $(“.main-header > .vmenu-container”).add(“.menu-container:not(.sticky-element):not(.isotope-filters)”).css(“position”, “relative”),
$body.removeClass(“open-overlay-menu”)
}
}))
};
check = UNCODE.menuOpened ? close() : open()
}
}),
window.addEventListener(“menuMobileTrigged”, function(e) {
$mobileToggleButton.trigger(“click”)
}),
window.addEventListener(“orientationchange”, function(e) {
$(“#logo-container-mobile .mobile-menu-button.close”).trigger(“click”)
}),
window.addEventListener(“resize”, function() {
if ($(window).width() < UNCODE.mediaQuery) { if (UNCODE.isMobile) { var $box = $(“.box-container .main-menu-container”) , $el = $(“.box-container .menu-horizontal-inner, .box-container .menu-sidebar-inner”); $($box).length && $($box).hasClass(“open-items”) && $($box).css(“height”) != “auto” && $(“.menu-wrapper.menu-sticky, .menu-wrapper.menu-hide-only”).length && (elHeight = 0, $.each($el, function(index, val) { elHeight += $(val).outerHeight() }), elHeight = window.innerHeight – $(“.menu-wrapper.menu-sticky .menu-container .row-menu-inner, .menu-wrapper.menu-hide-only .menu-container .row-menu-inner”).height() – UNCODE.bodyBorder * 2 + 1, $($box).css(“height”, elHeight + “px”)) } } else $(“.menu-hide-vertical”).removeAttr(“style”), $(“.menu-container-mobile”).removeAttr(“style”), $(“.vmenu-container.menu-container”).removeAttr(“style”) }) } function menuOffCanvas() { var menuClose = new CustomEvent(“menuCanvasClose”) , menuOpen = new CustomEvent(“menuCanvasOpen”); $(“.menu-primary .menu-button-offcanvas”).click(function(event) { $(window).width() > UNCODE.mediaQuery && ($(event.currentTarget).hasClass(“close”) ? ($(event.currentTarget).removeClass(“close”),
$(event.currentTarget).addClass(“closing”),
requestTimeout(function() {
$(event.currentTarget).removeClass(“closing”),
window.dispatchEvent(menuClose)
}, 500)) : ($(event.currentTarget).addClass(“close”),
window.dispatchEvent(menuOpen))),
$(“body”).toggleClass(“off-opened”)
})
}
function menuSmart() {
var $menusmart = $(‘[class*=”menu-smart”]’);
$menusmart.length > 0 && ($menusmart.smartmenus({
subIndicators: !1,
subIndicatorsPos: “append”,
subMenusMinWidth: “13em”,
subIndicatorsText: “”,
showTimeout: 50,
hideTimeout: 50,
showFunction: function($ul, complete) {
$ul.fadeIn(0, “linear”, complete),
$ul.addClass(“open-animated”)
},
hideFunction: function($ul, complete) {
var fixIE = $(“html.ie”).length;
if (fixIE) {
var $rowParent = $($ul).closest(“.main-menu-container”);
$rowParent.height(“auto”)
}
$ul.fadeOut(0, “linear”, complete),
$ul.removeClass(“open-animated”)
},
collapsibleShowFunction: function($ul, complete) {
$ul.slideDown(400, “easeInOutCirc”, function() {
12
})
},
collapsibleHideFunction: function($ul, complete) {
$ul.slideUp(200, “easeInOutCirc”, complete)
},
hideOnClick: !0
}),
$(“body”).hasClass(“menu-accordion-active”) && requestTimeout(function() {
$menusmart.smartmenus(“itemActivate”, $menusmart.find(“.current-menu-item > a”).eq(-1)),
$menusmart.addClass(“menu-smart-init”)
}, 1e3))
}
function menuOverlay() {
$(“.overlay”).length && $(“.overlay”).removeClass(“hidden”),
$(“.overlay-sequential, .menu-mobile-animated”).length > 0 && $(“.overlay-sequential .menu-smart > li, .menu-sticky .menu-container .menu-smart > li, .menu-hide.menu-container .menu-smart > li, .vmenu-container .menu-smart > li”).each(function(index, el) {
var transDelay = index / 20 + .1;
$(“body”).hasClass(“menu-mobile-centered”) && $(window).width() < UNCODE.mediaQuery && (transDelay += .3), $(this)[0].setAttribute(“style”, “-webkit-transition-delay:” + transDelay + “s; -moz-transition-delay:” + transDelay + “s; -ms-transition-delay:” + transDelay + “s; -o-transition-delay:” + transDelay + “s; transition-delay:” + transDelay + “s”) }) } function menuAppend() { var $body = $(“body”), $menuCont = $(“.menu-container”), $cta = $(“.navbar-cta”), $socials = $(“.navbar-social”), $ul = $(“.navbar-main ul.menu-primary-inner”), $ulCta, $ulSocials, $firstMenu = $(“.main-menu-container:first-child”, $menuCont), $secondMenu = $(“.main-menu-container:last-child”, $menuCont), $firstNav = $(“.navbar-nav:first-child”, $firstMenu), $secondNav = $(“.navbar-nav:first-child”, $secondMenu), $ulFirst = $(“> ul”, $firstNav), $ulSecond = $(“> ul”, $secondNav), setCTA, appendCTA = function() {
return !0
}, appendSocials = function() {
return !0
}, appendSplit = function() {
return !0
};
if ($body.hasClass(“cta-not-appended”))
return !1;
($body.hasClass(“menu-offcanvas”) || $body.hasClass(“menu-overlay”) || $body.hasClass(“hmenu-center-split”)) && $cta.length && ($ulCta = $(“> ul”, $cta),
appendCTA = function() {
UNCODE.wwidth < UNCODE.mediaQuery ? $ul.after($ulCta) : $cta.append($ulCta) } ), appendCTA(), $body.hasClass(“hmenu-center-split”) && $socials.length && ($ulSocials = $(“> ul”, $socials),
appendSocials = function() {
UNCODE.wwidth < UNCODE.mediaQuery ? $ul.after($ulSocials) : $socials.append($ulSocials) } ), appendSocials(), $body.hasClass(“hmenu-center-double”) && (appendSplit = function() { UNCODE.wwidth < UNCODE.mediaQuery ? ($secondNav.length && $secondNav.prepend($ulFirst), $firstMenu.hide()) : ($firstNav.append($ulFirst), $firstMenu.css({ display: “table-cell” })) } ), appendSplit(), $(window).on(“resize”, function() { clearRequestTimeout(setCTA), setCTA = requestTimeout(function() { appendCTA(), appendSocials(), appendSplit() }, 10) }) } menuMobile(), menuOffCanvas(), menuSmart(), menuOverlay(), menuAppend(); var setMenuOverlay; $(window).on(“resize”, function() { $(“.overlay”).length && $(“.overlay”).addClass(“hidden”), clearRequestTimeout(setMenuOverlay), setMenuOverlay = requestTimeout(menuOverlay, 150) }) } , UNCODE.okvideo = function() { var BLANK_GIF = “data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D”; $.okvideo = function(options) { typeof options != “object” && (options = { video: options }); var base = this; base.init = function() { base.options = $.extend({}, $.okvideo.options, options), base.options.video === null && (base.options.video = base.options.source), base.setOptions(); var target = base.options.target || $(“body”) , position = target[0] == $(“body”)[0] ? “fixed” : “absolute” , zIndex = base.options.controls === 3 ? -999 : “auto”; if ($(“#okplayer-” + base.options.id).length == 0) { var mask = ‘

‘; OKEvents.utils.isMobile() ? target.append(‘

‘) : (base.options.controls === 3 && target.append(mask), base.options.adproof === 1 ? target.append(‘

‘) : target.append(‘

‘)), $(“#okplayer-mask-” + base.options.id).css(“background-image”, “url(” + BLANK_GIF + “)”), base.options.playlist.list === null ? base.options.video.provider === “youtube” ? base.loadYouTubeAPI() : base.options.video.provider === “vimeo” && (base.options.volume /= 100, base.loadVimeoAPI()) : base.loadYouTubeAPI() } } , base.setOptions = function() { for (var key in this.options) this.options[key] === !0 && (this.options[key] = 1), this.options[key] === !1 && (this.options[key] = 3); base.options.playlist.list === null && (base.options.video = base.determineProvider()), $(window).data(“okoptions-” + base.options.id, base.options) } , base.insertJS = function(src, callback) { var tag = document.createElement(“script”); callback && (tag.readyState ? tag.onreadystatechange = function() { if (tag.readyState === “loaded” || tag.readyState === “complete”) tag.onreadystatechange = null, callback() } : tag.onload = function() { callback() } ), tag.src = src; var firstScriptTag = document.getElementsByTagName(“script”)[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag) } , base.loadYouTubeAPI = function(callback) { base.insertJS(“https://www.youtube.com/player_api”) } , base.loadYouTubePlaylist = function() { player.loadPlaylist(base.options.playlist.list, base.options.playlist.index, base.options.playlist.startSeconds, base.options.playlist.suggestedQuality) } , base.loadVimeoAPI = function() { var source = “//player.vimeo.com/video/” + base.options.video.id + “?background=1&api=1&title=0&byline=0&portrait=0&playbar=0&loop=” + base.options.loop + “&autoplay=” + (base.options.autoplay === 1 ? 1 : 0) + “&player_id=okplayer-” + base.options.id , jIframe = $(‘

Rolar para cima