/*! jQuery Mobile v1.3.0 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */

(function(a, b, c) {
    typeof define == "function" && define.amd ? define(["jquery"], function(d) {
        return c(d, a, b), d.mobile
    }) : c(a.jQuery, a, b)
})(this, document, function(a, b, c, d) {
    (function(a, b, d) {
        function k(a) {
            return a = a || location.href, "#" + a.replace(/^[^#]*#?(.*)$/, "$1")
        }
        var e = "hashchange",
            f = c,
            g, h = a.event.special,
            i = f.documentMode,
            j = "on" + e in b && (i === d || i > 7);
        a.fn[e] = function(a) {
            return a ? this.bind(e, a) : this.trigger(e)
        }, a.fn[e].delay = 50, h[e] = a.extend(h[e], {
            setup: function() {
                if (j) return !1;
                a(g.start)
            },
            teardown: function() {
                if (j) return !1;
                a(g.stop)
            }
        }), g = function() {
            function n() {
                var c = k(),
                    d = m(h);
                c !== h ? (l(h = c, d), a(b).trigger(e)) : d !== h && (location.href = location.href.replace(/#.*/, "") + d), g = setTimeout(n, a.fn[e].delay)
            }
            var c = {},
                g, h = k(),
                i = function(a) {
                    return a
                },
                l = i,
                m = i;
            return c.start = function() {
                g || n()
            }, c.stop = function() {
                g && clearTimeout(g), g = d
            }, b.attachEvent && !b.addEventListener && !j && function() {
                var b, d;
                c.start = function() {
                    b || (d = a.fn[e].src, d = d && d + k(), b = a('<iframe tabindex="-1" title="empty"/>').hide().one("load", function() {
                        d || l(k()), n()
                    }).attr("src", d || "javascript:0").insertAfter("body")[0].contentWindow, f.onpropertychange = function() {
                        try {
                            event.propertyName === "title" && (b.document.title = f.title)
                        } catch (a) {}
                    })
                }, c.stop = i, m = function() {
                    return k(b.location.href)
                }, l = function(c, d) {
                    var g = b.document,
                        h = a.fn[e].domain;
                    c !== d && (g.title = f.title, g.open(), h && g.write('<script>document.domain="' + h + '"</script>'), g.close(), b.location.hash = c)
                }
            }(), c
        }()
    })(a, this),
    function(a) {
        a.event.special.throttledresize = {
            setup: function() {
                a(this).bind("resize", c)
            },
            teardown: function() {
                a(this).unbind("resize", c)
            }
        };
        var b = 250,
            c = function() {
                f = (new Date).getTime(), g = f - d, g >= b ? (d = f, a(this).trigger("throttledresize")) : (e && clearTimeout(e), e = setTimeout(c, b - g))
            },
            d = 0,
            e, f, g
    }(a),
    function(a) {
        a.mobile = {}
    }(a),
    function(a, b, d) {
        var e = {};
        a.mobile = a.extend(a.mobile, {
            version: "1.3.0",
            ns: "",
            subPageUrlKey: "ui-page",
            activePageClass: "ui-page-active",
            activeBtnClass: "ui-btn-active",
            focusClass: "ui-focus",
            ajaxEnabled: !0,
            hashListeningEnabled: !0,
            linkBindingEnabled: !0,
            defaultPageTransition: "fade",
            maxTransitionWidth: !1,
            minScrollBack: 250,
            touchOverflowEnabled: !1,
            defaultDialogTransition: "pop",
            pageLoadErrorMessage: "Error Loading Page",
            pageLoadErrorMessageTheme: "e",
            phonegapNavigationEnabled: !1,
            autoInitializePage: !0,
            pushStateEnabled: !0,
            ignoreContentEnabled: !1,
            orientationChangeEnabled: !0,
            buttonMarkup: {
                hoverDelay: 200
            },
            window: a(b),
            document: a(c),
            keyCode: {
                ALT: 18,
                BACKSPACE: 8,
                CAPS_LOCK: 20,
                COMMA: 188,
                COMMAND: 91,
                COMMAND_LEFT: 91,
                COMMAND_RIGHT: 93,
                CONTROL: 17,
                DELETE: 46,
                DOWN: 40,
                END: 35,
                ENTER: 13,
                ESCAPE: 27,
                HOME: 36,
                INSERT: 45,
                LEFT: 37,
                MENU: 93,
                NUMPAD_ADD: 107,
                NUMPAD_DECIMAL: 110,
                NUMPAD_DIVIDE: 111,
                NUMPAD_ENTER: 108,
                NUMPAD_MULTIPLY: 106,
                NUMPAD_SUBTRACT: 109,
                PAGE_DOWN: 34,
                PAGE_UP: 33,
                PERIOD: 190,
                RIGHT: 39,
                SHIFT: 16,
                SPACE: 32,
                TAB: 9,
                UP: 38,
                WINDOWS: 91
            },
            behaviors: {},
            silentScroll: function(c) {
                a.type(c) !== "number" && (c = a.mobile.defaultHomeScroll), a.event.special.scrollstart.enabled = !1, setTimeout(function() {
                    b.scrollTo(0, c), a.mobile.document.trigger("silentscroll", {
                        x: 0,
                        y: c
                    })
                }, 20), setTimeout(function() {
                    a.event.special.scrollstart.enabled = !0
                }, 150)
            },
            nsNormalizeDict: e,
            nsNormalize: function(b) {
                if (!b) return;
                return e[b] || (e[b] = a.camelCase(a.mobile.ns + b))
            },
            getInheritedTheme: function(a, b) {
                var c = a[0],
                    d = "",
                    e = /ui-(bar|body|overlay)-([a-z])\b/,
                    f, g;
                while (c) {
                    f = c.className || "";
                    if (f && (g = e.exec(f)) && (d = g[2])) break;
                    c = c.parentNode
                }
                return d || b || "a"
            },
            closestPageData: function(a) {
                return a.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("mobile-page")
            },
            enhanceable: function(a) {
                return this.haveParents(a, "enhance")
            },
            hijackable: function(a) {
                return this.haveParents(a, "ajax")
            },
            haveParents: function(b, c) {
                if (!a.mobile.ignoreContentEnabled) return b;
                var d = b.length,
                    e = a(),
                    f, g, h;
                for (var i = 0; i < d; i++) {
                    g = b.eq(i), h = !1, f = b[i];
                    while (f) {
                        var j = f.getAttribute ? f.getAttribute("data-" + a.mobile.ns + c) : "";
                        if (j === "false") {
                            h = !0;
                            break
                        }
                        f = f.parentNode
                    }
                    h || (e = e.add(g))
                }
                return e
            },
            getScreenHeight: function() {
                return b.innerHeight || a.mobile.window.height()
            }
        }, a.mobile), a.fn.jqmData = function(b, c) {
            var e;
            return typeof b != "undefined" && (b && (b = a.mobile.nsNormalize(b)), arguments.length < 2 || c === d ? e = this.data(b) : e = this.data(b, c)), e
        }, a.jqmData = function(b, c, d) {
            var e;
            return typeof c != "undefined" && (e = a.data(b, c ? a.mobile.nsNormalize(c) : c, d)), e
        }, a.fn.jqmRemoveData = function(b) {
            return this.removeData(a.mobile.nsNormalize(b))
        }, a.jqmRemoveData = function(b, c) {
            return a.removeData(b, a.mobile.nsNormalize(c))
        }, a.fn.removeWithDependents = function() {
            a.removeWithDependents(this)
        }, a.removeWithDependents = function(b) {
            var c = a(b);
            (c.jqmData("dependents") || a()).remove(), c.remove()
        }, a.fn.addDependents = function(b) {
            a.addDependents(a(this), b)
        }, a.addDependents = function(b, c) {
            var d = a(b).jqmData("dependents") || a();
            a(b).jqmData("dependents", a.merge(d, c))
        }, a.fn.getEncodedText = function() {
            return a("<div/>").text(a(this).text()).html()
        }, a.fn.jqmEnhanceable = function() {
            return a.mobile.enhanceable(this)
        }, a.fn.jqmHijackable = function() {
            return a.mobile.hijackable(this)
        };
        var f = a.find,
            g = /:jqmData\(([^)]*)\)/g;
        a.find = function(b, c, d, e) {
            return b = b.replace(g, "[data-" + (a.mobile.ns || "") + "$1]"), f.call(this, b, c, d, e)
        }, a.extend(a.find, f), a.find.matches = function(b, c) {
            return a.find(b, null, null, c)
        }, a.find.matchesSelector = function(b, c) {
            return a.find(c, null, null, [b]).length > 0
        }
    }(a, this),
    function(a, d) {
        b.matchMedia = b.matchMedia || function(a, b) {
            var c, d = a.documentElement,
                e = d.firstElementChild || d.firstChild,
                f = a.createElement("body"),
                g = a.createElement("div");
            return g.id = "mq-test-1", g.style.cssText = "position:absolute;top:-100em", f.style.background = "none", f.appendChild(g),
                function(a) {
                    return g.innerHTML = '&shy;<style media="' + a + '"> #mq-test-1 { width: 42px; }</style>', d.insertBefore(f, e), c = g.offsetWidth === 42, d.removeChild(f), {
                        matches: c,
                        media: a
                    }
                }
        }(c), a.mobile.media = function(a) {
            return b.matchMedia(a).matches
        }
    }(a),
    function(a, c) {
        a.extend(a.support, {
            orientation: "orientation" in b && "onorientationchange" in b
        })
    }(a),
    function(a, b) {
        function o() {
            var a = g();
            a !== h && (h = a, d.trigger(e))
        }
        var d = a(b),
            e = "orientationchange",
            f, g, h, i, j, k = {
                0: !0,
                180: !0
            };
        if (a.support.orientation) {
            var l = b.innerWidth || d.width(),
                m = b.innerHeight || d.height(),
                n = 50;
            i = l > m && l - m > n, j = k[b.orientation];
            if (i && j || !i && !j) k = {
                "-90": !0,
                90: !0
            }
        }
        a.event.special.orientationchange = a.extend({}, a.event.special.orientationchange, {
            setup: function() {
                if (a.support.orientation && !a.event.special.orientationchange.disabled) return !1;
                h = g(), d.bind("throttledresize", o)
            },
            teardown: function() {
                if (a.support.orientation && !a.event.special.orientationchange.disabled) return !1;
                d.unbind("throttledresize", o)
            },
            add: function(a) {
                var b = a.handler;
                a.handler = function(a) {
                    return a.orientation = g(), b.apply(this, arguments)
                }
            }
        }), a.event.special.orientationchange.orientation = g = function() {
            var d = !0,
                e = c.documentElement;
            return a.support.orientation ? d = k[b.orientation] : d = e && e.clientWidth / e.clientHeight < 1.1, d ? "portrait" : "landscape"
        }, a.fn[e] = function(a) {
            return a ? this.bind(e, a) : this.trigger(e)
        }, a.attrFn && (a.attrFn[e] = !0)
    }(a, this),
    function(a, b) {
        var d = {
            touch: "ontouchend" in c
        };
        a.mobile.support = a.mobile.support || {}, a.extend(a.support, d), a.extend(a.mobile.support, d)
    }(a),
    function(a, d) {
        function e(a) {
            var b = a.charAt(0).toUpperCase() + a.substr(1),
                c = (a + " " + h.join(b + " ") + b).split(" ");
            for (var e in c)
                if (g[c[e]] !== d) return !0
        }

        function m(a, b, d) {
            var e = c.createElement("div"),
                f = function(a) {
                    return a.charAt(0).toUpperCase() + a.substr(1)
                },
                g = function(a) {
                    return a === "" ? "" : "-" + a.charAt(0).toLowerCase() + a.substr(1) + "-"
                },
                i = function(c) {
                    var d = g(c) + a + ": " + b + ";",
                        h = f(c),
                        i = h + (h === "" ? a : f(a));
                    e.setAttribute("style", d), !e.style[i] || (k = !0)
                },
                j = d ? d : h,
                k;
            for (var l = 0; l < j.length; l++) i(j[l]);
            return !!k
        }

        function n() {
            var e = "transform-3d",
                g = a.mobile.media("(-" + h.join("-" + e + "),(-") + "-" + e + "),(" + e + ")");
            if (g) return !!g;
            var i = c.createElement("div"),
                j = {
                    MozTransform: "-moz-transform",
                    transform: "transform"
                };
            f.append(i);
            for (var k in j) i.style[k] !== d && (i.style[k] = "translate3d( 100px, 1px, 1px )", g = b.getComputedStyle(i).getPropertyValue(j[k]));
            return !!g && g !== "none"
        }

        function o() {
            var b = location.protocol + "//" + location.host + location.pathname + "ui-dir/",
                c = a("head base"),
                d = null,
                e = "",
                g, h;
            return c.length ? e = c.attr("href") : c = d = a("<base>", {
                href: b
            }).appendTo("head"), g = a("<a href='testurl' />").prependTo(f), h = g[0].href, c[0].href = e || location.pathname, d && d.remove(), h.indexOf(b) === 0
        }

        function p() {
            var a = c.createElement("x"),
                d = c.documentElement,
                e = b.getComputedStyle,
                f;
            return "pointerEvents" in a.style ? (a.style.pointerEvents = "auto", a.style.pointerEvents = "x", d.appendChild(a), f = e && e(a, "").pointerEvents === "auto", d.removeChild(a), !!f) : !1
        }

        function q() {
            var a = c.createElement("div");
            return typeof a.getBoundingClientRect != "undefined"
        }

        function r() {
            var a = b,
                c = navigator.userAgent,
                d = navigator.platform,
                e = c.match(/AppleWebKit\/([0-9]+)/),
                f = !!e && e[1],
                g = c.match(/Fennec\/([0-9]+)/),
                h = !!g && g[1],
                i = c.match(/Opera Mobi\/([0-9]+)/),
                j = !!i && i[1];
            return (d.indexOf("iPhone") > -1 || d.indexOf("iPad") > -1 || d.indexOf("iPod") > -1) && f && f < 534 || a.operamini && {}.toString.call(a.operamini) === "[object OperaMini]" || i && j < 7458 || c.indexOf("Android") > -1 && f && f < 533 || h && h < 6 || "palmGetResource" in b && f && f < 534 || c.indexOf("MeeGo") > -1 && c.indexOf("NokiaBrowser/8.5.0") > -1 ? !1 : !0
        }
        var f = a("<body>").prependTo("html"),
            g = f[0].style,
            h = ["Webkit", "Moz", "O"],
            i = "palmGetResource" in b,
            j = b.opera,
            k = b.operamini && {}.toString.call(b.operamini) === "[object OperaMini]",
            l = b.blackberry && !e("-webkit-transform");
        a.extend(a.mobile, {
            browser: {}
        }), a.mobile.browser.oldIE = function() {
            var a = 3,
                b = c.createElement("div"),
                d = b.all || [];
            do b.innerHTML = "<!--[if gt IE " + ++a + "]><br><![endif]-->"; while (d[0]);
            return a > 4 ? a : !a
        }(), a.extend(a.support, {
            cssTransitions: "WebKitTransitionEvent" in b || m("transition", "height 100ms linear", ["Webkit", "Moz", ""]) && !a.mobile.browser.oldIE && !j,
            pushState: "pushState" in history && "replaceState" in history && b.navigator.userAgent.search(/CriOS/) === -1,
            mediaquery: a.mobile.media("only all"),
            cssPseudoElement: !!e("content"),
            touchOverflow: !!e("overflowScrolling"),
            cssTransform3d: n(),
            boxShadow: !!e("boxShadow") && !l,
            fixedPosition: r(),
            scrollTop: ("pageXOffset" in b || "scrollTop" in c.documentElement || "scrollTop" in f[0]) && !i && !k,
            dynamicBaseTag: o(),
            cssPointerEvents: p(),
            boundingRect: q()
        }), f.remove();
        var s = function() {
            var a = b.navigator.userAgent;
            return a.indexOf("Nokia") > -1 && (a.indexOf("Symbian/3") > -1 || a.indexOf("Series60/5") > -1) && a.indexOf("AppleWebKit") > -1 && a.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)
        }();
        a.mobile.gradeA = function() {
            return (a.support.mediaquery || a.mobile.browser.oldIE && a.mobile.browser.oldIE >= 7) && (a.support.boundingRect || a.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/) !== null)
        }, a.mobile.ajaxBlacklist = b.blackberry && !b.WebKitPoint || k || s, s && a(function() {
            a("head link[rel='stylesheet']").attr("rel", "alternate stylesheet").attr("rel", "stylesheet")
        }), a.support.boxShadow || a("html").addClass("ui-mobile-nosupport-boxshadow")
    }(a),
    function(a, b) {
        var c = a.mobile.window,
            d, e;
        a.event.special.navigate = d = {
            bound: !1,
            pushStateEnabled: !0,
            originalEventName: b,
            isPushStateEnabled: function() {
                return a.support.pushState && a.mobile.pushStateEnabled === !0 && this.isHashChangeEnabled()
            },
            isHashChangeEnabled: function() {
                return a.mobile.hashListeningEnabled === !0
            },
            popstate: function(b) {
                var d = new a.Event("navigate"),
                    e = new a.Event("beforenavigate"),
                    f = b.originalEvent.state || {},
                    g = location.href;
                c.trigger(e);
                if (e.isDefaultPrevented()) return;
                b.historyState && a.extend(f, b.historyState), d.originalEvent = b, setTimeout(function() {
                    c.trigger(d, {
                        state: f
                    })
                }, 0)
            },
            hashchange: function(b, d) {
                var e = new a.Event("navigate"),
                    f = new a.Event("beforenavigate");
                c.trigger(f);
                if (f.isDefaultPrevented()) return;
                e.originalEvent = b, c.trigger(e, {
                    state: b.hashchangeState || {}
                })
            },
            setup: function(a, b) {
                if (d.bound) return;
                d.bound = !0, d.isPushStateEnabled() ? (d.originalEventName = "popstate", c.bind("popstate.navigate", d.popstate)) : d.isHashChangeEnabled() && (d.originalEventName = "hashchange", c.bind("hashchange.navigate", d.hashchange))
            }
        }
    }(a),
    function(a, b, c, d) {
        function x(a) {
            while (a && typeof a.originalEvent != "undefined") a = a.originalEvent;
            return a
        }

        function y(b, c) {
            var e = b.type,
                f, g, i, k, l, m, n, o, p;
            b = a.Event(b), b.type = c, f = b.originalEvent, g = a.event.props, e.search(/^(mouse|click)/) > -1 && (g = j);
            if (f)
                for (n = g.length, k; n;) k = g[--n], b[k] = f[k];
            e.search(/mouse(down|up)|click/) > -1 && !b.which && (b.which = 1);
            if (e.search(/^touch/) !== -1) {
                i = x(f), e = i.touches, l = i.changedTouches, m = e && e.length ? e[0] : l && l.length ? l[0] : d;
                if (m)
                    for (o = 0, p = h.length; o < p; o++) k = h[o], b[k] = m[k]
            }
            return b
        }

        function z(b) {
            var c = {},
                d, f;
            while (b) {
                d = a.data(b, e);
                for (f in d) d[f] && (c[f] = c.hasVirtualBinding = !0);
                b = b.parentNode
            }
            return c
        }

        function A(b, c) {
            var d;
            while (b) {
                d = a.data(b, e);
                if (d && (!c || d[c])) return b;
                b = b.parentNode
            }
            return null
        }

        function B() {
            r = !1
        }

        function C() {
            r = !0
        }

        function D() {
            v = 0, p.length = 0, q = !1, C()
        }

        function E() {
            B()
        }

        function F() {
            G(), l = setTimeout(function() {
                l = 0, D()
            }, a.vmouse.resetTimerDuration)
        }

        function G() {
            l && (clearTimeout(l), l = 0)
        }

        function H(b, c, d) {
            var e;
            if (d && d[b] || !d && A(c.target, b)) e = y(c, b), a(c.target).trigger(e);
            return e
        }

        function I(b) {
            var c = a.data(b.target, f);
            if (!q && (!v || v !== c)) {
                var d = H("v" + b.type, b);
                d && (d.isDefaultPrevented() && b.preventDefault(), d.isPropagationStopped() && b.stopPropagation(), d.isImmediatePropagationStopped() && b.stopImmediatePropagation())
            }
        }

        function J(b) {
            var c = x(b).touches,
                d, e;
            if (c && c.length === 1) {
                d = b.target, e = z(d);
                if (e.hasVirtualBinding) {
                    v = u++, a.data(d, f, v), G(), E(), o = !1;
                    var g = x(b).touches[0];
                    m = g.pageX, n = g.pageY, H("vmouseover", b, e), H("vmousedown", b, e)
                }
            }
        }

        function K(a) {
            if (r) return;
            o || H("vmousecancel", a, z(a.target)), o = !0, F()
        }

        function L(b) {
            if (r) return;
            var c = x(b).touches[0],
                d = o,
                e = a.vmouse.moveDistanceThreshold,
                f = z(b.target);
            o = o || Math.abs(c.pageX - m) > e || Math.abs(c.pageY - n) > e, o && !d && H("vmousecancel", b, f), H("vmousemove", b, f), F()
        }

        function M(a) {
            if (r) return;
            C();
            var b = z(a.target),
                c;
            H("vmouseup", a, b);
            if (!o) {
                var d = H("vclick", a, b);
                d && d.isDefaultPrevented() && (c = x(a).changedTouches[0], p.push({
                    touchID: v,
                    x: c.clientX,
                    y: c.clientY
                }), q = !0)
            }
            H("vmouseout", a, b), o = !1, F()
        }

        function N(b) {
            var c = a.data(b, e),
                d;
            if (c)
                for (d in c)
                    if (c[d]) return !0;
            return !1
        }

        function O() {}

        function P(b) {
            var c = b.substr(1);
            return {
                setup: function(d, f) {
                    N(this) || a.data(this, e, {});
                    var g = a.data(this, e);
                    g[b] = !0, k[b] = (k[b] || 0) + 1, k[b] === 1 && t.bind(c, I), a(this).bind(c, O), s && (k.touchstart = (k.touchstart || 0) + 1, k.touchstart === 1 && t.bind("touchstart", J).bind("touchend", M).bind("touchmove", L).bind("scroll", K))
                },
                teardown: function(d, f) {
                    --k[b], k[b] || t.unbind(c, I), s && (--k.touchstart, k.touchstart || t.unbind("touchstart", J).unbind("touchmove", L).unbind("touchend", M).unbind("scroll", K));
                    var g = a(this),
                        h = a.data(this, e);
                    h && (h[b] = !1), g.unbind(c, O), N(this) || g.removeData(e)
                }
            }
        }
        var e = "virtualMouseBindings",
            f = "virtualTouchID",
            g = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),
            h = "clientX clientY pageX pageY screenX screenY".split(" "),
            i = a.event.mouseHooks ? a.event.mouseHooks.props : [],
            j = a.event.props.concat(i),
            k = {},
            l = 0,
            m = 0,
            n = 0,
            o = !1,
            p = [],
            q = !1,
            r = !1,
            s = "addEventListener" in c,
            t = a(c),
            u = 1,
            v = 0,
            w;
        a.vmouse = {
            moveDistanceThreshold: 10,
            clickDistanceThreshold: 10,
            resetTimerDuration: 1500
        };
        for (var Q = 0; Q < g.length; Q++) a.event.special[g[Q]] = P(g[Q]);
        s && c.addEventListener("click", function(b) {
            var c = p.length,
                d = b.target,
                e, g, h, i, j, k;
            if (c) {
                e = b.clientX, g = b.clientY, w = a.vmouse.clickDistanceThreshold, h = d;
                while (h) {
                    for (i = 0; i < c; i++) {
                        j = p[i], k = 0;
                        if (h === d && Math.abs(j.x - e) < w && Math.abs(j.y - g) < w || a.data(h, f) === j.touchID) {
                            b.preventDefault(), b.stopPropagation();
                            return
                        }
                    }
                    h = h.parentNode
                }
            }
        }, !0)
    }(a, b, c),
    function(a, b, d) {
        function k(b, c, d) {
            var e = d.type;
            d.type = c, a.event.dispatch.call(b, d), d.type = e
        }
        var e = a(c);
        a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "), function(b, c) {
            a.fn[c] = function(a) {
                return a ? this.bind(c, a) : this.trigger(c)
            }, a.attrFn && (a.attrFn[c] = !0)
        });
        var f = a.mobile.support.touch,
            g = "touchmove scroll",
            h = f ? "touchstart" : "mousedown",
            i = f ? "touchend" : "mouseup",
            j = f ? "touchmove" : "mousemove";
        a.event.special.scrollstart = {
            enabled: !0,
            setup: function() {
                function f(a, c) {
                    d = c, k(b, d ? "scrollstart" : "scrollstop", a)
                }
                var b = this,
                    c = a(b),
                    d, e;
                c.bind(g, function(b) {
                    if (!a.event.special.scrollstart.enabled) return;
                    d || f(b, !0), clearTimeout(e), e = setTimeout(function() {
                        f(b, !1)
                    }, 50)
                })
            }
        }, a.event.special.tap = {
            tapholdThreshold: 750,
            setup: function() {
                var b = this,
                    c = a(b);
                c.bind("vmousedown", function(d) {
                    function i() {
                        clearTimeout(h)
                    }

                    function j() {
                        i(), c.unbind("vclick", l).unbind("vmouseup", i), e.unbind("vmousecancel", j)
                    }

                    function l(a) {
                        j(), f === a.target && k(b, "tap", a)
                    }
                    if (d.which && d.which !== 1) return !1;
                    var f = d.target,
                        g = d.originalEvent,
                        h;
                    c.bind("vmouseup", i).bind("vclick", l), e.bind("vmousecancel", j), h = setTimeout(function() {
                        k(b, "taphold", a.Event("taphold", {
                            target: f
                        }))
                    }, a.event.special.tap.tapholdThreshold)
                })
            }
        }, a.event.special.swipe = {
            scrollSupressionThreshold: 30,
            durationThreshold: 1e3,
            horizontalDistanceThreshold: 30,
            verticalDistanceThreshold: 75,
            start: function(b) {
                var c = b.originalEvent.touches ? b.originalEvent.touches[0] : b;
                return {
                    time: (new Date).getTime(),
                    coords: [c.pageX, c.pageY],
                    origin: a(b.target)
                }
            },
            stop: function(a) {
                var b = a.originalEvent.touches ? a.originalEvent.touches[0] : a;
                return {
                    time: (new Date).getTime(),
                    coords: [b.pageX, b.pageY]
                }
            },
            handleSwipe: function(b, c) {
                c.time - b.time < a.event.special.swipe.durationThreshold && Math.abs(b.coords[0] - c.coords[0]) > a.event.special.swipe.horizontalDistanceThreshold && Math.abs(b.coords[1] - c.coords[1]) < a.event.special.swipe.verticalDistanceThreshold && b.origin.trigger("swipe").trigger(b.coords[0] > c.coords[0] ? "swipeleft" : "swiperight")
            },
            setup: function() {
                var b = this,
                    c = a(b);
                c.bind(h, function(b) {
                    function g(b) {
                        if (!e) return;
                        f = a.event.special.swipe.stop(b), Math.abs(e.coords[0] - f.coords[0]) > a.event.special.swipe.scrollSupressionThreshold && b.preventDefault()
                    }
                    var e = a.event.special.swipe.start(b),
                        f;
                    c.bind(j, g).one(i, function() {
                        c.unbind(j, g), e && f && a.event.special.swipe.handleSwipe(e, f), e = f = d
                    })
                })
            }
        }, a.each({
            scrollstop: "scrollstart",
            taphold: "tap",
            swipeleft: "swipe",
            swiperight: "swipe"
        }, function(b, c) {
            a.event.special[b] = {
                setup: function() {
                    a(this).bind(c, a.noop)
                }
            }
        })
    }(a, this)
})