· 7 years ago · Nov 06, 2018, 07:50 PM
1/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
2jQuery.migrateMute === void 0 && (jQuery.migrateMute = !0),
3 function(e, t, n) {
4 function r(n) {
5 var r = t.console;
6 i[n] || (i[n] = !0, e.migrateWarnings.push(n), r && r.warn && !e.migrateMute && (r.warn("JQMIGRATE: " + n), e.migrateTrace && r.trace && r.trace()))
7 }
8
9 function a(t, a, i, o) {
10 if (Object.defineProperty) try {
11 return Object.defineProperty(t, a, {
12 configurable: !0,
13 enumerable: !0,
14 get: function() {
15 return r(o), i
16 },
17 set: function(e) {
18 r(o), i = e
19 }
20 }), n
21 } catch (s) {}
22 e._definePropertyBroken = !0, t[a] = i
23 }
24 var i = {};
25 e.migrateWarnings = [], !e.migrateMute && t.console && t.console.log && t.console.log("JQMIGRATE: Logging is active"), e.migrateTrace === n && (e.migrateTrace = !0), e.migrateReset = function() {
26 i = {}, e.migrateWarnings.length = 0
27 }, "BackCompat" === document.compatMode && r("jQuery is not compatible with Quirks Mode");
28 var o = e("<input/>", {
29 size: 1
30 }).attr("size") && e.attrFn,
31 s = e.attr,
32 u = e.attrHooks.value && e.attrHooks.value.get || function() {
33 return null
34 },
35 c = e.attrHooks.value && e.attrHooks.value.set || function() {
36 return n
37 },
38 l = /^(?:input|button)$/i,
39 d = /^[238]$/,
40 p = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
41 f = /^(?:checked|selected)$/i;
42 a(e, "attrFn", o || {}, "jQuery.attrFn is deprecated"), e.attr = function(t, a, i, u) {
43 var c = a.toLowerCase(),
44 g = t && t.nodeType;
45 return u && (4 > s.length && r("jQuery.fn.attr( props, pass ) is deprecated"), t && !d.test(g) && (o ? a in o : e.isFunction(e.fn[a]))) ? e(t)[a](i) : ("type" === a && i !== n && l.test(t.nodeName) && t.parentNode && r("Can't change the 'type' of an input or button in IE 6/7/8"), !e.attrHooks[c] && p.test(c) && (e.attrHooks[c] = {
46 get: function(t, r) {
47 var a, i = e.prop(t, r);
48 return i === !0 || "boolean" != typeof i && (a = t.getAttributeNode(r)) && a.nodeValue !== !1 ? r.toLowerCase() : n
49 },
50 set: function(t, n, r) {
51 var a;
52 return n === !1 ? e.removeAttr(t, r) : (a = e.propFix[r] || r, a in t && (t[a] = !0), t.setAttribute(r, r.toLowerCase())), r
53 }
54 }, f.test(c) && r("jQuery.fn.attr('" + c + "') may use property instead of attribute")), s.call(e, t, a, i))
55 }, e.attrHooks.value = {
56 get: function(e, t) {
57 var n = (e.nodeName || "").toLowerCase();
58 return "button" === n ? u.apply(this, arguments) : ("input" !== n && "option" !== n && r("jQuery.fn.attr('value') no longer gets properties"), t in e ? e.value : null)
59 },
60 set: function(e, t) {
61 var a = (e.nodeName || "").toLowerCase();
62 return "button" === a ? c.apply(this, arguments) : ("input" !== a && "option" !== a && r("jQuery.fn.attr('value', val) no longer sets properties"), e.value = t, n)
63 }
64 };
65 var g, h, v = e.fn.init,
66 m = e.parseJSON,
67 y = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
68 e.fn.init = function(t, n, a) {
69 var i;
70 return t && "string" == typeof t && !e.isPlainObject(n) && (i = y.exec(e.trim(t))) && i[0] && ("<" !== t.charAt(0) && r("$(html) HTML strings must start with '<' character"), i[3] && r("$(html) HTML text after last tag is ignored"), "#" === i[0].charAt(0) && (r("HTML string cannot start with a '#' character"), e.error("JQMIGRATE: Invalid selector string (XSS)")), n && n.context && (n = n.context), e.parseHTML) ? v.call(this, e.parseHTML(i[2], n, !0), n, a) : v.apply(this, arguments)
71 }, e.fn.init.prototype = e.fn, e.parseJSON = function(e) {
72 return e || null === e ? m.apply(this, arguments) : (r("jQuery.parseJSON requires a valid JSON string"), null)
73 }, e.uaMatch = function(e) {
74 e = e.toLowerCase();
75 var t = /(chrome)[ \/]([\w.]+)/.exec(e) || /(webkit)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || 0 > e.indexOf("compatible") && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || [];
76 return {
77 browser: t[1] || "",
78 version: t[2] || "0"
79 }
80 }, e.browser || (g = e.uaMatch(navigator.userAgent), h = {}, g.browser && (h[g.browser] = !0, h.version = g.version), h.chrome ? h.webkit = !0 : h.webkit && (h.safari = !0), e.browser = h), a(e, "browser", e.browser, "jQuery.browser is deprecated"), e.sub = function() {
81 function t(e, n) {
82 return new t.fn.init(e, n)
83 }
84 e.extend(!0, t, this), t.superclass = this, t.fn = t.prototype = this(), t.fn.constructor = t, t.sub = this.sub, t.fn.init = function(r, a) {
85 return a && a instanceof e && !(a instanceof t) && (a = t(a)), e.fn.init.call(this, r, a, n)
86 }, t.fn.init.prototype = t.fn;
87 var n = t(document);
88 return r("jQuery.sub() is deprecated"), t
89 }, e.ajaxSetup({
90 converters: {
91 "text json": e.parseJSON
92 }
93 });
94 var b = e.fn.data;
95 e.fn.data = function(t) {
96 var a, i, o = this[0];
97 return !o || "events" !== t || 1 !== arguments.length || (a = e.data(o, t), i = e._data(o, t), a !== n && a !== i || i === n) ? b.apply(this, arguments) : (r("Use of jQuery.fn.data('events') is deprecated"), i)
98 };
99 var j = /\/(java|ecma)script/i,
100 w = e.fn.andSelf || e.fn.addBack;
101 e.fn.andSelf = function() {
102 return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"), w.apply(this, arguments)
103 }, e.clean || (e.clean = function(t, a, i, o) {
104 a = a || document, a = !a.nodeType && a[0] || a, a = a.ownerDocument || a, r("jQuery.clean() is deprecated");
105 var s, u, c, l, d = [];
106 if (e.merge(d, e.buildFragment(t, a).childNodes), i)
107 for (c = function(e) {
108 return !e.type || j.test(e.type) ? o ? o.push(e.parentNode ? e.parentNode.removeChild(e) : e) : i.appendChild(e) : n
109 }, s = 0; null != (u = d[s]); s++) e.nodeName(u, "script") && c(u) || (i.appendChild(u), u.getElementsByTagName !== n && (l = e.grep(e.merge([], u.getElementsByTagName("script")), c), d.splice.apply(d, [s + 1, 0].concat(l)), s += l.length));
110 return d
111 });
112 var Q = e.event.add,
113 x = e.event.remove,
114 k = e.event.trigger,
115 N = e.fn.toggle,
116 T = e.fn.live,
117 M = e.fn.die,
118 S = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
119 C = RegExp("\\b(?:" + S + ")\\b"),
120 H = /(?:^|\s)hover(\.\S+|)\b/,
121 A = function(t) {
122 return "string" != typeof t || e.event.special.hover ? t : (H.test(t) && r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"), t && t.replace(H, "mouseenter$1 mouseleave$1"))
123 };
124 e.event.props && "attrChange" !== e.event.props[0] && e.event.props.unshift("attrChange", "attrName", "relatedNode", "srcElement"), e.event.dispatch && a(e.event, "handle", e.event.dispatch, "jQuery.event.handle is undocumented and deprecated"), e.event.add = function(e, t, n, a, i) {
125 e !== document && C.test(t) && r("AJAX events should be attached to document: " + t), Q.call(this, e, A(t || ""), n, a, i)
126 }, e.event.remove = function(e, t, n, r, a) {
127 x.call(this, e, A(t) || "", n, r, a)
128 }, e.fn.error = function() {
129 var e = Array.prototype.slice.call(arguments, 0);
130 return r("jQuery.fn.error() is deprecated"), e.splice(0, 0, "error"), arguments.length ? this.bind.apply(this, e) : (this.triggerHandler.apply(this, e), this)
131 }, e.fn.toggle = function(t, n) {
132 if (!e.isFunction(t) || !e.isFunction(n)) return N.apply(this, arguments);
133 r("jQuery.fn.toggle(handler, handler...) is deprecated");
134 var a = arguments,
135 i = t.guid || e.guid++,
136 o = 0,
137 s = function(n) {
138 var r = (e._data(this, "lastToggle" + t.guid) || 0) % o;
139 return e._data(this, "lastToggle" + t.guid, r + 1), n.preventDefault(), a[r].apply(this, arguments) || !1
140 };
141 for (s.guid = i; a.length > o;) a[o++].guid = i;
142 return this.click(s)
143 }, e.fn.live = function(t, n, a) {
144 return r("jQuery.fn.live() is deprecated"), T ? T.apply(this, arguments) : (e(this.context).on(t, this.selector, n, a), this)
145 }, e.fn.die = function(t, n) {
146 return r("jQuery.fn.die() is deprecated"), M ? M.apply(this, arguments) : (e(this.context).off(t, this.selector || "**", n), this)
147 }, e.event.trigger = function(e, t, n, a) {
148 return n || C.test(e) || r("Global events are undocumented and deprecated"), k.call(this, e, t, n || document, a)
149 }, e.each(S.split("|"), function(t, n) {
150 e.event.special[n] = {
151 setup: function() {
152 var t = this;
153 return t !== document && (e.event.add(document, n + "." + e.guid, function() {
154 e.event.trigger(n, null, t, !0)
155 }), e._data(this, n, e.guid++)), !1
156 },
157 teardown: function() {
158 return this !== document && e.event.remove(document, n + "." + e._data(this, n)), !1
159 }
160 }
161 })
162 }(jQuery, window);
163
164/*
165 jQuery Tools dev - The missing UI library for the Web
166
167 dateinput/dateinput.js
168 overlay/overlay.js
169 overlay/overlay.apple.js
170 rangeinput/rangeinput.js
171 scrollable/scrollable.js
172 scrollable/scrollable.autoscroll.js
173 scrollable/scrollable.navigator.js
174 tabs/tabs.js
175 toolbox/toolbox.expose.js
176 toolbox/toolbox.history.js
177 toolbox/toolbox.mousewheel.js
178 tooltip/tooltip.js
179 tooltip/tooltip.slide.js
180
181 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
182
183 http://flowplayer.org/tools/
184
185 jquery.event.wheel.js - rev 1
186 Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
187 Liscensed under the MIT License (MIT-LICENSE.txt)
188 http://www.opensource.org/licenses/mit-license.php
189 Created: 2008-07-01 | Updated: 2008-07-14
190
191 -----
192
193*/
194(function(a, v) {
195 function n(a, b) {
196 a = "" + a;
197 for (b = b || 2; a.length < b;) a = "0" + a;
198 return a
199 }
200
201 function f(a, b, c, d) {
202 var g = b.getDate(),
203 e = b.getDay(),
204 k = b.getMonth(),
205 f = b.getFullYear(),
206 g = {
207 d: g,
208 dd: n(g),
209 ddd: m[d].shortDays[e],
210 dddd: m[d].days[e],
211 m: k + 1,
212 mm: n(k + 1),
213 mmm: m[d].shortMonths[k],
214 mmmm: m[d].months[k],
215 yy: String(f).slice(2),
216 yyyy: f
217 };
218 a = h[a](c, b, g, d);
219 return q.html(a).html()
220 }
221
222 function d(a) {
223 return parseInt(a, 10)
224 }
225
226 function c(a, b) {
227 return a.getFullYear() === b.getFullYear() && a.getMonth() == b.getMonth() && a.getDate() == b.getDate()
228 }
229
230 function b(a) {
231 if (a !==
232 v) {
233 if (a.constructor == Date) return a;
234 if ("string" == typeof a) {
235 var b = a.split("-");
236 if (3 == b.length) return new Date(d(b[0]), d(b[1]) - 1, d(b[2]));
237 if (!/^-?\d+$/.test(a)) return;
238 a = d(a)
239 }
240 b = new Date;
241 b.setDate(b.getDate() + a);
242 return b
243 }
244 }
245
246 function e(e, h) {
247 function k(b, c, d) {
248 e.attr("readonly") ? l.hide(d) : (D = b, L = b.getFullYear(), N = b.getMonth(), M = b.getDate(), d || (d = a.Event("api")), "click" != d.type || a.browser.msie || e.focus(), d.type = "beforeChange", O.trigger(d, [b]), d.isDefaultPrevented() || (e.val(f(c.formatter, b, c.format, c.lang)),
249 d.type = "change", O.trigger(d), e.data("date", b), l.hide(d)))
250 }
251
252 function w(b) {
253 b.type = "onShow";
254 O.trigger(b);
255 a(document).on("keydown.d", function(b) {
256 if (b.ctrlKey) return !0;
257 var c = b.keyCode;
258 if (8 == c || 46 == c) return e.val(""), l.hide(b);
259 if (27 == c || 9 == c) return l.hide(b);
260 if (0 <= a(r).index(c)) {
261 if (!G) return l.show(b), b.preventDefault();
262 var d = a("#" + p.weeks + " a"),
263 h = a("." + p.focus),
264 g = d.index(h);
265 h.removeClass(p.focus);
266 74 == c || 40 == c ? g += 7 : 75 == c || 38 == c ? g -= 7 : 76 == c || 39 == c ? g += 1 : 72 != c && 37 != c || --g;
267 41 < g ? (l.addMonth(), h = a("#" + p.weeks +
268 " a:eq(" + (g - 42) + ")")) : 0 > g ? (l.addMonth(-1), h = a("#" + p.weeks + " a:eq(" + (g + 42) + ")")) : h = d.eq(g);
269 h.addClass(p.focus);
270 return b.preventDefault()
271 }
272 if (34 == c) return l.addMonth();
273 if (33 == c) return l.addMonth(-1);
274 if (36 == c) return l.today();
275 13 == c && (a(b.target).is("select") || a("." + p.focus).click());
276 return 0 <= a([16, 17, 18, 9]).index(c)
277 });
278 a(document).on("click.d", function(b) {
279 var c = b.target;
280 c.id == p.root || a(c).parents("#" + p.root).length || c == e[0] || y && c == y[0] || l.hide(b)
281 })
282 }
283 var l = this,
284 q = new Date,
285 u = q.getFullYear(),
286 p = h.css,
287 n = m[h.lang],
288 x = a("#" + p.root),
289 F = x.find("#" + p.title),
290 y, H, I, L, N, M, D = e.attr("data-value") || h.value || e.val(),
291 A = e.attr("min") || h.min,
292 E = e.attr("max") || h.max,
293 G, P;
294 0 === A && (A = "0");
295 D = b(D) || q;
296 A = b(A || new Date(u + h.yearRange[0], 1, 1));
297 E = b(E || new Date(u + h.yearRange[1] + 1, 1, -1));
298 if (!n) throw "Dateinput: invalid language: " + h.lang;
299 "date" == e.attr("type") && (P = e.clone(), u = P.wrap("<div/>").parent().html(), u = a(u.replace(/type/i, "type=text data-orig-type")), h.value && u.val(h.value), e.replaceWith(u), e = u);
300 e.addClass(p.input);
301 var O = e.add(l);
302 if (!x.length) {
303 x = a("<div><div><a/><div/><a/></div><div><div/><div/></div></div>").hide().css({
304 position: "absolute"
305 }).attr("id", p.root);
306 x.children().eq(0).attr("id", p.head).end().eq(1).attr("id", p.body).children().eq(0).attr("id", p.days).end().eq(1).attr("id", p.weeks).end().end().end().find("a").eq(0).attr("id", p.prev).end().eq(1).attr("id", p.next);
307 F = x.find("#" + p.head).find("div").attr("id", p.title);
308 if (h.selectors) {
309 var J = a("<select/>").attr("id", p.month),
310 K = a("<select/>").attr("id", p.year);
311 F.html(J.add(K))
312 }
313 for (var u =
314 x.find("#" + p.days), S = 0; 7 > S; S++) u.append(a("<span/>").text(n.shortDays[(S + h.firstDay) % 7]));
315 a("body").append(x)
316 }
317 h.trigger && (y = a("<a/>").attr("href", "#").addClass(p.trigger).click(function(a) {
318 h.toggle ? l.toggle() : l.show();
319 return a.preventDefault()
320 }).insertAfter(e));
321 var Q = x.find("#" + p.weeks),
322 K = x.find("#" + p.year),
323 J = x.find("#" + p.month);
324 a.extend(l, {
325 show: function(b) {
326 if (!e.attr("disabled") && !G && (b = a.Event(), b.type = "onBeforeShow", O.trigger(b), !b.isDefaultPrevented())) {
327 a.each(g, function() {
328 this.hide()
329 });
330 G = !0;
331 J.off("change").change(function() {
332 l.setValue(d(K.val()), d(a(this).val()))
333 });
334 K.off("change").change(function() {
335 l.setValue(d(a(this).val()), d(J.val()))
336 });
337 H = x.find("#" + p.prev).off("click").click(function(a) {
338 H.hasClass(p.disabled) || l.addMonth(-1);
339 return !1
340 });
341 I = x.find("#" + p.next).off("click").click(function(a) {
342 I.hasClass(p.disabled) || l.addMonth();
343 return !1
344 });
345 l.setValue(D);
346 var c = e.offset();
347 /iPad/i.test(navigator.userAgent) && (c.top -= a(window).scrollTop());
348 x.css({
349 top: c.top + e.outerHeight(!0) + h.offset[0],
350 left: c.left +
351 h.offset[1]
352 });
353 h.speed ? x.show(h.speed, function() {
354 w(b)
355 }) : (x.show(), w(b));
356 return l
357 }
358 },
359 setValue: function(g, e, w) {
360 var f = -1 <= d(e) ? new Date(d(g), d(e), d(w == v || isNaN(w) ? 1 : w)) : g || D;
361 f < A ? f = A : f > E && (f = E);
362 "string" == typeof g && (f = b(g));
363 g = f.getFullYear();
364 e = f.getMonth();
365 w = f.getDate(); - 1 == e ? (e = 11, g--) : 12 == e && (e = 0, g++);
366 if (!G) return k(f, h), l;
367 N = e;
368 L = g;
369 M = w;
370 w = (new Date(g, e, 1 - h.firstDay)).getDay();
371 var t = (new Date(g, e + 1, 0)).getDate(),
372 r = (new Date(g, e - 1 + 1, 0)).getDate(),
373 u;
374 if (h.selectors) {
375 J.empty();
376 a.each(n.months, function(b, c) {
377 A <
378 new Date(g, b + 1, 1) && E > new Date(g, b, 0) && J.append(a("<option/>").html(c).attr("value", b))
379 });
380 K.empty();
381 for (var f = q.getFullYear(), m = f + h.yearRange[0]; m < f + h.yearRange[1]; m++) A < new Date(m + 1, 0, 1) && E > new Date(m, 0, 0) && K.append(a("<option/>").text(m));
382 J.val(e);
383 K.val(g)
384 } else F.html(n.months[e] + " " + g);
385 Q.empty();
386 H.add(I).removeClass(p.disabled);
387 for (var m = w ? 0 : -7, x, y; m < (w ? 42 : 35); m++) x = a("<a/>"), 0 === m % 7 && (u = a("<div/>").addClass(p.week), Q.append(u)), m < w ? (x.addClass(p.off), y = r - w + m + 1, f = new Date(g, e - 1, y)) : m >= w + t ? (x.addClass(p.off),
388 y = m - t - w + 1, f = new Date(g, e + 1, y)) : (y = m - w + 1, f = new Date(g, e, y), c(D, f) ? x.attr("id", p.current).addClass(p.focus) : c(q, f) && x.attr("id", p.today)), A && f < A && x.add(H).addClass(p.disabled), E && f > E && x.add(I).addClass(p.disabled), x.attr("href", "#" + y).text(y).data("date", f), u.append(x);
389 Q.find("a").click(function(b) {
390 var c = a(this);
391 c.hasClass(p.disabled) || (a("#" + p.current).removeAttr("id"), c.attr("id", p.current), k(c.data("date"), h, b));
392 return !1
393 });
394 p.sunday && Q.find("." + p.week).each(function() {
395 var b = h.firstDay ? 7 - h.firstDay :
396 0;
397 a(this).children().slice(b, b + 1).addClass(p.sunday)
398 });
399 return l
400 },
401 setMin: function(a, c) {
402 A = b(a);
403 c && D < A && l.setValue(A);
404 return l
405 },
406 setMax: function(a, c) {
407 E = b(a);
408 c && D > E && l.setValue(E);
409 return l
410 },
411 today: function() {
412 return l.setValue(q)
413 },
414 addDay: function(a) {
415 return this.setValue(L, N, M + (a || 1))
416 },
417 addMonth: function(a) {
418 a = N + (a || 1);
419 var b = (new Date(L, a + 1, 0)).getDate();
420 return this.setValue(L, a, M <= b ? M : b)
421 },
422 addYear: function(a) {
423 return this.setValue(L + (a || 1), N, M)
424 },
425 destroy: function() {
426 e.add(document).off("click.d keydown.d");
427 x.add(y).remove();
428 e.removeData("dateinput").removeClass(p.input);
429 P && e.replaceWith(P)
430 },
431 hide: function(b) {
432 if (G) {
433 b = a.Event();
434 b.type = "onHide";
435 O.trigger(b);
436 if (b.isDefaultPrevented()) return;
437 a(document).off("click.d keydown.d");
438 x.hide();
439 G = !1
440 }
441 return l
442 },
443 toggle: function() {
444 return l.isOpen() ? l.hide() : l.show()
445 },
446 getConf: function() {
447 return h
448 },
449 getInput: function() {
450 return e
451 },
452 getCalendar: function() {
453 return x
454 },
455 getValue: function(a) {
456 return a ? f(h.formatter, D, a, h.lang) : D
457 },
458 isOpen: function() {
459 return G
460 }
461 });
462 a.each(["onBeforeShow", "onShow", "change",
463 "onHide"
464 ], function(b, c) {
465 if (a.isFunction(h[c])) a(l).on(c, h[c]);
466 l[c] = function(b) {
467 if (b) a(l).on(c, b);
468 return l
469 }
470 });
471 h.editable || e.on("focus.d click.d", l.show).keydown(function(b) {
472 var c = b.keyCode;
473 if (!G && 0 <= a(r).index(c)) return l.show(b), b.preventDefault();
474 8 != c && 46 != c || e.val("");
475 return b.shiftKey || b.ctrlKey || b.altKey || 9 == c ? !0 : b.preventDefault()
476 });
477 b(e.val()) && k(D, h)
478 }
479 a.tools = a.tools || {
480 version: "1.2.8-dev"
481 };
482 var g = [],
483 h = {},
484 k, r = [75, 76, 38, 39, 74, 72, 40, 37],
485 m = {};
486 k = a.tools.dateinput = {
487 conf: {
488 format: "mm/dd/yy",
489 formatter: "default",
490 selectors: !1,
491 yearRange: [-5, 5],
492 lang: "en",
493 offset: [0, 0],
494 speed: 0,
495 firstDay: 0,
496 min: v,
497 max: v,
498 trigger: 0,
499 toggle: 0,
500 editable: 0,
501 css: {
502 prefix: "cal",
503 input: "date",
504 root: 0,
505 head: 0,
506 title: 0,
507 prev: 0,
508 next: 0,
509 month: 0,
510 year: 0,
511 days: 0,
512 body: 0,
513 weeks: 0,
514 today: 0,
515 current: 0,
516 week: 0,
517 off: 0,
518 sunday: 0,
519 focus: 0,
520 disabled: 0,
521 trigger: 0
522 }
523 },
524 addFormatter: function(a, b) {
525 h[a] = b
526 },
527 localize: function(b, c) {
528 a.each(c, function(a, b) {
529 c[a] = b.split(",")
530 });
531 m[b] = c
532 }
533 };
534 k.localize("en", {
535 months: "January,February,March,April,May,June,July,August,September,October,November,December",
536 shortMonths: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
537 days: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",
538 shortDays: "Sun,Mon,Tue,Wed,Thu,Fri,Sat"
539 });
540 var q = a("<a/>");
541 k.addFormatter("default", function(a, b, c, d) {
542 return a.replace(/d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*'/g, function(a) {
543 return a in c ? c[a] : a
544 })
545 });
546 k.addFormatter("prefixed", function(a, b, c, d) {
547 return a.replace(/%(d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*')/g, function(a, b) {
548 return b in c ? c[b] : a
549 })
550 });
551 a.expr[":"].date = function(b) {
552 var c =
553 b.getAttribute("type");
554 return c && "date" == c || !!a(b).data("dateinput")
555 };
556 a.fn.dateinput = function(b) {
557 if (this.data("dateinput")) return this;
558 b = a.extend(!0, {}, k.conf, b);
559 a.each(b.css, function(a, c) {
560 c || "prefix" == a || (b.css[a] = (b.css.prefix || "") + (c || a))
561 });
562 var c;
563 this.each(function() {
564 var d = new e(a(this), b);
565 g.push(d);
566 d = d.getInput().data("dateinput", d);
567 c = c ? c.add(d) : d
568 });
569 return c ? c : this
570 }
571})(jQuery);
572(function(a) {
573 function v(d, c) {
574 var b = this,
575 e = d.add(b),
576 g = a(window),
577 h, k, r, m = a.tools.expose && (c.mask || c.expose),
578 q = Math.random().toString().slice(10);
579 m && ("string" == typeof m && (m = {
580 color: m
581 }), m.closeOnClick = m.closeOnEsc = !1);
582 var t = c.target || d.attr("rel");
583 k = t ? a(t) : d;
584 if (!k.length) throw "Could not find Overlay: " + t;
585 if (d && -1 == d.index(k)) d.off("click.jqtoverlay").on("click.jqtoverlay", function(a) {
586 if (d.attr("href") && (a.ctrlKey || a.shiftKey || a.altKey || 1 < a.which)) return !0;
587 b.load(a);
588 return a.preventDefault()
589 });
590 a.extend(b, {
591 load: function(d) {
592 if (b.isOpened()) return b;
593 var h = f[c.effect];
594 if (!h) throw 'Overlay: cannot find effect : "' + c.effect + '"';
595 c.oneInstance && a.each(n, function() {
596 this.close(d)
597 });
598 d = d || a.Event();
599 d.type = "onBeforeLoad";
600 e.trigger(d);
601 if (d.isDefaultPrevented()) return b;
602 r = !0;
603 m && a(k).expose(m);
604 var w = c.top,
605 l = c.left,
606 t = k.outerWidth(!0),
607 u = k.outerHeight(!0);
608 "string" == typeof w && (w = "center" == w ? Math.max((g.height() - u) / 2, 0) : parseInt(w, 10) / 100 * g.height());
609 "center" == l && (l = Math.max((g.width() - t) / 2, 0));
610 h[0].call(b, {
611 top: w,
612 left: l
613 },
614 function() {
615 r && (d.type = "onLoad", e.trigger(d))
616 });
617 if (m && c.closeOnClick) a.mask.getMask().one("click", b.close);
618 if (c.closeOnClick) a(document).on("click." + q, function(c) {
619 a(c.target).parents(k).length || b.close(c)
620 });
621 if (c.closeOnEsc) a(document).on("keydown." + q, function(a) {
622 27 == a.keyCode && b.close(a)
623 });
624 return b
625 },
626 close: function(d) {
627 if (!b.isOpened()) return b;
628 d = a.Event();
629 d.type = "onBeforeClose";
630 e.trigger(d);
631 if (!d.isDefaultPrevented()) return r = !1, f[c.effect][1].call(b, function() {
632 d.type = "onClose";
633 e.trigger(d)
634 }), a(document).off("click." +
635 q + " keydown." + q), m && a.mask.close(), b
636 },
637 getOverlay: function() {
638 return k
639 },
640 getTrigger: function() {
641 return d
642 },
643 getClosers: function() {
644 return h
645 },
646 isOpened: function() {
647 return r
648 },
649 getConf: function() {
650 return c
651 }
652 });
653 a.each(["onBeforeLoad", "onStart", "onLoad", "onBeforeClose", "onClose"], function(d, g) {
654 if (a.isFunction(c[g])) a(b).on(g, c[g]);
655 b[g] = function(c) {
656 if (c) a(b).on(g, c);
657 return b
658 }
659 });
660 h = k.find(c.close || ".close");
661 h.length || c.close || (h = a('<a class="close"></a>'), k.prepend(h));
662 h.click(function(a) {
663 b.close(a)
664 });
665 c.load && b.load()
666 }
667 a.tools = a.tools || {
668 version: "1.2.8-dev"
669 };
670 a.tools.overlay = {
671 addEffect: function(a, c, b) {
672 f[a] = [c, b]
673 },
674 conf: {
675 close: null,
676 closeOnClick: !0,
677 closeOnEsc: !0,
678 closeSpeed: "fast",
679 effect: "default",
680 fixed: !a.browser.msie || 6 < a.browser.version,
681 left: "center",
682 load: !1,
683 mask: null,
684 oneInstance: !0,
685 speed: "normal",
686 target: null,
687 top: "10%"
688 }
689 };
690 var n = [],
691 f = {};
692 a.tools.overlay.addEffect("default", function(d, c) {
693 var b = this.getConf(),
694 e = a(window);
695 b.fixed || (d.top += e.scrollTop(), d.left += e.scrollLeft());
696 d.position = b.fixed ? "fixed" : "absolute";
697 this.getOverlay().css(d).fadeIn(b.speed,
698 c)
699 }, function(a) {
700 this.getOverlay().fadeOut(this.getConf().closeSpeed, a)
701 });
702 a.fn.overlay = function(d) {
703 var c = this.data("overlay");
704 if (c) return c;
705 a.isFunction(d) && (d = {
706 onBeforeLoad: d
707 });
708 d = a.extend(!0, {}, a.tools.overlay.conf, d);
709 this.each(function() {
710 c = new v(a(this), d);
711 n.push(c);
712 a(this).data("overlay", c)
713 });
714 return d.api ? c : this
715 }
716})(jQuery);
717(function(a) {
718 function v(a) {
719 var c = a.offset();
720 return {
721 top: c.top + a.height() / 2,
722 left: c.left + a.width() / 2
723 }
724 }
725 var n = a.tools.overlay,
726 f = a(window);
727 a.extend(n.conf, {
728 start: {
729 top: null,
730 left: null
731 },
732 fadeInSpeed: "fast",
733 zIndex: 9999
734 });
735 n.addEffect("apple", function(d, c) {
736 var b = this.getOverlay(),
737 e = this.getConf(),
738 g = this.getTrigger(),
739 h = this,
740 k = b.outerWidth(!0),
741 r = b.data("img"),
742 m = e.fixed ? "fixed" : "absolute";
743 if (!r) {
744 r = b.css("backgroundImage");
745 if (!r) throw "background-image CSS property not set for overlay";
746 r = r.slice(r.indexOf("(") + 1, r.indexOf(")")).replace(/\"/g,
747 "");
748 b.css("backgroundImage", "none");
749 r = a('<img src="' + r + '"/>');
750 r.css({
751 border: 0,
752 display: "none"
753 }).width(k);
754 a("body").append(r);
755 b.data("img", r)
756 }
757 var q = e.start.top || Math.round(f.height() / 2),
758 t = e.start.left || Math.round(f.width() / 2);
759 g && (g = v(g), q = g.top, t = g.left);
760 e.fixed ? (q -= f.scrollTop(), t -= f.scrollLeft()) : (d.top += f.scrollTop(), d.left += f.scrollLeft());
761 r.css({
762 position: "absolute",
763 top: q,
764 left: t,
765 width: 0,
766 zIndex: e.zIndex
767 }).show();
768 d.position = m;
769 b.css(d);
770 r.animate({
771 top: d.top,
772 left: d.left,
773 width: k
774 }, e.speed, function() {
775 b.css("zIndex",
776 e.zIndex + 1).fadeIn(e.fadeInSpeed, function() {
777 h.isOpened() && !a(this).index(b) ? c.call() : b.hide()
778 })
779 }).css("position", m)
780 }, function(d) {
781 var c = this.getOverlay().hide(),
782 b = this.getConf(),
783 e = this.getTrigger(),
784 c = c.data("img"),
785 g = {
786 top: b.start.top,
787 left: b.start.left,
788 width: 0
789 };
790 e && a.extend(g, v(e));
791 b.fixed && c.css({
792 position: "absolute"
793 }).animate({
794 top: "+=" + f.scrollTop(),
795 left: "+=" + f.scrollLeft()
796 }, 0);
797 c.animate(g, b.closeSpeed, d)
798 })
799})(jQuery);
800(function(a) {
801 function v(a, b) {
802 var c = Math.pow(10, b);
803 return Math.round(a * c) / c
804 }
805
806 function n(a, b) {
807 var c = parseInt(a.css(b), 10);
808 return c ? c : (c = a[0].currentStyle) && c.width && parseInt(c.width, 10)
809 }
810
811 function f(a) {
812 return (a = a.data("events")) && a.onSlide
813 }
814
815 function d(b, c) {
816 function d(a, e, f, l) {
817 void 0 === f ? f = e / C * R : l && (f -= c.min);
818 x && (f = Math.round(f / x) * x);
819 if (void 0 === e || x) e = f * C / R;
820 if (isNaN(f)) return q;
821 e = Math.max(0, Math.min(e, C));
822 f = e / C * R;
823 if (l || !B) f += c.min;
824 B && (l ? e = C - e : f = c.max - f);
825 f = v(f, F);
826 var k = "click" == a.type;
827 if (I && void 0 !== w &&
828 !k && (a.type = "onSlide", H.trigger(a, [f, e]), a.isDefaultPrevented())) return q;
829 l = k ? c.speed : 0;
830 k = k ? function() {
831 a.type = "change";
832 H.trigger(a, [f])
833 } : null;
834 B ? (u.animate({
835 top: e
836 }, l, k), c.progress && p.animate({
837 height: C - e + u.height() / 2
838 }, l)) : (u.animate({
839 left: e
840 }, l, k), c.progress && p.animate({
841 width: e + u.width() / 2
842 }, l));
843 w = f;
844 b.val(f);
845 return q
846 }
847
848 function e() {
849 (B = c.vertical || n(z, "height") > n(z, "width")) ? (C = n(z, "height") - n(u, "height"), l = z.offset().top + C) : (C = n(z, "width") - n(u, "width"), l = z.offset().left)
850 }
851
852 function m() {
853 e();
854 q.setValue(void 0 !==
855 c.value ? c.value : c.min)
856 }
857 var q = this,
858 t = c.css,
859 z = a("<div><div/><a href='#'/></div>").data("rangeinput", q),
860 B, w, l, C;
861 b.before(z);
862 var u = z.addClass(t.slider).find("a").addClass(t.handle),
863 p = z.find("div").addClass(t.progress);
864 a.each(["min", "max", "step", "value"], function(a, d) {
865 var e = b.attr(d);
866 parseFloat(e) && (c[d] = parseFloat(e, 10))
867 });
868 var R = c.max - c.min,
869 x = "any" == c.step ? 0 : c.step,
870 F = c.precision;
871 void 0 === F && (F = x.toString().split("."), F = 2 === F.length ? F[1].length : 0);
872 if ("range" == b.attr("type")) {
873 var y = b.clone().wrap("<div/>").parent().html(),
874 y = a(y.replace(/type/i, "type=text data-orig-type"));
875 y.val(c.value);
876 b.replaceWith(y);
877 b = y
878 }
879 b.addClass(t.input);
880 var H = a(q).add(b),
881 I = !0;
882 a.extend(q, {
883 getValue: function() {
884 return w
885 },
886 setValue: function(b, c) {
887 e();
888 return d(c || a.Event("api"), void 0, b, !0)
889 },
890 getConf: function() {
891 return c
892 },
893 getProgress: function() {
894 return p
895 },
896 getHandle: function() {
897 return u
898 },
899 getInput: function() {
900 return b
901 },
902 step: function(b, d) {
903 d = d || a.Event();
904 q.setValue(w + ("any" == c.step ? 1 : c.step) * (b || 1), d)
905 },
906 stepUp: function(a) {
907 return q.step(a || 1)
908 },
909 stepDown: function(a) {
910 return q.step(-a ||
911 -1)
912 }
913 });
914 a.each(["onSlide", "change"], function(b, d) {
915 if (a.isFunction(c[d])) a(q).on(d, c[d]);
916 q[d] = function(b) {
917 if (b) a(q).on(d, b);
918 return q
919 }
920 });
921 u.drag({
922 drag: !1
923 }).on("dragStart", function() {
924 e();
925 I = f(a(q)) || f(b)
926 }).on("drag", function(a, c, e) {
927 if (b.is(":disabled")) return !1;
928 d(a, B ? c : e)
929 }).on("dragEnd", function(a) {
930 a.isDefaultPrevented() || (a.type = "change", H.trigger(a, [w]))
931 }).click(function(a) {
932 return a.preventDefault()
933 });
934 z.click(function(a) {
935 if (b.is(":disabled") || a.target == u[0]) return a.preventDefault();
936 e();
937 var c = B ? u.height() /
938 2 : u.width() / 2;
939 d(a, B ? C - l - c + a.pageY : a.pageX - l - c)
940 });
941 c.keyboard && b.keydown(function(c) {
942 if (!b.attr("readonly")) {
943 var d = c.keyCode,
944 e = -1 != a([75, 76, 38, 33, 39]).index(d),
945 h = -1 != a([74, 72, 40, 34, 37]).index(d);
946 if ((e || h) && !(c.shiftKey || c.altKey || c.ctrlKey)) return e ? q.step(33 == d ? 10 : 1, c) : h && q.step(34 == d ? -10 : -1, c), c.preventDefault()
947 }
948 });
949 b.blur(function(b) {
950 var c = a(this).val();
951 c !== w && q.setValue(c, b)
952 });
953 a.extend(b[0], {
954 stepUp: q.stepUp,
955 stepDown: q.stepDown
956 });
957 m();
958 C || a(window).load(m)
959 }
960 a.tools = a.tools || {
961 version: "1.2.8-dev"
962 };
963 var c;
964 c = a.tools.rangeinput = {
965 conf: {
966 min: 0,
967 max: 100,
968 step: "any",
969 steps: 0,
970 value: 0,
971 precision: void 0,
972 vertical: 0,
973 keyboard: !0,
974 progress: !1,
975 speed: 100,
976 css: {
977 input: "range",
978 slider: "slider",
979 progress: "progress",
980 handle: "handle"
981 }
982 }
983 };
984 var b, e;
985 a.fn.drag = function(c) {
986 document.ondragstart = function() {
987 return !1
988 };
989 c = a.extend({
990 x: !0,
991 y: !0,
992 drag: !0
993 }, c);
994 b = b || a(document).on("mousedown mouseup", function(d) {
995 var f = a(d.target);
996 if ("mousedown" == d.type && f.data("drag")) {
997 var r = f.position(),
998 m = d.pageX - r.left,
999 q = d.pageY - r.top,
1000 t = !0;
1001 b.on("mousemove.drag", function(a) {
1002 var b =
1003 a.pageX - m;
1004 a = a.pageY - q;
1005 var d = {};
1006 c.x && (d.left = b);
1007 c.y && (d.top = a);
1008 t && (f.trigger("dragStart"), t = !1);
1009 c.drag && f.css(d);
1010 f.trigger("drag", [a, b]);
1011 e = f
1012 });
1013 d.preventDefault()
1014 } else try {
1015 e && e.trigger("dragEnd")
1016 } finally {
1017 b.off("mousemove.drag"), e = null
1018 }
1019 });
1020 return this.data("drag", !0)
1021 };
1022 a.expr[":"].range = function(b) {
1023 var c = b.getAttribute("type");
1024 return c && "range" == c || !!a(b).filter("input").data("rangeinput")
1025 };
1026 a.fn.rangeinput = function(b) {
1027 if (this.data("rangeinput")) return this;
1028 b = a.extend(!0, {}, c.conf, b);
1029 var e;
1030 this.each(function() {
1031 var c =
1032 new d(a(this), a.extend(!0, {}, b)),
1033 c = c.getInput().data("rangeinput", c);
1034 e = e ? e.add(c) : c
1035 });
1036 return e ? e : this
1037 }
1038})(jQuery);
1039(function(a) {
1040 function v(d, c) {
1041 var b = a(c);
1042 return 2 > b.length ? b : d.parent().find(c)
1043 }
1044
1045 function n(d, c) {
1046 var b = this,
1047 e = d.add(b),
1048 g = d.children(),
1049 h = 0,
1050 k = c.vertical;
1051 f || (f = b);
1052 1 < g.length && (g = a(c.items, d));
1053 1 < c.size && (c.circular = !1);
1054 a.extend(b, {
1055 getConf: function() {
1056 return c
1057 },
1058 getIndex: function() {
1059 return h
1060 },
1061 getSize: function() {
1062 return b.getItems().size()
1063 },
1064 getNaviButtons: function() {
1065 return q.add(t)
1066 },
1067 getRoot: function() {
1068 return d
1069 },
1070 getItemWrap: function() {
1071 return g
1072 },
1073 getItems: function() {
1074 return g.find(c.item).not("." + c.clonedClass)
1075 },
1076 getCircularClones: function() {
1077 return g.find(c.item).filter("." + c.clonedClass)
1078 },
1079 move: function(a, c) {
1080 return b.seekTo(h + a, c)
1081 },
1082 next: function(a) {
1083 return b.move(c.size, a)
1084 },
1085 prev: function(a) {
1086 return b.move(-c.size, a)
1087 },
1088 begin: function(a) {
1089 return b.seekTo(0, a)
1090 },
1091 end: function(a) {
1092 return b.seekTo(b.getSize() - 1, a)
1093 },
1094 focus: function() {
1095 return f = b
1096 },
1097 addItem: function(d) {
1098 d = a(d);
1099 c.circular ? (g.children().last().before(d), b.getCircularClones().first().replaceWith(d.clone().addClass(c.clonedClass))) : (g.append(d), t.removeClass("disabled"));
1100 e.trigger("onAddItem", [d]);
1101 return b
1102 },
1103 removeItem: function(a) {
1104 e.trigger("onRemoveItem", [a]);
1105 var d = b.getItems(),
1106 g;
1107 a.jquery ? b.getItems().index(g) : (g = 1 * a, a = b.getItems().eq(g));
1108 c.circular ? (a.remove(), d = b.getItems(), a = b.getCircularClones(), a.first().replaceWith(d.last().clone().addClass("cloned")), a.last().replaceWith(d.first().clone().addClass("cloned"))) : (a.remove(), b.getItems());
1109 h >= b.getSize() && (--h, b.move(1));
1110 return b
1111 },
1112 seekTo: function(d, l, q) {
1113 d.jquery || (d *= 1);
1114 if (c.circular && 0 === d && -1 == h && 0 !== l || !c.circular &&
1115 0 > d || d > b.getSize() || -1 > d) return b;
1116 var m = d;
1117 d.jquery ? d = b.getItems().index(d) : m = b.getItems().eq(d);
1118 var t = a.Event("onBeforeSeek");
1119 if (!q && (e.trigger(t, [d, l]), t.isDefaultPrevented() || !m.length)) return b;
1120 m = k ? {
1121 top: -m.position().top
1122 } : {
1123 left: -m.position().left
1124 };
1125 h = d;
1126 f = b;
1127 void 0 === l && (l = c.speed);
1128 g.animate(m, l, c.easing, q || function() {
1129 e.trigger("onSeek", [d])
1130 });
1131 return b
1132 }
1133 });
1134 a.each(["onBeforeSeek", "onSeek", "onAddItem", "onRemoveItem"], function(d, e) {
1135 if (a.isFunction(c[e])) a(b).on(e, c[e]);
1136 b[e] = function(c) {
1137 if (c) a(b).on(e,
1138 c);
1139 return b
1140 }
1141 });
1142 if (c.circular) {
1143 var r = b.getItems().slice(-1).clone().prependTo(g),
1144 m = b.getItems().eq(1).clone().appendTo(g);
1145 r.add(m).addClass(c.clonedClass);
1146 b.onBeforeSeek(function(a, c, d) {
1147 if (!a.isDefaultPrevented()) {
1148 var e = b.getCircularClones();
1149 if (-1 == c) return b.seekTo(e.first(), d, function() {
1150 b.end(0)
1151 }), a.preventDefault();
1152 c == b.getSize() && b.seekTo(e.last(), d, function() {
1153 b.begin(0)
1154 })
1155 }
1156 });
1157 r = d.parents().add(d).filter(function() {
1158 if ("none" === a(this).css("display")) return !0
1159 });
1160 r.length ? (r.show(), b.seekTo(0, 0, function() {}),
1161 r.hide()) : b.seekTo(0, 0, function() {})
1162 }
1163 var q = v(d, c.prev).click(function(a) {
1164 a.stopPropagation();
1165 b.prev()
1166 }),
1167 t = v(d, c.next).click(function(a) {
1168 a.stopPropagation();
1169 b.next()
1170 });
1171 c.circular || (b.onBeforeSeek(function(a, d) {
1172 setTimeout(function() {
1173 a.isDefaultPrevented() || (q.toggleClass(c.disabledClass, 0 >= d), t.toggleClass(c.disabledClass, d >= b.getSize() - 1))
1174 }, 1)
1175 }), c.initialIndex || q.addClass(c.disabledClass));
1176 2 > b.getSize() && q.add(t).addClass(c.disabledClass);
1177 c.mousewheel && a.fn.mousewheel && d.mousewheel(function(a, d) {
1178 if (c.mousewheel) return b.move(0 >
1179 d ? 1 : -1, c.wheelSpeed || 50), !1
1180 });
1181 if (c.touch) {
1182 var n, B;
1183 g[0].ontouchstart = function(a) {
1184 a = a.touches[0];
1185 n = a.clientX;
1186 B = a.clientY
1187 };
1188 g[0].ontouchmove = function(a) {
1189 if (1 == a.touches.length && !g.is(":animated")) {
1190 var c = a.touches[0],
1191 d = n - c.clientX,
1192 c = B - c.clientY;
1193 b[k && 0 < c || !k && 0 < d ? "next" : "prev"]();
1194 a.preventDefault()
1195 }
1196 }
1197 }
1198 if (c.keyboard) a(document).on("keydown.scrollable", function(d) {
1199 if (!(!c.keyboard || d.altKey || d.ctrlKey || d.metaKey || a(d.target).is(":input") || "static" != c.keyboard && f != b)) {
1200 var e = d.keyCode;
1201 if (k && (38 == e || 40 == e)) return b.move(38 ==
1202 e ? -1 : 1), d.preventDefault();
1203 if (!k && (37 == e || 39 == e)) return b.move(37 == e ? -1 : 1), d.preventDefault()
1204 }
1205 });
1206 c.initialIndex && b.seekTo(c.initialIndex, 0, function() {})
1207 }
1208 a.tools = a.tools || {
1209 version: "1.2.8-dev"
1210 };
1211 a.tools.scrollable = {
1212 conf: {
1213 activeClass: "active",
1214 circular: !1,
1215 clonedClass: "cloned",
1216 disabledClass: "disabled",
1217 easing: "swing",
1218 initialIndex: 0,
1219 item: "> *",
1220 items: ".items",
1221 keyboard: !0,
1222 mousewheel: !1,
1223 next: ".next",
1224 prev: ".prev",
1225 size: 1,
1226 speed: 400,
1227 vertical: !1,
1228 touch: !0,
1229 wheelSpeed: 0
1230 }
1231 };
1232 var f;
1233 a.fn.scrollable = function(d) {
1234 var c = this.data("scrollable");
1235 if (c) return c;
1236 d = a.extend({}, a.tools.scrollable.conf, d);
1237 this.each(function() {
1238 c = new n(a(this), d);
1239 a(this).data("scrollable", c)
1240 });
1241 return d.api ? c : this
1242 }
1243})(jQuery);
1244(function(a) {
1245 var v = a.tools.scrollable;
1246 v.autoscroll = {
1247 conf: {
1248 autoplay: !0,
1249 interval: 3E3,
1250 autopause: !0
1251 }
1252 };
1253 a.fn.autoscroll = function(n) {
1254 "number" == typeof n && (n = {
1255 interval: n
1256 });
1257 var f = a.extend({}, v.autoscroll.conf, n),
1258 d;
1259 this.each(function() {
1260 function c() {
1261 g && clearTimeout(g);
1262 g = setTimeout(function() {
1263 b.next()
1264 }, f.interval)
1265 }
1266 var b = a(this).data("scrollable"),
1267 e = b.getRoot(),
1268 g, h = !1;
1269 b && (d = b);
1270 b.play = function() {
1271 g || (h = !1, e.on("onSeek", c), c())
1272 };
1273 b.hoverPlay = function() {
1274 h || b.play()
1275 };
1276 b.pause = function() {
1277 g = clearTimeout(g);
1278 e.off("onSeek",
1279 c)
1280 };
1281 b.resume = function() {
1282 h || b.play()
1283 };
1284 b.stop = function() {
1285 h = !0;
1286 b.pause()
1287 };
1288 f.autopause && e.add(b.getNaviButtons()).hover(b.pause, b.resume);
1289 f.autoplay && b.play();
1290 b.onRemoveItem(function(a, c) {
1291 2 >= b.getSize() && b.stop()
1292 })
1293 });
1294 return f.api ? d : this
1295 }
1296})(jQuery);
1297(function(a) {
1298 function v(f, d) {
1299 var c = a(d);
1300 return 2 > c.length ? c : f.parent().find(d)
1301 }
1302 var n = a.tools.scrollable;
1303 n.navigator = {
1304 conf: {
1305 navi: ".navi",
1306 naviItem: null,
1307 activeClass: "active",
1308 indexed: !1,
1309 idPrefix: null,
1310 history: !1
1311 }
1312 };
1313 a.fn.navigator = function(f) {
1314 "string" == typeof f && (f = {
1315 navi: f
1316 });
1317 f = a.extend({}, n.navigator.conf, f);
1318 var d;
1319 this.each(function() {
1320 function c() {
1321 return g.find(f.naviItem || "> *")
1322 }
1323
1324 function b(b) {
1325 var c = a("<" + (f.naviItem || "a") + "/>").click(function(c) {
1326 a(this);
1327 e.seekTo(b);
1328 c.preventDefault();
1329 n && history.pushState({
1330 i: b
1331 },
1332 "")
1333 });
1334 0 === b && c.addClass(k);
1335 f.indexed && c.text(b + 1);
1336 f.idPrefix && c.attr("id", f.idPrefix + b);
1337 return c.appendTo(g)
1338 }
1339 var e = a(this).data("scrollable"),
1340 g = f.navi.jquery ? f.navi : v(e.getRoot(), f.navi),
1341 h = e.getNaviButtons(),
1342 k = f.activeClass,
1343 n = f.history && !!history.pushState,
1344 m = e.getConf().size;
1345 e && (d = e);
1346 e.getNaviButtons = function() {
1347 return h.add(g)
1348 };
1349 n && (history.pushState({
1350 i: 0
1351 }, ""), a(window).on("popstate", function(a) {
1352 (a = a.originalEvent.state) && e.seekTo(a.i)
1353 }));
1354 c().length ? c().click(function(b) {
1355 a(this);
1356 var d = c().index(this);
1357 e.seekTo(d);
1358 b.preventDefault();
1359 n && history.pushState({
1360 i: d
1361 }, "")
1362 }) : a.each(e.getItems(), function(a) {
1363 0 == a % m && b(a)
1364 });
1365 e.onBeforeSeek(function(a, b) {
1366 setTimeout(function() {
1367 if (!a.isDefaultPrevented()) {
1368 var d = b / m;
1369 c().eq(d).length && c().removeClass(k).eq(d).addClass(k)
1370 }
1371 }, 1)
1372 });
1373 e.onAddItem(function(a, c) {
1374 var d = e.getItems().index(c);
1375 0 == d % m && b(d)
1376 });
1377 e.onRemoveItem(function(a, b) {
1378 var d = e.getItems().index(b);
1379 c().eq(d).remove();
1380 c().removeClass(k).eq(d < e.getSize() - 1 ? d : 0).addClass(k)
1381 })
1382 });
1383 return f.api ? d : this
1384 }
1385})(jQuery);
1386(function(a) {
1387 function v(c, b, d) {
1388 var g = this,
1389 f = c.add(this),
1390 k = c.find(d.tabs),
1391 r = b.jquery ? b : c.children(b),
1392 m;
1393 k.length || (k = c.children());
1394 r.length || (r = c.parent().find(b));
1395 r.length || (r = a(b));
1396 a.extend(this, {
1397 click: function(b, t) {
1398 var r = k.eq(b),
1399 v = !c.data("tabs");
1400 "string" == typeof b && b.replace("#", "") && (r = k.filter('[href*="' + b.replace("#", "") + '"]'), b = Math.max(k.index(r), 0));
1401 if (d.rotate) {
1402 var w = k.length - 1;
1403 if (0 > b) return g.click(w, t);
1404 if (b > w) return g.click(0, t)
1405 }
1406 if (!r.length) {
1407 if (0 <= m) return g;
1408 b = d.initialIndex;
1409 r = k.eq(b)
1410 }
1411 if (b ===
1412 m) return g;
1413 t = t || a.Event();
1414 t.type = "onBeforeClick";
1415 f.trigger(t, [b]);
1416 if (!t.isDefaultPrevented()) return n[v ? d.initialEffect && d.effect || "default" : d.effect].call(g, b, function() {
1417 m = b;
1418 t.type = "onClick";
1419 f.trigger(t, [b])
1420 }), k.removeClass(d.current), r.addClass(d.current), g
1421 },
1422 getConf: function() {
1423 return d
1424 },
1425 getTabs: function() {
1426 return k
1427 },
1428 getPanes: function() {
1429 return r
1430 },
1431 getCurrentPane: function() {
1432 return r.eq(m)
1433 },
1434 getCurrentTab: function() {
1435 return k.eq(m)
1436 },
1437 getIndex: function() {
1438 return m
1439 },
1440 next: function() {
1441 return g.click(m + 1)
1442 },
1443 prev: function() {
1444 return g.click(m -
1445 1)
1446 },
1447 destroy: function() {
1448 k.off(d.event).removeClass(d.current);
1449 r.find('a[href^="#"]').off("click.T");
1450 return g
1451 }
1452 });
1453 a.each(["onBeforeClick", "onClick"], function(b, c) {
1454 if (a.isFunction(d[c])) a(g).on(c, d[c]);
1455 g[c] = function(b) {
1456 if (b) a(g).on(c, b);
1457 return g
1458 }
1459 });
1460 d.history && a.fn.history && (a.tools.history.init(k), d.event = "history");
1461 k.each(function(b) {
1462 a(this).on(d.event, function(a) {
1463 g.click(b, a);
1464 return a.preventDefault()
1465 })
1466 });
1467 r.find('a[href^="#"]').on("click.T", function(b) {
1468 g.click(a(this).attr("href"), b)
1469 });
1470 location.hash &&
1471 "a" == d.tabs && c.find('[href="' + location.hash.replace('"', "") + '"]').length ? g.click(location.hash) : (0 === d.initialIndex || 0 < d.initialIndex) && g.click(d.initialIndex)
1472 }
1473 a.tools = a.tools || {
1474 version: "1.2.8-dev"
1475 };
1476 a.tools.tabs = {
1477 conf: {
1478 tabs: "a",
1479 current: "current",
1480 onBeforeClick: null,
1481 onClick: null,
1482 effect: "default",
1483 initialEffect: !1,
1484 initialIndex: 0,
1485 event: "click",
1486 rotate: !1,
1487 slideUpSpeed: 400,
1488 slideDownSpeed: 400,
1489 history: !1
1490 },
1491 addEffect: function(a, b) {
1492 n[a] = b
1493 }
1494 };
1495 var n = {
1496 "default": function(a, b) {
1497 this.getPanes().hide().eq(a).show();
1498 b.call()
1499 },
1500 fade: function(a, b) {
1501 var d = this.getConf(),
1502 g = d.fadeOutSpeed,
1503 f = this.getPanes();
1504 g ? f.fadeOut(g) : f.hide();
1505 f.eq(a).fadeIn(d.fadeInSpeed, b)
1506 },
1507 slide: function(a, b) {
1508 var d = this.getConf();
1509 this.getPanes().slideUp(d.slideUpSpeed);
1510 this.getPanes().eq(a).slideDown(d.slideDownSpeed, b)
1511 },
1512 ajax: function(a, b) {
1513 this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"), b)
1514 }
1515 },
1516 f, d;
1517 a.tools.tabs.addEffect("horizontal", function(c, b) {
1518 if (!f) {
1519 var e = this.getPanes().eq(c),
1520 g = this.getCurrentPane();
1521 d || (d = this.getPanes().eq(0).width());
1522 f = !0;
1523 e.show();
1524 g.animate({
1525 width: 0
1526 }, {
1527 step: function(a) {
1528 e.css("width", d - a)
1529 },
1530 complete: function() {
1531 a(this).hide();
1532 b.call();
1533 f = !1
1534 }
1535 });
1536 g.length || (b.call(), f = !1)
1537 }
1538 });
1539 a.fn.tabs = function(c, b) {
1540 var d = this.data("tabs");
1541 d && (d.destroy(), this.removeData("tabs"));
1542 a.isFunction(b) && (b = {
1543 onBeforeClick: b
1544 });
1545 b = a.extend({}, a.tools.tabs.conf, b);
1546 this.each(function() {
1547 d = new v(a(this), c, b);
1548 a(this).data("tabs", d)
1549 });
1550 return b.api ? d : this
1551 }
1552})(jQuery);
1553(function(a) {
1554 function v() {
1555 if (a.browser.msie) {
1556 var b = a(document).height(),
1557 c = a(window).height();
1558 return [window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 20 > b - c ? c : b]
1559 }
1560 return [a(document).width(), a(document).height()]
1561 }
1562
1563 function n(b) {
1564 if (b) return b.call(a.mask)
1565 }
1566 a.tools = a.tools || {
1567 version: "1.2.8-dev"
1568 };
1569 var f;
1570 f = a.tools.expose = {
1571 conf: {
1572 maskId: "exposeMask",
1573 loadSpeed: "slow",
1574 closeSpeed: "fast",
1575 closeOnClick: !0,
1576 closeOnEsc: !0,
1577 zIndex: 9998,
1578 opacity: .8,
1579 startOpacity: 0,
1580 color: "#fff",
1581 onLoad: null,
1582 onClose: null
1583 }
1584 };
1585 var d, c, b, e, g;
1586 a.mask = {
1587 load: function(h, k) {
1588 if (b) return this;
1589 "string" == typeof h && (h = {
1590 color: h
1591 });
1592 h = h || e;
1593 e = h = a.extend(a.extend({}, f.conf), h);
1594 d = a("#" + h.maskId);
1595 d.length || (d = a("<div/>").attr("id", h.maskId), a("body").append(d));
1596 var r = v();
1597 d.css({
1598 position: "absolute",
1599 top: 0,
1600 left: 0,
1601 width: r[0],
1602 height: r[1],
1603 display: "none",
1604 opacity: h.startOpacity,
1605 zIndex: h.zIndex
1606 });
1607 h.color && d.css("backgroundColor", h.color);
1608 if (!1 === n(h.onBeforeLoad)) return this;
1609 if (h.closeOnEsc) a(document).on("keydown.mask", function(b) {
1610 27 ==
1611 b.keyCode && a.mask.close(b)
1612 });
1613 if (h.closeOnClick) d.on("click.mask", function(b) {
1614 a.mask.close(b)
1615 });
1616 a(window).on("resize.mask", function() {
1617 a.mask.fit()
1618 });
1619 k && k.length && (g = k.eq(0).css("zIndex"), a.each(k, function() {
1620 var b = a(this);
1621 /relative|absolute|fixed/i.test(b.css("position")) || b.css("position", "relative")
1622 }), c = k.css({
1623 zIndex: Math.max(h.zIndex + 1, "auto" == g ? 0 : g)
1624 }));
1625 d.css({
1626 display: "block"
1627 }).fadeTo(h.loadSpeed, h.opacity, function() {
1628 a.mask.fit();
1629 n(h.onLoad);
1630 b = "full"
1631 });
1632 b = !0;
1633 return this
1634 },
1635 close: function() {
1636 if (b) {
1637 if (!1 ===
1638 n(e.onBeforeClose)) return this;
1639 d.fadeOut(e.closeSpeed, function() {
1640 c && c.css({
1641 zIndex: g
1642 });
1643 b = !1;
1644 n(e.onClose)
1645 });
1646 a(document).off("keydown.mask");
1647 d.off("click.mask");
1648 a(window).off("resize.mask")
1649 }
1650 return this
1651 },
1652 fit: function() {
1653 if (b) {
1654 var a = d.css("display");
1655 d.css("display", "none");
1656 var c = v();
1657 d.css({
1658 display: a,
1659 width: c[0],
1660 height: c[1]
1661 })
1662 }
1663 },
1664 getMask: function() {
1665 return d
1666 },
1667 isLoaded: function(a) {
1668 return a ? "full" == b : b
1669 },
1670 getConf: function() {
1671 return e
1672 },
1673 getExposed: function() {
1674 return c
1675 }
1676 };
1677 a.fn.mask = function(b) {
1678 a.mask.load(b);
1679 return this
1680 };
1681 a.fn.expose = function(b) {
1682 a.mask.load(b, this);
1683 return this
1684 }
1685})(jQuery);
1686(function(a) {
1687 function v(a) {
1688 if (a) {
1689 var c = f.contentWindow.document;
1690 c.open().close();
1691 c.location.hash = a
1692 }
1693 }
1694 var n, f, d, c;
1695 a.tools = a.tools || {
1696 version: "1.2.8-dev"
1697 };
1698 a.tools.history = {
1699 init: function(b) {
1700 c || (a.browser.msie && "8" > a.browser.version ? f || (f = a("<iframe/>").attr("src", "javascript:false;").hide().get(0), a("body").append(f), setInterval(function() {
1701 var b = f.contentWindow.document.location.hash;
1702 n !== b && a(window).trigger("hash", b)
1703 }, 100), v(location.hash || "#")) : setInterval(function() {
1704 var b = location.hash;
1705 b !== n && a(window).trigger("hash",
1706 b)
1707 }, 100), d = d ? d.add(b) : b, b.click(function(b) {
1708 var c = a(this).attr("href");
1709 f && v(c);
1710 if ("#" != c.slice(0, 1)) return location.href = "#" + c, b.preventDefault()
1711 }), c = !0)
1712 }
1713 };
1714 a(window).on("hash", function(b, c) {
1715 c ? d.filter(function() {
1716 var b = a(this).attr("href");
1717 return b == c || b == c.replace("#", "")
1718 }).trigger("history", [c]) : d.eq(0).trigger("history", [c]);
1719 n = c
1720 });
1721 a.fn.history = function(b) {
1722 a.tools.history.init(this);
1723 return this.on("history", b)
1724 }
1725})(jQuery);
1726(function(a) {
1727 function v(f) {
1728 switch (f.type) {
1729 case "mousemove":
1730 return a.extend(f.data, {
1731 clientX: f.clientX,
1732 clientY: f.clientY,
1733 pageX: f.pageX,
1734 pageY: f.pageY
1735 });
1736 case "DOMMouseScroll":
1737 a.extend(f, f.data);
1738 f.delta = -f.detail / 3;
1739 break;
1740 case "mousewheel":
1741 f.delta = f.wheelDelta / 120
1742 }
1743 f.type = "wheel";
1744 return a.event.handle.call(this, f, f.delta)
1745 }
1746 a.fn.mousewheel = function(a) {
1747 return this[a ? "on" : "trigger"]("wheel", a)
1748 };
1749 a.event.special.wheel = {
1750 setup: function() {
1751 a.event.add(this, n, v, {})
1752 },
1753 teardown: function() {
1754 a.event.remove(this, n, v)
1755 }
1756 };
1757 var n =
1758 a.browser.mozilla ? "DOMMouseScroll" + ("1.9" > a.browser.version ? " mousemove" : "") : "mousewheel"
1759})(jQuery);
1760(function(a) {
1761 function v(d, c, b) {
1762 var e = b.relative ? d.position().top : d.offset().top,
1763 g = b.relative ? d.position().left : d.offset().left,
1764 f = b.position[0],
1765 e = e - (c.outerHeight() - b.offset[0]),
1766 g = g + (d.outerWidth() + b.offset[1]);
1767 /iPad/i.test(navigator.userAgent) && (e -= a(window).scrollTop());
1768 var k = c.outerHeight() + d.outerHeight();
1769 "center" == f && (e += k / 2);
1770 "bottom" == f && (e += k);
1771 f = b.position[1];
1772 d = c.outerWidth() + d.outerWidth();
1773 "center" == f && (g -= d / 2);
1774 "left" == f && (g -= d);
1775 return {
1776 top: e,
1777 left: g
1778 }
1779 }
1780
1781 function n(d, c) {
1782 var b = this,
1783 e = d.add(b),
1784 g,
1785 h = 0,
1786 k = 0,
1787 n = d.attr("title"),
1788 m = d.attr("data-tooltip"),
1789 q = f[c.effect],
1790 t, z = d.is(":input"),
1791 B = z && d.is(":checkbox, :radio, select, :button, :submit"),
1792 w = d.attr("type"),
1793 l = c.events[w] || c.events[z ? B ? "widget" : "input" : "def"];
1794 if (!q) throw 'Nonexistent effect "' + c.effect + '"';
1795 l = l.split(/,\s*/);
1796 if (2 != l.length) throw "Tooltip: bad events configuration for " + w;
1797 d.on(l[0], function(a) {
1798 clearTimeout(h);
1799 c.predelay ? k = setTimeout(function() {
1800 b.show(a)
1801 }, c.predelay) : b.show(a)
1802 }).on(l[1], function(a) {
1803 clearTimeout(k);
1804 c.delay ? h = setTimeout(function() {
1805 b.hide(a)
1806 },
1807 c.delay) : b.hide(a)
1808 });
1809 n && c.cancelDefault && (d.removeAttr("title"), d.data("title", n));
1810 a.extend(b, {
1811 show: function(f) {
1812 if (!g && (m ? g = a(m) : c.tip ? g = a(c.tip).eq(0) : n ? g = a(c.layout).addClass(c.tipClass).appendTo(document.body).hide().append(n) : (g = d.find("." + c.tipClass), g.length || (g = d.next()), g.length || (g = d.parent().next())), !g.length)) throw "Cannot find tooltip for " + d;
1813 if (b.isShown()) return b;
1814 g.stop(!0, !0);
1815 var u = v(d, g, c);
1816 c.tip && g.html(d.data("title"));
1817 f = a.Event();
1818 f.type = "onBeforeShow";
1819 e.trigger(f, [u]);
1820 if (f.isDefaultPrevented()) return b;
1821 u = v(d, g, c);
1822 g.css({
1823 position: "absolute",
1824 top: u.top,
1825 left: u.left
1826 });
1827 t = !0;
1828 q[0].call(b, function() {
1829 f.type = "onShow";
1830 t = "full";
1831 e.trigger(f)
1832 });
1833 u = c.events.tooltip.split(/,\s*/);
1834 if (!g.data("__set")) {
1835 g.off(u[0]).on(u[0], function() {
1836 clearTimeout(h);
1837 clearTimeout(k)
1838 });
1839 if (u[1] && !d.is("input:not(:checkbox, :radio), textarea")) g.off(u[1]).on(u[1], function(a) {
1840 a.relatedTarget != d[0] && d.trigger(l[1].split(" ")[0])
1841 });
1842 c.tip || g.data("__set", !0)
1843 }
1844 return b
1845 },
1846 hide: function(d) {
1847 if (!g || !b.isShown()) return b;
1848 d = a.Event();
1849 d.type = "onBeforeHide";
1850 e.trigger(d);
1851 if (!d.isDefaultPrevented()) return t = !1, f[c.effect][1].call(b, function() {
1852 d.type = "onHide";
1853 e.trigger(d)
1854 }), b
1855 },
1856 isShown: function(a) {
1857 return a ? "full" == t : t
1858 },
1859 getConf: function() {
1860 return c
1861 },
1862 getTip: function() {
1863 return g
1864 },
1865 getTrigger: function() {
1866 return d
1867 }
1868 });
1869 a.each(["onHide", "onBeforeShow", "onShow", "onBeforeHide"], function(d, e) {
1870 if (a.isFunction(c[e])) a(b).on(e, c[e]);
1871 b[e] = function(c) {
1872 if (c) a(b).on(e, c);
1873 return b
1874 }
1875 })
1876 }
1877 a.tools = a.tools || {
1878 version: "1.2.8-dev"
1879 };
1880 a.tools.tooltip = {
1881 conf: {
1882 effect: "toggle",
1883 fadeOutSpeed: "fast",
1884 predelay: 0,
1885 delay: 30,
1886 opacity: 1,
1887 tip: 0,
1888 fadeIE: !1,
1889 position: ["top", "center"],
1890 offset: [0, 0],
1891 relative: !1,
1892 cancelDefault: !0,
1893 events: {
1894 def: "mouseenter,mouseleave",
1895 input: "focus,blur",
1896 widget: "focus mouseenter,blur mouseleave",
1897 tooltip: "mouseenter,mouseleave"
1898 },
1899 layout: "<div/>",
1900 tipClass: "tooltip"
1901 },
1902 addEffect: function(a, c, b) {
1903 f[a] = [c, b]
1904 }
1905 };
1906 var f = {
1907 toggle: [function(a) {
1908 var c = this.getConf(),
1909 b = this.getTip(),
1910 c = c.opacity;
1911 1 > c && b.css({
1912 opacity: c
1913 });
1914 b.show();
1915 a.call()
1916 }, function(a) {
1917 this.getTip().hide();
1918 a.call()
1919 }],
1920 fade: [function(d) {
1921 var c =
1922 this.getConf();
1923 !a.browser.msie || c.fadeIE ? this.getTip().fadeTo(c.fadeInSpeed, c.opacity, d) : (this.getTip().show(), d())
1924 }, function(d) {
1925 var c = this.getConf();
1926 !a.browser.msie || c.fadeIE ? this.getTip().fadeOut(c.fadeOutSpeed, d) : (this.getTip().hide(), d())
1927 }]
1928 };
1929 a.fn.tooltip = function(d) {
1930 d = a.extend(!0, {}, a.tools.tooltip.conf, d);
1931 "string" == typeof d.position && (d.position = d.position.split(/,?\s/));
1932 this.each(function() {
1933 a(this).data("tooltip") || (api = new n(a(this), d), a(this).data("tooltip", api))
1934 });
1935 return d.api ? api : this
1936 }
1937})(jQuery);
1938(function(a) {
1939 var v = a.tools.tooltip;
1940 a.extend(v.conf, {
1941 direction: "up",
1942 bounce: !1,
1943 slideOffset: 10,
1944 slideInSpeed: 200,
1945 slideOutSpeed: 200,
1946 slideFade: !a.browser.msie
1947 });
1948 var n = {
1949 up: ["-", "top"],
1950 down: ["+", "top"],
1951 left: ["-", "left"],
1952 right: ["+", "left"]
1953 };
1954 v.addEffect("slide", function(a) {
1955 var d = this.getConf(),
1956 c = this.getTip(),
1957 b = d.slideFade ? {
1958 opacity: d.opacity
1959 } : {},
1960 e = n[d.direction] || n.up;
1961 b[e[1]] = e[0] + "=" + d.slideOffset;
1962 d.slideFade && c.css({
1963 opacity: 0
1964 });
1965 c.show().animate(b, d.slideInSpeed, a)
1966 }, function(f) {
1967 var d = this.getConf(),
1968 c = d.slideOffset,
1969 b = d.slideFade ? {
1970 opacity: 0
1971 } : {},
1972 e = n[d.direction] || n.up,
1973 g = "" + e[0];
1974 d.bounce && (g = "+" == g ? "-" : "+");
1975 b[e[1]] = g + "=" + c;
1976 this.getTip().animate(b, d.slideOutSpeed, function() {
1977 a(this).hide();
1978 f.call()
1979 })
1980 })
1981})(jQuery);
1982
1983/**
1984 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
1985 *
1986 * Uses the built in easing capabilities added In jQuery 1.1
1987 * to offer multiple easing options
1988 *
1989 * TERMS OF USE - jQuery Easing
1990 *
1991 * Open source under the BSD License.
1992 *
1993 * Copyright © 2008 George McGinley Smith
1994 * All rights reserved.
1995 *
1996 * TERMS OF USE - EASING EQUATIONS
1997 *
1998 * Open source under the BSD License.
1999 *
2000 * Copyright © 2001 Robert Penner
2001 * All rights reserved.
2002 *
2003 * Redistribution and use in source and binary forms, with or without modification,
2004 * are permitted provided that the following conditions are met:
2005 *
2006 * Redistributions of source code must retain the above copyright notice, this list of
2007 * conditions and the following disclaimer.
2008 * Redistributions in binary form must reproduce the above copyright notice, this list
2009 * of conditions and the following disclaimer in the documentation and/or other materials
2010 * provided with the distribution.
2011 *
2012 * Neither the name of the author nor the names of contributors may be used to endorse
2013 * or promote products derived from this software without specific prior written permission.
2014 *
2015 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
2016 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2017 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
2018 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2019 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
2020 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2021 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
2023 * OF THE POSSIBILITY OF SUCH DAMAGE.
2024 *
2025 */
2026jQuery.easing.jswing = jQuery.easing.swing;
2027jQuery.extend(jQuery.easing, {
2028 def: "easeOutQuad",
2029 swing: function(e, f, a, h, g) {
2030 return jQuery.easing[jQuery.easing.def](e, f, a, h, g)
2031 },
2032 easeInQuad: function(e, f, a, h, g) {
2033 return h * (f /= g) * f + a
2034 },
2035 easeOutQuad: function(e, f, a, h, g) {
2036 return -h * (f /= g) * (f - 2) + a
2037 },
2038 easeInOutQuad: function(e, f, a, h, g) {
2039 if ((f /= g / 2) < 1) {
2040 return h / 2 * f * f + a
2041 }
2042 return -h / 2 * ((--f) * (f - 2) - 1) + a
2043 },
2044 easeInCubic: function(e, f, a, h, g) {
2045 return h * (f /= g) * f * f + a
2046 },
2047 easeOutCubic: function(e, f, a, h, g) {
2048 return h * ((f = f / g - 1) * f * f + 1) + a
2049 },
2050 easeInOutCubic: function(e, f, a, h, g) {
2051 if ((f /= g / 2) < 1) {
2052 return h / 2 * f * f * f + a
2053 }
2054 return h / 2 * ((f -= 2) * f * f + 2) + a
2055 },
2056 easeInQuart: function(e, f, a, h, g) {
2057 return h * (f /= g) * f * f * f + a
2058 },
2059 easeOutQuart: function(e, f, a, h, g) {
2060 return -h * ((f = f / g - 1) * f * f * f - 1) + a
2061 },
2062 easeInOutQuart: function(e, f, a, h, g) {
2063 if ((f /= g / 2) < 1) {
2064 return h / 2 * f * f * f * f + a
2065 }
2066 return -h / 2 * ((f -= 2) * f * f * f - 2) + a
2067 },
2068 easeInQuint: function(e, f, a, h, g) {
2069 return h * (f /= g) * f * f * f * f + a
2070 },
2071 easeOutQuint: function(e, f, a, h, g) {
2072 return h * ((f = f / g - 1) * f * f * f * f + 1) + a
2073 },
2074 easeInOutQuint: function(e, f, a, h, g) {
2075 if ((f /= g / 2) < 1) {
2076 return h / 2 * f * f * f * f * f + a
2077 }
2078 return h / 2 * ((f -= 2) * f * f * f * f + 2) + a
2079 },
2080 easeInSine: function(e, f, a, h, g) {
2081 return -h * Math.cos(f / g * (Math.PI / 2)) + h + a
2082 },
2083 easeOutSine: function(e, f, a, h, g) {
2084 return h * Math.sin(f / g * (Math.PI / 2)) + a
2085 },
2086 easeInOutSine: function(e, f, a, h, g) {
2087 return -h / 2 * (Math.cos(Math.PI * f / g) - 1) + a
2088 },
2089 easeInExpo: function(e, f, a, h, g) {
2090 return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a
2091 },
2092 easeOutExpo: function(e, f, a, h, g) {
2093 return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a
2094 },
2095 easeInOutExpo: function(e, f, a, h, g) {
2096 if (f == 0) {
2097 return a
2098 }
2099 if (f == g) {
2100 return a + h
2101 }
2102 if ((f /= g / 2) < 1) {
2103 return h / 2 * Math.pow(2, 10 * (f - 1)) + a
2104 }
2105 return h / 2 * (-Math.pow(2, -10 * --f) + 2) + a
2106 },
2107 easeInCirc: function(e, f, a, h, g) {
2108 return -h * (Math.sqrt(1 - (f /= g) * f) - 1) + a
2109 },
2110 easeOutCirc: function(e, f, a, h, g) {
2111 return h * Math.sqrt(1 - (f = f / g - 1) * f) + a
2112 },
2113 easeInOutCirc: function(e, f, a, h, g) {
2114 if ((f /= g / 2) < 1) {
2115 return -h / 2 * (Math.sqrt(1 - f * f) - 1) + a
2116 }
2117 return h / 2 * (Math.sqrt(1 - (f -= 2) * f) + 1) + a
2118 },
2119 easeInElastic: function(f, h, e, l, k) {
2120 var i = 1.70158;
2121 var j = 0;
2122 var g = l;
2123 if (h == 0) {
2124 return e
2125 }
2126 if ((h /= k) == 1) {
2127 return e + l
2128 }
2129 if (!j) {
2130 j = k * 0.3
2131 }
2132 if (g < Math.abs(l)) {
2133 g = l;
2134 var i = j / 4
2135 } else {
2136 var i = j / (2 * Math.PI) * Math.asin(l / g)
2137 }
2138 return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
2139 },
2140 easeOutElastic: function(f, h, e, l, k) {
2141 var i = 1.70158;
2142 var j = 0;
2143 var g = l;
2144 if (h == 0) {
2145 return e
2146 }
2147 if ((h /= k) == 1) {
2148 return e + l
2149 }
2150 if (!j) {
2151 j = k * 0.3
2152 }
2153 if (g < Math.abs(l)) {
2154 g = l;
2155 var i = j / 4
2156 } else {
2157 var i = j / (2 * Math.PI) * Math.asin(l / g)
2158 }
2159 return g * Math.pow(2, -10 * h) * Math.sin((h * k - i) * (2 * Math.PI) / j) + l + e
2160 },
2161 easeInOutElastic: function(f, h, e, l, k) {
2162 var i = 1.70158;
2163 var j = 0;
2164 var g = l;
2165 if (h == 0) {
2166 return e
2167 }
2168 if ((h /= k / 2) == 2) {
2169 return e + l
2170 }
2171 if (!j) {
2172 j = k * (0.3 * 1.5)
2173 }
2174 if (g < Math.abs(l)) {
2175 g = l;
2176 var i = j / 4
2177 } else {
2178 var i = j / (2 * Math.PI) * Math.asin(l / g)
2179 }
2180 if (h < 1) {
2181 return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
2182 }
2183 return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j) * 0.5 + l + e
2184 },
2185 easeInBack: function(e, f, a, i, h, g) {
2186 if (g == undefined) {
2187 g = 1.70158
2188 }
2189 return i * (f /= h) * f * ((g + 1) * f - g) + a
2190 },
2191 easeOutBack: function(e, f, a, i, h, g) {
2192 if (g == undefined) {
2193 g = 1.70158
2194 }
2195 return i * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a
2196 },
2197 easeInOutBack: function(e, f, a, i, h, g) {
2198 if (g == undefined) {
2199 g = 1.70158
2200 }
2201 if ((f /= h / 2) < 1) {
2202 return i / 2 * (f * f * (((g *= (1.525)) + 1) * f - g)) + a
2203 }
2204 return i / 2 * ((f -= 2) * f * (((g *= (1.525)) + 1) * f + g) + 2) + a
2205 },
2206 easeInBounce: function(e, f, a, h, g) {
2207 return h - jQuery.easing.easeOutBounce(e, g - f, 0, h, g) + a
2208 },
2209 easeOutBounce: function(e, f, a, h, g) {
2210 if ((f /= g) < (1 / 2.75)) {
2211 return h * (7.5625 * f * f) + a
2212 } else {
2213 if (f < (2 / 2.75)) {
2214 return h * (7.5625 * (f -= (1.5 / 2.75)) * f + 0.75) + a
2215 } else {
2216 if (f < (2.5 / 2.75)) {
2217 return h * (7.5625 * (f -= (2.25 / 2.75)) * f + 0.9375) + a
2218 } else {
2219 return h * (7.5625 * (f -= (2.625 / 2.75)) * f + 0.984375) + a
2220 }
2221 }
2222 }
2223 },
2224 easeInOutBounce: function(e, f, a, h, g) {
2225 if (f < g / 2) {
2226 return jQuery.easing.easeInBounce(e, f * 2, 0, h, g) * 0.5 + a
2227 }
2228 return jQuery.easing.easeOutBounce(e, f * 2 - g, 0, h, g) * 0.5 + h * 0.5 + a
2229 }
2230});
2231
2232/**
2233 * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
2234 * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
2235 *
2236 * @param f onMouseOver function || An object with configuration options
2237 * @param g onMouseOut function || Nothing (use configuration options object)
2238 * @author Brian Cherne <brian@cherne.net>
2239 */
2240(function($) {
2241 $.fn.hoverIntent = function(f, g) {
2242 var cfg = {
2243 sensitivity: 7,
2244 interval: 100,
2245 timeout: 0
2246 };
2247 cfg = $.extend(cfg, g ? {
2248 over: f,
2249 out: g
2250 } : f);
2251 var cX, cY, pX, pY;
2252 var track = function(ev) {
2253 cX = ev.pageX;
2254 cY = ev.pageY;
2255 };
2256 var compare = function(ev, ob) {
2257 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2258 if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) {
2259 $(ob).unbind("mousemove", track);
2260 ob.hoverIntent_s = 1;
2261 return cfg.over.apply(ob, [ev]);
2262 } else {
2263 pX = cX;
2264 pY = cY;
2265 ob.hoverIntent_t = setTimeout(function() {
2266 compare(ev, ob);
2267 }, cfg.interval);
2268 }
2269 };
2270 var delay = function(ev, ob) {
2271 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2272 ob.hoverIntent_s = 0;
2273 return cfg.out.apply(ob, [ev]);
2274 };
2275 var handleHover = function(e) {
2276 var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
2277 while (p && p != this) {
2278 try {
2279 p = p.parentNode;
2280 } catch (e) {
2281 p = this;
2282 }
2283 }
2284 if (p == this) {
2285 return false;
2286 }
2287 var ev = jQuery.extend({}, e);
2288 var ob = this;
2289 if (ob.hoverIntent_t) {
2290 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2291 }
2292 if (e.type == "mouseover") {
2293 pX = ev.pageX;
2294 pY = ev.pageY;
2295 $(ob).bind("mousemove", track);
2296 if (ob.hoverIntent_s != 1) {
2297 ob.hoverIntent_t = setTimeout(function() {
2298 compare(ev, ob);
2299 }, cfg.interval);
2300 }
2301 } else {
2302 $(ob).unbind("mousemove", track);
2303 if (ob.hoverIntent_s == 1) {
2304 ob.hoverIntent_t = setTimeout(function() {
2305 delay(ev, ob);
2306 }, cfg.timeout);
2307 }
2308 }
2309 };
2310 return this.mouseover(handleHover).mouseout(handleHover);
2311 };
2312})(jQuery);
2313
2314/*
2315 * jQuery Color Animations
2316 * Copyright 2007 John Resig
2317 * Released under the MIT and GPL licenses.
2318 */
2319(function(d) {
2320 d.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function(f, e) {
2321 d.fx.step[e] = function(g) {
2322 if (g.state == 0) {
2323 g.start = c(g.elem, e);
2324 g.end = b(g.end)
2325 }
2326 g.elem.style[e] = "rgb(" + [Math.max(Math.min(parseInt((g.pos * (g.end[0] - g.start[0])) + g.start[0]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[1] - g.start[1])) + g.start[1]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[2] - g.start[2])) + g.start[2]), 255), 0)].join(",") + ")"
2327 }
2328 });
2329
2330 function b(f) {
2331 var e;
2332 if (f && f.constructor == Array && f.length == 3) {
2333 return f
2334 }
2335 if (e = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)) {
2336 return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3])]
2337 }
2338 if (e = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)) {
2339 return [parseFloat(e[1]) * 2.55, parseFloat(e[2]) * 2.55, parseFloat(e[3]) * 2.55]
2340 }
2341 if (e = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)) {
2342 return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
2343 }
2344 if (e = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)) {
2345 return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
2346 }
2347 return a[d.trim(f).toLowerCase()]
2348 }
2349
2350 function c(g, e) {
2351 var f;
2352 do {
2353 f = d.curCSS(g, e);
2354 if (f != "" && f != "transparent" || d.nodeName(g, "body")) {
2355 break
2356 }
2357 e = "backgroundColor"
2358 } while (g = g.parentNode);
2359 return b(f)
2360 }
2361 var a = {
2362 aqua: [0, 255, 255],
2363 azure: [240, 255, 255],
2364 beige: [245, 245, 220],
2365 black: [0, 0, 0],
2366 blue: [0, 0, 255],
2367 brown: [165, 42, 42],
2368 cyan: [0, 255, 255],
2369 darkblue: [0, 0, 139],
2370 darkcyan: [0, 139, 139],
2371 darkgrey: [169, 169, 169],
2372 darkgreen: [0, 100, 0],
2373 darkkhaki: [189, 183, 107],
2374 darkmagenta: [139, 0, 139],
2375 darkolivegreen: [85, 107, 47],
2376 darkorange: [255, 140, 0],
2377 darkorchid: [153, 50, 204],
2378 darkred: [139, 0, 0],
2379 darksalmon: [233, 150, 122],
2380 darkviolet: [148, 0, 211],
2381 fuchsia: [255, 0, 255],
2382 gold: [255, 215, 0],
2383 green: [0, 128, 0],
2384 indigo: [75, 0, 130],
2385 khaki: [240, 230, 140],
2386 lightblue: [173, 216, 230],
2387 lightcyan: [224, 255, 255],
2388 lightgreen: [144, 238, 144],
2389 lightgrey: [211, 211, 211],
2390 lightpink: [255, 182, 193],
2391 lightyellow: [255, 255, 224],
2392 lime: [0, 255, 0],
2393 magenta: [255, 0, 255],
2394 maroon: [128, 0, 0],
2395 navy: [0, 0, 128],
2396 olive: [128, 128, 0],
2397 orange: [255, 165, 0],
2398 pink: [255, 192, 203],
2399 purple: [128, 0, 128],
2400 violet: [128, 0, 128],
2401 red: [255, 0, 0],
2402 silver: [192, 192, 192],
2403 white: [255, 255, 255],
2404 yellow: [255, 255, 0]
2405 }
2406})(jQuery);
2407
2408/**
2409 * @license Rangy Inputs, a jQuery plug-in for selection and caret manipulation within textareas and text inputs.
2410 *
2411 * https://github.com/timdown/rangyinputs
2412 *
2413 * For range and selection features for contenteditable, see Rangy.
2414
2415 * http://code.google.com/p/rangy/
2416 *
2417 * Depends on jQuery 1.0 or later.
2418 *
2419 * Copyright 2013, Tim Down
2420 * Licensed under the MIT license.
2421 * Version: 1.1.2
2422 * Build date: 6 September 2013
2423 */
2424! function(a) {
2425 function l(a, b) {
2426 var c = typeof a[b];
2427 return "function" === c || !("object" != c || !a[b]) || "unknown" == c
2428 }
2429
2430 function m(a, c) {
2431 return typeof a[c] != b
2432 }
2433
2434 function n(a, b) {
2435 return !("object" != typeof a[b] || !a[b])
2436 }
2437
2438 function o(a) {
2439 window.console && window.console.log && window.console.log("RangyInputs not supported in your browser. Reason: " + a)
2440 }
2441
2442 function p(a, c, d) {
2443 return 0 > c && (c += a.value.length), typeof d == b && (d = c), 0 > d && (d += a.value.length), {
2444 start: c,
2445 end: d
2446 }
2447 }
2448
2449 function q(a, b, c) {
2450 return {
2451 start: b,
2452 end: c,
2453 length: c - b,
2454 text: a.value.slice(b, c)
2455 }
2456 }
2457
2458 function r() {
2459 return n(document, "body") ? document.body : document.getElementsByTagName("body")[0]
2460 }
2461 var c, d, e, f, g, h, i, j, k, b = "undefined";
2462 a(document).ready(function() {
2463 function v(a, b) {
2464 return function() {
2465 var c = this.jquery ? this[0] : this,
2466 d = c.nodeName.toLowerCase();
2467 if (1 == c.nodeType && ("textarea" == d || "input" == d && "text" == c.type)) {
2468 var e = [c].concat(Array.prototype.slice.call(arguments)),
2469 f = a.apply(this, e);
2470 if (!b) return f
2471 }
2472 return b ? this : void 0
2473 }
2474 }
2475 var s = document.createElement("textarea");
2476 if (r().appendChild(s), m(s, "selectionStart") && m(s, "selectionEnd")) c = function(a) {
2477 var b = a.selectionStart,
2478 c = a.selectionEnd;
2479 return q(a, b, c)
2480 }, d = function(a, b, c) {
2481 var d = p(a, b, c);
2482 a.selectionStart = d.start, a.selectionEnd = d.end
2483 }, k = function(a, b) {
2484 b ? a.selectionEnd = a.selectionStart : a.selectionStart = a.selectionEnd
2485 };
2486 else {
2487 if (!(l(s, "createTextRange") && n(document, "selection") && l(document.selection, "createRange"))) return r().removeChild(s), o("No means of finding text input caret position"), void 0;
2488 c = function(a) {
2489 var d, e, f, g, b = 0,
2490 c = 0,
2491 h = document.selection.createRange();
2492 return h && h.parentElement() == a && (f = a.value.length, d = a.value.replace(/\r\n/g, "\n"), e = a.createTextRange(), e.moveToBookmark(h.getBookmark()), g = a.createTextRange(), g.collapse(!1), e.compareEndPoints("StartToEnd", g) > -1 ? b = c = f : (b = -e.moveStart("character", -f), b += d.slice(0, b).split("\n").length - 1, e.compareEndPoints("EndToEnd", g) > -1 ? c = f : (c = -e.moveEnd("character", -f), c += d.slice(0, c).split("\n").length - 1))), q(a, b, c)
2493 };
2494 var t = function(a, b) {
2495 return b - (a.value.slice(0, b).split("\r\n").length - 1)
2496 };
2497 d = function(a, b, c) {
2498 var d = p(a, b, c),
2499 e = a.createTextRange(),
2500 f = t(a, d.start);
2501 e.collapse(!0), d.start == d.end ? e.move("character", f) : (e.moveEnd("character", t(a, d.end)), e.moveStart("character", f)), e.select()
2502 }, k = function(a, b) {
2503 var c = document.selection.createRange();
2504 c.collapse(b), c.select()
2505 }
2506 }
2507 r().removeChild(s), f = function(a, b, c, e) {
2508 var f;
2509 b != c && (f = a.value, a.value = f.slice(0, b) + f.slice(c)), e && d(a, b, b)
2510 }, e = function(a) {
2511 var b = c(a);
2512 f(a, b.start, b.end, !0)
2513 }, j = function(a) {
2514 var e, b = c(a);
2515 return b.start != b.end && (e = a.value, a.value = e.slice(0, b.start) + e.slice(b.end)), d(a, b.start, b.start), b.text
2516 };
2517 var u = function(a, b, c, e) {
2518 var f = b + c.length;
2519 if (e = "string" == typeof e ? e.toLowerCase() : "", ("collapsetoend" == e || "select" == e) && /[\r\n]/.test(c)) {
2520 var g = c.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
2521 f = b + g.length;
2522 var h = b + g.indexOf("\n");
2523 "\r\n" == a.value.slice(h, h + 2) && (f += g.match(/\n/g).length)
2524 }
2525 switch (e) {
2526 case "collapsetostart":
2527 d(a, b, b);
2528 break;
2529 case "collapsetoend":
2530 d(a, f, f);
2531 break;
2532 case "select":
2533 d(a, b, f)
2534 }
2535 };
2536 g = function(a, b, c, d) {
2537 var e = a.value;
2538 a.value = e.slice(0, c) + b + e.slice(c), "boolean" == typeof d && (d = d ? "collapseToEnd" : ""), u(a, c, b, d)
2539 }, h = function(a, b, d) {
2540 var e = c(a),
2541 f = a.value;
2542 a.value = f.slice(0, e.start) + b + f.slice(e.end), u(a, e.start, b, d || "collapseToEnd")
2543 }, i = function(a, d, e, f) {
2544 typeof e == b && (e = d);
2545 var g = c(a),
2546 h = a.value;
2547 a.value = h.slice(0, g.start) + d + g.text + e + h.slice(g.end);
2548 var i = g.start + d.length;
2549 u(a, i, g.text, f || "select")
2550 }, a.fn.extend({
2551 getSelection: v(c, !1),
2552 setSelection: v(d, !0),
2553 collapseSelection: v(k, !0),
2554 deleteSelectedText: v(e, !0),
2555 deleteText: v(f, !0),
2556 extractSelectedText: v(j, !1),
2557 insertText: v(g, !0),
2558 replaceSelectedText: v(h, !0),
2559 surroundSelectedText: v(i, !0)
2560 })
2561 })
2562}(jQuery);
2563
2564/*
2565 * XenForo xenforo.min.js
2566 * Copyright 2010-2017 XenForo Ltd.
2567 * Released under the XenForo License Agreement: http://xenforo.com/license-agreement
2568 */
2569var $jscomp = $jscomp || {};
2570$jscomp.scope = {};
2571$jscomp.findInternal = function(c, g, k) {
2572 c instanceof String && (c = String(c));
2573 for (var q = c.length, n = 0; n < q; n++) {
2574 var u = c[n];
2575 if (g.call(k, u, n, c)) return {
2576 i: n,
2577 v: u
2578 }
2579 }
2580 return {
2581 i: -1,
2582 v: void 0
2583 }
2584};
2585$jscomp.ASSUME_ES5 = !1;
2586$jscomp.ASSUME_NO_NATIVE_MAP = !1;
2587$jscomp.ASSUME_NO_NATIVE_SET = !1;
2588$jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function(c, g, k) {
2589 c != Array.prototype && c != Object.prototype && (c[g] = k.value)
2590};
2591$jscomp.getGlobal = function(c) {
2592 return "undefined" != typeof window && window === c ? c : "undefined" != typeof global && null != global ? global : c
2593};
2594$jscomp.global = $jscomp.getGlobal(this);
2595$jscomp.polyfill = function(c, g, k, q) {
2596 if (g) {
2597 k = $jscomp.global;
2598 c = c.split(".");
2599 for (q = 0; q < c.length - 1; q++) {
2600 var n = c[q];
2601 n in k || (k[n] = {});
2602 k = k[n]
2603 }
2604 c = c[c.length - 1];
2605 q = k[c];
2606 g = g(q);
2607 g != q && null != g && $jscomp.defineProperty(k, c, {
2608 configurable: !0,
2609 writable: !0,
2610 value: g
2611 })
2612 }
2613};
2614$jscomp.polyfill("Array.prototype.find", function(c) {
2615 return c ? c : function(c, k) {
2616 return $jscomp.findInternal(this, c, k).v
2617 }
2618}, "es6", "es3");
2619var XenForo = {};
2620void 0 === jQuery && (jQuery = $ = {});
2621void 0 === $.tools && console.error("jQuery Tools is not loaded.");
2622! function(c) {
2623 var g = 0;
2624 c.console || (c.console = {});
2625 c.console.log && !c.console.debug && (c.console.debug = c.console.log);
2626 var k = "assert clear count debug dir dirxml error getFirebugElement group groupCollapsed groupEnd info log notifyFirebug profile profileEnd time timeEnd trace warn".split(" ");
2627 for (g = 0; g < k.length; ++g) c.console[k[g]] || (c.console[k[g]] = function() {})
2628}(window);
2629! function(c, g, k, q) {
2630 q = function() {
2631 try {
2632 var a = !!("ontouchstart" in g || navigator.maxTouchPoints || navigator.msMaxTouchPoints)
2633 } catch (b) {
2634 a = -1 != navigator.userAgent.indexOf("webOS")
2635 }
2636 return function() {
2637 return a
2638 }
2639 }();
2640 var n = ["hasJs"];
2641 n.push(q() ? "Touch" : "NoTouch");
2642 var u = k.createElement("div");
2643 n.push("draggable" in u || "ondragstart" in u && "ondrop" in u ? "HasDragDrop" : "NoDragDrop"); - 1 != navigator.userAgent.search(/\((iPhone|iPad|iPod);/) && n.push("iOS");
2644 var w = c("html");
2645 w.addClass(n.join(" ")).removeClass("NoJs");
2646 k.createElement("abbr");
2647 /webkit.*mobile/i.test(navigator.userAgent) && (XenForo._isWebkitMobile = !0);
2648 jQuery.fn._jQueryToolsOverlay = jQuery.fn.overlay;
2649 jQuery.extend(!0, {
2650 context: function(a, b) {
2651 if ("string" == typeof b) {
2652 var c = a;
2653 a = a[b];
2654 b = c
2655 }
2656 return function() {
2657 return a.apply(b, arguments)
2658 }
2659 },
2660 setCookie: function(a, b, c) {
2661 console.log("Set cookie %s = %s", a, b);
2662 k.cookie = XenForo._cookieConfig.prefix + a + "=" + encodeURIComponent(b) + (void 0 === c ? "" : ";expires=" + c.toUTCString()) + (XenForo._cookieConfig.path ? ";path=" + XenForo._cookieConfig.path : "") + (XenForo._cookieConfig.domain ?
2663 ";domain=" + XenForo._cookieConfig.domain : "");
2664 return b
2665 },
2666 getCookie: function(a) {
2667 return (a = (new RegExp("(^| )" + XenForo._cookieConfig.prefix + a + "=([^;]+)(;|$)")).exec(k.cookie)) ? decodeURIComponent(a[2]) : null
2668 },
2669 deleteCookie: function(a) {
2670 console.info("Delete cookie %s", a);
2671 k.cookie = XenForo._cookieConfig.prefix + a + "=" + (XenForo._cookieConfig.path ? "; path=" + XenForo._cookieConfig.path : "") + (XenForo._cookieConfig.domain ? "; domain=" + XenForo._cookieConfig.domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
2672 return null
2673 }
2674 });
2675 jQuery.fn.extend({
2676 xfActivate: function() {
2677 return XenForo.activate(this)
2678 },
2679 dataOrDefault: function(a, b) {
2680 a = this.data(a);
2681 return void 0 === a ? b : a
2682 },
2683 strval: function() {
2684 return String(this.val()).replace(/\s+$/g, "")
2685 },
2686 fieldName: function() {
2687 return this.data("fieldname") || this.attr("name")
2688 },
2689 fieldValue: function() {
2690 switch (this.attr("type")) {
2691 case "checkbox":
2692 return c('input:checkbox[name="' + this.fieldName() + '"]:checked', this.context.form).val();
2693 case "radio":
2694 return c('input:radio[name="' + this.fieldName() + '"]:checked', this.context.form).val();
2695 default:
2696 return this.val()
2697 }
2698 },
2699 _jqSerialize: c.fn.serialize,
2700 serialize: function() {
2701 c("textarea.BbCodeWysiwygEditor").each(function() {
2702 var a = c(this).data("XenForo.BbCodeWysiwygEditor");
2703 a && a.syncEditor()
2704 });
2705 return this._jqSerialize()
2706 },
2707 _jqSerializeArray: c.fn.serializeArray,
2708 serializeArray: function() {
2709 c("textarea.BbCodeWysiwygEditor").each(function() {
2710 var a = c(this).data("XenForo.BbCodeWysiwygEditor");
2711 a && a.syncEditor()
2712 });
2713 return this._jqSerializeArray()
2714 },
2715 coords: function(a, b) {
2716 var c = this.is(":hidden");
2717 if (c) {
2718 var e = this.css("visibility");
2719 var f = this.css("display");
2720 this.css({
2721 visibility: "hidden",
2722 display: "block"
2723 })
2724 }
2725 switch (a) {
2726 case "inner":
2727 a = "innerWidth";
2728 var h = "innerHeight";
2729 break;
2730 case "outer":
2731 a = "outerWidth";
2732 h = "outerHeight";
2733 break;
2734 default:
2735 a = "width", h = "height"
2736 }
2737 switch (b) {
2738 case "position":
2739 b = "position";
2740 break;
2741 default:
2742 b = "offset"
2743 }
2744 b = this[b]();
2745 b.width = this[a]();
2746 b.height = this[h]();
2747 c && this.css({
2748 display: f,
2749 visibility: e
2750 });
2751 return b
2752 },
2753 uniqueId: function() {
2754 this.attr("id") || this.attr("id", "XenForoUniq" + XenForo._uniqueIdCounter++);
2755 return this
2756 },
2757 xfFadeIn: function(a,
2758 b) {
2759 return this.fadeIn(a, function() {
2760 c(this).ieOpacityFix(b)
2761 })
2762 },
2763 xfFadeOut: function(a, b) {
2764 return this.fadeOut(a, b)
2765 },
2766 xfShow: function(a, b) {
2767 return this.show(a, function() {
2768 c(this).ieOpacityFix(b)
2769 })
2770 },
2771 xfHide: function(a, b) {
2772 return this.hide(a, b)
2773 },
2774 xfSlideDown: function(a, b) {
2775 return this.slideDown(a, function() {
2776 c(this).ieOpacityFix(b)
2777 })
2778 },
2779 xfSlideUp: function(a, b) {
2780 return this.slideUp(a, b)
2781 },
2782 xfFadeDown: function(a, b) {
2783 this.filter(":hidden").xfHide().css("opacity", 0);
2784 a = a || XenForo.speed.normal;
2785 return this.xfSlideDown(XenForo.speed.fast).animate({
2786 opacity: 1
2787 },
2788 a,
2789 function() {
2790 c(this).ieOpacityFix(b)
2791 })
2792 },
2793 xfFadeUp: function(a, b, c, e) {
2794 a = "undefined" == typeof a || null === a ? XenForo.speed.normal : a;
2795 return this.slideUp({
2796 duration: Math.max(a, "undefined" == typeof c || null === c ? a : c),
2797 easing: e || "swing",
2798 complete: b,
2799 queue: !1
2800 }).animate({
2801 opacity: 0,
2802 queue: !1
2803 }, a)
2804 },
2805 xfInsert: function(a, b, d, e, f) {
2806 "replaceAll" == a && c(b).xfFadeUp(e);
2807 this.addClass("__XenForoActivator").css("display", "none")[a || "appendTo"](b).xfActivate()[d || "xfFadeDown"](e, f);
2808 return this
2809 },
2810 xfRemove: function(a, b, d, e) {
2811 return this[a ||
2812 "xfFadeUp"](XenForo.speed.normal, function() {
2813 c(this).empty().remove();
2814 c.isFunction(b) && b()
2815 }, d, e)
2816 },
2817 _xfSlideWrapper: function(a) {
2818 this.data("slidewrapper") || this.data("slidewrapper", this.wrap('<div class="_swOuter"><div class="_swInner" /></div>').closest("div._swOuter").css("overflow", "hidden"));
2819 if (a) try {
2820 return this.data("slidewrapper").height()
2821 } catch (b) {
2822 return 0
2823 }
2824 return this.data("slidewrapper")
2825 },
2826 xfSlideIn: function(a, b, c) {
2827 var d = this._xfSlideWrapper().css("height", "auto"),
2828 f = 0;
2829 d.find("div._swInner").css("margin",
2830 "auto");
2831 f = this.show(0).outerHeight();
2832 d.css("height", 0).animate({
2833 height: f
2834 }, a, b, function() {
2835 d.css("height", "")
2836 }).find("div._swInner").css("marginTop", -1 * f).animate({
2837 marginTop: 0
2838 }, a, b, c);
2839 return this
2840 },
2841 xfSlideOut: function(a, b, c) {
2842 var d = this.outerHeight();
2843 this._xfSlideWrapper().animate({
2844 height: 0
2845 }, a, b).find("div._swInner").animate({
2846 marginTop: -1 * d
2847 }, a, b, c);
2848 return this
2849 },
2850 ieOpacityFix: function(a) {
2851 c.support.opacity || (this.css("filter", ""), this.attr("style", this.attr("style").replace(/filter:\s*;/i, "")));
2852 c.isFunction(a) &&
2853 a.apply(this);
2854 return this
2855 },
2856 overlay: function(a) {
2857 return XenForo.isTouchBrowser() ? this._jQueryToolsOverlay(c.extend(!0, a, {
2858 speed: 0,
2859 loadSpeed: 0
2860 })) : this._jQueryToolsOverlay(a)
2861 }
2862 });
2863 c.tools.overlay.addEffect("slideDownContentFade", function(a, b) {
2864 var d = this.getOverlay(),
2865 e = this.getConf();
2866 d.find(".content").css("opacity", 0);
2867 this.getConf().fixed ? a.position = "fixed" : (a.position = "absolute", a.top += c(g).scrollTop(), a.left += c(g).scrollLeft());
2868 d.css(a).xfSlideDown(XenForo.speed.fast, function() {
2869 d.find(".content").animate({
2870 opacity: 1
2871 },
2872 e.speed,
2873 function() {
2874 c(this).ieOpacityFix(b)
2875 })
2876 })
2877 }, function(a) {
2878 var b = this.getOverlay();
2879 b.find(".content").animate({
2880 opacity: 0
2881 }, this.getConf().speed, function() {
2882 b.xfSlideUp(XenForo.speed.fast, a)
2883 })
2884 });
2885 c.tools.overlay.addEffect("slideDown", function(a, b) {
2886 this.getConf().fixed ? a.position = "fixed" : (a.position = "absolute", a.top += c(g).scrollTop(), a.left += c(g).scrollLeft());
2887 this.getOverlay().css(a).xfSlideDown(this.getConf().speed, b)
2888 }, function(a) {
2889 this.getOverlay().hide(0, a)
2890 });
2891 c.extend(XenForo, {
2892 _OverlayCache: {},
2893 _AjaxProgress: !1,
2894 ajaxBaseHref: "",
2895 _uniqueIdCounter: 0,
2896 _overlayConfig: {},
2897 _loadedScripts: {},
2898 _cookieConfig: {
2899 path: "/",
2900 domain: "",
2901 prefix: "xf_"
2902 },
2903 _hasFocus: !0,
2904 serverTimeInfo: {},
2905 visitor: {},
2906 _pageLoadTime: (new Date).getTime() / 1E3,
2907 _jsVersion: "",
2908 _noRtnProtect: !1,
2909 _csrfToken: "",
2910 _csrfRefreshUrl: "",
2911 _noSocialLogin: !1,
2912 speed: {
2913 xxfast: 50,
2914 xfast: 100,
2915 fast: 200,
2916 normal: 400,
2917 slow: 600
2918 },
2919 _animationSpeedMultiplier: 1,
2920 _enableOverlays: !0,
2921 _enableAjaxSubmit: !0,
2922 _lightBoxUniversal: !1,
2923 phrases: {},
2924 init: function() {
2925 var a = new Date,
2926 b = function() {
2927 XenForo._hasFocus = !0;
2928 c(k).triggerHandler("XenForoWindowFocus")
2929 },
2930 d = function() {
2931 XenForo._hasFocus = !1;
2932 c(k).triggerHandler("XenForoWindowBlur")
2933 },
2934 e = c("html");
2935 c.browser.msie ? c(k).bind({
2936 focusin: b,
2937 focusout: d
2938 }) : c(g).bind({
2939 focus: b,
2940 blur: d
2941 });
2942 c(g).on("resize", function() {
2943 XenForo.checkQuoteSizing(c(k))
2944 });
2945 XenForo.setAnimationSpeed(XenForo._animationSpeedMultiplier);
2946 XenForo._TimestampRefresh = new XenForo.TimestampRefresh;
2947 XenForo.prepareIgnoredContent();
2948 XenForo.AjaxProgress();
2949 XenForo.activate(k);
2950 c(k).on("click", ".bbCodeQuote .quoteContainer .quoteExpand",
2951 function(a) {
2952 c(this).closest(".quoteContainer").toggleClass("expanded")
2953 });
2954 XenForo.watchProxyLinks();
2955 XenForo._noRtnProtect || XenForo.watchExternalLinks();
2956 if (!e.hasClass("NoResponsive")) {
2957 XenForo.updateVisibleBreadcrumbs();
2958 XenForo.updateVisibleNavigationTabs();
2959 XenForo.updateVisibleNavigationLinks();
2960 var f, h = e.width();
2961 c(g).on("resize orientationchange load", function(a) {
2962 f || "load" != a.type && e.width() == h || (h = e.width(), f = setTimeout(function() {
2963 f = 0;
2964 XenForo.updateVisibleBreadcrumbs();
2965 XenForo.updateVisibleNavigationTabs();
2966 XenForo.updateVisibleNavigationLinks()
2967 }, 20))
2968 });
2969 c(k).on("click", ".breadcrumb .placeholder", function() {
2970 c(this).closest(".breadcrumb").addClass("showAll");
2971 XenForo.updateVisibleBreadcrumbs()
2972 })
2973 }
2974 XenForo._CsrfRefresh = new XenForo.CsrfRefresh;
2975 "autofocus" in k.createElement("input") || c("input[autofocus], textarea[autofocus], select[autofocus]").first().focus();
2976 XenForo.tweetButtonInit();
2977 console.info("XenForo.init() %dms. jQuery %s/%s", new Date - a, c().jquery, c.tools.version);
2978 c("#ManualDeferredTrigger").length &&
2979 setTimeout(XenForo.manualDeferredHandler, 100);
2980 c("html.RunDeferred").length && setTimeout(XenForo.runAutoDeferred, 100)
2981 },
2982 runAutoDeferred: function() {
2983 XenForo.ajax("deferred.php", {}, function(a) {
2984 a && a.moreDeferred && setTimeout(XenForo.runAutoDeferred, 100)
2985 }, {
2986 error: !1,
2987 global: !1
2988 })
2989 },
2990 prepareIgnoredContent: function() {
2991 var a = c("a.DisplayIgnoredContent"),
2992 b = {},
2993 d = [];
2994 a.length && (c(".ignored").each(function() {
2995 var a = c(this).data("author");
2996 a && (b[a] = !0)
2997 }), c.each(b, function(a) {
2998 d.push(a)
2999 }), d.length && (a.attr("title", XenForo.phrases.show_hidden_content_by_x.replace(/\{names\}/,
3000 d.join(", "))), a.parent().show()))
3001 },
3002 watchProxyLinks: function() {
3003 var a = function(a) {
3004 var b = c(this),
3005 e = b.data("proxy-href"),
3006 f = b.data("proxy-handler-last");
3007 !e || f && f == a.timeStamp || (b.data("proxy-handler-last", a.timeStamp), XenForo.ajax(e, {}, function(a) {}, {
3008 error: !1,
3009 global: !1
3010 }))
3011 };
3012 c(k).on("click", "a.ProxyLink", a).on("focusin", "a.ProxyLink", function(b) {
3013 b = c(this);
3014 b.data("proxy-handler") || b.data("proxy-handler", !0).click(a)
3015 })
3016 },
3017 watchExternalLinks: function() {
3018 var a = function(a) {
3019 if (!a.isDefaultPrevented()) {
3020 var b = c(this),
3021 e = b.attr("href"),
3022 f = b.data("blank-handler-last");
3023 if (!(!e || e.match(/^[a-z]:/i) && !e.match(/^https?:/i) || (e = XenForo.canonicalizeUrl(e), (new RegExp("^[a-z]+://" + location.host + "(/|$|:)", "i")).test(e) && !b.hasClass("ProxyLink")) || f && f == a.timeStamp)) {
3024 b.data("blank-handler-last", a.timeStamp);
3025 var h = navigator.userAgent;
3026 b = -1 !== h.indexOf("MSIE");
3027 f = -1 !== h.indexOf("Safari") && -1 == h.indexOf("Chrome");
3028 h = -1 !== h.indexOf("Gecko/");
3029 if (!(a.shiftKey && h || f && (a.shiftKey || a.altKey) || b)) {
3030 if (f) b = c('<iframe style="display: none" />').appendTo(k.body),
3031 f = b[0].contentDocument || b[0].contentWindow.document, f.__href = e, e = c("<script />", f), e[0].text = "window.opener=null;window.parent=null;window.top=null;window.frameElement=null;window.open(document.__href).opener = null;", f.body.appendChild(e[0]), b.remove();
3032 else {
3033 e = g.open(e);
3034 try {
3035 e.opener = null
3036 } catch (l) {}
3037 }
3038 a.preventDefault()
3039 }
3040 }
3041 }
3042 };
3043 c(k).on("click", "a[target=_blank]", a).on("focusin", "a[target=_blank]", function(b) {
3044 b = c(this);
3045 b.data("blank-handler") || b.data("blank-handler", !0).click(a)
3046 })
3047 },
3048 loadJs: function(a, b, c) {
3049 try {
3050 var d =
3051 k.createElement("script");
3052 d.async = !0;
3053 if (c) try {
3054 d.innerHTML = c
3055 } catch (h) {}
3056 var f = function() {
3057 b && (b(), b = null)
3058 };
3059 d.onload = f;
3060 d.onreadystatechange = function() {
3061 "loaded" === d.readyState && f()
3062 };
3063 d.src = a;
3064 k.getElementsByTagName("head")[0].appendChild(d)
3065 } catch (h) {}
3066 },
3067 tweetButtonInit: function() {
3068 c("a.twitter-share-button").length && XenForo.loadJs("https://platform.twitter.com/widgets.js")
3069 },
3070 plusoneButtonInit: function(a) {
3071 if (c(a).find("div.g-plusone, .GoogleLogin").length) {
3072 var b = c("html").attr("lang"),
3073 d = function() {
3074 g.gapi && c(a).find(".GoogleLogin").each(function() {
3075 var a =
3076 c(this),
3077 b = a.data("client-id");
3078 gapi.signin.render(this, {
3079 callback: function(b) {
3080 "AUTO" != b.status.method && b.code && (g.location = XenForo.canonicalizeUrl(a.data("redirect-url").replace("__CODE__", b.code)))
3081 },
3082 clientid: b,
3083 cookiepolicy: "single_host_origin",
3084 accesstype: "offline",
3085 immediate: !1,
3086 requestvisibleactions: "http://schemas.google.com/AddActivity",
3087 scope: "https://www.googleapis.com/auth/plus.login email"
3088 })
3089 })
3090 };
3091 g.___gcfg && g.gapi ? d() : (g.___gcfg = {
3092 lang: b,
3093 isSignedOut: !0
3094 }, XenForo.loadJs("https://plus.google.com/js/client:plusone.js",
3095 d))
3096 }
3097 },
3098 chromeAutoFillFix: function(a) {
3099 if (c.browser.webkit && 0 <= navigator.userAgent.toLowerCase().indexOf("chrome")) {
3100 a || (a = c(k));
3101 try {
3102 var b = a.find("input:-webkit-autofill")
3103 } catch (d) {
3104 b = c([])
3105 }
3106 b.length && b.each(function(a) {
3107 a = c(this);
3108 var b = a.val();
3109 b && b.length && a.after(a.clone(!0).val(b)).remove()
3110 })
3111 }
3112 },
3113 updateVisibleBreadcrumbs: function() {
3114 c(".breadcrumb").each(function() {
3115 var a = this,
3116 b = c(a);
3117 b.find(".placeholder").remove();
3118 var d = b.find(".crust");
3119 d.removeClass("firstVisibleCrumb").show();
3120 var e = d.filter(".homeCrumb");
3121 b.css("height", "");
3122 var f = a.offsetHeight;
3123 b.css("height", "auto");
3124 if (a.offsetHeight <= f) b.css("height", "");
3125 else {
3126 var h = null;
3127 d.each(function() {
3128 var b = c(this);
3129 if (b.is(".selectedTabCrumb, :last-child")) return !0;
3130 b.hide();
3131 h = b;
3132 return a.offsetHeight > f
3133 });
3134 if (h) {
3135 d = c('<span class="crust placeholder"><a class="crumb" href="javascript:"><span>...</span></a><span class="arrow"><span>></span></span></span>');
3136 h.after(d);
3137 if (a.offsetHeight > f) {
3138 var l = h.prevAll(".crust:not(.selectedTabCrumb, :last-child)").last();
3139 l.length &&
3140 l.hide()
3141 }
3142 a.offsetHeight > f && (l = h.nextAll(".crust:not(.placeholder, .selectedTabCrumb, :last-child)").first(), l.length && (l.hide(), l.after(d)));
3143 e.length && !e.is(":visible") && b.find(".crust:visible:first").addClass("firstVisibleCrumb");
3144 a.offsetHeight <= f && b.css("height", "")
3145 } else b.css("height", "")
3146 }
3147 })
3148 },
3149 updateVisibleNavigationTabs: function() {
3150 var a = c("#navigation").find(".navTabs");
3151 if (a.length) {
3152 var b = a.coords(),
3153 d = a.find(".publicTabs"),
3154 e = d.find("> .navTab"),
3155 f = a.find(".visitorTabs"),
3156 h = f.find("> .navTab"),
3157 l =
3158 c("#VisitorExtraMenu_Counter"),
3159 g = e.filter(".navigationHiddenTabs");
3160 e.show();
3161 g.hide();
3162 h.show();
3163 l.addClass("ResponsiveOnly");
3164 if (!a.is(".showAll")) {
3165 var k = a.width() - f.width() - 1;
3166 a = function() {
3167 var a = e.filter(":not(.selected, .navigationHiddenTabs)"),
3168 b = c("<ul />"),
3169 f = 0,
3170 h = !1;
3171 c.each(a.get().reverse(), function() {
3172 var a = c(this);
3173 if (m(d.coords(), !0)) b.prepend(c("<li />").html(a.find(".navLink").clone())), a.hide(), f++;
3174 else return f ? (g.show(), m(d.coords(), !0) && (b.prepend(c("<li />").html(a.find(".navLink").clone())),
3175 a.hide(), f++), c("#NavigationHiddenMenu").html(b).xfActivate(), h = !0) : g.hide(), !1
3176 });
3177 f && !h && (g.show(), c("#NavigationHiddenMenu").html(b).xfActivate())
3178 };
3179 var m = function(a, c) {
3180 return a.top >= b.top + b.height || a.height >= 2 * b.height || c && a.width > k ? !0 : !1
3181 };
3182 f.length ? m(f.coords()) && (a(), m(f.coords()) && (h.hide(), h.filter(".account, .selected").show(), l.removeClass("ResponsiveOnly"))) : m(d.coords()) && a()
3183 }
3184 }
3185 },
3186 updateVisibleNavigationLinks: function() {
3187 var a = c("#navigation").find(".navTab.selected .blockLinksList");
3188 if (a.length) {
3189 var b =
3190 a.find("> li"),
3191 d = a.offset(),
3192 e = b.filter(".navigationHidden");
3193 b.show();
3194 e.hide();
3195 if (!a.is(".showAll")) {
3196 var f = [],
3197 h = b.filter(":not(.navigationHidden)").last(),
3198 l = 0,
3199 g = !1;
3200 if (h.length) {
3201 do {
3202 var k = h.coords();
3203 if (k.top > d.top + k.height) k = b.eq(l), k.hide(), f.push(k), l++, g || (g = !0, e.length ? e.show() : (e = c('<li class="navigationHidden Popup PopupControl PopupClosed"><a rel="Menu" class="NoPopupGadget">...</a><div class="Menu blockLinksList primaryContent" id="NavigationLinksHiddenMenu"></div></li>'), a.append(e), new XenForo.PopupMenu(e)));
3204 else break
3205 } while (l < b.length);
3206 if (g) {
3207 l < b.length && (a = e.coords(), a.top > d.top + a.height && (k = b.eq(l), k.hide(), f.push(k)));
3208 var m = c("<ul />");
3209 c(f).each(function() {
3210 m.append(c("<li />").html(c(this).find("a").clone()))
3211 });
3212 c("#NavigationLinksHiddenMenu").html(m).xfActivate()
3213 }
3214 }
3215 }
3216 }
3217 },
3218 register: function(a, b, d) {
3219 if ("string" == typeof b) {
3220 var e = b;
3221 b = function(a) {
3222 XenForo.create(e, this)
3223 }
3224 }
3225 c(k).bind(d || "XenForoActivateHtml", function(d) {
3226 c(d.element).find(a).each(b)
3227 })
3228 },
3229 create: function(a, b) {
3230 b = c(b);
3231 var d = g,
3232 e = a.split("."),
3233 f;
3234 for (f = 0; f <
3235 e.length; f++) d = d[e[f]];
3236 if ("function" != typeof d) return console.error("%s is not a function.", a);
3237 b.data(a) || b.data(a, new d(b));
3238 return b.data(a)
3239 },
3240 activate: function(a) {
3241 var b = c(a);
3242 console.group("XenForo.activate(%o)", a);
3243 b.trigger("XenForoActivate").removeClass("__XenForoActivator");
3244 b.find("noscript").empty().remove();
3245 XenForo._TimestampRefresh.refresh(a, !0);
3246 c(k).trigger({
3247 element: a,
3248 type: "XenForoActivateHtml"
3249 }).trigger({
3250 element: a,
3251 type: "XenForoActivatePopups"
3252 }).trigger({
3253 element: a,
3254 type: "XenForoActivationComplete"
3255 });
3256 var d = b.find("form.AutoSubmit:first");
3257 d.length && (c(k).trigger("PseudoAjaxStart"), d.submit(), d.find('input[type="submit"], input[type="reset"]').hide());
3258 XenForo.checkQuoteSizing(b);
3259 XenForo.plusoneButtonInit(a);
3260 XenForo.Facebook.start();
3261 console.groupEnd();
3262 return a
3263 },
3264 checkQuoteSizing: function(a) {
3265 a.find(".bbCodeQuote .quoteContainer").each(function() {
3266 var a = this,
3267 d = 0,
3268 e = function() {
3269 var b = c(a),
3270 h = b.find(".quote")[0];
3271 h && (0 == h.scrollHeight || 0 == h.offsetHeight ? 2E3 > d && (setTimeout(e, d), d += 100) : h.scrollHeight > h.offsetHeight +
3272 1 ? b.find(".quoteExpand").addClass("quoteCut") : b.find(".quoteExpand").removeClass("quoteCut"))
3273 };
3274 e();
3275 c(this).find("img").one("load", e);
3276 c(this).on("elementResized", e)
3277 })
3278 },
3279 ajaxDataPush: function(a, b, c) {
3280 a && "string" != typeof a ? void 0 !== a[0] ? a.push({
3281 name: b,
3282 value: c
3283 }) : a[b] = c : (a = String(a), a += "&" + encodeURIComponent(b) + "=" + encodeURIComponent(c));
3284 return a
3285 },
3286 ajax: function(a, b, d, e) {
3287 if (!a) return console.error("No URL specified for XenForo.ajax()");
3288 a = XenForo.canonicalizeUrl(a, XenForo.ajaxBaseHref);
3289 b = XenForo.ajaxDataPush(b,
3290 "_xfRequestUri", g.location.pathname + g.location.search);
3291 b = XenForo.ajaxDataPush(b, "_xfNoRedirect", 1);
3292 XenForo._csrfToken && (b = XenForo.ajaxDataPush(b, "_xfToken", XenForo._csrfToken));
3293 var f = function(a, b) {
3294 "object" == typeof a && ("undefined" != typeof a._visitor_conversationsUnread && (XenForo.balloonCounterUpdate(c("#ConversationsMenu_Counter"), a._visitor_conversationsUnread), XenForo.balloonCounterUpdate(c("#AlertsMenu_Counter"), a._visitor_alertsUnread), XenForo.balloonCounterUpdate(c("#VisitorExtraMenu_ConversationsCounter"),
3295 a._visitor_conversationsUnread), XenForo.balloonCounterUpdate(c("#VisitorExtraMenu_AlertsCounter"), a._visitor_alertsUnread), XenForo.balloonCounterUpdate(c("#VisitorExtraMenu_Counter"), (parseInt(a._visitor_conversationsUnread, 10) + parseInt(a._visitor_alertsUnread, 10) || 0).toString())), a._manualDeferred ? XenForo.manualDeferredHandler() : a._autoDeferred && XenForo.runAutoDeferred());
3296 c(k).trigger({
3297 type: "XFAjaxSuccess",
3298 ajaxData: a,
3299 textStatus: b
3300 });
3301 d.call(null, a, b)
3302 },
3303 h = g.location.href;
3304 if (h.match(/[^\x20-\x7f]/)) {
3305 var l =
3306 k.createElement("a");
3307 l.href = "";
3308 h = h.replace(l.href, XenForo.baseUrl())
3309 }
3310 e = c.extend(!0, {
3311 data: b,
3312 url: a,
3313 success: f,
3314 type: "POST",
3315 dataType: "json",
3316 error: function(a, b, d) {
3317 if (0 != a.readyState) try {
3318 f.call(null, c.parseJSON(a.responseText), b)
3319 } catch (r) {
3320 XenForo.handleServerError(a, b, d)
3321 }
3322 },
3323 headers: {
3324 "X-Ajax-Referer": h
3325 },
3326 timeout: 3E4
3327 }, e);
3328 if (!e.data._xfResponseType) switch (e.dataType) {
3329 case "html":
3330 case "json":
3331 case "xml":
3332 e.data = XenForo.ajaxDataPush(e.data, "_xfResponseType", e.dataType)
3333 }
3334 return c.ajax(e)
3335 },
3336 balloonCounterUpdate: function(a,
3337 b) {
3338 if (a.length) {
3339 var d = a.find("span.Total"),
3340 e = d.text();
3341 d.text(b);
3342 b && "0" != b ? a.fadeIn("fast", function() {
3343 a.removeClass("Zero").css("display", "");
3344 var d = parseInt(e.replace(/[^\d]/, ""), 10);
3345 d = parseInt(b.replace(/[^\d]/, ""), 10) - d;
3346 if (0 < d && a.data("text")) {
3347 var h = a.closest(".Popup"),
3348 l = h.data("XenForo.PopupMenu");
3349 d = c("<a />").css("cursor", "pointer").html(a.data("text").replace(/%d/, d)).click(function(a) {
3350 h.is(":visible") && l ? l.$clicker.trigger("click") : h.find("a[href]").length && (g.location = XenForo.canonicalizeUrl(h.find("a[href]").attr("href")));
3351 return !1
3352 });
3353 l && !l.menuVisible && l.resetLoader();
3354 XenForo.stackAlert(d, 1E4, a)
3355 }
3356 }) : a.fadeOut("fast", function() {
3357 a.addClass("Zero").css("display", "")
3358 })
3359 }
3360 },
3361 _manualDeferUrl: "",
3362 _manualDeferOverlay: !1,
3363 _manualDeferXhr: !1,
3364 manualDeferredHandler: function() {
3365 if (XenForo._manualDeferUrl && !XenForo._manualDeferOverlay) {
3366 var a = XenForo.phrases.processing || "Processing";
3367 a = c('<div id="ManualDeferOverlay" class="xenOverlay"><h2 class="titleBar">' + a + '... <a class="CancelDeferred button" data-cancelling="' + (XenForo.phrases.cancelling ||
3368 "Cancelling") + '..." style="display:none">' + (XenForo.phrases.cancel || "Cancel") + '</a></h2><span class="processingText">' + a + '...</span><span class="close"></span></div>');
3369 a.find(".CancelDeferred").click(function(a) {
3370 a.preventDefault();
3371 c.setCookie("cancel_defer", "1");
3372 c(this).text(c(this).data("cancelling"))
3373 });
3374 a.appendTo("body").overlay(c.extend(!0, {
3375 mask: {
3376 color: "white",
3377 opacity: .6,
3378 loadSpeed: XenForo.speed.normal,
3379 closeSpeed: XenForo.speed.fast
3380 },
3381 closeOnClick: !1,
3382 closeOnEsc: !1,
3383 oneInstance: !1
3384 }, XenForo._overlayConfig, {
3385 top: "20%"
3386 }));
3387 a.overlay().load();
3388 XenForo._manualDeferOverlay = a;
3389 c(k).trigger("PseudoAjaxStart");
3390 var b = function() {
3391 XenForo._manualDeferOverlay.overlay().close();
3392 c("#ManualDeferOverlay").remove();
3393 XenForo._manualDeferOverlay = !1;
3394 XenForo._manualDeferXhr = !1;
3395 c(k).trigger("PseudoAjaxStop");
3396 c(k).trigger("ManualDeferComplete")
3397 },
3398 d = function() {
3399 XenForo._manualDeferXhr = XenForo.ajax(XenForo._manualDeferUrl, {
3400 execute: 1
3401 }, function(a) {
3402 if (a && a.continueProcessing) {
3403 setTimeout(d, 0);
3404 XenForo._manualDeferOverlay.find("span").text(a.status);
3405 var c = XenForo._manualDeferOverlay.find(".CancelDeferred");
3406 a.canCancel ? c.show() : c.hide()
3407 } else b()
3408 }).fail(b)
3409 };
3410 d()
3411 }
3412 },
3413 handleServerError: function(a, b, d) {
3414 switch (b) {
3415 case "abort":
3416 return !1;
3417 case "timeout":
3418 return XenForo.alert(XenForo.phrases.server_did_not_respond_in_time_try_again, XenForo.phrases.following_error_occurred + ":"), !1;
3419 case "parsererror":
3420 return console.error("PHP " + a.responseText), XenForo.alert("The server responded with an error. The error message is in the JavaScript console."), !1;
3421 case "notmodified":
3422 case "error":
3423 if (!a ||
3424 !a.responseText) return !1
3425 }
3426 b = a.getResponseHeader("Content-Type");
3427 d = !1;
3428 if (b) switch (b.split(";")[0]) {
3429 case "application/json":
3430 d = "json";
3431 break;
3432 case "text/html":
3433 d = "html";
3434 break;
3435 default:
3436 "{" == a.responseText.substr(0, 1) ? d = "json" : "<!DOCTYPE" == a.responseText.substr(0, 9) && (d = "html")
3437 }
3438 if ("json" == d && "{" == a.responseText.substr(0, 1)) {
3439 try {
3440 var e = c.parseJSON(a.responseText)
3441 } catch (f) {}
3442 e ? XenForo.hasResponseError(e, a.status) : XenForo.alert(a.responseText, XenForo.phrases.following_error_occurred + ":")
3443 } else XenForo.alert(a.responseText,
3444 XenForo.phrases.following_error_occurred + ":");
3445 return !1
3446 },
3447 hasResponseError: function(a, b) {
3448 if ("object" != typeof a) return XenForo.alert("Response not JSON!"), !0;
3449 if (a.errorTemplateHtml) return new XenForo.ExtLoader(a, function(b) {
3450 if (b = XenForo.alert(a.errorTemplateHtml, XenForo.phrases.following_error_occurred + ":")) b.find("div.errorDetails").removeClass("baseHtml"), a.errorOverlayType && b.closest(".errorOverlay").removeClass("errorOverlay").addClass(a.errorOverlayType)
3451 }), a.error || !0;
3452 if (void 0 !== a.error) {
3453 if ("object" ===
3454 typeof a.error) {
3455 for (var c in a.error) break;
3456 a.error = a.error[c]
3457 }
3458 XenForo.alert(a.error + "\n" + (void 0 !== a.traceHtml ? '<ol class="traceHtml">\n' + a.traceHtml + "</ol>" : ""), XenForo.phrases.following_error_occurred + ":");
3459 return a.error
3460 }
3461 return "ok" == a.status && a.message ? (XenForo.alert(a.message, "", 4E3), !0) : !1
3462 },
3463 hasTemplateHtml: function(a, b) {
3464 b = b || "templateHtml";
3465 return a[b] ? "function" == typeof a[b].search ? -1 !== a[b].search(/\S+/) : !0 : !1
3466 },
3467 createOverlay: function(a, b, d) {
3468 var e = null,
3469 f = null;
3470 f = null;
3471 f = /<script[^>]*>([\s\S]*?)<\/script>/ig;
3472 var h, l = [];
3473 if (b instanceof jQuery && b.is(".xenOverlay")) e = b.appendTo("body"), f = b;
3474 else {
3475 if ("string" == typeof b) {
3476 for (; h = f.exec(b);) l.push(h[1]);
3477 b = b.replace(f, "")
3478 }
3479 f = c(b);
3480 f.is(".NoAutoHeader") || d && d.title && c('<h2 class="heading h1" />').html(d.title).prependTo(f);
3481 f.is(".formOverlay") && f.find(".submitUnit").length && (f.find(".submitUnit :reset").length || f.find(".submitUnit .button:last").after(c('<input type="reset" class="button OverlayCloser" />').val(XenForo.phrases.cancel)).after(" "));
3482 e = c('<div class="xenOverlay __XenForoActivator" />').appendTo("body").addClass(c(b).data("overlayclass")).append(f);
3483 if (l.length)
3484 for (b = 0; b < l.length; b++) c.globalEval(l[b]);
3485 e.xfActivate()
3486 }
3487 d && (d.effect && e.addClass(d.effect + "Effect"), d.className && (e.addClass(d.className), delete d.className), d.noCache && (d.onClose = function() {
3488 this.getOverlay().empty().remove()
3489 }));
3490 0 == e.find(".OverlayCloser").length && e.prepend('<a class="close OverlayCloser"></a>');
3491 e.find(".OverlayCloser").click(function(a) {
3492 a.stopPropagation()
3493 });
3494 a = a || e;
3495 b = c(g).height();
3496 b = !(c.browser.msie && 6 >= c.browser.version || XenForo.isTouchBrowser() || 600 >= c(g).width() ||
3497 550 >= b || e.outerHeight() >= .9 * b);
3498 f.is(".NoFixedOverlay") && (b = !1);
3499 a.overlay(c.extend(!0, {
3500 target: e,
3501 oneInstance: !0,
3502 close: ".OverlayCloser",
3503 speed: XenForo.speed.normal,
3504 closeSpeed: XenForo.speed.fast,
3505 mask: {
3506 color: "white",
3507 opacity: .6,
3508 loadSpeed: XenForo.speed.normal,
3509 closeSpeed: XenForo.speed.fast
3510 },
3511 fixed: b
3512 }, XenForo._overlayConfig, d));
3513 a.bind({
3514 onBeforeLoad: function(a) {
3515 c(k).triggerHandler("OverlayOpening")
3516 },
3517 onLoad: function(b) {
3518 var d = c(this).data("overlay");
3519 b = d.getOverlay();
3520 var e = b.find(".OverlayScroller").get(0),
3521 f = null;
3522 "absolute" == b.css("position") && b.find(".overlayScroll").removeClass("overlayScroll");
3523 e && setTimeout(function() {
3524 e.scrollIntoView(!0)
3525 }, 0);
3526 var h = b.find("form").find("input[autofocus], textarea[autofocus], select[autofocus], .AutoFocus").first();
3527 h.length ? h.focus() : b.find("form").find("input:not([type=hidden], [type=file]), textarea, select, button, .submitUnit a.button").first().focus();
3528 d.getConf().closeOnResize && (f = function() {
3529 console.info("Window resize, close overlay!");
3530 d.close()
3531 }, c(g).one("resize",
3532 f), a.one("onClose", function() {
3533 c(g).unbind("resize", f)
3534 }));
3535 c(k).triggerHandler("OverlayOpened")
3536 },
3537 onBeforeClose: function(a) {
3538 e.find(".Popup").each(function() {
3539 var b = c(this).data("XenForo.PopupMenu");
3540 b.hideMenu && b.hideMenu(a, !0)
3541 })
3542 }
3543 });
3544 f = a.data("overlay");
3545 e.data("overlay", f);
3546 return f
3547 },
3548 alert: function(a, b, d, e) {
3549 a = String(a || "Unspecified error");
3550 var f = a.replace(/[^a-z0-9_]/gi, "_") + parseInt(d);
3551 if (void 0 === XenForo._OverlayCache[f])
3552 if (d) {
3553 var h = c('<div class="xenOverlay timedMessage"><div class="content baseHtml">' +
3554 a + '<span class="close"></span></div></div>');
3555 XenForo._OverlayCache[f] = h.appendTo("body").overlay({
3556 top: 0,
3557 effect: "slideDownContentFade",
3558 speed: XenForo.speed.normal,
3559 oneInstance: !1,
3560 onBeforeClose: e ? e : null
3561 }).data("overlay")
3562 } else h = c('<div class="errorOverlay"><a class="close OverlayCloser"></a><h2 class="heading">' + (b || XenForo.phrases.following_error_occurred) + '</h2><div class="baseHtml errorDetails"></div></div>'), h.find("div.errorDetails").html(a), XenForo._OverlayCache[f] = XenForo.createOverlay(null, h, {
3563 onLoad: function() {
3564 var a = c("input:button.close, button.close", k.getElementById(f)).get(0);
3565 a && a.focus()
3566 },
3567 onClose: e ? e : null
3568 });
3569 XenForo._OverlayCache[f].load();
3570 d && setTimeout('XenForo._OverlayCache["' + f + '"].close()', d);
3571 return h
3572 },
3573 stackAlert: function(a, b, d) {
3574 function e() {
3575 f.xfFadeUp(XenForo.speed.slow, function() {
3576 c(this).empty().remove();
3577 h.children().length || h.hide()
3578 })
3579 }
3580 var f = c('<li class="stackAlert DismissParent"><div class="stackAlertContent"><span class="helper"></span><a class="DismissCtrl"></a></div></li>'),
3581 h = c("#StackAlerts");
3582 h.length || (h = c('<ul id="StackAlerts"></ul>').appendTo("body"));
3583 0 == a instanceof jQuery && (a = c("<span>" + a + "</span>"));
3584 a.appendTo(f.find("div.stackAlertContent"));
3585 f.hide().prependTo(h.show()).fadeIn(XenForo.speed.normal, function() {
3586 0 < b && setTimeout(e, b)
3587 });
3588 f.find("a").click(function(a) {
3589 d && d.length && d.get(0).scrollIntoView(!0);
3590 e()
3591 });
3592 return f
3593 },
3594 setAnimationSpeed: function(a) {
3595 var b;
3596 for (b in XenForo.speed) {
3597 var d = XenForo.speed[b];
3598 if (c.browser.msie) {
3599 var e = 100 >= d ? 2 : 800 < d ? 1 : 1 + 100 / d;
3600 XenForo.speed[b] =
3601 d * a * e
3602 } else XenForo.speed[b] = d * a
3603 }
3604 },
3605 uniqueId: function(a) {
3606 return a ? c(a).uniqueId().attr("id") : "XenForoUniq" + XenForo._uniqueIdCounter++
3607 },
3608 redirect: function(a) {
3609 a = XenForo.canonicalizeUrl(a);
3610 if (a == g.location.href) g.location.reload();
3611 else {
3612 g.location = a;
3613 a = a.split("#");
3614 var b = g.location.href.split("#");
3615 a[1] && a[0] == b[0] && g.location.reload()
3616 }
3617 },
3618 canonicalizeUrl: function(a, b) {
3619 if (0 == a.indexOf("/") || a.match(/^(https?:|ftp:|mailto:)/i)) return a;
3620 b || (b = XenForo.baseUrl());
3621 "string" != typeof b && (b = "");
3622 return b + a
3623 },
3624 _baseUrl: !1,
3625 baseUrl: function() {
3626 if (!1 === XenForo._baseUrl) {
3627 var a = k.createElement("a"),
3628 b = c("base");
3629 a.href = "";
3630 XenForo._baseUrl = a.href.match(/[^\x20-\x7f]/) && b.length ? b.attr("href") : a.href;
3631 b.length || (XenForo._baseUrl = XenForo._baseUrl.replace(/\?.*$/, "").replace(/\/[^\/]*$/, "/"))
3632 }
3633 return XenForo._baseUrl
3634 },
3635 trailingSlash: function(a) {
3636 "/" != a.substr(-1) && (a += "/");
3637 return a
3638 },
3639 regexQuote: function(a) {
3640 return (a + "").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g, "\\$1")
3641 },
3642 htmlspecialchars: function(a) {
3643 return (String(a) || "").replace(/&/g,
3644 "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">")
3645 },
3646 isRTL: function() {
3647 if (void 0 === XenForo.RTL) {
3648 var a = c("html").attr("dir");
3649 XenForo.RTL = a && "RTL" == a.toUpperCase() ? !0 : !1
3650 }
3651 return XenForo.RTL
3652 },
3653 switchStringRTL: function(a) {
3654 XenForo.isRTL() && (a = a.replace(/left/i, "l_e_f_t"), a = a.replace(/right/i, "left"), a = a.replace("l_e_f_t", "right"));
3655 return a
3656 },
3657 switchOffsetRTL: function(a) {
3658 XenForo.isRTL() && !isNaN(a[1]) && (a[1] *= -1);
3659 return a
3660 },
3661 isListTag: function(a) {
3662 return "ul" == a.tagName || "ol" == a.tagName
3663 },
3664 isNumeric: function(a) {
3665 return !isNaN(a) &&
3666 a - 0 == a && 0 < a.length
3667 },
3668 isPositive: function(a) {
3669 switch (String(a).toLowerCase()) {
3670 case "on":
3671 case "yes":
3672 case "true":
3673 case "1":
3674 return !0;
3675 default:
3676 return !1
3677 }
3678 },
3679 ucfirst: function(a) {
3680 return a.charAt(0).toUpperCase() + a.substr(1)
3681 },
3682 updateUserAvatars: function(a, b, d) {
3683 console.log("Replacing visitor avatars on page: %o", b);
3684 c.each(b, function(b, f) {
3685 b = ".Av" + a + b + (d ? "" : ":not(.AvatarCropControl)");
3686 c(b).find("img").attr("src", f);
3687 c(b).find("span.img").css("background-image", "url(" + f + ")")
3688 })
3689 },
3690 getEditorInForm: function(a, b) {
3691 a = c(a);
3692 var d =
3693 a.find("textarea.MessageEditor" + (b || "")).first();
3694 return d.length ? d.prop("disabled") ? a.find(".bbCodeEditorContainer textarea" + (b || "")) : d.data("redactor") ? d.data("redactor") : d : !1
3695 },
3696 getPageScrollTagName: function() {
3697 if (0 < c("html").scrollTop()) return "html";
3698 if (0 < c("body").scrollTop()) return "body";
3699 var a = navigator.userAgent.match(/Chrome\/([0-9]+)/i);
3700 return a && 61 <= parseInt(a[1], 10) ? "html" : c.browser.webkit ? "body" : "html"
3701 },
3702 isTouchBrowser: q,
3703 scriptLoader: {
3704 loadScript: function(a, b, d) {
3705 if (void 0 === XenForo._loadedScripts[a]) {
3706 if (/tiny_mce[a-zA-Z0-9_-]*\.js/.test(a)) {
3707 var e =
3708 "",
3709 f = XenForo.baseUrl();
3710 /_(src|dev)\.js/g.test(a); - 1 != (p = a.indexOf("?")) && a.substring(p + 1);
3711 e = a.substring(0, a.lastIndexOf("/"));
3712 f && -1 == e.indexOf("://") && 0 !== e.indexOf("/") && (e = f + e)
3713 }
3714 c.ajax({
3715 type: "GET",
3716 url: a,
3717 cache: !0,
3718 dataType: "script",
3719 error: d,
3720 success: function(c, d) {
3721 XenForo._loadedScripts[a] = !0;
3722 b.call()
3723 }
3724 })
3725 } else b.call()
3726 },
3727 loadCss: function(a, b, d, e) {
3728 var f = [];
3729 c.each(a, function(a, b) {
3730 XenForo._loadedScripts[b] || f.push(b)
3731 });
3732 f.length ? (a = b.replace("__sentinel__", f.join(",")), a = XenForo.canonicalizeUrl(a, XenForo.ajaxBaseHref),
3733 c.ajax({
3734 type: "GET",
3735 url: a,
3736 cache: !0,
3737 dataType: "text",
3738 error: e,
3739 success: function(a, b) {
3740 c.each(f, function(a, b) {
3741 console.log("Loaded css %d, %s", a, b);
3742 XenForo._loadedScripts[b] = !0
3743 });
3744 var e = XenForo.baseUrl();
3745 e && (a = a.replace(/(url\(("|')?)([^"')]+)(("|')?\))/gi, function(a, b, c, d, f, h) {
3746 d.match(/^(https?:|\/)/i) || (d = e + d);
3747 return b + d + f
3748 }));
3749 c("<style>" + a + "</style>").appendTo("head");
3750 d.call()
3751 }
3752 })) : d.call()
3753 }
3754 }
3755 });
3756 XenForo.ExtLoader = function(a, b, c) {
3757 this.__construct(a, b, c)
3758 };
3759 XenForo.ExtLoader.prototype = {
3760 __construct: function(a,
3761 b, d) {
3762 this.success = b;
3763 this.failure = d;
3764 this.totalFetched = 0;
3765 this.data = a;
3766 d = b = 0;
3767 var e;
3768 if (a.css && !c.isEmptyObject(a.css.stylesheets)) {
3769 if (!a.css.urlTemplate) return console.warn("Unable to load CSS without a urlTemplate being provided.");
3770 d = 1
3771 }
3772 a.js && (b = a.js.length);
3773 this.totalExt = d + b;
3774 if (!this.totalExt) return this.callSuccess();
3775 if (b)
3776 for (e = 0; e < b; e++) XenForo.scriptLoader.loadScript(a.js[e], c.context(this, "successCount"), c.context(this, "callFailure"));
3777 d && XenForo.scriptLoader.loadCss(a.css.stylesheets, a.css.urlTemplate,
3778 c.context(this, "successCount"), c.context(this, "callFailure"))
3779 },
3780 callSuccess: function() {
3781 "function" == typeof this.success && this.success(this.data)
3782 },
3783 callFailure: function(a, b, c) {
3784 this.failed || ("function" == typeof this.failure ? this.failure(this.data) : console.warn("ExtLoader Failure %s %s", b, a.status), this.failed = !0)
3785 },
3786 successCount: function(a) {
3787 this.totalFetched++;
3788 this.totalFetched >= this.totalExt && this.callSuccess()
3789 }
3790 };
3791 XenForo._TimestampRefresh = null;
3792 XenForo.TimestampRefresh = function() {
3793 this.__construct()
3794 };
3795 XenForo.TimestampRefresh.prototype = {
3796 __construct: function() {
3797 this.active = this.activate();
3798 c(k).bind("XenForoWindowFocus", c.context(this, "focus"))
3799 },
3800 focus: function(a) {
3801 this.active || this.activate(!0)
3802 },
3803 activate: function(a) {
3804 a && this.refresh();
3805 return this.active = g.setInterval(c.context(this, "refresh"), 6E4)
3806 },
3807 deactivate: function() {
3808 g.clearInterval(this.active);
3809 return this.active = !1
3810 },
3811 refresh: function(a, b) {
3812 if (!XenForo._hasFocus && !b) return this.deactivate();
3813 if (!(c.browser.msie && 6 >= c.browser.version)) {
3814 a = c("abbr.DateTime[data-time]", a);
3815 b = (new Date).getTime() /
3816 1E3 - XenForo._pageLoadTime;
3817 var d = XenForo.serverTimeInfo.now,
3818 e = XenForo.serverTimeInfo.today,
3819 f = XenForo.serverTimeInfo.todayDow,
3820 h;
3821 if (d + b > e + 86400) {
3822 var g = Math.floor((d + b - e) / 86400);
3823 e += 86400 * g;
3824 f = (f + g) % 7
3825 }
3826 g = e - 86400;
3827 var k = e - 518400;
3828 var v = XenForo.isRTL() ? "\u200f" : "";
3829 for (h = 0; h < a.length; h++) {
3830 var m = c(a[h]);
3831 m.attr("title") || m.attr("title", m.text());
3832 var r = parseInt(m.data("diff"), 10);
3833 var t = parseInt(m.data("time"), 10);
3834 var n = t + r;
3835 n > d + b && (n = Math.floor(d + b));
3836 r = d - n + r + b;
3837 0 > r || (60 >= r ? m.text(XenForo.phrases.a_moment_ago) : 120 >=
3838 r ? m.text(XenForo.phrases.one_minute_ago) : 3600 > r ? m.text(XenForo.phrases.x_minutes_ago.replace(/%minutes%/, Math.floor(r / 60))) : t >= e ? m.text(XenForo.phrases.today_at_x.replace(/%time%/, m.attr("data-timestring"))) : t >= g ? m.text(XenForo.phrases.yesterday_at_x.replace(/%time%/, m.attr("data-timestring"))) : t >= k ? (t = f - Math.ceil((e - t) / 86400), 0 > t && (t += 7), m.text(v + XenForo.phrases.day_x_at_time_y.replace("%day%", XenForo.phrases["day" + t]).replace(/%time%/, m.attr("data-timestring")))) : m.text(v + m.attr("data-datestring")))
3839 }
3840 }
3841 }
3842 };
3843 XenForo.CsrfRefresh = function() {
3844 this.__construct()
3845 };
3846 XenForo.CsrfRefresh.prototype = {
3847 __construct: function() {
3848 this.activate();
3849 c(k).bind("XenForoWindowFocus", c.context(this, "focus"))
3850 },
3851 focus: function(a) {
3852 this.active || this.activate(!0)
3853 },
3854 activate: function(a) {
3855 a && this.refresh();
3856 return this.active = g.setInterval(c.context(this, "refresh"), 3E6)
3857 },
3858 deactivate: function() {
3859 g.clearInterval(this.active);
3860 this.active = !1
3861 },
3862 refresh: function() {
3863 XenForo._csrfRefreshUrl && (XenForo._hasFocus ? XenForo.ajax(XenForo._csrfRefreshUrl, "",
3864 function(a, b) {
3865 if (!a || void 0 === a.csrfToken) return !1;
3866 b = c("input[name=_xfToken]").val(a.csrfToken);
3867 XenForo._csrfToken = a.csrfToken;
3868 b.length && console.log("XenForo CSRF token updated in %d places (%s)", b.length, a.csrfToken);
3869 c(k).trigger({
3870 type: "CSRFRefresh",
3871 ajaxData: a
3872 })
3873 }, {
3874 error: !1,
3875 global: !1
3876 }) : this.deactivate())
3877 }
3878 };
3879 XenForo._PopupMenuActiveGroup = null;
3880 XenForo.PopupMenu = function(a) {
3881 this.__construct(a)
3882 };
3883 XenForo.PopupMenu.prototype = {
3884 __construct: function(a) {
3885 this.$container = a;
3886 this.$menu = this.$container.find(".Menu").appendTo("body");
3887 this.$menu.data("XenForo.PopupMenu", this);
3888 this.menuVisible = !1;
3889 if (!this.$menu.length) return console.warn("Unable to find menu for Popup %o", this.$container), !1;
3890 this.$menu.id = XenForo.uniqueId(this.$menu);
3891 this.contentSrc = this.$menu.data("contentsrc");
3892 this.contentDest = this.$menu.data("contentdest");
3893 this.unreadDisplayTimeout = this.loading = null;
3894 this.newlyOpened = !1;
3895 this.$clicker = a.find('[rel="Menu"]').first().click(c.context(this, "controlClick"));
3896 XenForo.isTouchBrowser() || this.$clicker.mouseover(c.context(this,
3897 "controlHover")).hoverIntent({
3898 sensitivity: 1,
3899 interval: 100,
3900 timeout: 0,
3901 over: c.context(this, "controlHoverIntent"),
3902 out: function() {}
3903 });
3904 this.$control = this.addPopupGadget(this.$clicker);
3905 this.popupGroup = this.$control.closest("[data-popupgroup]").data("popupgroup")
3906 },
3907 addPopupGadget: function(a) {
3908 a.hasClass("NoPopupGadget") || a.hasClass("SplitCtrl") || a.append('<span class="arrowWidget" />');
3909 var b = a.closest(".PopupControl");
3910 b.length && (a = b.addClass("PopupContainerControl"));
3911 a.addClass("PopupControl");
3912 return a
3913 },
3914 controlClick: function(a) {
3915 console.debug("%o control clicked. NewlyOpened: %s, Animated: %s",
3916 this.$control, this.newlyOpened, this.$menu.is(":animated"));
3917 if (this.newlyOpened || this.$menu.is(":animated")) console.debug("Click on control of newly-opened or animating menu, ignored");
3918 else if (console.info("control: %o", this.$control), this.$menu.is(":hidden")) this.showMenu(a, !1);
3919 else {
3920 if (this.$clicker.attr("href") && !XenForo.isPositive(this.$clicker.data("closemenu"))) return console.warn("Following hyperlink from %o", this.$clicker), !0;
3921 this.hideMenu(a, !1)
3922 }
3923 a.preventDefault();
3924 a.target.blur();
3925 return !1
3926 },
3927 controlHover: function(a) {
3928 if (null != this.popupGroup && this.popupGroup == this.getActiveGroup()) return this.showMenu(a, !0), !1
3929 },
3930 controlHoverIntent: function(a) {
3931 var b = !1;
3932 this.$clicker.hasClass("SplitCtrl") && (b = !0);
3933 this.showMenu(a, b)
3934 },
3935 showMenu: function(a, b) {
3936 if (this.$menu.is(":visible")) return !1;
3937 a = new c.Event("PopupMenuShow");
3938 a.$menu = this.$menu;
3939 a.instant = b;
3940 c(k).trigger(a);
3941 if (a.isDefaultPrevented()) return !1;
3942 this.menuVisible = !0;
3943 this.setMenuPosition("showMenu");
3944 this.$menu.hasClass("BottomControl") && (b = !0);
3945 this.contentSrc &&
3946 !this.loading && (this.loading = XenForo.ajax(this.contentSrc, "", c.context(this, "loadSuccess"), {
3947 type: "GET"
3948 }), this.$menu.find(".Progress").addClass("InProgress"), b = !0);
3949 this.setActiveGroup();
3950 this.$control.addClass("PopupOpen").removeClass("PopupClosed");
3951 this.$menu.stop().xfSlideDown(b ? 0 : XenForo.speed.xfast, c.context(this, "menuShown"));
3952 if (!this.menuEventsInitialized) {
3953 var d = c("html"),
3954 e = this,
3955 f = [d.width(), d.height()];
3956 c(k).bind({
3957 PopupMenuShow: c.context(this, "hideIfOther")
3958 });
3959 XenForo._isWebkitMobile ? c(k.body.children).click(c.context(this,
3960 "hideMenu")) : c(k).click(c.context(this, "hideMenu"));
3961 c(k).on("HideAllMenus", function(a) {
3962 e.menuVisible && e._hideMenu(a, !0)
3963 });
3964 c(g).bind({
3965 resize: function(a) {
3966 var b = d.width(),
3967 c = d.height();
3968 if (b != f[0] || c != f[1]) f[0] = b, f[1] = c, e._hideMenu(a)
3969 }
3970 });
3971 this.$menu.delegate("a", "click", c.context(this, "menuLinkClick"));
3972 this.$menu.delegate(".MenuCloser", "click", c.context(this, "hideMenu"));
3973 this.menuEventsInitialized = !0
3974 }
3975 },
3976 hideMenu: function(a, b) {
3977 this.$menu.is(":visible") && this.triggersMenuHide(a) && this._hideMenu(a, !b)
3978 },
3979 _hideMenu: function(a,
3980 b) {
3981 this.menuVisible = !1;
3982 this.setActiveGroup(null);
3983 this.$menu.hasClass("BottomControl") && (b = !1);
3984 clearTimeout(this.unreadDisplayTimeout);
3985 this.$menu.find(".Unread").stop();
3986 this.$menu.xfSlideUp(b ? XenForo.speed.xfast : 0, c.context(this, "menuHidden"))
3987 },
3988 menuShown: function() {
3989 var a = this.$menu.data("contentsrc") ? !1 : !0,
3990 b = null;
3991 this.$control.addClass("PopupOpen").removeClass("PopupClosed");
3992 this.newlyOpened = !0;
3993 setTimeout(c.context(function() {
3994 this.newlyOpened = !1
3995 }, this), 50);
3996 this.$menu.trigger("ShowComplete", [a]);
3997 this.setMenuPosition("menuShown");
3998 this.highlightUnreadContent();
3999 XenForo.isTouchBrowser() || (b = this.$menu.find("input[type=text], input[type=search], textarea, select").first(), b.length && !b.data("nofocus") && b.select())
4000 },
4001 menuHidden: function() {
4002 this.$control.removeClass("PopupOpen").addClass("PopupClosed");
4003 this.$menu.trigger("MenuHidden")
4004 },
4005 hideIfOther: function(a) {
4006 a.$menu.prop(c.expando) != this.$menu.prop(c.expando) && this.hideMenu(a, a.instant)
4007 },
4008 triggersMenuHide: function(a) {
4009 var b = c(a.target);
4010 return a.ctrlKey || a.shiftKey || a.altKey || 1 < a.which ?
4011 !1 : b.is(".MenuCloser") || b.is("a[href]") && !a.isDefaultPrevented() || a.target === k || !b.closest("#" + this.$menu.id).length ? !0 : !1
4012 },
4013 setMenuPosition: function(a) {
4014 var b;
4015 a = this.$control.coords("outer");
4016 this.$menu.css("position", "").removeData("position");
4017 for (b = this.$control; b && b.length && b.get(0) != k;) {
4018 if ("fixed" == b.css("position")) {
4019 a.top -= c(g).scrollTop();
4020 a.left -= c(g).scrollLeft();
4021 this.$menu.css("position", "fixed").data("position", "fixed");
4022 break
4023 }
4024 b = b.parent()
4025 }
4026 this.$control.removeClass("BottomControl");
4027 this.$menu.removeClass("BottomControl").css({
4028 left: a.left,
4029 top: a.top + a.height - 1
4030 });
4031 b = this.$menu.coords("outer");
4032 var d = c("#content .pageContent");
4033 var e = d.length ? d.coords("outer") : c("body").coords("outer");
4034 var f = c(g);
4035 d = f.scrollTop();
4036 var h = f.scrollLeft(),
4037 l = f.width();
4038 if (XenForo.isRTL() || b.left + b.width > e.left + e.width) e = Math.max(0, a.left + a.width - b.width), e > h && this.$menu.css("left", e);
4039 parseInt(this.$menu.css("left"), 10) + b.width > l + h && this.$menu.css("left", 0);
4040 b.top + b.height > f.height() + d && (b = a.top - b.height, b > d && (this.$control.addClass("BottomControl"), this.$menu.addClass("BottomControl"),
4041 this.$menu.css("top", a.top - this.$menu.outerHeight())))
4042 },
4043 loadSuccess: function(a, b) {
4044 if (XenForo.hasResponseError(a) || !XenForo.hasTemplateHtml(a)) return !1;
4045 this.contentDest || (console.warn("Menu content destination not specified, using this.$menu."), this.contentDest = this.$menu);
4046 console.info("Content destination: %o", this.contentDest);
4047 var d = this;
4048 new XenForo.ExtLoader(a, function(a) {
4049 d.$menu.trigger("LoadComplete");
4050 c(a.templateHtml).xfInsert(d.$menu.data("insertfn") || "appendTo", d.contentDest, "slideDown", 0,
4051 function() {
4052 d.$menu.css("min-width", "199px");
4053 setTimeout(function() {
4054 d.$menu.css("min-width", "")
4055 }, 0);
4056 d.$control.hasClass("PopupOpen") && d.menuShown()
4057 });
4058 d.$menu.find(".Progress").removeClass("InProgress")
4059 })
4060 },
4061 resetLoader: function() {
4062 this.contentDest && this.loading && (delete this.loading, c(this.contentDest).empty(), this.$menu.find(".Progress").addClass("InProgress"))
4063 },
4064 menuLinkClick: function(a) {
4065 this.hideMenu(a, !0)
4066 },
4067 setActiveGroup: function(a) {
4068 return XenForo._PopupMenuActiveGroup = void 0 === a ? this.popupGroup : a
4069 },
4070 getActiveGroup: function() {
4071 return XenForo._PopupMenuActiveGroup
4072 },
4073 highlightUnreadContent: function() {
4074 var a = this.$menu.find(".Unread"),
4075 b = null,
4076 d = null;
4077 a.length && (b = a.data("defaultbackground")) && (a.css("backgroundColor", null), this.unreadDisplayTimeout = setTimeout(c.context(function() {
4078 (d = this.$menu.data("removecounter")) && XenForo.balloonCounterUpdate(c(d), 0);
4079 a.animate({
4080 backgroundColor: b
4081 }, 2E3, c.context(function() {
4082 a.removeClass("Unread");
4083 this.$menu.trigger("UnreadDisplayComplete")
4084 }, this))
4085 }, this), 1E3))
4086 }
4087 };
4088 XenForo.AjaxProgress =
4089 function() {
4090 var a = null,
4091 b = function() {
4092 c(".Progress, .xenForm .ctrlUnit.submitUnit dt").addClass("InProgress");
4093 a || (a = c('<div id="AjaxProgress" class="xenOverlay"><div class="content"><span class="close" /></div></div>').appendTo("body").overlay({
4094 top: 0,
4095 speed: XenForo.speed.fast,
4096 oneInstance: !1,
4097 closeOnClick: !1,
4098 closeOnEsc: !1
4099 }).data("overlay"));
4100 a.load()
4101 },
4102 d = function() {
4103 c(".Progress, .xenForm .ctrlUnit.submitUnit dt").removeClass("InProgress");
4104 a && a.isOpened() && a.close()
4105 };
4106 c(k).bind({
4107 ajaxStart: function(a) {
4108 XenForo._AjaxProgress = !0;
4109 b()
4110 },
4111 ajaxStop: function(a) {
4112 XenForo._AjaxProgress = !1;
4113 d()
4114 },
4115 PseudoAjaxStart: function(a) {
4116 b()
4117 },
4118 PseudoAjaxStop: function(a) {
4119 d()
4120 }
4121 });
4122 c.browser.msie && 7 > c.browser.version && c(k).bind("scroll", function(b) {
4123 a && a.isOpened() && !a.getConf().fixed && a.getOverlay().css("top", a.getConf().top + c(g).scrollTop())
4124 })
4125 };
4126 XenForo.PageNav = function(a) {
4127 this.__construct(a)
4128 };
4129 XenForo.PageNav.prototype = {
4130 __construct: function(a) {
4131 if (XenForo.isRTL()) return !1;
4132 var b = a.find(".scrollable");
4133 if (!b.length) return !1;
4134 console.info("PageNav %o", a);
4135 this.start =
4136 parseInt(a.data("start"));
4137 this.page = parseInt(a.data("page"));
4138 this.end = parseInt(a.data("end"));
4139 this.last = parseInt(a.data("last"));
4140 this.range = parseInt(a.data("range"));
4141 this.size = 2 * this.range + 1;
4142 this.baseurl = a.data("baseurl");
4143 this.sentinel = a.data("sentinel");
4144 b.scrollable({
4145 speed: XenForo.speed.slow,
4146 easing: "easeOutBounce",
4147 keyboard: !1,
4148 prev: "#nullPrev",
4149 next: "#nullNext",
4150 touch: !1
4151 });
4152 this.api = b.data("scrollable").onBeforeSeek(c.context(this, "beforeSeek"));
4153 this.$prevButton = a.find(".PageNavPrev").click(c.context(this,
4154 "prevPage"));
4155 this.$nextButton = a.find(".PageNavNext").click(c.context(this, "nextPage"));
4156 this.setControlVisibility(this.api.getIndex(), 0)
4157 },
4158 prevPage: function(a) {
4159 if (0 == this.api.getIndex() && 2 < this.start) {
4160 var b = Math.max(2, this.start - this.size);
4161 for (a = this.start - 1; a >= b; a--) this.prepend(a);
4162 this.start = b
4163 }
4164 this.api.seekTo(Math.max(this.api.getIndex() - this.size, 0))
4165 },
4166 nextPage: function(a) {
4167 if (this.api.getIndex() + 1 + 2 * this.size > this.api.getSize() && this.end < this.last - 1) {
4168 var b = Math.min(this.last - 1, this.end + this.size);
4169 for (a = this.end + 1; a <= b; a++) this.append(a);
4170 this.end = b
4171 }
4172 this.api.seekTo(Math.min(this.api.getSize() - this.size, this.api.getIndex() + this.size))
4173 },
4174 prepend: function(a) {
4175 this.buildPageLink(a).prependTo(this.api.getItemWrap());
4176 this.api.next(0)
4177 },
4178 append: function(a) {
4179 this.buildPageLink(a).appendTo(this.api.getItemWrap())
4180 },
4181 buildPageLink: function(a) {
4182 return c("<a />", {
4183 href: this.buildPageUrl(a),
4184 text: a,
4185 "class": 999 < a ? "gt999" : ""
4186 })
4187 },
4188 buildPageUrl: function(a) {
4189 return this.baseurl.replace(this.sentinel, a).replace(escape(this.sentinel),
4190 a)
4191 },
4192 beforeSeek: function(a, b) {
4193 this.setControlVisibility(b, XenForo.speed.fast)
4194 },
4195 setControlVisibility: function(a, b) {
4196 0 == a && 2 >= this.start ? this.$prevButton.hide(b) : this.$prevButton.show(b);
4197 this.api.getSize() - this.size <= a && this.end >= this.last - 1 ? this.$nextButton.hide(b) : this.$nextButton.show(b)
4198 }
4199 };
4200 XenForo.ToggleTrigger = function(a) {
4201 this.__construct(a)
4202 };
4203 XenForo.ToggleTrigger.prototype = {
4204 __construct: function(a) {
4205 this.$trigger = a;
4206 this.targetVisible = this.loaded = !1;
4207 this.$target = null;
4208 if (a.data("target")) {
4209 var b = a.closest(".ToggleTriggerAnchor");
4210 b.length || (b = c("body"));
4211 b = b.find(a.data("target"));
4212 if (b.length) {
4213 this.$target = b;
4214 var d = b.data("toggle-class");
4215 this.targetVisible = d ? b.hasClass(d) : b.is(":visible")
4216 }
4217 }
4218 a.data("only-if-hidden") && XenForo.isPositive(a.data("only-if-hidden")) && this.targetVisible || a.click(c.context(this, "toggle"))
4219 },
4220 toggle: function(a) {
4221 a.preventDefault();
4222 var b = this.$trigger,
4223 d = this.$target;
4224 if (!b.data("toggle-if-pointer") || !XenForo.isPositive(b.data("toggle-if-pointer")) || "pointer" === b.css("cursor")) {
4225 if (b.data("toggle-text")) {
4226 var e =
4227 b.text();
4228 b.text(b.data("toggle-text"));
4229 b.data("toggle-text", e)
4230 }(a.pageX || a.pageY) && b.blur();
4231 d ? (c(k).trigger("ToggleTriggerEvent", {
4232 closing: this.targetVisible,
4233 $target: d
4234 }), this.hideSelfIfNeeded(), a = function() {
4235 d.trigger("elementResized")
4236 }, b = d.data("toggle-class"), this.targetVisible ? b ? (d.removeClass(b), a()) : d.xfFadeUp(null, a) : b ? (d.addClass(b), a()) : d.xfFadeDown(null, a), this.targetVisible = !this.targetVisible) : this.load()
4237 }
4238 },
4239 hideSelfIfNeeded: function() {
4240 var a = this.$trigger.data("hide");
4241 if (!a) return !1;
4242 if ("self" ==
4243 a) a = this.$trigger;
4244 else {
4245 var b = this.$trigger.closest(".ToggleTriggerAnchor");
4246 b.length || (b = c("body"));
4247 a = b.find(a)
4248 }
4249 a.hide()
4250 },
4251 load: function() {
4252 if (!this.loading && this.$trigger.attr("href")) {
4253 var a = this,
4254 b = c(this.$trigger.data("position"));
4255 if (!b.length && (b = this.$trigger.closest(".ToggleTriggerAnchor"), !b.length)) return console.warn("Could not match toggle target position selector %s", this.$trigger.data("position")), !1;
4256 var d = this.$trigger.data("position-method") || "insertAfter";
4257 this.loading = !0;
4258 XenForo.ajax(this.$trigger.attr("href"), {}, function(e) {
4259 a.loading = !1;
4260 if (XenForo.hasResponseError(e)) return !1;
4261 if (e._redirectStatus && e._redirectTarget) {
4262 var f = function() {
4263 XenForo.redirect(e._redirectTarget)
4264 };
4265 if (XenForo._manualDeferOverlay) c(k).one("ManualDeferComplete", f);
4266 else f();
4267 return !1
4268 }
4269 if (!e.templateHtml) return !1;
4270 new XenForo.ExtLoader(e, function(e) {
4271 a.$target = c(e.templateHtml);
4272 a.$target.xfInsert(d, b);
4273 a.targetVisible = !0;
4274 a.hideSelfIfNeeded()
4275 })
4276 })
4277 }
4278 }
4279 };
4280 XenForo.OverlayTrigger = function(a, b) {
4281 this.__construct(a, b)
4282 };
4283 XenForo.OverlayTrigger.prototype = {
4284 __construct: function(a, b) {
4285 this.$trigger = a.click(c.context(this, "show"));
4286 this.options = b
4287 },
4288 show: function(a) {
4289 var b = this.$trigger.closest(".xenOverlay").data("overlay"),
4290 d = this.$trigger.is(".username, .avatar");
4291 if (!parseInt(XenForo._enableOverlays)) {
4292 if (this.$trigger.attr("href")) return !0;
4293 if (this.$trigger.data("href")) {
4294 if (0 == this.$trigger.closest(".AttachmentUploader, #AttachmentUploader").length) return XenForo.redirect(this.$trigger.data("href")), !1
4295 } else return console.warn("No alternative action found for OverlayTrigger %o",
4296 this.$trigger), !0
4297 }
4298 if (d && this.$trigger.hasClass("NoOverlay") || a.ctrlKey || a.shiftKey || a.altKey || 1 < a.which) return !0;
4299 if (this.options && this.options.onBeforeTrigger) {
4300 var e = c.Event();
4301 e.clickEvent = a;
4302 this.options.onBeforeTrigger(e);
4303 if (e.isDefaultPrevented()) return
4304 }
4305 e = c.Event("BeforeOverlayTrigger");
4306 this.$trigger.trigger(e);
4307 if (!e.isDefaultPrevented())
4308 if (a.preventDefault(), b && b.isOpened()) {
4309 var f = this;
4310 b.getTrigger().one("onClose", function(a) {
4311 setTimeout(function() {
4312 f.show(a)
4313 }, 0)
4314 });
4315 b.getConf().mask.closeSpeed = 0;
4316 b.close()
4317 } else {
4318 if (!this.OverlayLoader) return b = "object" == typeof this.options ? this.options : {}, b = c.extend(b, this.$trigger.data("overlayoptions")), e = this.$trigger.data("cacheoverlay"), void 0 !== e ? XenForo.isPositive(e) ? e = !0 : (e = !1, b.onClose = c.context(this, "deCache")) : this.$trigger.is("input:submit") && (e = !1, b.onClose = c.context(this, "deCache")), d && !this.$trigger.hasClass("OverlayTrigger") && (!this.$trigger.data("cardurl") && this.$trigger.attr("href") && (d = this.$trigger.attr("href").replace(/#.*$/, ""), d = 0 <= d.indexOf("?") ?
4319 d + "&card=1" : d + "?card=1", this.$trigger.data("cardurl", d)), e = !0, b.speed = XenForo.speed.fast), this.OverlayLoader = new XenForo.OverlayLoader(this.$trigger, e, b), this.OverlayLoader.load(), a.preventDefault(), !0;
4320 this.OverlayLoader.show()
4321 }
4322 },
4323 deCache: function() {
4324 this.OverlayLoader && this.OverlayLoader.overlay && (console.info("DeCache %o", this.OverlayLoader.overlay.getOverlay()), this.OverlayLoader.overlay.getTrigger().removeData("overlay"), this.OverlayLoader.overlay.getOverlay().empty().remove());
4325 delete this.OverlayLoader
4326 }
4327 };
4328 XenForo.LightBoxTrigger = function(a) {
4329 new XenForo.OverlayTrigger(a.data("cacheoverlay", 1), {
4330 top: 15,
4331 speed: 1,
4332 closeSpeed: 0,
4333 closeOnResize: !0,
4334 mask: {
4335 color: "rgb(0,0,0)",
4336 opacity: .6,
4337 loadSpeed: 0,
4338 closeSpeed: 0
4339 },
4340 onBeforeTrigger: function(a) {
4341 500 > c(g).height() && a.preventDefault()
4342 },
4343 onBeforeLoad: function(b) {
4344 "function" == typeof XenForo.LightBox && (void 0 === XenForo._LightBoxObj && (XenForo._LightBoxObj = new XenForo.LightBox(this, "*[data-author]")), b = parseInt(XenForo._lightBoxUniversal) ? c("body") : a.closest("*[data-author]"),
4345 console.info("Opening LightBox for %o using %s", b, "*[data-author]"), XenForo._LightBoxObj.setThumbStrip(b), XenForo._LightBoxObj.setImage(this.getTrigger().find("img:first")), c(k).triggerHandler("LightBoxOpening"));
4346 return !0
4347 },
4348 onLoad: function(a) {
4349 XenForo._LightBoxObj.setDimensions(!0);
4350 XenForo._LightBoxObj.bindNav();
4351 return !0
4352 },
4353 onClose: function(a) {
4354 XenForo._LightBoxObj.setImage();
4355 XenForo._LightBoxObj.unbindNav();
4356 XenForo._LightBoxObj.resetHeight();
4357 return !0
4358 }
4359 })
4360 };
4361 XenForo.OverlayLoaderCache = {};
4362 XenForo.OverlayLoader =
4363 function(a, b, c) {
4364 this.__construct(a, c, b)
4365 };
4366 XenForo.OverlayLoader.prototype = {
4367 __construct: function(a, b, c) {
4368 this.$trigger = a;
4369 this.cache = c;
4370 this.options = b
4371 },
4372 load: function(a) {
4373 if (this.$trigger.is("input:submit")) {
4374 if (this.cache = !1, !this.xhr) {
4375 a = this.$trigger.closest("form");
4376 var b = a.serializeArray();
4377 b.push({
4378 name: this.$trigger.attr("name"),
4379 value: this.$trigger.attr("value")
4380 });
4381 this.xhr = XenForo.ajax(a.attr("action"), b, c.context(this, "loadSuccess"))
4382 }
4383 } else {
4384 this.href = this.$trigger.data("cardurl") || this.$trigger.data("href") ||
4385 this.$trigger.attr("href");
4386 if (!this.href) return console.warn("No overlay href found for control %o", this.$trigger), !1;
4387 console.info("OverlayLoader for %s", this.href);
4388 this.callback = a;
4389 this.cache && XenForo.OverlayLoaderCache[this.href] ? this.createOverlay(XenForo.OverlayLoaderCache[this.href]) : this.xhr || (this.xhr = XenForo.ajax(this.href, "", c.context(this, "loadSuccess"), {
4390 type: "GET"
4391 }))
4392 }
4393 },
4394 loadSuccess: function(a, b) {
4395 delete this.xhr;
4396 if (XenForo.hasResponseError(a)) return !1;
4397 if (a._redirectStatus && a._redirectTarget) {
4398 b =
4399 function() {
4400 XenForo.redirect(a._redirectTarget)
4401 };
4402 if (XenForo._manualDeferOverlay) c(k).one("ManualDeferComplete", b);
4403 else b();
4404 return !1
4405 }
4406 this.options.title = a.h1 || a.title;
4407 new XenForo.ExtLoader(a, c.context(this, "createOverlay"))
4408 },
4409 createOverlay: function(a) {
4410 this.overlay = XenForo.createOverlay(this.$trigger, a && a.templateHtml ? a.templateHtml : a, this.options);
4411 this.cache && (XenForo.OverlayLoaderCache[this.href] = this.overlay.getOverlay());
4412 "function" == typeof this.callback && this.callback();
4413 this.show()
4414 },
4415 show: function() {
4416 this.overlay ?
4417 (this.overlay.load(), c(k).trigger({
4418 type: "XFOverlay",
4419 overlay: this.overlay,
4420 trigger: this.$trigger
4421 })) : (console.warn("Attempted to call XenForo.OverlayLoader.show() for %s before overlay is created", this.href), this.load(this.callback))
4422 }
4423 };
4424 XenForo.LoginBar = function(a) {
4425 var b = c("#login").appendTo(a.find(".pageContent")),
4426 d = function(d) {
4427 d.preventDefault();
4428 XenForo.chromeAutoFillFix(b);
4429 b.xfSlideIn(XenForo.speed.slow, "easeOutBack", function() {
4430 c("#LoginControl").select();
4431 a.expose(c.extend(XenForo._overlayConfig.mask, {
4432 loadSpeed: XenForo.speed.slow,
4433 onBeforeLoad: function(a) {
4434 b.css("outline", "0px solid black")
4435 },
4436 onLoad: function(a) {
4437 b.css("outline", "")
4438 },
4439 onBeforeClose: function(a) {
4440 e(!1, !0);
4441 return !0
4442 }
4443 }))
4444 })
4445 },
4446 e = function(a, d) {
4447 a && a.target.blur();
4448 b.xfSlideOut(XenForo.speed.fast);
4449 !d && c.mask && c.mask.close()
4450 };
4451 c('label[for="LoginControl"]').click(function(a) {
4452 0 == c(this).closest("#login").length && (a.preventDefault(), b._xfSlideWrapper(!0) ? e(a) : (c(XenForo.getPageScrollTagName()).scrollTop(0), d(a)))
4453 });
4454 a.delegate('input[name="register"]',
4455 "click",
4456 function(a) {
4457 a = b.find("input.button.primary");
4458 var c = b.find('input[name="register"]:checked').val();
4459 b.find("input.button.primary").val("1" == c ? a.data("signupphrase") : a.data("loginphrase"));
4460 b.find("label.rememberPassword").css("visibility", "1" == c ? "hidden" : "visible")
4461 });
4462 a.delegate(".close", "click", e)
4463 };
4464 XenForo.QuickSearch = function(a) {
4465 var b = 0;
4466 c("#QuickSearchPlaceholder").click(function(a) {
4467 a.preventDefault();
4468 setTimeout(function() {
4469 c("#QuickSearch").addClass("show");
4470 c("#QuickSearchPlaceholder").addClass("hide");
4471 c("#QuickSearchQuery").focus();
4472 XenForo.isTouchBrowser() && c("#QuickSearchQuery").blur()
4473 }, 0)
4474 });
4475 c("#QuickSearchQuery").focus(function(d) {
4476 b++;
4477 console.log("Show quick search menu (%s)", b);
4478 1 == b && c.browser.msie && 9 > c.browser.version && a.find("input").keydown(function(a) {
4479 if (13 == a.keyCode) return c(this).parents("form").submit(), !1
4480 });
4481 if (1 == b) c(XenForo._isWebkitMobile ? k.body.children : k).on("click", function(b) {
4482 c(b.target).closest("#QuickSearch").length || (console.log("Hide quick search menu"), c("#QuickSearch").removeClass("show"),
4483 c("#QuickSearchPlaceholder").removeClass("hide"), a.find(".secondaryControls").slideUp(XenForo.speed.xfast, function() {
4484 a.removeClass("active");
4485 c.browser.msie && (c("body").css("zoom", 1), setTimeout(function() {
4486 c("body").css("zoom", "")
4487 }, 100))
4488 }))
4489 });
4490 a.addClass("active");
4491 a.find(".secondaryControls").slideDown(0)
4492 })
4493 };
4494 XenForo.configureTooltipRtl = function(a) {
4495 void 0 !== a.offset && (a.offset = XenForo.switchOffsetRTL(a.offset));
4496 void 0 !== a.position && (a.position = XenForo.switchStringRTL(a.position));
4497 return a
4498 };
4499 XenForo.Tooltip =
4500 function(a) {
4501 var b = String(a.data("tipclass") || ""),
4502 c = /(\s|^)flipped(\s|$)/.test(b);
4503 a.closest(".linkGroup").length && !c && (c = !0, b += " flipped");
4504 var e = parseInt(a.data("offsety"), 10) || -6,
4505 f = a.is(":visible") ? a.innerWidth() : 0,
4506 h = parseInt(a.data("offsetx"), 10) || 0,
4507 g = h + f * (c ? 1 : -1),
4508 k = XenForo.htmlspecialchars(a.attr("title")),
4509 v = null;
4510 if (0 >= f) {
4511 var m = !1;
4512 v = function() {
4513 if (!m) {
4514 var b = a.innerWidth();
4515 0 >= b || (m = !0, g = h + b * (c ? 1 : -1), a.data("tooltip").getConf().offset = XenForo.switchOffsetRTL([e, g]))
4516 }
4517 }
4518 }
4519 a.attr("title", k).tooltip(XenForo.configureTooltipRtl({
4520 delay: 0,
4521 position: a.data("position") || "top " + (c ? "left" : "right"),
4522 offset: [e, g],
4523 tipClass: "xenTooltip " + b,
4524 layout: '<div><span class="arrow" /></div>',
4525 onBeforeShow: v
4526 }))
4527 };
4528 XenForo.StatusTooltip = function(a) {
4529 if (a.attr("title")) {
4530 var b = XenForo.htmlspecialchars(a.attr("title"));
4531 a.attr("title", b).tooltip(XenForo.configureTooltipRtl({
4532 effect: "slide",
4533 slideOffset: 30,
4534 position: "bottom right",
4535 offset: [10, 10],
4536 tipClass: "xenTooltip statusTip",
4537 layout: '<div><span class="arrow" /></div>'
4538 }))
4539 }
4540 };
4541 XenForo.NodeDescriptionTooltip = function(a) {
4542 var b =
4543 a.data("description");
4544 if (b && c(b).length) {
4545 var d = c(b).addClass("xenTooltip nodeDescriptionTip").appendTo("body").append('<span class="arrow" />');
4546 a.tooltip(XenForo.configureTooltipRtl({
4547 effect: "slide",
4548 slideOffset: 30,
4549 offset: [30, 10],
4550 slideInSpeed: XenForo.speed.xfast,
4551 slideOutSpeed: 50 * XenForo._animationSpeedMultiplier,
4552 predelay: 250,
4553 position: "bottom right",
4554 tip: b,
4555 onBeforeShow: function() {
4556 if (!a.data("tooltip-shown")) {
4557 if (600 > c(g).width()) {
4558 var b = a.data("tooltip").getConf();
4559 b.slideOffset = 0;
4560 b.effect = "toggle";
4561 b.offset = [20, -a.width()];
4562 b.position = ["top", "right"];
4563 XenForo.isRTL() && (b.offset[1] *= -1, b.position[1] = "left");
4564 d.addClass("arrowBottom")
4565 }
4566 a.data("tooltip-shown", !0)
4567 }
4568 }
4569 }));
4570 a.click(function() {
4571 c(this).data("tooltip").hide()
4572 })
4573 }
4574 };
4575 XenForo.AccountMenu = function(a) {
4576 a.find(".submitUnit").hide();
4577 a.find(".StatusEditor").focus(function(b) {
4578 a.is(":visible") && a.find(".submitUnit").show()
4579 })
4580 };
4581 XenForo.FollowLink = function(a) {
4582 a.click(function(b) {
4583 b.preventDefault();
4584 a.get(0).blur();
4585 XenForo.ajax(a.attr("href"), {
4586 _xfConfirm: 1
4587 }, function(b,
4588 c) {
4589 if (XenForo.hasResponseError(b)) return !1;
4590 a.xfFadeOut(XenForo.speed.fast, function() {
4591 a.attr("href", b.linkUrl).html(b.linkPhrase).xfFadeIn(XenForo.speed.fast)
4592 })
4593 })
4594 })
4595 };
4596 XenForo.AttributionLink = function(a) {
4597 a.click(function(a) {
4598 if (c(this.hash).length) {
4599 try {
4600 var b = this.hash,
4601 e = c(this.hash).offset().top,
4602 f = XenForo.getPageScrollTagName();
4603 "pushState" in g.history && g.history.pushState({}, "", g.location.toString().replace(/#.*$/, "") + b);
4604 c(f).animate({
4605 scrollTop: e
4606 }, XenForo.speed.normal, "easeOutBack", function() {
4607 g.history.pushState ||
4608 (g.location.hash = b)
4609 })
4610 } catch (h) {
4611 g.location.hash = this.hash
4612 }
4613 a.preventDefault()
4614 }
4615 })
4616 };
4617 XenForo.ClickProxy = function(a) {
4618 a.click(function(b) {
4619 c(a.attr("rel")).click();
4620 if (!a.data("allowdefault")) return !1
4621 })
4622 };
4623 XenForo.ReCaptcha = function(a) {
4624 this.__construct(a)
4625 };
4626 XenForo.ReCaptcha.prototype = {
4627 __construct: function(a) {
4628 XenForo.ReCaptcha.instance && XenForo.ReCaptcha.instance.remove();
4629 XenForo.ReCaptcha.instance = this;
4630 if (this.publicKey = a.data("publickey")) a.siblings("noscript").remove(), a.uniqueId(), this.$captcha = a, this.type =
4631 "image", a.find(".ReCaptchaReload").click(c.context(this, "reload")), a.find(".ReCaptchaSwitch").click(c.context(this, "switchType")), this.load(), c(g).unload(c.context(this, "remove")), a.closest("form.AutoValidator").bind({
4632 AutoValidationDataReceived: c.context(this, "reload")
4633 })
4634 },
4635 load: function() {
4636 if (g.Recaptcha) this.create();
4637 else {
4638 var a = c.context(this, "create"),
4639 b = c.browser.msie && 6 >= c.browser.version ? 250 : 0;
4640 c.getScript("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js", function() {
4641 setTimeout(a, b)
4642 })
4643 }
4644 },
4645 create: function() {
4646 var a = this.$captcha;
4647 g.Recaptcha.create(this.publicKey, a.attr("id"), {
4648 theme: "custom",
4649 callback: function() {
4650 a.show();
4651 c("#ReCaptchaLoading").remove();
4652 c("#recaptcha_challenge_field").val(g.Recaptcha.get_challenge())
4653 }
4654 })
4655 },
4656 reload: function(a) {
4657 g.Recaptcha && (c(a.target).is("form") || a.preventDefault(), g.Recaptcha.reload())
4658 },
4659 switchType: function(a) {
4660 a.preventDefault();
4661 this.type = "image" == this.type ? "audio" : "image";
4662 g.Recaptcha.switch_type(this.type)
4663 },
4664 remove: function() {
4665 this.$captcha.empty().remove();
4666 g.Recaptcha && g.Recaptcha.destroy()
4667 }
4668 };
4669 XenForo.ReCaptcha.instance = null;
4670 XenForo.NoCaptcha = function(a) {
4671 this.__construct(a)
4672 };
4673 XenForo.NoCaptcha.prototype = {
4674 __construct: function(a) {
4675 this.$captcha = a;
4676 this.noCaptchaId = null;
4677 a.closest("form.AutoValidator").bind({
4678 AutoValidationDataReceived: c.context(this, "reload")
4679 });
4680 g.grecaptcha ? this.create() : (XenForo.NoCaptcha._callbacks.push(c.context(this, "create")), c.getScript("https://www.google.com/recaptcha/api.js?onload=XFNoCaptchaCallback&render=explicit"))
4681 },
4682 create: function() {
4683 g.grecaptcha &&
4684 (this.noCaptchaId = grecaptcha.render(this.$captcha[0], {
4685 sitekey: this.$captcha.data("sitekey")
4686 }))
4687 },
4688 reload: function() {
4689 g.grecaptcha && null !== this.noCaptchaId && grecaptcha.reset(this.noCaptchaId)
4690 }
4691 };
4692 XenForo.NoCaptcha._callbacks = [];
4693 g.XFNoCaptchaCallback = function() {
4694 for (var a = XenForo.NoCaptcha._callbacks, b = 0; b < a.length; b++) a[b]()
4695 };
4696 XenForo.SolveMediaCaptcha = function(a) {
4697 this.__construct(a)
4698 };
4699 XenForo.SolveMediaCaptcha.prototype = {
4700 __construct: function(a) {
4701 XenForo.SolveMediaCaptcha.instance && XenForo.SolveMediaCaptcha.instance.remove();
4702 XenForo.SolveMediaCaptcha.instance = this;
4703 if (this.cKey = a.data("c-key")) a.siblings("noscript").remove(), a.uniqueId(), this.$captcha = a, this.type = "image", this.load(), c(g).unload(c.context(this, "remove")), a.closest("form.AutoValidator").bind({
4704 AutoValidationDataReceived: c.context(this, "reload")
4705 })
4706 },
4707 load: function() {
4708 if (g.ACPuzzle) this.create();
4709 else {
4710 var a = "https:" == g.location.protocol ? "https://api-secure" : "http://api";
4711 g.ACPuzzleOptions = {
4712 onload: c.context(this, "create")
4713 };
4714 XenForo.loadJs(a + ".solvemedia.com/papi/challenge.ajax")
4715 }
4716 },
4717 create: function() {
4718 var a = this.$captcha;
4719 g.ACPuzzle.create(this.cKey, a.attr("id"), {
4720 theme: a.data("theme") || "white",
4721 lang: c("html").attr("lang").substr(0, 2) || "en"
4722 })
4723 },
4724 reload: function(a) {
4725 g.ACPuzzle && (c(a.target).is("form") || a.preventDefault(), g.ACPuzzle.reload())
4726 },
4727 remove: function() {
4728 this.$captcha.empty().remove();
4729 g.ACPuzzle && g.ACPuzzle.destroy()
4730 }
4731 };
4732 XenForo.SolveMediaCaptcha.instance = null;
4733 XenForo.KeyCaptcha = function(a) {
4734 this.__construct(a)
4735 };
4736 XenForo.KeyCaptcha.prototype = {
4737 __construct: function(a) {
4738 this.$captcha =
4739 a;
4740 this.$form = a.closest("form");
4741 this.$form.uniqueId();
4742 this.$codeEl = this.$form.find("input[name=keycaptcha_code]");
4743 this.$codeEl.uniqueId();
4744 this.load();
4745 a.closest("form.AutoValidator").bind({
4746 AutoValidationDataReceived: c.context(this, "reload")
4747 })
4748 },
4749 load: function() {
4750 if (g.s_s_c_onload) this.create();
4751 else {
4752 var a = this.$captcha;
4753 g.s_s_c_user_id = a.data("user-id");
4754 g.s_s_c_session_id = a.data("session-id");
4755 g.s_s_c_captcha_field_id = this.$codeEl.attr("id");
4756 g.s_s_c_submit_button_id = "sbutton-#-r";
4757 g.s_s_c_web_server_sign =
4758 a.data("sign");
4759 g.s_s_c_web_server_sign2 = a.data("sign2");
4760 k.s_s_c_element = this.$form[0];
4761 k.s_s_c_debugmode = 1;
4762 c("#div_for_keycaptcha").length || c("body").append('<div id="div_for_keycaptcha" />');
4763 XenForo.loadJs("https://backs.keycaptcha.com/swfs/cap.js")
4764 }
4765 },
4766 create: function() {
4767 g.s_s_c_onload(this.$form.attr("id"), this.$codeEl.attr("id"), "sbutton-#-r")
4768 },
4769 reload: function(a) {
4770 g.s_s_c_onload && (c(a.target).is("form") || a.preventDefault(), this.load())
4771 }
4772 };
4773 XenForo.Captcha = function(a) {
4774 a.closest("form").off("AutoValidationDataReceived.captcha").on("AutoValidationDataReceived.captcha",
4775 function(b) {
4776 a.fadeTo(XenForo.speed.fast, .5);
4777 XenForo.ajax(a.data("source"), {}, function(b, e) {
4778 if (XenForo.hasResponseError(b)) return !1;
4779 XenForo.hasTemplateHtml(b) && a.xfFadeOut(XenForo.speed.xfast, function() {
4780 c(b.templateHtml).xfInsert("replaceAll", a, "xfFadeIn", XenForo.speed.xfast)
4781 })
4782 })
4783 })
4784 };
4785 XenForo.BbCodeImage = function(a) {
4786 this.__construct(a)
4787 };
4788 XenForo.BbCodeImage.prototype = {
4789 __construct: function(a) {
4790 this.$image = a;
4791 this.actualWidth = 0;
4792 if (!a.closest("a").length && (a.attr("title", XenForo.phrases.click_image_show_full_size_version ||
4793 "Show full size").click(c.context(this, "toggleFullSize")), XenForo.isTouchBrowser() || this.$image.tooltip(XenForo.configureTooltipRtl({
4794 effect: "slide",
4795 slideOffset: 30,
4796 position: "top center",
4797 offset: [45, 0],
4798 tipClass: "xenTooltip bbCodeImageTip",
4799 onBeforeShow: c.context(this, "isResized"),
4800 onShow: c.context(this, "addTipClick")
4801 })), !this.getImageWidth())) {
4802 var b = a.attr("src");
4803 a.bind({
4804 load: c.context(this, "getImageWidth")
4805 });
4806 a.attr("src", b)
4807 }
4808 },
4809 getImageWidth: function() {
4810 this.$image.css({
4811 "max-width": "none",
4812 "max-height": "none"
4813 });
4814 this.actualWidth = this.$image.width();
4815 this.$image.css({
4816 "max-width": "",
4817 "max-height": ""
4818 });
4819 return this.actualWidth
4820 },
4821 toggleFullSize: function(a) {
4822 0 == this.actualWidth && this.getImageWidth();
4823 var b = this.$image.width(),
4824 d = g.navigator.userAgent.match(/Android|iOS|iPhone|iPad|Mobile Safari/i) ? 0 : XenForo.speed.normal;
4825 if (this.actualWidth > b) {
4826 var e = this.$image.offset();
4827 var f = this.actualWidth / b;
4828 XenForo.isRTL() && (e.right = c("html").width() - e.left - b, e.left = "auto");
4829 var h = c("<img />", {
4830 src: this.$image.attr("src")
4831 }).addClass("bbCodeImageFullSize").css("width",
4832 b).css(e).click(function() {
4833 c(this).remove();
4834 c(XenForo.getPageScrollTagName()).scrollLeft(0).scrollTop(e.top)
4835 }).appendTo("body").animate({
4836 width: this.actualWidth
4837 }, d, "easeInOutQuart");
4838 c(k).one("OverlayOpening", function() {
4839 h.remove()
4840 });
4841 c(k).bind("ToggleTriggerEvent", c.context(function(a, b) {
4842 b.closing && b.$target.find(this.$image).length && (console.info("Target is parent of this image %o", this.$image), h.remove())
4843 }, this));
4844 a.target == this.$image.get(0) ? (b = e.left + (a.pageX - e.left) * f - c(g).width() / 2, a = e.top + (a.pageY -
4845 e.top) * f - c(g).height() / 2) : (b = e.left + this.actualWidth / 2 - c(g).width() / 2, a = e.top + this.$image.height() * f / 2 - c(g).height() / 2);
4846 c(XenForo.getPageScrollTagName()).animate({
4847 scrollLeft: b,
4848 scrollTop: a
4849 }, d, "easeInOutQuart", c.context(function() {
4850 var a = this.$image.data("tooltip");
4851 a && a.hide()
4852 }, this))
4853 } else console.log("BBCodeImage: this.actualWidth = %d, currentWidth = %d", this.actualWidth, b)
4854 },
4855 isResized: function(a) {
4856 a = this.$image.width();
4857 if (!a || this.getImageWidth() <= a) return !1
4858 },
4859 addTipClick: function(a) {
4860 this.tipClickAdded ||
4861 (c(this.$image.data("tooltip").getTip()).click(c.context(this, "toggleFullSize")), this.tipClickAdded = !0)
4862 }
4863 };
4864 XenForo.Tabs = function(a) {
4865 this.__construct(a)
4866 };
4867 XenForo.Tabs.prototype = {
4868 __construct: function(a) {
4869 this.$tabContainer = a;
4870 this.$panes = c(a.data("panes"));
4871 var b = a.find("a");
4872 b.length || (b = a.children());
4873 var d = b.filter(".active"),
4874 e = 0;
4875 d.length && b.each(function() {
4876 if (this == d.get(0)) return !1;
4877 e++
4878 });
4879 if (1 < g.location.hash.length) {
4880 var f = g.location.hash.substr(1),
4881 h = -1,
4882 k = !1;
4883 this.$panes.each(function() {
4884 h++;
4885 return c(this).attr("id") ===
4886 f ? (k = !0, !1) : !0
4887 });
4888 k && (e = h)
4889 }
4890 a.tabs(this.$panes, {
4891 current: "active",
4892 history: !1,
4893 initialIndex: e,
4894 onBeforeClick: c.context(this, "onBeforeClick")
4895 });
4896 this.api = a.data("tabs")
4897 },
4898 getCurrentTab: function() {
4899 return this.api.getIndex()
4900 },
4901 click: function(a) {
4902 this.api.click(a)
4903 },
4904 onBeforeClick: function(a, b) {
4905 this.$tabContainer.children().each(function(a) {
4906 b == a ? c(this).addClass("active") : c(this).removeClass("active")
4907 });
4908 var d = c(this.$panes.get(b));
4909 if (a = d.data("loadurl")) d.data("loadurl", ""), XenForo.ajax(a, {}, function(a) {
4910 if (XenForo.hasTemplateHtml(a) ||
4911 XenForo.hasTemplateHtml(a, "message")) new XenForo.ExtLoader(a, function(a) {
4912 var b;
4913 a.templateHtml ? b = c(a.templateHtml) : a.message && (b = c('<div class="section" />').html(a.message));
4914 d.html("");
4915 b && b.xfInsert("appendTo", d, "xfFadeIn", 0)
4916 });
4917 else if (XenForo.hasResponseError(a)) return !1
4918 }, {
4919 type: "GET"
4920 })
4921 }
4922 };
4923 XenForo.LikeLink = function(a) {
4924 a.click(function(a) {
4925 a.preventDefault();
4926 var b = c(this);
4927 XenForo.ajax(this.href, {}, function(a, d) {
4928 if (XenForo.hasResponseError(a)) return !1;
4929 b.stop(!0, !0);
4930 a.term && (b.find(".LikeLabel").html(a.term),
4931 a.cssClasses && c.each(a.cssClasses, function(a, c) {
4932 b["+" == c ? "addClass" : "removeClass"](a)
4933 }));
4934 if ("" === a.templateHtml) c(b.data("container")).xfFadeUp(XenForo.speed.fast, function() {
4935 c(this).empty().xfFadeDown(0)
4936 });
4937 else {
4938 var e = c(b.data("container"));
4939 d = e.find(".LikeText");
4940 var f = c(a.templateHtml);
4941 d.length ? d.xfFadeOut(50, function() {
4942 var a = this.parentNode;
4943 c(this).remove();
4944 f.find(".LikeText").xfInsert("appendTo", a, "xfFadeIn", 50)
4945 }) : new XenForo.ExtLoader(a, function() {
4946 f.xfInsert("appendTo", e)
4947 })
4948 }
4949 })
4950 })
4951 };
4952 XenForo.Facebook = {
4953 initialized: !1,
4954 loading: !1,
4955 parsed: !1,
4956 appId: "",
4957 fbUid: 0,
4958 authResponse: {},
4959 locale: "en-US",
4960 init: function() {
4961 if (!XenForo.Facebook.initialized) {
4962 XenForo.Facebook.initialized = !0;
4963 XenForo.Facebook.loading = !1;
4964 c(k.body).append(c('<div id="fb-root" />'));
4965 var a = {
4966 version: "v2.10",
4967 xfbml: !1,
4968 oauth: !0,
4969 channelUrl: XenForo.canonicalizeUrl("fb_channel.php?l=" + XenForo.Facebook.locale)
4970 };
4971 XenForo.Facebook.appId && (a.appId = XenForo.Facebook.appId);
4972 FB.init(a);
4973 XenForo.Facebook.appId && XenForo.Facebook.fbUid && (FB.Event.subscribe("auth.authResponseChange",
4974 XenForo.Facebook.sessionChange), FB.getLoginStatus(XenForo.Facebook.sessionChange), XenForo.visitor.user_id && c(k).delegate("a.LogOut:not(.OverlayTrigger)", "click", XenForo.Facebook.eLogOutClick));
4975 FB.XFBML.parse(null, function() {
4976 XenForo.Facebook.parsed = !0
4977 })
4978 }
4979 },
4980 start: function() {
4981 var a = c.getCookie("fbUid");
4982 a && a.length && (XenForo.Facebook.fbUid = parseInt(a, 10));
4983 c(".fb-post, .fb-video, .fb-page, .fb-like, .fb-share-button").length && (XenForo.Facebook.forceInit = !0);
4984 (XenForo.Facebook.forceInit || XenForo.Facebook.appId &&
4985 XenForo.Facebook.fbUid) && XenForo.Facebook.load()
4986 },
4987 load: function() {
4988 if (XenForo.Facebook.parsed) FB.XFBML.parse();
4989 else if (!XenForo.Facebook.loading) {
4990 XenForo.Facebook.loading = !0;
4991 XenForo.Facebook.locale = c("html").attr("lang").replace("-", "_");
4992 XenForo.Facebook.locale || (XenForo.Facebook.locale = "en_US");
4993 var a = k.createElement("script");
4994 XenForo.Facebook.locale.replace("-", "_");
4995 a.src = "https://connect.facebook.net/" + XenForo.Facebook.locale + "/sdk.js";
4996 a.async = !0;
4997 g.fbAsyncInit = XenForo.Facebook.init;
4998 k.getElementsByTagName("head")[0].appendChild(a)
4999 }
5000 },
5001 sessionChange: function(a) {
5002 if (XenForo.Facebook.fbUid) {
5003 var b = a.authResponse;
5004 a = XenForo.visitor;
5005 !(XenForo.Facebook.authResponse = b) || a.user_id || XenForo._noSocialLogin || (XenForo.alert(XenForo.phrases.logging_in + "...", "", 8E3), setTimeout(function() {
5006 XenForo.redirect("index.php?register/facebook&t=" + escape(b.accessToken) + "&redirect=" + escape(g.location))
5007 }, 250))
5008 }
5009 },
5010 logout: function(a, b) {
5011 (a = c("a.LogOut:not(.OverlayTrigger)").attr("href")) || (a = "index.php?logout/&_xfToken=" + XenForo._csrfToken);
5012 b && (a += (0 <= a.indexOf("?") ?
5013 "&" : "?") + "redirect=" + escape(g.location));
5014 XenForo.redirect(a)
5015 },
5016 eLogOutClick: function(a) {
5017 if (XenForo.Facebook.authResponse && XenForo.Facebook.authResponse.userID) return FB.logout(XenForo.Facebook.logout), !1
5018 }
5019 };
5020 XenForo.Prompt = function(a) {
5021 this.__construct(a)
5022 };
5023 "placeholder" in k.createElement("input") ? XenForo.Prompt.prototype = {
5024 __construct: function(a) {
5025 this.$input = a
5026 },
5027 isEmpty: function() {
5028 return "" === this.$input.strval()
5029 },
5030 val: function(a, b) {
5031 if (void 0 === a) return this.$input.val();
5032 b && this.$input.focus();
5033 return this.$input.val(a)
5034 }
5035 } :
5036 XenForo.Prompt.prototype = {
5037 __construct: function(a) {
5038 console.log("Emulating placeholder behaviour for %o", a);
5039 this.placeholder = a.attr("placeholder");
5040 this.$input = a.bind({
5041 focus: c.context(this, "setValueMode"),
5042 blur: c.context(this, "setPromptMode")
5043 });
5044 this.$input.closest("form").bind({
5045 submit: c.context(this, "eFormSubmit"),
5046 AutoValidationBeforeSubmit: c.context(this, "eFormSubmit"),
5047 AutoValidationComplete: c.context(this, "eFormSubmitted")
5048 });
5049 this.setPromptMode()
5050 },
5051 isEmpty: function() {
5052 var a = this.$input.val();
5053 return "" ===
5054 a || a == this.placeholder
5055 },
5056 setPromptMode: function() {
5057 this.isEmpty() && this.$input.val(this.placeholder).addClass("prompt")
5058 },
5059 setValueMode: function() {
5060 this.isEmpty() && this.$input.val("").removeClass("prompt").select()
5061 },
5062 val: function(a, b) {
5063 if (void 0 === a) return this.isEmpty() ? "" : this.$input.val();
5064 "" === a ? (this.$input.val(""), void 0 === b && this.setPromptMode()) : (this.setValueMode(), this.$input.val(a))
5065 },
5066 eFormSubmit: function() {
5067 this.isEmpty() && this.$input.val("");
5068 return !0
5069 },
5070 eFormSubmitted: function() {
5071 this.setPromptMode()
5072 }
5073 };
5074 XenForo.SpinBox = function(a) {
5075 this.__construct(a)
5076 };
5077 XenForo.SpinBox.prototype = {
5078 __construct: function(a) {
5079 if (void 0 === a.attr("step")) console.warn("ERROR: No data-step attribute specified for spinbox.");
5080 else {
5081 this.parameters = {
5082 step: null,
5083 min: null,
5084 max: null
5085 };
5086 for (b in this.parameters) void 0 === a.attr(b) ? delete this.parameters[b] : this.parameters[b] = parseFloat(a.attr(b));
5087 a.width();
5088 var b = c('<input type="button" class="button spinBoxButton up" value="+" data-plusminus="+" tabindex="-1" />').insertAfter(a).focus(c.context(this,
5089 "eFocusButton")).click(c.context(this, "eClickButton")).mouseenter(c.context(this, "eMouseEnter")).mousedown(c.context(this, "eMousedownButton")).on("mouseleave mouseup", c.context(this, "eMouseupButton"));
5090 c('<input type="button" class="button spinBoxButton down" value="-" data-plusminus="-" tabindex="-1" />').insertAfter(b).focus(c.context(this, "eFocusButton")).click(c.context(this, "eClickButton")).mouseenter(c.context(this, "eMouseEnter")).mousedown(c.context(this, "eMousedownButton")).on("mouseleave mouseup",
5091 c.context(this, "eMouseupButton"));
5092 this.$input = a.attr("autocomplete", "off").blur(c.context(this, "eBlurInput")).keyup(c.context(this, "eKeyupInput"));
5093 this.$input.closest("form").bind("submit", c.context(this, "eBlurInput"));
5094 this.$input.val(this.constrain(this.getValue()));
5095 this.mouseTarget = null
5096 }
5097 },
5098 getValue: function() {
5099 var a = parseFloat(this.$input.val());
5100 a = isNaN(a) ? parseFloat(this.$input.val().replace(/[^0-9.]/g, "")) : a;
5101 return isNaN(a) ? 0 : a
5102 },
5103 constrain: function(a) {
5104 return void 0 !== this.parameters.min && a < this.parameters.min ?
5105 (console.warn("Minimum value for SpinBox = %s\n %o", this.parameters.min, this.$input), this.parameters.min) : void 0 !== this.parameters.max && a > this.parameters.max ? (console.warn("Maximum value for SpinBox = %s\n %o", this.parameters.max, this.$input), this.parameters.max) : a
5106 },
5107 stepValue: function(a) {
5108 if (this.$input.prop("readonly")) return !1;
5109 var b = this.getValue(),
5110 c = b % this.parameters.step;
5111 a = "+" == a;
5112 b -= c;
5113 if (!c || a && 0 < c || !a && 0 > c) b += this.parameters.step * (a ? 1 : -1);
5114 this.$input.val(this.constrain(b));
5115 this.$input.triggerHandler("change")
5116 },
5117 eBlurInput: function(a) {
5118 this.$input.val(this.constrain(this.getValue()))
5119 },
5120 eKeyupInput: function(a) {
5121 switch (a.which) {
5122 case 38:
5123 return this.stepValue("+"), this.$input.select(), !1;
5124 case 40:
5125 return this.stepValue("-"), this.$input.select(), !1
5126 }
5127 },
5128 eFocusButton: function(a) {
5129 return !1
5130 },
5131 eClickButton: function(a) {
5132 this.stepValue(c(a.target).data("plusminus"));
5133 this.$input.focus();
5134 this.$input.select()
5135 },
5136 eMousedownButton: function(a) {
5137 this.eMouseupButton(a);
5138 this.mouseTarget = a.target;
5139 this.holdTimeout = setTimeout(c.context(function() {
5140 this.holdInterval =
5141 setInterval(c.context(function() {
5142 this.stepValue(a.target.value)
5143 }, this), 75)
5144 }, this), 500)
5145 },
5146 eMouseEnter: function(a) {
5147 a.which && a.target == this.mouseTarget && (this.holdInterval = setInterval(c.context(function() {
5148 this.stepValue(a.target.value)
5149 }, this), 75))
5150 },
5151 eMouseupButton: function(a) {
5152 clearTimeout(this.holdTimeout);
5153 clearInterval(this.holdInterval);
5154 "mouseup" == a.type && (this.mouseTarget = null)
5155 }
5156 };
5157 XenForo.Disabler = function(a) {
5158 var b = function(b, e) {
5159 b = d.find("input, select, textarea, button, .inputWrapper, .taggingInput");
5160 var f = e ? 0 : XenForo.speed.fast,
5161 h = function(a) {
5162 d.find("input:not([type=hidden], [type=file]), textarea, select, button").first().focus().select()
5163 };
5164 a.is(":checked:enabled") ? (d.removeAttr("disabled").removeClass("disabled").trigger("DisablerDisabled"), b.removeAttr("disabled").removeClass("disabled"), a.hasClass("Hider") ? e ? d.show() : d.xfFadeDown(f, e ? null : h) : e || h.call()) : (a.hasClass("Hider") && (e ? d.hide() : d.xfFadeUp(f, null, f, "easeInBack")), d.prop("disabled", !0).addClass("disabled").trigger("DisablerEnabled"),
5165 b.prop("disabled", !0).addClass("disabled").each(function(a, b) {
5166 a = c(b);
5167 b = a.data("disabled");
5168 null !== b && "undefined" != typeof b && a.val(b)
5169 }))
5170 },
5171 d = c("#" + a.attr("id") + "_Disabler"),
5172 e = a.closest("form"),
5173 f = function() {
5174 setTimeout(b, 0)
5175 };
5176 a.is(":radio") ? e.find('input:radio[name="' + a.fieldName() + '"]').click(f) : a.click(f);
5177 e.bind("reset", f);
5178 e.bind("XFRecalculate", function() {
5179 b(null, !0)
5180 });
5181 b(null, !0);
5182 d.find("label, input, select, textarea").click(function(c) {
5183 a.is(":checked") || (a.prop("checked", !0), b())
5184 });
5185 this.setStatus = b
5186 };
5187 XenForo.CheckAll = function(a) {
5188 if (a.is(":checkbox")) {
5189 var b = a.data("target") ? c(a.data("target")) : !1;
5190 b && b.length || (b = a.closest("form"));
5191 var d = function() {
5192 var c = a.data("filter");
5193 return c ? b.find(c).filter("input:checkbox") : b.find("input:checkbox")
5194 },
5195 e = function() {
5196 var b = d(),
5197 e = 0 < b.length;
5198 b.each(function() {
5199 if (c(this).is(a)) return !0;
5200 if (!c(this).prop("checked")) return e = !1
5201 });
5202 a.prop("checked", e)
5203 };
5204 e();
5205 var f = !1;
5206 b.on("click", "input:checkbox", function(b) {
5207 f || (b = c(b.target), b.is(a) || a.data("filter") && !b.closest(a.data("filter")).length ||
5208 e())
5209 });
5210 a.click(function(a) {
5211 f || (f = !0, d().prop("checked", a.target.checked).triggerHandler("click"), f = !1)
5212 });
5213 a.on("XFRecalculate", e)
5214 } else a.click(function(b) {
5215 (b = a.data("target")) && c(b).prop("checked", !0)
5216 })
5217 };
5218 XenForo.AutoChecker = function(a) {
5219 a.click(function(b) {
5220 if (this.checked) {
5221 var d = null;
5222 c.each({
5223 check: !0,
5224 uncheck: !1
5225 }, function(b, f) {
5226 (d = a.data(b)) && c(d).each(function() {
5227 this.checked = f;
5228 var a = c(this).data("XenForo.Disabler");
5229 "object" == typeof a && a.setStatus()
5230 })
5231 })
5232 }
5233 })
5234 };
5235 XenForo.ToggleButton = function(a) {
5236 var b = function() {
5237 f[d.is(":checked") ?
5238 "addClass" : "removeClass"]("checked")
5239 },
5240 d = a.hide().find("input:checkbox, input:radio").first(),
5241 e = a.closest("ul, ol").bind("toggleButtonClick", b);
5242 !d.length && a.attr("for") && (d = c("#" + a.attr("for")));
5243 var f = c("<a />").text(a.attr("title") || a.text()).insertBefore(a).attr({
5244 "class": "button " + a.attr("class"),
5245 title: a.text()
5246 }).click(function(a) {
5247 d.click();
5248 e.length ? e.triggerHandler("toggleButtonClick") : b();
5249 return !1
5250 });
5251 a.closest("form").bind("reset", function(a) {
5252 setTimeout(b, 100)
5253 });
5254 b()
5255 };
5256 XenForo.AutoInlineUploader =
5257 function(a) {
5258 a.find("input:file").each(function() {
5259 var b = c(this).change(function(e) {
5260 "" != c(e.target).val() && (c('<iframe src="about:blank" style="display:none; background-color: white" name="AutoInlineUploader"></iframe>').insertAfter(c(e.target)).load(function(e) {
5261 var f = c(e.target);
5262 e = f.contents().text();
5263 var g = null;
5264 if (!e) return !1;
5265 c(k).trigger("PseudoAjaxStop");
5266 d.clone(!0).replaceAll(b);
5267 setTimeout(function() {
5268 f.remove()
5269 }, 500);
5270 try {
5271 e = c.parseJSON(e), console.info("Inline file upload completed successfully. Data: %o",
5272 e)
5273 } catch (x) {
5274 return console.error(e), !1
5275 }
5276 if (XenForo.hasResponseError(e)) return !1;
5277 c("input:submit", this.$form).removeAttr("disabled");
5278 g = new c.Event("AutoInlineUploadComplete");
5279 g.$form = a;
5280 g.ajaxData = e;
5281 a.trigger(g);
5282 console.log(e);
5283 !g.isDefaultPrevented() && e.message && XenForo.alert(e.message, "", 2500)
5284 }), e = c('<span><input type="hidden" name="_xfNoRedirect" value="1" /><input type="hidden" name="_xfResponseType" value="json-text" /><input type="hidden" name="_xfUploader" value="1" /></span>').appendTo(a), a.attr("target",
5285 "AutoInlineUploader").submit().trigger("AutoInlineUploadStart"), e.remove(), c(k).trigger("PseudoAjaxStart"), a.find("input:submit").prop("disabled", !0))
5286 }),
5287 d = b.clone(!0)
5288 })
5289 };
5290 XenForo.MultiSubmitFix = function(a) {
5291 var b = function() {
5292 c(g).unbind("unload", b);
5293 a.trigger("EnableSubmitButtons").find("input:submit, input:reset, input.PreviewButton, input.DisableOnSubmit").removeClass("disabled").removeAttr("disabled")
5294 },
5295 d = function(d) {
5296 setTimeout(function() {
5297 c.browser.webkit || c(g).bind("unload", b);
5298 a.trigger("DisableSubmitButtons").find("input:submit, input:reset, input.PreviewButton, input.DisableOnSubmit").prop("disabled", !0).addClass("disabled")
5299 }, 0);
5300 setTimeout(b, 5E3)
5301 };
5302 a.data("MultiSubmitEnable", b).data("MultiSubmitDisable", d).submit(d);
5303 return b
5304 };
5305 XenForo.SubmitOnChange = function(a) {
5306 if (a.is("label") && (a = a.find("input:radio, input:checkbox"), !a.length)) return;
5307 a.click(function(a) {
5308 clearTimeout(a.target.form.submitTimeout);
5309 a.target.form.submitTimeout = setTimeout(function() {
5310 c(a.target).closest("form").submit()
5311 }, 500)
5312 })
5313 };
5314 XenForo.AutoValidator = function(a) {
5315 this.__construct(a)
5316 };
5317 XenForo.AutoValidator.prototype = {
5318 __construct: function(a) {
5319 this.$form =
5320 a.bind({
5321 submit: c.context(this, "ajaxSave"),
5322 reset: c.context(this, "formReset"),
5323 BbCodeWysiwygEditorAutoSave: c.context(this, "editorAutoSave")
5324 });
5325 this.$form.find('input[type="submit"]').click(c.context(this, "setClickedSubmit"));
5326 this.fieldValidatorUrl = this.$form.data("fieldvalidatorurl");
5327 this.optInMode = this.$form.data("optinout") || "OptOut";
5328 this.ajaxSubmit = XenForo.isPositive(this.$form.data("normalsubmit")) ? !1 : !0;
5329 this.submitPending = !1;
5330 this.fieldValidationTimeouts = {};
5331 this.fieldValidationRequests = {}
5332 },
5333 getExistingDataKey: function() {
5334 var a =
5335 this.$form.find("input.ExistingDataKey, select.ExistingDataKey, textarea.ExistingDataKey, button.ExistingDataKey").val();
5336 void 0 === a && (a = this.$form.data("existingdatakey"), void 0 === a && (a = ""));
5337 return a
5338 },
5339 formReset: function(a) {
5340 (a = this.$form.data("exiturl")) && XenForo.redirect(a)
5341 },
5342 setClickedSubmit: function(a) {
5343 this.$form.data("clickedsubmitbutton", a.target)
5344 },
5345 editorAutoSave: function(a) {
5346 this.submitPending && a.preventDefault()
5347 },
5348 ajaxSave: function(a) {
5349 if (!this.ajaxSubmit || !XenForo._enableAjaxSubmit) return !0;
5350 this.abortPendingFieldValidation();
5351 var b = this.$form.data("clickedsubmitbutton"),
5352 d = c.Event("AutoValidationBeforeSubmit");
5353 d.formAction = this.$form.attr("action");
5354 d.clickedSubmitButton = b;
5355 d.preventSubmit = !1;
5356 d.ajaxOptions = {};
5357 this.$form.trigger(d);
5358 this.$form.removeData("clickedSubmitButton");
5359 if (d.preventSubmit) return !1;
5360 if (!d.isDefaultPrevented()) {
5361 var e = this.$form.serializeArray();
5362 b && (b = c(b), b.attr("name") && e.push({
5363 name: b.attr("name"),
5364 value: b.attr("value")
5365 }));
5366 this.submitPending = !0;
5367 XenForo.ajax(d.formAction, e, c.context(this, "ajaxSaveResponse"),
5368 d.ajaxOptions);
5369 a.preventDefault()
5370 }
5371 },
5372 ajaxSaveResponse: function(a, b) {
5373 this.submitPending = !1;
5374 if (!a) return console.warn("No ajax data returned."), !1;
5375 var d = c.Event("AutoValidationDataReceived");
5376 d.ajaxData = a;
5377 d.textStatus = b;
5378 d.validationError = [];
5379 console.group("Event: %s", d.type);
5380 this.$form.trigger(d);
5381 console.groupEnd();
5382 if (d.isDefaultPrevented()) return !1;
5383 if (!this.validates(d)) {
5384 var e = c.Event("AutoValidationError");
5385 e.ajaxData = a;
5386 e.textStatus = b;
5387 e.validationError = d.validationError;
5388 console.group("Event: %s", e.type);
5389 this.$form.trigger(e);
5390 console.groupEnd();
5391 if (e.isDefaultPrevented()) return !1;
5392 this.$form.closest(".xenOverlay").length && this.$form.closest(".xenOverlay").data("overlay").close();
5393 if (a.errorTemplateHtml) new XenForo.ExtLoader(a, function(b) {
5394 if (b = XenForo.alert(a.errorTemplateHtml, XenForo.phrases.following_error_occurred + ":")) b.find("div.errorDetails").removeClass("baseHtml"), a.errorOverlayType && b.closest(".errorOverlay").removeClass("errorOverlay").addClass(a.errorOverlayType)
5395 });
5396 else if (a.templateHtml) setTimeout(c.context(function() {
5397 this.$error =
5398 XenForo.createOverlay(null, this.prepareError(a.templateHtml)).load()
5399 }, this), 250);
5400 else if (void 0 !== a.error) {
5401 if ("object" === typeof a.error) {
5402 for (var f in a.error) break;
5403 a.error = a.error[f]
5404 }
5405 XenForo.alert(a.error + "\n" + (void 0 !== a.traceHtml ? '<ol class="traceHtml">\n' + a.traceHtml + "</ol>" : ""), XenForo.phrases.following_error_occurred + ":")
5406 }
5407 return !1
5408 }
5409 d = c.Event("AutoValidationComplete");
5410 d.ajaxData = a;
5411 d.textStatus = b;
5412 d.$form = this.$form;
5413 console.group("Event: %s", d.type);
5414 this.$form.trigger(d);
5415 console.groupEnd();
5416 if (d.isDefaultPrevented()) return !1;
5417 if (this.$form.parents(".xenOverlay").length && (this.$form.parents(".xenOverlay").data("overlay").close(), a.linkPhrase)) {
5418 var h = this.$form.parents(".xenOverlay").data("overlay").getTrigger();
5419 h.xfFadeOut(XenForo.speed.fast, function() {
5420 a.linkUrl && h.is("a") && h.attr("href", a.linkUrl);
5421 h.text(a.linkPhrase).xfFadeIn(XenForo.speed.fast)
5422 })
5423 }
5424 XenForo.isPositive(this.$form.data("reset")) && this.$form[0].reset();
5425 if (a.message) XenForo.alert(a.message, "", 4E3);
5426 else {
5427 if ("" == a._redirectMessage) return this.submitPending = !0,
5428 this.redirect(a._redirectTarget);
5429 this.submitPending = !0;
5430 XenForo.alert(a._redirectMessage, "", 1E3, c.context(function() {
5431 this.redirect(a._redirectTarget)
5432 }, this))
5433 }
5434 },
5435 validates: function(a) {
5436 return c.isEmptyObject(a.validationErrors) && !a.ajaxData.error
5437 },
5438 prepareError: function(a) {
5439 w = c(a);
5440 w.find("label").each(function(a, d) {
5441 a = c("#" + c(d).attr("for")).closest(".ctrlUnit").find("dt > label");
5442 a.length && c(d).prepend(a.text() + "<br />")
5443 });
5444 return w
5445 },
5446 redirect: function(a) {
5447 if (XenForo.isPositive(this.$form.data("redirect")) ||
5448 !parseInt(XenForo._enableOverlays)) {
5449 var b = new c.Event("AutoValidationRedirect");
5450 b.redirectTarget = a;
5451 this.$form.trigger(b);
5452 if (!b.isDefaultPrevented() && b.redirectTarget) {
5453 b = function() {
5454 XenForo.redirect(a)
5455 };
5456 if (XenForo._manualDeferOverlay) c(k).one("ManualDeferComplete", b);
5457 else b();
5458 return !0
5459 }
5460 }
5461 return !1
5462 },
5463 setFieldValidationTimeout: function(a, b) {
5464 if (!this.hasFieldValidator(a)) return !1;
5465 console.log("setTimeout %s", a);
5466 this.clearFieldValidationTimeout(a);
5467 this.fieldValidationTimeouts[a] = setTimeout(b, 250)
5468 },
5469 clearFieldValidationTimeout: function(a) {
5470 this.fieldValidationTimeouts[a] &&
5471 (console.log("Clear field validation timeout: %s", a), clearTimeout(this.fieldValidationTimeouts[a]), delete this.fieldValidationTimeouts[a])
5472 },
5473 startFieldValidationRequest: function(a, b, c) {
5474 if (!this.hasFieldValidator(a)) return !1;
5475 this.abortFieldValidationRequest(a);
5476 this.fieldValidationRequests[a] = XenForo.ajax(this.fieldValidatorUrl, {
5477 name: a,
5478 value: b.fieldValue(),
5479 existingDataKey: this.getExistingDataKey()
5480 }, c, {
5481 global: !1
5482 })
5483 },
5484 abortFieldValidationRequest: function(a) {
5485 this.fieldValidationRequests[a] && (console.log("Abort field validation request: %s",
5486 a), this.fieldValidationRequests[a].abort(), delete this.fieldValidationRequests[a])
5487 },
5488 abortPendingFieldValidation: function() {
5489 c.each(this.fieldValidationTimeouts, c.context(this, "clearFieldValidationTimeout"));
5490 c.each(this.fieldValidationRequests, c.context(this, "abortFieldValidationRequest"))
5491 },
5492 hasFieldValidator: function(a) {
5493 return this.fieldValidatorUrl ? !0 : !1
5494 }
5495 };
5496 XenForo.AutoValidatorControl = function(a) {
5497 this.__construct(a)
5498 };
5499 XenForo.AutoValidatorControl.prototype = {
5500 __construct: function(a) {
5501 this.$form = a.closest("form.AutoValidator").bind({
5502 AutoValidationDataReceived: c.context(this,
5503 "handleFormValidation")
5504 });
5505 this.$input = a.bind({
5506 change: c.context(this, "change"),
5507 AutoValidationError: c.context(this, "showError"),
5508 AutoValidationPass: c.context(this, "hideError")
5509 });
5510 this.name = a.data("validatorname") || a.attr("name");
5511 this.autoValidate = a.hasClass("NoAutoValidate") ? !1 : !0
5512 },
5513 change: function(a) {
5514 this.autoValidate && this.$form.data("XenForo.AutoValidator").setFieldValidationTimeout(this.name, c.context(this, "validate"))
5515 },
5516 validate: function() {
5517 this.autoValidate && this.$form.data("XenForo.AutoValidator").startFieldValidationRequest(this.name,
5518 this.$input, c.context(this, "handleValidation"))
5519 },
5520 handleValidation: function(a, b) {
5521 if (a && a.error && a.error.hasOwnProperty(this.name)) return this.$input.trigger({
5522 type: "AutoValidationError",
5523 errorMessage: a.error[this.name]
5524 }), !1;
5525 this.$input.trigger("AutoValidationPass");
5526 return !0
5527 },
5528 showError: function(a) {
5529 console.warn("%s: %s", this.name, a.errorMessage);
5530 a = this.fetchError(a.errorMessage).css("display", "inline-block");
5531 this.positionError(a)
5532 },
5533 hideError: function() {
5534 console.info("%s: Okay", this.name);
5535 this.$error && this.fetchError().hide()
5536 },
5537 fetchError: function(a) {
5538 this.$error || (this.$error = c('<label for="' + this.$input.attr("id") + '" class="formValidationInlineError">WHoops</label>').insertAfter(this.$input));
5539 a && this.$error.html(a).xfActivate();
5540 return this.$error
5541 },
5542 positionError: function(a) {
5543 a.removeClass("inlineError");
5544 var b = this.$input.coords("outer", "position"),
5545 d = this.$input.coords("outer"),
5546 e = c(g),
5547 f = a.outerWidth(),
5548 h = {
5549 top: b.top
5550 };
5551 d.width && d.height ? XenForo.isRTL() ? (h.left = b.left - f - 10, d = 0 < d.left - f - 10) : (d = d.left + d.width + 10 + f < e.width() + e.scrollLeft(),
5552 h.left = b.left + b.width + 10) : d = !1;
5553 d ? a.css(h) : a.addClass("inlineError")
5554 },
5555 handleFormValidation: function(a) {
5556 this.handleValidation(a.ajaxData, a.textStatus) || a.validationError.push(this.name)
5557 }
5558 };
5559 XenForo.isAutoValidatorField = function(a) {
5560 var b = c(a.form);
5561 if (!b.hasClass("AutoValidator")) return !1;
5562 if (b = b.data("XenForo.AutoValidator")) switch (a = c(a), b.optInMode) {
5563 case "OptIn":
5564 return a.hasClass("OptIn") || a.closest(".ctrlUnit").hasClass("OptIn");
5565 default:
5566 return !a.hasClass("OptOut") && !a.closest(".ctrlUnit").hasClass("OptOut")
5567 }
5568 return !1
5569 };
5570 XenForo.PreviewForm = function(a) {
5571 var b = a.data("previewurl");
5572 b ? a.find(".PreviewButton").click(function(d) {
5573 var e = c(this);
5574 XenForo.ajax(b, a.serialize(), function(b) {
5575 if (XenForo.hasResponseError(b) || !XenForo.hasTemplateHtml(b)) return !1;
5576 new XenForo.ExtLoader(b, function(b) {
5577 var d = a.find(".PreviewContainer").first();
5578 d.length ? d.xfFadeOut(XenForo.speed.fast, function() {
5579 d.html(b.templateHtml).xfActivate()
5580 }) : d = c("<div />", {
5581 "class": "PreviewContainer"
5582 }).hide().html(b.templateHtml).prependTo(a).xfActivate();
5583 e.data("overlay") ?
5584 (d.show(), XenForo.createOverlay(d, d.html(b.templateHtml)).load()) : (d.xfFadeIn(XenForo.speed.fast), d.get(0).scrollIntoView(!0))
5585 })
5586 })
5587 }) : console.warn("PreviewForm has no data-previewUrl: %o", a)
5588 };
5589 XenForo.LiveTitle = function(a) {
5590 var b = a.closest(".formOverlay").find("h2.h1");
5591 b.length || (b = c(".titleBar h1").first());
5592 console.info("Title Element: %o", b);
5593 b.data("originalhtml", b.html());
5594 var d = function(d) {
5595 a.trigger("LiveTitleSet", [d]);
5596 b.html("" === d ? b.data("originalhtml") : a.data("livetitletemplate").replace(/%s/,
5597 c("<div />").text(d).html()))
5598 };
5599 a.hasClass("prompt") || d(a.strval());
5600 a.bind("keyup focus", function(b) {
5601 d(a.strval())
5602 }).on("paste", function(b) {
5603 setTimeout(function() {
5604 d(a.strval())
5605 }, 0)
5606 }).closest("form").bind("reset", function(a) {
5607 d("")
5608 })
5609 };
5610 XenForo.TextareaElastic = function(a) {
5611 this.__construct(a)
5612 };
5613 XenForo.TextareaElastic.prototype = {
5614 __construct: function(a) {
5615 this.$input = a;
5616 this.curHeight = 0;
5617 a.bind("keyup focus XFRecalculate", c.context(this, "recalculate"));
5618 a.bind("paste", c.context(this, "paste"));
5619 "" !== a.val() && this.recalculate()
5620 },
5621 recalculate: function() {
5622 var a = this.$input,
5623 b = a.get(0);
5624 if ("" === a.val()) a.css({
5625 "overflow-y": "hidden",
5626 height: ""
5627 }), this.curHeight = 0;
5628 else if (b.clientWidth) {
5629 if (!this.minHeight) {
5630 this.minHeight = (this.borderBox = "border-box" == a.css("-moz-box-sizing") || "border-box" == a.css("box-sizing")) ? a.outerHeight() : b.clientHeight;
5631 if (!this.minHeight) return;
5632 this.maxHeight = parseInt(a.css("max-height"), 10);
5633 this.spacing = this.borderBox ? a.outerHeight() - a.innerHeight() : 0
5634 }
5635 this.$clone || (this.$clone = c("<textarea />").css({
5636 position: "absolute",
5637 left: XenForo.isRTL() ? "9999em" : "-9999em",
5638 top: 0,
5639 visibility: "hidden",
5640 width: b.clientWidth,
5641 height: "1px",
5642 "font-size": a.css("font-size"),
5643 "font-family": a.css("font-family"),
5644 "font-weight": a.css("font-weight"),
5645 "line-height": a.css("line-height"),
5646 "word-wrap": a.css("word-wrap")
5647 }).attr("tabindex", -1).val(" "), this.$clone.appendTo(k.body), this.lineHeight = this.$clone.get(0).scrollHeight);
5648 this.$clone.val(a.val());
5649 b = this.$clone.get(0);
5650 var d = Math.max(this.minHeight, b.scrollHeight + this.lineHeight + this.spacing);
5651 if (d <
5652 this.maxHeight) {
5653 if (this.curHeight != d) {
5654 b = a.get(0);
5655 if (this.curHeight == this.maxHeight && b.setSelectionRange) var e = b.selectionStart;
5656 a.css({
5657 "overflow-y": "hidden",
5658 height: d + "px"
5659 });
5660 if (this.curHeight == this.maxHeight && b.setSelectionRange) try {
5661 b.setSelectionRange(e, e)
5662 } catch (f) {}
5663 this.curHeight = d
5664 }
5665 } else if (this.curHeight != this.maxHeight) {
5666 b = a.get(0);
5667 b.setSelectionRange && (e = b.selectionStart);
5668 a.css({
5669 "overflow-y": "auto",
5670 height: this.maxHeight + "px"
5671 });
5672 if (b.setSelectionRange) try {
5673 b.setSelectionRange(e, e)
5674 } catch (f) {}
5675 this.curHeight =
5676 this.maxHeight
5677 }
5678 }
5679 },
5680 paste: function() {
5681 setTimeout(c.context(this, "recalculate"), 100)
5682 }
5683 };
5684 XenForo.AutoTimeZone = function(a) {
5685 var b = new Date,
5686 d = new Date(b.getFullYear(), 0, 1);
5687 b = new Date(b.getFullYear(), 5, 1);
5688 d = Math.round(d.getTimezoneOffset());
5689 b = Math.round(b.getTimezoneOffset());
5690 return !c.browser.opera && XenForo.AutoTimeZone.map[d + "," + b] ? (a.val(XenForo.AutoTimeZone.map[d + "," + b]), !0) : !1
5691 };
5692 XenForo.AutoTimeZone.map = {
5693 "660,660": "Pacific/Midway",
5694 "600,600": "Pacific/Honolulu",
5695 "570,570": "Pacific/Marquesas",
5696 "540,480": "America/Anchorage",
5697 "480,420": "America/Los_Angeles",
5698 "420,360": "America/Denver",
5699 "420,420": "America/Phoenix",
5700 "360,300": "America/Chicago",
5701 "360,360": "America/Belize",
5702 "300,240": "America/New_York",
5703 "300,300": "America/Bogota",
5704 "270,270": "America/Caracas",
5705 "240,180": "America/Halifax",
5706 "180,240": "America/Cuiaba",
5707 "240,240": "America/La_Paz",
5708 "210,150": "America/St_Johns",
5709 "180,180": "America/Argentina/Buenos_Aires",
5710 "120,180": "America/Sao_Paulo",
5711 "180,120": "America/Miquelon",
5712 "120,120": "America/Noronha",
5713 "60,60": "Atlantic/Cape_Verde",
5714 "60,0": "Atlantic/Azores",
5715 "0,-60": "Europe/London",
5716 "0,0": "Atlantic/Reykjavik",
5717 "-60,-120": "Europe/Amsterdam",
5718 "-60,-60": "Africa/Algiers",
5719 "-120,-60": "Africa/Windhoek",
5720 "-120,-180": "Europe/Athens",
5721 "-120,-120": "Africa/Johannesburg",
5722 "-180,-240": "Africa/Nairobi",
5723 "-180,-180": "Europe/Moscow",
5724 "-210,-270": "Asia/Tehran",
5725 "-240,-300": "Asia/Yerevan",
5726 "-270,-270": "Asia/Kabul",
5727 "-300,-300": "Asia/Tashkent",
5728 "-330,-330": "Asia/Kolkata",
5729 "-345,-345": "Asia/Kathmandu",
5730 "-360,-360": "Asia/Dhaka",
5731 "-390,-390": "Asia/Rangoon",
5732 "-420,-420": "Asia/Bangkok",
5733 "-420,-480": "Asia/Krasnoyarsk",
5734 "-480,-480": "Asia/Hong_Kong",
5735 "-540,-540": "Asia/Tokyo",
5736 "-630,-570": "Australia/Adelaide",
5737 "-570,-570": "Australia/Darwin",
5738 "-660,-600": "Australia/Sydney",
5739 "-600,-600": "Asia/Vladivostok",
5740 "-690,-690": "Pacific/Norfolk",
5741 "-780,-720": "Pacific/Auckland",
5742 "-825,-765": "Pacific/Chatham",
5743 "-780,-780": "Pacific/Tongatapu",
5744 "-840,-840": "Pacific/Kiritimati"
5745 };
5746 XenForo.DatePicker = function(a) {
5747 XenForo.DatePicker.$root || c.tools.dateinput.localize("_f", {
5748 months: XenForo.phrases._months,
5749 shortMonths: "1,2,3,4,5,6,7,8,9,10,11,12",
5750 days: "s,m,t,w,t,f,s",
5751 shortDays: XenForo.phrases._daysShort
5752 });
5753 var b = a.dateinput({
5754 lang: "_f",
5755 format: "yyyy-mm-dd",
5756 speed: 0,
5757 yearRange: [-100, 100],
5758 onShow: function(a) {
5759 a = XenForo.DatePicker.$root;
5760 var d = b.offset(),
5761 f = 0,
5762 h = {
5763 top: d.top + b.outerHeight()
5764 };
5765 XenForo.isRTL() ? h.right = c("html").width() - d.left - b.outerWidth() : h.left = d.left;
5766 a.css(h);
5767 b.parents().each(function(a, b) {
5768 a = parseInt(c(b).css("z-index"), 10);
5769 a > f && (f = a)
5770 });
5771 a.css("z-index", f + 1E3)
5772 }
5773 });
5774 b.addClass(a.attr("class"));
5775 a.attr("id") && b.attr("id", a.attr("id"));
5776 b.closest("form").on("reset",
5777 function() {
5778 setTimeout(function() {
5779 b.data("dateinput").hide()
5780 }, 10);
5781 setTimeout(function() {
5782 b.data("dateinput").hide()
5783 }, 100)
5784 });
5785 XenForo.DatePicker.$root || (XenForo.DatePicker.$root = c("#calroot").appendTo(k.body), c("#calprev").html(XenForo.isRTL() ? "→" : "←").prop("unselectable", !0), c("#calnext").html(XenForo.isRTL() ? "←" : "→").prop("unselectable", !0))
5786 };
5787 XenForo.DatePicker.$root = null;
5788 XenForo.AutoComplete = function(a) {
5789 this.__construct(a)
5790 };
5791 XenForo.AutoComplete.prototype = {
5792 __construct: function(a) {
5793 this.$input =
5794 a;
5795 this.url = a.data("acurl") || XenForo.AutoComplete.getDefaultUrl();
5796 this.extraFields = a.data("acextrafields");
5797 var b = {
5798 multiple: a.hasClass("AcSingle") ? !1 : ",",
5799 minLength: 2,
5800 queryKey: "q",
5801 extraParams: {},
5802 jsonContainer: "results",
5803 autoSubmit: XenForo.isPositive(a.data("autosubmit"))
5804 };
5805 a.data("acoptions") && (b = c.extend(b, a.data("acoptions")));
5806 b.autoSubmit && (b.multiple = !1);
5807 this.multiple = b.multiple;
5808 this.minLength = b.minLength;
5809 this.queryKey = b.queryKey;
5810 this.extraParams = b.extraParams;
5811 this.jsonContainer = b.jsonContainer;
5812 this.autoSubmit =
5813 b.autoSubmit;
5814 this.loadVal = "";
5815 this.results = new XenForo.AutoCompleteResults({
5816 onInsert: c.context(this, "addValue")
5817 });
5818 a.attr("autocomplete", "off").keydown(c.context(this, "keystroke")).keypress(c.context(this, "operaKeyPress")).blur(c.context(this, "blur"));
5819 a.on("paste", function() {
5820 setTimeout(function() {
5821 a.trigger("keydown")
5822 }, 0)
5823 });
5824 a.closest("form").submit(c.context(this, "hideResults"))
5825 },
5826 keystroke: function(a) {
5827 var b = a.keyCode || a.charCode,
5828 d = !0;
5829 switch (b) {
5830 case 40:
5831 this.results.selectResult(1);
5832 break;
5833 case 38:
5834 this.results.selectResult(-1);
5835 break;
5836 case 27:
5837 this.results.hideResults();
5838 break;
5839 case 13:
5840 this.results.isVisible() ? this.results.insertSelectedResult() : d = !1;
5841 break;
5842 default:
5843 d = !1, this.loadTimer && clearTimeout(this.loadTimer), this.loadTimer = setTimeout(c.context(this, "load"), 200), 229 != b && this.results.hideResults()
5844 }
5845 d && a.preventDefault();
5846 this.preventKey = d
5847 },
5848 operaKeyPress: function(a) {
5849 c.browser.opera && this.preventKey && a.preventDefault()
5850 },
5851 blur: function(a) {
5852 clearTimeout(this.loadTimer);
5853 setTimeout(c.context(this, "hideResults"), 250);
5854 this.xhr && (this.xhr.abort(),
5855 this.xhr = !1)
5856 },
5857 load: function() {
5858 var a = this.loadVal,
5859 b = this.extraParams;
5860 this.loadTimer && clearTimeout(this.loadTimer);
5861 this.loadVal = this.getPartialValue();
5862 "" == this.loadVal ? this.hideResults() : this.loadVal == a || this.loadVal.length < this.minLength || (b[this.queryKey] = this.loadVal, "" != this.extraFields && c(this.extraFields).each(function() {
5863 b[this.name] = c(this).val()
5864 }), this.xhr && this.xhr.abort(), this.xhr = XenForo.ajax(this.url, b, c.context(this, "showResults"), {
5865 global: !1,
5866 error: !1
5867 }))
5868 },
5869 hideResults: function() {
5870 this.results.hideResults()
5871 },
5872 showResults: function(a) {
5873 this.xhr && (this.xhr = !1);
5874 this.jsonContainer && a && (a = a[this.jsonContainer]);
5875 this.results.showResults(this.getPartialValue(), a, this.$input)
5876 },
5877 addValue: function(a) {
5878 if (this.multiple) {
5879 var b = this.getFullValues();
5880 "" != a && (b.length && (a = " " + a), b.push(a + this.multiple + " "));
5881 this.$input.val(b.join(this.multiple))
5882 } else this.$input.val(a);
5883 this.$input.trigger("AutoComplete", {
5884 inserted: a,
5885 current: this.$input.val()
5886 });
5887 this.autoSubmit ? this.$input.closest("form").submit() : this.$input.focus()
5888 },
5889 getFullValues: function() {
5890 var a =
5891 this.$input.val();
5892 if ("" == a) return [];
5893 if (this.multiple) {
5894 splitPos = a.lastIndexOf(this.multiple);
5895 if (-1 == splitPos) return [];
5896 a = a.substr(0, splitPos);
5897 return a.split(this.multiple)
5898 }
5899 return [a]
5900 },
5901 getPartialValue: function() {
5902 var a = this.$input.val();
5903 if (this.multiple) {
5904 var b = a.lastIndexOf(this.multiple);
5905 return -1 == b ? c.trim(a) : c.trim(a.substr(b + this.multiple.length))
5906 }
5907 return c.trim(a)
5908 }
5909 };
5910 XenForo.AutoComplete.getDefaultUrl = function() {
5911 null === XenForo.AutoComplete.defaultUrl && (c("html").hasClass("Admin") ? XenForo.AutoComplete.defaultUrl =
5912 "admin.php?users/search-name&_xfResponseType=json" : XenForo.AutoComplete.defaultUrl = "index.php?members/find&_xfResponseType=json");
5913 return XenForo.AutoComplete.defaultUrl
5914 };
5915 XenForo.AutoComplete.defaultUrl = null;
5916 XenForo.UserTagger = function(a) {
5917 this.__construct(a)
5918 };
5919 XenForo.UserTagger.prototype = {
5920 __construct: function(a) {
5921 this.$textarea = a;
5922 this.url = a.data("acurl") || XenForo.AutoComplete.getDefaultUrl();
5923 this.acResults = new XenForo.AutoCompleteResults({
5924 onInsert: c.context(this, "insertAutoComplete")
5925 });
5926 var b = this,
5927 d,
5928 e = function() {
5929 d || (d = setTimeout(function() {
5930 b.acResults.hideResults();
5931 d = null
5932 }, 200))
5933 };
5934 c(k).on("scroll", e);
5935 a.on("click blur", e);
5936 a.on("keydown", function(a) {
5937 var c = !0,
5938 d = b.acResults;
5939 if (d.isVisible()) {
5940 switch (a.keyCode) {
5941 case 40:
5942 d.selectResult(1);
5943 break;
5944 case 38:
5945 d.selectResult(-1);
5946 break;
5947 case 27:
5948 d.hideResults();
5949 break;
5950 case 13:
5951 d.insertSelectedResult();
5952 break;
5953 default:
5954 c = !1
5955 }
5956 c && (a.stopPropagation(), a.stopImmediatePropagation(), a.preventDefault())
5957 }
5958 });
5959 a.on("keyup", function(a) {
5960 (a = b.findCurrentAutoCompleteOption()) ? b.triggerAutoComplete(a):
5961 b.hideAutoComplete()
5962 })
5963 },
5964 findCurrentAutoCompleteOption: function() {
5965 var a = this.$textarea;
5966 a.focus();
5967 var b = a.getSelection();
5968 if (!b || 1 >= b.end) return !1;
5969 a = a.val().substring(0, b.end);
5970 b = a.lastIndexOf("@");
5971 return -1 != b && (0 == b || a.substr(b - 1, 1).match(/(\s|[\](,]|--)/)) && (a = a.substr(b + 1), !a.match(/\s/) || 10 >= a.length) ? a : !1
5972 },
5973 insertAutoComplete: function(a) {
5974 var b = this.$textarea;
5975 b.focus();
5976 var c = b.getSelection();
5977 if (!c || 1 >= c.end) return !1;
5978 var e = b.val().substring(0, c.end).lastIndexOf("@"); - 1 != e && (b.setSelection(e, c.end),
5979 b.replaceSelectedText("@" + a + " ", "collapseToEnd"), this.lastAcLookup = a + " ")
5980 },
5981 triggerAutoComplete: function(a) {
5982 this.lastAcLookup && this.lastAcLookup == a || (this.hideAutoComplete(), this.lastAcLookup = a, 2 < a.length && "[" != a.substr(0, 1) && (this.acLoadTimer = setTimeout(c.context(this, "autoCompleteLookup"), 200)))
5983 },
5984 autoCompleteLookup: function() {
5985 this.acXhr && this.acXhr.abort();
5986 this.lastAcLookup == this.findCurrentAutoCompleteOption() && (this.acXhr = XenForo.ajax(this.url, {
5987 q: this.lastAcLookup
5988 }, c.context(this, "showAutoCompleteResults"), {
5989 global: !1,
5990 error: !1
5991 }))
5992 },
5993 showAutoCompleteResults: function(a) {
5994 this.acXhr = !1;
5995 this.acResults.showResults(this.lastAcLookup, a.results, this.$textarea)
5996 },
5997 hideAutoComplete: function() {
5998 this.acResults.hideResults();
5999 this.acLoadTimer && (clearTimeout(this.acLoadTimer), this.acLoadTimer = !1)
6000 }
6001 };
6002 XenForo.AutoCompleteResults = function(a) {
6003 this.__construct(a)
6004 };
6005 XenForo.AutoCompleteResults.prototype = {
6006 __construct: function(a) {
6007 this.options = c.extend({
6008 onInsert: !1
6009 }, a);
6010 this.selectedResult = 0;
6011 this.resizeBound = this.resultsVisible = this.$results = !1
6012 },
6013 isVisible: function() {
6014 return this.resultsVisible
6015 },
6016 hideResults: function() {
6017 this.resultsVisible = !1;
6018 this.$results && this.$results.hide()
6019 },
6020 showResults: function(a, b, d, e) {
6021 var f = 0,
6022 h;
6023 if (b) {
6024 this.resultsVisible = !1;
6025 this.$results ? this.$results.hide().empty() : (this.$results = c("<ul />").css({
6026 position: "absolute",
6027 display: "none"
6028 }).addClass("autoCompleteList").appendTo(k.body), d.parents().each(function(a, b) {
6029 a = c(b);
6030 a = parseInt(a.css("z-index"), 10);
6031 a > f && (f = a)
6032 }), this.$results.css("z-index", f + 1E3));
6033 a = new RegExp("(" + XenForo.regexQuote(a) +
6034 ")", "i");
6035 for (h in b)
6036 if (b.hasOwnProperty(h)) {
6037 var l = b[h];
6038 var x = c("<li />").css("cursor", "pointer").attr("unselectable", "on").data("autocomplete", h).click(c.context(this, "resultClick")).mouseenter(c.context(this, "resultMouseEnter"));
6039 "string" == typeof l ? x.html(XenForo.htmlspecialchars(l).replace(a, "<strong>$1</strong>")) : x.html(l.username.replace(a, "<strong>$1</strong>")).prepend(c('<img class="autoCompleteAvatar" />').attr("src", l.avatar));
6040 x.appendTo(this.$results)
6041 }
6042 this.$results.children().length && (this.selectResult(0, !0), this.resizeBound || c(g).bind("resize", c.context(this, "hideResults")), e || (b = d.offset(), e = {
6043 top: b.top + d.outerHeight(),
6044 left: b.left
6045 }, XenForo.isRTL() && (e.right = c("html").width() - b.left - d.outerWidth(), e.left = "auto")), this.$results.css(e).show(), this.resultsVisible = !0)
6046 } else this.hideResults()
6047 },
6048 resultClick: function(a) {
6049 a.stopPropagation();
6050 this.insertResult(c(a.currentTarget).data("autocomplete"));
6051 this.hideResults()
6052 },
6053 resultMouseEnter: function(a) {
6054 this.selectResult(c(a.currentTarget).index(), !0)
6055 },
6056 selectResult: function(a,
6057 b) {
6058 if (this.$results) {
6059 var d = this.selectedResult = b ? a : this.selectedResult + a;
6060 a = this.$results.children();
6061 a.each(function(a) {
6062 a == d ? c(this).addClass("selected") : c(this).removeClass("selected")
6063 });
6064 if (0 > d || d >= a.length) this.selectedResult = -1
6065 }
6066 },
6067 insertSelectedResult: function() {
6068 var a, b = !1;
6069 if (!this.resultsVisible) return !1;
6070 0 <= this.selectedResult && (a = this.$results.children().get(this.selectedResult)) && (this.insertResult(c(a).data("autocomplete")), b = !0);
6071 this.hideResults();
6072 return b
6073 },
6074 insertResult: function(a) {
6075 if (this.options.onInsert) this.options.onInsert(a)
6076 }
6077 };
6078 XenForo.AutoSelect = function(a) {
6079 a.bind("focus", function(b) {
6080 setTimeout(function() {
6081 a.select()
6082 }, 50)
6083 })
6084 };
6085 XenForo.StatusEditor = function(a) {
6086 this.__construct(a)
6087 };
6088 XenForo.StatusEditor.prototype = {
6089 __construct: function(a) {
6090 this.$input = a.keyup(c.context(this, "update")).keydown(c.context(this, "preventNewline"));
6091 this.$counter = c(this.$input.data("statuseditorcounter"));
6092 this.$counter.length || (this.$counter = c("<span />").insertAfter(this.$input));
6093 this.$counter.addClass("statusEditorCounter").text("0");
6094 this.$form = this.$input.closest("form").bind({
6095 AutoValidationComplete: c.context(this,
6096 "saveStatus")
6097 });
6098 this.charLimit = 140;
6099 this.charCount = 0;
6100 this.update()
6101 },
6102 update: function(a) {
6103 a = this.$input.val();
6104 this.$input.attr("placeholder") && this.$input.attr("placeholder") == a ? this.setCounterValue(this.charLimit, a.length) : this.setCounterValue(this.charLimit - a.length, a.length)
6105 },
6106 setCounterValue: function(a, b) {
6107 0 > a ? (this.$counter.addClass("error"), this.$counter.removeClass("warning")) : a <= this.charLimit - 130 ? (this.$counter.removeClass("error"), this.$counter.addClass("warning")) : (this.$counter.removeClass("error"),
6108 this.$counter.removeClass("warning"));
6109 this.$counter.text(a);
6110 this.charCount = b || this.$input.val().length
6111 },
6112 preventNewline: function(a) {
6113 if (13 == a.which) return a.preventDefault(), c(this.$input.get(0).form).submit(), !1
6114 },
6115 saveStatus: function(a) {
6116 this.$input.val("");
6117 this.update(a);
6118 a.ajaxData && void 0 !== a.ajaxData.status && c(".CurrentStatus").text(a.ajaxData.status)
6119 }
6120 };
6121 c.tools.tooltip.addEffect("PreviewTooltip", function(a) {
6122 a = this.getTrigger().offset();
6123 var b = this.getConf(),
6124 d = {
6125 top: "auto",
6126 bottom: c(g).height() - a.top +
6127 b.offset[0]
6128 },
6129 e = 480 > c(g).width();
6130 XenForo.isRTL() ? (d.right = c("html").width() - this.getTrigger().outerWidth() - a.left - b.offset[1], d.left = "auto") : (d.left = a.left + b.offset[1], e && (d.left = Math.min(50, d.left)));
6131 this.getTip().css(d).xfFadeIn(XenForo.speed.normal)
6132 }, function(a) {
6133 this.getTip().xfFadeOut(XenForo.speed.fast)
6134 });
6135 XenForo._PreviewTooltipCache = {};
6136 XenForo.PreviewTooltip = function(a) {
6137 var b, d, e;
6138 parseInt(XenForo._enableOverlays) && ((d = a.data("previewurl")) ? (a.find("[title]").andSelf().attr("title", ""), a.bind({
6139 mouseenter: function(f) {
6140 b ||
6141 (e = setTimeout(function() {
6142 if (!b) {
6143 b = !0;
6144 var e = c("#PreviewTooltip");
6145 if (e.length) {
6146 console.log("Setup preview tooltip for %s", d);
6147 var f = e.clone().removeAttr("id").addClass("xenPreviewTooltip").appendTo(k.body);
6148 XenForo._PreviewTooltipCache[d] || XenForo.ajax(d, {}, function(a) {
6149 XenForo.hasTemplateHtml(a) ? (XenForo._PreviewTooltipCache[d] = a.templateHtml, c(a.templateHtml).xfInsert("replaceAll", f.find(".PreviewContents"))) : f.remove()
6150 }, {
6151 type: "GET",
6152 error: !1,
6153 global: !1
6154 });
6155 a.tooltip(XenForo.configureTooltipRtl({
6156 predelay: 500,
6157 delay: 0,
6158 effect: "PreviewTooltip",
6159 fadeInSpeed: "normal",
6160 fadeOutSpeed: "fast",
6161 tip: f,
6162 position: "bottom left",
6163 offset: [10, -15]
6164 }));
6165 a.data("tooltip").show(0);
6166 XenForo._PreviewTooltipCache[d] && c(XenForo._PreviewTooltipCache[d]).xfInsert("replaceAll", f.find(".PreviewContents"), "show", 0)
6167 } else console.error("Unable to find #PreviewTooltip")
6168 }
6169 }, 800))
6170 },
6171 mouseleave: function(c) {
6172 b ? a.data("tooltip") && a.data("tooltip").hide() : e && clearTimeout(e)
6173 },
6174 mousedown: function(b) {
6175 e && clearTimeout(e);
6176 a.data("tooltip") && a.data("tooltip").hide()
6177 }
6178 })) :
6179 console.warn("Preview tooltip has no preview: %o", a))
6180 };
6181 XenForo.PopupItemLink = function(a) {
6182 var b = a.find(".PopupItemLink").first().attr("href");
6183 b && a.addClass("PopupItemLinkActive").click(function(a) {
6184 c(a.target).closest("a").length || XenForo.redirect(b)
6185 })
6186 };
6187 XenForo.Loader = function(a) {
6188 var b = function(d) {
6189 var e = a.attr("href") || a.data("href"),
6190 f = a.data("target");
6191 e && c(f).length && (a.closest("a").length && d.stopPropagation(), d.preventDefault(), a.data("tooltip") && a.data("tooltip").hide(), XenForo.ajax(e, {}, function(d,
6192 e) {
6193 if (XenForo.hasResponseError(d)) return !1;
6194 var g = new c.Event("ContentLoaded");
6195 g.ajaxData = d;
6196 g.textStatus = e;
6197 a.trigger(g);
6198 g.isDefaultPrevented() || d.templateHtml && new XenForo.ExtLoader(d, function() {
6199 var e = a.data("method");
6200 "function" != typeof c.fn[e] && (e = "appendTo");
6201 "replaceAll" == e ? c(d.templateHtml).xfInsert(e, f, "show", 0) : c(d.templateHtml).xfInsert(e, f);
6202 !1 !== a.data("unlink") && a.removeAttr("href").removeData("href").unbind("click", b)
6203 })
6204 }))
6205 };
6206 a.bind("click", b)
6207 };
6208 XenForo.FieldAdder = function(a) {
6209 c(a.data("source")).filter(".PollNonJsInput").remove();
6210 var b = a.data("maxfields"),
6211 d = function(d) {
6212 b && c(a.data("source")).length >= b && (d ? a.remove() : a.xfRemove())
6213 };
6214 a.click(function(e) {
6215 e = c(a.data("source"));
6216 var f = null;
6217 console.log("source.length %s, maxfields %s", e.length, b);
6218 e.length && (!b || e.length < b) ? (f = e.last().clone(), f.find('input:not([type="button"], [type="submit"])').val("").prop("disabled", !0), f.find(".spinBoxButton").remove(), a.trigger({
6219 type: "FieldAdderClone",
6220 clone: f
6221 }), f.xfInsert("insertAfter", e.last(), !1, !1, function() {
6222 var a = f.find("input");
6223 a.prop("disabled", !1);
6224 a.first().focus().select();
6225 d()
6226 })) : d()
6227 });
6228 d(!0)
6229 };
6230 XenForo.ReadToggle = function(a) {
6231 a.click(function(b) {
6232 b.preventDefault();
6233 var d = null,
6234 e = null,
6235 f = a.data("counter");
6236 null == d && (e = a.closest(".discussionListItem").andSelf().toggleClass("unread"), d = XenForo.ajax(a.attr("href"), {
6237 _xfConfirm: 1
6238 }, function(b, g) {
6239 d = null;
6240 if (XenForo.hasResponseError(b)) return !1;
6241 if ("undefined" != typeof b.unread) e[b.unread ? "addClass" : "removeClass"]("unread");
6242 if (f && "undefined" != typeof b.counterFormatted) {
6243 g = c(f);
6244 var h = g.find("span.Total");
6245 h.length ? h.text(b.counterFormatted) : g.text(b.counterFormatted)
6246 }
6247 "undefined" != typeof b.actionPhrase && ("" != a.text() && a.html(b.actionPhrase), a.attr("title") && a.attr("title", b.actionPhrase));
6248 XenForo.alert(b._redirectMessage, "", 1E3)
6249 }))
6250 })
6251 };
6252 XenForo.Notices = function(a) {
6253 var b = XenForo.visitor.user_id ? !1 : !0,
6254 d = a.hasClass("PanelScroller"),
6255 e = function() {
6256 var a = c.getCookie("notice_dismiss");
6257 a = a ? a.split(",") : [];
6258 for (var b = [], d, e = 0; e < a.length; e++)(d = parseInt(a[e], 10)) && b.push(d);
6259 return b
6260 },
6261 f = e();
6262 b && a.find(".Notice").each(function() {
6263 var a =
6264 c(this),
6265 b = parseInt(a.data("notice"), 10);
6266 b && -1 != c.inArray(b, f) && (a.remove(), c("#n" + b).remove())
6267 });
6268 var h = function(a, b) {
6269 b && (a.find(".Notice").each(function() {
6270 var a = c(this),
6271 b = c(this).css("display"),
6272 d = parseInt(a.data("notice"), 10);
6273 "none" == b && (a.remove(), c("#n" + d).remove())
6274 }), b = a.find(".Nav a"), b.filter(".current").length || b.first().addClass("current"));
6275 a.find(".Notice").length || a.remove()
6276 };
6277 h(a, d);
6278 a.show();
6279 var l;
6280 d && (l = XenForo.PanelScroller(a.find(".PanelContainer"), {
6281 scrollable: {
6282 speed: a.dataOrDefault("speed",
6283 400) * XenForo._animationSpeedMultiplier,
6284 vertical: XenForo.isPositive(a.data("vertical")),
6285 keyboard: !1,
6286 touch: !1,
6287 prev: ".NoticePrev",
6288 next: ".NoticeNext"
6289 },
6290 autoscroll: {
6291 interval: a.dataOrDefault("interval", 2E3)
6292 }
6293 })) && 1 < l.getItems().length && c(k).bind({
6294 XenForoWindowBlur: function(a) {
6295 l.stop()
6296 },
6297 XenForoWindowFocus: function(a) {
6298 l.play()
6299 }
6300 });
6301 a.hasClass("FloatingContainer") && a.find(".Notice").each(function() {
6302 var a = c(this),
6303 b = a.data("display-duration"),
6304 d = a.data("delay-duration"),
6305 e = XenForo.isPositive(a.data("auto-dismiss"));
6306 d ? setTimeout(function() {
6307 a.xfFadeDown(XenForo.speed.normal, function() {
6308 b && setTimeout(function() {
6309 a.xfFadeUp(XenForo.speed.normal);
6310 e && a.find("a.DismissCtrl").trigger("click")
6311 }, b)
6312 })
6313 }, d) : (a.css("display", "block"), b && setTimeout(function() {
6314 a.xfFadeUp(XenForo.speed.normal);
6315 e && a.find("a.DismissCtrl").trigger("click")
6316 }, b))
6317 });
6318 a.delegate("a.DismissCtrl", "click", function(d) {
6319 d.preventDefault();
6320 var f = c(this),
6321 g = f.closest(".Notice"),
6322 h = g.closest(".Notices");
6323 f.data("tooltip") && f.data("tooltip").hide();
6324 l ? (l.removeItem(g),
6325 l.getItems().length || a.xfFadeUp()) : g.xfFadeUp(XenForo.speed.fast, function() {
6326 g.remove();
6327 h.find(".Notice").length || a.xfFadeUp()
6328 });
6329 if (b) {
6330 d = parseInt(g.data("notice"), 10);
6331 var k = e();
6332 d && -1 == c.inArray(d, k) && (k.push(d), k.sort(function(a, b) {
6333 return a - b
6334 }), c.setCookie("notice_dismiss", k.join(",")))
6335 } else f.data("xhr") || f.data("xhr", XenForo.ajax(f.attr("href"), {
6336 _xfConfirm: 1
6337 }, function(a, b) {
6338 f.removeData("xhr");
6339 if (XenForo.hasResponseError(a)) return !1
6340 }))
6341 });
6342 c(g).on("resize", function(b) {
6343 h(a, d)
6344 })
6345 };
6346 XenForo.PanelScroller =
6347 function(a, b) {
6348 function d() {
6349 var b = 0;
6350 a.find(".Panels > *").css({
6351 width: a.innerWidth(),
6352 height: "auto"
6353 }).each(function() {
6354 b = Math.max(c(this).outerHeight(), b)
6355 }).andSelf().css("height", b);
6356 var d = a.data("scrollable");
6357 d && d.seekTo(d.getIndex(), 0)
6358 }
6359 var e = a.find(".Panels > *");
6360 if (2 > e.length) return a.find(".Panels").css("position", "static"), !1;
6361 e.find("script").remove();
6362 b = c.extend(!0, {
6363 scrollable: {
6364 circular: !0,
6365 items: ".Panels"
6366 },
6367 navigator: {
6368 navi: ".Nav",
6369 naviItem: "a",
6370 activeClass: "current"
6371 },
6372 autoscroll: {
6373 interval: 3E3
6374 }
6375 }, b);
6376 a.css("overflow",
6377 "hidden");
6378 b.scrollable.vertical || a.css("height", "auto").find(".Panels").css("width", "20000em").find(".panel").css("float", XenForo.isRTL() ? "right" : "left");
6379 c(g).bind("load resize", d);
6380 c(".mainContent").bind("XenForoResize", d);
6381 d();
6382 a.scrollable(b.scrollable).navigator(b.navigator);
6383 1 < e.length && a.autoscroll(b.autoscroll);
6384 return a.data("scrollable")
6385 };
6386 XenForo.DisplayIgnoredContent = function(a) {
6387 var b;
6388 a.preventDefault();
6389 c("a.DisplayIgnoredContent").hide();
6390 c("#ignoredUserCss").empty().remove();
6391 if (k.styleSheets)
6392 for (a =
6393 0; a < k.styleSheets.length; a++) {
6394 var d = k.styleSheets[a];
6395 try {
6396 var e = d.cssRules ? d.cssRules : d.rules
6397 } catch (h) {
6398 e = !1
6399 }
6400 if (e)
6401 for (b = 0; b < e.length; b++) {
6402 var f = e[b];
6403 f.selectorText && ".ignored" == f.selectorText.toLowerCase() && (d.deleteRule ? d.deleteRule(b) : d.removeRule(b))
6404 }
6405 }
6406 c(".ignored").removeClass("ignored")
6407 };
6408 c("html").hasClass("Public") && c(function() {
6409 c("body").delegate("a.DisplayIgnoredContent", "click", XenForo.DisplayIgnoredContent);
6410 if (g.location.hash) {
6411 var a = c(g.location.hash.replace(/[^\w_#-]/g, ""));
6412 a.hasClass("ignored") &&
6413 (a.removeClass("ignored"), a.get(0).scrollIntoView(!0))
6414 }
6415 });
6416 XenForo.SpoilerBBCode = function(a) {
6417 a.click(function(b) {
6418 a.siblings(":first").css("fontSize", "25pt");
6419 return !1
6420 })
6421 };
6422 XenForo.SquareThumbs = function(a) {
6423 var b = a.data("thumb-height") || 44,
6424 d = a.data("thumb-selector") || "a.SquareThumb";
6425 console.info("XenForo.SquareThumbs: %o", a);
6426 a = a.find(d).addClass("SquareThumb").children("img");
6427 d = function() {
6428 var a = c(this),
6429 d = a.width(),
6430 g = a.height();
6431 d && g && (g > d ? (a.css("width", b), a.css("top", (a.height() - b) / 2 * -1)) : (a.css("height",
6432 b), a.css("left", (a.width() - b) / 2 * -1)))
6433 };
6434 a.load(d);
6435 a.each(d)
6436 };
6437 XenForo.register("a.OverlayTrigger, input.OverlayTrigger, button.OverlayTrigger, label.OverlayTrigger, a.username, a.avatar", "XenForo.OverlayTrigger");
6438 XenForo.register(".ToggleTrigger", "XenForo.ToggleTrigger");
6439 XenForo.isTouchBrowser() || (XenForo.register(".Tooltip", "XenForo.Tooltip"), XenForo.register("a.StatusTooltip", "XenForo.StatusTooltip"), XenForo.register(".PreviewTooltip", "XenForo.PreviewTooltip"));
6440 XenForo.register("a.LbTrigger", "XenForo.LightBoxTrigger");
6441 XenForo.register(".ClickProxy", "XenForo.ClickProxy");
6442 XenForo.register(".Popup", "XenForo.PopupMenu", "XenForoActivatePopups");
6443 XenForo.register(".PageNav", "XenForo.PageNav");
6444 XenForo.register(".Tabs", "XenForo.Tabs");
6445 XenForo.register(".SquareThumbs", "XenForo.SquareThumbs");
6446 XenForo.register("form.xenForm, .MultiSubmitFix", "XenForo.MultiSubmitFix");
6447 XenForo.register("input.CheckAll, a.CheckAll, label.CheckAll", "XenForo.CheckAll");
6448 XenForo.register("input.AutoChecker", "XenForo.AutoChecker");
6449 XenForo.register("label.ToggleButton",
6450 "XenForo.ToggleButton");
6451 XenForo.register("form.AutoInlineUploader", "XenForo.AutoInlineUploader");
6452 XenForo.register("form.AutoValidator", "XenForo.AutoValidator");
6453 XenForo.register("select.AutoTimeZone", "XenForo.AutoTimeZone");
6454 XenForo.register("a.Loader, input.Loader", "XenForo.Loader");
6455 var z = "step" in k.createElement("input");
6456 XenForo.register("input, textarea", function(a) {
6457 a = c(this);
6458 switch (a.attr("type")) {
6459 case "hidden":
6460 case "submit":
6461 return;
6462 case "checkbox":
6463 case "radio":
6464 a.hasClass("SubmitOnChange") && XenForo.create("XenForo.SubmitOnChange",
6465 this);
6466 return
6467 }
6468 "number" == a.attr("type") && z && (this.type = "text", a.addClass("SpinBox number"));
6469 a.hasClass("SpinBox") && XenForo.create("XenForo.SpinBox", this);
6470 a.hasClass("Prompt") && (console.error("input.Prompt[title] is now deprecated. Please replace any instances with input[placeholder] and remove the Prompt class."), a.attr({
6471 placeholder: a.attr("title"),
6472 title: ""
6473 }));
6474 a.attr("placeholder") && XenForo.create("XenForo.Prompt", this);
6475 a.data("livetitletemplate") && XenForo.create("XenForo.LiveTitle", this);
6476 a.is(":date") &&
6477 XenForo.create("XenForo.DatePicker", this);
6478 a.hasClass("AutoComplete") && XenForo.create("XenForo.AutoComplete", this);
6479 a.hasClass("UserTagger") && XenForo.create("XenForo.UserTagger", this);
6480 a.hasClass("AutoSelect") && XenForo.create("XenForo.AutoSelect", this);
6481 XenForo.isAutoValidatorField(this) && XenForo.create("XenForo.AutoValidatorControl", this);
6482 a.is("textarea.StatusEditor") && XenForo.create("XenForo.StatusEditor", this);
6483 a.is("textarea.Elastic") && XenForo.create("XenForo.TextareaElastic", this)
6484 });
6485 XenForo.register("form.Preview",
6486 "XenForo.PreviewForm");
6487 XenForo.register("a.FieldAdder, input.FieldAdder", "XenForo.FieldAdder");
6488 XenForo.register("a.ReadToggle", "XenForo.ReadToggle");
6489 c("html").hasClass("Public") && (XenForo.register("#loginBar", "XenForo.LoginBar"), XenForo.register("#QuickSearch", "XenForo.QuickSearch"), XenForo.register("a.AttributionLink", "XenForo.AttributionLink"), XenForo.register("#ReCaptcha", "XenForo.ReCaptcha"), XenForo.register(".NoCaptcha", "XenForo.NoCaptcha"), XenForo.register("#SolveMediaCaptcha", "XenForo.SolveMediaCaptcha"),
6490 XenForo.register("#KeyCaptcha", "XenForo.KeyCaptcha"), XenForo.register("#Captcha", "XenForo.Captcha"), XenForo.register("img.bbCodeImage", "XenForo.BbCodeImage"), XenForo.register("a.LikeLink", "XenForo.LikeLink"), XenForo.isTouchBrowser() || XenForo.register("h3.nodeTitle a", "XenForo.NodeDescriptionTooltip"), XenForo.register("#AccountMenu", "XenForo.AccountMenu"), XenForo.register("a.FollowLink", "XenForo.FollowLink"), XenForo.register("li.PopupItemLink", "XenForo.PopupItemLink"), XenForo.register(".Notices", "XenForo.Notices"),
6491 XenForo.register("button.Spoiler", "XenForo.SpoilerBBCode"));
6492 XenForo.register("input:checkbox.Disabler, input:radio.Disabler", "XenForo.Disabler");
6493 var y = !1;
6494 c(g).on("load", function() {
6495 if (!y && g.location.hash) {
6496 var a = g.location.hash.replace(/[^a-zA-Z0-9_-]/g, "");
6497 a = a ? c("#" + a) : c();
6498 a.length && a.get(0).scrollIntoView(!0)
6499 }
6500 });
6501 c(function() {
6502 XenForo.init();
6503 if (g.location.hash) c(g).one("scroll", function(a) {
6504 y = !0
6505 })
6506 })
6507}(jQuery, this, document);