PageSourceSearch

https://citizensclimatelobby.org/wp-content/themes/dante-child/js/theme-scripts.js?ver=6.3.11

js citizensclimatelobby.org collected 2026-10-01 09:07:03 UTC 226,710 bytes, 6,962 lines download raw bytes

1/*
2 * -- CONTENTS
3 *
4 * - MODERNIZR
5 * - HOVERINTENT
6 * - DC MEGA MENU
7 * - SMARTRESIZE
8 * - EQUALHEIGHTS
9 * - EASY PIE CHART
10 * - ANIMATE NUMBER
11 * - CLASSIE
12 * - ANIMONSCROLL
13 * - MASONRY
14 * - STICKY
15 * - TOUCHSWIPE
16 * - APPEAR
17 * - NICESCROLL
18 * - COUNTTO
19 * - COUNTDOWN
20 * - JQUERY PARALLAX
21 * - VIEWPORTS
22 * - STICKY SIDEBAR
23 * - vCenter
24 * - vCenterTop
25 *
26 */
27
28/////////////////////////////////////////////
29// MODERNIZR PLUGIN
30/////////////////////////////////////////////
31
32/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
33 * Build: http://modernizr.com/download/#-cssanimations-shiv-cssclasses-testprop-testallprops-domprefixes-load
34 */
35(window.Modernizr = (function (a, b, c) {
36  function x(a) {
37    j.cssText = a;
38  }
39  function y(a, b) {
40    return x(prefixes.join(a + ";") + (b || ""));
41  }
42  function z(a, b) {
43    return typeof a === b;
44  }
45  function A(a, b) {
46    return !!~("" + a).indexOf(b);
47  }
48  function B(a, b) {
49    for (var d in a) {
50      var e = a[d];
51      if (!A(e, "-") && j[e] !== c) return b == "pfx" ? e : !0;
52    }
53    return !1;
54  }
55  function C(a, b, d) {
56    for (var e in a) {
57      var f = b[a[e]];
58      if (f !== c)
59        return d === !1 ? a[e] : z(f, "function") ? f.bind(d || b) : f;
60    }
61    return !1;
62  }
63  function D(a, b, c) {
64    var d = a.charAt(0).toUpperCase() + a.slice(1),
65      e = (a + " " + n.join(d + " ") + d).split(" ");
66    return z(b, "string") || z(b, "undefined")
67      ? B(e, b)
68      : ((e = (a + " " + o.join(d + " ") + d).split(" ")), C(e, b, c));
69  }
70  var d = "2.6.2",
71    e = {},
72    f = !0,
73    g = b.documentElement,
74    h = "modernizr",
75    i = b.createElement(h),
76    j = i.style,
77    k,
78    l = {}.toString,
79    m = "Webkit Moz O ms",
80    n = m.split(" "),
81    o = m.toLowerCase().split(" "),
82    p = {},
83    q = {},
84    r = {},
85    s = [],
86    t = s.slice,
87    u,
88    v = {}.hasOwnProperty,
89    w;
90  !z(v, "undefined") && !z(v.call, "undefined")
91    ? (w = function (a, b) {
92        return v.call(a, b);
93      })
94    : (w = function (a, b) {
95        return b in a && z(a.constructor.prototype[b], "undefined");
96      }),
97    Function.prototype.bind ||
98      (Function.prototype.bind = function (b) {
99        var c = this;
100        if (typeof c != "function") throw new TypeError();
101        var d = t.call(arguments, 1),
102          e = function () {
103            if (this instanceof e) {
104              var a = function () {};
105              a.prototype = c.prototype;
106              var f = new a(),
107                g = c.apply(f, d.concat(t.call(arguments)));
108              return Object(g) === g ? g : f;
109            }
110            return c.apply(b, d.concat(t.call(arguments)));
111          };
112        return e;
113      }),
114    (p.cssanimations = function () {
115      return D("animationName");
116    });
117  for (var E in p)
118    w(p, E) &&
119      ((u = E.toLowerCase()), (e[u] = p[E]()), s.push((e[u] ? "" : "no-") + u));
120  return (
121    (e.addTest = function (a, b) {
122      if (typeof a == "object") for (var d in a) w(a, d) && e.addTest(d, a[d]);
123      else {
124        a = a.toLowerCase();
125        if (e[a] !== c) return e;
126        (b = typeof b == "function" ? b() : b),
127          typeof f != "undefined" &&
128            f &&
129            (g.className += " " + (b ? "" : "no-") + a),
130          (e[a] = b);
131      }
132      return e;
133    }),
134    x(""),
135    (i = k = null),
136    (function (a, b) {
137      function k(a, b) {
138        var c = a.createElement("p"),
139          d = a.getElementsByTagName("head")[0] || a.documentElement;
140        return (
141          (c.innerHTML = "x<style>" + b + "</style>"),
142          d.insertBefore(c.lastChild, d.firstChild)
143        );
144      }
145      function l() {
146        var a = r.elements;
147        return typeof a == "string" ? a.split(" ") : a;
148      }
149      function m(a) {
150        var b = i[a[g]];
151        return b || ((b = {}), h++, (a[g] = h), (i[h] = b)), b;
152      }
153      function n(a, c, f) {
154        c || (c = b);
155        if (j) return c.createElement(a);
156        f || (f = m(c));
157        var g;
158        return (
159          f.cache[a]
160            ? (g = f.cache[a].cloneNode())
161            : e.test(a)
162            ? (g = (f.cache[a] = f.createElem(a)).cloneNode())
163            : (g = f.createElem(a)),
164          g.canHaveChildren && !d.test(a) ? f.frag.appendChild(g) : g
165        );
166      }
167      function o(a, c) {
168        a || (a = b);
169        if (j) return a.createDocumentFragment();
170        c = c || m(a);
171        var d = c.frag.cloneNode(),
172          e = 0,
173          f = l(),
174          g = f.length;
175        for (; e < g; e++) d.createElement(f[e]);
176        return d;
177      }
178      function p(a, b) {
179        b.cache ||
180          ((b.cache = {}),
181          (b.createElem = a.createElement),
182          (b.createFrag = a.createDocumentFragment),
183          (b.frag = b.createFrag())),
184          (a.createElement = function (c) {
185            return r.shivMethods ? n(c, a, b) : b.createElem(c);
186          }),
187          (a.createDocumentFragment = Function(
188            "h,f",
189            "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" +
190              l()
191                .join()
192                .replace(/\w+/g, function (a) {
193                  return (
194                    b.createElem(a), b.frag.createElement(a), 'c("' + a + '")'
195                  );
196                }) +
197              ");return n}"
198          )(r, b.frag));
199      }
200      function q(a) {
201        a || (a = b);
202        var c = m(a);
203        return (
204          r.shivCSS &&
205            !f &&
206            !c.hasCSS &&
207            (c.hasCSS = !!k(
208              a,
209              "article,aside,figcaption,figure,footer,header,hgroup,nav,section{dis
209play:block}mark{background:#FF0;color:#000}"
210            )),
211          j || p(a, c),
212          a
213        );
214      }
215      var c = a.html5 || {},
216        d =
217          /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
218        e =
219          /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
220        f,
221        g = "_html5shiv",
222        h = 0,
223        i = {},
224        j;
225      (function () {
226        try {
227          var a = b.createElement("a");
228          (a.innerHTML = "<xyz></xyz>"),
229            (f = "hidden" in a),
230            (j =
231              a.childNodes.length == 1 ||
232              (function () {
233                b.createElement("a");
234                var a = b.createDocumentFragment();
235                return (
236                  typeof a.cloneNode == "undefined" ||
237                  typeof a.createDocumentFragment == "undefined" ||
238                  typeof a.createElement == "undefined"
239                );
240              })());
241        } catch (c) {
242          (f = !0), (j = !0);
243        }
244      })();
245      var r = {
246        elements:
247          c.elements ||
248          "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
249        shivCSS: c.shivCSS !== !1,
250        supportsUnknownElements: j,
251        shivMethods: c.shivMethods !== !1,
252        type: "default",
253        shivDocument: q,
254        createElement: n,
255        createDocumentFragment: o,
256      };
257      (a.html5 = r), q(b);
258    })(this, b),
259    (e._version = d),
260    (e._domPrefixes = o),
261    (e._cssomPrefixes = n),
262    (e.testProp = function (a) {
263      return B([a]);
264    }),
265    (e.testAllProps = D),
266    (g.className =
267      g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") +
268      (f ? " js " + s.join(" ") : "")),
269    e
270  );
271})(this, this.document)),
272  (function (a, b, c) {
273    function d(a) {
274      return "[object Function]" == o.call(a);
275    }
276    function e(a) {
277      return "string" == typeof a;
278    }
279    function f() {}
280    function g(a) {
281      return !a || "loaded" == a || "complete" == a || "uninitialized" == a;
282    }
283    function h() {
284      var a = p.shift();
285      (q = 1),
286        a
287          ? a.t
288            ? m(function () {
289                ("c" == a.t
290                  ? B.injectCss
291                  : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1);
292              }, 0)
293            : (a(), h())
294          : (q = 0);
295    }
296    function i(a, c, d, e, f, i, j) {
297      function k(b) {
298        if (
299          !o &&
300          g(l.readyState) &&
301          ((u.r = o = 1),
302          !q && h(),
303          (l.onload = l.onreadystatechange = null),
304          b)
305        ) {
306          "img" != a &&
307            m(function () {
308              t.removeChild(l);
309            }, 50);
310          for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload();
311        }
312      }
313      var j = j || B.errorTimeout,
314        l = b.createElement(a),
315        o = 0,
316        r = 0,
317        u = { t: d, s: c, e: f, a: i, x: j };
318      1 === y[c] && ((r = 1), (y[c] = [])),
319        "object" == a ? (l.data = c) : ((l.src = c), (l.type = a)),
320        (l.width = l.height = "0"),
321        (l.onerror =
322          l.onload =
323          l.onreadystatechange =
324            function () {
325              k.call(this, r);
326            }),
327        p.splice(e, 0, u),
328        "img" != a &&
329          (r || 2 === y[c]
330            ? (t.insertBefore(l, s ? null : n), m(k, j))
331            : y[c].push(l));
332    }
333    function j(a, b, c, d, f) {
334      return (
335        (q = 0),
336        (b = b || "j"),
337        e(a)
338          ? i("c" == b ? v : u, a, b, this.i++, c, d, f)
339          : (p.splice(this.i++, 0, a), 1 == p.length && h()),
340        this
341      );
342    }
343    function k() {
344      var a = B;
345      return (a.loader = { load: j, i: 0 }), a;
346    }
347    var l = b.documentElement,
348      m = a.setTimeout,
349      n = b.getElementsByTagName("script")[0],
350      o = {}.toString,
351      p = [],
352      q = 0,
353      r = "MozAppearance" in l.style,
354      s = r && !!b.createRange().compareNode,
355      t = s ? l : n.parentNode,
356      l = a.opera && "[object Opera]" == o.call(a.opera),
357      l = !!b.attachEvent && !l,
358      u = r ? "object" : l ? "script" : "img",
359      v = l ? "script" : u,
360      w =
361        Array.isArray ||
362        function (a) {
363          return "[object Array]" == o.call(a);
364        },
365      x = [],
366      y = {},
367      z = {
368        timeout: function (a, b) {
369          return b.length && (a.timeout = b[0]), a;
370        },
371      },
372      A,
373      B;
374    (B = function (a) {
375      function b(a) {
376        var a = a.split("!"),
377          b = x.length,
378          c = a.pop(),
379          d = a.length,
380          c = { url: c, origUrl: c, prefixes: a },
381          e,
382          f,
383          g;
384        for (f = 0; f < d; f++)
385          (g = a[f].split("=")), (e = z[g.shift()]) && (c = e(c, g));
386        for (f = 0; f < b; f++) c = x[f](c);
387        return c;
388      }
389      function g(a, e, f, g, h) {
390        var i = b(a),
391          j = i.autoCallback;
392        i.url.split(".").pop().split("?").shift(),
393          i.bypass ||
394            (e &&
395              (e = d(e)
396                ? e
397                : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]),
398            i.instead
399              ? i.instead(a, e, f, g, h)
400              : (y[i.url] ? (i.noexec = !0) : (y[i.url] = 1),
401                f.load(
402                  i.url,
403                  i.forceCSS ||
404                    (!i.forceJS &&
405                      "css" == i.url.split(".").pop().split("?").shift())
406                    ? "c"
407                    : c,
408                  i.noexec,
409                  i.attrs,
410                  i.timeout
411                ),
412                (d(e) || d(j)) &&
413                  f.load(function () {
414                    k(),
415                      e && e(i.origUrl, h, g),
416                      j && j(i.origUrl, h, g),
417                      (y[i.url] = 2);
418                  })));
419      }
420      function h(a, b) {
421        function c(a, c) {
422          if (a) {
423            if (e(a))
424              c ||
425                (j = function () {
426                  var a = [].slice.call(arguments);
427                  k.apply(this, a), l();
428                }),
429                g(a, j, b, 0, h);
430            else if (Object(a) === a)
431              for (n in ((m = (function () {
432                var b = 0,
433                  c;
434                for (c in a) a.hasOwnProperty(c) && b++;
435                return b;
436              })()),
437              a))
438                a.hasOwnProperty(n) &&
439                  (!c &&
440                    !--m &&
441                    (d(j)
442                      ? (j = function () {
443                          var a = [].slice.call(arguments);
444                          k.apply(this, a), l();
445                        })
446                      : (j[n] = (function (a) {
447                          return function () {
448                            var b = [].slice.call(arguments);
449                            a && a.apply(this, b), l();
450                          };
451                        })(k[n]))),
452                  g(a[n], j, b, n, h));
453          } else !c && l();
454        }
455        var h = !!a.test,
456          i = a.load || a.both,
457          j = a.callback || f,
458          k = j,
459          l = a.complete || f,
460          m,
461          n;
462        c(h ? a.yep : a.nope, !!i), i && c(i);
463      }
464      var i,
465        j,
466        l = this.yepnope.loader;
467      if (e(a)) g(a, 0, l, 0);
468      else if (w(a))
469        for (i = 0; i < a.length; i++)
470          (j = a[i]),
471            e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l);
472      else Object(a) === a && h(a, l);
473    }),
474      (B.addPrefix = function (a, b) {
475        z[a] = b;
476      }),
477      (B.addFilter = function (a) {
478        x.push(a);
479      }),
480      (B.errorTimeout = 1e4),
481      null == b.readyState &&
482        b.addEventListener &&
483        ((b.readyState = "loading"),
484        b.addEventListener(
485          "DOMContentLoaded",
486          (A = function () {
487            b.removeEventListener("DOMContentLoaded", A, 0),
488              (b.readyState = "complete");
489          }),
490          0
491        )),
492      (a.yepnope = k()),
493      (a.yepnope.executeStack = h),
494      (a.yepnope.injectJs = function (a, c, d, e, i, j) {
495        var k = b.createElement("script"),
496          l,
497          o,
498          e = e || B.errorTimeout;
499        k.src = a;
500        for (o in d) k.setAttribute(o, d[o]);
501        (c = j ? h : c || f),
502          (k.onreadystatechange = k.onload =
503            function () {
504              !l &&
505                g(k.readyState) &&
506                ((l = 1), c(), (k.onload = k.onreadystatechange = null));
507            }),
508          m(function () {
509            l || ((l = 1), c(1));
510          }, e),
511          i ? k.onload() : n.parentNode.insertBefore(k, n);
512      }),
513      (a.yepnope.injectCss = function (a, c, d, e, g, i) {
514        var e = b.createElement("link"),
515          j,
516          c = i ? h : c || f;
517        (e.href = a), (e.rel = "stylesheet"), (e.type = "text/css");
518        for (j in d) e.setAttribute(j, d[j]);
519        g || (n.parentNode.insertBefore(e, n), m(c, 0));
520      });
521  })(this, document),
522  (Modernizr.load = function () {
523    yepnope.apply(window, [].slice.call(arguments, 0));
524  });
525
526/////////////////////////////////////////////
527// HOVER INTENT PLUGIN
528/////////////////////////////////////////////
529
530/*!
531 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
532 * http://cherne.net/brian/resources/jquery.hoverIntent.html
533 *
534 * You may use hoverIntent under the terms of the MIT license. Basically that
535 * means you are free to use hoverIntent as long as this header is left intact.
536 * Copyright 2007, 2013 Brian Cherne
537 */
538(function ($) {
539  $.fn.hoverIntent = function (handlerIn, handlerOut, selector) {
540    // default configuration values
541    var cfg = {
542      interval: 100,
543      sensitivity: 7,
544      timeout: 0,
545    };
546
547    if (typeof handlerIn === "object") {
548      cfg = $.extend(cfg, handlerIn);
549    } else if ($.isFunction(handlerOut)) {
550      cfg = $.extend(cfg, {
551        over: handlerIn,
552        out: handlerOut,
553        selector: selector,
554      });
555    } else {
556      cfg = $.extend(cfg, {
557        over: handlerIn,
558        out: handlerIn,
559        selector: handlerOut,
560      });
561    }
562
563    // instantiate variables
564    // cX, cY = current X and Y position of mouse, updated by mousemove event
565    // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
566    var cX, cY, pX, pY;
567
568    // A private function for getting mouse position
569    var track = function (ev) {
570      cX = ev.pageX;
571      cY = ev.pageY;
572    };
573
574    // A private function for comparing current and previous mouse position
575    var compare = function (ev, ob) {
576      ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
577      // compare mouse positions to see if they've crossed the threshold
578      if (Math.abs(pX - cX) + Math.abs(pY - cY) < cfg.sensitivity) {
579        $(ob).off("mousemove.hoverIntent", track);
580        // set hoverIntent state to true (so mouseOut can be called)
581        ob.hoverIntent_s = 1;
582        return cfg.over.apply(ob, [ev]);
583      } else {
584        // set previous coordinates for next time
585        pX = cX;
586        pY = cY;
587        // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
588        ob.hoverIntent_t = setTimeout(function () {
589          compare(ev, ob);
590        }, cfg.interval);
591      }
592    };
593
594    // A private function for delaying the mouseOut function
595    var delay = function (ev, ob) {
596      ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
597      ob.hoverIntent_s = 0;
598      return cfg.out.apply(ob, [ev]);
599    };
600
601    // A private function for handling mouse 'hovering'
602    var handleHover = function (e) {
603      // copy objects to be passed into t (required for event object to be passed in IE)
604      var ev = jQuery.extend({}, e);
605      var ob = this;
606
607      // cancel hoverIntent timer if it exists
608      if (ob.hoverIntent_t) {
609        ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
610      }
611
612      // if e.type == "mouseenter"
613      if (e.type == "mouseenter") {
614        // set "previous" X and Y position based on initial entry point
615        pX = ev.pageX;
616        pY = ev.pageY;
617        // update "current" X and Y position based on mousemove
618        $(ob).on("mousemove.hoverIntent", track);
619        // start polling interval (self-calling timeout) to compare mouse coordinates over time
620        if (ob.hoverIntent_s != 1) {
621          ob.hoverIntent_t = setTimeout(function () {
622            compare(ev, ob);
623          }, cfg.interval);
624        }
625
626        // else e.type == "mouseleave"
627      } else {
628        // unbind expensive mousemove event
629        $(ob).off("mousemove.hoverIntent", track);
630        // if hoverIntent state is true, then call the mouseOut function after the specified delay
631        if (ob.hoverIntent_s == 1) {
632          ob.hoverIntent_t = setTimeout(function () {
633            delay(ev, ob);
634          }, cfg.timeout);
635        }
636      }
637    };
638
639    // listen for mouseenter and mouseleave
640    return this.on(
641      {
642        "mouseenter.hoverIntent": handleHover,
643        "mouseleave.hoverIntent": handleHover,
644      },
645      cfg.selector
646    );
647  };
648})(jQuery);
649
650/////////////////////////////////////////////
651// DC MEGA MENU PLUGIN
652/////////////////////////////////////////////
653
654/*
655 * DC Mega Menu - jQuery mega menu v1.3.3
656 * Copyright (c) 2011 Design Chemical
657 *
658 */
659
660(function ($) {
661  $.fn.dcMegaMenu = function (options) {
662    var defaults = {
663      classParent: "dc-mega",
664      classContainer: "sub-container",
665      classSubParent: "mega-hdr",
666      classSubLink: "mega-hdr",
667      classWidget: "dc-extra",
668      rowItems: 3,
669      speed: "fast",
670      effect: "fade",
671      event: "click",
672      fullWidth: false,
673      onLoad: function () {},
674      beforeOpen: function () {},
675      beforeClose: function () {},
676    };
677    var options = $.extend(defaults, options);
678    var $dcMegaMenuObj = this;
679    return $dcMegaMenuObj.each(function (options) {
680      var clSubParent = defaults.classSubParent;
681      var clSubLink = defaults.classSubLink;
682      var clParent = defaults.classParent;
683      var clContainer = defaults.classContainer;
684      var clWidget = defaults.classWidget;
685      megaSetup();
686      function megaOver() {
687        var subNav = $(".sub", this);
688        $(this).addClass("mega-hover");
689        if (defaults.effect == "fade") {
690          $(subNav).fadeIn(defaults.speed);
691        }
692        if (defaults.effect == "slide") {
693          $(subNav).show(defaults.speed);
694        }
695        defaults.beforeOpen.call(this);
696      }
697      function megaAction(obj) {
698        var subNav = $(".sub", obj);
699        $(obj).addClass("mega-hover");
700        if (defaults.effect == "fade") {
701          $(subNav).fadeIn(defaults.speed);
702        }
703        if (defaults.effect == "slide") {
704          $(subNav).show(defaults.speed);
705        }
706        defaults.beforeOpen.call(this);
707      }
708      function megaOut() {
709        var subNav = $(".sub", this);
710        $(this).removeClass("mega-hover");
711        $(subNav).hide();
712        defaults.beforeClose.call(this);
713      }
714      function megaActionClose(obj) {
715        var subNav = $(".sub", obj);
716        $(obj).removeClass("mega-hover");
717        $(subNav).hide();
718        defaults.beforeClose.call(this);
719      }
720      function megaReset() {
721        $("li", $dcMegaMenuObj).removeClass("mega-hover");
722        $(".sub", $dcMegaMenuObj).hide();
723      }
724      function megaSetup() {
725        $arrow = '<span class="dc-mega-icon"></span>';
726        var clParentLi = clParent + "-li";
727        var menuWidth = $dcMegaMenuObj.outerWidth();
728        $("> li", $dcMegaMenuObj).each(function () {
729          var $mainSub = $("> ul", this);
730          var $primaryLink = $("> a", this);
731          if ($mainSub.length) {
732            $primaryLink.addClass(clParent).append($arrow);
733            $mainSub
734              .addClass("sub")
735              .wrap('<div class="' + clContainer + '" />');
736            var pos = $(this).position();
737            pl = pos.left;
738            if ($("ul", $mainSub).length) {
739              $(this).addClass(clParentLi);
740              $("." + clContainer, this).addClass("mega");
741              $("> li", $mainSub).each(function () {
742                if (!$(this).hasClass(clWidget)) {
743                  $(this).addClass("mega-unit");
744                  if ($("> ul", this).length) {
745                    $(this).addClass(clSubParent);
746                    $("> a", this).addClass(clSubParent + "-a");
747                  } else {
748                    $(this).addClass(clSubLink);
749                    $("> a", this).addClass(clSubLink + "-a");
750                  }
751                }
752              });
753              var hdrs = $(".mega-unit", this);
754              rowSize = parseInt(defaults.rowItems);
755              for (var i = 0; i < hdrs.length; i += rowSize) {
756                hdrs.slice(i, i + rowSize).wrapAll('<div class="row" />');
757              }
758              $mainSub.show();
759              var pw = $(this).width();
760              var pr = pl + pw;
761              var mr = menuWidth - pr;
762              var subw = $mainSub.outerWidth();
763              var totw = $mainSub.parent("." + clContainer).outerWidth();
764              var cpad = totw - subw;
765              if (defaults.fullWidth == true) {
766                var fw = menuWidth - cpad;
767                $mainSub.parent("." + clContainer).css({ width: fw + "px" });
768                $dcMegaMenuObj.addClass("full-width");
769              }
770              var iw = $(".mega-unit", $mainSub).outerWidth(true);
771              var rowItems = $(".row:eq(0) .mega-unit", $mainSub).length;
772              var inneriw = iw * rowItems;
773              var totiw = inneriw + cpad;
774              $(".row", this).each(function () {
775                $(".mega-unit:last", this).addClass("last");
776                var maxValue = undefined;
777                $(".mega-unit > a", this).each(function () {
778                  var val = parseInt($(this).height());
779                  if (maxValue === undefined || maxValue < val) {
780                    maxValue = val;
781                  }
782                });
783                $(".mega-unit > a", this).css("height", maxValue + "px");
784                $(this).css("width", inneriw + "px");
785              });
786              if (defaults.fullWidth == true) {
787                params = { left: 0 };
788              } else {
789                var ml = mr < ml ? ml + ml - mr : (totiw - pw) / 2;
790                var subLeft = pl - ml;
791                var params = { left: pl + "px", marginLeft: -ml + "px" };
792                if (subLeft < 0) {
793                  params = { left: 0 };
794                } else if (mr < ml) {
795                  params = { right: 0 };
796                }
797              }
798              $("." + clContainer, this).css(params);
799              $(".row", $mainSub).each(function () {
800                var rh = $(this).height();
801                $(".mega-unit", this).css({ height: rh + "px" });
802                $(this)
803                  .parent(".row")
804                  .css({ height: rh + "px" });
805              });
806              $mainSub.hide();
807            } else {
808              $("." + clContainer, this)
809                .addClass("non-mega")
810                .css("left", pl + "px");
811            }
812          }
813        });
814        var menuHeight = $("> li > a", $dcMegaMenuObj).outerHeight(true);
815        $("." + clContainer, $dcMegaMenuObj)
816          .css({ top: menuHeight + "px" })
817          .css("z-index", "1000");
818        if (defaults.event == "hover") {
819          var config = {
820            sensitivity: 2,
821            interval: 100,
822            over: megaOver,
823            timeout: 400,
824            out: megaOut,
825          };
826          $("li", $dcMegaMenuObj).hoverIntent(config);
827        }
828        if (defaults.event == "click") {
829          $("body").mouseup(function (e) {
830            if (!$(e.target).parents(".mega-hover").length) {
831              megaReset();
832            }
833          });
834          $("> li > a." + clParent, $dcMegaMenuObj).click(function (e) {
835            var $parentLi = $(this).parent();
836            if ($parentLi.hasClass("mega-hover")) {
837              megaActionClose($parentLi);
838            } else {
839              megaAction($parentLi);
840            }
841            e.preventDefault();
842          });
843        }
844        defaults.onLoad.call(this);
845      }
846    });
847  };
848})(jQuery);
849
850/////////////////////////////////////////////
851// SMARTRESIZE PLUGIN
852/////////////////////////////////////////////
853
854(function ($, sr) {
855  // USE STRICT
856  "use strict";
857
858  // debouncing function from John Hann
859  // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
860  var debounce = function (func, threshold, execAsap) {
861    var timeout;
862
863    return function debounced() {
864      var obj = this,
865        args = arguments;
866      function delayed() {
867        if (!execAsap) {
868          func.apply(obj, args);
869          timeout = null;
870        }
871      }
872
873      if (timeout) {
874        clearTimeout(timeout);
875      } else if (execAsap) {
876        func.apply(obj, args);
877      }
878
879      timeout = setTimeout(delayed, threshold || 100);
880    };
881  };
882
883  // smartresize
884  jQuery.fn[sr] = function (fn) {
885    return fn ? this.bind("resize", debounce(fn)) : this.trigger(sr);
886  };
887})(jQuery, "smartresize");
888
889/////////////////////////////////////////////
890// EQUALHEIGHTS PLUGIN
891/////////////////////////////////////////////
892
893(function ($) {
894  // USE STRICT
895  "use strict";
896
897  $.fn.equalHeights = function (px) {
898    $(this).each(function () {
899      var currentTallest = 0;
900      $(this)
901        .children()
902        .each(function () {
903          if ($(this).height() > currentTallest) {
904            currentTallest = $(this).height();
905          }
906        });
907      if (!px && Number.prototype.pxToEm) {
908        currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
909      }
910      // for ie6, set height since min-height isn't supported
911      if ($.browser.msie && $.browser.version === 6.0) {
912        this.children().css({ height: currentTallest });
913      }
914      $(this).children().css({ "min-height": currentTallest });
915    });
916    return this;
917  };
918})(jQuery);
919
920/////////////////////////////////////////////
921// EASYPIECHART PLUGIN
922/////////////////////////////////////////////
923
924(function ($) {
925  // USE STRICT
926  "use strict";
927  $.easyPieChart = function (el, options) {
928    var addScaleLine,
929      animateLine,
930      drawLine,
931      easeInOutQuad,
932      renderBackground,
933      renderScale,
934      renderTrack,
935      _this = this;
936    this.el = el;
937    this.$el = $(el);
938    this.$el.data("easyPieChart", this);
939    this.init = function () {
940      var percent;
941      _this.options = $.extend({}, $.easyPieChart.defaultOptions, options);
942      percent = parseInt(_this.$el.data("percent"), 10);
943      _this.percentage = 0;
944      _this.canvas = $(
945        "<canvas width='" +
946          _this.options.size +
947          "' height='" +
948          _this.options.size +
949          "'></canvas>"
950      ).get(0);
951      _this.$el.append(_this.canvas);
952      if (
953        typeof G_vmlCanvasManager !== "undefined" &&
954        G_vmlCanvasManager !== null
955      ) {
956        G_vmlCanvasManager.initElement(_this.canvas);
957      }
958      _this.ctx = _this.canvas.getContext("2d");
959      if (window.devicePixelRatio > 1.5) {
960        $(_this.canvas).css({
961          width: _this.options.size,
962          height: _this.options.size,
963        });
964        _this.canvas.width *= 2;
965        _this.canvas.height *= 2;
966        _this.ctx.scale(2, 2);
967      }
968      _this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
969      _this.$el.addClass("easyPieChart");
970      _this.$el.css({
971        width: _this.options.size,
972        height: _this.options.size,
973        lineHeight: "" + _this.options.size + "px",
974      });
975      _this.update(percent);
976      return _this;
977    };
978    this.update = function (percent) {
979      if (_this.options.animate === false) {
980        return drawLine(percent);
981      } else {
982        if (percent === 0) {
983          return animateLine(0, 0);
984        } else {
985          return animateLine(_this.percentage, percent);
986        }
987      }
988    };
989    renderScale = function () {
990      var i, _i, _results;
991      _this.ctx.fillStyle = _this.options.scaleColor;
992      _this.ctx.lineWidth = 1;
993      _results = [];
994      for (i = _i = 0; _i <= 24; i = ++_i) {
995        _results.push(addScaleLine(i));
996      }
997      return _results;
998    };
999    addScaleLine = function (i) {
1000      var offset;
1001      offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
1002      _this.ctx.save();
1003      _this.ctx.rotate((i * Math.PI) / 12);
1004      _this.ctx.fillRect(
1005        _this.options.size / 2 - offset,
1006        0,
1007        -_this.options.size * 0.05 + offset,
1008        1
1009      );
1010      return _this.ctx.restore();
1011    };
1012    renderTrack = function () {
1013      var offset;
1014      offset = _this.options.size / 2 - _this.options.lineWidth / 2;
1015      if (_this.options.scaleColor !== false) {
1016        offset -= _this.options.size * 0.08;
1017      }
1018      _this.ctx.beginPath();
1019      _this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
1020      _this.ctx.closePath();
1021      _this.ctx.strokeStyle = _this.options.trackColor;
1022      _this.ctx.lineWidth = _this.options.lineWidth;
1023      return _this.ctx.stroke();
1024    };
1025    renderBackground = function () {
1026      //			if (_this.options.scaleColor !== false) {
1027      //				renderScale();
1028      //			}
1029      if (_this.options.trackColor !== false) {
1030        return renderTrack();
1031      }
1032    };
1033    drawLine = function (percent) {
1034      var offset;
1035      renderBackground();
1036      _this.ctx.strokeStyle = $.isFunction(_this.options.barColor)
1037        ? _this.options.barColor(percent)
1038        : _this.options.barColor;
1039      _this.ctx.lineCap = _this.options.lineCap;
1040      _this.ctx.lineWidth = _this.options.lineWidth;
1041      offset = _this.options.size / 2 - _this.options.lineWidth / 2;
1042      if (_this.options.scaleColor !== false) {
1043        offset -= _this.options.size * 0.08;
1044      }
1045      _this.ctx.save();
1046      _this.ctx.rotate(-Math.PI / 2);
1047      _this.ctx.beginPath();
1048      _this.ctx.arc(0, 0, offset, 0, (Math.PI * 2 * percent) / 100, false);
1049      _this.ctx.stroke();
1050      return _this.ctx.restore();
1051    };
1052    animateLine = function (from, to) {
1053      var currentStep, fps, steps;
1054      fps = 30;
1055      steps = (fps * _this.options.animate) / 1000;
1056      currentStep = 0;
1057      _this.options.onStart.call(_this);
1058      _this.percentage = to;
1059      if (_this.animation) {
1060        clearInterval(_this.animation);
1061        _this.animation = false;
1062      }
1063      _this.animation = setInterval(function () {
1064        _this.ctx.clearRect(
1065          -_this.options.size / 2,
1066          -_this.options.size / 2,
1067          _this.options.size,
1068          _this.options.size
1069        );
1070        renderBackground.call(_this);
1071        drawLine.call(_this, [
1072          easeInOutQuad(currentStep, from, to - from, steps),
1073        ]);
1074        currentStep++;
1075        if (currentStep / steps > 1) {
1076          clearInterval(_this.animation);
1077          _this.animation = false;
1078          return _this.options.onStop.call(_this);
1079        }
1080      }, 1000 / fps);
1081      return _this.animation;
1082    };
1083    easeInOutQuad = function (t, b, c, d) {
1084      var easeIn, easing;
1085      easeIn = function (t) {
1086        return Math.pow(t, 2);
1087      };
1088      easing = function (t) {
1089        if (t < 1) {
1090          return easeIn(t);
1091        } else {
1092          return 2 - easeIn((t / 2) * -2 + 2);
1093        }
1094      };
1095      t /= d / 2;
1096      return (c / 2) * easing(t) + b;
1097    };
1098    return this.init();
1099  };
1100  $.easyPieChart.defaultOptions = {
1101    barColor: "#ef1e25",
1102    trackColor: "#f2f2f2",
1103    scaleColor: false,
1104    lineCap: "round",
1105    size: 110,
1106    lineWidth: 3,
1107    animate: false,
1108    onStart: $.noop,
1109    onStop: $.noop,
1110  };
1111  $.fn.easyPieChart = function (options) {
1112    return $.each(this, function (i, el) {
1113      var $el;
1114      $el = $(el);
1115      if (!$el.data("easyPieChart")) {
1116        return $el.data("easyPieChart", new $.easyPieChart(el, options));
1117      }
1118    });
1119  };
1120  return void 0;
1121})(jQuery);
1122
1123/////////////////////////////////////////////
1124// ANIMATE NUMBER PLUGIN
1125/////////////////////////////////////////////
1126
1127(function ($) {
1128  // USE STRICT
1129  "use strict";
1130
1131  $.fn.animateNumber = function (to) {
1132    var $ele = $(this),
1133      num = parseInt($ele.html(), 10),
1134      up = to > num,
1135      num_interval = Math.abs(num - to) / 90;
1136
1137    var loop = function () {
1138      num = up ? Math.ceil(num + num_interval) : Math.floor(num - num_interval);
1139      if ((up && num > to) || (!up && num < to)) {
1140        num = to;
1141        clearInterval(animation);
1142      }
1143      $ele.html(num);
1144    };
1145
1146    var intervalTime =
1147      to <= 5
1148        ? (intervalTime = 100)
1149        : to <= 25
1150        ? (intervalTime = 50)
1151        : to <= 50
1152        ? (intervalTime = 25)
1153        : 10;
1154
1155    var animation = setInterval(loop, intervalTime);
1156  };
1157})(jQuery);
1158
1159/////////////////////////////////////////////
1160// CLASSIE PLUGIN
1161/////////////////////////////////////////////
1162
1163/*!
1164 * classie - class helper functions
1165 * from bonzo https://github.com/ded/bonzo
1166 *
1167 * classie.has( elem, 'my-class' ) -> true/false
1168 * classie.add( elem, 'my-new-class' )
1169 * classie.remove( elem, 'my-unwanted-class' )
1170 * classie.toggle( elem, 'my-class' )
1171 */
1172
1173/*jshint browser: true, strict: true, undef: true */
1174/*global define: false */
1175
1176(function (window) {
1177  "use strict";
1178
1179  // class helper functions from bonzo https://github.com/ded/bonzo
1180
1181  function classReg(className) {
1182    return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
1183  }
1184
1185  // classList support for class management
1186  // altho to be fair, the api sucks because it won't accept multiple classes at once
1187  var hasClass, addClass, removeClass;
1188
1189  if ("classList" in document.documentElement) {
1190    hasClass = function (elem, c) {
1191      return elem.classList.contains(c);
1192    };
1193    addClass = function (elem, c) {
1194      elem.classList.add(c);
1195    };
1196    removeClass = function (elem, c) {
1197      elem.classList.remove(c);
1198    };
1199  } else {
1200    hasClass = function (elem, c) {
1201      return classReg(c).test(elem.className);
1202    };
1203    addClass = function (elem, c) {
1204      if (!hasClass(elem, c)) {
1205        elem.className = elem.className + " " + c;
1206      }
1207    };
1208    removeClass = function (elem, c) {
1209      elem.className = elem.className.replace(classReg(c), " ");
1210    };
1211  }
1212
1213  function toggleClass(elem, c) {
1214    var fn = hasClass(elem, c) ? removeClass : addClass;
1215    fn(elem, c);
1216  }
1217
1218  var classie = {
1219    // full names
1220    hasClass: hasClass,
1221    addClass: addClass,
1222    removeClass: removeClass,
1223    toggleClass: toggleClass,
1224    // short names
1225    has: hasClass,
1226    add: addClass,
1227    remove: removeClass,
1228    toggle: toggleClass,
1229  };
1230
1231  // transport
1232  if (typeof define === "function" && define.amd) {
1233    // AMD
1234    define(classie);
1235  } else {
1236    // browser global
1237    window.classie = classie;
1238  }
1239})(window);
1240
1241/////////////////////////////////////////////
1242// ANIMONSCROLL PLUGIN
1243/////////////////////////////////////////////
1244
1245/**
1246 * animOnScroll.js v1.0.0
1247 * http://www.codrops.com
1248 *
1249 * Licensed under the MIT license.
1250 * http://www.opensource.org/licenses/mit-license.php
1251 *
1252 * Copyright 2013, Codrops
1253 * http://www.codrops.com
1254 */
1255(function (window) {
1256  "use strict";
1257
1258  var docElem = window.document.documentElement;
1259
1260  function getViewportH() {
1261    var client = docElem["clientHeight"],
1262      inner = window["innerHeight"];
1263
1264    if (client < inner) return inner;
1265    else return client;
1266  }
1267
1268  function scrollY() {
1269    return window.pageYOffset || docElem.scrollTop;
1270  }
1271
1272  // http://stackoverflow.com/a/5598797/989439
1273  function getOffset(el) {
1274    var offsetTop = 0,
1275      offsetLeft = 0;
1276    do {
1277      if (!isNaN(el.offsetTop)) {
1278        offsetTop += el.offsetTop;
1279      }
1280      if (!isNaN(el.offsetLeft)) {
1281        offsetLeft += el.offsetLeft;
1282      }
1283    } while ((el = el.offsetParent));
1284
1285    return {
1286      top: offsetTop,
1287      left: offsetLeft,
1288    };
1289  }
1290
1291  function inViewport(el, h) {
1292    var elH = el.offsetHeight,
1293      scrolled = scrollY(),
1294      viewed = scrolled + getViewportH(),
1295      elTop = getOffset(el).top,
1296      elBottom = elTop + elH,
1297      // if 0, the element is considered in the viewport as soon as it enters.
1298      // if 1, the element is considered in the viewport only when it's fully inside
1299      // value in percentage (1 >= h >= 0)
1300      h = h || 0;
1301
1302    return elTop + elH * h <= viewed && elBottom - elH * h >= scrolled;
1303  }
1304
1305  function extend(a, b) {
1306    for (var key in b) {
1307      if (b.hasOwnProperty(key)) {
1308        a[key] = b[key];
1309      }
1310    }
1311    return a;
1312  }
1313
1314  function AnimOnScroll(el, options) {
1315    this.el = el;
1316    this.options = extend(this.defaults, options);
1317    this._init();
1318  }
1319
1320  AnimOnScroll.prototype = {
1321    defaults: {
1322      // Minimum and a maximum duration of the animation (random value is chosen)
1323      minDuration: 0,
1324      maxDuration: 0,
1325      // The viewportFactor defines how much of the appearing item has to be visible in order to trigger the animation
1326      // if we'd use a value of 0, this would mean that it would add the animation class as soon as the item is in the viewport.
1327      // If we were to use the value of 1, the animation would only be triggered when we see all of the item in the viewport (100% of it)
1328      viewportFactor: 0,
1329    },
1330    _init: function () {
1331      this.items = Array.prototype.slice.call(
1332        document.querySelectorAll("#" + this.el.id + " > li")
1333      );
1334      this.itemsCount = this.items.length;
1335      this.itemsRenderedCount = 0;
1336      this.didScroll = false;
1337
1338      var self = this;
1339      var firstLoad = false;
1340
1341      imagesLoaded(this.el, function () {
1342        // initialize masonry
1343        new Masonry(self.el, {
1344          itemSelector: "li.blog-item",
1345          transitionDuration: 0,
1346        });
1347
1348        if (Modernizr.cssanimations) {
1349          // the items already shown...
1350          if (self.el.classList.contains("first-load")) {
1351            self.items.forEach(function (el, i) {
1352              if (inViewport(el)) {
1353                //								self._checkTotalRendered();
1354                //								classie.add( el, 'shown' );
1355                self._onScrollFn();
1356              }
1357            });
1358          } else {
1359            self.items.forEach(function (el, i) {
1360              if (inViewport(el)) {
1361                self._onScrollFn();
1362              }
1363            });
1364          }
1365
1366          document.getElementById(self.el.id).className = document
1367            .getElementById(self.el.id)
1368            .className.replace(/\bfirst-load\b/, "");
1369
1370          // animate on scroll the items inside the viewport
1371          window.addEventListener(
1372            "scroll",
1373            function () {
1374              self._onScrollFn();
1375            },
1376            false
1377          );
1378          window.addEventListener(
1379            "resize",
1380            function () {
1381              self._resizeHandler();
1382            },
1383            false
1384          );
1385        }
1386      });
1387    },
1388    _onScrollFn: function () {
1389      var self = this;
1390      if (!this.didScroll) {
1391        this.didScroll = true;
1392        setTimeout(function () {
1393          self._scrollPage();
1394        }, 60);
1395      }
1396    },
1397    _scrollPage: function () {
1398      var self = this;
1399      this.items.forEach(function (el, i) {
1400        if (
1401          !classie.has(el, "shown") &&
1402          !classie.has(el, "animate") &&
1403          inViewport(el, self.options.viewportFactor)
1404        ) {
1405          setTimeout(function () {
1406            var perspY = scrollY() + getViewportH() / 2;
1407            self.el.style.WebkitPerspectiveOrigin = "50% " + perspY + "px";
1408            self.el.style.MozPerspectiveOrigin = "50% " + perspY + "px";
1409            self.el.style.perspectiveOrigin = "50% " + perspY + "px";
1410
1411            self._checkTotalRendered();
1412
1413            if (self.options.minDuration && self.options.maxDuration) {
1414              var randDuration =
1415                Math.random() *
1416                  (self.options.maxDuration - self.options.minDuration) +
1417                self.options.minDuration +
1418                "s";
1419              el.style.WebkitAnimationDuration = randDuration;
1420              el.style.MozAnimationDuration = randDuration;
1421              el.style.animationDuration = randDuration;
1422            }
1423
1424            classie.add(el, "animate");
1425          }, 25);
1426        }
1427      });
1428      this.didScroll = false;
1429    },
1430    _resizeHandler: function () {
1431      var self = this;
1432      function delayed() {
1433        self._scrollPage();
1434        self.resizeTimeout = null;
1435      }
1436      if (this.resizeTimeout) {
1437        clearTimeout(this.resizeTimeout);
1438      }
1439      this.resizeTimeout = setTimeout(delayed, 1000);
1440    },
1441    _checkTotalRendered: function () {
1442      ++this.itemsRenderedCount;
1443      if (this.itemsRenderedCount === this.itemsCount) {
1444        window.removeEventListener("scroll", this._onScrollFn);
1445      }
1446    },
1447  };
1448
1449  // add to global namespace
1450  window.AnimOnScroll = AnimOnScroll;
1451})(window);
1452
1453/////////////////////////////////////////////
1454// MASONRY PLUGIN
1455/////////////////////////////////////////////
1456
1457/*!
1458 * Masonry PACKAGED v3.0.0
1459 * Cascading grid layout library
1460 * http://masonry.desandro.com
1461 * MIT License
1462 * by David DeSandro
1463 */
1464
1465(function (t) {
1466  "use strict";
1467  function e(t) {
1468    if (t) {
1469      if ("string" == typeof n[t]) return t;
1470      t = t.charAt(0).toUpperCase() + t.slice(1);
1471      for (var e, o = 0, r = i.length; r > o; o++)
1472        if (((e = i[o] + t), "string" == typeof n[e])) return e;
1473    }
1474  }
1475  var i = "Webkit Moz ms Ms O".split(" "),
1476    n = document.documentElement.style;
1477  "function" == typeof define && define.amd
1478    ? define(function () {
1479        return e;
1480      })
1481    : (t.getStyleProperty = e);
1482})(window),
1483  (function (t) {
1484    "use strict";
1485    function e(t) {
1486      var e = parseFloat(t),
1487        i = -1 === t.indexOf("%") && !isNaN(e);
1488      return i && e;
1489    }
1490    function i() {
1491      for (
1492        var t = {
1493            width: 0,
1494            height: 0,
1495            innerWidth: 0,
1496            innerHeight: 0,
1497            outerWidth: 0,
1498            outerHeight: 0,
1499          },
1500          e = 0,
1501          i = s.length;
1502        i > e;
1503        e++
1504      ) {
1505        var n = s[e];
1506        t[n] = 0;
1507      }
1508      return t;
1509    }
1510    function n(t) {
1511      function n(t) {
1512        if (
1513          ("string" == typeof t && (t = document.querySelector(t)),
1514          t && "object" == typeof t && t.nodeType)
1515        ) {
1516          var n = r(t);
1517          if ("none" === n.display) return i();
1518          var h = {};
1519          (h.width = t.offsetWidth), (h.height = t.offsetHeight);
1520          for (
1521            var p = (h.isBorderBox = !(!a || !n[a] || "border-box" !== n[a])),
1522              u = 0,
1523              f = s.length;
1524            f > u;
1525            u++
1526          ) {
1527            var d = s[u],
1528              c = n[d],
1529              l = parseFloat(c);
1530            h[d] = isNaN(l) ? 0 : l;
1531          }
1532          var m = h.paddingLeft + h.paddingRight,
1533            y = h.paddingTop + h.paddingBottom,
1534            g = h.marginLeft + h.marginRight,
1535            v = h.marginTop + h.marginBottom,
1536            _ = h.borderLeftWidth + h.borderRightWidth,
1537            b = h.borderTopWidth + h.borderBottomWidth,
1538            L = p && o,
1539            E = e(n.width);
1540          E !== !1 && (h.width = E + (L ? 0 : m + _));
1541          var I = e(n.height);
1542          return (
1543            I !== !1 && (h.height = I + (L ? 0 : y + b)),
1544            (h.innerWidth = h.width - (m + _)),
1545            (h.innerHeight = h.height - (y + b)),
1546            (h.outerWidth = h.width + g),
1547            (h.outerHeight = h.height + v),
1548            h
1549          );
1550        }
1551      }
1552      var o,
1553        a = t("boxSizing");
1554      return (
1555        (function () {
1556          if (a) {
1557            var t = document.createElement("div");
1558            (t.style.width = "200px"),
1559              (t.style.padding = "1px 2px 3px 4px"),
1560              (t.style.borderStyle = "solid"),
1561              (t.style.borderWidth = "1px 2px 3px 4px"),
1562              (t.style[a] = "border-box");
1563            var i = document.body || document.documentElement;
1564            i.appendChild(t);
1565            var n = r(t);
1566            (o = 200 === e(n.width)), i.removeChild(t);
1567          }
1568        })(),
1569        n
1570      );
1571    }
1572    var o = document.defaultView,
1573      r =
1574        o && o.getComputedStyle
1575          ? function (t) {
1576              return o.getComputedStyle(t, null);
1577            }
1578          : function (t) {
1579              return t.currentStyle;
1580            },
1581      s = [
1582        "paddingLeft",
1583        "paddingRight",
1584        "paddingTop",
1585        "paddingBottom",
1586        "marginLeft",
1587        "marginRight",
1588        "marginTop",
1589        "marginBottom",
1590        "borderLeftWidth",
1591        "borderRightWidth",
1592        "borderTopWidth",
1593        "borderBottomWidth",
1594      ];
1595    "function" == typeof define && define.amd
1596      ? define(["get-style-property"], n)
1597      : (t.getSize = n(t.getStyleProperty));
1598  })(window),
1599  (function (t) {
1600    "use strict";
1601    var e = document.documentElement,
1602      i = function () {};
1603    e.addEventListener
1604      ? (i = function (t, e, i) {
1605          t.addEventListener(e, i, !1);
1606        })
1607      : e.attachEvent &&
1608        (i = function (e, i, n) {
1609          (e[i + n] = n.handleEvent
1610            ? function () {
1611                var e = t.event;
1612                (e.target = e.target || e.srcElement), n.handleEvent.call(n, e);
1613              }
1614            : function () {
1615                var i = t.event;
1616                (i.target = i.target || i.srcElement), n.call(e, i);
1617              }),
1618            e.attachEvent("on" + i, e[i + n]);
1619        });
1620    var n = function () {};
1621    e.removeEventListener
1622      ? (n = function (t, e, i) {
1623          t.removeEventListener(e, i, !1);
1624        })
1625      : e.detachEvent &&
1626        (n = function (t, e, i) {
1627          t.detachEvent("on" + e, t[e + i]);
1628          try {
1629            delete t[e + i];
1630          } catch (n) {
1631            t[e + i] = void 0;
1632          }
1633        });
1634    var o = { bind: i, unbind: n };
1635    "function" == typeof define && define.amd ? define(o) : (t.eventie = o);
1636  })(this),
1637  (function (t) {
1638    "use strict";
1639    function e(t) {
1640      "function" == typeof t && (e.isReady ? t() : r.push(t));
1641    }
1642    function i(t) {
1643      var i = "readystatechange" === t.type && "complete" !== o.readyState;
1644      if (!e.isReady && !i) {
1645        e.isReady = !0;
1646        for (var n = 0, s = r.length; s > n; n++) {
1647          var a = r[n];
1648          a();
1649        }
1650      }
1651    }
1652    function n(n) {
1653      return (
1654        n.bind(o, "DOMContentLoaded", i),
1655        n.bind(o, "readystatechange", i),
1656        n.bind(t, "load", i),
1657        e
1658      );
1659    }
1660    var o = t.document,
1661      r = [];
1662    (e.isReady = !1),
1663      "function" == typeof define && define.amd
1664        ? define(["eventie"], n)
1665        : (t.docReady = n(t.eventie));
1666  })(this),
1667  (function (t) {
1668    "use strict";
1669    function e() {}
1670    function i(t, e) {
1671      if (o) return e.indexOf(t);
1672      for (var i = e.length; i--; ) if (e[i] === t) return i;
1673      return -1;
1674    }
1675    var n = e.prototype,
1676      o = Array.prototype.indexOf ? !0 : !1;
1677    (n._getEvents = function () {
1678      return this._events || (this._events = {});
1679    }),
1680      (n.getListeners = function (t) {
1681        var e,
1682          i,
1683          n = this._getEvents();
1684        if ("object" == typeof t) {
1685          e = {};
1686          for (i in n) n.hasOwnProperty(i) && t.test(i) && (e[i] = n[i]);
1687        } else e = n[t] || (n[t] = []);
1688        return e;
1689      }),
1690      (n.getListenersAsObject = function (t) {
1691        var e,
1692          i = this.getListeners(t);
1693        return i instanceof Array && ((e = {}), (e[t] = i)), e || i;
1694      }),
1695      (n.addListener = function (t, e) {
1696        var n,
1697          o = this.getListenersAsObject(t);
1698        for (n in o) o.hasOwnProperty(n) && -1 === i(e, o[n]) && o[n].push(e);
1699        return this;
1700      }),
1701      (n.on = n.addListener),
1702      (n.defineEvent = function (t) {
1703        return this.getListeners(t), this;
1704      }),
1705      (n.defineEvents = function (t) {
1706        for (var e = 0; t.length > e; e += 1) this.defineEvent(t[e]);
1707        return this;
1708      }),
1709      (n.removeListener = function (t, e) {
1710        var n,
1711          o,
1712          r = this.getListenersAsObject(t);
1713        for (o in r)
1714          r.hasOwnProperty(o) &&
1715            ((n = i(e, r[o])), -1 !== n && r[o].splice(n, 1));
1716        return this;
1717      }),
1718      (n.off = n.removeListener),
1719      (n.addListeners = function (t, e) {
1720        return this.manipulateListeners(!1, t, e);
1721      }),
1722      (n.removeListeners = function (t, e) {
1723        return this.manipulateListeners(!0, t, e);
1724      }),
1725      (n.manipulateListeners = function (t, e, i) {
1726        var n,
1727          o,
1728          r = t ? this.removeListener : this.addListener,
1729          s = t ? this.removeListeners : this.addListeners;
1730        if ("object" != typeof e || e instanceof RegExp)
1731          for (n = i.length; n--; ) r.call(this, e, i[n]);
1732        else
1733          for (n in e)
1734            e.hasOwnProperty(n) &&
1735              (o = e[n]) &&
1736              ("function" == typeof o
1737                ? r.call(this, n, o)
1738                : s.call(this, n, o));
1739        return this;
1740      }),
1741      (n.removeEvent = function (t) {
1742        var e,
1743          i = typeof t,
1744          n = this._getEvents();
1745        if ("string" === i) delete n[t];
1746        else if ("object" === i)
1747          for (e in n) n.hasOwnProperty(e) && t.test(e) && delete n[e];
1748        else delete this._events;
1749        return this;
1750      }),
1751      (n.emitEvent = function (t, e) {
1752        var i,
1753          n,
1754          o,
1755          r = this.getListenersAsObject(t);
1756        for (n in r)
1757          if (r.hasOwnProperty(n))
1758            for (i = r[n].length; i--; )
1759              (o = e ? r[n][i].apply(null, e) : r[n][i]()),
1760                o === !0 && this.removeListener(t, r[n][i]);
1761        return this;
1762      }),
1763      (n.trigger = n.emitEvent),
1764      (n.emit = function (t) {
1765        var e = Array.prototype.slice.call(arguments, 1);
1766        return this.emitEvent(t, e);
1767      }),
1768      "function" == typeof define && define.amd
1769        ? define(function () {
1770            return e;
1771          })
1772        : (t.EventEmitter = e);
1773  })(this),
1774  (function (t) {
1775    "use strict";
1776    function e() {}
1777    function i(t) {
1778      function i(e) {
1779        e.prototype.option ||
1780          (e.prototype.option = function (e) {
1781            t.isPlainObject(e) &&
1782              (this.options = t.extend(!0, this.options, e));
1783          });
1784      }
1785      function o(e, i) {
1786        t.fn[e] = function (o) {
1787          if ("string" == typeof o) {
1788            for (
1789              var s = n.call(arguments, 1), a = 0, h = this.length;
1790              h > a;
1791              a++
1792            ) {
1793              var p = this[a],
1794                u = t.data(p, e);
1795              if (u)
1796                if (t.isFunction(u[o]) && "_" !== o.charAt(0)) {
1797                  var f = u[o].apply(u, s);
1798                  if (void 0 !== f) return f;
1799                } else r("no such method '" + o + "' for " + e + " instance");
1800              else
1801                r(
1802                  "cannot call methods on " +
1803                    e +
1804                    " prior to initialization; " +
1805                    "attempted to call '" +
1806                    o +
1807                    "'"
1808                );
1809            }
1810            return this;
1811          }
1812          return this.each(function () {
1813            var n = t.data(this, e);
1814            n
1815              ? (n.option(o), n._init())
1816              : ((n = new i(this, o)), t.data(this, e, n));
1817          });
1818        };
1819      }
1820      if (t) {
1821        var r =
1822          "undefined" == typeof console
1823            ? e
1824            : function (t) {
1825                console.error(t);
1826              };
1827        t.bridget = function (t, e) {
1828          i(e), o(t, e);
1829        };
1830      }
1831    }
1832    var n = Array.prototype.slice;
1833    "function" == typeof define && define.amd
1834      ? define(["jquery"], i)
1835      : i(t.jQuery);
1836  })(window),
1837  (function (t, e) {
1838    "use strict";
1839    function i(t, e) {
1840      return t[a](e);
1841    }
1842    function n(t) {
1843      if (!t.parentNode) {
1844        var e = document.createDocumentFragment();
1845        e.appendChild(t);
1846      }
1847    }
1848    function o(t, e) {
1849      n(t);
1850      for (
1851        var i = t.parentNode.querySelectorAll(e), o = 0, r = i.length;
1852        r > o;
1853        o++
1854      )
1855        if (i[o] === t) return !0;
1856      return !1;
1857    }
1858    function r(t, e) {
1859      return n(t), i(t, e);
1860    }
1861    var s,
1862      a = (function () {
1863        if (e.matchesSelector) return "matchesSelector";
1864        for (
1865          var t = ["webkit", "moz", "ms", "o"], i = 0, n = t.length;
1866          n > i;
1867          i++
1868        ) {
1869          var o = t[i],
1870            r = o + "MatchesSelector";
1871          if (e[r]) return r;
1872        }
1873      })();
1874    if (a) {
1875      var h = document.createElement("div"),
1876        p = i(h, "div");
1877      s = p ? i : r;
1878    } else s = o;
1879    "function" == typeof define && define.amd
1880      ? define(function () {
1881          return s;
1882        })
1883      : (window.matchesSelector = s);
1884  })(this, Element.prototype),
1885  (function (t) {
1886    "use strict";
1887    function e(t, e) {
1888      for (var i in e) t[i] = e[i];
1889      return t;
1890    }
1891    function i(t, e) {
1892      t &&
1893        ((this.element = t),
1894        (this.layout = e),
1895        (this.position = { x: 0, y: 0 }),
1896        this._create());
1897    }
1898    var n = t.getSize,
1899      o = t.getStyleProperty,
1900      r = t.EventEmitter,
1901      s = document.defaultView,
1902      a =
1903        s && s.getComputedStyle
1904          ? function (t) {
1905              return s.getComputedStyle(t, null);
1906            }
1907          : function (t) {
1908              return t.currentStyle;
1909            },
1910      h = o("transition"),
1911      p = o("transform"),
1912      u = h && p,
1913      f = !!o("perspective"),
1914      d = {
1915        WebkitTransition: "webkitTransitionEnd",
1916        MozTransition: "transitionend",
1917        OTransition: "otransitionend",
1918        transition: "transitionend",
1919      }[h],
1920      c = [
1921        "transform",
1922        "transition",
1923        "transitionDuration",
1924        "transitionProperty",
1925      ],
1926      l = (function () {
1927        for (var t = {}, e = 0, i = c.length; i > e; e++) {
1928          var n = c[e],
1929            r = o(n);
1930          r && r !== n && (t[n] = r);
1931        }
1932        return t;
1933      })();
1934    e(i.prototype, r.prototype),
1935      (i.prototype._create = function () {
1936        this.css({ position: "absolute" });
1937      }),
1938      (i.prototype.handleEvent = function (t) {
1939        var e = "on" + t.type;
1940        this[e] && this[e](t);
1941      }),
1942      (i.prototype.getSize = function () {
1943        this.size = n(this.element);
1944      }),
1945      (i.prototype.css = function (t) {
1946        var e = this.element.style;
1947        for (var i in t) {
1948          var n = l[i] || i;
1949          e[n] = t[i];
1950        }
1951      }),
1952      (i.prototype.getPosition = function () {
1953        var t = a(this.element),
1954          e = this.layout.options,
1955          i = e.isOriginLeft,
1956          n = e.isOriginTop,
1957          o = parseInt(t[i ? "left" : "right"], 10),
1958          r = parseInt(t[n ? "top" : "bottom"], 10);
1959        (o = isNaN(o) ? 0 : o), (r = isNaN(r) ? 0 : r);
1960        var s = this.layout.size;
1961        (o -= i ? s.paddingLeft : s.paddingRight),
1962          (r -= n ? s.paddingTop : s.paddingBottom),
1963          (this.position.x = o),
1964          (this.position.y = r);
1965      }),
1966      (i.prototype.layoutPosition = function () {
1967        var t = this.layout.size,
1968          e = this.layout.options,
1969          i = {};
1970        e.isOriginLeft
1971          ? ((i.left = this.position.x + t.paddingLeft + "px"), (i.right = ""))
1972          : ((i.right = this.position.x + t.paddingRight + "px"),
1973            (i.left = "")),
1974          e.isOriginTop
1975            ? ((i.top = this.position.y + t.paddingTop + "px"), (i.bottom = ""))
1976            : ((i.bottom = this.position.y + t.paddingBottom + "px"),
1977              (i.top = "")),
1978          this.css(i),
1979          this.emitEvent("layout", [this]);
1980      });
1981    var m = f
1982      ? function (t, e) {
1983          return "translate3d(" + t + "px, " + e + "px, 0)";
1984        }
1985      : function (t, e) {
1986          return "translate(" + t + "px, " + e + "px)";
1987        };
1988    (i.prototype._transitionTo = function (t, e) {
1989      this.getPosition();
1990      var i = this.position.x,
1991        n = this.position.y,
1992        o = parseInt(t, 10),
1993        r = parseInt(e, 10),
1994        s = o === this.position.x && r === this.position.y;
1995      if ((this.setPosition(t, e), s && !this.isTransitioning))
1996        return this.layoutPosition(), void 0;
1997      var a = t - i,
1998        h = e - n,
1999        p = {},
2000        u = this.layout.options;
2001      (a = u.isOriginLeft ? a : -a),
2002        (h = u.isOriginTop ? h : -h),
2003        (p.transform = m(a, h)),
2004        this.transition({
2005          to: p,
2006          onTransitionEnd: this.layoutPosition,
2007          isCleaning: !0,
2008        });
2009    }),
2010      (i.prototype.goTo = function (t, e) {
2011        this.setPosition(t, e), this.layoutPosition();
2012      }),
2013      (i.prototype.moveTo = u ? i.prototype._transitionTo : i.prototype.goTo),
2014      (i.prototype.setPosition = function (t, e) {
2015        (this.position.x = parseInt(t, 10)),
2016          (this.position.y = parseInt(e, 10));
2017      }),
2018      (i.prototype._nonTransition = function (t) {
2019        this.css(t.to),
2020          t.isCleaning && this._removeStyles(t.to),
2021          t.onTransitionEnd && t.onTransitionEnd.call(this);
2022      }),
2023      (i.prototype._transition = function (t) {
2024        var e = this.layout.options.transitionDuration;
2025        if (!parseFloat(e)) return this._nonTransition(t), void 0;
2026        var i = t.to,
2027          n = [];
2028        for (var o in i) n.push(o);
2029        var r = {};
2030        if (
2031          ((r.transitionProperty = n.join(",")),
2032          (r.transitionDuration = e),
2033          this.element.addEventListener(d, this, !1),
2034          (t.isCleaning || t.onTransitionEnd) &&
2035            this.on("transitionEnd", function (e) {
2036              return (
2037                t.isCleaning && e._removeStyles(i),
2038                t.onTransitionEnd && t.onTransitionEnd.call(e),
2039                !0
2040              );
2041            }),
2042          t.from)
2043        ) {
2044          this.css(t.from);
2045          var s = this.element.offsetHeight;
2046          s = null;
2047        }
2048        this.css(r), this.css(i), (this.isTransitioning = !0);
2049      }),
2050      (i.prototype.transition =
2051        i.prototype[h ? "_transition" : "_nonTransition"]),
2052      (i.prototype.onwebkitTransitionEnd = function (t) {
2053        this.ontransitionend(t);
2054      }),
2055      (i.prototype.onotransitionend = function (t) {
2056        this.ontransitionend(t);
2057      }),
2058      (i.prototype.ontransitionend = function (t) {
2059        t.target === this.element &&
2060          (this.removeTransitionStyles(),
2061          this.element.removeEventListener(d, this, !1),
2062          (this.isTransitioning = !1),
2063          this.emitEvent("transitionEnd", [this]));
2064      }),
2065      (i.prototype._removeStyles = function (t) {
2066        var e = {};
2067        for (var i in t) e[i] = "";
2068        this.css(e);
2069      });
2070    var y = { transitionProperty: "", transitionDuration: "" };
2071    (i.prototype.removeTransitionStyles = function () {
2072      this.css(y);
2073    }),
2074      (i.prototype.removeElem = function () {
2075        this.element.parentNode.removeChild(this.element),
2076          this.emitEvent("remove", [this]);
2077      }),
2078      (i.prototype.remove = h
2079        ? function () {
2080            var t = this;
2081            this.on("transitionEnd", function () {
2082              return t.removeElem(), !0;
2083            }),
2084              this.hide();
2085          }
2086        : i.prototype.removeElem),
2087      (i.prototype.reveal = function () {
2088        this.css({ display: "" });
2089        var t = this.layout.options;
2090        this.transition({
2091          from: t.hiddenStyle,
2092          to: t.visibleStyle,
2093          isCleaning: !0,
2094        });
2095      }),
2096      (i.prototype.hide = function () {
2097        this.css({ display: "" });
2098        var t = this.layout.options;
2099        this.transition({
2100          from: t.visibleStyle,
2101          to: t.hiddenStyle,
2102          isCleaning: !0,
2103          onTransitionEnd: function () {
2104            this.css({ display: "none" });
2105          },
2106        });
2107      }),
2108      (i.prototype.destroy = function () {
2109        this.css({
2110          position: "",
2111          left: "",
2112          right: "",
2113          top: "",
2114          bottom: "",
2115          transition: "",
2116          transform: "",
2117        });
2118      }),
2119      (t.Outlayer = { Item: i });
2120  })(window),
2121  (function (t) {
2122    "use strict";
2123    function e(t, e) {
2124      for (var i in e) t[i] = e[i];
2125      return t;
2126    }
2127    function i(t) {
2128      return "[object Array]" === v.call(t);
2129    }
2130    function n(t) {
2131      var e = [];
2132      if (i(t)) e = t;
2133      else if ("number" == typeof t.length)
2134        for (var n = 0, o = t.length; o > n; n++) e.push(t[n]);
2135      else e.push(t);
2136      return e;
2137    }
2138    function o(t) {
2139      return t
2140        .replace(/(.)([A-Z])/g, function (t, e, i) {
2141          return e + "-" + i;
2142        })
2143        .toLowerCase();
2144    }
2145    function r(t, i) {
2146      if (("string" == typeof t && (t = l.querySelector(t)), !t || !_(t)))
2147        return (
2148          m && m.error("Bad " + this.settings.namespace + " element: " + t),
2149          void 0
2150        );
2151      (this.element = t),
2152        (this.options = e({}, this.options)),
2153        e(this.options, i);
2154      var n = ++L;
2155      (this.element.outlayerGUID = n),
2156        (E[n] = this),
2157        this._create(),
2158        this.options.isInitLayout && this.layout();
2159    }
2160    function s(t, i) {
2161      t.prototype[i] = e({}, r.prototype[i]);
2162    }
2163    var a = t.Outlayer,
2164      h = a.Item,
2165      p = t.docReady,
2166      u = t.EventEmitter,
2167      f = t.eventie,
2168      d = t.getSize,
2169      c = t.matchesSelector,
2170      l = t.document,
2171      m = t.console,
2172      y = t.jQuery,
2173      g = function () {},
2174      v = Object.prototype.toString,
2175      _ =
2176        "object" == typeof HTMLElement
2177          ? function (t) {
2178              return t instanceof HTMLElement;
2179            }
2180          : function (t) {
2181              return (
2182                t &&
2183                "object" == typeof t &&
2184                1 === t.nodeType &&
2185                "string" == typeof t.nodeName
2186              );
2187            },
2188      b = Array.prototype.indexOf
2189        ? function (t, e) {
2190            return t.indexOf(e);
2191          }
2192        : function (t, e) {
2193            for (var i = 0, n = t.length; n > i; i++) if (t[i] === e) return i;
2194            return -1;
2195          },
2196      L = 0,
2197      E = {};
2198    (r.prototype.settings = { namespace: "outlayer", item: a.Item }),
2199      (r.prototype.options = {
2200        containerStyle: { position: "relative" },
2201        isInitLayout: !0,
2202        isOriginLeft: !0,
2203        isOriginTop: !0,
2204        isResizeBound: !0,
2205        transitionDuration: "0.4s",
2206        hiddenStyle: { opacity: 0, transform: "scale(0.001)" },
2207        visibleStyle: { opacity: 1, transform: "scale(1)" },
2208      }),
2209      e(r.prototype, u.prototype),
2210      (r.prototype._create = function () {
2211        this.reloadItems(),
2212          (this.stamps = []),
2213          this.stamp(this.options.stamp),
2214          e(this.element.style, this.options.containerStyle),
2215          this.options.isResizeBound && this.bindResize();
2216      }),
2217      (r.prototype.reloadItems = function () {
2218        this.items = this._getItems(this.element.children);
2219      }),
2220      (r.prototype._getItems = function (t) {
2221        for (
2222          var e = this._filterFindItemElements(t),
2223            i = this.settings.item,
2224            n = [],
2225            o = 0,
2226            r = e.length;
2227          r > o;
2228          o++
2229        ) {
2230          var s = e[o],
2231            a = new i(s, this, this.options.itemOptions);
2232          n.push(a);
2233        }
2234        return n;
2235      }),
2236      (r.prototype._filterFindItemElements = function (t) {
2237        t = n(t);
2238        var e = this.options.itemSelector;
2239        if (!e) return t;
2240        for (var i = [], o = 0, r = t.length; r > o; o++) {
2241          var s = t[o];
2242          c(s, e) && i.push(s);
2243          for (var a = s.querySelectorAll(e), h = 0, p = a.length; p > h; h++)
2244            i.push(a[h]);
2245        }
2246        return i;
2247      }),
2248      (r.prototype.getItemElements = function () {
2249        for (var t = [], e = 0, i = this.items.length; i > e; e++)
2250          t.push(this.items[e].element);
2251        return t;
2252      }),
2253      (r.prototype.layout = function () {
2254        this._resetLayout(), this._manageStamps();
2255        var t =
2256          void 0 !== this.options.isLayoutInstant
2257            ? this.options.isLayoutInstant
2258            : !this._isLayoutInited;
2259        this.layoutItems(this.items, t), (this._isLayoutInited = !0);
2260      }),
2261      (r.prototype._init = r.prototype.layout),
2262      (r.prototype._resetLayout = function () {
2263        this.getSize();
2264      }),
2265      (r.prototype.getSize = function () {
2266        this.size = d(this.element);
2267      }),
2268      (r.prototype._getMeasurement = function (t, e) {
2269        var i,
2270          n = this.options[t];
2271        n
2272          ? ("string" == typeof n
2273              ? (i = this.element.querySelector(n))
2274              : _(n) && (i = n),
2275            (this[t] = i ? d(i)[e] : n))
2276          : (this[t] = 0);
2277      }),
2278      (r.prototype.layoutItems = function (t, e) {
2279        (t = this._getItemsForLayout(t)),
2280          this._layoutItems(t, e),
2281          this._postLayout();
2282      }),
2283      (r.prototype._getItemsForLayout = function (t) {
2284        for (var e = [], i = 0, n = t.length; n > i; i++) {
2285          var o = t[i];
2286          o.isIgnored || e.push(o);
2287        }
2288        return e;
2289      }),
2290      (r.prototype._layoutItems = function (t, e) {
2291        if (!t || !t.length)
2292          return this.emitEvent("layoutComplete", [this, t]), void 0;
2293        this._itemsOn(t, "layout", function () {
2294          this.emitEvent("layoutComplete", [this, t]);
2295        });
2296        for (var i = [], n = 0, o = t.length; o > n; n++) {
2297          var r = t[n],
2298            s = this._getItemLayoutPosition(r);
2299          (s.item = r), (s.isInstant = e), i.push(s);
2300        }
2301        this._processLayoutQueue(i);
2302      }),
2303      (r.prototype._getItemLayoutPosition = function () {
2304        return { x: 0, y: 0 };
2305      }),
2306      (r.prototype._processLayoutQueue = function (t) {
2307        for (var e = 0, i = t.length; i > e; e++) {
2308          var n = t[e];
2309          this._positionItem(n.item, n.x, n.y, n.isInstant);
2310        }
2311      }),
2312      (r.prototype._positionItem = function (t, e, i, n) {
2313        n ? t.goTo(e, i) : t.moveTo(e, i);
2314      }),
2315      (r.prototype._postLayout = function () {
2316        var t = this._getContainerSize();
2317        t &&
2318          (this._setContainerMeasure(t.width, !0),
2319          this._setContainerMeasure(t.height, !1));
2320      }),
2321      (r.prototype._getContainerSize = g),
2322      (r.prototype._setContainerMeasure = function (t, e) {
2323        if (void 0 !== t) {
2324          var i = this.size;
2325          i.isBorderBox &&
2326            (t += e
2327              ? i.paddingLeft +
2328                i.paddingRight +
2329                i.borderLeftWidth +
2330                i.borderRightWidth
2331              : i.paddingBottom +
2332                i.paddingTop +
2333                i.borderTopWidth +
2334                i.borderBottomWidth),
2335            (t = Math.max(t, 0)),
2336            (this.element.style[e ? "width" : "height"] = t + "px");
2337        }
2338      }),
2339      (r.prototype._itemsOn = function (t, e, i) {
2340        function n() {
2341          return o++, o === r && i.call(s), !0;
2342        }
2343        for (
2344          var o = 0, r = t.length, s = this, a = 0, h = t.length;
2345          h > a;
2346          a++
2347        ) {
2348          var p = t[a];
2349          p.on(e, n);
2350        }
2351      }),
2352      (r.prototype.ignore = function (t) {
2353        var e = this.getItem(t);
2354        e && (e.isIgnored = !0);
2355      }),
2356      (r.prototype.unignore = function (t) {
2357        var e = this.getItem(t);
2358        e && delete e.isIgnored;
2359      }),
2360      (r.prototype.stamp = function (t) {
2361        if ((t = this._find(t))) {
2362          this.stamps = this.stamps.concat(t);
2363          for (var e = 0, i = t.length; i > e; e++) {
2364            var n = t[e];
2365            this.ignore(n);
2366          }
2367        }
2368      }),
2369      (r.prototype.unstamp = function (t) {
2370        if ((t = this._find(t)))
2371          for (var e = 0, i = t.length; i > e; e++) {
2372            var n = t[e],
2373              o = b(this.stamps, n);
2374            -1 !== o && this.stamps.splice(o, 1), this.unignore(n);
2375          }
2376      }),
2377      (r.prototype._find = function (t) {
2378        return t
2379          ? ("string" == typeof t && (t = this.element.querySelectorAll(t)),
2380            (t = n(t)))
2381          : void 0;
2382      }),
2383      (r.prototype._manageStamps = function () {
2384        if (this.stamps && this.stamps.length) {
2385          this._getBoundingRect();
2386          for (var t = 0, e = this.stamps.length; e > t; t++) {
2387            var i = this.stamps[t];
2388            this._manageStamp(i);
2389          }
2390        }
2391      }),
2392      (r.prototype._getBoundingRect = function () {
2393        var t = this.element.getBoundingClientRect(),
2394          e = this.size;
2395        this._boundingRect = {
2396          left: t.left + e.paddingLeft + e.borderLeftWidth,
2397          top: t.top + e.paddingTop + e.borderTopWidth,
2398          right: t.right - (e.paddingRight + e.borderRightWidth),
2399          bottom: t.bottom - (e.paddingBottom + e.borderBottomWidth),
2400        };
2401      }),
2402      (r.prototype._manageStamp = g),
2403      (r.prototype._getElementOffset = function (t) {
2404        var e = t.getBoundingClientRect(),
2405          i = this._boundingRect,
2406          n = d(t),
2407          o = {
2408            left: e.left - i.left - n.marginLeft,
2409            top: e.top - i.top - n.marginTop,
2410            right: i.right - e.right - n.marginRight,
2411            bottom: i.bottom - e.bottom - n.marginBottom,
2412          };
2413        return o;
2414      }),
2415      (r.prototype.handleEvent = function (t) {
2416        var e = "on" + t.type;
2417        this[e] && this[e](t);
2418      }),
2419      (r.prototype.bindResize = function () {
2420        this.isResizeBound ||
2421          (f.bind(t, "resize", this), (this.isResizeBound = !0));
2422      }),
2423      (r.prototype.unbindResize = function () {
2424        f.unbind(t, "resize", this), (this.isResizeBound = !1);
2425      }),
2426      (r.prototype.onresize = function () {
2427        function t() {
2428          e.resize();
2429        }
2430        this.resizeTimeout && clearTimeout(this.resizeTimeout);
2431        var e = this;
2432        this.resizeTimeout = setTimeout(t, 100);
2433      }),
2434      (r.prototype.resize = function () {
2435        var t = d(this.element),
2436          e = this.size && t;
2437        (e && t.innerWidth === this.size.innerWidth) ||
2438          (this.layout(), delete this.resizeTimeout);
2439      }),
2440      (r.prototype.addItems = function (t) {
2441        var e = this._getItems(t);
2442        if (e.length) return (this.items = this.items.concat(e)), e;
2443      }),
2444      (r.prototype.appended = function (t) {
2445        var e = this.addItems(t);
2446        e.length && (this.layoutItems(e, !0), this.reveal(e));
2447      }),
2448      (r.prototype.prepended = function (t) {
2449        var e = this._getItems(t);
2450        if (e.length) {
2451          var i = this.items.slice(0);
2452          (this.items = e.concat(i)),
2453            this._resetLayout(),
2454            this.layoutItems(e, !0),
2455            this.reveal(e),
2456            this.layoutItems(i);
2457        }
2458      }),
2459      (r.prototype.reveal = function (t) {
2460        if (t && t.length)
2461          for (var e = 0, i = t.length; i > e; e++) {
2462            var n = t[e];
2463            n.reveal();
2464          }
2465      }),
2466      (r.prototype.hide = function (t) {
2467        if (t && t.length)
2468          for (var e = 0, i = t.length; i > e; e++) {
2469            var n = t[e];
2470            n.hide();
2471          }
2472      }),
2473      (r.prototype.getItem = function (t) {
2474        for (var e = 0, i = this.items.length; i > e; e++) {
2475          var n = this.items[e];
2476          if (n.element === t) return n;
2477        }
2478      }),
2479      (r.prototype.getItems = function (t) {
2480        if (t && t.length) {
2481          for (var e = [], i = 0, n = t.length; n > i; i++) {
2482            var o = t[i],
2483              r = this.getItem(o);
2484            r && e.push(r);
2485          }
2486          return e;
2487        }
2488      }),
2489      (r.prototype.remove = function (t) {
2490        t = n(t);
2491        var e = this.getItems(t);
2492        this._itemsOn(e, "remove", function () {
2493          this.emitEvent("removeComplete", [this, e]);
2494        });
2495        for (var i = 0, o = e.length; o > i; i++) {
2496          var r = e[i];
2497          r.remove();
2498          var s = b(this.items, r);
2499          this.items.splice(s, 1);
2500        }
2501      }),
2502      (r.prototype.destroy = function () {
2503        var t = this.element.style;
2504        (t.height = ""), (t.position = ""), (t.width = "");
2505        for (var e = 0, i = this.items.length; i > e; e++) {
2506          var n = this.items[e];
2507          n.destroy();
2508        }
2509        this.unbindResize(), delete this.element.outlayerGUID;
2510      }),
2511      (r.data = function (t) {
2512        var e = t && t.outlayerGUID;
2513        return e && E[e];
2514      }),
2515      (r.create = function (t, i) {
2516        function n() {
2517          r.apply(this, arguments);
2518        }
2519        return (
2520          e(n.prototype, r.prototype),
2521          s(n, "options"),
2522          s(n, "settings"),
2523          e(n.prototype.options, i),
2524          (n.prototype.settings.namespace = t),
2525          (n.data = r.data),
2526          (n.Item = function () {
2527            h.apply(this, arguments);
2528          }),
2529          (n.Item.prototype = new r.Item()),
2530          (n.prototype.settings.item = n.Item),
2531          p(function () {
2532            for (
2533              var e = o(t),
2534                i = l.querySelectorAll(".js-" + e),
2535                r = "data-" + e + "-options",
2536                s = 0,
2537                a = i.length;
2538              a > s;
2539              s++
2540            ) {
2541              var h,
2542                p = i[s],
2543                u = p.getAttribute(r);
2544              try {
2545                h = u && JSON.parse(u);
2546              } catch (f) {
2547                m &&
2548                  m.error(
2549                    "Error parsing " +
2550                      r +
2551                      " on " +
2552                      p.nodeName.toLowerCase() +
2553                      (p.id ? "#" + p.id : "") +
2554                      ": " +
2555                      f
2556                  );
2557                continue;
2558              }
2559              var d = new n(p, h);
2560              y && y.data(p, t, d);
2561            }
2562          }),
2563          y && y.bridget && y.bridget(t, n),
2564          n
2565        );
2566      }),
2567      (r.Item = h),
2568      (t.Outlayer = r);
2569  })(window),
2570  (function (t) {
2571    "use strict";
2572    function e(t, e) {
2573      var n = t.create("masonry");
2574      return (
2575        (n.prototype._resetLayout = function () {
2576          this.getSize(),
2577            this._getMeasurement("columnWidth", "outerWidth"),
2578            this._getMeasurement("gutter", "outerWidth"),
2579            this.measureColumns();
2580          var t = this.cols;
2581          for (this.colYs = []; t--; ) this.colYs.push(0);
2582          this.maxY = 0;
2583        }),
2584        (n.prototype.measureColumns = function () {
2585          var t = this.items[0].element;
2586          (this.columnWidth = this.columnWidth || e(t).outerWidth),
2587            (this.columnWidth += this.gutter),
2588            (this.cols = Math.floor(
2589              (this.size.innerWidth + this.gutter) / this.columnWidth
2590            )),
2591            (this.cols = Math.max(this.cols, 1));
2592        }),
2593        (n.prototype._getItemLayoutPosition = function (t) {
2594          t.getSize();
2595          var e = Math.ceil(t.size.outerWidth / this.columnWidth);
2596          e = Math.min(e, this.cols);
2597          for (
2598            var n = this._getColGroup(e),
2599              o = Math.min.apply(Math, n),
2600              r = i(n, o),
2601              s = { x: this.columnWidth * r, y: o },
2602              a = o + t.size.outerHeight,
2603              h = this.cols + 1 - n.length,
2604              p = 0;
2605            h > p;
2606            p++
2607          )
2608            this.colYs[r + p] = a;
2609          return s;
2610        }),
2611        (n.prototype._getColGroup = function (t) {
2612          if (1 === t) return this.colYs;
2613          for (var e = [], i = this.cols + 1 - t, n = 0; i > n; n++) {
2614            var o = this.colYs.slice(n, n + t);
2615            e[n] = Math.max.apply(Math, o);
2616          }
2617          return e;
2618        }),
2619        (n.prototype._manageStamp = function (t) {
2620          var i = e(t),
2621            n = this._getElementOffset(t),
2622            o = this.options.isOriginLeft ? n.left : n.right,
2623            r = o + i.outerWidth,
2624            s = Math.floor(o / this.columnWidth);
2625          s = Math.max(0, s);
2626          var a = Math.floor(r / this.columnWidth);
2627          a = Math.min(this.cols - 1, a);
2628          for (
2629            var h =
2630                (this.options.isOriginTop ? n.top : n.bottom) + i.outerHeight,
2631              p = s;
2632            a >= p;
2633            p++
2634          )
2635            this.colYs[p] = Math.max(h, this.colYs[p]);
2636        }),
2637        (n.prototype._getContainerSize = function () {
2638          return (
2639            (this.maxY = Math.max.apply(Math, this.colYs)),
2640            { height: this.maxY }
2641          );
2642        }),
2643        n
2644      );
2645    }
2646    var i = Array.prototype.indexOf
2647      ? function (t, e) {
2648          return t.indexOf(e);
2649        }
2650      : function (t, e) {
2651          for (var i = 0, n = t.length; n > i; i++) {
2652            var o = t[i];
2653            if (o === e) return i;
2654          }
2655          return -1;
2656        };
2657    "function" == typeof define && define.amd
2658      ? define(["outlayer", "get-size"], e)
2659      : (t.Masonry = e(t.Outlayer, t.getSize));
2660  })(window);
2661
2662/////////////////////////////////////////////
2663// STICKY PLUGIN
2664/////////////////////////////////////////////
2665
2666// Sticky Plugin v1.0.0 for jQuery
2667// =============
2668// Author: Anthony Garand
2669// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
2670// Improvements by Leonardo C. Daronco (daronco)
2671// Created: 2/14/2011
2672// Date: 2/12/2012
2673// Website: http://labs.anthonygarand.com/sticky
2674// Description: Makes an element on the page stick on the screen as you scroll
2675//       It will only set the 'top' and 'position' of your element, you
2676//       might need to adjust the width in some cases.
2677
2678(function ($) {
2679  var defaults = {
2680      topSpacing: 0,
2681      bottomSpacing: 0,
2682      className: "is-sticky",
2683      wrapperClassName: "sticky-wrapper",
2684      center: false,
2685      getWidthFrom: "",
2686    },
2687    $window = $(window),
2688    $document = $(document),
2689    sticked = [],
2690    windowHeight = $window.height(),
2691    scroller = function () {
2692      var scrollTop = $window.scrollTop(),
2693        documentHeight = $document.height(),
2694        dwh = documentHeight - windowHeight,
2695        extra = scrollTop > dwh ? dwh - scrollTop : 0;
2696
2697      for (var i = 0; i < sticked.length; i++) {
2698        var s = sticked[i],
2699          elementTop = s.stickyWrapper.offset().top,
2700          etse = elementTop - s.topSpacing - extra;
2701
2702        if (scrollTop <= etse) {
2703          if (s.currentTop !== null) {
2704            s.stickyElement.css("position", "").css("top", "");
2705            s.stickyElement.parent().removeClass(s.className);
2706            s.currentTop = null;
2707          }
2708        } else {
2709          var newTop =
2710            documentHeight -
2711            s.stickyElement.outerHeight() -
2712            s.topSpacing -
2713            s.bottomSpacing -
2714            scrollTop -
2715            extra;
2716          if (newTop < 0) {
2717            newTop = newTop + s.topSpacing;
2718          } else {
2719            newTop = s.topSpacing;
2720          }
2721          if (s.currentTop != newTop) {
2722            s.stickyElement.css("position", "fixed").css("top", newTop);
2723
2724            if (typeof s.getWidthFrom !== "undefined") {
2725              s.stickyElement.css("width", $(s.getWidthFrom).width());
2726            }
2727
2728            s.stickyElement.parent().addClass(s.className);
2729            s.currentTop = newTop;
2730          }
2731        }
2732      }
2733    },
2734    resizer = function () {
2735      windowHeight = $window.height();
2736    },
2737    methods = {
2738      init: function (options) {
2739        var o = $.extend(defaults, options);
2740        return this.each(function () {
2741          var stickyElement = $(this);
2742
2743          var stickyId = stickyElement.attr("id");
2744          var wrapper = $("<div></div>")
2745            .attr("id", stickyId + "-sticky-wrapper")
2746            .addClass(o.wrapperClassName);
2747          stickyElement.wrapAll(wrapper);
2748
2749          if (o.center) {
2750            stickyElement.parent().css({
2751              width: stickyElement.outerWidth(),
2752              marginLeft: "auto",
2753              marginRight: "auto",
2754            });
2755          }
2756
2757          if (stickyElement.css("float") == "right") {
2758            stickyElement
2759              .css({ float: "none" })
2760              .parent()
2761              .css({ float: "right" });
2762          }
2763
2764          var stickyWrapper = stickyElement.parent();
2765          stickyWrapper.css("height", stickyElement.outerHeight());
2766          sticked.push({
2767            topSpacing: o.topSpacing,
2768            bottomSpacing: o.bottomSpacing,
2769            stickyElement: stickyElement,
2770            currentTop: null,
2771            stickyWrapper: stickyWrapper,
2772            className: o.className,
2773            getWidthFrom: o.getWidthFrom,
2774          });
2775        });
2776      },
2777      update: scroller,
2778    };
2779
2780  // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
2781  if (window.addEventListener) {
2782    window.addEventListener("scroll", scroller, false);
2783    window.addEventListener("resize", resizer, false);
2784  } else if (window.attachEvent) {
2785    window.attachEvent("onscroll", scroller);
2786    window.attachEvent("onresize", resizer);
2787  }
2788
2789  $.fn.sticky = function (method) {
2790    if (methods[method]) {
2791      return methods[method].apply(
2792        this,
2793        Array.prototype.slice.call(arguments, 1)
2794      );
2795    } else if (typeof method === "object" || !method) {
2796      return methods.init.apply(this, arguments);
2797    } else {
2798      $.error("Method " + method + " does not exist on jQuery.sticky");
2799    }
2800  };
2801  $(function () {
2802    setTimeout(scroller, 0);
2803  });
2804})(jQuery);
2805
2806/////////////////////////////////////////////
2807// APPEAR PLUGIN
2808/////////////////////////////////////////////
2809
2810/*
2811 * jQuery.appear
2812 * https://github.com/bas2k/jquery.appear/
2813 * http://code.google.com/p/jquery-appear/
2814 *
2815 * Copyright (c) 2009 Michael Hixson
2816 * Copyright (c) 2012 Alexander Brovikov
2817 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
2818 */
2819(function ($) {
2820  $.fn.appear = function (fn, options) {
2821    var settings = $.extend(
2822      {
2823        //arbitrary data to pass to fn
2824        data: undefined,
2825
2826        //call fn only on the first appear?
2827        one: true,
2828
2829        // X & Y accuracy
2830        accX: 0,
2831        accY: 0,
2832      },
2833      options
2834    );
2835
2836    return this.each(function () {
2837      var t = $(this);
2838
2839      //whether the element is currently visible
2840      t.appeared = false;
2841
2842      if (!fn) {
2843        //trigger the custom event
2844        t.trigger("appear", settings.data);
2845        return;
2846      }
2847
2848      var w = $(window);
2849
2850      //fires the appear event when appropriate
2851      var check = function () {
2852        //is the element hidden?
2853        if (!t.is(":visible")) {
2854          //it became hidden
2855          t.appeared = false;
2856          return;
2857        }
2858
2859        //is the element inside the visible window?
2860        var a = w.scrollLeft();
2861        var b = w.scrollTop();
2862        var o = t.offset();
2863        var x = o.left;
2864        var y = o.top;
2865
2866        var ax = settings.accX;
2867        var ay = settings.accY;
2868        var th = t.height();
2869        var wh = w.height();
2870        var tw = t.width();
2871        var ww = w.width();
2872
2873        if (
2874          y + th + ay >= b &&
2875          y <= b + wh + ay &&
2876          x + tw + ax >= a &&
2877          x <= a + ww + ax
2878        ) {
2879          //trigger the custom event
2880          if (!t.appeared) t.trigger("appear", settings.data);
2881        } else {
2882          //it scrolled out of view
2883          t.appeared = false;
2884        }
2885      };
2886
2887      //create a modified fn with some additional logic
2888      var modifiedFn = function () {
2889        //mark the element as visible
2890        t.appeared = true;
2891
2892        //is this supposed to happen only once?
2893        if (settings.one) {
2894          //remove the check
2895          w.unbind("scroll", check);
2896          var i = $.inArray(check, $.fn.appear.checks);
2897          if (i >= 0) $.fn.appear.checks.splice(i, 1);
2898        }
2899
2900        //trigger the original fn
2901        fn.apply(this, arguments);
2902      };
2903
2904      //bind the modified fn to the element
2905      if (settings.one) t.one("appear", settings.data, modifiedFn);
2906      else t.bind("appear", settings.data, modifiedFn);
2907
2908      //check whenever the window scrolls
2909      w.scroll(check);
2910
2911      //check whenever the dom changes
2912      $.fn.appear.checks.push(check);
2913
2914      //check now
2915      check();
2916    });
2917  };
2918
2919  //keep a queue of appearance checks
2920  $.extend($.fn.appear, {
2921    checks: [],
2922    timeout: null,
2923
2924    //process the queue
2925    checkAll: function () {
2926      var length = $.fn.appear.checks.length;
2927      if (length > 0) while (length--) $.fn.appear.checks[length]();
2928    },
2929
2930    //check the queue asynchronously
2931    run: function () {
2932      if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
2933      $.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
2934    },
2935  });
2936
2937  //run checks when these methods are called
2938  $.each(
2939    [
2940      "append",
2941      "prepend",
2942      "after",
2943      "before",
2944      "attr",
2945      "removeAttr",
2946      "addClass",
2947      "removeClass",
2948      "toggleClass",
2949      "remove",
2950      "css",
2951      "show",
2952      "hide",
2953    ],
2954    function (i, n) {
2955      var old = $.fn[n];
2956      if (old) {
2957        $.fn[n] = function () {
2958          var r = old.apply(this, arguments);
2959          $.fn.appear.run();
2960          return r;
2961        };
2962      }
2963    }
2964  );
2965})(jQuery);
2966
2967/////////////////////////////////////////////
2968// COUNTTO PLUGIN
2969/////////////////////////////////////////////
2970
2971(function ($) {
2972  $.fn.countTo = function (options) {
2973    options = options || {};
2974
2975    return $(this).each(function () {
2976      // set options for current element
2977      var settings = $.extend(
2978        {},
2979        $.fn.countTo.defaults,
2980        {
2981          from: $(this).data("from"),
2982          to: $(this).data("to"),
2983          speed: $(this).data("speed"),
2984          refreshInterval: $(this).data("refresh-interval"),
2985          decimals: $(this).data("decimals"),
2986          prefix: $(this).data("prefix"),
2987          suffix: $(this).data("suffix"),
2988          withCommas: $(this).data("with-commas"),
2989          ordinal: $(this).data("ordinal"),
2990        },
2991        options
2992      );
2993
2994      // how many times to update the value, and how much to increment the value on each update
2995      var loops = Math.ceil(settings.speed / settings.refreshInterval),
2996        increment = (settings.to - settings.from) / loops;
2997
2998      // references & variables that will change with each update
2999      var self = this,
3000        $self = $(this),
3001        loopCount = 0,
3002        value = settings.from,
3003        data = $self.data("countTo") || {};
3004
3005      $self.data("countTo", data);
3006
3007      // if an existing interval can be found, clear it first
3008      if (data.interval) {
3009        clearInterval(data.interval);
3010      }
3011      data.interval = setInterval(updateTimer, settings.refreshInterval);
3012
3013      // initialize the element with the starting value
3014      render(value);
3015
3016      function updateTimer() {
3017        value += increment;
3018        loopCount++;
3019
3020        render(value);
3021
3022        if (typeof settings.onUpdate == "function") {
3023          settings.onUpdate.call(self, value);
3024        }
3025
3026        if (loopCount >= loops) {
3027          // remove the interval
3028          $self.removeData("countTo");
3029          clearInterval(data.interval);
3030          value = settings.to;
3031
3032          if (typeof settings.onComplete == "function") {
3033            settings.onComplete.call(self, value);
3034          }
3035        }
3036      }
3037
3038      function render(value) {
3039        var formattedValue = settings.formatter.call(self, value, settings);
3040        $self.text(formattedValue);
3041      }
3042    });
3043  };
3044
3045  $.fn.countTo.defaults = {
3046    from: 0, // the number the element should start at
3047    to: 0, // the number the element should end at
3048    speed: 1000, // how long it should take to count between the target numbers
3049    refreshInterval: 100, // how often the element should be updated
3050    decimals: 0, // the number of decimal places to show
3051    prefix: "", // the prefix to appear before the number
3052    suffix: "", // the suffix to appear after the number (and ordinal, if set)
3053    withCommas: false, // whether the number should show thousand/million commas
3054    ordinal: false, // whether it should show 1st, 2nd, 3rd and so on
3055    ordinalHandler: ordinalHandler, // handler for formatting the ordinals
3056    formatter: formatter, // handler for formatting the value before rendering
3057    onUpdate: null, // callback method for every time the element is updated
3058    onComplete: null, // callback method for when the element finishes updating
3059  };
3060
3061  function ordinalHandler(settings) {
3062    if (settings.ordinal !== false) {
3063      var s = ["th", "st", "nd", "rd"],
3064        v = settings.to % 100;
3065      return s[(v - 20) % 10] || s[v] || s[0];
3066    }
3067    return "";
3068  }
3069
3070  function numberWithCommas(value, settings) {
3071    if (settings.withCommas !== false) {
3072      var parts = value.toString().split(".");
3073      parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
3074      return parts.join(".");
3075    }
3076    return value;
3077  }
3078
3079  function formatter(value, settings) {
3080    return (
3081      settings.prefix +
3082      numberWithCommas(value.toFixed(settings.decimals), settings) +
3083      settings.suffix +
3084      settings.ordinalHandler.call(self, settings)
3085    );
3086  }
3087})(jQuery);
3088
3089/////////////////////////////////////////////
3090// NICESCROLL PLUGIN
3091/////////////////////////////////////////////
3092
3093/* jquery.nicescroll 3.5.1 InuYaksa*2013 MIT http://areaaperta.com/nicescroll */ (function (
3094  e
3095) {
3096  var z = !1,
3097    E = !1,
3098    L = 5e3,
3099    M = 2e3,
3100    y = 0,
3101    N = (function () {
3102      var e = document.getElementsByTagName("script"),
3103        e = e[e.length - 1].src.split("?")[0];
3104      return 0 < e.split("/").length
3105        ? e.split("/").slice(0, -1).join("/") + "/"
3106        : "";
3107    })(),
3108    H = ["ms", "moz", "webkit", "o"],
3109    v = window.requestAnimationFrame || !1,
3110    w = window.cancelAnimationFrame || !1;
3111  if (!v)
3112    for (var O in H) {
3113      var F = H[O];
3114      v || (v = window[F + "RequestAnimationFrame"]);
3115      w ||
3116        (w =
3117          window[F + "CancelAnimationFrame"] ||
3118          window[F + "CancelRequestAnimationFrame"]);
3119    }
3120  var A = window.MutationObserver || window.WebKitMutationObserver || !1,
3121    I = {
3122      zindex: "auto",
3123      cursoropacitymin: 0,
3124      cursoropacitymax: 1,
3125      cursorcolor: "#424242",
3126      cursorwidth: "5px",
3127      cursorborder: "1px solid #fff",
3128      cursorborderradius: "5px",
3129      scrollspeed: 60,
3130      mousescrollstep: 24,
3131      touchbehavior: !1,
3132      hwacceleration: !0,
3133      usetransition: !0,
3134      boxzoom: !1,
3135      dblclickzoom: !0,
3136      gesturezoom: !0,
3137      grabcursorenabled: !0,
3138      autohidemode: !0,
3139      background: "",
3140      iframeautoresize: !0,
3141      cursorminheight: 32,
3142      preservenativescrolling: !0,
3143      railoffset: !1,
3144      bouncescroll: !0,
3145      spacebarenabled: !0,
3146      railpadding: { top: 0, right: 0, left: 0, bottom: 0 },
3147      disableoutline: !0,
3148      horizrailenabled: !0,
3149      railalign: "right",
3150      railvalign: "bottom",
3151      enabletranslate3d: !0,
3152      enablemousewheel: !0,
3153      enablekeyboard: !0,
3154      smoothscroll: !0,
3155      sensitiverail: !0,
3156      enablemouselockapi: !0,
3157      cursorfixedheight: !1,
3158      directionlockdeadzone: 6,
3159      hidecursordelay: 400,
3160      nativeparentscrolling: !0,
3161      enablescrollonselection: !0,
3162      overflowx: !0,
3163      overflowy: !0,
3164      cursordragspeed: 0.3,
3165      rtlmode: !1,
3166      cursordragontouch: !1,
3167      oneaxismousemode: "auto",
3168    },
3169    G = !1,
3170    P = function () {
3171      if (G) return G;
3172      var e = document.createElement("DIV"),
3173        c = {
3174          haspointerlock:
3175            "pointerLockElement" in document ||
3176            "mozPointerLockElement" in document ||
3177            "webkitPointerLockElement" in document,
3178        };
3179      c.isopera = "opera" in window;
3180      c.isopera12 = c.isopera && "getUserMedia" in navigator;
3181      c.isoperamini =
3182        "[object OperaMini]" ===
3183        Object.prototype.toString.call(window.operamini);
3184      c.isie = "all" in document && "attachEvent" in e && !c.isopera;
3185      c.isieold = c.isie && !("msInterpolationMode" in e.style);
3186      c.isie7 =
3187        c.isie &&
3188        !c.isieold &&
3189        (!("documentMode" in document) || 7 == document.documentMode);
3190      c.isie8 =
3191        c.isie && "documentMode" in document && 8 == document.documentMode;
3192      c.isie9 = c.isie && "performance" in window && 9 <= document.documentMode;
3193      c.isie10 =
3194        c.isie && "performance" in window && 10 <= document.documentMode;
3195      c.isie9mobile = /iemobile.9/i.test(navigator.userAgent);
3196      c.isie9mobile && (c.isie9 = !1);
3197      c.isie7mobile =
3198        !c.isie9mobile && c.isie7 && /iemobile/i.test(navigator.userAgent);
3199      c.ismozilla = "MozAppearance" in e.style;
3200      c.iswebkit = "WebkitAppearance" in e.style;
3201      c.ischrome = "chrome" in window;
3202      c.ischrome22 = c.ischrome && c.haspointerlock;
3203      c.ischrome26 = c.ischrome && "transition" in e.style;
3204      c.cantouch =
3205        "ontouchstart" in document.documentElement || "ontouchstart" in window;
3206      c.hasmstouch = window.navigator.msPointerEnabled || !1;
3207      c.ismac = /^mac$/i.test(navigator.platform);
3208      c.isios = c.cantouch && /iphone|ipad|ipod/i.test(navigator.platform);
3209      c.isios4 = c.isios && !("seal" in Object);
3210      c.isandroid = /android/i.test(navigator.userAgent);
3211      c.trstyle = !1;
3212      c.hastransform = !1;
3213      c.hastranslate3d = !1;
3214      c.transitionstyle = !1;
3215      c.hastransition = !1;
3216      c.transitionend = !1;
3217      for (
3218        var h = [
3219            "transform",
3220            "msTransform",
3221            "webkitTransform",
3222            "MozTransform",
3223            "OTransform",
3224          ],
3225          l = 0;
3226        l < h.length;
3227        l++
3228      )
3229        if ("undefined" != typeof e.style[h[l]]) {
3230          c.trstyle = h[l];
3231          break;
3232        }
3233      c.hastransform = !1 != c.trstyle;
3234      c.hastransform &&
3235        ((e.style[c.trstyle] = "translate3d(1px,2px,3px)"),
3236        (c.hastranslate3d = /translate3d/.test(e.style[c.trstyle])));
3237      c.transitionstyle = !1;
3238      c.prefixstyle = "";
3239      c.transitionend = !1;
3240      for (
3241        var h =
3242            "transition webkitTransition MozTransition OTransition OTransition msTransition KhtmlTransition".split(
3243              " "
3244            ),
3245          q = " -webkit- -moz- -o- -o -ms- -khtml-".split(" "),
3246          t =
3247            "transitionend webkitTransitionEnd transitionend otransitionend oTransitionEnd msTransitionEnd KhtmlTransitionEnd".split(
3248              " "
3249            ),
3250          l = 0;
3251        l < h.length;
3252        l++
3253      )
3254        if (h[l] in e.style) {
3255          c.transitionstyle = h[l];
3256          c.prefixstyle = q[l];
3257          c.transitionend = t[l];
3258          break;
3259        }
3260      c.ischrome26 && (c.prefixstyle = q[1]);
3261      c.hastransition = c.transitionstyle;
3262      a: {
3263        h = ["-moz-grab", "-webkit-grab", "grab"];
3264        if ((c.ischrome && !c.ischrome22) || c.isie) h = [];
3265        for (l = 0; l < h.length; l++)
3266          if (((q = h[l]), (e.style.cursor = q), e.style.cursor == q)) {
3267            h = q;
3268            break a;
3269          }
3270        h =
3271          "url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize";
3272      }
3273      c.cursorgrabvalue = h;
3274      c.hasmousecapture = "setCapture" in e;
3275      c.hasMutationObserver = !1 !== A;
3276      return (G = c);
3277    },
3278    Q = function (k, c) {
3279      function h() {
3280        var d = b.win;
3281        if ("zIndex" in d) return d.zIndex();
3282        for (; 0 < d.length && 9 != d[0].nodeType; ) {
3283          var c = d.css("zIndex");
3284          if (!isNaN(c) && 0 != c) return parseInt(c);
3285          d = d.parent();
3286        }
3287        return !1;
3288      }
3289      function l(d, c, g) {
3290        c = d.css(c);
3291        d = parseFloat(c);
3292        return isNaN(d)
3293          ? ((d = u[c] || 0),
3294            (g =
3295              3 == d
3296                ? g
3297                  ? b.win.outerHeight() - b.win.innerHeight()
3298                  : b.win.outerWidth() - b.win.innerWidth()
3299                : 1),
3300            b.isie8 && d && (d += 1),
3301            g ? d : 0)
3302          : d;
3303      }
3304      function q(d, c, g, f) {
3305        b._bind(
3306          d,
3307          c,
3308          function (b) {
3309            b = b ? b : window.event;
3310            var f = {
3311              original: b,
3312              target: b.target || b.srcElement,
3313              type: "wheel",
3314              deltaMode: "MozMousePixelScroll" == b.type ? 0 : 1,
3315              deltaX: 0,
3316              deltaZ: 0,
3317              preventDefault: function () {
3318                b.preventDefault ? b.preventDefault() : (b.returnValue = !1);
3319                return !1;
3320              },
3321              stopImmediatePropagation: function () {
3322                b.stopImmediatePropagation
3323                  ? b.stopImmediatePropagation()
3324                  : (b.cancelBubble = !0);
3325              },
3326            };
3327            "mousewheel" == c
3328              ? ((f.deltaY = -0.025 * b.wheelDelta),
3329                b.wheelDeltaX && (f.deltaX = -0.025 * b.wheelDeltaX))
3330              : (f.deltaY = b.detail);
3331            return g.call(d, f);
3332          },
3333          f
3334        );
3335      }
3336      function t(d, c, g) {
3337        var f, e;
3338        0 == d.deltaMode
3339          ? ((f = -Math.floor(d.deltaX * (b.opt.mousescrollstep / 54))),
3340            (e = -Math.floor(d.deltaY * (b.opt.mousescrollstep / 54))))
3341          : 1 == d.deltaMode &&
3342            ((f = -Math.floor(d.deltaX * b.opt.mousescrollstep)),
3343            (e = -Math.floor(d.deltaY * b.opt.mousescrollstep)));
3344        c && b.opt.oneaxismousemode && 0 == f && e && ((f = e), (e = 0));
3345        f &&
3346          (b.scrollmom && b.scrollmom.stop(),
3347          (b.lastdeltax += f),
3348          b.debounced(
3349            "mousewheelx",
3350            function () {
3351              var d = b.lastdeltax;
3352              b.lastdeltax = 0;
3353              b.rail.drag || b.doScrollLeftBy(d);
3354            },
3355            120
3356          ));
3357        if (e) {
3358          if (b.opt.nativeparentscrolling && g && !b.ispage && !b.zoomactive)
3359            if (0 > e) {
3360              if (b.getScrollTop() >= b.page.maxh) return !0;
3361            } else if (0 >= b.getScrollTop()) return !0;
3362          b.scrollmom && b.scrollmom.stop();
3363          b.lastdeltay += e;
3364          b.debounced(
3365            "mousewheely",
3366            function () {
3367              var d = b.lastdeltay;
3368              b.lastdeltay = 0;
3369              b.rail.drag || b.doScrollBy(d);
3370            },
3371            120
3372          );
3373        }
3374        d.stopImmediatePropagation();
3375        return d.preventDefault();
3376      }
3377      var b = this;
3378      this.version = "3.5.1";
3379      this.name = "nicescroll";
3380      this.me = c;
3381      this.opt = { doc: e("body"), win: !1 };
3382      e.extend(this.opt, I);
3383      this.opt.snapbackspeed = 80;
3384      if (k)
3385        for (var p in b.opt) "undefined" != typeof k[p] && (b.opt[p] = k[p]);
3386      this.iddoc =
3387        (this.doc = b.opt.doc) && this.doc[0] ? this.doc[0].id || "" : "";
3388      this.ispage = /BODY|HTML/.test(
3389        b.opt.win ? b.opt.win[0].nodeName : this.doc[0].nodeName
3390      );
3391      this.haswrapper = !1 !== b.opt.win;
3392      this.win = b.opt.win || (this.ispage ? e(window) : this.doc);
3393      this.docscroll = this.ispage && !this.haswrapper ? e(window) : this.win;
3394      this.body = e("body");
3395      this.iframe = this.isfixed = this.viewport = !1;
3396      this.isiframe =
3397        "IFRAME" == this.doc[0].nodeName && "IFRAME" == this.win[0].nodeName;
3398      this.istextarea = "TEXTAREA" == this.win[0].nodeName;
3399      this.forcescreen = !1;
3400      this.canshowonmouseevent = "scroll" != b.opt.autohidemode;
3401      this.page =
3402        this.view =
3403        this.onzoomout =
3404        this.onzoomin =
3405        this.onscrollcancel =
3406        this.onscrollend =
3407        this.onscrollstart =
3408        this.onclick =
3409        this.ongesturezoom =
3410        this.onkeypress =
3411        this.onmousewheel =
3412        this.onmousemove =
3413        this.onmouseup =
3414        this.onmousedown =
3415          !1;
3416      this.scroll = { x: 0, y: 0 };
3417      this.scrollratio = { x: 0, y: 0 };
3418      this.cursorheight = 20;
3419      this.scrollvaluemax = 0;
3420      this.observerremover =
3421        this.observer =
3422        this.scrollmom =
3423        this.scrollrunning =
3424        this.checkrtlmode =
3425          !1;
3426      do this.id = "ascrail" + M++;
3427      while (document.getElementById(this.id));
3428      this.hasmousefocus =
3429        this.hasfocus =
3430        this.zoomactive =
3431        this.zoom =
3432        this.selectiondrag =
3433        this.cursorfreezed =
3434        this.cursor =
3435        this.rail =
3436          !1;
3437      this.visibility = !0;
3438      this.hidden = this.locked = !1;
3439      this.cursoractive = !0;
3440      this.overflowx = b.opt.overflowx;
3441      this.overflowy = b.opt.overflowy;
3442      this.nativescrollingarea = !1;
3443      this.checkarea = 0;
3444      this.events = [];
3445      this.saved = {};
3446      this.delaylist = {};
3447      this.synclist = {};
3448      this.lastdeltay = this.lastdeltax = 0;
3449      this.detected = P();
3450      var f = e.extend({}, this.detected);
3451      this.ishwscroll =
3452        (this.canhwscroll = f.hastransform && b.opt.hwacceleration) &&
3453        b.haswrapper;
3454      this.istouchcapable = !1;
3455      f.cantouch &&
3456        f.ischrome &&
3457        !f.isios &&
3458        !f.isandroid &&
3459        ((this.istouchcapable = !0), (f.cantouch = !1));
3460      f.cantouch &&
3461        f.ismozilla &&
3462        !f.isios &&
3463        !f.isandroid &&
3464        ((this.istouchcapable = !0), (f.cantouch = !1));
3465      b.opt.enablemouselockapi ||
3466        ((f.hasmousecapture = !1), (f.haspointerlock = !1));
3467      this.delayed = function (d, c, g, f) {
3468        var e = b.delaylist[d],
3469          h = new Date().getTime();
3470        if (!f && e && e.tt) return !1;
3471        e && e.tt && clearTimeout(e.tt);
3472        if (e && e.last + g > h && !e.tt)
3473          b.delaylist[d] = {
3474            last: h + g,
3475            tt: setTimeout(function () {
3476              b.delaylist[d].tt = 0;
3477              c.call();
3478            }, g),
3479          };
3480        else if (!e || !e.tt)
3481          (b.delaylist[d] = { last: h, tt: 0 }),
3482            setTimeout(function () {
3483              c.call();
3484            }, 0);
3485      };
3486      this.debounced = function (d, c, g) {
3487        var f = b.delaylist[d];
3488        new Date().getTime();
3489        b.delaylist[d] = c;
3490        f ||
3491          setTimeout(function () {
3492            var c = b.delaylist[d];
3493            b.delaylist[d] = !1;
3494            c.call();
3495          }, g);
3496      };
3497      this.synched = function (d, c) {
3498        b.synclist[d] = c;
3499        (function () {
3500          b.onsync ||
3501            (v(function () {
3502              b.onsync = !1;
3503              for (d in b.synclist) {
3504                var c = b.synclist[d];
3505                c && c.call(b);
3506                b.synclist[d] = !1;
3507              }
3508            }),
3509            (b.onsync = !0));
3510        })();
3511        return d;
3512      };
3513      this.unsynched = function (d) {
3514        b.synclist[d] && (b.synclist[d] = !1);
3515      };
3516      this.css = function (d, c) {
3517        for (var g in c) b.saved.css.push([d, g, d.css(g)]), d.css(g, c[g]);
3518      };
3519      this.scrollTop = function (d) {
3520        return "undefined" == typeof d ? b.getScrollTop() : b.setScrollTop(d);
3521      };
3522      this.scrollLeft = function (d) {
3523        return "undefined" == typeof d ? b.getScrollLeft() : b.setScrollLeft(d);
3524      };
3525      BezierClass = function (b, c, g, f, e, h, l) {
3526        this.st = b;
3527        this.ed = c;
3528        this.spd = g;
3529        this.p1 = f || 0;
3530        this.p2 = e || 1;
3531        this.p3 = h || 0;
3532        this.p4 = l || 1;
3533        this.ts = new Date().getTime();
3534        this.df = this.ed - this.st;
3535      };
3536      BezierClass.prototype = {
3537        B2: function (b) {
3538          return 3 * b * b * (1 - b);
3539        },
3540        B3: function (b) {
3541          return 3 * b * (1 - b) * (1 - b);
3542        },
3543        B4: function (b) {
3544          return (1 - b) * (1 - b) * (1 - b);
3545        },
3546        getNow: function () {
3547          var b = 1 - (new Date().getTime() - this.ts) / this.spd,
3548            c = this.B2(b) + this.B3(b) + this.B4(b);
3549          return 0 > b ? this.ed : this.st + Math.round(this.df * c);
3550        },
3551        update: function (b, c) {
3552          this.st = this.getNow();
3553          this.ed = b;
3554          this.spd = c;
3555          this.ts = new Date().getTime();
3556          this.df = this.ed - this.st;
3557          return this;
3558        },
3559      };
3560      if (this.ishwscroll) {
3561        this.doc.translate = { x: 0, y: 0, tx: "0px", ty: "0px" };
3562        f.hastranslate3d &&
3563          f.isios &&
3564          this.doc.css("-webkit-backface-visibility", "hidden");
3565        var s = function () {
3566          var d = b.doc.css(f.trstyle);
3567          return d && "matrix" == d.substr(0, 6)
3568            ? d
3569                .replace(/^.*\((.*)\)$/g, "$1")
3570                .replace(/px/g, "")
3571                .split(/, +/)
3572            : !1;
3573        };
3574        this.getScrollTop = function (d) {
3575          if (!d) {
3576            if ((d = s())) return 16 == d.length ? -d[13] : -d[5];
3577            if (b.timerscroll && b.timerscroll.bz)
3578              return b.timerscroll.bz.getNow();
3579          }
3580          return b.doc.translate.y;
3581        };
3582        this.getScrollLeft = function (d) {
3583          if (!d) {
3584            if ((d = s())) return 16 == d.length ? -d[12] : -d[4];
3585            if (b.timerscroll && b.timerscroll.bh)
3586              return b.timerscroll.bh.getNow();
3587          }
3588          return b.doc.translate.x;
3589        };
3590        this.notifyScrollEvent = document.createEvent
3591          ? function (b) {
3592              var c = document.createEvent("UIEvents");
3593              c.initUIEvent("scroll", !1, !0, window, 1);
3594              b.dispatchEvent(c);
3595            }
3596          : document.fireEvent
3597          ? function (b) {
3598              var c = document.createEventObject();
3599              b.fireEvent("onscroll");
3600              c.cancelBubble = !0;
3601            }
3602          : function (b, c) {};
3603        f.hastranslate3d && b.opt.enabletranslate3d
3604          ? ((this.setScrollTop = function (d, c) {
3605              b.doc.translate.y = d;
3606              b.doc.translate.ty = -1 * d + "px";
3607              b.doc.css(
3608                f.trstyle,
3609                "translate3d(" +
3610                  b.doc.translate.tx +
3611                  "," +
3612                  b.doc.translate.ty +
3613                  ",0px)"
3614              );
3615              c || b.notifyScrollEvent(b.win[0]);
3616            }),
3617            (this.setScrollLeft = function (d, c) {
3618              b.doc.translate.x = d;
3619              b.doc.translate.tx = -1 * d + "px";
3620              b.doc.css(
3621                f.trstyle,
3622                "translate3d(" +
3623                  b.doc.translate.tx +
3624                  "," +
3625                  b.doc.translate.ty +
3626                  ",0px)"
3627              );
3628              c || b.notifyScrollEvent(b.win[0]);
3629            }))
3630          : ((this.setScrollTop = function (d, c) {
3631              b.doc.translate.y = d;
3632              b.doc.translate.ty = -1 * d + "px";
3633              b.doc.css(
3634                f.trstyle,
3635                "translate(" +
3636                  b.doc.translate.tx +
3637                  "," +
3638                  b.doc.translate.ty +
3639                  ")"
3640              );
3641              c || b.notifyScrollEvent(b.win[0]);
3642            }),
3643            (this.setScrollLeft = function (d, c) {
3644              b.doc.translate.x = d;
3645              b.doc.translate.tx = -1 * d + "px";
3646              b.doc.css(
3647                f.trstyle,
3648                "translate(" +
3649                  b.doc.translate.tx +
3650                  "," +
3651                  b.doc.translate.ty +
3652                  ")"
3653              );
3654              c || b.notifyScrollEvent(b.win[0]);
3655            }));
3656      } else
3657        (this.getScrollTop = function () {
3658          return b.docscroll.scrollTop();
3659        }),
3660          (this.setScrollTop = function (d) {
3661            return b.docscroll.scrollTop(d);
3662          }),
3663          (this.getScrollLeft = function () {
3664            return b.docscroll.scrollLeft();
3665          }),
3666          (this.setScrollLeft = function (d) {
3667            return b.docscroll.scrollLeft(d);
3668          });
3669      this.getTarget = function (b) {
3670        return !b ? !1 : b.target ? b.target : b.srcElement ? b.srcElement : !1;
3671      };
3672      this.hasParent = function (b, c) {
3673        if (!b) return !1;
3674        for (var g = b.target || b.srcElement || b || !1; g && g.id != c; )
3675          g = g.parentNode || !1;
3676        return !1 !== g;
3677      };
3678      var u = { thin: 1, medium: 3, thick: 5 };
3679      this.getOffset = function () {
3680        if (b.isfixed)
3681          return {
3682            top: parseFloat(b.win.css("top")),
3683            left: parseFloat(b.win.css("left")),
3684          };
3685        if (!b.viewport) return b.win.offset();
3686        var d = b.win.offset(),
3687          c = b.viewport.offset();
3688        return {
3689          top: d.top - c.top + b.viewport.scrollTop(),
3690          left: d.left - c.left + b.viewport.scrollLeft(),
3691        };
3692      };
3693      this.updateScrollBar = function (d) {
3694        if (b.ishwscroll)
3695          b.rail.css({ height: b.win.innerHeight() }),
3696            b.railh && b.railh.css({ width: b.win.innerWidth() });
3697        else {
3698          var c = b.getOffset(),
3699            g = c.top,
3700            f = c.left,
3701            g = g + l(b.win, "border-top-width", !0);
3702          b.win.outerWidth();
3703          b.win.innerWidth();
3704          var f =
3705              f +
3706              (b.rail.align
3707                ? b.win.outerWidth() -
3708                  l(b.win, "border-right-width") -
3709                  b.rail.width
3710                : l(b.win, "border-left-width")),
3711            e = b.opt.railoffset;
3712          e && (e.top && (g += e.top), b.rail.align && e.left && (f += e.left));
3713          b.locked ||
3714            b.rail.css({
3715              top: g,
3716              left: f,
3717              height: d ? d.h : b.win.innerHeight(),
3718            });
3719          b.zoom &&
3720            b.zoom.css({
3721              top: g + 1,
3722              left: 1 == b.rail.align ? f - 20 : f + b.rail.width + 4,
3723            });
3724          b.railh &&
3725            !b.locked &&
3726            ((g = c.top),
3727            (f = c.left),
3728            (d = b.railh.align
3729              ? g +
3730                l(b.win, "border-top-width", !0) +
3731                b.win.innerHeight() -
3732                b.railh.height
3733              : g + l(b.win, "border-top-width", !0)),
3734            (f += l(b.win, "border-left-width")),
3735            b.railh.css({ top: d, left: f, width: b.railh.width }));
3736        }
3737      };
3738      this.doRailClick = function (d, c, g) {
3739        var f;
3740        b.locked ||
3741          (b.cancelEvent(d),
3742          c
3743            ? ((c = g ? b.doScrollLeft : b.doScrollTop),
3744              (f = g
3745                ? (d.pageX - b.railh.offset().left - b.cursorwidth / 2) *
3746                  b.scrollratio.x
3747                : (d.pageY - b.rail.offset().top - b.cursorheight / 2) *
3748                  b.scrollratio.y),
3749              c(f))
3750            : ((c = g ? b.doScrollLeftBy : b.doScrollBy),
3751              (f = g ? b.scroll.x : b.scroll.y),
3752              (d = g
3753                ? d.pageX - b.railh.offset().left
3754                : d.pageY - b.rail.offset().top),
3755              (g = g ? b.view.w : b.view.h),
3756              f >= d ? c(g) : c(-g)));
3757      };
3758      b.hasanimationframe = v;
3759      b.hascancelanimationframe = w;
3760      b.hasanimationframe
3761        ? b.hascancelanimationframe ||
3762          (w = function () {
3763            b.cancelAnimationFrame = !0;
3764          })
3765        : ((v = function (b) {
3766            return setTimeout(b, 15 - (Math.floor(+new Date() / 1e3) % 16));
3767          }),
3768          (w = clearInterval));
3769      this.init = function () {
3770        b.saved.css = [];
3771        if (f.isie7mobile || f.isoperamini) return !0;
3772        f.hasmstouch &&
3773          b.css(b.ispage ? e("html") : b.win, { "-ms-touch-action": "none" });
3774        b.zindex = "auto";
3775        b.zindex =
3776          !b.ispage && "auto" == b.opt.zindex ? h() || "auto" : b.opt.zindex;
3777        !b.ispage && "auto" != b.zindex && b.zindex > y && (y = b.zindex);
3778        b.isie &&
3779          0 == b.zindex &&
3780          "auto" == b.opt.zindex &&
3781          (b.zindex = "auto");
3782        if (!b.ispage || (!f.cantouch && !f.isieold && !f.isie9mobile)) {
3783          var d = b.docscroll;
3784          b.ispage && (d = b.haswrapper ? b.win : b.doc);
3785          f.isie9mobile || b.css(d, { "overflow-y": "hidden" });
3786          b.ispage &&
3787            f.isie7 &&
3788            ("BODY" == b.doc[0].nodeName
3789              ? b.css(e("html"), { "overflow-y": "hidden" })
3790              : "HTML" == b.doc[0].nodeName &&
3791                b.css(e("body"), { "overflow-y": "hidden" }));
3792          f.isios &&
3793            !b.ispage &&
3794            !b.haswrapper &&
3795            b.css(e("body"), { "-webkit-overflow-scrolling": "touch" });
3796          var c = e(document.createElement("div"));
3797          c.css({
3798            position: "relative",
3799            top: 0,
3800            float: "right",
3801            width: b.opt.cursorwidth,
3802            height: "0px",
3803            "background-color": b.opt.cursorcolor,
3804            border: b.opt.cursorborder,
3805            "background-clip": "padding-box",
3806            "-webkit-border-radius": b.opt.cursorborderradius,
3807            "-moz-border-radius": b.opt.cursorborderradius,
3808            "border-radius": b.opt.cursorborderradius,
3809          });
3810          c.hborder = parseFloat(c.outerHeight() - c.innerHeight());
3811          b.cursor = c;
3812          var g = e(document.createElement("div"));
3813          g.attr("id", b.id);
3814          g.addClass("nicescroll-rails");
3815          var l,
3816            k,
3817            x = ["left", "right"],
3818            q;
3819          for (q in x)
3820            (k = x[q]),
3821              (l = b.opt.railpadding[k])
3822                ? g.css("padding-" + k, l + "px")
3823                : (b.opt.railpadding[k] = 0);
3824          g.append(c);
3825          g.width =
3826            Math.max(parseFloat(b.opt.cursorwidth), c.outerWidth()) +
3827            b.opt.railpadding.left +
3828            b.opt.railpadding.right;
3829          g.css({
3830            width: g.width + "px",
3831            zIndex: b.zindex,
3832            background: b.opt.background,
3833            cursor: "default",
3834          });
3835          g.visibility = !0;
3836          g.scrollable = !0;
3837          g.align = "left" == b.opt.railalign ? 0 : 1;
3838          b.rail = g;
3839          c = b.rail.drag = !1;
3840          b.opt.boxzoom &&
3841            !b.ispage &&
3842            !f.isieold &&
3843            ((c = document.createElement("div")),
3844            b.bind(c, "click", b.doZoom),
3845            (b.zoom = e(c)),
3846            b.zoom.css({
3847              cursor: "pointer",
3848              "z-index": b.zindex,
3849              backgroundImage: "url(" + N + "zoomico.png)",
3850              height: 18,
3851              width: 18,
3852              backgroundPosition: "0px 0px",
3853            }),
3854            b.opt.dblclickzoom && b.bind(b.win, "dblclick", b.doZoom),
3855            f.cantouch &&
3856              b.opt.gesturezoom &&
3857              ((b.ongesturezoom = function (d) {
3858                1.5 < d.scale && b.doZoomIn(d);
3859                0.8 > d.scale && b.doZoomOut(d);
3860                return b.cancelEvent(d);
3861              }),
3862              b.bind(b.win, "gestureend", b.ongesturezoom)));
3863          b.railh = !1;
3864          if (b.opt.horizrailenabled) {
3865            b.css(d, { "overflow-x": "hidden" });
3866            c = e(document.createElement("div"));
3867            c.css({
3868              position: "relative",
3869              top: 0,
3870              height: b.opt.cursorwidth,
3871              width: "0px",
3872              "background-color": b.opt.cursorcolor,
3873              border: b.opt.cursorborder,
3874              "background-clip": "padding-box",
3875              "-webkit-border-radius": b.opt.cursorborderradius,
3876              "-moz-border-radius": b.opt.cursorborderradius,
3877              "border-radius": b.opt.cursorborderradius,
3878            });
3879            c.wborder = parseFloat(c.outerWidth() - c.innerWidth());
3880            b.cursorh = c;
3881            var m = e(document.createElement("div"));
3882            m.attr("id", b.id + "-hr");
3883            m.addClass("nicescroll-rails");
3884            m.height = Math.max(parseFloat(b.opt.cursorwidth), c.outerHeight());
3885            m.css({
3886              height: m.height + "px",
3887              zIndex: b.zindex,
3888              background: b.opt.background,
3889            });
3890            m.append(c);
3891            m.visibility = !0;
3892            m.scrollable = !0;
3893            m.align = "top" == b.opt.railvalign ? 0 : 1;
3894            b.railh = m;
3895            b.railh.drag = !1;
3896          }
3897          b.ispage
3898            ? (g.css({ position: "fixed", top: "0px", height: "100%" }),
3899              g.align ? g.css({ right: "0px" }) : g.css({ left: "0px" }),
3900              b.body.append(g),
3901              b.railh &&
3902                (m.css({ position: "fixed", left: "0px", width: "100%" }),
3903                m.align ? m.css({ bottom: "0px" }) : m.css({ top: "0px" }),
3904                b.body.append(m)))
3905            : (b.ishwscroll
3906                ? ("static" == b.win.css("position") &&
3907                    b.css(b.win, { position: "relative" }),
3908                  (d = "HTML" == b.win[0].nodeName ? b.body : b.win),
3909                  b.zoom &&
3910                    (b.zoom.css({
3911                      position: "absolute",
3912                      top: 1,
3913                      right: 0,
3914                      "margin-right": g.width + 4,
3915                    }),
3916                    d.append(b.zoom)),
3917                  g.css({ position: "absolute", top: 0 }),
3918                  g.align ? g.css({ right: 0 }) : g.css({ left: 0 }),
3919                  d.append(g),
3920                  m &&
3921                    (m.css({ position: "absolute", left: 0, bottom: 0 }),
3922                    m.align ? m.css({ bottom: 0 }) : m.css({ top: 0 }),
3923                    d.append(m)))
3924                : ((b.isfixed = "fixed" == b.win.css("position")),
3925                  (d = b.isfixed ? "fixed" : "absolute"),
3926                  b.isfixed || (b.viewport = b.getViewport(b.win[0])),
3927                  b.viewport &&
3928                    ((b.body = b.viewport),
3929                    !1 ==
3930                      /fixed|relative|absolute/.test(
3931                        b.viewport.css("position")
3932                      ) && b.css(b.viewport, { position: "relative" })),
3933                  g.css({ position: d }),
3934                  b.zoom && b.zoom.css({ position: d }),
3935                  b.updateScrollBar(),
3936                  b.body.append(g),
3937                  b.zoom && b.body.append(b.zoom),
3938                  b.railh && (m.css({ position: d }), b.body.append(m))),
3939              f.isios &&
3940                b.css(b.win, {
3941                  "-webkit-tap-highlight-color": "rgba(0,0,0,0)",
3942                  "-webkit-touch-callout": "none",
3943                }),
3944              f.isie && b.opt.disableoutline && b.win.attr("hideFocus", "true"),
3945              f.iswebkit &&
3946                b.opt.disableoutline &&
3947                b.win.css({ outline: "none" }));
3948          !1 === b.opt.autohidemode
3949            ? ((b.autohidedom = !1),
3950              b.rail.css({ opacity: b.opt.cursoropacitymax }),
3951              b.railh && b.railh.css({ opacity: b.opt.cursoropacitymax }))
3952            : !0 === b.opt.autohidemode || "leave" === b.opt.autohidemode
3953            ? ((b.autohidedom = e().add(b.rail)),
3954              f.isie8 && (b.autohidedom = b.autohidedom.add(b.cursor)),
3955              b.railh && (b.autohidedom = b.autohidedom.add(b.railh)),
3956              b.railh &&
3957                f.isie8 &&
3958                (b.autohidedom = b.autohidedom.add(b.cursorh)))
3959            : "scroll" == b.opt.autohidemode
3960            ? ((b.autohidedom = e().add(b.rail)),
3961              b.railh && (b.autohidedom = b.autohidedom.add(b.railh)))
3962            : "cursor" == b.opt.autohidemode
3963            ? ((b.autohidedom = e().add(b.cursor)),
3964              b.railh && (b.autohidedom = b.autohidedom.add(b.cursorh)))
3965            : "hidden" == b.opt.autohidemode &&
3966              ((b.autohidedom = !1), b.hide(), (b.locked = !1));
3967          if (f.isie9mobile)
3968            (b.scrollmom = new J(b)),
3969              (b.onmangotouch = function (d) {
3970                d = b.getScrollTop();
3971                var c = b.getScrollLeft();
3972                if (
3973                  d == b.scrollmom.lastscrolly &&
3974                  c == b.scrollmom.lastscrollx
3975                )
3976                  return !0;
3977                var g = d - b.mangotouch.sy,
3978                  f = c - b.mangotouch.sx;
3979                if (
3980                  0 != Math.round(Math.sqrt(Math.pow(f, 2) + Math.pow(g, 2)))
3981                ) {
3982                  var n = 0 > g ? -1 : 1,
3983                    e = 0 > f ? -1 : 1,
3984                    h = +new Date();
3985                  b.mangotouch.lazy && clearTimeout(b.mangotouch.lazy);
3986                  80 < h - b.mangotouch.tm ||
3987                  b.mangotouch.dry != n ||
3988                  b.mangotouch.drx != e
3989                    ? (b.scrollmom.stop(),
3990                      b.scrollmom.reset(c, d),
3991                      (b.mangotouch.sy = d),
3992                      (b.mangotouch.ly = d),
3993                      (b.mangotouch.sx = c),
3994                      (b.mangotouch.lx = c),
3995                      (b.mangotouch.dry = n),
3996                      (b.mangotouch.drx = e),
3997                      (b.mangotouch.tm = h))
3998                    : (b.scrollmom.stop(),
3999                      b.scrollmom.update(
4000                        b.mangotouch.sx - f,
4001                        b.mangotouch.sy - g
4002                      ),
4003                      (b.mangotouch.tm = h),
4004                      (g = Math.max(
4005                        Math.abs(b.mangotouch.ly - d),
4006                        Math.abs(b.mangotouch.lx - c)
4007                      )),
4008                      (b.mangotouch.ly = d),
4009                      (b.mangotouch.lx = c),
4010                      2 < g &&
4011                        (b.mangotouch.lazy = setTimeout(function () {
4012                          b.mangotouch.lazy = !1;
4013                          b.mangotouch.dry = 0;
4014                          b.mangotouch.drx = 0;
4015                          b.mangotouch.tm = 0;
4016                          b.scrollmom.doMomentum(30);
4017                        }, 100)));
4018                }
4019              }),
4020              (g = b.getScrollTop()),
4021              (m = b.getScrollLeft()),
4022              (b.mangotouch = {
4023                sy: g,
4024                ly: g,
4025                dry: 0,
4026                sx: m,
4027                lx: m,
4028                drx: 0,
4029                lazy: !1,
4030                tm: 0,
4031              }),
4032              b.bind(b.docscroll, "scroll", b.onmangotouch);
4033          else {
4034            if (
4035              f.cantouch ||
4036              b.istouchcapable ||
4037              b.opt.touchbehavior ||
4038              f.hasmstouch
4039            ) {
4040              b.scrollmom = new J(b);
4041              b.ontouchstart = function (d) {
4042                if (d.pointerType && 2 != d.pointerType) return !1;
4043                b.hasmoving = !1;
4044                if (!b.locked) {
4045                  if (f.hasmstouch)
4046                    for (var c = d.target ? d.target : !1; c; ) {
4047                      var g = e(c).getNiceScroll();
4048                      if (0 < g.length && g[0].me == b.me) break;
4049                      if (0 < g.length) return !1;
4050                      if ("DIV" == c.nodeName && c.id == b.id) break;
4051                      c = c.parentNode ? c.parentNode : !1;
4052                    }
4053                  b.cancelScroll();
4054                  if (
4055                    (c = b.getTarget(d)) &&
4056                    /INPUT/i.test(c.nodeName) &&
4057                    /range/i.test(c.type)
4058                  )
4059                    return b.stopPropagation(d);
4060                  !("clientX" in d) &&
4061                    "changedTouches" in d &&
4062                    ((d.clientX = d.changedTouches[0].clientX),
4063                    (d.clientY = d.changedTouches[0].clientY));
4064                  b.forcescreen &&
4065                    ((g = d),
4066                    (d = { original: d.original ? d.original : d }),
4067                    (d.clientX = g.screenX),
4068                    (d.clientY = g.screenY));
4069                  b.rail.drag = {
4070                    x: d.clientX,
4071                    y: d.clientY,
4072                    sx: b.scroll.x,
4073                    sy: b.scroll.y,
4074                    st: b.getScrollTop(),
4075                    sl: b.getScrollLeft(),
4076                    pt: 2,
4077                    dl: !1,
4078                  };
4079                  if (b.ispage || !b.opt.directionlockdeadzone)
4080                    b.rail.drag.dl = "f";
4081                  else {
4082                    var g = e(window).width(),
4083                      n = e(window).height(),
4084                      h = Math.max(
4085                        document.body.scrollWidth,
4086                        document.documentElement.scrollWidth
4087                      ),
4088                      l = Math.max(
4089                        document.body.scrollHeight,
4090                        document.documentElement.scrollHeight
4091                      ),
4092                      n = Math.max(0, l - n),
4093                      g = Math.max(0, h - g);
4094                    b.rail.drag.ck =
4095                      !b.rail.scrollable && b.railh.scrollable
4096                        ? 0 < n
4097                          ? "v"
4098                          : !1
4099                        : b.rail.scrollable && !b.railh.scrollable
4100                        ? 0 < g
4101                          ? "h"
4102                          : !1
4103                        : !1;
4104                    b.rail.drag.ck || (b.rail.drag.dl = "f");
4105                  }
4106                  b.opt.touchbehavior &&
4107                    b.isiframe &&
4108                    f.isie &&
4109                    ((g = b.win.position()),
4110                    (b.rail.drag.x += g.left),
4111                    (b.rail.drag.y += g.top));
4112                  b.hasmoving = !1;
4113                  b.lastmouseup = !1;
4114                  b.scrollmom.reset(d.clientX, d.clientY);
4115                  if (!f.cantouch && !this.istouchcapable && !f.hasmstouch) {
4116                    if (!c || !/INPUT|SELECT|TEXTAREA/i.test(c.nodeName))
4117                      return (
4118                        !b.ispage && f.hasmousecapture && c.setCapture(),
4119                        b.opt.touchbehavior
4120                          ? (c.onclick &&
4121                              !c._onclick &&
4122                              ((c._onclick = c.onclick),
4123                              (c.onclick = function (d) {
4124                                if (b.hasmoving) return !1;
4125                                c._onclick.call(this, d);
4126                              })),
4127                            b.cancelEvent(d))
4128                          : b.stopPropagation(d)
4129                      );
4130                    /SUBMIT|CANCEL|BUTTON/i.test(e(c).attr("type")) &&
4131                      ((pc = { tg: c, click: !1 }), (b.preventclick = pc));
4132                  }
4133                }
4134              };
4135              b.ontouchend = function (d) {
4136                if (d.pointerType && 2 != d.pointerType) return !1;
4137                if (
4138                  b.rail.drag &&
4139                  2 == b.rail.drag.pt &&
4140                  (b.scrollmom.doMomentum(),
4141                  (b.rail.drag = !1),
4142                  b.hasmoving &&
4143                    ((b.lastmouseup = !0),
4144                    b.hideCursor(),
4145                    f.hasmousecapture && document.releaseCapture(),
4146                    !f.cantouch))
4147                )
4148                  return b.cancelEvent(d);
4149              };
4150              var t = b.opt.touchbehavior && b.isiframe && !f.hasmousecapture;
4151              b.ontouchmove = function (d, c) {
4152                if (d.pointerType && 2 != d.pointerType) return !1;
4153                if (b.rail.drag && 2 == b.rail.drag.pt) {
4154                  if (f.cantouch && "undefined" == typeof d.original) return !0;
4155                  b.hasmoving = !0;
4156                  b.preventclick &&
4157                    !b.preventclick.click &&
4158                    ((b.preventclick.click = b.preventclick.tg.oncl
4158ick || !1),
4159                    (b.preventclick.tg.onclick = b.onpreventclick));
4160                  d = e.extend({ original: d }, d);
4161                  "changedTouches" in d &&
4162                    ((d.clientX = d.changedTouches[0].clientX),
4163                    (d.clientY = d.changedTouches[0].clientY));
4164                  if (b.forcescreen) {
4165                    var g = d;
4166                    d = { original: d.original ? d.original : d };
4167                    d.clientX = g.screenX;
4168                    d.clientY = g.screenY;
4169                  }
4170                  g = ofy = 0;
4171                  if (t && !c) {
4172                    var n = b.win.position(),
4173                      g = -n.left;
4174                    ofy = -n.top;
4175                  }
4176                  var h = d.clientY + ofy,
4177                    n = h - b.rail.drag.y,
4178                    l = d.clientX + g,
4179                    k = l - b.rail.drag.x,
4180                    r = b.rail.drag.st - n;
4181                  b.ishwscroll && b.opt.bouncescroll
4182                    ? 0 > r
4183                      ? (r = Math.round(r / 2))
4184                      : r > b.page.maxh &&
4185                        (r = b.page.maxh + Math.round((r - b.page.maxh) / 2))
4186                    : (0 > r && (h = r = 0),
4187                      r > b.page.maxh && ((r = b.page.maxh), (h = 0)));
4188                  if (b.railh && b.railh.scrollable) {
4189                    var m = b.rail.drag.sl - k;
4190                    b.ishwscroll && b.opt.bouncescroll
4191                      ? 0 > m
4192                        ? (m = Math.round(m / 2))
4193                        : m > b.page.maxw &&
4194                          (m = b.page.maxw + Math.round((m - b.page.maxw) / 2))
4195                      : (0 > m && (l = m = 0),
4196                        m > b.page.maxw && ((m = b.page.maxw), (l = 0)));
4197                  }
4198                  g = !1;
4199                  if (b.rail.drag.dl)
4200                    (g = !0),
4201                      "v" == b.rail.drag.dl
4202                        ? (m = b.rail.drag.sl)
4203                        : "h" == b.rail.drag.dl && (r = b.rail.drag.st);
4204                  else {
4205                    var n = Math.abs(n),
4206                      k = Math.abs(k),
4207                      x = b.opt.directionlockdeadzone;
4208                    if ("v" == b.rail.drag.ck) {
4209                      if (n > x && k <= 0.3 * n) return (b.rail.drag = !1), !0;
4210                      k > x &&
4211                        ((b.rail.drag.dl = "f"),
4212                        e("body").scrollTop(e("body").scrollTop()));
4213                    } else if ("h" == b.rail.drag.ck) {
4214                      if (k > x && n <= 0.3 * k) return (b.rail.drag = !1), !0;
4215                      n > x &&
4216                        ((b.rail.drag.dl = "f"),
4217                        e("body").scrollLeft(e("body").scrollLeft()));
4218                    }
4219                  }
4220                  b.synched("touchmove", function () {
4221                    b.rail.drag &&
4222                      2 == b.rail.drag.pt &&
4223                      (b.prepareTransition && b.prepareTransition(0),
4224                      b.rail.scrollable && b.setScrollTop(r),
4225                      b.scrollmom.update(l, h),
4226                      b.railh && b.railh.scrollable
4227                        ? (b.setScrollLeft(m), b.showCursor(r, m))
4228                        : b.showCursor(r),
4229                      f.isie10 && document.selection.clear());
4230                  });
4231                  f.ischrome && b.istouchcapable && (g = !1);
4232                  if (g) return b.cancelEvent(d);
4233                }
4234              };
4235            }
4236            b.onmousedown = function (d, c) {
4237              if (!(b.rail.drag && 1 != b.rail.drag.pt)) {
4238                if (b.locked) return b.cancelEvent(d);
4239                b.cancelScroll();
4240                b.rail.drag = {
4241                  x: d.clientX,
4242                  y: d.clientY,
4243                  sx: b.scroll.x,
4244                  sy: b.scroll.y,
4245                  pt: 1,
4246                  hr: !!c,
4247                };
4248                var g = b.getTarget(d);
4249                !b.ispage && f.hasmousecapture && g.setCapture();
4250                b.isiframe &&
4251                  !f.hasmousecapture &&
4252                  ((b.saved.csspointerevents = b.doc.css("pointer-events")),
4253                  b.css(b.doc, { "pointer-events": "none" }));
4254                return b.cancelEvent(d);
4255              }
4256            };
4257            b.onmouseup = function (d) {
4258              if (
4259                b.rail.drag &&
4260                (f.hasmousecapture && document.releaseCapture(),
4261                b.isiframe &&
4262                  !f.hasmousecapture &&
4263                  b.doc.css("pointer-events", b.saved.csspointerevents),
4264                1 == b.rail.drag.pt)
4265              )
4266                return (b.rail.drag = !1), b.cancelEvent(d);
4267            };
4268            b.onmousemove = function (d) {
4269              if (b.rail.drag && 1 == b.rail.drag.pt) {
4270                if (f.ischrome && 0 == d.which) return b.onmouseup(d);
4271                b.cursorfreezed = !0;
4272                if (b.rail.drag.hr) {
4273                  b.scroll.x = b.rail.drag.sx + (d.clientX - b.rail.drag.x);
4274                  0 > b.scroll.x && (b.scroll.x = 0);
4275                  var c = b.scrollvaluemaxw;
4276                  b.scroll.x > c && (b.scroll.x = c);
4277                } else
4278                  (b.scroll.y = b.rail.drag.sy + (d.clientY - b.rail.drag.y)),
4279                    0 > b.scroll.y && (b.scroll.y = 0),
4280                    (c = b.scrollvaluemax),
4281                    b.scroll.y > c && (b.scroll.y = c);
4282                b.synched("mousemove", function () {
4283                  b.rail.drag &&
4284                    1 == b.rail.drag.pt &&
4285                    (b.showCursor(),
4286                    b.rail.drag.hr
4287                      ? b.doScrollLeft(
4288                          Math.round(b.scroll.x * b.scrollratio.x),
4289                          b.opt.cursordragspeed
4290                        )
4291                      : b.doScrollTop(
4292                          Math.round(b.scroll.y * b.scrollratio.y),
4293                          b.opt.cursordragspeed
4294                        ));
4295                });
4296                return b.cancelEvent(d);
4297              }
4298            };
4299            if (f.cantouch || b.opt.touchbehavior)
4300              (b.onpreventclick = function (d) {
4301                if (b.preventclick)
4302                  return (
4303                    (b.preventclick.tg.onclick = b.preventclick.click),
4304                    (b.preventclick = !1),
4305                    b.cancelEvent(d)
4306                  );
4307              }),
4308                b.bind(b.win, "mousedown", b.ontouchstart),
4309                (b.onclick = f.isios
4310                  ? !1
4311                  : function (d) {
4312                      return b.lastmouseup
4313                        ? ((b.lastmouseup = !1), b.cancelEvent(d))
4314                        : !0;
4315                    }),
4316                b.opt.grabcursorenabled &&
4317                  f.cursorgrabvalue &&
4318                  (b.css(b.ispage ? b.doc : b.win, {
4319                    cursor: f.cursorgrabvalue,
4320                  }),
4321                  b.css(b.rail, { cursor: f.cursorgrabvalue }));
4322            else {
4323              var p = function (d) {
4324                if (b.selectiondrag) {
4325                  if (d) {
4326                    var c = b.win.outerHeight();
4327                    d = d.pageY - b.selectiondrag.top;
4328                    0 < d && d < c && (d = 0);
4329                    d >= c && (d -= c);
4330                    b.selectiondrag.df = d;
4331                  }
4332                  0 != b.selectiondrag.df &&
4333                    (b.doScrollBy(2 * -Math.floor(b.selectiondrag.df / 6)),
4334                    b.debounced(
4335                      "doselectionscroll",
4336                      function () {
4337                        p();
4338                      },
4339                      50
4340                    ));
4341                }
4342              };
4343              b.hasTextSelected =
4344                "getSelection" in document
4345                  ? function () {
4346                      return 0 < document.getSelection().rangeCount;
4347                    }
4348                  : "selection" in document
4349                  ? function () {
4350                      return "None" != document.selection.type;
4351                    }
4352                  : function () {
4353                      return !1;
4354                    };
4355              b.onselectionstart = function (d) {
4356                b.ispage || (b.selectiondrag = b.win.offset());
4357              };
4358              b.onselectionend = function (d) {
4359                b.selectiondrag = !1;
4360              };
4361              b.onselectiondrag = function (d) {
4362                b.selectiondrag &&
4363                  b.hasTextSelected() &&
4364                  b.debounced(
4365                    "selectionscroll",
4366                    function () {
4367                      p(d);
4368                    },
4369                    250
4370                  );
4371              };
4372            }
4373            f.hasmstouch &&
4374              (b.css(b.rail, { "-ms-touch-action": "none" }),
4375              b.css(b.cursor, { "-ms-touch-action": "none" }),
4376              b.bind(b.win, "MSPointerDown", b.ontouchstart),
4377              b.bind(document, "MSPointerUp", b.ontouchend),
4378              b.bind(document, "MSPointerMove", b.ontouchmove),
4379              b.bind(b.cursor, "MSGestureHold", function (b) {
4380                b.preventDefault();
4381              }),
4382              b.bind(b.cursor, "contextmenu", function (b) {
4383                b.preventDefault();
4384              }));
4385            this.istouchcapable &&
4386              (b.bind(b.win, "touchstart", b.ontouchstart),
4387              b.bind(document, "touchend", b.ontouchend),
4388              b.bind(document, "touchcancel", b.ontouchend),
4389              b.bind(document, "touchmove", b.ontouchmove));
4390            b.bind(b.cursor, "mousedown", b.onmousedown);
4391            b.bind(b.cursor, "mouseup", b.onmouseup);
4392            b.railh &&
4393              (b.bind(b.cursorh, "mousedown", function (d) {
4394                b.onmousedown(d, !0);
4395              }),
4396              b.bind(b.cursorh, "mouseup", function (d) {
4397                if (!(b.rail.drag && 2 == b.rail.drag.pt))
4398                  return (
4399                    (b.rail.drag = !1),
4400                    (b.hasmoving = !1),
4401                    b.hideCursor(),
4402                    f.hasmousecapture && document.releaseCapture(),
4403                    b.cancelEvent(d)
4404                  );
4405              }));
4406            if (
4407              b.opt.cursordragontouch ||
4408              (!f.cantouch && !b.opt.touchbehavior)
4409            )
4410              b.rail.css({ cursor: "default" }),
4411                b.railh && b.railh.css({ cursor: "default" }),
4412                b.jqbind(b.rail, "mouseenter", function () {
4413                  b.canshowonmouseevent && b.showCursor();
4414                  b.rail.active = !0;
4415                }),
4416                b.jqbind(b.rail, "mouseleave", function () {
4417                  b.rail.active = !1;
4418                  b.rail.drag || b.hideCursor();
4419                }),
4420                b.opt.sensitiverail &&
4421                  (b.bind(b.rail, "click", function (d) {
4422                    b.doRailClick(d, !1, !1);
4423                  }),
4424                  b.bind(b.rail, "dblclick", function (d) {
4425                    b.doRailClick(d, !0, !1);
4426                  }),
4427                  b.bind(b.cursor, "click", function (d) {
4428                    b.cancelEvent(d);
4429                  }),
4430                  b.bind(b.cursor, "dblclick", function (d) {
4431                    b.cancelEvent(d);
4432                  })),
4433                b.railh &&
4434                  (b.jqbind(b.railh, "mouseenter", function () {
4435                    b.canshowonmouseevent && b.showCursor();
4436                    b.rail.active = !0;
4437                  }),
4438                  b.jqbind(b.railh, "mouseleave", function () {
4439                    b.rail.active = !1;
4440                    b.rail.drag || b.hideCursor();
4441                  }),
4442                  b.opt.sensitiverail &&
4443                    (b.bind(b.railh, "click", function (d) {
4444                      b.doRailClick(d, !1, !0);
4445                    }),
4446                    b.bind(b.railh, "dblclick", function (d) {
4447                      b.doRailClick(d, !0, !0);
4448                    }),
4449                    b.bind(b.cursorh, "click", function (d) {
4450                      b.cancelEvent(d);
4451                    }),
4452                    b.bind(b.cursorh, "dblclick", function (d) {
4453                      b.cancelEvent(d);
4454                    })));
4455            !f.cantouch && !b.opt.touchbehavior
4456              ? (b.bind(
4457                  f.hasmousecapture ? b.win : document,
4458                  "mouseup",
4459                  b.onmouseup
4460                ),
4461                b.bind(document, "mousemove", b.onmousemove),
4462                b.onclick && b.bind(document, "click", b.onclick),
4463                !b.ispage &&
4464                  b.opt.enablescrollonselection &&
4465                  (b.bind(b.win[0], "mousedown", b.onselectionstart),
4466                  b.bind(document, "mouseup", b.onselectionend),
4467                  b.bind(b.cursor, "mouseup", b.onselectionend),
4468                  b.cursorh && b.bind(b.cursorh, "mouseup", b.onselectionend),
4469                  b.bind(document, "mousemove", b.onselectiondrag)),
4470                b.zoom &&
4471                  (b.jqbind(b.zoom, "mouseenter", function () {
4472                    b.canshowonmouseevent && b.showCursor();
4473                    b.rail.active = !0;
4474                  }),
4475                  b.jqbind(b.zoom, "mouseleave", function () {
4476                    b.rail.active = !1;
4477                    b.rail.drag || b.hideCursor();
4478                  })))
4479              : (b.bind(
4480                  f.hasmousecapture ? b.win : document,
4481                  "mouseup",
4482                  b.ontouchend
4483                ),
4484                b.bind(document, "mousemove", b.ontouchmove),
4485                b.onclick && b.bind(document, "click", b.onclick),
4486                b.opt.cursordragontouch &&
4487                  (b.bind(b.cursor, "mousedown", b.onmousedown),
4488                  b.bind(b.cursor, "mousemove", b.onmousemove),
4489                  b.cursorh &&
4490                    b.bind(b.cursorh, "mousedown", function (d) {
4491                      b.onmousedown(d, !0);
4492                    }),
4493                  b.cursorh && b.bind(b.cursorh, "mousemove", b.onmousemove)));
4494            b.opt.enablemousewheel &&
4495              (b.isiframe ||
4496                b.bind(
4497                  f.isie && b.ispage ? document : b.win,
4498                  "mousewheel",
4499                  b.onmousewheel
4500                ),
4501              b.bind(b.rail, "mousewheel", b.onmousewheel),
4502              b.railh && b.bind(b.railh, "mousewheel", b.onmousewheelhr));
4503            !b.ispage &&
4504              !f.cantouch &&
4505              !/HTML|BODY/.test(b.win[0].nodeName) &&
4506              (b.win.attr("tabindex") || b.win.attr({ tabindex: L++ }),
4507              b.jqbind(b.win, "focus", function (d) {
4508                z = b.getTarget(d).id || !0;
4509                b.hasfocus = !0;
4510                b.canshowonmouseevent && b.noticeCursor();
4511              }),
4512              b.jqbind(b.win, "blur", function (d) {
4513                z = !1;
4514                b.hasfocus = !1;
4515              }),
4516              b.jqbind(b.win, "mouseenter", function (d) {
4517                E = b.getTarget(d).id || !0;
4518                b.hasmousefocus = !0;
4519                b.canshowonmouseevent && b.noticeCursor();
4520              }),
4521              b.jqbind(b.win, "mouseleave", function () {
4522                E = !1;
4523                b.hasmousefocus = !1;
4524                b.rail.drag || b.hideCursor();
4525              }));
4526          }
4527          b.onkeypress = function (d) {
4528            if (b.locked && 0 == b.page.maxh) return !0;
4529            d = d ? d : window.e;
4530            var c = b.getTarget(d);
4531            if (
4532              c &&
4533              /INPUT|TEXTAREA|SELECT|OPTION/.test(c.nodeName) &&
4534              ((!c.getAttribute("type") && !c.type) ||
4535                !/submit|button|cancel/i.tp)
4536            )
4537              return !0;
4538            if (
4539              b.hasfocus ||
4540              (b.hasmousefocus && !z) ||
4541              (b.ispage && !z && !E)
4542            ) {
4543              c = d.keyCode;
4544              if (b.locked && 27 != c) return b.cancelEvent(d);
4545              var g = d.ctrlKey || !1,
4546                n = d.shiftKey || !1,
4547                f = !1;
4548              switch (c) {
4549                case 38:
4550                case 63233:
4551                  b.doScrollBy(72);
4552                  f = !0;
4553                  break;
4554                case 40:
4555                case 63235:
4556                  b.doScrollBy(-72);
4557                  f = !0;
4558                  break;
4559                case 37:
4560                case 63232:
4561                  b.railh &&
4562                    (g ? b.doScrollLeft(0) : b.doScrollLeftBy(72), (f = !0));
4563                  break;
4564                case 39:
4565                case 63234:
4566                  b.railh &&
4567                    (g ? b.doScrollLeft(b.page.maxw) : b.doScrollLeftBy(-72),
4568                    (f = !0));
4569                  break;
4570                case 33:
4571                case 63276:
4572                  b.doScrollBy(b.view.h);
4573                  f = !0;
4574                  break;
4575                case 34:
4576                case 63277:
4577                  b.doScrollBy(-b.view.h);
4578                  f = !0;
4579                  break;
4580                case 36:
4581                case 63273:
4582                  b.railh && g ? b.doScrollPos(0, 0) : b.doScrollTo(0);
4583                  f = !0;
4584                  break;
4585                case 35:
4586                case 63275:
4587                  b.railh && g
4588                    ? b.doScrollPos(b.page.maxw, b.page.maxh)
4589                    : b.doScrollTo(b.page.maxh);
4590                  f = !0;
4591                  break;
4592                case 32:
4593                  b.opt.spacebarenabled &&
4594                    (n ? b.doScrollBy(b.view.h) : b.doScrollBy(-b.view.h),
4595                    (f = !0));
4596                  break;
4597                case 27:
4598                  b.zoomactive && (b.doZoom(), (f = !0));
4599              }
4600              if (f) return b.cancelEvent(d);
4601            }
4602          };
4603          b.opt.enablekeyboard &&
4604            b.bind(
4605              document,
4606              f.isopera && !f.isopera12 ? "keypress" : "keydown",
4607              b.onkeypress
4608            );
4609          b.bind(window, "resize", b.lazyResize);
4610          b.bind(window, "orientationchange", b.lazyResize);
4611          b.bind(window, "load", b.lazyResize);
4612          if (f.ischrome && !b.ispage && !b.haswrapper) {
4613            var s = b.win.attr("style"),
4614              g = parseFloat(b.win.css("width")) + 1;
4615            b.win.css("width", g);
4616            b.synched("chromefix", function () {
4617              b.win.attr("style", s);
4618            });
4619          }
4620          b.onAttributeChange = function (d) {
4621            b.lazyResize(250);
4622          };
4623          !b.ispage &&
4624            !b.haswrapper &&
4625            (!1 !== A
4626              ? ((b.observer = new A(function (d) {
4627                  d.forEach(b.onAttributeChange);
4628                })),
4629                b.observer.observe(b.win[0], {
4630                  childList: !0,
4631                  characterData: !1,
4632                  attributes: !0,
4633                  subtree: !1,
4634                }),
4635                (b.observerremover = new A(function (d) {
4636                  d.forEach(function (d) {
4637                    if (0 < d.removedNodes.length)
4638                      for (var c in d.removedNodes)
4639                        if (d.removedNodes[c] == b.win[0]) return b.remove();
4640                  });
4641                })),
4642                b.observerremover.observe(b.win[0].parentNode, {
4643                  childList: !0,
4644                  characterData: !1,
4645                  attributes: !1,
4646                  subtree: !1,
4647                }))
4648              : (b.bind(
4649                  b.win,
4650                  f.isie && !f.isie9 ? "propertychange" : "DOMAttrModified",
4651                  b.onAttributeChange
4652                ),
4653                f.isie9 &&
4654                  b.win[0].attachEvent("onpropertychange", b.onAttributeChange),
4655                b.bind(b.win, "DOMNodeRemoved", function (d) {
4656                  d.target == b.win[0] && b.remove();
4657                })));
4658          !b.ispage && b.opt.boxzoom && b.bind(window, "resize", b.resizeZoom);
4659          b.istextarea && b.bind(b.win, "mouseup", b.lazyResize);
4660          b.checkrtlmode = !0;
4661          b.lazyResize(30);
4662        }
4663        if ("IFRAME" == this.doc[0].nodeName) {
4664          var K = function (d) {
4665            b.iframexd = !1;
4666            try {
4667              var c =
4668                "contentDocument" in this
4669                  ? this.contentDocument
4670                  : this.contentWindow.document;
4671            } catch (g) {
4672              (b.iframexd = !0), (c = !1);
4673            }
4674            if (b.iframexd)
4675              return (
4676                "console" in window &&
4677                  console.log("NiceScroll error: policy restriced iframe"),
4678                !0
4679              );
4680            b.forcescreen = !0;
4681            b.isiframe &&
4682              ((b.iframe = {
4683                doc: e(c),
4684                html: b.doc.contents().find("html")[0],
4685                body: b.doc.contents().find("body")[0],
4686              }),
4687              (b.getContentSize = function () {
4688                return {
4689                  w: Math.max(
4690                    b.iframe.html.scrollWidth,
4691                    b.iframe.body.scrollWidth
4692                  ),
4693                  h: Math.max(
4694                    b.iframe.html.scrollHeight,
4695                    b.iframe.body.scrollHeight
4696                  ),
4697                };
4698              }),
4699              (b.docscroll = e(b.iframe.body)));
4700            !f.isios &&
4701              b.opt.iframeautoresize &&
4702              !b.isiframe &&
4703              (b.win.scrollTop(0),
4704              b.doc.height(""),
4705              (d = Math.max(
4706                c.getElementsByTagName("html")[0].scrollHeight,
4707                c.body.scrollHeight
4708              )),
4709              b.doc.height(d));
4710            b.lazyResize(30);
4711            f.isie7 && b.css(e(b.iframe.html), { "overflow-y": "hidden" });
4712            b.css(e(b.iframe.body), { "overflow-y": "hidden" });
4713            f.isios &&
4714              b.haswrapper &&
4715              b.css(e(c.body), { "-webkit-transform": "translate3d(0,0,0)" });
4716            "contentWindow" in this
4717              ? b.bind(this.contentWindow, "scroll", b.onscroll)
4718              : b.bind(c, "scroll", b.onscroll);
4719            b.opt.enablemousewheel && b.bind(c, "mousewheel", b.onmousewheel);
4720            b.opt.enablekeyboard &&
4721              b.bind(c, f.isopera ? "keypress" : "keydown", b.onkeypress);
4722            if (f.cantouch || b.opt.touchbehavior)
4723              b.bind(c, "mousedown", b.ontouchstart),
4724                b.bind(c, "mousemove", function (d) {
4725                  b.ontouchmove(d, !0);
4726                }),
4727                b.opt.grabcursorenabled &&
4728                  f.cursorgrabvalue &&
4729                  b.css(e(c.body), { cursor: f.cursorgrabvalue });
4730            b.bind(c, "mouseup", b.ontouchend);
4731            b.zoom &&
4732              (b.opt.dblclickzoom && b.bind(c, "dblclick", b.doZoom),
4733              b.ongesturezoom && b.bind(c, "gestureend", b.ongesturezoom));
4734          };
4735          this.doc[0].readyState &&
4736            "complete" == this.doc[0].readyState &&
4737            setTimeout(function () {
4738              K.call(b.doc[0], !1);
4739            }, 500);
4740          b.bind(this.doc, "load", K);
4741        }
4742      };
4743      this.showCursor = function (d, c) {
4744        b.cursortimeout &&
4745          (clearTimeout(b.cursortimeout), (b.cursortimeout = 0));
4746        if (b.rail) {
4747          b.autohidedom &&
4748            (b.autohidedom.stop().css({ opacity: b.opt.cursoropacitymax }),
4749            (b.cursoractive = !0));
4750          if (!b.rail.drag || 1 != b.rail.drag.pt)
4751            "undefined" != typeof d &&
4752              !1 !== d &&
4753              (b.scroll.y = Math.round((1 * d) / b.scrollratio.y)),
4754              "undefined" != typeof c &&
4755                (b.scroll.x = Math.round((1 * c) / b.scrollratio.x));
4756          b.cursor.css({ height: b.cursorheight, top: b.scroll.y });
4757          b.cursorh &&
4758            (!b.rail.align && b.rail.visibility
4759              ? b.cursorh.css({
4760                  width: b.cursorwidth,
4761                  left: b.scroll.x + b.rail.width,
4762                })
4763              : b.cursorh.css({ width: b.cursorwidth, left: b.scroll.x }),
4764            (b.cursoractive = !0));
4765          b.zoom && b.zoom.stop().css({ opacity: b.opt.cursoropacitymax });
4766        }
4767      };
4768      this.hideCursor = function (d) {
4769        !b.cursortimeout &&
4770          b.rail &&
4771          b.autohidedom &&
4772          !(b.hasmousefocus && "leave" == b.opt.autohidemode) &&
4773          (b.cursortimeout = setTimeout(function () {
4774            if (!b.rail.active || !b.showonmouseevent)
4775              b.autohidedom.stop().animate({ opacity: b.opt.cursoropacitymin }),
4776                b.zoom &&
4777                  b.zoom.stop().animate({ opacity: b.opt.cursoropacitymin }),
4778                (b.cursoractive = !1);
4779            b.cursortimeout = 0;
4780          }, d || b.opt.hidecursordelay));
4781      };
4782      this.noticeCursor = function (d, c, g) {
4783        b.showCursor(c, g);
4784        b.rail.active || b.hideCursor(d);
4785      };
4786      this.getContentSize = b.ispage
4787        ? function () {
4788            return {
4789              w: Math.max(
4790                document.body.scrollWidth,
4791                document.documentElement.scrollWidth
4792              ),
4793              h: Math.max(
4794                document.body.scrollHeight,
4795                document.documentElement.scrollHeight
4796              ),
4797            };
4798          }
4799        : b.haswrapper
4800        ? function () {
4801            return {
4802              w:
4803                b.doc.outerWidth() +
4804                parseInt(b.win.css("paddingLeft")) +
4805                parseInt(b.win.css("paddingRight")),
4806              h:
4807                b.doc.outerHeight() +
4808                parseInt(b.win.css("paddingTop")) +
4809                parseInt(b.win.css("paddingBottom")),
4810            };
4811          }
4812        : function () {
4813            return {
4814              w: b.docscroll[0].scrollWidth,
4815              h: b.docscroll[0].scrollHeight,
4816            };
4817          };
4818      this.onResize = function (d, c) {
4819        if (!b || !b.win) return !1;
4820        if (!b.haswrapper && !b.ispage) {
4821          if ("none" == b.win.css("display"))
4822            return b.visibility && b.hideRail().hideRailHr(), !1;
4823          !b.hidden && !b.visibility && b.showRail().showRailHr();
4824        }
4825        var g = b.page.maxh,
4826          f = b.page.maxw,
4827          e = b.view.w;
4828        b.view = {
4829          w: b.ispage ? b.win.width() : parseInt(b.win[0].clientWidth),
4830          h: b.ispage ? b.win.height() : parseInt(b.win[0].clientHeight),
4831        };
4832        b.page = c ? c : b.getContentSize();
4833        b.page.maxh = Math.max(0, b.page.h - b.view.h);
4834        b.page.maxw = Math.max(0, b.page.w - b.view.w);
4835        if (b.page.maxh == g && b.page.maxw == f && b.view.w == e) {
4836          if (b.ispage) return b;
4837          g = b.win.offset();
4838          if (
4839            b.lastposition &&
4840            ((f = b.lastposition), f.top == g.top && f.left == g.left)
4841          )
4842            return b;
4843          b.lastposition = g;
4844        }
4845        0 == b.page.maxh
4846          ? (b.hideRail(),
4847            (b.scrollvaluemax = 0),
4848            (b.scroll.y = 0),
4849            (b.scrollratio.y = 0),
4850            (b.cursorheight = 0),
4851            b.setScrollTop(0),
4852            (b.rail.scrollable = !1))
4853          : (b.rail.scrollable = !0);
4854        0 == b.page.maxw
4855          ? (b.hideRailHr(),
4856            (b.scrollvaluemaxw = 0),
4857            (b.scroll.x = 0),
4858            (b.scrollratio.x = 0),
4859            (b.cursorwidth = 0),
4860            b.setScrollLeft(0),
4861            (b.railh.scrollable = !1))
4862          : (b.railh.scrollable = !0);
4863        b.locked = 0 == b.page.maxh && 0 == b.page.maxw;
4864        if (b.locked) return b.ispage || b.updateScrollBar(b.view), !1;
4865        !b.hidden && !b.visibility
4866          ? b.showRail().showRailHr()
4867          : !b.hidden && !b.railh.visibility && b.showRailHr();
4868        b.istextarea &&
4869          b.win.css("resize") &&
4870          "none" != b.win.css("resize") &&
4871          (b.view.h -= 20);
4872        b.cursorheight = Math.min(
4873          b.view.h,
4874          Math.round(b.view.h * (b.view.h / b.page.h))
4875        );
4876        b.cursorheight = b.opt.cursorfixedheight
4877          ? b.opt.cursorfixedheight
4878          : Math.max(b.opt.cursorminheight, b.cursorheight);
4879        b.cursorwidth = Math.min(
4880          b.view.w,
4881          Math.round(b.view.w * (b.view.w / b.page.w))
4882        );
4883        b.cursorwidth = b.opt.cursorfixedheight
4884          ? b.opt.cursorfixedheight
4885          : Math.max(b.opt.cursorminheight, b.cursorwidth);
4886        b.scrollvaluemax = b.view.h - b.cursorheight - b.cursor.hborder;
4887        b.railh &&
4888          ((b.railh.width =
4889            0 < b.page.maxh ? b.view.w - b.rail.width : b.view.w),
4890          (b.scrollvaluemaxw =
4891            b.railh.width - b.cursorwidth - b.cursorh.wborder));
4892        b.checkrtlmode &&
4893          b.railh &&
4894          ((b.checkrtlmode = !1),
4895          b.opt.rtlmode && 0 == b.scroll.x && b.setScrollLeft(b.page.maxw));
4896        b.ispage || b.updateScrollBar(b.view);
4897        b.scrollratio = {
4898          x: b.page.maxw / b.scrollvaluemaxw,
4899          y: b.page.maxh / b.scrollvaluemax,
4900        };
4901        b.getScrollTop() > b.page.maxh
4902          ? b.doScrollTop(b.page.maxh)
4903          : ((b.scroll.y = Math.round(
4904              b.getScrollTop() * (1 / b.scrollratio.y)
4905            )),
4906            (b.scroll.x = Math.round(
4907              b.getScrollLeft() * (1 / b.scrollratio.x)
4908            )),
4909            b.cursoractive && b.noticeCursor());
4910        b.scroll.y &&
4911          0 == b.getScrollTop() &&
4912          b.doScrollTo(Math.floor(b.scroll.y * b.scrollratio.y));
4913        return b;
4914      };
4915      this.resize = b.onResize;
4916      this.lazyResize = function (d) {
4917        d = isNaN(d) ? 30 : d;
4918        b.delayed("resize", b.resize, d);
4919        return b;
4920      };
4921      this._bind = function (d, c, g, f) {
4922        b.events.push({ e: d, n: c, f: g, b: f, q: !1 });
4923        d.addEventListener
4924          ? d.addEventListener(c, g, f || !1)
4925          : d.attachEvent
4926          ? d.attachEvent("on" + c, g)
4927          : (d["on" + c] = g);
4928      };
4929      this.jqbind = function (d, c, g) {
4930        b.events.push({ e: d, n: c, f: g, q: !0 });
4931        e(d).bind(c, g);
4932      };
4933      this.bind = function (d, c, g, e) {
4934        var h = "jquery" in d ? d[0] : d;
4935        "mousewheel" == c
4936          ? "onwheel" in b.win
4937            ? b._bind(h, "wheel", g, e || !1)
4938            : ((d =
4939                "undefined" != typeof document.onmousewheel
4940                  ? "mousewheel"
4941                  : "DOMMouseScroll"),
4942              q(h, d, g, e || !1),
4943              "DOMMouseScroll" == d && q(h, "MozMousePixelScroll", g, e || !1))
4944          : h.addEventListener
4945          ? (f.cantouch &&
4946              /mouseup|mousedown|mousemove/.test(c) &&
4947              b._bind(
4948                h,
4949                "mousedown" == c
4950                  ? "touchstart"
4951                  : "mouseup" == c
4952                  ? "touchend"
4953                  : "touchmove",
4954                function (b) {
4955                  if (b.touches) {
4956                    if (2 > b.touches.length) {
4957                      var d = b.touches.length ? b.touches[0] : b;
4958                      d.original = b;
4959                      g.call(this, d);
4960                    }
4961                  } else
4962                    b.changedTouches &&
4963                      ((d = b.changedTouches[0]),
4964                      (d.original = b),
4965                      g.call(this, d));
4966                },
4967                e || !1
4968              ),
4969            b._bind(h, c, g, e || !1),
4970            f.cantouch &&
4971              "mouseup" == c &&
4972              b._bind(h, "touchcancel", g, e || !1))
4973          : b._bind(h, c, function (d) {
4974              if ((d = d || window.event || !1) && d.srcElement)
4975                d.target = d.srcElement;
4976              "pageY" in d ||
4977                ((d.pageX = d.clientX + document.documentElement.scrollLeft),
4978                (d.pageY = d.clientY + document.documentElement.scrollTop));
4979              return !1 === g.call(h, d) || !1 === e ? b.cancelEvent(d) : !0;
4980            });
4981      };
4982      this._unbind = function (b, c, g, f) {
4983        b.removeEventListener
4984          ? b.removeEventListener(c, g, f)
4985          : b.detachEvent
4986          ? b.detachEvent("on" + c, g)
4987          : (b["on" + c] = !1);
4988      };
4989      this.unbindAll = function () {
4990        for (var d = 0; d < b.events.length; d++) {
4991          var c = b.events[d];
4992          c.q ? c.e.unbind(c.n, c.f) : b._unbind(c.e, c.n, c.f, c.b);
4993        }
4994      };
4995      this.cancelEvent = function (b) {
4996        b = b.original ? b.original : b ? b : window.event || !1;
4997        if (!b) return !1;
4998        b.preventDefault && b.preventDefault();
4999        b.stopPropagation && b.stopPropagation();
5000        b.preventManipulation && b.preventManipulation();
5001        b.cancelBubble = !0;
5002        b.cancel = !0;
5003        return (b.returnValue = !1);
5004      };
5005      this.stopPropagation = function (b) {
5006        b = b.original ? b.original : b ? b : window.event || !1;
5007        if (!b) return !1;
5008        if (b.stopPropagation) return b.stopPropagation();
5009        b.cancelBubble && (b.cancelBubble = !0);
5010        return !1;
5011      };
5012      this.showRail = function () {
5013        if (0 != b.page.maxh && (b.ispage || "none" != b.win.css("display")))
5014          (b.visibility = !0),
5015            (b.rail.visibility = !0),
5016            b.rail.css("display", "block");
5017        return b;
5018      };
5019      this.showRailHr = function () {
5020        if (!b.railh) return b;
5021        if (0 != b.page.maxw && (b.ispage || "none" != b.win.css("display")))
5022          (b.railh.visibility = !0), b.railh.css("display", "block");
5023        return b;
5024      };
5025      this.hideRail = function () {
5026        b.visibility = !1;
5027        b.rail.visibility = !1;
5028        b.rail.css("display", "none");
5029        return b;
5030      };
5031      this.hideRailHr = function () {
5032        if (!b.railh) return b;
5033        b.railh.visibility = !1;
5034        b.railh.css("display", "none");
5035        return b;
5036      };
5037      this.show = function () {
5038        b.hidden = !1;
5039        b.locked = !1;
5040        return b.showRail().showRailHr();
5041      };
5042      this.hide = function () {
5043        b.hidden = !0;
5044        b.locked = !0;
5045        return b.hideRail().hideRailHr();
5046      };
5047      this.toggle = function () {
5048        return b.hidden ? b.show() : b.hide();
5049      };
5050      this.remove = function () {
5051        b.stop();
5052        b.cursortimeout && clearTimeout(b.cursortimeout);
5053        b.doZoomOut();
5054        b.unbindAll();
5055        f.isie9 &&
5056          b.win[0].detachEvent("onpropertychange", b.onAttributeChange);
5057        !1 !== b.observer && b.observer.disconnect();
5058        !1 !== b.observerremover && b.observerremover.disconnect();
5059        b.events = null;
5060        b.cursor && b.cursor.remove();
5061        b.cursorh && b.cursorh.remove();
5062        b.rail && b.rail.remove();
5063        b.railh && b.railh.remove();
5064        b.zoom && b.zoom.remove();
5065        for (var d = 0; d < b.saved.css.length; d++) {
5066          var c = b.saved.css[d];
5067          c[0].css(c[1], "undefined" == typeof c[2] ? "" : c[2]);
5068        }
5069        b.saved = !1;
5070        b.me.data("__nicescroll", "");
5071        var g = e.nicescroll;
5072        g.each(function (d) {
5073          if (this && this.id === b.id) {
5074            delete g[d];
5075            for (var c = ++d; c < g.length; c++, d++) g[d] = g[c];
5076            g.length--;
5077            g.length && delete g[g.length];
5078          }
5079        });
5080        for (var h in b) (b[h] = null), delete b[h];
5081        b = null;
5082      };
5083      this.scrollstart = function (d) {
5084        this.onscrollstart = d;
5085        return b;
5086      };
5087      this.scrollend = function (d) {
5088        this.onscrollend = d;
5089        return b;
5090      };
5091      this.scrollcancel = function (d) {
5092        this.onscrollcancel = d;
5093        return b;
5094      };
5095      this.zoomin = function (d) {
5096        this.onzoomin = d;
5097        return b;
5098      };
5099      this.zoomout = function (d) {
5100        this.onzoomout = d;
5101        return b;
5102      };
5103      this.isScrollable = function (b) {
5104        b = b.target ? b.target : b;
5105        if ("OPTION" == b.nodeName) return !0;
5106        for (; b && 1 == b.nodeType && !/BODY|HTML/.test(b.nodeName); ) {
5107          var c = e(b),
5108            c =
5109              c.css("overflowY") ||
5110              c.css("overflowX") ||
5111              c.css("overflow") ||
5112              "";
5113          if (/scroll|auto/.test(c)) return b.clientHeight != b.scrollHeight;
5114          b = b.parentNode ? b.parentNode : !1;
5115        }
5116        return !1;
5117      };
5118      this.getViewport = function (b) {
5119        for (
5120          b = b && b.parentNode ? b.parentNode : !1;
5121          b && 1 == b.nodeType && !/BODY|HTML/.test(b.nodeName);
5122
5123        ) {
5124          var c = e(b);
5125          if (/fixed|absolute/.test(c.css("position"))) return c;
5126          var g =
5127            c.css("overflowY") || c.css("overflowX") || c.css("overflow") || "";
5128          if (
5129            (/scroll|auto/.test(g) && b.clientHeight != b.scrollHeight) ||
5130            0 < c.getNiceScroll().length
5131          )
5132            return c;
5133          b = b.parentNode ? b.parentNode : !1;
5134        }
5135        return !1;
5136      };
5137      this.onmousewheel = function (d) {
5138        if (b.locked) return b.debounced("checkunlock", b.resize, 250), !0;
5139        if (b.rail.drag) return b.cancelEvent(d);
5140        "auto" == b.opt.oneaxismousemode &&
5141          0 != d.deltaX &&
5142          (b.opt.oneaxismousemode = !1);
5143        if (b.opt.oneaxismousemode && 0 == d.deltaX && !b.rail.scrollable)
5144          return b.railh && b.railh.scrollable ? b.onmousewheelhr(d) : !0;
5145        var c = +new Date(),
5146          g = !1;
5147        b.opt.preservenativescrolling &&
5148          b.checkarea + 600 < c &&
5149          ((b.nativescrollingarea = b.isScrollable(d)), (g = !0));
5150        b.checkarea = c;
5151        if (b.nativescrollingarea) return !0;
5152        if ((d = t(d, !1, g))) b.checkarea = 0;
5153        return d;
5154      };
5155      this.onmousewheelhr = function (d) {
5156        if (b.locked || !b.railh.scrollable) return !0;
5157        if (b.rail.drag) return b.cancelEvent(d);
5158        var c = +new Date(),
5159          g = !1;
5160        b.opt.preservenativescrolling &&
5161          b.checkarea + 600 < c &&
5162          ((b.nativescrollingarea = b.isScrollable(d)), (g = !0));
5163        b.checkarea = c;
5164        return b.nativescrollingarea
5165          ? !0
5166          : b.locked
5167          ? b.cancelEvent(d)
5168          : t(d, !0, g);
5169      };
5170      this.stop = function () {
5171        b.cancelScroll();
5172        b.scrollmon && b.scrollmon.stop();
5173        b.cursorfreezed = !1;
5174        b.scroll.y = Math.round(b.getScrollTop() * (1 / b.scrollratio.y));
5175        b.noticeCursor();
5176        return b;
5177      };
5178      this.getTransitionSpeed = function (c) {
5179        var f = Math.round(10 * b.opt.scrollspeed);
5180        c = Math.min(f, Math.round((c / 20) * b.opt.scrollspeed));
5181        return 20 < c ? c : 0;
5182      };
5183      b.opt.smoothscroll
5184        ? b.ishwscroll && f.hastransition && b.opt.usetransition
5185          ? ((this.prepareTransition = function (c, e) {
5186              var g = e ? (20 < c ? c : 0) : b.getTransitionSpeed(c),
5187                h = g ? f.prefixstyle + "transform " + g + "ms ease-out" : "";
5188              if (!b.lasttransitionstyle || b.lasttransitionstyle != h)
5189                (b.lasttransitionstyle = h), b.doc.css(f.transitionstyle, h);
5190              return g;
5191            }),
5192            (this.doScrollLeft = function (c, f) {
5193              var g = b.scrollrunning ? b.newscrolly : b.getScrollTop();
5194              b.doScrollPos(c, g, f);
5195            }),
5196            (this.doScrollTop = function (c, f) {
5197              var g = b.scrollrunning ? b.newscrollx : b.getScrollLeft();
5198              b.doScrollPos(g, c, f);
5199            }),
5200            (this.doScrollPos = function (c, e, g) {
5201              var h = b.getScrollTop(),
5202                l = b.getScrollLeft();
5203              (0 > (b.newscrolly - h) * (e - h) ||
5204                0 > (b.newscrollx - l) * (c - l)) &&
5205                b.cancelScroll();
5206              !1 == b.opt.bouncescroll &&
5207                (0 > e ? (e = 0) : e > b.page.maxh && (e = b.page.maxh),
5208                0 > c ? (c = 0) : c > b.page.maxw && (c = b.page.maxw));
5209              if (b.scrollrunning && c == b.newscrollx && e == b.newscrolly)
5210                return !1;
5211              b.newscrolly = e;
5212              b.newscrollx = c;
5213              b.newscrollspeed = g || !1;
5214              if (b.timer) return !1;
5215              b.timer = setTimeout(function () {
5216                var g = b.getScrollTop(),
5217                  h = b.getScrollLeft(),
5218                  l,
5219                  k;
5220                l = c - h;
5221                k = e - g;
5222                l = Math.round(Math.sqrt(Math.pow(l, 2) + Math.pow(k, 2)));
5223                l =
5224                  b.newscrollspeed && 1 < b.newscrollspeed
5225                    ? b.newscrollspeed
5226                    : b.getTransitionSpeed(l);
5227                b.newscrollspeed &&
5228                  1 >= b.newscrollspeed &&
5229                  (l *= b.newscrollspeed);
5230                b.prepareTransition(l, !0);
5231                b.timerscroll &&
5232                  b.timerscroll.tm &&
5233                  clearInterval(b.timerscroll.tm);
5234                0 < l &&
5235                  (!b.scrollrunning &&
5236                    b.onscrollstart &&
5237                    b.onscrollstart.call(b, {
5238                      type: "scrollstart",
5239                      current: { x: h, y: g },
5240                      request: { x: c, y: e },
5241                      end: { x: b.newscrollx, y: b.newscrolly },
5242                      speed: l,
5243                    }),
5244                  f.transitionend
5245                    ? b.scrollendtrapped ||
5246                      ((b.scrollendtrapped = !0),
5247                      b.bind(b.doc, f.transitionend, b.onScrollEnd, !1))
5248                    : (b.scrollendtrapped && clearTimeout(b.scrollendtrapped),
5249                      (b.scrollendtrapped = setTimeout(b.onScrollEnd, l))),
5250                  (b.timerscroll = {
5251                    bz: new BezierClass(g, b.newscrolly, l, 0, 0, 0.58, 1),
5252                    bh: new BezierClass(h, b.newscrollx, l, 0, 0, 0.58, 1),
5253                  }),
5254                  b.cursorfreezed ||
5255                    (b.timerscroll.tm = setInterval(function () {
5256                      b.showCursor(b.getScrollTop(), b.getScrollLeft());
5257                    }, 60)));
5258                b.synched("doScroll-set", function () {
5259                  b.timer = 0;
5260                  b.scrollendtrapped && (b.scrollrunning = !0);
5261                  b.setScrollTop(b.newscrolly);
5262                  b.setScrollLeft(b.newscrollx);
5263                  if (!b.scrollendtrapped) b.onScrollEnd();
5264                });
5265              }, 50);
5266            }),
5267            (this.cancelScroll = function () {
5268              if (!b.scrollendtrapped) return !0;
5269              var c = b.getScrollTop(),
5270                e = b.getScrollLeft();
5271              b.scrollrunning = !1;
5272              f.transitionend || clearTimeout(f.transitionend);
5273              b.scrollendtrapped = !1;
5274              b._unbind(b.doc, f.transitionend, b.onScrollEnd);
5275              b.prepareTransition(0);
5276              b.setScrollTop(c);
5277              b.railh && b.setScrollLeft(e);
5278              b.timerscroll &&
5279                b.timerscroll.tm &&
5280                clearInterval(b.timerscroll.tm);
5281              b.timerscroll = !1;
5282              b.cursorfreezed = !1;
5283              b.showCursor(c, e);
5284              return b;
5285            }),
5286            (this.onScrollEnd = function () {
5287              b.scrollendtrapped &&
5288                b._unbind(b.doc, f.transitionend, b.onScrollEnd);
5289              b.scrollendtrapped = !1;
5290              b.prepareTransition(0);
5291              b.timerscroll &&
5292                b.timerscroll.tm &&
5293                clearInterval(b.timerscroll.tm);
5294              b.timerscroll = !1;
5295              var c = b.getScrollTop(),
5296                e = b.getScrollLeft();
5297              b.setScrollTop(c);
5298              b.railh && b.setScrollLeft(e);
5299              b.noticeCursor(!1, c, e);
5300              b.cursorfreezed = !1;
5301              0 > c ? (c = 0) : c > b.page.maxh && (c = b.page.maxh);
5302              0 > e ? (e = 0) : e > b.page.maxw && (e = b.page.maxw);
5303              if (c != b.newscrolly || e != b.newscrollx)
5304                return b.doScrollPos(e, c, b.opt.snapbackspeed);
5305              b.onscrollend &&
5306                b.scrollrunning &&
5307                b.onscrollend.call(b, {
5308                  type: "scrollend",
5309                  current: { x: e, y: c },
5310                  end: { x: b.newscrollx, y: b.newscrolly },
5311                });
5312              b.scrollrunning = !1;
5313            }))
5314          : ((this.doScrollLeft = function (c, f) {
5315              var g = b.scrollrunning ? b.newscrolly : b.getScrollTop();
5316              b.doScrollPos(c, g, f);
5317            }),
5318            (this.doScrollTop = function (c, f) {
5319              var g = b.scrollrunning ? b.new
5319scrollx : b.getScrollLeft();
5320              b.doScrollPos(g, c, f);
5321            }),
5322            (this.doScrollPos = function (c, f, g) {
5323              function e() {
5324                if (b.cancelAnimationFrame) return !0;
5325                b.scrollrunning = !0;
5326                if ((p = 1 - p)) return (b.timer = v(e) || 1);
5327                var c = 0,
5328                  d = (sy = b.getScrollTop());
5329                if (b.dst.ay) {
5330                  var d = b.bzscroll
5331                      ? b.dst.py + b.bzscroll.getNow() * b.dst.ay
5332                      : b.newscrolly,
5333                    g = d - sy;
5334                  if (
5335                    (0 > g && d < b.newscrolly) ||
5336                    (0 < g && d > b.newscrolly)
5337                  )
5338                    d = b.newscrolly;
5339                  b.setScrollTop(d);
5340                  d == b.newscrolly && (c = 1);
5341                } else c = 1;
5342                var f = (sx = b.getScrollLeft());
5343                if (b.dst.ax) {
5344                  f = b.bzscroll
5345                    ? b.dst.px + b.bzscroll.getNow() * b.dst.ax
5346                    : b.newscrollx;
5347                  g = f - sx;
5348                  if (
5349                    (0 > g && f < b.newscrollx) ||
5350                    (0 < g && f > b.newscrollx)
5351                  )
5352                    f = b.newscrollx;
5353                  b.setScrollLeft(f);
5354                  f == b.newscrollx && (c += 1);
5355                } else c += 1;
5356                2 == c
5357                  ? ((b.timer = 0),
5358                    (b.cursorfreezed = !1),
5359                    (b.bzscroll = !1),
5360                    (b.scrollrunning = !1),
5361                    0 > d ? (d = 0) : d > b.page.maxh && (d = b.page.maxh),
5362                    0 > f ? (f = 0) : f > b.page.maxw && (f = b.page.maxw),
5363                    f != b.newscrollx || d != b.newscrolly
5364                      ? b.doScrollPos(f, d)
5365                      : b.onscrollend &&
5366                        b.onscrollend.call(b, {
5367                          type: "scrollend",
5368                          current: { x: sx, y: sy },
5369                          end: { x: b.newscrollx, y: b.newscrolly },
5370                        }))
5371                  : (b.timer = v(e) || 1);
5372              }
5373              f = "undefined" == typeof f || !1 === f ? b.getScrollTop(!0) : f;
5374              if (b.timer && b.newscrolly == f && b.newscrollx == c) return !0;
5375              b.timer && w(b.timer);
5376              b.timer = 0;
5377              var h = b.getScrollTop(),
5378                l = b.getScrollLeft();
5379              (0 > (b.newscrolly - h) * (f - h) ||
5380                0 > (b.newscrollx - l) * (c - l)) &&
5381                b.cancelScroll();
5382              b.newscrolly = f;
5383              b.newscrollx = c;
5384              if (!b.bouncescroll || !b.rail.visibility)
5385                0 > b.newscrolly
5386                  ? (b.newscrolly = 0)
5387                  : b.newscrolly > b.page.maxh && (b.newscrolly = b.page.maxh);
5388              if (!b.bouncescroll || !b.railh.visibility)
5389                0 > b.newscrollx
5390                  ? (b.newscrollx = 0)
5391                  : b.newscrollx > b.page.maxw && (b.newscrollx = b.page.maxw);
5392              b.dst = {};
5393              b.dst.x = c - l;
5394              b.dst.y = f - h;
5395              b.dst.px = l;
5396              b.dst.py = h;
5397              var k = Math.round(
5398                Math.sqrt(Math.pow(b.dst.x, 2) + Math.pow(b.dst.y, 2))
5399              );
5400              b.dst.ax = b.dst.x / k;
5401              b.dst.ay = b.dst.y / k;
5402              var m = 0,
5403                q = k;
5404              0 == b.dst.x
5405                ? ((m = h), (q = f), (b.dst.ay = 1), (b.dst.py = 0))
5406                : 0 == b.dst.y &&
5407                  ((m = l), (q = c), (b.dst.ax = 1), (b.dst.px = 0));
5408              k = b.getTransitionSpeed(k);
5409              g && 1 >= g && (k *= g);
5410              b.bzscroll =
5411                0 < k
5412                  ? b.bzscroll
5413                    ? b.bzscroll.update(q, k)
5414                    : new BezierClass(m, q, k, 0, 1, 0, 1)
5415                  : !1;
5416              if (!b.timer) {
5417                ((h == b.page.maxh && f >= b.page.maxh) ||
5418                  (l == b.page.maxw && c >= b.page.maxw)) &&
5419                  b.checkContentSize();
5420                var p = 1;
5421                b.cancelAnimationFrame = !1;
5422                b.timer = 1;
5423                b.onscrollstart &&
5424                  !b.scrollrunning &&
5425                  b.onscrollstart.call(b, {
5426                    type: "scrollstart",
5427                    current: { x: l, y: h },
5428                    request: { x: c, y: f },
5429                    end: { x: b.newscrollx, y: b.newscrolly },
5430                    speed: k,
5431                  });
5432                e();
5433                ((h == b.page.maxh && f >= h) ||
5434                  (l == b.page.maxw && c >= l)) &&
5435                  b.checkContentSize();
5436                b.noticeCursor();
5437              }
5438            }),
5439            (this.cancelScroll = function () {
5440              b.timer && w(b.timer);
5441              b.timer = 0;
5442              b.bzscroll = !1;
5443              b.scrollrunning = !1;
5444              return b;
5445            }))
5446        : ((this.doScrollLeft = function (c, f) {
5447            var g = b.getScrollTop();
5448            b.doScrollPos(c, g, f);
5449          }),
5450          (this.doScrollTop = function (c, f) {
5451            var g = b.getScrollLeft();
5452            b.doScrollPos(g, c, f);
5453          }),
5454          (this.doScrollPos = function (c, f, g) {
5455            var e = c > b.page.maxw ? b.page.maxw : c;
5456            0 > e && (e = 0);
5457            var h = f > b.page.maxh ? b.page.maxh : f;
5458            0 > h && (h = 0);
5459            b.synched("scroll", function () {
5460              b.setScrollTop(h);
5461              b.setScrollLeft(e);
5462            });
5463          }),
5464          (this.cancelScroll = function () {}));
5465      this.doScrollBy = function (c, f) {
5466        var g = 0,
5467          g = f
5468            ? Math.floor((b.scroll.y - c) * b.scrollratio.y)
5469            : (b.timer ? b.newscrolly : b.getScrollTop(!0)) - c;
5470        if (b.bouncescroll) {
5471          var e = Math.round(b.view.h / 2);
5472          g < -e ? (g = -e) : g > b.page.maxh + e && (g = b.page.maxh + e);
5473        }
5474        b.cursorfreezed = !1;
5475        py = b.getScrollTop(!0);
5476        if (0 > g && 0 >= py) return b.noticeCursor();
5477        if (g > b.page.maxh && py >= b.page.maxh)
5478          return b.checkContentSize(), b.noticeCursor();
5479        b.doScrollTop(g);
5480      };
5481      this.doScrollLeftBy = function (c, f) {
5482        var g = 0,
5483          g = f
5484            ? Math.floor((b.scroll.x - c) * b.scrollratio.x)
5485            : (b.timer ? b.newscrollx : b.getScrollLeft(!0)) - c;
5486        if (b.bouncescroll) {
5487          var e = Math.round(b.view.w / 2);
5488          g < -e ? (g = -e) : g > b.page.maxw + e && (g = b.page.maxw + e);
5489        }
5490        b.cursorfreezed = !1;
5491        px = b.getScrollLeft(!0);
5492        if ((0 > g && 0 >= px) || (g > b.page.maxw && px >= b.page.maxw))
5493          return b.noticeCursor();
5494        b.doScrollLeft(g);
5495      };
5496      this.doScrollTo = function (c, f) {
5497        f && Math.round(c * b.scrollratio.y);
5498        b.cursorfreezed = !1;
5499        b.doScrollTop(c);
5500      };
5501      this.checkContentSize = function () {
5502        var c = b.getContentSize();
5503        (c.h != b.page.h || c.w != b.page.w) && b.resize(!1, c);
5504      };
5505      b.onscroll = function (c) {
5506        b.rail.drag ||
5507          b.cursorfreezed ||
5508          b.synched("scroll", function () {
5509            b.scroll.y = Math.round(b.getScrollTop() * (1 / b.scrollratio.y));
5510            b.railh &&
5511              (b.scroll.x = Math.round(
5512                b.getScrollLeft() * (1 / b.scrollratio.x)
5513              ));
5514            b.noticeCursor();
5515          });
5516      };
5517      b.bind(b.docscroll, "scroll", b.onscroll);
5518      this.doZoomIn = function (c) {
5519        if (!b.zoomactive) {
5520          b.zoomactive = !0;
5521          b.zoomrestore = { style: {} };
5522          var h =
5523              "position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(
5524                " "
5525              ),
5526            g = b.win[0].style,
5527            l;
5528          for (l in h) {
5529            var k = h[l];
5530            b.zoomrestore.style[k] = "undefined" != typeof g[k] ? g[k] : "";
5531          }
5532          b.zoomrestore.style.width = b.win.css("width");
5533          b.zoomrestore.style.height = b.win.css("height");
5534          b.zoomrestore.padding = {
5535            w: b.win.outerWidth() - b.win.width(),
5536            h: b.win.outerHeight() - b.win.height(),
5537          };
5538          f.isios4 &&
5539            ((b.zoomrestore.scrollTop = e(window).scrollTop()),
5540            e(window).scrollTop(0));
5541          b.win.css({
5542            position: f.isios4 ? "absolute" : "fixed",
5543            top: 0,
5544            left: 0,
5545            "z-index": y + 100,
5546            margin: "0px",
5547          });
5548          h = b.win.css("backgroundColor");
5549          ("" == h ||
5550            /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(h)) &&
5551            b.win.css("backgroundColor", "#fff");
5552          b.rail.css({ "z-index": y + 101 });
5553          b.zoom.css({ "z-index": y + 102 });
5554          b.zoom.css("backgroundPosition", "0px -18px");
5555          b.resizeZoom();
5556          b.onzoomin && b.onzoomin.call(b);
5557          return b.cancelEvent(c);
5558        }
5559      };
5560      this.doZoomOut = function (c) {
5561        if (b.zoomactive)
5562          return (
5563            (b.zoomactive = !1),
5564            b.win.css("margin", ""),
5565            b.win.css(b.zoomrestore.style),
5566            f.isios4 && e(window).scrollTop(b.zoomrestore.scrollTop),
5567            b.rail.css({ "z-index": b.zindex }),
5568            b.zoom.css({ "z-index": b.zindex }),
5569            (b.zoomrestore = !1),
5570            b.zoom.css("backgroundPosition", "0px 0px"),
5571            b.onResize(),
5572            b.onzoomout && b.onzoomout.call(b),
5573            b.cancelEvent(c)
5574          );
5575      };
5576      this.doZoom = function (c) {
5577        return b.zoomactive ? b.doZoomOut(c) : b.doZoomIn(c);
5578      };
5579      this.resizeZoom = function () {
5580        if (b.zoomactive) {
5581          var c = b.getScrollTop();
5582          b.win.css({
5583            width: e(window).width() - b.zoomrestore.padding.w + "px",
5584            height: e(window).height() - b.zoomrestore.padding.h + "px",
5585          });
5586          b.onResize();
5587          b.setScrollTop(Math.min(b.page.maxh, c));
5588        }
5589      };
5590      this.init();
5591      e.nicescroll.push(this);
5592    },
5593    J = function (e) {
5594      var c = this;
5595      this.nc = e;
5596      this.steptime =
5597        this.lasttime =
5598        this.speedy =
5599        this.speedx =
5600        this.lasty =
5601        this.lastx =
5602          0;
5603      this.snapy = this.snapx = !1;
5604      this.demuly = this.demulx = 0;
5605      this.lastscrolly = this.lastscrollx = -1;
5606      this.timer = this.chky = this.chkx = 0;
5607      this.time = function () {
5608        return +new Date();
5609      };
5610      this.reset = function (e, l) {
5611        c.stop();
5612        var k = c.time();
5613        c.steptime = 0;
5614        c.lasttime = k;
5615        c.speedx = 0;
5616        c.speedy = 0;
5617        c.lastx = e;
5618        c.lasty = l;
5619        c.lastscrollx = -1;
5620        c.lastscrolly = -1;
5621      };
5622      this.update = function (e, l) {
5623        var k = c.time();
5624        c.steptime = k - c.lasttime;
5625        c.lasttime = k;
5626        var k = l - c.lasty,
5627          t = e - c.lastx,
5628          b = c.nc.getScrollTop(),
5629          p = c.nc.getScrollLeft(),
5630          b = b + k,
5631          p = p + t;
5632        c.snapx = 0 > p || p > c.nc.page.maxw;
5633        c.snapy = 0 > b || b > c.nc.page.maxh;
5634        c.speedx = t;
5635        c.speedy = k;
5636        c.lastx = e;
5637        c.lasty = l;
5638      };
5639      this.stop = function () {
5640        c.nc.unsynched("domomentum2d");
5641        c.timer && clearTimeout(c.timer);
5642        c.timer = 0;
5643        c.lastscrollx = -1;
5644        c.lastscrolly = -1;
5645      };
5646      this.doSnapy = function (e, l) {
5647        var k = !1;
5648        0 > l
5649          ? ((l = 0), (k = !0))
5650          : l > c.nc.page.maxh && ((l = c.nc.page.maxh), (k = !0));
5651        0 > e
5652          ? ((e = 0), (k = !0))
5653          : e > c.nc.page.maxw && ((e = c.nc.page.maxw), (k = !0));
5654        k && c.nc.doScrollPos(e, l, c.nc.opt.snapbackspeed);
5655      };
5656      this.doMomentum = function (e) {
5657        var l = c.time(),
5658          k = e ? l + e : c.lasttime;
5659        e = c.nc.getScrollLeft();
5660        var t = c.nc.getScrollTop(),
5661          b = c.nc.page.maxh,
5662          p = c.nc.page.maxw;
5663        c.speedx = 0 < p ? Math.min(60, c.speedx) : 0;
5664        c.speedy = 0 < b ? Math.min(60, c.speedy) : 0;
5665        k = k && 60 >= l - k;
5666        if (0 > t || t > b || 0 > e || e > p) k = !1;
5667        e = c.speedx && k ? c.speedx : !1;
5668        if ((c.speedy && k && c.speedy) || e) {
5669          var f = Math.max(16, c.steptime);
5670          50 < f && ((e = f / 50), (c.speedx *= e), (c.speedy *= e), (f = 50));
5671          c.demulxy = 0;
5672          c.lastscrollx = c.nc.getScrollLeft();
5673          c.chkx = c.lastscrollx;
5674          c.lastscrolly = c.nc.getScrollTop();
5675          c.chky = c.lastscrolly;
5676          var s = c.lastscrollx,
5677            u = c.lastscrolly,
5678            d = function () {
5679              var e = 600 < c.time() - l ? 0.04 : 0.02;
5680              if (
5681                c.speedx &&
5682                ((s = Math.floor(c.lastscrollx - c.speedx * (1 - c.demulxy))),
5683                (c.lastscrollx = s),
5684                0 > s || s > p)
5685              )
5686                e = 0.1;
5687              if (
5688                c.speedy &&
5689                ((u = Math.floor(c.lastscrolly - c.speedy * (1 - c.demulxy))),
5690                (c.lastscrolly = u),
5691                0 > u || u > b)
5692              )
5693                e = 0.1;
5694              c.demulxy = Math.min(1, c.demulxy + e);
5695              c.nc.synched("domomentum2d", function () {
5696                c.speedx &&
5697                  (c.nc.getScrollLeft() != c.chkx && c.stop(),
5698                  (c.chkx = s),
5699                  c.nc.setScrollLeft(s));
5700                c.speedy &&
5701                  (c.nc.getScrollTop() != c.chky && c.stop(),
5702                  (c.chky = u),
5703                  c.nc.setScrollTop(u));
5704                c.timer || (c.nc.hideCursor(), c.doSnapy(s, u));
5705              });
5706              1 > c.demulxy
5707                ? (c.timer = setTimeout(d, f))
5708                : (c.stop(), c.nc.hideCursor(), c.doSnapy(s, u));
5709            };
5710          d();
5711        } else c.doSnapy(c.nc.getScrollLeft(), c.nc.getScrollTop());
5712      };
5713    },
5714    B = e.fn.scrollTop;
5715  e.cssHooks.pageYOffset = {
5716    get: function (k, c, h) {
5717      return (c = e.data(k, "__nicescroll") || !1) && c.ishwscroll
5718        ? c.getScrollTop()
5719        : B.call(k);
5720    },
5721    set: function (k, c) {
5722      var h = e.data(k, "__nicescroll") || !1;
5723      h && h.ishwscroll ? h.setScrollTop(parseInt(c)) : B.call(k, c);
5724      return this;
5725    },
5726  };
5727  e.fn.scrollTop = function (k) {
5728    if ("undefined" == typeof k) {
5729      var c = this[0] ? e.data(this[0], "__nicescroll") || !1 : !1;
5730      return c && c.ishwscroll ? c.getScrollTop() : B.call(this);
5731    }
5732    return this.each(function () {
5733      var c = e.data(this, "__nicescroll") || !1;
5734      c && c.ishwscroll ? c.setScrollTop(parseInt(k)) : B.call(e(this), k);
5735    });
5736  };
5737  var C = e.fn.scrollLeft;
5738  e.cssHooks.pageXOffset = {
5739    get: function (k, c, h) {
5740      return (c = e.data(k, "__nicescroll") || !1) && c.ishwscroll
5741        ? c.getScrollLeft()
5742        : C.call(k);
5743    },
5744    set: function (k, c) {
5745      var h = e.data(k, "__nicescroll") || !1;
5746      h && h.ishwscroll ? h.setScrollLeft(parseInt(c)) : C.call(k, c);
5747      return this;
5748    },
5749  };
5750  e.fn.scrollLeft = function (k) {
5751    if ("undefined" == typeof k) {
5752      var c = this[0] ? e.data(this[0], "__nicescroll") || !1 : !1;
5753      return c && c.ishwscroll ? c.getScrollLeft() : C.call(this);
5754    }
5755    return this.each(function () {
5756      var c = e.data(this, "__nicescroll") || !1;
5757      c && c.ishwscroll ? c.setScrollLeft(parseInt(k)) : C.call(e(this), k);
5758    });
5759  };
5760  var D = function (k) {
5761    var c = this;
5762    this.length = 0;
5763    this.name = "nicescrollarray";
5764    this.each = function (e) {
5765      for (var h = 0, k = 0; h < c.length; h++) e.call(c[h], k++);
5766      return c;
5767    };
5768    this.push = function (e) {
5769      c[c.length] = e;
5770      c.length++;
5771    };
5772    this.eq = function (e) {
5773      return c[e];
5774    };
5775    if (k)
5776      for (a = 0; a < k.length; a++) {
5777        var h = e.data(k[a], "__nicescroll") || !1;
5778        h && ((this[this.length] = h), this.length++);
5779      }
5780    return this;
5781  };
5782  (function (e, c, h) {
5783    for (var l = 0; l < c.length; l++) h(e, c[l]);
5784  })(
5785    D.prototype,
5786    "show hide toggle onResize resize remove stop doScrollPos".split(" "),
5787    function (e, c) {
5788      e[c] = function () {
5789        var e = arguments;
5790        return this.each(function () {
5791          this[c].apply(this, e);
5792        });
5793      };
5794    }
5795  );
5796  e.fn.getNiceScroll = function (k) {
5797    return "undefined" == typeof k
5798      ? new D(this)
5799      : (this[k] && e.data(this[k], "__nicescroll")) || !1;
5800  };
5801  e.extend(e.expr[":"], {
5802    nicescroll: function (k) {
5803      return e.data(k, "__nicescroll") ? !0 : !1;
5804    },
5805  });
5806  e.fn.niceScroll = function (k, c) {
5807    "undefined" == typeof c &&
5808      "object" == typeof k &&
5809      !("jquery" in k) &&
5810      ((c = k), (k = !1));
5811    var h = new D();
5812    "undefined" == typeof c && (c = {});
5813    k && ((c.doc = e(k)), (c.win = e(this)));
5814    var l = !("doc" in c);
5815    !l && !("win" in c) && (c.win = e(this));
5816    this.each(function () {
5817      var k = e(this).data("__nicescroll") || !1;
5818      k ||
5819        ((c.doc = l ? e(this) : c.doc),
5820        (k = new Q(c, e(this))),
5821        e(this).data("__nicescroll", k));
5822      h.push(k);
5823    });
5824    return 1 == h.length ? h[0] : h;
5825  };
5826  window.NiceScroll = {
5827    getjQuery: function () {
5828      return e;
5829    },
5830  };
5831  e.nicescroll || ((e.nicescroll = new D()), (e.nicescroll.options = I));
5832})(jQuery);
5833
5834/////////////////////////////////////////////
5835// COUNTDOWN PLUGIN
5836/////////////////////////////////////////////
5837
5838/* http://keith-wood.name/countdown.html
5839   Countdown for jQuery v1.6.3.
5840   Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
5841   Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. 
5842   Please attribute the author if you use it. */
5843(function ($) {
5844  function Countdown() {
5845    this.regional = [];
5846    this.regional[""] = {
5847      labels: [
5848        "Years",
5849        "Months",
5850        "Weeks",
5851        "Days",
5852        "Hours",
5853        "Minutes",
5854        "Seconds",
5855      ],
5856      labels1: ["Year", "Month", "Week", "Day", "Hour", "Minute", "Second"],
5857      compactLabels: ["y", "m", "w", "d"],
5858      whichLabels: null,
5859      digits: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
5860      timeSeparator: ":",
5861      isRTL: false,
5862    };
5863    this._defaults = {
5864      until: null,
5865      since: null,
5866      timezone: null,
5867      serverSync: null,
5868      format: "dHMS",
5869      layout: "",
5870      compact: false,
5871      significant: 0,
5872      description: "",
5873      expiryUrl: "",
5874      expiryText: "",
5875      alwaysExpire: false,
5876      onExpiry: null,
5877      onTick: null,
5878      tickInterval: 1,
5879    };
5880    $.extend(this._defaults, this.regional[""]);
5881    this._serverSyncs = [];
5882    var c =
5883      typeof Date.now == "function"
5884        ? Date.now
5885        : function () {
5886            return new Date().getTime();
5887          };
5888    var d = window.performance && typeof window.performance.now == "function";
5889    function timerCallBack(a) {
5890      var b =
5891        a < 1e12
5892          ? d
5893            ? performance.now() + performance.timing.navigationStart
5894            : c()
5895          : a || c();
5896      if (b - f >= 1000) {
5897        x._updateTargets();
5898        f = b;
5899      }
5900      e(timerCallBack);
5901    }
5902    var e =
5903      window.requestAnimationFrame ||
5904      window.webkitRequestAnimationFrame ||
5905      window.mozRequestAnimationFrame ||
5906      window.oRequestAnimationFrame ||
5907      window.msRequestAnimationFrame ||
5908      null;
5909    var f = 0;
5910    if (!e || $.noRequestAnimationFrame) {
5911      $.noRequestAnimationFrame = null;
5912      setInterval(function () {
5913        x._updateTargets();
5914      }, 980);
5915    } else {
5916      f =
5917        window.animationStartTime ||
5918        window.webkitAnimationStartTime ||
5919        window.mozAnimationStartTime ||
5920        window.oAnimationStartTime ||
5921        window.msAnimationStartTime ||
5922        c();
5923      e(timerCallBack);
5924    }
5925  }
5926  var Y = 0;
5927  var O = 1;
5928  var W = 2;
5929  var D = 3;
5930  var H = 4;
5931  var M = 5;
5932  var S = 6;
5933  $.extend(Countdown.prototype, {
5934    markerClassName: "hasCountdown",
5935    propertyName: "countdown",
5936    _rtlClass: "countdown_rtl",
5937    _sectionClass: "countdown_section",
5938    _amountClass: "countdown_amount",
5939    _rowClass: "countdown_row",
5940    _holdingClass: "countdown_holding",
5941    _showClass: "countdown_show",
5942    _descrClass: "countdown_descr",
5943    _timerTargets: [],
5944    setDefaults: function (a) {
5945      this._resetExtraLabels(this._defaults, a);
5946      $.extend(this._defaults, a || {});
5947    },
5948    UTCDate: function (a, b, c, e, f, g, h, i) {
5949      if (typeof b == "object" && b.constructor == Date) {
5950        i = b.getMilliseconds();
5951        h = b.getSeconds();
5952        g = b.getMinutes();
5953        f = b.getHours();
5954        e = b.getDate();
5955        c = b.getMonth();
5956        b = b.getFullYear();
5957      }
5958      var d = new Date();
5959      d.setUTCFullYear(b);
5960      d.setUTCDate(1);
5961      d.setUTCMonth(c || 0);
5962      d.setUTCDate(e || 1);
5963      d.setUTCHours(f || 0);
5964      d.setUTCMinutes((g || 0) - (Math.abs(a) < 30 ? a * 60 : a));
5965      d.setUTCSeconds(h || 0);
5966      d.setUTCMilliseconds(i || 0);
5967      return d;
5968    },
5969    periodsToSeconds: function (a) {
5970      return (
5971        a[0] * 31557600 +
5972        a[1] * 2629800 +
5973        a[2] * 604800 +
5974        a[3] * 86400 +
5975        a[4] * 3600 +
5976        a[5] * 60 +
5977        a[6]
5978      );
5979    },
5980    _attachPlugin: function (a, b) {
5981      a = $(a);
5982      if (a.hasClass(this.markerClassName)) {
5983        return;
5984      }
5985      var c = {
5986        options: $.extend({}, this._defaults),
5987        _periods: [0, 0, 0, 0, 0, 0, 0],
5988      };
5989      a.addClass(this.markerClassName).data(this.propertyName, c);
5990      this._optionPlugin(a, b);
5991    },
5992    _addTarget: function (a) {
5993      if (!this._hasTarget(a)) {
5994        this._timerTargets.push(a);
5995      }
5996    },
5997    _hasTarget: function (a) {
5998      return $.inArray(a, this._timerTargets) > -1;
5999    },
6000    _removeTarget: function (b) {
6001      this._timerTargets = $.map(this._timerTargets, function (a) {
6002        return a == b ? null : a;
6003      });
6004    },
6005    _updateTargets: function () {
6006      for (var i = this._timerTargets.length - 1; i >= 0; i--) {
6007        this._updateCountdown(this._timerTargets[i]);
6008      }
6009    },
6010    _optionPlugin: function (a, b, c) {
6011      a = $(a);
6012      var d = a.data(this.propertyName);
6013      if (!b || (typeof b == "string" && c == null)) {
6014        var e = b;
6015        b = (d || {}).options;
6016        return b && e ? b[e] : b;
6017      }
6018      if (!a.hasClass(this.markerClassName)) {
6019        return;
6020      }
6021      b = b || {};
6022      if (typeof b == "string") {
6023        var e = b;
6024        b = {};
6025        b[e] = c;
6026      }
6027      if (b.layout) {
6028        b.layout = b.layout.replace(/&lt;/g, "<").replace(/&gt;/g, ">");
6029      }
6030      this._resetExtraLabels(d.options, b);
6031      var f = d.options.timezone != b.timezone;
6032      $.extend(d.options, b);
6033      this._adjustSettings(a, d, b.until != null || b.since != null || f);
6034      var g = new Date();
6035      if ((d._since && d._since < g) || (d._until && d._until > g)) {
6036        this._addTarget(a[0]);
6037      }
6038      this._updateCountdown(a, d);
6039    },
6040    _updateCountdown: function (a, b) {
6041      var c = $(a);
6042      b = b || c.data(this.propertyName);
6043      if (!b) {
6044        return;
6045      }
6046      c.html(this._generateHTML(b)).toggleClass(
6047        this._rtlClass,
6048        b.options.isRTL
6049      );
6050      if ($.isFunction(b.options.onTick)) {
6051        var d =
6052          b._hold != "lap"
6053            ? b._periods
6054            : this._calculatePeriods(
6055                b,
6056                b._show,
6057                b.options.significant,
6058                new Date()
6059              );
6060        if (
6061          b.options.tickInterval == 1 ||
6062          this.periodsToSeconds(d) % b.options.tickInterval == 0
6063        ) {
6064          b.options.onTick.apply(a, [d]);
6065        }
6066      }
6067      var e =
6068        b._hold != "pause" &&
6069        (b._since
6070          ? b._now.getTime() < b._since.getTime()
6071          : b._now.getTime() >= b._until.getTime());
6072      if (e && !b._expiring) {
6073        b._expiring = true;
6074        if (this._hasTarget(a) || b.options.alwaysExpire) {
6075          this._removeTarget(a);
6076          if ($.isFunction(b.options.onExpiry)) {
6077            b.options.onExpiry.apply(a, []);
6078          }
6079          if (b.options.expiryText) {
6080            var f = b.options.layout;
6081            b.options.layout = b.options.expiryText;
6082            this._updateCountdown(a, b);
6083            b.options.layout = f;
6084          }
6085          if (b.options.expiryUrl) {
6086            window.location = b.options.expiryUrl;
6087          }
6088        }
6089        b._expiring = false;
6090      } else if (b._hold == "pause") {
6091        this._removeTarget(a);
6092      }
6093      c.data(this.propertyName, b);
6094    },
6095    _resetExtraLabels: function (a, b) {
6096      var c = false;
6097      for (var n in b) {
6098        if (n != "whichLabels" && n.match(/[Ll]abels/)) {
6099          c = true;
6100          break;
6101        }
6102      }
6103      if (c) {
6104        for (var n in a) {
6105          if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
6106            a[n] = null;
6107          }
6108        }
6109      }
6110    },
6111    _adjustSettings: function (a, b, c) {
6112      var d;
6113      var e = 0;
6114      var f = null;
6115      for (var i = 0; i < this._serverSyncs.length; i++) {
6116        if (this._serverSyncs[i][0] == b.options.serverSync) {
6117          f = this._serverSyncs[i][1];
6118          break;
6119        }
6120      }
6121      if (f != null) {
6122        e = b.options.serverSync ? f : 0;
6123        d = new Date();
6124      } else {
6125        var g = $.isFunction(b.options.serverSync)
6126          ? b.options.serverSync.apply(a, [])
6127          : null;
6128        d = new Date();
6129        e = g ? d.getTime() - g.getTime() : 0;
6130        this._serverSyncs.push([b.options.serverSync, e]);
6131      }
6132      var h = b.options.timezone;
6133      h = h == null ? -d.getTimezoneOffset() : h;
6134      if (c || (!c && b._until == null && b._since == null)) {
6135        b._since = b.options.since;
6136        if (b._since != null) {
6137          b._since = this.UTCDate(h, this._determineTime(b._since, null));
6138          if (b._since && e) {
6139            b._since.setMilliseconds(b._since.getMilliseconds() + e);
6140          }
6141        }
6142        b._until = this.UTCDate(h, this._determineTime(b.options.until, d));
6143        if (e) {
6144          b._until.setMilliseconds(b._until.getMilliseconds() + e);
6145        }
6146      }
6147      b._show = this._determineShow(b);
6148    },
6149    _destroyPlugin: function (a) {
6150      a = $(a);
6151      if (!a.hasClass(this.markerClassName)) {
6152        return;
6153      }
6154      this._removeTarget(a[0]);
6155      a.removeClass(this.markerClassName).empty().removeData(this.propertyName);
6156    },
6157    _pausePlugin: function (a) {
6158      this._hold(a, "pause");
6159    },
6160    _lapPlugin: function (a) {
6161      this._hold(a, "lap");
6162    },
6163    _resumePlugin: function (a) {
6164      this._hold(a, null);
6165    },
6166    _hold: function (a, b) {
6167      var c = $.data(a, this.propertyName);
6168      if (c) {
6169        if (c._hold == "pause" && !b) {
6170          c._periods = c._savePeriods;
6171          var d = c._since ? "-" : "+";
6172          c[c._since ? "_since" : "_until"] = this._determineTime(
6173            d +
6174              c._periods[0] +
6175              "y" +
6176              d +
6177              c._periods[1] +
6178              "o" +
6179              d +
6180              c._periods[2] +
6181              "w" +
6182              d +
6183              c._periods[3] +
6184              "d" +
6185              d +
6186              c._periods[4] +
6187              "h" +
6188              d +
6189              c._periods[5] +
6190              "m" +
6191              d +
6192              c._periods[6] +
6193              "s"
6194          );
6195          this._addTarget(a);
6196        }
6197        c._hold = b;
6198        c._savePeriods = b == "pause" ? c._periods : null;
6199        $.data(a, this.propertyName, c);
6200        this._updateCountdown(a, c);
6201      }
6202    },
6203    _getTimesPlugin: function (a) {
6204      var b = $.data(a, this.propertyName);
6205      return !b
6206        ? null
6207        : b._hold == "pause"
6208        ? b._savePeriods
6209        : !b._hold
6210        ? b._periods
6211        : this._calculatePeriods(b, b._show, b.options.significant, new Date());
6212    },
6213    _determineTime: function (k, l) {
6214      var m = function (a) {
6215        var b = new Date();
6216        b.setTime(b.getTime() + a * 1000);
6217        return b;
6218      };
6219      var n = function (a) {
6220        a = a.toLowerCase();
6221        var b = new Date();
6222        var c = b.getFullYear();
6223        var d = b.getMonth();
6224        var e = b.getDate();
6225        var f = b.getHours();
6226        var g = b.getMinutes();
6227        var h = b.getSeconds();
6228        var i = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
6229        var j = i.exec(a);
6230        while (j) {
6231          switch (j[2] || "s") {
6232            case "s":
6233              h += parseInt(j[1], 10);
6234              break;
6235            case "m":
6236              g += parseInt(j[1], 10);
6237              break;
6238            case "h":
6239              f += parseInt(j[1], 10);
6240              break;
6241            case "d":
6242              e += parseInt(j[1], 10);
6243              break;
6244            case "w":
6245              e += parseInt(j[1], 10) * 7;
6246              break;
6247            case "o":
6248              d += parseInt(j[1], 10);
6249              e = Math.min(e, x._getDaysInMonth(c, d));
6250              break;
6251            case "y":
6252              c += parseInt(j[1], 10);
6253              e = Math.min(e, x._getDaysInMonth(c, d));
6254              break;
6255          }
6256          j = i.exec(a);
6257        }
6258        return new Date(c, d, e, f, g, h, 0);
6259      };
6260      var o =
6261        k == null
6262          ? l
6263          : typeof k == "string"
6264          ? n(k)
6265          : typeof k == "number"
6266          ? m(k)
6267          : k;
6268      if (o) o.setMilliseconds(0);
6269      return o;
6270    },
6271    _getDaysInMonth: function (a, b) {
6272      return 32 - new Date(a, b, 32).getDate();
6273    },
6274    _normalLabels: function (a) {
6275      return a;
6276    },
6277    _generateHTML: function (c) {
6278      var d = this;
6279      c._periods = c._hold
6280        ? c._periods
6281        : this._calculatePeriods(c, c._show, c.options.significant, new Date());
6282      var e = false;
6283      var f = 0;
6284      var g = c.options.significant;
6285      var h = $.extend({}, c._show);
6286      for (var i = Y; i <= S; i++) {
6287        e |= c._show[i] == "?" && c._periods[i] > 0;
6288        h[i] = c._show[i] == "?" && !e ? null : c._show[i];
6289        f += h[i] ? 1 : 0;
6290        g -= c._periods[i] > 0 ? 1 : 0;
6291      }
6292      var j = [false, false, false, false, false, false, false];
6293      for (var i = S; i >= Y; i--) {
6294        if (c._show[i]) {
6295          if (c._periods[i]) {
6296            j[i] = true;
6297          } else {
6298            j[i] = g > 0;
6299            g--;
6300          }
6301        }
6302      }
6303      var k = c.options.compact ? c.options.compactLabels : c.options.labels;
6304      var l = c.options.whichLabels || this._normalLabels;
6305      var m = function (a) {
6306        var b = c.options["compactLabels" + l(c._periods[a])];
6307        return h[a]
6308          ? d._translateDigits(c, c._periods[a]) + (b ? b[a] : k[a]) + " "
6309          : "";
6310      };
6311      var n = function (a) {
6312        var b = c.options["labels" + l(c._periods[a])];
6313        return (!c.options.significant && h[a]) ||
6314          (c.options.significant && j[a])
6315          ? '<span class="' +
6316              x._sectionClass +
6317              '">' +
6318              '<span class="' +
6319              x._amountClass +
6320              '">' +
6321              d._translateDigits(c, c._periods[a]) +
6322              '</span><span class="amount_label">' +
6323              (b ? b[a] : k[a]) +
6324              "</span></span>"
6325          : "";
6326      };
6327      return c.options.layout
6328        ? this._buildLayout(
6329            c,
6330            h,
6331            c.options.layout,
6332            c.options.compact,
6333            c.options.significant,
6334            j
6335          )
6336        : (c.options.compact
6337            ? '<span class="' +
6338              this._rowClass +
6339              " " +
6340              this._amountClass +
6341              (c._hold ? " " + this._holdingClass : "") +
6342              '">' +
6343              m(Y) +
6344              m(O) +
6345              m(W) +
6346              m(D) +
6347              (h[H] ? this._minDigits(c, c._periods[H], 2) : "") +
6348              (h[M]
6349                ? (h[H] ? c.options.timeSeparator : "") +
6350                  this._minDigits(c, c._periods[M], 2)
6351                : "") +
6352              (h[S]
6353                ? (h[H] || h[M] ? c.options.timeSeparator : "") +
6354                  this._minDigits(c, c._periods[S], 2)
6355                : "")
6356            : '<span class="' +
6357              this._rowClass +
6358              " " +
6359              this._showClass +
6360              (c.options.significant || f) +
6361              (c._hold ? " " + this._holdingClass : "") +
6362              '">' +
6363              n(Y) +
6364              n(O) +
6365              n(W) +
6366              n(D) +
6367              n(H) +
6368              n(M) +
6369              n(S)) +
6370            "</span>" +
6371            (c.options.description
6372              ? '<span class="' +
6373                this._rowClass +
6374                " " +
6375                this._descrClass +
6376                '">' +
6377                c.options.description +
6378                "</span>"
6379              : "");
6380    },
6381    _buildLayout: function (c, d, e, f, g, h) {
6382      var j = c.options[f ? "compactLabels" : "labels"];
6383      var k = c.options.whichLabels || this._normalLabels;
6384      var l = function (a) {
6385        return (c.options[
6386          (f ? "compactLabels" : "labels") + k(c._periods[a])
6387        ] || j)[a];
6388      };
6389      var m = function (a, b) {
6390        return c.options.digits[Math.floor(a / b) % 10];
6391      };
6392      var o = {
6393        desc: c.options.description,
6394        sep: c.options.timeSeparator,
6395        yl: l(Y),
6396        yn: this._minDigits(c, c._periods[Y], 1),
6397        ynn: this._minDigits(c, c._periods[Y], 2),
6398        ynnn: this._minDigits(c, c._periods[Y], 3),
6399        y1: m(c._periods[Y], 1),
6400        y10: m(c._periods[Y], 10),
6401        y100: m(c._periods[Y], 100),
6402        y1000: m(c._periods[Y], 1000),
6403        ol: l(O),
6404        on: this._minDigits(c, c._periods[O], 1),
6405        onn: this._minDigits(c, c._periods[O], 2),
6406        onnn: this._minDigits(c, c._periods[O], 3),
6407        o1: m(c._periods[O], 1),
6408        o10: m(c._periods[O], 10),
6409        o100: m(c._periods[O], 100),
6410        o1000: m(c._periods[O], 1000),
6411        wl: l(W),
6412        wn: this._minDigits(c, c._periods[W], 1),
6413        wnn: this._minDigits(c, c._periods[W], 2),
6414        wnnn: this._minDigits(c, c._periods[W], 3),
6415        w1: m(c._periods[W], 1),
6416        w10: m(c._periods[W], 10),
6417        w100: m(c._periods[W], 100),
6418        w1000: m(c._periods[W], 1000),
6419        dl: l(D),
6420        dn: this._minDigits(c, c._periods[D], 1),
6421        dnn: this._minDigits(c, c._periods[D], 2),
6422        dnnn: this._minDigits(c, c._periods[D], 3),
6423        d1: m(c._periods[D], 1),
6424        d10: m(c._periods[D], 10),
6425        d100: m(c._periods[D], 100),
6426        d1000: m(c._periods[D], 1000),
6427        hl: l(H),
6428        hn: this._minDigits(c, c._periods[H], 1),
6429        hnn: this._minDigits(c, c._periods[H], 2),
6430        hnnn: this._minDigits(c, c._periods[H], 3),
6431        h1: m(c._periods[H], 1),
6432        h10: m(c._periods[H], 10),
6433        h100: m(c._periods[H], 100),
6434        h1000: m(c._periods[H], 1000),
6435        ml: l(M),
6436        mn: this._minDigits(c, c._periods[M], 1),
6437        mnn: this._minDigits(c, c._periods[M], 2),
6438        mnnn: this._minDigits(c, c._periods[M], 3),
6439        m1: m(c._periods[M], 1),
6440        m10: m(c._periods[M], 10),
6441        m100: m(c._periods[M], 100),
6442        m1000: m(c._periods[M], 1000),
6443        sl: l(S),
6444        sn: this._minDigits(c, c._periods[S], 1),
6445        snn: this._minDigits(c, c._periods[S], 2),
6446        snnn: this._minDigits(c, c._periods[S], 3),
6447        s1: m(c._periods[S], 1),
6448        s10: m(c._periods[S], 10),
6449        s100: m(c._periods[S], 100),
6450        s1000: m(c._periods[S], 1000),
6451      };
6452      var p = e;
6453      for (var i = Y; i <= S; i++) {
6454        var q = "yowdhms".charAt(i);
6455        var r = new RegExp("\\{" + q + "<\\}([\\s\\S]*)\\{" + q + ">\\}", "g");
6456        p = p.replace(r, (!g && d[i]) || (g && h[i]) ? "$1" : "");
6457      }
6458      $.each(o, function (n, v) {
6459        var a = new RegExp("\\{" + n + "\\}", "g");
6460        p = p.replace(a, v);
6461      });
6462      return p;
6463    },
6464    _minDigits: function (a, b, c) {
6465      b = "" + b;
6466      if (b.length >= c) {
6467        return this._translateDigits(a, b);
6468      }
6469      b = "0000000000" + b;
6470      return this._translateDigits(a, b.substr(b.length - c));
6471    },
6472    _translateDigits: function (b, c) {
6473      return ("" + c).replace(/[0-9]/g, function (a) {
6474        return b.options.digits[a];
6475      });
6476    },
6477    _determineShow: function (a) {
6478      var b = a.options.format;
6479      var c = [];
6480      c[Y] = b.match("y") ? "?" : b.match("Y") ? "!" : null;
6481      c[O] = b.match("o") ? "?" : b.match("O") ? "!" : null;
6482      c[W] = b.match("w") ? "?" : b.match("W") ? "!" : null;
6483      c[D] = b.match("d") ? "?" : b.match("D") ? "!" : null;
6484      c[H] = b.match("h") ? "?" : b.match("H") ? "!" : null;
6485      c[M] = b.match("m") ? "?" : b.match("M") ? "!" : null;
6486      c[S] = b.match("s") ? "?" : b.match("S") ? "!" : null;
6487      return c;
6488    },
6489    _calculatePeriods: function (c, d, e, f) {
6490      c._now = f;
6491      c._now.setMilliseconds(0);
6492      var g = new Date(c._now.getTime());
6493      if (c._since) {
6494        if (f.getTime() < c._since.getTime()) {
6495          c._now = f = g;
6496        } else {
6497          f = c._since;
6498        }
6499      } else {
6500        g.setTime(c._until.getTime());
6501        if (f.getTime() > c._until.getTime()) {
6502          c._now = f = g;
6503        }
6504      }
6505      var h = [0, 0, 0, 0, 0, 0, 0];
6506      if (d[Y] || d[O]) {
6507        var i = x._getDaysInMonth(f.getFullYear(), f.getMonth());
6508        var j = x._getDaysInMonth(g.getFullYear(), g.getMonth());
6509        var k =
6510          g.getDate() == f.getDate() ||
6511          (g.getDate() >= Math.min(i, j) && f.getDate() >= Math.min(i, j));
6512        var l = function (a) {
6513          return (a.getHours() * 60 + a.getMinutes()) * 60 + a.getSeconds();
6514        };
6515        var m = Math.max(
6516          0,
6517          (g.getFullYear() - f.getFullYear()) * 12 +
6518            g.getMonth() -
6519            f.getMonth() +
6520            ((g.getDate() < f.getDate() && !k) || (k && l(g) < l(f)) ? -1 : 0)
6521        );
6522        h[Y] = d[Y] ? Math.floor(m / 12) : 0;
6523        h[O] = d[O] ? m - h[Y] * 12 : 0;
6524        f = new Date(f.getTime());
6525        var n = f.getDate() == i;
6526        var o = x._getDaysInMonth(f.getFullYear() + h[Y], f.getMonth() + h[O]);
6527        if (f.getDate() > o) {
6528          f.setDate(o);
6529        }
6530        f.setFullYear(f.getFullYear() + h[Y]);
6531        f.setMonth(f.getMonth() + h[O]);
6532        if (n) {
6533          f.setDate(o);
6534        }
6535      }
6536      var p = Math.floor((g.getTime() - f.getTime()) / 1000);
6537      var q = function (a, b) {
6538        h[a] = d[a] ? Math.floor(p / b) : 0;
6539        p -= h[a] * b;
6540      };
6541      q(W, 604800);
6542      q(D, 86400);
6543      q(H, 3600);
6544      q(M, 60);
6545      q(S, 1);
6546      if (p > 0 && !c._since) {
6547        var r = [1, 12, 4.3482, 7, 24, 60, 60];
6548        var s = S;
6549        var t = 1;
6550        for (var u = S; u >= Y; u--) {
6551          if (d[u]) {
6552            if (h[s] >= t) {
6553              h[s] = 0;
6554              p = 1;
6555            }
6556            if (p > 0) {
6557              h[u]++;
6558              p = 0;
6559              s = u;
6560              t = 1;
6561            }
6562          }
6563          t *= r[u];
6564        }
6565      }
6566      if (e) {
6567        for (var u = Y; u <= S; u++) {
6568          if (e && h[u]) {
6569            e--;
6570          } else if (!e) {
6571            h[u] = 0;
6572          }
6573        }
6574      }
6575      return h;
6576    },
6577  });
6578  var w = ["getTimes"];
6579  function isNotChained(a, b) {
6580    if (
6581      a == "option" &&
6582      (b.length == 0 || (b.length == 1 && typeof b[0] == "string"))
6583    ) {
6584      return true;
6585    }
6586    return $.inArray(a, w) > -1;
6587  }
6588  $.fn.countdown = function (a) {
6589    var b = Array.prototype.slice.call(arguments, 1);
6590    if (isNotChained(a, b)) {
6591      return x["_" + a + "Plugin"].apply(x, [this[0]].concat(b));
6592    }
6593    return this.each(function () {
6594      if (typeof a == "string") {
6595        if (!x["_" + a + "Plugin"]) {
6596          throw "Unknown command: " + a;
6597        }
6598        x["_" + a + "Plugin"].apply(x, [this].concat(b));
6599      } else {
6600        x._attachPlugin(this, a || {});
6601      }
6602    });
6603  };
6604  var x = ($.countdown = new Countdown());
6605})(jQuery);
6606
6607/////////////////////////////////////////////
6608// jQuery Parallax PLUGIN
6609/////////////////////////////////////////////
6610
6611/*
6612Plugin: jQuery Parallax
6613Version 1.1.3
6614Author: Ian Lunn
6615Twitter: @IanLunn
6616Author URL: http://www.ianlunn.co.uk/
6617Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
6618
6619Dual licensed under the MIT and GPL licenses:
6620http://www.opensource.org/licenses/mit-license.php
6621http://www.gnu.org/licenses/gpl.html
6622*/
6623
6624(function ($) {
6625  var $window = $(window);
6626  var windowHeight = $window.height();
6627
6628  $window.resize(function () {
6629    windowHeight = $window.height();
6630  });
6631
6632  $.fn.parallax = function (xpos, speedFactor, outerHeight) {
6633    var $this = $(this);
6634    var getHeight;
6635    var firstTop;
6636    var paddingTop = 0;
6637
6638    //get the starting position of each element to have parallax applied to it
6639    $this.each(function () {
6640      firstTop = $this.offset().top;
6641    });
6642
6643    if (outerHeight) {
6644      getHeight = function (jqo) {
6645        return jqo.outerHeight(true);
6646      };
6647    } else {
6648      getHeight = function (jqo) {
6649        return jqo.height();
6650      };
6651    }
6652
6653    // setup defaults if arguments aren't specified
6654    if (arguments.length < 1 || xpos === null) xpos = "50%";
6655    if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
6656    if (arguments.length < 3 || outerHeight === null) outerHeight = true;
6657
6658    // function to be called whenever the window is scrolled or resized
6659    function update() {
6660      var pos = $window.scrollTop();
6661
6662      $this.each(function () {
6663        var $element = $(this);
6664        var top = $element.offset().top;
6665        var height = getHeight($element);
6666
6667        // Check if totally above or totally below viewport
6668        if (top + height < pos || top > pos + windowHeight) {
6669          return;
6670        }
6671
6672        $this.css(
6673          "backgroundPosition",
6674          xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"
6675        );
6676      });
6677    }
6678
6679    $window.bind("scroll", update).resize(update);
6680    update();
6681  };
6682})(jQuery);
6683
6684/////////////////////////////////////////////
6685// VIEWPORTS PLUGIN
6686/////////////////////////////////////////////
6687
6688(function ($) {
6689  $.belowthefold = function (element, settings) {
6690    var fold = $(window).height() + $(window).scrollTop();
6691    return fold <= $(element).offset().top - settings.threshold;
6692  };
6693  $.abovethetop = function (element, settings) {
6694    var top = $(window).scrollTop();
6695    return (
6696      top >= $(element).offset().top + $(element).height() - settings.threshold
6697    );
6698  };
6699  $.rightofscreen = function (element, settings) {
6700    var fold = $(window).width() + $(window).scrollLeft();
6701    return fold <= $(element).offset().left - settings.threshold;
6702  };
6703  $.leftofscreen = function (element, settings) {
6704    var left = $(window).scrollLeft();
6705    return (
6706      left >= $(element).offset().left + $(element).width() - settings.threshold
6707    );
6708  };
6709  $.inviewport = function (element, settings) {
6710    return (
6711      !$.rightofscreen(element, settings) &&
6712      !$.leftofscreen(element, settings) &&
6713      !$.belowthefold(element, settings) &&
6714      !$.abovethetop(element, settings)
6715    );
6716  };
6717  $.extend($.expr[":"], {
6718    "below-the-fold": function (a, i, m) {
6719      return $.belowthefold(a, { threshold: 0 });
6720    },
6721    "above-the-top": function (a, i, m) {
6722      return $.abovethetop(a, { threshold: 0 });
6723    },
6724    "left-of-screen": function (a, i, m) {
6725      return $.leftofscreen(a, { threshold: 0 });
6726    },
6727    "right-of-screen": function (a, i, m) {
6728      return $.rightofscreen(a, { threshold: 0 });
6729    },
6730    "in-viewport": function (a, i, m) {
6731      return $.inviewport(a, { threshold: 50 });
6732    },
6733  });
6734})(jQuery);
6735
6736/////////////////////////////////////////////
6737// STICKY SIDEBAR PLUGIN
6738/////////////////////////////////////////////
6739
6740/**
6741 * @name jQuery Stick 'em
6742 * @author Trevor Davis
6743 * @version 1.4.1
6744 *
6745 *	$('.container').stickem({
6746 *		item: '.stickem',
6747 *		container: '.stickem-container',
6748 *		stickClass: 'stickit',
6749 *		endStickClass: 'stickit-end',
6750 *		offset: 0,
6751 *		onStick: null,
6752 *		onUnstick: null
6753 *	});
6754 */
6755
6756(function ($, window, document, undefined) {
6757  var Stickem = function (elem, options) {
6758    this.elem = elem;
6759    this.$elem = $(elem);
6760    this.options = options;
6761    this.metadata = this.$elem.data("stickem-options");
6762    this.$win = $(window);
6763  };
6764
6765  Stickem.prototype = {
6766    defaults: {
6767      item: ".stickem",
6768      container: ".stickem-container",
6769      stickClass: "stickit",
6770      endStickClass: "stickit-end",
6771      offset: 0,
6772      start: 0,
6773      onStick: null,
6774      onUnstick: null,
6775    },
6776
6777    init: function () {
6778      var _self = this;
6779
6780      //Merge options
6781      _self.config = $.extend(
6782        {},
6783        _self.defaults,
6784        _self.options,
6785        _self.metadata
6786      );
6787
6788      _self.setWindowHeight();
6789      _self.getItems();
6790      _self.bindEvents();
6791
6792      return _self;
6793    },
6794
6795    bindEvents: function () {
6796      var _self = this;
6797
6798      _self.$win.on("scroll.stickem", $.proxy(_self.handleScroll, _self));
6799      _self.$win.on("resize.stickem", $.proxy(_self.handleResize, _self));
6800    },
6801
6802    destroy: function () {
6803      var _self = this;
6804
6805      _self.$win.off("scroll.stickem");
6806      _self.$win.off("resize.stickem");
6807    },
6808
6809    getItem: function (index, element) {
6810      var _self = this;
6811      var $this = $(element);
6812      var item = {
6813        $elem: $this,
6814        elemHeight: $this.height(),
6815        $container: $this.parents(_self.config.container),
6816        isStuck: false,
6817      };
6818
6819      //If the element is smaller than the window
6820      if (_self.windowHeight > item.elemHeight) {
6821        item.containerHeight = item.$container.outerHeight();
6822        item.containerInner = {
6823          border: {
6824            bottom: parseInt(item.$container.css("border-bottom"), 10) || 0,
6825            top: parseInt(item.$container.css("border-top"), 10) || 0,
6826          },
6827          padding: {
6828            bottom: parseInt(item.$container.css("padding-bottom"), 10) || 0,
6829            top: parseInt(item.$container.css("padding-top"), 10) || 0,
6830          },
6831        };
6832
6833        item.containerInnerHeight = item.$container.height();
6834        item.containerStart =
6835          item.$container.offset().top -
6836          _self.config.offset +
6837          _self.config.start +
6838          item.containerInner.padding.top +
6839          item.containerInner.border.top;
6840        item.scrollFinish =
6841          item.containerStart -
6842          _self.config.start +
6843          (item.containerInnerHeight - item.elemHeight);
6844
6845        //If the element is smaller than the container
6846        if (item.containerInnerHeight > item.elemHeight) {
6847          _self.items.push(item);
6848        }
6849      } else {
6850        item.$elem.removeClass(
6851          _self.config.stickClass + " " + _self.config.endStickClass
6852        );
6853      }
6854    },
6855
6856    getItems: function () {
6857      var _self = this;
6858
6859      _self.items = [];
6860
6861      _self.$elem.find(_self.config.item).each($.proxy(_self.getItem, _self));
6862    },
6863
6864    handleResize: function () {
6865      var _self = this;
6866
6867      _self.getItems();
6868      _self.setWindowHeight();
6869    },
6870
6871    handleScroll: function () {
6872      var _self = this;
6873
6874      if (_self.items.length > 0) {
6875        var pos = _self.$win.scrollTop();
6876
6877        for (var i = 0, len = _self.items.length; i < len; i++) {
6878          var item = _self.items[i];
6879
6880          //If it's stuck, and we need to unstick it, or if the page loads below it
6881          if (
6882            (item.isStuck &&
6883              (pos < item.containerStart || pos > item.scrollFinish)) ||
6884            pos > item.scrollFinish
6885          ) {
6886            item.$elem.removeClass(_self.config.stickClass);
6887
6888            //only at the bottom
6889            if (pos > item.scrollFinish) {
6890              item.$elem.addClass(_self.config.endStickClass);
6891            }
6892
6893            item.isStuck = false;
6894
6895            //if supplied fire the onUnstick callback
6896            if (_self.config.onUnstick) {
6897              _self.config.onUnstick(item);
6898            }
6899
6900            //If we need to stick it
6901          } else if (
6902            item.isStuck === false &&
6903            pos > item.containerStart &&
6904            pos < item.scrollFinish
6905          ) {
6906            item.$elem
6907              .removeClass(_self.config.endStickClass)
6908              .addClass(_self.config.stickClass);
6909            item.isStuck = true;
6910
6911            //if supplied fire the onStick callback
6912            if (_self.config.onStick) {
6913              _self.config.onStick(item);
6914            }
6915          }
6916        }
6917      }
6918    },
6919
6920    setWindowHeight: function () {
6921      var _self = this;
6922
6923      _self.windowHeight = _self.$win.height() - _self.config.offset;
6924    },
6925  };
6926
6927  Stickem.defaults = Stickem.prototype.defaults;
6928
6929  $.fn.stickem = function (options) {
6930    //Create a destroy method so that you can kill it and call it again.
6931    this.destroy = function () {
6932      this.each(function () {
6933        new Stickem(this, options).destroy();
6934      });
6935    };
6936
6937    return this.each(function () {
6938      new Stickem(this, options).init();
6939    });
6940  };
6941})(jQuery, window, document);
6942
6943/////////////////////////////////////////////
6944// vCenter PLUGIN
6945/////////////////////////////////////////////
6946
6947(function ($) {
6948  $.fn.vCenter = function () {
6949    return this.each(function () {
6950      var height = $(this).outerHeight();
6951      $(this).css("margin-bottom", -height / 2);
6952    });
6953  };
6954})(jQuery);
6955(function ($) {
6956  $.fn.vCenterTop = function () {
6957    return this.each(function () {
6958      var height = $(this).outerHeight();
6959      $(this).css("margin-top", -height / 2);
6960    });
6961  };
6962})(jQuery);

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.