/*pub-2|2011-10-25 15:48:54*/
(function(a, b, c) {
    var d = {
        mix: function(a, b, d, f) {
            if (!b || !a) return a;
            d === c && (d = !0);
            var g, h, i;
            if (f && (i = f.length)) for (g = 0; g < i; g++) h = f[g],
            h in b && e(h, a, b, d);
            else for (h in b) e(h, a, b, d);
            return a
        }
    },
    e = function(a, b, c, d) {
        if (d || !(a in b)) b[a] = c[a]
    },
    f = a && a[b] || {},
    g = 0,
    h = "";
    return a = f.__HOST || (f.__HOST = a || {}),
    b = a[b] = d.mix(f, d, !1),
    b.mix(b, {
        __APP_MEMBERS: ["namespace"],
        __APP_INIT_METHODS: ["__init"],
        version: "1.1.6",
        merge: function() {
            var a = {},
            c, d = arguments.length;
            for (c = 0; c < d; c++) b.mix(a, arguments[c]);
            return a
        },
        augment: function() {
            var a = arguments,
            d = a.length - 2,
            e = a[0],
            f = a[d],
            g = a[d + 1],
            h = 1;
            b.isArray(g) || (f = g, g = c, d++),
            b.isBoolean(f) || (f = c, d++);
            for (; h < d; h++) b.mix(e.prototype, a[h].prototype || a[h], f, g);
            return e
        },
        extend: function(a, c, d, e) {
            if (!c || !a) return a;
            var f = Object.create ?
            function(a, b) {
                return Object.create(a, {
                    constructor: {
                        value: b
                    }
                })
            }: function(a, b) {
                function c() {}
                c.prototype = a;
                var d = new c;
                return d.constructor = b,
                d
            },
            g = c.prototype,
            h;
            return a.prototype = h = f(g, a),
            a.superclass = f(g, c),
            d && b.mix(h, d),
            e && b.mix(a, e),
            a
        },
        __init: function() {
            this.Config = this.Config || {},
            this.Env = this.Env || {},
            this.Config.debug = ""
        },
        namespace: function() {
            var b = arguments,
            c = b.length,
            d = null,
            e, f, g, i = b[c - 1] === !0 && c--;
            for (e = 0; e < c; e++) {
                g = (h + b[e]).split("."),
                d = i ? a: this;
                for (f = a[g[0]] === d ? 1 : 0; f < g.length; ++f) d = d[g[f]] = d[g[f]] || {}
            }
            return d
        },
        app: function(c, d) {
            var e = b.isString(c),
            f = e ? a[c] || {}: c,
            g = 0,
            h = b.__APP_INIT_METHODS.length;
            b.mix(f, this, !0, b.__APP_MEMBERS);
            for (; g < h; g++) b[b.__APP_INIT_METHODS[g]].call(f);
            return b.mix(f, b.isFunction(d) ? d() : d),
            e && (a[c] = f),
            f
        },
        log: function(d, e, f) {
            b.Config.debug && (f && (d = f + ": " + d), a.console !== c && console.log && console[e && console[e] ? e: "log"](d))
        },
        error: function(a) {
            if (b.Config.debug) throw a
        },
        guid: function(a) {
            return (a || h) + g++
        }
    }),
    b.__init(),
    b
})(this, "KISSY"),
function(a, b) {
    var c = a.__HOST,
    d = Object.prototype.toString,
    e = Array.prototype.indexOf,
    f = Array.prototype.lastIndexOf,
    g = Array.prototype.filter,
    h = String.prototype.trim,
    i = "",
    j = /^\s+|\s+$/g,
    k = {};
    a.mix(a, {
        type: function(a) {
            return a == null ? String(a) : k[d.call(a)] || "object"
        },
        isNull: function(a) {
            return a === null
        },
        isUndefined: function(a) {
            return a === b
        },
        isEmptyObject: function(a) {
            for (var b in a) return ! 1;
            return ! 0
        },
        isPlainObject: function(a) {
            return a && d.call(a) === "[object Object]" && "isPrototypeOf" in a
        },
        clone: function(b) {
            var c = b,
            d, e;
            if (b && ((d = a.isArray(b)) || a.isPlainObject(b))) {
                c = d ? [] : {};
                for (e in b) b.hasOwnProperty(e) && (c[e] = a.clone(b[e]))
            }
            return c
        },
        trim: h ?
        function(a) {
            return a == b ? i: h.call(a)
        }: function(a) {
            return a == b ? i: a.toString().replace(j, i)
        },
        substitute: function(c, d, e) {
            return ! a.isString(c) || !a.isPlainObject(d) ? c: c.replace(e || /\\?\{([^{}]+)\}/g,
            function(a, c) {
                return a.charAt(0) === "\\" ? a.slice(1) : d[c] !== b ? d[c] : i
            })
        },
        each: function(d, e, f) {
            var g, h, i = 0,
            j = d.length,
            k = j === b || a.type(d) === "function";
            f = f || c;
            if (k) {
                for (g in d) if (e.call(f, d[g], g, d) === !1) break
            } else for (h = d[0]; i < j && e.call(f, h, i, d) !== !1; h = d[++i]);
            return d
        },
        indexOf: e ?
        function(a, b) {
            return e.call(b, a)
        }: function(a, b) {
            for (var c = 0,
            d = b.length; c < d; ++c) if (b[c] === a) return c;
            return - 1
        },
        lastIndexOf: f ?
        function(a, b) {
            return f.call(b, a)
        }: function(a, b) {
            for (var c = b.length - 1; c >= 0; c--) if (b[c] === a) break;
            return c
        },
        unique: function(b, c) {
            c && b.reverse();
            var d = b.slice(),
            e = 0,
            f,
            g;
            while (e < d.length) {
                g = d[e];
                while ((f = a.lastIndexOf(g, d)) !== e) d.splice(f, 1);
                e += 1
            }
            return c && d.reverse(),
            d
        },
        inArray: function(b, c) {
            return a.indexOf(b, c) > -1
        },
        filter: g ?
        function(a, b, c) {
            return g.call(a, b, c)
        }: function(b, c, d) {
            var e = [];
            return a.each(b,
            function(a, b, f) {
                c.call(d, a, b, f) && e.push(a)
            }),
            e
        },
        now: function() {
            return (new Date).getTime()
        }
    }),
    a.each("Boolean Number String Function Array Date RegExp Object".split(" "),
    function(b, c) {
        k["[object " + b + "]"] = c = b.toLowerCase(),
        a["is" + b] = function(b) {
            return a.type(b) == c
        }
    })
} (KISSY),
function(a, b) {
    function q(a) {
        var b = typeof a;
        return a === null || b !== "object" && b !== "function"
    }
    function r(a) {
        return Array.prototype.slice.call(a)
    }
    var c = a.__HOST,
    d = c.document,
    e = d.documentElement,
    f = "",
    g = "&",
    h = encodeURIComponent("[]"),
    i = !1,
    j = [],
    k = !1,
    l = 500,
    m = 40,
    n = /^#?([\w-]+)$/,
    o = /^(\w+)\[\]$/,
    p = /\S/;
    a.mix(a, {
        isWindow: function(b) {
            return a.type(b) === "object" && "setInterval" in b
        },
        makeArray: function(c) {
            return c === null || c === b ? [] : a.isArray(c) ? c: typeof c.length != "number" || a.isString(c) || a.isFunction(c) ? [c] : r(c)
        },
        param: function(b, c) {
            if (!a.isPlainObject(b)) return f;
            c = c || g;
            var d = [],
            e,
            i;
            for (e in b) {
                i = b[e],
                e = encodeURIComponent(e);
                if (q(i)) d.push(e, "=", encodeURIComponent(i + f), c);
                else if (a.isArray(i) && i.length) for (var j = 0,
                k = i.length; j < k; ++j) q(i[j]) && d.push(e, h + "=", encodeURIComponent(i[j] + f), c)
            }
            return d.pop(),
            d.join(f)
        },
        unparam: function(b, c) {
            if (typeof b != "string" || (b = a.trim(b)).length === 0) return {};
            var d = {},
            e = b.split(c || g),
            h,
            i,
            j,
            k,
            l = 0,
            m = e.length;
            for (; l < m; ++l) {
                h = e[l].split("="),
                i = decodeURIComponent(h[0]);
                try {
                    j = decodeURIComponent(h[1] || f)
                } catch(n) {
                    j = h[1] || f
                } (k = i.match(o)) && k[1] ? (d[k[1]] = d[k[1]] || [], d[k[1]].push(j)) : d[i] = j
            }
            return d
        },
        globalEval: function(a) {
            if (a && p.test(a)) {
                var b = d.getElementsByTagName("head")[0] || e,
                c = d.createElement("script");
                c.text = a,
                b.insertBefore(c, b.firstChild),
                b.removeChild(c)
            }
        },
        later: function(b, c, d, e, f) {
            c = c || 0,
            e = e || {};
            var g = b,
            h = a.makeArray(f),
            i,
            j;
            return a.isString(b) && (g = e[b]),
            g || a.error("method undefined"),
            i = function() {
                g.apply(e, h)
            },
            j = d ? setInterval(i, c) : setTimeout(i, c),
            {
                id: j,
                interval: d,
                cancel: function() {
                    this.interval ? clearInterval(j) : clearTimeout(j)
                }
            }
        },
        ready: function(a) {
            return k || this._bindReady(),
            i ? a.call(c, this) : j.push(a),
            this
        },
        _bindReady: function() {
            var a = this,
            b = d.documentElement.doScroll,
            e = b ? "onreadystatechange": "DOMContentLoaded",
            f = "complete",
            g = function() {
                a._fireReady()
            };
            k = !0;
            if (d.readyState === f) return g();
            if (d.addEventListener) {
                function h() {
                    d.removeEventListener(e, h, !1),
                    g()
                }
                d.addEventListener(e, h, !1),
                c.addEventListener("load", g, !1)
            } else {
                function i() {
                    d.readyState === f && (d.detachEvent(e, i), g())
                }
                d.attachEvent(e, i),
                c.attachEvent("onload", g);
                var j = !1;
                try {
                    j = c.frameElement == null
                } catch(l) {}
                if (b && j) {
                    function m() {
                        try {
                            b("left"),
                            g()
                        } catch(a) {
                            setTimeout(m, 1)
                        }
                    }
                    m()
                }
            }
        },
        _fireReady: function() {
            if (i) return;
            i = !0;
            if (j) {
                var a, b = 0;
                while (a = j[b++]) a.call(c, this);
                j = null
            }
        },
        available: function(b, c) {
            b = (b + f).match(n)[1];
            if (!b || !a.isFunction(c)) return;
            var e = 1,
            g = a.later(function() { (d.getElementById(b) && (c() || 1) || ++e > l) && g.cancel()
            },
            m, !0)
        }
    });
    try {
        r(e.childNodes)
    } catch(s) {
        r = function(a) {
            for (var b = [], c = a.length - 1; c >= 0; c--) b[c] = a[c];
            return b
        }
    }
    location && (location.search || f).indexOf("ks-debug") !== -1 && (a.Config.debug = !0),
    a._bindReady()
} (KISSY),
function(a, b) {
    function r(a) {
        var b = a.src,
        c = a.getAttribute("data-combo-prefix") || "??",
        d = a.getAttribute("data-combo-sep") || ",",
        e = b.split(d),
        f,
        g = e[0],
        h = g.indexOf(c);
        if (h == -1) f = b.replace(p, "$1");
        else {
            f = g.substring(0, h);
            var i = g.substring(h + 2, g.length);
            if (i.match(q)) f += i.replace(p, "$1");
            else for (var j = 1; j < e.length; j++) {
                var k = e[j];
                if (k.match(q)) {
                    f += k.replace(p, "$1");
                    break
                }
            }
        }
        return f
    }
    var c = a.__HOST,
    d = c.document,
    e = d.getElementsByTagName("head")[0] || d.documentElement,
    f = "",
    g = "cssfullpath",
    h = 1,
    i = 2,
    j = 3,
    k = 4,
    l = a.mix,
    m = d.createElement("script").readyState ?
    function(a, b) {
        var c = a.onreadystatechange;
        a.onreadystatechange = function() {
            var d = a.readyState;
            if (d === "loaded" || d === "complete") a.onreadystatechange = null,
            c && c(),
            b.call(this)
        }
    }: function(a, b) {
        a.addEventListener("load", b, !1)
    },
    n = /\.css(?:\?|$)/i,
    o;
    o = {
        add: function(b, c, d) {
            var e = this,
            f = e.Env.mods,
            g, h, j;
            return a.isString(b) && !d && a.isPlainObject(c) && (h = {},
            h[b] = c, b = h),
            a.isPlainObject(b) ? (a.each(b,
            function(a, b) {
                a.name = b,
                f[b] && l(a, f[b], !1)
            }), l(f, b)) : (d = d || {},
            g = f[b] || {},
            b = d.host || g.host || b, g = f[b] || {},
            l(g, {
                name: b,
                status: i
            }), g.fns || (g.fns = []), c && g.fns.push(c), j = g.requires, l(f[b] = g, d), f[b].requires = j, g.attach !== !1 && e.__isAttached(g.requires) && e.__attachMod(g)),
            e
        },
        use: function(b, c, d) {
            b = b.replace(/\s+/g, f).split(","),
            d = d || {};
            var e = this,
            g = e.Env.mods,
            h = (d || 0).global,
            i,
            j = b.length,
            l,
            m,
            n;
            h && e.__mixMods(h);
            if (e.__isAttached(b)) {
                c && c(e);
                return
            }
            for (i = 0; i < j && (l = g[b[i]]); i++) {
                if (l.status === k) continue;
                d.order && i > 0 && (l.requires || (l.requires = []), l._requires = l.requires.concat(), m = b[i - 1], !a.inArray(m, l.requires) && !a.inArray(l.name, g[m].requires || []) && l.requires.push(m)),
                e.__attach(l,
                function() {
                    l._requires && (l.requires = l._requires, delete l._requires),
                    !n && e.__isAttached(b) && (n = !0, c && c(e))
                },
                h)
            }
            return e
        },
        __attach: function(a, b, c) {
            function h() {
                var c = a.requires || [];
                d.__isAttached(c) && (a.status === i && d.__attachMod(a), a.status === k && b())
            }
            var d = this,
            e = a.requires || [],
            f = 0,
            g = e.length;
            for (; f < g; f++) d.__attach(d.Env.mods[e[f]], h, c);
            d.__buildPath(a),
            d.__load(a, h, c)
        },
        __mixMods: function(a) {
            var b = this.Env.mods,
            c = a.Env.mods,
            d;
            for (d in c) this.__mixMod(b, c, d, a)
        },
        __mixMod: function(b, c, d, e) {
            var f = b[d] || {},
            g = f.status;
            a.mix(f, a.clone(c[d])),
            g && (f.status = g),
            e && this.__buildPath(f, e.Config.base),
            b[d] = f
        },
        __attachMod: function(c) {
            var d = this;
            c.fns && (a.each(c.fns,
            function(a) {
                a && a(d)
            }), c.fns = b),
            c.status = k
        },
        __isAttached: function(b) {
            var c = this.Env.mods,
            d, e = (b = a.makeArray(b)).length - 1;
            for (; e >= 0 && (d = c[b[e]]); e--) if (d.status !== k) return ! 1;
            return ! 0
        },
        __load: function(b, c, d) {
            function q() {
                r(),
                b.status !== j && (d && e.__mixMod(e.Env.mods, d.Env.mods, b.name, d), b.status !== k && (b.status = i), c())
            }
            function r() {
                l[f] = i
            }
            var e = this,
            f = b.fullpath,
            l = a.Env._loadQueue,
            o = l[f],
            p;
            b.status = b.status || 0,
            b.status < h && o && (b.status = o.nodeName ? h: i),
            a.isString(b[g]) && (e.getScript(b[g]), b[g] = i),
            b.status < h && f ? (b.status = h, p = e.getScript(f, {
                success: function() {
                    KISSY.log(b.name + " is loaded.", "info"),
                    q()
                },
                error: function() {
                    b.status = j,
                    r()
                },
                charset: b.charset
            }), n.test(f) || (l[f] = p)) : b.status === h ? m(o, q) : c()
        },
        __buildPath: function(a, b) {
            function d(d, e) { ! a[e] && a[d] && (a[e] = (b || c.base) + a[d]),
                a[e] && c.debug && (a[e] = a[e].replace(/-min/g, ""))
            }
            var c = this.Config;
            d("path", "fullpath"),
            a[g] !== i && d("csspath", g)
        },
        getScript: function(c, f, g) {
            var h = n.test(c),
            i = d.createElement(h ? "link": "script"),
            j = f,
            k,
            l,
            o;
            return a.isPlainObject(j) && (f = j.success, k = j.error, l = j.timeout, g = j.charset),
            h ? (i.href = c, i.rel = "stylesheet") : (i.src = c, i.async = !0),
            g && (i.charset = g),
            h ? a.isFunction(f) && f.call(i) : m(i,
            function() {
                o && (o.cancel(), o = b),
                a.isFunction(f) && f.call(i),
                e && i.parentNode && e.removeChild(i)
            }),
            a.isFunction(k) && (o = a.later(function() {
                o = b,
                k()
            },
            (l || this.Config.timeout) * 1e3)),
            e.insertBefore(i, e.firstChild),
            i
        }
    },
    l(a, o);
    var p = /^(.*)(seed|kissy)(-min)?\.js[^/] * /i,q=/ (seed | kissy)( - min) ? \.js / ;
    a.__initLoader = function() {
        var a = d.getElementsByTagName("script"),
        b = a[a.length - 1],
        c = r(b);
        this.Env.mods = {},
        this.Env._loadQueue = {},
        this.Config.base || (this.Config.base = c),
        this.Config.timeout || (this.Config.timeout = 10)
    },
    a.__initLoader(),
    a.each(o,
    function(b, c) {
        a.__APP_MEMBERS.push(c)
    }),
    a.__APP_INIT_METHODS.push("__initLoader")
} (KISSY),
function(a) {
    /*
	var b = {
        core: {
            path: "packages/core-min.js",
            charset: "utf-8"
        }
    };
    a.each(["sizzle", "dd", "datalazyload", "flash", "switchable", "suggest", "calendar", "uibase", "overlay", "imagezoom", "waterfall", "template"],
    function(a) {
        b[a] = {
            path: a + "/" + a + "-pkg-min.js",
            requires: ["core"],
            charset: "utf-8"
        }
    }),
    b.calendar.csspath = "calendar/default-min.css",
    b.overlay.requires = ["uibase"],
    b.waterfall.requires = ["template"],
    a.add(b)*/
} (KISSY),
KISSY.add("ua",
function(a) {
    var b = navigator.userAgent,
    c = "",
    d = "mobile",
    e = c,
    f = c,
    g, h = {},
    i = function(a) {
        var b = 0;
        return parseFloat(a.replace(/\./g,
        function() {
            return b++===0 ? ".": ""
        }))
    };
    if ((g = b.match(/AppleWebKit\/([\d.]*)/)) && g[1]) {
        h[e = "webkit"] = i(g[1]),
        (g = b.match(/Chrome\/([\d.]*)/)) && g[1] ? h[f = "chrome"] = i(g[1]) : (g = b.match(/\/([\d.]*) Safari/)) && g[1] && (h[f = "safari"] = i(g[1]));
        if (/ Mobile\//.test(b)) h[d] = "apple";
        else if (g = b.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/)) h[d] = g[0].toLowerCase()
    } else if ((g = b.match(/Presto\/([\d.]*)/)) && g[1]) h[e = "presto"] = i(g[1]),
    (g = b.match(/Opera\/([\d.]*)/)) && g[1] && (h[f = "opera"] = i(g[1]), (g = b.match(/Opera\/.* Version\/([\d.]*)/)) && g[1] && (h[f] = i(g[1])), (g = b.match(/Opera Mini[^;]*/)) && g ? h[d] = g[0].toLowerCase() : (g = b.match(/Opera Mobi[^;]*/)) && g && (h[d] = g[0]));
    else if ((g = b.match(/MSIE\s([^;]*)/)) && g[1]) h[e = "trident"] = .1,
    h[f = "ie"] = i(g[1]),
    (g = b.match(/Trident\/([\d.]*)/)) && g[1] && (h[e] = i(g[1]));
    else if (g = b.match(/Gecko/)) h[e = "gecko"] = .1,
    (g = b.match(/rv:([\d.]*)/)) && g[1] && (h[e] = i(g[1])),
    (g = b.match(/Firefox\/([\d.]*)/)) && g[1] && (h[f = "firefox"] = i(g[1]));
    h.core = e,
    h.shell = f,
    h._numberify = i,
    a.UA = h
}),
KISSY.add("ua-extra",
function(a) {
    var b = a.UA,
    c = navigator.userAgent,
    d, e, f, g = {},
    h = b._numberify;
    if (d = c.match(/360SE/)) g[f = "se360"] = 3;
    else if ((d = c.match(/Maxthon/)) && (e = window.external)) {
        f = "maxthon";
        try {
            g[f] = h(e.max_version)
        } catch(i) {
            g[f] = .1
        }
    } else if (d = c.match(/TencentTraveler\s([\d.]*)/)) g[f = "tt"] = d[1] ? h(d[1]) : .1;
    else if (d = c.match(/TheWorld/)) g[f = "theworld"] = 3;
    else if (d = c.match(/SE\s([\d.]*)/)) g[f = "sougou"] = d[1] ? h(d[1]) : .1;
    f && (g.shell = f),
    a.mix(b, g)
}),
KISSY.add("dom",
function(a, b) {
    function c(a, b) {
        return a && a.nodeType === b
    }
    a.DOM = {
        _isElementNode: function(a) {
            return c(a, 1)
        },
        _isKSNode: function(b) {
            return a.Node && c(b, a.Node.TYPE)
        },
        _getWin: function(a) {
            return a && "scrollTo" in a && a.document ? a: c(a, 9) ? a.defaultView || a.parentWindow: a === b ? window: !1
        },
        _nodeTypeIs: c
    }
}),
KISSY.add("selector",
function(a, b) {
    function k(b, c) {
        var f, k, r = [],
        s,
        t,
        u;
        c = m(c);
        if (a.isString(b)) {
            b = a.trim(b);
            if (i.test(b)) k = n(b.slice(1), c),
            k && (r = [k]);
            else if (f = j.exec(b)) {
                s = f[1],
                t = f[2],
                u = f[3];
                if (c = s ? n(s, c) : c) u ? !s || b.indexOf(e) !== -1 ? r = p(u, t, c) : (k = n(s, c), k && d.hasClass(k, u) && (r = [k])) : t && (r = o(t, c))
            } else {
                if (a.ExternalSelector) return a.ExternalSelector(b, c);
                q(b)
            }
        } else b && (b[g] || b[h]) ? r = b[g] ? [b[g]()] : b[h]() : b && (a.isArray(b) || l(b)) ? r = b: b && (r = [b]);
        return l(r) && (r = a.makeArray(r)),
        r.each = function(b, c) {
            return a.each(r, b, c)
        },
        r
    }
    function l(a) {
        return a && !a.nodeType && a.item && a != window
    }
    function m(d) {
        return d === b ? d = c: a.isString(d) && i.test(d) ? d = n(d.slice(1), c) : d && d.nodeType !== 1 && d.nodeType !== 9 && (d = null),
        d
    }
    function n(a, b) {
        return b.nodeType !== 9 && (b = b.ownerDocument),
        b.getElementById(a)
    }
    function o(a, b) {
        return b.getElementsByTagName(a)
    }
    function p(a, b, c) {
        var d = c.getElementsByClassName(a),
        e = d,
        g = 0,
        h = 0,
        i = d.length,
        j;
        if (b && b !== f) {
            e = [],
            b = b.toUpperCase();
            for (; g < i; ++g) j = d[g],
            j.tagName === b && (e[h++] = j)
        }
        return e
    }
    function q(b) {
        a.error("Unsupported selector: " + b)
    }
    var c = document,
    d = a.DOM,
    e = " ",
    f = "*",
    g = "getDOMNode",
    h = g + "s",
    i = /^#[\w-]+$/,
    j = /^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/; (function() {
        var a = c.createElement("div");
        a.appendChild(c.createComment("")),
        a.getElementsByTagName(f).length > 0 && (o = function(a, b) {
            var c = b.getElementsByTagName(a);
            if (a === f) {
                var d = [],
                e = 0,
                g = 0,
                h;
                while (h = c[e++]) h.nodeType === 1 && (d[g++] = h);
                c = d
            }
            return c
        })
    })(),
    c.getElementsByClassName || (c.querySelectorAll ? p = function(a, b, c) {
        return c.querySelectorAll((b ? b: "") + "." + a)
    }: p = function(a, b, c) {
        var d = c.getElementsByTagName(b || f),
        g = [],
        h = 0,
        i = 0,
        j = d.length,
        k,
        l;
        a = e + a + e;
        for (; h < j; ++h) k = d[h],
        l = k.className,
        l && (e + l + e).indexOf(a) > -1 && (g[i++] = k);
        return g
    }),
    a.query = k,
    a.get = function(a, b) {
        return k(a, b)[0] || null
    },
    a.mix(d, {
        query: k,
        get: a.get,
        filter: function(b, c) {
            var e = k(b),
            f,
            g,
            h,
            i = [];
            return a.isString(c) && (f = j.exec(c)) && !f[1] && (g = f[2], h = f[3], c = function(a) {
                return ! (g && a.tagName !== g.toUpperCase() || h && !d.hasClass(a, h))
            }),
            a.isFunction(c) ? i = a.filter(e, c) : c && a.ExternalSelector ? i = a.ExternalSelector._filter(b, c + "") : q(c),
            i
        },
        test: function(a, b) {
            var c = k(a);
            return c.length && d.filter(c, b).length === c.length
        }
    })
}),
KISSY.add("dom-data",
function(a, b) {
    function i(a) {
        return a && a.nodeType
    }
    var c = window,
    d = a.DOM,
    e = "_ks_data_" + a.now(),
    f = {},
    g = {},
    h = {
        EMBED: 1,
        OBJECT: 1,
        APPLET: 1
    };
    a.mix(d, {
        data: function(j, k, l) {
            if (a.isPlainObject(k)) {
                for (var m in k) d.data(j, m, k[m]);
                return
            }
            if (l === b) {
                var n = a.get(j),
                o,
                p,
                q,
                r;
                if (!n || h[n.nodeName]) return;
                return n == c && (n = g),
                o = i(n),
                p = o ? f: n,
                q = o ? n[e] : e,
                r = p[q],
                a.isString(k) && r ? r[k] : r
            }
            a.query(j).each(function(d) {
                if (!d || h[d.nodeName]) return;
                d == c && (d = g);
                var j = f,
                m;
                i(d) ? (m = d[e]) || (m = d[e] = a.guid()) : (m = e, j = d),
                k && l !== b && (j[m] || (j[m] = {}), j[m][k] = l)
            })
        },
        removeData: function(b, h) {
            a.query(b).each(function(b) {
                if (!b) return;
                b == c && (b = g);
                var j, l = f,
                m, n = i(b);
                n ? j = b[e] : (l = b, j = e);
                if (!j) return;
                m = l[j];
                if (h) m && (delete m[h], a.isEmptyObject(m) && d.removeData(b));
                else {
                    if (!n) try {
                        delete b[e]
                    } catch(o) {} else b.removeAttribute && b.removeAttribute(e);
                    n && delete l[j]
                }
            })
        }
    })
}),
KISSY.add("dom-class",
function(a, b) {
    function g(c, f, g, h) {
        if (! (f = a.trim(f))) return h ? !1 : b;
        var i = a.query(c),
        j = 0,
        k = i.length,
        l = f.split(e),
        m,
        n;
        for (; j < k; j++) {
            m = i[j];
            if (d._isElementNode(m)) {
                n = g(m, l, l.length);
                if (n !== b) return n
            }
        }
        if (h) return ! 1
    }
    var c = " ",
    d = a.DOM,
    e = /[\.\s]\s*\.?/,
    f = /[\n\t]/g;
    a.mix(d, {
        hasClass: function(a, b) {
            return g(a, b,
            function(a, b, d) {
                var e = a.className;
                if (e) {
                    var f = c + e + c,
                    g = 0,
                    h = !0;
                    for (; g < d; g++) if (f.indexOf(c + b[g] + c) < 0) {
                        h = !1;
                        break
                    }
                    if (h) return ! 0
                }
            },
            !0)
        },
        addClass: function(b, d) {
            g(b, d,
            function(b, e, f) {
                var g = b.className;
                if (!g) b.className = d;
                else {
                    var h = c + g + c,
                    j = g,
                    k = 0;
                    for (; k < f; k++) h.indexOf(c + e[k] + c) < 0 && (j += c + e[k]);
                    b.className = a.trim(j)
                }
            })
        },
        removeClass: function(b, d) {
            g(b, d,
            function(b, d, e) {
                var g = b.className;
                if (g) if (!e) b.className = "";
                else {
                    var h = (c + g + c).replace(f, c),
                    i = 0,
                    j;
                    for (; i < e; i++) {
                        j = c + d[i] + c;
                        while (h.indexOf(j) >= 0) h = h.replace(j, c)
                    }
                    b.className = a.trim(h)
                }
            })
        },
        replaceClass: function(a, b, c) {
            d.removeClass(a, b),
            d.addClass(a, c)
        },
        toggleClass: function(b, c, e) {
            var f = a.isBoolean(e),
            h;
            g(b, c,
            function(a, b, c) {
                var g = 0,
                l;
                for (; g < c; g++) l = b[g],
                h = f ? !e: d.hasClass(a, l),
                d[h ? "removeClass": "addClass"](a, l)
            })
        }
    })
}),
KISSY.add("dom-attr",
function(a, b) {
    function u(a, b) {
        return b && b.nodeName.toUpperCase() === a.toUpperCase()
    }
    var c = a.UA,
    d = document,
    e = d.documentElement,
    f = !e.hasAttribute,
    g = e.textContent !== b ? "textContent": "innerText",
    h = "select",
    i = "",
    j = "checked",
    k = "style",
    l = a.DOM,
    m = l._isElementNode,
    n = function(a) {
        return l._nodeTypeIs(a, 3)
    },
    o = /^(?:href|src|style)/,
    p = /^(?:href|src|colspan|rowspan)/,
    q = /\r/g,
    r = /^(?:radio|checkbox)/,
    s = {
        readonly: "readOnly"
    },
    t = {
        val: 1,
        css: 1,
        html: 1,
        text: 1,
        data: 1,
        width: 1,
        height: 1,
        offset: 1
    };
    f && a.mix(s, {
        "for": "htmlFor",
        "class": "className"
    }),
    a.mix(l, {
        attr: function(c, d, e, g) {
            if (a.isPlainObject(d)) {
                g = e;
                for (var h in d) l.attr(c, h, d[h], g);
                return
            }
            if (! (d = a.trim(d))) return;
            d = d.toLowerCase();
            if (g && t[d]) return l[d](c, e);
            d = s[d] || d;
            if (e === b) {
                var n = a.get(c);
                if (!m(n)) return b;
                var q;
                return o.test(d) || (q = n[d]),
                q === b && (q = n.getAttribute(d)),
                f && (p.test(d) ? q = n.getAttribute(d, 2) : d === k && (q = n[k].cssText)),
                q === null ? b: q
            }
            a.each(a.query(c),
            function(a) {
                if (!m(a)) return;
                d === k ? a[k].cssText = e: (d === j && (a[d] = !!e), a.setAttribute(d, i + e))
            })
        },
        removeAttr: function(b, c) {
            a.each(a.query(b),
            function(a) {
                m(a) && (l.attr(a, c, i), a.removeAttribute(c))
            })
        },
        val: function(d, e) {
            if (e === b) {
                var f = a.get(d);
                if (!m(f)) return b;
                if (u("option", f)) return (f.attributes.value || {}).specified ? f.value: f.text;
                if (u(h, f)) {
                    var g = f.selectedIndex,
                    j = f.options;
                    if (g < 0) return null;
                    if (f.type === "select-one") return l.val(j[g]);
                    var k = [],
                    n = 0,
                    o = j.length;
                    for (; n < o; ++n) j[n].selected && k.push(l.val(j[n]));
                    return k
                }
                return c.webkit && r.test(f.type) ? f.getAttribute("value") === null ? "on": f.value: (f.value || i).replace(q, i)
            }
            a.each(a.query(d),
            function(b) {
                if (u(h, b)) {
                    a.isNumber(e) && (e += i);
                    var c = a.makeArray(e),
                    d = b.options,
                    f;
                    for (n = 0, o = d.length; n < o; ++n) f = d[n],
                    f.selected = a.inArray(l.val(f), c);
                    c.length || (b.selectedIndex = -1)
                } else m(b) && (b.value = e)
            })
        },
        text: function(c, d) {
            if (d === b) {
                var e = a.get(c);
                if (m(e)) return e[g] || i;
                if (n(e)) return e.nodeValue
            } else a.each(a.query(c),
            function(a) {
                m(a) ? a[g] = d: n(a) && (a.nodeValue = d)
            })
        }
    })
}),
KISSY.add("dom-style",
function(a, b) {
    function y(b, d) {
        var e = a.get(b),
        f = d === k ? ["Left", "Right"] : ["Top", "Bottom"],
        g = d === k ? e.offsetWidth: e.offsetHeight;
        return a.each(f,
        function(a) {
            g -= parseFloat(c._getComputedStyle(e, "padding" + a)) || 0,
            g -= parseFloat(c._getComputedStyle(e, "border" + a + "Width")) || 0
        }),
        g
    }
    function z(b, e, f) {
        var g, h = f;
        if (f === m && q.test(e)) {
            h = 0;
            if (a.inArray(c.css(b, "position"), ["absolute", "fixed"])) {
                g = b[e === "left" ? "offsetLeft": "offsetTop"];
                if (d.ie === 8 || d.opera) g -= p(c.css(b.offsetParent, "border-" + e + "-width")) || 0;
                h = g - (p(c.css(b, "margin-" + e)) || 0)
            }
        }
        return h
    }
    var c = a.DOM,
    d = a.UA,
    e = document,
    f = e.documentElement,
    g = "style",
    h = "float",
    i = "cssFloat",
    j = "styleFloat",
    k = "width",
    l = "height",
    m = "auto",
    n = "display",
    o = "none",
    p = parseInt,
    q = /^(?:left|top)/,
    r = /^(?:width|height|top|left|right|bottom|margin|padding)/i,
    s = /-([a-z])/ig,
    t = function(a, b) {
        return b.toUpperCase()
    },
    u = "",
    v = "px",
    w = {},
    x = {};
    a.mix(c, {
        _CUSTOM_STYLES: w,
        _getComputedStyle: function(a, b) {
            var c = "",
            d = a.ownerDocument;
            return a[g] && (c = d.defaultView.getComputedStyle(a, null)[b]),
            c
        },
        css: function(d, e, f) {
            if (a.isPlainObject(e)) {
                for (var h in e) c.css(d, h, e[h]);
                return
            }
            e.indexOf("-") > 0 && (e = e.replace(s, t)),
            e = w[e] || e;
            if (f === b) {
                var i = a.get(d),
                j = "";
                return i && i[g] && (j = e.get ? e.get(i) : i[g][e], j === "" && !e.get && (j = z(i, e, c._getComputedStyle(i, e)))),
                j === b ? "": j
            }
            f === null || f === u ? f = u: !isNaN(new Number(f)) && r.test(e) && (f += v);
            if ((e === k || e === l) && parseFloat(f) < 0) return;
            a.each(a.query(d),
            function(a) {
                a && a[g] && (e.set ? e.set(a, f) : a[g][e] = f, f === u && (a[g].cssText || a.removeAttribute(g)))
            })
        },
        width: function(a, d) {
            if (d === b) return y(a, k);
            c.css(a, k, d)
        },
        height: function(a, d) {
            if (d === b) return y(a, l);
            c.css(a, l, d)
        },
        show: function(b) {
            a.query(b).each(function(a) {
                if (!a) return;
                a.style[n] = c.data(a, n) || u;
                if (c.css(a, n) === o) {
                    var b = a.tagName,
                    d = x[b],
                    f;
                    d || (f = e.createElement(b), e.body.appendChild(f), d = c.css(f, n), c.remove(f), x[b] = d),
                    c.data(a, n, d),
                    a.style[n] = d
                }
            })
        },
        hide: function(b) {
            a.query(b).each(function(a) {
                if (!a) return;
                var b = a.style,
                d = b[n];
                d !== o && (d && c.data(a, n, d), b[n] = o)
            })
        },
        toggle: function(b) {
            a.query(b).each(function(a) {
                a && (a.style[n] === o ? c.show(a) : c.hide(a))
            })
        },
        addStyleSheet: function(b, d) {
            var f;
            d && (d = d.replace("#", u)) && (f = a.get("#" + d));
            if (f) return;
            f = c.create("<style>", {
                id: d
            }),
            a.get("head").appendChild(f),
            f.styleSheet ? f.styleSheet.cssText = b: f.appendChild(e.createTextNode(b))
        }
    }),
    f[g][i] !== b ? w[h] = i: f[g][j] !== b && (w[h] = j)
}),
KISSY.add("dom-style-ie",
function(a, b) {
    if (!a.UA.ie) return;
    var c = a.DOM,
    d = document,
    e = d.documentElement,
    f = "opacity",
    g = "filter",
    h = "filters",
    i = "currentStyle",
    j = "runtimeStyle",
    k = "left",
    l = "px",
    m = c._CUSTOM_STYLES,
    n = /^-?\d+(?:px)?$/i,
    o = /^-?\d/,
    p = /^(?:width|height)$/;
    try {
        e.style[f] === b && e[h] && (m[f] = {
            get: function(a) {
                var b = 100;
                try {
                    b = a[h]["DXImageTransform.Microsoft.Alpha"][f]
                } catch(c) {
                    try {
                        b = a[h]("alpha")[f]
                    } catch(d) {}
                }
                return b / 100 + ""
            },
            set: function(a, b) {
                var c = a.style,
                d = (a.currentStyle || 0).filter || "";
                c.zoom = 1,
                d && (d = d.replace(/alpha\(opacity=.+\)/ig, ""), d && (d += ", ")),
                c[g] = d + "alpha(" + f + "=" + b * 100 + ")"
            }
        })
    } catch(q) {
        a.log("IE filters ActiveX is disabled. ex = " + q)
    } ! (d.defaultView || {}).getComputedStyle && e[i] && (c._getComputedStyle = function(a, b) {
        var d = a.style,
        e = a[i][b];
        if (p.test(b)) e = c[b](a) + l;
        else if (!n.test(e) && o.test(e)) {
            var f = d[k],
            g = a[j][k];
            a[j][k] = a[i][k],
            d[k] = b === "fontSize" ? "1em": e || 0,
            e = d.pixelLeft + l,
            d[k] = f,
            a[j][k] = g
        }
        return e
    })
}),
KISSY.add("dom-offset",
function(a, b) {
    function B(a) {
        var b, e = 0,
        f = 0,
        g = i(a[r]);
        return a[A] && (b = a[A](), e = b[v], f = b[w], d.mobile !== "apple" && (e += c[y](g), f += c[z](g))),
        {
            left: e,
            top: f
        }
    }
    function C(a, b) {
        c.css(a, m) === "static" && (a.style[m] = n);
        var d = B(a),
        e = {},
        f,
        g;
        for (g in b) f = l(c.css(a, g), 10) || 0,
        e[g] = f + b[g] - d[g];
        c.css(a, e)
    }
    var c = a.DOM,
    d = a.UA,
    e = window,
    f = document,
    g = c._isElementNode,
    h = c._nodeTypeIs,
    i = c._getWin,
    j = f.compatMode === "CSS1Compat",
    k = Math.max,
    l = parseInt,
    m = "position",
    n = "relative",
    o = "document",
    p = "body",
    q = "documentElement",
    r = "ownerDocument",
    s = "viewport",
    t = "scroll",
    u = "client",
    v = "left",
    w = "top",
    x = "scrollTo",
    y = t + "Left",
    z = t + "Top",
    A = "getBoundingClientRect";
    a.mix(c, {
        offset: function(c, d) {
            if (! (c = a.get(c)) || !c[r]) return null;
            if (d === b) return B(c);
            C(c, d)
        },
        scrollIntoView: function(d, f, g, j) {
            if (! (d = a.get(d)) || !d[r]) return;
            j = j === b ? !0 : !!j,
            g = g === b ? !0 : !!g;
            if (!f || f === e) return d.scrollIntoView(g);
            f = a.get(f),
            h(f, 9) && (f = i(f));
            var k = f && x in f && f[o],
            m = c.offset(d),
            n = k ? {
                left: c.scrollLeft(f),
                top: c.scrollTop(f)
            }: c.offset(f),
            p = {
                left: m[v] - n[v],
                top: m[w] - n[w]
            },
            q = k ? c.viewportHeight(f) : f.clientHeight,
            s = k ? c.viewportWidth(f) : f.clientWidth,
            t = c[y](f),
            u = c[z](f),
            A = t + s,
            B = u + q,
            C = d.offsetHeight,
            D = d.offsetWidth,
            E = p.left + t - (l(c.css(f, "borderLeftWidth")) || 0),
            F = p.top + u - (l(c.css(f, "borderTopWidth")) || 0),
            G = E + D,
            H = F + C,
            I,
            J;
            C > q || F < u || g ? I = F: H > B && (I = H - q),
            j && (D > s || E < t || g ? J = E: G > A && (J = G - s)),
            k ? (I !== b || J !== b) && f[x](J, I) : (I !== b && (f[z] = I), J !== b && (f[y] = J))
        }
    }),
    a.each(["Left", "Top"],
    function(b, d) {
        var e = t + b;
        c[e] = function(b) {
            var c = 0,
            f = i(b),
            h;
            return f && (h = f[o]) ? c = f[d ? "pageYOffset": "pageXOffset"] || h[q][e] || h[p][e] : g(b = a.get(b)) && (c = b[e]),
            c
        }
    }),
    a.each(["Width", "Height"],
    function(a) {
        c["doc" + a] = function(b) {
            var d = b || f;
            return k(j ? d[q][t + a] : d[p][t + a], c[s + a](d))
        },
        c[s + a] = function(b) {
            var c = "inner" + a,
            d = i(b),
            e = d[o];
            return c in d ? d[c] : j ? e[q][u + a] : e[p][u + a]
        }
    })
}),
KISSY.add("dom-traversal",
function(a, b) {
    function e(e, f, g, h) {
        if (! (e = a.get(e))) return null;
        f === b && (f = 1);
        var i = null,
        j, k;
        if (a.isNumber(f) && f >= 0) {
            if (f === 0) return e;
            j = 0,
            k = f,
            f = function() {
                return++j === k
            }
        }
        while (e = e[g]) if (d(e) && (!f || c.test(e, f)) && (!h || h(e))) {
            i = e;
            break
        }
        return i
    }
    function f(b, e, f) {
        var g = [],
        h = a.get(b),
        i,
        j = h,
        k;
        h && f && (j = h.parentNode);
        if (j) for (i = 0, k = j.firstChild; k; k = k.nextSibling) d(k) && k !== h && (!e || c.test(k, e)) && (g[i++] = k);
        return g
    }
    var c = a.DOM,
    d = c._isElementNode;
    a.mix(c, {
        parent: function(a, b) {
            return e(a, b, "parentNode",
            function(a) {
                return a.nodeType != 11
            })
        },
        next: function(a, b) {
            return e(a, b, "nextSibling")
        },
        prev: function(a, b) {
            return e(a, b, "previousSibling")
        },
        siblings: function(a, b) {
            return f(a, b, !0)
        },
        children: function(a, b) {
            return f(a, b)
        },
        contains: function(b, c) {
            var d = !1;
            if ((b = a.get(b)) && (c = a.get(c))) if (b.contains) {
                if (c.nodeType === 3) {
                    c = c.parentNode;
                    if (c === b) return ! 0
                }
                if (c) return b.contains(c)
            } else {
                if (b.compareDocumentPosition) return !! (b.compareDocumentPosition(c) & 16);
                while (!d && (c = c.parentNode)) d = c == b
            }
            return d
        }
    })
}),
KISSY.add("dom-create",
function(a, b) {
    function r(b, c) {
        return h(b) && a.isPlainObject(c) && d.attr(b, c, !0),
        b
    }
    function s(b, c) {
        var d = null,
        e, f;
        if (b && (b.push || b.item) && b[0]) {
            c = c || b[0].ownerDocument,
            d = c.createDocumentFragment(),
            b.item && (b = a.makeArray(b));
            for (e = 0, f = b.length; e < f; e++) d.appendChild(b[e])
        } else a.log("Unable to convert " + b + " to fragment.");
        return d
    }
    function t(a) {
        var b = a.cloneNode(!0);
        return e.ie < 8 && (b.innerHTML = a.innerHTML),
        b
    }
    function u(b, e, f, g) {
        if (!f) {
            v(b, e),
            a.isFunction(g) && g();
            return
        }
        var h = a.guid("ks-tmp-"),
        i = new RegExp(n);
        e += '<span id="' + h + '"></span>',
        a.available(h,
        function() {
            var b = a.get("head"),
            f,
            j,
            k,
            l,
            m,
            n,
            o;
            i.lastIndex = 0;
            while (f = i.exec(e)) j = f[1],
            k = j ? j.match(p) : !1,
            k && k[2] ? (n = c.createElement("script"), n.src = k[2], (l = j.match(q)) && l[2] && (n.charset = l[2]), n.async = !0, b.appendChild(n)) : (o = f[2]) && o.length > 0 && a.globalEval(o); (m = c.getElementById(h)) && d.remove(m),
            a.isFunction(g) && g()
        }),
        v(b, e)
    }
    function v(a, b) {
        b = (b + "").replace(n, "");
        try {
            a.innerHTML = b
        } catch(c) {
            while (a.firstChild) a.removeChild(a.firstChild);
            b && a.appendChild(d.create(b))
        }
    }
    var c = document,
    d = a.DOM,
    e = a.UA,
    f = e.ie,
    g = d._nodeTypeIs,
    h = d._isElementNode,
    i = d._isKSNode,
    j = "div",
    k = "parentNode",
    l = c.createElement(j),
    m = /<(\w+)/,
    n = /<script([^>]*)>([^<]*(?:(?!<\/script>)<[^<]*)*)<\/script>/ig,
    o = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
    p = /\ssrc=(['"])(.*?)\1/i,
    q = /\scharset=(['"])(.*?)\1/i;
    a.mix(d, {
        create: function(b, e, f) {
            if (g(b, 1) || g(b, 3)) return t(b);
            if (i(b)) return t(b[0]);
            if (! (b = a.trim(b))) return null;
            var h = null,
            l = d._creators,
            n, p = j,
            q, u;
            return (n = o.exec(b)) ? h = (f || c).createElement(n[1]) : ((n = m.exec(b)) && (q = n[1]) && a.isFunction(l[q = q.toLowerCase()]) && (p = q), u = l[p](b, f).childNodes, u.length === 1 ? h = u[0][k].removeChild(u[0]) : h = s(u, f || c)),
            r(h, e)
        },
        _creators: {
            div: function(a, b) {
                var c = b ? b.createElement(j) : l;
                return c.innerHTML = a,
                c
            }
        },
        html: function(c, d, e, f) {
            if (d === b) {
                var g = a.get(c);
                if (h(g)) return g.innerHTML
            } else a.each(a.query(c),
            function(a) {
                h(a) && u(a, d, e, f)
            })
        },
        remove: function(b) {
            a.each(a.query(b),
            function(a) {
                h(a) && a.parentNode && a.parentNode.removeChild(a)
            })
        }
    });
    if (f || e.gecko || e.webkit) {
        var w = d._creators,
        x = d.create,
        y = "<table>",
        z = "</table>",
        A = /(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,
        B = {
            option: "select",
            td: "tr",
            tr: "tbody",
            tbody: "table",
            col: "colgroup",
            legend: "fieldset"
        };
        for (var C in B)(function(a) {
            w[C] = function(b, c) {
                return x("<" + a + ">" + b + "</" + a + ">", null, c)
            }
        })(B[C]);
        f && (w.script = function(a, b) {
            var c = b ? b.createElement(j) : l;
            return c.innerHTML = "-" + a,
            c.removeChild(c.firstChild),
            c
        },
        f < 8 && (w.tbody = function(a, b) {
            var c = x(y + a + z, null, b),
            d = c.children.tags("tbody")[0];
            return c.children.length > 1 && d && !A.test(a) && d[k].removeChild(d),
            c
        })),
        a.mix(w, {
            optgroup: w.option,
            th: w.td,
            thead: w.tbody,
            tfoot: w.tbody,
            caption: w.tbody,
            colgroup: w.tbody
        })
    }
}),
KISSY.add("dom-insertion",
function(a) {
    var b = a.DOM,
    c = "parentNode",
    d = "nextSibling";
    a.mix(b, {
        insertBefore: function(b, d) {
            return (b = a.get(b)) && (d = a.get(d)) && d[c] && d[c].insertBefore(b, d),
            b
        },
        insertAfter: function(b, e) {
            return (b = a.get(b)) && (e = a.get(e)) && e[c] && (e[d] ? e[c].insertBefore(b, e[d]) : e[c].appendChild(b)),
            b
        },
        append: function(b, c) { (b = a.get(b)) && (c = a.get(c)) && c.appendChild && c.appendChild(b)
        },
        prepend: function(c, d) { (c = a.get(c)) && (d = a.get(d)) && (d.firstChild ? b.insertBefore(c, d.firstChild) : d.appendChild(c))
        }
    })
}),
KISSY.add("event",
function(a, b) {
    function l(b, c, d, e, f) {
        a.isString(c) && (c = a.query(c));
        if (a.isArray(c)) return a.each(c,
        function(a) {
            k[b](a, d, e, f)
        }),
        !0;
        if ((d = a.trim(d)) && d.indexOf(h) > 0) return a.each(d.split(h),
        function(a) {
            k[b](c, a, e, f)
        }),
        !0;
        if (c.getDOMNodes) {
            for (var g = 0; g < c.length; g++) k[b](c.item(g), d, e, f);
            return ! 0
        }
    }
    function m(a) {
        return p(a) ? d.data(a, g) : -1
    }
    function n(a, b) {
        p(a) && d.data(a, g, b)
    }
    function o(a) {
        d.removeData(a, g)
    }
    function p(a) {
        return a && a.nodeType !== 3 && a.nodeType !== 8
    }
    var c = document,
    d = a.DOM,
    e = c.addEventListener ?
    function(a, b, c, d) {
        a.addEventListener && a.addEventListener(b, c, !!d)
    }: function(a, b, c) {
        a.attachEvent && a.attachEvent("on" + b, c)
    },
    f = c.removeEventListener ?
    function(a, b, c, d) {
        a.removeEventListener && a.removeEventListener(b, c, !!d)
    }: function(a, b, c) {
        a.detachEvent && a.detachEvent("on" + b, c)
    },
    g = "ksEventTargetId",
    h = " ",
    i = a.now(),
    j = {},
    k = {
        EVENT_GUID: g,
        special: {},
        add: function(b, c, d, f) {
            if (l("add", b, c, d, f)) return;
            var g = m(b),
            h,
            o,
            p,
            q,
            r,
            s;
            if (g === -1 || !c || !a.isFunction(d)) return;
            g || (n(b, g = i++), j[g] = {
                target: b,
                events: {}
            }),
            p = j[g].events,
            p[c] || (h = !b.isCustomEventTarget, o = (h || b._supportSpecialEvent) && k.special[c] || {},
            q = function(d, e) {
                if (!d || !d.fixed) d = new a.EventObject(b, d, c);
                return a.isPlainObject(e) && a.mix(d, e),
                o.setup && o.setup(d),
                (o.handle || k._handle)(b, d, p[c].listeners)
            },
            p[c] = {
                handle: q,
                listeners: []
            },
            r = o.fix || c, s = o.capture, h ? e(b, r, q, s) : b._addEvent && b._addEvent(r, q, s)),
            p[c].listeners.push({
                fn: d,
                scope: f || b
            })
        },
        remove: function(c, d, e, g) {
            if (l("remove", c, d, e, g)) return;
            var h = m(c),
            i,
            n,
            p,
            q,
            r,
            s,
            t,
            u,
            v;
            if (h === -1) return;
            if (!h || !(t = j[h])) return;
            if (t.target !== c) return;
            g = g || c,
            i = t.events || {};
            if (n = i[d]) {
                p = n.listeners,
                s = p.length;
                if (a.isFunction(e) && s) {
                    for (q = 0, r = 0, u = []; q < s; ++q) if (e !== p[q].fn || g !== p[q].scope) u[r++] = p[q];
                    n.listeners = u,
                    s = u.length
                }
                if (e === b || s === 0) c.isCustomEventTarget ? c._removeEvent && c._removeEvent(d, n.handle) : (v = k.special[d] || {},
                f(c, v.fix || d, n.handle)),
                delete i[d]
            }
            if (d === b || a.isEmptyObject(i)) {
                for (d in i) k.remove(c, d);
                delete j[h],
                o(c)
            }
        },
        _handle: function(a, c, d) {
            d = d.slice(0);
            var e, f = 0,
            g = d.length,
            h;
            for (; f < g; ++f) {
                h = d[f],
                e = h.fn.call(h.scope, c),
                e !== b && (c.result = e, e === !1 && c.halt());
                if (c.isImmediatePropagationStopped) break
            }
            return e
        },
        _getCache: function(a) {
            return j[a]
        },
        _simpleAdd: e,
        _simpleRemove: f
    };
    k.on = k.add,
    a.Event = k
}),
KISSY.add("event-object",
function(a, b) {
    function e(b, c, d) {
        var e = this;
        e.currentTarget = b,
        e.originalEvent = c || {},
        c ? (e.type = c.type, e._fix()) : (e.type = d, e.target = b),
        b.isCustomEventTarget && a.DOM._isKSNode(b) && (e.target = new a.Node(e.target)),
        e.currentTarget = b,
        e.fixed = !0
    }
    var c = document,
    d = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" ");
    a.augment(e, {
        _fix: function() {
            var a = this,
            e = a.originalEvent,
            f = d.length,
            g, h = a.currentTarget,
            i = h.nodeType === 9 ? h: h.ownerDocument || c;
            while (f) g = d[--f],
            a[g] = e[g];
            a.target || (a.target = a.srcElement || c),
            a.target.nodeType === 3 && (a.target = a.target.parentNode),
            !a.relatedTarget && a.fromElement && (a.relatedTarget = a.fromElement === a.target ? a.toElement: a.fromElement);
            if (a.pageX === b && a.clientX !== b) {
                var j = i.documentElement,
                k = i.body;
                a.pageX = a.clientX + (j && j.scrollLeft || k && k.scrollLeft || 0) - (j && j.clientLeft || k && k.clientLeft || 0),
                a.pageY = a.clientY + (j && j.scrollTop || k && k.scrollTop || 0) - (j && j.clientTop || k && k.clientTop || 0)
            }
            a.which === b && (a.which = a.charCode !== b ? a.charCode: a.keyCode),
            a.metaKey === b && (a.metaKey = a.ctrlKey),
            !a.which && a.button !== b && (a.which = a.button & 1 ? 1 : a.button & 2 ? 3 : a.button & 4 ? 2 : 0)
        },
        preventDefault: function() {
            var a = this.originalEvent;
            a.preventDefault ? a.preventDefault() : a.returnValue = !1,
            this.isDefaultPrevented = !0
        },
        stopPropagation: function() {
            var a = this.originalEvent;
            a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0,
            this.isPropagationStopped = !0
        },
        stopImmediatePropagation: function() {
            var a = this.originalEvent;
            a.stopImmediatePropagation ? a.stopImmediatePropagation() : this.stopPropagation(),
            this.isImmediatePropagationStopped = !0
        },
        halt: function(a) {
            a ? this.stopImmediatePropagation() : this.stopPropagation(),
            this.preventDefault()
        }
    }),
    a.EventObject = e
}),
KISSY.add("event-target",
function(a, b) {
    var c = a.Event;
    a.EventTarget = {
        isCustomEventTarget: !0,
        fire: function(d, e) {
            var f = a.DOM.data(this, c.EVENT_GUID) || -1,
            g = c._getCache(f) || {},
            h = g.events || {},
            i = h[d];
            return i && a.isFunction(i.handle) ? i.handle(b, e) : this
        },
        on: function(a, b, d) {
            return c.add(this, a, b, d),
            this
        },
        detach: function(a, b, d) {
            return c.remove(this, a, b, d),
            this
        }
    }
}),
KISSY.add("event-mouseenter",
function(a) {
    var b = a.Event;
    a.UA.ie || a.each([{
        name: "mouseenter",
        fix: "mouseover"
    },
    {
        name: "mouseleave",
        fix: "mouseout"
    }],
    function(c) {
        b.special[c.name] = {
            fix: c.fix,
            setup: function(a) {
                a.type = c.name
            },
            handle: function(c, d, e) {
                a.DOM._isKSNode(c) && (c = c[0]);
                var f = d.relatedTarget;
                try {
                    while (f && f !== c) f = f.parentNode;
                    f !== c && b._handle(c, d, e)
                } catch(g) {
                    a.log(g)
                }
            }
        }
    })
}),
KISSY.add("event-focusin",
function(a) {
    var b = a.Event;
    document.addEventListener && a.each([{
        name: "focusin",
        fix: "focus"
    },
    {
        name: "focusout",
        fix: "blur"
    }],
    function(a) {
        b.special[a.name] = {
            fix: a.fix,
            capture: !0,
            setup: function(b) {
                b.type = a.name
            }
        }
    })
}),
KISSY.add("node",
function(a) {
    function c(d, e, f) {
        var g = this,
        h;
        if (! (g instanceof c)) return new c(d, e, f);
        if (!d) {
            g.length = 0;
            return
        }
        if (a.isString(d)) {
            h = b.create(d, e, f);
            if (h.nodeType === 11) return new a.NodeList(h.childNodes)
        } else {
            if (d instanceof c) return d;
            h = d
        }
        g[0] = h
    }
    var b = a.DOM;
    c.TYPE = "-ks-Node",
    a.augment(c, {
        length: 1,
        getDOMNode: function() {
            return this[0]
        },
        nodeType: c.TYPE
    }),
    a.one = function(b, d) {
        var e = a.get(b, d);
        return e ? new c(e) : null
    },
    a.Node = c
}),
KISSY.add("nodelist",
function(a) {
    function e(b) {
        if (this instanceof e) c.push.apply(this, a.makeArray(b) || []);
        else return new e(b)
    }
    var b = a.DOM,
    c = Array.prototype,
    d = b._isElementNode;
    a.mix(e.prototype, {
        length: 0,
        item: function(b) {
            var c = null,
            e, f;
            if (d(b)) for (e = 0, f = this.length; e < f; e++) if (b === this[e]) {
                b = e;
                break
            }
            return d(this[b]) && (c = new a.Node(this[b])),
            c
        },
        getDOMNodes: function() {
            return c.slice.call(this)
        },
        each: function(b, c) {
            var d = this.length,
            e = 0,
            f;
            for (f = new a.Node(this[0]); e < d && b.call(c || f, f, e, this) !== !1; f = new a.Node(this[++e]));
            return this
        }
    }),
    a.all = function(b, c) {
        return new e(a.query(b, c, !0))
    },
    a.NodeList = e
}),
KISSY.add("node-attach",
function(a, b) {
    function n(d, e, f, g) {
        var h = this[d ? j: i](),
        k = [h].concat(a.makeArray(e));
        return e[f] === b ? g.apply(c, k) : (g.apply(c, k), this)
    }
    function o(d, e) {
        a.each(d,
        function(d) {
            a.each([g, h],
            function(f, g) {
                f[d] = function(d) {
                    switch (e) {
                    case k:
                        return function() {
                            return n.call(this, g, arguments, 1, d)
                        };
                    case l:
                        return function() {
                            return n.call(this, g, arguments, 0, d)
                        };
                    case m:
                        return function() {
                            var b = this[g ? j: i](),
                            e = d.apply(c, [b].concat(a.makeArray(arguments)));
                            return e ? new(a[a.isArray(e) ? "NodeList": "Node"])(e) : null
                        };
                    default:
                        return function() {
                            var e = this[g ? j: i](),
                            f = d.apply(c, [e].concat(a.makeArray(arguments)));
                            return f === b ? this: f
                        }
                    }
                } (c[d])
            })
        })
    }
    function p(b, d, g) {
        return b && a.each(this,
        function(h) {
            var i;
            if (d || a.isString(b)) i = c.create(b);
            else {
                if (e(b, 1) || e(b, 3)) i = b;
                f(b) && (i = b[0])
            }
            c[g](i, h)
        }),
        this
    }
    function q(b, d) {
        return (b = a.get(b)) && b.appendChild && a.each(this,
        function(a) {
            c[d](a, b)
        }),
        this
    }
    var c = a.DOM,
    d = a.Event,
    e = c._nodeTypeIs,
    f = c._isKSNode,
    g = a.Node.prototype,
    h = a.NodeList.prototype,
    i = "getDOMNode",
    j = i + "s",
    k = 1,
    l = 2,
    m = 4;
    a.mix(g, {
        one: function(b) {
            return a.one(b, this[0])
        },
        all: function(b) {
            return a.all(b, this[0])
        }
    }),
    o(["data", "removeData"], k),
    o(["hasClass", "addClass", "removeClass", "replaceClass", "toggleClass"]),
    o(["attr", "removeAttr"], k),
    o(["val", "text"], l),
    o(["css"], k),
    o(["width", "height"], l),
    o(["offset"], l),
    o(["scrollIntoView"]),
    o(["parent", "next", "prev", "siblings", "children"], m),
    o(["contains"]),
    o(["html"], l),
    o(["remove"]),
    a.each(["insertBefore", "insertAfter"],
    function(a) {
        g[a] = function(b) {
            return c[a].call(c, this[0], b),
            this
        }
    }),
    a.each([g, h],
    function(b, c) {
        a.each(["append", "prepend"],
        function(a) {
            b[a] = function(b) {
                return p.call(this, b, c, a)
            },
            b[a + "To"] = function(b) {
                return q.call(this, b, a)
            }
        })
    }),
    a.mix(g, a.EventTarget),
    g._supportSpecialEvent = !0,
    g._addEvent = function(a, b, c) {
        d._simpleAdd(this[0], a, b, c)
    },
    g._removeEvent = function(a, b, c) {
        d._simpleRemove(this[0], a, b, c)
    },
    delete g.fire,
    a.mix(h, a.EventTarget),
    delete h.fire
}),
this.JSON || (this.JSON = {}),
function() {
    function f(a) {
        return a < 10 ? "0" + a: a
    }
    function quote(a) {
        return escapable.lastIndex = 0,
        escapable.test(a) ? '"' + a.replace(escapable,
        function(a) {
            var b = meta[a];
            return typeof b == "string" ? b: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
        }) + '"': '"' + a + '"'
    }
    function str(a, b) {
        var c, d, e, f, g = gap,
        h, i = b[a];
        i && typeof i == "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)),
        typeof rep == "function" && (i = rep.call(b, a, i));
        switch (typeof i) {
        case "string":
            return quote(i);
        case "number":
            return isFinite(i) ? String(i) : "null";
        case "boolean":
        case "null":
            return String(i);
        case "object":
            if (!i) return "null";
            gap += indent,
            h = [];
            if (Object.prototype.toString.apply(i) === "[object Array]") {
                f = i.length;
                for (c = 0; c < f; c += 1) h[c] = str(c, i) || "null";
                return e = h.length === 0 ? "[]": gap ? "[\n" + gap + h.join(",\n" + gap) + "\n" + g + "]": "[" + h.join(",") + "]",
                gap = g,
                e
            }
            if (rep && typeof rep == "object") {
                f = rep.length;
                for (c = 0; c < f; c += 1) d = rep[c],
                typeof d == "string" && (e = str(d, i), e && h.push(quote(d) + (gap ? ": ": ":") + e))
            } else for (d in i) Object.hasOwnProperty.call(i, d) && (e = str(d, i), e && h.push(quote(d) + (gap ? ": ": ":") + e));
            return e = h.length === 0 ? "{}": gap ? "{\n" + gap + h.join(",\n" + gap) + "\n" + g + "}": "{" + h.join(",") + "}",
            gap = g,
            e
        }
    }
    typeof Date.prototype.toJSON != "function" && (Date.prototype.toJSON = function(a) {
        return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z": null
    },
    String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(a) {
        return this.valueOf()
    });
    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    gap, indent, meta = {
        "\b": "\\b",
        "\t": "\\t",
        "\n": "\\n",
        "\f": "\\f",
        "\r": "\\r",
        '"': '\\"',
        "\\": "\\\\"
    },
    rep;
    typeof JSON.stringify != "function" && (JSON.stringify = function(a, b, c) {
        var d;
        gap = "",
        indent = "";
        if (typeof c == "number") for (d = 0; d < c; d += 1) indent += " ";
        else typeof c == "string" && (indent = c);
        rep = b;
        if (!b || typeof b == "function" || typeof b == "object" && typeof b.length == "number") return str("", {
            "": a
        });
        throw new Error("JSON.stringify")
    }),
    typeof JSON.parse != "function" && (JSON.parse = function(text, reviver) {
        function walk(a, b) {
            var c, d, e = a[b];
            if (e && typeof e == "object") for (c in e) Object.hasOwnProperty.call(e, c) && (d = walk(e, c), d !== undefined ? e[c] = d: delete e[c]);
            return reviver.call(a, b, e)
        }
        var j;
        text = String(text),
        cx.lastIndex = 0,
        cx.test(text) && (text = text.replace(cx,
        function(a) {
            return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
        }));
        if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"),
        typeof reviver == "function" ? walk({
            "": j
        },
        "") : j;
        throw new SyntaxError("JSON.parse")
    })
} (),
KISSY.add("json",
function(a) {
    var b = window.JSON;
    a.JSON = {
        parse: function(a) {
            return a == null || a === "" ? null: b.parse(a)
        },
        stringify: b.stringify
    }
}),
KISSY.add("ajax",
function(a, b) {
    function v(h) {
        h = a.merge(u, h);
        if (!h.url) return;
        h.data && !a.isString(h.data) && (h.data = a.param(h.data)),
        h.context = h.context || h;
        var k, v = p,
        B, C = h.type.toUpperCase(),
        D;
        if (h.dataType === i) {
            k = h.jsonpCallback || i + a.now(),
            h.url = x(h.url, h.jsonp + "=" + k),
            h.dataType = j;
            var E = c[k];
            c[k] = function(d) {
                if (a.isFunction(E)) E(d);
                else {
                    c[k] = b;
                    try {
                        delete c[k]
                    } catch(e) {}
                }
                y([p, q], d, v, G, h)
            }
        }
        h.data && C === e && (h.url = x(h.url, h.data));
        if (h.dataType === j) return z(m, h),
        D = a.getScript(h.url, k ? null: function() {
            y([p, q], l, v, G, h)
        }),
        z(n, h),
        D;
        var F = !1,
        G = h.xhr();
        z(m, h),
        G.open(C, h.url, h.async);
        try { (h.data || h.contentType) && G.setRequestHeader(g, h.contentType),
            G.setRequestHeader("Accept", h.dataType && h.accepts[h.dataType] ? h.accepts[h.dataType] + ", */*; q=0.01": h.accepts._default)
        } catch(H) {}
        G.onreadystatechange = function(a) {
            if (!G || G.readyState === 0 || a === "abort") F || y(q, null, r, G, h),
            F = !0,
            G && (G.onreadystatechange = d);
            else if (!F && G && (G.readyState === 4 || a === s)) {
                F = !0,
                G.onreadystatechange = d,
                v = a === s ? s: w(G) ? p: r;
                try {
                    B = A(G, h.dataType)
                } catch(b) {
                    v = t
                }
                y([v === p ? p: r, q], B, v, G, h),
                a === s && (G.abort(), z(o, h)),
                h.async && (G = null)
            }
        },
        z(n, h);
        try {
            G.send(C === f ? h.data: null)
        } catch(H) {
            y([r, q], B, r, G, h)
        }
        return h.async || z(q, h),
        G
    }
    function w(a) {
        try {
            return a.status >= 200 && a.status < 300 || a.status === 304 || a.status === 1223
        } catch(b) {}
        return ! 1
    }
    function x(a, b) {
        return a + (a.indexOf("?") === -1 ? "?": "&") + b
    }
    function y(b, c, d, e, f) {
        a.isArray(b) ? a.each(b,
        function(a) {
            y(a, c, d, e, f)
        }) : (d === b && f[b] && f[b].call(f.context, c, d, e), z(b, f))
    }
    function z(a, b) {
        v.fire(a, {
            ajaxConfig: b
        })
    }
    function A(b, c) {
        var d = l,
        e, f = b;
        if (!a.isString(f)) {
            d = b.getResponseHeader(g) || l,
            e = c === "xml" || !c && d.indexOf("xml") >= 0,
            f = e ? b.responseXML: b.responseText;
            if (e && f.documentElement.nodeName === t) throw t
        }
        return a.isString(f) && (c === h || !c && d.indexOf(h) >= 0) && (f = a.JSON.parse(f)),
        f
    }
    var c = window,
    d = function() {},
    e = "GET",
    f = "POST",
    g = "Content-Type",
    h = "json",
    i = h + "p",
    j = "script",
    k = "callback",
    l = "",
    m = "start",
    n = "send",
    o = "stop",
    p = "success",
    q = "complete",
    r = "error",
    s = "timeout",
    t = "parsererror",
    u = {
        type: e,
        url: l,
        contentType: "application/x-www-form-urlencoded",
        async: !0,
        data: null,
        xhr: c.ActiveXObject ?
        function() {
            if (c.XmlHttpRequest) try {
                return new c.XMLHttpRequest
            } catch(a) {}
            try {
                return new c.ActiveXObject("Microsoft.XMLHTTP")
            } catch(b) {}
        }: function() {
            return new c.XMLHttpRequest
        },
        accepts: {
            xml: "application/xml, text/xml",
            html: "text/html",
            script: "text/javascript, application/javascript",
            json: "application/json, text/javascript",
            text: "text/plain",
            _default: "*/*"
        },
        jsonp: k
    };
    a.mix(v, a.EventTarget),
    a.mix(v, {
        get: function(b, c, d, f, g) {
            return a.isFunction(c) && (f = d, d = c),
            v({
                type: g || e,
                url: b,
                data: c,
                success: function(a, b, c) {
                    d && d.call(this, a, b, c)
                },
                dataType: f
            })
        },
        post: function(c, d, e, g) {
            return a.isFunction(d) && (g = e, e = d, d = b),
            v.get(c, d, e, g, f)
        },
        jsonp: function(b, c, d) {
            return a.isFunction(c) && (d = c, c = null),
            v.get(b, c, d, i)
        }
    }),
    v.getScript = a.getScript,
    a.io = a.ajax = v.ajax = v,
    a.jsonp = v.jsonp,
    a.IO = v
}),
KISSY.add("anim-easing",
function(a) {
    var b = Math,
    c = b.PI,
    d = b.pow,
    e = b.sin,
    f = 1.70158,
    g = {
        easeNone: function(a) {
            return a
        },
        easeIn: function(a) {
            return a * a
        },
        easeOut: function(a) {
            return (2 - a) * a
        },
        easeBoth: function(a) {
            return (a *= 2) < 1 ? .5 * a * a: .5 * (1 - --a * (a - 2))
        },
        easeInStrong: function(a) {
            return a * a * a * a
        },
        easeOutStrong: function(a) {
            return 1 - --a * a * a * a
        },
        easeBothStrong: function(a) {
            return (a *= 2) < 1 ? .5 * a * a * a * a: .5 * (2 - (a -= 2) * a * a * a)
        },
        elasticIn: function(a) {
            var b = .3,
            f = b / 4;
            return a === 0 || a === 1 ? a: -(d(2, 10 * (a -= 1)) * e((a - f) * 2 * c / b))
        },
        elasticOut: function(a) {
            var b = .3,
            f = b / 4;
            return a === 0 || a === 1 ? a: d(2, -10 * a) * e((a - f) * 2 * c / b) + 1
        },
        elasticBoth: function(a) {
            var b = .45,
            f = b / 4;
            return a === 0 || (a *= 2) === 2 ? a: a < 1 ? -0.5 * d(2, 10 * (a -= 1)) * e((a - f) * 2 * c / b) : d(2, -10 * (a -= 1)) * e((a - f) * 2 * c / b) * .5 + 1
        },
        backIn: function(a) {
            return a === 1 && (a -= .001),
            a * a * ((f + 1) * a - f)
        },
        backOut: function(a) {
            return (a -= 1) * a * ((f + 1) * a + f) + 1
        },
        backBoth: function(a) {
            return (a *= 2) < 1 ? .5 * a * a * (((f *= 1.525) + 1) * a - f) : .5 * ((a -= 2) * a * (((f *= 1.525) + 1) * a + f) + 2)
        },
        bounceIn: function(a) {
            return 1 - g.bounceOut(1 - a)
        },
        bounceOut: function(a) {
            var b = 7.5625,
            c;
            return a < 1 / 2.75 ? c = b * a * a: a < 2 / 2.75 ? c = b * (a -= 1.5 / 2.75) * a + .75 : a < 2.5 / 2.75 ? c = b * (a -= 2.25 / 2.75) * a + .9375 : c = b * (a -= 2.625 / 2.75) * a + .984375,
            c
        },
        bounceBoth: function(a) {
            return a < .5 ? g.bounceIn(a * 2) * .5 : g.bounceOut(a * 2 - 1) * .5 + .5
        }
    };
    g.NativeTimeFunction = {
        easeNone: "linear",
        ease: "ease",
        easeIn: "ease-in",
        easeOut: "ease-out",
        easeBoth: "ease-in-out",
        easeInStrong: "cubic-bezier(0.9, 0.0, 0.9, 0.5)",
        easeOutStrong: "cubic-bezier(0.1, 0.5, 0.1, 1.0)",
        easeBothStrong: "cubic-bezier(0.9, 0.0, 0.1, 1.0)"
    },
    a.Easing = g
}),
KISSY.add("anim",
function(a, b) {
    function p(c, f, g, h, i, j) {
        if (! (c = a.get(c))) return;
        if (! (this instanceof p)) return new p(c, f, g, h, i, j);
        var k = this,
        l = a.isPlainObject(g),
        m = f,
        r;
        k.domEl = c,
        a.isPlainObject(m) && (m = a.param(m, ";").replace(/=/g, ":").replace(/%23/g, "#").replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()),
        k.props = s(m),
        k.targetStyle = m;
        if (l) r = a.merge(o, g);
        else {
            r = a.clone(o),
            g && (r.duration = e(g) || 1);
            if (a.isString(h) || a.isFunction(h)) r.easing = h;
            a.isFunction(i) && (r.complete = i),
            j !== b && (r.nativeSupport = j)
        }
        k.config = r,
        r.nativeSupport && q() && a.isString(h = r.easing) && (/cubic-bezier\([\s\d.,]+\)/.test(h) || (h = d.NativeTimeFunction[h])) && (r.easing = h, k.transitionName = q()),
        a.isFunction(i) && k.on(n, i)
    }
    function q() {
        var c = "transition",
        d;
        return f.style[c] !== b ? d = c: a.each(["Webkit", "Moz", "O"],
        function(a) {
            if (f.style[c = a + "Transition"] !== b) return d = c,
            !1
        }),
        q = function() {
            return d
        },
        d
    }
    function r(b, d, e) {
        a.UA.ie && e.indexOf(i) > -1 && c.css(b, i, d[i].v),
        b.style.cssText += ";" + e
    }
    function s(a) {
        var b, c = {},
        d = g.length,
        e;
        f.innerHTML = '<div style="' + a + '"></div>',
        b = f.firstChild.style;
        while (d--) if (e = b[g[d]]) c[g[d]] = t(e);
        return c
    }
    function t(a) {
        var b = e(a),
        c = (a + "").replace(/^[-\d.]+/, "");
        return isNaN(b) ? {
            v: c,
            u: "",
            f: v
        }: {
            v: b,
            u: c,
            f: u
        }
    }
    function u(a, b, c) {
        return (a + (b - a) * c).toFixed(3)
    }
    function v(a, b, c) {
        var d = 2,
        e, f, g, h = [],
        i = [];
        while (e = 3, f = arguments[d - 1], d--) if (w(f, 0, 4) === "rgb(") {
            f = f.match(/\d+/g);
            while (e--) h.push(~~f[e])
        } else {
            if (w(f, 0) !== "#") return b;
            f.length === 4 && (f = "#" + w(f, 1) + w(f, 1) + w(f, 2) + w(f, 2) + w(f, 3) + w(f, 3));
            while (e--) h.push(parseInt(w(f, 1 + e * 2, 2), 16))
        }
        while (e--) g = ~~ (h[e + 3] + (h[e] - h[e + 3]) * c),
        i.push(g < 0 ? 0 : g > 255 ? 255 : g);
        return "rgb(" + i.join(",") + ")"
    }
    function w(a, b, c) {
        return a.substr(b, c || 1)
    }
    var c = a.DOM,
    d = a.Easing,
    e = parseFloat,
    f = c.create("<div>"),
    g = "backgroundColor borderBottomColor borderBottomWidth borderBottomStyle borderLeftColor borderLeftWidth borderLeftStyle borderRightColor borderRightWidth borderRightStyle borderSpacing borderTopColor borderTopWidth borderTopStyle bottom color font fontFamily fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex".split(" "),
    h = 13,
    i = "opacity",
    j = "none",
    k = "Property",
    l = "start",
    m = "step",
    n = "complete",
    o = {
        duration: 1,
        easing: "easeNone",
        nativeSupport: !0
    };
    a.augment(p, a.EventTarget, {
        run: function() {
            var b = this,
            e = b.config,
            f = b.domEl,
            g, i, j, k, o = b.props,
            p = {},
            q, r;
            for (q in o) p[q] = t(c.css(f, q));
            if (b.fire(l) === !1) return;
            return b.stop(),
            b.transitionName ? b._nativeRun() : (g = e.duration * 1e3, j = a.now(), k = j + g, i = e.easing, a.isString(i) && (i = d[i] || d.easeNone), b.timer = a.later(r = function() {
                var d = a.now(),
                e = d > k ? 1 : (d - j) / g,
                h,
                l,
                r;
                for (q in o) h = p[q],
                l = o[q],
                l.v == 0 && (l.u = h.u),
                h.u !== l.u && (h.v = 0),
                c.css(f, q, l.f(h.v, l.v, i(e)) + l.u);
                if (b.fire(m) === !1 || (r = d > k)) b.stop(),
                r && b.fire(n)
            },
            h, !0), r()),
            b
        },
        _nativeRun: function() {
            var b = this,
            d = b.config,
            e = b.domEl,
            f = b.props,
            g = d.duration * 1e3,
            h = d.easing,
            i = b.transitionName,
            j = {};
            a.log("Amin uses native transition."),
            j[i + "Property"] = "all",
            j[i + "Duration"] = g + "ms",
            j[i + "TimingFunction"] = h,
            c.css(e, j),
            a.later(function() {
                r(e, f, b.targetStyle)
            },
            0),
            a.later(function() {
                b.stop(!0)
            },
            g)
        },
        stop: function(a) {
            var c = this;
            return c.transitionName ? c._nativeStop(a) : (c.timer && (c.timer.cancel(), c.timer = b), a && (r(c.domEl, c.props, c.targetStyle), c.fire(n))),
            c
        },
        _nativeStop: function(a) {
            var b = this,
            d = b.domEl,
            e = b.transitionName,
            f = b.props,
            g;
            if (a) c.css(d, e + k, j),
            b.fire(n);
            else {
                for (g in f) c.css(d, g, c._getComputedStyle(d, g));
                c.css(d, e + k, j)
            }
        }
    }),
    p.supportTransition = function() {
        return !! q()
    },
    a.Anim = p
}),
KISSY.add("anim-node-plugin",
function(a, b) {
    function p(b, d, e, f, n) {
        d === "toggle" && (n = c.css(b, g) === h ? 1 : 0, d = "show"),
        n && c.css(b, g, c.data(b, g) || "");
        var p = {},
        q = {};
        a.each(o[d],
        function(a) {
            a === i ? (p[i] = c.css(b, i), c.css(b, i, j)) : a === k ? (p[k] = c.css(b, k), q.opacity = n ? 1 : 0, n && c.css(b, k, 0)) : a === l ? (p[l] = c.css(b, l), q.height = n ? c.css(b, l) || b.naturalHeight: 0, n && c.css(b, l, 0)) : a === m && (p[m] = c.css(b, m), q.width = n ? c.css(b, m) || b.naturalWidth: 0, n && c.css(b, m, 0))
        }),
        (new a.Anim(b, q, e, "easeOut",
        function() {
            if (!n) {
                var d = b.style,
                e = d[g];
                e !== h && (e && c.data(b, g, e), d[g] = h),
                p[l] && c.css(b, {
                    height: p[l]
                }),
                p[m] && c.css(b, {
                    width: p[m]
                }),
                p[k] && c.css(b, {
                    opacity: p[k]
                }),
                p[i] && c.css(b, {
                    overflow: p[i]
                })
            }
            f && a.isFunction(f) && f()
        })).run()
    }
    var c = a.DOM,
    d = a.Anim,
    e = a.Node.prototype,
    f = a.NodeList.prototype,
    g = "display",
    h = "none",
    i = "overflow",
    j = "hidden",
    k = "opacity",
    l = "height",
    m = "width",
    n = "auto",
    o = {
        show: [i, k, l, m],
        fade: [k],
        slide: [i, l]
    };
    a.each([e, f],
    function(e) {
        e.animate = function() {
            var c = a.makeArray(arguments);
            return a.each(this,
            function(a) {
                d.apply(b, [a].concat(c)).run()
            }),
            this
        },
        a.each({
            show: ["show", 1],
            hide: ["show", 0],
            toggle: ["toggle"],
            fadeIn: ["fade", 1],
            fadeOut: ["fade", 0],
            slideDown: ["slide", 1],
            slideUp: ["slide", 0]
        },
        function(b, d) {
            e[d] = function(e, f) {
                return c[d] && arguments.length === 0 ? c[d](this) : a.each(this,
                function(a) {
                    p(a, b[0], e, f, b[1])
                }),
                this
            }
        })
    })
}),
KISSY.add("cookie",
function(a) {
    function e(b) {
        return a.isString(b) && b !== ""
    }
    var b = document,
    c = encodeURIComponent,
    d = decodeURIComponent;
    a.Cookie = {
        get: function(a) {
            var c, f;
            return e(a) && (f = b.cookie.match("(?:^| )" + a + "(?:(?:=([^;]*))|;|$)")) && (c = f[1] ? d(f[1]) : ""),
            c
        },
        set: function(a, d, f, g, h, i) {
            var j = c(d),
            k = f;
            typeof k == "number" && (k = new Date, k.setTime(k.getTime() + f * 864e5)),
            k instanceof Date && (j += "; expires=" + k.toUTCString()),
            e(g) && (j += "; domain=" + g),
            e(h) && (j += "; path=" + h),
            i && (j += "; secure"),
            b.cookie = a + "=" + j
        },
        remove: function(a, b, c, d) {
            this.set(a, "", 0, b, c, d)
        }
    }
}),
KISSY.add("attribute",
function(a, b) {
    function c() {
        this.__attrs = {},
        this.__attrVals = {}
    }
    function d(a) {
        return a += "",
        a.charAt(0).toUpperCase() + a.substring(1)
    }
    a.augment(c, {
        __getDefAttrs: function() {
            return a.clone(this.__attrs)
        },
        addAttr: function(b, c) {
            var d = this;
            return d.__attrs[b] = a.clone(c || {}),
            d
        },
        addAttrs: function(b, c) {
            var d = this;
            return a.each(b,
            function(a, b) {
                b in c && (a.value = c[b]),
                d.addAttr(b, a)
            }),
            d
        },
        hasAttr: function(a) {
            return a && a in (this.__attrs || {})
        },
        removeAttr: function(a) {
            var b = this;
            return b.hasAttr(a) && (delete b.__attrs[a], delete b.__attrVals[a]),
            b
        },
        set: function(a, b) {
            var c = this,
            d = c.get(a);
            if (d === b) return;
            if (!1 === c.__fireAttrChange("before", a, d, b)) return;
            return c.__set(a, b),
            c.__fireAttrChange("after", a, d, c.__attrVals[a]),
            c
        },
        __fireAttrChange: function(a, b, c, e) {
            return this.fire(a + d(b) + "Change", {
                attrName: b,
                prevVal: c,
                newVal: e
            })
        },
        __set: function(a, c) {
            var d = this,
            e, f = d.__attrs[a],
            g = f && f.setter;
            g && (e = g.call(d, c)),
            e !== b && (c = e),
            d.__attrVals[a] = c
        },
        get: function(a) {
            var b = this,
            c, d, e;
            return c = b.__attrs[a],
            d = c && c.getter,
            e = a in b.__attrVals ? b.__attrVals[a] : b.__getDefAttrVal(a),
            d && (e = d.call(b, e)),
            e
        },
        __getDefAttrVal: function(a) {
            var c = this,
            d = c.__attrs[a],
            e,
            f;
            if (!d) return;
            if (e = d.valueFn) f = e.call(c),
            f !== b && (d.value = f),
            delete d.valueFn;
            return d.value
        },
        reset: function(a) {
            var b = this;
            if (b.hasAttr(a)) return b.set(a, b.__getDefAttrVal(a));
            for (a in b.__attrs) b.hasAttr(a) && b.reset(a);
            return b
        }
    }),
    a.Attribute = c,
    c.__capitalFirst = d
}),
KISSY.add("base",
function(a) {
    function b(b) {
        a.Attribute.call(this);
        var e = this.constructor;
        while (e) c(this, e.ATTRS),
        e = e.superclass ? e.superclass.constructor: null;
        d(this, b)
    }
    function c(a, b) {
        if (b) for (var c in b) b.hasOwnProperty(c) && !a.hasAttr(c) && a.addAttr(c, b[c])
    }
    function d(a, b) {
        if (b) for (var c in b) b.hasOwnProperty(c) && a.__set(c, b[c])
    }
    a.augment(b, a.EventTarget, a.Attribute),
    a.Base = b
}),
KISSY.add("core");
