Skip to content

Instantly share code, notes, and snippets.

@pcfreak30
Created March 17, 2017 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcfreak30/928b8e0035ddb8c324bb2aaedf407c91 to your computer and use it in GitHub Desktop.
Save pcfreak30/928b8e0035ddb8c324bb2aaedf407c91 to your computer and use it in GitHub Desktop.
Edge Script Bug
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="pingback" href="https://positek.net/xmlrpc.php" />
<title>Practical Help for Your Digital Life® - Consumer Tech Support for the Rest of Us</title>
<meta name="description" content="Consumer Tech Support for the Rest of Us" />
<meta name="robots" content="noodp" />
<link rel="canonical" href="https://positek.net/" />
<link rel="next" href="https://positek.net/page/2/" />
<link rel="publisher" href="http://google.com/+PositekNet" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Practical Help for Your Digital Life®" />
<meta property="og:description" content=
"Chris Gardner, Your Tech Coach brings you tips on how to manage your digital life, answering your burning questions about the consumer technology you own and use." />
<meta property="og:url" content="https://positek.net/" />
<meta property="og:site_name" content="Practical Help for Your Digital Life®" />
<meta property="fb:admins" content="100002561536104" />
<meta property="og:image" content="https://positek.net/wp-content/uploads/2014/09/2015_top_logo_for_adsense1.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="Consumer Tech Support for the Rest of Us" />
<meta name="twitter:title" content="Practical Help for Your Digital Life® - Consumer Tech Support for the Rest of Us" />
<meta name="twitter:site" content="@positek" />
<meta name="twitter:image" content="https://positek.net/wp-content/uploads/2014/09/2015_top_logo_for_adsense1.png" />
<script type="application/ld+json">
<![CDATA[
{"@context":"http:\/\/schema.org","@type":"WebSite","@id":"#website","url":"https:\/\/positek.net\/","name":"Practical Help for Your Digital Life\u00ae","alternateName":"PosiTek.net LLC","potentialAction":{"@type":"SearchAction","target":"https:\/\/positek.net\/?s={search_term_string}","query-input":"required name=search_term_string"}}
]]>
</script>
<script type="application/ld+json">
<![CDATA[
{"@context":"http:\/\/schema.org","@type":"Organization","url":"https:\/\/positek.net\/","sameAs":["https:\/\/www.facebook.com\/ChrisatPositek","https:\/\/www.linkedin.com\/in\/practicalhelp","http:\/\/google.com\/+PositekNet","https:\/\/www.youtube.com\/channel\/UCUzV4fc0I3OycMMd2-wSiPw","https:\/\/twitter.com\/positek"],"@id":"#organization","name":"PosiTek.net LLC","logo":"https:\/\/positek.net\/wp-content\/uploads\/2013\/10\/button100.png"}
]]>
</script>
<link rel="dns-prefetch" href="//1jlnyq1cz9avmcr4c1q1ls8i-wpengine.netdna-ssl.com" />
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//s.w.org" />
<link rel="alternate" type="application/rss+xml" title="Practical Help for Your Digital Life® » Feed" href=
"https://positek.net/feed/" />
<link rel="alternate" type="application/rss+xml" title="Practical Help for Your Digital Life® » Comments Feed" href=
"https://positek.net/comments/feed/" />
<link rel="https://api.w.org/" href="https://positek.net/wp-json/" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://positek.net/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://positek.net/wp-includes/wlwmanifest.xml" />
<style type="text/css">
/*<![CDATA[*/
#wptime-plugin-preloader{position:fixed;top:0;left:0;right:0;bottom:0;background:url(https://1jlnyq1cz9avmcr4c1q1ls8i-wpengine.netdna-ssl.com/wp-content/plugins/the-preloader/images/preloader.GIF) no-repeat #FFF 50%;-moz-background-size:64px 64px;-o-background-size:64px 64px;-webkit-background-size:64px 64px;background-size:64px 64px;z-index:99998;width:100%;height:100%}
/*]]>*/
</style><noscript>
<style type="text/css">
/*<![CDATA[*/
#wptime-plugin-preloader{display:none !important}
/*]]>*/
</style></noscript>
<meta name="generator" content="Videozoom 4.0.8" />
<meta name="generator" content="WPZOOM Framework 1.6.3" />
<meta name="norton-safeweb-site-verification" content=
"ybgnbvawr2n257ajkbrh8z8nnix1nz039e8en3ctc380zn4sfy92ntfi84nvcvs8cd9g22n7fsxls5c2hfjog8qi3w0f1r9kpu1u9yuxztcys2usozk8arwvtq39k6c3" />
<meta name="norton-safeweb-site-verification" content=
"rdgnjpwoetbtxfzv0bwmmvfncksjanyfpjgfly79kx75smnad14kinpd7qjpbarl4y0h3p56llvimaqaq-gu8o9nhdz2dczhorjr9wwdciflj3wusf9nqguz8lm8nc4e" />
<meta name="norton-safeweb-site-verification" content=
"xtryf91y3hvkvoeba30m5v6g29sthqm1froty-3ndkc7crxj7s5mt89z0vslckv4ww2nbtd1-g6i7gfhd0j3wklthi40d69he7lueug003zicr7-lz39yk7zzrn0za8k" />
<meta name="norton-safeweb-site-verification" content=
"p69b2nvmt3w1bmvw5sw1t6s0-42zq98dbrs7muxo3k74yr44kj094ln-e-ntt8q6tuxdweycc45yjo7ky8d5r3hybctrmxe9kl5x0sy9z3gw3o4w6t8id85c14daaybm" />
<meta name="norton-safeweb-site-verification" content=
"7zxj-cdtu-6bj0rxsbs-si0iyqlmrcfoqfz087g-8hbs3837m0ztls6duyoi2ut9-qwzyir9orrxc6g4l0lvciq2ilosazidf3gvte8nbx0gyhf5gj816zm5aaa40gmf" />
<meta name="norton-safeweb-site-verification" content=
"8d5fhdzq1dgqc8tlc0vxg4cb8c2lja5e74kybdfmukhyf0bmuy2sqqt6cu-9zqyqkt-z7ozaosxm9qejb0o5kj06dbavvrmviww8t0d0k7ohlcgbv8o5zzgk2177t2y6" />
<meta name="google-site-verification" content="BGFVcSBX35LEInh1zeUq6IpDjg3CEN_KVOOw5BwT55Q" />
<script data-no-minify="1">
<![CDATA[
(function(h){var d=function(d,e,n){function k(a){if(b.body)return a();setTimeout(function(){k(a)})}function f(){a.addEventListener&&a.removeEventListener("load",f);a.media=n||"all"}var b=h.document,a=b.createElement("link"),c;if(e)c=e;else{var l=(b.body||b.getElementsByTagName("head")[0]).childNodes;c=l[l.length-1]}var m=b.styleSheets;a.rel="stylesheet";a.href=d;a.media="only x";k(function(){c.parentNode.insertBefore(a,e?c:c.nextSibling)});var g=function(b){for(var c=a.href,d=m.length;d--;)if(m[d].href===
c)return b();setTimeout(function(){g(b)})};a.addEventListener&&a.addEventListener("load",f);a.onloadcssdefined=g;g(f);return a};"undefined"!==typeof exports?exports.loadCSS=d:h.loadCSS=d})("undefined"!==typeof global?global:this);loadCSS("https:\/\/1jlnyq1cz9avmcr4c1q1ls8i-wpengine.netdna-ssl.com\/wp-content\/cache\/min\/1\/1c9a2641fde46577c33cc603e9427166.css", document.getElementsByTagName("head")[0].childNodes[ document.getElementsByTagName("head")[0].childNodes.length-1]);
]]>
</script>
</head>
<body>
<div id="wptime-plugin-preloader"></div>
<script src="./test.js"></script>
</body>
</html>
alert('script running');
!function (a, b) {
"object" == typeof module && module.exports ? module.exports = b() : "function" == typeof define && define.amd ? define(b) : a.Spinner = b()
}
(this, function () {
"use strict";
function a(a, b) {
var c,
d = document.createElement(a || "div");
for (c in b)
d[c] = b[c];
return d
}
function b(a) {
for (var b = 1, c = arguments.length; c > b; b++)
a.appendChild(arguments[b]);
return a
}
function c(a, b, c, d) {
var e = ["opacity", b, ~~(100 * a), c, d].join("-"),
f = .01 + c / d * 100,
g = Math.max(1 - (1 - a) / b * (100 - f), a),
h = j.substring(0, j.indexOf("Animation")).toLowerCase(),
i = h && "-" + h + "-" || "";
return m[e] || (k.insertRule("@" + i + "keyframes " + e + "{0%{opacity:" + g + "}" + f + "%{opacity:" + a + "}" + (f + .01) + "%{opacity:1}" + (f + b) % 100 + "%{opacity:" + a + "}100%{opacity:" + g + "}}", k.cssRules.length), m[e] = 1),
e
}
function d(a, b) {
var c,
d,
e = a.style;
if (b = b.charAt(0).toUpperCase() + b.slice(1), void 0 !== e[b])
return b;
for (d = 0; d < l.length; d++)
if (c = l[d] + b, void 0 !== e[c])
return c
}
function e(a, b) {
for (var c in b)
a.style[d(a, c) || c] = b[c];
return a
}
function f(a) {
for (var b = 1; b < arguments.length; b++) {
var c = arguments[b];
for (var d in c)
void 0 === a[d] && (a[d] = c[d])
}
return a
}
function g(a, b) {
return "string" == typeof a ? a : a[b % a.length]
}
function h(a) {
this.opts = f(a || {}, h.defaults, n)
}
function i() {
function c(b, c) {
return a("<" + b + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', c)
}
k.addRule(".spin-vml", "behavior:url(#default#VML)"),
h.prototype.lines = function (a, d) {
function f() {
return e(c("group", {
coordsize: k + " " + k,
coordorigin: -j + " " + -j
}), {
width: k,
height: k
})
}
function h(a, h, i) {
b(m, b(e(f(), {
rotation: 360 / d.lines * a + "deg",
left: ~~h
}), b(e(c("roundrect", {
arcsize: d.corners
}), {
width: j,
height: d.scale * d.width,
left: d.scale * d.radius,
top: -d.scale * d.width >> 1,
filter: i
}), c("fill", {
color: g(d.color, a),
opacity: d.opacity
}), c("stroke", {
opacity: 0
}))))
}
var i,
j = d.scale * (d.length + d.width),
k = 2 * d.scale * j,
l = - (d.width + d.length) * d.scale * 2 + "px",
m = e(f(), {
position: "absolute",
top: l,
left: l
});
if (d.shadow)
for (i = 1; i <= d.lines; i++)
h(i, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
for (i = 1; i <= d.lines; i++)
h(i);
return b(a, m)
},
h.prototype.opacity = function (a, b, c, d) {
var e = a.firstChild;
d = d.shadow && d.lines || 0,
e && b + d < e.childNodes.length && (e = e.childNodes[b + d], e = e && e.firstChild, e = e && e.firstChild, e && (e.opacity = c))
}
}
var j,
k,
l = ["webkit", "Moz", "ms", "O"],
m = {},
n = {
lines: 12,
length: 7,
width: 5,
radius: 10,
scale: 1,
corners: 1,
color: "#000",
opacity: .25,
rotate: 0,
direction: 1,
speed: 1,
trail: 100,
fps: 20,
zIndex: 2e9,
className: "spinner",
top: "50%",
left: "50%",
shadow: !1,
hwaccel: !1,
position: "absolute"
};
if (h.defaults = {}, f(h.prototype, {
spin: function (b) {
this.stop();
var c = this,
d = c.opts,
f = c.el = a(null, {
className: d.className
});
if (e(f, {
position: d.position,
width: 0,
zIndex: d.zIndex,
left: d.left,
top: d.top
}), b && b.insertBefore(f, b.firstChild || null), f.setAttribute("role", "progressbar"), c.lines(f, c.opts), !j) {
var g,
h = 0,
i = (d.lines - 1) * (1 - d.direction) / 2,
k = d.fps,
l = k / d.speed,
m = (1 - d.opacity) / (l * d.trail / 100),
n = l / d.lines;
!function o() {
h++;
for (var a = 0; a < d.lines; a++)
g = Math.max(1 - (h + (d.lines - a) * n) % l * m, d.opacity), c.opacity(f, a * d.direction + i, g, d);
c.timeout = c.el && setTimeout(o, ~~(1e3 / k))
}
()
}
return c
},
stop: function () {
var a = this.el;
return a && (clearTimeout(this.timeout), a.parentNode && a.parentNode.removeChild(a), this.el = void 0),
this
},
lines: function (d, f) {
function h(b, c) {
return e(a(), {
position: "absolute",
width: f.scale * (f.length + f.width) + "px",
height: f.scale * f.width + "px",
background: b,
boxShadow: c,
transformOrigin: "left",
transform: "rotate(" + ~~(360 / f.lines * k + f.rotate) + "deg) translate(" + f.scale * f.radius + "px,0)",
borderRadius: (f.corners * f.scale * f.width >> 1) + "px"
})
}
for (var i, k = 0, l = (f.lines - 1) * (1 - f.direction) / 2; k < f.lines; k++)
i = e(a(), {
position: "absolute",
top: 1 + ~(f.scale * f.width / 2) + "px",
transform: f.hwaccel ? "translate3d(0,0,0)" : "",
opacity: f.opacity,
animation: j && c(f.opacity, f.trail, l + k * f.direction, f.lines) + " " + 1 / f.speed + "s linear infinite"
}), f.shadow && b(i, e(h("#000", "0 0 4px #000"), {
top: "2px"
})), b(d, b(i, h(g(f.color, k), "0 0 1px rgba(0,0,0,.1)")));
return d
},
opacity: function (a, b, c) {
b < a.childNodes.length && (a.childNodes[b].style.opacity = c)
}
}), "undefined" != typeof document) {
k = function () {
var c = a("style", {
type: "text/css"
});
return b(document.getElementsByTagName("head")[0], c),
c.sheet || c.styleSheet
}
();
var o = e(a("group"), {
behavior: "url(#default#VML)"
});
!d(o, "transform") && o.adj ? i() : j = d(o, "animation")
}
return h
});
(function (t, e) {
"object" == typeof exports ? module.exports = e(require("spin.js")) : "function" == typeof define && define.amd ? define(["spin"], e) : t.Ladda = e(t.Spinner)
})(this, function (t) {
"use strict";
function e(t) {
if (t === void 0)
return console.warn("Ladda button target must be defined."), void 0;
if (/ladda-button/i.test(t.className) || (t.className += " ladda-button"), t.hasAttribute("data-style") || t.setAttribute("data-style", "expand-right"), !t.querySelector(".ladda-label")) {
var e = document.createElement("span");
e.className = "ladda-label",
u(t, e)
}
var a,
n = t.querySelector(".ladda-spinner");
n || (n = document.createElement("span"), n.className = "ladda-spinner"),
t.appendChild(n);
var r,
i = {
start: function () {
return a || (a = o(t)),
t.setAttribute("disabled", ""),
t.setAttribute("data-loading", ""),
clearTimeout(r),
a.spin(n),
this.setProgress(0),
this
},
startAfter: function (t) {
return clearTimeout(r),
r = setTimeout(function () {
i.start()
}, t),
this
},
stop: function () {
return t.removeAttribute("disabled"),
t.removeAttribute("data-loading"),
clearTimeout(r),
a && (r = setTimeout(function () {
a.stop()
}, 1e3)),
this
},
toggle: function () {
return this.isLoading() ? this.stop() : this.start(),
this
},
setProgress: function (e) {
e = Math.max(Math.min(e, 1), 0);
var a = t.querySelector(".ladda-progress");
0 === e && a && a.parentNode ? a.parentNode.removeChild(a) : (a || (a = document.createElement("div"), a.className = "ladda-progress", t.appendChild(a)), a.style.width = (e || 0) * t.offsetWidth + "px")
},
enable: function () {
return this.stop(),
this
},
disable: function () {
return this.stop(),
t.setAttribute("disabled", ""),
this
},
isLoading: function () {
return t.hasAttribute("data-loading")
},
remove: function () {
clearTimeout(r),
t.removeAttribute("disabled", ""),
t.removeAttribute("data-loading", ""),
a && (a.stop(), a = null);
for (var e = 0, n = d.length; n > e; e++)
if (i === d[e]) {
d.splice(e, 1);
break
}
}
};
return d.push(i),
i
}
function a(t, e) {
for (; t.parentNode && t.tagName !== e; )
t = t.parentNode;
return e === t.tagName ? t : void 0
}
function n(t) {
for (var e = ["input", "textarea", "select"], a = [], n = 0; e.length > n; n++)
for (var r = t.getElementsByTagName(e[n]), i = 0; r.length > i; i++)
r[i].hasAttribute("required") && a.push(r[i]);
return a
}
function r(t, r) {
r = r || {};
var i = [];
"string" == typeof t ? i = s(document.querySelectorAll(t)) : "object" == typeof t && "string" == typeof t.nodeName && (i = [t]);
for (var o = 0, u = i.length; u > o; o++)
(function () {
var t = i[o];
if ("function" == typeof t.addEventListener) {
var s = e(t),
u = -1;
t.addEventListener("click", function () {
var e = !0,
i = a(t, "FORM");
if (i !== void 0)
for (var o = n(i), d = 0; o.length > d; d++)
"" === o[d].value.replace(/^\s+|\s+$/g, "") && (e = !1), "checkbox" !== o[d].type && "radio" !== o[d].type || o[d].checked || (e = !1), "email" === o[d].type && (e = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(o[d].value));
e && (s.startAfter(1), "number" == typeof r.timeout && (clearTimeout(u), u = setTimeout(s.stop, r.timeout)), "function" == typeof r.callback && r.callback.apply(null, [s]))
}, !1)
}
})()
}
function i() {
for (var t = 0, e = d.length; e > t; t++)
d[t].stop()
}
function o(e) {
var a,
n,
r = e.offsetHeight;
0 === r && (r = parseFloat(window.getComputedStyle(e).height)),
r > 32 && (r *= .8),
e.hasAttribute("data-spinner-size") && (r = parseInt(e.getAttribute("data-spinner-size"), 10)),
e.hasAttribute("data-spinner-color") && (a = e.getAttribute("data-spinner-color")),
e.hasAttribute("data-spinner-lines") && (n = parseInt(e.getAttribute("data-spinner-lines"), 10));
var i = .2 * r,
o = .6 * i,
s = 7 > i ? 2 : 3;
return new t({
color: a || "#fff",
lines: n || 12,
radius: i,
length: o,
width: s,
zIndex: "auto",
top: "auto",
left: "auto",
className: ""
})
}
function s(t) {
for (var e = [], a = 0; t.length > a; a++)
e.push(t[a]);
return e
}
function u(t, e) {
var a = document.createRange();
a.selectNodeContents(t),
a.surroundContents(e),
t.appendChild(e)
}
var d = [];
return {
bind: r,
create: e,
stopAll: i
}
});
!function (a, b) {
"object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) {
if (!a.document)
throw new Error("jQuery requires a window with a document");
return b(a)
}
: b(a)
}
("undefined" != typeof window ? window : this, function (a, b) {
var c = [],
d = a.document,
e = c.slice,
f = c.concat,
g = c.push,
h = c.indexOf,
i = {},
j = i.toString,
k = i.hasOwnProperty,
l = {},
m = "1.12.4",
n = function (a, b) {
return new n.fn.init(a, b)
},
o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
p = /^-ms-/,
q = /-([\da-z])/gi,
r = function (a, b) {
return b.toUpperCase()
};
n.fn = n.prototype = {
jquery: m,
constructor: n,
selector: "",
length: 0,
toArray: function () {
return e.call(this)
},
get: function (a) {
return null != a ? 0 > a ? this[a + this.length] : this[a] : e.call(this)
},
pushStack: function (a) {
var b = n.merge(this.constructor(), a);
return b.prevObject = this,
b.context = this.context,
b
},
each: function (a) {
return n.each(this, a)
},
map: function (a) {
return this.pushStack(n.map(this, function (b, c) {
return a.call(b, c, b)
}))
},
slice: function () {
return this.pushStack(e.apply(this, arguments))
},
first: function () {
return this.eq(0)
},
last: function () {
return this.eq(-1)
},
eq: function (a) {
var b = this.length,
c = +a + (0 > a ? b : 0);
return this.pushStack(c >= 0 && b > c ? [this[c]] : [])
},
end: function () {
return this.prevObject || this.constructor()
},
push: g,
sort: c.sort,
splice: c.splice
},
n.extend = n.fn.extend = function () {
var a,
b,
c,
d,
e,
f,
g = arguments[0] || {},
h = 1,
i = arguments.length,
j = !1;
for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || n.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)
if (null != (e = arguments[h]))
for (d in e)
a = g[d], c = e[d], g !== c && (j && c && (n.isPlainObject(c) || (b = n.isArray(c))) ? (b ? (b = !1, f = a && n.isArray(a) ? a : []) : f = a && n.isPlainObject(a) ? a : {}, g[d] = n.extend(j, f, c)) : void 0 !== c && (g[d] = c));
return g
},
n.extend({
expando: "jQuery" + (m + Math.random()).replace(/\D/g, ""),
isReady: !0,
error: function (a) {
throw new Error(a)
},
noop: function () {},
isFunction: function (a) {
return "function" === n.type(a)
},
isArray: Array.isArray || function (a) {
return "array" === n.type(a)
},
isWindow: function (a) {
return null != a && a == a.window
},
isNumeric: function (a) {
var b = a && a.toString();
return !n.isArray(a) && b - parseFloat(b) + 1 >= 0
},
isEmptyObject: function (a) {
var b;
for (b in a)
return !1;
return !0
},
isPlainObject: function (a) {
var b;
if (!a || "object" !== n.type(a) || a.nodeType || n.isWindow(a))
return !1;
try {
if (a.constructor && !k.call(a, "constructor") && !k.call(a.constructor.prototype, "isPrototypeOf"))
return !1
} catch (c) {
return !1
}
if (!l.ownFirst)
for (b in a)
return k.call(a, b);
for (b in a);
return void 0 === b || k.call(a, b)
},
type: function (a) {
return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? i[j.call(a)] || "object" : typeof a
},
globalEval: function (b) {
b && n.trim(b) && (a.execScript || function (b) {
a.eval.call(a, b)
})(b)
},
camelCase: function (a) {
return a.replace(p, "ms-").replace(q, r)
},
nodeName: function (a, b) {
return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase()
},
each: function (a, b) {
var c,
d = 0;
if (s(a)) {
for (c = a.length; c > d; d++)
if (b.call(a[d], d, a[d]) === !1)
break
} else
for (d in a)
if (b.call(a[d], d, a[d]) === !1)
break;
return a
},
trim: function (a) {
return null == a ? "" : (a + "").replace(o, "")
},
makeArray: function (a, b) {
var c = b || [];
return null != a && (s(Object(a)) ? n.merge(c, "string" == typeof a ? [a] : a) : g.call(c, a)),
c
},
inArray: function (a, b, c) {
var d;
if (b) {
if (h)
return h.call(b, a, c);
for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++)
if (c in b && b[c] === a)
return c
}
return -1
},
merge: function (a, b) {
var c = +b.length,
d = 0,
e = a.length;
while (c > d)
a[e++] = b[d++];
if (c !== c)
while (void 0 !== b[d])
a[e++] = b[d++];
return a.length = e,
a
},
grep: function (a, b, c) {
for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++)
d = !b(a[f], f), d !== h && e.push(a[f]);
return e
},
map: function (a, b, c) {
var d,
e,
g = 0,
h = [];
if (s(a))
for (d = a.length; d > g; g++)
e = b(a[g], g, c), null != e && h.push(e);
else
for (g in a)
e = b(a[g], g, c), null != e && h.push(e);
return f.apply([], h)
},
guid: 1,
proxy: function (a, b) {
var c,
d,
f;
return "string" == typeof b && (f = a[b], b = a, a = f),
n.isFunction(a) ? (c = e.call(arguments, 2), d = function () {
return a.apply(b || this, c.concat(e.call(arguments)))
}, d.guid = a.guid = a.guid || n.guid++, d) : void 0
},
now: function () {
return +new Date
},
support: l
}),
"function" == typeof Symbol && (n.fn[Symbol.iterator] = c[Symbol.iterator]),
n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (a, b) {
i["[object " + b + "]"] = b.toLowerCase()
});
function s(a) {
var b = !!a && "length" in a && a.length,
c = n.type(a);
return "function" === c || n.isWindow(a) ? !1 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a
}
var t = function (a) {
var b,
c,
d,
e,
f,
g,
h,
i,
j,
k,
l,
m,
n,
o,
p,
q,
r,
s,
t,
u = "sizzle" + 1 * new Date,
v = a.document,
w = 0,
x = 0,
y = ga(),
z = ga(),
A = ga(),
B = function (a, b) {
return a === b && (l = !0),
0
},
C = 1 << 31,
D = {}
.hasOwnProperty,
E = [],
F = E.pop,
G = E.push,
H = E.push,
I = E.slice,
J = function (a, b) {
for (var c = 0, d = a.length; d > c; c++)
if (a[c] === b)
return c;
return -1
},
K = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
L = "[\\x20\\t\\r\\n\\f]",
M = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
N = "\\[" + L + "*(" + M + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + M + "))|)" + L + "*\\]",
O = ":(" + M + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + N + ")*)|.*)\\)|)",
P = new RegExp(L + "+", "g"),
Q = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$", "g"),
R = new RegExp("^" + L + "*," + L + "*"),
S = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"),
T = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]", "g"),
U = new RegExp(O),
V = new RegExp("^" + M + "$"),
W = {
ID: new RegExp("^#(" + M + ")"),
CLASS: new RegExp("^\\.(" + M + ")"),
TAG: new RegExp("^(" + M + "|[*])"),
ATTR: new RegExp("^" + N),
PSEUDO: new RegExp("^" + O),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)", "i"),
bool: new RegExp("^(?:" + K + ")$", "i"),
needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)", "i")
},
X = /^(?:input|select|textarea|button)$/i,
Y = /^h\d$/i,
Z = /^[^{]+\{\s*\[native \w/,
$ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
_ = /[+~]/,
aa = /'|\\/g,
ba = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)", "ig"),
ca = function (a, b, c) {
var d = "0x" + b - 65536;
return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320)
},
da = function () {
m()
};
try {
H.apply(E = I.call(v.childNodes), v.childNodes),
E[v.childNodes.length].nodeType
} catch (ea) {
H = {
apply: E.length ? function (a, b) {
G.apply(a, I.call(b))
}
: function (a, b) {
var c = a.length,
d = 0;
while (a[c++] = b[d++]);
a.length = c - 1
}
}
}
function fa(a, b, d, e) {
var f,
h,
j,
k,
l,
o,
r,
s,
w = b && b.ownerDocument,
x = b ? b.nodeType : 9;
if (d = d || [], "string" != typeof a || !a || 1 !== x && 9 !== x && 11 !== x)
return d;
if (!e && ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, p)) {
if (11 !== x && (o = $.exec(a)))
if (f = o[1]) {
if (9 === x) {
if (!(j = b.getElementById(f)))
return d;
if (j.id === f)
return d.push(j), d
} else if (w && (j = w.getElementById(f)) && t(b, j) && j.id === f)
return d.push(j), d
} else {
if (o[2])
return H.apply(d, b.getElementsByTagName(a)), d;
if ((f = o[3]) && c.getElementsByClassName && b.getElementsByClassName)
return H.apply(d, b.getElementsByClassName(f)), d
}
if (c.qsa && !A[a + " "] && (!q || !q.test(a))) {
if (1 !== x)
w = b, s = a;
else if ("object" !== b.nodeName.toLowerCase()) {
(k = b.getAttribute("id")) ? k = k.replace(aa, "\\$&") : b.setAttribute("id", k = u),
r = g(a),
h = r.length,
l = V.test(k) ? "#" + k : "[id='" + k + "']";
while (h--)
r[h] = l + " " + qa(r[h]);
s = r.join(","),
w = _.test(a) && oa(b.parentNode) || b
}
if (s)
try {
return H.apply(d, w.querySelectorAll(s)),
d
} catch (y) {}
finally {
k === u && b.removeAttribute("id")
}
}
}
return i(a.replace(Q, "$1"), b, d, e)
}
function ga() {
var a = [];
function b(c, e) {
return a.push(c + " ") > d.cacheLength && delete b[a.shift()],
b[c + " "] = e
}
return b
}
function ha(a) {
return a[u] = !0,
a
}
function ia(a) {
var b = n.createElement("div");
try {
return !!a(b)
} catch (c) {
return !1
}
finally {
b.parentNode && b.parentNode.removeChild(b),
b = null
}
}
function ja(a, b) {
var c = a.split("|"),
e = c.length;
while (e--)
d.attrHandle[c[e]] = b
}
function ka(a, b) {
var c = b && a,
d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || C) - (~a.sourceIndex || C);
if (d)
return d;
if (c)
while (c = c.nextSibling)
if (c === b)
return -1;
return a ? 1 : -1
}
function la(a) {
return function (b) {
var c = b.nodeName.toLowerCase();
return "input" === c && b.type === a
}
}
function ma(a) {
return function (b) {
var c = b.nodeName.toLowerCase();
return ("input" === c || "button" === c) && b.type === a
}
}
function na(a) {
return ha(function (b) {
return b = +b,
ha(function (c, d) {
var e,
f = a([], c.length, b),
g = f.length;
while (g--)
c[e = f[g]] && (c[e] = !(d[e] = c[e]))
})
})
}
function oa(a) {
return a && "undefined" != typeof a.getElementsByTagName && a
}
c = fa.support = {},
f = fa.isXML = function (a) {
var b = a && (a.ownerDocument || a).documentElement;
return b ? "HTML" !== b.nodeName : !1
},
m = fa.setDocument = function (a) {
var b,
e,
g = a ? a.ownerDocument || a : v;
return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = n.documentElement, p = !f(n), (e = n.defaultView) && e.top !== e && (e.addEventListener ? e.addEventListener("unload", da, !1) : e.attachEvent && e.attachEvent("onunload", da)), c.attributes = ia(function (a) {
return a.className = "i",
!a.getAttribute("className")
}), c.getElementsByTagName = ia(function (a) {
return a.appendChild(n.createComment("")),
!a.getElementsByTagName("*").length
}), c.getElementsByClassName = Z.test(n.getElementsByClassName), c.getById = ia(function (a) {
return o.appendChild(a).id = u,
!n.getElementsByName || !n.getElementsByName(u).length
}), c.getById ? (d.find.ID = function (a, b) {
if ("undefined" != typeof b.getElementById && p) {
var c = b.getElementById(a);
return c ? [c] : []
}
}, d.filter.ID = function (a) {
var b = a.replace(ba, ca);
return function (a) {
return a.getAttribute("id") === b
}
}) : (delete d.find.ID, d.filter.ID = function (a) {
var b = a.replace(ba, ca);
return function (a) {
var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");
return c && c.value === b
}
}), d.find.TAG = c.getElementsByTagName ? function (a, b) {
return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0
}
: function (a, b) {
var c,
d = [],
e = 0,
f = b.getElementsByTagName(a);
if ("*" === a) {
while (c = f[e++])
1 === c.nodeType && d.push(c);
return d
}
return f
}, d.find.CLASS = c.getElementsByClassName && function (a, b) {
return "undefined" != typeof b.getElementsByClassName && p ? b.getElementsByClassName(a) : void 0
}, r = [], q = [], (c.qsa = Z.test(n.querySelectorAll)) && (ia(function (a) {
o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\r\\' msallowcapture=''><option selected=''></option></select>",
a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + L + "*(?:''|\"\")"),
a.querySelectorAll("[selected]").length || q.push("\\[" + L + "*(?:value|" + K + ")"),
a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="),
a.querySelectorAll(":checked").length || q.push(":checked"),
a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]")
}), ia(function (a) {
var b = n.createElement("input");
b.setAttribute("type", "hidden"),
a.appendChild(b).setAttribute("name", "D"),
a.querySelectorAll("[name=d]").length && q.push("name" + L + "*[*^$|!~]?="),
a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"),
a.querySelectorAll("*,:x"),
q.push(",.*:")
})), (c.matchesSelector = Z.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ia(function (a) {
c.disconnectedMatch = s.call(a, "div"),
s.call(a, "[s!='']:x"),
r.push("!=", O)
}), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = Z.test(o.compareDocumentPosition), t = b || Z.test(o.contains) ? function (a, b) {
var c = 9 === a.nodeType ? a.documentElement : a,
d = b && b.parentNode;
return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)))
}
: function (a, b) {
if (b)
while (b = b.parentNode)
if (b === a)
return !0;
return !1
}, B = b ? function (a, b) {
if (a === b)
return l = !0, 0;
var d = !a.compareDocumentPosition - !b.compareDocumentPosition;
return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === n || a.ownerDocument === v && t(v, a) ? -1 : b === n || b.ownerDocument === v && t(v, b) ? 1 : k ? J(k, a) - J(k, b) : 0 : 4 & d ? -1 : 1)
}
: function (a, b) {
if (a === b)
return l = !0, 0;
var c,
d = 0,
e = a.parentNode,
f = b.parentNode,
g = [a],
h = [b];
if (!e || !f)
return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? J(k, a) - J(k, b) : 0;
if (e === f)
return ka(a, b);
c = a;
while (c = c.parentNode)
g.unshift(c);
c = b;
while (c = c.parentNode)
h.unshift(c);
while (g[d] === h[d])
d++;
return d ? ka(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0
}, n) : n
},
fa.matches = function (a, b) {
return fa(a, null, null, b)
},
fa.matchesSelector = function (a, b) {
if ((a.ownerDocument || a) !== n && m(a), b = b.replace(T, "='$1']"), c.matchesSelector && p && !A[b + " "] && (!r || !r.test(b)) && (!q || !q.test(b)))
try {
var d = s.call(a, b);
if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType)
return d
} catch (e) {}
return fa(b, n, null, [a]).length > 0
},
fa.contains = function (a, b) {
return (a.ownerDocument || a) !== n && m(a),
t(a, b)
},
fa.attr = function (a, b) {
(a.ownerDocument || a) !== n && m(a);
var e = d.attrHandle[b.toLowerCase()],
f = e && D.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0;
return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null
},
fa.error = function (a) {
throw new Error("Syntax error, unrecognized expression: " + a)
},
fa.uniqueSort = function (a) {
var b,
d = [],
e = 0,
f = 0;
if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) {
while (b = a[f++])
b === a[f] && (e = d.push(f));
while (e--)
a.splice(d[e], 1)
}
return k = null,
a
},
e = fa.getText = function (a) {
var b,
c = "",
d = 0,
f = a.nodeType;
if (f) {
if (1 === f || 9 === f || 11 === f) {
if ("string" == typeof a.textContent)
return a.textContent;
for (a = a.firstChild; a; a = a.nextSibling)
c += e(a)
} else if (3 === f || 4 === f)
return a.nodeValue
} else
while (b = a[d++])
c += e(b);
return c
},
d = fa.selectors = {
cacheLength: 50,
createPseudo: ha,
match: W,
attrHandle: {},
find: {},
relative: {
">": {
dir: "parentNode",
first: !0
},
" ": {
dir: "parentNode"
},
"+": {
dir: "previousSibling",
first: !0
},
"~": {
dir: "previousSibling"
}
},
preFilter: {
ATTR: function (a) {
return a[1] = a[1].replace(ba, ca),
a[3] = (a[3] || a[4] || a[5] || "").replace(ba, ca),
"~=" === a[2] && (a[3] = " " + a[3] + " "),
a.slice(0, 4)
},
CHILD: function (a) {
return a[1] = a[1].toLowerCase(),
"nth" === a[1].slice(0, 3) ? (a[3] || fa.error(a[0]), a[4] = + (a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = + (a[7] + a[8] || "odd" === a[3])) : a[3] && fa.error(a[0]),
a
},
PSEUDO: function (a) {
var b,
c = !a[6] && a[2];
return W.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && U.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3))
}
},
filter: {
TAG: function (a) {
var b = a.replace(ba, ca).toLowerCase();
return "*" === a ? function () {
return !0
}
: function (a) {
return a.nodeName && a.nodeName.toLowerCase() === b
}
},
CLASS: function (a) {
var b = y[a + " "];
return b || (b = new RegExp("(^|" + L + ")" + a + "(" + L + "|$)")) && y(a, function (a) {
return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "")
})
},
ATTR: function (a, b, c) {
return function (d) {
var e = fa.attr(d, a);
return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(P, " ") + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0
}
},
CHILD: function (a, b, c, d, e) {
var f = "nth" !== a.slice(0, 3),
g = "last" !== a.slice(-4),
h = "of-type" === b;
return 1 === d && 0 === e ? function (a) {
return !!a.parentNode
}
: function (b, c, i) {
var j,
k,
l,
m,
n,
o,
p = f !== g ? "nextSibling" : "previousSibling",
q = b.parentNode,
r = h && b.nodeName.toLowerCase(),
s = !i && !h,
t = !1;
if (q) {
if (f) {
while (p) {
m = b;
while (m = m[p])
if (h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType)
return !1;
o = p = "only" === a && !o && "nextSibling"
}
return !0
}
if (o = [g ? q.firstChild : q.lastChild], g && s) {
m = q,
l = m[u] || (m[u] = {}),
k = l[m.uniqueID] || (l[m.uniqueID] = {}),
j = k[a] || [],
n = j[0] === w && j[1],
t = n && j[2],
m = n && q.childNodes[n];
while (m = ++n && m && m[p] || (t = n = 0) || o.pop())
if (1 === m.nodeType && ++t && m === b) {
k[a] = [w, n, t];
break
}
} else if (s && (m = b, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n), t === !1)
while (m = ++n && m && m[p] || (t = n = 0) || o.pop())
if ((h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && ++t && (s && (l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), k[a] = [w, t]), m === b))
break;
return t -= e,
t === d || t % d === 0 && t / d >= 0
}
}
},
PSEUDO: function (a, b) {
var c,
e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || fa.error("unsupported pseudo: " + a);
return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ha(function (a, c) {
var d,
f = e(a, b),
g = f.length;
while (g--)
d = J(a, f[g]), a[d] = !(c[d] = f[g])
}) : function (a) {
return e(a, 0, c)
}) : e
}
},
pseudos: {
not: ha(function (a) {
var b = [],
c = [],
d = h(a.replace(Q, "$1"));
return d[u] ? ha(function (a, b, c, e) {
var f,
g = d(a, null, e, []),
h = a.length;
while (h--)
(f = g[h]) && (a[h] = !(b[h] = f))
}) : function (a, e, f) {
return b[0] = a,
d(b, null, f, c),
b[0] = null,
!c.pop()
}
}),
has: ha(function (a) {
return function (b) {
return fa(a, b).length > 0
}
}),
contains: ha(function (a) {
return a = a.replace(ba, ca),
function (b) {
return (b.textContent || b.innerText || e(b)).indexOf(a) > -1
}
}),
lang: ha(function (a) {
return V.test(a || "") || fa.error("unsupported lang: " + a),
a = a.replace(ba, ca).toLowerCase(),
function (b) {
var c;
do
if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang"))
return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-");
while ((b = b.parentNode) && 1 === b.nodeType);
return !1
}
}),
target: function (b) {
var c = a.location && a.location.hash;
return c && c.slice(1) === b.id
},
root: function (a) {
return a === o
},
focus: function (a) {
return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex)
},
enabled: function (a) {
return a.disabled === !1
},
disabled: function (a) {
return a.disabled === !0
},
checked: function (a) {
var b = a.nodeName.toLowerCase();
return "input" === b && !!a.checked || "option" === b && !!a.selected
},
selected: function (a) {
return a.parentNode && a.parentNode.selectedIndex,
a.selected === !0
},
empty: function (a) {
for (a = a.firstChild; a; a = a.nextSibling)
if (a.nodeType < 6)
return !1;
return !0
},
parent: function (a) {
return !d.pseudos.empty(a)
},
header: function (a) {
return Y.test(a.nodeName)
},
input: function (a) {
return X.test(a.nodeName)
},
button: function (a) {
var b = a.nodeName.toLowerCase();
return "input" === b && "button" === a.type || "button" === b
},
text: function (a) {
var b;
return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase())
},
first: na(function () {
return [0]
}),
last: na(function (a, b) {
return [b - 1]
}),
eq: na(function (a, b, c) {
return [0 > c ? c + b : c]
}),
even: na(function (a, b) {
for (var c = 0; b > c; c += 2)
a.push(c);
return a
}),
odd: na(function (a, b) {
for (var c = 1; b > c; c += 2)
a.push(c);
return a
}),
lt: na(function (a, b, c) {
for (var d = 0 > c ? c + b : c; --d >= 0; )
a.push(d);
return a
}),
gt: na(function (a, b, c) {
for (var d = 0 > c ? c + b : c; ++d < b; )
a.push(d);
return a
})
}
},
d.pseudos.nth = d.pseudos.eq;
for (b in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
})
d.pseudos[b] = la(b);
for (b in {
submit: !0,
reset: !0
})
d.pseudos[b] = ma(b);
function pa() {}
pa.prototype = d.filters = d.pseudos,
d.setFilters = new pa,
g = fa.tokenize = function (a, b) {
var c,
e,
f,
g,
h,
i,
j,
k = z[a + " "];
if (k)
return b ? 0 : k.slice(0);
h = a,
i = [],
j = d.preFilter;
while (h) {
c && !(e = R.exec(h)) || (e && (h = h.slice(e[0].length) || h), i.push(f = [])),
c = !1,
(e = S.exec(h)) && (c = e.shift(), f.push({
value: c,
type: e[0].replace(Q, " ")
}), h = h.slice(c.length));
for (g in d.filter)
!(e = W[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({
value: c,
type: g,
matches: e
}), h = h.slice(c.length));
if (!c)
break
}
return b ? h.length : h ? fa.error(a) : z(a, i).slice(0)
};
function qa(a) {
for (var b = 0, c = a.length, d = ""; c > b; b++)
d += a[b].value;
return d
}
function ra(a, b, c) {
var d = b.dir,
e = c && "parentNode" === d,
f = x++;
return b.first ? function (b, c, f) {
while (b = b[d])
if (1 === b.nodeType || e)
return a(b, c, f)
}
: function (b, c, g) {
var h,
i,
j,
k = [w, f];
if (g) {
while (b = b[d])
if ((1 === b.nodeType || e) && a(b, c, g))
return !0
} else
while (b = b[d])
if (1 === b.nodeType || e) {
if (j = b[u] || (b[u] = {}), i = j[b.uniqueID] || (j[b.uniqueID] = {}), (h = i[d]) && h[0] === w && h[1] === f)
return k[2] = h[2];
if (i[d] = k, k[2] = a(b, c, g))
return !0
}
}
}
function sa(a) {
return a.length > 1 ? function (b, c, d) {
var e = a.length;
while (e--)
if (!a[e](b, c, d))
return !1;
return !0
}
: a[0]
}
function ta(a, b, c) {
for (var d = 0, e = b.length; e > d; d++)
fa(a, b[d], c);
return c
}
function ua(a, b, c, d, e) {
for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)
(f = a[h]) && (c && !c(f, d, e) || (g.push(f), j && b.push(h)));
return g
}
function va(a, b, c, d, e, f) {
return d && !d[u] && (d = va(d)),
e && !e[u] && (e = va(e, f)),
ha(function (f, g, h, i) {
var j,
k,
l,
m = [],
n = [],
o = g.length,
p = f || ta(b || "*", h.nodeType ? [h] : h, []),
q = !a || !f && b ? p : ua(p, m, a, h, i),
r = c ? e || (f ? a : o || d) ? [] : g : q;
if (c && c(q, r, h, i), d) {
j = ua(r, n),
d(j, [], h, i),
k = j.length;
while (k--)
(l = j[k]) && (r[n[k]] = !(q[n[k]] = l))
}
if (f) {
if (e || a) {
if (e) {
j = [],
k = r.length;
while (k--)
(l = r[k]) && j.push(q[k] = l);
e(null, r = [], j, i)
}
k = r.length;
while (k--)
(l = r[k]) && (j = e ? J(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l))
}
} else
r = ua(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : H.apply(g, r)
})
}
function wa(a) {
for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = ra(function (a) {
return a === b
}, h, !0), l = ra(function (a) {
return J(b, a) > -1
}, h, !0), m = [function (a, c, d) {
var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d));
return b = null,
e
}
]; f > i; i++)
if (c = d.relative[a[i].type])
m = [ra(sa(m), c)];
else {
if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) {
for (e = ++i; f > e; e++)
if (d.relative[a[e].type])
break;
return va(i > 1 && sa(m), i > 1 && qa(a.slice(0, i - 1).concat({
value: " " === a[i - 2].type ? "*" : ""
})).replace(Q, "$1"), c, e > i && wa(a.slice(i, e)), f > e && wa(a = a.slice(e)), f > e && qa(a))
}
m.push(c)
}
return sa(m)
}
function xa(a, b) {
var c = b.length > 0,
e = a.length > 0,
f = function (f, g, h, i, k) {
var l,
o,
q,
r = 0,
s = "0",
t = f && [],
u = [],
v = j,
x = f || e && d.find.TAG("*", k),
y = w += null == v ? 1 : Math.random() || .1,
z = x.length;
for (k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) {
if (e && l) {
o = 0,
g || l.ownerDocument === n || (m(l), h = !p);
while (q = a[o++])
if (q(l, g || n, h)) {
i.push(l);
break
}
k && (w = y)
}
c && ((l = !q && l) && r--, f && t.push(l))
}
if (r += s, c && s !== r) {
o = 0;
while (q = b[o++])
q(t, u, g, h);
if (f) {
if (r > 0)
while (s--)
t[s] || u[s] || (u[s] = F.call(i));
u = ua(u)
}
H.apply(i, u),
k && !f && u.length > 0 && r + b.length > 1 && fa.uniqueSort(i)
}
return k && (w = y, j = v),
t
};
return c ? ha(f) : f
}
return h = fa.compile = function (a, b) {
var c,
d = [],
e = [],
f = A[a + " "];
if (!f) {
b || (b = g(a)),
c = b.length;
while (c--)
f = wa(b[c]), f[u] ? d.push(f) : e.push(f);
f = A(a, xa(e, d)),
f.selector = a
}
return f
},
i = fa.select = function (a, b, e, f) {
var i,
j,
k,
l,
m,
n = "function" == typeof a && a,
o = !f && g(a = n.selector || a);
if (e = e || [], 1 === o.length) {
if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) {
if (b = (d.find.ID(k.matches[0].replace(ba, ca), b) || [])[0], !b)
return e;
n && (b = b.parentNode),
a = a.slice(j.shift().value.length)
}
i = W.needsContext.test(a) ? 0 : j.length;
while (i--) {
if (k = j[i], d.relative[l = k.type])
break;
if ((m = d.find[l]) && (f = m(k.matches[0].replace(ba, ca), _.test(j[0].type) && oa(b.parentNode) || b))) {
if (j.splice(i, 1), a = f.length && qa(j), !a)
return H.apply(e, f), e;
break
}
}
}
return (n || h(a, o))(f, b, !p, e, !b || _.test(a) && oa(b.parentNode) || b),
e
},
c.sortStable = u.split("").sort(B).join("") === u,
c.detectDuplicates = !!l,
m(),
c.sortDetached = ia(function (a) {
return 1 & a.compareDocumentPosition(n.createElement("div"))
}),
ia(function (a) {
return a.innerHTML = "<a href='#'></a>",
"#" === a.firstChild.getAttribute("href")
}) || ja("type|href|height|width", function (a, b, c) {
return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2)
}),
c.attributes && ia(function (a) {
return a.innerHTML = "<input/>",
a.firstChild.setAttribute("value", ""),
"" === a.firstChild.getAttribute("value")
}) || ja("value", function (a, b, c) {
return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue
}),
ia(function (a) {
return null == a.getAttribute("disabled")
}) || ja(K, function (a, b, c) {
var d;
return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null
}),
fa
}
(a);
n.find = t,
n.expr = t.selectors,
n.expr[":"] = n.expr.pseudos,
n.uniqueSort = n.unique = t.uniqueSort,
n.text = t.getText,
n.isXMLDoc = t.isXML,
n.contains = t.contains;
var u = function (a, b, c) {
var d = [],
e = void 0 !== c;
while ((a = a[b]) && 9 !== a.nodeType)
if (1 === a.nodeType) {
if (e && n(a).is(c))
break;
d.push(a)
}
return d
},
v = function (a, b) {
for (var c = []; a; a = a.nextSibling)
1 === a.nodeType && a !== b && c.push(a);
return c
},
w = n.expr.match.needsContext,
x = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,
y = /^.[^:#\[\.,]*$/;
function z(a, b, c) {
if (n.isFunction(b))
return n.grep(a, function (a, d) {
return !!b.call(a, d, a) !== c
});
if (b.nodeType)
return n.grep(a, function (a) {
return a === b !== c
});
if ("string" == typeof b) {
if (y.test(b))
return n.filter(b, a, c);
b = n.filter(b, a)
}
return n.grep(a, function (a) {
return n.inArray(a, b) > -1 !== c
})
}
n.filter = function (a, b, c) {
var d = b[0];
return c && (a = ":not(" + a + ")"),
1 === b.length && 1 === d.nodeType ? n.find.matchesSelector(d, a) ? [d] : [] : n.find.matches(a, n.grep(b, function (a) {
return 1 === a.nodeType
}))
},
n.fn.extend({
find: function (a) {
var b,
c = [],
d = this,
e = d.length;
if ("string" != typeof a)
return this.pushStack(n(a).filter(function () {
for (b = 0; e > b; b++)
if (n.contains(d[b], this))
return !0
}));
for (b = 0; e > b; b++)
n.find(a, d[b], c);
return c = this.pushStack(e > 1 ? n.unique(c) : c),
c.selector = this.selector ? this.selector + " " + a : a,
c
},
filter: function (a) {
return this.pushStack(z(this, a || [], !1))
},
not: function (a) {
return this.pushStack(z(this, a || [], !0))
},
is: function (a) {
return !!z(this, "string" == typeof a && w.test(a) ? n(a) : a || [], !1).length
}
});
var A,
B = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
C = n.fn.init = function (a, b, c) {
var e,
f;
if (!a)
return this;
if (c = c || A, "string" == typeof a) {
if (e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : B.exec(a), !e || !e[1] && b)
return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a);
if (e[1]) {
if (b = b instanceof n ? b[0] : b, n.merge(this, n.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), x.test(e[1]) && n.isPlainObject(b))
for (e in b)
n.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]);
return this
}
if (f = d.getElementById(e[2]), f && f.parentNode) {
if (f.id !== e[2])
return A.find(a);
this.length = 1,
this[0] = f
}
return this.context = d,
this.selector = a,
this
}
return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : n.isFunction(a) ? "undefined" != typeof c.ready ? c.ready(a) : a(n) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), n.makeArray(a, this))
};
C.prototype = n.fn,
A = n(d);
var D = /^(?:parents|prev(?:Until|All))/,
E = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
n.fn.extend({
has: function (a) {
var b,
c = n(a, this),
d = c.length;
return this.filter(function () {
for (b = 0; d > b; b++)
if (n.contains(this, c[b]))
return !0
})
},
closest: function (a, b) {
for (var c, d = 0, e = this.length, f = [], g = w.test(a) || "string" != typeof a ? n(a, b || this.context) : 0; e > d; d++)
for (c = this[d]; c && c !== b; c = c.parentNode)
if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && n.find.matchesSelector(c, a))) {
f.push(c);
break
}
return this.pushStack(f.length > 1 ? n.uniqueSort(f) : f)
},
index: function (a) {
return a ? "string" == typeof a ? n.inArray(this[0], n(a)) : n.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
},
add: function (a, b) {
return this.pushStack(n.uniqueSort(n.merge(this.get(), n(a, b))))
},
addBack: function (a) {
return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
}
});
function F(a, b) {
do
a = a[b];
while (a && 1 !== a.nodeType);
return a
}
n.each({
parent: function (a) {
var b = a.parentNode;
return b && 11 !== b.nodeType ? b : null
},
parents: function (a) {
return u(a, "parentNode")
},
parentsUntil: function (a, b, c) {
return u(a, "parentNode", c)
},
next: function (a) {
return F(a, "nextSibling")
},
prev: function (a) {
return F(a, "previousSibling")
},
nextAll: function (a) {
return u(a, "nextSibling")
},
prevAll: function (a) {
return u(a, "previousSibling")
},
nextUntil: function (a, b, c) {
return u(a, "nextSibling", c)
},
prevUntil: function (a, b, c) {
return u(a, "previousSibling", c)
},
siblings: function (a) {
return v((a.parentNode || {}).firstChild, a)
},
children: function (a) {
return v(a.firstChild)
},
contents: function (a) {
return n.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : n.merge([], a.childNodes)
}
}, function (a, b) {
n.fn[a] = function (c, d) {
var e = n.map(this, b, c);
return "Until" !== a.slice(-5) && (d = c),
d && "string" == typeof d && (e = n.filter(d, e)),
this.length > 1 && (E[a] || (e = n.uniqueSort(e)), D.test(a) && (e = e.reverse())),
this.pushStack(e)
}
});
var G = /\S+/g;
function H(a) {
var b = {};
return n.each(a.match(G) || [], function (a, c) {
b[c] = !0
}),
b
}
n.Callbacks = function (a) {
a = "string" == typeof a ? H(a) : n.extend({}, a);
var b,
c,
d,
e,
f = [],
g = [],
h = -1,
i = function () {
for (e = a.once, d = b = !0; g.length; h = -1) {
c = g.shift();
while (++h < f.length)
f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && (h = f.length, c = !1)
}
a.memory || (c = !1),
b = !1,
e && (f = c ? [] : "")
},
j = {
add: function () {
return f && (c && !b && (h = f.length - 1, g.push(c)), function d(b) {
n.each(b, function (b, c) {
n.isFunction(c) ? a.unique && j.has(c) || f.push(c) : c && c.length && "string" !== n.type(c) && d(c)
})
}
(arguments), c && !b && i()),
this
},
remove: function () {
return n.each(arguments, function (a, b) {
var c;
while ((c = n.inArray(b, f, c)) > -1)
f.splice(c, 1), h >= c && h--
}),
this
},
has: function (a) {
return a ? n.inArray(a, f) > -1 : f.length > 0
},
empty: function () {
return f && (f = []),
this
},
disable: function () {
return e = g = [],
f = c = "",
this
},
disabled: function () {
return !f
},
lock: function () {
return e = !0,
c || j.disable(),
this
},
locked: function () {
return !!e
},
fireWith: function (a, c) {
return e || (c = c || [], c = [a, c.slice ? c.slice() : c], g.push(c), b || i()),
this
},
fire: function () {
return j.fireWith(this, arguments),
this
},
fired: function () {
return !!d
}
};
return j
},
n.extend({
Deferred: function (a) {
var b = [["resolve", "done", n.Callbacks("once memory"), "resolved"], ["reject", "fail", n.Callbacks("once memory"), "rejected"], ["notify", "progress", n.Callbacks("memory")]],
c = "pending",
d = {
state: function () {
return c
},
always: function () {
return e.done(arguments).fail(arguments),
this
},
then: function () {
var a = arguments;
return n.Deferred(function (c) {
n.each(b, function (b, f) {
var g = n.isFunction(a[b]) && a[b];
e[f[1]](function () {
var a = g && g.apply(this, arguments);
a && n.isFunction(a.promise) ? a.promise().progress(c.notify).done(c.resolve).fail(c.reject) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments)
})
}),
a = null
}).promise()
},
promise: function (a) {
return null != a ? n.extend(a, d) : d
}
},
e = {};
return d.pipe = d.then,
n.each(b, function (a, f) {
var g = f[2],
h = f[3];
d[f[1]] = g.add,
h && g.add(function () {
c = h
}, b[1 ^ a][2].disable, b[2][2].lock),
e[f[0]] = function () {
return e[f[0] + "With"](this === e ? d : this, arguments),
this
},
e[f[0] + "With"] = g.fireWith
}),
d.promise(e),
a && a.call(e, e),
e
},
when: function (a) {
var b = 0,
c = e.call(arguments),
d = c.length,
f = 1 !== d || a && n.isFunction(a.promise) ? d : 0,
g = 1 === f ? a : n.Deferred(),
h = function (a, b, c) {
return function (d) {
b[a] = this,
c[a] = arguments.length > 1 ? e.call(arguments) : d,
c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c)
}
},
i,
j,
k;
if (d > 1)
for (i = new Array(d), j = new Array(d), k = new Array(d); d > b; b++)
c[b] && n.isFunction(c[b].promise) ? c[b].promise().progress(h(b, j, i)).done(h(b, k, c)).fail(g.reject) : --f;
return f || g.resolveWith(k, c),
g.promise()
}
});
var I;
n.fn.ready = function (a) {
return n.ready.promise().done(a),
this
},
n.extend({
isReady: !1,
readyWait: 1,
holdReady: function (a) {
a ? n.readyWait++ : n.ready(!0)
},
ready: function (a) {
(a === !0 ? --n.readyWait : n.isReady) || (n.isReady = !0, a !== !0 && --n.readyWait > 0 || (I.resolveWith(d, [n]), n.fn.triggerHandler && (n(d).triggerHandler("ready"), n(d).off("ready"))))
}
});
function J() {
d.addEventListener ? (d.removeEventListener("DOMContentLoaded", K), a.removeEventListener("load", K)) : (d.detachEvent("onreadystatechange", K), a.detachEvent("onload", K))
}
function K() {
(d.addEventListener || "load" === a.event.type || "complete" === d.readyState) && (J(), n.ready())
}
n.ready.promise = function (b) {
if (!I)
if (I = n.Deferred(), "complete" === d.readyState || "loading" !== d.readyState && !d.documentElement.doScroll)
a.setTimeout(n.ready);
else if (d.addEventListener)
d.addEventListener("DOMContentLoaded", K), a.addEventListener("load", K);
else {
d.attachEvent("onreadystatechange", K),
a.attachEvent("onload", K);
var c = !1;
try {
c = null == a.frameElement && d.documentElement
} catch (e) {}
c && c.doScroll && !function f() {
if (!n.isReady) {
try {
c.doScroll("left")
} catch (b) {
return a.setTimeout(f, 50)
}
J(),
n.ready()
}
}
()
}
return I.promise(b)
},
n.ready.promise();
var L;
for (L in n(l))
break;
l.ownFirst = "0" === L,
l.inlineBlockNeedsLayout = !1,
n(function () {
var a,
b,
c,
e;
c = d.getElementsByTagName("body")[0],
c && c.style && (b = d.createElement("div"), e = d.createElement("div"), e.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(e).appendChild(b), "undefined" != typeof b.style.zoom && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", l.inlineBlockNeedsLayout = a = 3 === b.offsetWidth, a && (c.style.zoom = 1)), c.removeChild(e))
}),
function () {
var a = d.createElement("div");
l.deleteExpando = !0;
try {
delete a.test
} catch (b) {
l.deleteExpando = !1
}
a = null
}
();
var M = function (a) {
var b = n.noData[(a.nodeName + " ").toLowerCase()],
c = +a.nodeType || 1;
return 1 !== c && 9 !== c ? !1 : !b || b !== !0 && a.getAttribute("classid") === b
},
N = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
O = /([A-Z])/g;
function P(a, b, c) {
if (void 0 === c && 1 === a.nodeType) {
var d = "data-" + b.replace(O, "-$1").toLowerCase();
if (c = a.getAttribute(d), "string" == typeof c) {
try {
c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : N.test(c) ? n.parseJSON(c) : c
} catch (e) {}
n.data(a, b, c)
} else
c = void 0;
}
return c
}
function Q(a) {
var b;
for (b in a)
if (("data" !== b || !n.isEmptyObject(a[b])) && "toJSON" !== b)
return !1;
return !0
}
function R(a, b, d, e) {
if (M(a)) {
var f,
g,
h = n.expando,
i = a.nodeType,
j = i ? n.cache : a,
k = i ? a[h] : a[h] && h;
if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b)
return k || (k = i ? a[h] = c.pop() || n.guid++ : h), j[k] || (j[k] = i ? {}
: {
toJSON: n.noop
}), "object" != typeof b && "function" != typeof b || (e ? j[k] = n.extend(j[k], b) : j[k].data = n.extend(j[k].data, b)), g = j[k], e || (g.data || (g.data = {}), g = g.data), void 0 !== d && (g[n.camelCase(b)] = d), "string" == typeof b ? (f = g[b], null == f && (f = g[n.camelCase(b)])) : f = g, f
}
}
function S(a, b, c) {
if (M(a)) {
var d,
e,
f = a.nodeType,
g = f ? n.cache : a,
h = f ? a[n.expando] : n.expando;
if (g[h]) {
if (b && (d = c ? g[h] : g[h].data)) {
n.isArray(b) ? b = b.concat(n.map(b, n.camelCase)) : b in d ? b = [b] : (b = n.camelCase(b), b = b in d ? [b] : b.split(" ")),
e = b.length;
while (e--)
delete d[b[e]];
if (c ? !Q(d) : !n.isEmptyObject(d))
return
}
(c || (delete g[h].data, Q(g[h]))) && (f ? n.cleanData([a], !0) : l.deleteExpando || g != g.window ? delete g[h] : g[h] = void 0)
}
}
}
n.extend({
cache: {},
noData: {
"applet ": !0,
"embed ": !0,
"object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
},
hasData: function (a) {
return a = a.nodeType ? n.cache[a[n.expando]] : a[n.expando],
!!a && !Q(a)
},
data: function (a, b, c) {
return R(a, b, c)
},
removeData: function (a, b) {
return S(a, b)
},
_data: function (a, b, c) {
return R(a, b, c, !0)
},
_removeData: function (a, b) {
return S(a, b, !0)
}
}),
n.fn.extend({
data: function (a, b) {
var c,
d,
e,
f = this[0],
g = f && f.attributes;
if (void 0 === a) {
if (this.length && (e = n.data(f), 1 === f.nodeType && !n._data(f, "parsedAttrs"))) {
c = g.length;
while (c--)
g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = n.camelCase(d.slice(5)), P(f, d, e[d])));
n._data(f, "parsedAttrs", !0)
}
return e
}
return "object" == typeof a ? this.each(function () {
n.data(this, a)
}) : arguments.length > 1 ? this.each(function () {
n.data(this, a, b)
}) : f ? P(f, a, n.data(f, a)) : void 0
},
removeData: function (a) {
return this.each(function () {
n.removeData(this, a)
})
}
}),
n.extend({
queue: function (a, b, c) {
var d;
return a ? (b = (b || "fx") + "queue", d = n._data(a, b), c && (!d || n.isArray(c) ? d = n._data(a, b, n.makeArray(c)) : d.push(c)), d || []) : void 0
},
dequeue: function (a, b) {
b = b || "fx";
var c = n.queue(a, b),
d = c.length,
e = c.shift(),
f = n._queueHooks(a, b),
g = function () {
n.dequeue(a, b)
};
"inprogress" === e && (e = c.shift(), d--),
e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)),
!d && f && f.empty.fire()
},
_queueHooks: function (a, b) {
var c = b + "queueHooks";
return n._data(a, c) || n._data(a, c, {
empty: n.Callbacks("once memory").add(function () {
n._removeData(a, b + "queue"),
n._removeData(a, c)
})
})
}
}),
n.fn.extend({
queue: function (a, b) {
var c = 2;
return "string" != typeof a && (b = a, a = "fx", c--),
arguments.length < c ? n.queue(this[0], a) : void 0 === b ? this : this.each(function () {
var c = n.queue(this, a, b);
n._queueHooks(this, a),
"fx" === a && "inprogress" !== c[0] && n.dequeue(this, a)
})
},
dequeue: function (a) {
return this.each(function () {
n.dequeue(this, a)
})
},
clearQueue: function (a) {
return this.queue(a || "fx", [])
},
promise: function (a, b) {
var c,
d = 1,
e = n.Deferred(),
f = this,
g = this.length,
h = function () {
--d || e.resolveWith(f, [f])
};
"string" != typeof a && (b = a, a = void 0),
a = a || "fx";
while (g--)
c = n._data(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h));
return h(),
e.promise(b)
}
}),
function () {
var a;
l.shrinkWrapBlocks = function () {
if (null != a)
return a;
a = !1;
var b,
c,
e;
return c = d.getElementsByTagName("body")[0],
c && c.style ? (b = d.createElement("div"), e = d.createElement("div"), e.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(e).appendChild(b), "undefined" != typeof b.style.zoom && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(d.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(e), a) : void 0
}
}
();
var T = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
U = new RegExp("^(?:([+-])=|)(" + T + ")([a-z%]*)$", "i"),
V = ["Top", "Right", "Bottom", "Left"],
W = function (a, b) {
return a = b || a,
"none" === n.css(a, "display") || !n.contains(a.ownerDocument, a)
};
function X(a, b, c, d) {
var e,
f = 1,
g = 20,
h = d ? function () {
return d.cur()
}
: function () {
return n.css(a, b, "")
},
i = h(),
j = c && c[3] || (n.cssNumber[b] ? "" : "px"),
k = (n.cssNumber[b] || "px" !== j && +i) && U.exec(n.css(a, b));
if (k && k[3] !== j) {
j = j || k[3],
c = c || [],
k = +i || 1;
do
f = f || ".5", k /= f, n.style(a, b, k + j);
while (f !== (f = h() / i) && 1 !== f && --g)
}
return c && (k = +k || +i || 0, e = c[1] ? k + (c[1] + 1) * c[2] : +c[2], d && (d.unit = j, d.start = k, d.end = e)),
e
}
var Y = function (a, b, c, d, e, f, g) {
var h = 0,
i = a.length,
j = null == c;
if ("object" === n.type(c)) {
e = !0;
for (h in c)
Y(a, b, h, c[h], !0, f, g)
} else if (void 0 !== d && (e = !0, n.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function (a, b, c) {
return j.call(n(a), c)
})), b))
for (; i > h; h++)
b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
},
Z = /^(?:checkbox|radio)$/i,
$ = /<([\w:-]+)/,
_ = /^$|\/(?:java|ecma)script/i,
aa = /^\s+/,
ba = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";
function ca(a) {
var b = ba.split("|"),
c = a.createDocumentFragment();
if (c.createElement)
while (b.length)
c.createElement(b.pop());
return c
}
!function () {
var a = d.createElement("div"),
b = d.createDocumentFragment(),
c = d.createElement("input");
a.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
l.leadingWhitespace = 3 === a.firstChild.nodeType,
l.tbody = !a.getElementsByTagName("tbody").length,
l.htmlSerialize = !!a.getElementsByTagName("link").length,
l.html5Clone = "<:nav></:nav>" !== d.createElement("nav").cloneNode(!0).outerHTML,
c.type = "checkbox",
c.checked = !0,
b.appendChild(c),
l.appendChecked = c.checked,
a.innerHTML = "<textarea>x</textarea>",
l.noCloneChecked = !!a.cloneNode(!0).lastChild.defaultValue,
b.appendChild(a),
c = d.createElement("input"),
c.setAttribute("type", "radio"),
c.setAttribute("checked", "checked"),
c.setAttribute("name", "t"),
a.appendChild(c),
l.checkClone = a.cloneNode(!0).cloneNode(!0).lastChild.checked,
l.noCloneEvent = !!a.addEventListener,
a[n.expando] = 1,
l.attributes = !a.getAttribute(n.expando)
}
();
var da = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
area: [1, "<map>", "</map>"],
param: [1, "<object>", "</object>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
_default: l.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
};
da.optgroup = da.option,
da.tbody = da.tfoot = da.colgroup = da.caption = da.thead,
da.th = da.td;
function ea(a, b) {
var c,
d,
e = 0,
f = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName(b || "*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll(b || "*") : void 0;
if (!f)
for (f = [], c = a.childNodes || a; null != (d = c[e]); e++)
!b || n.nodeName(d, b) ? f.push(d) : n.merge(f, ea(d, b));
return void 0 === b || b && n.nodeName(a, b) ? n.merge([a], f) : f
}
function fa(a, b) {
for (var c, d = 0; null != (c = a[d]); d++)
n._data(c, "globalEval", !b || n._data(b[d], "globalEval"))
}
var ga = /<|&#?\w+;/,
ha = /<tbody/i;
function ia(a) {
Z.test(a.type) && (a.defaultChecked = a.checked)
}
function ja(a, b, c, d, e) {
for (var f, g, h, i, j, k, m, o = a.length, p = ca(b), q = [], r = 0; o > r; r++)
if (g = a[r], g || 0 === g)
if ("object" === n.type(g))
n.merge(q, g.nodeType ? [g] : g);
else if (ga.test(g)) {
i = i || p.appendChild(b.createElement("div")),
j = ($.exec(g) || ["", ""])[1].toLowerCase(),
m = da[j] || da._default,
i.innerHTML = m[1] + n.htmlPrefilter(g) + m[2],
f = m[0];
while (f--)
i = i.lastChild;
if (!l.leadingWhitespace && aa.test(g) && q.push(b.createTextNode(aa.exec(g)[0])), !l.tbody) {
g = "table" !== j || ha.test(g) ? "<table>" !== m[1] || ha.test(g) ? 0 : i : i.firstChild,
f = g && g.childNodes.length;
while (f--)
n.nodeName(k = g.childNodes[f], "tbody") && !k.childNodes.length && g.removeChild(k)
}
n.merge(q, i.childNodes),
i.textContent = "";
while (i.firstChild)
i.removeChild(i.firstChild);
i = p.lastChild
} else
q.push(b.createTextNode(g));
i && p.removeChild(i),
l.appendChecked || n.grep(ea(q, "input"), ia),
r = 0;
while (g = q[r++])
if (d && n.inArray(g, d) > -1)
e && e.push(g);
else if (h = n.contains(g.ownerDocument, g), i = ea(p.appendChild(g), "script"), h && fa(i), c) {
f = 0;
while (g = i[f++])
_.test(g.type || "") && c.push(g)
}
return i = null,
p
}
!function () {
var b,
c,
e = d.createElement("div");
for (b in {
submit: !0,
change: !0,
focusin: !0
})
c = "on" + b, (l[b] = c in a) || (e.setAttribute(c, "t"), l[b] = e.attributes[c].expando === !1);
e = null
}
();
var ka = /^(?:input|select|textarea)$/i,
la = /^key/,
ma = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
na = /^(?:focusinfocus|focusoutblur)$/,
oa = /^([^.]*)(?:\.(.+)|)/;
function pa() {
return !0
}
function qa() {
return !1
}
function ra() {
try {
return d.activeElement
} catch (a) {}
}
function sa(a, b, c, d, e, f) {
var g,
h;
if ("object" == typeof b) {
"string" != typeof c && (d = d || c, c = void 0);
for (h in b)
sa(a, h, c, d, b[h], f);
return a
}
if (null == d && null == e ? (e = c, d = c = void 0) : null == e && ("string" == typeof c ? (e = d, d = void 0) : (e = d, d = c, c = void 0)), e === !1)
e = qa;
else if (!e)
return a;
return 1 === f && (g = e, e = function (a) {
return n().off(a),
g.apply(this, arguments)
}, e.guid = g.guid || (g.guid = n.guid++)),
a.each(function () {
n.event.add(this, b, e, d, c)
})
}
n.event = {
global: {},
add: function (a, b, c, d, e) {
var f,
g,
h,
i,
j,
k,
l,
m,
o,
p,
q,
r = n._data(a);
if (r) {
c.handler && (i = c, c = i.handler, e = i.selector),
c.guid || (c.guid = n.guid++),
(g = r.events) || (g = r.events = {}),
(k = r.handle) || (k = r.handle = function (a) {
return "undefined" == typeof n || a && n.event.triggered === a.type ? void 0 : n.event.dispatch.apply(k.elem, arguments)
}, k.elem = a),
b = (b || "").match(G) || [""],
h = b.length;
while (h--)
f = oa.exec(b[h]) || [], o = q = f[1], p = (f[2] || "").split(".").sort(), o && (j = n.event.special[o] || {}, o = (e ? j.delegateType : j.bindType) || o, j = n.event.special[o] || {}, l = n.extend({
type: o,
origType: q,
data: d,
handler: c,
guid: c.guid,
selector: e,
needsContext: e && n.expr.match.needsContext.test(e),
namespace: p.join(".")
}, i), (m = g[o]) || (m = g[o] = [], m.delegateCount = 0, j.setup && j.setup.call(a, d, p, k) !== !1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))), j.add && (j.add.call(a, l), l.handler.guid || (l.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, l) : m.push(l), n.event.global[o] = !0);
a = null
}
},
remove: function (a, b, c, d, e) {
var f,
g,
h,
i,
j,
k,
l,
m,
o,
p,
q,
r = n.hasData(a) && n._data(a);
if (r && (k = r.events)) {
b = (b || "").match(G) || [""],
j = b.length;
while (j--)
if (h = oa.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) {
l = n.event.special[o] || {},
o = (d ? l.delegateType : l.bindType) || o,
m = k[o] || [],
h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"),
i = f = m.length;
while (f--)
g = m[f], !e && q !== g.origType || c && c.guid !== g.guid || h && !h.test(g.namespace) || d && d !== g.selector && ("**" !== d || !g.selector) || (m.splice(f, 1), g.selector && m.delegateCount--, l.remove && l.remove.call(a, g));
i && !m.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || n.removeEvent(a, o, r.handle), delete k[o])
} else
for (o in k)
n.event.remove(a, o + b[j], c, d, !0);
n.isEmptyObject(k) && (delete r.handle, n._removeData(a, "events"))
}
},
trigger: function (b, c, e, f) {
var g,
h,
i,
j,
l,
m,
o,
p = [e || d],
q = k.call(b, "type") ? b.type : b,
r = k.call(b, "namespace") ? b.namespace.split(".") : [];
if (i = m = e = e || d, 3 !== e.nodeType && 8 !== e.nodeType && !na.test(q + n.event.triggered) && (q.indexOf(".") > -1 && (r = q.split("."), q = r.shift(), r.sort()), h = q.indexOf(":") < 0 && "on" + q, b = b[n.expando] ? b : new n.Event(q, "object" == typeof b && b), b.isTrigger = f ? 2 : 3, b.namespace = r.join("."), b.rnamespace = b.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = e), c = null == c ? [b] : n.makeArray(c, [b]), l = n.event.special[q] || {}, f || !l.trigger || l.trigger.apply(e, c) !== !1)) {
if (!f && !l.noBubble && !n.isWindow(e)) {
for (j = l.delegateType || q, na.test(j + q) || (i = i.parentNode); i; i = i.parentNode)
p.push(i), m = i;
m === (e.ownerDocument || d) && p.push(m.defaultView || m.parentWindow || a)
}
o = 0;
while ((i = p[o++]) && !b.isPropagationStopped())
b.type = o > 1 ? j : l.bindType || q, g = (n._data(i, "events") || {})[b.type] && n._data(i, "handle"), g && g.apply(i, c), g = h && i[h], g && g.apply && M(i) && (b.result = g.apply(i, c), b.result === !1 && b.preventDefault());
if (b.type = q, !f && !b.isDefaultPrevented() && (!l._default || l._default.apply(p.pop(), c) === !1) && M(e) && h && e[q] && !n.isWindow(e)) {
m = e[h],
m && (e[h] = null),
n.event.triggered = q;
try {
e[q]()
} catch (s) {}
n.event.triggered = void 0,
m && (e[h] = m)
}
return b.result
}
},
dispatch: function (a) {
a = n.event.fix(a);
var b,
c,
d,
f,
g,
h = [],
i = e.call(arguments),
j = (n._data(this, "events") || {})[a.type] || [],
k = n.event.special[a.type] || {};
if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) {
h = n.event.handlers.call(this, a, j),
b = 0;
while ((f = h[b++]) && !a.isPropagationStopped()) {
a.currentTarget = f.elem,
c = 0;
while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped())
a.rnamespace && !a.rnamespace.test(g.namespace) || (a.handleObj = g, a.data = g.data, d = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== d && (a.result = d) === !1 && (a.preventDefault(), a.stopPropagation()))
}
return k.postDispatch && k.postDispatch.call(this, a),
a.result
}
},
handlers: function (a, b) {
var c,
d,
e,
f,
g = [],
h = b.delegateCount,
i = a.target;
if (h && i.nodeType && ("click" !== a.type || isNaN(a.button) || a.button < 1))
for (; i != this; i = i.parentNode || this)
if (1 === i.nodeType && (i.disabled !== !0 || "click" !== a.type)) {
for (d = [], c = 0; h > c; c++)
f = b[c], e = f.selector + " ", void 0 === d[e] && (d[e] = f.needsContext ? n(e, this).index(i) > -1 : n.find(e, this, null, [i]).length), d[e] && d.push(f);
d.length && g.push({
elem: i,
handlers: d
})
}
return h < b.length && g.push({
elem: this,
handlers: b.slice(h)
}),
g
},
fix: function (a) {
if (a[n.expando])
return a;
var b,
c,
e,
f = a.type,
g = a,
h = this.fixHooks[f];
h || (this.fixHooks[f] = h = ma.test(f) ? this.mouseHooks : la.test(f) ? this.keyHooks : {}),
e = h.props ? this.props.concat(h.props) : this.props,
a = new n.Event(g),
b = e.length;
while (b--)
c = e[b], a[c] = g[c];
return a.target || (a.target = g.srcElement || d),
3 === a.target.nodeType && (a.target = a.target.parentNode),
a.metaKey = !!a.metaKey,
h.filter ? h.filter(a, g) : a
},
props: "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function (a, b) {
return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode),
a
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function (a, b) {
var c,
e,
f,
g = b.button,
h = b.fromElement;
return null == a.pageX && null != b.clientX && (e = a.target.ownerDocument || d, f = e.documentElement, c = e.body, a.pageX = b.clientX + (f && f.scrollLeft || c && c.scrollLeft || 0) - (f && f.clientLeft || c && c.clientLeft || 0), a.pageY = b.clientY + (f && f.scrollTop || c && c.scrollTop || 0) - (f && f.clientTop || c && c.clientTop || 0)),
!a.relatedTarget && h && (a.relatedTarget = h === a.target ? b.toElement : h),
a.which || void 0 === g || (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0),
a
}
},
special: {
load: {
noBubble: !0
},
focus: {
trigger: function () {
if (this !== ra() && this.focus)
try {
return this.focus(),
!1
} catch (a) {}
},
delegateType: "focusin"
},
blur: {
trigger: function () {
return this === ra() && this.blur ? (this.blur(), !1) : void 0
},
delegateType: "focusout"
},
click: {
trigger: function () {
return n.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0
},
_default: function (a) {
return n.nodeName(a.target, "a")
}
},
beforeunload: {
postDispatch: function (a) {
void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result)
}
}
},
simulate: function (a, b, c) {
var d = n.extend(new n.Event, c, {
type: a,
isSimulated: !0
});
n.event.trigger(d, null, b),
d.isDefaultPrevented() && c.preventDefault()
}
},
n.removeEvent = d.removeEventListener ? function (a, b, c) {
a.removeEventListener && a.removeEventListener(b, c)
}
: function (a, b, c) {
var d = "on" + b;
a.detachEvent && ("undefined" == typeof a[d] && (a[d] = null), a.detachEvent(d, c))
},
n.Event = function (a, b) {
return this instanceof n.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? pa : qa) : this.type = a, b && n.extend(this, b), this.timeStamp = a && a.timeStamp || n.now(), void(this[n.expando] = !0)) : new n.Event(a, b)
},
n.Event.prototype = {
constructor: n.Event,
isDefaultPrevented: qa,
isPropagationStopped: qa,
isImmediatePropagationStopped: qa,
preventDefault: function () {
var a = this.originalEvent;
this.isDefaultPrevented = pa,
a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
},
stopPropagation: function () {
var a = this.originalEvent;
this.isPropagationStopped = pa,
a && !this.isSimulated && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
},
stopImmediatePropagation: function () {
var a = this.originalEvent;
this.isImmediatePropagationStopped = pa,
a && a.stopImmediatePropagation && a.stopImmediatePropagation(),
this.stopPropagation()
}
},
n.each({
mouseenter: "mouseover",
mouseleave: "mouseout",
pointerenter: "pointerover",
pointerleave: "pointerout"
}, function (a, b) {
n.event.special[a] = {
delegateType: b,
bindType: b,
handle: function (a) {
var c,
d = this,
e = a.relatedTarget,
f = a.handleObj;
return e && (e === d || n.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b),
c
}
}
}),
l.submit || (n.event.special.submit = {
setup: function () {
return n.nodeName(this, "form") ? !1 : void n.event.add(this, "click._submit keypress._submit", function (a) {
var b = a.target,
c = n.nodeName(b, "input") || n.nodeName(b, "button") ? n.prop(b, "form") : void 0;
c && !n._data(c, "submit") && (n.event.add(c, "submit._submit", function (a) {
a._submitBubble = !0
}), n._data(c, "submit", !0))
})
},
postDispatch: function (a) {
a._submitBubble && (delete a._submitBubble, this.parentNode && !a.isTrigger && n.event.simulate("submit", this.parentNode, a))
},
teardown: function () {
return n.nodeName(this, "form") ? !1 : void n.event.remove(this, "._submit")
}
}),
l.change || (n.event.special.change = {
setup: function () {
return ka.test(this.nodeName) ? ("checkbox" !== this.type && "radio" !== this.type || (n.event.add(this, "propertychange._change", function (a) {
"checked" === a.originalEvent.propertyName && (this._justChanged = !0)
}), n.event.add(this, "click._change", function (a) {
this._justChanged && !a.isTrigger && (this._justChanged = !1),
n.event.simulate("change", this, a)
})), !1) : void n.event.add(this, "beforeactivate._change", function (a) {
var b = a.target;
ka.test(b.nodeName) && !n._data(b, "change") && (n.event.add(b, "change._change", function (a) {
!this.parentNode || a.isSimulated || a.isTrigger || n.event.simulate("change", this.parentNode, a)
}), n._data(b, "change", !0))
})
},
handle: function (a) {
var b = a.target;
return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0
},
teardown: function () {
return n.event.remove(this, "._change"),
!ka.test(this.nodeName)
}
}),
l.focusin || n.each({
focus: "focusin",
blur: "focusout"
}, function (a, b) {
var c = function (a) {
n.event.simulate(b, a.target, n.event.fix(a))
};
n.event.special[b] = {
setup: function () {
var d = this.ownerDocument || this,
e = n._data(d, b);
e || d.addEventListener(a, c, !0),
n._data(d, b, (e || 0) + 1)
},
teardown: function () {
var d = this.ownerDocument || this,
e = n._data(d, b) - 1;
e ? n._data(d, b, e) : (d.removeEventListener(a, c, !0), n._removeData(d, b))
}
}
}),
n.fn.extend({
on: function (a, b, c, d) {
return sa(this, a, b, c, d)
},
one: function (a, b, c, d) {
return sa(this, a, b, c, d, 1)
},
off: function (a, b, c) {
var d,
e;
if (a && a.preventDefault && a.handleObj)
return d = a.handleObj, n(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this;
if ("object" == typeof a) {
for (e in a)
this.off(e, b, a[e]);
return this
}
return b !== !1 && "function" != typeof b || (c = b, b = void 0),
c === !1 && (c = qa),
this.each(function () {
n.event.remove(this, a, c, b)
})
},
trigger: function (a, b) {
return this.each(function () {
n.event.trigger(a, b, this)
})
},
triggerHandler: function (a, b) {
var c = this[0];
return c ? n.event.trigger(a, b, c, !0) : void 0
}
});
var ta = / jQuery\d+="(?:null|\d+)"/g,
ua = new RegExp("<(?:" + ba + ")[\\s/>]", "i"),
va = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
wa = /<script|<style|<link/i,
xa = /checked\s*(?:[^=]|=\s*.checked.)/i,
ya = /^true\/(.*)/,
za = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
Aa = ca(d),
Ba = Aa.appendChild(d.createElement("div"));
function Ca(a, b) {
return n.nodeName(a, "table") && n.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
}
function Da(a) {
return a.type = (null !== n.find.attr(a, "type")) + "/" + a.type,
a
}
function Ea(a) {
var b = ya.exec(a.type);
return b ? a.type = b[1] : a.removeAttribute("type"),
a
}
function Fa(a, b) {
if (1 === b.nodeType && n.hasData(a)) {
var c,
d,
e,
f = n._data(a),
g = n._data(b, f),
h = f.events;
if (h) {
delete g.handle,
g.events = {};
for (c in h)
for (d = 0, e = h[c].length; e > d; d++)
n.event.add(b, c, h[c][d])
}
g.data && (g.data = n.extend({}, g.data))
}
}
function Ga(a, b) {
var c,
d,
e;
if (1 === b.nodeType) {
if (c = b.nodeName.toLowerCase(), !l.noCloneEvent && b[n.expando]) {
e = n._data(b);
for (d in e.events)
n.removeEvent(b, d, e.handle);
b.removeAttribute(n.expando)
}
"script" === c && b.text !== a.text ? (Da(b).text = a.text, Ea(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), l.html5Clone && a.innerHTML && !n.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && Z.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : "input" !== c && "textarea" !== c || (b.defaultValue = a.defaultValue)
}
}
function Ha(a, b, c, d) {
b = f.apply([], b);
var e,
g,
h,
i,
j,
k,
m = 0,
o = a.length,
p = o - 1,
q = b[0],
r = n.isFunction(q);
if (r || o > 1 && "string" == typeof q && !l.checkClone && xa.test(q))
return a.each(function (e) {
var f = a.eq(e);
r && (b[0] = q.call(this, e, f.html())),
Ha(f, b, c, d)
});
if (o && (k = ja(b, a[0].ownerDocument, !1, a, d), e = k.firstChild, 1 === k.childNodes.length && (k = e), e || d)) {
for (i = n.map(ea(k, "script"), Da), h = i.length; o > m; m++)
g = k, m !== p && (g = n.clone(g, !0, !0), h && n.merge(i, ea(g, "script"))), c.call(a[m], g, m);
if (h)
for (j = i[i.length - 1].ownerDocument, n.map(i, Ea), m = 0; h > m; m++)
g = i[m], _.test(g.type || "") && !n._data(g, "globalEval") && n.contains(j, g) && (g.src ? n._evalUrl && n._evalUrl(g.src) : n.globalEval((g.text || g.textContent || g.innerHTML || "").replace(za, "")));
k = e = null
}
return a
}
function Ia(a, b, c) {
for (var d, e = b ? n.filter(b, a) : a, f = 0; null != (d = e[f]); f++)
c || 1 !== d.nodeType || n.cleanData(ea(d)), d.parentNode && (c && n.contains(d.ownerDocument, d) && fa(ea(d, "script")), d.parentNode.removeChild(d));
return a
}
n.extend({
htmlPrefilter: function (a) {
return a.replace(va, "<$1></$2>")
},
clone: function (a, b, c) {
var d,
e,
f,
g,
h,
i = n.contains(a.ownerDocument, a);
if (l.html5Clone || n.isXMLDoc(a) || !ua.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (Ba.innerHTML = a.outerHTML, Ba.removeChild(f = Ba.firstChild)), !(l.noCloneEvent && l.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || n.isXMLDoc(a)))
for (d = ea(f), h = ea(a), g = 0; null != (e = h[g]); ++g)
d[g] && Ga(e, d[g]);
if (b)
if (c)
for (h = h || ea(a), d = d || ea(f), g = 0; null != (e = h[g]); g++)
Fa(e, d[g]);
else
Fa(a, f);
return d = ea(f, "script"),
d.length > 0 && fa(d, !i && ea(a, "script")),
d = h = e = null,
f
},
cleanData: function (a, b) {
for (var d, e, f, g, h = 0, i = n.expando, j = n.cache, k = l.attributes, m = n.event.special; null != (d = a[h]); h++)
if ((b || M(d)) && (f = d[i], g = f && j[f])) {
if (g.events)
for (e in g.events)
m[e] ? n.event.remove(d, e) : n.removeEvent(d, e, g.handle);
j[f] && (delete j[f], k || "undefined" == typeof d.removeAttribute ? d[i] = void 0 : d.removeAttribute(i), c.push(f))
}
}
}),
n.fn.extend({
domManip: Ha,
detach: function (a) {
return Ia(this, a, !0)
},
remove: function (a) {
return Ia(this, a)
},
text: function (a) {
return Y(this, function (a) {
return void 0 === a ? n.text(this) : this.empty().append((this[0] && this[0].ownerDocument || d).createTextNode(a))
}, null, a, arguments.length)
},
append: function () {
return Ha(this, arguments, function (a) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var b = Ca(this, a);
b.appendChild(a)
}
})
},
prepend: function () {
return Ha(this, arguments, function (a) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var b = Ca(this, a);
b.insertBefore(a, b.firstChild)
}
})
},
before: function () {
return Ha(this, arguments, function (a) {
this.parentNode && this.parentNode.insertBefore(a, this)
})
},
after: function () {
return Ha(this, arguments, function (a) {
this.parentNode && this.parentNode.insertBefore(a, this.nextSibling)
})
},
empty: function () {
for (var a, b = 0; null != (a = this[b]); b++) {
1 === a.nodeType && n.cleanData(ea(a, !1));
while (a.firstChild)
a.removeChild(a.firstChild);
a.options && n.nodeName(a, "select") && (a.options.length = 0)
}
return this
},
clone: function (a, b) {
return a = null == a ? !1 : a,
b = null == b ? a : b,
this.map(function () {
return n.clone(this, a, b)
})
},
html: function (a) {
return Y(this, function (a) {
var b = this[0] || {},
c = 0,
d = this.length;
if (void 0 === a)
return 1 === b.nodeType ? b.innerHTML.replace(ta, "") : void 0;
if ("string" == typeof a && !wa.test(a) && (l.htmlSerialize || !ua.test(a)) && (l.leadingWhitespace || !aa.test(a)) && !da[($.exec(a) || ["", ""])[1].toLowerCase()]) {
a = n.htmlPrefilter(a);
try {
for (; d > c; c++)
b = this[c] || {},
1 === b.nodeType && (n.cleanData(ea(b, !1)), b.innerHTML = a);
b = 0
} catch (e) {}
}
b && this.empty().append(a)
}, null, a, arguments.length)
},
replaceWith: function () {
var a = [];
return Ha(this, arguments, function (b) {
var c = this.parentNode;
n.inArray(this, a) < 0 && (n.cleanData(ea(this)), c && c.replaceChild(b, this))
}, a)
}
}),
n.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function (a, b) {
n.fn[a] = function (a) {
for (var c, d = 0, e = [], f = n(a), h = f.length - 1; h >= d; d++)
c = d === h ? this : this.clone(!0), n(f[d])[b](c), g.apply(e, c.get());
return this.pushStack(e)
}
});
var Ja,
Ka = {
HTML: "block",
BODY: "block"
};
function La(a, b) {
var c = n(b.createElement(a)).appendTo(b.body),
d = n.css(c[0], "display");
return c.detach(),
d
}
function Ma(a) {
var b = d,
c = Ka[a];
return c || (c = La(a, b), "none" !== c && c || (Ja = (Ja || n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = (Ja[0].contentWindow || Ja[0].contentDocument).document, b.write(), b.close(), c = La(a, b), Ja.detach()), Ka[a] = c),
c
}
var Na = /^margin/,
Oa = new RegExp("^(" + T + ")(?!px)[a-z%]+$", "i"),
Pa = function (a, b, c, d) {
var e,
f,
g = {};
for (f in b)
g[f] = a.style[f], a.style[f] = b[f];
e = c.apply(a, d || []);
for (f in b)
a.style[f] = g[f];
return e
},
Qa = d.documentElement;
!function () {
var b,
c,
e,
f,
g,
h,
i = d.createElement("div"),
j = d.createElement("div");
if (j.style) {
j.style.cssText = "float:left;opacity:.5",
l.opacity = "0.5" === j.style.opacity,
l.cssFloat = !!j.style.cssFloat,
j.style.backgroundClip = "content-box",
j.cloneNode(!0).style.backgroundClip = "",
l.clearCloneStyle = "content-box" === j.style.backgroundClip,
i = d.createElement("div"),
i.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",
j.innerHTML = "",
i.appendChild(j),
l.boxSizing = "" === j.style.boxSizing || "" === j.style.MozBoxSizing || "" === j.style.WebkitBoxSizing,
n.extend(l, {
reliableHiddenOffsets: function () {
return null == b && k(),
f
},
boxSizingReliable: function () {
return null == b && k(),
e
},
pixelMarginRight: function () {
return null == b && k(),
c
},
pixelPosition: function () {
return null == b && k(),
b
},
reliableMarginRight: function () {
return null == b && k(),
g
},
reliableMarginLeft: function () {
return null == b && k(),
h
}
});
function k() {
var k,
l,
m = d.documentElement;
m.appendChild(i),
j.style.cssText = "-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",
b = e = h = !1,
c = g = !0,
a.getComputedStyle && (l = a.getComputedStyle(j), b = "1%" !== (l || {}).top, h = "2px" === (l || {}).marginLeft, e = "4px" === (l || {
width: "4px"
}).width, j.style.marginRight = "50%", c = "4px" === (l || {
marginRight: "4px"
}).marginRight, k = j.appendChild(d.createElement("div")), k.style.cssText = j.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", k.style.marginRight = k.style.width = "0", j.style.width = "1px", g = !parseFloat((a.getComputedStyle(k) || {}).marginRight), j.removeChild(k)),
j.style.display = "none",
f = 0 === j.getClientRects().length,
f && (j.style.display = "", j.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", j.childNodes[0].style.borderCollapse = "separate", k = j.getElementsByTagName("td"), k[0].style.cssText = "margin:0;border:0;padding:0;display:none", f = 0 === k[0].offsetHeight, f && (k[0].style.display = "", k[1].style.display = "none", f = 0 === k[0].offsetHeight)),
m.removeChild(i)
}
}
}
();
var Ra,
Sa,
Ta = /^(top|right|bottom|left)$/;
a.getComputedStyle ? (Ra = function (b) {
var c = b.ownerDocument.defaultView;
return c && c.opener || (c = a),
c.getComputedStyle(b)
}, Sa = function (a, b, c) {
var d,
e,
f,
g,
h = a.style;
return c = c || Ra(a),
g = c ? c.getPropertyValue(b) || c[b] : void 0,
"" !== g && void 0 !== g || n.contains(a.ownerDocument, a) || (g = n.style(a, b)),
c && !l.pixelMarginRight() && Oa.test(g) && Na.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f),
void 0 === g ? g : g + ""
}) : Qa.currentStyle && (Ra = function (a) {
return a.currentStyle
}, Sa = function (a, b, c) {
var d,
e,
f,
g,
h = a.style;
return c = c || Ra(a),
g = c ? c[b] : void 0,
null == g && h && h[b] && (g = h[b]),
Oa.test(g) && !Ta.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)),
void 0 === g ? g : g + "" || "auto"
});
function Ua(a, b) {
return {
get: function () {
return a() ? void delete this.get : (this.get = b).apply(this, arguments)
}
}
}
var Va = /alpha\([^)]*\)/i,
Wa = /opacity\s*=\s*([^)]*)/i,
Xa = /^(none|table(?!-c[ea]).+)/,
Ya = new RegExp("^(" + T + ")(.*)$", "i"),
Za = {
position: "absolute",
visibility: "hidden",
display: "block"
},
$a = {
letterSpacing: "0",
fontWeight: "400"
},
_a = ["Webkit", "O", "Moz", "ms"],
ab = d.createElement("div").style;
function bb(a) {
if (a in ab)
return a;
var b = a.charAt(0).toUpperCase() + a.slice(1),
c = _a.length;
while (c--)
if (a = _a[c] + b, a in ab)
return a
}
function cb(a, b) {
for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)
d = a[g], d.style && (f[g] = n._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && W(d) && (f[g] = n._data(d, "olddisplay", Ma(d.nodeName)))) : (e = W(d), (c && "none" !== c || !e) && n._data(d, "olddisplay", e ? c : n.css(d, "display"))));
for (g = 0; h > g; g++)
d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none"));
return a
}
function db(a, b, c) {
var d = Ya.exec(b);
return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
}
function eb(a, b, c, d, e) {
for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2)
"margin" === c && (g += n.css(a, c + V[f], !0, e)), d ? ("content" === c && (g -= n.css(a, "padding" + V[f], !0, e)), "margin" !== c && (g -= n.css(a, "border" + V[f] + "Width", !0, e))) : (g += n.css(a, "padding" + V[f], !0, e), "padding" !== c && (g += n.css(a, "border" + V[f] + "Width", !0, e)));
return g
}
function fb(a, b, c) {
var d = !0,
e = "width" === b ? a.offsetWidth : a.offsetHeight,
f = Ra(a),
g = l.boxSizing && "border-box" === n.css(a, "boxSizing", !1, f);
if (0 >= e || null == e) {
if (e = Sa(a, b, f), (0 > e || null == e) && (e = a.style[b]), Oa.test(e))
return e;
d = g && (l.boxSizingReliable() || e === a.style[b]),
e = parseFloat(e) || 0
}
return e + eb(a, b, c || (g ? "border" : "content"), d, f) + "px"
}
n.extend({
cssHooks: {
opacity: {
get: function (a, b) {
if (b) {
var c = Sa(a, "opacity");
return "" === c ? "1" : c
}
}
}
},
cssNumber: {
animationIterationCount: !0,
columnCount: !0,
fillOpacity: !0,
flexGrow: !0,
flexShrink: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {
"float": l.cssFloat ? "cssFloat" : "styleFloat"
},
style: function (a, b, c, d) {
if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
var e,
f,
g,
h = n.camelCase(b),
i = a.style;
if (b = n.cssProps[h] || (n.cssProps[h] = bb(h) || h), g = n.cssHooks[b] || n.cssHooks[h], void 0 === c)
return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b];
if (f = typeof c, "string" === f && (e = U.exec(c)) && e[1] && (c = X(a, b, e), f = "number"), null != c && c === c && ("number" === f && (c += e && e[3] || (n.cssNumber[h] ? "" : "px")), l.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 === (c = g.set(a, c, d)))))
try {
i[b] = c
} catch (j) {}
}
},
css: function (a, b, c, d) {
var e,
f,
g,
h = n.camelCase(b);
return b = n.cssProps[h] || (n.cssProps[h] = bb(h) || h),
g = n.cssHooks[b] || n.cssHooks[h],
g && "get" in g && (f = g.get(a, !0, c)),
void 0 === f && (f = Sa(a, b, d)),
"normal" === f && b in $a && (f = $a[b]),
"" === c || c ? (e = parseFloat(f), c === !0 || isFinite(e) ? e || 0 : f) : f
}
}),
n.each(["height", "width"], function (a, b) {
n.cssHooks[b] = {
get: function (a, c, d) {
return c ? Xa.test(n.css(a, "display")) && 0 === a.offsetWidth ? Pa(a, Za, function () {
return fb(a, b, d)
}) : fb(a, b, d) : void 0
},
set: function (a, c, d) {
var e = d && Ra(a);
return db(a, c, d ? eb(a, b, d, l.boxSizing && "border-box" === n.css(a, "boxSizing", !1, e), e) : 0)
}
}
}),
l.opacity || (n.cssHooks.opacity = {
get: function (a, b) {
return Wa.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
},
set: function (a, b) {
var c = a.style,
d = a.currentStyle,
e = n.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "",
f = d && d.filter || c.filter || "";
c.zoom = 1,
(b >= 1 || "" === b) && "" === n.trim(f.replace(Va, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d && !d.filter) || (c.filter = Va.test(f) ? f.replace(Va, e) : f + " " + e)
}
}),
n.cssHooks.marginRight = Ua(l.reliableMarginRight, function (a, b) {
return b ? Pa(a, {
display: "inline-block"
}, Sa, [a, "marginRight"]) : void 0
}),
n.cssHooks.marginLeft = Ua(l.reliableMarginLeft, function (a, b) {
return b ? (parseFloat(Sa(a, "marginLeft")) || (n.contains(a.ownerDocument, a) ? a.getBoundingClientRect().left - Pa(a, {
marginLeft: 0
}, function () {
return a.getBoundingClientRect().left
}) : 0)) + "px" : void 0
}),
n.each({
margin: "",
padding: "",
border: "Width"
}, function (a, b) {
n.cssHooks[a + b] = {
expand: function (c) {
for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++)
e[a + V[d] + b] = f[d] || f[d - 2] || f[0];
return e
}
},
Na.test(a) || (n.cssHooks[a + b].set = db)
}),
n.fn.extend({
css: function (a, b) {
return Y(this, function (a, b, c) {
var d,
e,
f = {},
g = 0;
if (n.isArray(b)) {
for (d = Ra(a), e = b.length; e > g; g++)
f[b[g]] = n.css(a, b[g], !1, d);
return f
}
return void 0 !== c ? n.style(a, b, c) : n.css(a, b)
}, a, b, arguments.length > 1)
},
show: function () {
return cb(this, !0)
},
hide: function () {
return cb(this)
},
toggle: function (a) {
return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () {
W(this) ? n(this).show() : n(this).hide()
})
}
});
function gb(a, b, c, d, e) {
return new gb.prototype.init(a, b, c, d, e)
}
n.Tween = gb,
gb.prototype = {
constructor: gb,
init: function (a, b, c, d, e, f) {
this.elem = a,
this.prop = c,
this.easing = e || n.easing._default,
this.options = b,
this.start = this.now = this.cur(),
this.end = d,
this.unit = f || (n.cssNumber[c] ? "" : "px")
},
cur: function () {
var a = gb.propHooks[this.prop];
return a && a.get ? a.get(this) : gb.propHooks._default.get(this)
},
run: function (a) {
var b,
c = gb.propHooks[this.prop];
return this.options.duration ? this.pos = b = n.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a,
this.now = (this.end - this.start) * b + this.start,
this.options.step && this.options.step.call(this.elem, this.now, this),
c && c.set ? c.set(this) : gb.propHooks._default.set(this),
this
}
},
gb.prototype.init.prototype = gb.prototype,
gb.propHooks = {
_default: {
get: function (a) {
var b;
return 1 !== a.elem.nodeType || null != a.elem[a.prop] && null == a.elem.style[a.prop] ? a.elem[a.prop] : (b = n.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0)
},
set: function (a) {
n.fx.step[a.prop] ? n.fx.step[a.prop](a) : 1 !== a.elem.nodeType || null == a.elem.style[n.cssProps[a.prop]] && !n.cssHooks[a.prop] ? a.elem[a.prop] = a.now : n.style(a.elem, a.prop, a.now + a.unit)
}
}
},
gb.propHooks.scrollTop = gb.propHooks.scrollLeft = {
set: function (a) {
a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
}
},
n.easing = {
linear: function (a) {
return a
},
swing: function (a) {
return .5 - Math.cos(a * Math.PI) / 2
},
_default: "swing"
},
n.fx = gb.prototype.init,
n.fx.step = {};
var hb,
ib,
jb = /^(?:toggle|show|hide)$/,
kb = /queueHooks$/;
function lb() {
return a.setTimeout(function () {
hb = void 0
}),
hb = n.now()
}
function mb(a, b) {
var c,
d = {
height: a
},
e = 0;
for (b = b ? 1 : 0; 4 > e; e += 2 - b)
c = V[e], d["margin" + c] = d["padding" + c] = a;
return b && (d.opacity = d.width = a),
d
}
function nb(a, b, c) {
for (var d, e = (qb.tweeners[b] || []).concat(qb.tweeners["*"]), f = 0, g = e.length; g > f; f++)
if (d = e[f].call(c, b, a))
return d
}
function ob(a, b, c) {
var d,
e,
f,
g,
h,
i,
j,
k,
m = this,
o = {},
p = a.style,
q = a.nodeType && W(a),
r = n._data(a, "fxshow");
c.queue || (h = n._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () {
h.unqueued || i()
}), h.unqueued++, m.always(function () {
m.always(function () {
h.unqueued--,
n.queue(a, "fx").length || h.empty.fire()
})
})),
1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = n.css(a, "display"), k = "none" === j ? n._data(a, "olddisplay") || Ma(a.nodeName) : j, "inline" === k && "none" === n.css(a, "float") && (l.inlineBlockNeedsLayout && "inline" !== Ma(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")),
c.overflow && (p.overflow = "hidden", l.shrinkWrapBlocks() || m.always(function () {
p.overflow = c.overflow[0],
p.overflowX = c.overflow[1],
p.overflowY = c.overflow[2]
}));
for (d in b)
if (e = b[d], jb.exec(e)) {
if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) {
if ("show" !== e || !r || void 0 === r[d])
continue;
q = !0
}
o[d] = r && r[d] || n.style(a, d)
} else
j = void 0;
if (n.isEmptyObject(o))
"inline" === ("none" === j ? Ma(a.nodeName) : j) && (p.display = j);
else {
r ? "hidden" in r && (q = r.hidden) : r = n._data(a, "fxshow", {}),
f && (r.hidden = !q),
q ? n(a).show() : m.done(function () {
n(a).hide()
}),
m.done(function () {
var b;
n._removeData(a, "fxshow");
for (b in o)
n.style(a, b, o[b])
});
for (d in o)
g = nb(q ? r[d] : 0, d, m), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0))
}
}
function pb(a, b) {
var c,
d,
e,
f,
g;
for (c in a)
if (d = n.camelCase(c), e = b[d], f = a[c], n.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = n.cssHooks[d], g && "expand" in g) {
f = g.expand(f),
delete a[d];
for (c in f)
c in a || (a[c] = f[c], b[c] = e)
} else
b[d] = e
}
function qb(a, b, c) {
var d,
e,
f = 0,
g = qb.prefilters.length,
h = n.Deferred().always(function () {
delete i.elem
}),
i = function () {
if (e)
return !1;
for (var b = hb || lb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)
j.tweens[g].run(f);
return h.notifyWith(a, [j, f, c]),
1 > f && i ? c : (h.resolveWith(a, [j]), !1)
},
j = h.promise({
elem: a,
props: n.extend({}, b),
opts: n.extend(!0, {
specialEasing: {},
easing: n.easing._default
}, c),
originalProperties: b,
originalOptions: c,
startTime: hb || lb(),
duration: c.duration,
tweens: [],
createTween: function (b, c) {
var d = n.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);
return j.tweens.push(d),
d
},
stop: function (b) {
var c = 0,
d = b ? j.tweens.length : 0;
if (e)
return this;
for (e = !0; d > c; c++)
j.tweens[c].run(1);
return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]),
this
}
}),
k = j.props;
for (pb(k, j.opts.specialEasing); g > f; f++)
if (d = qb.prefilters[f].call(j, a, k, j.opts))
return n.isFunction(d.stop) && (n._queueHooks(j.elem, j.opts.queue).stop = n.proxy(d.stop, d)), d;
return n.map(k, nb, j),
n.isFunction(j.opts.start) && j.opts.start.call(a, j),
n.fx.timer(n.extend(i, {
elem: a,
anim: j,
queue: j.opts.queue
})),
j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always)
}
n.Animation = n.extend(qb, {
tweeners: {
"*": [function (a, b) {
var c = this.createTween(a, b);
return X(c.elem, a, U.exec(b), c),
c
}
]
},
tweener: function (a, b) {
n.isFunction(a) ? (b = a, a = ["*"]) : a = a.match(G);
for (var c, d = 0, e = a.length; e > d; d++)
c = a[d], qb.tweeners[c] = qb.tweeners[c] || [], qb.tweeners[c].unshift(b)
},
prefilters: [ob],
prefilter: function (a, b) {
b ? qb.prefilters.unshift(a) : qb.prefilters.push(a)
}
}),
n.speed = function (a, b, c) {
var d = a && "object" == typeof a ? n.extend({}, a) : {
complete: c || !c && b || n.isFunction(a) && a,
duration: a,
easing: c && b || b && !n.isFunction(b) && b
};
return d.duration = n.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in n.fx.speeds ? n.fx.speeds[d.duration] : n.fx.speeds._default,
null != d.queue && d.queue !== !0 || (d.queue = "fx"),
d.old = d.complete,
d.complete = function () {
n.isFunction(d.old) && d.old.call(this),
d.queue && n.dequeue(this, d.queue)
},
d
},
n.fn.extend({
fadeTo: function (a, b, c, d) {
return this.filter(W).css("opacity", 0).show().end().animate({
opacity: b
}, a, c, d)
},
animate: function (a, b, c, d) {
var e = n.isEmptyObject(a),
f = n.speed(b, c, d),
g = function () {
var b = qb(this, n.extend({}, a), f);
(e || n._data(this, "finish")) && b.stop(!0)
};
return g.finish = g,
e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
},
stop: function (a, b, c) {
var d = function (a) {
var b = a.stop;
delete a.stop,
b(c)
};
return "string" != typeof a && (c = b, b = a, a = void 0),
b && a !== !1 && this.queue(a || "fx", []),
this.each(function () {
var b = !0,
e = null != a && a + "queueHooks",
f = n.timers,
g = n._data(this);
if (e)
g[e] && g[e].stop && d(g[e]);
else
for (e in g)
g[e] && g[e].stop && kb.test(e) && d(g[e]);
for (e = f.length; e--; )
f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
!b && c || n.dequeue(this, a)
})
},
finish: function (a) {
return a !== !1 && (a = a || "fx"),
this.each(function () {
var b,
c = n._data(this),
d = c[a + "queue"],
e = c[a + "queueHooks"],
f = n.timers,
g = d ? d.length : 0;
for (c.finish = !0, n.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--; )
f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1));
for (b = 0; g > b; b++)
d[b] && d[b].finish && d[b].finish.call(this);
delete c.finish
})
}
}),
n.each(["toggle", "show", "hide"], function (a, b) {
var c = n.fn[b];
n.fn[b] = function (a, d, e) {
return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(mb(b, !0), a, d, e)
}
}),
n.each({
slideDown: mb("show"),
slideUp: mb("hide"),
slideToggle: mb("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function (a, b) {
n.fn[a] = function (a, c, d) {
return this.animate(b, a, c, d)
}
}),
n.timers = [],
n.fx.tick = function () {
var a,
b = n.timers,
c = 0;
for (hb = n.now(); c < b.length; c++)
a = b[c], a() || b[c] !== a || b.splice(c--, 1);
b.length || n.fx.stop(),
hb = void 0
},
n.fx.timer = function (a) {
n.timers.push(a),
a() ? n.fx.start() : n.timers.pop()
},
n.fx.interval = 13,
n.fx.start = function () {
ib || (ib = a.setInterval(n.fx.tick, n.fx.interval))
},
n.fx.stop = function () {
a.clearInterval(ib),
ib = null
},
n.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
},
n.fn.delay = function (b, c) {
return b = n.fx ? n.fx.speeds[b] || b : b,
c = c || "fx",
this.queue(c, function (c, d) {
var e = a.setTimeout(c, b);
d.stop = function () {
a.clearTimeout(e)
}
})
},
function () {
var a,
b = d.createElement("input"),
c = d.createElement("div"),
e = d.createElement("select"),
f = e.appendChild(d.createElement("option"));
c = d.createElement("div"),
c.setAttribute("className", "t"),
c.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
a = c.getElementsByTagName("a")[0],
b.setAttribute("type", "checkbox"),
c.appendChild(b),
a = c.getElementsByTagName("a")[0],
a.style.cssText = "top:1px",
l.getSetAttribute = "t" !== c.className,
l.style = /top/.test(a.getAttribute("style")),
l.hrefNormalized = "/a" === a.getAttribute("href"),
l.checkOn = !!b.value,
l.optSelected = f.selected,
l.enctype = !!d.createElement("form").enctype,
e.disabled = !0,
l.optDisabled = !f.disabled,
b = d.createElement("input"),
b.setAttribute("value", ""),
l.input = "" === b.getAttribute("value"),
b.value = "t",
b.setAttribute("type", "radio"),
l.radioValue = "t" === b.value
}
();
var rb = /\r/g,
sb = /[\x20\t\r\n\f]+/g;
n.fn.extend({
val: function (a) {
var b,
c,
d,
e = this[0]; {
if (arguments.length)
return d = n.isFunction(a), this.each(function (c) {
var e;
1 === this.nodeType && (e = d ? a.call(this, c, n(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : n.isArray(e) && (e = n.map(e, function (a) {
return null == a ? "" : a + ""
})), b = n.valHooks[this.type] || n.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e))
});
if (e)
return b = n.valHooks[e.type] || n.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(rb, "") : null == c ? "" : c)
}
}
}),
n.extend({
valHooks: {
option: {
get: function (a) {
var b = n.find.attr(a, "value");
return null != b ? b : n.trim(n.text(a)).replace(sb, " ")
}
},
select: {
get: function (a) {
for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)
if (c = d[i], (c.selected || i === e) && (l.optDisabled ? !c.disabled : null === c.getAttribute("disabled")) && (!c.parentNode.disabled || !n.nodeName(c.parentNode, "optgroup"))) {
if (b = n(c).val(), f)
return b;
g.push(b)
}
return g
},
set: function (a, b) {
var c,
d,
e = a.options,
f = n.makeArray(b),
g = e.length;
while (g--)
if (d = e[g], n.inArray(n.valHooks.option.get(d), f) > -1)
try {
d.selected = c = !0
} catch (h) {
d.scrollHeight
}
else
d.selected = !1;
return c || (a.selectedIndex = -1),
e
}
}
}
}),
n.each(["radio", "checkbox"], function () {
n.valHooks[this] = {
set: function (a, b) {
return n.isArray(b) ? a.checked = n.inArray(n(a).val(), b) > -1 : void 0
}
},
l.checkOn || (n.valHooks[this].get = function (a) {
return null === a.getAttribute("value") ? "on" : a.value
})
});
var tb,
ub,
vb = n.expr.attrHandle,
wb = /^(?:checked|selected)$/i,
xb = l.getSetAttribute,
yb = l.input;
n.fn.extend({
attr: function (a, b) {
return Y(this, n.attr, a, b, arguments.length > 1)
},
removeAttr: function (a) {
return this.each(function () {
n.removeAttr(this, a)
})
}
}),
n.extend({
attr: function (a, b, c) {
var d,
e,
f = a.nodeType;
if (3 !== f && 8 !== f && 2 !== f)
return "undefined" == typeof a.getAttribute ? n.prop(a, b, c) : (1 === f && n.isXMLDoc(a) || (b = b.toLowerCase(), e = n.attrHooks[b] || (n.expr.match.bool.test(b) ? ub : tb)), void 0 !== c ? null === c ? void n.removeAttr(a, b) : e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : (a.setAttribute(b, c + ""), c) : e && "get" in e && null !== (d = e.get(a, b)) ? d : (d = n.find.attr(a, b), null == d ? void 0 : d))
},
attrHooks: {
type: {
set: function (a, b) {
if (!l.radioValue && "radio" === b && n.nodeName(a, "input")) {
var c = a.value;
return a.setAttribute("type", b),
c && (a.value = c),
b
}
}
}
},
removeAttr: function (a, b) {
var c,
d,
e = 0,
f = b && b.match(G);
if (f && 1 === a.nodeType)
while (c = f[e++])
d = n.propFix[c] || c, n.expr.match.bool.test(c) ? yb && xb || !wb.test(c) ? a[d] = !1 : a[n.camelCase("default-" + c)] = a[d] = !1 : n.attr(a, c, ""), a.removeAttribute(xb ? c : d)
}
}),
ub = {
set: function (a, b, c) {
return b === !1 ? n.removeAttr(a, c) : yb && xb || !wb.test(c) ? a.setAttribute(!xb && n.propFix[c] || c, c) : a[n.camelCase("default-" + c)] = a[c] = !0,
c
}
},
n.each(n.expr.match.bool.source.match(/\w+/g), function (a, b) {
var c = vb[b] || n.find.attr;
yb && xb || !wb.test(b) ? vb[b] = function (a, b, d) {
var e,
f;
return d || (f = vb[b], vb[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, vb[b] = f),
e
}
: vb[b] = function (a, b, c) {
return c ? void 0 : a[n.camelCase("default-" + b)] ? b.toLowerCase() : null
}
}),
yb && xb || (n.attrHooks.value = {
set: function (a, b, c) {
return n.nodeName(a, "input") ? void(a.defaultValue = b) : tb && tb.set(a, b, c)
}
}),
xb || (tb = {
set: function (a, b, c) {
var d = a.getAttributeNode(c);
return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)),
d.value = b += "",
"value" === c || b === a.getAttribute(c) ? b : void 0
}
}, vb.id = vb.name = vb.coords = function (a, b, c) {
var d;
return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null
}, n.valHooks.button = {
get: function (a, b) {
var c = a.getAttributeNode(b);
return c && c.specified ? c.value : void 0
},
set: tb.set
}, n.attrHooks.contenteditable = {
set: function (a, b, c) {
tb.set(a, "" === b ? !1 : b, c)
}
}, n.each(["width", "height"], function (a, b) {
n.attrHooks[b] = {
set: function (a, c) {
return "" === c ? (a.setAttribute(b, "auto"), c) : void 0
}
}
})),
l.style || (n.attrHooks.style = {
get: function (a) {
return a.style.cssText || void 0
},
set: function (a, b) {
return a.style.cssText = b + ""
}
});
var zb = /^(?:input|select|textarea|button|object)$/i,
Ab = /^(?:a|area)$/i;
n.fn.extend({
prop: function (a, b) {
return Y(this, n.prop, a, b, arguments.length > 1)
},
removeProp: function (a) {
return a = n.propFix[a] || a,
this.each(function () {
try {
this[a] = void 0,
delete this[a]
} catch (b) {}
})
}
}),
n.extend({
prop: function (a, b, c) {
var d,
e,
f = a.nodeType;
if (3 !== f && 8 !== f && 2 !== f)
return 1 === f && n.isXMLDoc(a) || (b = n.propFix[b] || b, e = n.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b]
},
propHooks: {
tabIndex: {
get: function (a) {
var b = n.find.attr(a, "tabindex");
return b ? parseInt(b, 10) : zb.test(a.nodeName) || Ab.test(a.nodeName) && a.href ? 0 : -1
}
}
},
propFix: {
"for": "htmlFor",
"class": "className"
}
}),
l.hrefNormalized || n.each(["href", "src"], function (a, b) {
n.propHooks[b] = {
get: function (a) {
return a.getAttribute(b, 4)
}
}
}),
l.optSelected || (n.propHooks.selected = {
get: function (a) {
var b = a.parentNode;
return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex),
null
},
set: function (a) {
var b = a.parentNode;
b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex)
}
}),
n.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
n.propFix[this.toLowerCase()] = this
}),
l.enctype || (n.propFix.enctype = "encoding");
var Bb = /[\t\r\n\f]/g;
function Cb(a) {
return n.attr(a, "class") || ""
}
n.fn.extend({
addClass: function (a) {
var b,
c,
d,
e,
f,
g,
h,
i = 0;
if (n.isFunction(a))
return this.each(function (b) {
n(this).addClass(a.call(this, b, Cb(this)))
});
if ("string" == typeof a && a) {
b = a.match(G) || [];
while (c = this[i++])
if (e = Cb(c), d = 1 === c.nodeType && (" " + e + " ").replace(Bb, " ")) {
g = 0;
while (f = b[g++])
d.indexOf(" " + f + " ") < 0 && (d += f + " ");
h = n.trim(d),
e !== h && n.attr(c, "class", h)
}
}
return this
},
removeClass: function (a) {
var b,
c,
d,
e,
f,
g,
h,
i = 0;
if (n.isFunction(a))
return this.each(function (b) {
n(this).removeClass(a.call(this, b, Cb(this)))
});
if (!arguments.length)
return this.attr("class", "");
if ("string" == typeof a && a) {
b = a.match(G) || [];
while (c = this[i++])
if (e = Cb(c), d = 1 === c.nodeType && (" " + e + " ").replace(Bb, " ")) {
g = 0;
while (f = b[g++])
while (d.indexOf(" " + f + " ") > -1)
d = d.replace(" " + f + " ", " ");
h = n.trim(d),
e !== h && n.attr(c, "class", h)
}
}
return this
},
toggleClass: function (a, b) {
var c = typeof a;
return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : n.isFunction(a) ? this.each(function (c) {
n(this).toggleClass(a.call(this, c, Cb(this), b), b)
}) : this.each(function () {
var b,
d,
e,
f;
if ("string" === c) {
d = 0,
e = n(this),
f = a.match(G) || [];
while (b = f[d++])
e.hasClass(b) ? e.removeClass(b) : e.addClass(b)
} else
void 0 !== a && "boolean" !== c || (b = Cb(this), b && n._data(this, "__className__", b), n.attr(this, "class", b || a === !1 ? "" : n._data(this, "__className__") || ""))
})
},
hasClass: function (a) {
var b,
c,
d = 0;
b = " " + a + " ";
while (c = this[d++])
if (1 === c.nodeType && (" " + Cb(c) + " ").replace(Bb, " ").indexOf(b) > -1)
return !0;
return !1
}
}),
n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) {
n.fn[b] = function (a, c) {
return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
}
}),
n.fn.extend({
hover: function (a, b) {
return this.mouseenter(a).mouseleave(b || a)
}
});
var Db = a.location,
Eb = n.now(),
Fb = /\?/,
Gb = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
n.parseJSON = function (b) {
if (a.JSON && a.JSON.parse)
return a.JSON.parse(b + "");
var c,
d = null,
e = n.trim(b + "");
return e && !n.trim(e.replace(Gb, function (a, b, e, f) {
return c && b && (d = 0),
0 === d ? a : (c = e || b, d += !f - !e, "")
})) ? Function("return " + e)() : n.error("Invalid JSON: " + b)
},
n.parseXML = function (b) {
var c,
d;
if (!b || "string" != typeof b)
return null;
try {
a.DOMParser ? (d = new a.DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new a.ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b))
} catch (e) {
c = void 0
}
return c && c.documentElement && !c.getElementsByTagName("parsererror").length || n.error("Invalid XML: " + b),
c
};
var Hb = /#.*$/,
Ib = /([?&])_=[^&]*/,
Jb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
Kb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
Lb = /^(?:GET|HEAD)$/,
Mb = /^\/\//,
Nb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
Ob = {},
Pb = {},
Qb = "*/".concat("*"),
Rb = Db.href,
Sb = Nb.exec(Rb.toLowerCase()) || [];
function Tb(a) {
return function (b, c) {
"string" != typeof b && (c = b, b = "*");
var d,
e = 0,
f = b.toLowerCase().match(G) || [];
if (n.isFunction(c))
while (d = f[e++])
"+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c)
}
}
function Ub(a, b, c, d) {
var e = {},
f = a === Pb;
function g(h) {
var i;
return e[h] = !0,
n.each(a[h] || [], function (a, h) {
var j = h(b, c, d);
return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1)
}),
i
}
return g(b.dataTypes[0]) || !e["*"] && g("*")
}
function Vb(a, b) {
var c,
d,
e = n.ajaxSettings.flatOptions || {};
for (d in b)
void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]);
return c && n.extend(!0, a, c),
a
}
function Wb(a, b, c) {
var d,
e,
f,
g,
h = a.contents,
i = a.dataTypes;
while ("*" === i[0])
i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type"));
if (e)
for (g in h)
if (h[g] && h[g].test(e)) {
i.unshift(g);
break
}
if (i[0]in c)
f = i[0];
else {
for (g in c) {
if (!i[0] || a.converters[g + " " + i[0]]) {
f = g;
break
}
d || (d = g)
}
f = f || d
}
return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0
}
function Xb(a, b, c, d) {
var e,
f,
g,
h,
i,
j = {},
k = a.dataTypes.slice();
if (k[1])
for (g in a.converters)
j[g.toLowerCase()] = a.converters[g];
f = k.shift();
while (f)
if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift())
if ("*" === f)
f = i;
else if ("*" !== i && i !== f) {
if (g = j[i + " " + f] || j["* " + f], !g)
for (e in j)
if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1]));
break
}
if (g !== !0)
if (g && a["throws"])
b = g(b);
else
try {
b = g(b)
} catch (l) {
return {
state: "parsererror",
error: g ? l : "No conversion from " + i + " to " + f
}
}
}
return {
state: "success",
data: b
}
}
n.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: Rb,
type: "GET",
isLocal: Kb.test(Sb[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": Qb,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /\bxml\b/,
html: /\bhtml/,
json: /\bjson\b/
},
responseFields: {
xml: "responseXML",
text: "responseText",
json: "responseJSON"
},
converters: {
"* text": String,
"text html": !0,
"text json": n.parseJSON,
"text xml": n.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function (a, b) {
return b ? Vb(Vb(a, n.ajaxSettings), b) : Vb(n.ajaxSettings, a)
},
ajaxPrefilter: Tb(Ob),
ajaxTransport: Tb(Pb),
ajax: function (b, c) {
"object" == typeof b && (c = b, b = void 0),
c = c || {};
var d,
e,
f,
g,
h,
i,
j,
k,
l = n.ajaxSetup({}, c),
m = l.context || l,
o = l.context && (m.nodeType || m.jquery) ? n(m) : n.event,
p = n.Deferred(),
q = n.Callbacks("once memory"),
r = l.statusCode || {},
s = {},
t = {},
u = 0,
v = "canceled",
w = {
readyState: 0,
getResponseHeader: function (a) {
var b;
if (2 === u) {
if (!k) {
k = {};
while (b = Jb.exec(g))
k[b[1].toLowerCase()] = b[2]
}
b = k[a.toLowerCase()]
}
return null == b ? null : b
},
getAllResponseHeaders: function () {
return 2 === u ? g : null
},
setRequestHeader: function (a, b) {
var c = a.toLowerCase();
return u || (a = t[c] = t[c] || a, s[a] = b),
this
},
overrideMimeType: function (a) {
return u || (l.mimeType = a),
this
},
statusCode: function (a) {
var b;
if (a)
if (2 > u)
for (b in a)
r[b] = [r[b], a[b]];
else
w.always(a[w.status]);
return this
},
abort: function (a) {
var b = a || v;
return j && j.abort(b),
y(0, b),
this
}
};
if (p.promise(w).complete = q.add, w.success = w.done, w.error = w.fail, l.url = ((b || l.url || Rb) + "").replace(Hb, "").replace(Mb, Sb[1] + "//"), l.type = c.method || c.type || l.method || l.type, l.dataTypes = n.trim(l.dataType || "*").toLowerCase().match(G) || [""], null == l.crossDomain && (d = Nb.exec(l.url.toLowerCase()), l.crossDomain = !(!d || d[1] === Sb[1] && d[2] === Sb[2] && (d[3] || ("http:" === d[1] ? "80" : "443")) === (Sb[3] || ("http:" === Sb[1] ? "80" : "443")))), l.data && l.processData && "string" != typeof l.data && (l.data = n.param(l.data, l.traditional)), Ub(Ob, l, c, w), 2 === u)
return w;
i = n.event && l.global,
i && 0 === n.active++ && n.event.trigger("ajaxStart"),
l.type = l.type.toUpperCase(),
l.hasContent = !Lb.test(l.type),
f = l.url,
l.hasContent || (l.data && (f = l.url += (Fb.test(f) ? "&" : "?") + l.data, delete l.data), l.cache === !1 && (l.url = Ib.test(f) ? f.replace(Ib, "$1_=" + Eb++) : f + (Fb.test(f) ? "&" : "?") + "_=" + Eb++)),
l.ifModified && (n.lastModified[f] && w.setRequestHeader("If-Modified-Since", n.lastModified[f]), n.etag[f] && w.setRequestHeader("If-None-Match", n.etag[f])),
(l.data && l.hasContent && l.contentType !== !1 || c.contentType) && w.setRequestHeader("Content-Type", l.contentType),
w.setRequestHeader("Accept", l.dataTypes[0] && l.accepts[l.dataTypes[0]] ? l.accepts[l.dataTypes[0]] + ("*" !== l.dataTypes[0] ? ", " + Qb + "; q=0.01" : "") : l.accepts["*"]);
for (e in l.headers)
w.setRequestHeader(e, l.headers[e]);
if (l.beforeSend && (l.beforeSend.call(m, w, l) === !1 || 2 === u))
return w.abort();
v = "abort";
for (e in {
success: 1,
error: 1,
complete: 1
})
w[e](l[e]);
if (j = Ub(Pb, l, c, w)) {
if (w.readyState = 1, i && o.trigger("ajaxSend", [w, l]), 2 === u)
return w;
l.async && l.timeout > 0 && (h = a.setTimeout(function () {
w.abort("timeout")
}, l.timeout));
try {
u = 1,
j.send(s, y)
} catch (x) {
if (!(2 > u))
throw x;
y(-1, x)
}
} else
y(-1, "No Transport");
function y(b, c, d, e) {
var k,
s,
t,
v,
x,
y = c;
2 !== u && (u = 2, h && a.clearTimeout(h), j = void 0, g = e || "", w.readyState = b > 0 ? 4 : 0, k = b >= 200 && 300 > b || 304 === b, d && (v = Wb(l, w, d)), v = Xb(l, v, w, k), k ? (l.ifModified && (x = w.getResponseHeader("Last-Modified"), x && (n.lastModified[f] = x), x = w.getResponseHeader("etag"), x && (n.etag[f] = x)), 204 === b || "HEAD" === l.type ? y = "nocontent" : 304 === b ? y = "notmodified" : (y = v.state, s = v.data, t = v.error, k = !t)) : (t = y, !b && y || (y = "error", 0 > b && (b = 0))), w.status = b, w.statusText = (c || y) + "", k ? p.resolveWith(m, [s, y, w]) : p.rejectWith(m, [w, y, t]), w.statusCode(r), r = void 0, i && o.trigger(k ? "ajaxSuccess" : "ajaxError", [w, l, k ? s : t]), q.fireWith(m, [w, y]), i && (o.trigger("ajaxComplete", [w, l]), --n.active || n.event.trigger("ajaxStop")))
}
return w
},
getJSON: function (a, b, c) {
return n.get(a, b, c, "json")
},
getScript: function (a, b) {
return n.get(a, void 0, b, "script")
}
}),
n.each(["get", "post"], function (a, b) {
n[b] = function (a, c, d, e) {
return n.isFunction(c) && (e = e || d, d = c, c = void 0),
n.ajax(n.extend({
url: a,
type: b,
dataType: e,
data: c,
success: d
}, n.isPlainObject(a) && a))
}
}),
n._evalUrl = function (a) {
return n.ajax({
url: a,
type: "GET",
dataType: "script",
cache: !0,
async: !1,
global: !1,
"throws": !0
})
},
n.fn.extend({
wrapAll: function (a) {
if (n.isFunction(a))
return this.each(function (b) {
n(this).wrapAll(a.call(this, b))
});
if (this[0]) {
var b = n(a, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && b.insertBefore(this[0]),
b.map(function () {
var a = this;
while (a.firstChild && 1 === a.firstChild.nodeType)
a = a.firstChild;
return a
}).append(this)
}
return this
},
wrapInner: function (a) {
return n.isFunction(a) ? this.each(function (b) {
n(this).wrapInner(a.call(this, b))
}) : this.each(function () {
var b = n(this),
c = b.contents();
c.length ? c.wrapAll(a) : b.append(a)
})
},
wrap: function (a) {
var b = n.isFunction(a);
return this.each(function (c) {
n(this).wrapAll(b ? a.call(this, c) : a)
})
},
unwrap: function () {
return this.parent().each(function () {
n.nodeName(this, "body") || n(this).replaceWith(this.childNodes)
}).end()
}
});
function Yb(a) {
return a.style && a.style.display || n.css(a, "display")
}
function Zb(a) {
if (!n.contains(a.ownerDocument || d, a))
return !0;
while (a && 1 === a.nodeType) {
if ("none" === Yb(a) || "hidden" === a.type)
return !0;
a = a.parentNode
}
return !1
}
n.expr.filters.hidden = function (a) {
return l.reliableHiddenOffsets() ? a.offsetWidth <= 0 && a.offsetHeight <= 0 && !a.getClientRects().length : Zb(a)
},
n.expr.filters.visible = function (a) {
return !n.expr.filters.hidden(a)
};
var $b = /%20/g,
_b = /\[\]$/,
ac = /\r?\n/g,
bc = /^(?:submit|button|image|reset|file)$/i,
cc = /^(?:input|select|textarea|keygen)/i;
function dc(a, b, c, d) {
var e;
if (n.isArray(b))
n.each(b, function (b, e) {
c || _b.test(a) ? d(a, e) : dc(a + "[" + ("object" == typeof e && null != e ? b : "") + "]", e, c, d)
});
else if (c || "object" !== n.type(b))
d(a, b);
else
for (e in b)
dc(a + "[" + e + "]", b[e], c, d)
}
n.param = function (a, b) {
var c,
d = [],
e = function (a, b) {
b = n.isFunction(b) ? b() : null == b ? "" : b,
d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
};
if (void 0 === b && (b = n.ajaxSettings && n.ajaxSettings.traditional), n.isArray(a) || a.jquery && !n.isPlainObject(a))
n.each(a, function () {
e(this.name, this.value)
});
else
for (c in a)
dc(c, a[c], b, e);
return d.join("&").replace($b, "+")
},
n.fn.extend({
serialize: function () {
return n.param(this.serializeArray())
},
serializeArray: function () {
return this.map(function () {
var a = n.prop(this, "elements");
return a ? n.makeArray(a) : this
}).filter(function () {
var a = this.type;
return this.name && !n(this).is(":disabled") && cc.test(this.nodeName) && !bc.test(a) && (this.checked || !Z.test(a))
}).map(function (a, b) {
var c = n(this).val();
return null == c ? null : n.isArray(c) ? n.map(c, function (a) {
return {
name: b.name,
value: a.replace(ac, "\r\n")
}
}) : {
name: b.name,
value: c.replace(ac, "\r\n")
}
}).get()
}
}),
n.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function () {
return this.isLocal ? ic() : d.documentMode > 8 ? hc() : /^(get|post|head|put|delete|options)$/i.test(this.type) && hc() || ic()
}
: hc;
var ec = 0,
fc = {},
gc = n.ajaxSettings.xhr();
a.attachEvent && a.attachEvent("onunload", function () {
for (var a in fc)
fc[a](void 0, !0)
}),
l.cors = !!gc && "withCredentials" in gc,
gc = l.ajax = !!gc,
gc && n.ajaxTransport(function (b) {
if (!b.crossDomain || l.cors) {
var c;
return {
send: function (d, e) {
var f,
g = b.xhr(),
h = ++ec;
if (g.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields)
for (f in b.xhrFields)
g[f] = b.xhrFields[f];
b.mimeType && g.overrideMimeType && g.overrideMimeType(b.mimeType),
b.crossDomain || d["X-Requested-With"] || (d["X-Requested-With"] = "XMLHttpRequest");
for (f in d)
void 0 !== d[f] && g.setRequestHeader(f, d[f] + "");
g.send(b.hasContent && b.data || null),
c = function (a, d) {
var f,
i,
j;
if (c && (d || 4 === g.readyState))
if (delete fc[h], c = void 0, g.onreadystatechange = n.noop, d)
4 !== g.readyState && g.abort();
else {
j = {},
f = g.status,
"string" == typeof g.responseText && (j.text = g.responseText);
try {
i = g.statusText
} catch (k) {
i = ""
}
f || !b.isLocal || b.crossDomain ? 1223 === f && (f = 204) : f = j.text ? 200 : 404
}
j && e(f, i, j, g.getAllResponseHeaders())
},
b.async ? 4 === g.readyState ? a.setTimeout(c) : g.onreadystatechange = fc[h] = c : c()
},
abort: function () {
c && c(void 0, !0)
}
}
}
});
function hc() {
try {
return new a.XMLHttpRequest
} catch (b) {}
}
function ic() {
try {
return new a.ActiveXObject("Microsoft.XMLHTTP")
} catch (b) {}
}
n.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function (a) {
return n.globalEval(a),
a
}
}
}),
n.ajaxPrefilter("script", function (a) {
void 0 === a.cache && (a.cache = !1),
a.crossDomain && (a.type = "GET", a.global = !1)
}),
n.ajaxTransport("script", function (a) {
if (a.crossDomain) {
var b,
c = d.head || n("head")[0] || d.documentElement;
return {
send: function (e, f) {
b = d.createElement("script"),
b.async = !0,
a.scriptCharset && (b.charset = a.scriptCharset),
b.src = a.url,
b.onload = b.onreadystatechange = function (a, c) {
(c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || f(200, "success"))
},
c.insertBefore(b, c.firstChild)
},
abort: function () {
b && b.onload(void 0, !0)
}
}
}
});
var jc = [],
kc = /(=)\?(?=&|$)|\?\?/;
n.ajaxSetup({
jsonp: "callback",
jsonpCallback: function () {
var a = jc.pop() || n.expando + "_" + Eb++;
return this[a] = !0,
a
}
}),
n.ajaxPrefilter("json jsonp", function (b, c, d) {
var e,
f,
g,
h = b.jsonp !== !1 && (kc.test(b.url) ? "url" : "string" == typeof b.data && 0 === (b.contentType || "").indexOf("application/x-www-form-urlencoded") && kc.test(b.data) && "data");
return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = n.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(kc, "$1" + e) : b.jsonp !== !1 && (b.url += (Fb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () {
return g || n.error(e + " was not called"),
g[0]
}, b.dataTypes[0] = "json", f = a[e], a[e] = function () {
g = arguments
}, d.always(function () {
void 0 === f ? n(a).removeProp(e) : a[e] = f,
b[e] && (b.jsonpCallback = c.jsonpCallback, jc.push(e)),
g && n.isFunction(f) && f(g[0]),
g = f = void 0
}), "script") : void 0
}),
n.parseHTML = function (a, b, c) {
if (!a || "string" != typeof a)
return null;
"boolean" == typeof b && (c = b, b = !1),
b = b || d;
var e = x.exec(a),
f = !c && [];
return e ? [b.createElement(e[1])] : (e = ja([a], b, f), f && f.length && n(f).remove(), n.merge([], e.childNodes))
};
var lc = n.fn.load;
n.fn.load = function (a, b, c) {
if ("string" != typeof a && lc)
return lc.apply(this, arguments);
var d,
e,
f,
g = this,
h = a.indexOf(" ");
return h > -1 && (d = n.trim(a.slice(h, a.length)), a = a.slice(0, h)),
n.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (e = "POST"),
g.length > 0 && n.ajax({
url: a,
type: e || "GET",
dataType: "html",
data: b
}).done(function (a) {
f = arguments,
g.html(d ? n("<div>").append(n.parseHTML(a)).find(d) : a)
}).always(c && function (a, b) {
g.each(function () {
c.apply(this, f || [a.responseText, b, a])
})
}),
this
},
n.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) {
n.fn[b] = function (a) {
return this.on(b, a)
}
}),
n.expr.filters.animated = function (a) {
return n.grep(n.timers, function (b) {
return a === b.elem
}).length
};
function mc(a) {
return n.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1
}
n.offset = {
setOffset: function (a, b, c) {
var d,
e,
f,
g,
h,
i,
j,
k = n.css(a, "position"),
l = n(a),
m = {};
"static" === k && (a.style.position = "relative"),
h = l.offset(),
f = n.css(a, "top"),
i = n.css(a, "left"),
j = ("absolute" === k || "fixed" === k) && n.inArray("auto", [f, i]) > -1,
j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0),
n.isFunction(b) && (b = b.call(a, c, n.extend({}, h))),
null != b.top && (m.top = b.top - h.top + g),
null != b.left && (m.left = b.left - h.left + e),
"using" in b ? b.using.call(a, m) : l.css(m)
}
},
n.fn.extend({
offset: function (a) {
if (arguments.length)
return void 0 === a ? this : this.each(function (b) {
n.offset.setOffset(this, a, b)
});
var b,
c,
d = {
top: 0,
left: 0
},
e = this[0],
f = e && e.ownerDocument;
if (f)
return b = f.documentElement, n.contains(b, e) ? ("undefined" != typeof e.getBoundingClientRect && (d = e.getBoundingClientRect()), c = mc(f), {
top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0),
left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0)
}) : d
},
position: function () {
if (this[0]) {
var a,
b,
c = {
top: 0,
left: 0
},
d = this[0];
return "fixed" === n.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), n.nodeName(a[0], "html") || (c = a.offset()), c.top += n.css(a[0], "borderTopWidth", !0), c.left += n.css(a[0], "borderLeftWidth", !0)), {
top: b.top - c.top - n.css(d, "marginTop", !0),
left: b.left - c.left - n.css(d, "marginLeft", !0)
}
}
},
offsetParent: function () {
return this.map(function () {
var a = this.offsetParent;
while (a && !n.nodeName(a, "html") && "static" === n.css(a, "position"))
a = a.offsetParent;
return a || Qa
})
}
}),
n.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function (a, b) {
var c = /Y/.test(b);
n.fn[a] = function (d) {
return Y(this, function (a, d, e) {
var f = mc(a);
return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void(f ? f.scrollTo(c ? n(f).scrollLeft() : e, c ? e : n(f).scrollTop()) : a[d] = e)
}, a, d, arguments.length, null)
}
}),
n.each(["top", "left"], function (a, b) {
n.cssHooks[b] = Ua(l.pixelPosition, function (a, c) {
return c ? (c = Sa(a, b), Oa.test(c) ? n(a).position()[b] + "px" : c) : void 0
})
}),
n.each({
Height: "height",
Width: "width"
}, function (a, b) {
n.each({
padding: "inner" + a,
content: b,
"": "outer" + a
}, function (c, d) {
n.fn[d] = function (d, e) {
var f = arguments.length && (c || "boolean" != typeof d),
g = c || (d === !0 || e === !0 ? "margin" : "border");
return Y(this, function (b, c, d) {
var e;
return n.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? n.css(b, c, g) : n.style(b, c, d, g)
}, b, f ? d : void 0, f, null)
}
})
}),
n.fn.extend({
bind: function (a, b, c) {
return this.on(a, null, b, c)
},
unbind: function (a, b) {
return this.off(a, null, b)
},
delegate: function (a, b, c, d) {
return this.on(b, a, c, d)
},
undelegate: function (a, b, c) {
return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
}
}),
n.fn.size = function () {
return this.length
},
n.fn.andSelf = n.fn.addBack,
"function" == typeof define && define.amd && define("jquery", [], function () {
return n
});
var nc = a.jQuery,
oc = a.$;
return n.noConflict = function (b) {
return a.$ === n && (a.$ = oc),
b && a.jQuery === n && (a.jQuery = nc),
n
},
b || (a.jQuery = a.$ = n),
n
});
jQuery.noConflict();
(function ($) {
$(window).load(function () {
$(window).trigger('resize');
})
})(jQuery);
"undefined"
== typeof jQuery.migrateMute && (jQuery.migrateMute = !0), function (a, b, c) {
function d(c) {
var d = b.console;
f[c] || (f[c] = !0, a.migrateWarnings.push(c), d && d.warn && !a.migrateMute && (d.warn("JQMIGRATE: " + c), a.migrateTrace && d.trace && d.trace()))
}
function e(b, c, e, f) {
if (Object.defineProperty)
try {
return void Object.defineProperty(b, c, {
configurable: !0,
enumerable: !0,
get: function () {
return d(f),
e
},
set: function (a) {
d(f),
e = a
}
})
} catch (g) {}
a._definePropertyBroken = !0,
b[c] = e
}
a.migrateVersion = "1.4.1";
var f = {};
a.migrateWarnings = [],
b.console && b.console.log && b.console.log("JQMIGRATE: Migrate is installed" + (a.migrateMute ? "" : " with logging active") + ", version " + a.migrateVersion),
a.migrateTrace === c && (a.migrateTrace = !0),
a.migrateReset = function () {
f = {},
a.migrateWarnings.length = 0
},
"BackCompat" === document.compatMode && d("jQuery is not compatible with Quirks Mode");
var g = a("<input/>", {
size: 1
}).attr("size") && a.attrFn,
h = a.attr,
i = a.attrHooks.value && a.attrHooks.value.get || function () {
return null
},
j = a.attrHooks.value && a.attrHooks.value.set || function () {
return c
},
k = /^(?:input|button)$/i,
l = /^[238]$/,
m = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
n = /^(?:checked|selected)$/i;
e(a, "attrFn", g || {}, "jQuery.attrFn is deprecated"),
a.attr = function (b, e, f, i) {
var j = e.toLowerCase(),
o = b && b.nodeType;
return i && (h.length < 4 && d("jQuery.fn.attr( props, pass ) is deprecated"), b && !l.test(o) && (g ? e in g : a.isFunction(a.fn[e]))) ? a(b)[e](f) : ("type" === e && f !== c && k.test(b.nodeName) && b.parentNode && d("Can't change the 'type' of an input or button in IE 6/7/8"), !a.attrHooks[j] && m.test(j) && (a.attrHooks[j] = {
get: function (b, d) {
var e,
f = a.prop(b, d);
return f === !0 || "boolean" != typeof f && (e = b.getAttributeNode(d)) && e.nodeValue !== !1 ? d.toLowerCase() : c
},
set: function (b, c, d) {
var e;
return c === !1 ? a.removeAttr(b, d) : (e = a.propFix[d] || d, e in b && (b[e] = !0), b.setAttribute(d, d.toLowerCase())),
d
}
}, n.test(j) && d("jQuery.fn.attr('" + j + "') might use property instead of attribute")), h.call(a, b, e, f))
},
a.attrHooks.value = {
get: function (a, b) {
var c = (a.nodeName || "").toLowerCase();
return "button" === c ? i.apply(this, arguments) : ("input" !== c && "option" !== c && d("jQuery.fn.attr('value') no longer gets properties"), b in a ? a.value : null)
},
set: function (a, b) {
var c = (a.nodeName || "").toLowerCase();
return "button" === c ? j.apply(this, arguments) : ("input" !== c && "option" !== c && d("jQuery.fn.attr('value', val) no longer sets properties"), void(a.value = b))
}
};
var o,
p,
q = a.fn.init,
r = a.find,
s = a.parseJSON,
t = /^\s*</,
u = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
v = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
w = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
a.fn.init = function (b, e, f) {
var g,
h;
return b && "string" == typeof b && !a.isPlainObject(e) && (g = w.exec(a.trim(b))) && g[0] && (t.test(b) || d("$(html) HTML strings must start with '<' character"), g[3] && d("$(html) HTML text after last tag is ignored"), "#" === g[0].charAt(0) && (d("HTML string cannot start with a '#' character"), a.error("JQMIGRATE: Invalid selector string (XSS)")), e && e.context && e.context.nodeType && (e = e.context), a.parseHTML) ? q.call(this, a.parseHTML(g[2], e && e.ownerDocument || e || document, !0), e, f) : (h = q.apply(this, arguments), b && b.selector !== c ? (h.selector = b.selector, h.context = b.context) : (h.selector = "string" == typeof b ? b : "", b && (h.context = b.nodeType ? b : e || document)), h)
},
a.fn.init.prototype = a.fn,
a.find = function (a) {
var b = Array.prototype.slice.call(arguments);
if ("string" == typeof a && u.test(a))
try {
document.querySelector(a)
} catch (c) {
a = a.replace(v, function (a, b, c, d) {
return "[" + b + c + '"' + d + '"]'
});
try {
document.querySelector(a),
d("Attribute selector with '#' must be quoted: " + b[0]),
b[0] = a
} catch (e) {
d("Attribute selector with '#' was not fixed: " + b[0])
}
}
return r.apply(this, b)
};
var x;
for (x in r)
Object.prototype.hasOwnProperty.call(r, x) && (a.find[x] = r[x]);
a.parseJSON = function (a) {
return a ? s.apply(this, arguments) : (d("jQuery.parseJSON requires a valid JSON string"), null)
},
a.uaMatch = function (a) {
a = a.toLowerCase();
var b = /(chrome)[ \/]([\w.]+)/.exec(a) || /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || a.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a) || [];
return {
browser: b[1] || "",
version: b[2] || "0"
}
},
a.browser || (o = a.uaMatch(navigator.userAgent), p = {}, o.browser && (p[o.browser] = !0, p.version = o.version), p.chrome ? p.webkit = !0 : p.webkit && (p.safari = !0), a.browser = p),
e(a, "browser", a.browser, "jQuery.browser is deprecated"),
a.boxModel = a.support.boxModel = "CSS1Compat" === document.compatMode,
e(a, "boxModel", a.boxModel, "jQuery.boxModel is deprecated"),
e(a.support, "boxModel", a.support.boxModel, "jQuery.support.boxModel is deprecated"),
a.sub = function () {
function b(a, c) {
return new b.fn.init(a, c)
}
a.extend(!0, b, this),
b.superclass = this,
b.fn = b.prototype = this(),
b.fn.constructor = b,
b.sub = this.sub,
b.fn.init = function (d, e) {
var f = a.fn.init.call(this, d, e, c);
return f instanceof b ? f : b(f)
},
b.fn.init.prototype = b.fn;
var c = b(document);
return d("jQuery.sub() is deprecated"),
b
},
a.fn.size = function () {
return d("jQuery.fn.size() is deprecated; use the .length property"),
this.length
};
var y = !1;
a.swap && a.each(["height", "width", "reliableMarginRight"], function (b, c) {
var d = a.cssHooks[c] && a.cssHooks[c].get;
d && (a.cssHooks[c].get = function () {
var a;
return y = !0,
a = d.apply(this, arguments),
y = !1,
a
})
}),
a.swap = function (a, b, c, e) {
var f,
g,
h = {};
y || d("jQuery.swap() is undocumented and deprecated");
for (g in b)
h[g] = a.style[g], a.style[g] = b[g];
f = c.apply(a, e || []);
for (g in b)
a.style[g] = h[g];
return f
},
a.ajaxSetup({
converters: {
"text json": a.parseJSON
}
});
var z = a.fn.data;
a.fn.data = function (b) {
var e,
f,
g = this[0];
return !g || "events" !== b || 1 !== arguments.length || (e = a.data(g, b), f = a._data(g, b), e !== c && e !== f || f === c) ? z.apply(this, arguments) : (d("Use of jQuery.fn.data('events') is deprecated"), f)
};
var A = /\/(java|ecma)script/i;
a.clean || (a.clean = function (b, c, e, f) {
c = c || document,
c = !c.nodeType && c[0] || c,
c = c.ownerDocument || c,
d("jQuery.clean() is deprecated");
var g,
h,
i,
j,
k = [];
if (a.merge(k, a.buildFragment(b, c).childNodes), e)
for (i = function (a) {
return !a.type || A.test(a.type) ? f ? f.push(a.parentNode ? a.parentNode.removeChild(a) : a) : e.appendChild(a) : void 0
}, g = 0; null != (h = k[g]); g++)
a.nodeName(h, "script") && i(h) || (e.appendChild(h), "undefined" != typeof h.getElementsByTagName && (j = a.grep(a.merge([], h.getElementsByTagName("script")), i), k.splice.apply(k, [g + 1, 0].concat(j)), g += j.length));
return k
});
var B = a.event.add,
C = a.event.remove,
D = a.event.trigger,
E = a.fn.toggle,
F = a.fn.live,
G = a.fn.die,
H = a.fn.load,
I = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
J = new RegExp("\\b(?:" + I + ")\\b"),
K = /(?:^|\s)hover(\.\S+|)\b/,
L = function (b) {
return "string" != typeof b || a.event.special.hover ? b : (K.test(b) && d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"), b && b.replace(K, "mouseenter$1 mouseleave$1"))
};
a.event.props && "attrChange" !== a.event.props[0] && a.event.props.unshift("attrChange", "attrName", "relatedNode", "srcElement"),
a.event.dispatch && e(a.event, "handle", a.event.dispatch, "jQuery.event.handle is undocumented and deprecated"),
a.event.add = function (a, b, c, e, f) {
a !== document && J.test(b) && d("AJAX events should be attached to document: " + b),
B.call(this, a, L(b || ""), c, e, f)
},
a.event.remove = function (a, b, c, d, e) {
C.call(this, a, L(b) || "", c, d, e)
},
a.each(["load", "unload", "error"], function (b, c) {
a.fn[c] = function () {
var a = Array.prototype.slice.call(arguments, 0);
return "load" === c && "string" == typeof a[0] ? H.apply(this, a) : (d("jQuery.fn." + c + "() is deprecated"), a.splice(0, 0, c), arguments.length ? this.bind.apply(this, a) : (this.triggerHandler.apply(this, a), this))
}
}),
a.fn.toggle = function (b, c) {
if (!a.isFunction(b) || !a.isFunction(c))
return E.apply(this, arguments);
d("jQuery.fn.toggle(handler, handler...) is deprecated");
var e = arguments,
f = b.guid || a.guid++,
g = 0,
h = function (c) {
var d = (a._data(this, "lastToggle" + b.guid) || 0) % g;
return a._data(this, "lastToggle" + b.guid, d + 1),
c.preventDefault(),
e[d].apply(this, arguments) || !1
};
for (h.guid = f; g < e.length; )
e[g++].guid = f;
return this.click(h)
},
a.fn.live = function (b, c, e) {
return d("jQuery.fn.live() is deprecated"),
F ? F.apply(this, arguments) : (a(this.context).on(b, this.selector, c, e), this)
},
a.fn.die = function (b, c) {
return d("jQuery.fn.die() is deprecated"),
G ? G.apply(this, arguments) : (a(this.context).off(b, this.selector || "**", c), this)
},
a.event.trigger = function (a, b, c, e) {
return c || J.test(a) || d("Global events are undocumented and deprecated"),
D.call(this, a, b, c || document, e)
},
a.each(I.split("|"), function (b, c) {
a.event.special[c] = {
setup: function () {
var b = this;
return b !== document && (a.event.add(document, c + "." + a.guid, function () {
a.event.trigger(c, Array.prototype.slice.call(arguments, 1), b, !0)
}), a._data(this, c, a.guid++)),
!1
},
teardown: function () {
return this !== document && a.event.remove(document, c + "." + a._data(this, c)),
!1
}
}
}),
a.event.special.ready = {
setup: function () {
this === document && d("'ready' event is deprecated")
}
};
var M = a.fn.andSelf || a.fn.addBack,
N = a.fn.find;
if (a.fn.andSelf = function () {
return d("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),
M.apply(this, arguments)
}, a.fn.find = function (a) {
var b = N.apply(this, arguments);
return b.context = this.context,
b.selector = this.selector ? this.selector + " " + a : a,
b
}, a.Callbacks) {
var O = a.Deferred,
P = [["resolve", "done", a.Callbacks("once memory"), a.Callbacks("once memory"), "resolved"], ["reject", "fail", a.Callbacks("once memory"), a.Callbacks("once memory"), "rejected"], ["notify", "progress", a.Callbacks("memory"), a.Callbacks("memory")]];
a.Deferred = function (b) {
var c = O(),
e = c.promise();
return c.pipe = e.pipe = function () {
var b = arguments;
return d("deferred.pipe() is deprecated"),
a.Deferred(function (d) {
a.each(P, function (f, g) {
var h = a.isFunction(b[f]) && b[f];
c[g[1]](function () {
var b = h && h.apply(this, arguments);
b && a.isFunction(b.promise) ? b.promise().done(d.resolve).fail(d.reject).progress(d.notify) : d[g[0] + "With"](this === e ? d.promise() : this, h ? [b] : arguments)
})
}),
b = null
}).promise()
},
c.isResolved = function () {
return d("deferred.isResolved is deprecated"),
"resolved" === c.state()
},
c.isRejected = function () {
return d("deferred.isRejected is deprecated"),
"rejected" === c.state()
},
b && b.call(c, c),
c
}
}
}
(jQuery, window);
!function (a, b, c, d) {
"use strict";
function e(a, b, c) {
return setTimeout(j(a, c), b)
}
function f(a, b, c) {
return Array.isArray(a) ? (g(a, c[b], c), !0) : !1
}
function g(a, b, c) {
var e;
if (a)
if (a.forEach)
a.forEach(b, c);
else if (a.length !== d)
for (e = 0; e < a.length; )
b.call(c, a[e], e, a), e++;
else
for (e in a)
a.hasOwnProperty(e) && b.call(c, a[e], e, a)
}
function h(b, c, d) {
var e = "DEPRECATED METHOD: " + c + "\n" + d + " AT \n";
return function () {
var c = new Error("get-stack-trace"),
d = c && c.stack ? c.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace",
f = a.console && (a.console.warn || a.console.log);
return f && f.call(a.console, e, d),
b.apply(this, arguments)
}
}
function i(a, b, c) {
var d,
e = b.prototype;
d = a.prototype = Object.create(e),
d.constructor = a,
d._super = e,
c && ha(d, c)
}
function j(a, b) {
return function () {
return a.apply(b, arguments)
}
}
function k(a, b) {
return typeof a == ka ? a.apply(b ? b[0] || d : d, b) : a
}
function l(a, b) {
return a === d ? b : a
}
function m(a, b, c) {
g(q(b), function (b) {
a.addEventListener(b, c, !1)
})
}
function n(a, b, c) {
g(q(b), function (b) {
a.removeEventListener(b, c, !1)
})
}
function o(a, b) {
for (; a; ) {
if (a == b)
return !0;
a = a.parentNode
}
return !1
}
function p(a, b) {
return a.indexOf(b) > -1
}
function q(a) {
return a.trim().split(/\s+/g)
}
function r(a, b, c) {
if (a.indexOf && !c)
return a.indexOf(b);
for (var d = 0; d < a.length; ) {
if (c && a[d][c] == b || !c && a[d] === b)
return d;
d++
}
return -1
}
function s(a) {
return Array.prototype.slice.call(a, 0)
}
function t(a, b, c) {
for (var d = [], e = [], f = 0; f < a.length; ) {
var g = b ? a[f][b] : a[f];
r(e, g) < 0 && d.push(a[f]),
e[f] = g,
f++
}
return c && (d = b ? d.sort(function (a, c) {
return a[b] > c[b]
}) : d.sort()),
d
}
function u(a, b) {
for (var c, e, f = b[0].toUpperCase() + b.slice(1), g = 0; g < ia.length; ) {
if (c = ia[g], e = c ? c + f : b, e in a)
return e;
g++
}
return d
}
function v() {
return qa++
}
function w(b) {
var c = b.ownerDocument || b;
return c.defaultView || c.parentWindow || a
}
function x(a, b) {
var c = this;
this.manager = a,
this.callback = b,
this.element = a.element,
this.target = a.options.inputTarget,
this.domHandler = function (b) {
k(a.options.enable, [a]) && c.handler(b)
},
this.init()
}
function y(a) {
var b,
c = a.options.inputClass;
return new(b = c ? c : ta ? M : ua ? P : sa ? R : L)(a, z)
}
function z(a, b, c) {
var d = c.pointers.length,
e = c.changedPointers.length,
f = b & Aa && d - e === 0,
g = b & (Ca | Da) && d - e === 0;
c.isFirst = !!f,
c.isFinal = !!g,
f && (a.session = {}),
c.eventType = b,
A(a, c),
a.emit("hammer.input", c),
a.recognize(c),
a.session.prevInput = c
}
function A(a, b) {
var c = a.session,
d = b.pointers,
e = d.length;
c.firstInput || (c.firstInput = D(b)),
e > 1 && !c.firstMultiple ? c.firstMultiple = D(b) : 1 === e && (c.firstMultiple = !1);
var f = c.firstInput,
g = c.firstMultiple,
h = g ? g.center : f.center,
i = b.center = E(d);
b.timeStamp = na(),
b.deltaTime = b.timeStamp - f.timeStamp,
b.angle = I(h, i),
b.distance = H(h, i),
B(c, b),
b.offsetDirection = G(b.deltaX, b.deltaY);
var j = F(b.deltaTime, b.deltaX, b.deltaY);
b.overallVelocityX = j.x,
b.overallVelocityY = j.y,
b.overallVelocity = ma(j.x) > ma(j.y) ? j.x : j.y,
b.scale = g ? K(g.pointers, d) : 1,
b.rotation = g ? J(g.pointers, d) : 0,
b.maxPointers = c.prevInput ? b.pointers.length > c.prevInput.maxPointers ? b.pointers.length : c.prevInput.maxPointers : b.pointers.length,
C(c, b);
var k = a.element;
o(b.srcEvent.target, k) && (k = b.srcEvent.target),
b.target = k
}
function B(a, b) {
var c = b.center,
d = a.offsetDelta || {},
e = a.prevDelta || {},
f = a.prevInput || {};
(b.eventType === Aa || f.eventType === Ca) && (e = a.prevDelta = {
x: f.deltaX || 0,
y: f.deltaY || 0
}, d = a.offsetDelta = {
x: c.x,
y: c.y
}),
b.deltaX = e.x + (c.x - d.x),
b.deltaY = e.y + (c.y - d.y)
}
function C(a, b) {
var c,
e,
f,
g,
h = a.lastInterval || b,
i = b.timeStamp - h.timeStamp;
if (b.eventType != Da && (i > za || h.velocity === d)) {
var j = b.deltaX - h.deltaX,
k = b.deltaY - h.deltaY,
l = F(i, j, k);
e = l.x,
f = l.y,
c = ma(l.x) > ma(l.y) ? l.x : l.y,
g = G(j, k),
a.lastInterval = b
} else
c = h.velocity, e = h.velocityX, f = h.velocityY, g = h.direction;
b.velocity = c,
b.velocityX = e,
b.velocityY = f,
b.direction = g
}
function D(a) {
for (var b = [], c = 0; c < a.pointers.length; )
b[c] = {
clientX: la(a.pointers[c].clientX),
clientY: la(a.pointers[c].clientY)
},
c++;
return {
timeStamp: na(),
pointers: b,
center: E(b),
deltaX: a.deltaX,
deltaY: a.deltaY
}
}
function E(a) {
var b = a.length;
if (1 === b)
return {
x: la(a[0].clientX),
y: la(a[0].clientY)
};
for (var c = 0, d = 0, e = 0; b > e; )
c += a[e].clientX, d += a[e].clientY, e++;
return {
x: la(c / b),
y: la(d / b)
}
}
function F(a, b, c) {
return {
x: b / a || 0,
y: c / a || 0
}
}
function G(a, b) {
return a === b ? Ea : ma(a) >= ma(b) ? 0 > a ? Fa : Ga : 0 > b ? Ha : Ia
}
function H(a, b, c) {
c || (c = Ma);
var d = b[c[0]] - a[c[0]],
e = b[c[1]] - a[c[1]];
return Math.sqrt(d * d + e * e)
}
function I(a, b, c) {
c || (c = Ma);
var d = b[c[0]] - a[c[0]],
e = b[c[1]] - a[c[1]];
return 180 * Math.atan2(e, d) / Math.PI
}
function J(a, b) {
return I(b[1], b[0], Na) + I(a[1], a[0], Na)
}
function K(a, b) {
return H(b[0], b[1], Na) / H(a[0], a[1], Na)
}
function L() {
this.evEl = Pa,
this.evWin = Qa,
this.allow = !0,
this.pressed = !1,
x.apply(this, arguments)
}
function M() {
this.evEl = Ta,
this.evWin = Ua,
x.apply(this, arguments),
this.store = this.manager.session.pointerEvents = []
}
function N() {
this.evTarget = Wa,
this.evWin = Xa,
this.started = !1,
x.apply(this, arguments)
}
function O(a, b) {
var c = s(a.touches),
d = s(a.changedTouches);
return b & (Ca | Da) && (c = t(c.concat(d), "identifier", !0)),
[c, d]
}
function P() {
this.evTarget = Za,
this.targetIds = {},
x.apply(this, arguments)
}
function Q(a, b) {
var c = s(a.touches),
d = this.targetIds;
if (b & (Aa | Ba) && 1 === c.length)
return d[c[0].identifier] = !0, [c, c];
var e,
f,
g = s(a.changedTouches),
h = [],
i = this.target;
if (f = c.filter(function (a) {
return o(a.target, i)
}), b === Aa)
for (e = 0; e < f.length; )
d[f[e].identifier] = !0, e++;
for (e = 0; e < g.length; )
d[g[e].identifier] && h.push(g[e]), b & (Ca | Da) && delete d[g[e].identifier], e++;
return h.length ? [t(f.concat(h), "identifier", !0), h] : void 0
}
function R() {
x.apply(this, arguments);
var a = j(this.handler, this);
this.touch = new P(this.manager, a),
this.mouse = new L(this.manager, a)
}
function S(a, b) {
this.manager = a,
this.set(b)
}
function T(a) {
if (p(a, db))
return db;
var b = p(a, eb),
c = p(a, fb);
return b && c ? db : b || c ? b ? eb : fb : p(a, cb) ? cb : bb
}
function U(a) {
this.options = ha({}, this.defaults, a || {}),
this.id = v(),
this.manager = null,
this.options.enable = l(this.options.enable, !0),
this.state = gb,
this.simultaneous = {},
this.requireFail = []
}
function V(a) {
return a & lb ? "cancel" : a & jb ? "end" : a & ib ? "move" : a & hb ? "start" : ""
}
function W(a) {
return a == Ia ? "down" : a == Ha ? "up" : a == Fa ? "left" : a == Ga ? "right" : ""
}
function X(a, b) {
var c = b.manager;
return c ? c.get(a) : a
}
function Y() {
U.apply(this, arguments)
}
function Z() {
Y.apply(this, arguments),
this.pX = null,
this.pY = null
}
function $() {
Y.apply(this, arguments)
}
function _() {
U.apply(this, arguments),
this._timer = null,
this._input = null
}
function aa() {
Y.apply(this, arguments)
}
function ba() {
Y.apply(this, arguments)
}
function ca() {
U.apply(this, arguments),
this.pTime = !1,
this.pCenter = !1,
this._timer = null,
this._input = null,
this.count = 0
}
function da(a, b) {
return b = b || {},
b.recognizers = l(b.recognizers, da.defaults.preset),
new ea(a, b)
}
function ea(a, b) {
this.options = ha({}, da.defaults, b || {}),
this.options.inputTarget = this.options.inputTarget || a,
this.handlers = {},
this.session = {},
this.recognizers = [],
this.element = a,
this.input = y(this),
this.touchAction = new S(this, this.options.touchAction),
fa(this, !0),
g(this.options.recognizers, function (a) {
var b = this.add(new a[0](a[1]));
a[2] && b.recognizeWith(a[2]),
a[3] && b.requireFailure(a[3])
}, this)
}
function fa(a, b) {
var c = a.element;
c.style && g(a.options.cssProps, function (a, d) {
c.style[u(c.style, d)] = b ? a : ""
})
}
function ga(a, c) {
var d = b.createEvent("Event");
d.initEvent(a, !0, !0),
d.gesture = c,
c.target.dispatchEvent(d)
}
var ha,
ia = ["", "webkit", "Moz", "MS", "ms", "o"],
ja = b.createElement("div"),
ka = "function",
la = Math.round,
ma = Math.abs,
na = Date.now;
ha = "function" != typeof Object.assign ? function (a) {
if (a === d || null === a)
throw new TypeError("Cannot convert undefined or null to object");
for (var b = Object(a), c = 1; c < arguments.length; c++) {
var e = arguments[c];
if (e !== d && null !== e)
for (var f in e)
e.hasOwnProperty(f) && (b[f] = e[f])
}
return b
}
: Object.assign;
var oa = h(function (a, b, c) {
for (var e = Object.keys(b), f = 0; f < e.length; )
(!c || c && a[e[f]] === d) && (a[e[f]] = b[e[f]]), f++;
return a
}, "extend", "Use `assign`."),
pa = h(function (a, b) {
return oa(a, b, !0)
}, "merge", "Use `assign`."),
qa = 1,
ra = /mobile|tablet|ip(ad|hone|od)|android/i,
sa = "ontouchstart" in a,
ta = u(a, "PointerEvent") !== d,
ua = sa && ra.test(navigator.userAgent),
va = "touch",
wa = "pen",
xa = "mouse",
ya = "kinect",
za = 25,
Aa = 1,
Ba = 2,
Ca = 4,
Da = 8,
Ea = 1,
Fa = 2,
Ga = 4,
Ha = 8,
Ia = 16,
Ja = Fa | Ga,
Ka = Ha | Ia,
La = Ja | Ka,
Ma = ["x", "y"],
Na = ["clientX", "clientY"];
x.prototype = {
handler: function () {},
init: function () {
this.evEl && m(this.element, this.evEl, this.domHandler),
this.evTarget && m(this.target, this.evTarget, this.domHandler),
this.evWin && m(w(this.element), this.evWin, this.domHandler)
},
destroy: function () {
this.evEl && n(this.element, this.evEl, this.domHandler),
this.evTarget && n(this.target, this.evTarget, this.domHandler),
this.evWin && n(w(this.element), this.evWin, this.domHandler)
}
};
var Oa = {
mousedown: Aa,
mousemove: Ba,
mouseup: Ca
},
Pa = "mousedown",
Qa = "mousemove mouseup";
i(L, x, {
handler: function (a) {
var b = Oa[a.type];
b & Aa && 0 === a.button && (this.pressed = !0),
b & Ba && 1 !== a.which && (b = Ca),
this.pressed && this.allow && (b & Ca && (this.pressed = !1), this.callback(this.manager, b, {
pointers: [a],
changedPointers: [a],
pointerType: xa,
srcEvent: a
}))
}
});
var Ra = {
pointerdown: Aa,
pointermove: Ba,
pointerup: Ca,
pointercancel: Da,
pointerout: Da
},
Sa = {
2: va,
3: wa,
4: xa,
5: ya
},
Ta = "pointerdown",
Ua = "pointermove pointerup pointercancel";
a.MSPointerEvent && !a.PointerEvent && (Ta = "MSPointerDown", Ua = "MSPointerMove MSPointerUp MSPointerCancel"),
i(M, x, {
handler: function (a) {
var b = this.store,
c = !1,
d = a.type.toLowerCase().replace("ms", ""),
e = Ra[d],
f = Sa[a.pointerType] || a.pointerType,
g = f == va,
h = r(b, a.pointerId, "pointerId");
e & Aa && (0 === a.button || g) ? 0 > h && (b.push(a), h = b.length - 1) : e & (Ca | Da) && (c = !0),
0 > h || (b[h] = a, this.callback(this.manager, e, {
pointers: b,
changedPointers: [a],
pointerType: f,
srcEvent: a
}), c && b.splice(h, 1))
}
});
var Va = {
touchstart: Aa,
touchmove: Ba,
touchend: Ca,
touchcancel: Da
},
Wa = "touchstart",
Xa = "touchstart touchmove touchend touchcancel";
i(N, x, {
handler: function (a) {
var b = Va[a.type];
if (b === Aa && (this.started = !0), this.started) {
var c = O.call(this, a, b);
b & (Ca | Da) && c[0].length - c[1].length === 0 && (this.started = !1),
this.callback(this.manager, b, {
pointers: c[0],
changedPointers: c[1],
pointerType: va,
srcEvent: a
})
}
}
});
var Ya = {
touchstart: Aa,
touchmove: Ba,
touchend: Ca,
touchcancel: Da
},
Za = "touchstart touchmove touchend touchcancel";
i(P, x, {
handler: function (a) {
var b = Ya[a.type],
c = Q.call(this, a, b);
c && this.callback(this.manager, b, {
pointers: c[0],
changedPointers: c[1],
pointerType: va,
srcEvent: a
})
}
}),
i(R, x, {
handler: function (a, b, c) {
var d = c.pointerType == va,
e = c.pointerType == xa;
if (d)
this.mouse.allow = !1;
else if (e && !this.mouse.allow)
return;
b & (Ca | Da) && (this.mouse.allow = !0),
this.callback(a, b, c)
},
destroy: function () {
this.touch.destroy(),
this.mouse.destroy()
}
});
var $a = u(ja.style, "touchAction"),
_a = $a !== d,
ab = "compute",
bb = "auto",
cb = "manipulation",
db = "none",
eb = "pan-x",
fb = "pan-y";
S.prototype = {
set: function (a) {
a == ab && (a = this.compute()),
_a && this.manager.element.style && (this.manager.element.style[$a] = a),
this.actions = a.toLowerCase().trim()
},
update: function () {
this.set(this.manager.options.touchAction)
},
compute: function () {
var a = [];
return g(this.manager.recognizers, function (b) {
k(b.options.enable, [b]) && (a = a.concat(b.getTouchAction()))
}),
T(a.join(" "))
},
preventDefaults: function (a) {
if (!_a) {
var b = a.srcEvent,
c = a.offsetDirection;
if (this.manager.session.prevented)
return void b.preventDefault();
var d = this.actions,
e = p(d, db),
f = p(d, fb),
g = p(d, eb);
if (e) {
var h = 1 === a.pointers.length,
i = a.distance < 2,
j = a.deltaTime < 250;
if (h && i && j)
return
}
if (!g || !f)
return e || f && c & Ja || g && c & Ka ? this.preventSrc(b) : void 0
}
},
preventSrc: function (a) {
this.manager.session.prevented = !0,
a.preventDefault()
}
};
var gb = 1,
hb = 2,
ib = 4,
jb = 8,
kb = jb,
lb = 16,
mb = 32;
U.prototype = {
defaults: {},
set: function (a) {
return ha(this.options, a),
this.manager && this.manager.touchAction.update(),
this
},
recognizeWith: function (a) {
if (f(a, "recognizeWith", this))
return this;
var b = this.simultaneous;
return a = X(a, this),
b[a.id] || (b[a.id] = a, a.recognizeWith(this)),
this
},
dropRecognizeWith: function (a) {
return f(a, "dropRecognizeWith", this) ? this : (a = X(a, this), delete this.simultaneous[a.id], this)
},
requireFailure: function (a) {
if (f(a, "requireFailure", this))
return this;
var b = this.requireFail;
return a = X(a, this),
-1 === r(b, a) && (b.push(a), a.requireFailure(this)),
this
},
dropRequireFailure: function (a) {
if (f(a, "dropRequireFailure", this))
return this;
a = X(a, this);
var b = r(this.requireFail, a);
return b > -1 && this.requireFail.splice(b, 1),
this
},
hasRequireFailures: function () {
return this.requireFail.length > 0
},
canRecognizeWith: function (a) {
return !!this.simultaneous[a.id]
},
emit: function (a) {
function b(b) {
c.manager.emit(b, a)
}
var c = this,
d = this.state;
jb > d && b(c.options.event + V(d)),
b(c.options.event),
a.additionalEvent && b(a.additionalEvent),
d >= jb && b(c.options.event + V(d))
},
tryEmit: function (a) {
return this.canEmit() ? this.emit(a) : void(this.state = mb)
},
canEmit: function () {
for (var a = 0; a < this.requireFail.length; ) {
if (!(this.requireFail[a].state & (mb | gb)))
return !1;
a++
}
return !0
},
recognize: function (a) {
var b = ha({}, a);
return k(this.options.enable, [this, b]) ? (this.state & (kb | lb | mb) && (this.state = gb), this.state = this.process(b), void(this.state & (hb | ib | jb | lb) && this.tryEmit(b))) : (this.reset(), void(this.state = mb))
},
process: function (a) {},
getTouchAction: function () {},
reset: function () {}
},
i(Y, U, {
defaults: {
pointers: 1
},
attrTest: function (a) {
var b = this.options.pointers;
return 0 === b || a.pointers.length === b
},
process: function (a) {
var b = this.state,
c = a.eventType,
d = b & (hb | ib),
e = this.attrTest(a);
return d && (c & Da || !e) ? b | lb : d || e ? c & Ca ? b | jb : b & hb ? b | ib : hb : mb
}
}),
i(Z, Y, {
defaults: {
event: "pan",
threshold: 10,
pointers: 1,
direction: La
},
getTouchAction: function () {
var a = this.options.direction,
b = [];
return a & Ja && b.push(fb),
a & Ka && b.push(eb),
b
},
directionTest: function (a) {
var b = this.options,
c = !0,
d = a.distance,
e = a.direction,
f = a.deltaX,
g = a.deltaY;
return e & b.direction || (b.direction & Ja ? (e = 0 === f ? Ea : 0 > f ? Fa : Ga, c = f != this.pX, d = Math.abs(a.deltaX)) : (e = 0 === g ? Ea : 0 > g ? Ha : Ia, c = g != this.pY, d = Math.abs(a.deltaY))),
a.direction = e,
c && d > b.threshold && e & b.direction
},
attrTest: function (a) {
return Y.prototype.attrTest.call(this, a) && (this.state & hb || !(this.state & hb) && this.directionTest(a))
},
emit: function (a) {
this.pX = a.deltaX,
this.pY = a.deltaY;
var b = W(a.direction);
b && (a.additionalEvent = this.options.event + b),
this._super.emit.call(this, a)
}
}),
i($, Y, {
defaults: {
event: "pinch",
threshold: 0,
pointers: 2
},
getTouchAction: function () {
return [db]
},
attrTest: function (a) {
return this._super.attrTest.call(this, a) && (Math.abs(a.scale - 1) > this.options.threshold || this.state & hb)
},
emit: function (a) {
if (1 !== a.scale) {
var b = a.scale < 1 ? "in" : "out";
a.additionalEvent = this.options.event + b
}
this._super.emit.call(this, a)
}
}),
i(_, U, {
defaults: {
event: "press",
pointers: 1,
time: 251,
threshold: 9
},
getTouchAction: function () {
return [bb]
},
process: function (a) {
var b = this.options,
c = a.pointers.length === b.pointers,
d = a.distance < b.threshold,
f = a.deltaTime > b.time;
if (this._input = a, !d || !c || a.eventType & (Ca | Da) && !f)
this.reset();
else if (a.eventType & Aa)
this.reset(), this._timer = e(function () {
this.state = kb,
this.tryEmit()
}, b.time, this);
else if (a.eventType & Ca)
return kb;
return mb
},
reset: function () {
clearTimeout(this._timer)
},
emit: function (a) {
this.state === kb && (a && a.eventType & Ca ? this.manager.emit(this.options.event + "up", a) : (this._input.timeStamp = na(), this.manager.emit(this.options.event, this._input)))
}
}),
i(aa, Y, {
defaults: {
event: "rotate",
threshold: 0,
pointers: 2
},
getTouchAction: function () {
return [db]
},
attrTest: function (a) {
return this._super.attrTest.call(this, a) && (Math.abs(a.rotation) > this.options.threshold || this.state & hb)
}
}),
i(ba, Y, {
defaults: {
event: "swipe",
threshold: 10,
velocity: .3,
direction: Ja | Ka,
pointers: 1
},
getTouchAction: function () {
return Z.prototype.getTouchAction.call(this)
},
attrTest: function (a) {
var b,
c = this.options.direction;
return c & (Ja | Ka) ? b = a.overallVelocity : c & Ja ? b = a.overallVelocityX : c & Ka && (b = a.overallVelocityY),
this._super.attrTest.call(this, a) && c & a.offsetDirection && a.distance > this.options.threshold && a.maxPointers == this.options.pointers && ma(b) > this.options.velocity && a.eventType & Ca
},
emit: function (a) {
var b = W(a.offsetDirection);
b && this.manager.emit(this.options.event + b, a),
this.manager.emit(this.options.event, a)
}
}),
i(ca, U, {
defaults: {
event: "tap",
pointers: 1,
taps: 1,
interval: 300,
time: 250,
threshold: 9,
posThreshold: 10
},
getTouchAction: function () {
return [cb]
},
process: function (a) {
var b = this.options,
c = a.pointers.length === b.pointers,
d = a.distance < b.threshold,
f = a.deltaTime < b.time;
if (this.reset(), a.eventType & Aa && 0 === this.count)
return this.failTimeout();
if (d && f && c) {
if (a.eventType != Ca)
return this.failTimeout();
var g = this.pTime ? a.timeStamp - this.pTime < b.interval : !0,
h = !this.pCenter || H(this.pCenter, a.center) < b.posThreshold;
this.pTime = a.timeStamp,
this.pCenter = a.center,
h && g ? this.count += 1 : this.count = 1,
this._input = a;
var i = this.count % b.taps;
if (0 === i)
return this.hasRequireFailures() ? (this._timer = e(function () {
this.state = kb,
this.tryEmit()
}, b.interval, this), hb) : kb
}
return mb
},
failTimeout: function () {
return this._timer = e(function () {
this.state = mb
}, this.options.interval, this),
mb
},
reset: function () {
clearTimeout(this._timer)
},
emit: function () {
this.state == kb && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input))
}
}),
da.VERSION = "2.0.6",
da.defaults = {
domEvents: !1,
touchAction: ab,
enable: !0,
inputTarget: null,
inputClass: null,
preset: [[aa, {
enable: !1
}
], [$, {
enable: !1
}, ["rotate"]], [ba, {
direction: Ja
}
], [Z, {
direction: Ja
}, ["swipe"]], [ca], [ca, {
event: "doubletap",
taps: 2
}, ["tap"]], [_]],
cssProps: {
userSelect: "none",
touchSelect: "none",
touchCallout: "none",
contentZooming: "none",
userDrag: "none",
tapHighlightColor: "rgba(0,0,0,0)"
}
};
var nb = 1,
ob = 2;
ea.prototype = {
set: function (a) {
return ha(this.options, a),
a.touchAction && this.touchAction.update(),
a.inputTarget && (this.input.destroy(), this.input.target = a.inputTarget, this.input.init()),
this
},
stop: function (a) {
this.session.stopped = a ? ob : nb
},
recognize: function (a) {
var b = this.session;
if (!b.stopped) {
this.touchAction.preventDefaults(a);
var c,
d = this.recognizers,
e = b.curRecognizer;
(!e || e && e.state & kb) && (e = b.curRecognizer = null);
for (var f = 0; f < d.length; )
c = d[f], b.stopped === ob || e && c != e && !c.canRecognizeWith(e) ? c.reset() : c.recognize(a), !e && c.state & (hb | ib | jb) && (e = b.curRecognizer = c), f++
}
},
get: function (a) {
if (a instanceof U)
return a;
for (var b = this.recognizers, c = 0; c < b.length; c++)
if (b[c].options.event == a)
return b[c];
return null
},
add: function (a) {
if (f(a, "add", this))
return this;
var b = this.get(a.options.event);
return b && this.remove(b),
this.recognizers.push(a),
a.manager = this,
this.touchAction.update(),
a
},
remove: function (a) {
if (f(a, "remove", this))
return this;
if (a = this.get(a)) {
var b = this.recognizers,
c = r(b, a);
-1 !== c && (b.splice(c, 1), this.touchAction.update())
}
return this
},
on: function (a, b) {
var c = this.handlers;
return g(q(a), function (a) {
c[a] = c[a] || [],
c[a].push(b)
}),
this
},
off: function (a, b) {
var c = this.handlers;
return g(q(a), function (a) {
b ? c[a] && c[a].splice(r(c[a], b), 1) : delete c[a]
}),
this
},
emit: function (a, b) {
this.options.domEvents && ga(a, b);
var c = this.handlers[a] && this.handlers[a].slice();
if (c && c.length) {
b.type = a,
b.preventDefault = function () {
b.srcEvent.preventDefault()
};
for (var d = 0; d < c.length; )
c[d](b), d++
}
},
destroy: function () {
this.element && fa(this, !1),
this.handlers = {},
this.session = {},
this.input.destroy(),
this.element = null
}
},
ha(da, {
INPUT_START: Aa,
INPUT_MOVE: Ba,
INPUT_END: Ca,
INPUT_CANCEL: Da,
STATE_POSSIBLE: gb,
STATE_BEGAN: hb,
STATE_CHANGED: ib,
STATE_ENDED: jb,
STATE_RECOGNIZED: kb,
STATE_CANCELLED: lb,
STATE_FAILED: mb,
DIRECTION_NONE: Ea,
DIRECTION_LEFT: Fa,
DIRECTION_RIGHT: Ga,
DIRECTION_UP: Ha,
DIRECTION_DOWN: Ia,
DIRECTION_HORIZONTAL: Ja,
DIRECTION_VERTICAL: Ka,
DIRECTION_ALL: La,
Manager: ea,
Input: x,
TouchAction: S,
TouchInput: P,
MouseInput: L,
PointerEventInput: M,
TouchMouseInput: R,
SingleTouchInput: N,
Recognizer: U,
AttrRecognizer: Y,
Tap: ca,
Pan: Z,
Swipe: ba,
Pinch: $,
Rotate: aa,
Press: _,
on: m,
off: n,
each: g,
merge: pa,
extend: oa,
assign: ha,
inherit: i,
bindFn: j,
prefixed: u
});
var pb = "undefined" != typeof a ? a : "undefined" != typeof self ? self : {};
pb.Hammer = da,
"function" == typeof define && define.amd ? define(function () {
return da
}) : "undefined" != typeof module && module.exports ? module.exports = da : a[c] = da
}
(window, document, "Hammer");
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'hammerjs'], factory);
} else if (typeof exports === 'object') {
factory(require('jquery'), require('hammerjs'));
} else {
factory(jQuery, Hammer);
}
}
(function ($, Hammer) {
function hammerify(el, options) {
var $el = $(el);
if (!$el.data("hammer")) {
$el.data("hammer", new Hammer($el[0], options));
}
}
$.fn.hammer = function (options) {
return this.each(function () {
hammerify(this, options);
});
};
Hammer.Manager.prototype.emit = (function (originalEmit) {
return function (type, data) {
originalEmit.call(this, type, data);
$(this.element).trigger({
type: type,
gesture: data
});
};
})(Hammer.Manager.prototype.emit);
}));
!function (a) {
"function" == typeof define && define.amd ? define("picker", ["jquery"], a) : "object" == typeof exports ? module.exports = a(require("jquery")) : this.Picker = a(jQuery)
}
(function (a) {
function b(f, g, i, m) {
function n() {
return b._.node("div", b._.node("div", b._.node("div", b._.node("div", B.component.nodes(w.open), y.box), y.wrap), y.frame), y.holder, 'tabindex="-1"')
}
function o() {
z.data(g, B).addClass(y.input).val(z.data("value") ? B.get("select", x.format) : f.value),
x.editable || z.on("focus." + w.id + " click." + w.id, function (a) {
a.preventDefault(),
B.open()
}).on("keydown." + w.id, u),
e(f, {
haspopup: !0,
expanded: !1,
readonly: !1,
owns: f.id + "_root"
})
}
function p() {
e(B.$root[0], "hidden", !0)
}
function q() {
B.$holder.on({
keydown: u,
"focus.toOpen": t,
blur: function () {
z.removeClass(y.target)
},
focusin: function (a) {
B.$root.removeClass(y.focused),
a.stopPropagation()
},
"mousedown click": function (b) {
var c = b.target;
c != B.$holder[0] && (b.stopPropagation(), "mousedown" != b.type || a(c).is("input, select, textarea, button, option") || (b.preventDefault(), B.$holder[0].focus()))
}
}).on("click", "[data-pick], [data-nav], [data-clear], [data-close]", function () {
var b = a(this),
c = b.data(),
d = b.hasClass(y.navDisabled) || b.hasClass(y.disabled),
e = h();
e = e && (e.type || e.href),
(d || e && !a.contains(B.$root[0], e)) && B.$holder[0].focus(),
!d && c.nav ? B.set("highlight", B.component.item.highlight, {
nav: c.nav
}) : !d && "pick" in c ? (B.set("select", c.pick), x.closeOnSelect && B.close(!0)) : c.clear ? (B.clear(), x.closeOnClear && B.close(!0)) : c.close && B.close(!0)
})
}
function r() {
var b;
x.hiddenName === !0 ? (b = f.name, f.name = "") : (b = ["string" == typeof x.hiddenPrefix ? x.hiddenPrefix : "", "string" == typeof x.hiddenSuffix ? x.hiddenSuffix : "_submit"], b = b[0] + f.name + b[1]),
B._hidden = a('<input type=hidden name="' + b + '"' + (z.data("value") || f.value ? ' value="' + B.get("select", x.formatSubmit) + '"' : "") + ">")[0],
z.on("change." + w.id, function () {
B._hidden.value = f.value ? B.get("select", x.formatSubmit) : ""
})
}
function s() {
v && l ? B.$holder.find("." + y.frame).one("transitionend", function () {
B.$holder[0].focus()
}) : B.$holder[0].focus()
}
function t(a) {
a.stopPropagation(),
z.addClass(y.target),
B.$root.addClass(y.focused),
B.open()
}
function u(a) {
var b = a.keyCode,
c = /^(8|46)$/.test(b);
return 27 == b ? (B.close(!0), !1) : void((32 == b || c || !w.open && B.component.key[b]) && (a.preventDefault(), a.stopPropagation(), c ? B.clear().close() : B.open()))
}
if (!f)
return b;
var v = !1,
w = {
id: f.id || "P" + Math.abs(~~(Math.random() * new Date))
},
x = i ? a.extend(!0, {}, i.defaults, m) : m || {},
y = a.extend({}, b.klasses(), x.klass),
z = a(f),
A = function () {
return this.start()
},
B = A.prototype = {
constructor: A,
$node: z,
start: function () {
return w && w.start ? B : (w.methods = {}, w.start = !0, w.open = !1, w.type = f.type, f.autofocus = f == h(), f.readOnly = !x.editable, f.id = f.id || w.id, "text" != f.type && (f.type = "text"), B.component = new i(B, x), B.$root = a('<div class="' + y.picker + '" id="' + f.id + '_root" />'), p(), B.$holder = a(n()).appendTo(B.$root), q(), x.formatSubmit && r(), o(), x.containerHidden ? a(x.containerHidden).append(B._hidden) : z.after(B._hidden), x.container ? a(x.container).append(B.$root) : z.after(B.$root), B.on({
start: B.component.onStart,
render: B.component.onRender,
stop: B.component.onStop,
open: B.component.onOpen,
close: B.component.onClose,
set: B.component.onSet
}).on({
start: x.onStart,
render: x.onRender,
stop: x.onStop,
open: x.onOpen,
close: x.onClose,
set: x.onSet
}), v = c(B.$holder[0]), f.autofocus && B.open(), B.trigger("start").trigger("render"))
},
render: function (b) {
return b ? (B.$holder = a(n()), q(), B.$root.html(B.$holder)) : B.$root.find("." + y.box).html(B.component.nodes(w.open)),
B.trigger("render")
},
stop: function () {
return w.start ? (B.close(), B._hidden && B._hidden.parentNode.removeChild(B._hidden), B.$root.remove(), z.removeClass(y.input).removeData(g), setTimeout(function () {
z.off("." + w.id)
}, 0), f.type = w.type, f.readOnly = !1, B.trigger("stop"), w.methods = {}, w.start = !1, B) : B
},
open: function (c) {
return w.open ? B : (z.addClass(y.active), e(f, "expanded", !0), setTimeout(function () {
B.$root.addClass(y.opened),
e(B.$root[0], "hidden", !1)
}, 0), c !== !1 && (w.open = !0, v && k.css("overflow", "hidden").css("padding-right", "+=" + d()), s(), j.on("click." + w.id + " focusin." + w.id, function (a) {
var b = a.target;
b != f && b != document && 3 != a.which && B.close(b === B.$holder[0])
}).on("keydown." + w.id, function (c) {
var d = c.keyCode,
e = B.component.key[d],
f = c.target;
27 == d ? B.close(!0) : f != B.$holder[0] || !e && 13 != d ? a.contains(B.$root[0], f) && 13 == d && (c.preventDefault(), f.click()) : (c.preventDefault(), e ? b._.trigger(B.component.key.go, B, [b._.trigger(e)]) : B.$root.find("." + y.highlighted).hasClass(y.disabled) || (B.set("select", B.component.item.highlight), x.closeOnSelect && B.close(!0)))
})), B.trigger("open"))
},
close: function (a) {
return a && (x.editable ? f.focus() : (B.$holder.off("focus.toOpen").focus(), setTimeout(function () {
B.$holder.on("focus.toOpen", t)
}, 0))),
z.removeClass(y.active),
e(f, "expanded", !1),
setTimeout(function () {
B.$root.removeClass(y.opened + " " + y.focused),
e(B.$root[0], "hidden", !0)
}, 0),
w.open ? (w.open = !1, v && k.css("overflow", "").css("padding-right", "-=" + d()), j.off("." + w.id), B.trigger("close")) : B
},
clear: function (a) {
return B.set("clear", null, a)
},
set: function (b, c, d) {
var e,
f,
g = a.isPlainObject(b),
h = g ? b : {};
if (d = g && a.isPlainObject(c) ? c : d || {}, b) {
g || (h[b] = c);
for (e in h)
f = h[e], e in B.component.item && (void 0 === f && (f = null), B.component.set(e, f, d)), ("select" == e || "clear" == e) && z.val("clear" == e ? "" : B.get(e, x.format)).trigger("change");
B.render()
}
return d.muted ? B : B.trigger("set", h)
},
get: function (a, c) {
if (a = a || "value", null != w[a])
return w[a];
if ("valueSubmit" == a) {
if (B._hidden)
return B._hidden.value;
a = "value"
}
if ("value" == a)
return f.value;
if (a in B.component.item) {
if ("string" == typeof c) {
var d = B.component.get(a);
return d ? b._.trigger(B.component.formats.toString, B.component, [c, d]) : ""
}
return B.component.get(a)
}
},
on: function (b, c, d) {
var e,
f,
g = a.isPlainObject(b),
h = g ? b : {};
if (b) {
g || (h[b] = c);
for (e in h)
f = h[e], d && (e = "_" + e), w.methods[e] = w.methods[e] || [], w.methods[e].push(f)
}
return B
},
off: function () {
var a,
b,
c = arguments;
for (a = 0, namesCount = c.length; a < namesCount; a += 1)
b = c[a], b in w.methods && delete w.methods[b];
return B
},
trigger: function (a, c) {
var d = function (a) {
var d = w.methods[a];
d && d.map(function (a) {
b._.trigger(a, B, [c])
})
};
return d("_" + a),
d(a),
B
}
};
return new A
}
function c(a) {
var b,
c = "position";
return a.currentStyle ? b = a.currentStyle[c] : window.getComputedStyle && (b = getComputedStyle(a)[c]),
"fixed" == b
}
function d() {
if (k.height() <= i.height())
return 0;
var b = a('<div style="visibility:hidden;width:100px" />').appendTo("body"),
c = b[0].offsetWidth;
b.css("overflow", "scroll");
var d = a('<div style="width:100%" />').appendTo(b),
e = d[0].offsetWidth;
return b.remove(),
c - e
}
function e(b, c, d) {
if (a.isPlainObject(c))
for (var e in c)
f(b, e, c[e]);
else
f(b, c, d)
}
function f(a, b, c) {
a.setAttribute(("role" == b ? "" : "aria-") + b, c)
}
function g(b, c) {
a.isPlainObject(b) || (b = {
attribute: c
}),
c = "";
for (var d in b) {
var e = ("role" == d ? "" : "aria-") + d,
f = b[d];
c += null == f ? "" : e + '="' + b[d] + '"'
}
return c
}
function h() {
try {
return document.activeElement
} catch (a) {}
}
var i = a(window),
j = a(document),
k = a(document.documentElement),
l = null != document.documentElement.style.transition;
return b.klasses = function (a) {
return a = a || "picker", {
picker: a,
opened: a + "--opened",
focused: a + "--focused",
input: a + "__input",
active: a + "__input--active",
target: a + "__input--target",
holder: a + "__holder",
frame: a + "__frame",
wrap: a + "__wrap",
box: a + "__box"
}
},
b._ = {
group: function (a) {
for (var c, d = "", e = b._.trigger(a.min, a); e <= b._.trigger(a.max, a, [e]); e += a.i)
c = b._.trigger(a.item, a, [e]), d += b._.node(a.node, c[0], c[1], c[2]);
return d
},
node: function (b, c, d, e) {
return c ? (c = a.isArray(c) ? c.join("") : c, d = d ? ' class="' + d + '"' : "", e = e ? " " + e : "", "<" + b + d + e + ">" + c + "</" + b + ">") : ""
},
lead: function (a) {
return (10 > a ? "0" : "") + a
},
trigger: function (a, b, c) {
return "function" == typeof a ? a.apply(b, c || []) : a
},
digits: function (a) {
return /\d/.test(a[1]) ? 2 : 1
},
isDate: function (a) {
return {}
.toString.call(a).indexOf("Date") > -1 && this.isInteger(a.getDate())
},
isInteger: function (a) {
return {}
.toString.call(a).indexOf("Number") > -1 && a % 1 === 0
},
ariaAttr: g
},
b.extend = function (c, d) {
a.fn[c] = function (e, f) {
var g = this.data(c);
return "picker" == e ? g : g && "string" == typeof e ? b._.trigger(g[e], g, [f]) : this.each(function () {
var f = a(this);
f.data(c) || new b(this, c, d, e)
})
},
a.fn[c].defaults = d.defaults
},
b
});
!function (a) {
"function" == typeof define && define.amd ? define(["picker", "jquery"], a) : "object" == typeof exports ? module.exports = a(require("./picker.js"), require("jquery")) : a(Picker, jQuery)
}
(function (a, b) {
function c(a, b) {
var c = this,
d = a.$node[0],
e = d.value,
f = a.$node.data("value"),
g = f || e,
h = f ? b.formatSubmit : b.format,
i = function () {
return d.currentStyle ? "rtl" == d.currentStyle.direction : "rtl" == getComputedStyle(a.$root[0]).direction
};
c.settings = b,
c.$node = a.$node,
c.queue = {
min: "measure create",
max: "measure create",
now: "now create",
select: "parse create validate",
highlight: "parse navigate create validate",
view: "parse create validate viewset",
disable: "deactivate",
enable: "activate"
},
c.item = {},
c.item.clear = null,
c.item.disable = (b.disable || []).slice(0),
c.item.enable = -function(a) {
return a[0] === !0 ? a.shift() : -1
}
(c.item.disable),
c.set("min", b.min).set("max", b.max).set("now"),
g ? c.set("select", g, {
format: h,
defaultValue: !0
}) : c.set("select", null).set("highlight", c.item.now),
c.key = {
40: 7,
38: -7,
39: function () {
return i() ? -1 : 1
},
37: function () {
return i() ? 1 : -1
},
go: function (a) {
var b = c.item.highlight,
d = new Date(b.year, b.month, b.date + a);
c.set("highlight", d, {
interval: a
}),
this.render()
}
},
a.on("render", function () {
a.$root.find("." + b.klass.selectMonth).on("change", function () {
var c = this.value;
c && (a.set("highlight", [a.get("view").year, c, a.get("highlight").date]), a.$root.find("." + b.klass.selectMonth).trigger("focus"))
}),
a.$root.find("." + b.klass.selectYear).on("change", function () {
var c = this.value;
c && (a.set("highlight", [c, a.get("view").month, a.get("highlight").date]), a.$root.find("." + b.klass.selectYear).trigger("focus"))
})
}, 1).on("open", function () {
var d = "";
c.disabled(c.get("now")) && (d = ":not(." + b.klass.buttonToday + ")"),
a.$root.find("button" + d + ", select").attr("disabled", !1)
}, 1).on("close", function () {
a.$root.find("button, select").attr("disabled", !0)
}, 1)
}
var d = 7,
e = 6,
f = a._;
c.prototype.set = function (a, b, c) {
var d = this,
e = d.item;
return null === b ? ("clear" == a && (a = "select"), e[a] = b, d) : (e["enable" == a ? "disable" : "flip" == a ? "enable" : a] = d.queue[a].split(" ").map(function (e) {
return b = d[e](a, b, c)
}).pop(), "select" == a ? d.set("highlight", e.select, c) : "highlight" == a ? d.set("view", e.highlight, c) : a.match(/^(flip|min|max|disable|enable)$/) && (e.select && d.disabled(e.select) && d.set("select", e.select, c), e.highlight && d.disabled(e.highlight) && d.set("highlight", e.highlight, c)), d)
},
c.prototype.get = function (a) {
return this.item[a]
},
c.prototype.create = function (a, c, d) {
var e,
g = this;
return c = void 0 === c ? a : c,
c == - (1 / 0) || c == 1 / 0 ? e = c : b.isPlainObject(c) && f.isInteger(c.pick) ? c = c.obj : b.isArray(c) ? (c = new Date(c[0], c[1], c[2]), c = f.isDate(c) ? c : g.create().obj) : c = f.isInteger(c) || f.isDate(c) ? g.normalize(new Date(c), d) : g.now(a, c, d), {
year: e || c.getFullYear(),
month: e || c.getMonth(),
date: e || c.getDate(),
day: e || c.getDay(),
obj: e || c,
pick: e || c.getTime()
}
},
c.prototype.createRange = function (a, c) {
var d = this,
e = function (a) {
return a === !0 || b.isArray(a) || f.isDate(a) ? d.create(a) : a
};
return f.isInteger(a) || (a = e(a)),
f.isInteger(c) || (c = e(c)),
f.isInteger(a) && b.isPlainObject(c) ? a = [c.year, c.month, c.date + a] : f.isInteger(c) && b.isPlainObject(a) && (c = [a.year, a.month, a.date + c]), {
from: e(a),
to: e(c)
}
},
c.prototype.withinRange = function (a, b) {
return a = this.createRange(a.from, a.to),
b.pick >= a.from.pick && b.pick <= a.to.pick
},
c.prototype.overlapRanges = function (a, b) {
var c = this;
return a = c.createRange(a.from, a.to),
b = c.createRange(b.from, b.to),
c.withinRange(a, b.from) || c.withinRange(a, b.to) || c.withinRange(b, a.from) || c.withinRange(b, a.to)
},
c.prototype.now = function (a, b, c) {
return b = new Date,
c && c.rel && b.setDate(b.getDate() + c.rel),
this.normalize(b, c)
},
c.prototype.navigate = function (a, c, d) {
var e,
f,
g,
h,
i = b.isArray(c),
j = b.isPlainObject(c),
k = this.item.view;
if (i || j) {
for (j ? (f = c.year, g = c.month, h = c.date) : (f = +c[0], g = +c[1], h = +c[2]), d && d.nav && k && k.month !== g && (f = k.year, g = k.month), e = new Date(f, g + (d && d.nav ? d.nav : 0), 1), f = e.getFullYear(), g = e.getMonth(); new Date(f, g, h).getMonth() !== g; )
h -= 1;
c = [f, g, h]
}
return c
},
c.prototype.normalize = function (a) {
return a.setHours(0, 0, 0, 0),
a
},
c.prototype.measure = function (a, b) {
var c = this;
return b ? "string" == typeof b ? b = c.parse(a, b) : f.isInteger(b) && (b = c.now(a, b, {
rel: b
})) : b = "min" == a ? - (1 / 0) : 1 / 0,
b
},
c.prototype.viewset = function (a, b) {
return this.create([b.year, b.month, 1])
},
c.prototype.validate = function (a, c, d) {
var e,
g,
h,
i,
j = this,
k = c,
l = d && d.interval ? d.interval : 1,
m = -1 === j.item.enable,
n = j.item.min,
o = j.item.max,
p = m && j.item.disable.filter(function (a) {
if (b.isArray(a)) {
var d = j.create(a).pick;
d < c.pick ? e = !0 : d > c.pick && (g = !0)
}
return f.isInteger(a)
}).length;
if ((!d || !d.nav && !d.defaultValue) && (!m && j.disabled(c) || m && j.disabled(c) && (p || e || g) || !m && (c.pick <= n.pick || c.pick >= o.pick)))
for (m && !p && (!g && l > 0 || !e && 0 > l) && (l *= -1); j.disabled(c) && (Math.abs(l) > 1 && (c.month < k.month || c.month > k.month) && (c = k, l = l > 0 ? 1 : -1), c.pick <= n.pick ? (h = !0, l = 1, c = j.create([n.year, n.month, n.date + (c.pick === n.pick ? 0 : -1)])) : c.pick >= o.pick && (i = !0, l = -1, c = j.create([o.year, o.month, o.date + (c.pick === o.pick ? 0 : 1)])), !h || !i); )
c = j.create([c.year, c.month, c.date + l]);
return c
},
c.prototype.disabled = function (a) {
var c = this,
d = c.item.disable.filter(function (d) {
return f.isInteger(d) ? a.day === (c.settings.firstDay ? d : d - 1) % 7 : b.isArray(d) || f.isDate(d) ? a.pick === c.create(d).pick : b.isPlainObject(d) ? c.withinRange(d, a) : void 0
});
return d = d.length && !d.filter(function (a) {
return b.isArray(a) && "inverted" == a[3] || b.isPlainObject(a) && a.inverted
}).length,
-1 === c.item.enable ? !d : d || a.pick < c.item.min.pick || a.pick > c.item.max.pick
},
c.prototype.parse = function (a, b, c) {
var d = this,
e = {};
return b && "string" == typeof b ? (c && c.format || (c = c || {}, c.format = d.settings.format), d.formats.toArray(c.format).map(function (a) {
var c = d.formats[a],
g = c ? f.trigger(c, d, [b, e]) : a.replace(/^!/, "").length;
c && (e[a] = b.substr(0, g)),
b = b.substr(g)
}), [e.yyyy || e.yy, + (e.mm || e.m) - 1, e.dd || e.d]) : b
},
c.prototype.formats = function () {
function a(a, b, c) {
var d = a.match(/[^\x00-\x7F]+|\w+/)[0];
return c.mm || c.m || (c.m = b.indexOf(d) + 1),
d.length
}
function b(a) {
return a.match(/\w+/)[0].length
}
return {
d: function (a, b) {
return a ? f.digits(a) : b.date
},
dd: function (a, b) {
return a ? 2 : f.lead(b.date)
},
ddd: function (a, c) {
return a ? b(a) : this.settings.weekdaysShort[c.day]
},
dddd: function (a, c) {
return a ? b(a) : this.settings.weekdaysFull[c.day]
},
m: function (a, b) {
return a ? f.digits(a) : b.month + 1
},
mm: function (a, b) {
return a ? 2 : f.lead(b.month + 1)
},
mmm: function (b, c) {
var d = this.settings.monthsShort;
return b ? a(b, d, c) : d[c.month]
},
mmmm: function (b, c) {
var d = this.settings.monthsFull;
return b ? a(b, d, c) : d[c.month]
},
yy: function (a, b) {
return a ? 2 : ("" + b.year).slice(2)
},
yyyy: function (a, b) {
return a ? 4 : b.year
},
toArray: function (a) {
return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)
},
toString: function (a, b) {
var c = this;
return c.formats.toArray(a).map(function (a) {
return f.trigger(c.formats[a], c, [0, b]) || a.replace(/^!/, "")
}).join("")
}
}
}
(),
c.prototype.isDateExact = function (a, c) {
var d = this;
return f.isInteger(a) && f.isInteger(c) || "boolean" == typeof a && "boolean" == typeof c ? a === c : (f.isDate(a) || b.isArray(a)) && (f.isDate(c) || b.isArray(c)) ? d.create(a).pick === d.create(c).pick : b.isPlainObject(a) && b.isPlainObject(c) ? d.isDateExact(a.from, c.from) && d.isDateExact(a.to, c.to) : !1
},
c.prototype.isDateOverlap = function (a, c) {
var d = this,
e = d.settings.firstDay ? 1 : 0;
return f.isInteger(a) && (f.isDate(c) || b.isArray(c)) ? (a = a % 7 + e, a === d.create(c).day + 1) : f.isInteger(c) && (f.isDate(a) || b.isArray(a)) ? (c = c % 7 + e, c === d.create(a).day + 1) : b.isPlainObject(a) && b.isPlainObject(c) ? d.overlapRanges(a, c) : !1
},
c.prototype.flipEnable = function (a) {
var b = this.item;
b.enable = a || (-1 == b.enable ? 1 : -1)
},
c.prototype.deactivate = function (a, c) {
var d = this,
e = d.item.disable.slice(0);
return "flip" == c ? d.flipEnable() : c === !1 ? (d.flipEnable(1), e = []) : c === !0 ? (d.flipEnable(-1), e = []) : c.map(function (a) {
for (var c, g = 0; g < e.length; g += 1)
if (d.isDateExact(a, e[g])) {
c = !0;
break
}
c || (f.isInteger(a) || f.isDate(a) || b.isArray(a) || b.isPlainObject(a) && a.from && a.to) && e.push(a)
}),
e
},
c.prototype.activate = function (a, c) {
var d = this,
e = d.item.disable,
g = e.length;
return "flip" == c ? d.flipEnable() : c === !0 ? (d.flipEnable(1), e = []) : c === !1 ? (d.flipEnable(-1), e = []) : c.map(function (a) {
var c,
h,
i,
j;
for (i = 0; g > i; i += 1) {
if (h = e[i], d.isDateExact(h, a)) {
c = e[i] = null,
j = !0;
break
}
if (d.isDateOverlap(h, a)) {
b.isPlainObject(a) ? (a.inverted = !0, c = a) : b.isArray(a) ? (c = a, c[3] || c.push("inverted")) : f.isDate(a) && (c = [a.getFullYear(), a.getMonth(), a.getDate(), "inverted"]);
break
}
}
if (c)
for (i = 0; g > i; i += 1)
if (d.isDateExact(e[i], a)) {
e[i] = null;
break
}
if (j)
for (i = 0; g > i; i += 1)
if (d.isDateOverlap(e[i], a)) {
e[i] = null;
break
}
c && e.push(c)
}),
e.filter(function (a) {
return null != a
})
},
c.prototype.nodes = function (a) {
var b = this,
c = b.settings,
g = b.item,
h = g.now,
i = g.select,
j = g.highlight,
k = g.view,
l = g.disable,
m = g.min,
n = g.max,
o = function (a, b) {
return c.firstDay && (a.push(a.shift()), b.push(b.shift())),
f.node("thead", f.node("tr", f.group({
min: 0,
max: d - 1,
i: 1,
node: "th",
item: function (d) {
return [a[d], c.klass.weekdays, 'scope=col title="' + b[d] + '"']
}
})))
}
((c.showWeekdaysFull ? c.weekdaysFull : c.weekdaysShort).slice(0), c.weekdaysFull.slice(0)),
p = function (a) {
return f.node("div", " ", c.klass["nav" + (a ? "Next" : "Prev")] + (a && k.year >= n.year && k.month >= n.month || !a && k.year <= m.year && k.month <= m.month ? " " + c.klass.navDisabled : ""), "data-nav=" + (a || -1) + " " + f.ariaAttr({
role: "button",
controls: b.$node[0].id + "_table"
}) + ' title="' + (a ? c.labelMonthNext : c.labelMonthPrev) + '"')
},
q = function () {
var d = c.showMonthsShort ? c.monthsShort : c.monthsFull;
return c.selectMonths ? f.node("select", f.group({
min: 0,
max: 11,
i: 1,
node: "option",
item: function (a) {
return [d[a], 0, "value=" + a + (k.month == a ? " selected" : "") + (k.year == m.year && a < m.month || k.year == n.year && a > n.month ? " disabled" : "")]
}
}), c.klass.selectMonth, (a ? "" : "disabled") + " " + f.ariaAttr({
controls: b.$node[0].id + "_table"
}) + ' title="' + c.labelMonthSelect + '"') : f.node("div", d[k.month], c.klass.month)
},
r = function () {
var d = k.year,
e = c.selectYears === !0 ? 5 : ~~(c.selectYears / 2);
if (e) {
var g = m.year,
h = n.year,
i = d - e,
j = d + e;
if (g > i && (j += g - i, i = g), j > h) {
var l = i - g,
o = j - h;
i -= l > o ? o : l,
j = h
}
return f.node("select", f.group({
min: i,
max: j,
i: 1,
node: "option",
item: function (a) {
return [a, 0, "value=" + a + (d == a ? " selected" : "")]
}
}), c.klass.selectYear, (a ? "" : "disabled") + " " + f.ariaAttr({
controls: b.$node[0].id + "_table"
}) + ' title="' + c.labelYearSelect + '"')
}
return f.node("div", d, c.klass.year)
};
return f.node("div", (c.selectYears ? r() + q() : q() + r()) + p() + p(1), c.klass.header) + f.node("table", o + f.node("tbody", f.group({
min: 0,
max: e - 1,
i: 1,
node: "tr",
item: function (a) {
var e = c.firstDay && 0 === b.create([k.year, k.month, 1]).day ? -7 : 0;
return [f.group({
min: d * a - k.day + e + 1,
max: function () {
return this.min + d - 1
},
i: 1,
node: "td",
item: function (a) {
a = b.create([k.year, k.month, a + (c.firstDay ? 1 : 0)]);
var d = i && i.pick == a.pick,
e = j && j.pick == a.pick,
g = l && b.disabled(a) || a.pick < m.pick || a.pick > n.pick,
o = f.trigger(b.formats.toString, b, [c.format, a]);
return [f.node("div", a.date, function (b) {
return b.push(k.month == a.month ? c.klass.infocus : c.klass.outfocus),
h.pick == a.pick && b.push(c.klass.now),
d && b.push(c.klass.selected),
e && b.push(c.klass.highlighted),
g && b.push(c.klass.disabled),
b.join(" ")
}
([c.klass.day]), "data-pick=" + a.pick + " " + f.ariaAttr({
role: "gridcell",
label: o,
selected: d && b.$node.val() === o ? !0 : null,
activedescendant: e ? !0 : null,
disabled: g ? !0 : null
})), "", f.ariaAttr({
role: "presentation"
})]
}
})]
}
})), c.klass.table, 'id="' + b.$node[0].id + '_table" ' + f.ariaAttr({
role: "grid",
controls: b.$node[0].id,
readonly: !0
})) + f.node("div", f.node("button", c.today, c.klass.buttonToday, "type=button data-pick=" + h.pick + (a && !b.disabled(h) ? "" : " disabled") + " " + f.ariaAttr({
controls: b.$node[0].id
})) + f.node("button", c.clear, c.klass.buttonClear, "type=button data-clear=1" + (a ? "" : " disabled") + " " + f.ariaAttr({
controls: b.$node[0].id
})) + f.node("button", c.close, c.klass.buttonClose, "type=button data-close=true " + (a ? "" : " disabled") + " " + f.ariaAttr({
controls: b.$node[0].id
})), c.klass.footer)
},
c.defaults = function (a) {
return {
labelMonthNext: "Next month",
labelMonthPrev: "Previous month",
labelMonthSelect: "Select a month",
labelYearSelect: "Select a year",
monthsFull: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
weekdaysFull: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
weekdaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
today: "Today",
clear: "Clear",
close: "Close",
closeOnSelect: !0,
closeOnClear: !0,
format: "d mmmm, yyyy",
klass: {
table: a + "table",
header: a + "header",
navPrev: a + "nav--prev",
navNext: a + "nav--next",
navDisabled: a + "nav--disabled",
month: a + "month",
year: a + "year",
selectMonth: a + "select--month",
selectYear: a + "select--year",
weekdays: a + "weekday",
day: a + "day",
disabled: a + "day--disabled",
selected: a + "day--selected",
highlighted: a + "day--highlighted",
now: a + "day--today",
infocus: a + "day--infocus",
outfocus: a + "day--outfocus",
footer: a + "footer",
buttonClear: a + "button--clear",
buttonToday: a + "button--today",
buttonClose: a + "button--close"
}
}
}
(a.klasses().picker + "__"),
a.extend("pickadate", c)
});
!function (a) {
"function" == typeof define && define.amd ? define(["jquery"], function (b) {
a(b, window, document)
}) : "object" == typeof module && module.exports ? module.exports = a(require("jquery"), window, document) : a(jQuery, window, document)
}
(function (a, b, c, d) {
"use strict";
function e(b, c) {
this.a = b,
c && (a.extend(c, c, {
a: c.autoFormat,
h: c.autoHideDialCode,
d: c.defaultCountry,
i: c.ipinfoToken,
n: c.nationalMode,
t: c.numberType,
o: c.onlyCountries,
p: c.preferredCountries,
v: c.preventInvalidNumbers,
u: c.utilsScript
})),
this.b = a.extend({}, h, c),
this.c = h,
this.ns = "." + f + g++,
this.d = Boolean(b.setSelectionRange),
this.e = Boolean(a(b).attr("placeholder")),
this.f = f
}
var f = "intlTelInput",
g = 1,
h = {
allowExtensions: !1,
a: !0,
h: !0,
autoPlaceholder: !0,
d: "",
dropdownContainer: !1,
excludeCountries: [],
geoIpLookup: null,
n: !0,
t: "MOBILE",
o: [],
p: ["us", "gb"],
u: ""
},
i = {
b: 38,
c: 40,
d: 13,
e: 27,
f: 43,
A: 65,
Z: 90,
g: 48,
h: 57,
i: 32,
Bi: 8,
TAB: 9,
k: 46,
l: 17,
m: 91,
n: 224
},
j = !1;
a(b).load(function () {
j = !0
}),
e.prototype = {
_init: function () {
return this.b.n && (this.b.h = !1),
navigator.userAgent.match(/IEMobile/i) && (this.b.a = !1),
this.isMobile = /Android.+Mobile|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
this.autoCountryDeferred = new a.Deferred,
this.utilsScriptDeferred = new a.Deferred,
this._b(),
this._f(),
this._h(),
this._i(),
this._initRequests(),
[this.autoCountryDeferred, this.utilsScriptDeferred]
},
_b: function () {
this._d(),
this._e()
},
_c: function (a, b, c) {
b in this.m || (this.m[b] = []);
var d = c || 0;
this.m[b][d] = a
},
processCountries: function (b, c) {
var d;
for (d = 0; d < b.length; d++)
b[d] = b[d].toLowerCase();
for (this.l = [], d = 0; d < k.length; d++)
c(a.inArray(k[d].iso2, b)) && this.l.push(k[d])
},
_d: function () {
this.b.o.length ? this.processCountries(this.b.o, function (a) {
return -1 != a
}) : this.b.excludeCountries.length ? this.processCountries(this.b.excludeCountries, function (a) {
return -1 == a
}) : this.l = k,
this.m = {};
for (var a = 0; a < this.l.length; a++) {
var b = this.l[a];
if (this._c(b.iso2, b.dialCode, b.priority), b.areaCodes)
for (var c = 0; c < b.areaCodes.length; c++)
this._c(b.iso2, b.dialCode + b.areaCodes[c])
}
},
_e: function () {
this.n = [];
for (var a = 0; a < this.b.p.length; a++) {
var b = this.b.p[a].toLowerCase(),
c = this._y(b, !1, !0);
c && this.n.push(c)
}
},
_f: function () {
this.g = a(this.a),
this.g.attr("autocomplete", "off"),
this.g.wrap(a("<div>", {
"class": "intl-tel-input"
})),
this.flagsContainer = a("<div>", {
"class": "flag-container"
}).insertBefore(this.g);
var b = a("<div>", {
tabindex: "0",
"class": "selected-flag"
}).appendTo(this.flagsContainer);
this.h = a("<div>", {
"class": "iti-flag"
}).appendTo(b),
a("<div>", {
"class": "arrow"
}).appendTo(b),
this.isMobile ? this.i = a("<select>", {
"class": "iti-mobile-select"
}).appendTo(this.flagsContainer) : (this.i = a("<ul>", {
"class": "country-list hide"
}), this.n.length && !this.isMobile && (this._g(this.n, "preferred"), a("<li>", {
"class": "divider"
}).appendTo(this.i))),
this._g(this.l, ""),
this.isMobile || (this.k = this.i.children(".country"), this.b.dropdownContainer ? this.dropdown = a("<div>", {
"class": "intl-tel-input iti-container"
}).append(this.i) : this.i.appendTo(this.flagsContainer))
},
_g: function (a, b) {
for (var c = "", d = 0; d < a.length; d++) {
var e = a[d];
this.isMobile ? (c += "<option data-dial-code='" + e.dialCode + "' value='" + e.iso2 + "'>", c += e.name + " +" + e.dialCode, c += "</option>") : (c += "<li class='country " + b + "' data-dial-code='" + e.dialCode + "' data-country-code='" + e.iso2 + "'>", c += "<div class='flag'><div class='iti-flag " + e.iso2 + "'></div></div>", c += "<span class='country-name'>" + e.name + "</span>", c += "<span class='dial-code'>+" + e.dialCode + "</span>", c += "</li>")
}
this.i.append(c)
},
_h: function () {
var a = this.g.val();
this._af(a) ? this._v(a, !0) : "auto" != this.b.d && (this.b.d = this.b.d ? this._y(this.b.d.toLowerCase(), !1, !1) : this.n.length ? this.n[0] : this.l[0], this._z(this.b.d.iso2), a || this._ae(this.b.d.dialCode, !1)),
a && this._u(a)
},
_i: function () {
var b = this;
if (this._j(), (this.b.h || this.b.a) && this._l(), this.isMobile)
this.i.on("change" + this.ns, function () {
b._ab(a(this).find("option:selected"))
});
else {
var c = this.g.closest("label");
c.length && c.on("click" + this.ns, function (a) {
b.i.hasClass("hide") ? b.g.focus() : a.preventDefault()
});
var d = this.h.parent();
d.on("click" + this.ns, function () {
!b.i.hasClass("hide") || b.g.prop("disabled") || b.g.prop("readonly") || b._n()
})
}
this.flagsContainer.on("keydown" + b.ns, function (a) {
var c = b.i.hasClass("hide");
!c || a.which != i.b && a.which != i.c && a.which != i.i && a.which != i.d || (a.preventDefault(), a.stopPropagation(), b._n()),
a.which == i.TAB && b._ac()
})
},
_initRequests: function () {
var c = this;
this.b.u ? j ? this.loadUtils() : a(b).load(function () {
c.loadUtils()
}) : this.utilsScriptDeferred.resolve(),
"auto" == this.b.d ? this._loadAutoCountry() : this.autoCountryDeferred.resolve()
},
_loadAutoCountry: function () {
var b = a.cookie ? a.cookie("itiAutoCountry") : "";
b && (a.fn[f].autoCountry = b),
a.fn[f].autoCountry ? this.autoCountryLoaded() : a.fn[f].startedLoadingAutoCountry || (a.fn[f].startedLoadingAutoCountry = !0, "function" == typeof this.b.geoIpLookup && this.b.geoIpLookup(function (b) {
a.fn[f].autoCountry = b.toLowerCase(),
a.cookie && a.cookie("itiAutoCountry", a.fn[f].autoCountry, {
path: "/"
}),
setTimeout(function () {
a(".intl-tel-input input").intlTelInput("autoCountryLoaded")
})
}))
},
_j: function () {
var a = this;
this.b.a && this.g.on("keypress" + this.ns, function (c) {
if (c.which >= i.i && !c.ctrlKey && !c.metaKey && b.intlTelInputUtils && !a.g.prop("readonly")) {
c.preventDefault();
var d = c.which >= i.g && c.which <= i.h || c.which == i.f,
e = a.g[0],
f = a.d && e.selectionStart == e.selectionEnd,
g = a.g.attr("maxlength"),
h = a.g.val(),
j = g ? h.length < g : !0;
if (j && (d || f)) {
var k = d ? String.fromCharCode(c.which) : null;
a._k(k, !0, d),
h != a.g.val() && a.g.trigger("input")
}
d || a._handleInvalidKey()
}
}),
this.g.on("cut" + this.ns + " paste" + this.ns, function () {
setTimeout(function () {
if (a.b.a && b.intlTelInputUtils) {
var c = a.d && a.g[0].selectionStart == a.g.val().length;
a._k(null, c),
a._ensurePlus()
} else
a._v(a.g.val())
})
}),
this.g.on("keyup" + this.ns, function (c) {
if (c.which == i.d || a.g.prop("readonly"));
else if (a.b.a && b.intlTelInputUtils) {
var d = a.d && a.g[0].selectionStart == a.g.val().length;
a.g.val() ? (c.which == i.k && !d || c.which == i.Bi) && a._k() : a._v(""),
a._ensurePlus()
} else
a._v(a.g.val())
})
},
_ensurePlus: function () {
if (!this.b.n) {
var a = this.g.val(),
b = this.g[0];
if ("+" != a.charAt(0)) {
var c = this.d ? b.selectionStart + 1 : 0;
this.g.val("+" + a),
this.d && b.setSelectionRange(c, c)
}
}
},
_handleInvalidKey: function () {
var a = this;
this.g.trigger("invalidkey").addClass("iti-invalid-key"),
setTimeout(function () {
a.g.removeClass("iti-invalid-key")
}, 100)
},
_k: function (a, b, c) {
var d,
e = this.g.val(),
f = (this._getClean(e), this.g[0]),
g = 0;
if (this.d ? (g = this._getDigitsOnRight(e, f.selectionEnd), a ? e = e.substr(0, f.selectionStart) + a + e.substring(f.selectionEnd, e.length) : d = e.substr(f.selectionStart - 2, 2)) : a && (e += a), this.setNumber(e, null, b, !0, c), this.d) {
var h;
e = this.g.val(),
g ? (h = this._getCursorFromDigitsOnRight(e, g), a || (h = this._getCursorFromLeftChar(e, h, d))) : h = e.length,
f.setSelectionRange(h, h)
}
},
_getCursorFromLeftChar: function (b, c, d) {
for (var e = c; e > 0; e--) {
var f = b.charAt(e - 1);
if (a.isNumeric(f) || b.substr(e - 2, 2) == d)
return e
}
return 0
},
_getCursorFromDigitsOnRight: function (b, c) {
for (var d = b.length - 1; d >= 0; d--)
if (a.isNumeric(b.charAt(d)) && 0 === --c)
return d;
return 0
},
_getDigitsOnRight: function (b, c) {
for (var d = 0, e = c; e < b.length; e++)
a.isNumeric(b.charAt(e)) && d++;
return d
},
_l: function () {
var a = this;
this.b.h && this.g.on("mousedown" + this.ns, function (b) {
a.g.is(":focus") || a.g.val() || (b.preventDefault(), a.g.focus())
}),
this.g.on("focus" + this.ns, function () {
var c = a.g.val();
a.g.data("focusVal", c),
a.b.h && !c && !a.g.prop("readonly") && a.o.dialCode && (a._u("+" + a.o.dialCode, null, !0), a.g.one("keypress.plus" + a.ns, function (c) {
if (c.which == i.f) {
var d = a.b.a && b.intlTelInputUtils ? "+" : "";
a.g.val(d)
}
}), setTimeout(function () {
var b = a.g[0];
if (a.d) {
var c = a.g.val().length;
b.setSelectionRange(c, c)
}
}))
}),
this.g.on("blur" + this.ns, function () {
if (a.b.h) {
var c = a.g.val(),
d = "+" == c.charAt(0);
if (d) {
var e = a._m(c);
e && a.o.dialCode != e || a.g.val("")
}
a.g.off("keypress.plus" + a.ns)
}
a.b.a && b.intlTelInputUtils && a.g.val() != a.g.data("focusVal") && a.g.trigger("change")
})
},
_m: function (a) {
return a.replace(/\D/g, "")
},
_getClean: function (a) {
var b = "+" == a.charAt(0) ? "+" : "";
return b + this._m(a)
},
_n: function () {
this._o();
var a = this.i.children(".active");
a.length && this._x(a),
a.length && this._ad(a),
this._p(),
this.h.children(".arrow").addClass("up")
},
_o: function () {
var c = this.b.dropdownContainer && !this.isMobile;
c && this.dropdown.appendTo(this.b.dropdownContainer),
this.j = this.i.removeClass("hide").outerHeight();
var d = this,
e = this.g.offset(),
f = e.top,
g = a(b).scrollTop(),
h = f + this.g.outerHeight() + this.j < g + a(b).height(),
i = f - this.j > g;
if (this.i.toggleClass("dropup", !h && i), c) {
var j = !h && i ? 0 : this.g.innerHeight();
this.dropdown.css({
top: f + j,
left: e.left
}),
a(b).on("scroll" + this.ns, function () {
d._ac()
})
}
},
_p: function () {
var b = this;
this.i.on("mouseover" + this.ns, ".country", function () {
b._x(a(this))
}),
this.i.on("click" + this.ns, ".country", function () {
b._ab(a(this))
});
var d = !0;
a("html").on("click" + this.ns, function () {
d || b._ac(),
d = !1
});
var e = "",
f = null;
a(c).on("keydown" + this.ns, function (a) {
a.preventDefault(),
a.which == i.b || a.which == i.c ? b._q(a.which) : a.which == i.d ? b._r() : a.which == i.e ? b._ac() : (a.which >= i.A && a.which <= i.Z || a.which == i.i) && (f && clearTimeout(f), e += String.fromCharCode(a.which), b._s(e), f = setTimeout(function () {
e = ""
}, 1e3))
})
},
_q: function (a) {
var b = this.i.children(".highlight").first(),
c = a == i.b ? b.prev() : b.next();
c.length && (c.hasClass("divider") && (c = a == i.b ? c.prev() : c.next()), this._x(c), this._ad(c))
},
_r: function () {
var a = this.i.children(".highlight").first();
a.length && this._ab(a)
},
_s: function (a) {
for (var b = 0; b < this.l.length; b++)
if (this._t(this.l[b].name, a)) {
var c = this.i.children("[data-country-code=" + this.l[b].iso2 + "]").not(".preferred");
this._x(c),
this._ad(c, !0);
break
}
},
_t: function (a, b) {
return a.substr(0, b.length).toUpperCase() == b
},
_u: function (a, c, d, e, f) {
var g;
if (this.b.a && b.intlTelInputUtils && this.o) {
g = "number" == typeof c && intlTelInputUtils.isValidNumber(a, this.o.iso2) ? intlTelInputUtils.formatNumberByType(a, this.o.iso2, c) : !e && this.b.n && "+" == a.charAt(0) && intlTelInputUtils.isValidNumber(a, this.o.iso2) ? intlTelInputUtils.formatNumberByType(a, this.o.iso2, intlTelInputUtils.numberFormat.NATIONAL) : intlTelInputUtils.formatNumber(a, this.o.iso2, d, this.b.allowExtensions, f);
var h = this.g.attr("maxlength");
h && g.length > h && (g = g.substr(0, h))
} else
g = a;
this.g.val(g)
},
_v: function (b, c) {
b && this.b.n && this.o && "1" == this.o.dialCode && "+" != b.charAt(0) && ("1" != b.charAt(0) && (b = "1" + b), b = "+" + b);
var d = this._af(b),
e = null;
if (d) {
var f = this.m[this._m(d)],
g = this.o && -1 != a.inArray(this.o.iso2, f);
if (!g || this._w(b, d))
for (var h = 0; h < f.length; h++)
if (f[h]) {
e = f[h];
break
}
} else
"+" == b.charAt(0) && this._m(b).length ? e = "" : b && "+" != b || (e = this.b.d.iso2);
null !== e && this._z(e, c)
},
_w: function (a, b) {
return "+1" == b && this._m(a).length >= 4
},
_x: function (a) {
this.k.removeClass("highlight"),
a.addClass("highlight")
},
_y: function (a, b, c) {
for (var d = b ? k : this.l, e = 0; e < d.length; e++)
if (d[e].iso2 == a)
return d[e];
if (c)
return null;
throw new Error("No country data for '" + a + "'")
},
_z: function (a, b) {
this.o = a ? this._y(a, !1, !1) : {},
b && this.o.iso2 && (this.b.d = {
iso2: this.o.iso2
}),
this.h.attr("class", "iti-flag " + a);
var c = a ? this.o.name + ": +" + this.o.dialCode : "Unknown";
this.h.parent().attr("title", c),
this._aa(),
this.isMobile ? this.i.val(a) : (this.k.removeClass("active"), a && this.k.find(".iti-flag." + a).first().closest(".country").addClass("active"))
},
_aa: function () {
if (b.intlTelInputUtils && !this.e && this.b.autoPlaceholder && this.o) {
var a = this.o.iso2,
c = intlTelInputUtils.numberType[this.b.t || "FIXED_LINE"],
d = a ? intlTelInputUtils.getExampleNumber(a, this.b.n, c) : "";
"function" == typeof this.b.customPlaceholder && (d = this.b.customPlaceholder(d, this.o)),
this.g.attr("placeholder", d)
}
},
_ab: function (a) {
var b = this.isMobile ? "value" : "data-country-code";
if (this._z(a.attr(b), !0), this.isMobile || this._ac(), this._ae(a.attr("data-dial-code"), !0), this.g.trigger("change"), this.g.focus(), this.d) {
var c = this.g.val().length;
this.g[0].setSelectionRange(c, c)
}
},
_ac: function () {
this.i.addClass("hide"),
this.h.children(".arrow").removeClass("up"),
a(c).off(this.ns),
a("html").off(this.ns),
this.i.off(this.ns),
this.b.dropdownContainer && !this.isMobile && (a(b).off("scroll" + this.ns), this.dropdown.detach())
},
_ad: function (a, b) {
var c = this.i,
d = c.height(),
e = c.offset().top,
f = e + d,
g = a.outerHeight(),
h = a.offset().top,
i = h + g,
j = h - e + c.scrollTop(),
k = d / 2 - g / 2;
if (e > h)
b && (j -= k), c.scrollTop(j);
else if (i > f) {
b && (j += k);
var l = d - g;
c.scrollTop(j - l)
}
},
_ae: function (b, c) {
var d,
e = this.g.val();
if (b = "+" + b, this.b.n && "+" != e.charAt(0))
d = e;
else if (e) {
var f = this._af(e);
if (f.length > 1)
d = e.replace(f, b);
else {
var g = "+" != e.charAt(0) ? a.trim(e) : "";
d = b + g
}
} else
d = !this.b.h || c ? b : "";
this._u(d, null, c)
},
_af: function (b) {
var c = "";
if ("+" == b.charAt(0))
for (var d = "", e = 0; e < b.length; e++) {
var f = b.charAt(e);
if (a.isNumeric(f) && (d += f, this.m[d] && (c = b.substr(0, e + 1)), 4 == d.length))
break
}
return c
},
autoCountryLoaded: function () {
"auto" == this.b.d && (this.b.d = a.fn[f].autoCountry, this._h(), this.autoCountryDeferred.resolve())
},
destroy: function () {
this.isMobile || this._ac(),
this.g.off(this.ns),
this.isMobile ? this.i.off(this.ns) : (this.h.parent().off(this.ns), this.g.closest("label").off(this.ns));
var a = this.g.parent();
a.before(this.g).remove()
},
getExtension: function () {
return this.g.val().split(" ext. ")[1] || ""
},
getNumber: function (a) {
return b.intlTelInputUtils ? intlTelInputUtils.formatNumberByType(this.g.val(), this.o.iso2, a) : ""
},
getNumberType: function () {
return b.intlTelInputUtils ? intlTelInputUtils.getNumberType(this.g.val(), this.o.iso2) : -99
},
getSelectedCountryData: function () {
return this.o || {}
},
getValidationError: function () {
return b.intlTelInputUtils ? intlTelInputUtils.getValidationError(this.g.val(), this.o.iso2) : -99
},
isValidNumber: function () {
var c = a.trim(this.g.val()),
d = this.b.n ? this.o.iso2 : "";
return b.intlTelInputUtils ? intlTelInputUtils.isValidNumber(c, d) : !1
},
loadUtils: function (b) {
var c = b || this.b.u;
c ? a.fn[f].loadedUtilsScript || (a.fn[f].loadedUtilsScript = !0, a.ajax({
url: c,
complete: function () {
a(".intl-tel-input input").intlTelInput("utilsRequestComplete")
},
dataType: "script",
cache: !0
})) : this.utilsScriptDeferred.resolve()
},
selectCountry: function (a) {
a = a.toLowerCase(),
this.h.hasClass(a) || (this._z(a, !0), this._ae(this.o.dialCode, !1))
},
setNumber: function (a, b, c, d, e) {
this.b.n || "+" == a.charAt(0) || (a = "+" + a),
this._v(a),
this._u(a, b, c, d, e)
},
utilsRequestComplete: function () {
b.intlTelInputUtils && (this.b.a && this.g.val() && this._u(this.g.val()), this._aa()),
this.utilsScriptDeferred.resolve()
}
},
a.fn[f] = function (b) {
var c = arguments;
if (b === d || "object" == typeof b) {
var g = [];
return this.each(function () {
if (!a.data(this, "plugin_" + f)) {
var c = new e(this, b),
d = c._init();
g.push(d[0]),
g.push(d[1]),
a.data(this, "plugin_" + f, c)
}
}),
a.when.apply(null, g)
}
if ("string" == typeof b && "_" !== b[0]) {
var h;
return this.each(function () {
var d = a.data(this, "plugin_" + f);
d instanceof e && "function" == typeof d[b] && (h = d[b].apply(d, Array.prototype.slice.call(c, 1))),
"destroy" === b && a.data(this, "plugin_" + f, null)
}),
h !== d ? h : this
}
},
a.fn[f].getCountryData = function () {
return k
},
a.fn[f].version = "6.4.1";
for (var k = [["Afghanistan (‫افغانستان‬‎)", "af", "93"], ["Albania (Shqipëri)", "al", "355"], ["Algeria (‫الجزائر‬‎)", "dz", "213"], ["American Samoa", "as", "1684"], ["Andorra", "ad", "376"], ["Angola", "ao", "244"], ["Anguilla", "ai", "1264"], ["Antigua and Barbuda", "ag", "1268"], ["Argentina", "ar", "54"], ["Armenia (Հայաստան)", "am", "374"], ["Aruba", "aw", "297"], ["Australia", "au", "61", 0], ["Austria (Österreich)", "at", "43"], ["Azerbaijan (Azərbaycan)", "az", "994"], ["Bahamas", "bs", "1242"], ["Bahrain (‫البحرين‬‎)", "bh", "973"], ["Bangladesh (বাংলাদেশ)", "bd", "880"], ["Barbados", "bb", "1246"], ["Belarus (Беларусь)", "by", "375"], ["Belgium (België)", "be", "32"], ["Belize", "bz", "501"], ["Benin (Bénin)", "bj", "229"], ["Bermuda", "bm", "1441"], ["Bhutan (འབྲུག)", "bt", "975"], ["Bolivia", "bo", "591"], ["Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387"], ["Botswana", "bw", "267"], ["Brazil (Brasil)", "br", "55"], ["British Indian Ocean Territory", "io", "246"], ["British Virgin Islands", "vg", "1284"], ["Brunei", "bn", "673"], ["Bulgaria (България)", "bg", "359"], ["Burkina Faso", "bf", "226"], ["Burundi (Uburundi)", "bi", "257"], ["Cambodia (កម្ពុជា)", "kh", "855"], ["Cameroon (Cameroun)", "cm", "237"], ["Canada", "ca", "1", 1, ["204", "226", "236", "249", "250", "289", "306", "343", "365", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]], ["Cape Verde (Kabu Verdi)", "cv", "238"], ["Caribbean Netherlands", "bq", "599", 1], ["Cayman Islands", "ky", "1345"], ["Central African Republic (République centrafricaine)", "cf", "236"], ["Chad (Tchad)", "td", "235"], ["Chile", "cl", "56"], ["China (中国)", "cn", "86"], ["Christmas Island", "cx", "61", 2], ["Cocos (Keeling) Islands", "cc", "61", 1], ["Colombia", "co", "57"], ["Comoros (‫جزر القمر‬‎)", "km", "269"], ["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "cd", "243"], ["Congo (Republic) (Congo-Brazzaville)", "cg", "242"], ["Cook Islands", "ck", "682"], ["Costa Rica", "cr", "506"], ["Côte d’Ivoire", "ci", "225"], ["Croatia (Hrvatska)", "hr", "385"], ["Cuba", "cu", "53"], ["Curaçao", "cw", "599", 0], ["Cyprus (Κύπρος)", "cy", "357"], ["Czech Republic (Česká republika)", "cz", "420"], ["Denmark (Danmark)", "dk", "45"], ["Djibouti", "dj", "253"], ["Dominica", "dm", "1767"], ["Dominican Republic (República Dominicana)", "do", "1", 2, ["809", "829", "849"]], ["Ecuador", "ec", "593"], ["Egypt (‫مصر‬‎)", "eg", "20"], ["El Salvador", "sv", "503"], ["Equatorial Guinea (Guinea Ecuatorial)", "gq", "240"], ["Eritrea", "er", "291"], ["Estonia (Eesti)", "ee", "372"], ["Ethiopia", "et", "251"], ["Falkland Islands (Islas Malvinas)", "fk", "500"], ["Faroe Islands (Føroyar)", "fo", "298"], ["Fiji", "fj", "679"], ["Finland (Suomi)", "fi", "358", 0], ["France", "fr", "33"], ["French Guiana (Guyane française)", "gf", "594"], ["French Polynesia (Polynésie française)", "pf", "689"], ["Gabon", "ga", "241"], ["Gambia", "gm", "220"], ["Georgia (საქართველო)", "ge", "995"], ["Germany (Deutschland)", "de", "49"], ["Ghana (Gaana)", "gh", "233"], ["Gibraltar", "gi", "350"], ["Greece (Ελλάδα)", "gr", "30"], ["Greenland (Kalaallit Nunaat)", "gl", "299"], ["Grenada", "gd", "1473"], ["Guadeloupe", "gp", "590", 0], ["Guam", "gu", "1671"], ["Guatemala", "gt", "502"], ["Guernsey", "gg", "44", 1], ["Guinea (Guinée)", "gn", "224"], ["Guinea-Bissau (Guiné Bissau)", "gw", "245"], ["Guyana", "gy", "592"], ["Haiti", "ht", "509"], ["Honduras", "hn", "504"], ["Hong Kong (香港)", "hk", "852"], ["Hungary (Magyarország)", "hu", "36"], ["Iceland (Ísland)", "is", "354"], ["India (भारत)", "in", "91"], ["Indonesia", "id", "62"], ["Iran (‫ایران‬‎)", "ir", "98"], ["Iraq (‫العراق‬‎)", "iq", "964"], ["Ireland", "ie", "353"], ["Isle of Man", "im", "44", 2], ["Israel (‫ישראל‬‎)", "il", "972"], ["Italy (Italia)", "it", "39", 0], ["Jamaica", "jm", "1876"], ["Japan (日本)", "jp", "81"], ["Jersey", "je", "44", 3], ["Jordan (‫الأردن‬‎)", "jo", "962"], ["Kazakhstan (Казахстан)", "kz", "7", 1], ["Kenya", "ke", "254"], ["Kiribati", "ki", "686"], ["Kuwait (‫الكويت‬‎)", "kw", "965"], ["Kyrgyzstan (Кыргызстан)", "kg", "996"], ["Laos (ລາວ)", "la", "856"], ["Latvia (Latvija)", "lv", "371"], ["Lebanon (‫لبنان‬‎)", "lb", "961"], ["Lesotho", "ls", "266"], ["Liberia", "lr", "231"], ["Libya (‫ليبيا‬‎)", "ly", "218"], ["Liechtenstein", "li", "423"], ["Lithuania (Lietuva)", "lt", "370"], ["Luxembourg", "lu", "352"], ["Macau (澳門)", "mo", "853"], ["Macedonia (FYROM) (Македонија)", "mk", "389"], ["Madagascar (Madagasikara)", "mg", "261"], ["Malawi", "mw", "265"], ["Malaysia", "my", "60"], ["Maldives", "mv", "960"], ["Mali", "ml", "223"], ["Malta", "mt", "356"], ["Marshall Islands", "mh", "692"], ["Martinique", "mq", "596"], ["Mauritania (‫موريتانيا‬‎)", "mr", "222"], ["Mauritius (Moris)", "mu", "230"], ["Mayotte", "yt", "262", 1], ["Mexico (México)", "mx", "52"], ["Micronesia", "fm", "691"], ["Moldova (Republica Moldova)", "md", "373"], ["Monaco", "mc", "377"], ["Mongolia (Монгол)", "mn", "976"], ["Montenegro (Crna Gora)", "me", "382"], ["Montserrat", "ms", "1664"], ["Morocco (‫المغرب‬‎)", "ma", "212", 0], ["Mozambique (Moçambique)", "mz", "258"], ["Myanmar (Burma) (မြန်မာ)", "mm", "95"], ["Namibia (Namibië)", "na", "264"], ["Nauru", "nr", "674"], ["Nepal (नेपाल)", "np", "977"], ["Netherlands (Nederland)", "nl", "31"], ["New Caledonia (Nouvelle-Calédonie)", "nc", "687"], ["New Zealand", "nz", "64"], ["Nicaragua", "ni", "505"], ["Niger (Nijar)", "ne", "227"], ["Nigeria", "ng", "234"], ["Niue", "nu", "683"], ["Norfolk Island", "nf", "672"], ["North Korea (조선 민주주의 인민 공화국)", "kp", "850"], ["Northern Mariana Islands", "mp", "1670"], ["Norway (Norge)", "no", "47", 0], ["Oman (‫عُمان‬‎)", "om", "968"], ["Pakistan (‫پاکستان‬‎)", "pk", "92"], ["Palau", "pw", "680"], ["Palestine (‫فلسطين‬‎)", "ps", "970"], ["Panama (Panamá)", "pa", "507"], ["Papua New Guinea", "pg", "675"], ["Paraguay", "py", "595"], ["Peru (Perú)", "pe", "51"], ["Philippines", "ph", "63"], ["Poland (Polska)", "pl", "48"], ["Portugal", "pt", "351"], ["Puerto Rico", "pr", "1", 3, ["787", "939"]], ["Qatar (‫قطر‬‎)", "qa", "974"], ["Réunion (La Réunion)", "re", "262", 0], ["Romania (România)", "ro", "40"], ["Russia (Россия)", "ru", "7", 0], ["Rwanda", "rw", "250"], ["Saint Barthélemy (Saint-Barthélemy)", "bl", "590", 1], ["Saint Helena", "sh", "290"], ["Saint Kitts and Nevis", "kn", "1869"], ["Saint Lucia", "lc", "1758"], ["Saint Martin (Saint-Martin (partie française))", "mf", "590", 2], ["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508"], ["Saint Vincent and the Grenadines", "vc", "1784"], ["Samoa", "ws", "685"], ["San Marino", "sm", "378"], ["São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239"], ["Saudi Arabia (‫المملكة العربية السعودية‬‎)", "sa", "966"], ["Senegal (Sénégal)", "sn", "221"], ["Serbia (Србија)", "rs", "381"], ["Seychelles", "sc", "248"], ["Sierra Leone", "sl", "232"], ["Singapore", "sg", "65"], ["Sint Maarten", "sx", "1721"], ["Slovakia (Slovensko)", "sk", "421"], ["Slovenia (Slovenija)", "si", "386"], ["Solomon Islands", "sb", "677"], ["Somalia (Soomaaliya)", "so", "252"], ["South Africa", "za", "27"], ["South Korea (대한민국)", "kr", "82"], ["South Sudan (‫جنوب السودان‬‎)", "ss", "211"], ["Spain (España)", "es", "34"], ["Sri Lanka (ශ්‍රී ලංකාව)", "lk", "94"], ["Sudan (‫السودان‬‎)", "sd", "249"], ["Suriname", "sr", "597"], ["Svalbard and Jan Mayen", "sj", "47", 1], ["Swaziland", "sz", "268"], ["Sweden (Sverige)", "se", "46"], ["Switzerland (Schweiz)", "ch", "41"], ["Syria (‫سوريا‬‎)", "sy", "963"], ["Taiwan (台灣)", "tw", "886"], ["Tajikistan", "tj", "992"], ["Tanzania", "tz", "255"], ["Thailand (ไทย)", "th", "66"], ["Timor-Leste", "tl", "670"], ["Togo", "tg", "228"], ["Tokelau", "tk", "690"], ["Tonga", "to", "676"], ["Trinidad and Tobago", "tt", "1868"], ["Tunisia (‫تونس‬‎)", "tn", "216"], ["Turkey (Türkiye)", "tr", "90"], ["Turkmenistan", "tm", "993"], ["Turks and Caicos Islands", "tc", "1649"], ["Tuvalu", "tv", "688"], ["U.S. Virgin Islands", "vi", "1340"], ["Uganda", "ug", "256"], ["Ukraine (Україна)", "ua", "380"], ["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "ae", "971"], ["United Kingdom", "gb", "44", 0], ["United States", "us", "1", 0], ["Uruguay", "uy", "598"], ["Uzbekistan (Oʻzbekiston)", "uz", "998"], ["Vanuatu", "vu", "678"], ["Vatican City (Città del Vaticano)", "va", "39", 1], ["Venezuela", "ve", "58"], ["Vietnam (Việt Nam)", "vn", "84"], ["Wallis and Futuna", "wf", "681"], ["Western Sahara (‫الصحراء الغربية‬‎)", "eh", "212", 1], ["Yemen (‫اليمن‬‎)", "ye", "967"], ["Zambia", "zm", "260"], ["Zimbabwe", "zw", "263"], ["Åland Islands", "ax", "358", 1]], l = 0; l < k.length; l++) {
var m = k[l];
k[l] = {
name: m[0],
iso2: m[1],
dialCode: m[2],
priority: m[3] || 0,
areaCodes: m[4] || null
}
}
});
(function ($) {
window.bookly = function (Options) {
var $container = $('#bookly-form-' + Options.form_id),
time_zone_offset = (new Date).getTimezoneOffset();
Options.skip_steps.service = Options.skip_steps.service_part1 && Options.skip_steps.service_part2;
if (Options.status.booking == 'finished') {
stepComplete();
} else if (Options.status.booking == 'cancelled') {
stepPayment();
} else {
stepService({
new_chain: true
});
}
function stepService(params) {
if (Options.skip_steps.service) {
if (!Options.skip_steps.extras) {
stepExtras(params)
} else {
stepTime(params);
}
return;
}
var data = $.extend({
action: 'bookly_render_service',
form_id: Options.form_id,
time_zone_offset: time_zone_offset
}, params);
$.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
if (params === undefined) {
scrollTo($container);
}
var $chain_item_draft = $('.bookly-js-chain-item.bookly-js-draft', $container),
$select_location = $('.ab-select-location', $container),
$select_category = $('.ab-select-category', $container),
$select_service = $('.ab-select-service', $container),
$select_employee = $('.ab-select-employee', $container),
$select_nop = $('.ab-select-number-of-persons', $container),
$select_quantity = $('.ab-select-quantity', $container),
$date_from = $('.ab-date-from', $container),
$week_day = $('.bookly-week-day', $container),
$select_time_from = $('.ab-select-time-from', $container),
$select_time_to = $('.ab-select-time-to', $container),
$next_step = $('.bookly-next-step', $container),
$mobile_next_step = $('.ab-mobile-next-step', $container),
$mobile_prev_step = $('.ab-mobile-prev-step', $container),
locations = response.locations,
categories = response.categories,
services = response.services,
staff = response.staff,
chain = response.chain,
last_chain_key = 0,
category_selected = false;
$date_from.pickadate({
formatSubmit: 'yyyy-mm-dd',
format: Options.date_format,
min: response.date_min || true,
max: response.date_max || true,
clear: false,
close: false,
today: BooklyL10n.today,
monthsFull: BooklyL10n.months,
weekdaysFull: BooklyL10n.days,
weekdaysShort: BooklyL10n.daysShort,
labelMonthNext: BooklyL10n.nextMonth,
labelMonthPrev: BooklyL10n.prevMonth,
firstDay: Options.start_of_week,
onSet: function (timestamp) {
if ($.isNumeric(timestamp.select)) {
var date = new Date(timestamp.select);
$('.bookly-week-day[value="' + (date.getDay() + 1) + '"]:not(:checked)', $container).attr('checked', true).trigger('change');
}
}
});
$('.bookly-go-to-cart', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepCart({
from_step: 'service'
});
});
function setSelect($select, data, value) {
$('option:not([value=""])', $select).remove();
var docFragment = document.createDocumentFragment();
function valuesToArray(obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
}
function compare(a, b) {
if (parseInt(a.pos) < parseInt(b.pos))
return -1;
if (parseInt(a.pos) > parseInt(b.pos))
return 1;
return 0;
}
data = valuesToArray(data).sort(compare);
$.each(data, function (key, object) {
var option = document.createElement('option');
option.value = object.id;
option.text = object.name;
docFragment.appendChild(option);
});
$select.append(docFragment);
$select.val(value);
}
function setSelects($chain_item, location_id, category_id, service_id, staff_id) {
var _staff = {},
_services = {},
_categories = {},
_nop = {};
$.each(staff, function (id, staff_member) {
if (!location_id || locations[location_id].staff.hasOwnProperty(id)) {
if (!service_id) {
if (!category_id) {
_staff[id] = staff_member;
} else {
$.each(staff_member.services, function (s_id) {
if (services[s_id].category_id == category_id) {
_staff[id] = staff_member;
return false;
}
});
}
} else if (staff_member.services.hasOwnProperty(service_id)) {
if (staff_member.services[service_id].price != null) {
_staff[id] = {
id: id,
name: staff_member.name + ' (' + staff_member.services[service_id].price + ')',
pos: staff_member.pos
};
} else {
_staff[id] = staff_member;
}
}
}
});
if (!location_id) {
_categories = categories;
$.each(services, function (id, service) {
if (!category_id || service.category_id == category_id) {
if (!staff_id || staff[staff_id].services.hasOwnProperty(id)) {
_services[id] = service;
}
}
});
} else {
var category_ids = [],
service_ids = [];
$.each(locations[location_id].staff, function (st_id) {
$.each(staff[st_id].services, function (s_id) {
category_ids.push(services[s_id].category_id);
service_ids.push(s_id);
});
});
$.each(categories, function (id, category) {
if ($.inArray(parseInt(id), category_ids) > -1) {
_categories[id] = category;
}
});
$.each(services, function (id, service) {
if ($.inArray(id, service_ids) > -1) {
if (!category_id || service.category_id == category_id) {
if (!staff_id || staff[staff_id].services.hasOwnProperty(id)) {
_services[id] = service;
}
}
}
});
}
var nop = $chain_item.find('.ab-select-number-of-persons').val();
var max_capacity = service_id ? (staff_id ? staff[staff_id].services[service_id].capacity : services[service_id].max_capacity) : 1;
for (var i = 1; i <= max_capacity; ++i) {
_nop[i] = {
id: i,
name: i,
pos: i
};
}
if (nop > max_capacity) {
nop = max_capacity;
}
setSelect($chain_item.find('.ab-select-category'), _categories, category_id);
setSelect($chain_item.find('.ab-select-service'), _services, service_id);
setSelect($chain_item.find('.ab-select-employee'), _staff, staff_id);
setSelect($chain_item.find('.ab-select-number-of-persons'), _nop, nop);
}
$container.off('click').off('change');
$container.on('change', '.ab-select-location', function () {
var $chain_item = $(this).closest('.bookly-js-chain-item'),
location_id = this.value,
category_id = $chain_item.find('.ab-select-category').val(),
service_id = $chain_item.find('.ab-select-service').val(),
staff_id = $chain_item.find('.ab-select-employee').val();
if (location_id) {
if (staff_id && !locations[location_id].staff.hasOwnProperty(staff_id)) {
staff_id = '';
}
if (service_id) {
var valid = false;
$.each(locations[location_id].staff, function (id) {
if (staff[id].services.hasOwnProperty(service_id)) {
valid = true;
return false;
}
});
if (!valid) {
service_id = '';
}
}
if (category_id) {
var valid = false;
$.each(locations[location_id].staff, function (id) {
$.each(staff[id].services, function (s_id) {
if (services[s_id].category_id == category_id) {
valid = true;
return false;
}
});
if (valid) {
return false;
}
});
if (!valid) {
category_id = '';
}
}
}
setSelects($chain_item, location_id, category_id, service_id, staff_id);
});
$container.on('change', '.ab-select-category', function () {
var $chain_item = $(this).closest('.bookly-js-chain-item'),
location_id = $chain_item.find('.ab-select-location').val(),
category_id = this.value,
service_id = $chain_item.find('.ab-select-service').val(),
staff_id = $chain_item.find('.ab-select-employee').val();
if (category_id) {
category_selected = true;
if (service_id) {
if (services[service_id].category_id != category_id) {
service_id = '';
}
}
if (staff_id) {
var valid = false;
$.each(staff[staff_id].services, function (id) {
if (services[id].category_id == category_id) {
valid = true;
return false;
}
});
if (!valid) {
staff_id = '';
}
}
} else {
category_selected = false;
}
setSelects($chain_item, location_id, category_id, service_id, staff_id);
});
$container.on('change', '.ab-select-service', function () {
var $chain_item = $(this).closest('.bookly-js-chain-item'),
location_id = $chain_item.find('.ab-select-location').val(),
category_id = category_selected ? $chain_item.find('.ab-select-category').val() : '',
service_id = this.value,
staff_id = $chain_item.find('.ab-select-employee').val();
if (service_id) {
if (staff_id && !staff[staff_id].services.hasOwnProperty(service_id)) {
staff_id = '';
}
}
setSelects($chain_item, location_id, category_id, service_id, staff_id);
if (service_id) {
$chain_item.find('.ab-select-category').val(services[service_id].category_id);
}
});
$container.on('change', '.ab-select-employee', function () {
var $chain_item = $(this).closest('.bookly-js-chain-item'),
location_id = $chain_item.find('.ab-select-location').val(),
category_id = $('.ab-select-category', $chain_item).val(),
service_id = $chain_item.find('.ab-select-service').val(),
staff_id = this.value;
setSelects($chain_item, location_id, category_id, service_id, staff_id);
});
setSelect($select_location, locations);
setSelect($select_category, categories);
setSelect($select_service, services);
setSelect($select_employee, staff);
$select_location.closest('.ab-formGroup').toggle(!Options.attributes.hide_locations);
$select_category.closest('.ab-formGroup').toggle(!Options.attributes.hide_categories);
$select_service.closest('.ab-formGroup').toggle(!(Options.attributes.hide_services && Options.attributes.service_id));
$select_employee.closest('.ab-formGroup').toggle(!Options.attributes.hide_staff_members);
$select_nop.closest('.ab-formGroup').toggle(Options.attributes.show_number_of_persons);
$select_quantity.closest('.ab-formGroup').toggle(!Options.attributes.hide_quantity);
if (Options.attributes.location_id) {
$select_location.val(Options.attributes.location_id).trigger('change');
}
if (Options.attributes.category_id) {
$select_category.val(Options.attributes.category_id).trigger('change');
}
if (Options.attributes.service_id) {
$select_service.val(Options.attributes.service_id).trigger('change');
}
if (Options.attributes.staff_member_id) {
$select_employee.val(Options.attributes.staff_member_id).trigger('change');
}
if (Options.attributes.hide_date) {
$('.ab-available-date', $container).hide();
}
if (Options.attributes.hide_week_days) {
$('.bookly-week-days', $container).hide();
}
if (Options.attributes.hide_time_range) {
$('.ab-time-range', $container).hide();
}
$.each(chain, function (key, chain_item) {
var $chain_item = $chain_item_draft.clone().data('chain_key', key).removeClass('bookly-js-draft').css('display', 'table');
$chain_item_draft.find('select').each(function (i, select) {
$chain_item.find('select:eq(' + i + ')').val(select.value);
});
last_chain_key = key;
if (key == 0) {
$chain_item.find('.bookly-js-actions button[data-action="drop"]').remove();
}
$('.bookly-js-chain-item:last', $container).after($chain_item);
if (chain_item.location_id) {
$('.ab-select-location', $chain_item).val(chain_item.location_id).trigger('change');
}
if (chain_item.service_id) {
$('.ab-select-service', $chain_item).val(chain_item.service_id).trigger('change');
}
if (chain_item.staff_ids.length == 1 && chain_item.staff_ids[0]) {
$('.ab-select-employee', $chain_item).val(chain_item.staff_ids[0]).trigger('change');
}
if (chain_item.number_of_persons > 1) {
$('.ab-select-number-of-persons', $chain_item).val(chain_item.number_of_persons);
}
if (chain_item.quantity > 1) {
$('.ab-select-quantity', $chain_item).val(chain_item.quantity);
}
});
$container.on('click', '.ab-mobile-step_1 .bookly-js-actions button', function () {
switch ($(this).data('action')) {
case 'plus':
var $new_chain = $chain_item_draft.clone();
$chain_item_draft.find('select').each(function (i, select) {
$new_chain.find('select:eq(' + i + ')').val(select.value);
});
$('.bookly-js-chain-item:last', $container).after($new_chain.data('chain_key', ++last_chain_key).removeClass('bookly-js-draft').css('display', 'table'));
break;
case 'drop':
$(this).closest('.bookly-js-chain-item').remove();
break;
}
});
$week_day.on('change', function () {
var $this = $(this);
if ($this.is(':checked')) {
$this.parent().not("[class*='active']").addClass('active');
} else {
$this.parent().removeClass('active');
}
});
$select_time_from.on('change', function () {
var start_time = $(this).val(),
end_time = $select_time_to.val(),
$last_time_entry = $('option:last', $select_time_from);
$select_time_to.empty();
if ($select_time_from[0].selectedIndex < $last_time_entry.index()) {
$('option', this).each(function () {
if ($(this).val() > start_time) {
$select_time_to.append($(this).clone());
}
});
} else {
$select_time_to.append($last_time_entry.clone()).val($last_time_entry.val());
}
var first_value = $('option:first', $select_time_to).val();
$select_time_to.val(end_time >= first_value ? end_time : first_value);
});
var stepServiceValidator = function () {
$('.ab-select-service-error', $container).hide();
$('.ab-select-employee-error', $container).hide();
$('.ab-select-location-error', $container).hide();
var valid = true,
$select_service = null,
$select_employee = null,
$select_location = null,
$scroll_to = null;
$('.bookly-js-chain-item:not(.bookly-js-draft)', $container).each(function () {
var $chain = $(this);
$select_service = $('.ab-select-service', $chain);
$select_employee = $('.ab-select-employee', $chain);
$select_location = $('.ab-select-location', $chain);
$select_service.removeClass('ab-error');
$select_employee.removeClass('ab-error');
$select_location.removeClass('ab-error');
if (!$select_service.val()) {
valid = false;
$select_service.addClass('ab-error');
$('.ab-select-service-error', $chain).show();
$scroll_to = $select_service;
}
if (Options.required.hasOwnProperty('location') && Options.required.location && !$select_location.val()) {
valid = false;
$select_location.addClass('ab-error');
$('.ab-select-location-error', $chain).show();
$scroll_to = $select_location;
}
if (Options.required.staff && !$select_employee.val()) {
valid = false;
$select_employee.addClass('ab-error');
$('.ab-select-employee-error', $chain).show();
$scroll_to = $select_employee;
}
});
$date_from.removeClass('ab-error');
if (!$date_from.val()) {
valid = false;
$date_from.addClass('ab-error');
if ($scroll_to === null) {
$scroll_to = $date_from;
}
}
if (!$('.bookly-week-day:checked', $container).length) {
valid = false;
if ($scroll_to === null) {
$scroll_to = $week_day;
}
}
if ($scroll_to !== null) {
scrollTo($scroll_to);
}
return valid;
};
$next_step.on('click', function (e) {
e.preventDefault();
if (stepServiceValidator()) {
ladda_start(this);
var chain = {};
$('.bookly-js-chain-item:not(.bookly-js-draft)', $container).each(function () {
var $chain_item = $(this);
var staff_ids = [];
if ($('.ab-select-employee', $chain_item).val()) {
staff_ids.push($('.ab-select-employee', $chain_item).val());
} else {
$('.ab-select-employee', $chain_item).find('option').each(function () {
if (this.value) {
staff_ids.push(this.value);
}
});
}
chain[$chain_item.data('chain_key')] = {
location_id: $('.ab-select-location', $chain_item).val(),
service_id: $('.ab-select-service', $chain_item).val(),
staff_ids: staff_ids,
number_of_persons: $('.ab-select-number-of-persons', $chain_item).val(),
quantity: $('.ab-select-quantity', $chain_item).val() ? $('.ab-select-quantity', $chain_item).val() : 1
};
});
var days = [];
$('.bookly-week-days .active input.bookly-week-day', $container).each(function () {
days.push(this.value);
});
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_session_save',
form_id: Options.form_id,
chain: chain,
date_from: $date_from.pickadate('picker').get('select', 'yyyy-mm-dd'),
days: days,
time_from: $select_time_from.val(),
time_to: $select_time_to.val()
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (!Options.skip_steps.extras) {
stepExtras();
} else {
stepTime();
}
}
});
}
});
$mobile_next_step.on('click', function (e, skip_scroll) {
if (stepServiceValidator()) {
if (Options.skip_steps.service_part2) {
ladda_start(this);
$next_step.trigger('click');
} else {
$('.ab-mobile-step_1', $container).hide();
$('.ab-mobile-step_2', $container).css('display', 'block');
if (Options.skip_steps.service) {
$mobile_prev_step.remove();
}
if (skip_scroll != true) {
scrollTo($container);
}
}
}
return false;
});
$mobile_prev_step.on('click', function () {
$('.ab-mobile-step_1', $container).show();
$('.ab-mobile-step_2', $container).hide();
if ($select_service.val()) {
$('.ab-select-service', $container).parent().removeClass('ab-error');
}
return false;
});
if (Options.skip_steps.service_part1) {
$mobile_next_step.trigger('click', [true]);
}
}
}
});
}
function stepExtras(params) {
var data = $.extend({
action: 'bookly_render_extras',
form_id: Options.form_id
}, params);
if (Options.skip_steps.service) {
data.time_zone_offset = time_zone_offset;
}
$.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
if (params === undefined) {
scrollTo($container);
}
var $next_step = $('.bookly-next-step', $container),
$back_step = $('.bookly-back-step', $container),
$goto_cart = $('.bookly-go-to-cart', $container),
$extras_items = $('.bookly-js-extras-item', $container),
$extras_summary = $('.bookly-extras-summary span', $container),
currency = response.currency,
$this,
$input;
$extras_items.each(function (index, elem) {
var $this = $(this);
var $input = $this.find('input');
$this.find('.bookly-js-extras-thumb').on('click', function () {
extras_changed($this, $input.val() > 0 ? 0 : 1);
});
$this.find('.bookly-js-count-control').on('click', function () {
var count = parseInt($input.val());
count = $(this).hasClass('bookly-js-extras-increment') ? Math.min($this.data('max_quantity'), count + 1) : Math.max(0, count - 1);
extras_changed($this, count);
});
});
function extras_changed($extras_item, quantity) {
var $input = $extras_item.find('input');
var $total = $extras_item.find('.bookly-js-extras-total-price');
var total_price = quantity * parseFloat($extras_item.data('price'));
$total.text(currency.format.replace('1', total_price.toFixed(currency.precision)));
$input.val(quantity);
$extras_item.find('.bookly-js-extras-thumb').toggleClass('bookly-extras-selected', quantity > 0);
var amount = 0;
$extras_items.each(function (index, elem) {
var $this = $(this);
amount += parseFloat($this.data('price')) * $this.find('input').val();
});
if (amount) {
$extras_summary.html(' + ' + currency.format.replace('1', amount.toFixed(currency.precision)));
} else {
$extras_summary.html('');
}
}
$goto_cart.on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepCart({
from_step: 'extras'
});
});
$next_step.on('click', function (e) {
e.preventDefault();
ladda_start(this);
var extras = {};
$('.bookly-js-extras-container', $container).each(function () {
var $extras_container = $(this);
var chain_id = $extras_container.data('chain');
var chain_extras = {};
$extras_container.find('.bookly-js-extras-item').each(function (index, elem) {
$this = $(this);
$input = $this.find('input');
if ($input.val() > 0) {
chain_extras[$this.data('id')] = $input.val();
}
});
extras[chain_id] = JSON.stringify(chain_extras);
});
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_session_save',
form_id: Options.form_id,
extras: extras
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
stepTime();
}
});
});
$back_step.on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepService();
}).toggle(!Options.skip_steps.service);
}
}
});
}
var xhr_render_time = null;
function stepTime(params, error_message) {
if (xhr_render_time != null) {
xhr_render_time.abort();
xhr_render_time = null;
}
var data = $.extend({
action: 'bookly_render_time',
form_id: Options.form_id
}, params);
if (Options.skip_steps.service) {
data.time_zone_offset = time_zone_offset;
}
xhr_render_time = $.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success == false) {
stepService();
return;
}
$container.html(response.html);
var $columnizer_wrap = $('.ab-columnizer-wrap', $container),
$columnizer = $('.ab-columnizer', $columnizer_wrap),
$time_next_button = $('.ab-time-next', $container),
$time_prev_button = $('.ab-time-prev', $container),
$current_screen = null,
slot_height = 36,
column_width = 127,
columns = 0,
screen_index = 0,
has_more_slots = response.has_more_slots,
form_hidden = false,
$screens,
slots_per_column,
columns_per_screen,
show_day_per_column = response.day_one_column;
$('.bookly-back-step', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
if (!Options.skip_steps.extras) {
stepExtras();
} else {
stepService();
}
}).toggle(!Options.skip_steps.service || !Options.skip_steps.extras);
$('.bookly-go-to-cart', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepCart({
from_step: 'time'
});
});
if (Options.show_calendar) {
var $input = $('.ab-selected-date', $container);
$input.pickadate({
formatSubmit: 'yyyy-mm-dd',
format: Options.date_format,
min: response.date_min || true,
max: response.date_max || true,
weekdaysFull: BooklyL10n.days,
weekdaysShort: BooklyL10n.daysShort,
monthsFull: BooklyL10n.months,
firstDay: Options.start_of_week,
clear: false,
close: false,
today: false,
disable: response.disabled_days,
closeOnSelect: false,
klass: {
picker: 'picker picker--opened picker--focused'
},
onSet: function (e) {
if (e.select) {
var date = this.get('select', 'yyyy-mm-dd');
if (response.slots[date]) {
$columnizer.html(response.slots[date]).css('left', '0px');
columns = 0;
screen_index = 0;
$current_screen = null;
initSlots();
$time_prev_button.hide();
$time_next_button.toggle($screens.length != 1);
} else {
stepTime({
selected_date: date
});
showSpinner();
}
}
this.open();
},
onClose: function () {
this.open(false);
},
onRender: function () {
var date = new Date(Date.UTC(this.get('view').year, this.get('view').month));
$('.picker__nav--next').on('click', function () {
date.setUTCMonth(date.getUTCMonth() + 1);
stepTime({
selected_date: date.toJSON().substr(0, 10)
});
showSpinner();
});
$('.picker__nav--prev').on('click', function () {
date.setUTCMonth(date.getUTCMonth() - 1);
stepTime({
selected_date: date.toJSON().substr(0, 10)
});
showSpinner();
});
}
});
var date = $input.pickadate('picker').get('select', 'yyyy-mm-dd');
$columnizer.html(response.slots[date]);
} else {
var slots = '';
$.each(response.slots, function (group, group_slots) {
slots += group_slots;
});
$columnizer.html(slots);
}
if (response.has_slots) {
if (error_message) {
$container.find('.ab--holder.ab-label-error').html(error_message);
} else {
$container.find('.ab--holder.ab-label-error').hide();
}
slots_per_column = parseInt($(window).height() / slot_height, 10);
if (slots_per_column < 4) {
slots_per_column = 4;
} else if (slots_per_column > 10) {
slots_per_column = 10;
}
columns_per_screen = parseInt($columnizer_wrap.width() / column_width, 10);
if (columns_per_screen > 10) {
columns_per_screen = 10;
} else if (columns_per_screen == 0) {
form_hidden = true;
columns_per_screen = 4;
}
initSlots();
if (!has_more_slots && $screens.length == 1) {
$time_next_button.hide();
}
var hammertime = $('.ab-time-step', $container).hammer({
swipe_velocity: 0.1
});
hammertime.on('swipeleft', function () {
if ($time_next_button.is(':visible')) {
$time_next_button.trigger('click');
}
});
hammertime.on('swiperight', function () {
if ($time_prev_button.is(':visible')) {
$time_prev_button.trigger('click');
}
});
$time_next_button.on('click', function (e) {
$time_prev_button.show();
if ($screens.eq(screen_index + 1).length) {
$columnizer.animate({
left: (Options.is_rtl ? '+' : '-') + (screen_index + 1) * $current_screen.width()
}, {
duration: 800
});
$current_screen = $screens.eq(++screen_index);
$columnizer_wrap.animate({
height: $current_screen.height()
}, {
duration: 800
});
if (screen_index + 1 == $screens.length && !has_more_slots) {
$time_next_button.hide();
}
} else if (has_more_slots) {
var $button = $('> button:last', $columnizer);
if ($button.length == 0) {
$button = $('.ab-column:hidden:last > button:last', $columnizer);
if ($button.length == 0) {
$button = $('.ab-column:last > button:last', $columnizer);
}
}
var data = {
action: 'bookly_render_next_time',
form_id: Options.form_id,
last_slot: $button.val()
},
ladda = ladda_start(this);
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
if (response.has_slots) {
has_more_slots = response.has_more_slots;
var $html = $(response.html);
var $first_day = $html.eq(0);
if ($('button.ab-day[value="' + $first_day.attr('value') + '"]', $container).length) {
$html = $html.not(':first');
}
$columnizer.append($html);
initSlots();
$time_next_button.trigger('click');
} else {
$time_next_button.hide();
}
} else {
$time_next_button.hide();
}
ladda.stop();
}
});
}
});
$time_prev_button.on('click', function () {
$time_next_button.show();
$current_screen = $screens.eq(--screen_index);
$columnizer.animate({
left: (Options.is_rtl ? '+' : '-') + screen_index * $current_screen.width()
}, {
duration: 800
});
$columnizer_wrap.animate({
height: $current_screen.height()
}, {
duration: 800
});
if (screen_index === 0) {
$time_prev_button.hide();
}
});
}
if (params === undefined) {
scrollTo($container);
}
function showSpinner() {
$('.ab-time-screen,.ab-not-time-screen', $container).addClass('ab-spin-overlay');
var opts = {
lines: 11,
length: 11,
width: 4,
radius: 5
};
if ($screens) {
new Spinner(opts).spin($screens.eq(screen_index).get(0));
} else {
new Spinner(opts).spin($('.ab-not-time-screen', $container).get(0));
}
}
function initSlots() {
var $buttons = $('> button', $columnizer),
slots_count = 0,
max_slots = 0,
$button,
$column,
$screen;
if (show_day_per_column) {
while ($buttons.length > 0) {
if ($buttons.eq(0).hasClass('ab-day')) {
slots_count = 1;
$column = $('<div class="ab-column" />');
$button = $($buttons.splice(0, 1));
$button.addClass('ab-first-child');
$column.append($button);
} else {
slots_count++;
$button = $($buttons.splice(0, 1));
if (!$buttons.length || $buttons.eq(0).hasClass('ab-day')) {
$button.addClass('ab-last-child');
$column.append($button);
$columnizer.append($column);
} else {
$column.append($button);
}
}
if (slots_count > max_slots) {
max_slots = slots_count;
}
}
} else {
while (has_more_slots ? $buttons.length > slots_per_column : $buttons.length) {
$column = $('<div class="ab-column" />');
max_slots = slots_per_column;
if (columns % columns_per_screen == 0 && !$buttons.eq(0).hasClass('ab-day')) {
--max_slots;
}
for (var i = 0; i < max_slots; ++i) {
if (i + 1 == max_slots && $buttons.eq(0).hasClass('ab-day')) {
break;
}
$button = $($buttons.splice(0, 1));
if (i == 0) {
$button.addClass('ab-first-child');
} else if (i + 1 == max_slots) {
$button.addClass('ab-last-child');
}
$column.append($button);
}
$columnizer.append($column);
++columns;
}
}
var $columns = $('> .ab-column', $columnizer),
cols_per_screen = $columns.length < columns_per_screen ? $columns.length : columns_per_screen;
while (has_more_slots ? $columns.length >= cols_per_screen : $columns.length) {
$screen = $('<div class="ab-time-screen"/>');
for (var i = 0; i < cols_per_screen; ++i) {
$column = $($columns.splice(0, 1));
if (i == 0) {
$column.addClass('ab-first-column');
var $first_slot = $column.find('.ab-first-child');
if (!$first_slot.hasClass('ab-day')) {
var group = $first_slot.data('group'),
$group_slot = $('button.ab-day[value="' + group + '"]:last', $container);
$column.prepend($group_slot.clone());
}
}
$screen.append($column);
}
$columnizer.append($screen);
}
$screens = $('.ab-time-screen', $columnizer);
if ($current_screen === null) {
$current_screen = $screens.eq(0);
}
$('button.ab-hour', $container).off('click').on('click', function (e) {
e.preventDefault();
var $this = $(this),
data = {
action: 'bookly_session_save',
form_id: Options.form_id,
slots: this.value
};
$this.attr({
'data-style': 'zoom-in',
'data-spinner-color': '#333',
'data-spinner-size': '40'
});
ladda_start(this);
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (!Options.skip_steps.repeat) {
stepRepeat();
} else if (Options.cart.enabled) {
stepCart({
add_to_cart: true,
from_step: 'time'
});
} else {
stepDetails({
add_to_cart: true
});
}
}
});
});
$('.ab-time-step', $container).width(cols_per_screen * column_width);
$columnizer_wrap.height(form_hidden ? $('.ab-column.ab-first-column button', $current_screen).length * (slot_height + 3) : $current_screen.height());
form_hidden = false;
}
}
});
}
function stepRepeat(params, error) {
if (Options.skip_steps.repeat) {
stepCart(params, error)
} else {
var data = $.extend({
action: 'bookly_render_repeat',
form_id: Options.form_id
}, params);
$.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
scrollTo($container);
var $repeat_enabled = $('.bookly-repeat-appointment-enabled', $container),
$next_step = $('.bookly-next-step', $container),
$repeat_container = $('.bookly-repeat-variants-container', $container),
$variants = $('[class^="bookly-variant"]', $repeat_container),
$repeat_variant = $('.bookly-repeat-variant', $repeat_container),
$button_get_schedule = $('.bookly-get-schedule', $repeat_container),
$variant_weekly = $('.bookly-variant-weekly', $repeat_container),
$variant_monthly = $('.variant-monthly', $repeat_container),
$date_until = $('.bookly-repeat-until', $repeat_container),
$monthly_specific_day = $('.bookly-monthly-specific-day', $repeat_container),
$monthly_week_day = $('.bookly-monthly-week-day', $repeat_container),
$repeat_every_day = $('.bookly-repeat-daily-every', $repeat_container),
$week_day = $('.bookly-week-day', $repeat_container),
$schedule_container = $('.bookly-schedule-container', $container),
$days_error = $('.bookly-js-days-error', $repeat_container),
$schedule_slots = $('.bookly-schedule-slots', $schedule_container),
$intersection_info = $('.bookly-intersection-info', $schedule_container),
$info_help = $('.bookly-js-schedule-help', $schedule_container),
$info_wells = $('.bookly-well', $schedule_container),
$pagination = $('.bookly-pagination', $schedule_container),
$schedule_row_template = $('.bookly-schedule-row-template .bookly-schedule-row', $schedule_container),
pages_warning_info = response.pages_warning_info,
short_date_format = response.short_date_format,
bound_date = {
min: response.date_min || true,
max: response.date_max || true
},
schedule = [];
var repeat = {
prepareButtonNextState: function () {
var is_disabled = $next_step.prop('disabled'),
new_prop_disabled = schedule.length == 0;
for (var i = 0; i < schedule.length; i++) {
if (is_disabled) {
if (!schedule[i].deleted) {
new_prop_disabled = false;
break;
}
} else if (schedule[i].deleted) {
new_prop_disabled = true;
} else {
new_prop_disabled = false;
break;
}
}
$next_step.prop('disabled', new_prop_disabled);
},
addTimeSlotControl: function ($schedule_row, options, prefer_time, current_time) {
var $time = '';
if (options.length) {
var prefer;
$time = $('<select/>');
$.each(options, function (index, option) {
$time.append($('<option value="' + option.value + '">' + option.title + '</option>'));
if (!prefer) {
if (option.title == prefer_time) {
$time.val(option.value);
prefer = true;
} else if (option.title == current_time) {
$time.val(option.value);
}
}
});
}
$schedule_row.find('.bookly-schedule-time').html($time);
$schedule_row.find('div.ab-label-error').toggle(!options.length);
},
renderSchedulePage: function (page) {
var $row,
count = schedule.length,
rows_on_page = 5,
start = rows_on_page * page - rows_on_page,
warning_pages = [];
$schedule_slots.html('');
for (var i = start, j = 0; j < rows_on_page && i < count; i++, j++) {
$row = $schedule_row_template.clone();
$row.data('datetime', schedule[i].datetime);
$row.data('index', schedule[i].index);
$('> div:first-child', $row).html(schedule[i].index);
$('.bookly-schedule-date', $row).html(schedule[i].display_date);
$('.bookly-schedule-time', $row).html(schedule[i].display_time);
if (schedule[i].another_time) {
$('.bookly-schedule-intersect', $row).show();
}
if (schedule[i].deleted) {
$row.find('.bookly-schedule-appointment').addClass('bookly-appointment-hidden');
}
$schedule_slots.append($row);
}
if (count > rows_on_page) {
var $btn = $('<li/>').html('«');
$btn.on('click', function () {
var page = parseInt($pagination.find('.active').html());
if (page > 1) {
repeat.renderSchedulePage(page - 1);
}
});
$pagination.html($btn);
for (i = 0, j = 1; i < count; i += 5, j++) {
$btn = $('<li/>').html(j);
$pagination.append($btn);
$btn.on('click', function () {
repeat.renderSchedulePage($(this).html());
});
}
$pagination.find('li:eq(' + page + ')').addClass('active');
$btn = $('<li/>').html('»');
$btn.on('click', function () {
var page = parseInt($pagination.find('.active').html());
if (page < count / rows_on_page) {
repeat.renderSchedulePage(page + 1);
}
});
$pagination.append($btn).show();
for (i = 0; i < count; i++) {
if (schedule[i].another_time) {
page = parseInt(i / rows_on_page) + 1;
warning_pages.push(page);
i = page * rows_on_page - 1;
}
}
if (warning_pages.length > 0) {
$intersection_info.html(pages_warning_info.replace('{list}', warning_pages.join(', ')));
}
$info_wells.toggle(warning_pages.length > 0);
$pagination.toggle(count > rows_on_page);
} else {
$pagination.hide();
$info_wells.hide();
for (i = 0; i < count; i++) {
if (schedule[i].another_time) {
$info_help.show();
break;
}
}
}
},
renderFullSchedule: function (data) {
schedule = data;
var prefer_time = null;
$.each(schedule, function (index, item) {
if (!prefer_time && !item.another_time) {
prefer_time = item.display_time;
}
});
repeat.renderSchedulePage(1);
$schedule_container.show();
$next_step.prop('disabled', schedule.length == 0);
$schedule_slots.on('click', 'button[data-action]', function () {
var $schedule_row = $(this).closest('.bookly-schedule-row');
var row_index = $schedule_row.data('index') - 1;
switch ($(this).data('action')) {
case 'drop':
schedule[row_index].deleted = true;
$schedule_row.find('.bookly-schedule-appointment').addClass('bookly-appointment-hidden');
repeat.prepareButtonNextState();
break;
case 'restore':
schedule[row_index].deleted = false;
$schedule_row.find('.bookly-schedule-appointment').removeClass('bookly-appointment-hidden');
$next_step.prop('disabled', false);
break;
case 'edit':
var $date = $('<input type="text"/>'),
$edit_button = $(this),
ladda_round = ladda_start(this);
$schedule_row.find('.bookly-schedule-date').html($date);
$date.pickadate({
min: bound_date.min,
max: bound_date.max,
formatSubmit: 'yyyy-mm-dd',
format: short_date_format,
clear: false,
close: false,
today: BooklyL10n.today,
monthsFull: BooklyL10n.months,
weekdaysFull: BooklyL10n.days,
weekdaysShort: BooklyL10n.daysShort,
labelMonthNext: BooklyL10n.nextMonth,
labelMonthPrev: BooklyL10n.prevMonth,
firstDay: Options.start_of_week,
onSet: function () {
var exclude = [];
$.each(schedule, function (index, item) {
if ((row_index != index) && !item.deleted) {
exclude.push(item.slots);
}
});
$.ajax({
url: Options.ajaxurl,
type: 'POST',
data: {
action: 'bookly_recurring_appointments_get_daily_customer_schedule',
date: this.get('select', 'yyyy-mm-dd'),
form_id: Options.form_id,
exclude: exclude
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
$edit_button.hide();
ladda_round.stop();
if (response.data.length) {
repeat.addTimeSlotControl($schedule_row, response.data[0].options, prefer_time, schedule[row_index].display_time);
$schedule_row.find('button[data-action="save"]').show();
} else {
repeat.addTimeSlotControl($schedule_row, []);
$schedule_row.find('button[data-action="save"]').hide();
}
}
});
}
});
var slots = JSON.parse(schedule[row_index].slots);
var date = new Date();
date.setTime(slots[0][2] * 1000);
$date.pickadate('picker').set('select', date);
break;
case 'save':
$(this).hide();
$schedule_row.find('button[data-action="edit"]').show();
var $date_container = $schedule_row.find('.bookly-schedule-date'),
$time_container = $schedule_row.find('.bookly-schedule-time'),
$select = $time_container.find('select'),
option = $select.find('option:selected');
schedule[row_index].slots = $select.val();
schedule[row_index].display_date = $date_container.find('input').val();
schedule[row_index].display_time = option.text();
$date_container.html(schedule[row_index].display_date);
$time_container.html(schedule[row_index].display_time);
break;
}
});
}
};
$date_until.pickadate({
formatSubmit: 'yyyy-mm-dd',
format: Options.date_format,
min: bound_date.min,
max: bound_date.max,
clear: false,
close: false,
today: BooklyL10n.today,
monthsFull: BooklyL10n.months,
weekdaysFull: BooklyL10n.days,
weekdaysShort: BooklyL10n.daysShort,
labelMonthNext: BooklyL10n.nextMonth,
labelMonthPrev: BooklyL10n.prevMonth,
firstDay: Options.start_of_week
});
var open_repeat_onchange = $repeat_enabled.on('change', function () {
$repeat_container.toggle($(this).prop('checked'));
if ($(this).prop('checked')) {
repeat.prepareButtonNextState();
} else {
$next_step.prop('disabled', false);
}
});
if (response.repeated) {
var repeat_data = response.repeat_data;
var repeat_params = repeat_data.params;
$repeat_enabled.prop('checked', true);
$repeat_variant.val(repeat_data.variant);
var until = repeat_data.until.split('-');
$date_until.pickadate('set').set('select', new Date(until[0], until[1] - 1, until[2]));
switch (repeat_data.variant) {
case 'daily':
$repeat_every_day.val(repeat_params.every);
break;
case 'weekly':
case 'biweekly':
$('.bookly-week-days input.bookly-week-day', $repeat_container).prop('checked', false).parent().removeClass('active');
repeat_params.on.forEach(function (val) {
$('.bookly-week-days input.bookly-week-day[value=' + val + ']', $repeat_container).prop('checked', true).parent().addClass('active');
});
break;
case 'monthly':
if (repeat_params.on === 'day') {
$variant_monthly.val('specific');
$('.bookly-monthly-specific-day[value=' + repeat_params.day + ']', $repeat_container).prop('checked', true);
} else {
$variant_monthly.val(repeat_params.on);
$monthly_week_day.val(repeat_params.weekday);
}
break;
}
repeat.renderFullSchedule(response.schedule);
}
open_repeat_onchange.trigger('change');
if (!response.could_be_repeated) {
$repeat_enabled.attr('disabled', true);
}
$repeat_variant.on('change', function () {
$variants.hide();
$repeat_container.find('.bookly-variant-' + this.value).show()
}).trigger('change');
$variant_monthly.on('change', function () {
$monthly_week_day.toggle(this.value != 'specific');
$monthly_specific_day.toggle(this.value == 'specific');
}).trigger('change');
$week_day.on('change', function () {
var $this = $(this);
if ($this.is(':checked')) {
$this.parent().not("[class*='active']").addClass('active');
} else {
$this.parent().removeClass('active');
}
});
$monthly_specific_day.val(response.date_min[2]);
$button_get_schedule.on('click', function () {
$schedule_container.hide();
var data = {
action: 'bookly_recurring_appointments_get_customer_schedule',
form_id: Options.form_id,
repeat: $repeat_variant.val(),
until: $date_until.pickadate('picker').get('select', 'yyyy-mm-dd'),
params: {}
},
ladda = ladda_start(this);
switch (data.repeat) {
case 'daily':
data.params = {
every: $repeat_every_day.val()
};
break;
case 'weekly':
case 'biweekly':
data.params.on = [];
$('.bookly-week-days input.bookly-week-day:checked', $variant_weekly).each(function () {
data.params.on.push(this.value);
});
if (data.params.on.length == 0) {
$days_error.toggle(true);
ladda.stop();
return false;
} else {
$days_error.toggle(false);
}
break;
case 'monthly':
if ($variant_monthly.val() == 'specific') {
data.params = {
on: 'day',
day: $monthly_specific_day.val()
};
} else {
data.params = {
on: $variant_monthly.val(),
weekday: $monthly_week_day.val()
};
}
break;
}
$schedule_slots.off('click');
$.ajax({
url: Options.ajaxurl,
type: 'POST',
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
repeat.renderFullSchedule(response.data);
ladda.stop();
}
}
});
});
$('.bookly-back-step', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_session_save',
form_id: Options.form_id,
unrepeat: 1
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
stepTime();
}
});
});
$('.bookly-go-to-cart', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepCart({
from_step: 'repeat'
});
});
$('.bookly-next-step', $container).on('click', function (e) {
ladda_start(this);
if ($repeat_enabled.is(':checked')) {
var slots_to_send = [];
var repeat = 0;
schedule.forEach(function (item) {
if (!item.deleted) {
var slots = JSON.parse(item.slots);
slots_to_send = slots_to_send.concat(slots);
repeat++;
}
});
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_session_save',
form_id: Options.form_id,
slots: JSON.stringify(slots_to_send),
repeat: repeat
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
stepCart({
add_to_cart: true,
from_step: 'repeat'
});
}
});
} else {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_session_save',
form_id: Options.form_id,
unrepeat: 1
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
stepCart({
add_to_cart: true,
from_step: 'repeat'
});
}
});
}
});
}
}
});
}
}
function stepCart(params, error) {
if (!Options.cart.enabled) {
stepDetails(params);
} else {
if (params && params.from_step) {
Options.cart.prev_step = params.from_step;
}
var data = $.extend({
action: 'bookly_render_cart',
form_id: Options.form_id
}, params);
$.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
if (error) {
$('.ab--holder.ab-label-error', $container).html(error.message);
$('tr[data-cart-key="' + error.failed_key + '"]', $container).addClass('ab-label-error');
} else {
$('.ab--holder.ab-label-error', $container).hide();
}
scrollTo($container);
$('.bookly-next-step', $container).on('click', function () {
ladda_start(this);
stepDetails();
});
$('.ab-add-item', $container).on('click', function () {
ladda_start(this);
stepService({
new_chain: true
});
});
$('.bookly-back-step', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
switch (Options.cart.prev_step) {
case 'service':
stepService();
break;
case 'extras':
stepExtras();
break;
case 'time':
stepTime();
break;
case 'repeat':
stepRepeat();
break;
default:
stepService();
}
});
$('.bookly-js-actions button', $container).on('click', function () {
ladda_start(this);
var $this = $(this),
$cart_item = $this.closest('tr');
switch ($this.data('action')) {
case 'drop':
$.ajax({
url: Options.ajaxurl,
data: {
action: 'bookly_cart_drop_item',
form_id: Options.form_id,
cart_key: $cart_item.data('cart-key')
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
var remove_cart_key = $cart_item.data('cart-key'),
$trs_to_remove = $('tr[data-cart-key="' + remove_cart_key + '"]', $container);
$cart_item.delay(300).fadeOut(200, function () {
$('.bookly-js-total-price', $container).html(response.data.total_price);
$('.bookly-js-total-deposit-price', $container).html(response.data.total_deposit_price);
$trs_to_remove.remove();
if ($('tr[data-cart-key]').length == 0) {
$('.bookly-back-step', $container).hide();
$('.bookly-next-step', $container).hide();
}
});
}
}
});
break;
case 'edit':
stepService({
edit_cart_item: $cart_item.data('cart-key')
});
break;
}
});
}
}
});
}
}
function stepDetails(params) {
var data = $.extend({
action: 'bookly_render_details',
form_id: Options.form_id
}, params);
$.ajax({
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
scrollTo($container);
var $phone_field = $('.ab-user-phone-input', $container),
$email_field = $('.ab-user-email', $container),
$name_field = $('.ab-full-name', $container),
$phone_error = $('.ab-user-phone-error', $container),
$email_error = $('.ab-user-email-error', $container),
$name_error = $('.ab-full-name-error', $container),
$captcha = $('.ab-captcha-img', $container),
$errors = $('.ab-user-phone-error, .ab-user-email-error, .ab-full-name-error, div.ab-custom-field-error', $container),
$fields = $('.ab-user-phone-input, .ab-user-email, .ab-full-name, .ab-custom-field', $container),
phone_number = '';
if (Options.intlTelInput.enabled) {
$phone_field.intlTelInput({
preferredCountries: [Options.intlTelInput.country],
defaultCountry: Options.intlTelInput.country,
geoIpLookup: function (callback) {
$.get(Options.ajaxurl, {
action: 'bookly_ip_info'
}, function () {}, 'json').always(function (resp) {
var countryCode = (resp && resp.country) ? resp.country : '';
callback(countryCode);
});
},
utilsScript: Options.intlTelInput.utils
});
}
$('.bookly-next-step', $container).on('click', function (e) {
e.preventDefault();
var custom_fields = [],
checkbox_values,
captcha_ids = [],
ladda = ladda_start(this);
$('.bookly-custom-fields-container', $container).each(function () {
var $cf_container = $(this),
key = $cf_container.data('cart_key'),
custom_fields_data = [];
$('div.ab-custom-field-row', $cf_container).each(function () {
var $this = $(this);
switch ($this.data('type')) {
case 'text-field':
custom_fields_data.push({
id: $this.data('id'),
value: $this.find('input.ab-custom-field').val()
});
break;
case 'textarea':
custom_fields_data.push({
id: $this.data('id'),
value: $this.find('textarea.ab-custom-field').val()
});
break;
case 'checkboxes':
checkbox_values = [];
$this.find('input.ab-custom-field:checked').each(function () {
checkbox_values.push(this.value);
});
custom_fields_data.push({
id: $this.data('id'),
value: checkbox_values
});
break;
case 'radio-buttons':
custom_fields_data.push({
id: $this.data('id'),
value: $this.find('input.ab-custom-field:checked').val() || null
});
break;
case 'drop-down':
custom_fields_data.push({
id: $this.data('id'),
value: $this.find('select.ab-custom-field').val()
});
break;
case 'captcha':
custom_fields_data.push({
id: $this.data('id'),
value: $this.find('input.ab-custom-field').val()
});
captcha_ids.push($this.data('id'));
break;
}
});
custom_fields[key] = {
custom_fields: JSON.stringify(custom_fields_data)
};
});
try {
phone_number = Options.intlTelInput.enabled ? $phone_field.intlTelInput('getNumber') : $phone_field.val();
if (phone_number == '') {
phone_number = $phone_field.val();
}
} catch (error) {
phone_number = $phone_field.val();
}
var data = {
action: 'bookly_session_save',
form_id: Options.form_id,
name: $name_field.val(),
phone: phone_number,
email: $email_field.val(),
cart: custom_fields,
captcha_ids: JSON.stringify(captcha_ids)
};
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
$errors.empty();
$fields.removeClass('ab-error');
if (response.length == 0) {
if (Options.woocommerce.enabled) {
var data = {
action: 'bookly_add_to_woocommerce_cart',
form_id: Options.form_id
};
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
window.location.href = Options.woocommerce.cart_url;
} else {
ladda.stop();
stepTime(undefined, response.error);
}
}
});
} else {
stepPayment();
}
} else {
ladda.stop();
var $scroll_to = null;
if (response.name) {
$name_error.html(response.name);
$name_field.addClass('ab-error');
$scroll_to = $name_field;
}
if (response.phone) {
$phone_error.html(response.phone);
$phone_field.addClass('ab-error');
if ($scroll_to === null) {
$scroll_to = $phone_field;
}
}
if (response.email) {
$email_error.html(response.email);
$email_field.addClass('ab-error');
if ($scroll_to === null) {
$scroll_to = $email_field;
}
}
if (response.custom_fields) {
$.each(response.custom_fields, function (key, fields) {
$.each(fields, function (field_id, message) {
var $custom_fields_collector = $('.bookly-custom-fields-container[data-cart_key="' + key + '"]', $container);
var $div = $('[data-id="' + field_id + '"]', $custom_fields_collector);
$div.find('.ab-custom-field-error').html(message);
$div.find('.ab-custom-field').addClass('ab-error');
if ($scroll_to === null) {
$scroll_to = $div.find('.ab-custom-field');
}
});
});
}
if ($scroll_to !== null) {
scrollTo($scroll_to);
}
}
}
});
});
$('.bookly-back-step', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
if (Options.cart.enabled) {
stepCart();
} else if (!Options.skip_steps.repeat) {
stepRepeat();
} else {
stepTime();
}
});
$('.ab-captcha-refresh', $container).on('click', function () {
$captcha.css('opacity', '0.5');
$.get(Options.ajaxurl, {
action: 'bookly_captcha_refresh',
form_id: Options.form_id
}, function (response) {
if (response.success) {
$captcha.attr('src', response.data.captcha_url).on('load', function () {
$captcha.css('opacity', '1');
});
}
}, 'json');
});
}
}
});
}
function stepPayment() {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: {
action: 'bookly_render_payment',
form_id: Options.form_id,
page_url: document.URL.split('#')[0]
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
if (response.disabled) {
save();
return;
}
$container.html(response.html);
scrollTo($container);
if (Options.status.booking == 'cancelled') {
Options.status.booking = 'ok';
}
var $payments = $('.ab-payment', $container),
$apply_coupon_button = $('.btn-apply-coupon', $container),
$coupon_input = $('input.ab-user-coupon', $container),
$coupon_error = $('.ab-coupon-error', $container),
$coupon_info_text = $('.ab-info-text-coupon', $container),
$ab_payment_nav = $('.ab-payment-nav', $container),
$buttons = $('.bookly-gateway-buttons,form.bookly-authorize-net,form.bookly-stripe', $container);
$payments.on('click', function () {
$buttons.hide();
$('.bookly-gateway-buttons.pay-' + $(this).val(), $container).show();
if ($(this).val() == 'card') {
$('form.bookly-' + $(this).data('form'), $container).show();
}
});
$payments.eq(0).trigger('click');
$apply_coupon_button.on('click', function (e) {
var ladda = ladda_start(this);
$coupon_error.text('');
$coupon_input.removeClass('ab-field-error');
var data = {
action: 'bookly_apply_coupon',
form_id: Options.form_id,
coupon: $coupon_input.val()
};
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$coupon_info_text.html(response.text);
$coupon_input.replaceWith(data.coupon);
$apply_coupon_button.replaceWith('✓');
if (response.total <= 0) {
$ab_payment_nav.hide();
$buttons.hide();
$('.bookly-gateway-buttons.pay-coupon', $container).show();
$('.bookly-coupon-free', $container).attr('checked', 'checked').val(data.coupon);
} else {
$('input.bookly-payment-amount', $container).val(response.total);
var $payu_latam_form = $('.bookly-payu_latam-form', $container);
if ($payu_latam_form.length) {
$.post(Options.ajaxurl, {
action: 'bookly_payu_latam_refresh_tokens',
form_id: Options.form_id
}).done(function (response) {
if (response.success) {
$payu_latam_form.find('input[name=referenceCode]').val(response.data.referenceCode);
$payu_latam_form.find('input[name=signature]').val(response.data.signature);
}
}, 'json');
}
}
} else if (response.error_code == 6) {
$coupon_error.html(response.error);
$coupon_input.addClass('ab-field-error');
$coupon_info_text.html(response.text);
scrollTo($coupon_error);
}
ladda.stop();
},
error: function () {
ladda.stop();
}
});
});
$('.bookly-next-step', $container).on('click', function (e) {
var ladda = ladda_start(this),
$form;
if ($('.ab-payment[value=local]', $container).is(':checked') || $(this).hasClass('ab-coupon-payment')) {
e.preventDefault();
save();
} else if ($('.ab-payment[value=card]', $container).is(':checked')) {
var stripe = $('.ab-payment[data-form=stripe]', $container).is(':checked');
var card_action = stripe ? 'bookly_stripe' : 'bookly_authorize_net_aim';
$form = $container.find(stripe ? '.bookly-stripe' : '.bookly-authorize-net');
e.preventDefault();
var data = {
action: card_action,
card: {
number: $form.find('input[name="ab_card_number"]').val(),
cvc: $form.find('input[name="ab_card_cvc"]').val(),
exp_month: $form.find('select[name="ab_card_exp_month"]').val(),
exp_year: $form.find('select[name="ab_card_exp_year"]').val()
},
form_id: Options.form_id
};
var card_payment = function (data) {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
stepComplete();
} else if (response.error_code == 3) {
handle_error_3(response);
} else if (response.error_code == 7) {
ladda.stop();
$form.find('.ab-card-error').text(response.error);
}
}
});
};
if (stripe && $form.find('#publishable_key').val()) {
try {
Stripe.setPublishableKey($form.find('#publishable_key').val());
Stripe.createToken(data.card, function (status, response) {
if (response.error) {
$form.find('.ab-card-error').text(response.error.message);
ladda.stop();
} else {
data['card'] = response['id'];
card_payment(data);
}
});
} catch (e) {
$form.find('.ab-card-error').text(e.message);
ladda.stop();
}
} else {
card_payment(data);
}
} else if ($('.ab-payment[value=paypal]', $container).is(':checked') || $('.ab-payment[value=2checkout]', $container).is(':checked') || $('.ab-payment[value=payu_latam]', $container).is(':checked') || $('.ab-payment[value=payson]', $container).is(':checked') || $('.ab-payment[value=mollie]', $container).is(':checked')) {
e.preventDefault();
$form = $(this).closest('form');
if ($form.find('input.bookly-payment-id').length > 0) {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
data: {
action: 'bookly_save_pending_appointment',
form_id: Options.form_id,
payment_type: $form.data('gateway')
},
dataType: 'json',
success: function (response) {
if (response.success) {
$form.find('input.bookly-payment-id').val(response.payment_id);
$form.submit();
} else if (response.error_code == 3) {
handle_error_3(response);
}
}
});
} else {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
data: {
action: 'bookly_check_cart',
form_id: Options.form_id
},
dataType: 'json',
success: function (response) {
if (response.success) {
$form.submit();
} else if (response.error_code == 3) {
handle_error_3(response);
}
}
});
}
}
});
$('.bookly-back-step', $container).on('click', function (e) {
e.preventDefault();
ladda_start(this);
stepDetails();
});
}
}
});
}
function stepComplete() {
if (Options.final_step_url) {
document.location.href = Options.final_step_url;
} else {
$.ajax({
url: Options.ajaxurl,
data: {
action: 'bookly_render_complete',
form_id: Options.form_id
},
dataType: 'json',
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
success: function (response) {
if (response.success) {
$container.html(response.html);
scrollTo($container);
}
}
});
}
}
function save() {
$.ajax({
type: 'POST',
url: Options.ajaxurl,
xhrFields: {
withCredentials: true
},
crossDomain: 'withCredentials' in new XMLHttpRequest(),
data: {
action: 'bookly_save_appointment',
form_id: Options.form_id
},
dataType: 'json'
}).done(function (response) {
if (response.success) {
stepComplete();
} else if (response.error_code == 3) {
handle_error_3(response);
}
});
}
function ladda_start(elem) {
var ladda = Ladda.create(elem);
ladda.start();
return ladda;
}
function handle_error_3(response) {
if (Options.cart.enabled) {
stepCart(undefined, {
failed_key: response.failed_cart_key,
message: response.error
});
} else {
stepTime(undefined, response.error);
}
}
function scrollTo($elem) {
var elemTop = $elem.offset().top;
var scrollTop = $(window).scrollTop();
if (elemTop < $(window).scrollTop() || elemTop > scrollTop + window.innerHeight) {
$('html,body').animate({
scrollTop: (elemTop - 24)
}, 500);
}
}
};
})(jQuery);
(function ($) {
window.booklyCustomerProfile = function (options) {
$('.ab--show-past').on('click', function (e) {
e.preventDefault();
var $self = $(this),
$table = $self.prevAll('table.ab-appointments-table'),
ladda = Ladda.create(this);
ladda.start();
$.get(options.ajaxurl, {
action: 'bookly_get_past_appointments',
columns: $table.data('columns'),
custom_fields: $table.data('custom_fields'),
page: $table.data('page') + 1
}, function () {}, 'json').done(function (resp) {
ladda.stop();
if (resp.data.more) {
$self.find('span.ab_label').html(BooklyL10n.show_more);
} else {
$self.remove();
}
if (resp.data.html) {
$table.find('tr.bookly--no-appointments').remove();
$(resp.data.html).hide().appendTo($table).show('slow');
$table.data('page', $table.data('page') + 1);
}
});
});
};
})(jQuery);
jQuery(window).load(function () {
console.log('window load');
jQuery('#wptime-plugin-preloader').delay(500).fadeOut("slow");
setTimeout(wptime_plugin_remove_preloader, 3000);
function wptime_plugin_remove_preloader() {
console.log('hiding');
jQuery('#wptime-plugin-preloader').remove();
}
});
!function (a) {
var b = navigator.userAgent;
a.HTMLPictureElement && /ecko/.test(b) && b.match(/rv\:(\d+)/) && RegExp.$1 < 45 && addEventListener("resize", function () {
var b,
c = document.createElement("source"),
d = function (a) {
var b,
d,
e = a.parentNode;
"PICTURE" === e.nodeName.toUpperCase() ? (b = c.cloneNode(), e.insertBefore(b, e.firstElementChild), setTimeout(function () {
e.removeChild(b)
})) : (!a._pfLastSize || a.offsetWidth > a._pfLastSize) && (a._pfLastSize = a.offsetWidth, d = a.sizes, a.sizes += ",100vw", setTimeout(function () {
a.sizes = d
}))
},
e = function () {
var a,
b = document.querySelectorAll("picture > img, img[srcset][sizes]");
for (a = 0; a < b.length; a++)
d(b[a])
},
f = function () {
clearTimeout(b),
b = setTimeout(e, 99)
},
g = a.matchMedia && matchMedia("(orientation: landscape)"),
h = function () {
f(),
g && g.addListener && g.addListener(f)
};
return c.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",
/^[c|i]|d$/.test(document.readyState || "") ? h() : document.addEventListener("DOMContentLoaded", h),
f
}
())
}
(window), function (a, b, c) {
"use strict";
function d(a) {
return " " === a || " " === a || "\n" === a || "\f" === a || "\r" === a
}
function e(b, c) {
var d = new a.Image;
return d.onerror = function () {
A[b] = !1,
ba()
},
d.onload = function () {
A[b] = 1 === d.width,
ba()
},
d.src = c,
"pending"
}
function f() {
M = !1,
P = a.devicePixelRatio,
N = {},
O = {},
s.DPR = P || 1,
Q.width = Math.max(a.innerWidth || 0, z.clientWidth),
Q.height = Math.max(a.innerHeight || 0, z.clientHeight),
Q.vw = Q.width / 100,
Q.vh = Q.height / 100,
r = [Q.height, Q.width, P].join("-"),
Q.em = s.getEmValue(),
Q.rem = Q.em
}
function g(a, b, c, d) {
var e,
f,
g,
h;
return "saveData" === B.algorithm ? a > 2.7 ? h = c + 1 : (f = b - c, e = Math.pow(a - .6, 1.5), g = f * e, d && (g += .1 * e), h = a + g) : h = c > 1 ? Math.sqrt(a * b) : a,
h > c
}
function h(a) {
var b,
c = s.getSet(a),
d = !1;
"pending" !== c && (d = r, c && (b = s.setRes(c), s.applySetCandidate(b, a))),
a[s.ns].evaled = d
}
function i(a, b) {
return a.res - b.res
}
function j(a, b, c) {
var d;
return !c && b && (c = a[s.ns].sets, c = c && c[c.length - 1]),
d = k(b, c),
d && (b = s.makeUrl(b), a[s.ns].curSrc = b, a[s.ns].curCan = d, d.res || aa(d, d.set.sizes)),
d
}
function k(a, b) {
var c,
d,
e;
if (a && b)
for (e = s.parseSet(b), a = s.makeUrl(a), c = 0; c < e.length; c++)
if (a === s.makeUrl(e[c].url)) {
d = e[c];
break
}
return d
}
function l(a, b) {
var c,
d,
e,
f,
g = a.getElementsByTagName("source");
for (c = 0, d = g.length; d > c; c++)
e = g[c], e[s.ns] = !0, f = e.getAttribute("srcset"), f && b.push({
srcset: f,
media: e.getAttribute("media"),
type: e.getAttribute("type"),
sizes: e.getAttribute("sizes")
})
}
function m(a, b) {
function c(b) {
var c,
d = b.exec(a.substring(m));
return d ? (c = d[0], m += c.length, c) : void 0
}
function e() {
var a,
c,
d,
e,
f,
i,
j,
k,
l,
m = !1,
o = {};
for (e = 0; e < h.length; e++)
f = h[e], i = f[f.length - 1], j = f.substring(0, f.length - 1), k = parseInt(j, 10), l = parseFloat(j), X.test(j) && "w" === i ? ((a || c) && (m = !0), 0 === k ? m = !0 : a = k) : Y.test(j) && "x" === i ? ((a || c || d) && (m = !0), 0 > l ? m = !0 : c = l) : X.test(j) && "h" === i ? ((d || c) && (m = !0), 0 === k ? m = !0 : d = k) : m = !0;
m || (o.url = g, a && (o.w = a), c && (o.d = c), d && (o.h = d), d || c || a || (o.d = 1), 1 === o.d && (b.has1x = !0), o.set = b, n.push(o))
}
function f() {
for (c(T), i = "", j = "in descriptor"; ; ) {
if (k = a.charAt(m), "in descriptor" === j)
if (d(k))
i && (h.push(i), i = "", j = "after descriptor");
else {
if ("," === k)
return m += 1, i && h.push(i), void e();
if ("(" === k)
i += k, j = "in parens";
else {
if ("" === k)
return i && h.push(i), void e();
i += k
}
}
else if ("in parens" === j)
if (")" === k)
i += k, j = "in descriptor";
else {
if ("" === k)
return h.push(i), void e();
i += k
}
else if ("after descriptor" === j)
if (d(k));
else {
if ("" === k)
return void e();
j = "in descriptor",
m -= 1
}
m += 1
}
}
for (var g, h, i, j, k, l = a.length, m = 0, n = []; ; ) {
if (c(U), m >= l)
return n;
g = c(V),
h = [],
"," === g.slice(-1) ? (g = g.replace(W, ""), e()) : f()
}
}
function n(a) {
function b(a) {
function b() {
f && (g.push(f), f = "")
}
function c() {
g[0] && (h.push(g), g = [])
}
for (var e, f = "", g = [], h = [], i = 0, j = 0, k = !1; ; ) {
if (e = a.charAt(j), "" === e)
return b(), c(), h;
if (k) {
if ("*" === e && "/" === a[j + 1]) {
k = !1,
j += 2,
b();
continue
}
j += 1
} else {
if (d(e)) {
if (a.charAt(j - 1) && d(a.charAt(j - 1)) || !f) {
j += 1;
continue
}
if (0 === i) {
b(),
j += 1;
continue
}
e = " "
} else if ("(" === e)
i += 1;
else if (")" === e)
i -= 1;
else {
if ("," === e) {
b(),
c(),
j += 1;
continue
}
if ("/" === e && "*" === a.charAt(j + 1)) {
k = !0,
j += 2;
continue
}
}
f += e,
j += 1
}
}
}
function c(a) {
return k.test(a) && parseFloat(a) >= 0 ? !0 : l.test(a) ? !0 : "0" === a || "-0" === a || "+0" === a ? !0 : !1
}
var e,
f,
g,
h,
i,
j,
k = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,
l = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;
for (f = b(a), g = f.length, e = 0; g > e; e++)
if (h = f[e], i = h[h.length - 1], c(i)) {
if (j = i, h.pop(), 0 === h.length)
return j;
if (h = h.join(" "), s.matchesMedia(h))
return j
}
return "100vw"
}
b.createElement("picture");
var o,
p,
q,
r,
s = {},
t = !1,
u = function () {},
v = b.createElement("img"),
w = v.getAttribute,
x = v.setAttribute,
y = v.removeAttribute,
z = b.documentElement,
A = {},
B = {
algorithm: ""
},
C = "data-pfsrc",
D = C + "set",
E = navigator.userAgent,
F = /rident/.test(E) || /ecko/.test(E) && E.match(/rv\:(\d+)/) && RegExp.$1 > 35,
G = "currentSrc",
H = /\s+\+?\d+(e\d+)?w/,
I = /(\([^)]+\))?\s*(.+)/,
J = a.picturefillCFG,
K = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",
L = "font-size:100%!important;",
M = !0,
N = {},
O = {},
P = a.devicePixelRatio,
Q = {
px: 1,
"in": 96
},
R = b.createElement("a"),
S = !1,
T = /^[ \t\n\r\u000c]+/,
U = /^[, \t\n\r\u000c]+/,
V = /^[^ \t\n\r\u000c]+/,
W = /[,]+$/,
X = /^\d+$/,
Y = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,
Z = function (a, b, c, d) {
a.addEventListener ? a.addEventListener(b, c, d || !1) : a.attachEvent && a.attachEvent("on" + b, c)
},
$ = function (a) {
var b = {};
return function (c) {
return c in b || (b[c] = a(c)),
b[c]
}
},
_ = function () {
var a = /^([\d\.]+)(em|vw|px)$/,
b = function () {
for (var a = arguments, b = 0, c = a[0]; ++b in a; )
c = c.replace(a[b], a[++b]);
return c
},
c = $(function (a) {
return "return " + b((a || "").toLowerCase(), /\band\b/g, "&&", /,/g, "||", /min-([a-z-\s]+):/g, "e.$1>=", /max-([a-z-\s]+):/g, "e.$1<=", /calc([^)]+)/g, "($1)", /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi, "") + ";"
});
return function (b, d) {
var e;
if (!(b in N))
if (N[b] = !1, d && (e = b.match(a)))
N[b] = e[1] * Q[e[2]];
else
try {
N[b] = new Function("e", c(b))(Q)
} catch (f) {}
return N[b]
}
}
(),
aa = function (a, b) {
return a.w ? (a.cWidth = s.calcListLength(b || "100vw"), a.res = a.w / a.cWidth) : a.res = a.d,
a
},
ba = function (a) {
if (t) {
var c,
d,
e,
f = a || {};
if (f.elements && 1 === f.elements.nodeType && ("IMG" === f.elements.nodeName.toUpperCase() ? f.elements = [f.elements] : (f.context = f.elements, f.elements = null)), c = f.elements || s.qsa(f.context || b, f.reevaluate || f.reselect ? s.sel : s.selShort), e = c.length) {
for (s.setupRun(f), S = !0, d = 0; e > d; d++)
s.fillImg(c[d], f);
s.teardownRun(f)
}
}
};
o = a.console && console.warn ? function (a) {
console.warn(a)
}
: u,
G in v || (G = "src"),
A["image/jpeg"] = !0,
A["image/gif"] = !0,
A["image/png"] = !0,
A["image/svg+xml"] = b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"),
s.ns = ("pf" + (new Date).getTime()).substr(0, 9),
s.supSrcset = "srcset" in v,
s.supSizes = "sizes" in v,
s.supPicture = !!a.HTMLPictureElement,
s.supSrcset && s.supPicture && !s.supSizes && !function (a) {
v.srcset = "data:,a",
a.src = "data:,a",
s.supSrcset = v.complete === a.complete,
s.supPicture = s.supSrcset && s.supPicture
}
(b.createElement("img")),
s.supSrcset && !s.supSizes ? !function () {
var a = "data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",
c = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",
d = b.createElement("img"),
e = function () {
var a = d.width;
2 === a && (s.supSizes = !0),
q = s.supSrcset && !s.supSizes,
t = !0,
setTimeout(ba)
};
d.onload = e,
d.onerror = e,
d.setAttribute("sizes", "9px"),
d.srcset = c + " 1w," + a + " 9w",
d.src = c
}
() : t = !0,
s.selShort = "picture>img,img[srcset]",
s.sel = s.selShort,
s.cfg = B,
s.DPR = P || 1,
s.u = Q,
s.types = A,
s.setSize = u,
s.makeUrl = $(function (a) {
return R.href = a,
R.href
}),
s.qsa = function (a, b) {
return "querySelector" in a ? a.querySelectorAll(b) : []
},
s.matchesMedia = function () {
return a.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches ? s.matchesMedia = function (a) {
return !a || matchMedia(a).matches
}
: s.matchesMedia = s.mMQ,
s.matchesMedia.apply(this, arguments)
},
s.mMQ = function (a) {
return a ? _(a) : !0
},
s.calcLength = function (a) {
var b = _(a, !0) || !1;
return 0 > b && (b = !1),
b
},
s.supportsType = function (a) {
return a ? A[a] : !0
},
s.parseSize = $(function (a) {
var b = (a || "").match(I);
return {
media: b && b[1],
length: b && b[2]
}
}),
s.parseSet = function (a) {
return a.cands || (a.cands = m(a.srcset, a)),
a.cands
},
s.getEmValue = function () {
var a;
if (!p && (a = b.body)) {
var c = b.createElement("div"),
d = z.style.cssText,
e = a.style.cssText;
c.style.cssText = K,
z.style.cssText = L,
a.style.cssText = L,
a.appendChild(c),
p = c.offsetWidth,
a.removeChild(c),
p = parseFloat(p, 10),
z.style.cssText = d,
a.style.cssText = e
}
return p || 16
},
s.calcListLength = function (a) {
if (!(a in O) || B.uT) {
var b = s.calcLength(n(a));
O[a] = b ? b : Q.width
}
return O[a]
},
s.setRes = function (a) {
var b;
if (a) {
b = s.parseSet(a);
for (var c = 0, d = b.length; d > c; c++)
aa(b[c], a.sizes)
}
return b
},
s.setRes.res = aa,
s.applySetCandidate = function (a, b) {
if (a.length) {
var c,
d,
e,
f,
h,
k,
l,
m,
n,
o = b[s.ns],
p = s.DPR;
if (k = o.curSrc || b[G], l = o.curCan || j(b, k, a[0].set), l && l.set === a[0].set && (n = F && !b.complete && l.res - .1 > p, n || (l.cached = !0, l.res >= p && (h = l))), !h)
for (a.sort(i), f = a.length, h = a[f - 1], d = 0; f > d; d++)
if (c = a[d], c.res >= p) {
e = d - 1,
h = a[e] && (n || k !== s.makeUrl(c.url)) && g(a[e].res, c.res, p, a[e].cached) ? a[e] : c;
break
}
h && (m = s.makeUrl(h.url), o.curSrc = m, o.curCan = h, m !== k && s.setSrc(b, h), s.setSize(b))
}
},
s.setSrc = function (a, b) {
var c;
a.src = b.url,
"image/svg+xml" === b.set.type && (c = a.style.width, a.style.width = a.offsetWidth + 1 + "px", a.offsetWidth + 1 && (a.style.width = c))
},
s.getSet = function (a) {
var b,
c,
d,
e = !1,
f = a[s.ns].sets;
for (b = 0; b < f.length && !e; b++)
if (c = f[b], c.srcset && s.matchesMedia(c.media) && (d = s.supportsType(c.type))) {
"pending" === d && (c = d),
e = c;
break
}
return e
},
s.parseSets = function (a, b, d) {
var e,
f,
g,
h,
i = b && "PICTURE" === b.nodeName.toUpperCase(),
j = a[s.ns];
(j.src === c || d.src) && (j.src = w.call(a, "src"), j.src ? x.call(a, C, j.src) : y.call(a, C)),
(j.srcset === c || d.srcset || !s.supSrcset || a.srcset) && (e = w.call(a, "srcset"), j.srcset = e, h = !0),
j.sets = [],
i && (j.pic = !0, l(b, j.sets)),
j.srcset ? (f = {
srcset: j.srcset,
sizes: w.call(a, "sizes")
}, j.sets.push(f), g = (q || j.src) && H.test(j.srcset || ""), g || !j.src || k(j.src, f) || f.has1x || (f.srcset += ", " + j.src, f.cands.push({
url: j.src,
d: 1,
set: f
}))) : j.src && j.sets.push({
srcset: j.src,
sizes: null
}),
j.curCan = null,
j.curSrc = c,
j.supported = !(i || f && !s.supSrcset || g && !s.supSizes),
h && s.supSrcset && !j.supported && (e ? (x.call(a, D, e), a.srcset = "") : y.call(a, D)),
j.supported && !j.srcset && (!j.src && a.src || a.src !== s.makeUrl(j.src)) && (null === j.src ? a.removeAttribute("src") : a.src = j.src),
j.parsed = !0
},
s.fillImg = function (a, b) {
var c,
d = b.reselect || b.reevaluate;
a[s.ns] || (a[s.ns] = {}),
c = a[s.ns],
(d || c.evaled !== r) && ((!c.parsed || b.reevaluate) && s.parseSets(a, a.parentNode, b), c.supported ? c.evaled = r : h(a))
},
s.setupRun = function () {
(!S || M || P !== a.devicePixelRatio) && f()
},
s.supPicture ? (ba = u, s.fillImg = u) : !function () {
var c,
d = a.attachEvent ? /d$|^c/ : /d$|^c|^i/,
e = function () {
var a = b.readyState || "";
f = setTimeout(e, "loading" === a ? 200 : 999),
b.body && (s.fillImgs(), c = c || d.test(a), c && clearTimeout(f))
},
f = setTimeout(e, b.body ? 9 : 99),
g = function (a, b) {
var c,
d,
e = function () {
var f = new Date - d;
b > f ? c = setTimeout(e, b - f) : (c = null, a())
};
return function () {
d = new Date,
c || (c = setTimeout(e, b))
}
},
h = z.clientHeight,
i = function () {
M = Math.max(a.innerWidth || 0, z.clientWidth) !== Q.width || z.clientHeight !== h,
h = z.clientHeight,
M && s.fillImgs()
};
Z(a, "resize", g(i, 99)),
Z(b, "readystatechange", e)
}
(),
s.picturefill = ba,
s.fillImgs = ba,
s.teardownRun = u,
ba._ = s,
a.picturefillCFG = {
pf: s,
push: function (a) {
var b = a.shift();
"function" == typeof s[b] ? s[b].apply(s, a) : (B[b] = a[0], S && s.fillImgs({
reselect: !0
}))
}
};
for (; J && J.length; )
a.picturefillCFG.push(J.shift());
a.picturefill = ba,
"object" == typeof module && "object" == typeof module.exports ? module.exports = ba : "function" == typeof define && define.amd && define("picturefill", function () {
return ba
}),
s.supPicture || (A["image/webp"] = e("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))
}
(window, document); ;
window.Modernizr = function (a, b, c) {
function u(a) {
j.cssText = a
}
function v(a, b) {
return u(prefixes.join(a + ";") + (b || ""))
}
function w(a, b) {
return typeof a === b
}
function x(a, b) {
return !!~("" + a).indexOf(b)
}
function y(a, b, d) {
for (var e in a) {
var f = b[a[e]];
if (f !== c)
return d === !1 ? a[e] : w(f, "function") ? f.bind(d || b) : f
}
return !1
}
var d = "2.7.1",
e = {},
f = !0,
g = b.documentElement,
h = "modernizr",
i = b.createElement(h),
j = i.style,
k,
l = {}
.toString,
m = {},
n = {},
o = {},
p = [],
q = p.slice,
r,
s = {}
.hasOwnProperty,
t;
!w(s, "undefined") && !w(s.call, "undefined") ? t = function (a, b) {
return s.call(a, b)
}
: t = function (a, b) {
return b in a && w(a.constructor.prototype[b], "undefined")
},
Function.prototype.bind || (Function.prototype.bind = function (b) {
var c = this;
if (typeof c != "function")
throw new TypeError;
var d = q.call(arguments, 1),
e = function () {
if (this instanceof e) {
var a = function () {};
a.prototype = c.prototype;
var f = new a,
g = c.apply(f, d.concat(q.call(arguments)));
return Object(g) === g ? g : f
}
return c.apply(b, d.concat(q.call(arguments)))
};
return e
});
for (var z in m)
t(m, z) && (r = z.toLowerCase(), e[r] = m[z](), p.push((e[r] ? "" : "no-") + r));
return e.addTest = function (a, b) {
if (typeof a == "object")
for (var d in a)
t(a, d) && e.addTest(d, a[d]);
else {
a = a.toLowerCase();
if (e[a] !== c)
return e;
b = typeof b == "function" ? b() : b,
typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a),
e[a] = b
}
return e
},
u(""),
i = k = null,
e._version = d,
g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + p.join(" ") : ""),
e
}
(this, this.document), function (a, b) {
function l(a, b) {
var c = a.createElement("p"),
d = a.getElementsByTagName("head")[0] || a.documentElement;
return c.innerHTML = "x<style>" + b + "</style>",
d.insertBefore(c.lastChild, d.firstChild)
}
function m() {
var a = s.elements;
return typeof a == "string" ? a.split(" ") : a
}
function n(a) {
var b = j[a[h]];
return b || (b = {}, i++, a[h] = i, j[i] = b),
b
}
function o(a, c, d) {
c || (c = b);
if (k)
return c.createElement(a);
d || (d = n(c));
var g;
return d.cache[a] ? g = d.cache[a].cloneNode() : f.test(a) ? g = (d.cache[a] = d.createElem(a)).cloneNode() : g = d.createElem(a),
g.canHaveChildren && !e.test(a) && !g.tagUrn ? d.frag.appendChild(g) : g
}
function p(a, c) {
a || (a = b);
if (k)
return a.createDocumentFragment();
c = c || n(a);
var d = c.frag.cloneNode(),
e = 0,
f = m(),
g = f.length;
for (; e < g; e++)
d.createElement(f[e]);
return d
}
function q(a, b) {
b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag = b.createFrag()),
a.createElement = function (c) {
return s.shivMethods ? o(c, a, b) : b.createElem(c)
},
a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + m().join().replace(/\w+/g, function (a) {
return b.createElem(a),
b.frag.createElement(a),
'c("' + a + '")'
}) + ");return n}")(s, b.frag)
}
function r(a) {
a || (a = b);
var c = n(a);
return s.shivCSS && !g && !c.hasCSS && (c.hasCSS = !!l(a, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),
k || q(a, c),
a
}
function w(a) {
var b,
c = a.getElementsByTagName("*"),
d = c.length,
e = RegExp("^(?:" + m().join("|") + ")$", "i"),
f = [];
while (d--)
b = c[d], e.test(b.nodeName) && f.push(b.applyElement(x(b)));
return f
}
function x(a) {
var b,
c = a.attributes,
d = c.length,
e = a.ownerDocument.createElement(u + ":" + a.nodeName);
while (d--)
b = c[d], b.specified && e.setAttribute(b.nodeName, b.nodeValue);
return e.style.cssText = a.style.cssText,
e
}
function y(a) {
var b,
c = a.split("{"),
d = c.length,
e = RegExp("(^|[\\s,>+~])(" + m().join("|") + ")(?=[[\\s,>+~#.:]|$)", "gi"),
f = "$1" + u + "\\:$2";
while (d--)
b = c[d] = c[d].split("}"), b[b.length - 1] = b[b.length - 1].replace(e, f), c[d] = b.join("}");
return c.join("{")
}
function z(a) {
var b = a.length;
while (b--)
a[b].removeNode()
}
function A(a) {
function g() {
clearTimeout(d._removeSheetTimer),
b && b.removeNode(!0),
b = null
}
var b,
c,
d = n(a),
e = a.namespaces,
f = a.parentWindow;
return !v || a.printShived ? a : (typeof e[u] == "undefined" && e.add(u), f.attachEvent("onbeforeprint", function () {
g();
var d,
e,
f,
h = a.styleSheets,
i = [],
j = h.length,
k = Array(j);
while (j--)
k[j] = h[j];
while (f = k.pop())
if (!f.disabled && t.test(f.media)) {
try {
d = f.imports,
e = d.length
} catch (m) {
e = 0
}
for (j = 0; j < e; j++)
k.push(d[j]);
try {
i.push(f.cssText)
} catch (m) {}
}
i = y(i.reverse().join("")),
c = w(a),
b = l(a, i)
}), f.attachEvent("onafterprint", function () {
z(c),
clearTimeout(d._removeSheetTimer),
d._removeSheetTimer = setTimeout(g, 500)
}), a.printShived = !0, a)
}
var c = "3.7.0",
d = a.html5 || {},
e = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
f = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
g,
h = "_html5shiv",
i = 0,
j = {},
k;
(function () {
try {
var a = b.createElement("a");
a.innerHTML = "<xyz></xyz>",
g = "hidden" in a,
k = a.childNodes.length == 1 || function () {
b.createElement("a");
var a = b.createDocumentFragment();
return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined"
}
()
} catch (c) {
g = !0,
k = !0
}
})();
var s = {
elements: d.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",
version: c,
shivCSS: d.shivCSS !== !1,
supportsUnknownElements: k,
shivMethods: d.shivMethods !== !1,
type: "default",
shivDocument: r,
createElement: o,
createDocumentFragment: p
};
a.html5 = s,
r(b);
var t = /^$|\b(?:all|print)\b/,
u = "html5shiv",
v = !k && function () {
var c = b.documentElement;
return typeof b.namespaces != "undefined" && typeof b.parentWindow != "undefined" && typeof c.applyElement != "undefined" && typeof c.removeNode != "undefined" && typeof a.attachEvent != "undefined"
}
();
s.type += " print",
s.shivPrint = A,
A(b)
}
(this, document);
var featuredSlider;
function stopFeaturedSlider() {
if (!featuredSlider)
return;
featuredSlider.flexslider('stop');
}
function onYoutubeStateChange(event) {
if (event.data === 1) {
stopFeaturedSlider();
}
};
var a3_lazyload_params = {
"apply_images": "1",
"apply_videos": "1"
};
(function (e, t, n, r) {
function w(e, t) {
return e[t] === r ? l[t] : e[t]
}
function E() {
var e = t.pageYOffset;
return e === r ? a.scrollTop : e
}
function S(e, t) {
var n = l["on" + e];
if (n) {
if (p(n)) {
n.call(t[0])
} else {
if (n.addClass) {
t.addClass(n.addClass)
}
if (n.removeClass) {
t.removeClass(n.removeClass)
}
}
}
t.trigger("lazy" + e, [t]);
C()
}
function x(t) {
S(t.type, e(this).off(o, x))
}
function T(n) {
if (!g.length) {
return
}
n = n || l.forceLoad;
y = Infinity;
var r = E(),
s = t.innerHeight || a.clientHeight,
u = t.innerWidth || a.clientWidth,
f,
c;
for (f = 0, c = g.length; f < c; f++) {
var h = g[f],
d = h[0],
v = h[i],
b = false,
w = n,
T;
if (!m(a, d)) {
b = true
} else if (n || !v.visibleOnly || d.offsetWidth || d.offsetHeight) {
if (!w) {
var N = d.getBoundingClientRect(),
C = v.edgeX,
k = v.edgeY;
T = N.top + r - k - s;
w = T <= r && N.bottom > -k && N.left <= u + C && N.right > -C
}
if (w) {
S("show", h);
var L = v.srcAttr,
A = p(L) ? L(h) : d.getAttribute(L);
if (A) {
h.on(o, x);
d.src = A
}
b = true
} else {
if (T < y) {
y = T
}
}
}
if (b) {
g.splice(f--, 1);
c--
}
}
if (!c) {
S("complete", e(a))
}
}
function N() {
if (b > 1) {
b = 1;
T();
setTimeout(N, l.throttle)
} else {
b = 0
}
}
function C(e) {
if (!g.length) {
return
}
if (e && e.type === "scroll" && e.currentTarget === t) {
if (y >= E()) {
return
}
}
if (!b) {
setTimeout(N, 0)
}
b = 2
}
function k() {
h.lazyLoadXT()
}
function L() {
T(true)
}
var i = "lazyLoadXT",
s = "lazied",
o = "load error",
u = "lazy-hidden",
a = n.documentElement || n.body,
f = t.onscroll === r || !!t.operamini || !a.getBoundingClientRect,
l = {
autoInit: true,
selector: "img[data-src]",
blankImage: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
throttle: 99,
forceLoad: f,
loadEvent: "pageshow",
updateEvent: "load orientationchange resize scroll touchmove focus",
forceEvent: "",
oninit: {
removeClass: "lazy"
},
onshow: {
addClass: u
},
onload: {
removeClass: u,
addClass: "lazy-loaded"
},
onerror: {
removeClass: u
},
checkDuplicates: true
},
c = {
srcAttr: "data-src",
edgeX: 0,
edgeY: 0,
visibleOnly: true
},
h = e(t),
p = e.isFunction,
d = e.extend,
v = e.data || function (t, n) {
return e(t).data(n)
},
m = e.contains || function (e, t) {
while (t = t.parentNode) {
if (t === e) {
return true
}
}
return false
},
g = [],
y = 0,
b = 0;
e[i] = d(l, c, e[i]);
e.fn[i] = function (n) {
n = n || {};
var r = w(n, "blankImage"),
o = w(n, "checkDuplicates"),
u = w(n, "scrollContainer"),
a = {},
f;
e(u).on("scroll", C);
for (f in c) {
a[f] = w(n, f)
}
return this.each(function (u, f) {
if (f === t) {
e(l.selector).lazyLoadXT(n)
} else {
if (o && v(f, s)) {
return
}
var c = e(f).data(s, 1);
if (r && f.tagName === "IMG" && !f.src) {
f.src = r
}
c[i] = d({}, a);
S("init", c);
g.push(c)
}
})
};
e(n).ready(function () {
S("start", h);
h.on(l.loadEvent, k).on(l.updateEvent, C).on(l.forceEvent, L);
e(n).on(l.updateEvent, C);
if (l.autoInit) {
k()
}
})
})(window.jQuery || window.Zepto || window.$, window, document);
(function (e) {
var t = e.lazyLoadXT;
t.selector += ",video,iframe[data-src],embed[data-src]";
t.videoPoster = "data-poster";
e(document).on("lazyshow", "video", function (n, r) {
var i = r.lazyLoadXT.srcAttr,
s = e.isFunction(i);
r.attr("poster", r.attr(t.videoPoster)).children("source,track").each(function (t, n) {
var r = e(n);
r.attr("src", s ? i(r) : r.attr(i))
});
this.load();
e(this).removeClass("lazy-hidden")
});
e(document).on("lazyshow", "embed", function (t, n) {
e(this).removeClass("lazy-hidden")
})
})(window.jQuery || window.Zepto || window.$);
(function ($) {
var options = $.lazyLoadXT,
widgetAttr = options.widgetAttr || 'data-lazy-widget',
reComment = /<!--([\s\S]*)-->/;
options.selector += ',[' + widgetAttr + ']';
$(document).on('lazyshow', '[' + widgetAttr + ']', function () {
var $this = $(this),
$target = $this,
id = $this.attr(widgetAttr),
match;
if (id) {
$target = $('#' + id);
}
if ($target.length) {
match = reComment.exec($target.html());
if (match) {
$target.replaceWith($.trim(match[1]));
}
}
$this.triggerHandler('load');
});
})(window.jQuery || window.Zepto || window.$);
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26584467-1']);
_gaq.push(['_trackPageview']);
(function () {
var E;
function Aa(a, b) {
switch (b) {
case 0:
return "" + a;
case 1:
return 1 * a;
case 2:
return !!a;
case 3:
return 1E3 * a
}
return a
}
function Ba(a) {
return "function" == typeof a
}
function Ca(a) {
return void 0 != a && -1 < (a.constructor + "").indexOf("String")
}
function F(a, b) {
return void 0 == a || "-" == a && !b || "" == a
}
function Da(a) {
if (!a || "" == a)
return "";
for (; a && -1 < " \n\r\t".indexOf(a.charAt(0)); )
a = a.substring(1);
for (; a && -1 < " \n\r\t".indexOf(a.charAt(a.length - 1)); )
a = a.substring(0, a.length - 1);
return a
}
function Ea() {
return Math.round(2147483647 * Math.random())
}
function Fa() {}
function G(a, b) {
if (encodeURIComponent instanceof Function)
return b ? encodeURI(a) : encodeURIComponent(a);
H(68);
return escape(a)
}
function I(a) {
a = a.split("+").join(" ");
if (decodeURIComponent instanceof Function)
try {
return decodeURIComponent(a)
} catch (b) {
H(17)
}
else
H(68);
return unescape(a)
}
var Ga = function (a, b, c, d) {
a.addEventListener ? a.addEventListener(b, c, !!d) : a.attachEvent && a.attachEvent("on" + b, c)
};
function Ia(a, b) {
if (a) {
var c = J.createElement("script");
c.type = "text/javascript";
c.async = !0;
c.src = a;
c.id = b;
a = J.getElementsByTagName("script")[0];
a.parentNode.insertBefore(c, a);
return c
}
}
function K(a) {
return a && 0 < a.length ? a[0] : ""
}
function L(a) {
var b = a ? a.length : 0;
return 0 < b ? a[b - 1] : ""
}
var Bd = function () {
this.prefix = "ga.";
this.values = {}
};
Bd.prototype.set = function (a, b) {
this.values[this.prefix + a] = b
};
Bd.prototype.get = function (a) {
return this.values[this.prefix + a]
};
Bd.prototype.contains = function (a) {
return void 0 !== this.get(a)
};
function Ka(a) {
0 == a.indexOf("www.") && (a = a.substring(4));
return a.toLowerCase()
}
function La(a, b) {
var c,
d = {
url: a,
protocol: "http",
host: "",
path: "",
R: new Bd,
anchor: ""
};
if (!a)
return d;
c = a.indexOf("://");
0 <= c && (d.protocol = a.substring(0, c), a = a.substring(c + 3));
c = a.search("/|\\?|#");
if (0 <= c)
d.host = a.substring(0, c).toLowerCase(), a = a.substring(c);
else
return d.host = a.toLowerCase(), d;
c = a.indexOf("#");
0 <= c && (d.anchor = a.substring(c + 1), a = a.substring(0, c));
c = a.indexOf("?");
0 <= c && (Na(d.R, a.substring(c + 1)), a = a.substring(0, c));
d.anchor && b && Na(d.R, d.anchor);
a && "/" == a.charAt(0) && (a = a.substring(1));
d.path = a;
return d
}
function Oa(a, b) {
function c(a) {
var b = (a.hostname || "").split(":")[0].toLowerCase(),
c = (a.protocol || "").toLowerCase(),
c = 1 * a.port || ("http:" == c ? 80 : "https:" == c ? 443 : "");
a = a.pathname || "";
0 == a.indexOf("/") || (a = "/" + a);
return [b, "" + c, a]
}
b = b || J.createElement("a");
b.href = J.location.href;
var d = (b.protocol || "").toLowerCase(),
e = c(b),
f = b.search || "",
Be = d + "//" + e[0] + (e[1] ? ":" + e[1] : "");
0 == a.indexOf("//") ? a = d + a : 0 == a.indexOf("/") ? a = Be + a : a && 0 != a.indexOf("?") ? 0 > a.split("/")[0].indexOf(":") && (a = Be + e[2].substring(0, e[2].lastIndexOf("/")) + "/" + a) : a = Be + e[2] + (a || f);
b.href = a;
d = c(b);
return {
protocol: (b.protocol || "").toLowerCase(),
host: d[0],
port: d[1],
path: d[2],
query: b.search || "",
url: a || ""
}
}
function Na(a, b) {
function c(b, c) {
a.contains(b) || a.set(b, []);
a.get(b).push(c)
}
b = Da(b).split("&");
for (var d = 0; d < b.length; d++)
if (b[d]) {
var e = b[d].indexOf("=");
0 > e ? c(b[d], "1") : c(b[d].substring(0, e), b[d].substring(e + 1))
}
}
function Pa(a, b) {
return F(a) || "[" == a.charAt(0) && "]" == a.charAt(a.length - 1) ? "-" : a.indexOf(J.domain + (b && "/" != b ? b : "")) == (0 == a.indexOf("http://") ? 7 : 0 == a.indexOf("https://") ? 8 : 0) ? "0" : a
};
var Qa = 0;
function Ra(a, b, c) {
1 <= Qa || 1 <= 100 * Math.random() || ld() || (a = ["utmt=error", "utmerr=" + a, "utmwv=5.6.8dc", "utmn=" + Ea(), "utmsp=1"], b && a.push("api=" + b), c && a.push("msg=" + G(c.substring(0, 100))), M.w && a.push("aip=1"), Sa(a.join("&")), Qa++)
};
var Ta = 0,
Ua = {};
function N(a) {
return Va("x" + Ta++, a)
}
function Va(a, b) {
Ua[a] = !!b;
return a
}
var Wa = N(),
Xa = Va("anonymizeIp"),
Ya = N(),
$a = N(),
ab = N(),
bb = N(),
O = N(),
P = N(),
cb = N(),
db = N(),
eb = N(),
fb = N(),
gb = N(),
hb = N(),
ib = N(),
jb = N(),
kb = N(),
lb = N(),
nb = N(),
ob = N(),
pb = N(),
qb = N(),
rb = N(),
sb = N(),
tb = N(),
ub = N(),
vb = N(),
wb = N(),
xb = N(),
yb = N(),
zb = N(),
Ab = N(),
Bb = N(),
Cb = N(),
Db = N(),
Eb = N(),
Fb = N(!0),
Gb = Va("currencyCode"),
Hb = Va("page"),
Ib = Va("title"),
Jb = N(),
Kb = N(),
Lb = N(),
Mb = N(),
Nb = N(),
Ob = N(),
Pb = N(),
Qb = N(),
Rb = N(),
Q = N(!0),
Sb = N(!0),
Tb = N(!0),
Ub = N(!0),
Vb = N(!0),
Wb = N(!0),
Zb = N(!0),
$b = N(!0),
ac = N(!0),
bc = N(!0),
cc = N(!0),
R = N(!0),
dc = N(!0),
ec = N(!0),
fc = N(!0),
gc = N(!0),
hc = N(!0),
ic = N(!0),
jc = N(!0),
S = N(!0),
kc = N(!0),
lc = N(!0),
mc = N(!0),
nc = N(!0),
oc = N(!0),
pc = N(!0),
qc = N(!0),
rc = Va("campaignParams"),
sc = N(),
tc = Va("hitCallback"),
uc = N();
N();
var vc = N(),
wc = N(),
xc = N(),
yc = N(),
zc = N(),
Ac = N(),
Bc = N(),
Cc = N(),
Dc = N(),
Ec = N(),
Fc = N(),
Gc = N(),
Hc = N(),
Ic = N();
N();
var Mc = N(),
Nc = N(),
jf = N(),
Yb = N(),
kf = N(),
lf = Va("utmtCookieName"),
mf = Va("displayFeatures"),
Oc = N(),
Ie = Va("gtmid"),
Ne = Va("uaName"),
Oe = Va("uaDomain"),
Pe = Va("uaPath"),
Je = Va("linkid");
var Qe = function () {
function a(a, c, d) {
T(gf.prototype, a, c, d)
}
a("_createTracker", gf.prototype.hb, 55);
a("_getTracker", gf.prototype.oa, 0);
a("_getTrackerByName", gf.prototype.u, 51);
a("_getTrackers", gf.prototype.pa, 130);
a("_anonymizeIp", gf.prototype.aa, 16);
a("_forceSSL", gf.prototype.la, 125);
a("_getPlugin", Pc, 120)
},
Re = function () {
function a(a, c, d) {
T(U.prototype, a, c, d)
}
Qc("_getName", $a, 58);
Qc("_getAccount", Wa, 64);
Qc("_visitCode", Q, 54);
Qc("_getClientInfo", ib, 53, 1);
Qc("_getDetectTitle", lb, 56, 1);
Qc("_getDetectFlash", jb, 65, 1);
Qc("_getLocalGifPath", wb, 57);
Qc("_getServiceMode", xb, 59);
V("_setClientInfo", ib, 66, 2);
V("_setAccount", Wa, 3);
V("_setNamespace", Ya, 48);
V("_setAllowLinker", fb, 11, 2);
V("_setDetectFlash", jb, 61, 2);
V("_setDetectTitle", lb, 62, 2);
V("_setLocalGifPath", wb, 46, 0);
V("_setLocalServerMode", xb, 92, void 0, 0);
V("_setRemoteServerMode", xb, 63, void 0, 1);
V("_setLocalRemoteServerMode", xb, 47, void 0, 2);
V("_setSampleRate", vb, 45, 1);
V("_setCampaignTrack", kb, 36, 2);
V("_setAllowAnchor", gb, 7, 2);
V("_setCampNameKey", ob, 41);
V("_setCampContentKey", tb, 38);
V("_setCampIdKey", nb, 39);
V("_setCampMediumKey", rb, 40);
V("_setCampNOKey", ub, 42);
V("_setCampSourceKey", qb, 43);
V("_setCampTermKey", sb, 44);
V("_setCampCIdKey", pb, 37);
V("_setCookiePath", P, 9, 0);
V("_setMaxCustomVariables", yb, 0, 1);
V("_setVisitorCookieTimeout", cb, 28, 1);
V("_setSessionCookieTimeout", db, 26, 1);
V("_setCampaignCookieTimeout", eb, 29, 1);
V("_setReferrerOverride", Jb, 49);
V("_setSiteSpeedSampleRate", Dc, 132);
a("_trackPageview", U.prototype.Fa, 1);
a("_trackEvent", U.prototype.F, 4);
a("_trackPageLoadTime", U.prototype.Ea, 100);
a("_trackSocial", U.prototype.Ga, 104);
a("_trackTrans", U.prototype.Ia, 18);
a("_sendXEvent", U.prototype.ib, 78);
a("_createEventTracker", U.prototype.ia, 74);
a("_getVersion", U.prototype.qa, 60);
a("_setDomainName", U.prototype.B, 6);
a("_setAllowHash", U.prototype.va, 8);
a("_getLinkerUrl", U.prototype.na, 52);
a("_link", U.prototype.link, 101);
a("_linkByPost", U.prototype.ua, 102);
a("_setTrans", U.prototype.za, 20);
a("_addTrans", U.prototype.$, 21);
a("_addItem", U.prototype.Y, 19);
a("_clearTrans", U.prototype.ea, 105);
a("_setTransactionDelim", U.prototype.Aa, 82);
a("_setCustomVar", U.prototype.wa, 10);
a("_deleteCustomVar", U.prototype.ka, 35);
a("_getVisitorCustomVar", U.prototype.ra, 50);
a("_setXKey", U.prototype.Ca, 83);
a("_setXValue", U.prototype.Da, 84);
a("_getXKey", U.prototype.sa, 76);
a("_getXValue", U.prototype.ta, 77);
a("_clearXKey", U.prototype.fa, 72);
a("_clearXValue", U.prototype.ga, 73);
a("_createXObj", U.prototype.ja, 75);
a("_addIgnoredOrganic", U.prototype.W, 15);
a("_clearIgnoredOrganic", U.prototype.ba, 97);
a("_addIgnoredRef", U.prototype.X, 31);
a("_clearIgnoredRef", U.prototype.ca, 32);
a("_addOrganic", U.prototype.Z, 14);
a("_clearOrganic", U.prototype.da, 70);
a("_cookiePathCopy", U.prototype.ha, 30);
a("_get", U.prototype.ma, 106);
a("_set", U.prototype.xa, 107);
a("_addEventListener", U.prototype.addEventListener, 108);
a("_removeEventListener", U.prototype.removeEventListener, 109);
a("_addDevId", U.prototype.V);
a("_getPlugin", Pc, 122);
a("_setPageGroup", U.prototype.ya, 126);
a("_trackTiming", U.prototype.Ha, 124);
a("_initData", U.prototype.initData, 2);
a("_setVar", U.prototype.Ba, 22);
V("_setSessionTimeout", db, 27, 3);
V("_setCookieTimeout", eb, 25, 3);
V("_setCookiePersistence", cb, 24, 1);
a("_setAutoTrackOutbound", Fa, 79);
a("_setTrackOutboundSubdomains", Fa, 81);
a("_setHrefExamineLimit", Fa, 80)
};
function Pc(a) {
var b = this.plugins_;
if (b)
return b.get(a)
}
var T = function (a, b, c, d) {
a[b] = function () {
try {
return void 0 != d && H(d),
c.apply(this, arguments)
} catch (e) {
throw Ra("exc", b, e && e.name),
e;
}
}
},
Qc = function (a, b, c, d) {
U.prototype[a] = function () {
try {
return H(c),
Aa(this.a.get(b), d)
} catch (e) {
throw Ra("exc", a, e && e.name),
e;
}
}
},
V = function (a, b, c, d, e) {
U.prototype[a] = function (f) {
try {
H(c),
void 0 == e ? this.a.set(b, Aa(f, d)) : this.a.set(b, e)
} catch (Be) {
throw Ra("exc", a, Be && Be.name),
Be;
}
}
},
Se = function (a, b) {
return {
type: b,
target: a,
stopPropagation: function () {
throw "aborted";
}
}
};
var Rc = new RegExp(/(^|\.)doubleclick\.net$/i),
Sc = function (a, b) {
return Rc.test(J.location.hostname) ? !0 : "/" !== b ? !1 : 0 != a.indexOf("www.google.") && 0 != a.indexOf(".google.") && 0 != a.indexOf("google.") || -1 < a.indexOf("google.org") ? !1 : !0
},
Tc = function (a) {
var b = a.get(bb),
c = a.c(P, "/");
Sc(b, c) && a.stopPropagation()
};
var Zc = function () {
var a = {},
b = {},
c = new Uc;
this.g = function (a, b) {
c.add(a, b)
};
var d = new Uc;
this.v = function (a, b) {
d.add(a, b)
};
var e = !1,
f = !1,
Be = !0;
this.T = function () {
e = !0
};
this.j = function (a) {
this.load();
this.set(sc, a, !0);
a = new Vc(this);
e = !1;
d.cb(this);
e = !0;
b = {};
this.gb();
a.Ja()
};
this.load = function () {
e && (e = !1, this.Ka(), Wc(this), f || (f = !0, c.cb(this), Xc(this), Wc(this)), e = !0)
};
this.gb = function () {
e && (f ? (e = !1, Xc(this), e = !0) : this.load())
};
this.get = function (c) {
Ua[c] && this.load();
return void 0 !== b[c] ? b[c] : a[c]
};
this.set = function (c, d, e) {
Ua[c] && this.load();
e ? b[c] = d : a[c] = d;
Ua[c] && this.gb()
};
this.Za = function (b) {
a[b] = this.b(b, 0) + 1
};
this.b = function (a, b) {
a = this.get(a);
return void 0 == a || "" === a ? b : 1 * a
};
this.c = function (a, b) {
a = this.get(a);
return void 0 == a ? b : a + ""
};
this.Ka = function () {
if (Be) {
var b = this.c(bb, ""),
c = this.c(P, "/");
Sc(b, c) || (a[O] = a[hb] && "" != b ? Yc(b) : 1, Be = !1)
}
}
};
Zc.prototype.stopPropagation = function () {
throw "aborted";
};
var Vc = function (a) {
var b = this;
this.fb = 0;
var c = a.get(tc);
this.Ua = function () {
0 < b.fb && c && (b.fb--, b.fb || c())
};
this.Ja = function () {
!b.fb && c && setTimeout(c, 10)
};
a.set(uc, b, !0)
};
function $c(a, b) {
b = b || [];
for (var c = 0; c < b.length; c++) {
var d = b[c];
if ("" + a == d || 0 == d.indexOf(a + "."))
return d
}
return "-"
}
var bd = function (a, b, c) {
c = c ? "" : a.c(O, "1");
b = b.split(".");
if (6 !== b.length || ad(b[0], c))
return !1;
c = 1 * b[1];
var d = 1 * b[2],
e = 1 * b[3],
f = 1 * b[4];
b = 1 * b[5];
if (!(0 <= c && 0 < d && 0 < e && 0 < f && 0 <= b))
return !1;
a.set(Q, c);
a.set(Vb, d);
a.set(Wb, e);
a.set(Zb, f);
a.set($b, b);
return !0
},
cd = function (a) {
var b = a.get(Q),
c = a.get(Vb),
d = a.get(Wb),
e = a.get(Zb),
f = a.b($b, 1);
return [a.b(O, 1), void 0 != b ? b : "-", c || "-", d || "-", e || "-", f].join(".")
},
dd = function (a) {
return [a.b(O, 1), a.b(cc, 0), a.b(R, 1), a.b(dc, 0)].join(".")
},
ed = function (a, b, c) {
c = c ? "" : a.c(O, "1");
var d = b.split(".");
if (4 !== d.length || ad(d[0], c))
d = null;
a.set(cc, d ? 1 * d[1] : 0);
a.set(R, d ? 1 * d[2] : 10);
a.set(dc, d ? 1 * d[3] : a.get(ab));
return null != d || !ad(b, c)
},
fd = function (a, b) {
var c = G(a.c(Tb, "")),
d = [],
e = a.get(Fb);
if (!b && e) {
for (b = 0; b < e.length; b++) {
var f = e[b];
f && 1 == f.scope && d.push(b + "=" + G(f.name) + "=" + G(f.value) + "=1")
}
0 < d.length && (c += "|" + d.join("^"))
}
return c ? a.b(O, 1) + "." + c : null
},
gd = function (a, b, c) {
c = c ? "" : a.c(O, "1");
b = b.split(".");
if (2 > b.length || ad(b[0], c))
return !1;
b = b.slice(1).join(".").split("|");
0 < b.length && a.set(Tb, I(b[0]));
if (1 >= b.length)
return !0;
b = b[1].split(-1 == b[1].indexOf(",") ? "^" : ",");
for (c = 0; c < b.length; c++) {
var d = b[c].split("=");
if (4 == d.length) {
var e = {};
e.name = I(d[1]);
e.value = I(d[2]);
e.scope = 1;
a.get(Fb)[d[0]] = e
}
}
return !0
},
hd = function (a, b) {
return (b = Te(a, b)) ? [a.b(O, 1), a.b(ec, 0), a.b(fc, 1), a.b(gc, 1), b].join(".") : ""
},
Te = function (a) {
function b(b, e) {
F(a.get(b)) || (b = a.c(b, ""), b = b.split(" ").join("%20"), b = b.split("+").join("%20"), c.push(e + "=" + b))
}
var c = [];
b(ic, "utmcid");
b(nc, "utmcsr");
b(S, "utmgclid");
b(kc, "utmgclsrc");
b(lc, "utmdclid");
b(mc, "utmdsid");
b(jc, "utmccn");
b(oc, "utmcmd");
b(pc, "utmctr");
b(qc, "utmcct");
return c.join("|")
},
id = function (a, b, c) {
c = c ? "" : a.c(O, "1");
b = b.split(".");
if (5 > b.length || ad(b[0], c))
return a.set(ec, void 0), a.set(fc, void 0), a.set(gc, void 0), a.set(ic, void 0), a.set(jc, void 0), a.set(nc, void 0), a.set(oc, void 0), a.set(pc, void 0), a.set(qc, void 0), a.set(S, void 0), a.set(kc, void 0), a.set(lc, void 0), a.set(mc, void 0), !1;
a.set(ec, 1 * b[1]);
a.set(fc, 1 * b[2]);
a.set(gc, 1 * b[3]);
Ue(a, b.slice(4).join("."));
return !0
},
Ue = function (a, b) {
function c(a) {
return (a = b.match(a + "=(.*?)(?:\\|utm|$)")) && 2 == a.length ? a[1] : void 0
}
function d(b, c) {
c ? (c = e ? I(c) : c.split("%20").join(" "), a.set(b, c)) : a.set(b, void 0)
}
-1 == b.indexOf("=") && (b = I(b));
var e = "2" == c("utmcvr");
d(ic, c("utmcid"));
d(jc, c("utmccn"));
d(nc, c("utmcsr"));
d(oc, c("utmcmd"));
d(pc, c("utmctr"));
d(qc, c("utmcct"));
d(S, c("utmgclid"));
d(kc, c("utmgclsrc"));
d(lc, c("utmdclid"));
d(mc, c("utmdsid"))
},
ad = function (a, b) {
return b ? a != b : !/^\d+$/.test(a)
};
var Uc = function () {
this.filters = []
};
Uc.prototype.add = function (a, b) {
this.filters.push({
name: a,
s: b
})
};
Uc.prototype.cb = function (a) {
try {
for (var b = 0; b < this.filters.length; b++)
this.filters[b].s.call(W, a)
} catch (c) {}
};
function jd(a) {
100 != a.get(vb) && a.get(Q) % 1E4 >= 100 * a.get(vb) && a.stopPropagation()
}
function kd(a) {
ld(a.get(Wa)) && a.stopPropagation()
}
function md(a) {
"file:" == J.location.protocol && a.stopPropagation()
}
function Ge(a) {
He() && a.stopPropagation()
}
function nd(a) {
a.get(Ib) || a.set(Ib, J.title, !0);
a.get(Hb) || a.set(Hb, J.location.pathname + J.location.search, !0)
}
function hf(a) {
a.get(Wa) && "UA-XXXXX-X" != a.get(Wa) || a.stopPropagation()
};
var od = new function () {
var a = [];
this.set = function (b) {
a[b] = !0
};
this.encode = function () {
for (var b = [], c = 0; c < a.length; c++)
a[c] && (b[Math.floor(c / 6)] ^= 1 << c % 6);
for (c = 0; c < b.length; c++)
b[c] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(b[c] || 0);
return b.join("") + "~"
}
};
function H(a) {
od.set(a)
};
var W = window,
J = document,
ld = function (a) {
var b = W._gaUserPrefs;
if (b && b.ioo && b.ioo() || a && !0 === W["ga-disable-" + a])
return !0;
try {
var c = W.external;
if (c && c._gaUserPrefs && "oo" == c._gaUserPrefs)
return !0
} catch (d) {}
return !1
},
He = function () {
return W.navigator && "preview" == W.navigator.loadPurpose
},
Ve = function (a, b) {
setTimeout(a, b)
},
pd = function (a) {
var b = [],
c = J.cookie.split(";");
a = new RegExp("^\\s*" + a + "=\\s*(.*?)\\s*$");
for (var d = 0; d < c.length; d++) {
var e = c[d].match(a);
e && b.push(e[1])
}
return b
},
X = function (a, b, c, d, e, f) {
e = ld(e) ? !1 : Sc(d, c) ? !1 : He() ? !1 : !0;
e && ((b = Lc(b)) && 2E3 < b.length && (b = b.substring(0, 2E3), H(69)), a = a + "=" + b + "; path=" + c + "; ", f && (a += "expires=" + (new Date((new Date).getTime() + f)).toGMTString() + "; "), d && (a += "domain=" + d + ";"), J.cookie = a)
},
Lc = function (a) {
if (!a)
return a;
var b = a.indexOf(";");
-1 != b && (a = a.substring(0, b), H(141));
if (!(0 <= W.navigator.userAgent.indexOf("Firefox")))
return a;
a = a.replace(/\n|\r/g, " ");
for (var b = 0, c = a.length; b < c; ++b) {
var d = a.charCodeAt(b) & 255;
if (10 == d || 13 == d)
a = a.substring(0, b) + "?" + a.substring(b +
1)
}
return a
};
var qd,
rd,
sd = function () {
if (!qd) {
var a = {},
b = W.navigator,
c = W.screen;
a.jb = c ? c.width + "x" + c.height : "-";
a.P = c ? c.colorDepth + "-bit" : "-";
a.language = (b && (b.language || b.browserLanguage) || "-").toLowerCase();
a.javaEnabled = b && b.javaEnabled() ? 1 : 0;
a.characterSet = J.characterSet || J.charset || "-";
try {
var d;
var e = J.documentElement,
f = J.body,
Be = f && f.clientWidth && f.clientHeight,
b = [];
e && e.clientWidth && e.clientHeight && ("CSS1Compat" === J.compatMode || !Be) ? b = [e.clientWidth, e.clientHeight] : Be && (b = [f.clientWidth, f.clientHeight]);
d = 0 >= b[0] || 0 >= b[1] ? "" : b.join("x");
a.Wa = d
} catch (n) {
H(135)
}
qd = a
}
},
td = function () {
sd();
for (var a = qd, b = W.navigator, a = b.appName + b.version + a.language + b.platform + b.userAgent + a.javaEnabled + a.jb + a.P + (J.cookie ? J.cookie : "") + (J.referrer ? J.referrer : ""), b = a.length, c = W.history.length; 0 < c; )
a += c-- ^ b++;
return Yc(a)
},
ud = function (a) {
sd();
var b = qd;
a.set(Lb, b.jb);
a.set(Mb, b.P);
a.set(Pb, b.language);
a.set(Qb, b.characterSet);
a.set(Nb, b.javaEnabled);
a.set(Rb, b.Wa);
if (a.get(ib) && a.get(jb)) {
if (!(b = rd)) {
var c,
d,
e;
d = "ShockwaveFlash";
if ((b = (b = W.navigator) ? b.plugins : void 0) && 0 < b.length)
for (c = 0; c < b.length && !e; c++)
d = b[c], -1 < d.name.indexOf("Shockwave Flash") && (e = d.description.split("Shockwave Flash ")[1]);
else {
d = d + "." + d;
try {
c = new ActiveXObject(d + ".7"),
e = c.GetVariable("$version")
} catch (f) {}
if (!e)
try {
c = new ActiveXObject(d + ".6"),
e = "WIN 6,0,21,0",
c.AllowScriptAccess = "always",
e = c.GetVariable("$version")
} catch (f) {}
if (!e)
try {
c = new ActiveXObject(d),
e = c.GetVariable("$version")
} catch (f) {}
e && (e = e.split(" ")[1].split(","), e = e[0] + "." + e[1] + " r" +
e[2])
}
b = e ? e : "-"
}
rd = b;
a.set(Ob, rd)
} else
a.set(Ob, "-")
};
var vd = function (a) {
if (Ba(a))
this.s = a;
else {
var b = a[0],
c = b.lastIndexOf(":"),
d = b.lastIndexOf(".");
this.h = this.i = this.l = "";
-1 == c && -1 == d ? this.h = b : -1 == c && -1 != d ? (this.i = b.substring(0, d), this.h = b.substring(d + 1)) : -1 != c && -1 == d ? (this.l = b.substring(0, c), this.h = b.substring(c + 1)) : c > d ? (this.i = b.substring(0, d), this.l = b.substring(d + 1, c), this.h = b.substring(c + 1)) : (this.i = b.substring(0, d), this.h = b.substring(d + 1));
this.Xa = a.slice(1);
this.Ma = !this.l && "_require" == this.h;
this.J = !this.i && !this.l && "_provide" == this.h
}
},
Y = function () {
T(Y.prototype, "push", Y.prototype.push, 5);
T(Y.prototype, "_getPlugin", Pc, 121);
T(Y.prototype, "_createAsyncTracker", Y.prototype.Sa, 33);
T(Y.prototype, "_getAsyncTracker", Y.prototype.Ta, 34);
this.I = new Bd;
this.eb = []
};
E = Y.prototype;
E.Na = function (a, b, c) {
var d = this.I.get(a);
if (!Ba(d))
return !1;
b.plugins_ = b.plugins_ || new Bd;
b.plugins_.set(a, new d(b, c || {}));
return !0
};
E.push = function (a) {
var b = Z.Va.apply(this, arguments),
b = Z.eb.concat(b);
for (Z.eb = []; 0 < b.length && !Z.O(b[0]) && !(b.shift(), 0 < Z.eb.length); );
Z.eb = Z.eb.concat(b);
return 0
};
E.Va = function (a) {
for (var b = [], c = 0; c < arguments.length; c++)
try {
var d = new vd(arguments[c]);
d.J ? this.O(d) : b.push(d)
} catch (e) {}
return b
};
E.O = function (a) {
try {
if (a.s)
a.s.apply(W);
else if (a.J)
this.I.set(a.Xa[0], a.Xa[1]);
else {
var b = "_gat" == a.i ? M : "_gaq" == a.i ? Z : M.u(a.i);
if (a.Ma) {
if (!this.Na(a.Xa[0], b, a.Xa[2])) {
if (!a.Pa) {
var c = Oa("" + a.Xa[1]);
var d = c.protocol,
e = J.location.protocol;
var f;
if (f = "https:" == d || d == e ? !0 : "http:" != d ? !1 : "http:" == e)
a: {
var Be = Oa(J.location.href);
if (!(c.query || 0 <= c.url.indexOf("?") || 0 <= c.path.indexOf("://") || c.host == Be.host && c.port == Be.port))
for (var n = "http:" == c.protocol ? 80 : 443, Ja = M.S, b = 0; b < Ja.length; b++)
if (c.host == Ja[b][0] && (c.port || n) == (Ja[b][1] || n) && 0 == c.path.indexOf(Ja[b][2])) {
f = !0;
break a
}
f = !1
}
f && !ld() && (a.Pa = Ia(c.url))
}
return !0
}
} else
a.l && (b = b.plugins_.get(a.l)), b[a.h].apply(b, a.Xa)
}
} catch (t) {}
};
E.Sa = function (a, b) {
return M.hb(a, b || "")
};
E.Ta = function (a) {
return M.u(a)
};
var yd = function () {
function a(a, b, c, d) {
void 0 == f[a] && (f[a] = {});
void 0 == f[a][b] && (f[a][b] = []);
f[a][b][c] = d
}
function b(a, b, c) {
if (void 0 != f[a] && void 0 != f[a][b])
return f[a][b][c]
}
function c(a, b) {
if (void 0 != f[a] && void 0 != f[a][b]) {
f[a][b] = void 0;
b = !0;
var c;
for (c = 0; c < Be.length; c++)
if (void 0 != f[a][Be[c]]) {
b = !1;
break
}
b && (f[a] = void 0)
}
}
function d(a) {
var b = "",
c = !1,
d,
e;
for (d = 0; d < Be.length; d++)
if (e = a[Be[d]], void 0 != e) {
c && (b += Be[d]);
var f = e,
Ja = [];
for (e = 0; e < f.length; e++)
if (void 0 != f[e]) {
c = "";
1 != e && void 0 == f[e - 1] && (c += e.toString() + "!");
var fa,
Ke,
Le,
Me = f[e],
ga = "";
for (Le = 0; Le < Me.length; Le++)
Ke = Me.charAt(Le), fa = n[Ke], ga += void 0 != fa ? fa : Ke;
c += ga;
Ja.push(c)
}
b += "(" + Ja.join("*") + ")";
c = !1
} else
c = !0;
return b
}
var e = this,
f = [],
Be = ["k", "v"],
n = {
"'": "'0",
")": "'1",
"*": "'2",
"!": "'3"
};
e.Ra = function (a) {
return void 0 != f[a]
};
e.A = function () {
for (var a = "", b = 0; b < f.length; b++)
void 0 != f[b] && (a += b.toString() + d(f[b]));
return a
};
e.Qa = function (a) {
if (void 0 == a)
return e.A();
for (var b = a.A(), c = 0; c < f.length; c++)
void 0 == f[c] || a.Ra(c) || (b += c.toString() +
d(f[c]));
return b
};
e.f = function (b, c, d) {
if (!wd(d))
return !1;
a(b, "k", c, d);
return !0
};
e.o = function (b, c, d) {
if (!xd(d))
return !1;
a(b, "v", c, d.toString());
return !0
};
e.getKey = function (a, c) {
return b(a, "k", c)
};
e.N = function (a, c) {
return b(a, "v", c)
};
e.L = function (a) {
c(a, "k")
};
e.M = function (a) {
c(a, "v")
};
T(e, "_setKey", e.f, 89);
T(e, "_setValue", e.o, 90);
T(e, "_getKey", e.getKey, 87);
T(e, "_getValue", e.N, 88);
T(e, "_clearKey", e.L, 85);
T(e, "_clearValue", e.M, 86)
};
function wd(a) {
return "string" == typeof a
}
function xd(a) {
return !("number" == typeof a || void 0 != Number && a instanceof Number) || Math.round(a) != a || isNaN(a) || Infinity == a ? !1 : !0
};
var zd = function (a) {
var b = W.gaGlobal;
a && !b && (W.gaGlobal = b = {});
return b
},
Cd = function () {
var a = zd(!0).hid;
null == a && (a = Ea(), zd(!0).hid = a);
return a
},
Dd = function (a) {
a.set(Kb, Cd());
var b = zd();
if (b && b.dh == a.get(O)) {
var c = b.sid;
c && (a.get(ac) ? H(112) : H(132), a.set(Zb, c), a.get(Sb) && a.set(Wb, c));
b = b.vid;
a.get(Sb) && b && (b = b.split("."), a.set(Q, 1 * b[0]), a.set(Vb, 1 * b[1]))
}
};
var Ed,
Fd = function (a, b, c, d) {
var e = a.c(bb, ""),
f = a.c(P, "/");
d = void 0 != d ? d : a.b(cb, 0);
a = a.c(Wa, "");
X(b, c, f, e, a, d)
},
Xc = function (a) {
var b = a.c(bb, "");
a.b(O, 1);
var c = a.c(P, "/"),
d = a.c(Wa, "");
X("__utma", cd(a), c, b, d, a.get(cb));
X("__utmb", dd(a), c, b, d, a.get(db));
X("__utmc", "" + a.b(O, 1), c, b, d);
var e = hd(a, !0);
e ? X("__utmz", e, c, b, d, a.get(eb)) : X("__utmz", "", c, b, "", -1);
(e = fd(a, !1)) ? X("__utmv", e, c, b, d, a.get(cb)) : X("__utmv", "", c, b, "", -1)
},
Wc = function (a) {
var b = a.b(O, 1);
if (!bd(a, $c(b, pd("__utma"))))
return a.set(Ub, !0), !1;
var c = !ed(a, $c(b, pd("__utmb")));
a.set(bc, c);
id(a, $c(b, pd("__utmz")));
gd(a, $c(b, pd("__utmv")));
Ed = !c;
return !0
},
Gd = function (a) {
Ed || 0 < pd("__utmb").length || (X("__utmd", "1", a.c(P, "/"), a.c(bb, ""), a.c(Wa, ""), 1E4), 0 == pd("__utmd").length && a.stopPropagation())
};
var h = 0,
Jd = function (a) {
void 0 == a.get(Q) ? Hd(a) : a.get(Ub) && !a.get(Mc) ? Hd(a) : a.get(bc) && Id(a)
},
Kd = function (a) {
a.get(hc) && !a.get(ac) && (Id(a), a.set(fc, a.get($b)))
},
Hd = function (a) {
h++;
1 < h && H(137);
var b = a.get(ab);
a.set(Sb, !0);
a.set(Q, Ea() ^ td(a) & 2147483647);
a.set(Tb, "");
a.set(Vb, b);
a.set(Wb, b);
a.set(Zb, b);
a.set($b, 1);
a.set(ac, !0);
a.set(cc, 0);
a.set(R, 10);
a.set(dc, b);
a.set(Fb, []);
a.set(Ub, !1);
a.set(bc, !1)
},
Id = function (a) {
h++;
1 < h && H(137);
a.set(Wb, a.get(Zb));
a.set(Zb, a.get(ab));
a.Za($b);
a.set(ac, !0);
a.set(cc, 0);
a.set(R, 10);
a.set(dc, a.get(ab));
a.set(bc, !1)
};
var Ld = "daum:q eniro:search_word naver:query pchome:q images.google:q google:q yahoo:p yahoo:q msn:q bing:q aol:query aol:q lycos:q lycos:query ask:q cnn:query virgilio:qs baidu:wd baidu:word alice:qs yandex:text najdi:q seznam:q rakuten:qt biglobe:q goo.ne:MT search.smt.docomo:MT onet:qt onet:q kvasir:q terra:query rambler:query conduit:q babylon:q search-results:q avg:q comcast:q incredimail:q startsiden:q go.mail.ru:q centrum.cz:q 360.cn:q sogou:query tut.by:query globo:q ukr:q so.com:q haosou.com:q auone:q".split(" "),
Sd = function (a) {
if (a.get(kb) && !a.get(Mc)) {
var b;
b = !F(a.get(ic)) || !F(a.get(nc)) || !F(a.get(S)) || !F(a.get(lc));
for (var c = {}, d = 0; d < Md.length; d++) {
var e = Md[d];
c[e] = a.get(e)
}
(d = a.get(rc)) ? (H(149), e = new Bd, Na(e, d), d = e) : d = La(J.location.href, a.get(gb)).R;
if ("1" != L(d.get(a.get(ub))) || !b)
if (d = We(a, d) || Qd(a), d || b || !a.get(ac) || (Pd(a, void 0, "(direct)", void 0, void 0, void 0, "(direct)", "(none)", void 0, void 0), d = !0), d && (a.set(hc, Rd(a, c)), b = "(direct)" == a.get(nc) && "(direct)" == a.get(jc) && "(none)" == a.get(oc), a.get(hc) || a.get(ac) && !b))
a.set(ec, a.get(ab)), a.set(fc, a.get($b)), a.Za(gc)
}
},
We = function (a, b) {
function c(c, d) {
d = d || "-";
return (c = L(b.get(a.get(c)))) && "-" != c ? I(c) : d
}
var d = L(b.get(a.get(nb))) || "-",
e = L(b.get(a.get(qb))) || "-",
f = L(b.get(a.get(pb))) || "-",
Be = L(b.get("gclsrc")) || "-",
n = L(b.get("dclid")) || "-",
Ja = c(ob, "(not set)"),
t = c(rb, "(not set)"),
Za = c(sb),
Ma = c(tb);
if (F(d) && F(f) && F(n) && F(e))
return !1;
var mb = !F(f) && !F(Be),
mb = F(e) && (!F(n) || mb),
Xb = F(Za);
if (mb || Xb) {
var Ad = Nd(a),
Ad = La(Ad, !0);
(Ad = Od(a, Ad)) && !F(Ad[1] && !Ad[2]) && (mb && (e = Ad[0]), Xb && (Za = Ad[1]))
}
Pd(a, d, e, f, Be, n, Ja, t, Za, Ma);
return !0
},
Qd = function (a) {
var b = Nd(a),
c = La(b, !0);
(b = !(void 0 != b && null != b && "" != b && "0" != b && "-" != b && 0 <= b.indexOf("://"))) || (b = c && -1 < c.host.indexOf("google") && c.R.contains("q") && "cse" == c.path);
if (b)
return !1;
if ((b = Od(a, c)) && !b[2])
return Pd(a, void 0, b[0], void 0, void 0, void 0, "(organic)", "organic", b[1], void 0), !0;
if (b || !a.get(ac))
return !1;
a: {
for (var b = a.get(Bb), d = Ka(c.host), e = 0; e < b.length; ++e)
if (-1 < d.indexOf(b[e])) {
a = !1;
break a
}
Pd(a, void 0, d, void 0, void 0, void 0, "(referral)", "referral", void 0, "/" + c.path);
a = !0
}
return a
},
Od = function (a, b) {
for (var c = a.get(zb), d = 0; d < c.length; ++d) {
var e = c[d].split(":");
if (-1 < b.host.indexOf(e[0].toLowerCase())) {
var f = b.R.get(e[1]);
if (f && (f = K(f), !f && -1 < b.host.indexOf("google.") && (f = "(not provided)"), !e[3] || -1 < b.url.indexOf(e[3]))) {
f || H(151);
a: {
b = f;
a = a.get(Ab);
b = I(b).toLowerCase();
for (c = 0; c < a.length; ++c)
if (b == a[c]) {
a = !0;
break a
}
a = !1
}
return [e[2] || e[0], f, a]
}
}
}
return null
},
Pd = function (a, b, c, d, e, f, Be, n, Ja, t) {
a.set(ic, b);
a.set(nc, c);
a.set(S, d);
a.set(kc, e);
a.set(lc, f);
a.set(jc, Be);
a.set(oc, n);
a.set(pc, Ja);
a.set(qc, t)
},
Md = [jc, ic, S, lc, nc, oc, pc, qc],
Rd = function (a, b) {
function c(a) {
a = ("" + a).split("+").join("%20");
return a = a.split(" ").join("%20")
}
function d(c) {
var d = "" + (a.get(c) || "");
c = "" + (b[c] || "");
return 0 < d.length && d == c
}
if (d(S) || d(lc))
return H(131), !1;
for (var e = 0; e < Md.length; e++) {
var f = Md[e],
Be = b[f] || "-",
f = a.get(f) || "-";
if (c(Be) != c(f))
return !0
}
return !1
},
Td = new RegExp(/^https?:\/\/(www\.)?google(\.com?)?(\.[a-z]{2}t?)?\/?$/i),
cf = /^https?:\/\/(r\.)?search\.yahoo\.com?(\.jp)?\/?[^?]*$/i,
of = /^https?:\/\/(www\.)?bing\.com\/?$/i,
Nd = function (a) {
a = Pa(a.get(Jb), a.get(P));
try {
if (Td.test(a))
return H(136), a + "?q=";
if (cf.test(a))
return H(150), a + "?p=(not provided)";
if (of.test(a))
return a + "?q=(not provided)"
} catch (b) {
H(145)
}
return a
};
var Ud,
Vd,
Wd = function (a) {
Ud = a.c(S, "");
Vd = a.c(kc, "")
},
Xd = function (a) {
var b = a.c(S, ""),
c = a.c(kc, "");
b != Ud && (-1 < c.indexOf("ds") ? a.set(mc, void 0) : !F(Ud) && -1 < Vd.indexOf("ds") && a.set(mc, Ud))
};
var Zd = function (a) {
Yd(a, J.location.href) ? (a.set(Mc, !0), H(12)) : a.set(Mc, !1)
},
Yd = function (a, b) {
if (!a.get(fb))
return !1;
var c = La(b, a.get(gb));
b = K(c.R.get("__utma"));
var d = K(c.R.get("__utmb")),
e = K(c.R.get("__utmc")),
f = K(c.R.get("__utmx")),
Be = K(c.R.get("__utmz")),
n = K(c.R.get("__utmv")),
c = K(c.R.get("__utmk"));
if (Yc("" + b + d + e + f + Be + n) != c) {
b = I(b);
d = I(d);
e = I(e);
f = I(f);
e = $d(b + d + e + f, Be, n, c);
if (!e)
return !1;
Be = e[0];
n = e[1]
}
if (!bd(a, b, !0))
return !1;
ed(a, d, !0);
id(a, Be, !0);
gd(a, n, !0);
ae(a, f, !0);
return !0
},
ce = function (a, b, c) {
var d;
d = cd(a) || "-";
var e = dd(a) || "-",
f = "" + a.b(O, 1) || "-",
Be = be(a) || "-",
n = hd(a, !1) || "-";
a = fd(a, !1) || "-";
var Ja = Yc("" + d + e + f + Be + n + a),
t = [];
t.push("__utma=" + d);
t.push("__utmb=" + e);
t.push("__utmc=" + f);
t.push("__utmx=" + Be);
t.push("__utmz=" + n);
t.push("__utmv=" + a);
t.push("__utmk=" + Ja);
d = t.join("&");
if (!d)
return b;
e = b.indexOf("#");
if (c)
return 0 > e ? b + "#" + d : b + "&" + d;
c = "";
0 < e && (c = b.substring(e), b = b.substring(0, e));
return 0 > b.indexOf("?") ? b + "?" + d + c : b + "&" + d + c
},
$d = function (a, b, c, d) {
for (var e = 0; 3 > e; e++) {
for (var f = 0; 3 > f; f++) {
if (d == Yc(a + b + c))
return H(127), [b, c];
var Be = b.replace(/ /g, "%20"),
n = c.replace(/ /g, "%20");
if (d == Yc(a + Be + n))
return H(128), [Be, n];
Be = Be.replace(/\+/g, "%20");
n = n.replace(/\+/g, "%20");
if (d == Yc(a + Be + n))
return H(129), [Be, n];
try {
var Ja = b.match("utmctr=(.*?)(?:\\|utm|$)");
if (Ja && 2 == Ja.length && (Be = b.replace(Ja[1], G(I(Ja[1]))), d == Yc(a + Be + c)))
return H(139), [Be, c]
} catch (t) {}
b = I(b)
}
c = I(c)
}
};
var de = "|",
fe = function (a, b, c, d, e, f, Be, n, Ja) {
var t = ee(a, b);
t || (t = {}, a.get(Cb).push(t));
t.id_ = b;
t.affiliation_ = c;
t.total_ = d;
t.tax_ = e;
t.shipping_ = f;
t.city_ = Be;
t.state_ = n;
t.country_ = Ja;
t.items_ = t.items_ || [];
return t
},
ge = function (a, b, c, d, e, f, Be) {
a = ee(a, b) || fe(a, b, "", 0, 0, 0, "", "", "");
var n;
a: {
if (a && a.items_) {
n = a.items_;
for (var Ja = 0; Ja < n.length; Ja++)
if (n[Ja].sku_ == c) {
n = n[Ja];
break a
}
}
n = null
}
Ja = n || {};
Ja.transId_ = b;
Ja.sku_ = c;
Ja.name_ = d;
Ja.category_ = e;
Ja.price_ = f;
Ja.quantity_ = Be;
n || a.items_.push(Ja);
return Ja
},
ee = function (a, b) {
a = a.get(Cb);
for (var c = 0; c < a.length; c++)
if (a[c].id_ == b)
return a[c];
return null
};
var he,
ie = function (a) {
if (!he) {
var b;
b = J.location.hash;
var c = W.name,
d = /^#?gaso=([^&]*)/;
if (c = (b = (b = b && b.match(d) || c && c.match(d)) ? b[1] : K(pd("GASO"))) && b.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))
Fd(a, "GASO", "" + b, 0), M._gasoDomain = a.get(bb), M._gasoCPath = a.get(P), a = c[1], Ia("https://www.google.com/analytics/web/inpage/pub/inpage.js?" + (a ? "prefix=" + a + "&" : "") + Ea(), "_gasojs");
he = !0
}
};
var ae = function (a, b, c) {
c && (b = I(b));
c = a.b(O, 1);
b = b.split(".");
2 > b.length || !/^\d+$/.test(b[0]) || (b[0] = "" + c, Fd(a, "__utmx", b.join("."), void 0))
},
be = function (a, b) {
a = $c(a.get(O), pd("__utmx"));
"-" == a && (a = "");
return b ? G(a) : a
},
Xe = function (a) {
try {
var b = La(J.location.href, !1),
c = decodeURIComponent(L(b.R.get("utm_referrer"))) || "";
c && a.set(Jb, c);
var d = decodeURIComponent(K(b.R.get("utm_expid"))) || "";
d && (d = d.split(".")[0], a.set(Oc, "" + d))
} catch (e) {
H(146)
}
},
k = function (a) {
var b = W.gaData && W.gaData.expId;
b && a.set(Oc, "" + b)
};
var ke = function (a, b) {
var c = Math.min(a.b(Dc, 0), 100);
if (a.b(Q, 0) % 100 >= c)
return !1;
c = Ye() || Ze();
if (void 0 == c)
return !1;
var d = c[0];
if (void 0 == d || Infinity == d || isNaN(d))
return !1;
0 < d ? $e(c) ? b(je(c)) : b(je(c.slice(0, 1))) : Ga(W, "load", function () {
ke(a, b)
}, !1);
return !0
},
me = function (a, b, c, d) {
var e = new yd;
e.f(14, 90, b.substring(0, 500));
e.f(14, 91, a.substring(0, 150));
e.f(14, 92, "" + le(c));
void 0 != d && e.f(14, 93, d.substring(0, 500));
e.o(14, 90, c);
return e
},
$e = function (a) {
for (var b = 1; b < a.length; b++)
if (isNaN(a[b]) || Infinity == a[b] || 0 > a[b])
return !1;
return !0
},
le = function (a) {
return isNaN(a) || 0 > a ? 0 : 5E3 > a ? 10 * Math.floor(a / 10) : 5E4 > a ? 100 * Math.floor(a / 100) : 41E5 > a ? 1E3 * Math.floor(a / 1E3) : 41E5
},
je = function (a) {
for (var b = new yd, c = 0; c < a.length; c++)
b.f(14, c + 1, "" + le(a[c])), b.o(14, c + 1, a[c]);
return b
},
Ye = function () {
var a = W.performance || W.webkitPerformance;
if (a = a && a.timing) {
var b = a.navigationStart;
if (0 == b)
H(133);
else
return [a.loadEventStart - b, a.domainLookupEnd - a.domainLookupStart, a.connectEnd - a.connectStart, a.responseStart - a.requestStart, a.responseEnd - a.responseStart, a.fetchStart - b, a.domInteractive - b, a.domContentLoadedEventStart - b]
}
},
Ze = function () {
if (W.top == W) {
var a = W.external,
b = a && a.onloadT;
a && !a.isValidLoadTime && (b = void 0);
2147483648 < b && (b = void 0);
0 < b && a.setPageReadyTime();
if (void 0 != b)
return [b]
}
};
var bf = function (a) {
if (a.get(Sb))
try {
var b;
a: {
var c = pd(a.get(Ne) || "_ga");
if (c && !(1 > c.length)) {
for (var d = [], e = 0; e < c.length; e++) {
var f;
var Be = c[e].split("."),
n = Be.shift();
if (("GA1" == n || "1" == n) && 1 < Be.length) {
var Ja = Be.shift().split("-");
1 == Ja.length && (Ja[1] = "1");
Ja[0] *= 1;
Ja[1] *= 1;
f = {
Ya: Ja,
$a: Be.join(".")
}
} else
f = void 0;
f && d.push(f)
}
if (1 == d.length) {
b = d[0].$a;
break a
}
if (0 != d.length) {
var t = a.get(Oe) || a.get(bb),
d = af(d, (0 == t.indexOf(".") ? t.substr(1) : t).split(".").length, 0);
if (1 == d.length) {
b = d[0].$a;
break a
}
var Za = a.get(Pe) || a.get(P);
(c = Za) ? (1 < c.length && "/" == c.charAt(c.length - 1) && (c = c.substr(0, c.length - 1)), 0 != c.indexOf("/") && (c = "/" + c), Za = c) : Za = "/";
d = af(d, "/" == Za ? 1 : Za.split("/").length, 1);
b = d[0].$a;
break a
}
}
b = void 0
}
if (b) {
var Ma = ("" + b).split(".");
2 == Ma.length && /[0-9.]/.test(Ma) && (H(114), a.set(Q, Ma[0]), a.set(Vb, Ma[1]), a.set(Sb, !1))
}
} catch (mb) {
H(115)
}
},
af = function (a, b, c) {
for (var d = [], e = [], f = 128, Be = 0; Be < a.length; Be++) {
var n = a[Be];
n.Ya[c] == b ? d.push(n) : n.Ya[c] == f ? e.push(n) : n.Ya[c] < f && (e = [n], f = n.Ya[c])
}
return 0 < d.length ? d : e
};
var nf = /^gtm\d+$/,
Jc = function (a) {
var b;
b = !!a.b(mf, 1);
b && (H(140), "page" != a.get(sc) ? a.set(kf, "", !0) : (b = a.c(lf, ""), b || (b = (b = a.c($a, "")) && "~0" != b ? nf.test(b) ? "__utmt_" + G(a.c(Wa, "")) : "__utmt_" + G(b) : "__utmt"), 0 < pd(b).length ? a.set(kf, "", !0) : (X(b, "1", a.c(P, "/"), a.c(bb, ""), a.c(Wa, ""), 6E5), 0 < pd(b).length && (a.set(kf, Ea(), !0), a.set(jf, 3, !0), a.set(Yb, Kc() + "/r/__utm.gif?", !0)))))
};
var U = function (a, b, c) {
function d(a) {
return function (b) {
if ((b = b.get(Nc)[a]) && b.length)
for (var c = Se(e, a), d = 0; d < b.length; d++)
b[d].call(e, c)
}
}
var e = this;
this.a = new Zc;
this.get = function (a) {
return this.a.get(a)
};
this.set = function (a, b, c) {
this.a.set(a, b, c)
};
this.set(Wa, b || "UA-XXXXX-X");
this.set($a, a || "");
this.set(Ya, c || "");
this.set(ab, Math.round((new Date).getTime() / 1E3));
this.set(P, "/");
this.set(cb, 63072E6);
this.set(eb, 15768E6);
this.set(db, 18E5);
this.set(fb, !1);
this.set(yb, 50);
this.set(gb, !1);
this.set(hb, !0);
this.set(ib, !0);
this.set(jb, !0);
this.set(kb, !0);
this.set(lb, !0);
this.set(ob, "utm_campaign");
this.set(nb, "utm_id");
this.set(pb, "gclid");
this.set(qb, "utm_source");
this.set(rb, "utm_medium");
this.set(sb, "utm_term");
this.set(tb, "utm_content");
this.set(ub, "utm_nooverride");
this.set(vb, 100);
this.set(Dc, 1);
this.set(Ec, !1);
this.set(wb, "/__utm.gif");
this.set(xb, 1);
this.set(Cb, []);
this.set(Fb, []);
this.set(zb, Ld.slice(0));
this.set(Ab, []);
this.set(Bb, []);
this.B("auto");
this.set(Jb, J.referrer);
Xe(this.a);
this.set(Nc, {
hit: [],
load: []
});
this.a.g("0", Zd);
this.a.g("1", Wd);
this.a.g("2", Jd);
this.a.g("3", bf);
this.a.g("4", Sd);
this.a.g("5", Xd);
this.a.g("6", Kd);
this.a.g("7", d("load"));
this.a.g("8", ie);
this.a.v("A", kd);
this.a.v("B", md);
this.a.v("C", Ge);
this.a.v("D", Jd);
this.a.v("E", jd);
this.a.v("F", Tc);
this.a.v("G", ne);
this.a.v("H", hf);
this.a.v("I", Gd);
this.a.v("J", nd);
this.a.v("K", ud);
this.a.v("L", Dd);
this.a.v("M", k);
this.a.v("N", Jc);
this.a.v("O", d("hit"));
this.a.v("P", oe);
this.a.v("Q", pe);
0 === this.get(ab) && H(111);
this.a.T();
this.H = void 0
};
E = U.prototype;
E.m = function () {
var a = this.get(Db);
a || (a = new yd, this.set(Db, a));
return a
};
E.La = function (a) {
for (var b in a) {
var c = a[b];
a.hasOwnProperty(b) && this.set(b, c, !0)
}
};
E.K = function (a) {
if (this.get(Ec))
return !1;
var b = this,
c = ke(this.a, function (c) {
b.set(Hb, a, !0);
b.ib(c)
});
this.set(Ec, c);
return c
};
E.Fa = function (a) {
a && Ca(a) ? (H(13), this.set(Hb, a, !0)) : "object" === typeof a && null !== a && this.La(a);
this.H = a = this.get(Hb);
this.a.j("page");
this.K(a)
};
E.F = function (a, b, c, d, e) {
if ("" == a || !wd(a) || "" == b || !wd(b) || void 0 != c && !wd(c) || void 0 != d && !xd(d))
return !1;
this.set(wc, a, !0);
this.set(xc, b, !0);
this.set(yc, c, !0);
this.set(zc, d, !0);
this.set(vc, !!e, !0);
this.a.j("event");
return !0
};
E.Ha = function (a, b, c, d, e) {
var f = this.a.b(Dc, 0);
1 * e === e && (f = e);
if (this.a.b(Q, 0) % 100 >= f)
return !1;
c = 1 * ("" + c);
if ("" == a || !wd(a) || "" == b || !wd(b) || !xd(c) || isNaN(c) || 0 > c || 0 > f || 100 < f || void 0 != d && ("" == d || !wd(d)))
return !1;
this.ib(me(a, b, c, d));
return !0
};
E.Ga = function (a, b, c, d) {
if (!a || !b)
return !1;
this.set(Ac, a, !0);
this.set(Bc, b, !0);
this.set(Cc, c || J.location.href, !0);
d && this.set(Hb, d, !0);
this.a.j("social");
return !0
};
E.Ea = function () {
this.set(Dc, 10);
this.K(this.H)
};
E.Ia = function () {
this.a.j("trans")
};
E.ib = function (a) {
this.set(Eb, a, !0);
this.a.j("event")
};
E.ia = function (a) {
this.initData();
var b = this;
return {
_trackEvent: function (c, d, e) {
H(91);
b.F(a, c, d, e)
}
}
};
E.ma = function (a) {
return this.get(a)
};
E.xa = function (a, b) {
if (a)
if (Ca(a))
this.set(a, b);
else if ("object" == typeof a)
for (var c in a)
a.hasOwnProperty(c) && this.set(c, a[c])
};
E.addEventListener = function (a, b) {
(a = this.get(Nc)[a]) && a.push(b)
};
E.removeEventListener = function (a, b) {
a = this.get(Nc)[a];
for (var c = 0; a && c < a.length; c++)
if (a[c] == b) {
a.splice(c, 1);
break
}
};
E.qa = function () {
return "5.6.8dc"
};
E.B = function (a) {
this.get(hb);
a = "auto" == a ? Ka(J.domain) : a && "-" != a && "none" != a ? a.toLowerCase() : "";
this.set(bb, a)
};
E.va = function (a) {
this.set(hb, !!a)
};
E.na = function (a, b) {
return ce(this.a, a, b)
};
E.link = function (a, b) {
this.a.get(fb) && a && (J.location.href = ce(this.a, a, b))
};
E.ua = function (a, b) {
this.a.get(fb) && a && a.action && (a.action = ce(this.a, a.action, b))
};
E.za = function () {
this.initData();
var a = this.a,
b = J.getElementById ? J.getElementById("utmtrans") : J.utmform && J.utmform.utmtrans ? J.utmform.utmtrans : null;
if (b && b.value) {
a.set(Cb, []);
for (var b = b.value.split("UTM:"), c = 0; c < b.length; c++) {
b[c] = Da(b[c]);
for (var d = b[c].split(de), e = 0; e < d.length; e++)
d[e] = Da(d[e]);
"T" == d[0] ? fe(a, d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8]) : "I" == d[0] && ge(a, d[1], d[2], d[3], d[4], d[5], d[6])
}
}
};
E.$ = function (a, b, c, d, e, f, Be, n) {
return fe(this.a, a, b, c, d, e, f, Be, n)
};
E.Y = function (a, b, c, d, e, f) {
return ge(this.a, a, b, c, d, e, f)
};
E.Aa = function (a) {
de = a || "|"
};
E.ea = function () {
this.set(Cb, [])
};
E.wa = function (a, b, c, d) {
var e = this.a;
if (0 >= a || a > e.get(yb))
a = !1;
else if (!b || !c || 128 < b.length + c.length)
a = !1;
else {
1 != d && 2 != d && (d = 3);
var f = {};
f.name = b;
f.value = c;
f.scope = d;
e.get(Fb)[a] = f;
a = !0
}
a && this.a.gb();
return a
};
E.ka = function (a) {
this.a.get(Fb)[a] = void 0;
this.a.gb()
};
E.ra = function (a) {
return (a = this.a.get(Fb)[a]) && 1 == a.scope ? a.value : void 0
};
E.Ca = function (a, b, c) {
12 == a && 1 == b ? this.set(Je, c) : this.m().f(a, b, c)
};
E.Da = function (a, b, c) {
this.m().o(a, b, c)
};
E.sa = function (a, b) {
return this.m().getKey(a, b)
};
E.ta = function (a, b) {
return this.m().N(a, b)
};
E.fa = function (a) {
this.m().L(a)
};
E.ga = function (a) {
this.m().M(a)
};
E.ja = function () {
return new yd
};
E.W = function (a) {
a && this.get(Ab).push(a.toLowerCase())
};
E.ba = function () {
this.set(Ab, [])
};
E.X = function (a) {
a && this.get(Bb).push(a.toLowerCase())
};
E.ca = function () {
this.set(Bb, [])
};
E.Z = function (a, b, c, d, e) {
if (a && b) {
a = [a, b.toLowerCase()].join(":");
if (d || e)
a = [a, d, e].join(":");
d = this.get(zb);
d.splice(c ? 0 : d.length, 0, a)
}
};
E.da = function () {
this.set(zb, [])
};
E.ha = function (a) {
this.a.load();
var b = this.get(P),
c = be(this.a);
this.set(P, a);
this.a.gb();
ae(this.a, c);
this.set(P, b)
};
E.ya = function (a, b) {
if (0 < a && 5 >= a && Ca(b) && "" != b) {
var c = this.get(Fc) || [];
c[a] = b;
this.set(Fc, c)
}
};
E.V = function (a) {
a = "" + a;
if (a.match(/^[A-Za-z0-9]{1,5}$/)) {
var b = this.get(Ic) || [];
b.push(a);
this.set(Ic, b)
}
};
E.initData = function () {
this.a.load()
};
E.Ba = function (a) {
a && "" != a && (this.set(Tb, a), this.a.j("var"))
};
var ne = function (a) {
"trans" !== a.get(sc) && 500 <= a.b(cc, 0) && a.stopPropagation();
if ("event" === a.get(sc)) {
var b = (new Date).getTime(),
c = a.b(dc, 0),
d = a.b(Zb, 0),
c = Math.floor((b - (c != d ? c : 1E3 * c)) / 1E3 * 1);
0 < c && (a.set(dc, b), a.set(R, Math.min(10, a.b(R, 0) + c)));
0 >= a.b(R, 0) && a.stopPropagation()
}
},
pe = function (a) {
"event" === a.get(sc) && a.set(R, Math.max(0, a.b(R, 10) - 1))
};
var qe = function () {
var a = [];
this.add = function (b, c, d) {
d && (c = G("" + c));
a.push(b + "=" + c)
};
this.toString = function () {
return a.join("&")
}
},
re = function (a, b) {
(b || 2 != a.get(xb)) && a.Za(cc)
},
se = function (a, b) {
b.add("utmwv", "5.6.8dc");
b.add("utms", a.get(cc));
b.add("utmn", Ea());
var c = J.location.hostname;
F(c) || b.add("utmhn", c, !0);
a = a.get(vb);
100 != a && b.add("utmsp", a, !0)
},
te = function (a, b) {
b.add("utmht", (new Date).getTime());
b.add("utmac", Da(a.get(Wa)));
a.get(Oc) && b.add("utmxkey", a.get(Oc), !0);
a.get(vc) && b.add("utmni", 1);
a.get(Ie) && b.add("utmgtm", a.get(Ie), !0);
var c = a.get(Ic);
c && 0 < c.length && b.add("utmdid", c.join("."));
ef(a, b);
!1 !== a.get(Xa) && (a.get(Xa) || M.w) && b.add("aip", 1);
void 0 !== a.get(kf) && b.add("utmjid", a.c(kf, ""), !0);
a.b(jf, 0) && b.add("utmredir", a.b(jf, 0), !0);
M.bb || (M.bb = a.get(Wa));
(1 < M.ab() || M.bb != a.get(Wa)) && b.add("utmmt", 1);
b.add("utmu", od.encode())
},
ue = function (a, b) {
a = a.get(Fc) || [];
for (var c = [], d = 1; d < a.length; d++)
a[d] && c.push(d + ":" + G(a[d].replace(/%/g, "%25").replace(/:/g, "%3A").replace(/,/g, "%2C")));
c.length && b.add("utmpg", c.join(","))
},
ef = function (a, b) {
function c(a, b) {
b && d.push(a + "=" + b + ";")
}
var d = [];
c("__utma", cd(a));
c("__utmz", hd(a, !1));
c("__utmv", fd(a, !0));
c("__utmx", be(a));
b.add("utmcc", d.join("+"), !0)
},
ve = function (a, b) {
a.get(ib) && (b.add("utmcs", a.get(Qb), !0), b.add("utmsr", a.get(Lb)), a.get(Rb) && b.add("utmvp", a.get(Rb)), b.add("utmsc", a.get(Mb)), b.add("utmul", a.get(Pb)), b.add("utmje", a.get(Nb)), b.add("utmfl", a.get(Ob), !0))
},
we = function (a, b) {
a.get(lb) && a.get(Ib) && b.add("utmdt", a.get(Ib), !0);
b.add("utmhid", a.get(Kb));
b.add("utmr", Pa(a.get(Jb), a.get(P)), !0);
b.add("utmp", G(a.get(Hb), !0), !0)
},
xe = function (a, b) {
for (var c = a.get(Db), d = a.get(Eb), e = a.get(Fb) || [], f = 0; f < e.length; f++) {
var Be = e[f];
Be && (c || (c = new yd), c.f(8, f, Be.name), c.f(9, f, Be.value), 3 != Be.scope && c.f(11, f, "" + Be.scope))
}
F(a.get(wc)) || F(a.get(xc), !0) || (c || (c = new yd), c.f(5, 1, a.get(wc)), c.f(5, 2, a.get(xc)), e = a.get(yc), void 0 != e && c.f(5, 3, e), e = a.get(zc), void 0 != e && c.o(5, 1, e));
F(a.get(Je)) || (c || (c = new yd), c.f(12, 1, a.get(Je)));
c ? b.add("utme", c.Qa(d), !0) : d && b.add("utme", d.A(), !0)
},
ye = function (a, b, c) {
var d = new qe;
re(a, c);
se(a, d);
d.add("utmt", "tran");
d.add("utmtid", b.id_, !0);
d.add("utmtst", b.affiliation_, !0);
d.add("utmtto", b.total_, !0);
d.add("utmttx", b.tax_, !0);
d.add("utmtsp", b.shipping_, !0);
d.add("utmtci", b.city_, !0);
d.add("utmtrg", b.state_, !0);
d.add("utmtco", b.country_, !0);
xe(a, d);
ve(a, d);
we(a, d);
(b = a.get(Gb)) && d.add("utmcu", b, !0);
c || (ue(a, d), te(a, d));
return d.toString()
},
ze = function (a, b, c) {
var d = new qe;
re(a, c);
se(a, d);
d.add("utmt", "item");
d.add("utmtid", b.transId_, !0);
d.add("utmipc", b.sku_, !0);
d.add("utmipn", b.name_, !0);
d.add("utmiva", b.category_, !0);
d.add("utmipr", b.price_, !0);
d.add("utmiqt", b.quantity_, !0);
xe(a, d);
ve(a, d);
we(a, d);
(b = a.get(Gb)) && d.add("utmcu", b, !0);
c || (ue(a, d), te(a, d));
return d.toString()
},
Ae = function (a, b) {
var c = a.get(sc);
if ("page" == c)
c = new qe, re(a, b), se(a, c), xe(a, c), ve(a, c), we(a, c), b || (ue(a, c), te(a, c)), a = [c.toString()];
else if ("event" == c)
c = new qe, re(a, b), se(a, c), c.add("utmt", "event"), xe(a, c), ve(a, c), we(a, c), b || (ue(a, c), te(a, c)), a = [c.toString()];
else if ("var" == c)
c = new qe, re(a, b), se(a, c), c.add("utmt", "var"), !b && te(a, c), a = [c.toString()];
else if ("trans" == c) {
for (var c = [], d = a.get(Cb), e = 0; e < d.length; ++e) {
c.push(ye(a, d[e], b));
for (var f = d[e].items_, Be = 0; Be < f.length; ++Be)
c.push(ze(a, f[Be], b))
}
a = c
} else
"social" == c ? b ? a = [] : (c = new qe, re(a, b), se(a, c), c.add("utmt", "social"), c.add("utmsn", a.get(Ac), !0), c.add("utmsa", a.get(Bc), !0), c.add("utmsid", a.get(Cc), !0), xe(a, c), ve(a, c), we(a, c), ue(a, c), te(a, c), a = [c.toString()]) : "feedback" == c ? b ? a = [] : (c = new qe, re(a, b), se(a, c), c.add("utmt", "feedback"), c.add("utmfbid", a.get(Gc), !0), c.add("utmfbpr", a.get(Hc), !0), xe(a, c), ve(a, c), we(a, c), ue(a, c), te(a, c), a = [c.toString()]) : a = [];
return a
},
oe = function (a) {
var b,
c = a.get(xb),
d = a.get(uc),
e = d && d.Ua,
f = 0;
if (0 == c || 2 == c) {
var Be = a.get(wb) + "?";
b = Ae(a, !0);
for (var n = 0, Ja = b.length; n < Ja; n++)
Sa(b[n], e, Be, !0), f++
}
if (1 == c || 2 == c)
for (b = Ae(a), a = a.c(Yb, ""), n = 0, Ja = b.length; n < Ja; n++)
try {
Sa(b[n], e, a),
f++
} catch (t) {
t && Ra(t.name, void 0, t.message)
}
d && (d.fb = f)
};
var Kc = function () {
return "https:" == J.location.protocol || M.G ? "https://stats.g.doubleclick.net" : "http://stats.g.doubleclick.net"
},
Ce = function (a) {
this.name = "len";
this.message = a + "-8192"
},
De = function (a) {
this.name = "ff2post";
this.message = a + "-2036"
},
Sa = function (a, b, c, d) {
b = b || Fa;
if (d || 2036 >= a.length) {
ff(a, b, c);
a: break a
} else if (8192 >= a.length) {
if (0 <= W.navigator.userAgent.indexOf("Firefox") && ![].reduce)
throw new De(a.length);
df(a, b) || Ee(a, b) || b();
a: break a
} else
throw new Ce(a.length);
},
ff = function (a, b, c) {
c = c || Kc() + "/__utm.gif?";
var d = new Image(1, 1);
d.src = c + a;
d.onload = function () {
d.onload = null;
d.onerror = null;
b()
};
d.onerror = function () {
d.onload = null;
d.onerror = null;
b()
}
},
df = function (a, b) {
var c = W.XMLHttpRequest;
if (!c)
return !1;
var d = new c;
if (!("withCredentials" in d))
return !1;
d.open("POST", Kc() + "/p/__utm.gif", !0);
d.withCredentials = !0;
d.setRequestHeader("Content-Type", "text/plain");
d.onreadystatechange = function () {
4 == d.readyState && (b(), d = null)
};
d.send(a);
return !0
},
Ee = function (a, b) {
if (!J.body)
return Ve(function () {
Ee(a, b)
}, 100), !0;
a = encodeURIComponent(a);
try {
var c = J.createElement('<iframe name="' + a + '"></iframe>')
} catch (e) {
c = J.createElement("iframe"),
c.name = a
}
c.height = "0";
c.width = "0";
c.style.display = "none";
c.style.visibility = "hidden";
var d = Kc() + "/u/post_iframe_dc.html";
Ga(W, "beforeunload", function () {
c.src = "";
c.parentNode && c.parentNode.removeChild(c)
});
setTimeout(b, 1E3);
J.body.appendChild(c);
c.src = d;
return !0
};
var gf = function () {
this.G = this.w = !1;
0 == Ea() % 100 && (H(142), this.G = !0);
this.C = {};
this.D = [];
this.U = 0;
this.S = [["www.google-analytics.com", "", "/plugins/"]];
this._gasoCPath = this._gasoDomain = this.bb = void 0;
Qe();
Re()
};
E = gf.prototype;
E.oa = function (a, b) {
return this.hb(a, void 0, b)
};
E.hb = function (a, b, c) {
b && H(23);
c && H(67);
void 0 == b && (b = "~" + M.U++);
a = new U(b, a, c);
M.C[b] = a;
M.D.push(a);
return a
};
E.u = function (a) {
a = a || "";
return M.C[a] || M.hb(void 0, a)
};
E.pa = function () {
return M.D.slice(0)
};
E.ab = function () {
return M.D.length
};
E.aa = function () {
this.w = !0
};
E.la = function () {
this.G = !0
};
var Fe = function (a) {
if ("prerender" == J.visibilityState)
return !1;
a();
return !0
};
var M = new gf;
var g = W._gat;
g && Ba(g._getTracker) ? M = g : W._gat = M;
var Z = new Y;
(function (a) {
if (!Fe(a)) {
H(123);
var b = !1,
c = function () {
if (!b && Fe(a)) {
b = !0;
var d = J,
e = c;
d.removeEventListener ? d.removeEventListener("visibilitychange", e, !1) : d.detachEvent && d.detachEvent("onvisibilitychange", e)
}
};
Ga(J, "visibilitychange", c)
}
})(function () {
var a = W._gaq,
b = !1;
if (a && Ba(a.push) && (b = "[object Array]" == Object.prototype.toString.call(Object(a)), !b)) {
Z = a;
return
}
W._gaq = Z;
b && Z.push.apply(Z, a)
});
function Yc(a) {
var b = 1,
c,
d;
if (a)
for (b = 0, d = a.length - 1; 0 <= d; d--)
c = a.charCodeAt(d), b = (b << 6 & 268435455) + c + (c << 14), c = b & 266338304, b = 0 != c ? b ^ c >> 21 : b;
return b
};
}).call(this);
var fb_timeout = null;
var fb_opts = {
'overlayShow': true,
'hideOnOverlayClick': true,
'showCloseButton': true,
'margin': 20,
'centerOnScroll': true,
'enableEscapeButton': true,
'autoScale': true
};
var easy_fancybox_handler = function () {
var fb_IMG_select = 'a[href*=".jpg"]:not(.nolightbox,li.nolightbox>a), area[href*=".jpg"]:not(.nolightbox), a[href*=".jpeg"]:not(.nolightbox,li.nolightbox>a), area[href*=".jpeg"]:not(.nolightbox), a[href*=".png"]:not(.nolightbox,li.nolightbox>a), area[href*=".png"]:not(.nolightbox)';
jQuery(fb_IMG_select).addClass('fancybox image');
var fb_IMG_sections = jQuery('div.gallery');
fb_IMG_sections.each(function () {
jQuery(this).find(fb_IMG_select).attr('rel', 'gallery-' + fb_IMG_sections.index(this));
});
jQuery('a.fancybox, area.fancybox, li.fancybox a').fancybox(jQuery.extend({}, fb_opts, {
'transitionIn': 'elastic',
'easingIn': 'easeOutBack',
'transitionOut': 'elastic',
'easingOut': 'easeInBack',
'opacity': false,
'hideOnContentClick': false,
'titleShow': true,
'titlePosition': 'over',
'titleFromAlt': true,
'showNavArrows': true,
'enableKeyboardNav': true,
'cyclic': false
}));
jQuery('a[href*=".pdf"], area[href*=".pdf"], a[href*=".PDF"], area[href*=".PDF"]').not('.nolightbox').addClass('fancybox-pdf');
jQuery('a.fancybox-pdf, area.fancybox-pdf, li.fancybox-pdf a').fancybox(jQuery.extend({}, fb_opts, {
'type': 'html',
'width': '90%',
'height': '90%',
'padding': 10,
'titleShow': false,
'titlePosition': 'float',
'titleFromAlt': true,
'autoDimensions': false,
'scrolling': 'no',
'onStart': function (selectedArray, selectedIndex, selectedOpts) {
selectedOpts.content = '<object data="' + selectedArray[selectedIndex].href + '" type="application/pdf" height="100%" width="100%"><a href="' + selectedArray[selectedIndex].href + '" style="display:block;position:absolute;top:48%;width:100%;text-align:center">' + jQuery(selectedArray[selectedIndex]).html() + ''
}
}));
}
var easy_fancybox_auto = function () {
setTimeout(function () {
jQuery('#fancybox-auto').trigger('click')
}, 1000);
};
var pixelRatio = window.devicePixelRatio || 1;
if (window.innerWidth / pixelRatio < 641) {
easy_fancybox_handler = null;
};
(function ($) {
$(document).ready(function () {});
})(jQuery);
!function (e) {
"use strict";
"function" == typeof define && define.amd ? define(["jquery"], e) : e("undefined" != typeof jQuery ? jQuery : window.Zepto)
}
(function (e) {
"use strict";
function t(t) {
var r = t.data;
t.isDefaultPrevented() || (t.preventDefault(), e(t.target).ajaxSubmit(r))
}
function r(t) {
var r = t.target,
a = e(r);
if (!a.is("[type=submit],[type=image]")) {
var n = a.closest("[type=submit]");
if (0 === n.length)
return;
r = n[0]
}
var i = this;
if (i.clk = r, "image" == r.type)
if (void 0 !== t.offsetX)
i.clk_x = t.offsetX, i.clk_y = t.offsetY;
else if ("function" == typeof e.fn.offset) {
var o = a.offset();
i.clk_x = t.pageX - o.left,
i.clk_y = t.pageY - o.top
} else
i.clk_x = t.pageX - r.offsetLeft, i.clk_y = t.pageY - r.offsetTop;
setTimeout(function () {
i.clk = i.clk_x = i.clk_y = null
}, 100)
}
function a() {
if (e.fn.ajaxSubmit.debug) {
var t = "[jquery.form] " + Array.prototype.join.call(arguments, "");
window.console && window.console.log ? window.console.log(t) : window.opera && window.opera.postError && window.opera.postError(t)
}
}
var n = {};
n.fileapi = void 0 !== e("<input type='file'/>").get(0).files,
n.formdata = void 0 !== window.FormData;
var i = !!e.fn.prop;
e.fn.attr2 = function () {
if (!i)
return this.attr.apply(this, arguments);
var e = this.prop.apply(this, arguments);
return e && e.jquery || "string" == typeof e ? e : this.attr.apply(this, arguments)
},
e.fn.ajaxSubmit = function (t) {
function r(r) {
var a,
n,
i = e.param(r, t.traditional).split("&"),
o = i.length,
s = [];
for (a = 0; o > a; a++)
i[a] = i[a].replace(/\+/g, " "), n = i[a].split("="), s.push([decodeURIComponent(n[0]), decodeURIComponent(n[1])]);
return s
}
function o(a) {
for (var n = new FormData, i = 0; i < a.length; i++)
n.append(a[i].name, a[i].value);
if (t.extraData) {
var o = r(t.extraData);
for (i = 0; i < o.length; i++)
o[i] && n.append(o[i][0], o[i][1])
}
t.data = null;
var s = e.extend(!0, {}, e.ajaxSettings, t, {
contentType: !1,
processData: !1,
cache: !1,
type: u || "POST"
});
t.uploadProgress && (s.xhr = function () {
var r = e.ajaxSettings.xhr();
return r.upload && r.upload.addEventListener("progress", function (e) {
var r = 0,
a = e.loaded || e.position,
n = e.total;
e.lengthComputable && (r = Math.ceil(a / n * 100)),
t.uploadProgress(e, a, n, r)
}, !1),
r
}),
s.data = null;
var c = s.beforeSend;
return s.beforeSend = function (e, r) {
r.data = t.formData ? t.formData : n,
c && c.call(this, e, r)
},
e.ajax(s)
}
function s(r) {
function n(e) {
var t = null;
try {
e.contentWindow && (t = e.contentWindow.document)
} catch (r) {
a("cannot get iframe.contentWindow document: " + r)
}
if (t)
return t;
try {
t = e.contentDocument ? e.contentDocument : e.document
} catch (r) {
a("cannot get iframe.contentDocument: " + r),
t = e.document
}
return t
}
function o() {
function t() {
try {
var e = n(g).readyState;
a("state = " + e),
e && "uninitialized" == e.toLowerCase() && setTimeout(t, 50)
} catch (r) {
a("Server abort: ", r, " (", r.name, ")"),
s(k),
j && clearTimeout(j),
j = void 0
}
}
var r = f.attr2("target"),
i = f.attr2("action"),
o = "multipart/form-data",
c = f.attr("enctype") || f.attr("encoding") || o;
w.setAttribute("target", p),
(!u || /post/i.test(u)) && w.setAttribute("method", "POST"),
i != m.url && w.setAttribute("action", m.url),
m.skipEncodingOverride || u && !/post/i.test(u) || f.attr({
encoding: "multipart/form-data",
enctype: "multipart/form-data"
}),
m.timeout && (j = setTimeout(function () {
T = !0,
s(D)
}, m.timeout));
var l = [];
try {
if (m.extraData)
for (var d in m.extraData)
m.extraData.hasOwnProperty(d) && l.push(e.isPlainObject(m.extraData[d]) && m.extraData[d].hasOwnProperty("name") && m.extraData[d].hasOwnProperty("value") ? e('<input type="hidden" name="' + m.extraData[d].name + '">').val(m.extraData[d].value).appendTo(w)[0] : e('<input type="hidden" name="' + d + '">').val(m.extraData[d]).appendTo(w)[0]);
m.iframeTarget || v.appendTo("body"),
g.attachEvent ? g.attachEvent("onload", s) : g.addEventListener("load", s, !1),
setTimeout(t, 15);
try {
w.submit()
} catch (h) {
var x = document.createElement("form").submit;
x.apply(w)
}
}
finally {
w.setAttribute("action", i),
w.setAttribute("enctype", c),
r ? w.setAttribute("target", r) : f.removeAttr("target"),
e(l).remove()
}
}
function s(t) {
if (!x.aborted && !F) {
if (M = n(g), M || (a("cannot access response document"), t = k), t === D && x)
return x.abort("timeout"), void S.reject(x, "timeout");
if (t == k && x)
return x.abort("server abort"), void S.reject(x, "error", "server abort");
if (M && M.location.href != m.iframeSrc || T) {
g.detachEvent ? g.detachEvent("onload", s) : g.removeEventListener("load", s, !1);
var r,
i = "success";
try {
if (T)
throw "timeout";
var o = "xml" == m.dataType || M.XMLDocument || e.isXMLDoc(M);
if (a("isXml=" + o), !o && window.opera && (null === M.body || !M.body.innerHTML) && --O)
return a("requeing onLoad callback, DOM not available"), void setTimeout(s, 250);
var u = M.body ? M.body : M.documentElement;
x.responseText = u ? u.innerHTML : null,
x.responseXML = M.XMLDocument ? M.XMLDocument : M,
o && (m.dataType = "xml"),
x.getResponseHeader = function (e) {
var t = {
"content-type": m.dataType
};
return t[e.toLowerCase()]
},
u && (x.status = Number(u.getAttribute("status")) || x.status, x.statusText = u.getAttribute("statusText") || x.statusText);
var c = (m.dataType || "").toLowerCase(),
l = /(json|script|text)/.test(c);
if (l || m.textarea) {
var f = M.getElementsByTagName("textarea")[0];
if (f)
x.responseText = f.value, x.status = Number(f.getAttribute("status")) || x.status, x.statusText = f.getAttribute("statusText") || x.statusText;
else if (l) {
var p = M.getElementsByTagName("pre")[0],
h = M.getElementsByTagName("body")[0];
p ? x.responseText = p.textContent ? p.textContent : p.innerText : h && (x.responseText = h.textContent ? h.textContent : h.innerText)
}
} else
"xml" == c && !x.responseXML && x.responseText && (x.responseXML = X(x.responseText));
try {
E = _(x, c, m)
} catch (y) {
i = "parsererror",
x.error = r = y || i
}
} catch (y) {
a("error caught: ", y),
i = "error",
x.error = r = y || i
}
x.aborted && (a("upload aborted"), i = null),
x.status && (i = x.status >= 200 && x.status < 300 || 304 === x.status ? "success" : "error"),
"success" === i ? (m.success && m.success.call(m.context, E, "success", x), S.resolve(x.responseText, "success", x), d && e.event.trigger("ajaxSuccess", [x, m])) : i && (void 0 === r && (r = x.statusText), m.error && m.error.call(m.context, x, i, r), S.reject(x, "error", r), d && e.event.trigger("ajaxError", [x, m, r])),
d && e.event.trigger("ajaxComplete", [x, m]),
d && !--e.active && e.event.trigger("ajaxStop"),
m.complete && m.complete.call(m.context, x, i),
F = !0,
m.timeout && clearTimeout(j),
setTimeout(function () {
m.iframeTarget ? v.attr("src", m.iframeSrc) : v.remove(),
x.responseXML = null
}, 100)
}
}
}
var c,
l,
m,
d,
p,
v,
g,
x,
y,
b,
T,
j,
w = f[0],
S = e.Deferred();
if (S.abort = function (e) {
x.abort(e)
}, r)
for (l = 0; l < h.length; l++)
c = e(h[l]), i ? c.prop("disabled", !1) : c.removeAttr("disabled");
if (m = e.extend(!0, {}, e.ajaxSettings, t), m.context = m.context || m, p = "jqFormIO" + (new Date).getTime(), m.iframeTarget ? (v = e(m.iframeTarget), b = v.attr2("name"), b ? p = b : v.attr2("name", p)) : (v = e('<iframe name="' + p + '" src="' + m.iframeSrc + '" />'), v.css({
position: "absolute",
top: "-1000px",
left: "-1000px"
})), g = v[0], x = {
aborted: 0,
responseText: null,
responseXML: null,
status: 0,
statusText: "n/a",
getAllResponseHeaders: function () {},
getResponseHeader: function () {},
setRequestHeader: function () {},
abort: function (t) {
var r = "timeout" === t ? "timeout" : "aborted";
a("aborting upload... " + r),
this.aborted = 1;
try {
g.contentWindow.document.execCommand && g.contentWindow.document.execCommand("Stop")
} catch (n) {}
v.attr("src", m.iframeSrc),
x.error = r,
m.error && m.error.call(m.context, x, r, t),
d && e.event.trigger("ajaxError", [x, m, r]),
m.complete && m.complete.call(m.context, x, r)
}
}, d = m.global, d && 0 === e.active++ && e.event.trigger("ajaxStart"), d && e.event.trigger("ajaxSend", [x, m]), m.beforeSend && m.beforeSend.call(m.context, x, m) === !1)
return m.global && e.active--, S.reject(), S;
if (x.aborted)
return S.reject(), S;
y = w.clk,
y && (b = y.name, b && !y.disabled && (m.extraData = m.extraData || {}, m.extraData[b] = y.value, "image" == y.type && (m.extraData[b + ".x"] = w.clk_x, m.extraData[b + ".y"] = w.clk_y)));
var D = 1,
k = 2,
A = e("meta[name=csrf-token]").attr("content"),
L = e("meta[name=csrf-param]").attr("content");
L && A && (m.extraData = m.extraData || {}, m.extraData[L] = A),
m.forceSync ? o() : setTimeout(o, 10);
var E,
M,
F,
O = 50,
X = e.parseXML || function (e, t) {
return window.ActiveXObject ? (t = new ActiveXObject("Microsoft.XMLDOM"), t.async = "false", t.loadXML(e)) : t = (new DOMParser).parseFromString(e, "text/xml"),
t && t.documentElement && "parsererror" != t.documentElement.nodeName ? t : null
},
C = e.parseJSON || function (e) {
return window.eval("(" + e + ")")
},
_ = function (t, r, a) {
var n = t.getResponseHeader("content-type") || "",
i = "xml" === r || !r && n.indexOf("xml") >= 0,
o = i ? t.responseXML : t.responseText;
return i && "parsererror" === o.documentElement.nodeName && e.error && e.error("parsererror"),
a && a.dataFilter && (o = a.dataFilter(o, r)),
"string" == typeof o && ("json" === r || !r && n.indexOf("json") >= 0 ? o = C(o) : ("script" === r || !r && n.indexOf("javascript") >= 0) && e.globalEval(o)),
o
};
return S
}
if (!this.length)
return a("ajaxSubmit: skipping submit process - no element selected"), this;
var u,
c,
l,
f = this;
"function" == typeof t ? t = {
success: t
}
: void 0 === t && (t = {}),
u = t.type || this.attr2("method"),
c = t.url || this.attr2("action"),
l = "string" == typeof c ? e.trim(c) : "",
l = l || window.location.href || "",
l && (l = (l.match(/^([^#]+)/) || [])[1]),
t = e.extend(!0, {
url: l,
success: e.ajaxSettings.success,
type: u || e.ajaxSettings.type,
iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank"
}, t);
var m = {};
if (this.trigger("form-pre-serialize", [this, t, m]), m.veto)
return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this;
if (t.beforeSerialize && t.beforeSerialize(this, t) === !1)
return a("ajaxSubmit: submit aborted via beforeSerialize callback"), this;
var d = t.traditional;
void 0 === d && (d = e.ajaxSettings.traditional);
var p,
h = [],
v = this.formToArray(t.semantic, h);
if (t.data && (t.extraData = t.data, p = e.param(t.data, d)), t.beforeSubmit && t.beforeSubmit(v, this, t) === !1)
return a("ajaxSubmit: submit aborted via beforeSubmit callback"), this;
if (this.trigger("form-submit-validate", [v, this, t, m]), m.veto)
return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this;
var g = e.param(v, d);
p && (g = g ? g + "&" + p : p),
"GET" == t.type.toUpperCase() ? (t.url += (t.url.indexOf("?") >= 0 ? "&" : "?") + g, t.data = null) : t.data = g;
var x = [];
if (t.resetForm && x.push(function () {
f.resetForm()
}), t.clearForm && x.push(function () {
f.clearForm(t.includeHidden)
}), !t.dataType && t.target) {
var y = t.success || function () {};
x.push(function (r) {
var a = t.replaceTarget ? "replaceWith" : "html";
e(t.target)[a](r).each(y, arguments)
})
} else
t.success && x.push(t.success);
if (t.success = function (e, r, a) {
for (var n = t.context || this, i = 0, o = x.length; o > i; i++)
x[i].apply(n, [e, r, a || f, f])
}, t.error) {
var b = t.error;
t.error = function (e, r, a) {
var n = t.context || this;
b.apply(n, [e, r, a, f])
}
}
if (t.complete) {
var T = t.complete;
t.complete = function (e, r) {
var a = t.context || this;
T.apply(a, [e, r, f])
}
}
var j = e("input[type=file]:enabled", this).filter(function () {
return "" !== e(this).val()
}),
w = j.length > 0,
S = "multipart/form-data",
D = f.attr("enctype") == S || f.attr("encoding") == S,
k = n.fileapi && n.formdata;
a("fileAPI :" + k);
var A,
L = (w || D) && !k;
t.iframe !== !1 && (t.iframe || L) ? t.closeKeepAlive ? e.get(t.closeKeepAlive, function () {
A = s(v)
}) : A = s(v) : A = (w || D) && k ? o(v) : e.ajax(t),
f.removeData("jqxhr").data("jqxhr", A);
for (var E = 0; E < h.length; E++)
h[E] = null;
return this.trigger("form-submit-notify", [this, t]),
this
},
e.fn.ajaxForm = function (n) {
if (n = n || {}, n.delegation = n.delegation && e.isFunction(e.fn.on), !n.delegation && 0 === this.length) {
var i = {
s: this.selector,
c: this.context
};
return !e.isReady && i.s ? (a("DOM not ready, queuing ajaxForm"), e(function () {
e(i.s, i.c).ajaxForm(n)
}), this) : (a("terminating; zero elements found by selector" + (e.isReady ? "" : " (DOM not ready)")), this)
}
return n.delegation ? (e(document).off("submit.form-plugin", this.selector, t).off("click.form-plugin", this.selector, r).on("submit.form-plugin", this.selector, n, t).on("click.form-plugin", this.selector, n, r), this) : this.ajaxFormUnbind().bind("submit.form-plugin", n, t).bind("click.form-plugin", n, r)
},
e.fn.ajaxFormUnbind = function () {
return this.unbind("submit.form-plugin click.form-plugin")
},
e.fn.formToArray = function (t, r) {
var a = [];
if (0 === this.length)
return a;
var i,
o = this[0],
s = this.attr("id"),
u = t ? o.getElementsByTagName("*") : o.elements;
if (u && !/MSIE [678]/.test(navigator.userAgent) && (u = e(u).get()), s && (i = e(':input[form="' + s + '"]').get(), i.length && (u = (u || []).concat(i))), !u || !u.length)
return a;
var c,
l,
f,
m,
d,
p,
h;
for (c = 0, p = u.length; p > c; c++)
if (d = u[c], f = d.name, f && !d.disabled)
if (t && o.clk && "image" == d.type)
o.clk == d && (a.push({
name: f,
value: e(d).val(),
type: d.type
}), a.push({
name: f + ".x",
value: o.clk_x
}, {
name: f + ".y",
value: o.clk_y
}));
else if (m = e.fieldValue(d, !0), m && m.constructor == Array)
for (r && r.push(d), l = 0, h = m.length; h > l; l++)
a.push({
name: f,
value: m[l]
});
else if (n.fileapi && "file" == d.type) {
r && r.push(d);
var v = d.files;
if (v.length)
for (l = 0; l < v.length; l++)
a.push({
name: f,
value: v[l],
type: d.type
});
else
a.push({
name: f,
value: "",
type: d.type
})
} else
null !== m && "undefined" != typeof m && (r && r.push(d), a.push({
name: f,
value: m,
type: d.type,
required: d.required
}));
if (!t && o.clk) {
var g = e(o.clk),
x = g[0];
f = x.name,
f && !x.disabled && "image" == x.type && (a.push({
name: f,
value: g.val()
}), a.push({
name: f + ".x",
value: o.clk_x
}, {
name: f + ".y",
value: o.clk_y
}))
}
return a
},
e.fn.formSerialize = function (t) {
return e.param(this.formToArray(t))
},
e.fn.fieldSerialize = function (t) {
var r = [];
return this.each(function () {
var a = this.name;
if (a) {
var n = e.fieldValue(this, t);
if (n && n.constructor == Array)
for (var i = 0, o = n.length; o > i; i++)
r.push({
name: a,
value: n[i]
});
else
null !== n && "undefined" != typeof n && r.push({
name: this.name,
value: n
})
}
}),
e.param(r)
},
e.fn.fieldValue = function (t) {
for (var r = [], a = 0, n = this.length; n > a; a++) {
var i = this[a],
o = e.fieldValue(i, t);
null === o || "undefined" == typeof o || o.constructor == Array && !o.length || (o.constructor == Array ? e.merge(r, o) : r.push(o))
}
return r
},
e.fieldValue = function (t, r) {
var a = t.name,
n = t.type,
i = t.tagName.toLowerCase();
if (void 0 === r && (r = !0), r && (!a || t.disabled || "reset" == n || "button" == n || ("checkbox" == n || "radio" == n) && !t.checked || ("submit" == n || "image" == n) && t.form && t.form.clk != t || "select" == i && -1 == t.selectedIndex))
return null;
if ("select" == i) {
var o = t.selectedIndex;
if (0 > o)
return null;
for (var s = [], u = t.options, c = "select-one" == n, l = c ? o + 1 : u.length, f = c ? o : 0; l > f; f++) {
var m = u[f];
if (m.selected) {
var d = m.value;
if (d || (d = m.attributes && m.attributes.value && !m.attributes.value.specified ? m.text : m.value), c)
return d;
s.push(d)
}
}
return s
}
return e(t).val()
},
e.fn.clearForm = function (t) {
return this.each(function () {
e("input,select,textarea", this).clearFields(t)
})
},
e.fn.clearFields = e.fn.clearInputs = function (t) {
var r = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
return this.each(function () {
var a = this.type,
n = this.tagName.toLowerCase();
r.test(a) || "textarea" == n ? this.value = "" : "checkbox" == a || "radio" == a ? this.checked = !1 : "select" == n ? this.selectedIndex = -1 : "file" == a ? /MSIE/.test(navigator.userAgent) ? e(this).replaceWith(e(this).clone(!0)) : e(this).val("") : t && (t === !0 && /hidden/.test(a) || "string" == typeof t && e(this).is(t)) && (this.value = "")
})
},
e.fn.resetForm = function () {
return this.each(function () {
("function" == typeof this.reset || "object" == typeof this.reset && !this.reset.nodeType) && this.reset()
})
},
e.fn.enable = function (e) {
return void 0 === e && (e = !0),
this.each(function () {
this.disabled = !e
})
},
e.fn.selected = function (t) {
return void 0 === t && (t = !0),
this.each(function () {
var r = this.type;
if ("checkbox" == r || "radio" == r)
this.checked = t;
else if ("option" == this.tagName.toLowerCase()) {
var a = e(this).parent("select");
t && a[0] && "select-one" == a[0].type && a.find("option").selected(!1),
this.selected = t
}
})
},
e.fn.ajaxSubmit.debug = !1
});
(function ($) {
'use strict';
if (typeof _wpcf7 === 'undefined' || _wpcf7 === null) {
return;
}
_wpcf7 = $.extend({
cached: 0,
inputs: []
}, _wpcf7);
$.fn.wpcf7InitForm = function () {
this.ajaxForm({
beforeSubmit: function (arr, $form, options) {
$form.wpcf7ClearResponseOutput();
$form.find('[aria-invalid]').attr('aria-invalid', 'false');
$form.find('.ajax-loader').addClass('is-active');
return true;
},
beforeSerialize: function ($form, options) {
$form.find('[placeholder].placeheld').each(function (i, n) {
$(n).val('');
});
return true;
},
data: {
'_wpcf7_is_ajax_call': 1
},
dataType: 'json',
success: $.wpcf7AjaxSuccess,
error: function (xhr, status, error, $form) {
var e = $('<div class="ajax-error"></div>').text(error.message);
$form.after(e);
}
});
if (_wpcf7.cached) {
this.wpcf7OnloadRefill();
}
this.wpcf7ToggleSubmit();
this.find('.wpcf7-submit').wpcf7AjaxLoader();
this.find('.wpcf7-acceptance').click(function () {
$(this).closest('form').wpcf7ToggleSubmit();
});
this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox();
this.find('.wpcf7-list-item.has-free-text').wpcf7ToggleCheckboxFreetext();
this.find('[placeholder]').wpcf7Placeholder();
if (_wpcf7.jqueryUi && !_wpcf7.supportHtml5.date) {
this.find('input.wpcf7-date[type="date"]').each(function () {
$(this).datepicker({
dateFormat: 'yy-mm-dd',
minDate: new Date($(this).attr('min')),
maxDate: new Date($(this).attr('max'))
});
});
}
if (_wpcf7.jqueryUi && !_wpcf7.supportHtml5.number) {
this.find('input.wpcf7-number[type="number"]').each(function () {
$(this).spinner({
min: $(this).attr('min'),
max: $(this).attr('max'),
step: $(this).attr('step')
});
});
}
this.find('.wpcf7-character-count').wpcf7CharacterCount();
this.find('.wpcf7-validates-as-url').change(function () {
$(this).wpcf7NormalizeUrl();
});
this.find('.wpcf7-recaptcha').wpcf7Recaptcha();
};
$.wpcf7AjaxSuccess = function (data, status, xhr, $form) {
if (!$.isPlainObject(data) || $.isEmptyObject(data)) {
return;
}
_wpcf7.inputs = $form.serializeArray();
var $responseOutput = $form.find('div.wpcf7-response-output');
$form.wpcf7ClearResponseOutput();
$form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
$form.removeClass('invalid spam sent failed');
if (data.captcha) {
$form.wpcf7RefillCaptcha(data.captcha);
}
if (data.quiz) {
$form.wpcf7RefillQuiz(data.quiz);
}
if (data.invalids) {
$.each(data.invalids, function (i, n) {
$form.find(n.into).wpcf7NotValidTip(n.message);
$form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
$form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true');
});
$responseOutput.addClass('wpcf7-validation-errors');
$form.addClass('invalid');
$(data.into).wpcf7TriggerEvent('invalid');
} else if (1 == data.spam) {
$form.find('[name="g-recaptcha-response"]').each(function () {
if ('' == $(this).val()) {
var $recaptcha = $(this).closest('.wpcf7-form-control-wrap');
$recaptcha.wpcf7NotValidTip(_wpcf7.recaptcha.messages.empty);
}
});
$responseOutput.addClass('wpcf7-spam-blocked');
$form.addClass('spam');
$(data.into).wpcf7TriggerEvent('spam');
} else if (1 == data.mailSent) {
$responseOutput.addClass('wpcf7-mail-sent-ok');
$form.addClass('sent');
if (data.onSentOk) {
$.each(data.onSentOk, function (i, n) {
eval(n)
});
}
$(data.into).wpcf7TriggerEvent('mailsent');
} else {
$responseOutput.addClass('wpcf7-mail-sent-ng');
$form.addClass('failed');
$(data.into).wpcf7TriggerEvent('mailfailed');
}
if (data.onSubmit) {
$.each(data.onSubmit, function (i, n) {
eval(n)
});
}
$(data.into).wpcf7TriggerEvent('submit');
if (1 == data.mailSent) {
$form.resetForm();
}
$form.find('[placeholder].placeheld').each(function (i, n) {
$(n).val($(n).attr('placeholder'));
});
$responseOutput.append(data.message).slideDown('fast');
$responseOutput.attr('role', 'alert');
$.wpcf7UpdateScreenReaderResponse($form, data);
};
$.fn.wpcf7TriggerEvent = function (name) {
return this.each(function () {
var elmId = this.id;
var inputs = _wpcf7.inputs;
var event = new CustomEvent('wpcf7' + name, {
bubbles: true,
detail: {
id: elmId,
inputs: inputs
}
});
this.dispatchEvent(event);
$(this).trigger('wpcf7:' + name);
$(this).trigger(name + '.wpcf7');
});
};
$.fn.wpcf7ExclusiveCheckbox = function () {
return this.find('input:checkbox').click(function () {
var name = $(this).attr('name');
$(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
});
};
$.fn.wpcf7Placeholder = function () {
if (_wpcf7.supportHtml5.placeholder) {
return this;
}
return this.each(function () {
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
$(this).focus(function () {
if ($(this).hasClass('placeheld')) {
$(this).val('').removeClass('placeheld');
}
});
$(this).blur(function () {
if ('' === $(this).val()) {
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
}
});
});
};
$.fn.wpcf7AjaxLoader = function () {
return this.each(function () {
$(this).after('<span class="ajax-loader"></span>');
});
};
$.fn.wpcf7ToggleSubmit = function () {
return this.each(function () {
var form = $(this);
if (this.tagName.toLowerCase() != 'form') {
form = $(this).find('form').first();
}
if (form.hasClass('wpcf7-acceptance-as-validation')) {
return;
}
var submit = form.find('input:submit');
if (!submit.length) {
return;
}
var acceptances = form.find('input:checkbox.wpcf7-acceptance');
if (!acceptances.length) {
return;
}
submit.removeAttr('disabled');
acceptances.each(function (i, n) {
n = $(n);
if (n.hasClass('wpcf7-invert') && n.is(':checked') || !n.hasClass('wpcf7-invert') && !n.is(':checked')) {
submit.attr('disabled', 'disabled');
}
});
});
};
$.fn.wpcf7ToggleCheckboxFreetext = function () {
return this.each(function () {
var $wrap = $(this).closest('.wpcf7-form-control');
if ($(this).find(':checkbox, :radio').is(':checked')) {
$(this).find(':input.wpcf7-free-text').prop('disabled', false);
} else {
$(this).find(':input.wpcf7-free-text').prop('disabled', true);
}
$wrap.find(':checkbox, :radio').change(function () {
var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio');
var $freetext = $(':input.wpcf7-free-text', $wrap);
if ($cb.is(':checked')) {
$freetext.prop('disabled', false).focus();
} else {
$freetext.prop('disabled', true);
}
});
});
};
$.fn.wpcf7CharacterCount = function () {
return this.each(function () {
var $count = $(this);
var name = $count.attr('data-target-name');
var down = $count.hasClass('down');
var starting = parseInt($count.attr('data-starting-value'), 10);
var maximum = parseInt($count.attr('data-maximum-value'), 10);
var minimum = parseInt($count.attr('data-minimum-value'), 10);
var updateCount = function ($target) {
var length = $target.val().length;
var count = down ? starting - length : length;
$count.attr('data-current-value', count);
$count.text(count);
if (maximum && maximum < length) {
$count.addClass('too-long');
} else {
$count.removeClass('too-long');
}
if (minimum && length < minimum) {
$count.addClass('too-short');
} else {
$count.removeClass('too-short');
}
};
$count.closest('form').find(':input[name="' + name + '"]').each(function () {
updateCount($(this));
$(this).keyup(function () {
updateCount($(this));
});
});
});
};
$.fn.wpcf7NormalizeUrl = function () {
return this.each(function () {
var val = $.trim($(this).val());
if (val && !val.match(/^[a-z][a-z0-9.+-]*:/i)) {
val = val.replace(/^\/+/, '');
val = 'http://' + val;
}
$(this).val(val);
});
};
$.fn.wpcf7NotValidTip = function (message) {
return this.each(function () {
var $into = $(this);
$into.find('span.wpcf7-not-valid-tip').remove();
$into.append('<span role="alert" class="wpcf7-not-valid-tip">' + message + '</span>');
if ($into.is('.use-floating-validation-tip *')) {
$('.wpcf7-not-valid-tip', $into).mouseover(function () {
$(this).wpcf7FadeOut();
});
$(':input', $into).focus(function () {
$('.wpcf7-not-valid-tip', $into).not(':hidden').wpcf7FadeOut();
});
}
});
};
$.fn.wpcf7FadeOut = function () {
return this.each(function () {
$(this).animate({
opacity: 0
}, 'fast', function () {
$(this).css({
'z-index': -100
});
});
});
};
$.fn.wpcf7OnloadRefill = function () {
return this.each(function () {
var url = $(this).attr('action');
if (0 < url.indexOf('#')) {
url = url.substr(0, url.indexOf('#'));
}
var id = $(this).find('input[name="_wpcf7"]').val();
var unitTag = $(this).find('input[name="_wpcf7_unit_tag"]').val();
$.getJSON(url, {
_wpcf7_is_ajax_call: 1,
_wpcf7: id,
_wpcf7_request_ver: $.now()
}, function (data) {
if (data && data.captcha) {
$('#' + unitTag).wpcf7RefillCaptcha(data.captcha);
}
if (data && data.quiz) {
$('#' + unitTag).wpcf7RefillQuiz(data.quiz);
}
});
});
};
$.fn.wpcf7RefillCaptcha = function (captcha) {
return this.each(function () {
var form = $(this);
$.each(captcha, function (i, n) {
form.find(':input[name="' + i + '"]').clearFields();
form.find('img.wpcf7-captcha-' + i).attr('src', n);
var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
});
});
};
$.fn.wpcf7RefillQuiz = function (quiz) {
return this.each(function () {
var form = $(this);
$.each(quiz, function (i, n) {
form.find(':input[name="' + i + '"]').clearFields();
form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
});
});
};
$.fn.wpcf7ClearResponseOutput = function () {
return this.each(function () {
$(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role');
$(this).find('span.wpcf7-not-valid-tip').remove();
$(this).find('.ajax-loader').removeClass('is-active');
});
};
$.fn.wpcf7Recaptcha = function () {
return this.each(function () {
var events = 'wpcf7:spam wpcf7:mailsent wpcf7:mailfailed';
$(this).closest('div.wpcf7').on(events, function (e) {
if (recaptchaWidgets && grecaptcha) {
$.each(recaptchaWidgets, function (index, value) {
grecaptcha.reset(value);
});
}
});
});
};
$.wpcf7UpdateScreenReaderResponse = function ($form, data) {
$('.wpcf7 .screen-reader-response').html('').attr('role', '');
if (data.message) {
var $response = $form.siblings('.screen-reader-response').first();
$response.append(data.message);
if (data.invalids) {
var $invalids = $('<ul></ul>');
$.each(data.invalids, function (i, n) {
if (n.idref) {
var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message));
} else {
var $li = $('<li></li>').append(n.message);
}
$invalids.append($li);
});
$response.append($invalids);
}
$response.attr('role', 'alert').focus();
}
};
$.wpcf7SupportHtml5 = function () {
var features = {};
var input = document.createElement('input');
features.placeholder = 'placeholder' in input;
var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date'];
$.each(inputTypes, function (index, value) {
input.setAttribute('type', value);
features[value] = input.type !== 'text';
});
return features;
};
$(function () {
_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
$('div.wpcf7 > form').wpcf7InitForm();
});
})(jQuery);
(function () {
if (typeof window.CustomEvent === "function")
return false;
function CustomEvent(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
(function ($) {
"use strict";
$.fn.fitVids = function (options) {
var settings = {
customSelector: null,
ignore: null,
};
if (!document.getElementById('fit-vids-style')) {
var head = document.head || document.getElementsByTagName('head')[0];
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div = document.createElement('div');
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
head.appendChild(div.childNodes[1]);
}
if (options) {
$.extend(settings, options);
}
return this.each(function () {
var selectors = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed"];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var ignoreList = '.fitvidsignore';
if (settings.ignore) {
ignoreList = ignoreList + ', ' + settings.ignore;
}
var $allVideos = $(this).find(selectors.join(','));
$allVideos = $allVideos.not("object object");
$allVideos = $allVideos.not(ignoreList);
$allVideos.each(function () {
var $this = $(this);
if ($this.parents(ignoreList).length > 0) {
return;
}
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) {
return;
}
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) {
$this.attr('height', 9);
$this.attr('width', 16);
}
var height = (this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if (!$this.attr('id')) {
var videoID = 'fitvid' + Math.floor(Math.random() * 999999);
$this.attr('id', videoID);
}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100) + "%");
$this.removeAttr('height').removeAttr('width');
});
});
};
})(window.jQuery || window.Zepto);
!function (e) {
function n() {
e[t].glbl || (l = {
$wndw: e(window),
$html: e("html"),
$body: e("body")
}, a = {}, i = {}, r = {}, e.each([a, i, r], function (e, n) {
n.add = function (e) {
e = e.split(" ");
for (var t = 0, s = e.length; s > t; t++)
n[e[t]] = n.mm(e[t])
}
}), a.mm = function (e) {
return "mm-" + e
}, a.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"), a.umm = function (e) {
return "mm-" == e.slice(0, 3) && (e = e.slice(3)),
e
}, i.mm = function (e) {
return "mm-" + e
}, i.add("parent sub"), r.mm = function (e) {
return e + ".mm"
}, r.add("transitionend webkitTransitionEnd mousedown mouseup touchstart touchmove touchend click keydown"), e[t]._c = a, e[t]._d = i, e[t]._e = r, e[t].glbl = l)
}
var t = "mmenu",
s = "5.5.3";
if (!(e[t] && e[t].version > s)) {
e[t] = function (e, n, t) {
this.$menu = e,
this._api = ["bind", "init", "update", "setSelected", "getInstance", "openPanel", "closePanel", "closeAllPanels"],
this.opts = n,
this.conf = t,
this.vars = {},
this.cbck = {},
"function" == typeof this.___deprecated && this.___deprecated(),
this._initMenu(),
this._initAnchors();
var s = this.$pnls.children();
return this._initAddons(),
this.init(s),
"function" == typeof this.___debug && this.___debug(),
this
},
e[t].version = s,
e[t].addons = {},
e[t].uniqueId = 0,
e[t].defaults = {
extensions: [],
navbar: {
add: !0,
title: "Menu",
titleLink: "panel"
},
onClick: {
setSelected: !0
},
slidingSubmenus: !0
},
e[t].configuration = {
classNames: {
divider: "Divider",
inset: "Inset",
panel: "Panel",
selected: "Selected",
spacer: "Spacer",
vertical: "Vertical"
},
clone: !1,
openingInterval: 25,
panelNodetype: "ul, ol, div",
transitionDuration: 400
},
e[t].prototype = {
init: function (e) {
e = e.not("." + a.nopanel),
e = this._initPanels(e),
this.trigger("init", e),
this.trigger("update")
},
update: function () {
this.trigger("update")
},
setSelected: function (e) {
this.$menu.find("." + a.listview).children().removeClass(a.selected),
e.addClass(a.selected),
this.trigger("setSelected", e)
},
openPanel: function (n) {
var s = n.parent();
if (s.hasClass(a.vertical)) {
var i = s.parents("." + a.subopened);
if (i.length)
return this.openPanel(i.first());
s.addClass(a.opened)
} else {
if (n.hasClass(a.current))
return;
var r = this.$pnls.children("." + a.panel),
l = r.filter("." + a.current);
r.removeClass(a.highest).removeClass(a.current).not(n).not(l).not("." + a.vertical).addClass(a.hidden),
e[t].support.csstransitions || l.addClass(a.hidden),
n.hasClass(a.opened) ? n.nextAll("." + a.opened).addClass(a.highest).removeClass(a.opened).removeClass(a.subopened) : (n.addClass(a.highest), l.addClass(a.subopened)),
n.removeClass(a.hidden).addClass(a.current),
setTimeout(function () {
n.removeClass(a.subopened).addClass(a.opened)
}, this.conf.openingInterval)
}
this.trigger("openPanel", n)
},
closePanel: function (e) {
var n = e.parent();
n.hasClass(a.vertical) && (n.removeClass(a.opened), this.trigger("closePanel", e))
},
closeAllPanels: function () {
this.$menu.find("." + a.listview).children().removeClass(a.selected).filter("." + a.vertical).removeClass(a.opened);
var e = this.$pnls.children("." + a.panel),
n = e.first();
this.$pnls.children("." + a.panel).not(n).removeClass(a.subopened).removeClass(a.opened).removeClass(a.current).removeClass(a.highest).addClass(a.hidden),
this.openPanel(n)
},
togglePanel: function (e) {
var n = e.parent();
n.hasClass(a.vertical) && this[n.hasClass(a.opened) ? "closePanel" : "openPanel"](e)
},
getInstance: function () {
return this
},
bind: function (e, n) {
this.cbck[e] = this.cbck[e] || [],
this.cbck[e].push(n)
},
trigger: function () {
var e = this,
n = Array.prototype.slice.call(arguments),
t = n.shift();
if (this.cbck[t])
for (var s = 0, a = this.cbck[t].length; a > s; s++)
this.cbck[t][s].apply(e, n)
},
_initMenu: function () {
this.opts.offCanvas && this.conf.clone && (this.$menu = this.$menu.clone(!0), this.$menu.add(this.$menu.find("[id]")).filter("[id]").each(function () {
e(this).attr("id", a.mm(e(this).attr("id")))
})),
this.$menu.contents().each(function () {
3 == e(this)[0].nodeType && e(this).remove()
}),
this.$pnls = e('<div class="' + a.panels + '" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),
this.$menu.parent().addClass(a.wrapper);
var n = [a.menu];
this.opts.slidingSubmenus || n.push(a.vertical),
this.opts.extensions = this.opts.extensions.length ? "mm-" + this.opts.extensions.join(" mm-") : "",
this.opts.extensions && n.push(this.opts.extensions),
this.$menu.addClass(n.join(" "))
},
_initPanels: function (n) {
var t = this,
s = this.__findAddBack(n, "ul, ol");
this.__refactorClass(s, this.conf.classNames.inset, "inset").addClass(a.nolistview + " " + a.nopanel),
s.not("." + a.nolistview).addClass(a.listview);
var r = this.__findAddBack(n, "." + a.listview).children();
this.__refactorClass(r, this.conf.classNames.selected, "selected"),
this.__refactorClass(r, this.conf.classNames.divider, "divider"),
this.__refactorClass(r, this.conf.classNames.spacer, "spacer"),
this.__refactorClass(this.__findAddBack(n, "." + this.conf.classNames.panel), this.conf.classNames.panel, "panel");
var l = e(),
d = n.add(n.find("." + a.panel)).add(this.__findAddBack(n, "." + a.listview).children().children(this.conf.panelNodetype)).not("." + a.nopanel);
this.__refactorClass(d, this.conf.classNames.vertical, "vertical"),
this.opts.slidingSubmenus || d.addClass(a.vertical),
d.each(function () {
var n = e(this),
s = n;
n.is("ul, ol") ? (n.wrap('<div class="' + a.panel + '" />'), s = n.parent()) : s.addClass(a.panel);
var i = n.attr("id");
n.removeAttr("id"),
s.attr("id", i || t.__getUniqueId()),
n.hasClass(a.vertical) && (n.removeClass(t.conf.classNames.vertical), s.add(s.parent()).addClass(a.vertical)),
l = l.add(s)
});
var o = e("." + a.panel, this.$menu);
l.each(function () {
var n = e(this),
s = n.parent(),
r = s.children("a, span").first();
if (s.is("." + a.panels) || (s.data(i.sub, n), n.data(i.parent, s)), !s.children("." + a.next).length && s.parent().is("." + a.listview)) {
var l = n.attr("id"),
d = e('<a class="' + a.next + '" href="#' + l + '" data-target="#' + l + '" />').insertBefore(r);
r.is("span") && d.addClass(a.fullsubopen)
}
if (!n.children("." + a.navbar).length && !s.hasClass(a.vertical)) {
if (s.parent().is("." + a.listview))
var s = s.closest("." + a.panel);
else
var r = s.closest("." + a.panel).find('a[href="#' + n.attr("id") + '"]').first(), s = r.closest("." + a.panel);
var o = e('<div class="' + a.navbar + '" />');
if (s.length) {
var l = s.attr("id");
switch (t.opts.navbar.titleLink) {
case "anchor":
_url = r.attr("href");
break;
case "panel":
case "parent":
_url = "#" + l;
break;
case "none":
default:
_url = !1
}
o.append('<a class="' + a.btn + " " + a.prev + '" href="#' + l + '" data-target="#' + l + '" />').append(e('<a class="' + a.title + '"' + (_url ? ' href="' + _url + '"' : "") + " />").text(r.text())).prependTo(n),
t.opts.navbar.add && n.addClass(a.hasnavbar)
} else
t.opts.navbar.title && (o.append('<a class="' + a.title + '">' + t.opts.navbar.title + "</a>").prependTo(n), t.opts.navbar.add && n.addClass(a.hasnavbar))
}
});
var c = this.__findAddBack(n, "." + a.listview).children("." + a.selected).removeClass(a.selected).last().addClass(a.selected);
c.add(c.parentsUntil("." + a.menu, "li")).filter("." + a.vertical).addClass(a.opened).end().not("." + a.vertical).each(function () {
e(this).parentsUntil("." + a.menu, "." + a.panel).not("." + a.vertical).first().addClass(a.opened).parentsUntil("." + a.menu, "." + a.panel).not("." + a.vertical).first().addClass(a.opened).addClass(a.subopened)
}),
c.children("." + a.panel).not("." + a.vertical).addClass(a.opened).parentsUntil("." + a.menu, "." + a.panel).not("." + a.vertical).first().addClass(a.opened).addClass(a.subopened);
var h = o.filter("." + a.opened);
return h.length || (h = l.first()),
h.addClass(a.opened).last().addClass(a.current),
l.not("." + a.vertical).not(h.last()).addClass(a.hidden).end().appendTo(this.$pnls),
l
},
_initAnchors: function () {
var n = this;
l.$body.on(r.click + "-oncanvas", "a[href]", function (s) {
var i = e(this),
r = !1,
l = n.$menu.find(i).length;
for (var d in e[t].addons)
if (r = e[t].addons[d].clickAnchor.call(n, i, l))
break;
if (!r && l) {
var o = i.attr("href");
if (o.length > 1 && "#" == o.slice(0, 1))
try {
var c = e(o, n.$menu);
c.is("." + a.panel) && (r = !0, n[i.parent().hasClass(a.vertical) ? "togglePanel" : "openPanel"](c))
} catch (h) {}
}
if (r && s.preventDefault(), !r && l && i.is("." + a.listview + " > li > a") && !i.is('[rel="external"]') && !i.is('[target="_blank"]')) {
n.__valueOrFn(n.opts.onClick.setSelected, i) && n.setSelected(e(s.target).parent());
var p = n.__valueOrFn(n.opts.onClick.preventDefault, i, "#" == o.slice(0, 1));
p && s.preventDefault(),
n.__valueOrFn(n.opts.onClick.close, i, p) && n.close()
}
})
},
_initAddons: function () {
for (var n in e[t].addons)
e[t].addons[n].add.call(this), e[t].addons[n].add = function () {};
for (var n in e[t].addons)
e[t].addons[n].setup.call(this)
},
__api: function () {
var n = this,
t = {};
return e.each(this._api, function () {
var e = this;
t[e] = function () {
var s = n[e].apply(n, arguments);
return "undefined" == typeof s ? t : s
}
}),
t
},
__valueOrFn: function (e, n, t) {
return "function" == typeof e ? e.call(n[0]) : "undefined" == typeof e && "undefined" != typeof t ? t : e
},
__refactorClass: function (e, n, t) {
return e.filter("." + n).removeClass(n).addClass(a[t])
},
__findAddBack: function (e, n) {
return e.find(n).add(e.filter(n))
},
__filterListItems: function (e) {
return e.not("." + a.divider).not("." + a.hidden)
},
__transitionend: function (e, n, t) {
var s = !1,
a = function () {
s || n.call(e[0]),
s = !0
};
e.one(r.transitionend, a),
e.one(r.webkitTransitionEnd, a),
setTimeout(a, 1.1 * t)
},
__getUniqueId: function () {
return a.mm(e[t].uniqueId++)
}
},
e.fn[t] = function (s, a) {
return n(),
s = e.extend(!0, {}, e[t].defaults, s),
a = e.extend(!0, {}, e[t].configuration, a),
this.each(function () {
var n = e(this);
if (!n.data(t)) {
var i = new e[t](n, s, a);
n.data(t, i.__api())
}
})
},
e[t].support = {
touch: "ontouchstart" in window || navigator.msMaxTouchPoints,
csstransitions: function () {
if ("undefined" != typeof Modernizr && "undefined" != typeof Modernizr.csstransitions)
return Modernizr.csstransitions;
var e = document.body || document.documentElement,
n = e.style,
t = "transition";
if ("string" == typeof n[t])
return !0;
var s = ["Moz", "webkit", "Webkit", "Khtml", "O", "ms"];
t = t.charAt(0).toUpperCase() + t.substr(1);
for (var a = 0; a < s.length; a++)
if ("string" == typeof n[s[a] + t])
return !0;
return !1
}
()
};
var a,
i,
r,
l
}
}
(jQuery);
!function (e) {
var t = "mmenu",
o = "offCanvas";
e[t].addons[o] = {
setup: function () {
if (this.opts[o]) {
var s = this.opts[o],
i = this.conf[o];
a = e[t].glbl,
this._api = e.merge(this._api, ["open", "close", "setPage"]),
("top" == s.position || "bottom" == s.position) && (s.zposition = "front"),
"string" != typeof i.pageSelector && (i.pageSelector = "> " + i.pageNodetype),
a.$allMenus = (a.$allMenus || e()).add(this.$menu),
this.vars.opened = !1;
var r = [n.offcanvas];
"left" != s.position && r.push(n.mm(s.position)),
"back" != s.zposition && r.push(n.mm(s.zposition)),
this.$menu.addClass(r.join(" ")).parent().removeClass(n.wrapper),
this.setPage(a.$page),
this._initBlocker(),
this["_initWindow_" + o](),
this.$menu[i.menuInjectMethod + "To"](i.menuWrapperSelector)
}
},
add: function () {
n = e[t]._c,
s = e[t]._d,
i = e[t]._e,
n.add("offcanvas slideout blocking modal background opening blocker page"),
s.add("style"),
i.add("resize")
},
clickAnchor: function (e) {
if (!this.opts[o])
return !1;
var t = this.$menu.attr("id");
if (t && t.length && (this.conf.clone && (t = n.umm(t)), e.is('[href="#' + t + '"]')))
return this.open(), !0;
if (a.$page) {
var t = a.$page.first().attr("id");
return t && t.length && e.is('[href="#' + t + '"]') ? (this.close(), !0) : !1
}
}
},
e[t].defaults[o] = {
position: "left",
zposition: "back",
blockUI: !0,
moveBackground: !0
},
e[t].configuration[o] = {
pageNodetype: "div",
pageSelector: null,
noPageSelector: [],
wrapPageIfNeeded: !0,
menuWrapperSelector: "body",
menuInjectMethod: "prepend"
},
e[t].prototype.open = function () {
if (!this.vars.opened) {
var e = this;
this._openSetup(),
setTimeout(function () {
e._openFinish()
}, this.conf.openingInterval),
this.trigger("open")
}
},
e[t].prototype._openSetup = function () {
var t = this,
r = this.opts[o];
this.closeAllOthers(),
a.$page.each(function () {
e(this).data(s.style, e(this).attr("style") || "")
}),
a.$wndw.trigger(i.resize + "-" + o, [!0]);
var p = [n.opened];
r.blockUI && p.push(n.blocking),
"modal" == r.blockUI && p.push(n.modal),
r.moveBackground && p.push(n.background),
"left" != r.position && p.push(n.mm(this.opts[o].position)),
"back" != r.zposition && p.push(n.mm(this.opts[o].zposition)),
this.opts.extensions && p.push(this.opts.extensions),
a.$html.addClass(p.join(" ")),
setTimeout(function () {
t.vars.opened = !0
}, this.conf.openingInterval),
this.$menu.addClass(n.current + " " + n.opened)
},
e[t].prototype._openFinish = function () {
var e = this;
this.__transitionend(a.$page.first(), function () {
e.trigger("opened")
}, this.conf.transitionDuration),
a.$html.addClass(n.opening),
this.trigger("opening")
},
e[t].prototype.close = function () {
if (this.vars.opened) {
var t = this;
this.__transitionend(a.$page.first(), function () {
t.$menu.removeClass(n.current).removeClass(n.opened),
a.$html.removeClass(n.opened).removeClass(n.blocking).removeClass(n.modal).removeClass(n.background).removeClass(n.mm(t.opts[o].position)).removeClass(n.mm(t.opts[o].zposition)),
t.opts.extensions && a.$html.removeClass(t.opts.extensions),
a.$page.each(function () {
e(this).attr("style", e(this).data(s.style))
}),
t.vars.opened = !1,
t.trigger("closed")
}, this.conf.transitionDuration),
a.$html.removeClass(n.opening),
this.trigger("close"),
this.trigger("closing")
}
},
e[t].prototype.closeAllOthers = function () {
a.$allMenus.not(this.$menu).each(function () {
var o = e(this).data(t);
o && o.close && o.close()
})
},
e[t].prototype.setPage = function (t) {
var s = this,
i = this.conf[o];
t && t.length || (t = a.$body.find(i.pageSelector), i.noPageSelector.length && (t = t.not(i.noPageSelector.join(", "))), t.length > 1 && i.wrapPageIfNeeded && (t = t.wrapAll("<" + this.conf[o].pageNodetype + " />").parent())),
t.each(function () {
e(this).attr("id", e(this).attr("id") || s.__getUniqueId())
}),
t.addClass(n.page + " " + n.slideout),
a.$page = t,
this.trigger("setPage", t)
},
e[t].prototype["_initWindow_" + o] = function () {
a.$wndw.off(i.keydown + "-" + o).on(i.keydown + "-" + o, function (e) {
return a.$html.hasClass(n.opened) && 9 == e.keyCode ? (e.preventDefault(), !1) : void 0
});
var e = 0;
a.$wndw.off(i.resize + "-" + o).on(i.resize + "-" + o, function (t, o) {
if (1 == a.$page.length && (o || a.$html.hasClass(n.opened))) {
var s = a.$wndw.height();
(o || s != e) && (e = s, a.$page.css("minHeight", s))
}
})
},
e[t].prototype._initBlocker = function () {
var t = this;
this.opts[o].blockUI && (a.$blck || (a.$blck = e('<div id="' + n.blocker + '" class="' + n.slideout + '" />')), a.$blck.appendTo(a.$body).off(i.touchstart + "-" + o + " " + i.touchmove + "-" + o).on(i.touchstart + "-" + o + " " + i.touchmove + "-" + o, function (e) {
e.preventDefault(),
e.stopPropagation(),
a.$blck.trigger(i.mousedown + "-" + o)
}).off(i.mousedown + "-" + o).on(i.mousedown + "-" + o, function (e) {
e.preventDefault(),
a.$html.hasClass(n.modal) || (t.closeAllOthers(), t.close())
}))
};
var n,
s,
i,
a
}
(jQuery);
!function (t) {
var e = "mmenu",
s = "autoHeight";
t[e].addons[s] = {
setup: function () {
if (this.opts.offCanvas) {
switch (this.opts.offCanvas.position) {
case "left":
case "right":
return
}
var n = this,
o = this.opts[s];
if (this.conf[s], h = t[e].glbl, "boolean" == typeof o && o && (o = {
height: "auto"
}), "object" != typeof o && (o = {}), o = this.opts[s] = t.extend(!0, {}, t[e].defaults[s], o), "auto" == o.height) {
this.$menu.addClass(i.autoheight);
var u = function (t) {
var e = parseInt(this.$pnls.css("top"), 10) || 0;
_bot = parseInt(this.$pnls.css("bottom"), 10) || 0,
this.$menu.addClass(i.measureheight),
t = t || this.$pnls.children("." + i.current),
t.is("." + i.vertical) && (t = t.parents("." + i.panel).not("." + i.vertical).first()),
this.$menu.height(t.outerHeight() + e + _bot).removeClass(i.measureheight)
};
this.bind("update", u),
this.bind("openPanel", u),
this.bind("closePanel", u),
this.bind("open", u),
h.$wndw.off(a.resize + "-autoheight").on(a.resize + "-autoheight", function () {
u.call(n)
})
}
}
},
add: function () {
i = t[e]._c,
n = t[e]._d,
a = t[e]._e,
i.add("autoheight measureheight"),
a.add("resize")
},
clickAnchor: function () {}
},
t[e].defaults[s] = {
height: "default"
};
var i,
n,
a,
h
}
(jQuery);
!function (o) {
var t = "mmenu",
n = "backButton";
o[t].addons[n] = {
setup: function () {
if (this.opts.offCanvas) {
var i = this,
e = this.opts[n];
if (this.conf[n], a = o[t].glbl, "boolean" == typeof e && (e = {
close: e
}), "object" != typeof e && (e = {}), e = o.extend(!0, {}, o[t].defaults[n], e), e.close) {
var c = "#" + i.$menu.attr("id");
this.bind("opened", function () {
location.hash != c && history.pushState(null, document.title, c)
}),
o(window).on("popstate", function (o) {
a.$html.hasClass(s.opened) ? (o.stopPropagation(), i.close()) : location.hash == c && (o.stopPropagation(), i.open())
})
}
}
},
add: function () {
return window.history && window.history.pushState ? (s = o[t]._c, i = o[t]._d, void(e = o[t]._e)) : void(o[t].addons[n].setup = function () {})
},
clickAnchor: function () {}
},
o[t].defaults[n] = {
close: !1
};
var s,
i,
e,
a
}
(jQuery);
!function (t) {
var n = "mmenu",
e = "counters";
t[n].addons[e] = {
setup: function () {
var s = this,
o = this.opts[e];
this.conf[e],
c = t[n].glbl,
"boolean" == typeof o && (o = {
add: o,
update: o
}),
"object" != typeof o && (o = {}),
o = this.opts[e] = t.extend(!0, {}, t[n].defaults[e], o),
this.bind("init", function (n) {
this.__refactorClass(t("em", n), this.conf.classNames[e].counter, "counter")
}),
o.add && this.bind("init", function (n) {
n.each(function () {
var n = t(this).data(a.parent);
n && (n.children("em." + i.counter).length || n.prepend(t('<em class="' + i.counter + '" />')))
})
}),
o.update && this.bind("update", function () {
this.$pnls.find("." + i.panel).each(function () {
var n = t(this),
e = n.data(a.parent);
if (e) {
var c = e.children("em." + i.counter);
c.length && (n = n.children("." + i.listview), n.length && c.html(s.__filterListItems(n.children()).length))
}
})
})
},
add: function () {
i = t[n]._c,
a = t[n]._d,
s = t[n]._e,
i.add("counter search noresultsmsg")
},
clickAnchor: function () {}
},
t[n].defaults[e] = {
add: !1,
update: !1
},
t[n].configuration.classNames[e] = {
counter: "Counter"
};
var i,
a,
s,
c
}
(jQuery);
!function (i) {
var e = "mmenu",
s = "dividers";
i[e].addons[s] = {
setup: function () {
var n = this,
a = this.opts[s];
if (this.conf[s], l = i[e].glbl, "boolean" == typeof a && (a = {
add: a,
fixed: a
}), "object" != typeof a && (a = {}), a = this.opts[s] = i.extend(!0, {}, i[e].defaults[s], a), this.bind("init", function () {
this.__refactorClass(i("li", this.$menu), this.conf.classNames[s].collapsed, "collapsed")
}), a.add && this.bind("init", function (e) {
switch (a.addTo) {
case "panels":
var s = e;
break;
default:
var s = i(a.addTo, this.$pnls).filter("." + d.panel)
}
i("." + d.divider, s).remove(),
s.find("." + d.listview).not("." + d.vertical).each(function () {
var e = "";
n.__filterListItems(i(this).children()).each(function () {
var s = i.trim(i(this).children("a, span").text()).slice(0, 1).toLowerCase();
s != e && s.length && (e = s, i('<li class="' + d.divider + '">' + s + "</li>").insertBefore(this))
})
})
}), a.collapse && this.bind("init", function (e) {
i("." + d.divider, e).each(function () {
var e = i(this),
s = e.nextUntil("." + d.divider, "." + d.collapsed);
s.length && (e.children("." + d.subopen).length || (e.wrapInner("<span />"), e.prepend('<a href="#" class="' + d.subopen + " " + d.fullsubopen + '" />')))
})
}), a.fixed) {
var o = function (e) {
e = e || this.$pnls.children("." + d.current);
var s = e.find("." + d.divider).not("." + d.hidden);
if (s.length) {
this.$menu.addClass(d.hasdividers);
var n = e.scrollTop() || 0,
t = "";
e.is(":visible") && e.find("." + d.divider).not("." + d.hidden).each(function () {
i(this).position().top + n < n + 1 && (t = i(this).text())
}),
this.$fixeddivider.text(t)
} else
this.$menu.removeClass(d.hasdividers)
};
this.$fixeddivider = i('<ul class="' + d.listview + " " + d.fixeddivider + '"><li class="' + d.divider + '"></li></ul>').prependTo(this.$pnls).children(),
this.bind("openPanel", o),
this.bind("init", function (e) {
e.off(t.scroll + "-dividers " + t.touchmove + "-dividers").on(t.scroll + "-dividers " + t.touchmove + "-dividers", function () {
o.call(n, i(this))
})
})
}
},
add: function () {
d = i[e]._c,
n = i[e]._d,
t = i[e]._e,
d.add("collapsed uncollapsed fixeddivider hasdividers"),
t.add("scroll")
},
clickAnchor: function (i, e) {
if (this.opts[s].collapse && e) {
var n = i.parent();
if (n.is("." + d.divider)) {
var t = n.nextUntil("." + d.divider, "." + d.collapsed);
return n.toggleClass(d.opened),
t[n.hasClass(d.opened) ? "addClass" : "removeClass"](d.uncollapsed),
!0
}
}
return !1
}
},
i[e].defaults[s] = {
add: !1,
addTo: "panels",
fixed: !1,
collapse: !1
},
i[e].configuration.classNames[s] = {
collapsed: "Collapsed"
};
var d,
n,
t,
l
}
(jQuery);
!function (e) {
function t(e, t, n) {
return t > e && (e = t),
e > n && (e = n),
e
}
var n = "mmenu",
o = "dragOpen";
e[n].addons[o] = {
setup: function () {
if (this.opts.offCanvas) {
var i = this,
a = this.opts[o],
p = this.conf[o];
if (r = e[n].glbl, "boolean" == typeof a && (a = {
open: a
}), "object" != typeof a && (a = {}), a = this.opts[o] = e.extend(!0, {}, e[n].defaults[o], a), a.open) {
var d,
f,
c,
u,
h,
l = {},
m = 0,
g = !1,
v = !1,
w = 0,
_ = 0;
switch (this.opts.offCanvas.position) {
case "left":
case "right":
l.events = "panleft panright",
l.typeLower = "x",
l.typeUpper = "X",
v = "width";
break;
case "top":
case "bottom":
l.events = "panup pandown",
l.typeLower = "y",
l.typeUpper = "Y",
v = "height"
}
switch (this.opts.offCanvas.position) {
case "right":
case "bottom":
l.negative = !0,
u = function (e) {
e >= r.$wndw[v]() - a.maxStartPos && (m = 1)
};
break;
default:
l.negative = !1,
u = function (e) {
e <= a.maxStartPos && (m = 1)
}
}
switch (this.opts.offCanvas.position) {
case "left":
l.open_dir = "right",
l.close_dir = "left";
break;
case "right":
l.open_dir = "left",
l.close_dir = "right";
break;
case "top":
l.open_dir = "down",
l.close_dir = "up";
break;
case "bottom":
l.open_dir = "up",
l.close_dir = "down"
}
switch (this.opts.offCanvas.zposition) {
case "front":
h = function () {
return this.$menu
};
break;
default:
h = function () {
return e("." + s.slideout)
}
}
var b = this.__valueOrFn(a.pageNode, this.$menu, r.$page);
"string" == typeof b && (b = e(b));
var y = new Hammer(b[0], a.vendors.hammer);
y.on("panstart", function (e) {
u(e.center[l.typeLower]),
r.$slideOutNodes = h(),
g = l.open_dir
}).on(l.events + " panend", function (e) {
m > 0 && e.preventDefault()
}).on(l.events, function (e) {
if (d = e["delta" + l.typeUpper], l.negative && (d = -d), d != w && (g = d >= w ? l.open_dir : l.close_dir), w = d, w > a.threshold && 1 == m) {
if (r.$html.hasClass(s.opened))
return;
m = 2,
i._openSetup(),
i.trigger("opening"),
r.$html.addClass(s.dragging),
_ = t(r.$wndw[v]() * p[v].perc, p[v].min, p[v].max)
}
2 == m && (f = t(w, 10, _) - ("front" == i.opts.offCanvas.zposition ? _ : 0), l.negative && (f = -f), c = "translate" + l.typeUpper + "(" + f + "px )", r.$slideOutNodes.css({
"-webkit-transform": "-webkit-" + c,
transform: c
}))
}).on("panend", function () {
2 == m && (r.$html.removeClass(s.dragging), r.$slideOutNodes.css("transform", ""), i[g == l.open_dir ? "_openFinish" : "close"]()),
m = 0
})
}
}
},
add: function () {
return "function" != typeof Hammer || Hammer.VERSION < 2 ? void(e[n].addons[o].setup = function () {}) : (s = e[n]._c, i = e[n]._d, a = e[n]._e, void s.add("dragging"))
},
clickAnchor: function () {}
},
e[n].defaults[o] = {
open: !1,
maxStartPos: 100,
threshold: 50,
vendors: {
hammer: {}
}
},
e[n].configuration[o] = {
width: {
perc: .8,
min: 140,
max: 440
},
height: {
perc: .8,
min: 140,
max: 880
}
};
var s,
i,
a,
r
}
(jQuery);
!function (s) {
var i = "mmenu",
t = "fixedElements";
s[i].addons[t] = {
setup: function () {
if (this.opts.offCanvas) {
var n = this.opts[t];
this.conf[t],
d = s[i].glbl,
n = this.opts[t] = s.extend(!0, {}, s[i].defaults[t], n);
var a = function (s) {
var i = this.conf.classNames[t].fixed;
this.__refactorClass(s.find("." + i), i, "slideout").appendTo(d.$body)
};
a.call(this, d.$page),
this.bind("setPage", a)
}
},
add: function () {
n = s[i]._c,
a = s[i]._d,
e = s[i]._e,
n.add("fixed")
},
clickAnchor: function () {}
},
s[i].configuration.classNames[t] = {
fixed: "Fixed"
};
var n,
a,
e,
d
}
(jQuery);
!function (e) {
var n = "mmenu",
i = "iconPanels";
e[n].addons[i] = {
setup: function () {
var a = this,
l = this.opts[i];
if (this.conf[i], d = e[n].glbl, "boolean" == typeof l && (l = {
add: l
}), "number" == typeof l && (l = {
add: !0,
visible: l
}), "object" != typeof l && (l = {}), l = this.opts[i] = e.extend(!0, {}, e[n].defaults[i], l), l.visible++, l.add) {
this.$menu.addClass(s.iconpanel);
for (var t = [], o = 0; o <= l.visible; o++)
t.push(s.iconpanel + "-" + o);
t = t.join(" ");
var c = function (n) {
var i = a.$pnls.children("." + s.panel).removeClass(t),
d = i.filter("." + s.subopened);
d.removeClass(s.hidden).add(n).slice(-l.visible).each(function (n) {
e(this).addClass(s.iconpanel + "-" + n)
})
};
this.bind("openPanel", c),
this.bind("init", function (n) {
c.call(a, a.$pnls.children("." + s.current)),
l.hideNavbars && n.removeClass(s.hasnavbar),
n.each(function () {
e(this).children("." + s.subblocker).length || e(this).prepend('<a href="#' + e(this).closest("." + s.panel).attr("id") + '" class="' + s.subblocker + '" />')
})
})
}
},
add: function () {
s = e[n]._c,
a = e[n]._d,
l = e[n]._e,
s.add("iconpanel subblocker")
},
clickAnchor: function () {}
},
e[n].defaults[i] = {
add: !1,
visible: 3,
hideNavbars: !1
};
var s,
a,
l,
d
}
(jQuery);
!function (n) {
var a = "mmenu",
t = "navbars";
n[a].addons[t] = {
setup: function () {
var r = this,
s = this.opts[t],
c = this.conf[t];
if (i = n[a].glbl, "undefined" != typeof s) {
s instanceof Array || (s = [s]);
var d = {};
n.each(s, function (i) {
var o = s[i];
"boolean" == typeof o && o && (o = {}),
"object" != typeof o && (o = {}),
"undefined" == typeof o.content && (o.content = ["prev", "title"]),
o.content instanceof Array || (o.content = [o.content]),
o = n.extend(!0, {}, r.opts.navbar, o);
var l = o.position,
h = o.height;
"number" != typeof h && (h = 1),
h = Math.min(4, Math.max(1, h)),
"bottom" != l && (l = "top"),
d[l] || (d[l] = 0),
d[l]++;
var f = n("<div />").addClass(e.navbar + " " + e.navbar + "-" + l + " " + e.navbar + "-" + l + "-" + d[l] + " " + e.navbar + "-size-" + h);
d[l] += h - 1;
for (var v = 0, p = o.content.length; p > v; v++) {
var u = n[a].addons[t][o.content[v]] || !1;
u ? u.call(r, f, o, c) : (u = o.content[v], u instanceof n || (u = n(o.content[v])), u.each(function () {
f.append(n(this))
}))
}
var b = Math.ceil(f.children().not("." + e.btn).length / h);
b > 1 && f.addClass(e.navbar + "-content-" + b),
f.children("." + e.btn).length && f.addClass(e.hasbtns),
f.prependTo(r.$menu)
});
for (var o in d)
r.$menu.addClass(e.hasnavbar + "-" + o + "-" + d[o])
}
},
add: function () {
e = n[a]._c,
r = n[a]._d,
s = n[a]._e,
e.add("close hasbtns")
},
clickAnchor: function () {}
},
n[a].configuration[t] = {
breadcrumbSeparator: "/"
},
n[a].configuration.classNames[t] = {
panelTitle: "Title",
panelNext: "Next",
panelPrev: "Prev"
};
var e,
r,
s,
i
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "breadcrumbs";
n[a].addons[t][e] = function (t, e, r) {
var s = n[a]._c,
i = n[a]._d;
s.add("breadcrumbs separator"),
t.append('<span class="' + s.breadcrumbs + '"></span>'),
this.bind("init", function (a) {
a.removeClass(s.hasnavbar).each(function () {
for (var a = [], t = n(this), e = n('<span class="' + s.breadcrumbs + '"></span>'), c = n(this).children().first(), d = !0; c && c.length; ) {
c.is("." + s.panel) || (c = c.closest("." + s.panel));
var o = c.children("." + s.navbar).children("." + s.title).text();
a.unshift(d ? "<span>" + o + "</span>" : '<a href="#' + c.attr("id") + '">' + o + "</a>"),
d = !1,
c = c.data(i.parent)
}
e.append(a.join('<span class="' + s.separator + '">' + r.breadcrumbSeparator + "</span>")).appendTo(t.children("." + s.navbar))
})
});
var c = function () {
var n = this.$pnls.children("." + s.current),
a = t.find("." + s.breadcrumbs),
e = n.children("." + s.navbar).children("." + s.breadcrumbs);
a.html(e.html())
};
this.bind("openPanel", c),
this.bind("init", c)
}
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "close";
n[a].addons[t][e] = function (t) {
var e = n[a]._c,
r = n[a].glbl;
t.append('<a class="' + e.close + " " + e.btn + '" href="#"></a>');
var s = function (n) {
t.find("." + e.close).attr("href", "#" + n.attr("id"))
};
s.call(this, r.$page),
this.bind("setPage", s)
}
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "next";
n[a].addons[t][e] = function (e) {
var r = n[a]._c;
e.append('<a class="' + r.next + " " + r.btn + '" href="#"></a>');
var s = function (n) {
n = n || this.$pnls.children("." + r.current);
var a = e.find("." + r.next),
s = n.find("." + this.conf.classNames[t].panelNext),
i = s.attr("href"),
c = s.html();
a[i ? "attr" : "removeAttr"]("href", i),
a[i || c ? "removeClass" : "addClass"](r.hidden),
a.html(c)
};
this.bind("openPanel", s),
this.bind("init", function () {
s.call(this)
})
}
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "prev";
n[a].addons[t][e] = function (e) {
var r = n[a]._c;
e.append('<a class="' + r.prev + " " + r.btn + '" href="#"></a>'),
this.bind("init", function (n) {
n.removeClass(r.hasnavbar)
});
var s = function () {
var n = this.$pnls.children("." + r.current),
a = e.find("." + r.prev),
s = n.find("." + this.conf.classNames[t].panelPrev);
s.length || (s = n.children("." + r.navbar).children("." + r.prev));
var i = s.attr("href"),
c = s.html();
a[i ? "attr" : "removeAttr"]("href", i),
a[i || c ? "removeClass" : "addClass"](r.hidden),
a.html(c)
};
this.bind("openPanel", s),
this.bind("init", s)
}
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "searchfield";
n[a].addons[t][e] = function (t) {
var e = n[a]._c,
r = n('<div class="' + e.search + '" />').appendTo(t);
"object" != typeof this.opts.searchfield && (this.opts.searchfield = {}),
this.opts.searchfield.add = !0,
this.opts.searchfield.addTo = r
}
}
(jQuery), function (n) {
var a = "mmenu",
t = "navbars",
e = "title";
n[a].addons[t][e] = function (e, r) {
var s = n[a]._c;
e.append('<a class="' + s.title + '"></a>');
var i = function (n) {
n = n || this.$pnls.children("." + s.current);
var a = e.find("." + s.title),
i = n.find("." + this.conf.classNames[t].panelTitle);
i.length || (i = n.children("." + s.navbar).children("." + s.title));
var c = i.attr("href"),
d = i.html() || r.title;
a[c ? "attr" : "removeAttr"]("href", c),
a[c || d ? "removeClass" : "addClass"](s.hidden),
a.html(d)
};
this.bind("openPanel", i),
this.bind("init", function () {
i.call(this)
})
}
}
(jQuery);
!function (e) {
function s(e) {
switch (e) {
case 9:
case 16:
case 17:
case 18:
case 37:
case 38:
case 39:
case 40:
return !0
}
return !1
}
var n = "mmenu",
a = "searchfield";
e[n].addons[a] = {
setup: function () {
var o = this,
d = this.opts[a],
c = this.conf[a];
r = e[n].glbl,
"boolean" == typeof d && (d = {
add: d
}),
"object" != typeof d && (d = {}),
d = this.opts[a] = e.extend(!0, {}, e[n].defaults[a], d),
this.bind("close", function () {
this.$menu.find("." + l.search).find("input").blur()
}),
this.bind("init", function (n) {
if (d.add) {
switch (d.addTo) {
case "panels":
var a = n;
break;
default:
var a = e(d.addTo, this.$menu)
}
a.each(function () {
var s = e(this);
if (!s.is("." + l.panel) || !s.is("." + l.vertical)) {
if (!s.children("." + l.search).length) {
var n = c.form ? "form" : "div",
a = e("<" + n + ' class="' + l.search + '" />');
if (c.form && "object" == typeof c.form)
for (var t in c.form)
a.attr(t, c.form[t]);
a.append('<input placeholder="' + d.placeholder + '" type="text" autocomplete="off" />'),
s.hasClass(l.search) ? s.replaceWith(a) : s.prepend(a).addClass(l.hassearch)
}
if (d.noResults) {
var i = s.closest("." + l.panel).length;
if (i || (s = o.$pnls.children("." + l.panel).first()), !s.children("." + l.noresultsmsg).length) {
var r = s.children("." + l.listview).first();
e('<div class="' + l.noresultsmsg + '" />').append(d.noResults)[r.length ? "insertAfter" : "prependTo"](r.length ? r : s)
}
}
}
}),
d.search && e("." + l.search, this.$menu).each(function () {
var n = e(this),
a = n.closest("." + l.panel).length;
if (a)
var r = n.closest("." + l.panel), c = r;
else
var r = e("." + l.panel, o.$menu), c = o.$menu;
var h = n.children("input"),
u = o.__findAddBack(r, "." + l.listview).children("li"),
f = u.filter("." + l.divider),
p = o.__filterListItems(u),
v = "> a",
m = v + ", > span",
b = function () {
var s = h.val().toLowerCase();
r.scrollTop(0),
p.add(f).addClass(l.hidden).find("." + l.fullsubopensearch).removeClass(l.fullsubopen).removeClass(l.fullsubopensearch),
p.each(function () {
var n = e(this),
a = v;
(d.showTextItems || d.showSubPanels && n.find("." + l.next)) && (a = m),
e(a, n).text().toLowerCase().indexOf(s) > -1 && n.add(n.prevAll("." + l.divider).first()).removeClass(l.hidden)
}),
d.showSubPanels && r.each(function () {
var s = e(this);
o.__filterListItems(s.find("." + l.listview).children()).each(function () {
var s = e(this),
n = s.data(t.sub);
s.removeClass(l.nosubresults),
n && n.find("." + l.listview).children().removeClass(l.hidden)
})
}),
e(r.get().reverse()).each(function (s) {
var n = e(this),
i = n.data(t.parent);
i && (o.__filterListItems(n.find("." + l.listview).children()).length ? (i.hasClass(l.hidden) && i.children("." + l.next).not("." + l.fullsubopen).addClass(l.fullsubopen).addClass(l.fullsubopensearch), i.removeClass(l.hidden).removeClass(l.nosubresults).prevAll("." + l.divider).first().removeClass(l.hidden)) : a || (n.hasClass(l.opened) && setTimeout(function () {
o.openPanel(i.closest("." + l.panel))
}, 1.5 * (s + 1) * o.conf.openingInterval), i.addClass(l.nosubresults)))
}),
c[p.not("." + l.hidden).length ? "removeClass" : "addClass"](l.noresults),
this.update()
};
h.off(i.keyup + "-searchfield " + i.change + "-searchfield").on(i.keyup + "-searchfield", function (e) {
s(e.keyCode) || b.call(o)
}).on(i.change + "-searchfield", function () {
b.call(o)
})
})
}
})
},
add: function () {
l = e[n]._c,
t = e[n]._d,
i = e[n]._e,
l.add("search hassearch noresultsmsg noresults nosubresults fullsubopensearch"),
i.add("change keyup")
},
clickAnchor: function () {}
},
e[n].defaults[a] = {
add: !1,
addTo: "panels",
search: !0,
placeholder: "Search",
noResults: "No results found.",
showTextItems: !1,
showSubPanels: !0
},
e[n].configuration[a] = {
form: !1
};
var l,
t,
i,
r
}
(jQuery);
!function (e) {
var a = "mmenu",
r = "sectionIndexer";
e[a].addons[r] = {
setup: function () {
var i = this,
d = this.opts[r];
this.conf[r],
t = e[a].glbl,
"boolean" == typeof d && (d = {
add: d
}),
"object" != typeof d && (d = {}),
d = this.opts[r] = e.extend(!0, {}, e[a].defaults[r], d),
this.bind("init", function (a) {
if (d.add) {
switch (d.addTo) {
case "panels":
var r = a;
break;
default:
var r = e(d.addTo, this.$menu).filter("." + n.panel)
}
r.find("." + n.divider).closest("." + n.panel).addClass(n.hasindexer)
}
if (!this.$indexer && this.$pnls.children("." + n.hasindexer).length) {
this.$indexer = e('<div class="' + n.indexer + '" />').prependTo(this.$pnls).append('<a href="#a">a</a><a href="#b">b</a><a href="#c">c</a><a href="#d">d</a><a href="#e">e</a><a href="#f">f</a><a href="#g">g</a><a href="#h">h</a><a href="#i">i</a><a href="#j">j</a><a href="#k">k</a><a href="#l">l</a><a href="#m">m</a><a href="#n">n</a><a href="#o">o</a><a href="#p">p</a><a href="#q">q</a><a href="#r">r</a><a href="#s">s</a><a href="#t">t</a><a href="#u">u</a><a href="#v">v</a><a href="#w">w</a><a href="#x">x</a><a href="#y">y</a><a href="#z">z</a>'),
this.$indexer.children().on(s.mouseover + "-sectionindexer " + n.touchstart + "-sectionindexer", function () {
var a = e(this).attr("href").slice(1),
r = i.$pnls.children("." + n.current),
s = r.find("." + n.listview),
t = !1,
d = r.scrollTop(),
h = s.position().top + parseInt(s.css("margin-top"), 10) + parseInt(s.css("padding-top"), 10) + d;
r.scrollTop(0),
s.children("." + n.divider).not("." + n.hidden).each(function () {
t === !1 && a == e(this).text().slice(0, 1).toLowerCase() && (t = e(this).position().top + h)
}),
r.scrollTop(t !== !1 ? t : d)
});
var t = function (e) {
i.$menu[(e.hasClass(n.hasindexer) ? "add" : "remove") + "Class"](n.hasindexer)
};
this.bind("openPanel", t),
t.call(this, this.$pnls.children("." + n.current))
}
})
},
add: function () {
n = e[a]._c,
i = e[a]._d,
s = e[a]._e,
n.add("indexer hasindexer"),
s.add("mouseover touchstart")
},
clickAnchor: function (e) {
return e.parent().is("." + n.indexer) ? !0 : void 0
}
},
e[a].defaults[r] = {
add: !1,
addTo: "panels"
};
var n,
i,
s,
t
}
(jQuery);
!function (t) {
var e = "mmenu",
c = "toggles";
t[e].addons[c] = {
setup: function () {
var n = this;
this.opts[c],
this.conf[c],
l = t[e].glbl,
this.bind("init", function (e) {
this.__refactorClass(t("input", e), this.conf.classNames[c].toggle, "toggle"),
this.__refactorClass(t("input", e), this.conf.classNames[c].check, "check"),
t("input." + s.toggle + ", input." + s.check, e).each(function () {
var e = t(this),
c = e.closest("li"),
i = e.hasClass(s.toggle) ? "toggle" : "check",
l = e.attr("id") || n.__getUniqueId();
c.children('label[for="' + l + '"]').length || (e.attr("id", l), c.prepend(e), t('<label for="' + l + '" class="' + s[i] + '"></label>').insertBefore(c.children("a, span").last()))
})
})
},
add: function () {
s = t[e]._c,
n = t[e]._d,
i = t[e]._e,
s.add("toggle check")
},
clickAnchor: function () {}
},
t[e].configuration.classNames[c] = {
toggle: "Toggle",
check: "Check"
};
var s,
n,
i,
l
}
(jQuery); ;
(function (e) {
"use strict";
var s = function () {
var s = {
bcClass: "sf-breadcrumb",
menuClass: "sf-js-enabled",
anchorClass: "sf-with-ul",
menuArrowClass: "sf-arrows"
},
o = function () {
var s = /iPhone|iPad|iPod/i.test(navigator.userAgent);
return s && e(window).load(function () {
e("body").children().on("click", e.noop)
}),
s
}
(),
n = function () {
var e = document.documentElement.style;
return "behavior" in e && "fill" in e && /iemobile/i.test(navigator.userAgent)
}
(),
t = function (e, o) {
var n = s.menuClass;
o.cssArrows && (n += " " + s.menuArrowClass),
e.toggleClass(n)
},
i = function (o, n) {
return o.find("li." + n.pathClass).slice(0, n.pathLevels).addClass(n.hoverClass + " " + s.bcClass).filter(function () {
return e(this).children(n.popUpSelector).hide().show().length
}).removeClass(n.pathClass)
},
r = function (e) {
e.children("a").toggleClass(s.anchorClass)
},
a = function (e) {
var s = e.css("ms-touch-action");
s = "pan-y" === s ? "auto" : "pan-y",
e.css("ms-touch-action", s)
},
l = function (s, t) {
var i = "li:has(" + t.popUpSelector + ")";
e.fn.hoverIntent && !t.disableHI ? s.hoverIntent(u, p, i) : s.on("mouseenter.superfish", i, u).on("mouseleave.superfish", i, p);
var r = "MSPointerDown.superfish";
o || (r += " touchend.superfish"),
n && (r += " mousedown.superfish"),
s.on("focusin.superfish", "li", u).on("focusout.superfish", "li", p).on(r, "a", t, h)
},
h = function (s) {
var o = e(this),
n = o.siblings(s.data.popUpSelector);
n.length > 0 && n.is(":hidden") && (o.one("click.superfish", !1), "MSPointerDown" === s.type ? o.trigger("focus") : e.proxy(u, o.parent("li"))())
},
u = function () {
var s = e(this),
o = d(s);
clearTimeout(o.sfTimer),
s.siblings().superfish("hide").end().superfish("show")
},
p = function () {
var s = e(this),
n = d(s);
o ? e.proxy(f, s, n)() : (clearTimeout(n.sfTimer), n.sfTimer = setTimeout(e.proxy(f, s, n), n.delay))
},
f = function (s) {
s.retainPath = e.inArray(this[0], s.$path) > -1,
this.superfish("hide"),
this.parents("." + s.hoverClass).length || (s.onIdle.call(c(this)), s.$path.length && e.proxy(u, s.$path)())
},
c = function (e) {
return e.closest("." + s.menuClass)
},
d = function (e) {
return c(e).data("sf-options")
};
return {
hide: function (s) {
if (this.length) {
var o = this,
n = d(o);
if (!n)
return this;
var t = n.retainPath === !0 ? n.$path : "",
i = o.find("li." + n.hoverClass).add(this).not(t).removeClass(n.hoverClass).children(n.popUpSelector),
r = n.speedOut;
s && (i.show(), r = 0),
n.retainPath = !1,
n.onBeforeHide.call(i),
i.stop(!0, !0).animate(n.animationOut, r, function () {
var s = e(this);
n.onHide.call(s)
})
}
return this
},
show: function () {
var e = d(this);
if (!e)
return this;
var s = this.addClass(e.hoverClass),
o = s.children(e.popUpSelector);
return e.onBeforeShow.call(o),
o.stop(!0, !0).animate(e.animation, e.speed, function () {
e.onShow.call(o)
}),
this
},
destroy: function () {
return this.each(function () {
var o,
n = e(this),
i = n.data("sf-options");
return i ? (o = n.find(i.popUpSelector).parent("li"), clearTimeout(i.sfTimer), t(n, i), r(o), a(n), n.off(".superfish").off(".hoverIntent"), o.children(i.popUpSelector).attr("style", function (e, s) {
return s.replace(/display[^;]+;?/g, "")
}), i.$path.removeClass(i.hoverClass + " " + s.bcClass).addClass(i.pathClass), n.find("." + i.hoverClass).removeClass(i.hoverClass), i.onDestroy.call(n), n.removeData("sf-options"), void 0) : !1
})
},
init: function (o) {
return this.each(function () {
var n = e(this);
if (n.data("sf-options"))
return !1;
var h = e.extend({}, e.fn.superfish.defaults, o),
u = n.find(h.popUpSelector).parent("li");
h.$path = i(n, h),
n.data("sf-options", h),
t(n, h),
r(u),
a(n),
l(n, h),
u.not("." + s.bcClass).superfish("hide", !0),
h.onInit.call(this)
})
}
}
}
();
e.fn.superfish = function (o) {
return s[o] ? s[o].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof o && o ? e.error("Method " + o + " does not exist on jQuery.fn.superfish") : s.init.apply(this, arguments)
},
e.fn.superfish.defaults = {
popUpSelector: "ul,.sf-mega",
hoverClass: "sfHover",
pathClass: "overrideThisToUse",
pathLevels: 1,
delay: 800,
animation: {
opacity: "show"
},
animationOut: {
opacity: "hide"
},
speed: "normal",
speedOut: "fast",
cssArrows: !0,
disableHI: !1,
onInit: e.noop,
onBeforeShow: e.noop,
onShow: e.noop,
onBeforeHide: e.noop,
onHide: e.noop,
onIdle: e.noop,
onDestroy: e.noop
},
e.fn.extend({
hideSuperfishUl: s.hide,
showSuperfishUl: s.show
})
})(jQuery);
(function ($) {
$(function () {
$('.sf-menu').superfish({
'speed': 100,
'delay': 0,
'animation': {
'height': 'show'
}
});
$("#menu-top-slide").mmenu({
"slidingSubmenus": false,
"extensions": ["theme-dark", "pageshadow", "border-full"]
});
$("#menu-main-slide").mmenu({
"slidingSubmenus": false,
"extensions": ["theme-dark", "pageshadow", "border-full"]
});
$(".entry-content, .video-cover, #slider, .zoomvideo_big, #content").fitVids();
});
})(jQuery);
!function (a, b, c) {
!function (a) {
"use strict";
"function" == typeof define && define.amd ? define(["jquery"], a) : jQuery && !jQuery.fn.qtip && a(jQuery)
}
(function (d) {
"use strict";
function e(a, b, c, e) {
this.id = c,
this.target = a,
this.tooltip = A,
this.elements = {
target: a
},
this._id = L + "-" + c,
this.timers = {
img: {}
},
this.options = b,
this.plugins = {},
this.cache = {
event: {},
target: d(),
disabled: z,
attr: e,
onTooltip: z,
lastClass: ""
},
this.rendered = this.destroyed = this.disabled = this.waiting = this.hiddenDuringWait = this.positioning = this.triggering = z
}
function f(a) {
return a === A || "object" !== d.type(a)
}
function g(a) {
return !(d.isFunction(a) || a && a.attr || a.length || "object" === d.type(a) && (a.jquery || a.then))
}
function h(a) {
var b,
c,
e,
h;
return f(a) ? z : (f(a.metadata) && (a.metadata = {
type: a.metadata
}), "content" in a && (b = a.content, f(b) || b.jquery || b.done ? (c = g(b) ? z : b, b = a.content = {
text: c
}) : c = b.text, "ajax" in b && (e = b.ajax, h = e && e.once !== z, delete b.ajax, b.text = function (a, b) {
var f = c || d(this).attr(b.options.content.attr) || "Loading...",
g = d.ajax(d.extend({}, e, {
context: b
})).then(e.success, A, e.error).then(function (a) {
return a && h && b.set("content.text", a),
a
}, function (a, c, d) {
b.destroyed || 0 === a.status || b.set("content.text", c + ": " + d)
});
return h ? f : (b.set("content.text", f), g)
}), "title" in b && (d.isPlainObject(b.title) && (b.button = b.title.button, b.title = b.title.text), g(b.title || z) && (b.title = z))), "position" in a && f(a.position) && (a.position = {
my: a.position,
at: a.position
}), "show" in a && f(a.show) && (a.show = a.show.jquery ? {
target: a.show
}
: a.show === y ? {
ready: y
}
: {
event: a.show
}), "hide" in a && f(a.hide) && (a.hide = a.hide.jquery ? {
target: a.hide
}
: {
event: a.hide
}), "style" in a && f(a.style) && (a.style = {
classes: a.style
}), d.each(K, function () {
this.sanitize && this.sanitize(a)
}), a)
}
function i(a, b) {
for (var c, d = 0, e = a, f = b.split("."); e = e[f[d++]]; )
d < f.length && (c = e);
return [c || a, f.pop()]
}
function j(a, b) {
var c,
d,
e;
for (c in this.checks)
if (this.checks.hasOwnProperty(c))
for (d in this.checks[c])
this.checks[c].hasOwnProperty(d) && (e = new RegExp(d, "i").exec(a)) && (b.push(e), ("builtin" === c || this.plugins[c]) && this.checks[c][d].apply(this.plugins[c] || this, b))
}
function k(a) {
return O.concat("").join(a ? "-" + a + " " : " ")
}
function l(a, b) {
return b > 0 ? setTimeout(d.proxy(a, this), b) : void a.call(this)
}
function m(a) {
this.tooltip.hasClass(V) || (clearTimeout(this.timers.show), clearTimeout(this.timers.hide), this.timers.show = l.call(this, function () {
this.toggle(y, a)
}, this.options.show.delay))
}
function n(a) {
if (!this.tooltip.hasClass(V) && !this.destroyed) {
var b = d(a.relatedTarget),
c = b.closest(P)[0] === this.tooltip[0],
e = b[0] === this.options.show.target[0];
if (clearTimeout(this.timers.show), clearTimeout(this.timers.hide), this !== b[0] && "mouse" === this.options.position.target && c || this.options.hide.fixed && /mouse(out|leave|move)/.test(a.type) && (c || e))
try {
a.preventDefault(),
a.stopImmediatePropagation()
} catch (f) {}
else
this.timers.hide = l.call(this, function () {
this.toggle(z, a)
}, this.options.hide.delay, this)
}
}
function o(a) {
!this.tooltip.hasClass(V) && this.options.hide.inactive && (clearTimeout(this.timers.inactive), this.timers.inactive = l.call(this, function () {
this.hide(a)
}, this.options.hide.inactive))
}
function p(a) {
this.rendered && this.tooltip[0].offsetWidth > 0 && this.reposition(a)
}
function q(a, c, e) {
d(b.body).delegate(a, (c.split ? c : c.join("." + L + " ")) + "." + L, function () {
var a = t.api[d.attr(this, N)];
a && !a.disabled && e.apply(a, arguments)
})
}
function r(a, c, f) {
var g,
i,
j,
k,
l,
m = d(b.body),
n = a[0] === b ? m : a,
o = a.metadata ? a.metadata(f.metadata) : A,
p = "html5" === f.metadata.type && o ? o[f.metadata.name] : A,
q = a.data(f.metadata.name || "qtipopts");
try {
q = "string" == typeof q ? d.parseJSON(q) : q
} catch (r) {}
if (k = d.extend(y, {}, t.defaults, f, "object" == typeof q ? h(q) : A, h(p || o)), i = k.position, k.id = c, "boolean" == typeof k.content.text) {
if (j = a.attr(k.content.attr), k.content.attr === z || !j)
return z;
k.content.text = j
}
if (i.container.length || (i.container = m), i.target === z && (i.target = n), k.show.target === z && (k.show.target = n), k.show.solo === y && (k.show.solo = i.container.closest("body")), k.hide.target === z && (k.hide.target = n), k.position.viewport === y && (k.position.viewport = i.container), i.container = i.container.eq(0), i.at = new v(i.at, y), i.my = new v(i.my), a.data(L))
if (k.overwrite)
a.qtip("destroy", !0);
else if (k.overwrite === z)
return z;
return a.attr(M, c),
k.suppress && (l = a.attr("title")) && a.removeAttr("title").attr(X, l).attr("title", ""),
g = new e(a, k, c, !!j),
a.data(L, g),
g
}
function s(a) {
this._ns = "ie6",
this.qtip = a,
this.init(a)
}
var t,
u,
v,
w,
x,
y = !0,
z = !1,
A = null,
B = "x",
C = "y",
D = "width",
E = "height",
F = "top",
G = "left",
H = "bottom",
I = "right",
J = "center",
K = {},
L = "qtip",
M = "data-hasqtip",
N = "data-qtip-id",
O = ["ui-widget", "ui-tooltip"],
P = "." + L,
Q = "click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),
R = L + "-fixed",
S = L + "-default",
T = L + "-focus",
U = L + "-hover",
V = L + "-disabled",
W = "_replacedByqTip",
X = "oldtitle",
Y = {
ie: function () {
var a,
c;
for (a = 4, c = b.createElement("div"); (c.innerHTML = "<!--[if gt IE " + a + "]><i></i><![endif]-->") && c.getElementsByTagName("i")[0]; a += 1);
return a > 4 ? a : NaN
}
(),
iOS: parseFloat(("" + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".").replace("_", "")) || z
};
u = e.prototype,
u._when = function (a) {
return d.when.apply(d, a)
},
u.render = function (a) {
if (this.rendered || this.destroyed)
return this;
var b = this,
c = this.options,
e = this.cache,
f = this.elements,
g = c.content.text,
h = c.content.title,
i = c.content.button,
j = c.position,
k = [];
return d.attr(this.target[0], "aria-describedby", this._id),
e.posClass = this._createPosClass((this.position = {
my: j.my,
at: j.at
}).my),
this.tooltip = f.tooltip = d("<div/>", {
id: this._id,
"class": [L, S, c.style.classes, e.posClass].join(" "),
width: c.style.width || "",
height: c.style.height || "",
tracking: "mouse" === j.target && j.adjust.mouse,
role: "alert",
"aria-live": "polite",
"aria-atomic": z,
"aria-describedby": this._id + "-content",
"aria-hidden": y
}).toggleClass(V, this.disabled).attr(N, this.id).data(L, this).appendTo(j.container).append(f.content = d("<div />", {
"class": L + "-content",
id: this._id + "-content",
"aria-atomic": y
})),
this.rendered = -1,
this.positioning = y,
h && (this._createTitle(), d.isFunction(h) || k.push(this._updateTitle(h, z))),
i && this._createButton(),
d.isFunction(g) || k.push(this._updateContent(g, z)),
this.rendered = y,
this._setWidget(),
d.each(K, function (a) {
var c;
"render" === this.initialize && (c = this(b)) && (b.plugins[a] = c)
}),
this._unassignEvents(),
this._assignEvents(),
this._when(k).then(function () {
b._trigger("render"),
b.positioning = z,
b.hiddenDuringWait || !c.show.ready && !a || b.toggle(y, e.event, z),
b.hiddenDuringWait = z
}),
t.api[this.id] = this,
this
},
u.destroy = function (a) {
function b() {
if (!this.destroyed) {
this.destroyed = y;
var a,
b = this.target,
c = b.attr(X);
this.rendered && this.tooltip.stop(1, 0).find("*").remove().end().remove(),
d.each(this.plugins, function () {
this.destroy && this.destroy()
});
for (a in this.timers)
this.timers.hasOwnProperty(a) && clearTimeout(this.timers[a]);
b.removeData(L).removeAttr(N).removeAttr(M).removeAttr("aria-describedby"),
this.options.suppress && c && b.attr("title", c).removeAttr(X),
this._unassignEvents(),
this.options = this.elements = this.cache = this.timers = this.plugins = this.mouse = A,
delete t.api[this.id]
}
}
return this.destroyed ? this.target : (a === y && "hide" !== this.triggering || !this.rendered ? b.call(this) : (this.tooltip.one("tooltiphidden", d.proxy(b, this)), !this.triggering && this.hide()), this.target)
},
w = u.checks = {
builtin: {
"^id$": function (a, b, c, e) {
var f = c === y ? t.nextid : c,
g = L + "-" + f;
f !== z && f.length > 0 && !d("#" + g).length ? (this._id = g, this.rendered && (this.tooltip[0].id = this._id, this.elements.content[0].id = this._id + "-content", this.elements.title[0].id = this._id + "-title")) : a[b] = e
},
"^prerender": function (a, b, c) {
c && !this.rendered && this.render(this.options.show.ready)
},
"^content.text$": function (a, b, c) {
this._updateContent(c)
},
"^content.attr$": function (a, b, c, d) {
this.options.content.text === this.target.attr(d) && this._updateContent(this.target.attr(c))
},
"^content.title$": function (a, b, c) {
return c ? (c && !this.elements.title && this._createTitle(), void this._updateTitle(c)) : this._removeTitle()
},
"^content.button$": function (a, b, c) {
this._updateButton(c)
},
"^content.title.(text|button)$": function (a, b, c) {
this.set("content." + b, c)
},
"^position.(my|at)$": function (a, b, c) {
"string" == typeof c && (this.position[b] = a[b] = new v(c, "at" === b))
},
"^position.container$": function (a, b, c) {
this.rendered && this.tooltip.appendTo(c)
},
"^show.ready$": function (a, b, c) {
c && (!this.rendered && this.render(y) || this.toggle(y))
},
"^style.classes$": function (a, b, c, d) {
this.rendered && this.tooltip.removeClass(d).addClass(c)
},
"^style.(width|height)": function (a, b, c) {
this.rendered && this.tooltip.css(b, c)
},
"^style.widget|content.title": function () {
this.rendered && this._setWidget()
},
"^style.def": function (a, b, c) {
this.rendered && this.tooltip.toggleClass(S, !!c)
},
"^events.(render|show|move|hide|focus|blur)$": function (a, b, c) {
this.rendered && this.tooltip[(d.isFunction(c) ? "" : "un") + "bind"]("tooltip" + b, c)
},
"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)": function () {
if (this.rendered) {
var a = this.options.position;
this.tooltip.attr("tracking", "mouse" === a.target && a.adjust.mouse),
this._unassignEvents(),
this._assignEvents()
}
}
}
},
u.get = function (a) {
if (this.destroyed)
return this;
var b = i(this.options, a.toLowerCase()),
c = b[0][b[1]];
return c.precedance ? c.string() : c
};
var Z = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,
$ = /^prerender|show\.ready/i;
u.set = function (a, b) {
if (this.destroyed)
return this;
var c,
e = this.rendered,
f = z,
g = this.options;
return "string" == typeof a ? (c = a, a = {}, a[c] = b) : a = d.extend({}, a),
d.each(a, function (b, c) {
if (e && $.test(b))
return void delete a[b];
var h,
j = i(g, b.toLowerCase());
h = j[0][j[1]],
j[0][j[1]] = c && c.nodeType ? d(c) : c,
f = Z.test(b) || f,
a[b] = [j[0], j[1], c, h]
}),
h(g),
this.positioning = y,
d.each(a, d.proxy(j, this)),
this.positioning = z,
this.rendered && this.tooltip[0].offsetWidth > 0 && f && this.reposition("mouse" === g.position.target ? A : this.cache.event),
this
},
u._update = function (a, b) {
var c = this,
e = this.cache;
return this.rendered && a ? (d.isFunction(a) && (a = a.call(this.elements.target, e.event, this) || ""), d.isFunction(a.then) ? (e.waiting = y, a.then(function (a) {
return e.waiting = z,
c._update(a, b)
}, A, function (a) {
return c._update(a, b)
})) : a === z || !a && "" !== a ? z : (a.jquery && a.length > 0 ? b.empty().append(a.css({
display: "block",
visibility: "visible"
})) : b.html(a), this._waitForContent(b).then(function (a) {
c.rendered && c.tooltip[0].offsetWidth > 0 && c.reposition(e.event, !a.length)
}))) : z
},
u._waitForContent = function (a) {
var b = this.cache;
return b.waiting = y,
(d.fn.imagesLoaded ? a.imagesLoaded() : (new d.Deferred).resolve([])).done(function () {
b.waiting = z
}).promise()
},
u._updateContent = function (a, b) {
this._update(a, this.elements.content, b)
},
u._updateTitle = function (a, b) {
this._update(a, this.elements.title, b) === z && this._removeTitle(z)
},
u._createTitle = function () {
var a = this.elements,
b = this._id + "-title";
a.titlebar && this._removeTitle(),
a.titlebar = d("<div />", {
"class": L + "-titlebar " + (this.options.style.widget ? k("header") : "")
}).append(a.title = d("<div />", {
id: b,
"class": L + "-title",
"aria-atomic": y
})).insertBefore(a.content).delegate(".qtip-close", "mousedown keydown mouseup keyup mouseout", function (a) {
d(this).toggleClass("ui-state-active ui-state-focus", "down" === a.type.substr(-4))
}).delegate(".qtip-close", "mouseover mouseout", function (a) {
d(this).toggleClass("ui-state-hover", "mouseover" === a.type)
}),
this.options.content.button && this._createButton()
},
u._removeTitle = function (a) {
var b = this.elements;
b.title && (b.titlebar.remove(), b.titlebar = b.title = b.button = A, a !== z && this.reposition())
},
u._createPosClass = function (a) {
return L + "-pos-" + (a || this.options.position.my).abbrev()
},
u.reposition = function (c, e) {
if (!this.rendered || this.positioning || this.destroyed)
return this;
this.positioning = y;
var f,
g,
h,
i,
j = this.cache,
k = this.tooltip,
l = this.options.position,
m = l.target,
n = l.my,
o = l.at,
p = l.viewport,
q = l.container,
r = l.adjust,
s = r.method.split(" "),
t = k.outerWidth(z),
u = k.outerHeight(z),
v = 0,
w = 0,
x = k.css("position"),
A = {
left: 0,
top: 0
},
B = k[0].offsetWidth > 0,
C = c && "scroll" === c.type,
D = d(a),
E = q[0].ownerDocument,
L = this.mouse;
if (d.isArray(m) && 2 === m.length)
o = {
x: G,
y: F
},
A = {
left: m[0],
top: m[1]
};
else if ("mouse" === m)
o = {
x: G,
y: F
},
(!r.mouse || this.options.hide.distance) && j.origin && j.origin.pageX ? c = j.origin : !c || c && ("resize" === c.type || "scroll" === c.type) ? c = j.event : L && L.pageX && (c = L),
"static" !== x && (A = q.offset()),
E.body.offsetWidth !== (a.innerWidth || E.documentElement.clientWidth) && (g = d(b.body).offset()),
A = {
left: c.pageX - A.left + (g && g.left || 0),
top: c.pageY - A.top + (g && g.top || 0)
},
r.mouse && C && L && (A.left -= (L.scrollX || 0) - D.scrollLeft(), A.top -= (L.scrollY || 0) - D.scrollTop());
else {
if ("event" === m ? c && c.target && "scroll" !== c.type && "resize" !== c.type ? j.target = d(c.target) : c.target || (j.target = this.elements.target) : "event" !== m && (j.target = d(m.jquery ? m : this.elements.target)), m = j.target, m = d(m).eq(0), 0 === m.length)
return this;
m[0] === b || m[0] === a ? (v = Y.iOS ? a.innerWidth : m.width(), w = Y.iOS ? a.innerHeight : m.height(), m[0] === a && (A = {
top: (p || m).scrollTop(),
left: (p || m).scrollLeft()
})) : K.imagemap && m.is("area") ? f = K.imagemap(this, m, o, K.viewport ? s : z) : K.svg && m && m[0].ownerSVGElement ? f = K.svg(this, m, o, K.viewport ? s : z) : (v = m.outerWidth(z), w = m.outerHeight(z), A = m.offset()),
f && (v = f.width, w = f.height, g = f.offset, A = f.position),
A = this.reposition.offset(m, A, q),
(Y.iOS > 3.1 && Y.iOS < 4.1 || Y.iOS >= 4.3 && Y.iOS < 4.33 || !Y.iOS && "fixed" === x) && (A.left -= D.scrollLeft(), A.top -= D.scrollTop()),
(!f || f && f.adjustable !== z) && (A.left += o.x === I ? v : o.x === J ? v / 2 : 0, A.top += o.y === H ? w : o.y === J ? w / 2 : 0)
}
return A.left += r.x + (n.x === I ? -t : n.x === J ? -t / 2 : 0),
A.top += r.y + (n.y === H ? -u : n.y === J ? -u / 2 : 0),
K.viewport ? (h = A.adjusted = K.viewport(this, A, l, v, w, t, u), g && h.left && (A.left += g.left), g && h.top && (A.top += g.top), h.my && (this.position.my = h.my)) : A.adjusted = {
left: 0,
top: 0
},
j.posClass !== (i = this._createPosClass(this.position.my)) && (j.posClass = i, k.removeClass(j.posClass).addClass(i)),
this._trigger("move", [A, p.elem || p], c) ? (delete A.adjusted, e === z || !B || isNaN(A.left) || isNaN(A.top) || "mouse" === m || !d.isFunction(l.effect) ? k.css(A) : d.isFunction(l.effect) && (l.effect.call(k, this, d.extend({}, A)), k.queue(function (a) {
d(this).css({
opacity: "",
height: ""
}),
Y.ie && this.style.removeAttribute("filter"),
a()
})), this.positioning = z, this) : this
},
u.reposition.offset = function (a, c, e) {
function f(a, b) {
c.left += b * a.scrollLeft(),
c.top += b * a.scrollTop()
}
if (!e[0])
return c;
var g,
h,
i,
j,
k = d(a[0].ownerDocument),
l = !!Y.ie && "CSS1Compat" !== b.compatMode,
m = e[0];
do
"static" !== (h = d.css(m, "position")) && ("fixed" === h ? (i = m.getBoundingClientRect(), f(k, -1)) : (i = d(m).position(), i.left += parseFloat(d.css(m, "borderLeftWidth")) || 0, i.top += parseFloat(d.css(m, "borderTopWidth")) || 0), c.left -= i.left + (parseFloat(d.css(m, "marginLeft")) || 0), c.top -= i.top + (parseFloat(d.css(m, "marginTop")) || 0), g || "hidden" === (j = d.css(m, "overflow")) || "visible" === j || (g = d(m)));
while (m = m.offsetParent);
return g && (g[0] !== k[0] || l) && f(g, 1),
c
};
var _ = (v = u.reposition.Corner = function (a, b) {
a = ("" + a).replace(/([A-Z])/, " $1").replace(/middle/gi, J).toLowerCase(),
this.x = (a.match(/left|right/i) || a.match(/center/) || ["inherit"])[0].toLowerCase(),
this.y = (a.match(/top|bottom|center/i) || ["inherit"])[0].toLowerCase(),
this.forceY = !!b;
var c = a.charAt(0);
this.precedance = "t" === c || "b" === c ? C : B
}).prototype;
_.invert = function (a, b) {
this[a] = this[a] === G ? I : this[a] === I ? G : b || this[a]
},
_.string = function (a) {
var b = this.x,
c = this.y,
d = b !== c ? "center" === b || "center" !== c && (this.precedance === C || this.forceY) ? [c, b] : [b, c] : [b];
return a !== !1 ? d.join(" ") : d
},
_.abbrev = function () {
var a = this.string(!1);
return a[0].charAt(0) + (a[1] && a[1].charAt(0) || "")
},
_.clone = function () {
return new v(this.string(), this.forceY)
},
u.toggle = function (a, c) {
var e = this.cache,
f = this.options,
g = this.tooltip;
if (c) {
if (/over|enter/.test(c.type) && e.event && /out|leave/.test(e.event.type) && f.show.target.add(c.target).length === f.show.target.length && g.has(c.relatedTarget).length)
return this;
e.event = d.event.fix(c)
}
if (this.waiting && !a && (this.hiddenDuringWait = y), !this.rendered)
return a ? this.render(1) : this;
if (this.destroyed || this.disabled)
return this;
var h,
i,
j,
k = a ? "show" : "hide",
l = this.options[k],
m = this.options.position,
n = this.options.content,
o = this.tooltip.css("width"),
p = this.tooltip.is(":visible"),
q = a || 1 === l.target.length,
r = !c || l.target.length < 2 || e.target[0] === c.target;
return (typeof a).search("boolean|number") && (a = !p),
h = !g.is(":animated") && p === a && r,
i = h ? A : !!this._trigger(k, [90]),
this.destroyed ? this : (i !== z && a && this.focus(c), !i || h ? this : (d.attr(g[0], "aria-hidden", !a), a ? (this.mouse && (e.origin = d.event.fix(this.mouse)), d.isFunction(n.text) && this._updateContent(n.text, z), d.isFunction(n.title) && this._updateTitle(n.title, z), !x && "mouse" === m.target && m.adjust.mouse && (d(b).bind("mousemove." + L, this._storeMouse), x = y), o || g.css("width", g.outerWidth(z)), this.reposition(c, arguments[2]), o || g.css("width", ""), l.solo && ("string" == typeof l.solo ? d(l.solo) : d(P, l.solo)).not(g).not(l.target).qtip("hide", new d.Event("tooltipsolo"))) : (clearTimeout(this.timers.show), delete e.origin, x && !d(P + '[tracking="true"]:visible', l.solo).not(g).length && (d(b).unbind("mousemove." + L), x = z), this.blur(c)), j = d.proxy(function () {
a ? (Y.ie && g[0].style.removeAttribute("filter"), g.css("overflow", ""), "string" == typeof l.autofocus && d(this.options.show.autofocus, g).focus(), this.options.show.target.trigger("qtip-" + this.id + "-inactive")) : g.css({
display: "",
visibility: "",
opacity: "",
left: "",
top: ""
}),
this._trigger(a ? "visible" : "hidden")
}, this), l.effect === z || q === z ? (g[k](), j()) : d.isFunction(l.effect) ? (g.stop(1, 1), l.effect.call(g, this), g.queue("fx", function (a) {
j(),
a()
})) : g.fadeTo(90, a ? 1 : 0, j), a && l.target.trigger("qtip-" + this.id + "-inactive"), this))
},
u.show = function (a) {
return this.toggle(y, a)
},
u.hide = function (a) {
return this.toggle(z, a)
},
u.focus = function (a) {
if (!this.rendered || this.destroyed)
return this;
var b = d(P),
c = this.tooltip,
e = parseInt(c[0].style.zIndex, 10),
f = t.zindex + b.length;
return c.hasClass(T) || this._trigger("focus", [f], a) && (e !== f && (b.each(function () {
this.style.zIndex > e && (this.style.zIndex = this.style.zIndex - 1)
}), b.filter("." + T).qtip("blur", a)), c.addClass(T)[0].style.zIndex = f),
this
},
u.blur = function (a) {
return !this.rendered || this.destroyed ? this : (this.tooltip.removeClass(T), this._trigger("blur", [this.tooltip.css("zIndex")], a), this)
},
u.disable = function (a) {
return this.destroyed ? this : ("toggle" === a ? a = !(this.rendered ? this.tooltip.hasClass(V) : this.disabled) : "boolean" != typeof a && (a = y), this.rendered && this.tooltip.toggleClass(V, a).attr("aria-disabled", a), this.disabled = !!a, this)
},
u.enable = function () {
return this.disable(z)
},
u._createButton = function () {
var a = this,
b = this.elements,
c = b.tooltip,
e = this.options.content.button,
f = "string" == typeof e,
g = f ? e : "Close tooltip";
b.button && b.button.remove(),
e.jquery ? b.button = e : b.button = d("<a />", {
"class": "qtip-close " + (this.options.style.widget ? "" : L + "-icon"),
title: g,
"aria-label": g
}).prepend(d("<span />", {
"class": "ui-icon ui-icon-close",
html: "&times;"
})),
b.button.appendTo(b.titlebar || c).attr("role", "button").click(function (b) {
return c.hasClass(V) || a.hide(b),
z
})
},
u._updateButton = function (a) {
if (!this.rendered)
return z;
var b = this.elements.button;
a ? this._createButton() : b.remove()
},
u._setWidget = function () {
var a = this.options.style.widget,
b = this.elements,
c = b.tooltip,
d = c.hasClass(V);
c.removeClass(V),
V = a ? "ui-state-disabled" : "qtip-disabled",
c.toggleClass(V, d),
c.toggleClass("ui-helper-reset " + k(), a).toggleClass(S, this.options.style.def && !a),
b.content && b.content.toggleClass(k("content"), a),
b.titlebar && b.titlebar.toggleClass(k("header"), a),
b.button && b.button.toggleClass(L + "-icon", !a)
},
u._storeMouse = function (a) {
return (this.mouse = d.event.fix(a)).type = "mousemove",
this
},
u._bind = function (a, b, c, e, f) {
if (a && c && b.length) {
var g = "." + this._id + (e ? "-" + e : "");
return d(a).bind((b.split ? b : b.join(g + " ")) + g, d.proxy(c, f || this)),
this
}
},
u._unbind = function (a, b) {
return a && d(a).unbind("." + this._id + (b ? "-" + b : "")),
this
},
u._trigger = function (a, b, c) {
var e = new d.Event("tooltip" + a);
return e.originalEvent = c && d.extend({}, c) || this.cache.event || A,
this.triggering = a,
this.tooltip.trigger(e, [this].concat(b || [])),
this.triggering = z,
!e.isDefaultPrevented()
},
u._bindEvents = function (a, b, c, e, f, g) {
var h = c.filter(e).add(e.filter(c)),
i = [];
h.length && (d.each(b, function (b, c) {
var e = d.inArray(c, a);
e > -1 && i.push(a.splice(e, 1)[0])
}), i.length && (this._bind(h, i, function (a) {
var b = this.rendered ? this.tooltip[0].offsetWidth > 0 : !1;
(b ? g : f).call(this, a)
}), c = c.not(h), e = e.not(h))),
this._bind(c, a, f),
this._bind(e, b, g)
},
u._assignInitialEvents = function (a) {
function b(a) {
return this.disabled || this.destroyed ? z : (this.cache.event = a && d.event.fix(a), this.cache.target = a && d(a.target), clearTimeout(this.timers.show), void(this.timers.show = l.call(this, function () {
this.render("object" == typeof a || c.show.ready)
}, c.prerender ? 0 : c.show.delay)))
}
var c = this.options,
e = c.show.target,
f = c.hide.target,
g = c.show.event ? d.trim("" + c.show.event).split(" ") : [],
h = c.hide.event ? d.trim("" + c.hide.event).split(" ") : [];
this._bind(this.elements.target, ["remove", "removeqtip"], function () {
this.destroy(!0)
}, "destroy"),
/mouse(over|enter)/i.test(c.show.event) && !/mouse(out|leave)/i.test(c.hide.event) && h.push("mouseleave"),
this._bind(e, "mousemove", function (a) {
this._storeMouse(a),
this.cache.onTarget = y
}),
this._bindEvents(g, h, e, f, b, function () {
return this.timers ? void clearTimeout(this.timers.show) : z
}),
(c.show.ready || c.prerender) && b.call(this, a)
},
u._assignEvents = function () {
var c = this,
e = this.options,
f = e.position,
g = this.tooltip,
h = e.show.target,
i = e.hide.target,
j = f.container,
k = f.viewport,
l = d(b),
q = d(a),
r = e.show.event ? d.trim("" + e.show.event).split(" ") : [],
s = e.hide.event ? d.trim("" + e.hide.event).split(" ") : [];
d.each(e.events, function (a, b) {
c._bind(g, "toggle" === a ? ["tooltipshow", "tooltiphide"] : ["tooltip" + a], b, null, g)
}),
/mouse(out|leave)/i.test(e.hide.event) && "window" === e.hide.leave && this._bind(l, ["mouseout", "blur"], function (a) {
/select|option/.test(a.target.nodeName) || a.relatedTarget || this.hide(a)
}),
e.hide.fixed ? i = i.add(g.addClass(R)) : /mouse(over|enter)/i.test(e.show.event) && this._bind(i, "mouseleave", function () {
clearTimeout(this.timers.show)
}),
("" + e.hide.event).indexOf("unfocus") > -1 && this._bind(j.closest("html"), ["mousedown", "touchstart"], function (a) {
var b = d(a.target),
c = this.rendered && !this.tooltip.hasClass(V) && this.tooltip[0].offsetWidth > 0,
e = b.parents(P).filter(this.tooltip[0]).length > 0;
b[0] === this.target[0] || b[0] === this.tooltip[0] || e || this.target.has(b[0]).length || !c || this.hide(a)
}),
"number" == typeof e.hide.inactive && (this._bind(h, "qtip-" + this.id + "-inactive", o, "inactive"), this._bind(i.add(g), t.inactiveEvents, o)),
this._bindEvents(r, s, h, i, m, n),
this._bind(h.add(g), "mousemove", function (a) {
if ("number" == typeof e.hide.distance) {
var b = this.cache.origin || {},
c = this.options.hide.distance,
d = Math.abs;
(d(a.pageX - b.pageX) >= c || d(a.pageY - b.pageY) >= c) && this.hide(a)
}
this._storeMouse(a)
}),
"mouse" === f.target && f.adjust.mouse && (e.hide.event && this._bind(h, ["mouseenter", "mouseleave"], function (a) {
return this.cache ? void(this.cache.onTarget = "mouseenter" === a.type) : z
}), this._bind(l, "mousemove", function (a) {
this.rendered && this.cache.onTarget && !this.tooltip.hasClass(V) && this.tooltip[0].offsetWidth > 0 && this.reposition(a)
})),
(f.adjust.resize || k.length) && this._bind(d.event.special.resize ? k : q, "resize", p),
f.adjust.scroll && this._bind(q.add(f.container), "scroll", p)
},
u._unassignEvents = function () {
var c = this.options,
e = c.show.target,
f = c.hide.target,
g = d.grep([this.elements.target[0], this.rendered && this.tooltip[0], c.position.container[0], c.position.viewport[0], c.position.container.closest("html")[0], a, b], function (a) {
return "object" == typeof a
});
e && e.toArray && (g = g.concat(e.toArray())),
f && f.toArray && (g = g.concat(f.toArray())),
this._unbind(g)._unbind(g, "destroy")._unbind(g, "inactive")
},
d(function () {
q(P, ["mouseenter", "mouseleave"], function (a) {
var b = "mouseenter" === a.type,
c = d(a.currentTarget),
e = d(a.relatedTarget || a.target),
f = this.options;
b ? (this.focus(a), c.hasClass(R) && !c.hasClass(V) && clearTimeout(this.timers.hide)) : "mouse" === f.position.target && f.position.adjust.mouse && f.hide.event && f.show.target && !e.closest(f.show.target[0]).length && this.hide(a),
c.toggleClass(U, b)
}),
q("[" + N + "]", Q, o)
}),
t = d.fn.qtip = function (a, b, e) {
var f = ("" + a).toLowerCase(),
g = A,
i = d.makeArray(arguments).slice(1),
j = i[i.length - 1],
k = this[0] ? d.data(this[0], L) : A;
return !arguments.length && k || "api" === f ? k : "string" == typeof a ? (this.each(function () {
var a = d.data(this, L);
if (!a)
return y;
if (j && j.timeStamp && (a.cache.event = j), !b || "option" !== f && "options" !== f)
a[f] && a[f].apply(a, i);
else {
if (e === c && !d.isPlainObject(b))
return g = a.get(b), z;
a.set(b, e)
}
}), g !== A ? g : this) : "object" != typeof a && arguments.length ? void 0 : (k = h(d.extend(y, {}, a)), this.each(function (a) {
var b,
c;
return c = d.isArray(k.id) ? k.id[a] : k.id,
c = !c || c === z || c.length < 1 || t.api[c] ? t.nextid++ : c,
b = r(d(this), c, k),
b === z ? y : (t.api[c] = b, d.each(K, function () {
"initialize" === this.initialize && this(b)
}), void b._assignInitialEvents(j))
}))
},
d.qtip = e,
t.api = {},
d.each({
attr: function (a, b) {
if (this.length) {
var c = this[0],
e = "title",
f = d.data(c, "qtip");
if (a === e && f && f.options && "object" == typeof f && "object" == typeof f.options && f.options.suppress)
return arguments.length < 2 ? d.attr(c, X) : (f && f.options.content.attr === e && f.cache.attr && f.set("content.text", b), this.attr(X, b))
}
return d.fn["attr" + W].apply(this, arguments)
},
clone: function (a) {
var b = d.fn["clone" + W].apply(this, arguments);
return a || b.filter("[" + X + "]").attr("title", function () {
return d.attr(this, X)
}).removeAttr(X),
b
}
}, function (a, b) {
if (!b || d.fn[a + W])
return y;
var c = d.fn[a + W] = d.fn[a];
d.fn[a] = function () {
return b.apply(this, arguments) || c.apply(this, arguments)
}
}),
d.ui || (d["cleanData" + W] = d.cleanData, d.cleanData = function (a) {
for (var b, c = 0; (b = d(a[c])).length; c++)
if (b.attr(M))
try {
b.triggerHandler("removeqtip")
} catch (e) {}
d["cleanData" + W].apply(this, arguments)
}),
t.version = "3.0.3",
t.nextid = 0,
t.inactiveEvents = Q,
t.zindex = 15e3,
t.defaults = {
prerender: z,
id: z,
overwrite: y,
suppress: y,
content: {
text: y,
attr: "title",
title: z,
button: z
},
position: {
my: "top left",
at: "bottom right",
target: z,
container: z,
viewport: z,
adjust: {
x: 0,
y: 0,
mouse: y,
scroll: y,
resize: y,
method: "flipinvert flipinvert"
},
effect: function (a, b) {
d(this).animate(b, {
duration: 200,
queue: z
})
}
},
show: {
target: z,
event: "mouseenter",
effect: y,
delay: 90,
solo: z,
ready: z,
autofocus: z
},
hide: {
target: z,
event: "mouseleave",
effect: y,
delay: 0,
fixed: z,
inactive: z,
leave: "window",
distance: z
},
style: {
classes: "",
widget: z,
width: z,
height: z,
def: y
},
events: {
render: A,
move: A,
show: A,
hide: A,
toggle: A,
visible: A,
hidden: A,
focus: A,
blur: A
}
};
var aa,
ba = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';
d.extend(s.prototype, {
_scroll: function () {
var b = this.qtip.elements.overlay;
b && (b[0].style.top = d(a).scrollTop() + "px")
},
init: function (c) {
var e = c.tooltip;
d("select, object").length < 1 && (this.bgiframe = c.elements.bgiframe = d(ba).appendTo(e), c._bind(e, "tooltipmove", this.adjustBGIFrame, this._ns, this)),
this.redrawContainer = d("<div/>", {
id: L + "-rcontainer"
}).appendTo(b.body),
c.elements.overlay && c.elements.overlay.addClass("qtipmodal-ie6fix") && (c._bind(a, ["scroll", "resize"], this._scroll, this._ns, this), c._bind(e, ["tooltipshow"], this._scroll, this._ns, this)),
this.redraw()
},
adjustBGIFrame: function () {
var a,
b,
c = this.qtip.tooltip,
d = {
height: c.outerHeight(z),
width: c.outerWidth(z)
},
e = this.qtip.plugins.tip,
f = this.qtip.elements.tip;
b = parseInt(c.css("borderLeftWidth"), 10) || 0,
b = {
left: -b,
top: -b
},
e && f && (a = "x" === e.corner.precedance ? [D, G] : [E, F], b[a[1]] -= f[a[0]]()),
this.bgiframe.css(b).css(d)
},
redraw: function () {
if (this.qtip.rendered < 1 || this.drawing)
return this;
var a,
b,
c,
d,
e = this.qtip.tooltip,
f = this.qtip.options.style,
g = this.qtip.options.position.container;
return this.qtip.drawing = 1,
f.height && e.css(E, f.height),
f.width ? e.css(D, f.width) : (e.css(D, "").appendTo(this.redrawContainer), b = e.width(), 1 > b % 2 && (b += 1), c = e.css("maxWidth") || "", d = e.css("minWidth") || "", a = (c + d).indexOf("%") > -1 ? g.width() / 100 : 0, c = (c.indexOf("%") > -1 ? a : 1 * parseInt(c, 10)) || b, d = (d.indexOf("%") > -1 ? a : 1 * parseInt(d, 10)) || 0, b = c + d ? Math.min(Math.max(b, d), c) : b, e.css(D, Math.round(b)).appendTo(g)),
this.drawing = 0,
this
},
destroy: function () {
this.bgiframe && this.bgiframe.remove(),
this.qtip._unbind([a, this.qtip.tooltip], this._ns)
}
}),
aa = K.ie6 = function (a) {
return 6 === Y.ie ? new s(a) : z
},
aa.initialize = "render",
w.ie6 = {
"^content|style$": function () {
this.redraw()
}
}
})
}
(window, document);
jQuery('acronym.c2c-text-hover[title!=""]').qtip({
style: {
classes: 'text-hover-qtip'
}
});
!function (t, e, i, n) {
var a = e.document,
o = t(a),
r = t(e),
s = Array.prototype,
l = 1.33,
c = true,
h = 3e4,
u = false,
f = navigator.userAgent.toLowerCase(),
d = e.location.hash.replace(/#\//, ""),
p = e.location.protocol,
g = Math,
m = function () {},
v = function () {
return false
},
y = function () {
var t = 3,
e = a.createElement("div"),
i = e.getElementsByTagName("i");
do {
e.innerHTML = "<!--[if gt IE " + ++t + "]><i></i><![endif]-->"
} while (i[0]);
return t > 4 ? t : a.documentMode || n
}
(),
_ = function () {
return {
html: a.documentElement,
body: a.body,
head: a.getElementsByTagName("head")[0],
title: a.title
}
},
b = e.parent !== e.self,
w = "data ready thumbnail loadstart loadfinish image play pause progress " + "fullscreen_enter fullscreen_exit idle_enter idle_exit rescale " + "lightbox_open lightbox_close lightbox_image",
x = function () {
var e = [];
t.each(w.split(" "), function (t, i) {
e.push(i);
if (/_/.test(i)) {
e.push(i.replace(/_/g, ""))
}
});
return e
}
(),
T = function (e) {
var i;
if (typeof e !== "object") {
return e
}
t.each(e, function (n, a) {
if (/^[a-z]+_/.test(n)) {
i = "";
t.each(n.split("_"), function (t, e) {
i += t > 0 ? e.substr(0, 1).toUpperCase() + e.substr(1) : e
});
e[i] = a;
delete e[n]
}
});
return e
},
k = function (e) {
if (t.inArray(e, x) > -1) {
return i[e.toUpperCase()]
}
return e
},
C = {
youtube: {
reg: /https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i,
embed: function () {
return "http://www.youtube.com/embed/" + this.id
},
getUrl: function () {
return p + "//gdata.youtube.com/feeds/api/videos/" + this.id + "?v=2&alt=json-in-script&callback=?"
},
get_thumb: function (t) {
return t.entry.media$group.media$thumbnail[2].url
},
get_image: function (t) {
if (t.entry.yt$hd) {
return p + "//img.youtube.com/vi/" + this.id + "/maxresdefault.jpg"
}
return t.entry.media$group.media$thumbnail[3].url
}
},
vimeo: {
reg: /https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,
embed: function () {
return "http://player.vimeo.com/video/" + this.id
},
getUrl: function () {
return p + "//vimeo.com/api/v2/video/" + this.id + ".json?callback=?"
},
get_thumb: function (t) {
return t[0].thumbnail_medium
},
get_image: function (t) {
return t[0].thumbnail_large
}
},
dailymotion: {
reg: /https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,
embed: function () {
return p + "//www.dailymotion.com/embed/video/" + this.id
},
getUrl: function () {
return "https://api.dailymotion.com/video/" + this.id + "?fields=thumbnail_240_url,thumbnail_720_url&callback=?"
},
get_thumb: function (t) {
return t.thumbnail_240_url
},
get_image: function (t) {
return t.thumbnail_720_url
}
},
_inst: []
},
I = function (e, i) {
for (var n = 0; n < C._inst.length; n++) {
if (C._inst[n].id === i && C._inst[n].type == e) {
return C._inst[n]
}
}
this.type = e;
this.id = i;
this.readys = [];
C._inst.push(this);
var a = this;
t.extend(this, C[e]);
t.getJSON(this.getUrl(), function (e) {
a.data = e;
t.each(a.readys, function (t, e) {
e(a.data)
});
a.readys = []
});
this.getMedia = function (t, e, i) {
i = i || m;
var n = this;
var a = function (i) {
e(n["get_" + t](i))
};
try {
if (n.data) {
a(n.data)
} else {
n.readys.push(a)
}
} catch (o) {
i()
}
}
},
S = function (t) {
var e;
for (var i in C) {
e = t && C[i].reg && t.match(C[i].reg);
if (e && e.length) {
return {
id: e[2],
provider: i
}
}
}
return false
},
A = {
support: function () {
var t = _().html;
return !b && (t.requestFullscreen || t.mozRequestFullScreen || t.webkitRequestFullScreen)
}
(),
callback: m,
enter: function (t, e, i) {
this.instance = t;
this.callback = e || m;
i = i || _().html;
if (i.requestFullscreen) {
i.requestFullscreen()
} else if (i.mozRequestFullScreen) {
i.mozRequestFullScreen()
} else if (i.webkitRequestFullScreen) {
i.webkitRequestFullScreen()
}
},
exit: function (t) {
this.callback = t || m;
if (a.exitFullscreen) {
a.exitFullscreen()
} else if (a.mozCancelFullScreen) {
a.mozCancelFullScreen()
} else if (a.webkitCancelFullScreen) {
a.webkitCancelFullScreen()
}
},
instance: null,
listen: function () {
if (!this.support) {
return
}
var t = function () {
if (!A.instance) {
return
}
var t = A.instance._fullscreen;
if (a.fullscreen || a.mozFullScreen || a.webkitIsFullScreen) {
t._enter(A.callback)
} else {
t._exit(A.callback)
}
};
a.addEventListener("fullscreenchange", t, false);
a.addEventListener("mozfullscreenchange", t, false);
a.addEventListener("webkitfullscreenchange", t, false)
}
},
E = [],
$ = [],
D = false,
L = false,
P = [],
z = function (e) {
i.theme = e;
t.each(P, function (t, e) {
if (!e._initialized) {
e._init.call(e)
}
});
P = []
},
H = function () {
return {
clearTimer: function (e) {
t.each(i.get(), function () {
this.clearTimer(e)
})
},
addTimer: function (e) {
t.each(i.get(), function () {
this.addTimer(e)
})
},
array: function (t) {
return s.slice.call(t, 0)
},
create: function (t, e) {
e = e || "div";
var i = a.createElement(e);
i.className = t;
return i
},
removeFromArray: function (e, i) {
t.each(e, function (t, n) {
if (n == i) {
e.splice(t, 1);
return false
}
});
return e
},
getScriptPath: function (e) {
e = e || t("script:last").attr("src");
var i = e.split("/");
if (i.length == 1) {
return ""
}
i.pop();
return i.join("/") + "/"
},
animate: function () {
var n = function (t) {
var i = "transition WebkitTransition MozTransition OTransition".split(" "),
n;
if (e.opera) {
return false
}
for (n = 0; i[n]; n++) {
if (typeof t[i[n]] !== "undefined") {
return i[n]
}
}
return false
}
((a.body || a.documentElement).style);
var o = {
MozTransition: "transitionend",
OTransition: "oTransitionEnd",
WebkitTransition: "webkitTransitionEnd",
transition: "transitionend"
}
[n];
var r = {
_default: [.25, .1, .25, 1],
galleria: [.645, .045, .355, 1],
galleriaIn: [.55, .085, .68, .53],
galleriaOut: [.25, .46, .45, .94],
ease: [.25, 0, .25, 1],
linear: [.25, .25, .75, .75],
"ease-in": [.42, 0, 1, 1],
"ease-out": [0, 0, .58, 1],
"ease-in-out": [.42, 0, .58, 1]
};
var s = function (e, i, n) {
var a = {};
n = n || "transition";
t.each("webkit moz ms o".split(" "), function () {
a["-" + this + "-" + n] = i
});
e.css(a)
};
var l = function (t) {
s(t, "none", "transition");
if (i.WEBKIT && i.TOUCH) {
s(t, "translate3d(0,0,0)", "transform");
if (t.data("revert")) {
t.css(t.data("revert"));
t.data("revert", null)
}
}
};
var c,
h,
u,
f,
d,
p,
g;
return function (a, v, y) {
y = t.extend({
duration: 400,
complete: m,
stop: false
}, y);
a = t(a);
if (!y.duration) {
a.css(v);
y.complete.call(a[0]);
return
}
if (!n) {
a.animate(v, y);
return
}
if (y.stop) {
a.off(o);
l(a)
}
c = false;
t.each(v, function (t, e) {
g = a.css(t);
if (H.parseValue(g) != H.parseValue(e)) {
c = true
}
a.css(t, g)
});
if (!c) {
e.setTimeout(function () {
y.complete.call(a[0])
}, y.duration);
return
}
h = [];
u = y.easing in r ? r[y.easing] : r._default;
f = " " + y.duration + "ms" + " cubic-bezier(" + u.join(",") + ")";
e.setTimeout(function (e, n, a, o) {
return function () {
e.one(n, function (t) {
return function () {
l(t);
y.complete.call(t[0])
}
}
(e));
if (i.WEBKIT && i.TOUCH) {
d = {};
p = [0, 0, 0];
t.each(["left", "top"], function (t, i) {
if (i in a) {
p[t] = H.parseValue(a[i]) - H.parseValue(e.css(i)) + "px";
d[i] = a[i];
delete a[i]
}
});
if (p[0] || p[1]) {
e.data("revert", d);
h.push("-webkit-transform" + o);
s(e, "translate3d(" + p.join(",") + ")", "transform")
}
}
t.each(a, function (t, e) {
h.push(t + o)
});
s(e, h.join(","));
e.css(a)
}
}
(a, o, v, f), 2)
}
}
(),
removeAlpha: function (t) {
if (t instanceof jQuery) {
t = t[0]
}
if (y < 9 && t) {
var e = t.style,
i = t.currentStyle,
n = i && i.filter || e.filter || "";
if (/alpha/.test(n)) {
e.filter = n.replace(/alpha\([^)]*\)/i, "")
}
}
},
forceStyles: function (e, i) {
e = t(e);
if (e.attr("style")) {
e.data("styles", e.attr("style")).removeAttr("style")
}
e.css(i)
},
revertStyles: function () {
t.each(H.array(arguments), function (e, i) {
i = t(i);
i.removeAttr("style");
i.attr("style", "");
if (i.data("styles")) {
i.attr("style", i.data("styles")).data("styles", null)
}
})
},
moveOut: function (t) {
H.forceStyles(t, {
position: "absolute",
left: -1e4
})
},
moveIn: function () {
H.revertStyles.apply(H, H.array(arguments))
},
hide: function (e, i, n) {
n = n || m;
var a = t(e);
e = a[0];
if (!a.data("opacity")) {
a.data("opacity", a.css("opacity"))
}
var o = {
opacity: 0
};
if (i) {
var r = y < 9 && e ? function () {
H.removeAlpha(e);
e.style.visibility = "hidden";
n.call(e)
}
: n;
H.animate(e, o, {
duration: i,
complete: r,
stop: true
})
} else {
if (y < 9 && e) {
H.removeAlpha(e);
e.style.visibility = "hidden"
} else {
a.css(o)
}
}
},
show: function (e, i, n) {
n = n || m;
var a = t(e);
e = a[0];
var o = parseFloat(a.data("opacity")) || 1,
r = {
opacity: o
};
if (i) {
if (y < 9) {
a.css("opacity", 0);
e.style.visibility = "visible"
}
var s = y < 9 && e ? function () {
if (r.opacity == 1) {
H.removeAlpha(e)
}
n.call(e)
}
: n;
H.animate(e, r, {
duration: i,
complete: s,
stop: true
})
} else {
if (y < 9 && r.opacity == 1 && e) {
H.removeAlpha(e);
e.style.visibility = "visible"
} else {
a.css(r)
}
}
},
wait: function (n) {
i._waiters = i._waiters || [];
n = t.extend({
until: v,
success: m,
error: function () {
i.raise("Could not complete wait function.")
},
timeout: 3e3
}, n);
var a = H.timestamp(),
o,
r,
s,
l = function () {
r = H.timestamp();
o = r - a;
H.removeFromArray(i._waiters, s);
if (n.until(o)) {
n.success();
return false
}
if (typeof n.timeout == "number" && r >= a + n.timeout) {
n.error();
return false
}
i._waiters.push(s = e.setTimeout(l, 10))
};
i._waiters.push(s = e.setTimeout(l, 10))
},
toggleQuality: function (t, e) {
if (y !== 7 && y !== 8 || !t || t.nodeName.toUpperCase() != "IMG") {
return
}
if (typeof e === "undefined") {
e = t.style.msInterpolationMode === "nearest-neighbor"
}
t.style.msInterpolationMode = e ? "bicubic" : "nearest-neighbor"
},
insertStyleTag: function (e, i) {
if (i && t("#" + i).length) {
return
}
var n = a.createElement("style");
if (i) {
n.id = i
}
_().head.appendChild(n);
if (n.styleSheet) {
n.styleSheet.cssText = e
} else {
var o = a.createTextNode(e);
n.appendChild(o)
}
},
loadScript: function (e, i) {
var n = false,
a = t("<scr" + "ipt>").attr({
src: e,
async: true
}).get(0);
a.onload = a.onreadystatechange = function () {
if (!n && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
n = true;
a.onload = a.onreadystatechange = null;
if (typeof i === "function") {
i.call(this, this)
}
}
};
_().head.appendChild(a)
},
parseValue: function (t) {
if (typeof t === "number") {
return t
} else if (typeof t === "string") {
var e = t.match(/\-?\d|\./g);
return e && e.constructor === Array ? e.join("") * 1 : 0
} else {
return 0
}
},
timestamp: function () {
return (new Date).getTime()
},
loadCSS: function (e, o, r) {
var s,
l;
t("link[rel=stylesheet]").each(function () {
if (new RegExp(e).test(this.href)) {
s = this;
return false
}
});
if (typeof o === "function") {
r = o;
o = n
}
r = r || m;
if (s) {
r.call(s, s);
return s
}
l = a.styleSheets.length;
if (t("#" + o).length) {
t("#" + o).attr("href", e);
l--
} else {
s = t("<link>").attr({
rel: "stylesheet",
href: e,
id: o
}).get(0);
var c = t('link[rel="stylesheet"], style');
if (c.length) {
c.get(0).parentNode.insertBefore(s, c[0])
} else {
_().head.appendChild(s)
}
if (y && l >= 31) {
i.raise("You have reached the browser stylesheet limit (31)", true);
return
}
}
if (typeof r === "function") {
var h = t("<s>").attr("id", "galleria-loader").hide().appendTo(_().body);
H.wait({
until: function () {
return h.height() == 1
},
success: function () {
h.remove();
r.call(s, s)
},
error: function () {
h.remove();
i.raise("Theme CSS could not load after 20 sec. " + (i.QUIRK ? "Your browser is in Quirks Mode, please add a correct doctype." : "Please download the latest theme at http://galleria.io/customer/."), true)
},
timeout: 5e3
})
}
return s
}
}
}
(),
O = function (e) {
var i = ".galleria-videoicon{width:60px;height:60px;position:absolute;top:50%;left:50%;z-index:1;" + "margin:-30px 0 0 -30px;cursor:pointer;background:#000;background:rgba(0,0,0,.8);border-radius:3px;-webkit-transition:all 150ms}" + ".galleria-videoicon i{width:0px;height:0px;border-style:solid;border-width:10px 0 10px 16px;display:block;" + "border-color:transparent transparent transparent #ffffff;margin:20px 0 0 22px}.galleria-image:hover .galleria-videoicon{background:#000}";
H.insertStyleTag(i, "galleria-videoicon");
return t(H.create("galleria-videoicon")).html("<i></i>").appendTo(e).click(function () {
t(this).siblings("img").mouseup()
})
},
F = function () {
var e = function (e, i, n, a) {
var o = this.getOptions("easing"),
r = this.getStageWidth(),
s = {
left: r * (e.rewind ? -1 : 1)
},
l = {
left: 0
};
if (n) {
s.opacity = 0;
l.opacity = 1
} else {
s.opacity = 1
}
t(e.next).css(s);
H.animate(e.next, l, {
duration: e.speed,
complete: function (t) {
return function () {
i();
t.css({
left: 0
})
}
}
(t(e.next).add(e.prev)),
queue: false,
easing: o
});
if (a) {
e.rewind = !e.rewind
}
if (e.prev) {
s = {
left: 0
};
l = {
left: r * (e.rewind ? 1 : -1)
};
if (n) {
s.opacity = 1;
l.opacity = 0
}
t(e.prev).css(s);
H.animate(e.prev, l, {
duration: e.speed,
queue: false,
easing: o,
complete: function () {
t(this).css("opacity", 0)
}
})
}
};
return {
active: false,
init: function (t, e, i) {
if (F.effects.hasOwnProperty(t)) {
F.effects[t].call(this, e, i)
}
},
effects: {
fade: function (e, i) {
t(e.next).css({
opacity: 0,
left: 0
});
H.animate(e.next, {
opacity: 1
}, {
duration: e.speed,
complete: i
});
if (e.prev) {
t(e.prev).css("opacity", 1).show();
H.animate(e.prev, {
opacity: 0
}, {
duration: e.speed
})
}
},
flash: function (e, i) {
t(e.next).css({
opacity: 0,
left: 0
});
if (e.prev) {
H.animate(e.prev, {
opacity: 0
}, {
duration: e.speed / 2,
complete: function () {
H.animate(e.next, {
opacity: 1
}, {
duration: e.speed,
complete: i
})
}
})
} else {
H.animate(e.next, {
opacity: 1
}, {
duration: e.speed,
complete: i
})
}
},
pulse: function (e, i) {
if (e.prev) {
t(e.prev).hide()
}
t(e.next).css({
opacity: 0,
left: 0
}).show();
H.animate(e.next, {
opacity: 1
}, {
duration: e.speed,
complete: i
})
},
slide: function (t, i) {
e.apply(this, H.array(arguments))
},
fadeslide: function (t, i) {
e.apply(this, H.array(arguments).concat([true]))
},
doorslide: function (t, i) {
e.apply(this, H.array(arguments).concat([false, true]))
}
}
}
}
();
A.listen();
t.event.special["click:fast"] = {
propagate: true,
add: function (e) {
var n = this.propagate;
if (i.TOUCH) {
t(this).on("touchstart.fast", function a(i) {
var n = i.originalEvent,
a,
o,
r = 0;
if (n.touches.length == 1) {
a = n.touches[0].pageX;
o = n.touches[0].pageY;
t(this).on("touchmove.fast", function (t) {
var e = t.originalEvent.touches;
if (e.length == 1) {
r = g.max(g.abs(a - e[0].pageX), g.abs(o - e[0].pageY))
}
});
t(this).on("touchend.fast", function () {
if (r > 4) {
return t(this).off("touchend.fast touchmove.fast")
}
e.handler.call(this, i);
t(this).off("touchend.fast touchmove.fast")
})
}
})
} else {
t(this).on("click.fast", e.handler)
}
},
remove: function (e) {
if (i.TOUCH) {
t(this).off("touchstart.fast touchmove.fast touchend.fast")
} else {
t(this).off("click.fast", e.handler)
}
}
};
r.on("orientationchange", function () {
t(this).resize()
});
i = function () {
var s = this;
this._options = {};
this._playing = false;
this._playtime = 5e3;
this._active = null;
this._queue = {
length: 0
};
this._data = [];
this._dom = {};
this._thumbnails = [];
this._layers = [];
this._initialized = false;
this._firstrun = false;
this._stageWidth = 0;
this._stageHeight = 0;
this._target = n;
this._binds = [];
this._id = parseInt(g.random() * 1e4, 10);
var l = "container stage images image-nav image-nav-left image-nav-right " + "info info-text info-title info-description " + "thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right " + "loader counter tooltip",
c = "current total";
t.each(l.split(" "), function (t, e) {
s._dom[e] = H.create("galleria-" + e)
});
t.each(c.split(" "), function (t, e) {
s._dom[e] = H.create("galleria-" + e, "span")
});
var h = this._keyboard = {
keys: {
UP: 38,
DOWN: 40,
LEFT: 37,
RIGHT: 39,
RETURN: 13,
ESCAPE: 27,
BACKSPACE: 8,
SPACE: 32
},
map: {},
bound: false,
press: function (t) {
var e = t.keyCode || t.which;
if (e in h.map && typeof h.map[e] === "function") {
h.map[e].call(s, t)
}
},
attach: function (t) {
var e,
i;
for (e in t) {
if (t.hasOwnProperty(e)) {
i = e.toUpperCase();
if (i in h.keys) {
h.map[h.keys[i]] = t[e]
} else {
h.map[i] = t[e]
}
}
}
if (!h.bound) {
h.bound = true;
o.on("keydown", h.press)
}
},
detach: function () {
h.bound = false;
h.map = {};
o.off("keydown", h.press)
}
};
var u = this._controls = {
0: n,
1: n,
active: 0,
swap: function () {
u.active = u.active ? 0 : 1
},
getActive: function () {
return s._options.swipe ? u.slides[s._active] : u[u.active]
},
getNext: function () {
return s._options.swipe ? u.slides[s.getNext(s._active)] : u[1 - u.active]
},
slides: [],
frames: [],
layers: []
};
var d = this._carousel = {
next: s.$("thumb-nav-right"),
prev: s.$("thumb-nav-left"),
width: 0,
current: 0,
max: 0,
hooks: [],
update: function () {
var e = 0,
i = 0,
n = [0];
t.each(s._thumbnails, function (a, o) {
if (o.ready) {
e += o.outerWidth || t(o.container).outerWidth(true);
var r = t(o.container).width();
e += r - g.floor(r);
n[a + 1] = e;
i = g.max(i, o.outerHeight || t(o.container).outerHeight(true))
}
});
s.$("thumbnails").css({
width: e,
height: i
});
d.max = e;
d.hooks = n;
d.width = s.$("thumbnails-list").width();
d.setClasses();
s.$("thumbnails-container").toggleClass("galleria-carousel", e > d.width);
d.width = s.$("thumbnails-list").width()
},
bindControls: function () {
var t;
d.next.on("click:fast", function (e) {
e.preventDefault();
if (s._options.carouselSteps === "auto") {
for (t = d.current; t < d.hooks.length; t++) {
if (d.hooks[t] - d.hooks[d.current] > d.width) {
d.set(t - 2);
break
}
}
} else {
d.set(d.current + s._options.carouselSteps)
}
});
d.prev.on("click:fast", function (e) {
e.preventDefault();
if (s._options.carouselSteps === "auto") {
for (t = d.current; t >= 0; t--) {
if (d.hooks[d.current] - d.hooks[t] > d.width) {
d.set(t + 2);
break
} else if (t === 0) {
d.set(0);
break
}
}
} else {
d.set(d.current - s._options.carouselSteps)
}
})
},
set: function (t) {
t = g.max(t, 0);
while (d.hooks[t - 1] + d.width >= d.max && t >= 0) {
t--
}
d.current = t;
d.animate()
},
getLast: function (t) {
return (t || d.current) - 1
},
follow: function (t) {
if (t === 0 || t === d.hooks.length - 2) {
d.set(t);
return
}
var e = d.current;
while (d.hooks[e] - d.hooks[d.current] < d.width && e <= d.hooks.length) {
e++
}
if (t - 1 < d.current) {
d.set(t - 1)
} else if (t + 2 > e) {
d.set(t - e + d.current + 2)
}
},
setClasses: function () {
d.prev.toggleClass("disabled", !d.current);
d.next.toggleClass("disabled", d.hooks[d.current] + d.width >= d.max)
},
animate: function (e) {
d.setClasses();
var i = d.hooks[d.current] * -1;
if (isNaN(i)) {
return
}
s.$("thumbnails").css("left", function () {
return t(this).css("left")
});
H.animate(s.get("thumbnails"), {
left: i
}, {
duration: s._options.carouselSpeed,
easing: s._options.easing,
queue: false
})
}
};
var p = this._tooltip = {
initialized: false,
open: false,
timer: "tooltip" + s._id,
swapTimer: "swap" + s._id,
init: function () {
p.initialized = true;
var t = ".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;" + "opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}";
H.insertStyleTag(t, "galleria-tooltip");
s.$("tooltip").css({
opacity: .8,
visibility: "visible",
display: "none"
})
},
move: function (t) {
var e = s.getMousePosition(t).x,
i = s.getMousePosition(t).y,
n = s.$("tooltip"),
a = e,
o = i,
r = n.outerHeight(true) + 1,
l = n.outerWidth(true),
c = r + 15;
var h = s.$("container").width() - l - 2,
u = s.$("container").height() - r - 2;
if (!isNaN(a) && !isNaN(o)) {
a += 10;
o -= r + 8;
a = g.max(0, g.min(h, a));
o = g.max(0, g.min(u, o));
if (i < c) {
o = c
}
n.css({
left: a,
top: o
})
}
},
bind: function (e, n) {
if (i.TOUCH) {
return
}
if (!p.initialized) {
p.init()
}
var a = function () {
s.$("container").off("mousemove", p.move);
s.clearTimer(p.timer);
s.$("tooltip").stop().animate({
opacity: 0
}, 200, function () {
s.$("tooltip").hide();
s.addTimer(p.swapTimer, function () {
p.open = false
}, 1e3)
})
};
var o = function (e, i) {
p.define(e, i);
t(e).hover(function () {
s.clearTimer(p.swapTimer);
s.$("container").off("mousemove", p.move).on("mousemove", p.move).trigger("mousemove");
p.show(e);
s.addTimer(p.timer, function () {
s.$("tooltip").stop().show().animate({
opacity: 1
});
p.open = true
}, p.open ? 0 : 500)
}, a).click(a)
};
if (typeof n === "string") {
o(e in s._dom ? s.get(e) : e, n)
} else {
t.each(e, function (t, e) {
o(s.get(t), e)
})
}
},
show: function (i) {
i = t(i in s._dom ? s.get(i) : i);
var n = i.data("tt"),
a = function (t) {
e.setTimeout(function (t) {
return function () {
p.move(t)
}
}
(t), 10);
i.off("mouseup", a)
};
n = typeof n === "function" ? n() : n;
if (!n) {
return
}
s.$("tooltip").html(n.replace(/\s/, "&#160;"));
i.on("mouseup", a)
},
define: function (e, i) {
if (typeof i !== "function") {
var n = i;
i = function () {
return n
}
}
e = t(e in s._dom ? s.get(e) : e).data("tt", i);
p.show(e)
}
};
var m = this._fullscreen = {
scrolled: 0,
crop: n,
active: false,
prev: t(),
beforeEnter: function (t) {
t()
},
beforeExit: function (t) {
t()
},
keymap: s._keyboard.map,
parseCallback: function (e, i) {
return F.active ? function () {
if (typeof e == "function") {
e.call(s)
}
var n = s._controls.getActive(),
a = s._controls.getNext();
s._scaleImage(a);
s._scaleImage(n);
if (i && s._options.trueFullscreen) {
t(n.container).add(a.container).trigger("transitionend")
}
}
: e
},
enter: function (t) {
m.beforeEnter(function () {
t = m.parseCallback(t, true);
if (s._options.trueFullscreen && A.support) {
m.active = true;
H.forceStyles(s.get("container"), {
width: "100%",
height: "100%"
});
s.rescale();
if (i.MAC) {
if (!(i.SAFARI && /version\/[1-5]/.test(f))) {
s.$("container").css("opacity", 0).addClass("fullscreen");
e.setTimeout(function () {
m.scale();
s.$("container").css("opacity", 1)
}, 50)
} else {
s.$("stage").css("opacity", 0);
e.setTimeout(function () {
m.scale();
s.$("stage").css("opacity", 1)
}, 4)
}
} else {
s.$("container").addClass("fullscreen")
}
r.resize(m.scale);
A.enter(s, t, s.get("container"))
} else {
m.scrolled = r.scrollTop();
if (!i.TOUCH) {
e.scrollTo(0, 0)
}
m._enter(t)
}
})
},
_enter: function (o) {
m.active = true;
if (b) {
m.iframe = function () {
var n,
o = a.referrer,
r = a.createElement("a"),
s = e.location;
r.href = o;
if (r.protocol != s.protocol || r.hostname != s.hostname || r.port != s.port) {
i.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match.");
return false
}
m.pd = e.parent.document;
t(m.pd).find("iframe").each(function () {
var t = this.contentDocument || this.contentWindow.document;
if (t === a) {
n = this;
return false
}
});
return n
}
()
}
H.hide(s.getActiveImage());
if (b && m.iframe) {
m.iframe.scrolled = t(e.parent).scrollTop();
e.parent.scrollTo(0, 0)
}
var l = s.getData(),
c = s._options,
h = !s._options.trueFullscreen || !A.support,
u = {
height: "100%",
overflow: "hidden",
margin: 0,
padding: 0
};
if (h) {
s.$("container").addClass("fullscreen");
m.prev = s.$("container").prev();
if (!m.prev.length) {
m.parent = s.$("container").parent()
}
s.$("container").appendTo("body");
H.forceStyles(s.get("container"), {
position: i.TOUCH ? "absolute" : "fixed",
top: 0,
left: 0,
width: "100%",
height: "100%",
zIndex: 1e4
});
H.forceStyles(_().html, u);
H.forceStyles(_().body, u)
}
if (b && m.iframe) {
H.forceStyles(m.pd.documentElement, u);
H.forceStyles(m.pd.body, u);
H.forceStyles(m.iframe, t.extend(u, {
width: "100%",
height: "100%",
top: 0,
left: 0,
position: "fixed",
zIndex: 1e4,
border: "none"
}))
}
m.keymap = t.extend({}, s._keyboard.map);
s.attachKeyboard({
escape: s.exitFullscreen,
right: s.next,
left: s.prev
});
m.crop = c.imageCrop;
if (c.fullscreenCrop != n) {
c.imageCrop = c.fullscreenCrop
}
if (l && l.big && l.image !== l.big) {
var f = new i.Picture,
d = f.isCached(l.big),
p = s.getIndex(),
g = s._thumbnails[p];
s.trigger({
type: i.LOADSTART,
cached: d,
rewind: false,
index: p,
imageTarget: s.getActiveImage(),
thumbTarget: g,
galleriaData: l
});
f.load(l.big, function (e) {
s._scaleImage(e, {
complete: function (e) {
s.trigger({
type: i.LOADFINISH,
cached: d,
index: p,
rewind: false,
imageTarget: e.image,
thumbTarget: g
});
var n = s._controls.getActive().image;
if (n) {
t(n).width(e.image.width).height(e.image.height).attr("style", t(e.image).attr("style")).attr("src", e.image.src)
}
}
})
})
}
s.rescale(function () {
s.addTimer(false, function () {
if (h) {
H.show(s.getActiveImage())
}
if (typeof o === "function") {
o.call(s)
}
s.rescale()
}, 100);
s.trigger(i.FULLSCREEN_ENTER)
});
if (!h) {
H.show(s.getActiveImage())
} else {
r.resize(m.scale)
}
},
scale: function () {
s.rescale()
},
exit: function (t) {
m.beforeExit(function () {
t = m.parseCallback(t);
if (s._options.trueFullscreen && A.support) {
A.exit(t)
} else {
m._exit(t)
}
})
},
_exit: function (t) {
m.active = false;
var n = !s._options.trueFullscreen || !A.support,
a = s.$("container").removeClass("fullscreen");
if (m.parent) {
m.parent.prepend(a)
} else {
a.insertAfter(m.prev)
}
if (n) {
H.hide(s.getActiveImage());
H.revertStyles(s.get("container"), _().html, _().body);
if (!i.TOUCH) {
e.scrollTo(0, m.scrolled)
}
var o = s._controls.frames[s._controls.active];
if (o && o.image) {
o.image.src = o.image.src
}
}
if (b && m.iframe) {
H.revertStyles(m.pd.documentElement, m.pd.body, m.iframe);
if (m.iframe.scrolled) {
e.parent.scrollTo(0, m.iframe.scrolled)
}
}
s.detachKeyboard();
s.attachKeyboard(m.keymap);
s._options.imageCrop = m.crop;
var l = s.getData().big,
c = s._controls.getActive().image;
if (!s.getData().iframe && c && l && l == c.src) {
e.setTimeout(function (t) {
return function () {
c.src = t
}
}
(s.getData().image), 1)
}
s.rescale(function () {
s.addTimer(false, function () {
if (n) {
H.show(s.getActiveImage())
}
if (typeof t === "function") {
t.call(s)
}
r.trigger("resize")
}, 50);
s.trigger(i.FULLSCREEN_EXIT)
});
r.off("resize", m.scale)
}
};
var v = this._idle = {
trunk: [],
bound: false,
active: false,
add: function (e, i, n, a) {
if (!e) {
return
}
if (!v.bound) {
v.addEvent()
}
e = t(e);
if (typeof n == "boolean") {
a = n;
n = {}
}
n = n || {};
var o = {},
r;
for (r in i) {
if (i.hasOwnProperty(r)) {
o[r] = e.css(r)
}
}
e.data("idle", {
from: t.extend(o, n),
to: i,
complete: true,
busy: false
});
if (!a) {
v.addTimer()
} else {
e.css(i)
}
v.trunk.push(e)
},
remove: function (e) {
e = t(e);
t.each(v.trunk, function (t, i) {
if (i && i.length && !i.not(e).length) {
e.css(e.data("idle").from);
v.trunk.splice(t, 1)
}
});
if (!v.trunk.length) {
v.removeEvent();
s.clearTimer(v.timer)
}
},
addEvent: function () {
v.bound = true;
s.$("container").on("mousemove click", v.showAll);
if (s._options.idleMode == "hover") {
s.$("container").on("mouseleave", v.hide)
}
},
removeEvent: function () {
v.bound = false;
s.$("container").on("mousemove click", v.showAll);
if (s._options.idleMode == "hover") {
s.$("container").off("mouseleave", v.hide)
}
},
addTimer: function () {
if (s._options.idleMode == "hover") {
return
}
s.addTimer("idle", function () {
v.hide()
}, s._options.idleTime)
},
hide: function () {
if (!s._options.idleMode || s.getIndex() === false) {
return
}
s.trigger(i.IDLE_ENTER);
var e = v.trunk.length;
t.each(v.trunk, function (t, i) {
var n = i.data("idle");
if (!n) {
return
}
i.data("idle").complete = false;
H.animate(i, n.to, {
duration: s._options.idleSpeed,
complete: function () {
if (t == e - 1) {
v.active = false
}
}
})
})
},
showAll: function () {
s.clearTimer("idle");
t.each(v.trunk, function (t, e) {
v.show(e)
})
},
show: function (e) {
var n = e.data("idle");
if (!v.active || !n.busy && !n.complete) {
n.busy = true;
s.trigger(i.IDLE_EXIT);
s.clearTimer("idle");
H.animate(e, n.from, {
duration: s._options.idleSpeed / 2,
complete: function () {
v.active = true;
t(e).data("idle").busy = false;
t(e).data("idle").complete = true
}
})
}
v.addTimer()
}
};
var w = this._lightbox = {
width: 0,
height: 0,
initialized: false,
active: null,
image: null,
elems: {},
keymap: false,
init: function () {
if (w.initialized) {
return
}
w.initialized = true;
var e = "overlay box content shadow title info close prevholder prev nextholder next counter image",
n = {},
a = s._options,
o = "",
r = "position:absolute;",
l = "lightbox-",
c = {
overlay: "position:fixed;display:none;opacity:" + a.overlayOpacity + ";filter:alpha(opacity=" + a.overlayOpacity * 100 + ");top:0;left:0;width:100%;height:100%;background:" + a.overlayBackground + ";z-index:99990",
box: "position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",
shadow: r + "background:#000;width:100%;height:100%;",
content: r + "background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",
info: r + "bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",
close: r + "top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",
image: r + "top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",
prevholder: r + "width:50%;top:0;bottom:40px;cursor:pointer;",
nextholder: r + "width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",
prev: r + "top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",
next: r + "top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",
title: "float:left",
counter: "float:right;margin-left:8px;"
},
h = function (e) {
return e.hover(function () {
t(this).css("color", "#bbb")
}, function () {
t(this).css("color", "#444")
})
},
u = {};
if (y && y > 7) {
c.nextholder += "background:#000;filter:alpha(opacity=0);";
c.prevholder += "background:#000;filter:alpha(opacity=0);"
}
t.each(c, function (t, e) {
o += ".galleria-" + l + t + "{" + e + "}"
});
o += ".galleria-" + l + "box.iframe .galleria-" + l + "prevholder," + ".galleria-" + l + "box.iframe .galleria-" + l + "nextholder{" + "width:100px;height:100px;top:50%;margin-top:-70px}";
H.insertStyleTag(o, "galleria-lightbox");
t.each(e.split(" "), function (t, e) {
s.addElement("lightbox-" + e);
n[e] = w.elems[e] = s.get("lightbox-" + e)
});
w.image = new i.Picture;
t.each({
box: "shadow content close prevholder nextholder",
info: "title counter",
content: "info image",
prevholder: "prev",
nextholder: "next"
}, function (e, i) {
var n = [];
t.each(i.split(" "), function (t, e) {
n.push(l + e)
});
u[l + e] = n
});
s.append(u);
t(n.image).append(w.image.container);
t(_().body).append(n.overlay, n.box);
h(t(n.close).on("click:fast", w.hide).html("&#215;"));
t.each(["Prev", "Next"], function (e, a) {
var o = t(n[a.toLowerCase()]).html(/v/.test(a) ? "&#8249;&#160;" : "&#160;&#8250;"),
r = t(n[a.toLowerCase() + "holder"]);
r.on("click:fast", function () {
w["show" + a]()
});
if (y < 8 || i.TOUCH) {
o.show();
return
}
r.hover(function () {
o.show()
}, function (t) {
o.stop().fadeOut(200)
})
});
t(n.overlay).on("click:fast", w.hide);
if (i.IPAD) {
s._options.lightboxTransitionSpeed = 0
}
},
rescale: function (e) {
var n = g.min(r.width() - 40, w.width),
a = g.min(r.height() - 60, w.height),
o = g.min(n / w.width, a / w.height),
l = g.round(w.width * o) + 40,
c = g.round(w.height * o) + 60,
h = {
width: l,
height: c,
"margin-top": g.ceil(c / 2) * -1,
"margin-left": g.ceil(l / 2) * -1
};
if (e) {
t(w.elems.box).css(h)
} else {
t(w.elems.box).animate(h, {
duration: s._options.lightboxTransitionSpeed,
easing: s._options.easing,
complete: function () {
var e = w.image,
n = s._options.lightboxFadeSpeed;
s.trigger({
type: i.LIGHTBOX_IMAGE,
imageTarget: e.image
});
t(e.container).show();
t(e.image).animate({
opacity: 1
}, n);
H.show(w.elems.info, n)
}
})
}
},
hide: function () {
w.image.image = null;
r.off("resize", w.rescale);
t(w.elems.box).hide().find("iframe").remove();
H.hide(w.elems.info);
s.detachKeyboard();
s.attachKeyboard(w.keymap);
w.keymap = false;
H.hide(w.elems.overlay, 200, function () {
t(this).hide().css("opacity", s._options.overlayOpacity);
s.trigger(i.LIGHTBOX_CLOSE)
})
},
showNext: function () {
w.show(s.getNext(w.active))
},
showPrev: function () {
w.show(s.getPrev(w.active))
},
show: function (n) {
w.active = n = typeof n === "number" ? n : s.getIndex() || 0;
if (!w.initialized) {
w.init()
}
s.trigger(i.LIGHTBOX_OPEN);
if (!w.keymap) {
w.keymap = t.extend({}, s._keyboard.map);
s.attachKeyboard({
escape: w.hide,
right: w.showNext,
left: w.showPrev
})
}
r.off("resize", w.rescale);
var a = s.getData(n),
o = s.getDataLength(),
l = s.getNext(n),
c,
h,
u;
H.hide(w.elems.info);
try {
for (u = s._options.preload; u > 0; u--) {
h = new i.Picture;
c = s.getData(l);
h.preload(c.big ? c.big : c.image);
l = s.getNext(l)
}
} catch (f) {}
w.image.isIframe = a.iframe && !a.image;
t(w.elems.box).toggleClass("iframe", w.image.isIframe);
t(w.image.container).find(".galleria-videoicon").remove();
w.image.load(a.big || a.image || a.iframe, function (i) {
if (i.isIframe) {
var l = t(e).width(),
c = t(e).height();
if (i.video && s._options.maxVideoSize) {
var h = g.min(s._options.maxVideoSize / l, s._options.maxVideoSize / c);
if (h < 1) {
l *= h;
c *= h
}
}
w.width = l;
w.height = c
} else {
w.width = i.original.width;
w.height = i.original.height
}
t(i.image).css({
width: i.isIframe ? "100%" : "100.1%",
height: i.isIframe ? "100%" : "100.1%",
top: 0,
bottom: 0,
zIndex: 99998,
opacity: 0,
visibility: "visible"
}).parent().height("100%");
w.elems.title.innerHTML = a.title || "";
w.elems.counter.innerHTML = n + 1 + " / " + o;
r.resize(w.rescale);
w.rescale();
if (a.image && a.iframe) {
t(w.elems.box).addClass("iframe");
if (a.video) {
var u = O(i.container).hide();
e.setTimeout(function () {
u.fadeIn(200)
}, 200)
}
t(i.image).css("cursor", "pointer").mouseup(function (e, i) {
return function (n) {
t(w.image.container).find(".galleria-videoicon").remove();
n.preventDefault();
i.isIframe = true;
i.load(e.iframe + (e.video ? "&autoplay=1" : ""), {
width: "100%",
height: y < 8 ? t(w.image.container).height() : "100%"
})
}
}
(a, i))
}
});
t(w.elems.overlay).show().css("visibility", "visible");
t(w.elems.box).show()
}
};
var x = this._timer = {
trunk: {},
add: function (t, i, n, a) {
t = t || (new Date).getTime();
a = a || false;
this.clear(t);
if (a) {
var o = i;
i = function () {
o();
x.add(t, i, n)
}
}
this.trunk[t] = e.setTimeout(i, n)
},
clear: function (t) {
var i = function (t) {
e.clearTimeout(this.trunk[t]);
delete this.trunk[t]
},
n;
if (!!t && t in this.trunk) {
i.call(this, t)
} else if (typeof t === "undefined") {
for (n in this.trunk) {
if (this.trunk.hasOwnProperty(n)) {
i.call(this, n)
}
}
}
}
};
return this
};
i.prototype = {
constructor: i,
init: function (e, a) {
a = T(a);
this._original = {
target: e,
options: a,
data: null
};
this._target = this._dom.target = e.nodeName ? e : t(e).get(0);
this._original.html = this._target.innerHTML;
$.push(this);
if (!this._target) {
i.raise("Target not found", true);
return
}
this._options = {
autoplay: false,
carousel: true,
carouselFollow: true,
carouselSpeed: 400,
carouselSteps: "auto",
clicknext: false,
dailymotion: {
foreground: "%23EEEEEE",
highlight: "%235BCEC5",
background: "%23222222",
logo: 0,
hideInfos: 1
},
dataConfig: function (t) {
return {}
},
dataSelector: "img",
dataSort: false,
dataSource: this._target,
debug: n,
dummy: n,
easing: "galleria",
extend: function (t) {},
fullscreenCrop: n,
fullscreenDoubleTap: true,
fullscreenTransition: n,
height: 0,
idleMode: true,
idleTime: 3e3,
idleSpeed: 200,
imageCrop: false,
imageMargin: 0,
imagePan: false,
imagePanSmoothness: 12,
imagePosition: "50%",
imageTimeout: n,
initialTransition: n,
keepSource: false,
layerFollow: true,
lightbox: false,
lightboxFadeSpeed: 200,
lightboxTransitionSpeed: 200,
linkSourceImages: true,
maxScaleRatio: n,
maxVideoSize: n,
minScaleRatio: n,
overlayOpacity: .85,
overlayBackground: "#0b0b0b",
pauseOnInteraction: true,
popupLinks: false,
preload: 2,
queue: true,
responsive: true,
show: 0,
showInfo: true,
showCounter: true,
showImagenav: true,
swipe: true,
thumbCrop: true,
thumbEventType: "click:fast",
thumbMargin: 0,
thumbQuality: "auto",
thumbDisplayOrder: true,
thumbPosition: "50%",
thumbnails: true,
touchTransition: n,
transition: "fade",
transitionInitial: n,
transitionSpeed: 400,
trueFullscreen: true,
useCanvas: false,
variation: "",
videoPoster: true,
vimeo: {
title: 0,
byline: 0,
portrait: 0,
color: "aaaaaa"
},
wait: 5e3,
width: "auto",
youtube: {
modestbranding: 1,
autohide: 1,
color: "white",
hd: 1,
rel: 0,
showinfo: 0
}
};
this._options.initialTransition = this._options.initialTransition || this._options.transitionInitial;
if (a && a.debug === false) {
c = false
}
if (a && typeof a.imageTimeout === "number") {
h = a.imageTimeout
}
if (a && typeof a.dummy === "string") {
u = a.dummy
}
if (!i.TOUCH) {
this._options.swipe = false
}
t(this._target).children().hide();
if (i.QUIRK) {
i.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype.")
}
if (typeof i.theme === "object") {
this._init()
} else {
P.push(this)
}
return this
},
_init: function () {
var o = this,
s = this._options;
if (this._initialized) {
i.raise("Init failed: Gallery instance already initialized.");
return this
}
this._initialized = true;
if (!i.theme) {
i.raise("Init failed: No theme found.", true);
return this
}
t.extend(true, s, i.theme.defaults, this._original.options, i.configure.options);
if (s.swipe) {
s.clicknext = false;
s.imagePan = false
}
!function (t) {
if (!("getContext" in t)) {
t = null;
return
}
L = L || {
elem: t,
context: t.getContext("2d"),
cache: {},
length: 0
}
}
(a.createElement("canvas"));
this.bind(i.DATA, function () {
if (e.screen && e.screen.width && Array.prototype.forEach) {
this._data.forEach(function (t) {
var i = "devicePixelRatio" in e ? e.devicePixelRatio : 1,
n = g.max(e.screen.width, e.screen.height);
if (n * i < 1024) {
t.big = t.image
}
})
}
this._original.data = this._data;
this.get("total").innerHTML = this.getDataLength();
var t = this.$("container");
if (o._options.height < 2) {
o._userRatio = o._ratio = o._options.height
}
var n = {
width: 0,
height: 0
};
var a = function () {
return o.$("stage").height()
};
H.wait({
until: function () {
n = o._getWH();
t.width(n.width).height(n.height);
return a() && n.width && n.height > 50
},
success: function () {
o._width = n.width;
o._height = n.height;
o._ratio = o._ratio || n.height / n.width;
if (i.WEBKIT) {
e.setTimeout(function () {
o._run()
}, 1)
} else {
o._run()
}
},
error: function () {
if (a()) {
i.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:" + n.width + "px, height: " + n.height + "px.", true)
} else {
i.raise("Could not extract a stage height from the CSS. Traced height: " + a() + "px.", true)
}
},
timeout: typeof this._options.wait == "number" ? this._options.wait : false
})
});
this.append({
"info-text": ["info-title", "info-description"],
info: ["info-text"],
"image-nav": ["image-nav-right", "image-nav-left"],
stage: ["images", "loader", "counter", "image-nav"],
"thumbnails-list": ["thumbnails"],
"thumbnails-container": ["thumb-nav-left", "thumbnails-list", "thumb-nav-right"],
container: ["stage", "thumbnails-container", "info", "tooltip"]
});
H.hide(this.$("counter").append(this.get("current"), a.createTextNode(" / "), this.get("total")));
this.setCounter("&#8211;");
H.hide(o.get("tooltip"));
this.$("container").addClass((i.TOUCH ? "touch" : "notouch") + " " + this._options.variation);
if (!this._options.swipe) {
t.each(new Array(2), function (e) {
var n = new i.Picture;
t(n.container).css({
position: "absolute",
top: 0,
left: 0
}).prepend(o._layers[e] = t(H.create("galleria-layer")).css({
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 2
})[0]);
o.$("images").append(n.container);
o._controls[e] = n;
var a = new i.Picture;
a.isIframe = true;
t(a.container).attr("class", "galleria-frame").css({
position: "absolute",
top: 0,
left: 0,
zIndex: 4,
background: "#000",
display: "none"
}).appendTo(n.container);
o._controls.frames[e] = a
})
}
this.$("images").css({
position: "relative",
top: 0,
left: 0,
width: "100%",
height: "100%"
});
if (s.swipe) {
this.$("images").css({
position: "absolute",
top: 0,
left: 0,
width: 0,
height: "100%"
});
this.finger = new i.Finger(this.get("stage"), {
onchange: function (t) {
o.setCounter(t).setInfo(t).pause();
o.show(t)
},
oncomplete: function (t) {
var e = g.max(0, g.min(parseInt(t, 10), o.getDataLength() - 1)),
i = o.getData(e);
if (!i) {
return
}
o.$("images").find("iframe").remove();
o.$("images").find(".galleria-frame").css("opacity", 0).hide();
if (o._options.carousel && o._options.carouselFollow) {
o._carousel.follow(e)
}
}
});
this.bind(i.RESCALE, function () {
this.finger.setup()
});
this.$("stage").on("click", function (i) {
var a = o.getData();
if (!a) {
return
}
if (a.iframe) {
if (o.isPlaying()) {
o.pause()
}
var r = o._controls.frames[o._active],
s = o._stageWidth,
l = o._stageHeight;
if (t(r.container).find("iframe").length) {
return
}
t(r.container).css({
width: s,
height: l,
opacity: 0
}).show().animate({
opacity: 1
}, 200);
e.setTimeout(function () {
r.load(a.iframe + (a.video ? "&autoplay=1" : ""), {
width: s,
height: l
}, function (t) {
o.$("container").addClass("videoplay");
t.scale({
width: o._stageWidth,
height: o._stageHeight,
iframelimit: a.video ? o._options.maxVideoSize : n
})
})
}, 100);
return
}
if (a.link) {
if (o._options.popupLinks) {
var c = e.open(a.link, "_blank")
} else {
e.location.href = a.link
}
return
}
});
this.bind(i.IMAGE, function (e) {
o.setCounter(e.index);
o.setInfo(e.index);
var i = this.getNext(),
n = this.getPrev();
var a = [n, i];
a.push(this.getNext(i), this.getPrev(n), o._controls.slides.length - 1);
var r = [];
t.each(a, function (e, i) {
if (t.inArray(i, r) == -1) {
r.push(i)
}
});
t.each(r, function (e, i) {
var n = o.getData(i),
a = o._controls.slides[i],
r = o.isFullscreen() && n.big ? n.big : n.image || n.iframe;
if (n.iframe && !n.image) {
a.isIframe = true
}
if (!a.ready) {
o._controls.slides[i].load(r, function (e) {
if (!e.isIframe) {
t(e.image).css("visibility", "hidden")
}
o._scaleImage(e, {
complete: function (e) {
if (!e.isIframe) {
t(e.image).css({
opacity: 0,
visibility: "visible"
}).animate({
opacity: 1
}, 200)
}
}
})
})
}
})
})
}
this.$("thumbnails, thumbnails-list").css({
overflow: "hidden",
position: "relative"
});
this.$("image-nav-right, image-nav-left").on("click:fast", function (t) {
if (s.pauseOnInteraction) {
o.pause()
}
var e = /right/.test(this.className) ? "next" : "prev";
o[e]()
}).on("click", function (t) {
t.preventDefault();
if (s.clicknext || s.swipe) {
t.stopPropagation()
}
});
t.each(["info", "counter", "image-nav"], function (t, e) {
if (s["show" + e.substr(0, 1).toUpperCase() + e.substr(1).replace(/-/, "")] === false) {
H.moveOut(o.get(e.toLowerCase()))
}
});
this.load();
if (!s.keepSource && !y) {
this._target.innerHTML = ""
}
if (this.get("errors")) {
this.appendChild("target", "errors")
}
this.appendChild("target", "container");
if (s.carousel) {
var l = 0,
c = s.show;
this.bind(i.THUMBNAIL, function () {
this.updateCarousel();
if (++l == this.getDataLength() && typeof c == "number" && c > 0) {
this._carousel.follow(c)
}
})
}
if (s.responsive) {
r.on("resize", function () {
if (!o.isFullscreen()) {
o.resize()
}
})
}
if (s.fullscreenDoubleTap) {
this.$("stage").on("touchstart", function () {
var t,
e,
i,
n,
a,
r,
s = function (t) {
return t.originalEvent.touches ? t.originalEvent.touches[0] : t
};
o.$("stage").on("touchmove", function () {
t = 0
});
return function (l) {
if (/(-left|-right)/.test(l.target.className)) {
return
}
r = H.timestamp();
e = s(l).pageX;
i = s(l).pageY;
if (l.originalEvent.touches.length < 2 && r - t < 300 && e - n < 20 && i - a < 20) {
o.toggleFullscreen();
l.preventDefault();
return
}
t = r;
n = e;
a = i
}
}
())
}
t.each(i.on.binds, function (e, i) {
if (t.inArray(i.hash, o._binds) == -1) {
o.bind(i.type, i.callback)
}
});
return this
},
addTimer: function () {
this._timer.add.apply(this._timer, H.array(arguments));
return this
},
clearTimer: function () {
this._timer.clear.apply(this._timer, H.array(arguments));
return this
},
_getWH: function () {
var e = this.$("container"),
i = this.$("target"),
n = this,
a = {},
o;
t.each(["width", "height"], function (t, r) {
if (n._options[r] && typeof n._options[r] === "number") {
a[r] = n._options[r]
} else {
o = [H.parseValue(e.css(r)), H.parseValue(i.css(r)), e[r](), i[r]()];
if (!n["_" + r]) {
o.splice(o.length, H.parseValue(e.css("min-" + r)), H.parseValue(i.css("min-" + r)))
}
a[r] = g.max.apply(g, o)
}
});
if (n._userRatio) {
a.height = a.width * n._userRatio
}
return a
},
_createThumbnails: function (n) {
this.get("total").innerHTML = this.getDataLength();
var o,
r,
s,
l,
c = this,
h = this._options,
u = n ? this._data.length - n.length : 0,
f = u,
d = [],
p = 0,
g = y < 8 ? "http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif" : "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",
m = function () {
var t = c.$("thumbnails").find(".active");
if (!t.length) {
return false
}
return t.find("img").attr("src")
}
(),
v = typeof h.thumbnails === "string" ? h.thumbnails.toLowerCase() : null,
_ = function (t) {
return a.defaultView && a.defaultView.getComputedStyle ? a.defaultView.getComputedStyle(r.container, null)[t] : l.css(t)
},
b = function (e, n, a) {
return function () {
t(a).append(e);
c.trigger({
type: i.THUMBNAIL,
thumbTarget: e,
index: n,
galleriaData: c.getData(n)
})
}
},
w = function (e) {
if (h.pauseOnInteraction) {
c.pause()
}
var i = t(e.currentTarget).data("index");
if (c.getIndex() !== i) {
c.show(i)
}
e.preventDefault()
},
x = function (e, n) {
t(e.container).css("visibility", "visible");
c.trigger({
type: i.THUMBNAIL,
thumbTarget: e.image,
index: e.data.order,
galleriaData: c.getData(e.data.order)
});
if (typeof n == "function") {
n.call(c, e)
}
},
T = function (e, i) {
e.scale({
width: e.data.width,
height: e.data.height,
crop: h.thumbCrop,
margin: h.thumbMargin,
canvas: h.useCanvas,
position: h.thumbPosition,
complete: function (e) {
var n = ["left", "top"],
a = ["Width", "Height"],
o,
r,
s = c.getData(e.index);
t.each(a, function (i, a) {
o = a.toLowerCase();
if (h.thumbCrop !== true || h.thumbCrop === o) {
r = {};
r[o] = e[o];
t(e.container).css(r);
r = {};
r[n[i]] = 0;
t(e.image).css(r)
}
e["outer" + a] = t(e.container)["outer" + a](true)
});
H.toggleQuality(e.image, h.thumbQuality === true || h.thumbQuality === "auto" && e.original.width < e.width * 3);
if (h.thumbDisplayOrder && !e.lazy) {
t.each(d, function (t, e) {
if (t === p && e.ready && !e.displayed) {
p++;
e.displayed = true;
x(e, i);
return
}
})
} else {
x(e, i)
}
}
})
};
if (!n) {
this._thumbnails = [];
this.$("thumbnails").empty()
}
for (; this._data[u]; u++) {
s = this._data[u];
o = s.thumb || s.image;
if ((h.thumbnails === true || v == "lazy") && (s.thumb || s.image)) {
r = new i.Picture(u);
r.index = u;
r.displayed = false;
r.lazy = false;
r.video = false;
this.$("thumbnails").append(r.container);
l = t(r.container);
l.css("visibility", "hidden");
r.data = {
width: H.parseValue(_("width")),
height: H.parseValue(_("height")),
order: u,
src: o
};
if (h.thumbCrop !== true) {
l.css({
width: "auto",
height: "auto"
})
} else {
l.css({
width: r.data.width,
height: r.data.height
})
}
if (v == "lazy") {
l.addClass("lazy");
r.lazy = true;
r.load(g, {
height: r.data.height,
width: r.data.width
})
} else {
r.load(o, T)
}
if (h.preload === "all") {
r.preload(s.image)
}
} else if (s.iframe || v === "empty" || v === "numbers") {
r = {
container: H.create("galleria-image"),
image: H.create("img", "span"),
ready: true,
data: {
order: u
}
};
if (v === "numbers") {
t(r.image).text(u + 1)
}
if (s.iframe) {
t(r.image).addClass("iframe")
}
this.$("thumbnails").append(r.container);
e.setTimeout(b(r.image, u, r.container), 50 + u * 20)
} else {
r = {
container: null,
image: null
}
}
t(r.container).add(h.keepSource && h.linkSourceImages ? s.original : null).data("index", u).on(h.thumbEventType, w).data("thumbload", T);
if (m === o) {
t(r.container).addClass("active")
}
this._thumbnails.push(r)
}
d = this._thumbnails.slice(f);
return this
},
lazyLoad: function (e, i) {
var n = e.constructor == Array ? e : [e],
a = this,
o = 0;
t.each(n, function (e, r) {
if (r > a._thumbnails.length - 1) {
return
}
var s = a._thumbnails[r],
l = s.data,
c = function () {
if (++o == n.length && typeof i == "function") {
i.call(a)
}
},
h = t(s.container).data("thumbload");
if (s.video) {
h.call(a, s, c)
} else {
s.load(l.src, function (t) {
h.call(a, t, c)
})
}
});
return this
},
lazyLoadChunks: function (t, i) {
var n = this.getDataLength(),
a = 0,
o = 0,
r = [],
s = [],
l = this;
i = i || 0;
for (; a < n; a++) {
s.push(a);
if (++o == t || a == n - 1) {
r.push(s);
o = 0;
s = []
}
}
var c = function (t) {
var n = r.shift();
if (n) {
e.setTimeout(function () {
l.lazyLoad(n, function () {
c(true)
})
}, i && t ? i : 0)
}
};
c(false);
return this
},
_run: function () {
var a = this;
a._createThumbnails();
H.wait({
timeout: 1e4,
until: function () {
if (i.OPERA) {
a.$("stage").css("display", "inline-block")
}
a._stageWidth = a.$("stage").width();
a._stageHeight = a.$("stage").height();
return a._stageWidth && a._stageHeight > 50
},
success: function () {
E.push(a);
if (a._options.swipe) {
var o = a.$("images").width(a.getDataLength() * a._stageWidth);
t.each(new Array(a.getDataLength()), function (e) {
var n = new i.Picture,
r = a.getData(e);
t(n.container).css({
position: "absolute",
top: 0,
left: a._stageWidth * e
}).prepend(a._layers[e] = t(H.create("galleria-layer")).css({
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 2
})[0]).appendTo(o);
if (r.video) {
O(n.container)
}
a._controls.slides.push(n);
var s = new i.Picture;
s.isIframe = true;
t(s.container).attr("class", "galleria-frame").css({
position: "absolute",
top: 0,
left: 0,
zIndex: 4,
background: "#000",
display: "none"
}).appendTo(n.container);
a._controls.frames.push(s)
});
a.finger.setup()
}
H.show(a.get("counter"));
if (a._options.carousel) {
a._carousel.bindControls()
}
if (a._options.autoplay) {
a.pause();
if (typeof a._options.autoplay === "number") {
a._playtime = a._options.autoplay
}
a._playing = true
}
if (a._firstrun) {
if (a._options.autoplay) {
a.trigger(i.PLAY)
}
if (typeof a._options.show === "number") {
a.show(a._options.show)
}
return
}
a._firstrun = true;
if (i.History) {
i.History.change(function (t) {
if (isNaN(t)) {
e.history.go(-1)
} else {
a.show(t, n, true)
}
})
}
a.trigger(i.READY);
i.theme.init.call(a, a._options);
t.each(i.ready.callbacks, function (t, e) {
if (typeof e == "function") {
e.call(a, a._options)
}
});
a._options.extend.call(a, a._options);
if (/^[0-9]{1,4}$/.test(d) && i.History) {
a.show(d, n, true)
} else if (a._data[a._options.show]) {
a.show(a._options.show)
}
if (a._options.autoplay) {
a.trigger(i.PLAY)
}
},
error: function () {
i.raise("Stage width or height is too small to show the gallery. Traced measures: width:" + a._stageWidth + "px, height: " + a._stageHeight + "px.", true)
}
})
},
load: function (e, n, a) {
var o = this,
r = this._options;
this._data = [];
this._thumbnails = [];
this.$("thumbnails").empty();
if (typeof n === "function") {
a = n;
n = null
}
e = e || r.dataSource;
n = n || r.dataSelector;
a = a || r.dataConfig;
if (t.isPlainObject(e)) {
e = [e]
}
if (t.isArray(e)) {
if (this.validate(e)) {
this._data = e
} else {
i.raise("Load failed: JSON Array not valid.")
}
} else {
n += ",.video,.iframe";
t(e).find(n).each(function (e, i) {
i = t(i);
var n = {},
r = i.parent(),
s = r.attr("href"),
l = r.attr("rel");
if (s && (i[0].nodeName == "IMG" || i.hasClass("video")) && S(s)) {
n.video = s
} else if (s && i.hasClass("iframe")) {
n.iframe = s
} else {
n.image = n.big = s
}
if (l) {
n.big = l
}
t.each("big title description link layer image".split(" "), function (t, e) {
if (i.data(e)) {
n[e] = i.data(e).toString()
}
});
if (!n.big) {
n.big = n.image
}
o._data.push(t.extend({
title: i.attr("title") || "",
thumb: i.attr("src"),
image: i.attr("src"),
big: i.attr("src"),
description: i.attr("alt") || "",
link: i.attr("longdesc"),
original: i.get(0)
}, n, a(i)))
})
}
if (typeof r.dataSort == "function") {
s.sort.call(this._data, r.dataSort)
} else if (r.dataSort == "random") {
this._data.sort(function () {
return g.round(g.random()) - .5
})
}
if (this.getDataLength()) {
this._parseData(function () {
this.trigger(i.DATA)
})
}
return this
},
_parseData: function (e) {
var i = this,
a,
o = false,
r = function () {
var n = true;
t.each(i._data, function (t, e) {
if (e.loading) {
n = false;
return false
}
});
if (n && !o) {
o = true;
e.call(i)
}
};
t.each(this._data, function (e, o) {
a = i._data[e];
if ("thumb" in o === false) {
a.thumb = o.image
}
if (!o.big) {
a.big = o.image
}
if ("video" in o) {
var s = S(o.video);
if (s) {
a.iframe = new I(s.provider, s.id).embed() + function () {
if (typeof i._options[s.provider] == "object") {
var e = "?",
n = [];
t.each(i._options[s.provider], function (t, e) {
n.push(t + "=" + e)
});
if (s.provider == "youtube") {
n = ["wmode=opaque"].concat(n)
}
return e + n.join("&")
}
return ""
}
();
if (!a.thumb || !a.image) {
t.each(["thumb", "image"], function (t, e) {
if (e == "image" && !i._options.videoPoster) {
a.image = n;
return
}
var o = new I(s.provider, s.id);
if (!a[e]) {
a.loading = true;
o.getMedia(e, function (t, e) {
return function (i) {
t[e] = i;
if (e == "image" && !t.big) {
t.big = t.image
}
delete t.loading;
r()
}
}
(a, e))
}
})
}
}
}
});
r();
return this
},
destroy: function () {
this.$("target").data("galleria", null);
this.$("container").off("galleria");
this.get("target").innerHTML = this._original.html;
this.clearTimer();
H.removeFromArray($, this);
H.removeFromArray(E, this);
if (i._waiters.length) {
t.each(i._waiters, function (t, i) {
if (i)
e.clearTimeout(i)
})
}
return this
},
splice: function () {
var t = this,
i = H.array(arguments);
e.setTimeout(function () {
s.splice.apply(t._data, i);
t._parseData(function () {
t._createThumbnails()
})
}, 2);
return t
},
push: function () {
var t = this,
i = H.array(arguments);
if (i.length == 1 && i[0].constructor == Array) {
i = i[0]
}
e.setTimeout(function () {
s.push.apply(t._data, i);
t._parseData(function () {
t._createThumbnails(i)
})
}, 2);
return t
},
_getActive: function () {
return this._controls.getActive()
},
validate: function (t) {
return true
},
bind: function (t, e) {
t = k(t);
this.$("container").on(t, this.proxy(e));
return this
},
unbind: function (t) {
t = k(t);
this.$("container").off(t);
return this
},
trigger: function (e) {
e = typeof e === "object" ? t.extend(e, {
scope: this
}) : {
type: k(e),
scope: this
};
this.$("container").trigger(e);
return this
},
addIdleState: function (t, e, i, n) {
this._idle.add.apply(this._idle, H.array(arguments));
return this
},
removeIdleState: function (t) {
this._idle.remove.apply(this._idle, H.array(arguments));
return this
},
enterIdleMode: function () {
this._idle.hide();
return this
},
exitIdleMode: function () {
this._idle.showAll();
return this
},
enterFullscreen: function (t) {
this._fullscreen.enter.apply(this, H.array(arguments));
return this
},
exitFullscreen: function (t) {
this._fullscreen.exit.apply(this, H.array(arguments));
return this
},
toggleFullscreen: function (t) {
this._fullscreen[this.isFullscreen() ? "exit" : "enter"].apply(this, H.array(arguments));
return this
},
bindTooltip: function (t, e) {
this._tooltip.bind.apply(this._tooltip, H.array(arguments));
return this
},
defineTooltip: function (t, e) {
this._tooltip.define.apply(this._tooltip, H.array(arguments));
return this
},
refreshTooltip: function (t) {
this._tooltip.show.apply(this._tooltip, H.array(arguments));
return this
},
openLightbox: function () {
this._lightbox.show.apply(this._lightbox, H.array(arguments));
return this
},
closeLightbox: function () {
this._lightbox.hide.apply(this._lightbox, H.array(arguments));
return this
},
hasVariation: function (e) {
return t.inArray(e, this._options.variation.split(/\s+/)) > -1
},
getActiveImage: function () {
var t = this._getActive();
return t ? t.image : n
},
getActiveThumb: function () {
return this._thumbnails[this._active].image || n
},
getMousePosition: function (t) {
return {
x: t.pageX - this.$("container").offset().left,
y: t.pageY - this.$("container").offset().top
}
},
addPan: function (e) {
if (this._options.imageCrop === false) {
return
}
e = t(e || this.getActiveImage());
var i = this,
n = e.width() / 2,
a = e.height() / 2,
o = parseInt(e.css("left"), 10),
r = parseInt(e.css("top"), 10),
s = o || 0,
l = r || 0,
c = 0,
h = 0,
u = false,
f = H.timestamp(),
d = 0,
p = 0,
m = function (t, i, n) {
if (t > 0) {
p = g.round(g.max(t * -1, g.min(0, i)));
if (d !== p) {
d = p;
if (y === 8) {
e.parent()["scroll" + n](p * -1)
} else {
var a = {};
a[n.toLowerCase()] = p;
e.css(a)
}
}
}
},
v = function (t) {
if (H.timestamp() - f < 50) {
return
}
u = true;
n = i.getMousePosition(t).x;
a = i.getMousePosition(t).y
},
_ = function (t) {
if (!u) {
return
}
c = e.width() - i._stageWidth;
h = e.height() - i._stageHeight;
o = n / i._stageWidth * c * -1;
r = a / i._stageHeight * h * -1;
s += (o - s) / i._options.imagePanSmoothness;
l += (r - l) / i._options.imagePanSmoothness;
m(h, l, "Top");
m(c, s, "Left")
};
if (y === 8) {
e.parent().scrollTop(l * -1).scrollLeft(s * -1);
e.css({
top: 0,
left: 0
})
}
this.$("stage").off("mousemove", v).on("mousemove", v);
this.addTimer("pan" + i._id, _, 50, true);
return this
},
proxy: function (t, e) {
if (typeof t !== "function") {
return m
}
e = e || this;
return function () {
return t.apply(e, H.array(arguments))
}
},
removePan: function () {
this.$("stage").off("mousemove");
this.clearTimer("pan" + this._id);
return this
},
addElement: function (e) {
var i = this._dom;
t.each(H.array(arguments), function (t, e) {
i[e] = H.create("galleria-" + e)
});
return this
},
attachKeyboard: function (t) {
this._keyboard.attach.apply(this._keyboard, H.array(arguments));
return this
},
detachKeyboard: function () {
this._keyboard.detach.apply(this._keyboard, H.array(arguments));
return this
},
appendChild: function (t, e) {
this.$(t).append(this.get(e) || e);
return this
},
prependChild: function (t, e) {
this.$(t).prepend(this.get(e) || e);
return this
},
remove: function (t) {
this.$(H.array(arguments).join(",")).remove();
return this
},
append: function (t) {
var e,
i;
for (e in t) {
if (t.hasOwnProperty(e)) {
if (t[e].constructor === Array) {
for (i = 0; t[e][i]; i++) {
this.appendChild(e, t[e][i])
}
} else {
this.appendChild(e, t[e])
}
}
}
return this
},
_scaleImage: function (e, i) {
e = e || this._controls.getActive();
if (!e) {
return
}
var n,
a = function (e) {
t(e.container).children(":first").css({
top: g.max(0, H.parseValue(e.image.style.top)),
left: g.max(0, H.parseValue(e.image.style.left)),
width: H.parseValue(e.image.width),
height: H.parseValue(e.image.height)
})
};
i = t.extend({
width: this._stageWidth,
height: this._stageHeight,
crop: this._options.imageCrop,
max: this._options.maxScaleRatio,
min: this._options.minScaleRatio,
margin: this._options.imageMargin,
position: this._options.imagePosition,
iframelimit: this._options.maxVideoSize
}, i);
if (this._options.layerFollow && this._options.imageCrop !== true) {
if (typeof i.complete == "function") {
n = i.complete;
i.complete = function () {
n.call(e, e);
a(e)
}
} else {
i.complete = a
}
} else {
t(e.container).children(":first").css({
top: 0,
left: 0
})
}
e.scale(i);
return this
},
updateCarousel: function () {
this._carousel.update();
return this
},
resize: function (e, i) {
if (typeof e == "function") {
i = e;
e = n
}
e = t.extend({
width: 0,
height: 0
}, e);
var a = this,
o = this.$("container");
t.each(e, function (t, i) {
if (!i) {
o[t]("auto");
e[t] = a._getWH()[t]
}
});
t.each(e, function (t, e) {
o[t](e)
});
return this.rescale(i)
},
rescale: function (e, a, o) {
var r = this;
if (typeof e === "function") {
o = e;
e = n
}
var s = function () {
r._stageWidth = e || r.$("stage").width();
r._stageHeight = a || r.$("stage").height();
if (r._options.swipe) {
t.each(r._controls.slides, function (e, i) {
r._scaleImage(i);
t(i.container).css("left", r._stageWidth * e)
});
r.$("images").css("width", r._stageWidth * r.getDataLength())
} else {
r._scaleImage()
}
if (r._options.carousel) {
r.updateCarousel()
}
r._controls.frames[r._controls.active].scale({
width: r._stageWidth,
height: r._stageHeight,
iframelimit: r._options.maxVideoSize
});
r.trigger(i.RESCALE);
if (typeof o === "function") {
o.call(r)
}
};
s.call(r);
return this
},
refreshImage: function () {
this._scaleImage();
if (this._options.imagePan) {
this.addPan()
}
return this
},
show: function (n, a, o) {
var r = this._options.swipe;
if (!r && (this._queue.length > 3 || n === false || !this._options.queue && this._queue.stalled)) {
return
}
n = g.max(0, g.min(parseInt(n, 10), this.getDataLength() - 1));
a = typeof a !== "undefined" ? !!a : n < this.getIndex();
o = o || false;
if (!o && i.History) {
i.History.set(n.toString());
return
}
if (this.finger && n !== this._active) {
this.finger.to = - (n * this.finger.width);
this.finger.index = n
}
this._active = n;
if (r) {
var l = this.getData(n),
c = this;
if (!l) {
return
}
var h = this.isFullscreen() && l.big ? l.big : l.image || l.iframe,
u = this._controls.slides[n],
f = u.isCached(h),
d = this._thumbnails[n];
var p = {
cached: f,
index: n,
rewind: a,
imageTarget: u.image,
thumbTarget: d.image,
galleriaData: l
};
this.trigger(t.extend(p, {
type: i.LOADSTART
}));
t(c._thumbnails[n].container).addClass("active").siblings(".active").removeClass("active");
c.$("container").removeClass("videoplay");
var m = function () {
c._layers[n].innerHTML = c.getData().layer || "";
c.trigger(t.extend(p, {
type: i.LOADFINISH
}));
c._playCheck()
};
e.setTimeout(function () {
if (!u.ready) {
if (l.iframe && !l.image) {
u.isIframe = true
}
u.load(h, function (e) {
c._scaleImage(e, m).trigger(t.extend(p, {
type: i.IMAGE
}));
m()
})
} else {
c.trigger(t.extend(p, {
type: i.IMAGE
}));
m()
}
}, 100)
} else {
s.push.call(this._queue, {
index: n,
rewind: a
});
if (!this._queue.stalled) {
this._show()
}
}
return this
},
_show: function () {
var a = this,
o = this._queue[0],
r = this.getData(o.index);
if (!r) {
return
}
var l = this.isFullscreen() && r.big ? r.big : r.image || r.iframe,
c = this._controls.getActive(),
h = this._controls.getNext(),
u = h.isCached(l),
f = this._thumbnails[o.index],
d = function () {
t(h.image).trigger("mouseup")
};
a.$("container").toggleClass("iframe", !!r.isIframe).removeClass("videoplay");
var p = function (o, r, l, c, h) {
return function () {
var u;
F.active = false;
H.toggleQuality(r.image, a._options.imageQuality);
a._layers[a._controls.active].innerHTML = "";
t(l.container).css({
zIndex: 0,
opacity: 0
}).show();
t(l.container).find("iframe, .galleria-videoicon").remove();
t(a._controls.frames[a._controls.active].container).hide();
t(r.container).css({
zIndex: 1,
left: 0,
top: 0
}).show();
a._controls.swap();
if (a._options.imagePan) {
a.addPan(r.image)
}
if (o.iframe && o.image || o.link || a._options.lightbox || a._options.clicknext) {
t(r.image).css({
cursor: "pointer"
}).on("mouseup", function (r) {
if (typeof r.which == "number" && r.which > 1) {
return
}
if (o.iframe) {
if (a.isPlaying()) {
a.pause()
}
var s = a._controls.frames[a._controls.active],
l = a._stageWidth,
c = a._stageHeight;
t(s.container).css({
width: l,
height: c,
opacity: 0
}).show().animate({
opacity: 1
}, 200);
e.setTimeout(function () {
s.load(o.iframe + (o.video ? "&autoplay=1" : ""), {
width: l,
height: c
}, function (t) {
a.$("container").addClass("videoplay");
t.scale({
width: a._stageWidth,
height: a._stageHeight,
iframelimit: o.video ? a._options.maxVideoSize : n
})
})
}, 100);
return
}
if (a._options.clicknext && !i.TOUCH) {
if (a._options.pauseOnInteraction) {
a.pause()
}
a.next();
return
}
if (o.link) {
if (a._options.popupLinks) {
u = e.open(o.link, "_blank")
} else {
e.location.href = o.link
}
return
}
if (a._options.lightbox) {
a.openLightbox()
}
})
}
a._playCheck();
a.trigger({
type: i.IMAGE,
index: c.index,
imageTarget: r.image,
thumbTarget: h.image,
galleriaData: o
});
s.shift.call(a._queue);
a._queue.stalled = false;
if (a._queue.length) {
a._show()
}
}
}
(r, h, c, o, f);
if (this._options.carousel && this._options.carouselFollow) {
this._carousel.follow(o.index)
}
if (this._options.preload) {
var g,
m,
v = this.getNext(),
y;
try {
for (m = this._options.preload; m > 0; m--) {
g = new i.Picture;
y = a.getData(v);
g.preload(this.isFullscreen() && y.big ? y.big : y.image);
v = a.getNext(v)
}
} catch (_) {}
}
H.show(h.container);
h.isIframe = r.iframe && !r.image;
t(a._thumbnails[o.index].container).addClass("active").siblings(".active").removeClass("active");
a.trigger({
type: i.LOADSTART,
cached: u,
index: o.index,
rewind: o.rewind,
imageTarget: h.image,
thumbTarget: f.image,
galleriaData: r
});
a._queue.stalled = true;
h.load(l, function (e) {
var s = t(a._layers[1 - a._controls.active]).html(r.layer || "").hide();
a._scaleImage(e, {
complete: function (e) {
if ("image" in c) {
H.toggleQuality(c.image, false)
}
H.toggleQuality(e.image, false);
a.removePan();
a.setInfo(o.index);
a.setCounter(o.index);
if (r.layer) {
s.show();
if (r.iframe && r.image || r.link || a._options.lightbox || a._options.clicknext) {
s.css("cursor", "pointer").off("mouseup").mouseup(d)
}
}
if (r.video && r.image) {
O(e.container)
}
var l = a._options.transition;
t.each({
initial: c.image === null,
touch: i.TOUCH,
fullscreen: a.isFullscreen()
}, function (t, e) {
if (e && a._options[t + "Transition"] !== n) {
l = a._options[t + "Transition"];
return false
}
});
if (l in F.effects === false) {
p()
} else {
var h = {
prev: c.container,
next: e.container,
rewind: o.rewind,
speed: a._options.transitionSpeed || 400
};
F.active = true;
F.init.call(a, l, h, p)
}
a.trigger({
type: i.LOADFINISH,
cached: u,
index: o.index,
rewind: o.rewind,
imageTarget: e.image,
thumbTarget: a._thumbnails[o.index].image,
galleriaData: a.getData(o.index)
})
}
})
})
},
getNext: function (t) {
t = typeof t === "number" ? t : this.getIndex();
return t === this.getDataLength() - 1 ? 0 : t + 1
},
getPrev: function (t) {
t = typeof t === "number" ? t : this.getIndex();
return t === 0 ? this.getDataLength() - 1 : t - 1
},
next: function () {
if (this.getDataLength() > 1) {
this.show(this.getNext(), false)
}
return this
},
prev: function () {
if (this.getDataLength() > 1) {
this.show(this.getPrev(), true)
}
return this
},
get: function (t) {
return t in this._dom ? this._dom[t] : null
},
getData: function (t) {
return t in this._data ? this._data[t] : this._data[this._active]
},
getDataLength: function () {
return this._data.length
},
getIndex: function () {
return typeof this._active === "number" ? this._active : false
},
getStageHeight: function () {
return this._stageHeight
},
getStageWidth: function () {
return this._stageWidth
},
getOptions: function (t) {
return typeof t === "undefined" ? this._options : this._options[t]
},
setOptions: function (e, i) {
if (typeof e === "object") {
t.extend(this._options, e)
} else {
this._options[e] = i
}
return this
},
play: function (t) {
this._playing = true;
this._playtime = t || this._playtime;
this._playCheck();
this.trigger(i.PLAY);
return this
},
pause: function () {
this._playing = false;
this.trigger(i.PAUSE);
return this
},
playToggle: function (t) {
return this._playing ? this.pause() : this.play(t)
},
isPlaying: function () {
return this._playing
},
isFullscreen: function () {
return this._fullscreen.active
},
_playCheck: function () {
var t = this,
e = 0,
n = 20,
a = H.timestamp(),
o = "play" + this._id;
if (this._playing) {
this.clearTimer(o);
var r = function () {
e = H.timestamp() - a;
if (e >= t._playtime && t._playing) {
t.clearTimer(o);
t.next();
return
}
if (t._playing) {
t.trigger({
type: i.PROGRESS,
percent: g.ceil(e / t._playtime * 100),
seconds: g.floor(e / 1e3),
milliseconds: e
});
t.addTimer(o, r, n)
}
};
t.addTimer(o, r, n)
}
},
setPlaytime: function (t) {
this._playtime = t;
return this
},
setIndex: function (t) {
this._active = t;
return this
},
setCounter: function (t) {
if (typeof t === "number") {
t++
} else if (typeof t === "undefined") {
t = this.getIndex() + 1
}
this.get("current").innerHTML = t;
if (y) {
var e = this.$("counter"),
i = e.css("opacity");
if (parseInt(i, 10) === 1) {
H.removeAlpha(e[0])
} else {
this.$("counter").css("opacity", i)
}
}
return this
},
setInfo: function (e) {
var i = this,
n = this.getData(e);
t.each(["title", "description"], function (t, e) {
var a = i.$("info-" + e);
if (!!n[e]) {
a[n[e].length ? "show" : "hide"]().html(n[e])
} else {
a.empty().hide()
}
});
return this
},
hasInfo: function (t) {
var e = "title description".split(" "),
i;
for (i = 0; e[i]; i++) {
if (!!this.getData(t)[e[i]]) {
return true
}
}
return false
},
jQuery: function (e) {
var i = this,
n = [];
t.each(e.split(","), function (e, a) {
a = t.trim(a);
if (i.get(a)) {
n.push(a)
}
});
var a = t(i.get(n.shift()));
t.each(n, function (t, e) {
a = a.add(i.get(e))
});
return a
},
$: function (t) {
return this.jQuery.apply(this, H.array(arguments))
}
};
t.each(x, function (t, e) {
var n = /_/.test(e) ? e.replace(/_/g, "") : e;
i[e.toUpperCase()] = "galleria." + n
});
t.extend(i, {
IE9: y === 9,
IE8: y === 8,
IE7: y === 7,
IE6: y === 6,
IE: y,
WEBKIT: /webkit/.test(f),
CHROME: /chrome/.test(f),
SAFARI: /safari/.test(f) && !/chrome/.test(f),
QUIRK: y && a.compatMode && a.compatMode === "BackCompat",
MAC: /mac/.test(navigator.platform.toLowerCase()),
OPERA: !!e.opera,
IPHONE: /iphone/.test(f),
IPAD: /ipad/.test(f),
ANDROID: /android/.test(f),
TOUCH: "ontouchstart" in a
});
i.addTheme = function (n) {
if (!n.name) {
i.raise("No theme name specified")
}
if (typeof n.defaults !== "object") {
n.defaults = {}
} else {
n.defaults = T(n.defaults)
}
var a = false,
o;
if (typeof n.css === "string") {
t("link").each(function (t, e) {
o = new RegExp(n.css);
if (o.test(e.href)) {
a = true;
z(n);
return false
}
});
if (!a) {
t(function () {
var r = 0;
var s = function () {
t("script").each(function (t, i) {
o = new RegExp("galleria\\." + n.name.toLowerCase() + "\\.");
if (o.test(i.src)) {
a = i.src.replace(/[^\/]*$/, "") + n.css;
e.setTimeout(function () {
H.loadCSS(a, "galleria-theme", function () {
z(n)
})
}, 1)
}
});
if (!a) {
if (r++ > 5) {
i.raise("No theme CSS loaded")
} else {
e.setTimeout(s, 500)
}
}
};
s()
})
}
} else {
z(n)
}
return n
};
i.loadTheme = function (n, a) {
if (t("script").filter(function () {
return t(this).attr("src") == n
}).length) {
return
}
var o = false,
r;
t(e).load(function () {
if (!o) {
r = e.setTimeout(function () {
if (!o && !i.theme) {
i.raise("Galleria had problems loading theme at " + n + ". Please check theme path or load manually.", true)
}
}, 2e4)
}
});
i.unloadTheme();
H.loadScript(n, function () {
o = true;
e.clearTimeout(r)
});
return i
};
i.unloadTheme = function () {
if (typeof i.theme == "object") {
t("script").each(function (e, n) {
if (new RegExp("galleria\\." + i.theme.name + "\\.").test(n.src)) {
t(n).remove()
}
});
i.theme = n
}
return i
};
i.get = function (t) {
if (!!$[t]) {
return $[t]
} else if (typeof t !== "number") {
return $
} else {
i.raise("Gallery index " + t + " not found")
}
};
i.configure = function (e, n) {
var a = {};
if (typeof e == "string" && n) {
a[e] = n;
e = a
} else {
t.extend(a, e)
}
i.configure.options = a;
t.each(i.get(), function (t, e) {
e.setOptions(a)
});
return i
};
i.configure.options = {};
i.on = function (e, n) {
if (!e) {
return
}
n = n || m;
var a = e + n.toString().replace(/\s/g, "") + H.timestamp();
t.each(i.get(), function (t, i) {
i._binds.push(a);
i.bind(e, n)
});
i.on.binds.push({
type: e,
callback: n,
hash: a
});
return i
};
i.on.binds = [];
i.run = function (e, n) {
if (t.isFunction(n)) {
n = {
extend: n
}
}
t(e || "#galleria").galleria(n);
return i
};
i.addTransition = function (t, e) {
F.effects[t] = e;
return i
};
i.utils = H;
i.log = function () {
var i = H.array(arguments);
if ("console" in e && "log" in e.console) {
try {
return e.console.log.apply(e.console, i)
} catch (n) {
t.each(i, function () {
e.console.log(this)
})
}
} else {
return e.alert(i.join("<br>"))
}
};
i.ready = function (e) {
if (typeof e != "function") {
return i
}
t.each(E, function (t, i) {
e.call(i, i._options)
});
i.ready.callbacks.push(e);
return i
};
i.ready.callbacks = [];
i.raise = function (e, i) {
var n = i ? "Fatal error" : "Error",
a = {
color: "#fff",
position: "absolute",
top: 0,
left: 0,
zIndex: 1e5
},
o = function (e) {
var o = '<div style="padding:4px;margin:0 0 2px;background:#' + (i ? "811" : "222") + ';">' + (i ? "<strong>" + n + ": </strong>" : "") + e + "</div>";
t.each($, function () {
var t = this.$("errors"),
e = this.$("target");
if (!t.length) {
e.css("position", "relative");
t = this.addElement("errors").appendChild("target", "errors").$("errors").css(a)
}
t.append(o)
});
if (!$.length) {
t("<div>").css(t.extend(a, {
position: "fixed"
})).append(o).appendTo(_().body)
}
};
if (c) {
o(e);
if (i) {
throw new Error(n + ": " + e)
}
} else if (i) {
if (D) {
return
}
D = true;
i = false;
o("Gallery could not load.")
}
};
i.version = l;
i.requires = function (t, e) {
e = e || "You need to upgrade Galleria to version " + t + " to use one or more components.";
if (i.version < t) {
i.raise(e, true)
}
return i
};
i.Picture = function (e) {
this.id = e || null;
this.image = null;
this.container = H.create("galleria-image");
t(this.container).css({
overflow: "hidden",
position: "relative"
});
this.original = {
width: 0,
height: 0
};
this.ready = false;
this.isIframe = false
};
i.Picture.prototype = {
cache: {},
show: function () {
H.show(this.image)
},
hide: function () {
H.moveOut(this.image)
},
clear: function () {
this.image = null
},
isCached: function (t) {
return !!this.cache[t]
},
preload: function (e) {
t(new Image).load(function (t, e) {
return function () {
e[t] = t
}
}
(e, this.cache)).attr("src", e)
},
load: function (n, a, o) {
if (typeof a == "function") {
o = a;
a = null
}
if (this.isIframe) {
var r = "if" + (new Date).getTime();
var s = this.image = t("<iframe>", {
src: n,
frameborder: 0,
id: r,
allowfullscreen: true,
css: {
visibility: "hidden"
}
})[0];
if (a) {
t(s).css(a)
}
t(this.container).find("iframe,img").remove();
this.container.appendChild(this.image);
t("#" + r).load(function (i, n) {
return function () {
e.setTimeout(function () {
t(i.image).css("visibility", "visible");
if (typeof n == "function") {
n.call(i, i)
}
}, 10)
}
}
(this, o));
return this.container
}
this.image = new Image;
if (i.IE8) {
t(this.image).css("filter", "inherit")
}
var l = false,
c = false,
h = t(this.container),
f = t(this.image),
d = function () {
if (!l) {
l = true;
e.setTimeout(function (t, e) {
return function () {
t.attr("src", e + (e.indexOf("?") > -1 ? "&" : "?") + H.timestamp())
}
}
(t(this), n), 50)
} else {
if (u) {
t(this).attr("src", u)
} else {
i.raise("Image not found: " + n)
}
}
},
p = function (n, o, r) {
return function () {
var s = function () {
t(this).off("load");
n.original = a || {
height: this.height,
width: this.width
};
if (i.HAS3D) {
this.style.MozTransform = this.style.webkitTransform = "translate3d(0,0,0)"
}
h.append(this);
n.cache[r] = r;
if (typeof o == "function") {
e.setTimeout(function () {
o.call(n, n)
}, 1)
}
};
if (!this.width || !this.height) {
!function (e) {
H.wait({
until: function () {
return e.width && e.height
},
success: function () {
s.call(e)
},
error: function () {
if (!c) {
t(new Image).load(p).attr("src", e.src);
c = true
} else {
i.raise("Could not extract width/height from image: " + e.src + ". Traced measures: width:" + e.width + "px, height: " + e.height + "px.")
}
},
timeout: 100
})
}
(this)
} else {
s.call(this)
}
}
}
(this, o, n);
h.find("iframe,img").remove();
f.css("display", "block");
H.hide(this.image);
t.each("minWidth minHeight maxWidth maxHeight".split(" "), function (t, e) {
f.css(e, /min/.test(e) ? "0" : "none")
});
f.load(p).on("error", d).attr("src", n);
return this.container
},
scale: function (e) {
var a = this;
e = t.extend({
width: 0,
height: 0,
min: n,
max: n,
margin: 0,
complete: m,
position: "center",
crop: false,
canvas: false,
iframelimit: n
}, e);
if (this.isIframe) {
var o = e.width,
r = e.height,
s,
l;
if (e.iframelimit) {
var c = g.min(e.iframelimit / o, e.iframelimit / r);
if (c < 1) {
s = o * c;
l = r * c;
t(this.image).css({
top: r / 2 - l / 2,
left: o / 2 - s / 2,
position: "absolute"
})
} else {
t(this.image).css({
top: 0,
left: 0
})
}
}
t(this.image).width(s || o).height(l || r).removeAttr("width").removeAttr("height");
t(this.container).width(o).height(r);
e.complete.call(a, a);
try {
if (this.image.contentWindow) {
t(this.image.contentWindow).trigger("resize")
}
} catch (h) {}
return this.container
}
if (!this.image) {
return this.container
}
var u,
f,
d = t(a.container),
p;
H.wait({
until: function () {
u = e.width || d.width() || H.parseValue(d.css("width"));
f = e.height || d.height() || H.parseValue(d.css("height"));
return u && f
},
success: function () {
var i = (u - e.margin * 2) / a.original.width,
n = (f - e.margin * 2) / a.original.height,
o = g.min(i, n),
r = g.max(i, n),
s = {
"true": r,
width: i,
height: n,
"false": o,
landscape: a.original.width > a.original.height ? r : o,
portrait: a.original.width < a.original.height ? r : o
},
l = s[e.crop.toString()],
c = "";
if (e.max) {
l = g.min(e.max, l)
}
if (e.min) {
l = g.max(e.min, l)
}
t.each(["width", "height"], function (e, i) {
t(a.image)[i](a[i] = a.image[i] = g.round(a.original[i] * l))
});
t(a.container).width(u).height(f);
if (e.canvas && L) {
L.elem.width = a.width;
L.elem.height = a.height;
c = a.image.src + ":" + a.width + "x" + a.height;
a.image.src = L.cache[c] || function (t) {
L.context.drawImage(a.image, 0, 0, a.original.width * l, a.original.height * l);
try {
p = L.elem.toDataURL();
L.length += p.length;
L.cache[t] = p;
return p
} catch (e) {
return a.image.src
}
}
(c)
}
var h = {},
d = {},
m = function (e, i, n) {
var o = 0;
if (/\%/.test(e)) {
var r = parseInt(e, 10) / 100,
s = a.image[i] || t(a.image)[i]();
o = g.ceil(s * -1 * r + n * r)
} else {
o = H.parseValue(e)
}
return o
},
v = {
top: {
top: 0
},
left: {
left: 0
},
right: {
left: "100%"
},
bottom: {
top: "100%"
}
};
t.each(e.position.toLowerCase().split(" "), function (t, e) {
if (e === "center") {
e = "50%"
}
h[t ? "top" : "left"] = e
});
t.each(h, function (e, i) {
if (v.hasOwnProperty(i)) {
t.extend(d, v[i])
}
});
h = h.top ? t.extend(h, d) : d;
h = t.extend({
top: "50%",
left: "50%"
}, h);
t(a.image).css({
position: "absolute",
top: m(h.top, "height", f),
left: m(h.left, "width", u)
});
a.show();
a.ready = true;
e.complete.call(a, a)
},
error: function () {
i.raise("Could not scale image: " + a.image.src)
},
timeout: 1e3
});
return this
}
};
t.extend(t.easing, {
galleria: function (t, e, i, n, a) {
if ((e /= a / 2) < 1) {
return n / 2 * e * e * e + i
}
return n / 2 * ((e -= 2) * e * e + 2) + i
},
galleriaIn: function (t, e, i, n, a) {
return n * (e /= a) * e + i
},
galleriaOut: function (t, e, i, n, a) {
return -n * (e /= a) * (e - 2) + i
}
});
i.Finger = function () {
var n = g.abs;
var r = i.HAS3D = function () {
var e = a.createElement("p"),
i,
n = ["webkit", "O", "ms", "Moz", ""],
o,
r = 0,
s = "transform";
_().html.insertBefore(e, null);
for (; n[r]; r++) {
o = n[r] ? n[r] + "Transform" : s;
if (e.style[o] !== undefined) {
e.style[o] = "translate3d(1px,1px,1px)";
i = t(e).css(n[r] ? "-" + n[r].toLowerCase() + "-" + s : s)
}
}
_().html.removeChild(e);
return i !== undefined && i.length > 0 && i !== "none"
}
();
var s = function () {
var t = "RequestAnimationFrame";
return e.requestAnimationFrame || e["webkit" + t] || e["moz" + t] || e["o" + t] || e["ms" + t] || function (t) {
e.setTimeout(t, 1e3 / 60)
}
}
();
var l = function (i, n) {
this.config = {
start: 0,
duration: 500,
onchange: function () {},
oncomplete: function () {},
easing: function (t, e, i, n, a) {
return -n * ((e = e / a - 1) * e * e * e - 1) + i
}
};
this.easeout = function (t, e, i, n, a) {
return n * ((e = e / a - 1) * e * e * e * e + 1) + i
};
if (!i.children.length) {
return
}
var a = this;
t.extend(this.config, n);
this.elem = i;
this.child = i.children[0];
this.to = this.pos = 0;
this.touching = false;
this.start = {};
this.index = this.config.start;
this.anim = 0;
this.easing = this.config.easing;
if (!r) {
this.child.style.position = "absolute";
this.elem.style.position = "relative"
}
t.each(["ontouchstart", "ontouchmove", "ontouchend", "setup"], function (t, e) {
a[e] = function (t) {
return function () {
t.apply(a, arguments)
}
}
(a[e])
});
this.setX = function () {
var t = a.child.style;
if (!r) {
t.left = a.pos + "px";
return
}
t.MozTransform = t.webkitTransform = "translate3d(" + a.pos + "px,0,0)";
return
};
t(i).on("touchstart", this.ontouchstart);
t(e).on("resize", this.setup);
t(e).on("orientationchange", this.setup);
this.setup();
!function o() {
s(o);
a.loop.call(a)
}
()
};
l.prototype = {
constructor: l,
setup: function () {
this.width = t(this.elem).width();
this.length = g.ceil(t(this.child).width() / this.width);
if (this.index !== 0) {
this.index = g.max(0, g.min(this.index, this.length - 1));
this.pos = this.to = -this.width * this.index
}
},
setPosition: function (t) {
this.pos = t;
this.to = t
},
ontouchstart: function (t) {
var e = t.originalEvent.touches;
this.start = {
pageX: e[0].pageX,
pageY: e[0].pageY,
time: +new Date
};
this.isScrolling = null;
this.touching = true;
this.deltaX = 0;
o.on("touchmove", this.ontouchmove);
o.on("touchend", this.ontouchend)
},
ontouchmove: function (t) {
var e = t.originalEvent.touches;
if (e && e.length > 1 || t.scale && t.scale !== 1) {
return
}
this.deltaX = e[0].pageX - this.start.pageX;
if (this.isScrolling === null) {
this.isScrolling = !!(this.isScrolling || g.abs(this.deltaX) < g.abs(e[0].pageY - this.start.pageY))
}
if (!this.isScrolling) {
t.preventDefault();
this.deltaX /= !this.index && this.deltaX > 0 || this.index == this.length - 1 && this.deltaX < 0 ? g.abs(this.deltaX) / this.width + 1.8 : 1;
this.to = this.deltaX - this.index * this.width
}
t.stopPropagation()
},
ontouchend: function (t) {
this.touching = false;
var e = +new Date - this.start.time < 250 && g.abs(this.deltaX) > 40 || g.abs(this.deltaX) > this.width / 2,
i = !this.index && this.deltaX > 0 || this.index == this.length - 1 && this.deltaX < 0;
if (!this.isScrolling) {
this.show(this.index + (e && !i ? this.deltaX < 0 ? 1 : -1 : 0))
}
o.off("touchmove", this.ontouchmove);
o.off("touchend", this.ontouchend)
},
show: function (t) {
if (t != this.index) {
this.config.onchange.call(this, t)
} else {
this.to = - (t * this.width)
}
},
moveTo: function (t) {
if (t != this.index) {
this.pos = this.to = - (t * this.width);
this.index = t
}
},
loop: function () {
var t = this.to - this.pos,
e = 1;
if (this.width && t) {
e = g.max(.5, g.min(1.5, g.abs(t / this.width)))
}
if (this.touching || g.abs(t) <= 1) {
this.pos = this.to;
t = 0;
if (this.anim && !this.touching) {
this.config.oncomplete(this.index)
}
this.anim = 0;
this.easing = this.config.easing
} else {
if (!this.anim) {
this.anim = {
start: this.pos,
time: +new Date,
distance: t,
factor: e,
destination: this.to
}
}
if (this.anim.destination != this.to) {
this.anim = 0;
this.easing = this.easeout;
return
}
this.pos = this.easing(null, +new Date - this.anim.time, this.anim.start, this.anim.distance, this.config.duration * this.anim.factor)
}
this.setX()
}
};
return l
}
();
t.fn.galleria = function (e) {
var n = this.selector;
if (!t(this).length) {
t(function () {
if (t(n).length) {
t(n).galleria(e)
} else {
i.utils.wait({
until: function () {
return t(n).length
},
success: function () {
t(n).galleria(e)
},
error: function () {
i.raise('Init failed: Galleria could not find the element "' + n + '".')
},
timeout: 5e3
})
}
});
return this
}
return this.each(function () {
if (t.data(this, "galleria")) {
t.data(this, "galleria").destroy();
t(this).find("*").hide()
}
t.data(this, "galleria", (new i).init(this, e))
})
};
if (typeof module === "object" && module && typeof module.exports === "object") {
module.exports = i
} else {
e.Galleria = i;
if (typeof define === "function" && define.amd) {
define("galleria", ["jquery"], function () {
return i
})
}
}
}
(jQuery, this);
(function ($) {
Galleria.addTheme({
name: 'classic',
author: 'Galleria',
defaults: {
transition: 'slide',
thumbCrop: 'height',
_toggleInfo: true
},
init: function (options) {
this.attachKeyboard({
right: this.next,
left: this.prev
});
this.addElement('info-link', 'info-close');
this.append({
'info': ['info-link', 'info-close']
});
var info = this.$('info-link,info-close,info-text'),
touch = Galleria.TOUCH,
click = touch ? 'touchstart' : 'click';
this.$('loader,counter').show().css('opacity', 0.4);
if (!touch) {
this.addIdleState(this.get('image-nav-left'), {
left: -50
});
this.addIdleState(this.get('image-nav-right'), {
right: -50
});
this.addIdleState(this.get('counter'), {
opacity: 0
});
}
if (options._toggleInfo === true) {
info.bind(click, function () {
info.toggle();
});
} else {
info.show();
this.$('info-link, info-close').hide();
}
this.bind('thumbnail', function (e) {
if (!touch) {
$(e.thumbTarget).css('opacity', 0.6).parent().hover(function () {
$(this).not('.active').children().stop().fadeTo(100, 1);
}, function () {
$(this).not('.active').children().stop().fadeTo(400, 0.6);
});
if (e.index === this.getIndex()) {
$(e.thumbTarget).css('opacity', 1);
}
} else {
$(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6);
}
});
this.bind('loadstart', function (e) {
if (!e.cached) {
this.$('loader').show().fadeTo(200, 0.4);
}
this.$('info').toggle(this.hasInfo());
$(e.thumbTarget).css('opacity', 1).parent().siblings().children().css('opacity', 0.6);
});
this.bind('loadfinish', function (e) {
this.$('loader').fadeOut(200);
});
}
});
}
(jQuery));
!function (t, r, e, n) {
function s(r, e) {
return Math[e].apply(null, t.map(r, function (t) {
return t[o]
}))
}
function a(t) {
return t[o] >= g[o] || t[o] === d
}
function c(t) {
return t[o] === d
}
function i(n) {
var i = n.attr(u.srcsetAttr);
if (!i)
return !1;
var l = t.map(i.split(","), function (t) {
return {
url: x.exec(t)[1],
w: parseFloat((f.exec(t) || p)[1]),
h: parseFloat((w.exec(t) || p)[1]),
x: parseFloat((h.exec(t) || m)[1])
}
});
if (!l.length)
return !1;
var A,
v,
E = e.documentElement;
g = {
w: r.innerWidth || E.clientWidth,
h: r.innerHeight || E.clientHeight,
x: r.devicePixelRatio || 1
};
for (A in g)
o = A, d = s(l, "max"), l = t.grep(l, a);
for (A in g)
o = A, d = s(l, "min"), l = t.grep(l, c);
return v = l[0].url,
u.srcsetExtended && (v = (n.attr(u.srcsetBaseAttr) || "") + v + (n.attr(u.srcsetExtAttr) || "")),
v
}
var o,
d,
u = t.lazyLoadXT,
l = function () {
return "srcset" in new Image
}
(),
x = /^\s*(\S*)/,
f = /\S\s+(\d+)w/,
w = /\S\s+(\d+)h/,
h = /\S\s+([\d\.]+)x/,
p = [0, 1 / 0],
m = [0, 1],
A = {
srcsetAttr: "data-srcset",
srcsetExtended: !1,
srcsetBaseAttr: "data-srcset-base",
srcsetExtAttr: "data-srcset-ext"
},
g = {
w: 0,
h: 0,
x: 0
};
for (o in A)
u[o] === n && (u[o] = A[o]);
u.selector += ",img[" + u.srcsetAttr + "]",
t(e).on("lazyshow", "img", function (t, r) {
var e = r.attr(u.srcsetAttr);
e && (!u.srcsetExtended && l ? (r.attr("srcset", e), r.attr("data-srcset", "")) : r.lazyLoadXT.srcAttr = i)
})
}
(window.jQuery || window.Zepto || window.$, window, document);
var a3_lazyload_extend_params = {
"edgeY": "0"
};
var a3_lazyload_extend_params = {
"edgeY": "0"
};
jQuery.lazyLoadXT.updateEvent = 'load orientationchange resize scroll touchmove focus click customlazyloadxtevent';
jQuery.lazyLoadXT.edgeY = a3_lazyload_extend_params.edgeY;
jQuery(document).ready(function ($) {
jQuery(document).on('mouseenter', '.site-header-cart', function () {
jQuery(document).trigger('customlazyloadxtevent');
});
jQuery(document).on('mouseenter', '.widget_shopping_cart', function () {
jQuery(document).trigger('customlazyloadxtevent');
});
});
jQuery(window).on('ajaxComplete', function () {
setTimeout(function () {
jQuery(window).lazyLoadXT();
}, 1000);
});
!function (a, b) {
"use strict";
function c() {
if (!e) {
e = !0;
var a,
c,
d,
f,
g = -1 !== navigator.appVersion.indexOf("MSIE 10"),
h = !!navigator.userAgent.match(/Trident.*rv:11\./),
i = b.querySelectorAll("iframe.wp-embedded-content");
for (c = 0; c < i.length; c++) {
if (d = i[c], !d.getAttribute("data-secret"))
f = Math.random().toString(36).substr(2, 10), d.src += "#?secret=" + f, d.setAttribute("data-secret", f);
if (g || h)
a = d.cloneNode(!0), a.removeAttribute("security"), d.parentNode.replaceChild(a, d)
}
}
}
var d = !1,
e = !1;
if (b.querySelector)
if (a.addEventListener)
d = !0;
if (a.wp = a.wp || {}, !a.wp.receiveEmbedMessage)
if (a.wp.receiveEmbedMessage = function (c) {
var d = c.data;
if (d.secret || d.message || d.value)
if (!/[^a-zA-Z0-9]/.test(d.secret)) {
var e,
f,
g,
h,
i,
j = b.querySelectorAll('iframe[data-secret="' + d.secret + '"]'),
k = b.querySelectorAll('blockquote[data-secret="' + d.secret + '"]');
for (e = 0; e < k.length; e++)
k[e].style.display = "none";
for (e = 0; e < j.length; e++)
if (f = j[e], c.source === f.contentWindow) {
if (f.removeAttribute("style"), "height" === d.message) {
if (g = parseInt(d.value, 10), g > 1e3)
g = 1e3;
else if (~~g < 200)
g = 200;
f.height = g
}
if ("link" === d.message)
if (h = b.createElement("a"), i = b.createElement("a"), h.href = f.getAttribute("src"), i.href = d.value, i.host === h.host)
if (b.activeElement === f)
a.top.location.href = d.value
} else ;
}
}, d)
a.addEventListener("message", a.wp.receiveEmbedMessage, !1), b.addEventListener("DOMContentLoaded", c, !1), a.addEventListener("load", c, !1)
}
(window, document);
(function ($) {
$.fn.validationEngineLanguage = function () {};
$.validationEngineLanguage = {
newLang: function () {
$.validationEngineLanguage.allRules = {
"required": {
"regex": "none",
"alertText": "* This field is required",
"alertTextCheckboxMultiple": "* Please select an option",
"alertTextCheckboxe": "* This checkbox is required",
"alertTextDateRange": "* Both date range fields are required"
},
"requiredInFunction": {
"func": function (field, rules, i, options) {
return (field.val() == "test") ? true : false;
},
"alertText": "* Field must equal test"
},
"dateRange": {
"regex": "none",
"alertText": "* Invalid ",
"alertText2": "Date Range"
},
"dateTimeRange": {
"regex": "none",
"alertText": "* Invalid ",
"alertText2": "Date Time Range"
},
"minSize": {
"regex": "none",
"alertText": "* Minimum ",
"alertText2": " characters required"
},
"maxSize": {
"regex": "none",
"alertText": "* Maximum ",
"alertText2": " characters allowed"
},
"groupRequired": {
"regex": "none",
"alertText": "* You must fill one of the following fields",
"alertTextCheckboxMultiple": "* Please select an option",
"alertTextCheckboxe": "* This checkbox is required"
},
"min": {
"regex": "none",
"alertText": "* Minimum value is "
},
"max": {
"regex": "none",
"alertText": "* Maximum value is "
},
"past": {
"regex": "none",
"alertText": "* Date prior to "
},
"future": {
"regex": "none",
"alertText": "* Date past "
},
"maxCheckbox": {
"regex": "none",
"alertText": "* Maximum ",
"alertText2": " options allowed"
},
"minCheckbox": {
"regex": "none",
"alertText": "* Please select ",
"alertText2": " options"
},
"equals": {
"regex": "none",
"alertText": "* Fields do not match"
},
"creditCard": {
"regex": "none",
"alertText": "* Invalid credit card number"
},
"phone": {
"regex": /^([\+][0-9]{1,3}([ \.\-])?)?([\(][0-9]{1,6}[\)])?([0-9 \.\-]{1,32})(([A-Za-z \:]{1,11})?[0-9]{1,4}?)$/,
"alertText": "* Invalid phone number"
},
"email": {
"regex": /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
"alertText": "* Invalid email address"
},
"fullname": {
"regex": /^([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]*)+[ ]([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]+)+$/,
"alertText": "* Must be first and last name"
},
"zip": {
"regex": /^\d{5}$|^\d{5}-\d{4}$/,
"alertText": "* Invalid zip format"
},
"integer": {
"regex": /^[\-\+]?\d+$/,
"alertText": "* Not a valid integer"
},
"number": {
"regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
"alertText": "* Invalid floating decimal number"
},
"date": {
"func": function (field) {
var pattern = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/);
var match = pattern.exec(field.val());
if (match == null)
return false;
var year = match[1];
var month = match[2] * 1;
var day = match[3] * 1;
var date = new Date(year, month - 1, day);
return (date.getFullYear() == year && date.getMonth() == (month - 1) && date.getDate() == day);
},
"alertText": "* Invalid date, must be in YYYY-MM-DD format"
},
"ipv4": {
"regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
"alertText": "* Invalid IP address"
},
"url": {
"regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
"alertText": "* Invalid URL"
},
"onlyNumberSp": {
"regex": /^[0-9\ ]+$/,
"alertText": "* Numbers only"
},
"onlyLetterSp": {
"regex": /^[a-zA-Z\ \']+$/,
"alertText": "* Letters only"
},
"onlyLetterAccentSp": {
"regex": /^[a-z\u00C0-\u017F\ ]+$/i,
"alertText": "* Letters only (accents allowed)"
},
"onlyLetterNumber": {
"regex": /^[0-9a-zA-Z]+$/,
"alertText": "* No special characters allowed"
},
"ajaxUserCall": {
"url": "ajaxValidateFieldUser",
"extraData": "name=eric",
"alertText": "* This user is already taken",
"alertTextLoad": "* Validating, please wait"
},
"ajaxUserCallPhp": {
"url": "phpajax/ajaxValidateFieldUser.php",
"extraData": "name=eric",
"alertTextOk": "* This username is available",
"alertText": "* This user is already taken",
"alertTextLoad": "* Validating, please wait"
},
"ajaxNameCall": {
"url": "ajaxValidateFieldName",
"alertText": "* This name is already taken",
"alertTextOk": "* This name is available",
"alertTextLoad": "* Validating, please wait"
},
"ajaxNameCallPhp": {
"url": "phpajax/ajaxValidateFieldName.php",
"alertText": "* This name is already taken",
"alertTextLoad": "* Validating, please wait"
},
"validate2fields": {
"alertText": "* Please input HELLO"
},
"dateFormat": {
"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
"alertText": "* Invalid Date"
},
"dateTimeFormat": {
"regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
"alertText": "* Invalid Date or Date Format",
"alertText2": "Expected Format: ",
"alertText3": "mm/dd/yyyy hh:mm:ss AM|PM or ",
"alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
}
};
}
};
$.validationEngineLanguage.newLang();
})(jQuery);
(function ($) {
"use strict";
var methods = {
init: function (options) {
var form = this;
if (!form.data('jqv') || form.data('jqv') == null) {
options = methods._saveOptions(form, options);
$(document).on("click", ".formError", function () {
$(this).fadeOut(150, function () {
$(this).parent('.formErrorOuter').remove();
$(this).remove();
});
});
}
return this;
},
attach: function (userOptions) {
var form = this;
var options;
if (userOptions)
options = methods._saveOptions(form, userOptions);
else
options = form.data('jqv');
options.validateAttribute = (form.find("[data-validation-engine*=validate]").length) ? "data-validation-engine" : "class";
if (options.binded) {
form.on(options.validationEventTrigger, "[" + options.validateAttribute + "*=validate]:not([type=checkbox]):not([type=radio]):not(.datepicker)", methods._onFieldEvent);
form.on("click", "[" + options.validateAttribute + "*=validate][type=checkbox],[" + options.validateAttribute + "*=validate][type=radio]", methods._onFieldEvent);
form.on(options.validationEventTrigger, "[" + options.validateAttribute + "*=validate][class*=datepicker]", {
"delay": 300
}, methods._onFieldEvent);
}
if (options.autoPositionUpdate) {
$(window).bind("resize", {
"noAnimation": true,
"formElem": form
}, methods.updatePromptsPosition);
}
form.on("click", "a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']", methods._submitButtonClick);
form.removeData('jqv_submitButton');
form.on("submit", methods._onSubmitEvent);
return this;
},
detach: function () {
var form = this;
var options = form.data('jqv');
form.find("[" + options.validateAttribute + "*=validate]").not("[type=checkbox]").off(options.validationEventTrigger, methods._onFieldEvent);
form.find("[" + options.validateAttribute + "*=validate][type=checkbox],[class*=validate][type=radio]").off("click", methods._onFieldEvent);
form.off("submit", methods.onAjaxFormComplete);
form.off("submit", methods.onAjaxFormComplete);
form.removeData('jqv');
form.off("click", "a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']", methods._submitButtonClick);
form.removeData('jqv_submitButton');
if (options.autoPositionUpdate)
$(window).unbind("resize", methods.updatePromptsPosition);
return this;
},
validate: function () {
var element = $(this);
var valid = null;
if (element.is("form") || element.hasClass("validationEngineContainer")) {
if (element.hasClass('validating')) {
return false;
} else {
element.addClass('validating');
var options = element.data('jqv');
var valid = methods._validateFields(this);
setTimeout(function () {
element.removeClass('validating');
}, 100);
if (valid && options.onSuccess) {
options.onSuccess();
} else if (!valid && options.onFailure) {
options.onFailure();
}
}
} else if (element.is('form') || element.hasClass('validationEngineContainer')) {
element.removeClass('validating');
} else {
var form = element.closest('form, .validationEngineContainer'),
options = (form.data('jqv')) ? form.data('jqv') : $.validationEngine.defaults,
valid = methods._validateField(element, options);
if (valid && options.onFieldSuccess)
options.onFieldSuccess();
else if (options.onFieldFailure && options.InvalidFields.length > 0) {
options.onFieldFailure();
}
}
if (options.onValidationComplete) {
return !!options.onValidationComplete(form, valid);
}
return valid;
},
updatePromptsPosition: function (event) {
if (event && this == window) {
var form = event.data.formElem;
var noAnimation = event.data.noAnimation;
} else
var form = $(this.closest('form, .validationEngineContainer'));
var options = form.data('jqv');
form.find('[' + options.validateAttribute + '*=validate]').not(":disabled").each(function () {
var field = $(this);
if (options.prettySelect && field.is(":hidden"))
field = form.find("#" + options.usePrefix + field.attr('id') + options.useSuffix);
var prompt = methods._getPrompt(field);
var promptText = $(prompt).find(".formErrorContent").html();
if (prompt)
methods._updatePrompt(field, $(prompt), promptText, undefined, false, options, noAnimation);
});
return this;
},
showPrompt: function (promptText, type, promptPosition, showArrow) {
var form = this.closest('form, .validationEngineContainer');
var options = form.data('jqv');
if (!options)
options = methods._saveOptions(this, options);
if (promptPosition)
options.promptPosition = promptPosition;
options.showArrow = showArrow == true;
methods._showPrompt(this, promptText, type, false, options);
return this;
},
hide: function () {
var form = $(this).closest('form, .validationEngineContainer');
var options = form.data('jqv');
var fadeDuration = (options && options.fadeDuration) ? options.fadeDuration : 0.3;
var closingtag;
if ($(this).is("form") || $(this).hasClass("validationEngineContainer")) {
closingtag = "parentForm" + methods._getClassName($(this).attr("id"));
} else {
closingtag = methods._getClassName($(this).attr("id")) + "formError";
}
$('.' + closingtag).fadeTo(fadeDuration, 0.3, function () {
$(this).parent('.formErrorOuter').remove();
$(this).remove();
});
return this;
},
hideAll: function () {
var form = this;
var options = form.data('jqv');
var duration = options ? options.fadeDuration : 300;
$('.formError').fadeTo(duration, 300, function () {
$(this).parent('.formErrorOuter').remove();
$(this).remove();
});
return this;
},
_onFieldEvent: function (event) {
var field = $(this);
var form = field.closest('form, .validationEngineContainer');
var options = form.data('jqv');
options.eventTrigger = "field";
window.setTimeout(function () {
methods._validateField(field, options);
if (options.InvalidFields.length == 0 && options.onFieldSuccess) {
options.onFieldSuccess();
} else if (options.InvalidFields.length > 0 && options.onFieldFailure) {
options.onFieldFailure();
}
}, (event.data) ? event.data.delay : 0);
},
_onSubmitEvent: function () {
var form = $(this);
var options = form.data('jqv');
if (form.data("jqv_submitButton")) {
var submitButton = $("#" + form.data("jqv_submitButton"));
if (submitButton) {
if (submitButton.length > 0) {
if (submitButton.hasClass("validate-skip") || submitButton.attr("data-validation-engine-skip") == "true")
return true;
}
}
}
options.eventTrigger = "submit";
var r = methods._validateFields(form);
if (r && options.ajaxFormValidation) {
methods._validateFormWithAjax(form, options);
return false;
}
if (options.onValidationComplete) {
return !!options.onValidationComplete(form, r);
}
return r;
},
_checkAjaxStatus: function (options) {
var status = true;
$.each(options.ajaxValidCache, function (key, value) {
if (!value) {
status = false;
return false;
}
});
return status;
},
_checkAjaxFieldStatus: function (fieldid, options) {
return options.ajaxValidCache[fieldid] == true;
},
_validateFields: function (form) {
var options = form.data('jqv');
var errorFound = false;
form.trigger("jqv.form.validating");
var first_err = null;
form.find('[' + options.validateAttribute + '*=validate]').not(":disabled").each(function () {
var field = $(this);
var names = [];
if ($.inArray(field.attr('name'), names) < 0) {
errorFound |= methods._validateField(field, options);
if (errorFound && first_err == null)
if (field.is(":hidden") && options.prettySelect)
first_err = field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix);
else
first_err = field;
if (options.doNotShowAllErrosOnSubmit)
return false;
names.push(field.attr('name'));
if (options.showOneMessage == true && errorFound) {
return false;
}
}
});
form.trigger("jqv.form.result", [errorFound]);
if (errorFound) {
if (options.scroll) {
var destination = first_err.offset().top;
var fixleft = first_err.offset().left;
var positionType = options.promptPosition;
if (typeof(positionType) == 'string' && positionType.indexOf(":") != -1)
positionType = positionType.substring(0, positionType.indexOf(":"));
if (positionType != "bottomRight" && positionType != "bottomLeft") {
var prompt_err = methods._getPrompt(first_err);
if (prompt_err) {
destination = prompt_err.offset().top;
}
}
if (options.scrollOffset) {
destination -= options.scrollOffset;
}
if (options.isOverflown) {
var overflowDIV = $(options.overflownDIV);
if (!overflowDIV.length)
return false;
var scrollContainerScroll = overflowDIV.scrollTop();
var scrollContainerPos = -parseInt(overflowDIV.offset().top);
destination += scrollContainerScroll + scrollContainerPos - 5;
var scrollContainer = $(options.overflownDIV + ":not(:animated)");
scrollContainer.animate({
scrollTop: destination
}, 1100, function () {
if (options.focusFirstField)
first_err.focus();
});
} else {
$("html, body").animate({
scrollTop: destination
}, 1100, function () {
if (options.focusFirstField)
first_err.focus();
});
$("html, body").animate({
scrollLeft: fixleft
}, 1100)
}
} else if (options.focusFirstField)
first_err.focus();
return false;
}
return true;
},
_validateFormWithAjax: function (form, options) {
var data = form.serialize();
var type = (options.ajaxFormValidationMethod) ? options.ajaxFormValidationMethod : "GET";
var url = (options.ajaxFormValidationURL) ? options.ajaxFormValidationURL : form.attr("action");
var dataType = (options.dataType) ? options.dataType : "json";
$.ajax({
type: type,
url: url,
cache: false,
dataType: dataType,
data: data,
form: form,
methods: methods,
options: options,
beforeSend: function () {
return options.onBeforeAjaxFormValidation(form, options);
},
error: function (data, transport) {
methods._ajaxError(data, transport);
},
success: function (json) {
if ((dataType == "json") && (json !== true)) {
var errorInForm = false;
for (var i = 0; i < json.length; i++) {
var value = json[i];
var errorFieldId = value[0];
var errorField = $($("#" + errorFieldId)[0]);
if (errorField.length == 1) {
var msg = value[2];
if (value[1] == true) {
if (msg == "" || !msg) {
methods._closePrompt(errorField);
} else {
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertTextOk;
if (txt)
msg = txt;
}
if (options.showPrompts)
methods._showPrompt(errorField, msg, "pass", false, options, true);
}
} else {
errorInForm |= true;
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertText;
if (txt)
msg = txt;
}
if (options.showPrompts)
methods._showPrompt(errorField, msg, "", false, options, true);
}
}
}
options.onAjaxFormComplete(!errorInForm, form, json, options);
} else
options.onAjaxFormComplete(true, form, json, options);
}
});
},
_validateField: function (field, options, skipAjaxValidation) {
if (!field.attr("id")) {
field.attr("id", "form-validation-field-" + $.validationEngine.fieldIdCounter);
++$.validationEngine.fieldIdCounter;
}
if (!options.validateNonVisibleFields && (field.is(":hidden") && !options.prettySelect || field.parent().is(":hidden")))
return false;
var rulesParsing = field.attr(options.validateAttribute);
var getRules = /validate\[(.*)\]/.exec(rulesParsing);
if (!getRules)
return false;
var str = getRules[1];
var rules = str.split(/\[|,|\]/);
var isAjaxValidator = false;
var fieldName = field.attr("name");
var promptText = "";
var promptType = "";
var required = false;
var limitErrors = false;
options.isError = false;
options.showArrow = true;
if (options.maxErrorsPerField > 0) {
limitErrors = true;
}
var form = $(field.closest("form, .validationEngineContainer"));
for (var i = 0; i < rules.length; i++) {
rules[i] = rules[i].replace(" ", "");
if (rules[i] === '') {
delete rules[i];
}
}
for (var i = 0, field_errors = 0; i < rules.length; i++) {
if (limitErrors && field_errors >= options.maxErrorsPerField) {
if (!required) {
var have_required = $.inArray('required', rules);
required = (have_required != -1 && have_required >= i);
}
break;
}
var errorMsg = undefined;
switch (rules[i]) {
case "required":
required = true;
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._required);
break;
case "custom":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._custom);
break;
case "groupRequired":
var classGroup = "[" + options.validateAttribute + "*=" + rules[i + 1] + "]";
var firstOfGroup = form.find(classGroup).eq(0);
if (firstOfGroup[0] != field[0]) {
methods._validateField(firstOfGroup, options, skipAjaxValidation);
options.showArrow = true;
}
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._groupRequired);
if (errorMsg)
required = true;
options.showArrow = false;
break;
case "ajax":
errorMsg = methods._ajax(field, rules, i, options);
if (errorMsg) {
promptType = "load";
}
break;
case "minSize":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._minSize);
break;
case "maxSize":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._maxSize);
break;
case "min":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._min);
break;
case "max":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._max);
break;
case "past":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._past);
break;
case "future":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._future);
break;
case "dateRange":
var classGroup = "[" + options.validateAttribute + "*=" + rules[i + 1] + "]";
options.firstOfGroup = form.find(classGroup).eq(0);
options.secondOfGroup = form.find(classGroup).eq(1);
if (options.firstOfGroup[0].value || options.secondOfGroup[0].value) {
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._dateRange);
}
if (errorMsg)
required = true;
options.showArrow = false;
break;
case "dateTimeRange":
var classGroup = "[" + options.validateAttribute + "*=" + rules[i + 1] + "]";
options.firstOfGroup = form.find(classGroup).eq(0);
options.secondOfGroup = form.find(classGroup).eq(1);
if (options.firstOfGroup[0].value || options.secondOfGroup[0].value) {
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._dateTimeRange);
}
if (errorMsg)
required = true;
options.showArrow = false;
break;
case "maxCheckbox":
field = $(form.find("input[name='" + fieldName + "']"));
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._maxCheckbox);
break;
case "minCheckbox":
field = $(form.find("input[name='" + fieldName + "']"));
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._minCheckbox);
break;
case "equals":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._equals);
break;
case "funcCall":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._funcCall);
break;
case "creditCard":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._creditCard);
break;
case "condRequired":
errorMsg = methods._getErrorMessage(form, field, rules[i], rules, i, options, methods._condRequired);
if (errorMsg !== undefined) {
required = true;
}
break;
default:
}
var end_validation = false;
if (typeof errorMsg == "object") {
switch (errorMsg.status) {
case "_break":
end_validation = true;
break;
case "_error":
errorMsg = errorMsg.message;
break;
case "_error_no_prompt":
return true;
break;
default:
break;
}
}
if (end_validation) {
break;
}
if (typeof errorMsg == 'string') {
promptText += errorMsg + "<br/>";
options.isError = true;
field_errors++;
}
}
if (!required && !(field.val()) && field.val().length < 1)
options.isError = false;
var fieldType = field.prop("type");
var positionType = field.data("promptPosition") || options.promptPosition;
if ((fieldType == "radio" || fieldType == "checkbox") && form.find("input[name='" + fieldName + "']").size() > 1) {
if (positionType === 'inline') {
field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:last"));
} else {
field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first"));
}
options.showArrow = false;
}
if (field.is(":hidden") && options.prettySelect) {
field = form.find("#" + options.usePrefix + methods._jqSelector(field.attr('id')) + options.useSuffix);
}
if (options.isError && options.showPrompts) {
methods._showPrompt(field, promptText, promptType, false, options);
} else {
if (!isAjaxValidator)
methods._closePrompt(field);
}
if (!isAjaxValidator) {
field.trigger("jqv.field.result", [field, options.isError, promptText]);
}
var errindex = $.inArray(field[0], options.InvalidFields);
if (errindex == -1) {
if (options.isError)
options.InvalidFields.push(field[0]);
} else if (!options.isError) {
options.InvalidFields.splice(errindex, 1);
}
methods._handleStatusCssClasses(field, options);
if (options.isError && options.onFieldFailure)
options.onFieldFailure(field);
if (!options.isError && options.onFieldSuccess)
options.onFieldSuccess(field);
return options.isError;
},
_handleStatusCssClasses: function (field, options) {
if (options.addSuccessCssClassToField)
field.removeClass(options.addSuccessCssClassToField);
if (options.addFailureCssClassToField)
field.removeClass(options.addFailureCssClassToField);
if (options.addSuccessCssClassToField && !options.isError)
field.addClass(options.addSuccessCssClassToField);
if (options.addFailureCssClassToField && options.isError)
field.addClass(options.addFailureCssClassToField);
},
_getErrorMessage: function (form, field, rule, rules, i, options, originalValidationMethod) {
var rule_index = jQuery.inArray(rule, rules);
if (rule === "custom" || rule === "funcCall") {
var custom_validation_type = rules[rule_index + 1];
rule = rule + "[" + custom_validation_type + "]";
delete (rules[rule_index]);
}
var alteredRule = rule;
var element_classes = (field.attr("data-validation-engine")) ? field.attr("data-validation-engine") : field.attr("class");
var element_classes_array = element_classes.split(" ");
var errorMsg;
if (rule == "future" || rule == "past" || rule == "maxCheckbox" || rule == "minCheckbox") {
errorMsg = originalValidationMethod(form, field, rules, i, options);
} else {
errorMsg = originalValidationMethod(field, rules, i, options);
}
if (errorMsg != undefined) {
var custom_message = methods._getCustomErrorMessage($(field), element_classes_array, alteredRule, options);
if (custom_message)
errorMsg = custom_message;
}
return errorMsg;
},
_getCustomErrorMessage: function (field, classes, rule, options) {
var custom_message = false;
var validityProp = methods._validityProp[rule];
if (validityProp != undefined) {
custom_message = field.attr("data-errormessage-" + validityProp);
if (custom_message != undefined)
return custom_message;
}
custom_message = field.attr("data-errormessage");
if (custom_message != undefined)
return custom_message;
var id = '#' + field.attr("id");
if (typeof options.custom_error_messages[id] != "undefined" && typeof options.custom_error_messages[id][rule] != "undefined") {
custom_message = options.custom_error_messages[id][rule]['message'];
} else if (classes.length > 0) {
for (var i = 0; i < classes.length && classes.length > 0; i++) {
var element_class = "." + classes[i];
if (typeof options.custom_error_messages[element_class] != "undefined" && typeof options.custom_error_messages[element_class][rule] != "undefined") {
custom_message = options.custom_error_messages[element_class][rule]['message'];
break;
}
}
}
if (!custom_message && typeof options.custom_error_messages[rule] != "undefined" && typeof options.custom_error_messages[rule]['message'] != "undefined") {
custom_message = options.custom_error_messages[rule]['message'];
}
return custom_message;
},
_validityProp: {
"required": "value-missing",
"custom": "custom-error",
"groupRequired": "value-missing",
"ajax": "custom-error",
"minSize": "range-underflow",
"maxSize": "range-overflow",
"min": "range-underflow",
"max": "range-overflow",
"past": "type-mismatch",
"future": "type-mismatch",
"dateRange": "type-mismatch",
"dateTimeRange": "type-mismatch",
"maxCheckbox": "range-overflow",
"minCheckbox": "range-underflow",
"equals": "pattern-mismatch",
"funcCall": "custom-error",
"creditCard": "pattern-mismatch",
"condRequired": "value-missing"
},
_required: function (field, rules, i, options, condRequired) {
switch (field.prop("type")) {
case "text":
case "password":
case "textarea":
case "file":
case "select-one":
case "select-multiple":
default:
var field_val = $.trim(field.val());
var dv_placeholder = $.trim(field.attr("data-validation-placeholder"));
var placeholder = $.trim(field.attr("placeholder"));
if ((!field_val) || (dv_placeholder && field_val == dv_placeholder) || (placeholder && field_val == placeholder)) {
return options.allrules[rules[i]].alertText;
}
break;
case "radio":
case "checkbox":
if (condRequired) {
if (!field.attr('checked')) {
return options.allrules[rules[i]].alertTextCheckboxMultiple;
}
break;
}
var form = field.closest("form, .validationEngineContainer");
var name = field.attr("name");
if (form.find("input[name='" + name + "']:checked").size() == 0) {
if (form.find("input[name='" + name + "']:visible").size() == 1)
return options.allrules[rules[i]].alertTextCheckboxe;
else
return options.allrules[rules[i]].alertTextCheckboxMultiple;
}
break;
}
},
_groupRequired: function (field, rules, i, options) {
var classGroup = "[" + options.validateAttribute + "*=" + rules[i + 1] + "]";
var isValid = false;
field.closest("form, .validationEngineContainer").find(classGroup).each(function () {
if (!methods._required($(this), rules, i, options)) {
isValid = true;
return false;
}
});
if (!isValid) {
return options.allrules[rules[i]].alertText;
}
},
_custom: function (field, rules, i, options) {
var customRule = rules[i + 1];
var rule = options.allrules[customRule];
var fn;
if (!rule) {
alert("jqv:custom rule not found - " + customRule);
return;
}
if (rule["regex"]) {
var ex = rule.regex;
if (!ex) {
alert("jqv:custom regex not found - " + customRule);
return;
}
var pattern = new RegExp(ex);
if (!pattern.test(field.val()))
return options.allrules[customRule].alertText;
} else if (rule["func"]) {
fn = rule["func"];
if (typeof(fn) !== "function") {
alert("jqv:custom parameter 'function' is no function - " + customRule);
return;
}
if (!fn(field, rules, i, options))
return options.allrules[customRule].alertText;
} else {
alert("jqv:custom type not allowed " + customRule);
return;
}
},
_funcCall: function (field, rules, i, options) {
var functionName = rules[i + 1];
var fn;
if (functionName.indexOf('.') > -1) {
var namespaces = functionName.split('.');
var scope = window;
while (namespaces.length) {
scope = scope[namespaces.shift()];
}
fn = scope;
} else
fn = window[functionName] || options.customFunctions[functionName];
if (typeof(fn) == 'function')
return fn(field, rules, i, options);
},
_equals: function (field, rules, i, options) {
var equalsField = rules[i + 1];
if (field.val() != $("#" + equalsField).val())
return options.allrules.equals.alertText;
},
_maxSize: function (field, rules, i, options) {
var max = rules[i + 1];
var len = field.val().length;
if (len > max) {
var rule = options.allrules.maxSize;
return rule.alertText + max + rule.alertText2;
}
},
_minSize: function (field, rules, i, options) {
var min = rules[i + 1];
var len = field.val().length;
if (len < min) {
var rule = options.allrules.minSize;
return rule.alertText + min + rule.alertText2;
}
},
_min: function (field, rules, i, options) {
var min = parseFloat(rules[i + 1]);
var len = parseFloat(field.val());
if (len < min) {
var rule = options.allrules.min;
if (rule.alertText2)
return rule.alertText + min + rule.alertText2;
return rule.alertText + min;
}
},
_max: function (field, rules, i, options) {
var max = parseFloat(rules[i + 1]);
var len = parseFloat(field.val());
if (len > max) {
var rule = options.allrules.max;
if (rule.alertText2)
return rule.alertText + max + rule.alertText2;
return rule.alertText + max;
}
},
_past: function (form, field, rules, i, options) {
var p = rules[i + 1];
var fieldAlt = $(form.find("input[name='" + p.replace(/^#+/, '') + "']"));
var pdate;
if (p.toLowerCase() == "now") {
pdate = new Date();
} else if (undefined != fieldAlt.val()) {
if (fieldAlt.is(":disabled"))
return;
pdate = methods._parseDate(fieldAlt.val());
} else {
pdate = methods._parseDate(p);
}
var vdate = methods._parseDate(field.val());
if (vdate > pdate) {
var rule = options.allrules.past;
if (rule.alertText2)
return rule.alertText + methods._dateToString(pdate) + rule.alertText2;
return rule.alertText + methods._dateToString(pdate);
}
},
_future: function (form, field, rules, i, options) {
var p = rules[i + 1];
var fieldAlt = $(form.find("input[name='" + p.replace(/^#+/, '') + "']"));
var pdate;
if (p.toLowerCase() == "now") {
pdate = new Date();
} else if (undefined != fieldAlt.val()) {
if (fieldAlt.is(":disabled"))
return;
pdate = methods._parseDate(fieldAlt.val());
} else {
pdate = methods._parseDate(p);
}
var vdate = methods._parseDate(field.val());
if (vdate < pdate) {
var rule = options.allrules.future;
if (rule.alertText2)
return rule.alertText + methods._dateToString(pdate) + rule.alertText2;
return rule.alertText + methods._dateToString(pdate);
}
},
_isDate: function (value) {
var dateRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);
return dateRegEx.test(value);
},
_isDateTime: function (value) {
var dateTimeRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/);
return dateTimeRegEx.test(value);
},
_dateCompare: function (start, end) {
return (new Date(start.toString()) < new Date(end.toString()));
},
_dateRange: function (field, rules, i, options) {
if ((!options.firstOfGroup[0].value && options.secondOfGroup[0].value) || (options.firstOfGroup[0].value && !options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
if (!methods._isDate(options.firstOfGroup[0].value) || !methods._isDate(options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
if (!methods._dateCompare(options.firstOfGroup[0].value, options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
},
_dateTimeRange: function (field, rules, i, options) {
if ((!options.firstOfGroup[0].value && options.secondOfGroup[0].value) || (options.firstOfGroup[0].value && !options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
if (!methods._isDateTime(options.firstOfGroup[0].value) || !methods._isDateTime(options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
if (!methods._dateCompare(options.firstOfGroup[0].value, options.secondOfGroup[0].value)) {
return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2;
}
},
_maxCheckbox: function (form, field, rules, i, options) {
var nbCheck = rules[i + 1];
var groupname = field.attr("name");
var groupSize = form.find("input[name='" + groupname + "']:checked").size();
if (groupSize > nbCheck) {
options.showArrow = false;
if (options.allrules.maxCheckbox.alertText2)
return options.allrules.maxCheckbox.alertText + " " + nbCheck + " " + options.allrules.maxCheckbox.alertText2;
return options.allrules.maxCheckbox.alertText;
}
},
_minCheckbox: function (form, field, rules, i, options) {
var nbCheck = rules[i + 1];
var groupname = field.attr("name");
var groupSize = form.find("input[name='" + groupname + "']:checked").size();
if (groupSize < nbCheck) {
options.showArrow = false;
return options.allrules.minCheckbox.alertText + " " + nbCheck + " " + options.allrules.minCheckbox.alertText2;
}
},
_creditCard: function (field, rules, i, options) {
var valid = false,
cardNumber = field.val().replace(/ +/g, '').replace(/-+/g, '');
var numDigits = cardNumber.length;
if (numDigits >= 14 && numDigits <= 16 && parseInt(cardNumber) > 0) {
var sum = 0,
i = numDigits - 1,
pos = 1,
digit,
luhn = new String();
do {
digit = parseInt(cardNumber.charAt(i));
luhn += (pos++ % 2 == 0) ? digit * 2 : digit;
} while (--i >= 0)
for (i = 0; i < luhn.length; i++) {
sum += parseInt(luhn.charAt(i));
}
valid = sum % 10 == 0;
}
if (!valid)
return options.allrules.creditCard.alertText;
},
_ajax: function (field, rules, i, options) {
var errorSelector = rules[i + 1];
var rule = options.allrules[errorSelector];
var extraData = rule.extraData;
var extraDataDynamic = rule.extraDataDynamic;
var data = {
"fieldId": field.attr("id"),
"fieldValue": field.val()
};
if (typeof extraData === "object") {
$.extend(data, extraData);
} else if (typeof extraData === "string") {
var tempData = extraData.split("&");
for (var i = 0; i < tempData.length; i++) {
var values = tempData[i].split("=");
if (values[0] && values[0]) {
data[values[0]] = values[1];
}
}
}
if (extraDataDynamic) {
var tmpData = [];
var domIds = String(extraDataDynamic).split(",");
for (var i = 0; i < domIds.length; i++) {
var id = domIds[i];
if ($(id).length) {
var inputValue = field.closest("form, .validationEngineContainer").find(id).val();
var keyValue = id.replace('#', '') + '=' + escape(inputValue);
data[id.replace('#', '')] = inputValue;
}
}
}
if (options.eventTrigger == "field") {
delete (options.ajaxValidCache[field.attr("id")]);
}
if (!options.isError && !methods._checkAjaxFieldStatus(field.attr("id"), options)) {
$.ajax({
type: options.ajaxFormValidationMethod,
url: rule.url,
cache: false,
dataType: "json",
data: data,
field: field,
rule: rule,
methods: methods,
options: options,
beforeSend: function () {},
error: function (data, transport) {
methods._ajaxError(data, transport);
},
success: function (json) {
var errorFieldId = json[0];
var errorField = $("#" + errorFieldId).eq(0);
if (errorField.length == 1) {
var status = json[1];
var msg = json[2];
if (!status) {
options.ajaxValidCache[errorFieldId] = false;
options.isError = true;
if (msg) {
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertText;
if (txt) {
msg = txt;
}
}
} else
msg = rule.alertText;
if (options.showPrompts)
methods._showPrompt(errorField, msg, "", true, options);
} else {
options.ajaxValidCache[errorFieldId] = true;
if (msg) {
if (options.allrules[msg]) {
var txt = options.allrules[msg].alertTextOk;
if (txt) {
msg = txt;
}
}
} else
msg = rule.alertTextOk;
if (options.showPrompts) {
if (msg)
methods._showPrompt(errorField, msg, "pass", true, options);
else
methods._closePrompt(errorField);
}
if (options.eventTrigger == "submit")
field.closest("form").submit();
}
}
errorField.trigger("jqv.field.result", [errorField, options.isError, msg]);
}
});
return rule.alertTextLoad;
}
},
_ajaxError: function (data, transport) {
if (data.status == 0 && transport == null)
alert("The page is not served from a server! ajax call failed");
else if (typeof console != "undefined")
console.log("Ajax error: " + data.status + " " + transport);
},
_dateToString: function (date) {
return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
},
_parseDate: function (d) {
var dateParts = d.split("-");
if (dateParts == d)
dateParts = d.split("/");
if (dateParts == d) {
dateParts = d.split(".");
return new Date(dateParts[2], (dateParts[1] - 1), dateParts[0]);
}
return new Date(dateParts[0], (dateParts[1] - 1), dateParts[2]);
},
_showPrompt: function (field, promptText, type, ajaxed, options, ajaxform) {
var prompt = methods._getPrompt(field);
if (ajaxform)
prompt = false;
if ($.trim(promptText)) {
if (prompt)
methods._updatePrompt(field, prompt, promptText, type, ajaxed, options);
else
methods._buildPrompt(field, promptText, type, ajaxed, options);
}
},
_buildPrompt: function (field, promptText, type, ajaxed, options) {
var prompt = $('<div>');
prompt.addClass(methods._getClassName(field.attr("id")) + "formError");
prompt.addClass("parentForm" + methods._getClassName(field.closest('form, .validationEngineContainer').attr("id")));
prompt.addClass("formError");
switch (type) {
case "pass":
prompt.addClass("greenPopup");
break;
case "load":
prompt.addClass("blackPopup");
break;
default:
}
if (ajaxed)
prompt.addClass("ajaxed");
var promptContent = $('<div>').addClass("formErrorContent").html(promptText).appendTo(prompt);
var positionType = field.data("promptPosition") || options.promptPosition;
if (options.showArrow) {
var arrow = $('<div>').addClass("formErrorArrow");
if (typeof(positionType) == 'string') {
var pos = positionType.indexOf(":");
if (pos != -1)
positionType = positionType.substring(0, pos);
}
switch (positionType) {
case "bottomLeft":
case "bottomRight":
prompt.find(".formErrorContent").before(arrow);
arrow.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');
break;
case "topLeft":
case "topRight":
arrow.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>');
prompt.append(arrow);
break;
}
}
if (options.addPromptClass)
prompt.addClass(options.addPromptClass);
var requiredOverride = field.attr('data-required-class');
if (requiredOverride !== undefined) {
prompt.addClass(requiredOverride);
} else {
if (options.prettySelect) {
if ($('#' + field.attr('id')).next().is('select')) {
var prettyOverrideClass = $('#' + field.attr('id').substr(options.usePrefix.length).substring(options.useSuffix.length)).attr('data-required-class');
if (prettyOverrideClass !== undefined) {
prompt.addClass(prettyOverrideClass);
}
}
}
}
prompt.css({
"opacity": 0
});
if (positionType === 'inline') {
prompt.addClass("inline");
if (typeof field.attr('data-prompt-target') !== 'undefined' && $('#' + field.attr('data-prompt-target')).length > 0) {
prompt.appendTo($('#' + field.attr('data-prompt-target')));
} else {
field.after(prompt);
}
} else {
field.before(prompt);
}
var pos = methods._calculatePosition(field, prompt, options);
prompt.css({
'position': positionType === 'inline' ? 'relative' : 'absolute',
"top": pos.callerTopPosition,
"left": pos.callerleftPosition,
"marginTop": pos.marginTopSize,
"opacity": 0
}).data("callerField", field);
if (options.autoHidePrompt) {
setTimeout(function () {
prompt.animate({
"opacity": 0
}, function () {
prompt.closest('.formErrorOuter').remove();
prompt.remove();
});
}, options.autoHideDelay);
}
return prompt.animate({
"opacity": 0.87
});
},
_updatePrompt: function (field, prompt, promptText, type, ajaxed, options, noAnimation) {
if (prompt) {
if (typeof type !== "undefined") {
if (type == "pass")
prompt.addClass("greenPopup");
else
prompt.removeClass("greenPopup");
if (type == "load")
prompt.addClass("blackPopup");
else
prompt.removeClass("blackPopup");
}
if (ajaxed)
prompt.addClass("ajaxed");
else
prompt.removeClass("ajaxed");
prompt.find(".formErrorContent").html(promptText);
var pos = methods._calculatePosition(field, prompt, options);
var css = {
"top": pos.callerTopPosition,
"left": pos.callerleftPosition,
"marginTop": pos.marginTopSize
};
if (noAnimation)
prompt.css(css);
else
prompt.animate(css);
}
},
_closePrompt: function (field) {
var prompt = methods._getPrompt(field);
if (prompt)
prompt.fadeTo("fast", 0, function () {
prompt.parent('.formErrorOuter').remove();
prompt.remove();
});
},
closePrompt: function (field) {
return methods._closePrompt(field);
},
_getPrompt: function (field) {
var formId = $(field).closest('form, .validationEngineContainer').attr('id');
var className = methods._getClassName(field.attr("id")) + "formError";
var match = $("." + methods._escapeExpression(className) + '.parentForm' + formId)[0];
if (match)
return $(match);
},
_escapeExpression: function (selector) {
return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1");
},
isRTL: function (field) {
var $document = $(document);
var $body = $('body');
var rtl = (field && field.hasClass('rtl')) || (field && (field.attr('dir') || '').toLowerCase() === 'rtl') || $document.hasClass('rtl') || ($document.attr('dir') || '').toLowerCase() === 'rtl' || $body.hasClass('rtl') || ($body.attr('dir') || '').toLowerCase() === 'rtl';
return Boolean(rtl);
},
_calculatePosition: function (field, promptElmt, options) {
var promptTopPosition,
promptleftPosition,
marginTopSize;
var fieldWidth = field.width();
var fieldLeft = field.position().left;
var fieldTop = field.position().top;
var fieldHeight = field.height();
var promptHeight = promptElmt.height();
promptTopPosition = promptleftPosition = 0;
marginTopSize = -promptHeight;
var positionType = field.data("promptPosition") || options.promptPosition;
var shift1 = "";
var shift2 = "";
var shiftX = 0;
var shiftY = 0;
if (typeof(positionType) == 'string') {
if (positionType.indexOf(":") != -1) {
shift1 = positionType.substring(positionType.indexOf(":") + 1);
positionType = positionType.substring(0, positionType.indexOf(":"));
if (shift1.indexOf(",") != -1) {
shift2 = shift1.substring(shift1.indexOf(",") + 1);
shift1 = shift1.substring(0, shift1.indexOf(","));
shiftY = parseInt(shift2);
if (isNaN(shiftY))
shiftY = 0;
};
shiftX = parseInt(shift1);
if (isNaN(shift1))
shift1 = 0;
};
};
switch (positionType) {
default:
case "topRight":
promptleftPosition += fieldLeft + fieldWidth - 30;
promptTopPosition += fieldTop;
break;
case "topLeft":
promptTopPosition += fieldTop;
promptleftPosition += fieldLeft;
break;
case "centerRight":
promptTopPosition = fieldTop + 4;
marginTopSize = 0;
promptleftPosition = fieldLeft + field.outerWidth(true) + 5;
break;
case "centerLeft":
promptleftPosition = fieldLeft - (promptElmt.width() + 2);
promptTopPosition = fieldTop + 4;
marginTopSize = 0;
break;
case "bottomLeft":
promptTopPosition = fieldTop + field.height() + 5;
marginTopSize = 0;
promptleftPosition = fieldLeft;
break;
case "bottomRight":
promptleftPosition = fieldLeft + fieldWidth - 30;
promptTopPosition = fieldTop + field.height() + 5;
marginTopSize = 0;
break;
case "inline":
promptleftPosition = 0;
promptTopPosition = 0;
marginTopSize = 0;
};
promptleftPosition += shiftX;
promptTopPosition += shiftY;
return {
"callerTopPosition": promptTopPosition + "px",
"callerleftPosition": promptleftPosition + "px",
"marginTopSize": marginTopSize + "px"
};
},
_saveOptions: function (form, options) {
if ($.validationEngineLanguage)
var allRules = $.validationEngineLanguage.allRules;
else
$.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");
$.validationEngine.defaults.allrules = allRules;
var userOptions = $.extend(true, {}, $.validationEngine.defaults, options);
form.data('jqv', userOptions);
return userOptions;
},
_getClassName: function (className) {
if (className)
return className.replace(/:/g, "_").replace(/\./g, "_");
},
_jqSelector: function (str) {
return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
},
_condRequired: function (field, rules, i, options) {
var idx,
dependingField;
for (idx = (i + 1); idx < rules.length; idx++) {
dependingField = jQuery("#" + rules[idx]).first();
if (dependingField.length && methods._required(dependingField, ["required"], 0, options, true) == undefined) {
return methods._required(field, ["required"], 0, options);
}
}
},
_submitButtonClick: function (event) {
var button = $(this);
var form = button.closest('form, .validationEngineContainer');
form.data("jqv_submitButton", button.attr("id"));
}
};
$.fn.validationEngine = function (method) {
var form = $(this);
if (!form[0])
return form;
if (typeof(method) == 'string' && method.charAt(0) != '_' && methods[method]) {
if (method != "showPrompt" && method != "hide" && method != "hideAll")
methods.init.apply(form);
return methods[method].apply(form, Array.prototype.slice.call(arguments, 1));
} else if (typeof method == 'object' || !method) {
methods.init.apply(form, arguments);
return methods.attach.apply(form);
} else {
$.error('Method ' + method + ' does not exist in jQuery.validationEngine');
}
};
$.validationEngine = {
fieldIdCounter: 0,
defaults: {
validationEventTrigger: "blur",
scroll: true,
focusFirstField: true,
showPrompts: true,
validateNonVisibleFields: false,
promptPosition: "topRight",
bindMethod: "bind",
inlineAjax: false,
ajaxFormValidation: false,
ajaxFormValidationURL: false,
ajaxFormValidationMethod: 'get',
onAjaxFormComplete: $.noop,
onBeforeAjaxFormValidation: $.noop,
onValidationComplete: false,
doNotShowAllErrosOnSubmit: false,
custom_error_messages: {},
binded: true,
showArrow: true,
isError: false,
maxErrorsPerField: false,
ajaxValidCache: {},
autoPositionUpdate: false,
InvalidFields: [],
onFieldSuccess: false,
onFieldFailure: false,
onSuccess: false,
onFailure: false,
validateAttribute: "class",
addSuccessCssClassToField: "",
addFailureCssClassToField: "",
autoHidePrompt: false,
autoHideDelay: 10000,
fadeDuration: 0.3,
prettySelect: false,
addPromptClass: "",
usePrefix: "",
useSuffix: "",
showOneMessage: false
}
};
$(function () {
$.validationEngine.defaults.promptPosition = methods.isRTL() ? 'topLeft' : "topRight"
});
})(jQuery);
function version_compare(t, i) {
if (t === i)
return 0;
for (var a = t.split("."), n = i.split("."), l = Math.min(a.length, n.length), e = 0; l > e; e++) {
if (parseInt(a[e]) > parseInt(n[e]))
return 1;
if (parseInt(a[e]) < parseInt(n[e]))
return -1
}
return a.length > n.length ? 1 : a.length < n.length ? -1 : 0
}
jQuery(function (t) {
void 0 === t.fn.on && (t.fn.on = function (i, a, n, l) {
return "function" == typeof a ? t(this.context).live(i, a) : t(a).live(i, n, l),
this
}),
t(document).on("click", ".showerrors", function () {
return t(".xdetailed-errors").toggle(),
!1
}),
t(document).on("click", ".shownotices", function () {
return t(".xdetailed-updated").toggle(),
!1
}),
t("form.widget_wysija").on("focus", "input[placeholder]", function () {
t(this).val() === t(this).attr("placeholder") && t(this).val("")
}),
t("form.widget_wysija").on("blur", "input[placeholder]", function () {
"" === t(this).val() && t(this).val(t(this).attr("placeholder"))
}),
t("form.widget_wysija").on("focus", "input.defaultlabels", function () {
t(this).val() === t(this).attr("title") && t(this).val("")
}),
t("form.widget_wysija").on("blur", "input.defaultlabels", function () {
"" === t(this).val() && t(this).val(t(this).attr("title"))
}),
t(document).on("submit", "form.widget_wysija", function (i) {
if (i.preventDefault(), void 0 !== wysijaAJAX.noajax)
return t(this).validationEngine("validate");
if (t(this).validationEngine("validate") === !0) {
var a = t(this).find('input[name="action"]').val(),
n = t(this).find('input[name="controller"]').val(),
l = t(this).attr("id"),
e = t(this).serializeArray();
wysijaAJAX.task = a,
wysijaAJAX.controller = n,
wysijaAJAX.formid = l,
t.each(e, function (t, i) {
wysijaAJAX["data[" + t + "][name]"] = i.name,
wysijaAJAX["data[" + t + "][value]"] = i.value
}),
t("#msg-" + l).html('<div class="allmsgs"><blink>' + wysijaAJAX.loadingTrans + "</blink></div>"),
t("#" + l).fadeOut(),
t.ajax({
type: "post",
url: wysijaAJAX.ajaxurl,
data: wysijaAJAX,
success: function (i) {
t("#msg-" + l).html('<div class="allmsgs"></div>'),
i.result || t("#" + l).fadeIn(),
t.each(i.msgs, function (i, a) {
t("#msg-" + l + " .allmsgs ." + i + " ul").length || t("#msg-" + l + " .allmsgs").append('<div class="' + i + '"><ul></ul></div>'),
t.each(a, function (a, n) {
t("#msg-" + l + " .allmsgs ." + i + " ul").append("<li>" + n + "</li>")
})
})
},
error: function (i, a, n) {
t("#msg-" + l).html('<div class="allmsgs"></div>'),
t("#msg-" + l + " .allmsgs").html('<div class="error"><ul><li>Oops! There is a problem with this form:</li><li>textStatus:' + a + "</li><li>errorThrown:" + n + "</li><li>responseText:" + i.responseText + "</li></ul></div>")
},
dataType: "jsonp"
})
}
return !1
}),
t(function () {
var i = "centerRight";
wysijaAJAX.is_rtl && (i = "centerLeft"),
t("form.widget_wysija").validationEngine("attach", {
promptPosition: i,
scroll: !1
}),
t("form.widget_wysija").bind("jqv.form.validating", function () {
t(this).find("input[placeholder]").each(function () {
t(this).val() === t(this).attr("placeholder") && t(this).val("")
})
}),
t("form.widget_wysija").find("input[placeholder]").each(function () {
"" === t(this).val() && t(this).val(t(this).attr("placeholder"))
}),
t("form.widget_wysija").bind("jqv.form.validating", function () {
t(this).find("input.defaultlabels").each(function () {
t(this).val() === t(this).attr("title") && t(this).val("")
})
}),
t("form.widget_wysija").find("input.defaultlabels").each(function () {
"" === t(this).val() && t(this).val(t(this).attr("title"))
})
})
});
!function (t) {
"use strict";
var o;
t.fn.accordionShortcodes = function (o) {
function e() {
return t(this).hasClass("open") ? h.clickToClose && n(t(this)) : (h.autoClose && a.each(function () {
n(t(this))
}), i(t(this), !0)),
!1
}
function i(o, e) {
o.next().clearQueue().stop().slideDown(l, function () {
e && h.scroll && t("html, body").animate({
scrollTop: t(this).prev().offset().top - h.scrollOffset
}, l)
}),
o.addClass("open read").attr({
"aria-selected": "true",
"aria-expanded": "true"
}).next().attr({
"aria-hidden": "false"
})
}
function n(t) {
t.next().slideUp(l),
t.removeClass("open"),
t.attr({
"aria-selected": "false",
"aria-expanded": "false"
}).next().attr({
"aria-hidden": "true"
})
}
var a = this.children(".accordion-title"),
s = this.children(".accordion-content").hide(),
c = a.first(),
r = (s.first(), t(window.location.hash)),
l = 250,
h = t.extend({
autoClose: !0,
openFirst: !1,
openAll: !1,
clickToClose: !1,
scroll: !1
}, o);
return t(".accordion").removeClass("no-js"),
h.scrollOffset = 0 | Math.floor(parseInt(h.scroll)),
r.length && r.hasClass("accordion-title") ? i(r, !0) : h.openAll ? a.each(function () {
i(t(this), !1)
}) : h.openFirst && i(c, !1),
t('[data-initialstate!=""]').each(function () {
switch (t(this).data("initialstate")) {
case "open":
i(t(this), !1);
break;
case "closed":
t(this).attr("id") !== r.attr("id") && n(t(this))
}
}),
a.click(e),
a.keydown(function (o) {
var e = o.which;
(13 === e || 32 === e) && t(this).click()
}),
t(window).on("hashchange", function () {
r = t(window.location.hash),
r.length && r.hasClass("accordion-title") && (h.autoClose && a.each(function () {
n(t(this))
}), i(r, !0))
}),
this
},
t(window).load(function () {
for (var e = 0; e < accordionShortcodesSettings.length; e += 1)
o = accordionShortcodesSettings[e], t("#" + o.id).accordionShortcodes(o)
})
}
(jQuery);
!function (t) {
var e,
i,
n,
a,
o,
d,
c,
r,
s,
h,
l,
f,
p,
g = 0,
u = {},
b = [],
y = 0,
w = {},
m = [],
v = null,
x = new Image,
I = /\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,
C = /[^\.]\.(swf)\s*$/i,
k = /[^\.]\.(svg)\s*$/i,
O = 1,
j = 0,
T = "",
A = !1,
D = t.extend(t("<div/>")[0], {
prop: 0
}),
N = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
E = void 0 !== document.createTouch,
S = function () {
i.hide(),
x.onerror = x.onload = null,
v && v.abort(),
e.empty()
},
F = function () {
return !1 === u.onError(b, g, u) ? (i.hide(), void(A = !1)) : (u.titleShow = !1, u.width = "auto", u.height = "auto", e.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'), void B())
},
P = function () {
var n,
a,
o,
c,
r,
s,
h = b[g];
if (S(), u = t.extend({}, t.fn.fancybox.defaults, void 0 === t(h).data("fancybox") ? u : t(h).data("fancybox")), s = u.onStart(b, g, u), s === !1)
return void(A = !1);
if ("object" == typeof s && (u = t.extend(u, s)), o = u.title || (h.nodeName ? t(h).attr("title") : h.title) || "", h.nodeName && !u.orig && (u.orig = t(h).find("img:first").length ? t(h).find("img:first") : t(h)), "" === o && u.orig && (o = u.orig.attr(u.titleFromAlt ? "alt" : "title")), n = u.href || (h.nodeName ? t(h).attr("href") : h.href) || null, (/^(?:javascript)/i.test(n) || "#" == n) && (n = null), u.type ? (a = u.type, n || (n = u.content)) : u.content ? a = "html" : n && (a = n.match(I) || t(h).hasClass("image") ? "image" : n.match(C) ? "swf" : n.match(k) ? "svg" : t(h).hasClass("iframe") ? "iframe" : 0 === n.indexOf("#") ? "inline" : "ajax"), !a)
return void F();
switch ("inline" == a && (h = n.substr(n.indexOf("#")), a = t(h).length > 0 ? "inline" : "ajax"), u.type = a, u.href = n, u.title = o, u.autoDimensions && ("html" == u.type || "inline" == u.type || "ajax" == u.type ? (u.width = "auto", u.height = "auto") : u.autoDimensions = !1), u.modal && (u.overlayShow = !0, u.hideOnOverlayClick = !1, u.hideOnContentClick = !1, u.enableEscapeButton = !1, u.showCloseButton = !1), u.padding = parseInt(u.padding, 10), u.margin = parseInt(u.margin, 10), e.css("padding", u.padding + u.margin), t(".fancybox-inline-tmp").off("fancybox-cancel").on("fancybox-change", function () {
t(this).replaceWith(d.children())
}), a) {
case "html":
e.html(u.content),
B();
break;
case "inline":
if (t(h).parent().is("#fancybox-content") === !0)
return void(A = !1);
t('<div class="fancybox-inline-tmp" />').hide().insertBefore(t(h)).on("fancybox-cleanup", function () {
t(this).replaceWith(d.children())
}).on("fancybox-cancel", function () {
t(this).replaceWith(e.children())
}),
t(h).appendTo(e),
B();
break;
case "image":
A = !1,
t.fancybox.showActivity(),
x = new Image,
x.onerror = function () {
F()
},
x.onload = function () {
A = !0,
x.onerror = x.onload = null,
L()
},
x.src = n;
break;
case "swf":
u.scrolling = "no",
c = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + u.width + '" height="' + u.height + '"><param name="movie" value="' + n + '"></param>',
r = "",
t.each(u.swf, function (t, e) {
c += '<param name="' + t + '" value="' + e + '"></param>',
r += " " + t + '="' + e + '"'
}),
c += '<embed src="' + n + '" type="application/x-shockwave-flash" width="' + u.width + '" height="' + u.height + '"' + r + "></embed></object>",
e.html(c),
B();
break;
case "svg":
u.scrolling = "no",
c = '<object width="' + u.width + '" height="' + u.height + '" data="' + n + '"></object>',
e.html(c),
B();
break;
case "ajax":
A = !1,
t.fancybox.showActivity(),
u.ajax.win = u.ajax.success,
v = t.ajax(t.extend({}, u.ajax, {
url: n,
data: u.ajax.data || {},
error: function (t) {
t.status > 0 && F()
},
success: function (t, a, o) {
var d = "object" == typeof o ? o : v;
if (200 == d.status) {
if ("function" == typeof u.ajax.win) {
if (s = u.ajax.win(n, t, a, o), s === !1)
return void i.hide();
("string" == typeof s || "object" == typeof s) && (t = s)
}
e.html(t),
B()
}
}
}));
break;
case "iframe":
z()
}
},
B = function () {
var i = u.width,
n = u.height,
a = 0 == t(window).width() ? window.innerWidth : t(window).width(),
o = 0 == t(window).height() ? window.innerHeight : t(window).height();
i = ("" + i).indexOf("%") > -1 ? parseInt((a - 2 * u.margin) * parseFloat(i) / 100, 10) + "px" : "auto" == i ? "auto" : i + "px",
n = ("" + n).indexOf("%") > -1 ? parseInt((o - 2 * u.margin) * parseFloat(n) / 100, 10) + "px" : "auto" == n ? "auto" : n + "px",
e.wrapInner('<div style="width:' + i + ";height:" + n + ";overflow: " + ("auto" == u.scrolling ? "auto" : "yes" == u.scrolling ? "scroll" : "hidden") + ';position:relative;"></div>'),
u.width = e.width(),
u.height = e.height(),
z()
},
L = function () {
u.width = x.width,
u.height = x.height,
t("<img />").attr({
id: "fancybox-img",
src: x.src,
alt: u.title
}).appendTo(e),
z()
},
z = function () {
var o,
l;
return i.hide(),
a.is(":visible") && !1 === w.onCleanup(m, y, w) ? (t(".fancybox-inline-tmp").trigger("fancybox-cancel"), void(A = !1)) : (A = !0, t(d.add(n)).off(), t(window).off("resize.fb scroll.fb"), t(document).off("keydown.fb"), a.is(":visible") && "outside" !== w.titlePosition && a.css("height", a.height()), m = b, y = g, w = u, w.overlayShow ? (n.css({
"background-color": w.overlayColor,
opacity: w.overlayOpacity,
cursor: w.hideOnOverlayClick ? "pointer" : "auto",
height: t(document).height()
}), n.is(":visible") || (N && t("select:not(#fancybox-tmp select)").filter(function () {
return "hidden" !== this.style.visibility
}).css({
visibility: "hidden"
}).one("fancybox-cleanup", function () {
this.style.visibility = "inherit"
}), n.show())) : n.hide(), p = $(), M(), a.is(":visible") ? (t(c.add(s).add(h)).hide(), o = a.position(), f = {
top: o.top,
left: o.left,
width: a.width(),
height: a.height()
}, l = f.width == p.width && f.height == p.height, void d.fadeTo(w.changeFade, .3, function () {
var i = function () {
d.html(e.contents()).fadeTo(w.changeFade, 1, K)
};
t(".fancybox-inline-tmp").trigger("fancybox-change"),
d.empty().removeAttr("filter").css({
"border-width": w.padding,
width: p.width - 2 * w.padding,
height: u.autoDimensions ? "auto" : p.height - j - 2 * w.padding
}),
l ? i() : (D.prop = 0, t(D).animate({
prop: 1
}, {
duration: w.changeSpeed,
easing: w.easingChange,
step: q,
complete: i
}))
})) : (a.removeAttr("style"), d.css("border-width", w.padding), "elastic" == w.transitionIn ? (f = U(), d.html(e.contents()), a.show(), w.opacity && (p.opacity = 0), D.prop = 0, void t(D).animate({
prop: 1
}, {
duration: w.speedIn,
easing: w.easingIn,
step: q,
complete: K
})) : ("inside" == w.titlePosition && j > 0 && r.show(), d.css({
width: p.width - 2 * w.padding,
height: u.autoDimensions ? "auto" : p.height - j - 2 * w.padding
}).html(e.contents()), void a.css(p).fadeIn("none" == w.transitionIn ? 0 : w.speedIn, K))))
},
H = function (t) {
return t && t.length ? "float" == w.titlePosition ? '<table id="fancybox-title-float-wrap" style="border-spacing:0;border-collapse:collapse"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + t + '</td><td id="fancybox-title-float-right"></td></tr></table>' : '<div id="fancybox-title-' + w.titlePosition + '">' + t + "</div>" : !1
},
M = function () {
if (T = w.title || "", j = 0, r.empty().removeAttr("style").removeClass(), w.titleShow === !1)
return void r.hide();
if (T = t.isFunction(w.titleFormat) ? w.titleFormat(T, m, y, w) : H(T), !T || "" === T)
return void r.hide();
switch (r.addClass("fancybox-title-" + w.titlePosition).html(T).appendTo("body").show(), w.titlePosition) {
case "inside":
r.css({
width: p.width - 2 * w.padding,
marginLeft: w.padding,
marginRight: w.padding
}),
j = r.outerHeight(!0),
r.appendTo(o),
p.height += j;
break;
case "over":
r.css({
marginLeft: w.padding,
width: p.width - 2 * w.padding,
bottom: w.padding
}).appendTo(o);
break;
case "float":
r.css("left", -1 * parseInt((r.width() - p.width - 40) / 2, 10)).appendTo(a);
break;
default:
r.css({
width: p.width - 2 * w.padding,
paddingLeft: w.padding,
paddingRight: w.padding
}).appendTo(a)
}
r.hide()
},
R = function () {
return (w.enableEscapeButton || w.enableKeyboardNav) && t(document).on("keydown.fb", function (e) {
27 == e.keyCode && w.enableEscapeButton ? (e.preventDefault(), t.fancybox.close()) : 37 != e.keyCode && 39 != e.keyCode || !w.enableKeyboardNav || "INPUT" === e.target.tagName || "TEXTAREA" === e.target.tagName || "SELECT" === e.target.tagName ? 9 == e.keyCode && w.enableKeyboardNav && "INPUT" !== e.target.tagName && "TEXTAREA" !== e.target.tagName && "SELECT" !== e.target.tagName && (e.preventDefault(), t.fancybox[e.shiftKey ? "prev" : "next"]()) : (e.preventDefault(), t.fancybox[37 == e.keyCode ? "prev" : "next"]())
}),
w.showNavArrows ? ((w.cyclic && m.length > 1 || 0 !== y) && s.show(), void((w.cyclic && m.length > 1 || y != m.length - 1) && h.show())) : (s.hide(), void h.hide())
},
K = function () {
t.support.opacity || (d.css("filter", 0), a.css("filter", 0)),
u.autoDimensions && d.css("height", "auto"),
a.css("height", "auto"),
T && T.length && r.show(),
w.showCloseButton && c.show(),
R(),
w.hideOnContentClick && d.on("click", t.fancybox.close),
w.hideOnOverlayClick && n.on("click", t.fancybox.close),
w.autoResize && t(window).on("resize.fb", t.fancybox.resize),
w.centerOnScroll && t(window).on("scroll.fb", t.fancybox.center),
t.fn.mousewheel && a.on("mousewheel.fb", function (e, i) {
A ? e.preventDefault() : "image" != w.type || 0 != t(e.target).outerHeight() && t(e.target).prop("scrollHeight") !== t(e.target).outerHeight() || (e.preventDefault(), t.fancybox[i > 0 ? "prev" : "next"]())
}),
"iframe" == w.type && t('<iframe id="fancybox-frame" name="fancybox-frame' + (new Date).getTime() + '"' + (navigator.userAgent.match(/msie [6]/i) ? ' allowtransparency="true""' : "") + ' style="border:0;margin:0;overflow:' + ("auto" == u.scrolling ? "auto" : "yes" == u.scrolling ? "scroll" : "hidden") + '" src="' + w.href + '"' + (!1 === w.allowfullscreen ? "" : " allowfullscreen") + ' tabindex="999"></iframe>').appendTo(d).focus(),
a.show(),
A = !1,
t.fancybox.center(),
w.onComplete(m, y, w),
W()
},
W = function () {
var e,
i;
m.length - 1 > y && (e = m[y + 1], "undefined" != typeof href && (e.href.match(I) || t(e).hasClass("image")) && (i = new Image, i.src = href)),
y > 0 && (e = m[y - 1], "undefined" != typeof href && (e.href.match(I) || t(e).hasClass("image")) && (i = new Image, i.src = href))
},
q = function (t) {
var e = {
width: parseInt(f.width + (p.width - f.width) * t, 10),
height: parseInt(f.height + (p.height - f.height) * t, 10),
top: parseInt(f.top + (p.top - f.top) * t, 10),
left: parseInt(f.left + (p.left - f.left) * t, 10)
};
void 0 !== p.opacity && (e.opacity = .5 > t ? .5 : t),
a.css(e),
d.css({
width: e.width - 2 * w.padding,
height: e.height - j * t - 2 * w.padding
})
},
X = function () {
return [0 == t(window).width() ? window.innerWidth : t(window).width() - 2 * w.margin, 0 == t(window).height() ? window.innerHeight : t(window).height() - 2 * w.margin, t(document).scrollLeft() + w.margin, t(document).scrollTop() + w.margin]
},
$ = function () {
var t,
e = X(),
i = {},
n = w.autoScale,
a = 2 * w.padding;
return i.width = ("" + w.width).indexOf("%") > -1 ? parseInt(e[0] * parseFloat(w.width) / 100, 10) : w.width + a,
i.height = ("" + w.height).indexOf("%") > -1 ? parseInt(e[1] * parseFloat(w.height) / 100, 10) : w.height + a,
n && (i.width > e[0] || i.height > e[1]) && ("image" == u.type || "svg" == u.type || "swf" == u.type ? (t = w.width / w.height, i.width > e[0] && (i.width = e[0], i.height = parseInt((i.width - a) / t + a, 10)), i.height > e[1] && (i.height = e[1], i.width = parseInt((i.height - a) * t + a, 10))) : (i.width = Math.min(i.width, e[0]), i.height = Math.min(i.height, e[1]))),
i.top = parseInt(Math.max(e[3] - 20, e[3] + .5 * (e[1] - i.height - 40)), 10),
i.left = parseInt(Math.max(e[2] - 20, e[2] + .5 * (e[0] - i.width - 40)), 10),
i
},
Q = function (t) {
var e = t.offset();
return e.top += parseInt(t.css("paddingTop"), 10) || 0,
e.left += parseInt(t.css("paddingLeft"), 10) || 0,
e.top += parseInt(t.css("border-top-width"), 10) || 0,
e.left += parseInt(t.css("border-left-width"), 10) || 0,
e.width = t.width(),
e.height = t.height(),
e
},
U = function () {
var e,
i,
n = u.orig ? t(u.orig) : !1,
a = {};
return n && n.length ? (e = Q(n), a = {
width: e.width + 2 * w.padding,
height: e.height + 2 * w.padding,
top: e.top - w.padding - 20,
left: e.left - w.padding - 20
}) : (i = X(), a = {
width: 2 * w.padding,
height: 2 * w.padding,
top: parseInt(i[3] + .5 * i[1], 10),
left: parseInt(i[2] + .5 * i[0], 10)
}),
a
},
G = function () {
return i.is(":visible") ? (t("div", i).css("top", -40 * O + "px"), void(O = (O + 1) % 12)) : void clearInterval(l)
};
t.fn.fancybox = function (e) {
return t(this).length ? (t(this).data("fancybox", t.extend({}, e, t.metadata ? t(this).metadata() : {})).off("click.fb").on("click.fb", function (e) {
if (e.preventDefault(), !A) {
A = !0,
t(this).blur(),
b = [],
g = 0;
var i = t(this).attr("rel") || "";
i && "" != i && "nofollow" !== i ? (b = t('a[rel="' + i + '"], area[rel="' + i + '"]'), g = b.index(this)) : b.push(this),
P()
}
}), this) : this
},
t.fancybox = function (e) {
var i;
if (!A) {
if (A = !0, i = void 0 !== arguments[1] ? arguments[1] : {}, b = [], g = parseInt(i.index, 10) || 0, t.isArray(e)) {
for (var n = 0, a = e.length; a > n; n++)
"object" == typeof e[n] ? t(e[n]).data("fancybox", t.extend({}, i, e[n])) : e[n] = t({}).data("fancybox", t.extend({
content: e[n]
}, i));
b = jQuery.merge(b, e)
} else
"object" == typeof e ? t(e).data("fancybox", t.extend({}, i, e)) : e = t({}).data("fancybox", t.extend({
content: e
}, i)), b.push(e);
(g > b.length || 0 > g) && (g = 0),
P()
}
},
t.fancybox.showActivity = function () {
clearInterval(l),
i.show(),
l = setInterval(G, 66)
},
t.fancybox.hideActivity = function () {
i.hide()
},
t.fancybox.next = function () {
return t.fancybox.pos(y + 1)
},
t.fancybox.prev = function () {
return t.fancybox.pos(y - 1)
},
t.fancybox.pos = function (t) {
A || (t = parseInt(t), b = m, t > -1 && t < m.length ? (g = t, P()) : w.cyclic && m.length > 1 && (g = t < m.length ? m.length - 1 : 0, P()))
},
t.fancybox.cancel = function () {
A || (A = !0, t(".fancybox-inline-tmp").trigger("fancybox-cancel"), S(), u.onCancel(b, g, u), A = !1)
},
t.fancybox.close = function () {
function e() {
n.fadeOut("fast"),
r.empty().hide(),
a.hide(),
t(".fancybox-inline-tmp").trigger("fancybox-cleanup"),
d.empty(),
w.onClosed(m, y, w),
m = u = [],
y = g = 0,
w = u = {},
A = !1
}
if (!A && !a.is(":hidden")) {
if (A = !0, w && !1 === w.onCleanup(m, y, w))
return void(A = !1);
if (S(), t(c.add(s).add(h)).hide(), t(d.add(n)).off(), t(window).off("resize.fb scroll.fb mousewheel.fb"), t(document).off("keydown.fb"), d.find("iframe#fancybox-frame").attr("src", N && /^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank"), "inside" !== w.titlePosition && r.empty(), a.stop(), "elastic" == w.transitionOut) {
f = U();
var i = a.position();
p = {
top: i.top,
left: i.left,
width: a.width(),
height: a.height()
},
w.opacity && (p.opacity = 1),
r.empty().hide(),
D.prop = 1,
t(D).animate({
prop: 0
}, {
duration: w.speedOut,
easing: w.easingOut,
step: q,
complete: e
})
} else
a.fadeOut("none" == w.transitionOut ? 0 : w.speedOut, e)
}
},
t.fancybox.resize = function () {
n.is(":visible") && n.css("height", t(document).height()),
E || t.fancybox.center(!0)
},
t.fancybox.center = function () {
var t,
e;
A || (e = arguments[0] === !0 ? 1 : 0, t = X(), (e || a.width() <= t[0] && a.height() <= t[1]) && a.stop().animate({
top: parseInt(Math.max(t[3] - 20, t[3] + .5 * (t[1] - d.height() - 40) - w.padding)),
left: parseInt(Math.max(t[2] - 20, t[2] + .5 * (t[0] - d.width() - 40) - w.padding))
}, "number" == typeof arguments[0] ? arguments[0] : 200))
},
t.fancybox.init = function () {
t("#fancybox-wrap").length || (t("body").append(e = t('<div id="fancybox-tmp"></div>'), i = t('<div id="fancybox-loading"><div></div></div>'), n = t('<div id="fancybox-overlay"></div>'), a = t('<div id="fancybox-wrap"></div>')), o = t('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(a), o.append(d = t('<div id="fancybox-content"></div>'), c = t('<a id="fancybox-close"></a>'), r = t('<div id="fancybox-title"></div>'), s = t('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), h = t('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')), c.click(t.fancybox.close), i.click(t.fancybox.cancel), s.click(function (e) {
e.preventDefault(),
t.fancybox.prev()
}), h.click(function (e) {
e.preventDefault(),
t.fancybox.next()
}), t.support.opacity || a.addClass("fancybox-ie"), N && (i.addClass("fancybox-ie6"), a.addClass("fancybox-ie6"), t('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || "") ? "javascript:void(false)" : "about:blank") + '" style="overflow:hidden;border:0" tabindex="-1"></iframe>').prependTo(o)))
},
t.fn.fancybox.defaults = {
padding: 10,
margin: 40,
opacity: !1,
modal: !1,
cyclic: !1,
allowfullscreen: !1,
scrolling: "auto",
width: 560,
height: 340,
autoScale: !0,
autoDimensions: !0,
centerOnScroll: !E,
autoResize: !0,
ajax: {},
swf: {
wmode: "opaque"
},
svg: {
wmode: "opaque"
},
hideOnOverlayClick: !0,
hideOnContentClick: !1,
overlayShow: !0,
overlayOpacity: .7,
overlayColor: "#777",
titleShow: !0,
titlePosition: "float",
titleFormat: null,
titleFromAlt: !1,
transitionIn: "fade",
transitionOut: "fade",
speedIn: 300,
speedOut: 300,
changeSpeed: 300,
changeFade: "fast",
easingIn: "swing",
easingOut: "swing",
showCloseButton: !0,
showNavArrows: !0,
enableEscapeButton: !0,
enableKeyboardNav: !0,
onStart: function () {},
onCancel: function () {},
onComplete: function () {},
onCleanup: function () {},
onClosed: function () {},
onError: function () {}
},
t(document).ready(function () {
t.fancybox.init()
})
}
(jQuery);
(function (h) {
h.easing.jswing = h.easing.swing;
h.extend(h.easing, {
def: "easeOutQuad",
swing: function (e, a, c, b, d) {
return h.easing[h.easing.def](e, a, c, b, d)
},
easeInQuad: function (e, a, c, b, d) {
return b * (a /= d) * a + c
},
easeOutQuad: function (e, a, c, b, d) {
return -b * (a /= d) * (a - 2) + c
},
easeInOutQuad: function (e, a, c, b, d) {
return 1 > (a /= d / 2) ? b / 2 * a * a + c : -b / 2 * (--a * (a - 2) - 1) + c
},
easeInCubic: function (e, a, c, b, d) {
return b * (a /= d) * a * a + c
},
easeOutCubic: function (e, a, c, b, d) {
return b * ((a = a / d - 1) * a * a + 1) + c
},
easeInOutCubic: function (e, a, c, b, d) {
return 1 > (a /= d / 2) ? b / 2 * a * a * a + c : b / 2 * ((a -= 2) * a * a + 2) + c
},
easeInQuart: function (e, a, c, b, d) {
return b * (a /= d) * a * a * a + c
},
easeOutQuart: function (e, a, c, b, d) {
return -b * ((a = a / d - 1) * a * a * a - 1) + c
},
easeInOutQuart: function (e, a, c, b, d) {
return 1 > (a /= d / 2) ? b / 2 * a * a * a * a + c : -b / 2 * ((a -= 2) * a * a * a - 2) + c
},
easeInQuint: function (e, a, c, b, d) {
return b * (a /= d) * a * a * a * a + c
},
easeOutQuint: function (e, a, c, b, d) {
return b * ((a = a / d - 1) * a * a * a * a + 1) + c
},
easeInOutQuint: function (e, a, c, b, d) {
return 1 > (a /= d / 2) ? b / 2 * a * a * a * a * a + c : b / 2 * ((a -= 2) * a * a * a * a + 2) + c
},
easeInSine: function (e, a, c, b, d) {
return -b * Math.cos(a / d * (Math.PI / 2)) + b + c
},
easeOutSine: function (e, a, c, b, d) {
return b * Math.sin(a / d * (Math.PI / 2)) + c
},
easeInOutSine: function (e, a, c, b, d) {
return -b / 2 * (Math.cos(Math.PI * a / d) - 1) + c
},
easeInExpo: function (e, a, c, b, d) {
return 0 == a ? c : b * Math.pow(2, 10 * (a / d - 1)) + c
},
easeOutExpo: function (e, a, c, b, d) {
return a == d ? c + b : b * (-Math.pow(2, -10 * a / d) + 1) + c
},
easeInOutExpo: function (e, a, c, b, d) {
return 0 == a ? c : a == d ? c + b : 1 > (a /= d / 2) ? b / 2 * Math.pow(2, 10 * (a - 1)) + c : b / 2 * (-Math.pow(2, -10 * --a) + 2) + c
},
easeInCirc: function (e, a, c, b, d) {
return -b * (Math.sqrt(1 - (a /= d) * a) - 1) + c
},
easeOutCirc: function (e, a, c, b, d) {
return b * Math.sqrt(1 - (a = a / d - 1) * a) + c
},
easeInOutCirc: function (e, a, c, b, d) {
return 1 > (a /= d / 2) ? -b / 2 * (Math.sqrt(1 - a * a) - 1) + c : b / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + c
},
easeInElastic: function (e, a, c, b, d) {
e = 1.70158;
var f = 0,
g = b;
if (0 == a)
return c;
if (1 == (a /= d))
return c + b;
f || (f = .3 * d);
g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
return - (g * Math.pow(2, 10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / f)) + c
},
easeOutElastic: function (e, a, c, b, d) {
e = 1.70158;
var f = 0,
g = b;
if (0 == a)
return c;
if (1 == (a /= d))
return c + b;
f || (f = .3 * d);
g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
return g * Math.pow(2, -10 * a) * Math.sin(2 * (a * d - e) * Math.PI / f) + b + c
},
easeInOutElastic: function (e, a, c, b, d) {
e = 1.70158;
var f = 0,
g = b;
if (0 == a)
return c;
if (2 == (a /= d / 2))
return c + b;
f || (f = .3 * d * 1.5);
g < Math.abs(b) ? (g = b, e = f / 4) : e = f / (2 * Math.PI) * Math.asin(b / g);
return 1 > a ? - .5 * g * Math.pow(2, 10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / f) + c : g * Math.pow(2, -10 * --a) * Math.sin(2 * (a * d - e) * Math.PI / f) * .5 + b + c
},
easeInBack: function (e, a, c, b, d, f) {
void 0 == f && (f = 1.70158);
return b * (a /= d) * a * ((f + 1) * a - f) + c
},
easeOutBack: function (e, a, c, b, d, f) {
void 0 == f && (f = 1.70158);
return b * ((a = a / d - 1) * a * ((f + 1) * a + f) + 1) + c
},
easeInOutBack: function (e, a, c, b, d, f) {
void 0 == f && (f = 1.70158);
return 1 > (a /= d / 2) ? b / 2 * a * a * (((f *= 1.525) + 1) * a - f) + c : b / 2 * ((a -= 2) * a * (((f *= 1.525) + 1) * a + f) + 2) + c
},
easeInBounce: function (e, a, c, b, d) {
return b - h.easing.easeOutBounce(e, d - a, 0, b, d) + c
},
easeOutBounce: function (e, a, c, b, d) {
return (a /= d) < 1 / 2.75 ? 7.5625 * b * a * a + c : a < 2 / 2.75 ? b * (7.5625 * (a -= 1.5 / 2.75) * a + .75) + c : a < 2.5 / 2.75 ? b * (7.5625 * (a -= 2.25 / 2.75) * a + .9375) + c : b * (7.5625 * (a -= 2.625 / 2.75) * a + .984375) + c
},
easeInOutBounce: function (e, a, c, b, d) {
return a < d / 2 ? .5 * h.easing.easeInBounce(e, 2 * a, 0, b, d) + c : .5 * h.easing.easeOutBounce(e, 2 * a - d, 0, b, d) + .5 * b + c
}
})
})(jQuery);
!function (a) {
"function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a : a(jQuery)
}
(function (a) {
function b(b) {
var g = b || window.event,
h = i.call(arguments, 1),
j = 0,
l = 0,
m = 0,
n = 0,
o = 0,
p = 0;
if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheelDelta" in g && (m = g.wheelDelta), "wheelDeltaY" in g && (m = g.wheelDeltaY), "wheelDeltaX" in g && (l = -1 * g.wheelDeltaX), "axis" in g && g.axis === g.HORIZONTAL_AXIS && (l = -1 * m, m = 0), j = 0 === m ? l : m, "deltaY" in g && (m = -1 * g.deltaY, j = m), "deltaX" in g && (l = g.deltaX, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) {
if (1 === g.deltaMode) {
var q = a.data(this, "mousewheel-line-height");
j *= q,
m *= q,
l *= q
} else if (2 === g.deltaMode) {
var r = a.data(this, "mousewheel-page-height");
j *= r,
m *= r,
l *= r
}
if (n = Math.max(Math.abs(m), Math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = Math[j >= 1 ? "floor" : "ceil"](j / f), l = Math[l >= 1 ? "floor" : "ceil"](l / f), m = Math[m >= 1 ? "floor" : "ceil"](m / f), k.settings.normalizeOffset && this.getBoundingClientRect) {
var s = this.getBoundingClientRect();
o = b.clientX - s.left,
p = b.clientY - s.top
}
return b.deltaX = l,
b.deltaY = m,
b.deltaFactor = f,
b.offsetX = o,
b.offsetY = p,
b.deltaMode = 0,
h.unshift(b, j, l, m),
e && clearTimeout(e),
e = setTimeout(c, 200),
(a.event.dispatch || a.event.handle).apply(this, h)
}
}
function c() {
f = null
}
function d(a, b) {
return k.settings.adjustOldDeltas && "mousewheel" === a.type && b % 120 === 0
}
var e,
f,
g = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
i = Array.prototype.slice;
if (a.event.fixHooks)
for (var j = g.length; j; )
a.event.fixHooks[g[--j]] = a.event.mouseHooks;
var k = a.event.special.mousewheel = {
version: "3.1.12",
setup: function () {
if (this.addEventListener)
for (var c = h.length; c; )
this.addEventListener(h[--c], b, !1);
else
this.onmousewheel = b;
a.data(this, "mousewheel-line-height", k.getLineHeight(this)),
a.data(this, "mousewheel-page-height", k.getPageHeight(this))
},
teardown: function () {
if (this.removeEventListener)
for (var c = h.length; c; )
this.removeEventListener(h[--c], b, !1);
else
this.onmousewheel = null;
a.removeData(this, "mousewheel-line-height"),
a.removeData(this, "mousewheel-page-height")
},
getLineHeight: function (b) {
var c = a(b),
d = c["offsetParent" in a.fn ? "offsetParent" : "parent"]();
return d.length || (d = a("body")),
parseInt(d.css("fontSize"), 10) || parseInt(c.css("fontSize"), 10) || 16
},
getPageHeight: function (b) {
return a(b).height()
},
settings: {
adjustOldDeltas: !0,
normalizeOffset: !0
}
};
a.fn.extend({
mousewheel: function (a) {
return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
},
unmousewheel: function (a) {
return this.unbind("mousewheel", a)
}
})
});
jQuery(document).on('ready post-load', function () {
jQuery('.nofancybox,a.pin-it-button,a[href*="pinterest.com/pin/create/button"]').addClass('nolightbox');
});
jQuery(document).on('ready post-load', easy_fancybox_handler);
jQuery(document).on('ready', easy_fancybox_auto);
alert('script ending');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment