/**
* Javascript logic
*
* SCRIPTS
* SHORTCODES
* THEME LOGIC
*/
/*--------------------------------------------------
LOADING SCRIPTS
---------------------------------------------------*/
/* matchmedia*/
window.matchMedia = window.matchMedia || function (a) {
"use strict";
var c, d = a.documentElement, e = d.firstElementChild || d.firstChild, f = a.createElement("body"), g = a.createElement("div");
return g.id = "mq-test-1", g.style.cssText = "position:absolute;top:-100em", f.style.background = "none", f.appendChild(g), function (a) {
return g.innerHTML = '', d.insertBefore(f, e), c = 42 === g.offsetWidth, d.removeChild(f), {
matches: c,
media: a
}
}
}(document);
/* Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function (a) {
"use strict";
function x() {
u(!0)
}
var b = {};
if (a.respond = b, b.update = function () {
}, b.mediaQueriesSupported = a.matchMedia && a.matchMedia("only all").matches, !b.mediaQueriesSupported) {
var q, r, t, c = a.document, d = c.documentElement, e = [], f = [], g = [], h = {}, i = 30, j = c.getElementsByTagName("head")[0] || d, k = c.getElementsByTagName("base")[0], l = j.getElementsByTagName("link"), m = [], n = function () {
for (var b = 0; l.length > b; b++) {
var c = l[b], d = c.href, e = c.media, f = c.rel && "stylesheet" === c.rel.toLowerCase();
d && f && !h[d] && (c.styleSheet && c.styleSheet.rawCssText ? (p(c.styleSheet.rawCssText, d, e), h[d] = !0) : (!/^([a-zA-Z:]*\/\/)/.test(d) && !k || d.replace(RegExp.$1, "").split("/")[0] === a.location.host) && m.push({
href: d,
media: e
}))
}
o()
}, o = function () {
if (m.length) {
var b = m.shift();
v(b.href, function (c) {
p(c, b.href, b.media), h[b.href] = !0, a.setTimeout(function () {
o()
}, 0)
})
}
}, p = function (a, b, c) {
var d = a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi), g = d && d.length || 0;
b = b.substring(0, b.lastIndexOf("/"));
var h = function (a) {
return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + b + "$2$3")
}, i = !g && c;
b.length && (b += "/"), i && (g = 1);
for (var j = 0; g > j; j++) {
var k, l, m, n;
i ? (k = c, f.push(h(a))) : (k = d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/) && RegExp.$1, f.push(RegExp.$2 && h(RegExp.$2))), m = k.split(","), n = m.length;
for (var o = 0; n > o; o++)l = m[o], e.push({
media: l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/) && RegExp.$2 || "all",
rules: f.length - 1,
hasquery: l.indexOf("(") > -1,
minw: l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
maxw: l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
})
}
u()
}, s = function () {
var a, b = c.createElement("div"), e = c.body, f = !1;
return b.style.cssText = "position:absolute;font-size:1em;width:1em", e || (e = f = c.createElement("body"), e.style.background = "none"), e.appendChild(b), d.insertBefore(e, d.firstChild), a = b.offsetWidth, f ? d.removeChild(e) : e.removeChild(b), a = t = parseFloat(a)
}, u = function (b) {
var h = "clientWidth", k = d[h], m = "CSS1Compat" === c.compatMode && k || c.body[h] || k, n = {}, o = l[l.length - 1], p = (new Date).getTime();
if (b && q && i > p - q)return a.clearTimeout(r), r = a.setTimeout(u, i), void 0;
q = p;
for (var v in e)if (e.hasOwnProperty(v)) {
var w = e[v], x = w.minw, y = w.maxw, z = null === x, A = null === y, B = "em";
x && (x = parseFloat(x) * (x.indexOf(B) > -1 ? t || s() : 1)), y && (y = parseFloat(y) * (y.indexOf(B) > -1 ? t || s() : 1)), w.hasquery && (z && A || !(z || m >= x) || !(A || y >= m)) || (n[w.media] || (n[w.media] = []), n[w.media].push(f[w.rules]))
}
for (var C in g)g.hasOwnProperty(C) && g[C] && g[C].parentNode === j && j.removeChild(g[C]);
for (var D in n)if (n.hasOwnProperty(D)) {
var E = c.createElement("style"), F = n[D].join("\n");
E.type = "text/css", E.media = D, j.insertBefore(E, o.nextSibling), E.styleSheet ? E.styleSheet.cssText = F : E.appendChild(c.createTextNode(F)), g.push(E)
}
}, v = function (a, b) {
var c = w();
c && (c.open("GET", a, !0), c.onreadystatechange = function () {
4 !== c.readyState || 200 !== c.status && 304 !== c.status || b(c.responseText)
}, 4 !== c.readyState && c.send(null))
}, w = function () {
var b = !1;
try {
b = new a.XMLHttpRequest
} catch (c) {
b = new a.ActiveXObject("Microsoft.XMLHTTP")
}
return function () {
return b
}
}();
n(), b.update = n, a.addEventListener ? a.addEventListener("resize", x, !1) : a.attachEvent && a.attachEvent("onresize", x)
}
})(this);
/*
* Project: Twitter Bootstrap Hover Dropdown
* Author: Cameron Spear
* Contributors: Mattia Larentis
* Dependencies: Twitter Bootstrap's Dropdown plugin
* A simple plugin to enable twitter bootstrap dropdowns to active on hover and provide a nice user experience.
* No license, do what you want. I'd love credit or a shoutout, though.
* http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/
*/
(function (b, a, c) {
var d = b();
b.fn.dropdownHover = function (e) {
d = d.add(this.parent());
return this.each(function () {
var k = b(this), j = k.parent(), i = {
delay: 200,
instantlyCloseOthers: true
}, h = {
delay: b(this).data("delay"),
instantlyCloseOthers: b(this).data("close-others")
}, f = b.extend(true, {}, i, e, h), g;
j.hover(function (l) {
if (!j.hasClass("open") && !k.is(l.target)) {
return true
}
if (f.instantlyCloseOthers === true) {
d.removeClass("open")
}
a.clearTimeout(g);
j.addClass("open")
}, function () {
g = a.setTimeout(function () {
j.removeClass("open")
}, f.delay)
});
k.hover(function () {
if (f.instantlyCloseOthers === true) {
d.removeClass("open")
}
a.clearTimeout(g);
j.addClass("open")
});
j.find(".dropdown-submenu").each(function () {
var m = b(this);
var l;
m.hover(function () {
a.clearTimeout(l);
m.children(".dropdown-menu").show();
m.siblings().children(".dropdown-menu").hide()
}, function () {
var n = m.children(".dropdown-menu");
l = a.setTimeout(function () {
n.hide()
}, f.delay)
})
})
})
};
})(jQuery, this);
/* =========================================================
* bootstrap-tabdrop.js
* http://www.eyecon.ro/bootstrap-tabdrop
* =========================================================
* Copyright 2012 Stefan Petre
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function (c) {
var b = (function () {
var h = [];
var d = false;
var g;
var e = function (i) {
clearTimeout(g);
g = setTimeout(f, 100)
};
var f = function () {
for (var k = 0, j = h.length; k < j; k++) {
h[k].apply()
}
};
return {
register: function (i) {
h.push(i);
if (d === false) {
c(window).bind("resize", e);
d = true
}
}, unregister: function (l) {
for (var k = 0, j = h.length; k < j; k++) {
if (h[k] == l) {
delete h[k];
break
}
}
}
}
}());
var a = function (e, d) {
this.element = c(e);
this.dropdown = c('
').prependTo(this.element);
if (this.element.parent().is(".tabs-below")) {
this.dropdown.addClass("dropup")
}
b.register(c.proxy(this.layout, this));
this.layout()
};
a.prototype = {
constructor: a, layout: function () {
var d = [];
this.dropdown.removeClass("hide");
this.element.append(this.dropdown.find("li")).find(">li").not(".tabdrop").each(function () {
if (this.offsetTop > 0) {
d.push(this)
}
});
if (d.length > 0) {
d = c(d);
this.dropdown.find("ul").empty().append(d);
if (this.dropdown.find(".active").length == 1) {
this.dropdown.addClass("active")
} else {
this.dropdown.removeClass("active")
}
} else {
this.dropdown.addClass("hide")
}
}
};
c.fn.tabdrop = function (d) {
return this.each(function () {
var g = c(this), f = g.data("tabdrop"), e = typeof d === "object" && d;
if (!f) {
g.data("tabdrop", (f = new a(this, c.extend({}, c.fn.tabdrop.defaults, e))))
}
if (typeof d == "string") {
f[d]()
}
})
};
c.fn.tabdrop.defaults = {text: " "};
c.fn.tabdrop.Constructor = a
}(window.jQuery);
/* ======================= Sticky Plugin =============================== */
// // // Sticky Plugin v1.0.0 for jQuery
// =============
// Author: Anthony Garand
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
// Improvements by Leonardo C. Daronco (daronco)
// Created: 2/14/2011
// Date: 2/12/2012
// Website: http://labs.anthonygarand.com/sticky
// Description: Makes an element on the page stick on the screen as you scroll
// It will only set the 'top' and 'position' of your element, you
// might need to adjust the width in some cases.
(function (f) {
var e = {
topSpacing: 0,
bottomSpacing: 0,
className: "is-sticky",
wrapperClassName: "sticky-wrapper",
center: false,
getWidthFrom: ""
}, b = f(window), d = f(document), i = [], a = b.height(), g = function () {
var j = b.scrollTop(), q = d.height(), p = q - a, l = (j > p) ? p - j : 0;
for (var m = 0; m < i.length; m++) {
var r = i[m], k = r.stickyWrapper.offset().top, n = k - r.topSpacing - l;
if (j <= n) {
if (r.currentTop !== null) {
r.stickyElement.css("position", "").css("top", "");
r.stickyElement.parent().removeClass(r.className);
r.currentTop = null
}
} else {
var o = q - r.stickyElement.outerHeight() - r.topSpacing - r.bottomSpacing - j - l;
if (o < 0) {
o = o + r.topSpacing
} else {
o = r.topSpacing
}
if (r.currentTop != o) {
r.stickyElement.css("position", "fixed").css("top", o);
if (typeof r.getWidthFrom !== "undefined") {
r.stickyElement.css("width", f(r.getWidthFrom).width())
}
r.stickyElement.parent().addClass(r.className);
r.currentTop = o
}
}
}
}, h = function () {
a = b.height()
}, c = {
init: function (j) {
var k = f.extend(e, j);
return this.each(function () {
var l = f(this);
var m = l.attr("id");
var o = f("").attr("id", m + "-sticky-wrapper").addClass(k.wrapperClassName);
l.wrapAll(o);
if (k.center) {
l.parent().css({width: l.outerWidth(), marginLeft: "auto", marginRight: "auto"})
}
if (l.css("float") == "right") {
l.css({"float": "none"}).parent().css({"float": "right"})
}
var n = l.parent();
//if (f('body').hasClass('header-two-rows')) {
//n.css("height", l.height());
//}
i.push({
topSpacing: k.topSpacing,
bottomSpacing: k.bottomSpacing,
stickyElement: l,
currentTop: null,
stickyWrapper: n,
className: k.className,
getWidthFrom: k.getWidthFrom
})
})
}, update: g
};
if (window.addEventListener) {
window.addEventListener("scroll", g, false);
window.addEventListener("resize", h, false)
} else {
if (window.attachEvent) {
window.attachEvent("onscroll", g);
window.attachEvent("onresize", h)
}
}
f.fn.sticky = function (j) {
if (c[j]) {
return c[j].apply(this, Array.prototype.slice.call(arguments, 1))
} else {
if (typeof j === "object" || !j) {
return c.init.apply(this, arguments)
} else {
f.error("Method " + j + " does not exist on jQuery.sticky")
}
}
};
f(function () {
setTimeout(g, 0)
})
})(jQuery);
/* ======================= fitVids Plugin =============================== */
/**
* FitVids 1.0.3
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*/
(function (a) {
a.fn.fitVids = function (b) {
var c = {customSelector: null};
if (!document.getElementById("fit-vids-style")) {
var f = document.createElement("div"), d = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0], e = "";
f.className = "fit-vids-style";
f.id = "fit-vids-style";
f.style.display = "none";
f.innerHTML = e;
d.parentNode.insertBefore(f, d)
}
if (b) {
a.extend(c, b)
}
return this.each(function () {
var g = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "iframe[src*='embed.spotify.com']", "object", "embed:not(.mejs-shim)", "iframe[src*='dailymotion']"];
if (c.customSelector) {
g.push(c.customSelector)
}
var h = a(this).find(g.join(","));
h = h.not("object object");
h.each(function () {
var m = a(this);
if (this.tagName.toLowerCase() === "embed" && m.parent("object").length || m.parent(".fluid-width-video-wrapper").length || m.parent(".article-content").length ) {
return
}
var i = (this.tagName.toLowerCase() === "object" || (m.attr("height") && !isNaN(parseInt(m.attr("height"), 10)))) ? parseInt(m.attr("height"), 10) : m.height(), j = !isNaN(parseInt(m.attr("width"), 10)) ? parseInt(m.attr("width"), 10) : m.width(), k = i / j;
if (!m.attr("id")) {
var l = "fitvid" + Math.floor(Math.random() * 999999);
m.attr("id", l)
}
m.wrap('').parent(".fluid-width-video-wrapper").css("padding-top", (k * 100) + "%");
m.removeAttr("height").removeAttr("width")
})
})
}
})(window.jQuery);
/* ======================= jQuery Easing Plugin =============================== */
/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */
(function($, undefined) {
$.easing.jswing = $.easing.swing;
$.extend($.easing, {
def: "easeOutQuad", swing: function (e, f, a, h, g) {
return $.easing[$.easing.def](e, f, a, h, g)
}, easeInQuad: function (e, f, a, h, g) {
return h * (f /= g) * f + a
}, easeOutQuad: function (e, f, a, h, g) {
return -h * (f /= g) * (f - 2) + a
}, easeInOutQuad: function (e, f, a, h, g) {
if ((f /= g / 2) < 1) {
return h / 2 * f * f + a
}
return -h / 2 * ((--f) * (f - 2) - 1) + a
}, easeInCubic: function (e, f, a, h, g) {
return h * (f /= g) * f * f + a
}, easeOutCubic: function (e, f, a, h, g) {
return h * ((f = f / g - 1) * f * f + 1) + a
}, easeInOutCubic: function (e, f, a, h, g) {
if ((f /= g / 2) < 1) {
return h / 2 * f * f * f + a
}
return h / 2 * ((f -= 2) * f * f + 2) + a
}, easeInQuart: function (e, f, a, h, g) {
return h * (f /= g) * f * f * f + a
}, easeOutQuart: function (e, f, a, h, g) {
return -h * ((f = f / g - 1) * f * f * f - 1) + a
}, easeInOutQuart: function (e, f, a, h, g) {
if ((f /= g / 2) < 1) {
return h / 2 * f * f * f * f + a
}
return -h / 2 * ((f -= 2) * f * f * f - 2) + a
}, easeInQuint: function (e, f, a, h, g) {
return h * (f /= g) * f * f * f * f + a
}, easeOutQuint: function (e, f, a, h, g) {
return h * ((f = f / g - 1) * f * f * f * f + 1) + a
}, easeInOutQuint: function (e, f, a, h, g) {
if ((f /= g / 2) < 1) {
return h / 2 * f * f * f * f * f + a
}
return h / 2 * ((f -= 2) * f * f * f * f + 2) + a
}, easeInSine: function (e, f, a, h, g) {
return -h * Math.cos(f / g * (Math.PI / 2)) + h + a
}, easeOutSine: function (e, f, a, h, g) {
return h * Math.sin(f / g * (Math.PI / 2)) + a
}, easeInOutSine: function (e, f, a, h, g) {
return -h / 2 * (Math.cos(Math.PI * f / g) - 1) + a
}, easeInExpo: function (e, f, a, h, g) {
return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a
}, easeOutExpo: function (e, f, a, h, g) {
return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a
}, easeInOutExpo: function (e, f, a, h, g) {
if (f == 0) {
return a
}
if (f == g) {
return a + h
}
if ((f /= g / 2) < 1) {
return h / 2 * Math.pow(2, 10 * (f - 1)) + a
}
return h / 2 * (-Math.pow(2, -10 * --f) + 2) + a
}, easeInCirc: function (e, f, a, h, g) {
return -h * (Math.sqrt(1 - (f /= g) * f) - 1) + a
}, easeOutCirc: function (e, f, a, h, g) {
return h * Math.sqrt(1 - (f = f / g - 1) * f) + a
}, easeInOutCirc: function (e, f, a, h, g) {
if ((f /= g / 2) < 1) {
return -h / 2 * (Math.sqrt(1 - f * f) - 1) + a
}
return h / 2 * (Math.sqrt(1 - (f -= 2) * f) + 1) + a
}, easeInElastic: function (f, h, e, l, k) {
var i = 1.70158;
var j = 0;
var g = l;
if (h == 0) {
return e
}
if ((h /= k) == 1) {
return e + l
}
if (!j) {
j = k * 0.3
}
if (g < Math.abs(l)) {
g = l;
var i = j / 4
} else {
var i = j / (2 * Math.PI) * Math.asin(l / g)
}
return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
}, easeOutElastic: function (f, h, e, l, k) {
var i = 1.70158;
var j = 0;
var g = l;
if (h == 0) {
return e
}
if ((h /= k) == 1) {
return e + l
}
if (!j) {
j = k * 0.3
}
if (g < Math.abs(l)) {
g = l;
var i = j / 4
} else {
var i = j / (2 * Math.PI) * Math.asin(l / g)
}
return g * Math.pow(2, -10 * h) * Math.sin((h * k - i) * (2 * Math.PI) / j) + l + e
}, easeInOutElastic: function (f, h, e, l, k) {
var i = 1.70158;
var j = 0;
var g = l;
if (h == 0) {
return e
}
if ((h /= k / 2) == 2) {
return e + l
}
if (!j) {
j = k * (0.3 * 1.5)
}
if (g < Math.abs(l)) {
g = l;
var i = j / 4
} else {
var i = j / (2 * Math.PI) * Math.asin(l / g)
}
if (h < 1) {
return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
}
return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j) * 0.5 + l + e
}, easeInBack: function (e, f, a, i, h, g) {
if (g == undefined) {
g = 1.70158
}
return i * (f /= h) * f * ((g + 1) * f - g) + a
}, easeOutBack: function (e, f, a, i, h, g) {
if (g == undefined) {
g = 1.70158
}
return i * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a
}, easeInOutBack: function (e, f, a, i, h, g) {
if (g == undefined) {
g = 1.70158
}
if ((f /= h / 2) < 1) {
return i / 2 * (f * f * (((g *= (1.525)) + 1) * f - g)) + a
}
return i / 2 * ((f -= 2) * f * (((g *= (1.525)) + 1) * f + g) + 2) + a
}, easeInBounce: function (e, f, a, h, g) {
return h - $.easing.easeOutBounce(e, g - f, 0, h, g) + a
}, easeOutBounce: function (e, f, a, h, g) {
if ((f /= g) < (1 / 2.75)) {
return h * (7.5625 * f * f) + a
} else {
if (f < (2 / 2.75)) {
return h * (7.5625 * (f -= (1.5 / 2.75)) * f + 0.75) + a
} else {
if (f < (2.5 / 2.75)) {
return h * (7.5625 * (f -= (2.25 / 2.75)) * f + 0.9375) + a
} else {
return h * (7.5625 * (f -= (2.625 / 2.75)) * f + 0.984375) + a
}
}
}
}, easeInOutBounce: function (e, f, a, h, g) {
if (f < g / 2) {
return $.easing.easeInBounce(e, f * 2, 0, h, g) * 0.5 + a
}
return $.easing.easeOutBounce(e, f * 2 - g, 0, h, g) * 0.5 + h * 0.5 + a
}
});
}) (jQuery);
/* ======================= debouncedresize Plugin =============================== */
/*
* debouncedresize: special jQuery event that happens once after a window resize
*
* latest version and complete README available on Github:
* https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
*
* Copyright 2011 @louis_remi
* Licensed under the MIT license.
*/
(function (d) {
var b = d.event, a, c;
a = b.special.debouncedresize = {
setup: function () {
d(this).on("resize", a.handler)
}, teardown: function () {
d(this).off("resize", a.handler)
}, handler: function (i, e) {
var h = this, g = arguments, f = function () {
i.type = "debouncedresize";
b.dispatch.apply(h, g)
};
if (c) {
clearTimeout(c)
}
e ? f() : c = setTimeout(f, a.threshold)
}, threshold: 150
}
})(jQuery);
/* ======================= imagesLoaded Plugin =============================== */
/**
* imagesLoaded PACKAGED v3.1.8
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
(function () {
function e() {
}
function t(e, t) {
for (var n = e.length; n--;)if (e[n].listener === t)return n;
return -1
}
function n(e) {
return function () {
return this[e].apply(this, arguments)
}
}
var i = e.prototype, r = this, o = r.EventEmitter;
i.getListeners = function (e) {
var t, n, i = this._getEvents();
if ("object" == typeof e) {
t = {};
for (n in i)i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
} else t = i[e] || (i[e] = []);
return t
}, i.flattenListeners = function (e) {
var t, n = [];
for (t = 0; e.length > t; t += 1)n.push(e[t].listener);
return n
}, i.getListenersAsObject = function (e) {
var t, n = this.getListeners(e);
return n instanceof Array && (t = {}, t[e] = n), t || n
}, i.addListener = function (e, n) {
var i, r = this.getListenersAsObject(e), o = "object" == typeof n;
for (i in r)r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1});
return this
}, i.on = n("addListener"), i.addOnceListener = function (e, t) {
return this.addListener(e, {listener: t, once: !0})
}, i.once = n("addOnceListener"), i.defineEvent = function (e) {
return this.getListeners(e), this
}, i.defineEvents = function (e) {
for (var t = 0; e.length > t; t += 1)this.defineEvent(e[t]);
return this
}, i.removeListener = function (e, n) {
var i, r, o = this.getListenersAsObject(e);
for (r in o)o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
return this
}, i.off = n("removeListener"), i.addListeners = function (e, t) {
return this.manipulateListeners(!1, e, t)
}, i.removeListeners = function (e, t) {
return this.manipulateListeners(!0, e, t)
}, i.manipulateListeners = function (e, t, n) {
var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners;
if ("object" != typeof t || t instanceof RegExp)for (i = n.length; i--;)o.call(this, t, n[i]); else for (i in t)t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
return this
}, i.removeEvent = function (e) {
var t, n = typeof e, i = this._getEvents();
if ("string" === n)delete i[e]; else if ("object" === n)for (t in i)i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events;
return this
}, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) {
var n, i, r, o, s = this.getListenersAsObject(e);
for (r in s)if (s.hasOwnProperty(r))for (i = s[r].length; i--;)n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener);
return this
}, i.trigger = n("emitEvent"), i.emit = function (e) {
var t = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(e, t)
}, i.setOnceReturnValue = function (e) {
return this._onceReturnValue = e, this
}, i._getOnceReturnValue = function () {
return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
}, i._getEvents = function () {
return this._events || (this._events = {})
}, e.noConflict = function () {
return r.EventEmitter = o, e
}, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () {
return e
}) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e
}).call(this), function (e) {
function t(t) {
var n = e.event;
return n.target = n.target || n.srcElement || t, n
}
var n = document.documentElement, i = function () {
};
n.addEventListener ? i = function (e, t, n) {
e.addEventListener(t, n, !1)
} : n.attachEvent && (i = function (e, n, i) {
e[n + i] = i.handleEvent ? function () {
var n = t(e);
i.handleEvent.call(i, n)
} : function () {
var n = t(e);
i.call(e, n)
}, e.attachEvent("on" + n, e[n + i])
});
var r = function () {
};
n.removeEventListener ? r = function (e, t, n) {
e.removeEventListener(t, n, !1)
} : n.detachEvent && (r = function (e, t, n) {
e.detachEvent("on" + t, e[t + n]);
try {
delete e[t + n]
} catch (i) {
e[t + n] = void 0
}
});
var o = {bind: i, unbind: r};
"function" == typeof define && define.amd ? define("eventie/eventie", o) : e.eventie = o
}(this), function (e, t) {
"function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, i) {
return t(e, n, i)
}) : "object" == typeof exports ? module.exports = t(e, require("wolfy87-eventemitter"), require("eventie")) : e.imagesLoaded = t(e, e.EventEmitter, e.eventie)
}(window, function (e, t, n) {
function i(e, t) {
for (var n in t)e[n] = t[n];
return e
}
function r(e) {
return "[object Array]" === d.call(e)
}
function o(e) {
var t = [];
if (r(e))t = e; else if ("number" == typeof e.length)for (var n = 0, i = e.length; i > n; n++)t.push(e[n]); else t.push(e);
return t
}
function s(e, t, n) {
if (!(this instanceof s))return new s(e, t);
"string" == typeof e && (e = document.querySelectorAll(e)), this.elements = o(e), this.options = i({}, this.options), "function" == typeof t ? n = t : i(this.options, t), n && this.on("always", n), this.getImages(), a && (this.jqDeferred = new a.Deferred);
var r = this;
setTimeout(function () {
r.check()
})
}
function f(e) {
this.img = e
}
function c(e) {
this.src = e, v[e] = this
}
var a = e.jQuery, u = e.console, h = u !== void 0, d = Object.prototype.toString;
s.prototype = new t, s.prototype.options = {}, s.prototype.getImages = function () {
this.images = [];
for (var e = 0, t = this.elements.length; t > e; e++) {
var n = this.elements[e];
"IMG" === n.nodeName && this.addImage(n);
var i = n.nodeType;
if (i && (1 === i || 9 === i || 11 === i))for (var r = n.querySelectorAll("img"), o = 0, s = r.length; s > o; o++) {
var f = r[o];
this.addImage(f)
}
}
}, s.prototype.addImage = function (e) {
var t = new f(e);
this.images.push(t)
}, s.prototype.check = function () {
function e(e, r) {
return t.options.debug && h && u.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
}
var t = this, n = 0, i = this.images.length;
if (this.hasAnyBroken = !1, !i)return this.complete(), void 0;
for (var r = 0; i > r; r++) {
var o = this.images[r];
o.on("confirm", e), o.check()
}
}, s.prototype.progress = function (e) {
this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
var t = this;
setTimeout(function () {
t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify && t.jqDeferred.notify(t, e)
})
}, s.prototype.complete = function () {
var e = this.hasAnyBroken ? "fail" : "done";
this.isComplete = !0;
var t = this;
setTimeout(function () {
if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
var n = t.hasAnyBroken ? "reject" : "resolve";
t.jqDeferred[n](t)
}
})
}, a && (a.fn.imagesLoaded = function (e, t) {
var n = new s(this, e, t);
return n.jqDeferred.promise(a(this))
}), f.prototype = new t, f.prototype.check = function () {
var e = v[this.img.src] || new c(this.img.src);
if (e.isConfirmed)return this.confirm(e.isLoaded, "cached was confirmed"), void 0;
if (this.img.complete && void 0 !== this.img.naturalWidth)return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
var t = this;
e.on("confirm", function (e, n) {
return t.confirm(e.isLoaded, n), !0
}), e.check()
}, f.prototype.confirm = function (e, t) {
this.isLoaded = e, this.emit("confirm", this, t)
};
var v = {};
return c.prototype = new t, c.prototype.check = function () {
if (!this.isChecked) {
var e = new Image;
n.bind(e, "load", this), n.bind(e, "error", this), e.src = this.src, this.isChecked = !0
}
}, c.prototype.handleEvent = function (e) {
var t = "on" + e.type;
this[t] && this[t](e)
}, c.prototype.onload = function (e) {
this.confirm(!0, "onload"), this.unbindProxyEvents(e)
}, c.prototype.onerror = function (e) {
this.confirm(!1, "onerror"), this.unbindProxyEvents(e)
}, c.prototype.confirm = function (e, t) {
this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
}, c.prototype.unbindProxyEvents = function (e) {
n.unbind(e.target, "load", this), n.unbind(e.target, "error", this)
}, s
});
/* ======================= imgpreload Plugin =============================== */
/**
* jquery.imgpreload 1.6.2
* Copyright 2009-2014 Dimas Begunoff
* License MIT
*/
"undefined" != typeof jQuery && !function (a) {
"use strict";
a.imgpreload = function (b, c) {
c = a.extend({}, a.fn.imgpreload.defaults, c instanceof Function ? {all: c} : c), "string" == typeof b && (b = [b]);
var d = [];
a.each(b, function (e, f) {
var g = new Image, h = f, i = g;
"string" != typeof f && (h = a(f).attr("src") || a(f).css("background-image").replace(/^url\((?:"|')?(.*)(?:'|")?\)$/gm, "$1"), i = f), a(g).bind("load error", function (e) {
d.push(i), a.data(i, "loaded", "error" == e.type ? !1 : !0), c.each instanceof Function && c.each.call(i, d.slice(0)), d.length >= b.length && c.all instanceof Function && c.all.call(d), a(this).unbind("load error")
}), g.src = h
})
}, a.fn.imgpreload = function (b) {
return a.imgpreload(this, b), this
}, a.fn.imgpreload.defaults = {each: null, all: null}
}(jQuery);
/* jQuery.flexMenu 1.4
https://github.com/352Media/flexMenu
Description: If a list is too long for all items to fit on one line, display a popup menu instead.
Dependencies: jQuery, Modernizr (optional). Without Modernizr, the menu can only be shown on click (not hover). */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var windowWidth = $(window).width(); // Store the window width
var windowHeight = $(window).height(); // Store the window height
var flexObjects = [], // Array of all flexMenu objects
resizeTimeout;
// When the page is resized, adjust the flexMenus.
function adjustFlexMenu() {
if ($(window).width() !== windowWidth || $(window).height() !== windowHeight) {
$(flexObjects).each(function () {
$(this).flexMenu({
'undo': true
}).flexMenu(this.options);
});
windowWidth = $(window).width(); // Store the window width if it changed
windowHeight = $(window).height(); // Store the window height if it changed
}
}
function collapseAllExcept($menuToAvoid) {
var $activeMenus,
$menusToCollapse;
$activeMenus = $('li.flexMenu-viewMore.active');
$menusToCollapse = $activeMenus.not($menuToAvoid);
$menusToCollapse.removeClass('active').find('> ul').hide();
}
$(window).resize(function () {
$('body').trigger('flexmenu-beforeResize');
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function () {
adjustFlexMenu();
}, 200);
});
$('body').on('flexmenu-go', function () {
$('body').trigger('flexmenu-beforeResize');
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function () {
$(flexObjects).each(function () {
$(this).flexMenu({
'undo': true
}).flexMenu(this.options);
});
}, 200);
});
$.fn.flexMenu = function (options) {
var checkFlexObject,
s = $.extend({
'threshold': 2, // [integer] If there are this many items or fewer in the list, we will not display a "View More" link and will instead let the list break to the next line. This is useful in cases where adding a "view more" link would actually cause more things to break to the next line.
'cutoff': 2, // [integer] If there is space for this many or fewer items outside our "more" popup, just move everything into the more menu. In that case, also use linkTextAll and linkTitleAll instead of linkText and linkTitle. To disable this feature, just set this value to 0.
'linkText': 'More', // [string] What text should we display on the "view more" link?
'linkTitle': 'View More', // [string] What should the title of the "view more" button be?
'linkTextAll': 'Menu', // [string] If we hit the cutoff, what text should we display on the "view more" link?
'linkTitleAll': 'Open/Close Menu', // [string] If we hit the cutoff, what should the title of the "view more" button be?
'showOnHover': true, // [boolean] Should we we show the menu on hover? If not, we'll require a click. If we're on a touch device - or if Modernizr is not available - we'll ignore this setting and only show the menu on click. The reason for this is that touch devices emulate hover events in unpredictable ways, causing some taps to do nothing.
'popupAbsolute': true, // [boolean] Should we absolutely position the popup? Usually this is a good idea. That way, the popup can appear over other content and spill outside a parent that has overflow: hidden set. If you want to do something different from this in CSS, just set this option to false.
'popupClass': '', // [string] If this is set, this class will be added to the popup
'undo': false // [boolean] Move the list items back to where they were before, and remove the "View More" link.
}, options);
this.options = s; // Set options on object
checkFlexObject = $.inArray(this, flexObjects); // Checks if this object is already in the flexObjects array
if (checkFlexObject >= 0) {
flexObjects.splice(checkFlexObject, 1); // Remove this object if found
} else {
flexObjects.push(this); // Add this object to the flexObjects array
}
return this.each(function () {
var $this = $(this),
exceptItems = '.kleo-toggle-menu.shop-drop, .kleo-search-nav, #nav-menu-item-side',
$items = $this.find('> li'),
$firstItem = $items.first(),
$lastItem = $items.not(exceptItems).last(),
numItems = $this.find('li').length,
firstItemTop = Math.floor($firstItem.offset().top),
firstItemHeight = Math.floor($firstItem.outerHeight(true)),
$lastChild,
keepLooking,
$moreItem,
$moreLink,
numToRemove,
allInPopup = false,
$menu,
i;
function needsMenu($itemOfInterest) {
var excluded = $(exceptItems);
var excludedReturn = false;
firstItemTop = Math.floor($firstItem.offset().top);
firstItemHeight = Math.floor($firstItem.outerHeight(true));
excluded.each(function () {
if (Math.ceil($(this).offset().top) >= ( firstItemTop + firstItemHeight )) {
excludedReturn = true;
}
});
if (excludedReturn) {
return true;
}
//var excludedResult = (Math.ceil(excluded.offset().top) >= (firstItemTop + firstItemHeight)) ? true : false;
//if (excludedResult == true) {
// return true;
//}
// Values may be calculated from em and give us something other than round numbers. Browsers may round these inconsistently. So, let's round numbers to make it easier to trigger flexMenu.
return (Math.ceil($itemOfInterest.offset().top) >= (firstItemTop + firstItemHeight));
}
//is > 768px
if ($lastItem.length && needsMenu($lastItem) && numItems > s.threshold && !s.undo && $this.is(':visible') && !KLEO.isMobile.tabletWidth()) {
var $popup = $('
');
// Add class if popupClass option is set
$popup.addClass(s.popupClass);
// Move all list items after the first to this new popup ul
for (i = numItems; i > 1; i--) {
// Find all of the list items that have been pushed below the first item. Put those items into the popup menu. Put one additional item into the popup menu to cover situations where the last item is shorter than the "more" text.
$lastChild = $this.find('> li').not(exceptItems).last();
keepLooking = (needsMenu($lastChild));
$lastChild.appendTo($popup);
// If there only a few items left in the navigation bar, move them all to the popup menu.
if ((i - 1) <= s.cutoff) { // We've removed the ith item, so i - 1 gives us the number of items remaining.
$($this.find("> li").not(exceptItems).get().reverse()).appendTo($popup);
allInPopup = true;
break;
}
if (!keepLooking) {
break;
}
}
if (allInPopup) {
$this.append('