(function(c) {
    function o(b) { return typeof b == "object" ? b : { top: b, left: b} } var m = c.scrollTo = function(b, g, a) { c(window).scrollTo(b, g, a) }; m.defaults = { axis: "xy", duration: parseFloat(c.fn.jquery) >= 1.3 ? 0 : 1 }; m.window = function() { return c(window)._scrollable() }; c.fn._scrollable = function() {
        return this.map(function() {
            if (!(!this.nodeName || c.inArray(this.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1)) return this; var b = (this.contentWindow || this).document || this.ownerDocument || this; return c.browser.safari ||
b.compatMode == "BackCompat" ? b.body : b.documentElement
        })
    }; c.fn.scrollTo = function(b, g, a) {
        if (typeof g == "object") { a = g; g = 0 } if (typeof a == "function") a = { onAfter: a }; if (b == "max") b = 9E9; a = c.extend({}, m.defaults, a); g = g || a.speed || a.duration; a.queue = a.queue && a.axis.length > 1; if (a.queue) g /= 2; a.offset = o(a.offset); a.over = o(a.over); return this._scrollable().each(function() {
            function i(n) { j.animate(e, g, a.easing, n && function() { n.call(this, b, a) }) } var k = this, j = c(k), d = b, p, e = {}, t = j.is("html,body"); switch (typeof d) {
                case "number": case "string": if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(d)) {
                        d =
o(d); break
                    } d = c(d, this); case "object": if (d.is || d.style) p = (d = c(d)).offset()
            } c.each(a.axis.split(""), function(n, q) {
                var h = q == "x" ? "Left" : "Top", l = h.toLowerCase(), f = "scroll" + h, r = k[f], s = m.max(k, q); if (p) { e[f] = p[l] + (t ? 0 : r - j.offset()[l]); if (a.margin) { e[f] -= parseInt(d.css("margin" + h)) || 0; e[f] -= parseInt(d.css("border" + h + "Width")) || 0 } e[f] += a.offset[l] || 0; if (a.over[l]) e[f] += d[q == "x" ? "width" : "height"]() * a.over[l] } else { h = d[l]; e[f] = h.slice && h.slice(-1) == "%" ? parseFloat(h) / 100 * s : h } if (/^\d+$/.test(e[f])) e[f] = e[f] <= 0 ?
0 : Math.min(e[f], s); if (!n && a.queue) { r != e[f] && i(a.onAfterFirst); delete e[f] } 
            }); i(a.onAfter)
        }).end()
    }; m.max = function(b, g) { var a = g == "x" ? "Width" : "Height", i = "scroll" + a; if (!c(b).is("html,body")) return b[i] - c(b)[a.toLowerCase()](); a = "client" + a; var k = b.ownerDocument.documentElement, j = b.ownerDocument.body; return Math.max(k[i], j[i]) - Math.min(k[a], j[a]) } 
})(jQuery);