PageSourceSearch

https://www.vaal.ee/javascripts/app.base.en.min.js

js vaal.ee collected 2026-09-24 20:45:54 UTC 394,557 bytes, 8,773 lines download raw bytes

vendor: 30,142 bytes, lines 1-602
1/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
2!function(a, b) {
3    "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) {
4        if (!a.document)
5            throw new Error("jQuery requires a window with a document");
6        return b(a)
7    } : b(a)
8}("undefined" != typeof window ? window : this, function(a, b) {
9    var c = [], d = c.slice, e = c.concat, f = c.push, g = c.indexOf, h = {}, i = h.toString, j = h.hasOwnProperty, k = {}, l = "1.11.3", m = function(a, b) {
10        return new m.fn.init(a, b)
11    }, n = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, o = /^-ms-/, p = /-([\da-z])/gi, q = function(a, b) {
12        return b.toUpperCase()
13    };
14    m.fn = m.prototype = {
15        jquery: l,
16        constructor: m,
17        selector: "",
18        length: 0,
19        toArray: function() {
20            return d.call(this)
21        },
22        get: function(a) {
23            return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this)
24        },
25        pushStack: function(a) {
26            var b = m.merge(this.constructor(), a);
27            return b.prevObject = this, b.context = this.context, b
28        },
29        each: function(a, b) {
30            return m.each(this, a, b)
31        },
32        map: function(a) {
33            return this.pushStack(m.map(this, function(b, c) {
34                return a.call(b, c, b)
35            }))
36        },
37        slice: function() {
38            return this.pushStack(d.apply(this, arguments))
39        },
40        first: function() {
41            return this.eq(0)
42        },
43        last: function() {
44            return this.eq( - 1)
45        },
46        eq: function(a) {
47            var b = this.length, c =+ a + (0 > a ? b : 0);
48            return this.pushStack(c >= 0 && b > c ? [this[c]] : [])
49        },
50        end: function() {
51            return this.prevObject || this.constructor(null)
52        },
53        push: f,
54        sort: c.sort,
55        splice: c.splice
56    }, m.extend = m.fn.extend = function() {
57        var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j=!1;
58        for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || m.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)
59            if (null != (e = arguments[h]))
60                for (d in e)
61                    a = g[d], c = e[d], g !== c && (j && c && (m.isPlainObject(c) || (b = m.isArray(c))) ? (b ? (b=!1, f = a && m.isArray(a) ? a : []) : f = a && m.isPlainObject(a) ? a : {}, g[d] = m.extend(j, f, c)) : void 0 !== c && (g[d] = c));
62        return g
63    }, m.extend({
64        expando: "jQuery" + (l + Math.random()).replace(/\D/g, ""),
65        isReady: !0,
66        error: function(a) {
67            throw new Error(a)
68        },
69        noop: function() {},
70        isFunction: function(a) {
71            return "function" === m.type(a)
72        },
73        isArray: Array.isArray || function(a) {
74            return "array" === m.type(a)
75        },
76        isWindow: function(a) {
77            return null != a && a == a.window
78        },
79        isNumeric: function(a) {
80            return !m.isArray(a) && a - parseFloat(a) + 1 >= 0
81        },
82        isEmptyObject: function(a) {
83            var b;
84            for (b in a)
85                return !1;
86            return !0
87        },
88        isPlainObject: function(a) {
89            var b;
90            if (!a || "object" !== m.type(a) || a.nodeType || m.isWindow(a))
91                return !1;
92            try {
93                if (a.constructor&&!j.call(a, "constructor")&&!j.call(a.constructor.prototype, "isPrototypeOf"))
94                    return !1
95            } catch (c) {
96                return !1
97            }
98            if (k.ownLast)
99                for (b in a)
100                    return j.call(a, b);
101            for (b in a);
102            return void 0 === b || j.call(a, b)
103        },
104        type: function(a) {
105            return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? h[i.call(a)] || "object" : typeof a
106        },
107        globalEval: function(b) {
108            b && m.trim(b) && (a.execScript || function(b) {
109                a.eval.call(a, b)
110            })(b)
111        },
112        camelCase: function(a) {
113            return a.replace(o, "ms-").replace(p, q)
114        },
115        nodeName: function(a, b) {
116            return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase()
117        },
118        each: function(a, b, c) {
119            var d, e = 0, f = a.length, g = r(a);
120            if (c) {
121                if (g) {
122                    for (; f > e; e++)
123                        if (d = b.apply(a[e], c), d===!1)
124                            break
125                } else 
126                    for (e in a)
127                        if (d = b.apply(a[e], c), d===!1)
128                            break
129            } else if (g) {
130                for (; f > e; e++)
131                    if (d = b.call(a[e], e, a[e]), d===!1)
132                        break
133            } else 
134                for (e in a)
135                    if (d = b.call(a[e], e, a[e]), d===!1)
136                        break;
137            return a
138        },
139        trim: function(a) {
140            return null == a ? "" : (a + "").replace(n, "")
141        },
142        makeArray: function(a, b) {
143            var c = b || [];
144            return null != a && (r(Object(a)) ? m.merge(c, "string" == typeof a ? [a] : a) : f.call(c, a)), c
145        },
146        inArray: function(a, b, c) {
147            var d;
148            if (b) {
149                if (g)
150                    return g.call(b, a, c);
151                for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++)
152                    if (c in b && b[c] === a)
153                        return c
154            }
155            return - 1
156        },
157        merge: function(a, b) {
158            var c =+ b.length, d = 0, e = a.length;
159            while (c > d)
160                a[e++] = b[d++];
161            if (c !== c)
162                while (void 0 !== b[d])
163                    a[e++] = b[d++];
164            return a.length = e, a
165        },
166        grep: function(a, b, c) {
167            for (var d, e = [], f = 0, g = a.length, h=!c; g > f; f++)
168                d=!b(a[f], f), d !== h && e.push(a[f]);
169            return e
170        },
171        map: function(a, b, c) {
172            var d, f = 0, g = a.length, h = r(a), i = [];
173            if (h)
174                for (; g > f; f++)
175                    d = b(a[f], f, c), null != d && i.push(d);
176            else 
177                for (f in a)
178                    d = b(a[f], f, c), null != d && i.push(d);
179            return e.apply([], i)
180        },
181        guid: 1,
182        proxy: function(a, b) {
183            var c, e, f;
184            return "string" == typeof b && (f = a[b], b = a, a = f), m.isFunction(a) ? (c = d.call(arguments, 2), e = function() {
185                return a.apply(b || this, c.concat(d.call(arguments)))
186            }, e.guid = a.guid = a.guid || m.guid++, e) : void 0
187        },
188        now: function() {
189            return + new Date
190        },
191        support: k
192    }), m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(a, b) {
193        h["[object " + b + "]"] = b.toLowerCase()
194    });
195    function r(a) {
196        var b = "length"in a && a.length, c = m.type(a);
197        return "function" === c || m.isWindow(a)?!1 : 1 === a.nodeType && b?!0 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a
198    }
199    var s = function(a) {
200        var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date, v = a.document, w = 0, x = 0, y = ha(), z = ha(), A = ha(), B = function(a, b) {
201            return a === b && (l=!0), 0
202        }, C = 1<<31, D = {}.hasOwnProperty, E = [], F = E.pop, G = E.push, H = E.push, I = E.slice, J = function(a, b) {
203            for (var c = 0, d = a.length; d > c; c++)
204                if (a[c] === b)
205                    return c;
206            return - 1
207        }, K = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", L = "[\\x20\\t\\r\\n\\f]", M = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", N = M.replace("w", "w#"), O = "\\[" + L + "*(" + M + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + N + "))|)" + L + "*\\]", P = ":(" + M + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + O + ")*)|.*)\\)|)", Q = new RegExp(L + "+", "g"), R = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$", "g"), S = new RegExp("^" + L + "*," + L + "*"), T = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"), U = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]", "g"), V = new RegExp(P), W = new RegExp("^" + N + "$"), X = {
208            ID: new RegExp("^#(" + M + ")"),
209            CLASS: new RegExp("^\\.(" + M + ")"),
210            TAG: new RegExp("^(" + M.replace("w", "w*") + ")"),
211            ATTR: new RegExp("^" + O),
212            PSEUDO: new RegExp("^" + P),
213            CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)", "i"),
214            bool: new RegExp("^(?:" + K + ")$", "i"),
215            needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)", "i")
216        }, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, $ = /^[^{]+\{\s*\[native \w/, _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, aa = /[+~]/, ba = /'|\\/g, ca = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)", "ig"), da = function(a, b, c) {
217            var d = "0x" + b - 65536;
218            return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d>>10 | 55296, 1023 & d | 56320)
219        }, ea = function() {
220            m()
221        };
222        try {
223            H.apply(E = I.call(v.childNodes), v.childNodes), E[v.childNodes.length].nodeType
224        } catch (fa) {
225            H = {
226                apply: E.length ? function(a, b) {
227                    G.apply(a, I.call(b))
228                }
229                : function(a, b) {
230                    var c = a.length, d = 0;
231                    while (a[c++] = b[d++]);
232                    a.length = c - 1
233                }
234            }
235        }
236        function ga(a, b, d, e) {
237            var f, h, j, k, l, o, r, s, w, x;
238            if ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, d = d || [], k = b.nodeType, "string" != typeof a ||!a || 1 !== k && 9 !== k && 11 !== k)
239                return d;
240            if (!e && p) {
241                if (11 !== k && (f = _.exec(a)))
242                    if (j = f[1]) {
243                        if (9 === k) {
244                            if (h = b.getElementById(j), !h ||!h.parentNode)
245                                return d;
246                                if (h.id === j)
247                                    return d.push(h), d
248                        } else if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j)
249                            return d.push(h), d
250                    } else {
251                        if (f[2])
252                            return H.apply(d, b.getElementsByTagName(a)), d;
253                            if ((j = f[3]) && c.getElementsByClassName)
254                                return H.apply(d, b.getElementsByClassName(j)), d
255                    }
256                if (c.qsa && (!q ||!q.test(a))) {
257                    if (s = r = u, w = b, x = 1 !== k && a, 1 === k && "object" !== b.nodeName.toLowerCase()) {
258                        o = g(a), (r = b.getAttribute("id")) ? s = r.replace(ba, "\\$&") : b.setAttribute("id", s), s = "[id='" + s + "'] ", l = o.length;
259                        while (l--)
260                            o[l] = s + ra(o[l]);
261                        w = aa.test(a) && pa(b.parentNode) || b, x = o.join(",")
262                    }
263                    if (x)
264                        try {
265                            return H.apply(d, w.querySelectorAll(x)), d
266                    } catch (y) {} finally {
267                        r || b.removeAttribute("id")
268                    }
269                }
270            }
271            return i(a.replace(R, "$1"), b, d, e)
272        }
273        function ha() {
274            var a = [];
275            function b(c, e) {
276                return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e
277            }
278            return b
279        }
280        function ia(a) {
281            return a[u]=!0, a
282        }
283        function ja(a) {
284            var b = n.createElement("div");
285            try {
286                return !!a(b)
287            } catch (c) {
288                return !1
289            } finally {
290                b.parentNode && b.parentNode.removeChild(b), b = null
291            }
292        }
293        function ka(a, b) {
294            var c = a.split("|"), e = a.length;
295            while (e--)
296                d.attrHandle[c[e]] = b
297        }
298        function la(a, b) {
299            var c = b && a, d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || C) - (~a.sourceIndex || C);
300            if (d)
301                return d;
302            if (c)
303                while (c = c.nextSibling)
304                    if (c === b)
305                        return - 1;
306            return a ? 1 : - 1
307        }
308        function ma(a) {
309            return function(b) {
310                var c = b.nodeName.toLowerCase();
311                return "input" === c && b.type === a
312            }
313        }
314        function na(a) {
315            return function(b) {
316                var c = b.nodeName.toLowerCase();
317                return ("input" === c || "button" === c) && b.type === a
318            }
319        }
320        function oa(a) {
321            return ia(function(b) {
322                return b =+ b, ia(function(c, d) {
323                    var e, f = a([], c.length, b), g = f.length;
324                    while (g--)
325                        c[e = f[g]] && (c[e]=!(d[e] = c[e]))
326                })
327            })
328        }
329        function pa(a) {
330            return a && "undefined" != typeof a.getElementsByTagName && a
331        }
332        c = ga.support = {}, f = ga.isXML = function(a) {
333            var b = a && (a.ownerDocument || a).documentElement;
334            return b ? "HTML" !== b.nodeName : !1
335        }, m = ga.setDocument = function(a) {
336            var b, e, g = a ? a.ownerDocument || a: v;
337            return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = g.documentElement, e = g.defaultView, e && e !== e.top && (e.addEventListener ? e.addEventListener("unload", ea, !1) : e.attachEvent && e.attachEvent("onunload", ea)), p=!f(g), c.attributes = ja(function(a) {
338                return a.className = "i", !a.getAttribute("className")
339            }), c.getElementsByTagName = ja(function(a) {
340                return a.appendChild(g.createComment("")), !a.getElementsByTagName("*").length
341            }), c.getElementsByClassName = $.test(g.getElementsByClassName), c.getById = ja(function(a) {
342                return o.appendChild(a).id = u, !g.getElementsByName ||!g.getElementsByName(u).length
343            }), c.getById ? (d.find.ID = function(a, b) {
344                if ("undefined" != typeof b.getElementById && p) {
345                    var c = b.getElementById(a);
346                    return c && c.parentNode ? [c] : []
347                }
348            }, d.filter.ID = function(a) {
349                var b = a.replace(ca, da);
350                return function(a) {
351                    return a.getAttribute("id") === b
352                }
353            }) : (delete d.find.ID, d.filter.ID = function(a) {
354                var b = a.replace(ca, da);
355                return function(a) {
356                    var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");
357                    return c && c.value === b
358                }
359            }), d.find.TAG = c.getElementsByTagName ? function(a, b) {
360                return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0
361            } : function(a, b) {
362                var c, d = [], e = 0, f = b.getElementsByTagName(a);
363                if ("*" === a) {
364                    while (c = f[e++])
365                        1 === c.nodeType && d.push(c);
366                    return d
367                }
368                return f
369            }, d.find.CLASS = c.getElementsByClassName && function(a, b) {
370                return p ? b.getElementsByClassName(a) : void 0
371            }, r = [], q = [], (c.qsa = $.test(g.querySelectorAll)) && (ja(function(a) {
372                o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\f]' msallowcapture=''><option selected=''></option></select>", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + L + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + L + "*(?:value|" + K + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]")
373            }), ja(function(a) {
374                var b = g.createElement("input");
375                b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + L + "*[*^$|!~]?="), a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:")
376            })), (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ja(function(a) {
377                c.disconnectedMatch = s.call(a, "div"), s.call(a, "[s!='']:x"), r.push("!=", P)
378            }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = $.test(o.compareDocumentPosition), t = b || $.test(o.contains) ? function(a, b) {
379                var c = 9 === a.nodeType ? a.documentElement: a, d = b && b.parentNode;
380                return a === d ||!(!d || 1 !== d.nodeType ||!(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)))
381            } : function(a, b) {
382                if (b)
383                    while (b = b.parentNode)
384                        if (b === a)
385                            return !0;
386                return !1
387            }, B = b ? function(a, b) {
388                if (a === b)
389                    return l=!0, 0;
390                var d=!a.compareDocumentPosition-!b.compareDocumentPosition;
391                return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d ||!c.sortDetached && b.compareDocumentPosition(a) === d ? a === g || a.ownerDocument === v && t(v, a)?-1 : b === g || b.ownerDocument === v && t(v, b) ? 1 : k ? J(k, a) - J(k, b) : 0 : 4 & d?-1 : 1)
392            } : function(a, b) {
393                if (a === b)
394                    return l=!0, 0;
395                var c, d = 0, e = a.parentNode, f = b.parentNode, h = [a], i = [b];
396                if (!e ||!f)
397                    return a === g?-1 : b === g ? 1 : e?-1 : f ? 1 : k ? J(k, a) - J(k, b) : 0;
398                if (e === f)
399                    return la(a, b);
400                c = a;
401                while (c = c.parentNode)
402                    h.unshift(c);
403                c = b;
404                while (c = c.parentNode)
405                    i.unshift(c);
406                while (h[d] === i[d])
407                    d++;
408                return d ? la(h[d], i[d]) : h[d] === v?-1 : i[d] === v ? 1 : 0
409            }, g) : n
410        }, ga.matches = function(a, b) {
411            return ga(a, null, null, b)
412        }, ga.matchesSelector = function(a, b) {
413            if ((a.ownerDocument || a) !== n && m(a), b = b.replace(U, "='$1']"), !(!c.matchesSelector ||!p || r && r.test(b) || q && q.test(b)))
414                try {
415                    var d = s.call(a, b);
416                    if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType)
417                        return d
418            } catch (e) {}
419            return ga(b, n, null, [a]).length > 0
420        }, ga.contains = function(a, b) {
421            return (a.ownerDocument || a) !== n && m(a), t(a, b)
422        }, ga.attr = function(a, b) {
423            (a.ownerDocument || a) !== n && m(a);
424            var e = d.attrHandle[b.toLowerCase()], f = e && D.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p): void 0;
425            return void 0 !== f ? f : c.attributes ||!p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null
426        }, ga.error = function(a) {
427            throw new Error("Syntax error, unrecognized expression: " + a)
428        }, ga.uniqueSort = function(a) {
429            var b, d = [], e = 0, f = 0;
430            if (l=!c.detectDuplicates, k=!c.sortStable && a.slice(0), a.sort(B), l) {
431                while (b = a[f++])
432                    b === a[f] && (e = d.push(f));
433                while (e--)
434                    a.splice(d[e], 1)
435            }
436            return k = null, a
437        }, e = ga.getText = function(a) {
438            var b, c = "", d = 0, f = a.nodeType;
439            if (f) {
440                if (1 === f || 9 === f || 11 === f) {
441                    if ("string" == typeof a.textContent)
442                        return a.textContent;
443                    for (a = a.firstChild; a; a = a.nextSibling)
444                        c += e(a)
445                    } else if (3 === f || 4 === f)
446                    return a.nodeValue
447            } else 
448                while (b = a[d++])
449                    c += e(b);
450            return c
451        }, d = ga.selectors = {
452            cacheLength: 50,
453            createPseudo: ia,
454            match: X,
455            attrHandle: {},
456            find: {},
457            relative: {
458                ">": {
459                    dir: "parentNode",
460                    first: !0
461                },
462                " ": {
463                    dir: "parentNode"
464                },
465                "+": {
466                    dir: "previousSibling",
467                    first: !0
468                },
469                "~": {
470                    dir: "previousSibling"
471                }
472            },
473            preFilter: {
474                ATTR: function(a) {
475                    return a[1] = a[1].replace(ca, da), a[3] = (a[3] || a[4] || a[5] || "").replace(ca, da), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
476                },
477                CHILD: function(a) {
478                    return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || ga.error(a[0]), a[4] =+ (a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] =+ (a[7] + a[8] || "odd" === a[3])) : a[3] && ga.error(a[0]), a
479                },
480                PSEUDO: function(a) {
481                    var b, c=!a[6] && a[2];
482                    return X.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && V.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3))
483                }
484            },
485            filter: {
486                TAG: function(a) {
487                    var b = a.replace(ca, da).toLowerCase();
488                    return "*" === a ? function() {
489                        return !0
490                    } : function(a) {
491                        return a.nodeName && a.nodeName.toLowerCase() === b
492                    }
493                },
494                CLASS: function(a) {
495                    var b = y[a + " "];
496                    return b || (b = new RegExp("(^|" + L + ")" + a + "(" + L + "|$)")) && y(a, function(a) {
497                        return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "")
498                    })
499                },
500                ATTR: function(a, b, c) {
501                    return function(d) {
502                        var e = ga.attr(d, a);
503                        return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c)>-1 : "$=" === b ? c && e.slice( - c.length) === c : "~=" === b ? (" " + e.replace(Q, " ") + " ").indexOf(c)>-1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0
504                    }
505                },
506                CHILD: function(a, b, c, d, e) {
507                    var f = "nth" !== a.slice(0, 3), g = "last" !== a.slice( - 4), h = "of-type" === b;
508                    return 1 === d && 0 === e ? function(a) {
509                        return !!a.parentNode
510                    } : function(b, c, i) {
511                        var j, k, l, m, n, o, p = f !== g ? "nextSibling": "previousSibling", q = b.parentNode, r = h && b.nodeName.toLowerCase(), s=!i&&!h;
512                        if (q) {
513                            if (f) {
514                                while (p) {
515                                    l = b;
516                                    while (l = l[p])
517                                        if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType)
518                                            return !1;
519                                    o = p = "only" === a&&!o && "nextSibling"
520                                }
521                                return !0
522                            }
523                            if (o = [g ? q.firstChild: q.lastChild], g && s) {
524                                k = q[u] || (q[u] = {}), j = k[a] || [], n = j[0] === w && j[1], m = j[0] === w && j[2], l = n && q.childNodes[n];
525                                while (l=++n && l && l[p] || (m = n = 0) || o.pop()
526                                    )if (1 === l.nodeType&&++m && l === b) {
527                                    k[a] = [w, n, m];
528                                    break
529                                }
530                            } else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w)
531                                m = j[1];
532                            else 
533                                while (l=++n && l && l[p] || (m = n = 0) || o.pop()
534                                    )if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType)&&++m && (s && ((l[u] || (l[u] = {})
535                                )[a] = [w, m]), l === b))break;
536                            return m -= e, m === d || m%d === 0 && m / d >= 0
537                        }
538                    }
539                },
540                PSEUDO: function(a, b) {
541                    var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error("unsupported pseudo: " + a);
542                    return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ia(function(a, c) {
543                        var d, f = e(a, b), g = f.length;
544                        while (g--)
545                            d = J(a, f[g]), a[d]=!(c[d] = f[g])
546                    }) : function(a) {
547                        return e(a, 0, c)
548                    }) : e
549                }
550            },
551            pseudos: {
552                not: ia(function(a) {
553                    var b = [], c = [], d = h(a.replace(R, "$1"));
554                    return d[u] ? ia(function(a, b, c, e) {
555                        var f, g = d(a, null, e, []), h = a.length;
556                        while (h--)(f = g[h]) && (a[h]=!(b[h] = f))
557                        }) : function(a, e, f) {
558                        return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop()
559                    }
560                }), has : ia(function(a) {
561                    return function(b) {
562                        return ga(a, b).length > 0
563                    }
564                }), contains : ia(function(a) {
565                    return a = a.replace(ca, da), function(b) {
566                        return (b.textContent || b.innerText || e(b)).indexOf(a)>-1
567                    }
568                }), lang : ia(function(a) {
569                    return W.test(a || "") || ga.error("unsupported lang: " + a), a = a.replace(ca, da).toLowerCase(), function(b) {
570                        var c;
571                        do 
572                            if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang"))
573                                return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-");
574                        while ((b = b.parentNode) && 1 === b.nodeType);
575                        return !1
576                    }
577                }), target : function(b) {
578                    var c = a.location && a.location.hash;
579                    return c && c.slice(1) === b.id
580                }, root: function(a) {
581                    return a === o
582                }, focus: function(a) {
583                    return a === n.activeElement && (!n.hasFocus || n.hasFocus())&&!!(a.type || a.href||~a.tabIndex)
584                }, enabled: function(a) {
585                    return a.disabled===!1
586                }, disabled: function(a) {
587                    return a.disabled===!0
588                }, checked: function(a) {
589                    var b = a.nodeName.toLowerCase();
590                    return "input" === b&&!!a.checked || "option" === b&&!!a.selected
591                }, selected: function(a) {
592                    return a.parentNode && a.parentNode.selectedIndex, a.selected===!0
593                }, empty: function(a) {
594                    for (a = a.firstChild; a; a = a.nextSibling)
595                        if (a.nodeType < 6)
596                            return !1;
597                    return !0
598                }, parent: function(a) {
599                    return !d.pseudos.empty(a)
600                }, header: function(a) {
601                    return Z.test(a.nodeName)
602                }
vendor: 4,457 bytes, lines 602-709
602, input: function(a) {
603                    return Y.test(a.nodeName)
604                }, button: function(a) {
605                    var b = a.nodeName.toLowerCase();
606                    return "input" === b && "button" === a.type || "button" === b
607                }, text: function(a) {
608                    var b;
609                    return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase())
610                }, first: oa(function() {
611                    return [0]
612                }), last : oa(function(a, b) {
613                    return [b - 1]
614                }), eq : oa(function(a, b, c) {
615                    return [0 > c ? c + b: c]
616                }), even : oa(function(a, b) {
617                    for (var c = 0; b > c; c += 2)
618                        a.push(c);
619                    return a
620                }), odd : oa(function(a, b) {
621                    for (var c = 1; b > c; c += 2)
622                        a.push(c);
623                    return a
624                }), lt : oa(function(a, b, c) {
625                    for (var d = 0 > c ? c + b : c; --d >= 0;)
626                        a.push(d);
627                    return a
628                }), gt : oa(function(a, b, c) {
629                    for (var d = 0 > c ? c + b : c; ++d < b;)
630                        a.push(d);
631                    return a
632                })
633            }
634        }, d.pseudos.nth = d.pseudos.eq; for (b in{
635            radio : !0, checkbox : !0, file : !0, password : !0, image : !0
636        })d.pseudos[b] = ma(b);
637        for (b in{
638            submit: !0,
639            reset: !0
640        })d.pseudos[b] = na(b);
641        function qa() {}
642        qa.prototype = d.filters = d.pseudos, d.setFilters = new qa, g = ga.tokenize = function(a, b) {
643            var c, e, f, g, h, i, j, k = z[a + " "];
644            if (k)
645                return b ? 0 : k.slice(0);
646            h = a, i = [], j = d.preFilter;
647            while (h) {
648                (!c || (e = S.exec(h))) && (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c=!1, (e = T.exec(h)) && (c = e.shift(), f.push({
649                    value: c,
650                    type: e[0].replace(R, " ")
651                }), h = h.slice(c.length));
652                for (g in d.filter)
653                    !(e = X[g].exec(h)) || j[g]&&!(e = j[g](e)) || (c = e.shift(), f.push({
654                        value: c,
655                        type: g,
656                        matches: e
657                    }), h = h.slice(c.length));
658                if (!c)
659                    break
660            }
661            return b ? h.length : h ? ga.error(a) : z(a, i).slice(0)
662        };
663        function ra(a) {
664            for (var b = 0, c = a.length, d = ""; c > b; b++)
665                d += a[b].value;
666            return d
667        }
668        function sa(a, b, c) {
669            var d = b.dir, e = c && "parentNode" === d, f = x++;
670            return b.first ? function(b, c, f) {
671                while (b = b[d])
672                    if (1 === b.nodeType || e)
673                        return a(b, c, f)
674            } : function(b, c, g) {
675                var h, i, j = [w, f];
676                if (g) {
677                    while (b = b[d])
678                        if ((1 === b.nodeType || e) && a(b, c, g))
679                            return !0
680                } else 
681                    while (b = b[d])
682                        if (1 === b.nodeType || e) {
683                            if (i = b[u] || (b[u] = {}), (h = i[d]) && h[0] === w && h[1] === f)
684                                return j[2] = h[2];
685                                if (i[d] = j, j[2] = a(b, c, g))
686                                    return !0
687                        }
688            }
689        }
690        function ta(a) {
691            return a.length > 1 ? function(b, c, d) {
692                var e = a.length;
693                while (e--)
694                    if (!a[e](b, c, d))
695                        return !1;
696                return !0
697            } : a[0]
698        }
699        function ua(a, b, c) {
700            for (var d = 0, e = b.length; e > d; d++)
701                ga(a, b[d], c);
702            return c
703        }
704        function va(a, b, c, d, e) {
705            for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)(f = a[h]) 
706                && (!c || c(f, d, e)) && (g.push(f), j && b.push(h));
707            return g
708        }
709        function wa(a, b, c, d, e, f) {
vendor: 75,366 bytes, lines 710-2189
710            return d&&!d[u] && (d = wa(d)), e&&!e[u] && (e = wa(e, f)), ia(function(f, g, h, i) {
711                var j, k, l, m = [], n = [], o = g.length, p = f || ua(b || "*", h.nodeType ? [h] : h, []), q=!a ||!f && b ? p : va(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q;
712                if (c && c(q, r, h, i), d) {
713                    j = va(r, n), d(j, [], h, i), k = j.length;
714                    while (k--)(l = j[k]) && (r[n[k]]=!(q[n[k]] = l))
715                    }
716                if (f) {
717                    if (e || a) {
718                        if (e) {
719                            j = [], k = r.length;
720                            while (k--)(l = r[k]) && j.push(q[k] = l);
721                            e(null, r = [], j, i)
722                        }
723                        k = r.length;
724                        while (k--)(l = r[k]) && (j = e ? J(f, l) : m[k])>-1 && (f[j]=!(g[j] = l))
725                        }
726                } else 
727                    r = va(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : H.apply(g, r)
728                })
729        }
730        function xa(a) {
731            for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = sa(function(a) {
732                return a === b
733            }, h, !0), l = sa(function(a) {
734                return J(b, a)>-1
735            }, h, !0), m = [function(a, c, d) {
736                var e=!g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d));
737                return b = null, e
738            }
739            ]; f > i; i++)
740                if (c = d.relative[a[i].type])
741                    m = [sa(ta(m), c)];
742                else {
743                    if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) {
744                        for (e=++i; f > e; e++)
745                            if (d.relative[a[e].type])
746                                break;
747                                return wa(i > 1 && ta(m), i > 1 && ra(a.slice(0, i - 1).concat({
748                                    value: " " === a[i - 2].type ? "*": ""
749                                })).replace(R, "$1"), c, e > i && xa(a.slice(i, e)), f > e && xa(a = a.slice(e)), f > e && ra(a))
750                            }
751                            m.push(c)
752                }
753            return ta(m)
754        }
755        function ya(a, b) {
756            var c = b.length > 0, e = a.length > 0, f = function(f, g, h, i, k) {
757                var l, m, o, p = 0, q = "0", r = f && [], s = [], t = j, u = f || e && d.find.TAG("*", k), v = w += null == t ? 1: Math.random() || .1, x = u.length;
758                for (k && (j = g !== n && g); q !== x && null != (l = u[q]); q++) {
759                    if (e && l) {
760                        m = 0;
761                        while (o = a[m++])
762                            if (o(l, g, h)) {
763                                i.push(l);
764                                break
765                            }
766                        k && (w = v)
767                    }
768                    c && ((l=!o && l) && p--, f && r.push(l))
769                }
770                if (p += q, c && q !== p) {
771                    m = 0;
772                    while (o = b[m++])
773                        o(r, s, g, h);
774                    if (f) {
775                        if (p > 0)
776                            while (q--)
777                                r[q] || s[q] || (s[q] = F.call(i));
778                        s = va(s)
779                    }
780                    H.apply(i, s), k&&!f && s.length > 0 && p + b.length > 1 && ga.uniqueSort(i)
781                }
782                return k && (w = v, j = t), r
783            };
784            return c ? ia(f) : f
785        }
786        return h = ga.compile = function(a, b) {
787            var c, d = [], e = [], f = A[a + " "];
788            if (!f) {
789                b || (b = g(a)), c = b.length;
790                while (c--)
791                    f = xa(b[c]), f[u] ? d.push(f) : e.push(f);
792                f = A(a, ya(e, d)), f.selector = a
793            }
794            return f
795        }, i = ga.select = function(a, b, e, f) {
796            var i, j, k, l, m, n = "function" == typeof a && a, o=!f && g(a = n.selector || a);
797            if (e = e || [], 1 === o.length) {
798                if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) {
799                    if (b = (d.find.ID(k.matches[0].replace(ca, da), b) || [])[0], !b)
800                        return e;
801                    n && (b = b.parentNode), a = a.slice(j.shift().value.length)
802                }
803                i = X.needsContext.test(a) ? 0 : j.length;
804                while (i--) {
805                    if (k = j[i], d.relative[l = k.type])
806                        break;
807                    if ((m = d.find[l]) && (f = m(k.matches[0].replace(ca, da), aa.test(j[0].type) && pa(b.parentNode) || b))) {
808                        if (j.splice(i, 1), a = f.length && ra(j), !a)
809                            return H.apply(e, f), e;
810                        break
811                    }
812                }
813            }
814            return (n || h(a, o))(f, b, !p, e, aa.test(a) && pa(b.parentNode) || b), e
815        }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates=!!l, m(), c.sortDetached = ja(function(a) {
816            return 1 & a.compareDocumentPosition(n.createElement("div"))
817        }), ja(function(a) {
818            return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href")
819        }) || ka("type|href|height|width", function(a, b, c) {
820            return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2)
821        }), c.attributes && ja(function(a) {
822            return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value")
823        }) || ka("value", function(a, b, c) {
824            return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue
825        }), ja(function(a) {
826            return null == a.getAttribute("disabled")
827        }) || ka(K, function(a, b, c) {
828            var d;
829            return c ? void 0 : a[b]===!0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null
830        }), ga
831    }(a); m.find = s, m.expr = s.selectors, m.expr[":"] = m.expr.pseudos, m.unique = s.uniqueSort, m.text = s.getText, m.isXMLDoc = s.isXML, m.contains = s.contains; var t = m.expr.match.needsContext, u = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, v = /^.[^:#\[\.,]*$/; function w(a, b, c) {
832        if (m.isFunction(b))
833            return m.grep(a, function(a, d) {
834                return !!b.call(a, d, a) !== c
835            });
836        if (b.nodeType)
837            return m.grep(a, function(a) {
838                return a === b !== c
839            });
840        if ("string" == typeof b) {
841            if (v.test(b))
842                return m.filter(b, a, c);
843            b = m.filter(b, a)
844        }
845        return m.grep(a, function(a) {
846            return m.inArray(a, b) >= 0 !== c
847        })
848    }
849    m.filter = function(a, b, c) {
850        var d = b[0];
851        return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? m.find.matchesSelector(d, a) ? [d] : [] : m.find.matches(a, m.grep(b, function(a) {
852            return 1 === a.nodeType
853        }))
854    }, m.fn.extend({
855        find: function(a) {
856            var b, c = [], d = this, e = d.length;
857            if ("string" != typeof a)
858                return this.pushStack(m(a).filter(function() {
859                    for (b = 0; e > b; b++)
860                        if (m.contains(d[b], this))
861                            return !0
862                        }));
863            for (b = 0; e > b; b++)
864                m.find(a, d[b], c);
865            return c = this.pushStack(e > 1 ? m.unique(c) : c), c.selector = this.selector ? this.selector + " " + a : a, c
866        },
867        filter: function(a) {
868            return this.pushStack(w(this, a || [], !1))
869        },
870        not: function(a) {
871            return this.pushStack(w(this, a || [], !0))
872        },
873        is: function(a) {
874            return !!w(this, "string" == typeof a && t.test(a) ? m(a) : a || [], !1).length
875        }
876    });
877    var x, y = a.document, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, A = m.fn.init = function(a, b) {
878        var c, d;
879        if (!a)
880            return this;
881        if ("string" == typeof a) {
882            if (c = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : z.exec(a), !c ||!c[1] && b)
883                return !b || b.jquery ? (b || x).find(a) : this.constructor(b).find(a);
884            if (c[1]) {
885                if (b = b instanceof m ? b[0] : b, m.merge(this, m.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : y, !0)), u.test(c[1]) && m.isPlainObject(b))
886                    for (c in b)
887                        m.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]);
888                return this
889            }
890            if (d = y.getElementById(c[2]), d && d.parentNode) {
891                if (d.id !== c[2])
892                    return x.find(a);
893                this.length = 1, this[0] = d
894            }
895            return this.context = y, this.selector = a, this
896        }
897        return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : m.isFunction(a) ? "undefined" != typeof x.ready ? x.ready(a) : a(m) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), m.makeArray(a, this))
898    };
899    A.prototype = m.fn, x = m(y);
900    var B = /^(?:parents|prev(?:Until|All))/, C = {
901        children: !0,
902        contents: !0,
903        next: !0,
904        prev: !0
905    };
906    m.extend({
907        dir: function(a, b, c) {
908            var d = [], e = a[b];
909            while (e && 9 !== e.nodeType && (void 0 === c || 1 !== e.nodeType ||!m(e).is(c))
910                )1 === e.nodeType && d.push(e), e = e[b];
911            return d
912        },
913        sibling: function(a, b) {
914            for (var c = []; a; a = a.nextSibling)
915                1 === a.nodeType && a !== b && c.push(a);
916            return c
917        }
918    }), m.fn.extend({
919        has: function(a) {
920            var b, c = m(a, this), d = c.length;
921            return this.filter(function() {
922                for (b = 0; d > b; b++)
923                    if (m.contains(this, c[b]))
924                        return !0
925            })
926        },
927        closest: function(a, b) {
928            for (var c, d = 0, e = this.length, f = [], g = t.test(a) || "string" != typeof a ? m(a, b || this.context) : 0; e > d; d++)
929                for (c = this[d]; c && c !== b; c = c.parentNode)
930                    if (c.nodeType < 11 && (g ? g.index(c)>-1 : 1 === c.nodeType && m.find.matchesSelector(c, a))) {
931                        f.push(c);
932                        break
933                    }
934            return this.pushStack(f.length > 1 ? m.unique(f) : f)
935        },
936        index: function(a) {
937            return a ? "string" == typeof a ? m.inArray(this[0], m(a)) : m.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : - 1
938        },
939        add: function(a, b) {
940            return this.pushStack(m.unique(m.merge(this.get(), m(a, b))))
941        },
942        addBack: function(a) {
943            return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
944        }
945    });
946    function D(a, b) {
947        do 
948            a = a[b];
949        while (a && 1 !== a.nodeType);
950        return a
951    }
952    m.each({
953        parent: function(a) {
954            var b = a.parentNode;
955            return b && 11 !== b.nodeType ? b : null
956        },
957        parents: function(a) {
958            return m.dir(a, "parentNode")
959        },
960        parentsUntil: function(a, b, c) {
961            return m.dir(a, "parentNode", c)
962        },
963        next: function(a) {
964            return D(a, "nextSibling")
965        },
966        prev: function(a) {
967            return D(a, "previousSibling")
968        },
969        nextAll: function(a) {
970            return m.dir(a, "nextSibling")
971        },
972        prevAll: function(a) {
973            return m.dir(a, "previousSibling")
974        },
975        nextUntil: function(a, b, c) {
976            return m.dir(a, "nextSibling", c)
977        },
978        prevUntil: function(a, b, c) {
979            return m.dir(a, "previousSibling", c)
980        },
981        siblings: function(a) {
982            return m.sibling((a.parentNode || {}).firstChild, a)
983        },
984        children: function(a) {
985            return m.sibling(a.firstChild)
986        },
987        contents: function(a) {
988            return m.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : m.merge([], a.childNodes)
989        }
990    }, function(a, b) {
991        m.fn[a] = function(c, d) {
992            var e = m.map(this, b, c);
993            return "Until" !== a.slice( - 5) && (d = c), d && "string" == typeof d && (e = m.filter(d, e)), this.length > 1 && (C[a] || (e = m.unique(e)), B.test(a) && (e = e.reverse())), this.pushStack(e)
994        }
995    });
996    var E = /\S+/g, F = {};
997    function G(a) {
998        var b = F[a] = {};
999        return m.each(a.match(E) || [], function(a, c) {
1000            b[c]=!0
1001        }), b
1002    }
1003    m.Callbacks = function(a) {
1004        a = "string" == typeof a ? F[a] || G(a) : m.extend({}, a);
1005        var b, c, d, e, f, g, h = [], i=!a.once && [], j = function(l) {
1006            for (c = a.memory && l, d=!0, f = g || 0, g = 0, e = h.length, b=!0; h && e > f; f++)
1007                if (h[f].apply(l[0], l[1])===!1 && a.stopOnFalse) {
1008                    c=!1;
1009                    break
1010                }
1011            b=!1, h && (i ? i.length && j(i.shift()) : c ? h = [] : k.disable())
1012        }, k = {
1013            add: function() {
1014                if (h) {
1015                    var d = h.length;
1016                    !function f(b) {
1017                        m.each(b, function(b, c) {
1018                            var d = m.type(c);
1019                            "function" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && "string" !== d && f(c)
1020                        })
1021                    }(arguments), b ? e = h.length : c && (g = d, j(c))
1022                }
1023                return this
1024            },
1025            remove: function() {
1026                return h && m.each(arguments, function(a, c) {
1027                    var d;
1028                    while ((d = m.inArray(c, h, d))>-1)
1029                        h.splice(d, 1), b && (e >= d && e--, f >= d && f--)
1030                }), this
1031            },
1032            has: function(a) {
1033                return a ? m.inArray(a, h)>-1 : !(!h ||!h.length)
1034            },
1035            empty: function() {
1036                return h = [], e = 0, this
1037            },
1038            disable: function() {
1039                return h = i = c = void 0, this
1040            },
1041            disabled: function() {
1042                return !h
1043            },
1044            lock: function() {
1045                return i = void 0, c || k.disable(), this
1046            },
1047            locked: function() {
1048                return !i
1049            },
1050            fireWith: function(a, c) {
1051                return !h || d&&!i || (c = c || [], c = [a, c.slice ? c.slice(): c], b ? i.push(c) : j(c)), this
1052            },
1053            fire: function() {
1054                return k.fireWith(this, arguments), this
1055            },
1056            fired: function() {
1057                return !!d
1058            }
1059        };
1060        return k
1061    }, m.extend({
1062        Deferred: function(a) {
1063            var b = [["resolve", "done", m.Callbacks("once memory"), "resolved"], ["reject", "fail", m.Callbacks("once memory"), "rejected"], ["notify", "progress", m.Callbacks("memory")]], c = "pending", d = {
1064                state: function() {
1065                    return c
1066                },
1067                always: function() {
1068                    return e.done(arguments).fail(arguments), this
1069                },
1070                then: function() {
1071                    var a = arguments;
1072                    return m.Deferred(function(c) {
1073                        m.each(b, function(b, f) {
1074                            var g = m.isFunction(a[b]) && a[b];
1075                            e[f[1]](function() {
1076                                var a = g && g.apply(this, arguments);
1077                                a && m.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments)
1078                            })
1079                        }), a = null
1080                    }).promise()
1081                },
1082                promise: function(a) {
1083                    return null != a ? m.extend(a, d) : d
1084                }
1085            }, e = {};
1086            return d.pipe = d.then, m.each(b, function(a, f) {
1087                var g = f[2], h = f[3];
1088                d[f[1]] = g.add, h && g.add(function() {
1089                    c = h
1090                }, b[1^a][2].disable, b[2][2].lock), e[f[0]] = function() {
1091                    return e[f[0] + "With"](this === e ? d : this, arguments), this
1092                }, e[f[0] + "With"] = g.fireWith
1093            }), d.promise(e), a && a.call(e, e), e
1094        },
1095        when: function(a) {
1096            var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && m.isFunction(a.promise) ? e: 0, g = 1 === f ? a: m.Deferred(), h = function(a, b, c) {
1097                return function(e) {
1098                    b[a] = this, c[a] = arguments.length > 1 ? d.call(arguments) : e, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c)
1099                }
1100            }, i, j, k;
1101            if (e > 1)
1102                for (i = new Array(e), j = new Array(e), k = new Array(e); e > b; b++)
1103                    c[b] && m.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f;
1104            return f || g.resolveWith(k, c), g.promise()
1105        }
1106    });
1107    var H;
1108    m.fn.ready = function(a) {
1109        return m.ready.promise().done(a), this
1110    }, m.extend({
1111        isReady: !1,
1112        readyWait: 1,
1113        holdReady: function(a) {
1114            a ? m.readyWait++ : m.ready(!0)
1115        },
1116        ready: function(a) {
1117            if (a===!0?!--m.readyWait : !m.isReady) {
1118                if (!y.body)
1119                    return setTimeout(m.ready);
1120                m.isReady=!0, a!==!0&&--m.readyWait > 0 || (H.resolveWith(y, [m]), m.fn.triggerHandler && (m(y).triggerHandler("ready"), m(y).off("ready")))
1121            }
1122        }
1123    });
1124    function I() {
1125        y.addEventListener ? (y.removeEventListener("DOMContentLoaded", J, !1), a.removeEventListener("load", J, !1)) : (y.detachEvent("onreadystatechange", J), a.detachEvent("onload", J))
1126    }
1127    function J() {
1128        (y.addEventListener || "load" === event.type || "complete" === y.readyState) && (I(), m.ready())
1129    }
1130    m.ready.promise = function(b) {
1131        if (!H)
1132            if (H = m.Deferred(), "complete" === y.readyState)
1133                setTimeout(m.ready);
1134            else if (y.addEventListener)
1135                y.addEventListener("DOMContentLoaded", J, !1), a.addEventListener("load", J, !1);
1136            else {
1137                y.attachEvent("onreadystatechange", J), a.attachEvent("onload", J);
1138                var c=!1;
1139                try {
1140                    c = null == a.frameElement && y.documentElement
1141                } catch (d) {}
1142                c && c.doScroll&&!function e() {
1143                    if (!m.isReady) {
1144                        try {
1145                            c.doScroll("left")
1146                        } catch (a) {
1147                            return setTimeout(e, 50)
1148                        }
1149                        I(), m.ready()
1150                    }
1151                }()
1152            }
1153        return H.promise(b)
1154    };
1155    var K = "undefined", L;
1156    for (L in m(k))
1157        break;
1158    k.ownLast = "0" !== L, k.inlineBlockNeedsLayout=!1, m(function() {
1159        var a, b, c, d;
1160        c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", k.inlineBlockNeedsLayout = a = 3 === b.offsetWidth, a && (c.style.zoom = 1)), c.removeChild(d))
1161    }), function() {
1162        var a = y.createElement("div");
1163        if (null == k.deleteExpando) {
1164            k.deleteExpando=!0;
1165            try {
1166                delete a.test
1167            } catch (b) {
1168                k.deleteExpando=!1
1169            }
1170        }
1171        a = null
1172    }(), m.acceptData = function(a) {
1173        var b = m.noData[(a.nodeName + " ").toLowerCase()], c =+ a.nodeType || 1;
1174        return 1 !== c && 9 !== c?!1 : !b || b!==!0 && a.getAttribute("classid") === b
1175    };
1176    var M = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, N = /([A-Z])/g;
1177    function O(a, b, c) {
1178        if (void 0 === c && 1 === a.nodeType) {
1179            var d = "data-" + b.replace(N, "-$1").toLowerCase();
1180            if (c = a.getAttribute(d), "string" == typeof c) {
1181                try {
1182                    c = "true" === c?!0 : "false" === c?!1 : "null" === c ? null : + c + "" === c?+c : M.test(c) ? m.parseJSON(c) : c
1183                } catch (e) {}
1184                m.data(a, b, c)
1185            } else 
1186                c = void 0
1187        }
1188        return c
1189    }
1190    function P(a) {
1191        var b;
1192        for (b in a)
1193            if (("data" !== b ||!m.isEmptyObject(a[b])) && "toJSON" !== b)
1194                return !1;
1195
1196        return !0
1197    }
1198    function Q(a, b, d, e) {
1199        if (m.acceptData(a)) {
1200            var f, g, h = m.expando, i = a.nodeType, j = i ? m.cache: a, k = i ? a[h]: a[h] && h;
1201            if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b)
1202                return k || (k = i ? a[h] = c.pop() || m.guid++ : h), j[k] || (j[k] = i ? {} : {
1203                    toJSON: m.noop
1204                }), ("object" == typeof b || "function" == typeof b) && (e ? j[k] = m.extend(j[k], b) : j[k].data = m.extend(j[k].data, b)), g = j[k], e || (g.data || (g.data = {}), g = g.data), void 0 !== d && (g[m.camelCase(b)] = d), "string" == typeof b ? (f = g[b], null == f && (f = g[m.camelCase(b)])) : f = g, f
1205        }
1206    }
1207    function R(a, b, c) {
1208        if (m.acceptData(a)) {
1209            var d, e, f = a.nodeType, g = f ? m.cache: a, h = f ? a[m.expando]: m.expando;
1210            if (g[h]) {
1211                if (b && (d = c ? g[h] : g[h].data)) {
1212                    m.isArray(b) ? b = b.concat(m.map(b, m.camelCase)) : b in d ? b = [b] : (b = m.camelCase(b), b = b in d ? [b] : b.split(" ")), e = b.length;
1213                    while (e--)
1214                        delete d[b[e]];
1215                    if (c?!P(d) : !m.isEmptyObject(d)
1216                        )return 
1217                }(c || (delete g[h].data, P(g[h]))) && (f ? m.cleanData([a], !0) : k.deleteExpando || g != g.window ? delete g[h] : g[h] = null)
1218            }
1219        }
1220    }
1221    m.extend({
1222        cache: {},
1223        noData: {
1224            "applet ": !0,
1225            "embed ": !0,
1226            "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
1227        },
1228        hasData: function(a) {
1229            return a = a.nodeType ? m.cache[a[m.expando]] : a[m.expando], !!a&&!P(a)
1230        },
1231        data: function(a, b, c) {
1232            return Q(a, b, c)
1233        },
1234        removeData: function(a, b) {
1235            return R(a, b)
1236        },
1237        _data: function(a, b, c) {
1238            return Q(a, b, c, !0)
1239        },
1240        _removeData: function(a, b) {
1241            return R(a, b, !0)
1242        }
1243    }), m.fn.extend({
1244        data: function(a, b) {
1245            var c, d, e, f = this[0], g = f && f.attributes;
1246            if (void 0 === a) {
1247                if (this.length && (e = m.data(f), 1 === f.nodeType&&!m._data(f, "parsedAttrs"))) {
1248                    c = g.length;
1249                    while (c--)
1250                        g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = m.camelCase(d.slice(5)), O(f, d, e[d])));
1251                    m._data(f, "parsedAttrs", !0)
1252                }
1253                return e
1254            }
1255            return "object" == typeof a ? this.each(function() {
1256                m.data(this, a)
1257            }) : arguments.length > 1 ? this.each(function() {
1258                m.data(this, a, b)
1259            }) : f ? O(f, a, m.data(f, a)) : void 0
1260        },
1261        removeData: function(a) {
1262            return this.each(function() {
1263                m.removeData(this, a)
1264            })
1265        }
1266    }), m.extend({
1267        queue: function(a, b, c) {
1268            var d;
1269            return a ? (b = (b || "fx") + "queue", d = m._data(a, b), c && (!d || m.isArray(c) ? d = m._data(a, b, m.makeArray(c)) : d.push(c)), d || []) : void 0
1270        },
1271        dequeue: function(a, b) {
1272            b = b || "fx";
1273            var c = m.queue(a, b), d = c.length, e = c.shift(), f = m._queueHooks(a, b), g = function() {
1274                m.dequeue(a, b)
1275            };
1276            "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire()
1277        },
1278        _queueHooks: function(a, b) {
1279            var c = b + "queueHooks";
1280            return m._data(a, c) || m._data(a, c, {
1281                empty: m.Callbacks("once memory").add(function() {
1282                    m._removeData(a, b + "queue"), m._removeData(a, c)
1283                })
1284            })
1285        }
1286    }), m.fn.extend({
1287        queue: function(a, b) {
1288            var c = 2;
1289            return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? m.queue(this[0], a) : void 0 === b ? this : this.each(function() {
1290                var c = m.queue(this, a, b);
1291                m._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && m.dequeue(this, a)
1292            })
1293        },
1294        dequeue: function(a) {
1295            return this.each(function() {
1296                m.dequeue(this, a)
1297            })
1298        },
1299        clearQueue: function(a) {
1300            return this.queue(a || "fx", [])
1301        },
1302        promise: function(a, b) {
1303            var c, d = 1, e = m.Deferred(), f = this, g = this.length, h = function() {
1304                --d || e.resolveWith(f, [f])
1305            };
1306            "string" != typeof a && (b = a, a = void 0), a = a || "fx";
1307            while (g--)
1308                c = m._data(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h));
1309            return h(), e.promise(b)
1310        }
1311    });
1312    var S = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, T = ["Top", "Right", "Bottom", "Left"], U = function(a, b) {
1313        return a = b || a, "none" === m.css(a, "display") ||!m.contains(a.ownerDocument, a)
1314    }, V = m.access = function(a, b, c, d, e, f, g) {
1315        var h = 0, i = a.length, j = null == c;
1316        if ("object" === m.type(c)) {
1317            e=!0;
1318            for (h in c)
1319                m.access(a, b, h, c[h], !0, f, g)
1320        } else if (void 0 !== d && (e=!0, m.isFunction(d) || (g=!0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function(a, b, c) {
1321            return j.call(m(a), c)
1322        })), b))for (; i > h; h++)
1323            b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
1324        return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
1325    }, W = /^(?:checkbox|radio)$/i;
1326    !function() {
1327        var a = y.createElement("input"), b = y.createElement("div"), c = y.createDocumentFragment();
1328        if (b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", k.leadingWhitespace = 3 === b.firstChild.nodeType, k.tbody=!b.getElementsByTagName("tbody").length, k.htmlSerialize=!!b.getElementsByTagName("link").length, k.html5Clone = "<:nav></:nav>" !== y.createElement("nav").cloneNode(!0).outerHTML, a.type = "checkbox", a.checked=!0, c.appendChild(a), k.appendChecked = a.checked, b.innerHTML = "<textarea>x</textarea>", k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue, c.appendChild(b), b.innerHTML = "<input type='radio' checked='checked' name='t'/>", k.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, k.noCloneEvent=!0, b.attachEvent && (b.attachEvent("onclick", function() {
1329            k.noCloneEvent=!1
1330        }), b.cloneNode(!0).click()), null == k.deleteExpando) {
1331            k.deleteExpando=!0;
1332            try {
1333                delete b.test
1334            } catch (d) {
1335                k.deleteExpando=!1
1336            }
1337        }
1338    }(), function() {
1339        var b, c, d = y.createElement("div");
1340        for (b in{
1341            submit: !0,
1342            change: !0,
1343            focusin: !0
1344        })
1345            c = "on" + b, (k[b + "Bubbles"] = c in a) || (d.setAttribute(c, "t"), k[b + "Bubbles"] = d.attributes[c].expando===!1);
1346        d = null
1347    }();
1348    var X = /^(?:input|select|textarea)$/i, Y = /^key/, Z = /^(?:mouse|pointer|contextmenu)|click/, $ = /^(?:focusinfocus|focusoutblur)$/, _ = /^([^.]*)(?:\.(.+)|)$/;
1349    function aa() {
1350        return !0
1351    }
1352    function ba() {
1353        return !1
1354    }
1355    function ca() {
1356        try {
1357            return y.activeElement
1358        } catch (a) {}
1359    }
1360    m.event = {
1361        global: {},
1362        add: function(a, b, c, d, e) {
1363            var f, g, h, i, j, k, l, n, o, p, q, r = m._data(a);
1364            if (r) {
1365                c.handler && (i = c, c = i.handler, e = i.selector), c.guid || (c.guid = m.guid++), (g = r.events) || (g = r.events = {}), (k = r.handle) || (k = r.handle = function(a) {
1366                    return typeof m === K || a && m.event.triggered === a.type ? void 0 : m.event.dispatch.apply(k.elem, arguments)
1367                }, k.elem = a), b = (b || "").match(E) || [""], h = b.length;
1368                while (h--)
1369                    f = _.exec(b[h]) || [], o = q = f[1], p = (f[2] || "").split(".").sort(), o && (j = m.event.special[o] || {}, o = (e ? j.delegateType : j.bindType) || o, j = m.event.special[o] || {}, l = m.extend({
1370                        type: o,
1371                        origType: q,
1372                        data: d,
1373                        handler: c,
1374                        guid: c.guid,
1375                        selector: e,
1376                        needsContext: e && m.expr.match.needsContext.test(e),
1377                        namespace: p.join(".")
1378                    }, i), (n = g[o]) || (n = g[o] = [], n.delegateCount = 0, j.setup && j.setup.call(a, d, p, k)!==!1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))), j.add && (j.add.call(a, l), l.handler.guid || (l.handler.guid = c.guid)), e ? n.splice(n.delegateCount++, 0, l) : n.push(l), m.event.global[o]=!0);
1379                a = null
1380            }
1381        },
1382        remove: function(a, b, c, d, e) {
1383            var f, g, h, i, j, k, l, n, o, p, q, r = m.hasData(a) && m._data(a);
1384            if (r && (k = r.events)) {
1385                b = (b || "").match(E) || [""], j = b.length;
1386                while (j--)
1387                    if (h = _.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) {
1388                        l = m.event.special[o] || {}, o = (d ? l.delegateType : l.bindType) || o, n = k[o] || [], h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), i = f = n.length;
1389                        while (f--)
1390                            g = n[f], !e && q !== g.origType || c && c.guid !== g.guid || h&&!h.test(g.namespace) || d && d !== g.selector && ("**" !== d ||!g.selector) || (n.splice(f, 1), g.selector && n.delegateCount--, l.remove && l.remove.call(a, g));
1391                            i&&!n.length && (l.teardown && l.teardown.call(a, p, r.handle)!==!1 || m.removeEvent(a, o, r.handle), delete k[o])
1392                    } else 
1393                        for (o in k)
1394                            m.event.remove(a, o + b[j], c, d, !0);
1395                m.isEmptyObject(k) && (delete r.handle, m._removeData(a, "events"))
1396            }
1397        },
1398        trigger: function(b, c, d, e) {
1399            var f, g, h, i, k, l, n, o = [d || y], p = j.call(b, "type") ? b.type: b, q = j.call(b, "namespace") ? b.namespace.split("."): [];
1400            if (h = l = d = d || y, 3 !== d.nodeType && 8 !== d.nodeType&&!$.test(p + m.event.triggered) && (p.indexOf(".") >= 0 && (q = p.split("."), p = q.shift(), q.sort()), g = p.indexOf(":") < 0 && "on" + p, b = b[m.expando] ? b : new m.Event(p, "object" == typeof b && b), b.isTrigger = e ? 2 : 3, b.namespace = q.join("."), b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = d), c = null == c ? [b] : m.makeArray(c, [b]), k = m.event.special[p] || {}, e ||!k.trigger || k.trigger.apply(d, c)!==!1)
1401                ) {
1402                if (!e&&!k.noBubble&&!m.isWindow(d)) {
1403                    for (i = k.delegateType || p, $.test(i + p) || (h = h.parentNode); h; h = h.parentNode)
1404                        o.push(h), l = h;
1405                    l === (d.ownerDocument || y) && o.push(l.defaultView || l.parentWindow || a)
1406                }
1407                n = 0;
1408                while ((h = o[n++])&&!b.isPropagationStopped())
1409                    b.type = n > 1 ? i : k.bindType || p, f = (m._data(h, "events") || {})[b.type] && m._data(h, "handle"), f && f.apply(h, c), f = g && h[g], f && f.apply && m.acceptData(h) && (b.result = f.apply(h, c), b.result===!1 && b.preventDefault());
1410                if (b.type = p, !e&&!b.isDefaultPrevented() && (!k._default || k._default.apply(o.pop(), c)===!1) && m.acceptData(d) && g && d[p]&&!m.isWindow(d)) {
1411                    l = d[g], l && (d[g] = null), m.event.triggered = p;
1412                    try {
1413                        d[p]()
1414                    } catch (r) {}
1415                    m.event.triggered = void 0, l && (d[g] = l)
1416                }
1417                return b.result
1418            }
1419        },
1420        dispatch: function(a) {
1421            a = m.event.fix(a);
1422            var b, c, e, f, g, h = [], i = d.call(arguments), j = (m._data(this, "events") || {})[a.type] || [], k = m.event.special[a.type] || {};
1423            if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a)!==!1) {
1424                h = m.event.handlers.call(this, a, j), b = 0;
1425                while ((f = h[b++])&&!a.isPropagationStopped()) {
1426                    a.currentTarget = f.elem, g = 0;
1427                    while ((e = f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re || a.namespace_re.test(e.namespace)) && (a.handleObj = e, a.data = e.data, c = ((m.event.special[e.origType] || {}).handle || e.handler).apply(f.elem, i), void 0 !== c && (a.result = c)===!1 && (a.preventDefault(), a.stopPropagation())
1428                        )
1429                    }
1430                return k.postDispatch && k.postDispatch.call(this, a), a.result
1431            }
1432        },
1433        handlers: function(a, b) {
1434            var c, d, e, f, g = [], h = b.delegateCount, i = a.target;
1435            if (h && i.nodeType && (!a.button || "click" !== a.type))
1436                for (; i != this; i = i.parentNode || this)
1437                    if (1 === i.nodeType && (i.disabled!==!0 || "click" !== a.type)) {
1438                        for (e = [], f = 0; h > f; f++)
1439                            d = b[f], c = d.selector + " ", void 0 === e[c] && (e[c] = d.needsContext ? m(c, this).index(i) >= 0 : m.find(c, this, null, [i]).length), e[c] && e.push(d);
1440                            e.length && g.push({
1441                                elem: i,
1442                                handlers: e
1443                            })
1444                    }
1445            return h < b.length && g.push({
1446                elem: this,
1447                handlers: b.slice(h)
1448            }), g
1449        },
1450        fix: function(a) {
1451            if (a[m.expando])
1452                return a;
1453            var b, c, d, e = a.type, f = a, g = this.fixHooks[e];
1454            g || (this.fixHooks[e] = g = Z.test(e) ? this.mouseHooks : Y.test(e) ? this.keyHooks : {}), d = g.props ? this.props.concat(g.props) : this.props, a = new m.Event(f), b = d.length;
1455            while (b--)
1456                c = d[b], a[c] = f[c];
1457            return a.target || (a.target = f.srcElement || y), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey=!!a.metaKey, g.filter ? g.filter(a, f) : a
1458        },
1459        props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
1460        fixHooks: {},
1461        keyHooks: {
1462            props: "char charCode key keyCode".split(" "),
1463            filter: function(a, b) {
1464                return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a
1465            }
1466        },
1467        mouseHooks: {
1468            props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
1469            filter: function(a, b) {
1470                var c, d, e, f = b.button, g = b.fromElement;
1471                return null == a.pageX && null != b.clientX && (d = a.target.ownerDocument || y, e = d.documentElement, c = d.body, a.pageX = b.clientX + (e && e.scrollLeft || c && c.scrollLeft || 0) - (e && e.clientLeft || c && c.clientLeft || 0), a.pageY = b.clientY + (e && e.scrollTop || c && c.scrollTop || 0) - (e && e.clientTop || c && c.clientTop || 0)), !a.relatedTarget && g && (a.relatedTarget = g === a.target ? b.toElement : g), a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a
1472            }
1473        },
1474        special: {
1475            load: {
1476                noBubble: !0
1477            },
1478            focus: {
1479                trigger: function() {
1480                    if (this !== ca() && this.focus)
1481                        try {
1482                            return this.focus(), !1
1483                    } catch (a) {}
1484                },
1485                delegateType: "focusin"
1486            },
1487            blur: {
1488                trigger: function() {
1489                    return this === ca() && this.blur ? (this.blur(), !1) : void 0
1490                },
1491                delegateType: "focusout"
1492            },
1493            click: {
1494                trigger: function() {
1495                    return m.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0
1496                },
1497                _default: function(a) {
1498                    return m.nodeName(a.target, "a")
1499                }
1500            },
1501            beforeunload: {
1502                postDispatch: function(a) {
1503                    void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result)
1504                }
1505            }
1506        },
1507        simulate: function(a, b, c, d) {
1508            var e = m.extend(new m.Event, c, {
1509                type: a,
1510                isSimulated: !0,
1511                originalEvent: {}
1512            });
1513            d ? m.event.trigger(e, null, b) : m.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault()
1514        }
1515    }, m.removeEvent = y.removeEventListener ? function(a, b, c) {
1516        a.removeEventListener && a.removeEventListener(b, c, !1)
1517    } : function(a, b, c) {
1518        var d = "on" + b;
1519        a.detachEvent && (typeof a[d] === K && (a[d] = null), a.detachEvent(d, c))
1520    }, m.Event = function(a, b) {
1521        return this instanceof m.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue===!1 ? aa : ba) : this.type = a, b && m.extend(this, b), this.timeStamp = a && a.timeStamp || m.now(), void(this[m.expando]=!0)) : new m.Event(a, b)
1522    }, m.Event.prototype = {
1523        isDefaultPrevented: ba,
1524        isPropagationStopped: ba,
1525        isImmediatePropagationStopped: ba,
1526        preventDefault: function() {
1527            var a = this.originalEvent;
1528            this.isDefaultPrevented = aa, a && (a.preventDefault ? a.preventDefault() : a.returnValue=!1)
1529        },
1530        stopPropagation: function() {
1531            var a = this.originalEvent;
1532            this.isPropagationStopped = aa, a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble=!0)
1533        },
1534        stopImmediatePropagation: function() {
1535            var a = this.originalEvent;
1536            this.isImmediatePropagationStopped = aa, a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation()
1537        }
1538    }, m.each({
1539        mouseenter: "mouseover",
1540        mouseleave: "mouseout",
1541        pointerenter: "pointerover",
1542        pointerleave: "pointerout"
1543    }, function(a, b) {
1544        m.event.special[a] = {
1545            delegateType: b,
1546            bindType: b,
1547            handle: function(a) {
1548                var c, d = this, e = a.relatedTarget, f = a.handleObj;
1549                return (!e || e !== d&&!m.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c
1550            }
1551        }
1552    }), k.submitBubbles || (m.event.special.submit = {
1553        setup: function() {
1554            return m.nodeName(this, "form")?!1 : void m.event.add(this, "click._submit keypress._submit", function(a) {
1555                var b = a.target, c = m.nodeName(b, "input") || m.nodeName(b, "button") ? b.form: void 0;
1556                c&&!m._data(c, "submitBubbles") && (m.event.add(c, "submit._submit", function(a) {
1557                    a._submit_bubble=!0
1558                }), m._data(c, "submitBubbles", !0))
1559            })
1560        },
1561        postDispatch: function(a) {
1562            a._submit_bubble && (delete a._submit_bubble, this.parentNode&&!a.isTrigger && m.event.simulate("submit", this.parentNode, a, !0))
1563        },
1564        teardown: function() {
1565            return m.nodeName(this, "form")?!1 : void m.event.remove(this, "._submit")
1566        }
1567    }), k.changeBubbles || (m.event.special.change = {
1568        setup: function() {
1569            return X.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (m.event.add(this, "propertychange._change", function(a) {
1570                "checked" === a.originalEvent.propertyName && (this._just_changed=!0)
1571            }), m.event.add(this, "click._change", function(a) {
1572                this._just_changed&&!a.isTrigger && (this._just_changed=!1), m.event.simulate("change", this, a, !0)
1573            })), !1) : void m.event.add(this, "beforeactivate._change", function(a) {
1574                var b = a.target;
1575                X.test(b.nodeName)&&!m._data(b, "changeBubbles") && (m.event.add(b, "change._change", function(a) {
1576                    !this.parentNode || a.isSimulated || a.isTrigger || m.event.simulate("change", this.parentNode, a, !0)
1577                }), m._data(b, "changeBubbles", !0))
1578            })
1579        },
1580        handle: function(a) {
1581            var b = a.target;
1582            return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0
1583        },
1584        teardown: function() {
1585            return m.event.remove(this, "._change"), !X.test(this.nodeName)
1586        }
1587    }), k.focusinBubbles || m.each({
1588        focus: "focusin",
1589        blur: "focusout"
1590    }, function(a, b) {
1591        var c = function(a) {
1592            m.event.simulate(b, a.target, m.event.fix(a), !0)
1593        };
1594        m.event.special[b] = {
1595            setup: function() {
1596                var d = this.ownerDocument || this, e = m._data(d, b);
1597                e || d.addEventListener(a, c, !0), m._data(d, b, (e || 0) + 1)
1598            },
1599            teardown: function() {
1600                var d = this.ownerDocument || this, e = m._data(d, b) - 1;
1601                e ? m._data(d, b, e) : (d.removeEventListener(a, c, !0), m._removeData(d, b))
1602            }
1603        }
1604    }), m.fn.extend({
1605        on: function(a, b, c, d, e) {
1606            var f, g;
1607            if ("object" == typeof a) {
1608                "string" != typeof b && (c = c || b, b = void 0);
1609                for (f in a)
1610                    this.on(f, b, c, a[f], e);
1611                return this
1612            }
1613            if (null == c && null == d ? (d = b, c = b = void 0) : null == d && ("string" == typeof b ? (d = c, c = void 0) : (d = c, c = b, b = void 0)), d===!1)
1614                d = ba;
1615            else if (!d)
1616                return this;
1617            return 1 === e && (g = d, d = function(a) {
1618                return m().off(a), g.apply(this, arguments)
1619            }, d.guid = g.guid || (g.guid = m.guid++)), this.each(function() {
1620                m.event.add(this, a, d, c, b)
1621            })
1622        },
1623        one: function(a, b, c, d) {
1624            return this.on(a, b, c, d, 1)
1625        },
1626        off: function(a, b, c) {
1627            var d, e;
1628            if (a && a.preventDefault && a.handleObj)
1629                return d = a.handleObj, m(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this;
1630            if ("object" == typeof a) {
1631                for (e in a)
1632                    this.off(e, b, a[e]);
1633                return this
1634            }
1635            return (b===!1 || "function" == typeof b) && (c = b, b = void 0), c===!1 && (c = ba), this.each(function() {
1636                m.event.remove(this, a, c, b)
1637            })
1638        },
1639        trigger: function(a, b) {
1640            return this.each(function() {
1641                m.event.trigger(a, b, this)
1642            })
1643        },
1644        triggerHandler: function(a, b) {
1645            var c = this[0];
1646            return c ? m.event.trigger(a, b, c, !0) : void 0
1647        }
1648    });
1649    function da(a) {
1650        var b = ea.split("|"), c = a.createDocumentFragment();
1651        if (c.createElement)
1652            while (b.length)
1653                c.createElement(b.pop());
1654        return c
1655    }
1656    var ea = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", fa = / jQuery\d+="(?:null|\d+)"/g, ga = new RegExp("<(?:" + ea + ")[\\s/>]", "i"), ha = /^\s+/, ia = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, ja = /<([\w:]+)/, ka = /<tbody/i, la = /<|&#?\w+;/, ma = /<(?:script|style|link)/i, na = /checked\s*(?:[^=]|=\s*.checked.)/i, oa = /^$|\/(?:java|ecma)script/i, pa = /^true\/(.*)/, qa = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, ra = {
1657        option: [1, "<select multiple='multiple'>", "</select>"],
1658        legend: [1, "<fieldset>", "</fieldset>"],
1659        area: [1, "<map>", "</map>"],
1660        param: [1, "<object>", "</object>"],
1661        thead: [1, "<table>", "</table>"],
1662        tr: [2, "<table><tbody>", "</tbody></table>"],
1663        col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
1664        td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
1665        _default: k.htmlSerialize ? [0, "", ""]: [1, "X<div>", "</div>"]
1666    }, sa = da(y), ta = sa.appendChild(y.createElement("div"));
1667    ra.optgroup = ra.option, ra.tbody = ra.tfoot = ra.colgroup = ra.caption = ra.thead, ra.th = ra.td;
1668    function ua(a, b) {
1669        var c, d, e = 0, f = typeof a.getElementsByTagName !== K ? a.getElementsByTagName(b || "*"): typeof a.querySelectorAll !== K ? a.querySelectorAll(b || "*"): void 0;
1670        if (!f)
1671            for (f = [], c = a.childNodes || a; null != (d = c[e]); e++)
1672                !b || m.nodeName(d, b) ? f.push(d) : m.merge(f, ua(d, b));
1673        return void 0 === b || b && m.nodeName(a, b) ? m.merge([a], f) : f
1674    }
1675    function va(a) {
1676        W.test(a.type) && (a.defaultChecked = a.checked)
1677    }
1678    function wa(a, b) {
1679        return m.nodeName(a, "table") && m.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
1680    }
1681    function xa(a) {
1682        return a.type = (null !== m.find.attr(a, "type")) + "/" + a.type, a
1683    }
1684    function ya(a) {
1685        var b = pa.exec(a.type);
1686        return b ? a.type = b[1] : a.removeAttribute("type"), a
1687    }
1688    function za(a, b) {
1689        for (var c, d = 0; null != (c = a[d]); d++)
1690            m._data(c, "globalEval", !b || m._data(b[d], "globalEval"))
1691    }
1692    function Aa(a, b) {
1693        if (1 === b.nodeType && m.hasData(a)) {
1694            var c, d, e, f = m._data(a), g = m._data(b, f), h = f.events;
1695            if (h) {
1696                delete g.handle, g.events = {};
1697                for (c in h)
1698                    for (d = 0, e = h[c].length; e > d; d++)
1699                        m.event.add(b, c, h[c][d])
1700                    }
1701            g.data && (g.data = m.extend({}, g.data))
1702        }
1703    }
1704    function Ba(a, b) {
1705        var c, d, e;
1706        if (1 === b.nodeType) {
1707            if (c = b.nodeName.toLowerCase(), !k.noCloneEvent && b[m.expando]) {
1708                e = m._data(b);
1709                for (d in e.events)
1710                    m.removeEvent(b, d, e.handle);
1711                b.removeAttribute(m.expando)
1712            }
1713            "script" === c && b.text !== a.text ? (xa(b).text = a.text, ya(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), k.html5Clone && a.innerHTML&&!m.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && W.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue)
1714        }
1715    }
1716    m.extend({
1717        clone: function(a, b, c) {
1718            var d, e, f, g, h, i = m.contains(a.ownerDocument, a);
1719            if (k.html5Clone || m.isXMLDoc(a) ||!ga.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (ta.innerHTML = a.outerHTML, ta.removeChild(f = ta.firstChild)), !(k.noCloneEvent && k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || m.isXMLDoc(a)))
1720                for (d = ua(f), h = ua(a), g = 0; null != (e = h[g]); ++g)
1721                    d[g] && Ba(e, d[g]);
1722            if (b)
1723                if (c)
1724                    for (h = h || ua(a), d = d || ua(f), g = 0; null != (e = h[g]); g++)
1725                        Aa(e, d[g]);
1726                else 
1727                    Aa(a, f);
1728            return d = ua(f, "script"), d.length > 0 && za(d, !i && ua(a, "script")), d = h = e = null, f
1729        },
1730        buildFragment: function(a, b, c, d) {
1731            for (var e, f, g, h, i, j, l, n = a.length, o = da(b), p = [], q = 0; n > q; q++)
1732                if (f = a[q], f || 0 === f)
1733                    if ("object" === m.type(f))
1734                        m.merge(p, f.nodeType ? [f] : f);
1735                    else if (la.test(f)) {
1736                        h = h || o.appendChild(b.createElement("div")), i = (ja.exec(f) || ["", ""])[1].toLowerCase(), l = ra[i] || ra._default, h.innerHTML = l[1] + f.replace(ia, "<$1></$2>") + l[2], e = l[0];
1737                        while (e--)
1738                            h = h.lastChild;
1739                            if (!k.leadingWhitespace && ha.test(f) && p.push(b.createTextNode(ha.exec(f)[0])), !k.tbody) {
1740                                f = "table" !== i || ka.test(f) ? "<table>" !== l[1] || ka.test(f) ? 0 : h : h.firstChild, e = f && f.childNodes.length;
1741                                while (e--)
1742                                    m.nodeName(j = f.childNodes[e], "tbody")&&!j.childNodes.length && f.removeChild(j)
1743                                }
1744                                m.merge(p, h.childNodes), h.textContent = "";
1745                                while (h.firstChild)
1746                                    h.removeChild(h.firstChild);
1747                                    h = o.lastChild
1748                        } else 
1749                            p.push(b.createTextNode(f));
1750            h && o.removeChild(h), k.appendChecked || m.grep(ua(p, "input"), va), q = 0;
1751            while (f = p[q++])
1752                if ((!d||-1 === m.inArray(f, d)) && (g = m.contains(f.ownerDocument, f), h = ua(o.appendChild(f), "script"), g && za(h), c)) {
1753                    e = 0;
1754                    while (f = h[e++])
1755                        oa.test(f.type || "") && c.push(f)
1756                }
1757            return h = null, o
1758        },
1759        cleanData: function(a, b) {
1760            for (var d, e, f, g, h = 0, i = m.expando, j = m.cache, l = k.deleteExpando, n = m.event.special; null != (d = a[h]); h++)
1761                if ((b || m.acceptData(d)) && (f = d[i], g = f && j[f])) {
1762                    if (g.events)
1763                        for (e in g.events)
1764                            n[e] ? m.event.remove(d, e) : m.removeEvent(d, e, g.handle);
1765                            j[f] && (delete j[f], l ? delete d[i] : typeof d.removeAttribute !== K ? d.removeAttribute(i) : d[i] = null, c.push(f))
1766                }
1767                }
1768    }), m.fn.extend({
1769        text: function(a) {
1770            return V(this, function(a) {
1771                return void 0 === a ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || y).createTextNode(a))
1772            }, null, a, arguments.length)
1773        },
1774        append: function() {
1775            return this.domManip(arguments, function(a) {
1776                if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
1777                    var b = wa(this, a);
1778                    b.appendChild(a)
1779                }
1780            })
1781        },
1782        prepend: function() {
1783            return this.domManip(arguments, function(a) {
1784                if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
1785                    var b = wa(this, a);
1786                    b.insertBefore(a, b.firstChild)
1787                }
1788            })
1789        },
1790        before: function() {
1791            return this.domManip(arguments, function(a) {
1792                this.parentNode && this.parentNode.insertBefore(a, this)
1793            })
1794        },
1795        after: function() {
1796            return this.domManip(arguments, function(a) {
1797                this.parentNode && this.parentNode.insertBefore(a, this.nextSibling)
1798            })
1799        },
1800        remove: function(a, b) {
1801            for (var c, d = a ? m.filter(a, this) : this, e = 0; null != (c = d[e]); e++)
1802                b || 1 !== c.nodeType || m.cleanData(ua(c)), c.parentNode && (b && m.contains(c.ownerDocument, c) && za(ua(c, "script")), c.parentNode.removeChild(c));
1803            return this
1804        },
1805        empty: function() {
1806            for (var a, b = 0; null != (a = this[b]); b++) {
1807                1 === a.nodeType && m.cleanData(ua(a, !1));
1808                while (a.firstChild)
1809                    a.removeChild(a.firstChild);
1810                a.options && m.nodeName(a, "select") && (a.options.length = 0)
1811            }
1812            return this
1813        },
1814        clone: function(a, b) {
1815            return a = null == a?!1 : a, b = null == b ? a : b, this.map(function() {
1816                return m.clone(this, a, b)
1817            })
1818        },
1819        html: function(a) {
1820            return V(this, function(a) {
1821                var b = this[0] || {}, c = 0, d = this.length;
1822                if (void 0 === a)
1823                    return 1 === b.nodeType ? b.innerHTML.replace(fa, "") : void 0;
1824                if (!("string" != typeof a || ma.test(a) ||!k.htmlSerialize && ga.test(a) ||!k.leadingWhitespace && ha.test(a) || ra[(ja.exec(a) || ["", ""])[1].toLowerCase()])) {
1825                    a = a.replace(ia, "<$1></$2>");
1826                    try {
1827                        for (; d > c; c++)
1828                            b = this[c] || {}, 1 === b.nodeType && (m.cleanData(ua(b, !1)), b.innerHTML = a);
1829                        b = 0
1830                    } catch (e) {}
1831                }
1832                b && this.empty().append(a)
1833            }, null, a, arguments.length)
1834        },
1835        replaceWith: function() {
1836            var a = arguments[0];
1837            return this.domManip(arguments, function(b) {
1838                a = this.parentNode, m.cleanData(ua(this)), a && a.replaceChild(b, this)
1839            }), a && (a.length || a.nodeType) ? this : this.remove()
1840        },
1841        detach: function(a) {
1842            return this.remove(a, !0)
1843        },
1844        domManip: function(a, b) {
1845            a = e.apply([], a);
1846            var c, d, f, g, h, i, j = 0, l = this.length, n = this, o = l - 1, p = a[0], q = m.isFunction(p);
1847            if (q || l > 1 && "string" == typeof p&&!k.checkClone && na.test(p))
1848                return this.each(function(c) {
1849                    var d = n.eq(c);
1850                    q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b)
1851                });
1852            if (l && (i = m.buildFragment(a, this[0].ownerDocument, !1, this), c = i.firstChild, 1 === i.childNodes.length && (i = c), c)) {
1853                for (g = m.map(ua(i, "script"), xa), f = g.length; l > j; j++)
1854                    d = i, j !== o && (d = m.clone(d, !0, !0), f && m.merge(g, ua(d, "script"))), b.call(this[j], d, j);
1855                if (f)
1856                    for (h = g[g.length - 1].ownerDocument, m.map(g, ya), j = 0; f > j; j++)
1857                        d = g[j], oa.test(d.type || "")&&!m._data(d, "globalEval") && m.contains(h, d) && (d.src ? m._evalUrl && m._evalUrl(d.src) : m.globalEval((d.text || d.textContent || d.innerHTML || "").replace(qa, "")));
1858                i = c = null
1859            }
1860            return this
1861        }
1862    }), m.each({
1863        appendTo: "append",
1864        prependTo: "prepend",
1865        insertBefore: "before",
1866        insertAfter: "after",
1867        replaceAll: "replaceWith"
1868    }, function(a, b) {
1869        m.fn[a] = function(a) {
1870            for (var c, d = 0, e = [], g = m(a), h = g.length - 1; h >= d; d++)
1871                c = d === h ? this : this.clone(!0), m(g[d])[b](c), f.apply(e, c.get());
1872            return this.pushStack(e)
1873        }
1874    });
1875    var Ca, Da = {};
1876    function Ea(b, c) {
1877        var d, e = m(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display: m.css(e[0], "display");
1878        return e.detach(), f
1879    }
1880    function Fa(a) {
1881        var b = y, c = Da[a];
1882        return c || (c = Ea(a, b), "none" !== c && c || (Ca = (Ca || m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = (Ca[0].contentWindow || Ca[0].contentDocument).document, b.write(), b.close(), c = Ea(a, b), Ca.detach()), Da[a] = c), c
1883    }
1884    !function() {
1885        var a;
1886        k.shrinkWrapBlocks = function() {
1887            if (null != a)
1888                return a;
1889            a=!1;
1890            var b, c, d;
1891            return c = y.getElementsByTagName("body")[0], c && c.style ? (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(y.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(d), a) : void 0
1892        }
1893    }();
1894    var Ga = /^margin/, Ha = new RegExp("^(" + S + ")(?!px)[a-z%]+$", "i"), Ia, Ja, Ka = /^(top|right|bottom|left)$/;
1895    a.getComputedStyle ? (Ia = function(b) {
1896        return b.ownerDocument.defaultView.opener ? b.ownerDocument.defaultView.getComputedStyle(b, null) : a.getComputedStyle(b, null)
1897    }, Ja = function(a, b, c) {
1898        var d, e, f, g, h = a.style;
1899        return c = c || Ia(a), g = c ? c.getPropertyValue(b) || c[b] : void 0, c && ("" !== g || m.contains(a.ownerDocument, a) || (g = m.style(a, b)), Ha.test(g) && Ga.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 === g ? g : g + ""
1900    }) : y.documentElement.currentStyle && (Ia = function(a) {
1901        return a.currentStyle
1902    }, Ja = function(a, b, c) {
1903        var d, e, f, g, h = a.style;
1904        return c = c || Ia(a), g = c ? c[b] : void 0, null == g && h && h[b] && (g = h[b]), Ha.test(g)&&!Ka.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)), void 0 === g ? g : g + "" || "auto"
1905    });
1906    function La(a, b) {
1907        return {
1908            get: function() {
1909                var c = a();
1910                if (null != c)
1911                    return c ? void delete this.get : (this.get = b).apply(this, arguments)
1912            }
1913        }
1914    }
1915    !function() {
1916        var b, c, d, e, f, g, h;
1917        if (b = y.createElement("div"), b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = d && d.style) {
1918            c.cssText = "float:left;opacity:.5", k.opacity = "0.5" === c.opacity, k.cssFloat=!!c.cssFloat, b.style.backgroundClip = "content-box", b.cloneNode(!0).style.backgroundClip = "", k.clearCloneStyle = "content-box" === b.style.backgroundClip, k.boxSizing = "" === c.boxSizing || "" === c.MozBoxSizing || "" === c.WebkitBoxSizing, m.extend(k, {
1919                reliableHiddenOffsets: function() {
1920                    return null == g && i(), g
1921                },
1922                boxSizingReliable: function() {
1923                    return null == f && i(), f
1924                },
1925                pixelPosition: function() {
1926                    return null == e && i(), e
1927                },
1928                reliableMarginRight: function() {
1929                    return null == h && i(), h
1930                }
1931            });
1932            function i() {
1933                var b, c, d, i;
1934                c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), b.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", e = f=!1, h=!0, a.getComputedStyle && (e = "1%" !== (a.getComputedStyle(b, null) || {}).top, f = "4px" === (a.getComputedStyle(b, null) || {
1935                    width: "4px"
1936                }).width, i = b.appendChild(y.createElement("div")), i.style.cssText = b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", i.style.marginRight = i.style.width = "0", b.style.width = "1px", h=!parseFloat((a.getComputedStyle(i, null) || {}).marginRight), b.removeChild(i)), b.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", i = b.getElementsByTagName("td"), i[0].style.cssText = "margin:0;border:0;padding:0;display:none", g = 0 === i[0].offsetHeight, g && (i[0].style.display = "", i[1].style.display = "none", g = 0 === i[0].offsetHeight), c.removeChild(d))
1937            }
1938        }
1939    }(), m.swap = function(a, b, c, d) {
1940        var e, f, g = {};
1941        for (f in b)
1942            g[f] = a.style[f], a.style[f] = b[f];
1943        e = c.apply(a, d || []);
1944        for (f in b)
1945            a.style[f] = g[f];
1946        return e
1947    };
1948    var Ma = /alpha\([^)]*\)/i, Na = /opacity\s*=\s*([^)]*)/, Oa = /^(none|table(?!-c[ea]).+)/, Pa = new RegExp("^(" + S + ")(.*)$", "i"), Qa = new RegExp("^([+-])=(" + S + ")", "i"), Ra = {
1949        position: "absolute",
1950        visibility: "hidden",
1951        display: "block"
1952    }, Sa = {
1953        letterSpacing: "0",
1954        fontWeight: "400"
1955    }, Ta = ["Webkit", "O", "Moz", "ms"];
1956    function Ua(a, b) {
1957        if (b in a)
1958            return b;
1959        var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = Ta.length;
1960        while (e--)
1961            if (b = Ta[e] + c, b in a)
1962                return b;
1963        return d
1964    }
1965    function Va(a, b) {
1966        for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)
1967            d = a[g], d.style && (f[g] = m._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && U(d) && (f[g] = m._data(d, "olddisplay", Fa(d.nodeName)))) : (e = U(d), (c && "none" !== c ||!e) && m._data(d, "olddisplay", e ? c : m.css(d, "display"))));
1968        for (g = 0; h > g; g++)
1969            d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none"));
1970        return a
1971    }
1972    function Wa(a, b, c) {
1973        var d = Pa.exec(b);
1974        return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
1975    }
1976    function Xa(a, b, c, d, e) {
1977        for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2)
1978            "margin" === c && (g += m.css(a, c + T[f], !0, e)), d ? ("content" === c && (g -= m.css(a, "padding" + T[f], !0, e)), "margin" !== c && (g -= m.css(a, "border" + T[f] + "Width", !0, e))) : (g += m.css(a, "padding" + T[f], !0, e), "padding" !== c && (g += m.css(a, "border" + T[f] + "Width", !0, e)));
1979        return g
1980    }
1981    function Ya(a, b, c) {
1982        var d=!0, e = "width" === b ? a.offsetWidth : a.offsetHeight, f = Ia(a), g = k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, f);
1983        if (0 >= e || null == e) {
1984            if (e = Ja(a, b, f), (0 > e || null == e) && (e = a.style[b]), Ha.test(e))
1985                return e;
1986            d = g && (k.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0
1987        }
1988        return e + Xa(a, b, c || (g ? "border" : "content"), d, f) + "px"
1989    }
1990    m.extend({
1991        cssHooks: {
1992            opacity: {
1993                get: function(a, b) {
1994                    if (b) {
1995                        var c = Ja(a, "opacity");
1996                        return "" === c ? "1" : c
1997                    }
1998                }
1999            }
2000        },
2001        cssNumber: {
2002            columnCount: !0,
2003            fillOpacity: !0,
2004            flexGrow: !0,
2005            flexShrink: !0,
2006            fontWeight: !0,
2007            lineHeight: !0,
2008            opacity: !0,
2009            order: !0,
2010            orphans: !0,
2011            widows: !0,
2012            zIndex: !0,
2013            zoom: !0
2014        },
2015        cssProps: {
2016            "float": k.cssFloat ? "cssFloat": "styleFloat"
2017        },
2018        style: function(a, b, c, d) {
2019            if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
2020                var e, f, g, h = m.camelCase(b), i = a.style;
2021                if (b = m.cssProps[h] || (m.cssProps[h] = Ua(i, h)), g = m.cssHooks[b] || m.cssHooks[h], void 0 === c)
2022                    return g && "get"in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b];
2023                if (f = typeof c, "string" === f && (e = Qa.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b)), f = "number"), null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set"in g && void 0 === (c = g.set(a, c, d)))
2024                    ))try {
2025                    i[b] = c
2026                } catch (j) {}
2027            }
2028        },
2029        css: function(a, b, c, d) {
2030            var e, f, g, h = m.camelCase(b);
2031            return b = m.cssProps[h] || (m.cssProps[h] = Ua(a.style, h)), g = m.cssHooks[b] || m.cssHooks[h], g && "get"in g && (f = g.get(a, !0, c)), void 0 === f && (f = Ja(a, b, d)), "normal" === f && b in Sa && (f = Sa[b]), "" === c || c ? (e = parseFloat(f), c===!0 || m.isNumeric(e) ? e || 0 : f) : f
2032        }
2033    }), m.each(["height", "width"], function(a, b) {
2034        m.cssHooks[b] = {
2035            get: function(a, c, d) {
2036                return c ? Oa.test(m.css(a, "display")) && 0 === a.offsetWidth ? m.swap(a, Ra, function() {
2037                    return Ya(a, b, d)
2038                }) : Ya(a, b, d) : void 0
2039            },
2040            set: function(a, c, d) {
2041                var e = d && Ia(a);
2042                return Wa(a, c, d ? Xa(a, b, d, k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, e), e) : 0)
2043            }
2044        }
2045    }), k.opacity || (m.cssHooks.opacity = {
2046        get: function(a, b) {
2047            return Na.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
2048        },
2049        set: function(a, b) {
2050            var c = a.style, d = a.currentStyle, e = m.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")": "", f = d && d.filter || c.filter || "";
2051            c.zoom = 1, (b >= 1 || "" === b) && "" === m.trim(f.replace(Ma, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d&&!d.filter) || (c.filter = Ma.test(f) ? f.replace(Ma, e) : f + " " + e)
2052        }
2053    }), m.cssHooks.marginRight = La(k.reliableMarginRight, function(a, b) {
2054        return b ? m.swap(a, {
2055            display: "inline-block"
2056        }, Ja, [a, "marginRight"]) : void 0
2057    }), m.each({
2058        margin: "",
2059        padding: "",
2060        border: "Width"
2061    }, function(a, b) {
2062        m.cssHooks[a + b] = {
2063            expand: function(c) {
2064                for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++)
2065                    e[a + T[d] + b] = f[d] || f[d - 2] || f[0];
2066                return e
2067            }
2068        }, Ga.test(a) || (m.cssHooks[a + b].set = Wa)
2069    }), m.fn.extend({
2070        css: function(a, b) {
2071            return V(this, function(a, b, c) {
2072                var d, e, f = {}, g = 0;
2073                if (m.isArray(b)) {
2074                    for (d = Ia(a), e = b.length; e > g; g++)
2075                        f[b[g]] = m.css(a, b[g], !1, d);
2076                    return f
2077                }
2078                return void 0 !== c ? m.style(a, b, c) : m.css(a, b)
2079            }, a, b, arguments.length > 1)
2080        },
2081        show: function() {
2082            return Va(this, !0)
2083        },
2084        hide: function() {
2085            return Va(this)
2086        },
2087        toggle: function(a) {
2088            return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function() {
2089                U(this) ? m(this).show() : m(this).hide()
2090            })
2091        }
2092    });
2093    function Za(a, b, c, d, e) {
2094        return new Za.prototype.init(a, b, c, d, e)
2095    }
2096    m.Tween = Za, Za.prototype = {
2097        constructor: Za,
2098        init: function(a, b, c, d, e, f) {
2099            this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (m.cssNumber[c] ? "" : "px")
2100        },
2101        cur: function() {
2102            var a = Za.propHooks[this.prop];
2103            return a && a.get ? a.get(this) : Za.propHooks._default.get(this)
2104        },
2105        run: function(a) {
2106            var b, c = Za.propHooks[this.prop];
2107            return this.options.duration ? this.pos = b = m.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Za.propHooks._default.set(this), this
2108        }
2109    }, Za.prototype.init.prototype = Za.prototype, Za.propHooks = {
2110        _default: {
2111            get: function(a) {
2112                var b;
2113                return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = m.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop]
2114            },
2115            set: function(a) {
2116                m.fx.step[a.prop] ? m.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[m.cssProps[a.prop]] || m.cssHooks[a.prop]) ? m.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now
2117            }
2118        }
2119    }, Za.propHooks.scrollTop = Za.propHooks.scrollLeft = {
2120        set: function(a) {
2121            a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
2122        }
2123    }, m.easing = {
2124        linear: function(a) {
2125            return a
2126        },
2127        swing: function(a) {
2128            return .5 - Math.cos(a * Math.PI) / 2
2129        }
2130    }, m.fx = Za.prototype.init, m.fx.step = {};
2131    var $a, _a, ab = /^(?:toggle|show|hide)$/, bb = new RegExp("^(?:([+-])=|)(" + S + ")([a-z%]*)$", "i"), cb = /queueHooks$/, db = [ib], eb = {
2132        "*": [function(a, b) {
2133            var c = this.createTween(a, b), d = c.cur(), e = bb.exec(b), f = e && e[3] || (m.cssNumber[a] ? "" : "px"), g = (m.cssNumber[a] || "px" !== f&&+d) && bb.exec(m.css(c.elem, a)), h = 1, i = 20;
2134            if (g && g[3] !== f) {
2135                f = f || g[3], e = e || [], g =+ d || 1;
2136                do 
2137                    h = h || ".5", g/=h, m.style(c.elem, a, g + f);
2138                while (h !== (h = c.cur() / d) && 1 !== h&&--i)
2139                }
2140            return e && (g = c.start =+ g||+d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : + e[2]), c
2141        }
2142        ]
2143    };
2144    function fb() {
2145        return setTimeout(function() {
2146            $a = void 0
2147        }), $a = m.now()
2148    }
2149    function gb(a, b) {
2150        var c, d = {
2151            height: a
2152        }, e = 0;
2153        for (b = b ? 1: 0;
2154        4 > e;
2155        e += 2 - b)c = T[e],
2156        d["margin" + c] = d["padding" + c] = a;
2157        return b && (d.opacity = d.width = a),
2158        d
2159    }
2160    function hb(a, b, c) {
2161        for (var d, e = (eb[b] || []).concat(eb["*"]), f = 0, g = e.length; g > f; f++)
2162            if (d = e[f].call(c, b, a))
2163                return d
2164    }
2165    function ib(a, b, c) {
2166        var d, e, f, g, h, i, j, l, n = this, o = {}, p = a.style, q = a.nodeType && U(a), r = m._data(a, "fxshow");
2167        c.queue || (h = m._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function() {
2168            h.unqueued || i()
2169        }), h.unqueued++, n.always(function() {
2170            n.always(function() {
2171                h.unqueued--, m.queue(a, "fx").length || h.empty.fire()
2172            })
2173        })), 1 === a.nodeType && ("height"in b || "width"in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = m.css(a, "display"), l = "none" === j ? m._data(a, "olddisplay") || Fa(a.nodeName) : j, "inline" === l && "none" === m.css(a, "float") && (k.inlineBlockNeedsLayout && "inline" !== Fa(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")), c.overflow && (p.overflow = "hidden", k.shrinkWrapBlocks() || n.always(function() {
2174            p.overflow = c.overflow[0], p.overflowX = c.overflow[1], p.overflowY = c.overflow[2]
2175        }));
2176        for (d in b)
2177            if (e = b[d], ab.exec(e)) {
2178                if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) {
2179                    if ("show" !== e ||!r || void 0 === r[d])
2180                        continue;
2181                        q=!0
2182                }
2183                o[d] = r && r[d] || m.style(a, d)
2184            } else 
2185                j = void 0;
2186        if (m.isEmptyObject(o))
2187            "inline" === ("none" === j ? Fa(a.nodeName) : j) && (p.display = j);
2188        else {
2189            r ? "hidden"in r && (q = r.hidden) : r = m._data(a, "fxshow", {}), f && (r.hidden=!q), q ? m(a).show() : n.done(function() {
vendor: 6,297 bytes, lines 2190-2335
2190                m(a).hide()
2191            }), n.done(function() {
2192                var b;
2193                m._removeData(a, "fxshow");
2194                for (b in o)
2195                    m.style(a, b, o[b])
2196            });
2197            for (d in o)
2198                g = hb(q ? r[d] : 0, d, n), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0))
2199        }
2200    }
2201    function jb(a, b) {
2202        var c, d, e, f, g;
2203        for (c in a)
2204            if (d = m.camelCase(c), e = b[d], f = a[c], m.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = m.cssHooks[d], g && "expand"in g) {
2205                f = g.expand(f), delete a[d];
2206                for (c in f)
2207                    c in a || (a[c] = f[c], b[c] = e)
2208            } else 
2209                b[d] = e
2210    }
2211    function kb(a, b, c) {
2212        var d, e, f = 0, g = db.length, h = m.Deferred().always(function() {
2213            delete i.elem
2214        }), i = function() {
2215            if (e)
2216                return !1;
2217            for (var b = $a || fb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)
2218                j.tweens[g].run(f);
2219            return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1)
2220        }, j = h.promise({
2221            elem: a,
2222            props: m.extend({}, b),
2223            opts: m.extend(!0, {
2224                specialEasing: {}
2225            }, c),
2226            originalProperties: b,
2227            originalOptions: c,
2228            startTime: $a || fb(),
2229            duration: c.duration,
2230            tweens: [],
2231            createTween: function(b, c) {
2232                var d = m.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);
2233                return j.tweens.push(d), d
2234            },
2235            stop: function(b) {
2236                var c = 0, d = b ? j.tweens.length: 0;
2237                if (e)
2238                    return this;
2239                for (e=!0; d > c; c++)
2240                    j.tweens[c].run(1);
2241                return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this
2242            }
2243        }), k = j.props;
2244        for (jb(k, j.opts.specialEasing);
2245        g > f;
2246        f++)if (d = db[f].call(j, a, k, j.opts))
2247            return d;
2248        return m.map(k, hb, j), m.isFunction(j.opts.start) && j.opts.start.call(a, j), m.fx.timer(m.extend(i, {
2249            elem: a,
2250            anim: j,
2251            queue: j.opts.queue
2252        })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always)
2253    }
2254    m.Animation = m.extend(kb, {
2255        tweener: function(a, b) {
2256            m.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
2257            for (var c, d = 0, e = a.length; e > d; d++)
2258                c = a[d], eb[c] = eb[c] || [], eb[c].unshift(b)
2259        },
2260        prefilter: function(a, b) {
2261            b ? db.unshift(a) : db.push(a)
2262        }
2263    }), m.speed = function(a, b, c) {
2264        var d = a && "object" == typeof a ? m.extend({}, a): {
2265            complete: c ||!c && b || m.isFunction(a) && a,
2266            duration: a,
2267            easing: c && b || b&&!m.isFunction(b) && b
2268        };
2269        return d.duration = m.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in m.fx.speeds ? m.fx.speeds[d.duration] : m.fx.speeds._default, (null == d.queue || d.queue===!0) && (d.queue = "fx"), d.old = d.complete, d.complete = function() {
2270            m.isFunction(d.old) && d.old.call(this), d.queue && m.dequeue(this, d.queue)
2271        }, d
2272    }, m.fn.extend({
2273        fadeTo: function(a, b, c, d) {
2274            return this.filter(U).css("opacity", 0).show().end().animate({
2275                opacity: b
2276            }, a, c, d)
2277        },
2278        animate: function(a, b, c, d) {
2279            var e = m.isEmptyObject(a), f = m.speed(b, c, d), g = function() {
2280                var b = kb(this, m.extend({}, a), f);
2281                (e || m._data(this, "finish")) && b.stop(!0)
2282            };
2283            return g.finish = g, e || f.queue===!1 ? this.each(g) : this.queue(f.queue, g)
2284        },
2285        stop: function(a, b, c) {
2286            var d = function(a) {
2287                var b = a.stop;
2288                delete a.stop, b(c)
2289            };
2290            return "string" != typeof a && (c = b, b = a, a = void 0), b && a!==!1 && this.queue(a || "fx", []), this.each(function() {
2291                var b=!0, e = null != a && a + "queueHooks", f = m.timers, g = m._data(this);
2292                if (e)
2293                    g[e] && g[e].stop && d(g[e]);
2294                else 
2295                    for (e in g)
2296                        g[e] && g[e].stop && cb.test(e) && d(g[e]);
2297                for (e = f.length; e--;)
2298                    f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b=!1, f.splice(e, 1));
2299                (b ||!c) && m.dequeue(this, a)
2300            })
2301        },
2302        finish: function(a) {
2303            return a!==!1 && (a = a || "fx"), this.each(function() {
2304                var b, c = m._data(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = m.timers, g = d ? d.length: 0;
2305                for (c.finish=!0, m.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;)
2306                    f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1));
2307                for (b = 0; g > b; b++)
2308                    d[b] && d[b].finish && d[b].finish.call(this);
2309                delete c.finish
2310            })
2311        }
2312    }), m.each(["toggle", "show", "hide"], function(a, b) {
2313        var c = m.fn[b];
2314        m.fn[b] = function(a, d, e) {
2315            return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(gb(b, !0), a, d, e)
2316        }
2317    }), m.each({
2318        slideDown: gb("show"),
2319        slideUp: gb("hide"),
2320        slideToggle: gb("toggle"),
2321        fadeIn: {
2322            opacity: "show"
2323        },
2324        fadeOut: {
2325            opacity: "hide"
2326        },
2327        fadeToggle: {
2328            opacity: "toggle"
2329        }
2330    }, function(a, b) {
2331        m.fn[a] = function(a, c, d) {
2332            return this.animate(b, a, c, d)
2333        }
2334    }), m.timers = [], m.fx.tick = function() {
2335        var a, b = m.timers, c = 0;
vendor: 36,502 bytes, lines 2336-3100
2336        for ($a = m.now(); c < b.length; c++)
2337            a = b[c], a() || b[c] !== a || b.splice(c--, 1);
2338        b.length || m.fx.stop(), $a = void 0
2339    }, m.fx.timer = function(a) {
2340        m.timers.push(a), a() ? m.fx.start() : m.timers.pop()
2341    }, m.fx.interval = 13, m.fx.start = function() {
2342        _a || (_a = setInterval(m.fx.tick, m.fx.interval))
2343    }, m.fx.stop = function() {
2344        clearInterval(_a), _a = null
2345    }, m.fx.speeds = {
2346        slow: 600,
2347        fast: 200,
2348        _default: 400
2349    }, m.fn.delay = function(a, b) {
2350        return a = m.fx ? m.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function(b, c) {
2351            var d = setTimeout(b, a);
2352            c.stop = function() {
2353                clearTimeout(d)
2354            }
2355        })
2356    }, function() {
2357        var a, b, c, d, e;
2358        b = y.createElement("div"), b.setAttribute("className", "t"), b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = y.createElement("select"), e = c.appendChild(y.createElement("option")), a = b.getElementsByTagName("input")[0], d.style.cssText = "top:1px", k.getSetAttribute = "t" !== b.className, k.style = /top/.test(d.getAttribute("style")), k.hrefNormalized = "/a" === d.getAttribute("href"), k.checkOn=!!a.value, k.optSelected = e.selected, k.enctype=!!y.createElement("form").enctype, c.disabled=!0, k.optDisabled=!e.disabled, a = y.createElement("input"), a.setAttribute("value", ""), k.input = "" === a.getAttribute("value"), a.value = "t", a.setAttribute("type", "radio"), k.radioValue = "t" === a.value
2359    }();
2360    var lb = /\r/g;
2361    m.fn.extend({
2362        val: function(a) {
2363            var b, c, d, e = this[0];
2364            {
2365                if (arguments.length)
2366                    return d = m.isFunction(a), this.each(function(c) {
2367                        var e;
2368                        1 === this.nodeType && (e = d ? a.call(this, c, m(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function(a) {
2369                            return null == a ? "" : a + ""
2370                        })), b = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()], b && "set"in b && void 0 !== b.set(this, e, "value") || (this.value = e))
2371                    });
2372                if (e)
2373                    return b = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()], b && "get"in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(lb, "") : null == c ? "" : c)
2374            }
2375        }
2376    }), m.extend({
2377        valHooks: {
2378            option: {
2379                get: function(a) {
2380                    var b = m.find.attr(a, "value");
2381                    return null != b ? b : m.trim(m.text(a))
2382                }
2383            },
2384            select: {
2385                get: function(a) {
2386                    for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)
2387                        if (c = d[i], !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && m.nodeName(c.parentNode, "optgroup"))) {
2388                            if (b = m(c).val(), f)
2389                                return b;
2390                                g.push(b)
2391                        }
2392                    return g
2393                },
2394                set: function(a, b) {
2395                    var c, d, e = a.options, f = m.makeArray(b), g = e.length;
2396                    while (g--)
2397                        if (d = e[g], m.inArray(m.valHooks.option.get(d), f) >= 0)
2398                            try {
2399                                d.selected = c=!0
2400                    } catch (h) {
2401                        d.scrollHeight
2402                    } else 
2403                        d.selected=!1;
2404                    return c || (a.selectedIndex =- 1), e
2405                }
2406            }
2407        }
2408    }), m.each(["radio", "checkbox"], function() {
2409        m.valHooks[this] = {
2410            set: function(a, b) {
2411                return m.isArray(b) ? a.checked = m.inArray(m(a).val(), b) >= 0 : void 0
2412            }
2413        }, k.checkOn || (m.valHooks[this].get = function(a) {
2414            return null === a.getAttribute("value") ? "on" : a.value
2415        })
2416    });
2417    var mb, nb, ob = m.expr.attrHandle, pb = /^(?:checked|selected)$/i, qb = k.getSetAttribute, rb = k.input;
2418    m.fn.extend({
2419        attr: function(a, b) {
2420            return V(this, m.attr, a, b, arguments.length > 1)
2421        },
2422        removeAttr: function(a) {
2423            return this.each(function() {
2424                m.removeAttr(this, a)
2425            })
2426        }
2427    }), m.extend({
2428        attr: function(a, b, c) {
2429            var d, e, f = a.nodeType;
2430            if (a && 3 !== f && 8 !== f && 2 !== f)
2431                return typeof a.getAttribute === K ? m.prop(a, b, c) : (1 === f && m.isXMLDoc(a) || (b = b.toLowerCase(), d = m.attrHooks[b] || (m.expr.match.bool.test(b) ? nb : mb)), void 0 === c ? d && "get"in d && null !== (e = d.get(a, b)) ? e : (e = m.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && "set"in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""), c) : void m.removeAttr(a, b))
2432        },
2433        removeAttr: function(a, b) {
2434            var c, d, e = 0, f = b && b.match(E);
2435            if (f && 1 === a.nodeType)
2436                while (c = f[e++])
2437                    d = m.propFix[c] || c, m.expr.match.bool.test(c) ? rb && qb ||!pb.test(c) ? a[d]=!1 : a[m.camelCase("default-" + c)] = a[d]=!1 : m.attr(a, c, ""), a.removeAttribute(qb ? c : d)
2438        },
2439        attrHooks: {
2440            type: {
2441                set: function(a, b) {
2442                    if (!k.radioValue && "radio" === b && m.nodeName(a, "input")) {
2443                        var c = a.value;
2444                        return a.setAttribute("type", b), c && (a.value = c), b
2445                    }
2446                }
2447            }
2448        }
2449    }), nb = {
2450        set: function(a, b, c) {
2451            return b===!1 ? m.removeAttr(a, c) : rb && qb ||!pb.test(c) ? a.setAttribute(!qb && m.propFix[c] || c, c) : a[m.camelCase("default-" + c)] = a[c]=!0, c
2452        }
2453    }, m.each(m.expr.match.bool.source.match(/\w+/g), function(a, b) {
2454        var c = ob[b] || m.find.attr;
2455        ob[b] = rb && qb ||!pb.test(b) ? function(a, b, d) {
2456            var e, f;
2457            return d || (f = ob[b], ob[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, ob[b] = f), e
2458        } : function(a, b, c) {
2459            return c ? void 0 : a[m.camelCase("default-" + b)] ? b.toLowerCase() : null
2460        }
2461    }), rb && qb || (m.attrHooks.value = {
2462        set: function(a, b, c) {
2463            return m.nodeName(a, "input") ? void(a.defaultValue = b) : mb && mb.set(a, b, c)
2464        }
2465    }), qb || (mb = {
2466        set: function(a, b, c) {
2467            var d = a.getAttributeNode(c);
2468            return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)), d.value = b += "", "value" === c || b === a.getAttribute(c) ? b : void 0
2469        }
2470    }, ob.id = ob.name = ob.coords = function(a, b, c) {
2471        var d;
2472        return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null
2473    }, m.valHooks.button = {
2474        get: function(a, b) {
2475            var c = a.getAttributeNode(b);
2476            return c && c.specified ? c.value : void 0
2477        },
2478        set: mb.set
2479    }, m.attrHooks.contenteditable = {
2480        set: function(a, b, c) {
2481            mb.set(a, "" === b?!1 : b, c)
2482        }
2483    }, m.each(["width", "height"], function(a, b) {
2484        m.attrHooks[b] = {
2485            set: function(a, c) {
2486                return "" === c ? (a.setAttribute(b, "auto"), c) : void 0
2487            }
2488        }
2489    })), k.style || (m.attrHooks.style = {
2490        get: function(a) {
2491            return a.style.cssText || void 0
2492        },
2493        set: function(a, b) {
2494            return a.style.cssText = b + ""
2495        }
2496    });
2497    var sb = /^(?:input|select|textarea|button|object)$/i, tb = /^(?:a|area)$/i;
2498    m.fn.extend({
2499        prop: function(a, b) {
2500            return V(this, m.prop, a, b, arguments.length > 1)
2501        },
2502        removeProp: function(a) {
2503            return a = m.propFix[a] || a, this.each(function() {
2504                try {
2505                    this[a] = void 0, delete this[a]
2506                } catch (b) {}
2507            })
2508        }
2509    }), m.extend({
2510        propFix: {
2511            "for": "htmlFor",
2512            "class": "className"
2513        },
2514        prop: function(a, b, c) {
2515            var d, e, f, g = a.nodeType;
2516            if (a && 3 !== g && 8 !== g && 2 !== g)
2517                return f = 1 !== g ||!m.isXMLDoc(a), f && (b = m.propFix[b] || b, e = m.propHooks[b]), void 0 !== c ? e && "set"in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get"in e && null !== (d = e.get(a, b)) ? d : a[b]
2518        },
2519        propHooks: {
2520            tabIndex: {
2521                get: function(a) {
2522                    var b = m.find.attr(a, "tabindex");
2523                    return b ? parseInt(b, 10) : sb.test(a.nodeName) || tb.test(a.nodeName) && a.href ? 0 : - 1
2524                }
2525            }
2526        }
2527    }), k.hrefNormalized || m.each(["href", "src"], function(a, b) {
2528        m.propHooks[b] = {
2529            get: function(a) {
2530                return a.getAttribute(b, 4)
2531            }
2532        }
2533    }), k.optSelected || (m.propHooks.selected = {
2534        get: function(a) {
2535            var b = a.parentNode;
2536            return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
2537        }
2538    }), m.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
2539        m.propFix[this.toLowerCase()] = this
2540    }), k.enctype || (m.propFix.enctype = "encoding");
2541    var ub = /[\t\r\n\f]/g;
2542    m.fn.extend({
2543        addClass: function(a) {
2544            var b, c, d, e, f, g, h = 0, i = this.length, j = "string" == typeof a && a;
2545            if (m.isFunction(a))
2546                return this.each(function(b) {
2547                    m(this).addClass(a.call(this, b, this.className))
2548                });
2549            if (j)
2550                for (b = (a || "").match(E) || []; i > h; h++)
2551                    if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ub, " ") : " ")) {
2552                        f = 0;
2553                        while (e = b[f++])
2554                            d.indexOf(" " + e + " ") < 0 && (d += e + " ");
2555                            g = m.trim(d), c.className !== g && (c.className = g)
2556                    }
2557            return this
2558        },
2559        removeClass: function(a) {
2560            var b, c, d, e, f, g, h = 0, i = this.length, j = 0 === arguments.length || "string" == typeof a && a;
2561            if (m.isFunction(a))
2562                return this.each(function(b) {
2563                    m(this).removeClass(a.call(this, b, this.className))
2564                });
2565            if (j)
2566                for (b = (a || "").match(E) || []; i > h; h++)
2567                    if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ub, " ") : "")) {
2568                        f = 0;
2569                        while (e = b[f++])
2570                            while (d.indexOf(" " + e + " ") >= 0)
2571                                d = d.replace(" " + e + " ", " ");
2572                                g = a ? m.trim(d) : "", c.className !== g && (c.className = g)
2573                    }
2574            return this
2575        },
2576        toggleClass: function(a, b) {
2577            var c = typeof a;
2578            return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(m.isFunction(a) ? function(c) {
2579                m(this).toggleClass(a.call(this, c, this.className, b), b)
2580            } : function() {
2581                if ("string" === c) {
2582                    var b, d = 0, e = m(this), f = a.match(E) || [];
2583                    while (b = f[d++])
2584                        e.hasClass(b) ? e.removeClass(b) : e.addClass(b)
2585                } else (c === K || "boolean" === c) 
2586                    && (this.className && m._data(this, "__className__", this.className), this.className = this.className || a===!1 ? "" : m._data(this, "__className__") || "")
2587            })
2588        },
2589        hasClass: function(a) {
2590            for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++)
2591                if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(ub, " ").indexOf(b) >= 0)
2592                    return !0;
2593            return !1
2594        }
2595    }), m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(a, b) {
2596        m.fn[b] = function(a, c) {
2597            return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
2598        }
2599    }), m.fn.extend({
2600        hover: function(a, b) {
2601            return this.mouseenter(a).mouseleave(b || a)
2602        },
2603        bind: function(a, b, c) {
2604            return this.on(a, null, b, c)
2605        },
2606        unbind: function(a, b) {
2607            return this.off(a, null, b)
2608        },
2609        delegate: function(a, b, c, d) {
2610            return this.on(b, a, c, d)
2611        },
2612        undelegate: function(a, b, c) {
2613            return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
2614        }
2615    });
2616    var vb = m.now(), wb = /\?/, xb = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
2617    m.parseJSON = function(b) {
2618        if (a.JSON && a.JSON.parse)
2619            return a.JSON.parse(b + "");
2620        var c, d = null, e = m.trim(b + "");
2621        return e&&!m.trim(e.replace(xb, function(a, b, e, f) {
2622            return c && b && (d = 0), 0 === d ? a : (c = e || b, d+=!f-!e, "")
2623        })) ? Function("return " + e)() : m.error("Invalid JSON: " + b)
2624    }, m.parseXML = function(b) {
2625        var c, d;
2626        if (!b || "string" != typeof b)
2627            return null;
2628        try {
2629            a.DOMParser ? (d = new DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b))
2630        } catch (e) {
2631            c = void 0
2632        }
2633        return c && c.documentElement&&!c.getElementsByTagName("parsererror").length || m.error("Invalid XML: " + b), c
2634    };
2635    var yb, zb, Ab = /#.*$/, Bb = /([?&])_=[^&]*/, Cb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Db = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Eb = /^(?:GET|HEAD)$/, Fb = /^\/\//, Gb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Hb = {}, Ib = {}, Jb = "*/".concat("*");
2636    try {
2637        zb = location.href
2638    } catch (Kb) {
2639        zb = y.createElement("a"), zb.href = "", zb = zb.href
2640    }
2641    yb = Gb.exec(zb.toLowerCase()) || [];
2642    function Lb(a) {
2643        return function(b, c) {
2644            "string" != typeof b && (c = b, b = "*");
2645            var d, e = 0, f = b.toLowerCase().match(E) || [];
2646            if (m.isFunction(c))
2647                while (d = f[e++])
2648                    "+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c)
2649        }
2650    }
2651    function Mb(a, b, c, d) {
2652        var e = {}, f = a === Ib;
2653        function g(h) {
2654            var i;
2655            return e[h]=!0, m.each(a[h] || [], function(a, h) {
2656                var j = h(b, c, d);
2657                return "string" != typeof j || f || e[j] ? f?!(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1)
2658            }), i
2659        }
2660        return g(b.dataTypes[0]) ||!e["*"] && g("*")
2661    }
2662    function Nb(a, b) {
2663        var c, d, e = m.ajaxSettings.flatOptions || {};
2664        for (d in b)
2665            void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]);
2666        return c && m.extend(!0, a, c), a
2667    }
2668    function Ob(a, b, c) {
2669        var d, e, f, g, h = a.contents, i = a.dataTypes;
2670        while ("*" === i[0])
2671            i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type"));
2672        if (e)
2673            for (g in h)
2674                if (h[g] && h[g].test(e)) {
2675                    i.unshift(g);
2676                    break
2677                }
2678        if (i[0]in c)
2679            f = i[0];
2680        else {
2681            for (g in c) {
2682                if (!i[0] || a.converters[g + " " + i[0]]) {
2683                    f = g;
2684                    break
2685                }
2686                d || (d = g)
2687            }
2688            f = f || d
2689        }
2690        return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0
2691    }
2692    function Pb(a, b, c, d) {
2693        var e, f, g, h, i, j = {}, k = a.dataTypes.slice();
2694        if (k[1])
2695            for (g in a.converters)
2696                j[g.toLowerCase()] = a.converters[g];
2697        f = k.shift();
2698        while (f)
2699            if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift())
2700                if ("*" === f)
2701                    f = i;
2702                else if ("*" !== i && i !== f) {
2703                    if (g = j[i + " " + f] || j["* " + f], !g)
2704                        for (e in j)
2705                            if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
2706                                g===!0 ? g = j[e] : j[e]!==!0 && (f = h[0], k.unshift(h[1]));
2707                                break
2708                            }
2709                            if (g!==!0)
2710                                if (g && a["throws"])
2711                                    b = g(b);
2712                                else 
2713                                    try {
2714                                        b = g(b)
2715                                    } catch (l) {
2716                                        return {
2717                                            state: "parsererror",
2718                                            error: g ? l: "No conversion from " + i + " to " + f
2719                                        }
2720                                    }
2721                                }
2722        return {
2723            state: "success",
2724            data: b
2725        }
2726    }
2727    m.extend({
2728        active: 0,
2729        lastModified: {},
2730        etag: {},
2731        ajaxSettings: {
2732            url: zb,
2733            type: "GET",
2734            isLocal: Db.test(yb[1]),
2735            global: !0,
2736            processData: !0,
2737            async: !0,
2738            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
2739            accepts: {
2740                "*": Jb,
2741                text: "text/plain",
2742                html: "text/html",
2743                xml: "application/xml, text/xml",
2744                json: "application/json, text/javascript"
2745            },
2746            contents: {
2747                xml: /xml/,
2748                html: /html/,
2749                json: /json/
2750            },
2751            responseFields: {
2752                xml: "responseXML",
2753                text: "responseText",
2754                json: "responseJSON"
2755            },
2756            converters: {
2757                "* text": String,
2758                "text html": !0,
2759                "text json": m.parseJSON,
2760                "text xml": m.parseXML
2761            },
2762            flatOptions: {
2763                url: !0,
2764                context: !0
2765            }
2766        },
2767        ajaxSetup: function(a, b) {
2768            return b ? Nb(Nb(a, m.ajaxSettings), b) : Nb(m.ajaxSettings, a)
2769        },
2770        ajaxPrefilter: Lb(Hb),
2771        ajaxTransport: Lb(Ib),
2772        ajax: function(a, b) {
2773            "object" == typeof a && (b = a, a = void 0), b = b || {};
2774            var c, d, e, f, g, h, i, j, k = m.ajaxSetup({}, b), l = k.context || k, n = k.context && (l.nodeType || l.jquery) ? m(l): m.event, o = m.Deferred(), p = m.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = {
2775                readyState: 0,
2776                getResponseHeader: function(a) {
2777                    var b;
2778                    if (2 === t) {
2779                        if (!j) {
2780                            j = {};
2781                            while (b = Cb.exec(f))
2782                                j[b[1].toLowerCase()] = b[2]
2783                        }
2784                        b = j[a.toLowerCase()]
2785                    }
2786                    return null == b ? null : b
2787                },
2788                getAllResponseHeaders: function() {
2789                    return 2 === t ? f : null
2790                },
2791                setRequestHeader: function(a, b) {
2792                    var c = a.toLowerCase();
2793                    return t || (a = s[c] = s[c] || a, r[a] = b), this
2794                },
2795                overrideMimeType: function(a) {
2796                    return t || (k.mimeType = a), this
2797                },
2798                statusCode: function(a) {
2799                    var b;
2800                    if (a)
2801                        if (2 > t)
2802                            for (b in a)
2803                                q[b] = [q[b], a[b]];
2804                        else 
2805                            v.always(a[v.status]);
2806                    return this
2807                },
2808                abort: function(a) {
2809                    var b = a || u;
2810                    return i && i.abort(b), x(0, b), this
2811                }
2812            };
2813            if (o.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || zb) + "").replace(Ab, "").replace(Fb, yb[1] + "//"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = m.trim(k.dataType || "*").toLowerCase().match(E) || [""], null == k.crossDomain && (c = Gb.exec(k.url.toLowerCase()), k.crossDomain=!(!c || c[1] === yb[1] && c[2] === yb[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (yb[3] || ("http:" === yb[1] ? "80" : "443")))), k.data && k.processData && "string" != typeof k.data && (k.data = m.param(k.data, k.traditional)), Mb(Hb, k, b, v), 2 === t)
2814                return v;
2815            h = m.event && k.global, h && 0 === m.active++&&m.event.trigger("ajaxStart"), k.type = k.type.toUpperCase(), k.hasContent=!Eb.test(k.type), e = k.url, k.hasContent || (k.data && (e = k.url += (wb.test(e) ? "&" : "?") + k.data, delete k.data), k.cache===!1 && (k.url = Bb.test(e) ? e.replace(Bb, "$1_=" + vb++) : e + (wb.test(e) ? "&" : "?") + "_=" + vb++)), k.ifModified && (m.lastModified[e] && v.setRequestHeader("If-Modified-Since", m.lastModified[e]), m.etag[e] && v.setRequestHeader("If-None-Match", m.etag[e])), (k.data && k.hasContent && k.contentType!==!1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType), v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + Jb + "; q=0.01" : "") : k.accepts["*"]);
2816            for (d in k.headers)
2817                v.setRequestHeader(d, k.headers[d]);
2818            if (k.beforeSend && (k.beforeSend.call(l, v, k)===!1 || 2 === t))
2819                return v.abort();
2820            u = "abort";
2821            for (d in{
2822                success: 1,
2823                error: 1,
2824                complete: 1
2825            })
2826                v[d](k[d]);
2827            if (i = Mb(Ib, k, b, v)) {
2828                v.readyState = 1, h && n.trigger("ajaxSend", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function() {
2829                    v.abort("timeout")
2830                }, k.timeout));
2831                try {
2832                    t = 1, i.send(r, x)
2833                } catch (w) {
2834                    if (!(2 > t))
2835                        throw w;
2836                    x( - 1, w)
2837                }
2838            } else 
2839                x( - 1, "No Transport");
2840            function x(a, b, c, d) {
2841                var j, r, s, u, w, x = b;
2842                2 !== t && (t = 2, g && clearTimeout(g), i = void 0, f = d || "", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, c && (u = Ob(k, v, c)), u = Pb(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"), w && (m.lastModified[e] = w), w = v.getResponseHeader("etag"), w && (m.etag[e] = w)), 204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state, r = u.data, s = u.error, j=!s)) : (s = x, (a ||!x) && (x = "error", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + "", j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, h && n.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r: s]), p.fireWith(l, [v, x]), h && (n.trigger("ajaxComplete", [v, k]), --m.active || m.event.trigger("ajaxStop")))
2843            }
2844            return v
2845        },
2846        getJSON: function(a, b, c) {
2847            return m.get(a, b, c, "json")
2848        },
2849        getScript: function(a, b) {
2850            return m.get(a, void 0, b, "script")
2851        }
2852    }), m.each(["get", "post"], function(a, b) {
2853        m[b] = function(a, c, d, e) {
2854            return m.isFunction(c) && (e = e || d, d = c, c = void 0), m.ajax({
2855                url: a,
2856                type: b,
2857                dataType: e,
2858                data: c,
2859                success: d
2860            })
2861        }
2862    }), m._evalUrl = function(a) {
2863        return m.ajax({
2864            url: a,
2865            type: "GET",
2866            dataType: "script",
2867            async: !1,
2868            global: !1,
2869            "throws": !0
2870        })
2871    }, m.fn.extend({
2872        wrapAll: function(a) {
2873            if (m.isFunction(a))
2874                return this.each(function(b) {
2875                    m(this).wrapAll(a.call(this, b))
2876                });
2877            if (this[0]) {
2878                var b = m(a, this[0].ownerDocument).eq(0).clone(!0);
2879                this[0].parentNode && b.insertBefore(this[0]), b.map(function() {
2880                    var a = this;
2881                    while (a.firstChild && 1 === a.firstChild.nodeType)
2882                        a = a.firstChild;
2883                    return a
2884                }).append(this)
2885            }
2886            return this
2887        },
2888        wrapInner: function(a) {
2889            return this.each(m.isFunction(a) ? function(b) {
2890                m(this).wrapInner(a.call(this, b))
2891            } : function() {
2892                var b = m(this), c = b.contents();
2893                c.length ? c.wrapAll(a) : b.append(a)
2894            })
2895        },
2896        wrap: function(a) {
2897            var b = m.isFunction(a);
2898            return this.each(function(c) {
2899                m(this).wrapAll(b ? a.call(this, c) : a)
2900            })
2901        },
2902        unwrap: function() {
2903            return this.parent().each(function() {
2904                m.nodeName(this, "body") || m(this).replaceWith(this.childNodes)
2905            }).end()
2906        }
2907    }), m.expr.filters.hidden = function(a) {
2908        return a.offsetWidth <= 0 && a.offsetHeight <= 0 ||!k.reliableHiddenOffsets() && "none" === (a.style && a.style.display || m.css(a, "display"))
2909    }, m.expr.filters.visible = function(a) {
2910        return !m.expr.filters.hidden(a)
2911    };
2912    var Qb = /%20/g, Rb = /\[\]$/, Sb = /\r?\n/g, Tb = /^(?:submit|button|image|reset|file)$/i, Ub = /^(?:input|select|textarea|keygen)/i;
2913    function Vb(a, b, c, d) {
2914        var e;
2915        if (m.isArray(b))
2916            m.each(b, function(b, e) {
2917                c || Rb.test(a) ? d(a, e) : Vb(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d)
2918            });
2919        else if (c || "object" !== m.type(b))
2920            d(a, b);
2921        else 
2922            for (e in b)
2923                Vb(a + "[" + e + "]", b[e], c, d)
2924    }
2925    m.param = function(a, b) {
2926        var c, d = [], e = function(a, b) {
2927            b = m.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
2928        };
2929        if (void 0 === b && (b = m.ajaxSettings && m.ajaxSettings.traditional), m.isArray(a) || a.jquery&&!m.isPlainObject(a)
2930            )m.each(a, function() {
2931            e(this.name, this.value)
2932        });
2933        else 
2934            for (c in a)
2935                Vb(c, a[c], b, e);
2936        return d.join("&").replace(Qb, "+")
2937    }, m.fn.extend({
2938        serialize: function() {
2939            return m.param(this.serializeArray())
2940        },
2941        serializeArray: function() {
2942            return this.map(function() {
2943                var a = m.prop(this, "elements");
2944                return a ? m.makeArray(a) : this
2945            }).filter(function() {
2946                var a = this.type;
2947                return this.name&&!m(this).is(":disabled") && Ub.test(this.nodeName)&&!Tb.test(a) && (this.checked ||!W.test(a))
2948            }).map(function(a, b) {
2949                var c = m(this).val();
2950                return null == c ? null : m.isArray(c) ? m.map(c, function(a) {
2951                    return {
2952                        name: b.name,
2953                        value: a.replace(Sb, "\r\n")
2954                    }
2955                }) : {
2956                    name: b.name,
2957                    value: c.replace(Sb, "\r\n")
2958                }
2959            }).get()
2960        }
2961    }), m.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function() {
2962        return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Zb() || $b()
2963    } : Zb;
2964    var Wb = 0, Xb = {}, Yb = m.ajaxSettings.xhr();
2965    a.attachEvent && a.attachEvent("onunload", function() {
2966        for (var a in Xb)
2967            Xb[a](void 0, !0)
2968    }), k.cors=!!Yb && "withCredentials"in Yb, Yb = k.ajax=!!Yb, Yb && m.ajaxTransport(function(a) {
2969        if (!a.crossDomain || k.cors) {
2970            var b;
2971            return {
2972                send: function(c, d) {
2973                    var e, f = a.xhr(), g=++Wb;
2974                    if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields)
2975                        for (e in a.xhrFields)
2976                            f[e] = a.xhrFields[e];
2977                    a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest");
2978                    for (e in c)
2979                        void 0 !== c[e] && f.setRequestHeader(e, c[e] + "");
2980                    f.send(a.hasContent && a.data || null), b = function(c, e) {
2981                        var h, i, j;
2982                        if (b && (e || 4 === f.readyState))
2983                            if (delete Xb[g], b = void 0, f.onreadystatechange = m.noop, e)
2984                                4 !== f.readyState && f.abort();
2985                            else {
2986                                j = {}, h = f.status, "string" == typeof f.responseText && (j.text = f.responseText);
2987                                try {
2988                                    i = f.statusText
2989                                } catch (k) {
2990                                    i = ""
2991                                }
2992                                h ||!a.isLocal || a.crossDomain ? 1223 === h && (h = 204) : h = j.text ? 200 : 404
2993                            }
2994                        j && d(h, i, j, f.getAllResponseHeaders())
2995                    }, a.async ? 4 === f.readyState ? setTimeout(b) : f.onreadystatechange = Xb[g] = b : b()
2996                },
2997                abort: function() {
2998                    b && b(void 0, !0)
2999                }
3000            }
3001        }
3002    });
3003    function Zb() {
3004        try {
3005            return new a.XMLHttpRequest
3006        } catch (b) {}
3007    }
3008    function $b() {
3009        try {
3010            return new a.ActiveXObject("Microsoft.XMLHTTP")
3011        } catch (b) {}
3012    }
3013    m.ajaxSetup({
3014        accepts: {
3015            script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
3016        },
3017        contents: {
3018            script: /(?:java|ecma)script/
3019        },
3020        converters: {
3021            "text script": function(a) {
3022                return m.globalEval(a), a
3023            }
3024        }
3025    }), m.ajaxPrefilter("script", function(a) {
3026        void 0 === a.cache && (a.cache=!1), a.crossDomain && (a.type = "GET", a.global=!1)
3027    }), m.ajaxTransport("script", function(a) {
3028        if (a.crossDomain) {
3029            var b, c = y.head || m("head")[0] || y.documentElement;
3030            return {
3031                send: function(d, e) {
3032                    b = y.createElement("script"), b.async=!0, a.scriptCharset && (b.charset = a.scriptCharset), b.src = a.url, b.onload = b.onreadystatechange = function(a, c) {
3033                        (c ||!b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || e(200, "success"))
3034                    }, c.insertBefore(b, c.firstChild)
3035                },
3036                abort: function() {
3037                    b && b.onload(void 0, !0)
3038                }
3039            }
3040        }
3041    });
3042    var _b = [], ac = /(=)\?(?=&|$)|\?\?/;
3043    m.ajaxSetup({
3044        jsonp: "callback",
3045        jsonpCallback: function() {
3046            var a = _b.pop() || m.expando + "_" + vb++;
3047            return this[a]=!0, a
3048        }
3049    }), m.ajaxPrefilter("json jsonp", function(b, c, d) {
3050        var e, f, g, h = b.jsonp!==!1 && (ac.test(b.url) ? "url" : "string" == typeof b.data&&!(b.contentType || "").indexOf("application/x-www-form-urlencoded") && ac.test(b.data) && "data");
3051        return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = m.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(ac, "$1" + e) : b.jsonp!==!1 && (b.url += (wb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function() {
3052            return g || m.error(e + " was not called"), g[0]
3053        }, b.dataTypes[0] = "json", f = a[e], a[e] = function() {
3054            g = arguments
3055        }, d.always(function() {
3056            a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, _b.push(e)), g && m.isFunction(f) && f(g[0]), g = f = void 0
3057        }), "script") : void 0
3058    }), m.parseHTML = function(a, b, c) {
3059        if (!a || "string" != typeof a)
3060            return null;
3061        "boolean" == typeof b && (c = b, b=!1), b = b || y;
3062        var d = u.exec(a), e=!c && [];
3063        return d ? [b.createElement(d[1])] : (d = m.buildFragment([a], b, e), e && e.length && m(e).remove(), m.merge([], d.childNodes))
3064    };
3065    var bc = m.fn.load;
3066    m.fn.load = function(a, b, c) {
3067        if ("string" != typeof a && bc)
3068            return bc.apply(this, arguments);
3069        var d, e, f, g = this, h = a.indexOf(" ");
3070        return h >= 0 && (d = m.trim(a.slice(h, a.length)), a = a.slice(0, h)), m.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (f = "POST"), g.length > 0 && m.ajax({
3071            url: a,
3072            type: f,
3073            dataType: "html",
3074            data: b
3075        }).done(function(a) {
3076            e = arguments, g.html(d ? m("<div>").append(m.parseHTML(a)).find(d) : a)
3077        }).complete(c && function(a, b) {
3078            g.each(c, e || [a.responseText, b, a])
3079        }), this
3080    }, m.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(a, b) {
3081        m.fn[b] = function(a) {
3082            return this.on(b, a)
3083        }
3084    }), m.expr.filters.animated = function(a) {
3085        return m.grep(m.timers, function(b) {
3086            return a === b.elem
3087        }).length
3088    };
3089    var cc = a.document.documentElement;
3090    function dc(a) {
3091        return m.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1
3092    }
3093    m.offset = {
3094        setOffset: function(a, b, c) {
3095            var d, e, f, g, h, i, j, k = m.css(a, "position"), l = m(a), n = {};
3096            "static" === k && (a.style.position = "relative"), h = l.offset(), f = m.css(a, "top"), i = m.css(a, "left"), j = ("absolute" === k || "fixed" === k) && m.inArray("auto", [f, i])>-1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), m.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (n.top = b.top - h.top + g), null != b.left && (n.left = b.left - h.left + e), "using"in b ? b.using.call(a, n) : l.css(n)
3097        }
3098    }, m.fn.extend({
3099        offset: function(a) {
3100            if (arguments.length)
3101                return void 0 === a ? this : this.each(function(b) {
3102                m.offset.setOffset(this, a, b)
3103            });
3104            var b, c, d = {
3105                top: 0,
3106                left: 0
3107            }, e = this[0], f = e && e.ownerDocument;
3108            if (f)
3109                return b = f.documentElement, m.contains(b, e) ? (typeof e.getBoundingClientRect !== K && (d = e.getBoundingClientRect()), c = dc(f), {
3110                    top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0),
3111                    left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0)
3112                }) : d
3113        },
3114        position: function() {
3115            if (this[0]) {
3116                var a, b, c = {
3117                    top: 0,
3118                    left: 0
3119                }, d = this[0];
3120                return "fixed" === m.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), m.nodeName(a[0], "html") || (c = a.offset()), c.top += m.css(a[0], "borderTopWidth", !0), c.left += m.css(a[0], "borderLeftWidth", !0)), {
3121                    top: b.top - c.top - m.css(d, "marginTop", !0),
3122                    left: b.left - c.left - m.css(d, "marginLeft", !0)
3123                }
3124            }
3125        },
3126        offsetParent: function() {
3127            return this.map(function() {
3128                var a = this.offsetParent || cc;
3129                while (a&&!m.nodeName(a, "html") && "static" === m.css(a, "position"))
3130                    a = a.offsetParent;
3131                return a || cc
3132            })
3133        }
3134    }), m.each({
3135        scrollLeft: "pageXOffset",
3136        scrollTop: "pageYOffset"
3137    }, function(a, b) {
3138        var c = /Y/.test(b);
3139        m.fn[a] = function(d) {
3140            return V(this, function(a, d, e) {
3141                var f = dc(a);
3142                return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void(f ? f.scrollTo(c ? m(f).scrollLeft() : e, c ? e : m(f).scrollTop()) : a[d] = e)
3143            }, a, d, arguments.length, null)
3144        }
3145    }), m.each(["top", "left"], function(a, b) {
3146        m.cssHooks[b] = La(k.pixelPosition, function(a, c) {
3147            return c ? (c = Ja(a, b), Ha.test(c) ? m(a).position()[b] + "px" : c) : void 0
3148        })
3149    }), m.each({
3150        Height: "height",
3151        Width: "width"
3152    }, function(a, b) {
3153        m.each({
3154            padding: "inner" + a,
3155            content: b,
3156            "": "outer" + a
3157        }, function(c, d) {
3158            m.fn[d] = function(d, e) {
3159                var f = arguments.length && (c || "boolean" != typeof d), g = c || (d===!0 || e===!0 ? "margin" : "border");
3160                return V(this, function(b, c, d) {
3161                    var e;
3162                    return m.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? m.css(b, c, g) : m.style(b, c, d, g)
3163                }, b, f ? d : void 0, f, null)
3164            }
3165        })
3166    }), m.fn.size = function() {
3167        return this.length
3168    }, m.fn.andSelf = m.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function() {
3169        return m
3170    });
3171    var ec = a.jQuery, fc = a.$;
3172    return m.noConflict = function(b) {
3173        return a.$ === m && (a.$ = fc), b && a.jQuery === m && (a.jQuery = ec), m
3174    }, typeof b === K && (a.jQuery = a.$ = m), m
3175});
3176
3177/*!
3178 * jQuery Form Plugin
3179 * version: 3.51.0-2014.06.20
3180 * Requires jQuery v1.5 or later
3181 * Copyright (c) 2014 M. Alsup
3182 * Examples and documentation at: http://malsup.com/jquery/form/
3183 * Project repository: https://github.com/malsup/form
3184 * Dual licensed under the MIT and GPL licenses.
3185 * https://github.com/malsup/form#copyright-and-license
3186 */
3187!function(e) {
3188    "use strict";
3189    "function" == typeof define && define.amd ? define(["jquery"], e) : e("undefined" != typeof jQuery ? jQuery : window.Zepto)
3190}(function(e) {
3191    "use strict";
3192    function t(t) {
3193        var r = t.data;
3194        t.isDefaultPrevented() || (t.preventDefault(), e(t.target).ajaxSubmit(r))
3195    }
3196    function r(t) {
3197        var r = t.target, a = e(r);
3198        if (!a.is("[type=submit],[type=image]")) {
3199            var n = a.closest("[type=submit]");
3200            if (0 === n.length)
3201                return;
3202            r = n[0]
3203        }
3204        var i = this;
3205        if (i.clk = r, "image" == r.type)
3206            if (void 0 !== t.offsetX)
3207                i.clk_x = t.offsetX, i.clk_y = t.offsetY;
3208            else if ("function" == typeof e.fn.offset) {
3209                var o = a.offset();
3210                i.clk_x = t.pageX - o.left, i.clk_y = t.pageY - o.top
3211            } else 
3212                i.clk_x = t.pageX - r.offsetLeft, i.clk_y = t.pageY - r.offsetTop;
3213        setTimeout(function() {
3214            i.clk = i.clk_x = i.clk_y = null
3215        }, 100)
3216    }
3217    function a() {
3218        if (e.fn.ajaxSubmit.debug) {
3219            var t = "[jquery.form] " + Array.prototype.join.call(arguments, "");
3220            window.console && window.console.log ? window.console.log(t) : window.opera && window.opera.postError && window.opera.postError(t)
3221        }
3222    }
3223    var n = {};
3224    n.fileapi = void 0 !== e("<input type='file'/>").get(0).files, n.formdata = void 0 !== window.FormData;
3225    var i=!!e.fn.prop;
3226    e.fn.attr2 = function() {
3227        if (!i)
3228            return this.attr.apply(this, arguments);
3229        var e = this.prop.apply(this, arguments);
3230        return e && e.jquery || "string" == typeof e ? e : this.attr.apply(this, arguments)
3231    }, e.fn.ajaxSubmit = function(t) {
3232        function r(r) {
3233            var a, n, i = e.param(r, t.traditional).split("&"), o = i.length, s = [];
3234            for (a = 0; o > a; a++)
3235                i[a] = i[a].replace(/\+/g, " "), n = i[a].split("="), s.push([decodeURIComponent(n[0]), decodeURIComponent(n[1])]);
3236            return s
3237        }
3238        function o(a) {
3239            for (var n = new FormData, i = 0; i < a.length; i++)
3240                n.append(a[i].name, a[i].value);
3241            if (t.extraData) {
3242                var o = r(t.extraData);
3243                for (i = 0; i < o.length; i++)
3244                    o[i] && n.append(o[i][0], o[i][1])
3245            }
3246            t.data = null;
3247            var s = e.extend(!0, {}, e.ajaxSettings, t, {
3248                contentType: !1,
3249                processData: !1,
3250                cache: !1,
3251                type: u || "POST"
3252            });
3253            t.uploadProgress && (s.xhr = function() {
3254                var r = e.ajaxSettings.xhr();
3255                return r.upload && r.upload.addEventListener("progress", function(e) {
3256                    var r = 0, a = e.loaded || e.position, n = e.total;
3257                    e.lengthComputable && (r = Math.ceil(a / n * 100)), t.uploadProgress(e, a, n, r)
3258                }, !1), r
3259            }), s.data = null;
3260            var c = s.beforeSend;
3261            return s.beforeSend = function(e, r) {
3262                r.data = t.formData ? t.formData : n, c && c.call(this, e, r)
3263            }, e.ajax(s)
3264        }
3265        function s(r) {
3266            function n(e) {
3267                var t = null;
3268                try {
3269                    e.contentWindow && (t = e.contentWindow.document)
3270                } catch (r) {
3271                    a("cannot get iframe.contentWindow document: " + r)
3272                }
3273                if (t)
3274                    return t;
3275                try {
3276                    t = e.contentDocument ? e.contentDocument : e.document
3277                } catch (r) {
3278                    a("cannot get iframe.contentDocument: " + r), t = e.document
3279                }
3280                return t
3281            }
3282            function o() {
3283                function t() {
3284                    try {
3285                        var e = n(g).readyState;
3286                        a("state = " + e), e && "uninitialized" == e.toLowerCase() && setTimeout(t, 50)
3287                    } catch (r) {
3288                        a("Server abort: ", r, " (", r.name, ")"), s(k), j && clearTimeout(j), j = void 0
3289                    }
3290                }
3291                var r = f.attr2("target"), i = f.attr2("action"), o = "multipart/form-data", c = f.attr("enctype") || f.attr("encoding") || o;
3292                w.setAttribute("target", p), (!u || /post/i.test(u)) && w.setAttribute("method", "POST"), i != m.url && w.setAttribute("action", m.url), m.skipEncodingOverride || u&&!/post/i.test(u) || f.attr({
3293                    encoding: "multipart/form-data",
3294                    enctype: "multipart/form-data"
3295                }), m.timeout && (j = setTimeout(function() {
3296                    T=!0, s(D)
3297                }, m.timeout));
3298                var l = [];
3299                try {
3300                    if (m.extraData)
3301                        for (var d in m.extraData)
3302                            m.extraData.hasOwnProperty(d) && l.push(e.isPlainObject(m.extraData[d]) && m.extraData[d].hasOwnProperty("name") && m.extraData[d].hasOwnProperty("value") ? e('<input type="hidden" name="' + m.extraData[d].name + '">').val(m.extraData[d].value).appendTo(w)[0] : e('<input type="hidden" name="' + d + '">').val(m.extraData[d]).appendTo(w)[0]);
3303                    m.iframeTarget || v.appendTo("body"), g.attachEvent ? g.attachEvent("onload", s) : g.addEventListener("load", s, !1), setTimeout(t, 15);
3304                    try {
3305                        w.submit()
3306                    } catch (h) {
3307                        var x = document.createElement("form").submit;
3308                        x.apply(w)
3309                    }
3310                } finally {
3311                    w.setAttribute("action", i), w.setAttribute("enctype", c), r ? w.setAttribute("target", r) : f.removeAttr("target"), e(l).remove()
3312                }
3313            }
3314            function s(t) {
3315                if (!x.aborted&&!F) {
3316                    if (M = n(g), M || (a("cannot access response document"), t = k), t === D && x)
3317                        return x.abort("timeout"), void S.reject(x, "timeout");
3318                    if (t == k && x)
3319                        return x.abort("server abort"), void S.reject(x, "error", "server abort");
3320                    if (M && M.location.href != m.iframeSrc || T) {
3321                        g.detachEvent ? g.detachEvent("onload", s) : g.removeEventListener("load", s, !1);
3322                        var r, i = "success";
3323                        try {
3324                            if (T)
3325                                throw "timeout";
3326                            var o = "xml" == m.dataType || M.XMLDocument || e.isXMLDoc(M);
3327                            if (a("isXml=" + o), !o && window.opera && (null === M.body ||!M.body.innerHTML)&&--O)
3328                                return a("requeing onLoad callback, DOM not available"), void setTimeout(s, 250);
3329                            var u = M.body ? M.body: M.documentElement;
3330                            x.responseText = u ? u.innerHTML : null, x.responseXML = M.XMLDocument ? M.XMLDocument : M, o && (m.dataType = "xml"), x.getResponseHeader = function(e) {
3331                                var t = {
3332                                    "content-type": m.dataType
3333                                };
3334                                return t[e.toLowerCase()]
3335                            }, u && (x.status = Number(u.getAttribute("status")) || x.status, x.statusText = u.getAttribute("statusText") || x.statusText);
3336                            var c = (m.dataType || "").toLowerCase(), l = /(json|script|text)/.test(c);
3337                            if (l || m.textarea) {
3338                                var f = M.getElementsByTagName("textarea")[0];
3339                                if (f)
3340                                    x.responseText = f.value, x.status = Number(f.getAttribute("status")) || x.status, x.statusText = f.getAttribute("statusText") || x.statusText;
3341                                else if (l) {
3342                                    var p = M.getElementsByTagName("pre")[0], h = M.getElementsByTagName("body")[0];
3343                                    p ? x.responseText = p.textContent ? p.textContent : p.innerText : h && (x.responseText = h.textContent ? h.textContent : h.innerText)
3344                                }
3345                            } else 
3346                                "xml" == c&&!x.responseXML && x.responseText && (x.responseXML = X(x.responseText));
3347                            try {
3348                                E = _(x, c, m)
3349                            } catch (y) {
3350                                i = "parsererror", x.error = r = y || i
3351                            }
3352                        } catch (y) {
3353                            a("error caught: ", y), i = "error", x.error = r = y || i
3354                        }
3355                        x.aborted && (a("upload aborted"), i = null), x.status && (i = x.status >= 200 && x.status < 300 || 304 === x.status ? "success" : "error"), "success" === i ? (m.success && m.success.call(m.context, E, "success", x), S.resolve(x.responseText, "success", x), d && e.event.trigger("ajaxSuccess", [x, m])) : i && (void 0 === r && (r = x.statusText), m.error && m.error.call(m.context, x, i, r), S.reject(x, "error", r), d && e.event.trigger("ajaxError", [x, m, r])), d && e.event.trigger("ajaxComplete", [x, m]), d&&!--e.active && e.event.trigger("ajaxStop"), m.complete && m.complete.call(m.context, x, i), F=!0, m.timeout && clearTimeout(j), setTimeout(function() {
3356                            m.iframeTarget ? v.attr("src", m.iframeSrc) : v.remove(), x.responseXML = null
3357                        }, 100)
3358                    }
3359                }
3360            }
3361            var c, l, m, d, p, v, g, x, y, b, T, j, w = f[0], S = e.Deferred();
3362            if (S.abort = function(e) {
3363                x.abort(e)
3364            }, r)
3365                for (l = 0; l < h.length; l++)
3366                    c = e(h[l]), i ? c.prop("disabled", !1) : c.removeAttr("disabled");
3367            if (m = e.extend(!0, {}, e.ajaxSettings, t), m.context = m.context || m, p = "jqFormIO" + (new Date).getTime(), m.iframeTarget ? (v = e(m.iframeTarget), b = v.attr2("name"), b ? p = b : v.attr2("name", p)) : (v = e('<iframe name="' + p + '" src="' + m.iframeSrc + '" />'), v.css({
3368                position: "absolute",
3369                top: "-1000px",
3370                left: "-1000px"
3371            })), g = v[0], x = {
3372                aborted: 0,
3373                responseText: null,
3374                responseXML: null,
3375                status: 0,
3376                statusText: "n/a",
3377                getAllResponseHeaders: function() {},
3378                getResponseHeader: function() {},
3379                setRequestHeader: function() {},
3380                abort: function(t) {
3381                    var r = "timeout" === t ? "timeout": "aborted";
3382                    a("aborting upload... " + r), this.aborted = 1;
3383                    try {
3384                        g.contentWindow.document.execCommand && g.contentWindow.document.execCommand("Stop")
3385                    } catch (n) {}
3386                    v.attr("src", m.iframeSrc), x.error = r, m.error && m.error.call(m.context, x, r, t), d && e.event.trigger("ajaxError", [x, m, r]), m.complete && m.complete.call(m.context, x, r)
3387                }
3388            }, d = m.global, d && 0 === e.active++&&e.event.trigger("ajaxStart"), d && e.event.trigger("ajaxSend", [x, m]), m.beforeSend && m.beforeSend.c
3388all(m.context, x, m)===!1)return m.global && e.active--, S.reject(), S;
3389            if (x.aborted)
3390                return S.reject(), S;
3391            y = w.clk, y && (b = y.name, b&&!y.disabled && (m.extraData = m.extraData || {}, m.extraData[b] = y.value, "image" == y.type && (m.extraData[b + ".x"] = w.clk_x, m.extraData[b + ".y"] = w.clk_y)));
3392            var D = 1, k = 2, A = e("meta[name=csrf-token]").attr("content"), L = e("meta[name=csrf-param]").attr("content");
3393            L && A && (m.extraData = m.extraData || {}, m.extraData[L] = A), m.forceSync ? o() : setTimeout(o, 10);
3394            var E, M, F, O = 50, X = e.parseXML || function(e, t) {
3395                return window.ActiveXObject ? (t = new ActiveXObject("Microsoft.XMLDOM"), t.async = "false", t.loadXML(e)) : t = (new DOMParser).parseFromString(e, "text/xml"), t && t.documentElement && "parsererror" != t.documentElement.nodeName ? t : null
3396            }, C = e.parseJSON || function(e) {
3397                return window.eval("(" + e + ")")
3398            }, _ = function(t, r, a) {
3399                var n = t.getResponseHeader("content-type") || "", i = "xml" === r ||!r && n.indexOf("xml") >= 0, o = i ? t.responseXML: t.responseText;
3400                return i && "parsererror" === o.documentElement.nodeName && e.error && e.error("parsererror"), a && a.dataFilter && (o = a.dataFilter(o, r)), "string" == typeof o && ("json" === r ||!r && n.indexOf("json") >= 0 ? o = C(o) : ("script" === r ||!r && n.indexOf("javascript") >= 0) && e.globalEval(o)), o
3401            };
3402            return S
3403        }
3404        if (!this.length)
3405            return a("ajaxSubmit: skipping submit process - no element selected"), this;
3406        var u, c, l, f = this;
3407        "function" == typeof t ? t = {
3408            success: t
3409        } : void 0 === t && (t = {}), u = t.type || this.attr2("method"), c = t.url || this.attr2("action"), l = "string" == typeof c ? e.trim(c) : "", l = l || window.location.href || "", l && (l = (l.match(/^([^#]+)/) || [])[1]), t = e.extend(!0, {
3410            url: l,
3411            success: e.ajaxSettings.success,
3412            type: u || e.ajaxSettings.type,
3413            iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false": "about:blank"
3414        }, t);
3415        var m = {};
3416        if (this.trigger("form-pre-serialize", [this, t, m]), m.veto)
3417            return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this;
3418        if (t.beforeSerialize && t.beforeSerialize(this, t)===!1)
3419            return a("ajaxSubmit: submit aborted via beforeSerialize callback"), this;
3420        var d = t.traditional;
3421        void 0 === d && (d = e.ajaxSettings.traditional);
3422        var p, h = [], v = this.formToArray(t.semantic, h);
3423        if (t.data && (t.extraData = t.data, p = e.param(t.data, d)), t.beforeSubmit && t.beforeSubmit(v, this, t)===!1)
3424            return a("ajaxSubmit: submit aborted via beforeSubmit callback"), this;
3425        if (this.trigger("form-submit-validate", [v, this, t, m]), m.veto)
3426            return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this;
3427        var g = e.param(v, d);
3428        p && (g = g ? g + "&" + p : p), "GET" == t.type.toUpperCase() ? (t.url += (t.url.indexOf("?") >= 0 ? "&" : "?") + g, t.data = null) : t.data = g;
3429        var x = [];
3430        if (t.resetForm && x.push(function() {
3431            f.resetForm()
3432        }), t.clearForm && x.push(function() {
3433            f.clearForm(t.includeHidden)
3434        }), !t.dataType && t.target) {
3435            var y = t.success || function() {};
3436            x.push(function(r) {
3437                var a = t.replaceTarget ? "replaceWith": "html";
3438                e(t.target)[a](r).each(y, arguments)
3439            })
3440        } else 
3441            t.success && x.push(t.success);
3442        if (t.success = function(e, r, a) {
3443            for (var n = t.context || this, i = 0, o = x.length; o > i; i++)
3444                x[i].apply(n, [e, r, a || f, f])
3445        }, t.error) {
3446            var b = t.error;
3447            t.error = function(e, r, a) {
3448                var n = t.context || this;
3449                b.apply(n, [e, r, a, f])
3450            }
3451        }
3452        if (t.complete) {
3453            var T = t.complete;
3454            t.complete = function(e, r) {
3455                var a = t.context || this;
3456                T.apply(a, [e, r, f])
3457            }
3458        }
3459        var j = e("input[type=file]:enabled", this).filter(function() {
3460            return "" !== e(this).val()
3461        }), w = j.length > 0, S = "multipart/form-data", D = f.attr("enctype") == S || f.attr("encoding") == S, k = n.fileapi && n.formdata;
3462        a("fileAPI :" + k);
3463        var A, L = (w || D)&&!k;
3464        t.iframe!==!1 && (t.iframe || L) ? t.closeKeepAlive ? e.get(t.closeKeepAlive, function() {
3465            A = s(v)
3466        }) : A = s(v) : A = (w || D) && k ? o(v) : e.ajax(t), f.removeData("jqxhr").data("jqxhr", A);
3467        for (var E = 0; E < h.length; E++)
3468            h[E] = null;
3469        return this.trigger("form-submit-notify", [this, t]), this
3470    }, e.fn.ajaxForm = function(n) {
3471        if (n = n || {}, n.delegation = n.delegation && e.isFunction(e.fn.on), !n.delegation && 0 === this.length) {
3472            var i = {
3473                s: this.selector,
3474                c: this.context
3475            };
3476            return !e.isReady && i.s ? (a("DOM not ready, queuing ajaxForm"), e(function() {
3477                e(i.s, i.c).ajaxForm(n)
3478            }), this) : (a("terminating; zero elements found by selector" + (e.isReady ? "" : " (DOM not ready)")), this)
3479        }
3480        return n.delegation ? (e(document).off("submit.form-plugin", this.selector, t).off("click.form-plugin", this.selector, r).on("submit.form-plugin", this.selector, n, t).on("click.form-plugin", this.selector, n, r), this) : this.ajaxFormUnbind().bind("submit.form-plugin", n, t).bind("click.form-plugin", n, r)
3481    }, e.fn.ajaxFormUnbind = function() {
3482        return this.unbind("submit.form-plugin click.form-plugin")
3483    }, e.fn.formToArray = function(t, r) {
3484        var a = [];
3485        if (0 === this.length)
3486            return a;
3487        var i, o = this[0], s = this.attr("id"), u = t ? o.getElementsByTagName("*"): o.elements;
3488        if (u&&!/MSIE [678]/.test(navigator.userAgent) && (u = e(u).get()), s && (i = e(':input[form="' + s + '"]').get(), i.length && (u = (u || []).concat(i))), !u ||!u.length)
3489            return a;
3490        var c, l, f, m, d, p, h;
3491        for (c = 0, p = u.length; p > c; c++)
3492            if (d = u[c], f = d.name, f&&!d.disabled)
3493                if (t && o.clk && "image" == d.type)
3494                    o.clk == d && (a.push({
3495                        name: f,
3496                        value: e(d).val(),
3497                        type: d.type
3498                    }), a.push({
3499                        name: f + ".x",
3500                        value: o.clk_x
3501                    }, {
3502                        name: f + ".y",
3503                        value: o.clk_y
3504                    }));
3505                else if (m = e.fieldValue(d, !0), m && m.constructor == Array)
3506                    for (r && r.push(d), l = 0, h = m.length; h > l; l++)
3507                        a.push({
3508                            name: f,
3509                            value: m[l]
3510                        });
3511                else if (n.fileapi && "file" == d.type) {
3512                    r && r.push(d);
3513                    var v = d.files;
3514                    if (v.length)
3515                        for (l = 0; l < v.length; l++)
3516                            a.push({
3517                                name: f,
3518                                value: v[l],
3519                                type: d.type
3520                            });
3521                    else 
3522                        a.push({
3523                            name: f,
3524                            value: "",
3525                            type: d.type
3526                        })
3527                } else 
3528                    null !== m && "undefined" != typeof m && (r && r.push(d), a.push({
3529                        name: f,
3530                        value: m,
3531                        type: d.type,
3532                        required: d.required
3533                    }));
3534        if (!t && o.clk) {
3535            var g = e(o.clk), x = g[0];
3536            f = x.name, f&&!x.disabled && "image" == x.type && (a.push({
3537                name: f,
3538                value: g.val()
3539            }), a.push({
3540                name: f + ".x",
3541                value: o.clk_x
3542            }, {
3543                name: f + ".y",
3544                value: o.clk_y
3545            }))
3546        }
3547        return a
3548    }
3548, e.fn.formSerialize = function(t) {
3549        return e.param(this.formToArray(t))
3550    }, e.fn.fieldSerialize = function(t) {
3551        var r = [];
3552        return this.each(function() {
3553            var a = this.name;
3554            if (a) {
3555                var n = e.fieldValue(this, t);
3556                if (n && n.constructor == Array)
3557                    for (var i = 0, o = n.length; o > i; i++)
3558                        r.push({
3559                            name: a,
3560                            value: n[i]
3561                        });
3562                else 
3563                    null !== n && "undefined" != typeof n && r.push({
3564                        name: this.name,
3565                        value: n
3566                    })
3567            }
3568        }), e.param(r)
3569    }, e.fn.fieldValue = function(t) {
3570        for (var r = [], a = 0, n = this.length; n > a; a++) {
3571            var i = this[a], o = e.fieldValue(i, t);
3572            null === o || "undefined" == typeof o || o.constructor == Array&&!o.length || (o.constructor == Array ? e.merge(r, o) : r.push(o))
3573        }
3574        return r
3575    }, e.fieldValue = function(t, r) {
3576        var a = t.name, n = t.type, i = t.tagName.toLowerCase();
3577        if (void 0 === r && (r=!0), r && (!a || t.disabled || "reset" == n || "button" == n || ("checkbox" == n || "radio" == n)&&!t.checked || ("submit" == n || "image" == n) && t.form && t.form.clk != t || "select" == i&&-1 == t.selectedIndex)
3578            )return null;
3579        if ("select" == i) {
3580            var o = t.selectedIndex;
3581            if (0 > o)
3582                return null;
3583            for (var s = [], u = t.options, c = "select-one" == n, l = c ? o + 1 : u.length, f = c ? o : 0; l > f; f++) {
3584                var m = u[f];
3585                if (m.selected) {
3586                    var d = m.value;
3587                    if (d || (d = m.attributes && m.attributes.value&&!m.attributes.value.specified ? m.text : m.value), c)
3588                        return d;
3589                    s.push(d)
3590                }
3591            }
3592            return s
3593        }
3594        return e(t).val()
3595    }, e.fn.clearForm = function(t) {
3596        return this.each(function() {
3597            e("input,select,textarea", this).clearFields(t)
3598        })
3599    }, e.fn.clearFields = e.fn.clearInputs = function(t) {
3600        var r = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
3601        return this.each(function() {
3602            var a = this.type, n = this.tagName.toLowerCase();
3603            r.test(a) || "textarea" == n ? this.value = "" : "checkbox" == a || "radio" == a ? this.checked=!1 : "select" == n ? this.selectedIndex =- 1 : "file" == a ? /MSIE/.test(navigator.userAgent) ? e(this).replaceWith(e(this).clone(!0)) : e(this).val("") : t && (t===!0 && /hidden/.test(a) || "string" == typeof t && e(this).is(t)) && (this.value = "")
3604        })
3605    }, e.fn.resetForm = function() {
3606        return this.each(function() {
3607            ("function" == typeof this.reset || "object" == typeof this.reset&&!this.reset.nodeType) && this.reset()
3608        })
3609    }, e.fn.enable = function(e) {
3610        return void 0 === e && (e=!0), this.each(function() {
3611            this.disabled=!e
3612        })
3613    }, e.fn.selected = function(t) {
3614        return void 0 === t && (t=!0), this.each(function() {
3615            var r = this.type;
3616            if ("checkbox" == r || "radio" == r)
3617                this.checked = t;
3618            else if ("option" == this.tagName.toLowerCase()) {
3619                var a = e(this).parent("select");
3620                t && a[0] && "select-one" == a[0].type && a.find("option").selected(!1), this.selected = t
3621            }
3622        })
3623    }, e.fn.ajaxSubmit.debug=!1
3624});
3625
3626/*
3627 jQuery Masked Input Plugin
3628 Copyright (c) 2007 - 2014 Josh Bush (digitalbush.com)
3629 Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
3630 Version: 1.4.0
3631 */
3632!function(a) {
3633    "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery)
3634}(function(a) {
3635    var b, c = navigator.userAgent, d = /iphone/i.test(c), e = /chrome/i.test(c), f = /android/i.test(c);
3636    a.mask = {
3637        definitions: {
3638            9: "[0-9]",
3639            a: "[A-Za-z]",
3640            "*": "[A-Za-z0-9]"
3641        },
3642        autoclear: !0,
3643        dataName: "rawMaskFn",
3644        placeholder: "_"
3645    }, a.fn.extend({
3646        caret: function(a, b) {
3647            var c;
3648            if (0 !== this.length&&!this.is(":hidden"))
3649                return "number" == typeof a ? (b = "number" == typeof b ? b : a, this.each(function() {
3650                    this.setSelectionRange ? this.setSelectionRange(a, b) : this.createTextRange && (c = this.createTextRange(), c.collapse(!0), c.moveEnd("character", b), c.moveStart("character", a), c.select())
3651                })) : (this[0].setSelectionRange ? (a = this[0].selectionStart, b = this[0].selectionEnd) : document.selection && document.selection.createRange && (c = document.selection.createRange(), a = 0 - c.duplicate().moveStart("character", - 1e5), b = a + c.text.length), {
3652                    begin: a,
3653                    end: b
3654                })
3655        },
3656        unmask: function() {
3657            return this.trigger("unmask")
3658        },
3659        mask: function(c, g) {
3660            var h, i, j, k, l, m, n, o;
3661            if (!c && this.length > 0) {
3662                h = a(this[0]);
3663                var p = h.data(a.mask.dataName);
3664                return p ? p() : void 0
3665            }
3666            return g = a.extend({
3667                autoclear: a.mask.autoclear,
3668                placeholder: a.mask.placeholder,
3669                completed: null
3670            }, g), i = a.mask.definitions, j = [], k = n = c.length, l = null, a.each(c.split(""), function(a, b) {
3671                "?" == b ? (n--, k = a) : i[b] ? (j.push(new RegExp(i[b])), null === l && (l = j.length - 1), k > a && (m = j.length - 1)) : j.push(null)
3672            }), this.trigger("unmask").each(function() {
3673                function h() {
3674                    if (g.completed) {
3675                        for (var a = l; m >= a; a++)
3676                            if (j[a] && C[a] === p(a))
3677                                return;
3678                        g.completed.call(B)
3679                    }
3680                }
3681                function p(a) {
3682                    return g.placeholder.charAt(a < g.placeholder.length ? a : 0)
3683                }
3684                function q(a) {
3685                    for (; ++a < n&&!j[a];);
3686                    return a
3687                }
3688                function r(a) {
3689                    for (; --a >= 0&&!j[a];);
3690                    return a
3691                }
3692                function s(a, b) {
3693                    var c, d;
3694                    if (!(0 > a)) {
3695                        for (c = a, d = q(b); n > c; c++)
3696                            if (j[c]) {
3697                                if (!(n > d && j[c].test(C[d])))
3698                                    break;
3699                                    C[c] = C[d], C[d] = p(d), d = q(d)
3700                            }
3701                        z(), B.caret(Math.max(l, a))
3702                    }
3703                }
3704                function t(a) {
3705                    var b, c, d, e;
3706                    for (b = a, c = p(a); n > b; b++)
3707                        if (j[b]) {
3708                            if (d = q(b), e = C[b], C[b] = c, !(n > d && j[d].test(e)))
3709                                break;
3710                                c = e
3711                        }
3712                }
3713                function u() {
3714                    var a = B.val(), b = B.caret();
3715                    if (a.length < o.length) {
3716                        for (A(!0); b.begin > 0&&!j[b.begin - 1];)
3717                            b.begin--;
3718                        if (0 === b.begin)
3719                            for (; b.begin < l&&!j[b.begin];)
3720                                b.begin++;
3721                        B.caret(b.begin, b.begin)
3722                    } else {
3723                        for (A(!0); b.begin < n&&!j[b.begin];)
3724                            b.begin++;
3725                        B.caret(b.begin, b.begin)
3726                    }
3727                    h()
3728                }
3729                function v() {
3730                    A(), B.val() != E && B.change()
3731                }
3732                function w(a) {
3733                    if (!B.prop("readonly")) {
3734                        var b, c, e, f = a.which || a.keyCode;
3735                        o = B.val(), 8 === f || 46 === f || d && 127 === f ? (b = B.caret(), c = b.begin, e = b.end, e - c === 0 && (c = 46 !== f ? r(c) : e = q(c - 1), e = 46 === f ? q(e) : e), y(c, e), s(c, e - 1), a.preventDefault()) : 13 === f ? v.call(this, a) : 27 === f && (B.val(E), B.caret(0, A()), a.preventDefault())
3736                    }
3737                }
3738                function x(b) {
3739                    if (!B.prop("readonly")) {
3740                        var c, d, e, g = b.which || b.keyCode, i = B.caret();
3741                        if (!(b.ctrlKey || b.altKey || b.metaKey || 32 > g) && g && 13 !== g) {
3742                            if (i.end - i.begin !== 0 && (y(i.begin, i.end), s(i.begin, i.end - 1)), c = q(i.begin - 1), n > c && (d = String.fromCharCode(g), j[c].test(d))) {
3743                                if (t(c), C[c] = d, z(), e = q(c), f) {
3744                                    var k = function() {
3745                                        a.proxy(a.fn.caret, B, e)()
3746                                    };
3747                                    setTimeout(k, 0)
3748                                } else 
3749                                    B.caret(e);
3750                                i.begin <= m && h()
3751                            }
3752                            b.preventDefault()
3753                        }
3754                    }
3755                }
3756                function y(a, b) {
3757                    var c;
3758                    for (c = a; b > c && n > c; c++)
3759                        j[c] && (C[c] = p(c))
3760                }
3761                function z() {
3762                    B.val(C.join(""))
3763                }
3764                function A(a) {
3765                    var b, c, d, e = B.val(), f =- 1;
3766                    for (b = 0, d = 0; n > b; b++)
3767                        if (j[b]) {
3768                            for (C[b] = p(b);
3769                            d++<e.length;
3770                            )if (c = e.charAt(d - 1), j[b].test(c)) {
3771                                C[b] = c, f = b;
3772                                break
3773                            }
3774                            if (d > e.length) {
3775                                y(b + 1, n);
3776                                break
3777                            }
3778                        } else 
3779                            C[b] === e.charAt(d) && d++, k > b && (f = b);
3780                    return a ? z() : k > f + 1 ? g.autoclear || C.join("") === D ? (B.val() && B.val(""), y(0, n)) : z() : (z(), B.val(B.val().substring(0, f + 1))), k ? b : l
3781                }
3782                var B = a(this), C = a.map(c.split(""), function(a, b) {
3783                    return "?" != a ? i[a] ? p(b) : a : void 0
3784                }), D = C.join(""), E = B.val();
3785                B.data(a.mask.dataName, function() {
3786                    return a.map(C, function(a, b) {
3787                        return j[b] && a != p(b) ? a : null
3788                    }).join("")
3789                }), B.one("unmask", function() {
3790                    B.off(".mask").removeData(a.mask.dataName)
3791                }).on("focus.mask", function() {
3792                    if (!B.prop("readonly")) {
3793                        clearTimeout(b);
3794                        var a;
3795                        E = B.val(), a = A(), b = setTimeout(function() {
3796                            z(), a == c.replace("?", "").length ? B.caret(0, a) : B.caret(a)
3797                        }, 10)
3798                    }
3799                }).on("blur.mask", v).on("keydown.mask", w).on("keypress.mask", x).on("input.mask paste.mask", function() {
3800                    B.prop("readonly") || setTimeout(function() {
3801                        var a = A(!0);
3802                        B.caret(a), h()
3803                    }, 0)
3804                }), e && f && B.off("input.mask").on("input.mask", u), A()
3805            })
3806        }
3807    })
3808});
3809
3810/*!
3811 * Bootstrap v3.3.0 (http://getbootstrap.com)
3812 * Copyright 2011-2014 Twitter, Inc.
3813 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3814 */
3815if ("undefined" == typeof jQuery)
3816    throw new Error("Bootstrap's JavaScript requires jQuery");
3817+ function(a) {
3818    var b = a.fn.jquery.split(" ")[0].split(".");
3819    if (b[0] < 2 && b[1] < 9 || 1 == b[0] && 9 == b[1] && b[2] < 1)
3820        throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")
3821}(jQuery), + function(a) {
3822    "use strict";
3823    function b() {
3824        var a = document.createElement("bootstrap"), b = {
3825            WebkitTransition: "webkitTransitionEnd",
3826            MozTransition: "transitionend",
3827            OTransition: "oTransitionEnd otransitionend",
3828            transition: "transitionend"
3829        };
3830        for (var c in b)
3831            if (void 0 !== a.style[c])
3832                return {
3833                    end: b[c]
3834                };
3835        return !1
3836    }
3837    a.fn.emulateTransitionEnd = function(b) {
3838        var c=!1, d = this;
3839        a(this).one("bsTransitionEnd", function() {
3840            c=!0
3841        });
3842        var e = function() {
3843            c || a(d).trigger(a.support.transition.end)
3844        };
3845        return setTimeout(e, b), this
3846    }, a(function() {
3847        a.support.transition = b(), a.support.transition && (a.event.special.bsTransitionEnd = {
3848            bindType: a.support.transition.end,
3849            delegateType: a.support.transition.end,
3850            handle: function(b) {
3851                return a(b.target).is(this) ? b.handleObj.handler.apply(this, arguments) : void 0
3852            }
3853        })
3854    })
3855}(jQuery), + function(a) {
3856    "use strict";
3857    function b(b) {
3858        return this.each(function() {
3859            var c = a(this), e = c.data("bs.alert");
3860            e || c.data("bs.alert", e = new d(this)), "string" == typeof b && e[b].call(c)
3861        })
3862    }
3863    var c = '[data-dismiss="alert"]', d = function(b) {
3864        a(b).on("click", c, this.close)
3865    };
3866    d.VERSION = "3.3.0", d.TRANSITION_DURATION = 150, d.prototype.close = function(b) {
3867        function c() {
3868            g.detach().trigger("closed.bs.alert").remove()
3869        }
3870        var e = a(this), f = e.attr("data-target");
3871        f || (f = e.attr("href"), f = f && f.replace(/.*(?=#[^\s]*$)/, ""));
3872        var g = a(f);
3873        b && b.preventDefault(), g.length || (g = e.closest(".alert")), g.trigger(b = a.Event("close.bs.alert")), b.isDefaultPrevented() || (g.removeClass("in"), a.support.transition && g.hasClass("fade") ? g.one("bsTransitionEnd", c).emulateTransitionEnd(d.TRANSITION_DURATION) : c())
3874    };
3875    var e = a.fn.alert;
3876    a.fn.alert = b, a.fn.alert.Constructor = d, a.fn.alert.noConflict = function() {
3877        return a.fn.alert = e, this
3878    }, a(document).on("click.bs.alert.data-api", c, d.prototype.close)
3879}(jQuery), + function(a) {
3880    "use strict";
3881    function b(b) {
3882        return this.each(function() {
3883            var d = a(this), e = d.data("bs.button"), f = "object" == typeof b && b;
3884            e || d.data("bs.button", e = new c(this, f)), "toggle" == b ? e.toggle(
vendor: 41,847 bytes, lines 3884-4609
3884) : b && e.setState(b)
3885        })
3886    }
3887    var c = function(b, d) {
3888        this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.isLoading=!1
3889    };
3890    c.VERSION = "3.3.0", c.DEFAULTS = {
3891        loadingText: "loading..."
3892    }, c.prototype.setState = function(b) {
3893        var c = "disabled", d = this.$element, e = d.is("input") ? "val": "html", f = d.data();
3894        b += "Text", null == f.resetText && d.data("resetText", d[e]()), setTimeout(a.proxy(function() {
3895            d[e](null == f[b] ? this.options[b] : f[b]), "loadingText" == b ? (this.isLoading=!0, d.addClass(c).attr(c, c)) : this.isLoading && (this.isLoading=!1, d.removeClass(c).removeAttr(c))
3896        }, this), 0)
3897    }, c.prototype.toggle = function() {
3898        var a=!0, b = this.$element.closest('[data-toggle="buttons"]');
3899        if (b.length) {
3900            var c = this.$element.find("input");
3901            "radio" == c.prop("type") && (c.prop("checked") && this.$element.hasClass("active") ? a=!1 : b.find(".active").removeClass("active")), a && c.prop("checked", !this.$element.hasClass("active")).trigger("change")
3902        } else 
3903            this.$element.attr("aria-pressed", !this.$element.hasClass("active"));
3904        a && this.$element.toggleClass("active")
3905    };
3906    var d = a.fn.button;
3907    a.fn.button = b, a.fn.button.Constructor = c, a.fn.button.noConflict = function() {
3908        return a.fn.button = d, this
3909    }, a(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(c) {
3910        var d = a(c.target);
3911        d.hasClass("btn") || (d = d.closest(".btn")), b.call(d, "toggle"), c.preventDefault()
3912    }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(b) {
3913        a(b.target).closest(".btn").toggleClass("focus", "focus" == b.type)
3914    })
3915}(jQuery), + function(a) {
3916    "use strict";
3917    function b(b) {
3918        return this.each(function() {
3919            var d = a(this), e = d.data("bs.carousel"), f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b), g = "string" == typeof b ? b: f.slide;
3920            e || d.data("bs.carousel", e = new c(this, f)), "number" == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle()
3921        })
3922    }
3923    var c = function(b, c) {
3924        this.$element = a(b), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = this.sliding = this.interval = this.$active = this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", a.proxy(this.keydown, this)), "hover" == this.options.pause&&!("ontouchstart"in document.documentElement) && this.$element.on("mouseenter.bs.carousel", a.proxy(this.pause, this)).on("mouseleave.bs.carousel", a.proxy(this.cycle, this))
3925    };
3926    c.VERSION = "3.3.0", c.TRANSITION_DURATION = 600, c.DEFAULTS = {
3927        interval: 5e3,
3928        pause: "hover",
3929        wrap: !0,
3930        keyboard: !0
3931    }, c.prototype.keydown = function(a) {
3932        switch (a.which) {
3933        case 37:
3934            this.prev();
3935            break;
3936        case 39:
3937            this.next();
3938            break;
3939        default:
3940            return 
3941        }
3942        a.preventDefault()
3943    }, c.prototype.cycle = function(b) {
3944        return b || (this.paused=!1), this.interval && clearInterval(this.interval), this.options.interval&&!this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this
3945    }, c.prototype.getItemIndex = function(a) {
3946        return this.$items = a.parent().children(".item"), this.$items.index(a || this.$active)
3947    }, c.prototype.getItemForDirection = function(a, b) {
3948        var c = "prev" == a?-1 : 1, d = this.getItemIndex(b), e = (d + c)%this.$items.length;
3949        return this.$items.eq(e)
3950    }, c.prototype.to = function(a) {
3951        var b = this, c = this.getItemIndex(this.$active = this.$element.find(".item.active"));
3952        return a > this.$items.length - 1 || 0 > a ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() {
3953            b.to(a)
3954        }) : c == a ? this.pause().cycle() : this.slide(a > c ? "next" : "prev", this.$items.eq(a))
3955    }, c.prototype.pause = function(b) {
3956        return b || (this.paused=!0), this.$element.find(".next, .prev").length && a.support.transition && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this
3957    }, c.prototype.next = function() {
3958        return this.sliding ? void 0 : this.slide("next")
3959    }, c.prototype.prev = function() {
3960        return this.sliding ? void 0 : this.slide("prev")
3961    }, c.prototype.slide = function(b, d) {
3962        var e = this.$element.find(".item.active"), f = d || this.getItemForDirection(b, e), g = this.interval, h = "next" == b ? "left": "right", i = "next" == b ? "first": "last", j = this;
3963        if (!f.length) {
3964            if (!this.options.wrap)
3965                return;
3966            f = this.$element.find(".item")[i]()
3967        }
3968        if (f.hasClass("active"))
3969            return this.sliding=!1;
3970        var k = f[0], l = a.Event("slide.bs.carousel", {
3971            relatedTarget: k,
3972            direction: h
3973        });
3974        if (this.$element.trigger(l), !l.isDefaultPrevented()) {
3975            if (this.sliding=!0, g && this.pause(), this.$indicators.length) {
3976                this.$indicators.find(".active").removeClass("active");
3977                var m = a(this.$indicators.children()[this.getItemIndex(f)]);
3978                m && m.addClass("active")
3979            }
3980            var n = a.Event("slid.bs.carousel", {
3981                relatedTarget: k,
3982                direction: h
3983            });
3984            return a.support.transition && this.$element.hasClass("slide") ? (f.addClass(b), f[0].offsetWidth, e.addClass(h), f.addClass(h), e.one("bsTransitionEnd", function() {
3985                f.removeClass([b, h].join(" ")).addClass("active"), e.removeClass(["active", h].join(" ")), j.sliding=!1, setTimeout(function() {
3986                    j.$element.trigger(n)
3987                }, 0)
3988            }).emulateTransitionEnd(c.TRANSITION_DURATION)) : (e.removeClass("active"), f.addClass("active"), this.sliding=!1, this.$element.trigger(n)), g && this.cycle(), this
3989        }
3990    };
3991    var d = a.fn.carousel;
3992    a.fn.carousel = b, a.fn.carousel.Constructor = c, a.fn.carousel.noConflict = function() {
3993        return a.fn.carousel = d, this
3994    };
3995    var e = function(c) {
3996        var d, e = a(this), f = a(e.attr("data-target") || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""));
3997        if (f.hasClass("carousel")) {
3998            var g = a.extend({}, f.data(), e.data()), h = e.attr("data-slide-to");
3999            h && (g.interval=!1), b.call(f, g), h && f.data("bs.carousel").to(h), c.preventDefault()
4000        }
4001    };
4002    a(document).on("click.bs.carousel.data-api", "[data-slide]", e).on("click.bs.carousel.data-api", "[data-slide-to]", e), a(window).on("load", function() {
4003        a('[data-ride="carousel"]').each(function() {
4004            var c = a(this);
4005            b.call(c, c.data())
4006        })
4007    })
4008}(jQuery), + function(a) {
4009    "use strict";
4010    function b(b) {
4011        var c, d = b.attr("data-target") || (c = b.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, "");
4012        return a(d)
4013    }
4014    function c(b) {
4015        return this.each(function() {
4016            var c = a(this), e = c.data("bs.collapse"), f = a.extend({}, d.DEFAULTS, c.data(), "object" == typeof b && b);
4017            !e && f.toggle && "show" == b && (f.toggle=!1), e || c.data("bs.collapse", e = new d(this, f)), "string" == typeof b && e[b]()
4018        })
4019    }
4020    var d = function(b, c) {
4021        this.$element = a(b), this.options = a.extend({}, d.DEFAULTS, c), this.$trigger = a(this.options.trigger).filter('[href="#' + b.id + '"], [data-target="#' + b.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle()
4022    };
4023    d.VERSION = "3.3.0", d.TRANSITION_DURATION = 350, d.DEFAULTS = {
4024        toggle: !0,
4025        trigger: '[data-toggle="collapse"]'
4026    }, d.prototype.dimension = function() {
4027        var a = this.$element.hasClass("width");
4028        return a ? "width" : "height"
4029    }, d.prototype.show = function() {
4030        if (!this.transitioning&&!this.$element.hasClass("in")) {
4031            var b, e = this.$parent && this.$parent.find("> .panel").children(".in, .collapsing");
4032            if (!(e && e.length && (b = e.data("bs.collapse"), b && b.transitioning))) {
4033                var f = a.Event("show.bs.collapse");
4034                if (this.$element.trigger(f), !f.isDefaultPrevented()) {
4035                    e && e.length && (c.call(e, "hide"), b || e.data("bs.collapse", null));
4036                    var g = this.dimension();
4037                    this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1;
4038                    var h = function() {
4039                        this.$element.removeClass("collapsing").addClass("collapse in")[g](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse")
4040                    };
4041                    if (!a.support.transition)
4042                        return h.call(this);
4043                    var i = a.camelCase(["scroll", g].join("-"));
4044                    this.$element.one("bsTransitionEnd", a.proxy(h, this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])
4045                }
4046            }
4047        }
4048    }, d.prototype.hide = function() {
4049        if (!this.transitioning && this.$element.hasClass("in")) {
4050            var b = a.Event("hide.bs.collapse");
4051            if (this.$element.trigger(b), !b.isDefaultPrevented()) {
4052                var c = this.dimension();
4053                this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1;
4054                var e = function() {
4055                    this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")
4056                };
4057                return a.support.transition ? void this.$element[c](0).one("bsTransitionEnd", a.proxy(e, this)).emulateTransitionEnd(d.TRANSITION_DURATION) : e.call(this)
4058            }
4059        }
4060    }, d.prototype.toggle = function() {
4061        this[this.$element.hasClass("in") ? "hide": "show"]()
4062    }, d.prototype.getParent = function() {
4063        return a(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(a.proxy(function(c, d) {
4064            var e = a(d);
4065            this.addAriaAndCollapsedClass(b(e), e)
4066        }, this)).end()
4067    }, d.prototype.addAriaAndCollapsedClass = function(a, b) {
4068        var c = a.hasClass("in");
4069        a.attr("aria-expanded", c), b.toggleClass("collapsed", !c).attr("aria-expanded", c)
4070    };
4071    var e = a.fn.collapse;
4072    a.fn.collapse = c, a.fn.collapse.Constructor = d, a.fn.collapse.noConflict = function() {
4073        return a.fn.collapse = e, this
4074    }, a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(d) {
4075        var e = a(this);
4076        e.attr("data-target") || d.preventDefault();
4077        var f = b(e), g = f.data("bs.collapse"), h = g ? "toggle": a.extend({}, e.data(), {
4078            trigger: this
4079        });
4080        c.call(f, h)
4081    })
4082}(jQuery), + function(a) {
4083    "use strict";
4084    function b(b) {
4085        b && 3 === b.which || (a(e).remove(), a(f).each(function() {
4086            var d = a(this), e = c(d), f = {
4087                relatedTarget: this
4088            };
4089            e.hasClass("open") && (e.trigger(b = a.Event("hide.bs.dropdown", f)), b.isDefaultPrevented() || (d.attr("aria-expanded", "false"), e.removeClass("open").trigger("hidden.bs.dropdown", f)))
4090        }))
4091    }
4092    function c(b) {
4093        var c = b.attr("data-target");
4094        c || (c = b.attr("href"), c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, ""));
4095        var d = c && a(c);
4096        return d && d.length ? d : b.parent()
4097    }
4098    function d(b) {
4099        return this.each(function() {
4100            var c = a(this), d = c.data("bs.dropdown");
4101            d || c.data("bs.dropdown", d = new g(this)), "string" == typeof b && d[b].call(c)
4102        })
4103    }
4104    var e = ".dropdown-backdrop", f = '[data-toggle="dropdown"]', g = function(b) {
4105        a(b).on("click.bs.dropdown", this.toggle)
4106    };
4107    g.VERSION = "3.3.0", g.prototype.toggle = function(d) {
4108        var e = a(this);
4109        if (!e.is(".disabled, :disabled")) {
4110            var f = c(e), g = f.hasClass("open");
4111            if (b(), !g) {
4112                "ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length && a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click", b);
4113                var h = {
4114                    relatedTarget: this
4115                };
4116                if (f.trigger(d = a.Event("show.bs.dropdown", h)), d.isDefaultPrevented())
4117                    return;
4118                e.trigger("focus").attr("aria-expanded", "true"), f.toggleClass("open").trigger("shown.bs.dropdown", h)
4119            }
4120            return !1
4121        }
4122    }, g.prototype.keydown = function(b) {
4123        if (/(38|40|27|32)/.test(b.which)) {
4124            var d = a(this);
4125            if (b.preventDefault(), b.stopPropagation(), !d.is(".disabled, :disabled")) {
4126                var e = c(d), g = e.hasClass("open");
4127                if (!g && 27 != b.which || g && 27 == b.which)
4128                    return 27 == b.which && e.find(f).trigger("focus"), d.trigger("click");
4129                var h = " li:not(.divider):visible a", i = e.find('[role="menu"]' + h + ', [role="listbox"]' + h);
4130                if (i.length) {
4131                    var j = i.index(b.target);
4132                    38 == b.which && j > 0 && j--, 40 == b.which && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).trigger("focus")
4133                }
4134            }
4135        }
4136    };
4137    var h = a.fn.dropdown;
4138    a.fn.dropdown = d, a.fn.dropdown.Constructor = g, a.fn.dropdown.noConflict = function() {
4139        return a.fn.dropdown = h, this
4140    }, a(document).on("click.bs.dropdown.data-api", b).on("click.bs.dropdown.data-api", ".dropdown form", function(a) {
4141        a.stopPropagation()
4142    }).on("click.bs.dropdown.data-api", f, g.prototype.toggle).on("keydown.bs.dropdown.data-api", f, g.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="menu"]', g.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="listbox"]', g.prototype.keydown)
4143}(jQuery), + function(a) {
4144    "use strict";
4145    function b(b, d) {
4146        return this.each(function() {
4147            var e = a(this), f = e.data("bs.modal"), g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b);
4148            f || e.data("bs.modal", f = new c(this, g)), "string" == typeof b ? f[b](d) : g.show && f.show(d)
4149        })
4150    }
4151    var c = function(b, c) {
4152        this.options = c, this.$body = a(document.body), this.$element = a(b), this.$backdrop = this.isShown = null, this.scrollbarWidth = 0, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, a.proxy(function() {
4153            this.$element.trigger("loaded.bs.modal")
4154        }, this))
4155    };
4156    c.VERSION = "3.3.0", c.TRANSITION_DURATION = 300, c.BACKDROP_TRANSITION_DURATION = 150, c.DEFAULTS = {
4157        backdrop: !0,
4158        keyboard: !0,
4159        show: !0
4160    }, c.prototype.toggle = function(a) {
4161        return this.isShown ? this.hide() : this.show(a)
4162    }, c.prototype.show = function(b) {
4163        var d = this, e = a.Event("show.bs.modal", {
4164            relatedTarget: b
4165        });
4166        this.$element.trigger(e), this.isShown || e.isDefaultPrevented() || (this.isShown=!0, this.checkScrollbar(), this.$body.addClass("modal-open"), this.setScrollbar(), this.escape(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.backdrop(function() {
4167            var e = a.support.transition && d.$element.hasClass("fade");
4168            d.$element.parent().length || d.$element.appendTo(d.$body), d.$element.show().scrollTop(0), e && d.$element[0].offsetWidth, d.$element.addClass("in").attr("aria-hidden", !1), d.enforceFocus();
4169            var f = a.Event("shown.bs.modal", {
4170                relatedTarget: b
4171            });
4172            e ? d.$element.find(".modal-dialog").one("bsTransitionEnd", function() {
4173                d.$element.trigger("focus").trigger(f)
4174            }).emulateTransitionEnd(c.TRANSITION_DURATION) : d.$element.trigger("focus").trigger(f)
4175        }))
4176    }, c.prototype.hide = function(b) {
4177        b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b), this.isShown&&!b.isDefaultPrevented() && (this.isShown=!1, this.escape(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.bs.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", a.proxy(this.hideModal, this)).emulateTransitionEnd(c.TRANSITION_DURATION) : this.hideModal())
4178    }, c.prototype.enforceFocus = function() {
4179        a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function(a) {
4180            this.$element[0] === a.target || this.$element.has(a.target).length || this.$element.trigger("focus")
4181        }, this))
4182    }, c.prototype.escape = function() {
4183        this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", a.proxy(function(a) {
4184            27 == a.which && this.hide()
4185        }, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal")
4186    }, c.prototype.hideModal = function() {
4187        var a = this;
4188        this.$element.hide(), this.backdrop(function() {
4189            a.$body.removeClass("modal-open"), a.resetScrollbar(), a.$element.trigger("hidden.bs.modal")
4190        })
4191    }, c.prototype.removeBackdrop = function() {
4192        this.$backdrop && this.$backdrop.remove(), this.$backdrop = null
4193    }, c.prototype.backdrop = function(b) {
4194        var d = this, e = this.$element.hasClass("fade") ? "fade": "";
4195        if (this.isShown && this.options.backdrop) {
4196            var f = a.support.transition && e;
4197            if (this.$backdrop = a('<div class="modal-backdrop ' + e + '" />').prependTo(this.$element).on("click.dismiss.bs.modal", a.proxy(function(a) {
4198                a.target === a.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this))
4199            }, this)), f && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !b)
4200                return;
4201            f ? this.$backdrop.one("bsTransitionEnd", b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : b()
4202        } else if (!this.isShown && this.$backdrop) {
4203            this.$backdrop.removeClass("in");
4204            var g = function() {
4205                d.removeBackdrop(), b && b()
4206            };
4207            a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) : g()
4208        } else 
4209            b && b()
4210    }, c.prototype.checkScrollbar = function() {
4211        this.scrollbarWidth = this.measureScrollbar()
4212    }, c.prototype.setScrollbar = function() {
4213        var a = parseInt(this.$body.css("padding-right") || 0, 10);
4214        this.scrollbarWidth && this.$body.css("padding-right", a + this.scrollbarWidth)
4215    }, c.prototype.resetScrollbar = function() {
4216        this.$body.css("padding-right", "")
4217    }, c.prototype.measureScrollbar = function() {
4218        if (document.body.clientWidth >= window.innerWidth)
4219            return 0;
4220        var a = document.createElement("div");
4221        a.className = "modal-scrollbar-measure", this.$body.append(a);
4222        var b = a.offsetWidth - a.clientWidth;
4223        return this.$body[0].removeChild(a), b
4224    };
4225    var d = a.fn.modal;
4226    a.fn.modal = b, a.fn.modal.Constructor = c, a.fn.modal.noConflict = function() {
4227        return a.fn.modal = d, this
4228    }, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(c) {
4229        var d = a(this), e = d.attr("href"), f = a(d.attr("data-target") || e && e.replace(/.*(?=#[^\s]+$)/, "")), g = f.data("bs.modal") ? "toggle": a.extend({
4230            remote: !/#/.test(e) && e
4231        }, f.data(), d.data());
4232        d.is("a") && c.preventDefault(), f.one("show.bs.modal", function(a) {
4233            a.isDefaultPrevented() || f.one("hidden.bs.modal", function() {
4234                d.is(":visible") && d.trigger("focus")
4235            })
4236        }), b.call(f, g, this)
4237    })
4238}(jQuery), + function(a) {
4239    "use strict";
4240    function b(b) {
4241        return this.each(function() {
4242            var d = a(this), e = d.data("bs.tooltip"), f = "object" == typeof b && b, g = f && f.selector;
4243            (e || "destroy" != b) && (g ? (e || d.data("bs.tooltip", e = {}), e[g] || (e[g] = new c(this, f))) : e || d.data("bs.tooltip", e = new c(this, f)), "string" == typeof b && e[b]())
4244        })
4245    }
4246    var c = function(a, b) {
4247        this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", a, b)
4248    };
4249    c.VERSION = "3.3.0", c.TRANSITION_DURATION = 150, c.DEFAULTS = {
4250        animation: !0,
4251        placement: "top",
4252        selector: !1,
4253        template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
4254        trigger: "hover focus",
4255        title: "",
4256        delay: 0,
4257        html: !1,
4258        container: !1,
4259        viewport: {
4260            selector: "body",
4261            padding: 0
4262        }
4263    }, c.prototype.init = function(b, c, d) {
4264        this.enabled=!0, this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.$viewport = this.options.viewport && a(this.options.viewport.selector || this.options.viewport);
4265        for (var e = this.options.trigger.split(" "), f = e.length; f--;) {
4266            var g = e[f];
4267            if ("click" == g)
4268                this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this));
4269            else if ("manual" != g) {
4270                var h = "hover" == g ? "mouseenter": "focusin", i = "hover" == g ? "mouseleave": "focusout";
4271                this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this))
4272            }
4273        }
4274        this.options.selector ? this._options = a.extend({}, this.options, {
4275            trigger: "manual",
4276            selector: ""
4277        }) : this.fixTitle()
4278    }, c.prototype.getDefaults = function() {
4279        return c.DEFAULTS
4280    }, c.prototype.getOptions = function(b) {
4281        return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && "number" == typeof b.delay && (b.delay = {
4282            show: b.delay,
4283            hide: b.delay
4284        }), b
4285    }, c.prototype.getDelegateOptions = function() {
4286        var b = {}, c = this.getDefaults();
4287        return this._options && a.each(this._options, function(a, d) {
4288            c[a] != d && (b[a] = d)
4289        }), b
4290    }, c.prototype.enter = function(b) {
4291        var c = b instanceof this.constructor ? b: a(b.currentTarget).data("bs." + this.type);
4292        return c && c.$tip && c.$tip.is(":visible") ? void(c.hoverState = "in") : (c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "in", c.options.delay && c.options.delay.show ? void(c.timeout = setTimeout(function() {
4293            "in" == c.hoverState && c.show()
4294        }, c.options.delay.show)) : c.show())
4295    }, c.prototype.leave = function(b) {
4296        var c = b instanceof this.constructor ? b: a(b.currentTarget).data("bs." + this.type);
4297        return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "out", c.options.delay && c.options.delay.hide ? void(c.timeout = setTimeout(function() {
4298            "out" == c.hoverState && c.hide()
4299        }, c.options.delay.hide)) : c.hide()
4300    }, c.prototype.show = function() {
4301        var b = a.Event("show.bs." + this.type);
4302        if (this.hasContent() && this.enabled) {
4303            this.$element.trigger(b);
4304            var d = a.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
4305            if (b.isDefaultPrevented() ||!d)
4306                return;
4307            var e = this, f = this.tip(), g = this.getUID(this.type);
4308            this.setContent(), f.attr("id", g), this.$element.attr("aria-describedby", g), this.options.animation && f.addClass("fade");
4309            var h = "function" == typeof this.options.placement ? this.options.placement.call(this, f[0], this.$element[0]): this.options.placement, i = /\s?auto?\s?/i, j = i.test(h);
4310            j && (h = h.replace(i, "") || "top"), f.detach().css({
4311                top: 0,
4312                left: 0,
4313                display: "block"
4314            }).addClass(h).data("bs." + this.type, this), this.options.container ? f.appendTo(this.options.container) : f.insertAfter(this.$element);
4315            var k = this.getPosition(), l = f[0].offsetWidth, m = f[0].offsetHeight;
4316            if (j) {
4317                var n = h, o = this.options.container ? a(this.options.container): this.$element.parent(), p = this.getPosition(o);
4318                h = "bottom" == h && k.bottom + m > p.bottom ? "top" : "top" == h && k.top - m < p.top ? "bottom" : "right" == h && k.right + l > p.width ? "left" : "left" == h && k.left - l < p.left ? "right" : h, f.removeClass(n).addClass(h)
4319            }
4320            var q = this.getCalculatedOffset(h, k, l, m);
4321            this.applyPlacement(q, h);
4322            var r = function() {
4323                var a = e.hoverState;
4324                e.$element.trigger("shown.bs." + e.type), e.hoverState = null, "out" == a && e.leave(e)
4325            };
4326            a.support.transition && this.$tip.hasClass("fade") ? f.one("bsTransitionEnd", r).emulateTransitionEnd(c.TRANSITION_DURATION) : r()
4327        }
4328    }, c.prototype.applyPlacement = function(b, c) {
4329        var d = this.tip(), e = d[0].offsetWidth, f = d[0].offsetHeight, g = parseInt(d.css("margin-top"), 10), h = parseInt(d.css("margin-left"), 10);
4330        isNaN(g) && (g = 0), isNaN(h) && (h = 0), b.top = b.top + g, b.left = b.left + h, a.offset.setOffset(d[0], a.extend({
4331            using: function(a) {
4332                d.css({
4333                    top: Math.round(a.top),
4334                    left: Math.round(a.left)
4335                })
4336            }
4337        }, b), 0), d.addClass("in");
4338        var i = d[0].offsetWidth, j = d[0].offsetHeight;
4339        "top" == c && j != f && (b.top = b.top + f - j);
4340        var k = this.getViewportAdjustedDelta(c, b, i, j);
4341        k.left ? b.left += k.left : b.top += k.top;
4342        var l = /top|bottom/.test(c), m = l ? 2 * k.left - e + i: 2 * k.top - f + j, n = l ? "offsetWidth": "offsetHeight";
4343        d.offset(b), this.replaceArrow(m, d[0][n], l)
4344    }, c.prototype.replaceArrow = function(a, b, c) {
4345        this.arrow().css(c ? "left" : "top", 50 * (1 - a / b) + "%").css(c ? "top" : "left", "")
4346    }, c.prototype.setContent = function() {
4347        var a = this.tip(), b = this.getTitle();
4348        a.find(".tooltip-inner")[this.options.html ? "html": "text"](b), a.removeClass("fade in top bottom left right")
4349    }, c.prototype.hide = function(b) {
4350        function d() {
4351            "in" != e.hoverState && f.detach(), e.$element.removeAttr("aria-describedby").trigger("hidden.bs." + e.type), b && b()
4352        }
4353        var e = this, f = this.tip(), g = a.Event("hide.bs." + this.type);
4354        return this.$element.trigger(g), g.isDefaultPrevented() ? void 0 : (f.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? f.one("bsTransitionEnd", d).emulateTransitionEnd(c.TRANSITION_DURATION) : d(), this.hoverState = null, this)
4355    }, c.prototype.fixTitle = function() {
4356        var a = this.$element;
4357        (a.attr("title") || "string" != typeof a.attr("data-original-title")) && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
4358    }, c.prototype.hasContent = function() {
4359        return this.getTitle()
4360    }, c.prototype.getPosition = function(b) {
4361        b = b || this.$element;
4362        var c = b[0], d = "BODY" == c.tagName, e = c.getBoundingClientRect();
4363        null == e.width && (e = a.extend({}, e, {
4364            width: e.right - e.left,
4365            height: e.bottom - e.top
4366        }));
4367        var f = d ? {
4368            top: 0,
4369            left: 0
4370        }
4371        : b.offset(), g = {
4372            scroll: d ? document.documentElement.scrollTop || document.body.scrollTop: b.scrollTop()
4373        }, h = d ? {
4374            width: a(window).width(),
4375            height: a(window).height()
4376        }
4377        : null;
4378        return a.extend({}, e, g, h, f)
4379    }, c.prototype.getCalculatedOffset = function(a, b, c, d) {
4380        return "bottom" == a ? {
4381            top: b.top + b.height,
4382            left: b.left + b.width / 2 - c / 2
4383        } : "top" == a ? {
4384            top: b.top - d,
4385            left: b.left + b.width / 2 - c / 2
4386        } : "left" == a ? {
4387            top: b.top + b.height / 2 - d / 2,
4388            left: b.left - c
4389        } : {
4390            top: b.top + b.height / 2 - d / 2,
4391            left: b.left + b.width
4392        }
4393    }, c.prototype.getViewportAdjustedDelta = function(a, b, c, d) {
4394        var e = {
4395            top: 0,
4396            left: 0
4397        };
4398        if (!this.$viewport)
4399            return e;
4400        var f = this.options.viewport && this.options.viewport.padding || 0, g = this.getPosition(this.$viewport);
4401        if (/right|left/.test(a)) {
4402            var h = b.top - f - g.scroll, i = b.top + f - g.scroll + d;
4403            h < g.top ? e.top = g.top - h : i > g.top + g.height && (e.top = g.top + g.height - i)
4404        } else {
4405            var j = b.left - f, k = b.left + f + c;
4406            j < g.left ? e.left = g.left - j : k > g.width && (e.left = g.left + g.width - k)
4407        }
4408        return e
4409    }, c.prototype.getTitle = function() {
4410        var a, b = this.$element, c = this.options;
4411        return a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title)
4412    }, c.prototype.getUID = function(a) {
4413        do 
4414            a+=~~(1e6 * Math.random());
4415        while (document.getElementById(a));
4416        return a
4417    }, c.prototype.tip = function() {
4418        return this.$tip = this.$tip || a(this.options.template)
4419    }, c.prototype.arrow = function() {
4420        return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
4421    }, c.prototype.enable = function() {
4422        this.enabled=!0
4423    }, c.prototype.disable = function() {
4424        this.enabled=!1
4425    }, c.prototype.toggleEnabled = function() {
4426        this.enabled=!this.enabled
4427    }, c.prototype.toggle = function(b) {
4428        var c = this;
4429        b && (c = a(b.currentTarget).data("bs." + this.type), c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c))), c.tip().hasClass("in") ? c.leave(c) : c.enter(c)
4430    }, c.prototype.destroy = function() {
4431        var a = this;
4432        clearTimeout(this.timeout), this.hide(function() {
4433            a.$element.off("." + a.type).removeData("bs." + a.type)
4434        })
4435    };
4436    var d = a.fn.tooltip;
4437    a.fn.tooltip = b, a.fn.tooltip.Constructor = c, a.fn.tooltip.noConflict = function() {
4438        return a.fn.tooltip = d, this
4439    }
4440}(jQuery), + function(a) {
4441    "use strict";
4442    function b(b) {
4443        return this.each(function() {
4444            var d = a(this), e = d.data("bs.popover"), f = "object" == typeof b && b, g = f && f.selector;
4445            (e || "destroy" != b) && (g ? (e || d.data("bs.popover", e = {}), e[g] || (e[g] = new c(this, f))) : e || d.data("bs.popover", e = new c(this, f)), "string" == typeof b && e[b]())
4446        })
4447    }
4448    var c = function(a, b) {
4449        this.init("popover", a, b)
4450    };
4451    if (!a.fn.tooltip)
4452        throw new Error("Popover requires tooltip.js");
4453    c.VERSION = "3.3.0", c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, {
4454        placement: "right",
4455        trigger: "click",
4456        content: "",
4457        template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
4458    }), c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), c.prototype.constructor = c, c.prototype.getDefaults = function() {
4459        return c.DEFAULTS
4460    }, c.prototype.setContent = function() {
4461        var a = this.tip(), b = this.getTitle(), c = this.getContent();
4462        a.find(".popover-title")[this.options.html ? "html": "text"](b), a.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof c ? "html": "append": "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide()
4463    }, c.prototype.hasContent = function() {
4464        return this.getTitle() || this.getContent()
4465    }, c.prototype.getContent = function() {
4466        var a = this.$element, b = this.options;
4467        return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
4468    }, c.prototype.arrow = function() {
4469        return this.$arrow = this.$arrow || this.tip().find(".arrow")
4470    }, c.prototype.tip = function() {
4471        return this.$tip || (this.$tip = a(this.options.template)), this.$tip
4472    };
4473    var d = a.fn.popover;
4474    a.fn.popover = b, a.fn.popover.Constructor = c, a.fn.popover.noConflict = function() {
4475        return a.fn.popover = d, this
4476    }
4477}(jQuery), + function(a) {
4478    "use strict";
4479    function b(c, d) {
4480        var e = a.proxy(this.process, this);
4481        this.$body = a("body"), this.$scrollElement = a(a(c).is("body") ? window : c), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", e), this.refresh(), this.process()
4482    }
4483    function c(c) {
4484        return this.each(function() {
4485            var d = a(this), e = d.data("bs.scrollspy"), f = "object" == typeof c && c;
4486            e || d.data("bs.scrollspy", e = new b(this, f)), "string" == typeof c && e[c]()
4487        })
4488    }
4489    b.VERSION = "3.3.0", b.DEFAULTS = {
4490        offset: 10
4491    }, b.prototype.getScrollHeight = function() {
4492        return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
4493    }, b.prototype.refresh = function() {
4494        var b = "offset", c = 0;
4495        a.isWindow(this.$scrollElement[0]) || (b = "position", c = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight();
4496        var d = this;
4497        this.$body.find(this.selector).map(function() {
4498            var d = a(this), e = d.data("target") || d.attr("href"), f = /^#./.test(e) && a(e);
4499            return f && f.length && f.is(":visible") && [[f[b]().top + c, e]] || null
4500        }).sort(function(a, b) {
4501            return a[0] - b[0]
4502        }).each(function() {
4503            d.offsets.push(this[0]), d.targets.push(this[1])
4504        })
4505    }, b.prototype.process = function() {
4506        var a, b = this.$scrollElement.scrollTop() + this.options.offset, c = this.getScrollHeight(), d = this.options.offset + c - this.$scrollElement.height(), e = this.offsets, f = this.targets, g = this.activeTarget;
4507        if (this.scrollHeight != c && this.refresh(), b >= d)
4508            return g != (a = f[f.length - 1]) && this.activate(a);
4509        if (g && b < e[0])
4510            return this.activeTarget = null, this.clear();
4511        for (a = e.length; a--;)
4512            g != f[a] && b >= e[a] && (!e[a + 1] || b <= e[a + 1]) && this.activate(f[a])
4513    }, b.prototype.activate = function(b) {
4514        this.activeTarget = b, this.clear();
4515        var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', d = a(c).parents("li").addClass("active");
4516        d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy")
4517    }, b.prototype.clear = function() {
4518        a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active")
4519    };
4520    var d = a.fn.scrollspy;
4521    a.fn.scrollspy = c, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function() {
4522        return a.fn.scrollspy = d, this
4523    }, a(window).on("load.bs.scrollspy.data-api", function() {
4524        a('[data-spy="scroll"]').each(function() {
4525            var b = a(this);
4526            c.call(b, b.data())
4527        })
4528    })
4529}(jQuery), + function(a) {
4530    "use strict";
4531    function b(b) {
4532        return this.each(function() {
4533            var d = a(this), e = d.data("bs.tab");
4534            e || d.data("bs.tab", e = new c(this)), "string" == typeof b && e[b]()
4535        })
4536    }
4537    var c = function(b) {
4538        this.element = a(b)
4539    };
4540    c.VERSION = "3.3.0", c.TRANSITION_DURATION = 150, c.prototype.show = function() {
4541        var b = this.element, c = b.closest("ul:not(.dropdown-menu)"), d = b.data("target");
4542        if (d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")), !b.parent("li").hasClass("active")) {
4543            var e = c.find(".active:last a"), f = a.Event("hide.bs.tab", {
4544                relatedTarget: b[0]
4545            }), g = a.Event("show.bs.tab", {
4546                relatedTarget: e[0]
4547            });
4548            if (e.trigger(f), b.trigger(g), !g.isDefaultPrevented()&&!f.isDefaultPrevented()) {
4549                var h = a(d);
4550                this.activate(b.closest("li"), c), this.activate(h, h.parent(), function() {
4551                    e.trigger({
4552                        type: "hidden.bs.tab",
4553                        relatedTarget: b[0]
4554                    }), b.trigger({
4555                        type: "shown.bs.tab",
4556                        relatedTarget: e[0]
4557                    })
4558                })
4559            }
4560        }
4561    }, c.prototype.activate = function(b, d, e) {
4562        function f() {
4563            g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), h ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu") && b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), e && e()
4564        }
4565        var g = d.find("> .active"), h = e && a.support.transition && (g.length && g.hasClass("fade")||!!d.find("> .fade").length);
4566        g.length && h ? g.one("bsTransitionEnd", f).emulateTransitionEnd(c.TRANSITION_DURATION) : f(), g.removeClass("in")
4567    };
4568    var d = a.fn.tab;
4569    a.fn.tab = b, a.fn.tab.Constructor = c, a.fn.tab.noConflict = function() {
4570        return a.fn.tab = d, this
4571    };
4572    var e = function(c) {
4573        c.preventDefault(), b.call(a(this), "show")
4574    };
4575    a(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', e).on("click.bs.tab.data-api", '[data-toggle="pill"]', e)
4576}(jQuery), + function(a) {
4577    "use strict";
4578    function b(b) {
4579        return this.each(function() {
4580            var d = a(this), e = d.data("bs.affix"), f = "object" == typeof b && b;
4581            e || d.data("bs.affix", e = new c(this, f)), "string" == typeof b && e[b]()
4582        })
4583    }
4584    var c = function(b, d) {
4585        this.options = a.extend({}, c.DEFAULTS, d), this.$target = a(this.options.target).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(b), this.affixed = this.unpin = this.pinnedOffset = null, this.checkPosition()
4586    };
4587    c.VERSION = "3.3.0", c.RESET = "affix affix-top affix-bottom", c.DEFAULTS = {
4588        offset: 0,
4589        target: window
4590    }, c.prototype.getState = function(a, b, c, d) {
4591        var e = this.$target.scrollTop(), f = this.$element.offset(), g = this.$target.height();
4592        if (null != c && "top" == this.affixed)
4593            return c > e ? "top" : !1;
4594        if ("bottom" == this.affixed)
4595            return null != c ? e + this.unpin <= f.top?!1 : "bottom" : a - d >= e + g?!1 : "bottom";
4596        var h = null == this.affixed, i = h ? e: f.top, j = h ? g: b;
4597        return null != c && c >= i ? "top" : null != d && i + j >= a - d ? "bottom" : !1
4598    }, c.prototype.getPinnedOffset = function() {
4599        if (this.pinnedOffset)
4600            return this.pinnedOffset;
4601        this.$element.removeClass(c.RESET).addClass("affix");
4602        var a = this.$target.scrollTop(), b = this.$element.offset();
4603        return this.pinnedOffset = b.top - a
4604    }, c.prototype.checkPositionWithEventLoop = function() {
4605        setTimeout(a.proxy(this.checkPosition, this), 1)
4606    }, c.prototype.checkPosition = function() {
4607        if (this.$element.is(":visible")) {
4608            var b = this.$element.height(), d = this.options.offset, e = d.top, f = d.bottom, g = a("body").height();
4609            "object" != typeof d && (f = e = d), "function" == typeof e && (e = d.top(this.$element)), "function" == typeof f && (f = d.bottom(this.$element));
4610            var h = this.getState(g, b, e, f);
4611            if (this.affixed != h) {
4612                null != this.unpin && this.$element.css("top", "");
4613                var i = "affix" + (h ? "-" + h : ""), j = a.Event(i + ".bs.affix");
4614                if (this.$element.trigger(j), j.isDefaultPrevented())
4615                    return;
4616                this.affixed = h, this.unpin = "bottom" == h ? this.getPinnedOffset() : null, this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix", "affixed") + ".bs.affix")
4617            }
4618            "bottom" == h && this.$element.offset({
4619                top: g - b - f
4620            })
4621        }
4622    };
4623    var d = a.fn.affix;
4624    a.fn.affix = b, a.fn.affix.Constructor = c, a.fn.affix.noConflict = function() {
4625        return a.fn.affix = d, this
4626    }, a(window).on("load", function() {
4627        a('[data-spy="affix"]').each(function() {
4628            var c = a(this), d = c.data();
4629            d.offset = d.offset || {}, null != d.offsetBottom && (d.offset.bottom = d.offsetBottom), null != d.offsetTop && (d.offset.top = d.offsetTop), b.call(c, d)
4630        })
4631    })
4632}(jQuery);
4633
4634/* =========================================================
4635 * bootstrap-datepicker.js
4636 * Repo: https://github.com/eternicode/bootstrap-datepicker/
4637 * Demo: http://eternicode.github.io/bootstrap-datepicker/
4638 * Docs: http://bootstrap-datepicker.readthedocs.org/
4639 * Forked from http://www.eyecon.ro/bootstrap-datepicker
4640 * =========================================================
4641 * Started by Stefan Petre; improvements by Andrew Rowls + contributors
4642 *
4643 * Licensed under the Apache License, Version 2.0 (the "License");
4644 * you may not use this file except in compliance with the License.
4645 * You may obtain a copy of the License at
4646 *
4647 * http://www.apache.org/licenses/LICENSE-2.0
4648 *
4649 * Unless required by applicable law or agreed to in writing, software
4650 * distributed under the License is distributed on an "AS IS" BASIS,
4651 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4652 * See the License for the specific language governing permissions and
4653 * limitations under the License.
4654 * ========================================================= */
4655
4656(function(factory) {
4657    if (typeof define === "function" && define.amd) {
4658        define(["jquery"], factory);
4659    } else if (typeof exports === 'object') {
4660        factory(require('jquery'));
4661    } else {
4662        factory(jQuery);
4663    }
4664}(function($, undefined) {
4665
4666    function UTCDate() {
4667        return new Date(Date.UTC.apply(Date, arguments));
4668    }
4669    function UTCToday() {
4670        var today = new Date();
4671        return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
4672    }
4673    function isUTCEquals(date1, date2) {
4674        return (
4675        date1.getUTCFullYear() === date2.getUTCFullYear() &&
4676        date1.getUTCMonth() === date2.getUTCMonth() &&
4677        date1.getUTCDate() === date2.getUTCDate()
4678        );
4679    }
4680    function alias(method) {
4681        return function() {
4682            return this[method].apply(this, arguments);
4683        };
4684    }
4685    function isValidDate(d) {
4686        return d && !isNaN(d.getTime());
4687    }
4688
4689    var DateArray = (function() {
4690        var extras = {
4691            get: function(i) {
4692                return this.slice(i)[0];
4693            },
4694            contains: function(d) {
4695                // Array.indexOf is not cross-browser;
4696                // $.inArray doesn't work with Dates
4697                var val = d && d.valueOf();
4698                for (var i = 0, l = this.length; i < l; i++)
4699                    if (this[i].valueOf() === val)
4700                        return i;
4701                return - 1;
4702            },
4703            remove: function(i) {
4704                this.splice(i, 1);
4705            },
4706            replace: function(new_array) {
4707                if (!new_array)
4708                    return;
4709                if (!$.isArray(new_array))
4710                    new_array = [new_array];
4711                this.clear();
4712                this.push.apply(this, new_array);
4713            },
4714            clear: function() {
4715                this.length = 0;
4716            },
4717            copy: function() {
4718                var a = new DateArray();
4719                a.replace(this);
4720                return a;
4721            }
4722        };
4723
4724        return function() {
4725            var a = [];
4726            a.push.apply(a, arguments);
4727            $.extend(a, extras);
4728            return a;
4729        };
4730    })();
4731
4732
4733    // Picker object
4734
4735    var Datepicker = function(element, options) {
4736        this._process_options(options);
4737
4738        this.dates = new DateArray();
4739        this.viewDate = this.o.defaultViewDate;
4740        this.focusDate = null;
4741
4742        this.element = $(element);
4743        this.isInline = false;
4744        this.isInput = this.element.is('input');
4745        this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
4746        this.hasInput = this.component && this.element.find('input').length;
4747        if (this.component && this.component.length === 0)
4748            this.component = false;
4749
4750        this.picker = $(DPGlobal.template);
4751        this._buildEvents();
4752        this._attachEvents();
4753
4754        if (this.isInline) {
4755            this.picker.addClass('datepicker-inline').appendTo(this.element);
4756        } else {
4757            this.picker.addClass('datepicker-dropdown dropdown-menu');
4758        }
4759
4760        if (this.o.rtl) {
4761            this.picker.addClass('datepicker-rtl');
4762        }
4763
4764        this.viewMode = this.o.startView;
4765
4766        if (this.o.calendarWeeks)
4767            this.picker.find('tfoot .today, tfoot .clear')
4768            .attr('colspan', function(i, val) {
4769                return parseInt(val) + 1;
4770            });
4771
4772        this._allow_update = false;
4773
4774        this.setStartDate(this._o.startDate);
4775        this.setEndDate(this._o.endDate);
4776        this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
4777        this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted);
4778        this.setDatesDisabled(this.o.datesDisabled);
4779
4780        this.fillDow();
4781        this.fillMonths();
4782
4783        this._allow_update = true;
4784
4785        this.update();
4786        this.showMode();
4787
4788        if (this.isInline) {
4789            this.show();
4790        }
4791    };
4792
4793    Datepicker.prototype = {
4794        constructor: Datepicker,
4795
4796        _process_options: function(opts) {
4797            // Store raw options for reference
4798            this._o = $.extend({}, this._o, opts);
4799            // Processed options
4800            var o = this.o = $.extend({}, this._o);
4801
4802            // Check if "de-DE" style date is available, if not language should
4803            // fallback to 2 letter code eg "de"
4804            var lang = o.language;
4805            if (!dates[lang]) {
4806                lang = lang.split('-')[0];
4807                if (!dates[lang])
4808                    lang = defaults.language;
4809            }
4810            o.language = lang;
4811
4812            switch (o.startView) {
4813            case 2:
4814            case 'decade':
4815                o.startView = 2;
4816                break;
4817            case 1:
4818            case 'year':
4819                o.startView = 1;
4820                break;
4821            default:
4822                o.startView = 0;
4823            }
4824
4825            switch (o.minViewMode) {
4826            case 1:
4827            case 'months':
4828                o.minViewMode = 1;
4829                break;
4830            case 2:
4831            case 'years':
4832                o.minViewMode = 2;
4833                break;
4834            default:
4835                o.minViewMode = 0;
4836            }
4837
4838            switch (o.maxViewMode) {
4839            case 0:
4840            case 'days':
4841                o.maxViewMode = 0;
4842                break;
4843            case 1:
4844            case 'months':
4845                o.maxViewMode = 1;
4846                break;
4847            default:
4848                o.maxViewMode = 2;
4849            }
4850
4851            o.startView = Math.min(o.startView, o.maxViewMode);
4852            o.startView = Math.max(o.startView, o.minViewMode);
4853
4854            // true, false, or Number > 0
4855            if (o.multidate !== true) {
4856                o.multidate = Number(o.multidate) || false;
4857                if (o.multidate !== false)
4858                    o.multidate = Math.max(0, o.multidate);
4859            }
4860            o.multidateSeparator = String(o.multidateSeparator);
4861
4862            o.weekStart %= 7;
4863            o.weekEnd = ((o.weekStart + 6) % 7);
4864
4865            var format = DPGlobal.parseFormat(o.format);
4866            if (o.startDate !== - Infinity) {
4867                if (!!o.startDate) {
4868                    if (o.startDate instanceof Date)
4869                        o.startDate = this._local_to_utc(this._zero_time(o.startDate));
4870                    else
4871                        o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
4872                } else {
4873                    o.startDate = - Infinity;
4874                }
4875            }
4876            if (o.endDate !== Infinity) {
4877                if (!!o.endDate) {
4878                    if (o.endDate instanceof Date)
4879                        o.endDate = this._local_to_utc(this._zero_time(o.endDate));
4880                    else
4881                        o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
4882                } else {
4883                    o.endDate = Infinity;
4884                }
4885            }
4886
4887            o.daysOfWeekDisabled = o.daysOfWeekDisabled || [];
4888            if (!$.isArray(o.daysOfWeekDisabled))
4889                o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
4890            o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d) {
4891                return parseInt(d, 10);
4892            });
4893
4894            o.daysOfWeekHighlighted = o.daysOfWeekHighlighted || [];
4895            if (!$.isArray(o.daysOfWeekHighlighted))
4896                o.daysOfWeekHighlighted = o.daysOfWeekHighlighted.split(/[,\s]*/);
4897            o.daysOfWeekHighlighted = $.map(o.daysOfWeekHighlighted, function(d) {
4898                return parseInt(d, 10);
4899            });
4900
4901            o.datesDisabled = o.datesDisabled || [];
4902            if (!$.isArray(o.datesDisabled)) {
4903                var datesDisabled = [];
4904                datesDisabled.push(DPGlobal.parseDate(o.datesDisabled, format, o.language));
4905                o.datesDisabled = datesDisabled;
4906            }
4907            o.datesDisabled = $.map(o.datesDisabled, function(d) {
4908                return DPGlobal.parseDate(d, format, o.language);
4909            });
4910
4911            var plc = String(o.orientation).toLowerCase().split(/\s+/g),
4912            _plc = o.orientation.toLowerCase();
4913            plc = $.grep(plc, function(word) {
4914                return /^auto|left|right|top|bottom$/.test(word);
4915            });
4916            o.orientation = {
4917                x: 'auto',
4918                y: 'auto'
4919            };
4920            if (!_plc || _plc === 'auto')
4921            ; // no action
4922            else if (plc.length === 1) {
4923                switch (plc[0]) {
4924                case 'top':
4925                case 'bottom':
4926                    o.orientation.y = plc[0];
4927                    break;
4928                case 'left':
4929                case 'right':
4930                    o.orientation.x = plc[0];
4931                    break;
4932                }
4933            } else {
4934                _plc = $.grep(plc, function(word) {
4935                    return /^left|right$/.test(word);
4936                });
4937                o.orientation.x = _plc[0] || 'auto';
4938
4939                _plc = $.grep(plc, function(word) {
4940                    return /^top|bottom$/.test(word);
4941                });
4942                o.orientation.y = _plc[0] || 'auto';
4943            }
4944            if (o.defaultViewDate) {
4945                var year = o.defaultViewDate.year || new Date().getFullYear();
vendor: 16,102 bytes, lines 4946-5407
4946                var month = o.defaultViewDate.month || 0;
4947                var day = o.defaultViewDate.day || 1;
4948                o.defaultViewDate = UTCDate(year, month, day);
4949            } else {
4950                o.defaultViewDate = UTCToday();
4951            }
4952            o.showOnFocus = o.showOnFocus !== undefined ? o.showOnFocus : true;
4953            o.zIndexOffset = o.zIndexOffset !== undefined ? o.zIndexOffset : 10;
4954        },
4955        _events: [],
4956        _secondaryEvents: [],
4957        _applyEvents: function(evs) {
4958            for (var i = 0, el, ch, ev; i < evs.length; i++) {
4959                el = evs[i][0];
4960                if (evs[i].length === 2) {
4961                    ch = undefined;
4962                    ev = evs[i][1];
4963                } else if (evs[i].length === 3) {
4964                    ch = evs[i][1];
4965                    ev = evs[i][2];
4966                }
4967                el.on(ev, ch);
4968            }
4969        },
4970        _unapplyEvents: function(evs) {
4971            for (var i = 0, el, ev, ch; i < evs.length; i++) {
4972                el = evs[i][0];
4973                if (evs[i].length === 2) {
4974                    ch = undefined;
4975                    ev = evs[i][1];
4976                } else if (evs[i].length === 3) {
4977                    ch = evs[i][1];
4978                    ev = evs[i][2];
4979                }
4980                el.off(ev, ch);
4981            }
4982        },
4983        _buildEvents: function() {
4984            var events = {
4985                keyup: $.proxy(function(e) {
4986                    if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === - 1)
4987                        this.update();
4988                }, this),
4989                keydown: $.proxy(this.keydown, this),
4990                paste: $.proxy(this.paste, this)
4991            };
4992
4993            if (this.o.showOnFocus === true) {
4994                events.focus = $.proxy(this.show, this);
4995            }
4996
4997            if (this.isInput) {
4998                // single input
4999                this._events = [
5000                [this.element, events]
5001                ];
5002            } else if (this.component && this.hasInput) {
5003                // component: input + button
5004                this._events = [
5005                // For components that are not readonly, allow keyboard nav
5006                [this.element.find('input'), events],
5007                [this.component, {
5008                    click: $.proxy(this.show, this)
5009                }
5010                ]
5011                ];
5012            } else if (this.element.is('div')) {
5013                // inline datepicker
5014                this.isInline = true;
5015            } else {
5016                this._events = [
5017                [this.element, {
5018                    click: $.proxy(this.show, this)
5019                }
5020                ]
5021                ];
5022            }
5023            this._events.push(
5024            // Component: listen for blur on element descendants
5025            [this.element, '*', {
5026                blur: $.proxy(function(e) {
5027                    this._focused_from = e.target;
5028                }, this)
5029            }
5030            ],
5031            // Input: listen for blur on element
5032            [this.element, {
5033                blur: $.proxy(function(e) {
5034                    this._focused_from = e.target;
5035                }, this)
5036            }
5037            ]
5038            );
5039
5040            if (this.o.immediateUpdates) {
5041                // Trigger input updates immediately on changed year/month
5042                this._events.push([this.element, {
5043                    'changeYear changeMonth': $.proxy(function(e) {
5044                        this.update(e.date);
5045                    }, this)
5046                }
5047                ]);
5048            }
5049
5050            this._secondaryEvents = [
5051            [this.picker, {
5052                click: $.proxy(this.click, this)
5053            }
5054            ],
5055            [$(window), {
5056                resize: $.proxy(this.place, this)
5057            }
5058            ],
5059            [$(document), {
5060                mousedown: $.proxy(function(e) {
5061                    // Clicked outside the datepicker, hide it
5062                    if (!(
5063                    this.element.is(e.target) ||
5064                    this.element.find(e.target).length ||
5065                    this.picker.is(e.target) ||
5066                    this.picker.find(e.target).length ||
5067                    this.picker.hasClass('datepicker-inline')
5068                    )) {
5069                        this.hide();
5070                    }
5071                }, this)
5072            }
5073            ]
5074            ];
5075        },
5076        _attachEvents: function() {
5077            this._detachEvents();
5078            this._applyEvents(this._events);
5079        },
5080        _detachEvents: function() {
5081            this._unapplyEvents(this._events);
5082        },
5083        _attachSecondaryEvents: function() {
5084            this._detachSecondaryEvents();
5085            this._applyEvents(this._secondaryEvents);
5086        },
5087        _detachSecondaryEvents: function() {
5088            this._unapplyEvents(this._secondaryEvents);
5089        },
5090        _trigger: function(event, altdate) {
5091            var date = altdate || this.dates.get( - 1),
5092            local_date = this._utc_to_local(date);
5093
5094            this.element.trigger({
5095                type: event,
5096                date: local_date,
5097                dates: $.map(this.dates, this._utc_to_local),
5098                format: $.proxy(function(ix, format) {
5099                    if (arguments.length === 0) {
5100                        ix = this.dates.length - 1;
5101                        format = this.o.format;
5102                    } else if (typeof ix === 'string') {
5103                        format = ix;
5104                        ix = this.dates.length - 1;
5105                    }
5106                    format = format || this.o.format;
5107                    var date = this.dates.get(ix);
5108                    return DPGlobal.formatDate(date, format, this.o.language);
5109                }, this)
5110            });
5111        },
5112
5113        show: function() {
5114            if (this.element.attr('readonly') && this.o.enableOnReadonly === false)
5115                return;
5116            if (!this.isInline)
5117                this.picker.appendTo(this.o.container);
5118            this.place();
5119            this.picker.show();
5120            this._attachSecondaryEvents();
5121            this._trigger('show');
5122            if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {
5123                $(this.element).blur();
5124            }
5125            return this;
5126        },
5127
5128        hide: function() {
5129            if (this.isInline)
5130                return this;
5131            if (!this.picker.is(':visible'))
5132                return this;
5133            this.focusDate = null;
5134            this.picker.hide().detach();
5135            this._detachSecondaryEvents();
5136            this.viewMode = this.o.startView;
5137            this.showMode();
5138
5139            if (
5140            this.o.forceParse &&
5141            (
5142            this.isInput && this.element.val() ||
5143            this.hasInput && this.element.find('input').val()
5144            )
5145            )
5146                this.setValue();
5147            this._trigger('hide');
5148            return this;
5149        },
5150
5151        remove: function() {
5152            this.hide();
5153            this._detachEvents();
5154            this._detachSecondaryEvents();
5155            this.picker.remove();
5156            delete this.element.data().datepicker;
5157            if (!this.isInput) {
5158                delete this.element.data().date;
5159            }
5160            return this;
5161        },
5162
5163        paste: function(evt) {
5164            var dateString;
5165            if (evt.originalEvent.clipboardData && evt.originalEvent.clipboardData.types
5166            && $.inArray('text/plain', evt.originalEvent.clipboardData.types) !== - 1) {
5167                dateString = evt.originalEvent.clipboardData.getData('text/plain');
5168            } else if (window.clipboardData) {
5169                dateString = window.clipboardData.getData('Text');
5170            } else {
5171                return;
5172            }
5173            this.setDate(dateString);
5174            this.update();
5175            evt.preventDefault();
5176        },
5177
5178        _utc_to_local: function(utc) {
5179            return utc && new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
5180        },
5181        _local_to_utc: function(local) {
5182            return local && new Date(local.getTime() - (local.getTimezoneOffset() * 60000));
5183        },
5184        _zero_time: function(local) {
5185            return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
5186        },
5187        _zero_utc_time: function(utc) {
5188            return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
5189        },
5190
5191        getDates: function() {
5192            return $.map(this.dates, this._utc_to_local);
5193        },
5194
5195        getUTCDates: function() {
5196            return $.map(this.dates, function(d) {
5197                return new Date(d);
5198            });
5199        },
5200
5201        getDate: function() {
5202            return this._utc_to_local(this.getUTCDate());
5203        },
5204
5205        getUTCDate: function() {
5206            var selected_date = this.dates.get( - 1);
5207            if (typeof selected_date !== 'undefined') {
5208                return new Date(selected_date);
5209            } else {
5210                return null;
5211            }
5212        },
5213
5214        clearDates: function() {
5215            var element;
5216            if (this.isInput) {
5217                element = this.element;
5218            } else if (this.component) {
5219                element = this.element.find('input');
5220            }
5221
5222            if (element) {
5223                element.val('');
5224            }
5225
5226            this.update();
5227            this._trigger('changeDate');
5228
5229            if (this.o.autoclose) {
5230                this.hide();
5231            }
5232        },
5233        setDates: function() {
5234            var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
5235            this.update.apply(this, args);
5236            this._trigger('changeDate');
5237            this.setValue();
5238            return this;
5239        },
5240
5241        setUTCDates: function() {
5242            var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
5243            this.update.apply(this, $.map(args, this._utc_to_local));
5244            this._trigger('changeDate');
5245            this.setValue();
5246            return this;
5247        },
5248
5249        setDate: alias('setDates'),
5250        setUTCDate: alias('setUTCDates'),
5251
5252        setValue: function() {
5253            var formatted = this.getFormattedDate();
5254            if (!this.isInput) {
5255                if (this.component) {
5256                    this.element.find('input').val(formatted);
5257                }
5258            } else {
5259                this.element.val(formatted);
5260            }
5261            return this;
5262        },
5263
5264        getFormattedDate: function(format) {
5265            if (format === undefined)
5266                format = this.o.format;
5267
5268            var lang = this.o.language;
5269            return $.map(this.dates, function(d) {
5270                return DPGlobal.formatDate(d, format, lang);
5271            }).join(this.o.multidateSeparator);
5272        },
5273
5274        setStartDate: function(startDate) {
5275            this._process_options({
5276                startDate: startDate
5277            });
5278            this.update();
5279            this.updateNavArrows();
5280            return this;
5281        },
5282
5283        setEndDate: function(endDate) {
5284            this._process_options({
5285                endDate: endDate
5286            });
5287            this.update();
5288            this.updateNavArrows();
5289            return this;
5290        },
5291
5292        setDaysOfWeekDisabled: function(daysOfWeekDisabled) {
5293            this._process_options({
5294                daysOfWeekDisabled: daysOfWeekDisabled
5295            });
5296            this.update();
5297            this.updateNavArrows();
5298            return this;
5299        },
5300
5301        setDaysOfWeekHighlighted: function(daysOfWeekHighlighted) {
5302            this._process_options({
5303                daysOfWeekHighlighted: daysOfWeekHighlighted
5304            });
5305            this.update();
5306            return this;
5307        },
5308
5309        setDatesDisabled: function(datesDisabled) {
5310            this._process_options({
5311                datesDisabled: datesDisabled
5312            });
5313            this.update();
5314            this.updateNavArrows();
5315        },
5316
5317        place: function() {
5318            if (this.isInline)
5319                return this;
5320            var calendarWidth = this.picker.outerWidth(),
5321            calendarHeight = this.picker.outerHeight(),
5322            visualPadding = 10,
5323            container = $(this.o.container),
5324            windowWidth = container.width(),
5325            scrollTop = container.scrollTop(),
5326            appendOffset = container.offset();
5327
5328            var parentsZindex = [];
5329            this.element.parents().each(function() {
5330                var itemZIndex = $(this).css('z-index');
5331                if (itemZIndex !== 'auto' && itemZIndex !== 0) 
5332                    parentsZindex.push(parseInt(itemZIndex));
5333            });
5334            var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;
5335            var offset = this.component ? this.component.parent().offset() : this.element.offset();
5336            var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
5337            var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
5338            var left = offset.left - appendOffset.left,
5339            top = offset.top - appendOffset.top;
5340
5341            this.picker.removeClass(
5342            'datepicker-orient-top datepicker-orient-bottom ' +
5343            'datepicker-orient-right datepicker-orient-left'
5344            );
5345
5346            if (this.o.orientation.x !== 'auto') {
5347                this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
5348                if (this.o.orientation.x === 'right')
5349                    left -= calendarWidth - width;
5350            }
5351            // auto x orientation is best-placement: if it crosses a window
5352            // edge, fudge it sideways
5353            else {
5354                if (offset.left < 0) {
5355                    // component is outside the window on the left side. Move it into visible range
5356                    this.picker.addClass('datepicker-orient-left');
5357                    left -= offset.left - visualPadding;
5358                } else if (left + calendarWidth > windowWidth) {
5359                    // the calendar passes the widow right edge. Align it to component right side
5360                    this.picker.addClass('datepicker-orient-right');
5361                    left = offset.left + width - calendarWidth;
5362                } else {
5363                    // Default to left
5364                    this.picker.addClass('datepicker-orient-left');
5365                }
5366            }
5367
5368            // auto y orientation is best-situation: top or bottom, no fudging,
5369            // decision based on which shows more of the calendar
5370            var yorient = this.o.orientation.y,
5371            top_overflow;
5372            if (yorient === 'auto') {
5373                top_overflow = - scrollTop + top - calendarHeight;
5374                yorient = top_overflow < 0 ? 'bottom' : 'top';
5375            }
5376
5377            this.picker.addClass('datepicker-orient-' + yorient);
5378            if (yorient === 'top')
5379                top -= calendarHeight + parseInt(this.picker.css('padding-top'));
5380            else
5381                top += height;
5382
5383            if (this.o.rtl) {
5384                var right = windowWidth - (left + width);
5385                this.picker.css({
5386                    top: top,
5387                    right: right,
5388                    zIndex: zIndex
5389                });
5390            } else {
5391                this.picker.css({
5392                    top: top,
5393                    left: left,
5394                    zIndex: zIndex
5395                });
5396            }
5397            return this;
5398        },
5399
5400        _allow_update: true,
5401        update: function() {
5402            if (!this._allow_update)
5403                return this;
5404
5405            var oldDates = this.dates.copy(),
5406            dates = [],
5407            fromArgs = false;
5408            if (arguments.length) {
5409                $.each(arguments, $.proxy(function(i, date) {
5410                    if (date instanceof Date)
5411                        date = this._local_to_utc(date);
5412                    dates.push(date);
5413                }, this));
5414                fromArgs = true;
5415            } else {
5416                dates = this.isInput
5417                ? this.element.val()
5418                : this.element.data('date') || this.element.find('input').val();
5419                if (dates && this.o.multidate)
5420                    dates = dates.split(this.o.multidateSeparator);
5421                else
5422                    dates = [dates];
5423                delete this.element.data().date;
5424            }
5425
5426            dates = $.map(dates, $.proxy(function(date) {
5427                return DPGlobal.parseDate(date, this.o.format, this.o.language);
5428            }, this));
5429            dates = $.grep(dates, $.proxy(function(date) {
5430                return (
5431                date < this.o.startDate ||
5432                date > this.o.endDate ||
5433                !date
5434                );
5435            }, this), true);
5436            this.dates.replace(dates);
5437
5438            if (this.dates.length)
5439                this.viewDate = new Date(this.dates.get( - 1));
5440            else if (this.viewDate < this.o.startDate)
5441                this.viewDate = new Date(this.o.startDate);
5442            else if (this.viewDate > this.o.endDate)
5443                this.viewDate = new Date(this.o.endDate);
5444            else
5445                this.viewDate = this.o.defaultViewDate;
5446
5447            if (fromArgs) {
5448                // setting date by clicking
5449                this.setValue();
5450            } else if (dates.length) {
5451                // setting date by typing
5452                if (String(oldDates) !== String(this.dates))
5453                    this._trigger('changeDate');
5454            }
5455            if (!this.dates.length && oldDates.length)
5456                this._trigger('clearDate');
5457
5458            this.fill();
5459            this.element.change();
5460            return this;
5461        },
5462
5463        fillDow: function() {
5464            var dowCnt = this.o.weekStart,
5465            html = '<tr>';
5466            if (this.o.calendarWeeks) {
5467                this.picker.find('.datepicker-days .datepicker-switch')
5468                .attr('colspan', function(i, val) {
5469                    return parseInt(val) + 1;
5470                });
5471                html += '<th class="cw">&#160;</th>';
5472            }
5473            while (dowCnt < this.o.weekStart + 7) {
5474                html += '<th class="dow">' + dates[this.o.language].daysMin[(dowCnt++)%7] + '</th>';
5475            }
5476            html += '</tr>';
5477            this.picker.find('.datepicker-days thead').append(html);
5478        },
5479
5480        fillMonths: function() {
5481            var html = '',
5482            i = 0;
5483            while (i < 12) {
5484                html += '<span class="month">' + dates[this.o.language].monthsShort[i++] + '</span>';
5485            }
5486            this.picker.find('.datepicker-months td').html(html);
5487        },
5488
5489        setRange: function(range) {
5490            if (!range || !range.length)
5491                delete this.range;
5492            else
5493                this.range = $.map(range, function(d) {
5494                    return d.valueOf();
5495                });
5496            this.fill();
5497        },
5498
5499        getClassNames: function(date) {
5500            var cls = [],
5501            year = this.viewDate.getUTCFullYear(),
5502            month = this.viewDate.getUTCMonth(),
5503            today = new Date();
5504            if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)) {
5505                cls.push('old');
5506            } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)) {
5507                cls.push('new');
5508            }
5509            if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
5510                cls.push('focused');
5511            // Compare internal UTC date with local today, not UTC today
5512            if (this.o.todayHighlight &&
5513            date.getUTCFullYear() === today.getFullYear() &&
5514            date.getUTCMonth() === today.getMonth() &&
5515            date.getUTCDate() === today.getDate()) {
5516                cls.push('today');
5517            }
5518            if (this.dates.contains(date) !== - 1)
5519                cls.push('active');
5520            if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
5521            $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== - 1) {
5522                cls.push('disabled');
5523            }
5524            if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== - 1) {
5525                cls.push('highlighted');
5526            }
5527            if (this.o.datesDisabled.length > 0 &&
5528            $.grep(this.o.datesDisabled, function(d) {
5529                return isUTCEquals(date, d);
5530            }).length > 0) {
5531                cls.push('disabled', 'disabled-date');
5532            }
5533
5534            if (this.range) {
5535                if (date > this.range[0] && date < this.range[this.range.length - 1]) {
5536                    cls.push('range');
5537                }
5538                if ($.inArray(date.valueOf(), this.range) !== - 1) {
5539                    cls.push('selected');
5540                }
5541                if (date.valueOf() === this.range[0]) {
5542                    cls.push('range-start');
5543                }
5544                if (date.valueOf() === this.range[this.range.length - 1]) {
5545                    cls.push('range-end');
5546                }
5547            }
5548            return cls;
5549        },
5550
5551        fill: function() {
5552            var d = new Date(this.viewDate),
5553            year = d.getUTCFullYear(),
5554            month = d.getUTCMonth(),
5555            startYear = this.o.startDate !== - Infinity ? this.o.startDate.getUTCFullYear() : - Infinity,
5556            startMonth = this.o.startDate !== - Infinity ? this.o.startDate.getUTCMonth() : - Infinity,
5557            endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
5558            endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
5559            todaytxt = dates[this.o.language].today || dates['en'].today || '',
5560            cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
5561            titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,
5562            tooltip;
5563            if (isNaN(year) || isNaN(month))
5564                return;
5565            this.picker.find('.datepicker-days thead .datepicker-switch')
5566            .text(DPGlobal.formatDate(new UTCDate(year, month), titleFormat, this.o.language));
5567            this.picker.find('tfoot .today')
5568            .text(todaytxt)
5569            .toggle(this.o.todayBtn !== false);
5570            this.picker.find('tfoot .clear')
5571            .text(cleartxt)
5572            .toggle(this.o.clearBtn !== false);
5573            this.picker.find('thead .datepicker-title')
5574            .text(this.o.title)
5575            .toggle(this.o.title !== '');
5576            this.updateNavArrows();
5577            this.fillMonths();
5578            var prevMonth = UTCDate(year, month - 1, 28),
5579            day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
5580            prevMonth.setUTCDate(day);
5581            prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
5582            var nextMonth = new Date(prevMonth);
5583            if (prevMonth.getUTCFullYear() < 100) {
5584                nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());
5585            }
5586            nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
5587            nextMonth = nextMonth.valueOf();
5588            var html = [];
5589            var clsName;
5590            while (prevMonth.valueOf() < nextMonth) {
5591                if (prevMonth.getUTCDay() === this.o.weekStart) {
5592                    html.push('<tr>');
5593                    if (this.o.calendarWeeks) {
5594                        // ISO 8601: First week contains first thursday.
5595                        // ISO also states week starts on Monday, but we can be more abstract here.
5596                        var
5597                        // Start of current week: based on weekstart/current date
5598                        ws = new Date( + prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
5599                        // Thursday of this week
5600                        th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
5601                        // First Thursday of year, year from thursday
5602                        yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7 * 864e5),
5603                        // Calendar week: ms between thursdays, div ms per day, div 7 days
5604                        calWeek = (th - yth) / 864e5 / 7 + 1;
5605                        html.push('<td class="cw">' + calWeek + '</td>');
5606
5607                    }
5608                }
5609                clsName = this.getClassNames(prevMonth);
5610                clsName.push('day');
5611
5612                if (this.o.beforeShowDay !== $.noop) {
5613                    var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
5614                    if (before === undefined)
5615                        before = {};
5616                    else if (typeof(before) === 'boolean')
5617                        before = {
5618                            enabled: before
5619                        };
5620                    else if (typeof(before) === 'string')
5621                        before = {
5622                            classes: before
5623                        };
5624                    if (before.enabled === false)
5625                        clsName.push('disabled');
5626                    if (before.classes)
5627                        clsName = clsName.concat(before.classes.split(/\s+/));
5628                    if (before.tooltip)
5629                        tooltip = before.tooltip;
5630                }
5631
5632                clsName = $.unique(clsName);
5633                html.push('<td class="' + clsName.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>
5633' + prevMonth.getUTCDate() + '</td>');
5634                tooltip = null;
5635                if (prevMonth.getUTCDay() === this.o.weekEnd) {
5636                    html.push('</tr>');
5637                }
5638                prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
5639            }
5640            this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
5641
5642            var months = this.picker.find('.datepicker-months')
5643            .find('.datepicker-switch')
5644            .text(this.o.maxViewMode < 2 ? 'Months' : year)
5645            .end()
5646            .find('span').removeClass('active');
5647
5648            $.each(this.dates, function(i, d) {
5649                if (d.getUTCFullYear() === year)
5650                    months.eq(d.getUTCMonth()).addClass('active');
5651            });
5652
5653            if (year < startYear || year > endYear) {
5654                months.addClass('disabled');
5655            }
5656            if (year === startYear) {
5657                months.slice(0, startMonth).addClass('disabled');
5658            }
5659            if (year === endYear) {
5660                months.slice(endMonth + 1).addClass('disabled');
5661            }
5662
5663            if (this.o.beforeShowMonth !== $.noop) {
5664                var that = this;
5665                $.each(months, function(i, month) {
5666                    if (!$(month).hasClass('disabled')) {
5667                        var moDate = new Date(year, i, 1);
5668                        var before = that.o.beforeShowMonth(moDate);
5669                        if (before === false)
5670                            $(month).addClass('disabled');
5671                    }
5672                });
5673            }
5674
5675            html = '';
5676            year = parseInt(year / 10, 10) * 10;
5677            var yearCont = this.picker.find('.datepicker-years')
5678            .find('.datepicker-switch')
5679            .text(year + '-' + (year + 9))
5680            .end()
5681            .find('td');
5682            year -= 1;
5683            var years = $.map(this.dates, function(d) {
5684                return d.getUTCFullYear();
5685            }),
5686            classes;
5687            for (var i = - 1; i < 11; i++) {
5688                classes = ['year'];
5689                tooltip = null;
5690
5691                if (i === - 1)
5692                    classes.push('old');
5693                else if (i === 10)
5694                    classes.push('new');
5695                if ($.inArray(year, years) !== - 1)
5696                    classes.push('active');
5697                if (year < startYear || year > endYear)
5698                    classes.push('disabled');
5699
5700                if (this.o.beforeShowYear !== $.noop) {
5701                    var yrBefore = this.o.beforeShowYear(new Date(year, 0, 1));
5702                    if (yrBefore === undefined)
5703                        yrBefore = {};
5704                    else if (typeof(yrBefore) === 'boolean')
5705                        yrBefore = {
5706                            enabled: yrBefore
5707                        };
5708                    else if (typeof(yrBefore) === 'string')
5709                        yrBefore = {
5710                            classes: yrBefore
5711                        };
5712                    if (yrBefore.enabled === false)
5713                        classes.push('disabled');
5714                    if (yrBefore.classes)
5715                        classes = classes.concat(yrBefore.classes.split(/\s+/));
5716                    if (yrBefore.tooltip)
5717                        tooltip = yrBefore.tooltip;
5718                }
5719
5720                html += '<span class="' + classes.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>' + year + '</span>';
5721                year += 1;
5722            }
5723            yearCont.html(html);
5724        },
5725
5726        updateNavArrows: function() {
5727            if (!this._allow_update)
5728                return;
5729
5730            var d = new Date(this.viewDate),
5731            year = d.getUTCFullYear(),
5732            month = d.getUTCMonth();
5733            switch (this.viewMode) {
5734            case 0:
5735                if (this.o.startDate !== - Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()) {
5736                    this.picker.find('.prev').css({
5737                        visibility: 'hidden'
5738                    });
5739                } else {
5740                    this.picker.find('.prev').css({
5741                        visibility: 'visible'
5742                    });
5743                }
5744                if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()) {
5745                    this.picker.find('.next').css({
5746                        visibility: 'hidden'
5747                    });
5748                } else {
5749                    this.picker.find('.next').css({
5750                        visibility: 'visible'
5751                    });
5752                }
5753                break;
5754            case 1:
5755            case 2:
5756                if (this.o.startDate !== - Infinity && year <= this.o.startDate.getUTCFullYear() || this.o.maxViewMode < 2) {
5757                    this.picker.find('.prev').css({
5758                        visibility: 'hidden'
5759                    });
5760                } else {
5761                    this.picker.find('.prev').css({
5762                        visibility: 'visible'
5763                    });
5764                }
5765                if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() || this.o.maxViewMode < 2) {
5766                    this.picker.find('.next').css({
5767                        visibility: 'hidden'
5768                    });
5769                } else {
5770                    this.picker.find('.next').css({
5771                        visibility: 'visible'
5772                    });
5773                }
5774                break;
5775            }
5776        },
5777
5778        click: function(e) {
5779            e.preventDefault();
5780            e.stopPropagation();
5781            var target = $(e.target).closest('span, td, th'),
5782            year, month, day;
5783            if (target.length === 1) {
5784                switch (target[0].nodeName.toLowerCase()) {
5785                case 'th':
5786                    switch (target[0].className) {
5787                    case 'datepicker-switch':
5788                        this.showMode(1);
5789                        break;
5790                    case 'prev':
5791                    case 'next':
5792                        var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? - 1 : 1);
5793                        switch (this.viewMode) {
5794                        case 0:
5795                            this.viewDate = this.moveMonth(this.viewDate, dir);
5796                            this._trigger('changeMonth', this.viewDate);
5797                            break;
5798                        case 1:
5799                        case 2:
5800                            this.viewDate = this.moveYear(this.viewDate, dir);
5801                            if (this.viewMode === 1)
5802                                this._trigger('changeYear', this.viewDate);
5803                            break;
5804                        }
5805                        this.fill();
5806                        break;
5807                    case 'today':
5808                        var date = new Date();
5809                        date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
5810
5811                        this.showMode( - 2);
5812                        var which = this.o.todayBtn === 'linked' ? null : 'view';
5813                        this._setDate(date, which);
5814                        break;
5815                    case 'clear':
5816                        this.clearDates();
5817                        break;
5818                    }
5819                    break;
5820                case 'span':
5821                    if (!target.hasClass('disabled')) {
5822                        this.viewDate.setUTCDate(1);
5823                        if (target.hasClass('month')) {
5824                            day = 1;
5825                            month = target.parent().find('span').index(target);
5826                            year = this.viewDate.getUTCFullYear();
5827                            this.viewDate.setUTCMonth(month);
5828                            this._trigger('changeMonth', this.viewDate);
5829                            if (this.o.minViewMode === 1) {
5830                                this._setDate(UTCDate(year, month, day));
5831                                this.showMode();
5832                            } else {
5833                                this.showMode( - 1);
5834                            }
5835                        } else {
5836                            day = 1;
5837                            month = 0;
5838                            year = parseInt(target.text(), 10) || 0;
5839                            this.viewDate.setUTCFullYear(year);
5840                            this._trigger('changeYear', this.viewDate);
5841                            if (this.o.minViewMode === 2) {
5842                                this._setDate(UTCDate(year, month, day));
5843                            }
5844                            this.showMode( - 1);
5845                        }
5846                        this.fill();
5847                    }
5848                    break;
5849                case 'td':
5850                    if (target.hasClass('day') && !target.hasClass('disabled')) {
5851                        day = parseInt(target.text(), 10) || 1;
5852                        year = this.viewDate.getUTCFullYear();
5853                        month = this.viewDate.getUTCMonth();
5854                        if (target.hasClass('old')) {
5855                            if (month === 0) {
5856                                month = 11;
5857                                year -= 1;
5858                            } else {
5859                                month -= 1;
5860                            }
5861                        } else if (target.hasClass('new')) {
5862                            if (month === 11) {
5863                                month = 0;
5864                                year += 1;
5865                            } else {
5866                                month += 1;
5867                            }
5868                        }
5869                        this._setDate(UTCDate(year, month, day));
5870                    }
5871                    break;
5872                }
5873            }
5874            if (this.picker.is(':visible') && this._focused_from) {
5875                $(this._focused_from).focus();
5876            }
5877            delete this._focused_from;
5878        },
5879
5880        _toggle_multidate: function(date) {
5881            var ix = this.dates.contains(date);
5882            if (!date) {
5883                this.dates.clear();
5884            }
5885
5886            if (ix !== - 1) {
5887                if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive) {
5888                    this.dates.remove(ix);
5889                }
5890            } else if (this.o.multidate === false) {
5891                this.dates.clear();
5892                this.dates.push(date);
5893            } else {
5894                this.dates.push(date);
5895            }
5896
5897            if (typeof this.o.multidate === 'number')
5898                while (this.dates.length > this.o.multidate)
5899                    this.dates.remove(0);
5900        },
5901
5902        _setDate: function(date, which) {
5903            if (!which || which === 'date')
5904                this._toggle_multidate(date && new Date(date));
5905            if (!which || which === 'view')
5906                this.viewDate = date && new Date(date);
5907
5908            this.fill();
5909            this.setValue();
5910            if (!which || which !== 'view') {
5911                this._trigger('changeDate');
5912            }
5913            var element;
5914            if (this.isInput) {
5915                element = this.element;
5916            } else if (this.component) {
5917                element = this.element.find('input');
5918            }
5919            if (element) {
5920                element.change();
5921            }
5922            if (this.o.autoclose && (!which || which === 'date')) {
5923                this.hide();
5924            }
5925        },
5926
5927        moveMonth: function(date, dir) {
5928            if (!isValidDate(date))
5929                return this.o.defaultViewDate;
5930            if (!dir)
5931                return date;
5932            var new_date = new Date(date.valueOf()),
5933            day = new_date.getUTCDate(),
5934            month = new_date.getUTCMonth(),
5935            mag = Math.abs(dir),
5936            new_month, test;
5937            dir = dir > 0 ? 1 : - 1;
5938            if (mag === 1) {
5939                test = dir === - 1
5940                // If going back one month, make sure month is not current month
5941                // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
5942                ? function() {
5943                    return new_date.getUTCMonth() === month;
5944                }
5945                // If going forward one month, make sure month is as expected
5946                // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
5947                : function() {
5948                    return new_date.getUTCMonth() !== new_month;
5949                };
5950                new_month = month + dir;
5951                new_date.setUTCMonth(new_month);
5952                // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
5953                if (new_month < 0 || new_month > 11)
5954                    new_month = (new_month + 12) % 12;
5955            } else {
5956                // For magnitudes >1, move one month at a time...
5957                for (var i = 0; i < mag; i++)
5958                // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
5959                new_date = this.moveMonth(new_date, dir);
5960                // ...then reset the day, keeping it in the new month
5961                new_month = new_date.getUTCMonth();
5962                new_date.setUTCDate(day);
5963                test = function() {
5964                    return new_month !== new_date.getUTCMonth();
5965                };
5966            }
5967            // Common date-resetting loop -- if date is beyond end of month, make it
5968            // end of month
5969            while (test()) {
5970                new_date.setUTCDate(--day);
5971                new_date.setUTCMonth(new_month);
5972            }
5973            return new_date;
5974        },
5975
5976        moveYear: function(date, dir) {
5977            return this.moveMonth(date, dir * 12);
5978        },
5979
5980        dateWithinRange: function(date) {
5981            return date >= this.o.startDate && date <= this.o.endDate;
5982        },
5983
5984        keydown: function(e) {
5985            if (!this.picker.is(':visible')) {
5986                if (e.keyCode === 40 || e.keyCode === 27) {
5987                    // allow down to re-show picker
5988                    this.show();
5989                    e.stopPropagation();
5990                }
5991                return;
5992            }
5993            var dateChanged = false,
5994            dir, newDate, newViewDate,
5995            focusDate = this.focusDate || this.viewDate;
5996            switch (e.keyCode) {
5997            case 27:
5998                // escape
5999                if (this.focusDate) {
6000                    this.focusDate = null;
6001                    this.viewDate = this.dates.get( - 1) || this.viewDate;
6002                    this.fill();
6003                } else
6004                    this.hide();
6005                e.preventDefault();
6006                e.stopPropagation();
6007                break;
6008            case 37:
6009                // left
6010            case 39:
6011                // right
6012                if (!this.o.keyboardNavigation)
6013                    break;
6014                dir = e.keyCode === 37 ? - 1 : 1;
6015                if (e.ctrlKey) {
6016                    newDate = this.moveYear(this.dates.get( - 1) || UTCToday(), dir);
6017                    newViewDate = this.moveYear(focusDate, dir);
6018                    this._trigger('changeYear', this.viewDate);
6019                } else if (e.shiftKey) {
6020                    newDate = this.moveMonth(this.dates.get( - 1) || UTCToday(), dir);
6021                    newViewDate = this.moveMonth(focusDate, dir);
6022                    this._trigger('changeMonth', this.viewDate);
6023                } else {
6024                    newDate = new Date(this.dates.get( - 1) || UTCToday());
6025                    newDate.setUTCDate(newDate.getUTCDate() + dir);
6026                    newViewDate = new Date(focusDate);
6027                    newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
6028                }
6029                if (this.dateWithinRange(newViewDate)) {
6030                    this.focusDate = this.viewDate = newViewDate;
6031                    this.setValue();
6032                    this.fill();
6033                    e.preventDefault();
6034                }
6035                break;
6036            case 38:
6037                // up
6038            case 40:
6039                // down
6040                if (!this.o.keyboardNavigation)
6041                    break;
6042                dir = e.keyCode === 38 ? - 1 : 1;
6043                if (e.ctrlKey) {
6044                    newDate = this.moveYear(this.dates.get( - 1) || UTCToday(), dir);
6045                    newViewDate = this.moveYear(focusDate, dir);
6046                    this._trigger('changeYear', this.viewDate);
6047                } else if (e.shiftKey) {
6048                    newDate = this.moveMonth(this.dates.get( - 1) || UTCToday(), dir);
6049                    newViewDate = this.moveMonth(focusDate, dir);
6050                    this._trigger('changeMonth', this.viewDate);
6051                } else {
6052                    newDate = new Date(this.dates.get( - 1) || UTCToday());
6053                    newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
6054                    newViewDate = new Date(focusDate);
6055                    newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
6056                }
6057                if (this.dateWithinRange(newViewDate)) {
6058                    this.focusDate = this.viewDate = newViewDate;
6059                    this.setValue();
6060                    this.fill();
6061                    e.preventDefault();
6062                }
6063                break;
6064            case 32:
6065                // spacebar
6066                // Spacebar is used in manually typing dates in some formats.
6067                // As such, its behavior should not be hijacked.
6068                break;
6069            case 13:
6070                // enter
6071                if (!this.o.forceParse) {
6072                    break;
6073                }
6074                focusDate = this.focusDate || this.dates.get( - 1) || this.viewDate;
6075                if (this.o.keyboardNavigation) {
6076                    this._toggle_multidate(focusDate);
6077                    dateChanged = true;
6078                }
6079                this.focusDate = null;
6080                this.viewDate = this.dates.get( - 1) || this.viewDate;
6081                this.setValue();
6082                this.fill();
6083                if (this.picker.is(':visible')) {
6084                    e.preventDefault();
6085                    if (typeof e.stopPropagation === 'function') {
6086                        e.stopPropagation(); // All modern browsers, IE9+
6087                    } else {
6088                        e.cancelBubble = true; // IE6,7,8 ignore "stopPropagation"
6089                    }
6090                    if (this.o.autoclose)
6091                        this.hide();
6092                }
6093                break;
6094            case 9:
6095                // tab
6096                this.focusDate = null;
6097                this.viewDate = this.dates.get( - 1) || this.viewDate;
6098                this.fill();
6099                this.hide();
6100                break;
6101            }
6102            if (dateChanged) {
6103                if (this.dates.length)
6104                    this._trigger('changeDate');
6105                else
6106                    this._trigger('clearDate');
6107                var element;
6108                if (this.isInput) {
6109                    element = this.element;
6110                } else if (this.component) {
6111                    element = this.element.find('input');
6112                }
6113                if (element) {
6114                    element.change();
6115                }
6116            }
6117        },
6118
6119        showMode: function(dir) {
6120            if (dir) {
6121                this.viewMode = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, this.viewMode + dir));
6122            }
6123            this.picker
6124            .children('div')
6125            .hide()
6126            .filter('.datepicker-' + DPGlobal.modes[this.viewMode].clsName)
6127            .show();
6128            this.updateNavArrows();
6129        }
6130    };
6131
6132    var DateRangePicker = function(element, options) {
6133        this.element = $(element);
6134        this.inputs = $.map(options.inputs, function(i) {
6135            return i.jquery ? i[0] : i;
6136        });
6137        delete options.inputs;
6138
6139        datepickerPlugin.call($(this.inputs), options)
6140        .on('changeDate', $.proxy(this.dateUpdated, this));
6141
6142        this.pickers = $.map(this.inputs, function(i) {
6143            return $(i).data('datepicker');
6144        });
6145        this.updateDates();
6146    };
6147    DateRangePicker.prototype = {
6148        updateDates: function() {
6149            this.dates = $.map(this.pickers, function(i) {
6150                return i.getUTCDate();
6151            });
6152            this.updateRanges();
6153        },
6154        updateRanges: function() {
6155            var range = $.map(this.dates, function(d) {
6156                return d.valueOf();
6157            });
6158            $.each(this.pickers, function(i, p) {
6159                p.setRange(range);
6160            });
6161        },
6162        dateUpdated: function(e) {
6163            // `this.updating` is a workaround for preventing infinite recursion
6164            // between `changeDate` triggering and `setUTCDate` calling.  Until
6165            // there is a better mechanism.
6166            if (this.updating)
6167                return;
6168            this.updating = true;
6169
6170            var dp = $(e.target).data('datepicker');
6171
6172            if (typeof(dp) === "undefined") {
6173                return;
6174            }
6175
6176            var new_date = dp.getUTCDate(),
6177            i = $.inArray(e.target, this.inputs),
6178            j = i - 1,
6179            k = i + 1,
6180            l = this.inputs.length;
6181            if (i === - 1)
6182                return;
6183
6184            $.each(this.pickers, function(i, p) {
6185                if (!p.getUTCDate())
6186                    p.setUTCDate(new_date);
6187            });
6188
6189            if (new_date < this.dates[j]) {
6190                // Date being moved earlier/left
6191                while (j >= 0 && new_date < this.dates[j]) {
6192                    this.pickers[j--].setUTCDate(new_date);
6193                }
6194            } else if (new_date > this.dates[k]) {
6195                // Date being moved later/right
6196                while (k < l && new_date > this.dates[k]) {
6197                    this.pickers[k++].setUTCDate(new_date);
6198                }
6199            }
6200            this.updateDates();
6201
6202            delete this.updating;
6203        },
6204        remove: function() {
6205            $.map(this.pickers, function(p) {
6206                p.remove();
6207            });
6208            delete this.element.data().datepicker;
6209        }
6210    };
6211
6212    function opts_from_el(el, prefix) {
6213        // Derive options from element data-attrs
6214        var data = $(el).data(),
6215        out = {}, inkey,
6216        replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
6217        prefix = new RegExp('^' + prefix.toLowerCase());
6218        function re_lower(_, a) {
6219            return a.toLowerCase();
6220        }
6221        for (var key in data)
6222            if (prefix.test(key)) {
6223                inkey = key.replace(replace, re_lower);
6224                out[inkey] = data[key];
6225            }
6226        return out;
6227    }
6228
6229    function opts_from_locale(lang) {
6230        // Derive options from locale plugins
6231        var out = {};
6232        // Check if "de-DE" style date is available, if not language should
6233        // fallback to 2 letter code eg "de"
6234        if (!dates[lang]) {
6235            lang = lang.split('-')[0];
6236            if (!dates[lang])
6237                return;
6238        }
6239        var d = dates[lang];
6240        $.each(locale_opts, function(i, k) {
6241            if (k in d)
6242                out[k] = d[k];
6243        });
6244        return out;
6245    }
6246
6247    var old = $.fn.datepicker;
6248    var datepickerPlugin = function(option) {
6249        var args = Array.apply(null, arguments);
6250        args.shift();
6251        var internal_return;
6252        this.each(function() {
6253            var $this = $(this),
6254            data = $this.data('datepicker'),
6255            options = typeof option === 'object' && option;
6256            if (!data) {
6257                var elopts = opts_from_el(this, 'date'),
6258                // Preliminary otions
6259                xopts = $.extend({}, defaults, elopts, options),
6260                locopts = opts_from_locale(xopts.language),
6261                // Options priority: js args, data-attrs, locales, defaults
6262                opts = $.extend({}, defaults, locopts, elopts, options);
6263                if ($this.hasClass('input-daterange') || opts.inputs) {
6264                    var ropts = {
6265                        inputs: opts.inputs || $this.find('input').toArray()
6266                    };
6267                    $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
6268                } else {
6269                    $this.data('datepicker', (data = new Datepicker(this, opts)));
6270                }
6271            }
6272            if (typeof option === 'string' && typeof data[option] === 'function') {
6273                internal_return = data[option].apply(data, args);
6274            }
6275        });
6276
6277        if (
6278        internal_return === undefined ||
6279        internal_return instanceof Datepicker ||
6280        internal_return instanceof DateRangePicker
6281        )
6282            return this;
6283
6284        if (this.length > 1)
6285            throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');
6286        else
6287            return internal_return;
6288    };
6289    $.fn.datepicker = datepickerPlugin;
6290
6291    var defaults = $.fn.datepicker.defaults = {
6292        autoclose: false,
6293        beforeShowDay: $.noop,
6294        beforeShowMonth: $.noop,
6295        beforeShowYear: $.noop,
6296        calendarWeeks: false,
6297        clearBtn: false,
6298        toggleActive: false,
6299        daysOfWeekDisabled: [],
6300        daysOfWeekHighlighted: [],
6301        datesDisabled: [],
6302        endDate: Infinity,
6303        forceParse: true,
6304        format: 'mm/dd/yyyy',
6305        keyboardNavigation: true,
6306        language: 'en',
6307        minViewMode: 0,
6308        maxViewMode: 2,
6309        multidate: false,
6310        multidateSeparator: ',',
6311        orientation: "auto",
6312        rtl: false,
6313        startDate: - Infinity,
6314        startView: 0,
6315        todayBtn: false,
6316        todayHighlight: false,
6317        weekStart: 0,
6318        disableTouchKeyboard: false,
6319        enableOnReadonly: true,
6320        container: 'body',
6321        immediateUpdates: false,
6322        title: ''
6323    };
6324    var locale_opts = $.fn.datepicker.locale_opts = [
6325    'format',
6326    'rtl',
6327    'weekStart'
6328    ];
6329    $.fn.datepicker.Constructor = Datepicker;
6330    var dates = $.fn.datepicker.dates = {
6331        en: {
6332            days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
6333            daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
6334            daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
6335            months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
6335November", "December"],
6336            monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
6337            today: "Today",
6338            clear: "Clear",
6339            titleFormat: "MM yyyy"
6340        }
6341    };
6342
6343    var DPGlobal = {
6344        modes: [
6345        {
6346            clsName: 'days',
6347            navFnc: 'Month',
6348            navStep: 1
6349        },
6350        {
6351            clsName: 'months',
6352            navFnc: 'FullYear',
6353            navStep: 1
6354        },
6355        {
6356            clsName: 'years',
6357            navFnc: 'FullYear',
6358            navStep: 10
6359        }
6360        ],
6361        isLeapYear: function(year) {
6362            return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
6363        },
6364        getDaysInMonth: function(year, month) {
6365            return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
6366        },
6367        validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
6368        nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
6369        parseFormat: function(format) {
6370            if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')
6371                return format;
6372            // IE treats \0 as a string end in inputs (truncating the value),
6373            // so it's a bad format delimiter, anyway
6374            var separators = format.replace(this.validParts, '\0').split('\0'),
6375            parts = format.match(this.validParts);
6376            if (!separators || !separators.length || !parts || parts.length === 0) {
6377                throw new Error("Invalid date format.");
6378            }
6379            return {
6380                separators: separators,
6381                parts: parts
6382            };
6383        },
6384        parseDate: function(date, format, language) {
6385            if (!date)
6386                return undefined;
6387            if (date instanceof Date)
6388                return date;
6389            if (typeof format === 'string')
6390                format = DPGlobal.parseFormat(format);
6391            if (format.toValue)
6392                return format.toValue(date, format, language);
6393            var part_re = /([\-+]\d+)([dmwy])/,
6394            parts = date.match(/([\-+]\d+)([dmwy])/g),
6395            part, dir, i;
6396            if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
6397                date = new Date();
6398                for (i = 0; i < parts.length; i++) {
6399                    part = part_re.exec(parts[i]);
6400                    dir = parseInt(part[1]);
6401                    switch (part[2]) {
6402                    case 'd':
6403                        date.setUTCDate(date.getUTCDate() + dir);
6404                        break;
6405                    case 'm':
6406                        date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
6407                        break;
6408                    case 'w':
6409                        date.setUTCDate(date.getUTCDate() + dir * 7);
6410                        break;
6411                    case 'y':
6412                        date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
6413                        break;
6414                    }
6415                }
6416                return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
6417            }
6418            parts = date && date.match(this.nonpunctuation) || [];
6419            date = new Date();
6420            var parsed = {},
6421            setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
6422            setters_map = {
6423                yyyy: function(d, v) {
6424                    return d.setUTCFullYear(v);
6425                },
6426                yy: function(d, v) {
6427                    return d.setUTCFullYear(2000 + v);
6428                },
6429                m: function(d, v) {
6430                    if (isNaN(d))
6431                        return d;
6432                    v -= 1;
6433                    while (v < 0) 
6434                        v += 12;
6435                    v %= 12;
6436                    d.setUTCMonth(v);
6437                    while (d.getUTCMonth() !== v)
6438                        d.setUTCDate(d.getUTCDate() - 1);
6439                    return d;
6440                },
6441                d: function(d, v) {
6442                    return d.setUTCDate(v);
6443                }
6444            },
6445            val, filtered;
6446            setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
6447            setters_map['dd'] = setters_map['d'];
6448            date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
6449            var fparts = format.parts.slice();
6450            // Remove noop parts
6451            if (parts.length !== fparts.length) {
6452                fparts = $(fparts).filter(function(i, p) {
6453                    return $.inArray(p, setters_order) !== - 1;
6454                }).toArray();
6455            }
6456            // Process remainder
6457            function match_part() {
6458                var m = this.slice(0, parts[i].length),
6459                p = parts[i].slice(0, m.length);
6460                return m.toLowerCase() === p.toLowerCase();
6461            }
6462            if (parts.length === fparts.length) {
6463                var cnt;
6464                for (i = 0, cnt = fparts.length; i < cnt; i++) {
6465                    val = parseInt(parts[i], 10);
6466                    part = fparts[i];
6467                    if (isNaN(val)) {
6468                        switch (part) {
6469                        case 'MM':
6470                            filtered = $(dates[language].months).filter(match_part);
6471                            val = $.inArray(filtered[0], dates[language].months) + 1;
6472                            break;
6473                        case 'M':
6474                            filtered = $(dates[language].monthsShort).filter(match_part);
6475                            val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
6476                            break;
6477                        }
6478                    }
6479                    parsed[part] = val;
6480                }
6481                var _date, s;
6482                for (i = 0; i < setters_order.length; i++) {
6483                    s = setters_order[i];
6484                    if (s in parsed && !isNaN(parsed[s])) {
6485                        _date = new Date(date);
6486                        setters_map[s](_date, parsed[s]);
6487                        if (!isNaN(_date))
6488                            date = _date;
6489                    }
6490                }
6491            }
6492            return date;
6493        },
6494        formatDate: function(date, format, language) {
6495            if (!date)
6496                return '';
6497            if (typeof format === 'string')
6498                format = DPGlobal.parseFormat(format);
6499            if (format.toDisplay)
6500                return format.toDisplay(date, format, language);
6501            var val = {
6502                d: date.getUTCDate(),
6503                D: dates[language].daysShort[date.getUTCDay()],
6504                DD: dates[language].days[date.getUTCDay()],
6505                m: date.getUTCMonth() + 1,
6506                M: dates[language].monthsShort[date.getUTCMonth()],
6507                MM: dates[language].months[date.getUTCMonth()],
6508                yy: date.getUTCFullYear().toString().substring(2),
6509                yyyy: date.getUTCFullYear()
6510            };
6511            val.dd = (val.d < 10 ? '0' : '') + val.d;
6512            val.mm = (val.m < 10 ? '0' : '') + val.m;
6513            date = [];
6514            var seps = $.extend([], format.separators);
6515            for (var i = 0, cnt = format.parts.length; i <= cnt; i++) {
6516                if (seps.length)
6517                    date.push(seps.shift());
6518                date.push(val[format.parts[i]]);
6519            }
6520            return date.join('');
6521        },
6522        headTemplate: '<thead>' +
6523        '<tr>' +
6524        '<th colspan="7" class="datepicker-title"></th>' +
6525        '</tr>' +
6526        '<tr>' +
6527        '<th class="prev">&#171;</th>' +
6528        '<th colspan="5" class="datepicker-switch"></th>' +
6529        '<th class="next">&#187;</th>' +
6530        '</tr>' +
6531        '</thead>',
6532        contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
6533        footTemplate: '<tfoot>' +
6534        '<tr>' +
6535        '<th colspan="7" class="today"></th>' +
6536        '</tr>' +
6537        '<tr>' +
6538        '<th colspan="7" class="clear"></th>' +
6539        '</tr>' +
6540        '</tfoot>'
6541    };
6542    DPGlobal.template = '<div class="datepicker">' +
6543    '<div class="datepicker-days">' +
6544    '<table class=" table-condensed">' +
6545    DPGlobal.headTemplate +
6546    '<tbody></tbody>' +
6547    DPGlobal.footTemplate +
6548    '</table>' +
6549    '</div>' +
6550    '<div class="datepicker-months">' +
6551    '<table class="table-condensed">' +
6552    DPGlobal.headTemplate +
6553    DPGlobal.contTemplate +
6554    DPGlobal.footTemplate +
6555    '</table>' +
6556    '</div>' +
6557    '<div class="datepicker-years">' +
6558    '<table class="table-condensed">' +
6559    DPGlobal.headTemplate +
6560    DPGlobal.contTemplate +
6561    DPGlobal.footTemplate +
6562    '</table>' +
6563    '</div>' +
6564    '</div>';
6565
6566    $.fn.datepicker.DPGlobal = DPGlobal;
6567
6568
6569    /* DATEPICKER NO CONFLICT
6570    	 * =================== */
6571
6572    $.fn.datepicker.noConflict = function() {
6573        $.fn.datepicker = old;
6574        return this;
6575    };
6576
6577    /* DATEPICKER VERSION
6578    	 * =================== */
6579    $.fn.datepicker.version = '1.5.0-RC1';
6580
6581    /* DATEPICKER DATA-API
6582    	 * ================== */
6583
6584    $(document).on(
6585    'focus.datepicker.data-api click.datepicker.data-api',
6586    '[data-provide="datepicker"]',
6587    function(e) {
6588        var $this = $(this);
6589        if ($this.data('datepicker'))
6590            return;
6591        e.preventDefault();
6592        // component click requires us to explicitly show it
6593        datepickerPlugin.call($this, 'show');
6594    });
6595    $(function() {
6596        datepickerPlugin.call($('[data-provide="datepicker-inline"]'));
6597    });
6598
6599}));
6600
6601$(function() {
6602    $.ajaxSetup({
6603        type: "post",
6604        dataType: "json"
6605    });
6606    $('[data-toggle="tooltip"]').tooltip();
6607    var URL = document.location.toString();
6608    if (URL.match(/#/))
6609    {
6610        var anchor = URL.split('#')[1];
6611        if ($("#content_" + anchor).length)
6612        {
6613            TAB.select(anchor);
6614        }
6615    }
6616    $('noscript').remove();
6617    if ($(".defaultfocus").length)
6618    {
6619        $(".defaultfocus")[0].focus();
6620    }
6621});
6622function str_repeat(i, m)
6623{
6624    for (var o = []; m > 0; o[--m] = i);
6625    return o.join('');
6626}
6627function sprintf()
6628{
6629    var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = '';
6630    while (f) {
6631        if (m = /^[^\x25]+/.exec(f)) {
6632            o.push(m[0]);
6633        } else if (m = /^\x25{2}/.exec(f)) {
6634            o.push('%');
6635        } else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
6636            if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) {
6637                throw ('Too few arguments.');
6638            }
6639            if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) {
6640                throw ('Expecting number but found ' + typeof(a));
6641            }
6642            switch (m[7]) {
6643            case'b':
6644                a = a.toString(2);
6645                break;
6646            case'c':
6647                a = String.fromCharCode(a);
6648                break;
6649            case'd':
6650                a = parseInt(a);
6651                break;
6652            case'e':
6653                a = m[6] ? a.toExponential(m[6]) : a.toExponential();
6654                break;
6655            case'f':
6656                a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a);
6657                break;
6658            case'o':
6659                a = a.toString(8);
6660                break;
6661            case's':
6662                a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a);
6663                break;
6664            case'u':
6665                a = Math.abs(a);
6666                break;
6667            case'x':
6668                a = a.toString(16);
6669                break;
6670            case'X':
6671                a = a.toString(16).toUpperCase();
6672                break;
6673            }
6674            a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+' + a : a);
6675            c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
6676            x = m[5] - String(a).length - s.length;
6677            p = m[5] ? str_repeat(c, x) : '';
6678            o.push(s + (m[4] ? a + p : p + a));
6679        } else {
6680            throw ('Huh ?!');
6681        }
6682        f = f.substring(m[0].length);
6683    }
6684    return o.join('');
6685}
6686function sortObject(object)
6687{
6688    var newArr = new Array();
6689    var last = "";
6690    for (n in object)
6691    {
6692        last = "";
6693        for (i in object)
6694        {
6695            if ((last == '' || object[i] < last)&&!newArr[i])
6696            {
6697                last = i;
6698            }
6699        }
6700        newArr[last] = object[last];
6701    }
6702    return newArr;
6703}
6704function var_dump(obj)
6705{
6706    var out = typeof(obj) + ": \n";
6707    for (var i in obj) {
6708        out += i + ": " + obj[i] + "\n";
6709    }
6710    return out;
6711}
6712function oneof()
6713{
6714    for (var i = 0; i < arguments.length; i++)
6715    {
6716        if (arguments[i] != null && arguments[i] != '' && arguments[i] != 0)
6717            return arguments[i];
6718    }
6719    return arguments[arguments.length];
6720}
6721Math.stdRound = Math.round;
6722Math.round = function(number, precision)
6723{
6724    if (isNaN(number))
6725        return 0;
6726    if (precision != null)
6727    {
6728        precision = Math.abs(parseInt(precision)) || 0;
6729        var coefficient = Math.pow(10, precision);
6730        return Math.stdRound(number * coefficient) / coefficient;
6731    } else
6732    {
6733        return Math.stdRound(number);
6734    }
6735};
6736Object.elementCount = function(obj)
6737{
6738    var size = 0, key;
6739    for (key in obj) {
6740        if (obj.hasOwnProperty(key))
6741            size++;
6742    }
6743    return size;
6744};
6745var Base64 = {
6746    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
6746+/=",
6747    encode: function(e) {
6748        var t = "";
6749        var n, r, i, s, o, u, a;
6750        var f = 0;
6751        e = Base64._utf8_encode(e);
6752        while (f < e.length) {
6753            n = e.charCodeAt(f++);
6754            r = e.charCodeAt(f++);
6755            i = e.charCodeAt(f++);
6756            s = n>>2;
6757            o = (n & 3)<<4 | r>>4;
6758            u = (r & 15)<<2 | i>>6;
6759            a = i & 63;
6760            if (isNaN(r)) {
6761                u = a = 64
6762            } else if (isNaN(i)) {
6763                a = 64
6764            }
6765            t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
6766        }
6767        return t
6768    },
6769    decode: function(e) {
6770        var t = "";
6771        var n, r, i;
6772        var s, o, u, a;
6773        var f = 0;
6774        e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
6775        while (f < e.length) {
6776            s = this._keyStr.indexOf(e.charAt(f++));
6777            o = this._keyStr.indexOf(e.charAt(f++));
6778            u = this._keyStr.indexOf(e.charAt(f++));
6779            a = this._keyStr.indexOf(e.charAt(f++));
6780            n = s<<2 | o>>4;
6781            r = (o & 15)<<4 | u>>2;
6782            i = (u & 3)<<6 | a;
6783            t = t + String.fromCharCode(n);
6784            if (u != 64) {
6785                t = t + String.fromCharCode(r)
6786            }
6787            if (a != 64) {
6788                t = t + String.fromCharCode(i)
6789            }
6790        }
6791        t = Base64._utf8_decode(t);
6792        return t
6793    },
6794    _utf8_encode: function(e) {
6795        e = e.replace(/\r\n/g, "\n");
6796        var t = "";
6797        for (var n = 0; n < e.length; n++) {
6798            var r = e.charCodeAt(n);
6799            if (r < 128) {
6800                t += String.fromCharCode(r)
6801            } else if (r > 127 && r < 2048) {
6802                t += String.fromCharCode(r>>6 | 192);
6803                t += String.fromCharCode(r & 63 | 128)
6804            } else {
6805                t += String.fromCharCode(r>>12 | 224);
6806                t += String.fromCharCode(r>>6 & 63 | 128);
6807                t += String.fromCharCode(r & 63 | 128)
6808            }
6809        }
6810        return t
6811    },
6812    _utf8_decode: function(e) {
6813        var t = "";
6814        var n = 0;
6815        var r = c1 = c2 = 0;
6816        while (n < e.length) {
6817            r = e.charCodeAt(n);
6818            if (r < 128) {
6819                t += String.fromCharCode(r);
6820                n++
6821            } else if (r > 191 && r < 224) {
6822                c2 = e.charCodeAt(n + 1);
6823                t += String.fromCharCode((r & 31)<<6 | c2 & 63);
6824                n += 2
6825            } else {
6826                c2 = e.charCodeAt(n + 1);
6827                c3 = e.charCodeAt(n + 2);
6828                t += String.fromCharCode((r & 15)<<12 | (c2 & 63)<<6 | c3 & 63);
6829                n += 3
6830            }
6831        }
6832        return t
6833    }
6834}
6835BASE = {};
6836BASE.redirect = function(url)
6837{
6838    window.location.href = url;
6839};
6840BASE.reload = function()
6841{
6842    window.location.reload(true);
6843};
6844BASE.createDialog = function(title, buttons, width, dialog_tag, dialog_class)
6845{
6846    if (dialog_tag == null)
6847    {
6848        var dialog_tag = 'dialog_' + Math.floor(Math.random() * 100000 + 1);
6849    }
6850    if (width != null)
6851    {
6852        width = parseInt(width);
6853    }
6854    if (dialog_class != null && dialog_class != '')
6855    {
6856        var dialog_class = 'modal ' + dialog_class;
6857    } else
6858    {
6859        var dialog_class = 'modal';
6860    }
6861    var dialog_html = '<div id="' + dialog_tag + '" class="' + dialog_class + '" tabindex="-1">';
6862    dialog_html = dialog_html + '<div class="modal-dialog">';
6863    dialog_html = dialog_html + '<div class="modal-content">';
6864    if (!(title != null && title == false))
6865    {
6866        dialog_html = dialog_html + '<div class="modal-header">';
6867        dialog_html = dialog_html + '<button type="button" id="' + dialog_tag + '_close" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">' + LOCALE.get('BASE.DIALOG.CloseWindow') + '</span></button>';
6868        dialog_html = dialog_html + '<h4 class="modal-title">' + title + '</h4>';
6869        dialog_html = dialog_html + '</div>';
6870    }
6871    dialog_html = dialog_html + '<div class="modal-body"><div class="modal-body-content"></div></div>';
6872    if (!(buttons != null && buttons == false))
6873    {
6874        dialog_html = dialog_html + '<div class="modal-footer"></div>';
6875    }
6876    dialog_html = dialog_html + '</div>';
6877    dialog_html = dialog_html + '</div>';
6878    dialog_html = dialog_html + '</div>';
6879    $('body').append(dialog_html);
6880    dialog_tag = dialog_tag;
6881    $('#' + dialog_tag).on('show.bs.modal', function() {
6882        $('#' + dialog_tag).css('display', 'block');
6883        if (width != null && width > 0)
6884        {
6885            if ($(window).width() > (width + 80))
6886            {
6887                $('#' + dialog_tag + ' .modal-dialog').css('width', width + 'px');
6888            } else if ($(window).width() > 767)
6889            {
6890                $('#' + dialog_tag + ' .modal-dialog').css('width', '90%');
6891            }
6892        }
6893        BASE.initModal(dialog_tag);
6894    });
6895    $('#' + dialog_tag).on('hidden.bs.modal', function() {
6896        $('#' + dialog_tag).remove();
6897    });
6898    return dialog_tag;
6899};
6900BASE.closeDialog = function(context)
6901{
6902    if (context != null)
6903    {
6904        $(context).closest('.modal').modal('hide');
6905    } else
6906    {
6907        $('.modal:visible').modal('hide');
6908    }
6909};
6910BASE.centerModal = function(dialog_tag)
6911{
6912    if ($('#' + dialog_tag).hasClass('nocenter'))
6913        return;
6914    if ($(window).width() < 768)
6915    {
6916        return;
6917    }
6918    if (dialog_tag != null)
6919    {
6920        var dialog = $('#' + dialog_tag + ' .modal-dialog');
6921        var offset = Math.round(($(window).height() - dialog.height()) / 2);
6922        if (offset > 40)
6923        {
6924            dialog.css('margin-top', offset);
6925        }
6926    } else
6927    {
6928        $('.modal-dialog').each(function() {
6929            var dialog = $(this);
6930            var offset = Math.round(($(window).height() - dialog.height()) / 2);
6931            if (offset > 40)
6932            {
6933                dialog.css('margin-top', offset);
6934            }
6935        });
6936    }
6937};
6938BASE.resizeContent = function(dialog_tag)
6939{
6940    if ($('#' + dialog_tag).hasClass('noresize'))
6941        return;
6942    var window_height = $(window).height();
6943    $('#' + dialog_tag + ' .modal-body-content').css('display', 'block');
6944    $('#' + dialog_tag + ' .modal-body-content').css('height', '');
6945    $('#' + dialog_tag + ' .modal-body-content').css('padding-right', '');
6946    $('#' + dialog_tag + ' .modal-body-content').css('overflow-y', '');
6947    var content_height = $('#' + dialog_tag + ' .modal-body-content').height();
6948    var max_content_height = window_height - 250;
6949    if (content_height > max_content_height)
6950    {
6951        $('#' + dialog_tag + ' .modal-body-content').css('display', 'block');
6952        $('#' + dialog_tag + ' .modal-body-content').css('height', max_content_height + 'px');
6953        $('#' + dialog_tag + ' .modal-body-content').css('padding-right', '30px');
6954        $('#' + dialog_tag + ' .modal-body-content').css('overflow-y', 'auto');
6955    }
6956};
6957BASE.initModal = function(dialog_tag)
6958{
6959    BASE.resizeContent(dialog_tag);
6960    BASE.centerModal(dialog_tag);
6961};
6962BASE.getDialogTag = function(context)
6963{
6964    if ($(context).closest('.modal').length)
6965    {
6966        return $(context).closest('.modal').attr('id');
6967    } else
6968    {
6969        return false;
6970    }
6971};
6972BASE.alert = function(message, title, reloadonclose, redirectonclose, width)
6973{
6974    if (title == null ||!title.length)
6975    {
6976        title = LOCALE.get('BASE.DIALOG.Title.Message');
6977    }
6978    var dialog_tag = BASE.createDialog(title, true, width);
6979    $('#' + dialog_tag + ' .modal-body-content').html('<div style="margin: 0px">' + message + '</div>');
6980    $('#' + dialog_tag).on('hidden.bs.modal', function() {
6981        if (reloadonclose != null && reloadonclose == true)
6982        {
6983            BASE.reload();
6984        }
6985        if (redirectonclose != null && redirectonclose.length > 0)
6986        {
6987            BASE.redirect(redirectonclose);
6988        }
6989    });
6990    $('#' + dialog_tag + ' .modal-footer').append('<button type="button" class="btn btn-default btn-primary" data-dismiss="modal">' + LOCALE.get('BASE.COMMON.OK') + '</button>');
6991    $('#' + dialog_tag).modal({
6992        backdrop: 'static',
6993        keyboard: true,
6994        show: true
6995    });
6996};
6997BASE.confirmDialog = function(message, title, buttons, width)
6998{
6999    if (title == null ||!title.length)
7000    {
7001        title = LOCALE.get('BASE.DIALOG.Title.Choose');
7002    }
7003    var dialog_tag = BASE.createDialog(title, true, width);
7004    $('#' + dialog_tag + ' .modal-body-content').html('<div style="margin: 0px">' + message + '</div>');
7005    for (t in buttons)
7006    {
7007        $('#' + dialog_tag + ' .modal-footer').append('<button type="button" id="' + dialog_tag + '_btn_' + t + '" class="btn btn-default' + (buttons[t].class != null ? ' ' + buttons[t].class : '') + '">' + buttons[t].title + '</button>');
7008        $('#' + dialog_tag + '_btn_' + t).on('click', buttons[t].callback);
7009        if (buttons[t].cancel != null && buttons[t].cancel == true)
7010        {
7011            $('#' + dialog_tag + '_close').on('click', buttons[t].callback);
7012        }
7013    }
7014    $('#' + dialog_tag).modal({
7015        backdrop: 'static',
7016        keyboard: true,
7017        show: true
7018    });
7019};
7020BASE.displayErrors = function(message, title, errors)
7021{
7022    var fieldErrors = false;
7023    var firstField = null;
7024    if (typeof errors !== 'undefined')
7025    {
7026        fieldErrors = true;
7027        for (var formElementID in errors)
7028        {
7029            if (firstField == null)
7030                firstField = formElementID;
7031            $('#' + formElementID).addClass('error');
7032        }
7033    }
7034    if (title == null ||!title.length)
7035    {
7036        title = LOCALE.get('BASE.DIALOG.Title.Message');
7037    }
7038    BASE.alert(message, title);
7039};
7040BASE.openDialog = function(content_url, content_data, dialog_width, buttons, close_button_label, dialog_class)
7041{
7042    if (dialog_width == null)
7043        dialog_width = 600;
7044    if (buttons != null && buttons == false)
7045    {
7046        var dialog_tag = BASE.createDialog('&nbsp;', false, dialog_width, null, dialog_class);
7047    } else
7048    {
7049        var dialog_tag = BASE.createDialog('&nbsp;', true, dialog_width, null, dialog_class);
7050    }
7051    if (content_data == null)
7052    {
7053        content_data = {
7054            'tag': dialog_tag
7055        };
7056    } else
7057    {
7058        content_data.tag = dialog_tag;
7059    }
7060    $.ajax({
7061        url: content_url,
7062        data: content_data,
7063        success: function(data)
7064        {
7065            if (data != null && data.status == '1')
7066            {
7067                $('#' + dialog_tag + ' .modal-body-content').html(data.content);
7068                if (data.title != null)
7069                {
7070                    $('#' + dialog_tag + ' .modal-title').text(data.title);
7071                } else
7072                {
7073                    $('#' + dialog_tag + ' .modal-title').text(LOCALE.get('BASE.DIALOG.Title.Message'));
7074                }
7075                if (buttons != null)
7076                {
7077                    if (buttons != false)
7078                    {
7079                        for (t in buttons)
7080                        {
7081                            $('#' + dialog_tag + ' .modal-footer').append('<button type="button" id="' + (buttons[t].id != null ? buttons[t].id : dialog_tag + '_btn_' + t) + '" class="btn btn-default' + (buttons[t].class != null ? ' ' + buttons[t].class : '') + '"' + ((buttons[t].disabled != null && buttons[t].disabled == 1) ? ' disabled="disabled"' : '') + '>
7081' + buttons[t].title + '</button>');
7082                            $('#' + (buttons[t].id != null ? buttons[t].id : dialog_tag + '_btn_' + t)).on('click', buttons[t].callback);
7083                            if (buttons[t].cancel != null && buttons[t].cancel == true)
7084                            {
7085                                $('#' + dialog_tag + '_close').on('click', buttons[t].callback);
7086                            }
7087                        }
7088                        $('#' + dialog_tag + ' .modal-footer').append('<button type="button" class="btn btn-default" data-dismiss="modal">' + oneof(close_button_label, LOCALE.get('BASE.FORM.Btn.Cancel')) + '</button>');
7089                    }
7090                } else
7091                {
7092                    $('#' + dialog_tag + ' .modal-footer').append('<button type="button" class="btn btn-default" data-dismiss="modal">' + oneof(close_button_label, LOCALE.get('BASE.COMMON.OK')) + '</button>');
7093                }
7094                $('#' + dialog_tag).modal({
7095                    backdrop: 'static',
7096                    keyboard: true,
7097                    show: true
7098                });
7099                if (data.displaytrigger != null && data.displaytrigger != "")
7100                {
7101                    eval(data.displaytrigger);
7102                }
7103                if ($("#" + dialog_tag + " .modal-footer button.btn-primary").length == 1)
7104                {
7105                    $("#form_" + dialog_tag + " input, #form_" + dialog_tag + " select").not('.noautosubmit').keypress(function(e) {
7106                        if (e.which == 13)
7107                        {
7108                            $("#" + dialog_tag + " .modal-footer button.btn-primary").trigger('click');
7109                        }
7110                    });
7111                }
7112                if ($("#" + dialog_tag + " .modal-body-content .defaultfocus").length)
7113                {
7114                    $("#" + dialog_tag + " .modal-body-content .defaultfocus")[0].focus();
7115                } else
7116                {
7117                    if ($("#" + dialog_tag + " .modal-body-content :input:visible").length)
7118                    {
7119                        $("#" + dialog_tag + " .modal-body-content :input:visible").first().focus();
7120                    }
7121                }
7122                FORM.initElements("#form_" + dialog_tag);
7123            } else
7124            {
7125                if (data != null && data.error != null)
7126                {
7127                    BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
7128                } else
7129                {
7130                    BASE.alert(LOCALE.get('BASE.FORM.ERROR.ErrorOpeningDialog'), LOCALE.get('BASE.COMMON.Error'));
7131                }
7132                return;
7133            }
7134        },
7135        error: function()
7136        {
7137            BASE.alert(LOCALE.get('BASE.FORM.ERROR.ErrorOpeningDialog'), LOCALE.get('BASE.COMMON.Error'));
7138            return null;
7139        }
7140    });
7141    return dialog_tag;
7142};
7143BASE.openEditDialog = function(content_url, content_data, dialog_width, extra_buttons, no_standard_save, dialog_class)
7144{
7145    if (dialog_width == null)
7146    {
7147        dialog_width = 850;
7148    }
7149    var dialog_tag = BASE.createDialog('&nbsp;', true, dialog_width, null, dialog_class);
7150    if (content_data == null)
7151    {
7152        content_data = {
7153            'tag': dialog_tag
7154        };
7155    } else
7156    {
7157        content_data.tag = dialog_tag;
7158    }
7159    $.ajax({
7160        url: content_url,
7161        data: content_data,
7162        success: function(data)
7163        {
7164            if (data != null && data.status == '1')
7165            {
7166                $('#' + dialog_tag + ' .modal-body-content').html(data.content);
7167                $('#' + dialog_tag + ' .modal-title').text(data.title);
7168                var submitbuttontitle = LOCALE.get('BASE.FORM.Btn.Save');
7169                if (data.submit != null && data.submit != "")
7170                {
7171                    submitbuttontitle = data.submit;
7172                }
7173                var progressmessage = LOCALE.get('BASE.FORM.Msg.Saving');
7174                if (data.progressmessage != null && data.progressmessage != "")
7175                {
7176                    progressmessage = data.progressmessage;
7177                }
7178                var submithandler = null;
7179                if (data.submithandler != null && data.submithandler != "")
7180                {
7181                    submithandler = data.submithandler;
7182                }
7183                if (no_standard_save == null || no_standard_save == false)
7184                {
7185                    $('#' + dialog_tag + ' .modal-footer').append('<button type="button" id="' + dialog_tag + '_btn_' + t + '" class="btn btn-primary">' + submitbuttontitle + '</button>');
7186                    $('#' + dialog_tag + '_btn_' + t).on('click', function() {
7187                        if ($("#form_" + dialog_tag)[0].action == null || $("#form_" + dialog_tag)[0].action == "")
7188                        {
7189                            BASE.alert(LOCALE.get('BASE.FORM.Error.CouldNotFindForm'), LOCALE.get('BASE.COMMON.Error'));
7190                            return;
7191                        }
7192                        $("#form_" + dialog_tag + " td.label.error").removeClass('error');
7193                        if (submithandler != null)
7194                        {
7195                            eval(submithandler + '(\'' + dialog_tag + '\')');
7196                        } else
7197                        {
7198                            if (progressmessage != '')
7199                            {
7200                                BASE.progressDialog(progressmessage);
7201                            }
7202                            $("#form_" + dialog_tag).ajaxSubmit({
7203                                type: "post",
7204                                data: {
7205                                    ajaxsubmit: '1'
7206                                },
7207                                success: function(data)
7208                                {
7209                                    if (data != null && data.status == '1')
7210                                    {
7211                                        if (data.message != null && data.message != '')
7212                                        {
7213                                            BASE.closeProgressDialog();
7214                                            BASE.closeDialog('#' + dialog_tag);
7215                                            if (data.redirect != null && data.redirect != '')
7216                                            {
7217                                                BASE.alert(data.message, null, null, data.redirect);
7218                                            } else if (data.reload != null && data.reload == '1')
7219                                            {
7220                                                BASE.alert(data.message, null, true);
7221                                            }
7222                                        } else if (data.redirect != null && data.redirect != '')
7223                                        {
7224                                            BASE.closeDialog('#' + dialog_tag);
7225                                            BASE.redirect(data.redirect);
7226                                        } else if (data.reload != null && data.reload == '1')
7227                                        {
7228                                            BASE.closeDialog('#' + dialog_tag);
7229                                            BASE.reload();
7230                                        } else
7231                                        {
7232                                            BASE.closeProgressDialog();
7233                                            if (data.submitsuccessaction)
7234                                            {
7235                                                eval(data.submitsuccessaction);
7236                                            }
7237                                            BASE.closeDialog('#' + dialog_tag);
7238                                        }
7239                                    } else
7240                                    {
7241                                        BASE.closeProgressDialog();
7242                                        var errors = '<b>' + LOCALE.get('BASE.FORM.Error.Errors') + ':</b>';
7243                                        if (data != null && data.error != null)
7244                                        {
7245                                            if (typeof(data.error) == 'object')
7246                                            {
7247                                                for (var fld_tag in data.error)
7248                                                {
7249                                                    if (data.error.hasOwnProperty(fld_tag))
7250                                                    {
7251                                                        errors = errors + '<br/> &#0149; ' + data.error[fld_tag];
7252                                                    }
7253                                                }
7254                                                BASE.displayErrors(errors, LOCALE.get('BASE.COMMON.Error'), data.error);
7255                                            } else
7256                                            {
7257                                                BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
7258                                            }
7259                                        } else
7260                                        {
7261                                            BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData') + ': 1', LOCALE.get('BASE.COMMON.Error'));
7262                                        }
7263                                        return;
7264                                    }
7265                                },
7266                                error: function(xhr, ajaxOptions, thrownError)
7267                                {
7268                                    BASE.closeProgressDialog();
7269                                    BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData') + ': ' + thrownError + ' / ' + var_dump(xhr), LOCALE.get('BASE.COMMON.Error'));
7270                                    return;
7271                                }
7272                            });
7273                        }
7274                    });
7275                }
7276                if (extra_buttons != null)
7277                {
7278                    for (var t in extra_buttons)
7279                    {
7280                        $('#' + dialog_tag + ' .modal-footer').append('<button type="button" id="' + dialog_tag + '_btn_' + t + '" class="btn' + (buttons[t].class != null ? ' ' + buttons[t].class : '') + '">' + buttons[t].title + '</button>');
7281                        $('#' + dialog_tag + '_btn_' + t).on('click', buttons[t].callback);
7282                        if (buttons[t].cancel != null && buttons[t].cancel == true)
7283                        {
7284                            $('#' + dialog_tag + '_close').on('click', buttons[t].callback);
7285                        }
7286                    }
7287                }
7288                $('#' + dialog_tag + ' .modal-footer').append('<button type="button" class="btn btn-default" data-dismiss="modal">' + LOCALE.get('BASE.FORM.Btn.Cancel') + '</button>');
7289                $('#' + dialog_tag).modal({
7290                    backdrop: 'static',
7291                    keyboard: true,
7292                    show: true
7293                });
7294                if (data.displaytrigger != null && data.displaytrigger != "")
7295                {
7296                    eval(data.displaytrigger);
7297                }
7298                if ($("#" + dialog_tag + " .modal-footer button.btn-primary").length == 1)
7299                {
7300                    $("#form_" + dialog_tag + " input, #form_" + dialog_tag + " select").not('.noautosubmit').keypress(function(e) {
7301                        if (e.which == 13)
7302                        {
7303                            $("#" + dialog_tag + " .modal-footer button.btn-primary").trigger('click');
7304                        }
7305                    });
7306                }
7307                if ($("#form_" + dialog_tag + " .defaultfocus").length)
7308                {
7309                    $("#form_" + dialog_tag + " .defaultfocus")[0].focus();
7310                } else
7311                {
7312                    if ($("#form_" + dialog_tag + " :input:visible").length)
7313                    {
7314                        $("#form_" + dialog_tag + " :input:visible").first().focus();
7315                    }
7316                }
7317                FORM.initElements("#form_" + dialog_tag);
7318            } else
7319            {
7320                if (data != null && data.error != null)
7321                {
7322                    if (typeof(data.error) == 'object')
7323                    {
7324                        BASE.displayErrors(data.error, LOCALE.get('BASE.COMMON.Error'), data.error);
7325                    } else
7326                    {
7327                        BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
7328                    }
7329                } else
7330                {
7331                    BASE.alert(LOCALE.get('BASE.FORM.ERROR.ErrorOpeningDialog'), LOCALE.get('BASE.COMMON.Error'));
7332                }
7333                return;
7334            }
7335        },
7336        error: function()
7337        {
7338            BASE.alert(LOCALE.get('BASE.FORM.ERROR.ErrorOpeningDialog'), LOCALE.get('BASE.COMMON.Error'));
7339            return null;
7340        }
7341    });
7342    return dialog_tag;
7343};
7344BASE.progressDialog = function(message, width)
7345{
7346    BASE.createDialog(false, false, width, 'lab-progressdialog');
7347    $('#lab-progressdialog .modal-body-content').html('<div style="margin: 30px 10px; text-align: center">' + message + '</div>');
7348    $('#lab-progressdialog').modal({
7349        backdrop: 'static',
7350        keyboard: true,
7351        show: true
7352    });
7353};
7354BASE.closeProgressDialog = function()
7355{
7356    if ($("#lab-progressdialog").length > 0)
7357    {
7358        $("#lab-progressdialog").modal('hide');
7359    }
7360};
7361BASE.doPostSubmit = function(form_url, form_data, confirm_message, new_window)
7362{
7363    if (confirm_message != null)
7364    {
7365        if (!confirm(confirm_message))
7366            return;
7367    }
7368    var form_tag = Math.floor(Math.random() * 100000 + 1);
7369    if (new_window != null && new_window == '1')
7370    {
7371        var target = ' target="_blank"';
7372    } else
7373    {
7374        var target = '';
7375    }
7376    $('body').append('<form id="form_' + form_tag + '" method="post" action="' + form_url + '"' + target + '></form>');
7377    for (var k in form_data)
7378    {
7379        $('#form_' + form_tag).append('<input type="hidden" name="' + k + '" value="' + form_data[k] + '" />');
7380    }
7381    $('#form_' + form_tag)[0].submit();
7382};
7383BASE.doPostSubmitWithOptions = function(form_url, form_data, title, message, option_key, options, enable_cancel)
7384{
7385    if (title == null || title == '')
7386    {
7387        title = 'Dialog';
7388    }
7389    if (form_data == null)
7390    {
7391        form_data = {};
7392    }
7393    var buttons = {};
7394    $.each(options, function(o, button_title) {
7395        buttons[button_title] = {
7396            buttonAction: function()
7397            {
7398                $("#labengine_alert").dialog('close');
7399                $("#labengine_alert").remove();
7400                form_data[option_key] = o;
7401                BASE.doPostSubmit(form_url, form_data);
7402            },
7403            buttonClass: "primary"
7404        }
7405    });
7406    if (enable_cancel != null && enable_cancel == true)
7407    {
7408        buttons[LOCALE.get('BASE.FORM.BTN.Cancel')] = {
7409            buttonACtion: function()
7410            {
7411                $("#labengine_alert").dialog('close');
7412                $("#labengine_alert").remove();
7413            }
7414        }
7415    }
7416    $("#labengine_alert").remove();
7417    $('body').append('<div id="labengine_alert" title="' + title + '" style="display:none">' + message + '</div>');
7418    $("#labengine_alert").dialog({
7419        width: '500px',
7420        resizable: false,
7421        bgiframe: true,
7422        modal: true,
7423        buttons: buttons
7424    });
7425};
7426BASE.doAjaxAction = function(action_url, action_data, confirm_message, reload_on_success, progressmessage, reload_on_close)
7427{
7428    if (confirm_message != null)
7429    {
7430        BASE.confirmDialog(confirm_message, LOCALE.get('BASE.DIALOG.Title.Confirm'), {
7431            ok: {
7432                title: LOCALE.get('BASE.FORM.BTN.OK'),
7433                class: "btn-primary",
7434                callback: function() {
7435                    BASE.closeDialog(this);
7436                    BASE.doAjaxAction(action_url, action_data, null, reload_on_success, progressmessage, reload_on_close);
7437                }
7438            },
7439            cancel: {
7440                title: LOCALE.get('BASE.FORM.BTN.Cancel'),
7441                cancel: true,
7442                callback: function() {
7443                    BASE.closeDialog(this);
7444                }
7445            }
7446        });
7447        return;
7448    }
7449    if (progressmessage == null)
7450    {
7451        var progressmessage = LOCALE.get('BASE.FORM.MSG.Saving');
7452    }
7453    BASE.progressDialog(progressmessage);
7454    $.ajax({
7455        url: action_url,
7456        data: action_data,
7457        success: function(data)
7458        {
7459            if (data != null && data.status == '1')
7460            {
7461                if (data.redirect != null)
7462                {
7463                    BASE.redirect(data.redirect);
7464                } else if ((data.reload != null && data.reload == '1') || reload_on_success == null || reload_on_success == true)
7465                {
7466                    BASE.reload();
7467                } else
7468                {
7469                    BASE.closeProgressDialog();
7470                    if (data.submitsuccessaction != null && data.submitsuccessaction.length > 0)
7471                    {
7472                        eval(data.submitsuccessaction);
7473                    }
7474                }
7475            } else
7476            {
7477                BASE.closeProgressDialog();
7478                if (data != null && data.error != null)
7479                {
7480                    if (reload_on_close == true)
7481                    {
7482                        BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'), true);
7483                    } else
7484                    {
7485                        BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
7486                    }
7487                } else
7488                {
7489                    if (reload_on_close == true)
7490                    {
7491                        BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData'), LOCALE.get('BASE.COMMON.Error'), true);
7492                    } else
7493                    {
7494                        BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData'), LOCALE.get('BASE.COMMON.Error'));
7495                    }
7496                }
7497                return;
7498            }
7499        },
7500        error: function()
7501        {
7502            BASE.closeProgressDialog();
7503            BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData'), LOCALE.get('BASE.COMMON.Error'));
7504            return;
7505        }
7506    });
7507};
7508BASE.doAjaxActionWithOptions = function(action_url, action_data, title, message, option_key, options, enable_cancel, reload_on_success, progressmessage)
7509{
7510    if (title == null || title == '')
7511    {
7512        title = 'Dialog';
7513    }
7514    if (action_data == null)
7515    {
7516        action_data = {};
7517    }
7518    var buttons = {};
7519    $.each(options, function(o, button_title) {
7520        buttons[button_title] = {
7521            buttonAction: function()
7522            {
7523                $("#labengine_alert").dialog('close');
7524                $("#labengine_alert").remove();
7525                action_data[option_key] = o;
7526                BASE.doAjaxAction(action_url, action_data, null, reload_on_success, progressmessage);
7527            },
7528            buttonClass: "primary"
7529        }
7530    });
7531    if (enable_cancel != null && enable_cancel == true)
7532    {
7533        buttons[LOCALE.get('BASE.FORM.BTN.Cancel')] = {
7534            buttonAction: function()
7535            {
7536                $("#labengine_alert").dialog('close');
7537                $("#labengine_alert").remove();
7538            }
7539        }
7540    }
7541    $("#labengine_alert").remove();
7542    $('body').append('<div id="labengine_alert" title="' + title + '" style="display:none">
7542' + message + '</div>');
7543    $("#labengine_alert").dialog({
7544        width: '500px',
7545        resizable: false,
7546        bgiframe: true,
7547        modal: true,
7548        buttons: buttons
7549    });
7550};
7551var FORM = {};
7552FORM.submit = function(form_action, form_id, success_callback, progressmessage)
7553{
7554    if (form_action == null)
7555    {
7556        form_action = 'save';
7557    }
7558    if (form_id == null)
7559    {
7560        form_id = 'labengine-form';
7561    }
7562    if ($("#" + form_id)[0].action == null || $("#" + form_id)[0].action == "")
7563    {
7564        BASE.alert(LOCALE.get('BASE.FORM.Error.CouldNotFindForm'), LOCALE.get('BASE.COMMON.Error'));
7565        return;
7566    }
7567    $("#" + form_id + " .errors").remove();
7568    $("#" + form_id + " label.error").removeClass('error');
7569    if (progressmessage == null)
7570    {
7571        progressmessage = LOCALE.get('BASE.FORM.MSG.Saving');
7572    }
7573    if (progressmessage != '')
7574    {
7575        BASE.progressDialog(progressmessage);
7576    }
7577    $("#" + form_id).ajaxSubmit({
7578        data: {
7579            ajaxsubmit: '1',
7580            action: form_action
7581        },
7582        success: function(data)
7583        {
7584            if (data != null && data.status == '1')
7585            {
7586                if (success_callback != null)
7587                {
7588                    BASE.closeProgressDialog();
7589                    success_callback(data);
7590                } else if (data.reload != null && data.reload == '1')
7591                {
7592                    BASE.reload();
7593                } else if (data.redirect != null && data.redirect.length > 0)
7594                {
7595                    BASE.redirect(data.redirect);
7596                } else
7597                {
7598                    BASE.closeProgressDialog();
7599                }
7600            } else
7601            {
7602                BASE.closeProgressDialog();
7603                var errors = '<b>' + LOCALE.get('BASE.FORM.Error.Errors') + ':</b>';
7604                if (data != null && data.error != null)
7605                {
7606                    if (typeof(data.error) == 'object')
7607                    {
7608                        for (var fld_tag in data.error)
7609                        {
7610                            if (data.error.hasOwnProperty(fld_tag))
7611                            {
7612                                errors = errors + '<br/> &#0149; ' + data.error[fld_tag];
7613                            }
7614                        }
7615                        BASE.displayErrors(errors, LOCALE.get('BASE.COMMON.Error'), data.error);
7616                    } else
7617                    {
7618                        BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
7619                    }
7620                } else
7621                {
7622                    BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData'), LOCALE.get('BASE.COMMON.Error'));
7623                }
7624                return;
7625            }
7626        },
7627        error: function(xhr, ajaxOptions, thrownError)
7628        {
7629            BASE.closeProgressDialog();
7630            BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData') + ' - ' + thrownError + ' - ' + xhr.responseText, LOCALE.get('BASE.COMMON.Error'));
7631            return;
7632        }
7633    });
7634};
7635FORM.cancel = function(return_url)
7636{
7637    if (return_url != null)
7638    {
7639        BASE.redirect(return_url);
7640    } else
7641    {
7642        window.history.go( - 1);
7643    }
7644};
7645FORM.initElements = function(base_element)
7646{
7647    FORM.setDatePicker(base_element);
7648    FORM.setMask(base_element);
7649};
7650FORM.setDatePicker = function(base_element)
7651{
7652    $((base_element != null ? base_element + " " : "") + " input.datefield").each(function() {
7653        $(this).datepicker({
7654            container: 'body',
7655            format: $(this).attr('data-dateformat'),
7656            weekStart: (typeof($(this).attr('data-weekstart')) !== 'undefined' ? parseInt($(this).attr('data-weekstart')) : 1),
7657            showOnFocus: false,
7658            todayHighlight: true,
7659            autoclose: true
7660        });
7661    });
7662};
7663FORM.setMask = function(base_element)
7664{
7665    $((base_element != null ? base_element + " " : "") + " input[data-mask!='']").each(function() {
7666        $(this).mask($(this).attr('data-mask'));
7667    });
7668}
7669FORM.setAutoComplete = function(select_fields_filter)
7670{
7671    if (select_fields_filter == null)
7672    {
7673        select_fields_filter = 'select.autocomplete:not([readonly=readonly])';
7674    }
7675    if (!$(select_fields_filter).length) {
7676        return;
7677    }
7678    $(select_fields_filter).css('display', 'none');
7679    $(select_fields_filter).combobox();
7680};
7681FORM.loadOptions = function(select_name, data, selected_option)
7682{
7683    var option = '';
7684    for (var key in data)
7685    {
7686        var dkey = ((key.indexOf("#_")>-1) ? key.replace("#_", "") : key);
7687        option += '<option value="' + dkey + '"' + (dkey == selected_option ? ' selected="selected"' : '') + '>
7687' + data[key] + '</option>';
7688    }
7689    $(select_name + ' option').remove();
7690    $(select_name).html(option);
7691};
7692FORM.setValues = function(values, base_field)
7693{
7694    for (var k in values)
7695    {
7696        if (base_field != null && base_field != '')
7697        {
7698            if (base_field == 'prop' && k.match(/^prop_/))
7699            {
7700                var fld = k;
7701            } else
7702            {
7703                var fld = base_field + "_" + k;
7704            }
7705        } else
7706        {
7707            var fld = k;
7708        }
7709        if ($("select[name=" + fld + "]").length)
7710        {
7711            if (values[k] != null && typeof(values[k]) == 'object')
7712            {
7713                FORM.loadOptions("select[name=" + fld + "]", sortObject(values[k]), $("select[name=" + fld + "]").val());
7714            } else
7715            {
7716                $("#" + fld).val(values[k]);
7717            }
7718        } else if ($("input[name=" + fld + "]").attr('type') == 'radio')
7719        {
7720            $("#" + fld + "_" + values[k]).trigger("click");
7721        } else if ($("input[name=" + fld + "]").attr('type') == 'checkbox')
7722        {
7723            if (values[k] == '1')
7724            {
7725                $("#" + fld).attr('checked', 'checked');
7726            } else
7727            {
7728                $("#" + fld).removeAttr('checked');
7729            }
7730        } else
7731        {
7732            $("#" + fld).val(values[k]);
7733        }
7734    }
7735};
7736FORM.toggleFieldGroup = function(fieldgroup)
7737{
7738    if ($("#fieldgroup_" + fieldgroup).is(':visible'))
7739    {
7740        $("#fieldgroup_" + fieldgroup).hide();
7741        $("#header_" + fieldgroup).parent().find('.icon-fieldgroup').removeClass('icon-fieldgroup-open');
7742        $("#header_" + fieldgroup).parent().find('.icon-fieldgroup').addClass('icon-fieldgroup-closed');
7743        var hidden = '1';
7744    } else
7745    {
7746        $("#fieldgroup_" + fieldgroup).show();
7747        $("#header_" + fieldgroup).parent().find('.icon-fieldgroup').removeClass('icon-fieldgroup-closed');
7748        $("#header_" + fieldgroup).parent().find('.icon-fieldgroup').addClass('icon-fieldgroup-open');
7749        var hidden = '0';
7750    }
7751    $.ajax({
7752        url: "/ajax/dashboard/module",
7753        data: "module=fieldgroup_" + encodeURIComponent(fieldgroup) + "&hidden=" + encodeURIComponent(hidden),
7754        success: function(data) {},
7755        error: function(data) {}
7756    });
7757};
7758FORM.toggleShowAll = function()
7759{
7760    if ($("#broker_person_oid_showall").is(':checked'))
7761    {
7762        $("#broker_person_oid").html($("#broker_person_oid_fulllist").html());
7763    } else
7764    {
7765        $("#broker_person_oid").html($("#broker_person_oid_shortlist").html());
7766    }
7767};
7768FORM.toUpperCase = function(field_tag)
7769{
7770    $(field_tag).val($(field_tag).val().toUpperCase());
7771};
7772FORM.toLowerCase = function(field_tag)
7773{
7774    $(field_tag).val($(field_tag).val().toLowerCase());
7775};
7776FORM.toNameCase = function(field_tag)
7777{
7778    var name = $(field_tag).val();
7779    var pieces = name.split(" ");
7780    for (var i = 0; i < pieces.length; i++)
7781    {
7782        var j = pieces[i].charAt(0).toUpperCase();
7783        pieces[i] = j + pieces[i].substr(1);
7784    }
7785    name = pieces.join(" ");
7786    var pieces = name.split("-");
7787    for (var i = 0; i < pieces.length; i++)
7788    {
7789        var j = pieces[i].charAt(0).toUpperCase();
7790        pieces[i] = j + pieces[i].substr(1);
7791    }
7792    name = pieces.join("-");
7793    $(field_tag).val(name);
7794};
7795FORM.fixupTextFields = function(dom_base)
7796{
7797    if (dom_base == undefined)
7798        dom_base = '';
7799    $(dom_base + ":text").change(function() {
7800        this.value = jQuery.trim(this.value);
7801    });
7802};
7803FORM.checklistSelectAll = function(field_tag)
7804{
7805    if ($('input[name="' + field_tag + '[]"]:checked').length < $('input[name="' + field_tag + '[]"]').length)
7806    {
7807        $('input[name="' + field_tag + '[]"]').attr('checked', 'checked').parent().find('span.icon-check-empty').addClass("icon-check");
7808    } else
7809    {
7810        $('input[name="' + field_tag + '[]"]').removeAttr('checked').parent().find('span.icon-check-empty').removeClass("icon-check");
7811    }
7812};
7813FORM.showFields = function(hide_fields, show_fields, field, param_attr, init)
7814{
7815    if (field != null && $(field).length == 0)
7816        return;
7817    if (hide_fields != '')
7818    {
7819        $(hide_fields).hide();
7820    }
7821    if (field != null)
7822    {
7823        if (param_attr != null)
7824        {
7825            if ($(field).get(0).tagName == 'SELECT')
7826            {
7827                show_fields = show_fields.replace('$val', $(field + ' option:selected').attr(param_attr));
7828                show_fields = show_fields.replace('$empty', (($(field).val().length == 0 || $(field).val() == '0') ? 'empty' : 'notempty'));
7829            } else
7830            {
7831                show_fields = show_fields.replace('$val', $(field).attr(param_attr));
7832                show_fields = show_fields.replace('$empty', (($(field).attr(param_attr).length == 0) ? 'empty' : 'notempty'));
7833            }
7834        } else
7835        {
7836            if ($(field).attr('type') == 'checkbox')
7837            {
7838                show_fields = show_fields.replace('$val', ($(field).is(':checked') ? '1' : '0'));
7839                show_fields = show_fields.replace('$empty', ($(field).is(':checked') ? 'notempty' : 'empty'));
7840            } else if ($(field).attr('type') == 'radio')
7841            {
7842                show_fields = show_fields.replace('$val', $(field + ':checked').val());
7843                show_fields = show_fields.replace('$empty', ($(field + ':checked').length > 0 ? 'notempty' : 'empty'));
7844            } else
7845            {
7846                show_fields = show_fields.replace('$val', $(field).val());
7847                show_fields = show_fields.replace('$empty', (($(field).val().length == 0 || ($(field).get(0).tagName == 'SELECT' && $(field).val() == '0')) ? 'empty' : 'notempty'));
7848            }
7849        }
7850    }
7851    if (show_fields != '')
7852    {
7853        $(show_fields).show();
7854    }
7855    if (hide_fields != '')
7856    {
7857        $(hide_fields + " input[type=text]").each(function() {
7858            if ($(this).closest("div.form-group").css('display') == 'none' && $(this).attr('data-keephiddenvalue') != '1')
7859            {
7860                $(this).val($(this).attr('data-emptyformat'));
7861            }
7862        });
7863        $(hide_fields + " textarea").each(function() {
7864            if ($(this).closest("div.form-group").css('display') == 'none' && $(this).attr('data-keephiddenvalue') != '1')
7865            {
7866                $(this).val($(this).attr('data-emptyformat'));
7867            }
7868        });
7869        $(hide_fields + " select").each(function() {
7870            if ($(this).closest("div.form-group").css('display') == 'none' && $(this).attr('data-keephiddenvalue') != '1')
7871            {
7872                if ($(this).attr('data-emptyformat') != null && $(this).attr('data-emptyformat') != '')
7873                {
7874                    $(this).val($(this).attr('data-emptyformat'));
7875                } else
7876                {
7877                    $(this).val($('option:first', this).attr('value'));
7878                }
7879            }
7880        });
7881        $(hide_fields + " input[type=checkbox]").each(function() {
7882            if ($(this).closest("div.form-group").css('display') == 'none' && $(this).attr('data-keephiddenvalue') != '1')
7883            {
7884                $(this).removeAttr('checked');
7885            }
7886        });
7887    }
7888    BASE.centerModal();
7889};
7890FORM.getOptions = function(field_name, fetch_url, data, set_fields)
7891{
7892    if (data == null)
7893    {
7894        data = {};
7895    }
7896    if (field_name != null)
7897    {
7898        data[field_name] = $("#" + field_name).val();
7899    }
7900    $.ajax({
7901        url: fetch_url,
7902        data: data,
7903        success: function(data)
7904        {
7905            if (data != null && data.status == '1')
7906            {
7907                if (set_fields != null)
7908                {
7909                    for (var k in set_fields)
7910                    {
7911                        if (data[set_fields[k]] != null)
7912                        {
7913                            FORM.loadOptions('#' + set_fields[k], data[set_fields[k]], $('#' + set_fields[k]).val());
7914                        }
7915                    }
7916                } else
7917                {
7918                    for (var k in data)
7919                    {
7920                        if (k == 'status')
7921                            continue;
7922                        if ($('#' + data[k]).length == 0)
7923                            continue;
7924                        FORM.loadOptions('#' + k, data[k], $('#' + k).val());
7925                    }
7926                }
7927            } else
7928            {
7929                if (set_fields != null)
7930                {
7931                    for (var k in set_fields)
7932                    {
7933                        if ($("#" + set_fields[k]).get(0).tagName == 'SELECT')
7934                        {
7935                            $("#" + set_fields[k]).html('<option value="">
7935--- ' + LOCALE.get('BASE.FORM.ERROR.ErrorFetchingData') + ' ---</option>');
7936                        } else
7937                        {
7938                            $("#" + set_fields[k]).val(LOCALE.get('BASE.FORM.ERROR.ErrorFetchingData'));
7939                        }
7940                    }
7941                }
7942            }
7943        },
7944        error: function()
7945        {
7946            if (set_fields != null)
7947            {
7948                for (var k in set_fields)
7949                {
7950                    if ($("#" + set_fields[k]).get(0).tagName == 'SELECT')
7951                    {
7952                        $("#" + set_fields[k]).html('<option value="">--- ' + LOCALE.get('BASE.FORM.ERROR.ErrorFetchingData') + ' ---</option>');
7953                    } else
7954                    {
7955                        $("#" + set_fields[k]).val(LOCALE.get('BASE.FORM.ERROR.ErrorFetchingData'));
7956                    }
7957                }
7958            }
7959        }
7960    });
7961};
7962CHOOSER = {};
7963CHOOSER.dialog_tag = '';
7964CHOOSER.field_name = '';
7965CHOOSER.search_url = '';
7966CHOOSER.data = {};
7967CHOOSER.addform_url = '';
7968CHOOSER.openChooser = function(field_name, search_url, chooser_title, search_placeholder, data, enable_add, addform_url, displaytrigger)
7969{
7970    var dialog_tag = 'dialog_' + Math.floor(Math.random() * 100000 + 1);
7971    CHOOSER.dialog_tag = dialog_tag;
7972    CHOOSER.field_name = field_name;
7973    CHOOSER.search_url = search_url;
7974    if (chooser_title == null)
7975    {
7976        chooser_title = LOCALE.get('BASE.CHOOSER.DialogTitle');
7977    }
7978    if (search_placeholder == null)
7979    {
7980        search_placeholder = LOCALE.get('BASE.CHOOSER.SearchPlaceholder');
7981    }
7982    if (data != null)
7983    {
7984        CHOOSER.data = data;
7985    }
7986    CHOOSER.data.tag = dialog_tag;
7987    if (addform_url != null)
7988    {
7989        CHOOSER.addform_url = addform_url;
7990    }
7991    var chooser_dialog = '<div id="chooser_searchform" style="margin-bottom: 20px"><table style="width: 100%">';
7992    chooser_dialog = chooser_dialog + '<tr>';
7993    chooser_dialog = chooser_dialog + '<td style="width: 99%"><input type="text" class="form-control" id="chooser_search" name="chooser_search" placeholder="' + search_placeholder + '" autocomplete="off" onkeyup="CHOOSER.searchKeypress(event)"></td>';
7994    chooser_dialog = chooser_dialog + '<td style="width: 1%; text-align: right" nowrap="nowrap">';
7995    chooser_dialog = chooser_dialog + '<button class="btn btn-default" style="margin-left: 10px" onclick="CHOOSER.doSearch()"><span class="icon-search"></span> ' + LOCALE.get('BASE.CHOOSER.Action.Search') + '</button>';
7996    if (enable_add != null && enable_add != false)
7997        chooser_dialog = chooser_dialog + '<button class="btn btn-default" style="margin-left: 10px" onclick="CHOOSER.openAddForm()"><span class="icon-add"></span> ' + enable_add + '</button>';
7998    chooser_dialog = chooser_dialog + '</td>';
7999    chooser_dialog = chooser_dialog + '</tr>';
8000    chooser_dialog = chooser_dialog + '</table></div>';
8001    chooser_dialog = chooser_dialog + '<div id="chooser_results" style="margin-top: 20px"><p style="color: #919191">' + LOCALE.get('BASE.CHOOSER.ResultsPlaceholder') + '</p></div>';
8002    if (enable_add != null && enable_add != false)
8003        chooser_dialog = chooser_dialog + '<div id="chooser_addform" style="display: none">add form be here</div>';
8004    BASE.createDialog(chooser_title, true, 800, dialog_tag);
8005    $("#" + dialog_tag + " .modal-body-content").html(chooser_dialog);
8006    var chooser_buttons = '';
8007    if (enable_add != null && enable_add != false)
8008        chooser_buttons = chooser_buttons + '<button id="chooser_addsubmit" class="btn btn-primary" style="display: none" onclick="">' + LOCALE.get('BASE.FORM.BTN.Add') + '</button>'
8009    chooser_buttons = chooser_buttons + '<button class="btn btn-default" onclick="BASE.closeDialog(\'#' + dialog_tag + '\')">' + LOCALE.get('BASE.DIALOG.CloseWindow') + '</button>';
8010    $("#" + dialog_tag + " .modal-footer").html(chooser_buttons);
8011    $('#' + dialog_tag).modal({
8012        backdrop: 'static',
8013        keyboard: true,
8014        show: true
8015    });
8016    if (displaytrigger != null)
8017    {
8018        displaytrigger(dialog_tag);
8019    }
8020    $("#chooser_search").focus();
8021};
8022CHOOSER.searchKeypress = function(evt)
8023{
8024    if (evt.which == 13)
8025    {
8026        CHOOSER.doSearch();
8027        evt.stopPropagation();
8028    }
8029};
8030CHOOSER.doSearch = function()
8031{
8032    var search = $("#chooser_search").val();
8033    if (search == '')
8034    {
8035        return;
8036    } else if (search.length < 3)
8037    {
8038        $("#chooser_results").html('<p style="color: #919191">' + sprintf(LOCALE.get('BASE.CHOOSER.Error.MinimumLength'), '3') + '</p>');
8039        return;
8040    }
8041    var submitdata = CHOOSER.data;
8042    submitdata.search = search;
8043    submitdata.dialog_tag = CHOOSER.dialog_tag;
8044    $.ajax({
8045        url: CHOOSER.search_url,
8046        data: submitdata,
8047        success: function(data)
8048        {
8049            if (data != null && data.status == '1')
8050            {
8051                $("#chooser_results").html(data.content);
8052                BASE.centerModal(CHOOSER.dialog_tag);
8053            } else
8054            {
8055                $("#chooser_results").html('<p style="color: #920000">' + oneof(data.error, LOCALE.get('BASE.CHOOSER.Error')) + '</p>');
8056                BASE.centerModal(CHOOSER.dialog_tag);
8057                return;
8058            }
8059        },
8060        error: function()
8061        {
8062            $("#chooser_results").html('<p style="color: #920000">' + LOCALE.get('BASE.CHOOSER.Error') + '</p>');
8063            BASE.centerModal(CHOOSER.dialog_tag);
8064        }
8065    });
8066};
8067CHOOSER.openAddForm = function()
8068{
8069    $.ajax({
8070        url: CHOOSER.addform_url,
8071        data: CHOOSER.data,
8072        success: function(data)
8073        {
8074            if (data != null && data.status == '1')
8075            {
8076                $("#chooser_searchform").hide();
8077                $("#chooser_results").hide();
8078                $("#chooser_addform").show();
8079                $("#chooser_addsubmit").show();
8080                $("#chooser_addform").html(data.content);
8081                if (data.submit != null)
8082                {
8083                    $("#chooser_addsubmit").text(data.submit);
8084                }
8085                if ($("#" + CHOOSER.dialog_tag + " .modal-body-content .defaultfocus").length)
8086                {
8087                    $("#" + CHOOSER.dialog_tag + " .modal-body-content .defaultfocus")[0].focus();
8088                } else
8089                {
8090                    if ($("#" + CHOOSER.dialog_tag + " .modal-body-content :input:visible").length)
8091                    {
8092                        $("#" + CHOOSER.dialog_tag + " .modal-body-content :input:visible").first().focus();
8093                    }
8094                }
8095                if ($("#" + CHOOSER.dialog_tag + " .modal-body-content input.setsearchresult").length)
8096                {
8097                    $("#" + CHOOSER.dialog_tag + " .modal-body-content input.setsearchresult").val($("#chooser_search").val());
8098                }
8099                BASE.centerModal(CHOOSER.dialog_tag);
8100                FORM.initElements("#form_" + CHOOSER.dialog_tag);
8101                $('#chooser_addsubmit').on('click', function() {
8102                    if ($("#form_" + CHOOSER.dialog_tag)[0].action == null || $("#form_" + CHOOSER.dialog_tag)[0].action == "")
8103                    {
8104                        BASE.alert(LOCALE.get('BASE.FORM.Error.CouldNotFindForm'), LOCALE.get('BASE.COMMON.Error'));
8105                        return;
8106                    }
8107                    $("#form_" + CHOOSER.dialog_tag + " td.label.error").removeClass('error');
8108                    BASE.progressDialog(LOCALE.get('BASE.FORM.MSG.Saving'));
8109                    $("#form_" + CHOOSER.dialog_tag).ajaxSubmit({
8110                        type: "post",
8111                        data: {
8112                            ajaxsubmit: '1'
8113                        },
8114                        success: function(data)
8115                        {
8116                            if (data != null && data.status == '1')
8117                            {
8118                                if (data.message != null && data.message != '')
8119                                {
8120                                    BASE.closeProgressDialog();
8121                                    BASE.closeDialog('#' + dialog_tag);
8122                                    if (data.redirect != null && data.redirect != '')
8123                                    {
8124                                        BASE.alert(data.message, null, null, data.redirect);
8125                                    } else if (data.reload != null && data.reload == '1')
8126                                    {
8127                                        BASE.alert(data.message, null, true);
8128                                    }
8129                                } else if (data.redirect != null && data.redirect != '')
8130                                {
8131                                    BASE.closeDialog('#' + CHOOSER.dialog_tag);
8132                                    BASE.redirect(data.redirect);
8133                                } else if (data.reload != null && data.reload == '1')
8134                                {
8135                                    BASE.closeDialog('#' + CHOOSER.dialog_tag);
8136                                    BASE.reload();
8137                                } else
8138                                {
8139                                    BASE.closeProgressDialog();
8140                                    if (data.submitsuccessaction)
8141                                    {
8142                                        eval(data.submitsuccessaction);
8143                                    }
8144                                    BASE.closeDialog('#' + CHOOSER.dialog_tag);
8145                                }
8146                            } else
8147                            {
8148                                BASE.closeProgressDialog();
8149                                var errors = '<b>' + LOCALE.get('BASE.FORM.Error.Errors') + ':</b>';
8150                                if (data != null && data.error != null)
8151                                {
8152                                    if (typeof(data.error) == 'object')
8153                                    {
8154                                        for (var fld_tag in data.error)
8155                                        {
8156                                            if (data.error.hasOwnProperty(fld_tag))
8157                                            {
8158                                                errors = errors + '<br/> &#0149; ' + data.error[fld_tag];
8159                                            }
8160                                        }
8161                                        BASE.displayErrors(errors, LOCALE.get('BASE.COMMON.Error'), data.error);
8162                                    } else
8163                                    {
8164                                        BASE.alert(data.error, LOCALE.get('BASE.COMMON.Error'));
8165                                    }
8166                                } else
8167                                {
8168                                    BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData') + ': 1', LOCALE.get('BASE.COMMON.Error'));
8169                                }
8170                                return;
8171                            }
8172                        },
8173                        error: function(xhr, ajaxOptions, thrownError)
8174                        {
8175                            BASE.closeProgressDialog();
8176                            BASE.alert(LOCALE.get('BASE.COMMON.ErrorSavingData') + ': ' + thrownError + ' / ' + var_dump(xhr), LOCALE.get('BASE.COMMON.Error'));
8177                            return;
8178                        }
8179                    });
8180                });
8181            } else
8182            {
8183                if (data.error != null)
8184                {
8185                    $("#chooser_results").html('<p style="color: #920000">' + data.error + '</p>');
8186                } else
8187                {
8188                    $("#chooser_results").html('<p style="color: #920000">' + LOCALE.get('BASE.COMMON.ErrorReadingData') + '</p>');
8189                }
8190            }
8191        },
8192        error: function()
8193        {
8194            $("#chooser_results").html('<p style="color: #920000">' + LOCALE.get('BASE.COMMON.ErrorReadingData') + '</p>');
8195            BASE.centerModal(CHOOSER.dialog_tag);
8196        }
8197    });
8198};
8199CHOOSER.select = function(value, description)
8200{
8201    $("#" + CHOOSER.field_name).val(value);
8202    $("#" + CHOOSER.field_name + "_display").html(description);
8203    CHOOSER.closeChooser();
8204};
8205CHOOSER.closeChooser = function()
8206{
8207    BASE.closeDialog('#' + CHOOSER.dialog_tag);
8208};
8209INLINECHOOSER = {};
8210INLINECHOOSER.search_results = new Array();
8211INLINECHOOSER.keyPress = function(field_tag, min_search_length, search_url, multiple, evt)
8212{
8213    var search = $("#" + field_tag + "_search").val();
8214    if (search.length < min_search_length)
8215    {
8216        $("#" + field_tag + "_searchresults").hide();
8217        return;
8218    }
8219    if (evt.which == 13)
8220    {
8221        evt.stopPropagation();
8222        if (INLINECHOOSER.search_results[field_tag] != null && Object.elementCount(INLINECHOOSER.search_results[field_tag]) == 1)
8223        {
8224            for (var i in INLINECHOOSER.search_results[field_tag])
8225            {
8226                var key = ((i.indexOf("#_")>-1) ? i.replace("#_", "") : i);
8227                if (multiple)
8228                {
8229                    INLINECHOOSER.addItem(field_tag, key, INLINECHOOSER.search_results[field_tag][i]);
8230                } else
8231                {
8232                    INLINECHOOSER.select(field_tag, key, INLINECHOOSER.search_results[field_tag][i]);
8233                }
8234            }
8235        }
8236        return;
8237    }
8238    $.ajax({
8239        url: search_url,
8240        data: {
8241            search: search
8242        },
8243        success: function(data)
8244        {
8245            if (data != null && data.status == '1')
8246            {
8247                if (data.message != null && data.message.length > 0)
8248                {
8249                    $("#" + field_tag + "_searchresults").show();
8250                    $("#" + field_tag + "_searchresults").html('<div class="field-inlinechooser-search-message">' + data.message + '</div>');
8251                } else if (data.search != null)
8252                {
8253                    INLINECHOOSER.search_results[field_tag] = data.search;
8254                    var res = '';
8255                    for (var i in data.search)
8256                    {
8257                        var key = ((i.indexOf("#_")>-1) ? i.replace("#_", "") : i);
8258                        if (multiple)
8259                        {
8260                            var action = "INLINECHOOSER.addItem('" + field_tag + "','" + key + "','" + data.search[i] + "')";
8261                        } else
8262                        {
8263                            var action = "INLINECHOOSER.select('" + field_tag + "','" + key + "','" + data.search[i] + "')";
8264                        }
8265                        res = res + '<div class="field-inlinechooser-search-resultitem" onclick="' + action + '">' + data.search[i] + '</a></div>';
8266                    }
8267                    $("#" + field_tag + "_searchresults").show();
8268                    $("#" + field_tag + "_searchresults").html(res);
8269                } else
8270                {
8271                    $("#" + field_tag + "_searchresults").show();
8272                    $("#" + field_tag + "_searchresults").html('<div class="field-inlinechooser-search-message" style="color: #920000">' + LOCALE.get('BASE.CHOOSER.Error') + '</div>');
8273                }
8274            } else
8275            {
8276                $("#" + field_tag + "_searchresults").show();
8277                $("#" + field_tag + "_searchresults").html('<div class="field-inlinechooser-search-message" style="color: #920000">' + oneof(data.error, LOCALE.get('BASE.CHOOSER.Error')) + '</div>');
8278            }
8279        },
8280        error: function()
8281        {
8282            $("#" + field_tag + "_searchresults").show();
8283            $("#" + field_tag + "_searchresults").html('<div class="field-inlinechooser-search-message" style="color: #920000">' + LOCALE.get('BASE.CHOOSER.Error') + '</div>');
8284        }
8285    });
8286};
8287INLINECHOOSER.select = function(field_tag, value, description)
8288{
8289    $("#" + field_tag).val(value).trigger('change');
8290    $("#" + field_tag + "_display").html(description);
8291    $("#" + field_tag + "_searchresults").hide();
8292    $("#" + field_tag + "_search").val('').focus();
8293};
8294INLINECHOOSER.addItem = function(field_tag, value, description)
8295{
8296    if ($("#" + field_tag + "_val_" + value).length == 0)
8297    {
8298        var html = '<p id="' + field_tag + '_val_' + value + '" class="form-control-static field-inlinechooser-value" style="width: 100%">';
8299        var html = html + '<input type="hidden" id="' + field_tag + '_' + value + '" name="' + field_tag + '[]" value="' + value + '">';
8300        var html = html + '<span class="field-chooser-display">' + description + '</span>';
8301        var html = html + '<span class="field-chooser-choose">
8301<a onclick="INLINECHOOSER.removeItem(\'' + field_tag + '\',\'' + value + '\')"><span class="icon-cancel"></span></a></span>';
8302        var html = html + '</p>';
8303        $("#" + field_tag + "_value").append(html);
8304        $("#" + field_tag + "_trigger").trigger('change');
8305    }
8306    $("#" + field_tag + "_none").hide();
8307    $("#" + field_tag + "_searchresults").hide();
8308    $("#" + field_tag + "_search").val('').focus();
8309};
8310INLINECHOOSER.removeItem = function(field_tag, value)
8311{
8312    $("#" + field_tag + "_val_" + value).remove();
8313    if ($("#" + field_tag + "_value .field-inlinechooser-value").length == 0)
8314    {
8315        $("#" + field_tag + "_none").show();
8316    }
8317    $("#" + field_tag + "_trigger").trigger('change');
8318};
8319LIST = {};
8320LIST.FILTER = {};
8321LIST.FILTER.CHECKLIST = {};
8322LIST.FILTER.CHECKLIST.openFilter = function(field_tag, title, options)
8323{
8324    var selected = $("input[name=filter_" + field_tag + "]").val().split(',');
8325    var filtercontent = '<div class="checklistfilter-options container-fluid"><div class="row-fluid">';
8326    var c = 1;
8327    for (var o in options)
8328    {
8329        c++;
8330        if (c == 2)
8331        {
8332            filtercontent = filtercontent + '</div>';
8333            filtercontent = filtercontent + '<div class="row-fluid">';
8334            c = 0;
8335        }
8336        filtercontent = filtercontent + '<div class="col-xs-6"><label for="filteroption_' + o + '"><input type="checkbox" style="margin-right: 7px" id="filteroption_' + o + '" rel="filteroption_' + field_tag + '" value="' + o + '"' + ($.inArray(o, selected)!=-1 ? 'checked="checked"' : '') + '>' + options[o] + '</label></div>';
8337    }
8338    filtercontent = filtercontent + '</div></div>';
8339    var dialog_tag = BASE.createDialog(title, true);
8340    $('#' + dialog_tag + ' .modal-body-content').html(filtercontent);
8341    $('#' + dialog_tag + ' .modal-footer').append('<button type="button" id="' + dialog_tag + '_btn_apply" class="btn btn-primary">' + LOCALE.get('BASE.LIST.Filter.ApplySelection') + '</button>');
8342    $('#' + dialog_tag + '_btn_apply').on('click', function() {
8343        var filterval = '';
8344        var filtertext = '';
8345        if ($("input[rel=filteroption_" + field_tag + "]:checked").length < $("input[rel=filteroption_" + field_tag + "]").length)
8346        {
8347            $("input[rel=filteroption_" + field_tag + "]:checked").each(function() {
8348                if (filterval != '')
8349                {
8350                    filterval = filterval + ',';
8351                    filtertext = filtertext + ', ';
8352                }
8353                filterval = filterval + $(this).attr('value');
8354                filtertext = filtertext + options[$(this).attr('value')];
8355            });
8356        }
8357        if (filterval == '')
8358        {
8359            filtertext = '--- ' + LOCALE.get('BASE.COMMON.All') + ' ---';
8360        }
8361        $("input[name=filter_" + field_tag + "]").val(filterval).change();
8362        $("input[name=filter_" + field_tag + "_disp]").val(filtertext);
8363        $("#" + dialog_tag).modal('hide');
8364    });
8365    $('#' + dialog_tag + ' .modal-footer').append('<button type="button" class="btn btn-default" data-dismiss="modal">' + LOCALE.get('BASE.FORM.Btn.Cancel') + '</button>');
8366    $('#' + dialog_tag).modal({
8367        backdrop: 'static',
8368        keyboard: true,
8369        show: true
8370    });
8371};
8372var TAB = {};
8373TAB.loaded = new Array();
8374TAB.select = function(tab_id, content_url)
8375{
8376    $('.tabcontent').hide();
8377    $('#content_' + tab_id).show();
8378    $(".nav-tabs li").removeClass('active');
8379    $('#tab_' + tab_id).addClass('active');
8380    var URL = document.location.toString();
8381    if (URL.match('#'))
8382    {
8383        var URLbase = URL.split('#')[0];
8384        document.location.href = URLbase + '#' + tab_id;
8385    } else
8386    {
8387        document.location.href = URL + '#' + tab_id;
8388    }
8389    if (content_url == null && $("#content_" + tab_id).attr('rel') != undefined && $("#content_" + tab_id).attr('rel') != '')
8390    {
8391        content_url = $("#content_" + tab_id).attr('rel');
8392    }
8393    if (content_url != null)
8394    {
8395        if (TAB.loaded[tab_id] != null && TAB.loaded[tab_id] == 1) {
8396            return;
8397        }
8398        $("#content_" + tab_id).html('<div class="icon-spin"> Loading...</div>');
8399        $.ajax({
8400            url: content_url,
8401            data: "",
8402            success: function(data)
8403            {
8404                if (data != null && data.status == '1')
8405                {
8406                    $("#content_" + tab_id).hide().html(data.content).fadeIn(200);
8407                    TAB.loaded[tab_id] = 1;
8408                    $("#content_" + tab_id + ' [data-toggle="tooltip"]').tooltip();
8409                    TAB.initTab(tab_id);
8410                    if ($("#content_" + tab_id).attr('data-displaytrigger').length)
8411                    {
8412                        eval($("#content_" + tab_id).attr('data-displaytrigger'));
8413                    }
8414                } else
8415                {
8416                    if (data.error != null && data.error != '')
8417                    {
8418                        $("#content_" + tab_id).html('<div class="alert alert-danger">' + data.error + '</div>');
8419                    } else
8420                    {
8421                        $("#content_" + tab_id).html('<div class="alert alert-danger">' + LOCALE.get('BASE.COMMON.ErrorReadingData') + '</div>');
8422                    }
8423                    return;
8424                }
8425            },
8426            error: function()
8427            {
8428                $("#content_" + tab_id).html('<div class="alert alert-danger">' + LOCALE.get('BASE.COMMON.ErrorReadingData') + '</div>');
8429                return;
8430            }
8431        });
8432    }
8433};
8434TAB.initTab = function(tab_id)
8435{};
8436var LOG = {};
8437LOG.toggleData = function(id)
8438{
8439    if (id != null)
8440    {
8441        var $icon = $('#' + id).prev().find('span.icon-arrow-closed,span.icon-arrow-open');
8442        if ($icon.attr('class') == 'icon-arrow-closed')
8443        {
8444            $icon.attr('class', 'icon-arrow-open');
8445        } else
8446        {
8447            $icon.attr('class', 'icon-arrow-closed');
8448        }
8449        $('#' + id).toggle();
8450    } else
8451    {
8452        $('.logrow').show();
8453        $('#content_log table span').attr('class', 'icon-arrow-open');
8454    }
8455};
8456PASSWORD = {};
8457PASSWORD.suggestPassword = function(field_tag)
8458{
8459    while (true)
8460    {
8461        var password = '';
8462        var symbols = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz987654321";
8463        for (var b = 0; b < 4; b++)
8464        {
8465            if (b > 0)
8466                password += '-';
8467            for (var i = 0; i < 3; i++)
8468            {
8469                var symbol = symbols[(Math.floor(Math.random() * symbols.length))];
8470                password += symbol;
8471            }
8472        }
8473        if (password.match(/([987654321])+/))
8474            break;
8475    }
8476    $("#" + field_tag).val(password);
8477    $("#" + field_tag + "_repeat").val(password);
8478    BASE.alert(LOCALE.get('BASE.FORM.Password.SuggestPassword.Result.1') + ': <b>' + password + '</b><br/>' + LOCALE.get('BASE.FORM.Password.SuggestPassword.Result.2'), LOCALE.get('BASE.FORM.Password.SuggestPassword.Title'));
8479};
8480LOGIN = {};
8481LOGIN.usernameKeypress = function(evt)
8482{
8483    if (evt.which == 13)
8484    {
8485        $("#login_password")[0].focus();
8486        evt.stopPropagation();
8487        return;
8488    }
8489};
8490LOGIN.passwordKeypress = function(evt)
8491{
8492    if (evt.which == 13)
8493    {
8494        LOGIN.doLogin();
8495        evt.stopPropagation();
8496        return;
8497    }
8498};
8499LOGIN.doLogin = function()
8500{
8501    $("#login_message").hide();
8502    $("#feedback_login_email").attr('class', 'form-control-feedback');
8503    $("#feedback_login_password").attr('class', 'form-control-feedback');
8504    var username = jQuery.trim($("#login_email").val());
8505    if (username == '')
8506    {
8507        $("#feedback_login_email").attr('class', 'form-control-feedback icon-cancel text-danger');
8508        $("#login_email")[0].focus();
8509        return;
8510    } else if (!username.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/))
8511    {
8512        $("#feedback_login_email").attr('class', 'form-control-feedback icon-cancel text-danger');
8513        $("#login_email")[0].focus();
8514        return;
8515    }
8516    var password = jQuery.trim($("#login_password").val());
8517    if (username == 'password')
8518    {
8519        $("#feedback_login_password").attr('class', 'form-control-feedback icon-cancel text-danger');
8520        $("#login_password")[0].focus();
8521        return;
8522    }
8523    $("#login_email").attr('readonly', 'readonly');
8524    $("#login_password").attr('readonly', 'readonly');
8525    $("#login_submit").attr('disabled', 'disabled');
8526    if ($("#login_submit").attr('data-title-progress') != null && $("#login_submit").attr('data-title-progress') != '')
8527    {
8528        $("#login_submit").html($("#login_submit").attr('data-title-progress'));
8529    }
8530    $("#login_form").ajaxSubmit({
8531        type: 'post',
8532        data: {
8533            login: '1'
8534        },
8535        success: function(data)
8536        {
8537            $("#login_email").removeAttr('readonly');
8538            $("#login_password").removeAttr('readonly');
8539            $("#login_submit").removeAttr('disabled');
8540            if ($("#login_submit").attr('data-title') != null && $("#login_submit").attr('data-title') != '')
8541            {
8542                $("#login_submit").html($("#login_submit").attr('data-title'));
8543            }
8544            if (data != null && data.status == '1')
8545            {
8546                if (data.redirect != null && data.redirect != '')
8547                {
8548                    BASE.redirect(data.redirect);
8549                } else if (data.reload != null && data.reload == '1')
8550                {
8551                    BASE.reload();
8552                } else
8553                {
8554                    if (data.submitsuccessaction)
8555                    {
8556                        eval(data.submitsuccessaction);
8557                    }
8558                }
8559            } else
8560            {
8561                $("#login_message").text(oneof(data.error, 'Login error')).show();
8562                return;
8563            }
8564        },
8565        error: function()
8566        {
8567            $("#login_email").removeAttr('disabled');
8568            $("#login_password").removeAttr('disabled');
8569            $("#login_submit").removeAttr('disabled');
8570            if ($("#login_submit").attr('data-title') != null && $("#login_submit").attr('data-title') != '')
8571            {
8572                $("#login_submit").html($("#login_submit").attr('data-title'));
8573            }
8574            $("#login_message").text('Login error').show();
8575            return;
8576        }
8577    });
8578};
8579
8580LOCALE = new Object();
8581LOCALE.get = function(tag) {
8582    return LOCALE.data[tag.toLowerCase()];
8583}
8584LOCALE.tag = new String('en');
8585LOCALE.data = {
8586    "base.common.ok": "OK",
8587    "base.common.warnings": "Warnings",
8588    "base.common.notok": "Not OK",
8589    "base.common.showall": "show all",
8590    "base.common.missing": "missing",
8591    "base.common.notset": "not set",
8592    "base.common.notentered": "not entered",
8593    "base.common.notconnected": "not connected",
8594    "base.common.none": "none",
8595    "base.common.empty": "empty",
8596    "base.common.unknown": "unknown",
8597    "base.common.all": "all",
8598    "base.common.selectall": "select all",
8599    "base.common.selected": "selected",
8600    "base.common.other": "other",
8601    "base.common.otherenter": "other, enter",
8602    "base.common.backtolist": "back to list",
8603    "base.common.error": "ERROR",
8604    "base.common.errorpage": "Unfortunately the page you tried to access was unvailable due to an error",
8605    "base.common.errorreadingdata": "Error reading data.",
8606    "base.common.errorsavingdata": "Error saving data.",
8607    "base.common.errorcheckingdata": "Error checking data.",
8608    "base.common.errorreadingfile": "Error reading file.",
8609    "base.common.errorreadingcalcresults": "Error reading response.",
8610    "base.common.errordisplayingform": "Error displaying form.",
8611    "base.common.errorcreatingpdf": "Error creating PDF.",
8612    "base.common.error.templatenotfound": "Template not found.",
8613    "base.common.error.accessdenied": "Access denied.",
8614    "base.common.error.notnumeric": "Not a numeric value",
8615    "base.common.error.nothingselected": "Nothing selected",
8616    "base.common.error.date.invalid": "Must be in the %s format",
8617    "base.common.error.date.invaliddate": "Invalid date",
8618    "base.common.error.date.invalid.range": "Must be date or date range in the %s format",
8619    "base.common.error.date.startinvalid": "Period start not in a valid %s format",
8620    "base.common.error.date.endinvalid": "Period end not in a valid %s format",
8621    "base.common.error.date.endearlierthanstart": "Period start must be earlier than the end",
8622    "base.common.error.numberfld.format": "Field value is not a valid number",
8623    "base.common.error.numberfld.format.negative": "Field value is not a valid positive number",
8624    "base.common.error.numberfld.minvalue": "The minimum allowed value is %s",
8625    "base.common.error.numberfld.maxvalue": "The maximum allowed value is %s",
8626    "base.common.error.delete.relateddataexists": "Cannot delete - related data exists.",
8627    "base.common.yes": "Yes",
8628    "base.common.no": "No",
8629    "base.common.enabled": "Enabled",
8630    "base.common.disabled": "Disabled",
8631    "base.common.add": "Add",
8632    "base.common.edit": "Edit",
8633    "base.common.delete": "Delete",
8634    "base.common.choose": "Choose",
8635    "base.common.noteditable": "Not editable",
8636    "base.common.email": "E-mail address",
8637    "base.common.email.short": "E-mail",
8638    "base.common.name": "Name",
8639    "base.common.name.first": "First name",
8640    "base.common.name.last": "Last name",
8641    "base.common.name.middle": "Middle name",
8642    "base.common.type": "Type",
8643    "base.common.status": "Status",
8644    "base.common.language": "Language",
8645    "base.common.login": "Login",
8646    "base.common.password": "Password",
8647    "base.common.password.repeat": "Password (repeat)",
8648    "base.common.date": "Date",
8649    "base.common.time": "Time",
8650    "base.common.datetime": "Date/time",
8651    "base.common.day": "day",
8652    "base.common.days": "days",
8653    "base.common.dayabbr": "D",
8654    "base.common.week": "week",
8655    "base.common.weeks": "weeks",
8656    "base.common.weekabbr": "W",
8657    "base.common.month": "month",
8658    "base.common.months": "months",
8659    "base.common.monthabbr": "M",
8660    "base.common.year": "year",
8661    "base.common.years": "years",
8662    "base.common.yearabbr": "Y",
8663    "base.common.hour": "hour",
8664    "base.common.hours": "hours",
8665    "base.common.hourabbr": "h",
8666    "base.common.min": "minute",
8667    "base.common.mins": "minutes",
8668    "base.common.minabbr": "m",
8669    "base.common.day.1": "Monday",
8670    "base.common.day.2": "Tuesday",
8671    "base.common.day.3": "Wednesday",
8672    "base.common.day.4": "Thursday",
8673    "base.common.day.5": "Friday",
8674    "base.common.day.6": "Saturday",
8675    "base.common.day.7": "Sunday",
8676    "base.common.day.short.1": "Mon",
8677    "base.common.day.short.2": "Tue",
8678    "base.common.day.short.3": "Wed",
8679    "base.common.day.short.4": "Thu",
8680    "base.common.day.short.5": "Fri",
8681    "base.common.day.short.6": "Sat",
8682    "base.common.day.short.7": "Sun",
8683    "base.common.month.1": "January",
8684    "base.common.month.2": "February",
8685    "base.common.month.3": "March",
8686    "base.common.month.4": "April",
8687    "base.common.month.5": "May",
8688    "base.common.month.6": "June",
8689    "base.common.month.7": "July",
8690    "base.common.month.8": "August",
8691    "base.common.month.9": "September",
8692    "base.common.month.10": "October",
8693    "base.common.month.11": "November",
8694    "base.common.month.12": "December",
8695    "base.common.month.short.1": "Jan",
8696    "base.common.month.short.2": "Feb",
8697    "base.common.month.short.3": "Mar",
8698    "base.common.month.short.4": "Apr",
8699    "base.common.month.short.5": "May",
8700    "base.common.month.short.6": "Jun",
8701    "base.common.month.short.7": "Jul",
8702    "base.common.month.short.8": "Aug",
8703    "base.common.month.short.9": "Sep",
8704    "base.common.month.short.10": "Oct",
8705    "base.common.month.short.11": "Nov",
8706    "base.common.month.short.12": "Dec",
8707    "base.list.filter.submit": "Apply filters",
8708    "base.list.filter.clear": "Clear filters",
8709    "base.list.filter.required": "Please enter/choose at least one filter criteria.",
8710    "base.list.filter.applyselection": "Apply selection",
8711    "base.list.filter.toggleall": "Toggle all",
8712    "base.list.filter.showall": "Show all",
8713    "base.list.actions": "Actions",
8714    "base.list.action.add": "Add a new entry",
8715    "base.list.action.addsub": "Add subentry",
8716    "base.list.action.edit": "Edit entry",
8717    "base.list.action.delete": "Delete entry",
8718    "base.list.action.swap.up": "Move entry up",
8719    "base.list.action.swap.dn": "Move entry down",
8720    "base.list.confirm": "Sure? This action cannot be undone.",
8721    "base.list.confirm2": "Are you sure?",
8722    "base.list.totalrecords": "Total of <b>%d</b> record(s)",
8723    "base.list.return": "return",
8724    "base.dialog.title.message": "Message",
8725    "base.dialog.title.choose": "Please choose",
8726    "base.dialog.title.confirm": "Please confirm",
8727    "base.dialog.closewindow": "Close dialog",
8728    "base.form.select": "select from here",
8729    "base.form.btn.save": "Save",
8730    "base.form.btn.add": "Add",
8731    "base.form.btn.edit": "Save",
8732    "base.form.btn.ok": "OK",
8733    "base.form.btn.cancel": "Cancel",
8734    "base.form.msg.querying": "Querying data, hold on a moment ...",
8735    "base.form.msg.saving": "Saving, hold on a moment ...",
8736    "base.form.notes": "Notes",
8737    "base.form.notes.password": "Only enter password if you want to change it.",
8738    "base.form.chooser.choose": "choose",
8739    "base.form.chooser.clear": "clear",
8740    "base.form.password.suggestpassword": "suggest a secure password",
8741    "base.form.password.suggestpassword.title": "Password suggestion",
8742    "base.form.password.suggestpassword.result.1": "Your password is",
8743    "base.form.password.suggestpassword.result.2": "Please write it down and store in a safe place.",
8744    "base.form.error.errors": "The following errors occured while validating data",
8745    "base.form.error.erroropeningdialog": "An error occured trying to open the dialog.",
8746    "base.form.error.couldnotfindform": "Could not find the form",
8747    "base.form.error.couldnotload": "Could not load data",
8748    "base.form.error.couldnotsave": "Could not save data",
8749    "base.form.error.requiredfieldempty": "Required field is empty",
8750    "base.form.error.filter": "Field contains invalid characters",
8751    "base.form.error.unique": "Field value is not unique",
8752    "base.form.error.minlength": "Value too short (at least %d characters required)",
8753    "base.form.error.maxlength": "Value too long (maximum %d characters allowed)",
8754    "base.form.error.minvalue": "Value under allowed minimum value (%d)",
8755    "base.form.error.maxvalue": "Value over allowed maximum value (%d)",
8756    "base.form.error.invalidvalue": "Invalid value",
8757    "base.form.error.invaliddate": "Invalid date",
8758    "base.form.error.invalidtime": "Invalid time",
8759    "base.form.error.incompletedatetime": "Incomplete date/time",
8760    "base.form.error.passwordweak1": "Password too weak (must contain both characters and numbers)",
8761    "base.form.error.passwordweak2": "Password too weak (must contain lower- and uppercase characters, numbers and punctuation)",
8762    "base.form.error.passwordrepeatempty": "Password repeat empty",
8763    "base.form.error.passwordrepeatmismatch": "Password repeat does not match",
8764    "base.form.error.filetypenotallowed": "Files of this type are not allowed",
8765    "base.form.error.invalidemail": "E-mail address invalid",
8766    "base.form.error.invalidemail2": "E-mail address (%s) invalid",
8767    "base.form.error.duplicatekey": "A record with the given data already exists, cannot create a duplicate.",
8768    "base.form.error.errorfetchingdata": "ERROR FETCHING DATA",
8769    "base.form.log.password.old": "old password",
8770    "base.form.log.password.new": "new password"
8771}
8772
8773LOCALE.datepicker = new String('dd.mm.yyyy');

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.