var delayb4scroll = 4000;
var marqueespeed = 1;
var pauseit = 1;
var copyspeed = marqueespeed;
var pausespeed = (pauseit == 0) ? copyspeed: 0;
var actualheight = "";
function scrollmarquee() {
    if (parseInt(cross_marquee.style.top) > (actualheight * ( - 1) + 8)) {
        cross_marquee.style.top = parseInt(cross_marquee.style.top) - copyspeed + "px"
    } else {
        cross_marquee.style.top = parseInt(marqueeheight) + 8 + "px"
    }
}
function initializemarquee() {
    cross_marquee = document.getElementById("vmarquee");
    cross_marquee.style.top = 0;
    marqueeheight = document.getElementById("marqueecontainer").offsetHeight;
    actualheight = cross_marquee.offsetHeight;
    if (window.opera || navigator.userAgent.indexOf("Netscape/7") != -1) {
        cross_marquee.style.height = marqueeheight + "px";
        cross_marquee.style.overflow = "scroll";
        return
    }
    setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
    }
if (window.addEventListener) {
    window.addEventListener("load", initializemarquee, false)
    } else {
    if (window.attachEvent) {
        window.attachEvent("onload", initializemarquee)
        } else {
        if (document.getElementById) {
            window.onload = initializemarquee
        }
    }
}
var MooTools = {
    version: "1.2.1",
    build: "0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf"
};
var Native = function(r) {
    r = r || {};
    var s = r.name;
    var p = r.legacy;
    var t = r.protect;
    var u = r.implement;
    var o = r.generics;
    var m = r.initialize;
    var n = r.afterImplement || function() {};
    var v = m || p;
    o = o !== false;
    v.constructor = Native;
    v.$family = {
        name: "native"
    };
    if (p && m) {
        v.prototype = p.prototype
    }
    v.prototype.constructor = v;
    if (s) {
        var l = s.toLowerCase();
        v.prototype.$family = {
            name: l
        };
        Native.typize(v, l)
        }
    var q = function(d, b, a, c) {
        if (!t || c || !d.prototype[b]) {
            d.prototype[b] = a
        }
        if (o) {
            Native.genericize(d, b, t)
            }
        n.call(d, b, a);
        return d
    };
    v.alias = function(d, b, a) {
        if (typeof d == "string") {
            if ((d = this.prototype[d])) {
                return q(this, b, d, a)
                }
        }
        for (var c in d) {
            this.alias(c, d[c], b)
            }
        return this
    };
    v.implement = function(c, b, a) {
        if (typeof c == "string") {
            return q(this, c, b, a)
            }
        for (var d in c) {
            q(this, d, c[d], b)
            }
        return this
    };
    if (u) {
        v.implement(u)
        }
    return v
};
Native.genericize = function(f, d, e) {
    if ((!e || !f[d]) && typeof f.prototype[d] == "function") {
        f[d] = function() {
            var a = Array.prototype.slice.call(arguments);
            return f.prototype[d].apply(a.shift(), a)
            }
    }
};
Native.implement = function(e, h) {
    for (var g = 0, f = e.length; g < f; g++) {
        e[g].implement(h)
        }
};
Native.typize = function(d, c) {
    if (!d.type) {
        d.type = function(a) {
            return ($type(a) === c)
            }
    }
}; (function() {
    var i = {
        Array: Array,
        Date: Date,
        Function: Function,
        Number: Number,
        RegExp: RegExp,
        String: String
    };
    for (var h in i) {
        new Native({
            name: h,
            initialize: i[h],
            protect: true
        })
        }
    var l = {
        "boolean": Boolean,
        "native": Native,
        object: Object
    };
    for (var k in l) {
        Native.typize(l[k], k)
        }
    var n = {
        Array: ["concat", "indexOf", "join", "lastIndexOf", "pop", "push", "reverse", "shift", "slice", "sort", "splice", "toString", "unshift", "valueOf"],
        String: ["charAt", "charCodeAt", "concat", "indexOf", "lastIndexOf", "match", "replace", "search", "slice", "split", "substr", "substring", "toLowerCase", "toUpperCase", "valueOf"]
        };
    for (var m in n) {
        for (var j = n[m].length; j--;) {
            Native.genericize(window[m], n[m][j], true)
            }
    }
})();
var Hash = new Native({
    name: "Hash",
    initialize: function(d) {
        if ($type(d) == "hash") {
            d = $unlink(d.getClean())
            }
        for (var c in d) {
            this[c] = d[c]
            }
        return this
    }
});
Hash.implement({
    forEach: function(f, d) {
        for (var e in this) {
            if (this.hasOwnProperty(e)) {
                f.call(d, this[e], e, this)
                }
        }
    },
    getClean: function() {
        var c = {};
        for (var d in this) {
            if (this.hasOwnProperty(d)) {
                c[d] = this[d]
                }
        }
        return c
    },
    getLength: function() {
        var c = 0;
        for (var d in this) {
            if (this.hasOwnProperty(d)) {
                c++
            }
        }
        return c
    }
});
Hash.alias("forEach", "each");
Array.implement({
    forEach: function(h, e) {
        for (var g = 0, f = this.length; g < f; g++) {
            h.call(e, this[g], g, this)
            }
    }
});
Array.alias("forEach", "each");
function $A(h) {
    if (h.item) {
        var e = [];
        for (var g = 0, f = h.length; g < f; g++) {
            e[g] = h[g]
            }
        return e
    }
    return Array.prototype.slice.call(h)
    }
function $arguments(b) {
    return function() {
        return arguments[b]
        }
}
function $chk(b) {
    return !! (b || b === 0)
    }
function $clear(b) {
    clearTimeout(b);
    clearInterval(b);
    return null
}
function $defined(b) {
    return (b != undefined)
    }
function $each(h, g, e) {
    var f = $type(h); ((f == "arguments" || f == "collection" || f == "array") ? Array: Hash).each(h, g, e)
    }
function $empty() {}
function $extend(d, e) {
    for (var f in (e || {})) {
        d[f] = e[f]
        }
    return d
}
function $H(b) {
    return new Hash(b)
    }
function $lambda(b) {
    return (typeof b == "function") ? b: function() {
        return b
    }
}
function $merge() {
    var m = {};
    for (var l = 0, i = arguments.length; l < i; l++) {
        var j = arguments[l];
        if ($type(j) != "object") {
            continue
        }
        for (var k in j) {
            var h = j[k],
            n = m[k];
            m[k] = (n && $type(h) == "object" && $type(n) == "object") ? $merge(n, h) : $unlink(h)
            }
    }
    return m
}
function $pick() {
    for (var c = 0, d = arguments.length; c < d; c++) {
        if (arguments[c] != undefined) {
            return arguments[c]
            }
    }
    return null
}
function $random(c, d) {
    return Math.floor(Math.random() * (d - c + 1) + c)
    }
function $splat(c) {
    var d = $type(c);
    return (d) ? ((d != "array" && d != "arguments") ? [c] : c) : []
    }
var $time = Date.now || function() {
    return + new Date
};
function $try() {
    for (var f = 0, e = arguments.length; f < e; f++) {
        try {
            return arguments[f]()
            } catch(d) {}
    }
    return null
}
function $type(b) {
    if (b == undefined) {
        return false
    }
    if (b.$family) {
        return (b.$family.name == "number" && !isFinite(b)) ? false: b.$family.name
    }
    if (b.nodeName) {
        switch (b.nodeType) {
        case 1:
            return "element";
        case 3:
            return (/\S/).test(b.nodeValue) ? "textnode": "whitespace"
        }
    } else {
        if (typeof b.length == "number") {
            if (b.callee) {
                return "arguments"
            } else {
                if (b.item) {
                    return "collection"
                }
            }
        }
    }
    return typeof b
}
function $unlink(i) {
    var h;
    switch ($type(i)) {
    case "object":
        h = {};
        for (var f in i) {
            h[f] = $unlink(i[f])
            }
        break;
    case "hash":
        h = new Hash(i);
        break;
    case "array":
        h = [];
        for (var j = 0, g = i.length; j < g; j++) {
            h[j] = $unlink(i[j])
            }
        break;
    default:
        return i
    }
    return h
}
var Browser = $merge({
    Engine: {
        name: "unknown",
        version: 0
    },
    Platform: {
        name: (window.orientation != undefined) ? "ipod": (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase()
        },
    Features: {
        xpath: !!(document.evaluate),
        air: !!(window.runtime),
        query: !!(document.querySelector)
        },
    Plugins: {},
    Engines: {
        presto: function() {
            return (!window.opera) ? false: ((arguments.callee.caller) ? 960: ((document.getElementsByClassName) ? 950: 925))
            },
        trident: function() {
            return (!window.ActiveXObject) ? false: ((window.XMLHttpRequest) ? 5: 4)
            },
        webkit: function() {
            return (navigator.taintEnabled) ? false: ((Browser.Features.xpath) ? ((Browser.Features.query) ? 525: 420) : 419)
            },
        gecko: function() {
            return (document.getBoxObjectFor == undefined) ? false: ((document.getElementsByClassName) ? 19: 18)
            }
    }
}, Browser || {});
Browser.Platform[Browser.Platform.name] = true;
Browser.detect = function() {
    for (var c in this.Engines) {
        var d = this.Engines[c]();
        if (d) {
            this.Engine = {
                name: c,
                version: d
            };
            this.Engine[c] = this.Engine[c + d] = true;
            break
        }
    }
    return {
        name: c,
        version: d
    }
};
Browser.detect();
Browser.Request = function() {
    return $try(function() {
        return new XMLHttpRequest()
        }, function() {
        return new ActiveXObject("MSXML2.XMLHTTP")
        })
    };
Browser.Features.xhr = !!(Browser.Request());
Browser.Plugins.Flash = (function() {
    var b = ($try(function() {
        return navigator.plugins["Shockwave Flash"].description
    }, function() {
        return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")
        }) || "0 r0").match(/\d+/g);
    return {
        version: parseInt(b[0] || 0 + "." + b[1] || 0),
        build: parseInt(b[2] || 0)
        }
})();
function $exec(c) {
    if (!c) {
        return c
    }
    if (window.execScript) {
        window.execScript(c)
        } else {
        var d = document.createElement("script");
        d.setAttribute("type", "text/javascript");
        d[(Browser.Engine.webkit && Browser.Engine.version < 420) ? "innerText": "text"] = c;
        document.head.appendChild(d);
        document.head.removeChild(d)
        }
    return c
}
Native.UID = 1;
var $uid = (Browser.Engine.trident) ? function(b) {
    return (b.uid || (b.uid = [Native.UID++]))[0]
    }: function(b) {
    return b.uid || (b.uid = Native.UID++)
    };
var Window = new Native({
    name: "Window",
    legacy: (Browser.Engine.trident) ? null: window.Window,
    initialize: function(b) {
        $uid(b);
        if (!b.Element) {
            b.Element = $empty;
            if (Browser.Engine.webkit) {
                b.document.createElement("iframe")
                }
            b.Element.prototype = (Browser.Engine.webkit) ? window["[[DOMElement.prototype]]"] : {}
        }
        b.document.window = b;
        return $extend(b, Window.Prototype)
        },
    afterImplement: function(c, d) {
        window[c] = Window.Prototype[c] = d
    }
});
Window.Prototype = {
    $family: {
        name: "window"
    }
};
new Window(window);
var Document = new Native({
    name: "Document",
    legacy: (Browser.Engine.trident) ? null: window.Document,
    initialize: function(b) {
        $uid(b);
        b.head = b.getElementsByTagName("head")[0];
        b.html = b.getElementsByTagName("html")[0];
        if (Browser.Engine.trident && Browser.Engine.version <= 4) {
            $try(function() {
                b.execCommand("BackgroundImageCache", false, true)
                })
            }
        if (Browser.Engine.trident) {
            b.window.attachEvent("onunload", function() {
                b.window.detachEvent("onunload", arguments.callee);
                b.head = b.html = b.window = null
            })
            }
        return $extend(b, Document.Prototype)
        },
    afterImplement: function(c, d) {
        document[c] = Document.Prototype[c] = d
    }
});
Document.Prototype = {
    $family: {
        name: "document"
    }
};
new Document(document);
Array.implement({
    every: function(h, e) {
        for (var g = 0, f = this.length; g < f; g++) {
            if (!h.call(e, this[g], g, this)) {
                return false
            }
        }
        return true
    },
    filter: function(j, f) {
        var i = [];
        for (var h = 0, g = this.length; h < g; h++) {
            if (j.call(f, this[h], h, this)) {
                i.push(this[h])
                }
        }
        return i
    },
    clean: function() {
        return this.filter($defined)
        },
    indexOf: function(h, e) {
        var f = this.length;
        for (var g = (e < 0) ? Math.max(0, f + e) : e || 0; g < f; g++) {
            if (this[g] === h) {
                return g
            }
        }
        return - 1
    },
    map: function(j, f) {
        var i = [];
        for (var h = 0, g = this.length; h < g; h++) {
            i[h] = j.call(f, this[h], h, this)
            }
        return i
    },
    some: function(h, e) {
        for (var g = 0, f = this.length; g < f; g++) {
            if (h.call(e, this[g], g, this)) {
                return true
            }
        }
        return false
    },
    associate: function(h) {
        var e = {},
        g = Math.min(this.length, h.length);
        for (var f = 0; f < g; f++) {
            e[h[f]] = this[f]
            }
        return e
    },
    link: function(i) {
        var g = {};
        for (var f = 0, h = this.length; f < h; f++) {
            for (var j in i) {
                if (i[j](this[f])) {
                    g[j] = this[f];
                    delete i[j];
                    break
                }
            }
        }
        return g
    },
    contains: function(d, c) {
        return this.indexOf(d, c) != -1
    },
    extend: function(d) {
        for (var f = 0, e = d.length; f < e; f++) {
            this.push(d[f])
            }
        return this
    },
    getLast: function() {
        return (this.length) ? this[this.length - 1] : null
    },
    getRandom: function() {
        return (this.length) ? this[$random(0, this.length - 1)] : null
    },
    include: function(b) {
        if (!this.contains(b)) {
            this.push(b)
            }
        return this
    },
    combine: function(d) {
        for (var f = 0, e = d.length; f < e; f++) {
            this.include(d[f])
            }
        return this
    },
    erase: function(c) {
        for (var d = this.length; d--; d) {
            if (this[d] === c) {
                this.splice(d, 1)
                }
        }
        return this
    },
    empty: function() {
        this.length = 0;
        return this
    },
    flatten: function() {
        var e = [];
        for (var g = 0, f = this.length; g < f; g++) {
            var h = $type(this[g]);
            if (!h) {
                continue
            }
            e = e.concat((h == "array" || h == "collection" || h == "arguments") ? Array.flatten(this[g]) : this[g])
            }
        return e
    },
    hexToRgb: function(c) {
        if (this.length != 3) {
            return null
        }
        var d = this.map(function(a) {
            if (a.length == 1) {
                a += a
            }
            return a.toInt(16)
            });
        return (c) ? d: "rgb(" + d + ")"
    },
    rgbToHex: function(e) {
        if (this.length < 3) {
            return null
        }
        if (this.length == 4 && this[3] == 0 && !e) {
            return "transparent"
        }
        var g = [];
        for (var f = 0; f < 3; f++) {
            var h = (this[f] - 0).toString(16);
            g.push((h.length == 1) ? "0" + h: h)
            }
        return (e) ? g: "#" + g.join("")
        }
});
Function.implement({
    extend: function(d) {
        for (var c in d) {
            this[c] = d[c]
            }
        return this
    },
    create: function(c) {
        var d = this;
        c = c || {};
        return function(b) {
            var a = c.arguments;
            a = (a != undefined) ? $splat(a) : Array.slice(arguments, (c.event) ? 1: 0);
            if (c.event) {
                a = [b || window.event].extend(a)
                }
            var f = function() {
                return d.apply(c.bind || null, a)
                };
            if (c.delay) {
                return setTimeout(f, c.delay)
                }
            if (c.periodical) {
                return setInterval(f, c.periodical)
                }
            if (c.attempt) {
                return $try(f)
                }
            return f()
            }
    },
    run: function(d, c) {
        return this.apply(c, $splat(d))
        },
    pass: function(d, c) {
        return this.create({
            bind: c,
            arguments: d
        })
        },
    bind: function(c, d) {
        return this.create({
            bind: c,
            arguments: d
        })
        },
    bindWithEvent: function(c, d) {
        return this.create({
            bind: c,
            arguments: d,
            event: true
        })
        },
    attempt: function(d, c) {
        return this.create({
            bind: c,
            arguments: d,
            attempt: true
        })()
        },
    delay: function(f, d, e) {
        return this.create({
            bind: d,
            arguments: e,
            delay: f
        })()
        },
    periodical: function(d, f, e) {
        return this.create({
            bind: f,
            arguments: e,
            periodical: d
        })()
        }
});
Number.implement({
    limit: function(c, d) {
        return Math.min(d, Math.max(c, this))
        },
    round: function(b) {
        b = Math.pow(10, b || 0);
        return Math.round(this * b) / b
    },
    times: function(f, d) {
        for (var e = 0; e < this; e++) {
            f.call(d, e, this)
            }
    },
    toFloat: function() {
        return parseFloat(this)
        },
    toInt: function(b) {
        return parseInt(this, b || 10)
        }
});
Number.alias("times", "each"); (function(c) {
    var d = {};
    c.each(function(a) {
        if (!Number[a]) {
            d[a] = function() {
                return Math[a].apply(null, [this].concat($A(arguments)))
                }
        }
    });
    Number.implement(d)
    })(["abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "exp", "floor", "log", "max", "min", "pow", "sin", "sqrt", "tan"]);
String.implement({
    test: function(d, c) {
        return ((typeof d == "string") ? new RegExp(d, c) : d).test(this)
        },
    contains: function(d, c) {
        return (c) ? (c + this + c).indexOf(c + d + c) > -1: this.indexOf(d) > -1
    },
    trim: function() {
        return this.replace(/^\s+|\s+$/g, "")
        },
    clean: function() {
        return this.replace(/\s+/g, " ").trim()
        },
    camelCase: function() {
        return this.replace(/-\D/g, function(b) {
            return b.charAt(1).toUpperCase()
            })
        },
    hyphenate: function() {
        return this.replace(/[A-Z]/g, function(b) {
            return ("-" + b.charAt(0).toLowerCase())
            })
        },
    capitalize: function() {
        return this.replace(/\b[a-z]/g, function(b) {
            return b.toUpperCase()
            })
        },
    escapeRegExp: function() {
        return this.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1")
        },
    toInt: function(b) {
        return parseInt(this, b || 10)
        },
    toFloat: function() {
        return parseFloat(this)
        },
    hexToRgb: function(c) {
        var d = this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
        return (d) ? d.slice(1).hexToRgb(c) : null
    },
    rgbToHex: function(c) {
        var d = this.match(/\d{1,3}/g);
        return (d) ? d.rgbToHex(c) : null
    },
    stripScripts: function(f) {
        var e = "";
        var d = this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function() {
            e += arguments[1] + "\n";
            return ""
        });
        if (f === true) {
            $exec(e)
            } else {
            if ($type(f) == "function") {
                f(e, d)
                }
        }
        return d
    },
    substitute: function(d, c) {
        return this.replace(c || (/\\?\{([^{}]+)\}/g), function(b, a) {
            if (b.charAt(0) == "\\") {
                return b.slice(1)
                }
            return (d[a] != undefined) ? d[a] : ""
        })
        }
});
Hash.implement({
    has: Object.prototype.hasOwnProperty,
    keyOf: function(c) {
        for (var d in this) {
            if (this.hasOwnProperty(d) && this[d] === c) {
                return d
            }
        }
        return null
    },
    hasValue: function(b) {
        return (Hash.keyOf(this, b) !== null)
        },
    extend: function(b) {
        Hash.each(b, function(a, d) {
            Hash.set(this, d, a)
            }, this);
        return this
    },
    combine: function(b) {
        Hash.each(b, function(a, d) {
            Hash.include(this, d, a)
            }, this);
        return this
    },
    erase: function(b) {
        if (this.hasOwnProperty(b)) {
            delete this[b]
            }
        return this
    },
    get: function(b) {
        return (this.hasOwnProperty(b)) ? this[b] : null
    },
    set: function(d, c) {
        if (!this[d] || this.hasOwnProperty(d)) {
            this[d] = c
        }
        return this
    },
    empty: function() {
        Hash.each(this, function(c, d) {
            delete this[d]
            }, this);
        return this
    },
    include: function(f, d) {
        var e = this[f];
        if (e == undefined) {
            this[f] = d
        }
        return this
    },
    map: function(f, d) {
        var e = new Hash;
        Hash.each(this, function(b, a) {
            e.set(a, f.call(d, b, a, this))
            }, this);
        return e
    },
    filter: function(f, d) {
        var e = new Hash;
        Hash.each(this, function(b, a) {
            if (f.call(d, b, a, this)) {
                e.set(a, b)
                }
        }, this);
        return e
    },
    every: function(f, d) {
        for (var e in this) {
            if (this.hasOwnProperty(e) && !f.call(d, this[e], e)) {
                return false
            }
        }
        return true
    },
    some: function(f, d) {
        for (var e in this) {
            if (this.hasOwnProperty(e) && f.call(d, this[e], e)) {
                return true
            }
        }
        return false
    },
    getKeys: function() {
        var b = [];
        Hash.each(this, function(a, d) {
            b.push(d)
            });
        return b
    },
    getValues: function() {
        var b = [];
        Hash.each(this, function(a) {
            b.push(a)
            });
        return b
    },
    toQueryString: function(d) {
        var c = [];
        Hash.each(this, function(h, g) {
            if (d) {
                g = d + "[" + g + "]"
            }
            var b;
            switch ($type(h)) {
            case "object":
                b = Hash.toQueryString(h, g);
                break;
            case "array":
                var a = {};
                h.each(function(f, e) {
                    a[e] = f
                });
                b = Hash.toQueryString(a, g);
                break;
            default:
                b = g + "=" + encodeURIComponent(h)
                }
            if (h != undefined) {
                c.push(b)
                }
        });
        return c.join("&")
        }
});
Hash.alias({
    keyOf: "indexOf",
    hasValue: "contains"
});
var Event = new Native({
    name: "Event",
    initialize: function(w, o) {
        o = o || window;
        var t = o.document;
        w = w || o.event;
        if (w.$extended) {
            return w
        }
        this.$extended = true;
        var s = w.type;
        var p = w.target || w.srcElement;
        while (p && p.nodeType == 3) {
            p = p.parentNode
        }
        if (s.test(/key/)) {
            var x = w.which || w.keyCode;
            var v = Event.Keys.keyOf(x);
            if (s == "keydown") {
                var z = x - 111;
                if (z > 0 && z < 13) {
                    v = "f" + z
                }
            }
            v = v || String.fromCharCode(x).toLowerCase()
            } else {
            if (s.match(/(click|mouse|menu)/i)) {
                t = (!t.compatMode || t.compatMode == "CSS1Compat") ? t.html: t.body;
                var r = {
                    x: w.pageX || w.clientX + t.scrollLeft,
                    y: w.pageY || w.clientY + t.scrollTop
                };
                var y = {
                    x: (w.pageX) ? w.pageX - o.pageXOffset: w.clientX,
                    y: (w.pageY) ? w.pageY - o.pageYOffset: w.clientY
                };
                if (s.match(/DOMMouseScroll|mousewheel/)) {
                    var q = (w.wheelDelta) ? w.wheelDelta / 120: -(w.detail || 0) / 3
                }
                var n = (w.which == 3) || (w.button == 2);
                var u = null;
                if (s.match(/over|out/)) {
                    switch (s) {
                    case "mouseover":
                        u = w.relatedTarget || w.fromElement;
                        break;
                    case "mouseout":
                        u = w.relatedTarget || w.toElement
                    }
                    if (! (function() {
                        while (u && u.nodeType == 3) {
                            u = u.parentNode
                        }
                        return true
                    }).create({
                        attempt: Browser.Engine.gecko
                    })()) {
                        u = false
                    }
                }
            }
        }
        return $extend(this, {
            event: w,
            type: s,
            page: r,
            client: y,
            rightClick: n,
            wheel: q,
            relatedTarget: u,
            target: p,
            code: x,
            key: v,
            shift: w.shiftKey,
            control: w.ctrlKey,
            alt: w.altKey,
            meta: w.metaKey
        })
        }
});
Event.Keys = new Hash({
    enter: 13,
    up: 38,
    down: 40,
    left: 37,
    right: 39,
    esc: 27,
    space: 32,
    backspace: 8,
    tab: 9,
    "delete": 46
});
Event.implement({
    stop: function() {
        return this.stopPropagation().preventDefault()
        },
    stopPropagation: function() {
        if (this.event.stopPropagation) {
            this.event.stopPropagation()
            } else {
            this.event.cancelBubble = true
        }
        return this
    },
    preventDefault: function() {
        if (this.event.preventDefault) {
            this.event.preventDefault()
            } else {
            this.event.returnValue = false
        }
        return this
    }
});
var Class = new Native({
    name: "Class",
    initialize: function(f) {
        f = f || {};
        var e = function() {
            for (var b in this) {
                if ($type(this[b]) != "function") {
                    this[b] = $unlink(this[b])
                    }
            }
            this.constructor = e;
            if (Class.prototyping) {
                return this
            }
            var a = (this.initialize) ? this.initialize.apply(this, arguments) : this;
            if (this.options && this.options.initialize) {
                this.options.initialize.call(this)
                }
            return a
        };
        for (var d in Class.Mutators) {
            if (!f[d]) {
                continue
            }
            f = Class.Mutators[d](f, f[d]);
            delete f[d]
            }
        $extend(e, this);
        e.constructor = Class;
        e.prototype = f;
        return e
    }
});
Class.Mutators = {
    Extends: function(d, e) {
        Class.prototyping = e.prototype;
        var f = new e;
        delete f.parent;
        f = Class.inherit(f, d);
        delete Class.prototyping;
        return f
    },
    Implements: function(d, c) {
        $splat(c).each(function(a) {
            Class.prototying = a;
            $extend(d, ($type(a) == "class") ? new a: a);
            delete Class.prototyping
        });
        return d
    }
};
Class.extend({
    inherit: function(j, m) {
        var i = arguments.callee.caller;
        for (var l in m) {
            var k = m[l];
            var h = j[l];
            var n = $type(k);
            if (h && n == "function") {
                if (k != h) {
                    if (i) {
                        k.__parent = h;
                        j[l] = k
                    } else {
                        Class.override(j, l, k)
                        }
                }
            } else {
                if (n == "object") {
                    j[l] = $merge(h, k)
                    } else {
                    j[l] = k
                }
            }
        }
        if (i) {
            j.parent = function() {
                return arguments.callee.caller.__parent.apply(this, arguments)
                }
        }
        return j
    },
    override: function(h, g, f) {
        var j = Class.prototyping;
        if (j && h[g] != j[g]) {
            j = null
        }
        var i = function() {
            var a = this.parent;
            this.parent = j ? j[g] : h[g];
            var b = f.apply(this, arguments);
            this.parent = a;
            return b
        };
        h[g] = i
    }
});
Class.implement({
    implement: function() {
        var b = this.prototype;
        $each(arguments, function(a) {
            Class.inherit(b, a)
            });
        return this
    }
});
var Chain = new Class({
    $chain: [],
    chain: function() {
        this.$chain.extend(Array.flatten(arguments));
        return this
    },
    callChain: function() {
        return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false
    },
    clearChain: function() {
        this.$chain.empty();
        return this
    }
});
var Events = new Class({
    $events: {},
    addEvent: function(d, f, e) {
        d = Events.removeOn(d);
        if (f != $empty) {
            this.$events[d] = this.$events[d] || [];
            this.$events[d].include(f);
            if (e) {
                f.internal = true
            }
        }
        return this
    },
    addEvents: function(d) {
        for (var c in d) {
            this.addEvent(c, d[c])
            }
        return this
    },
    fireEvent: function(d, f, e) {
        d = Events.removeOn(d);
        if (!this.$events || !this.$events[d]) {
            return this
        }
        this.$events[d].each(function(a) {
            a.create({
                bind: this,
                delay: e,
                "arguments": f
            })()
            }, this);
        return this
    },
    removeEvent: function(c, d) {
        c = Events.removeOn(c);
        if (!this.$events[c]) {
            return this
        }
        if (!d.internal) {
            this.$events[c].erase(d)
            }
        return this
    },
    removeEvents: function(h) {
        if ($type(h) == "object") {
            for (var e in h) {
                this.removeEvent(e, h[e])
                }
            return this
        }
        if (h) {
            h = Events.removeOn(h)
            }
        for (var e in this.$events) {
            if (h && h != e) {
                continue
            }
            var g = this.$events[e];
            for (var f = g.length; f--; f) {
                this.removeEvent(e, g[f])
                }
        }
        return this
    }
});
Events.removeOn = function(b) {
    return b.replace(/^on([A-Z])/, function(d, a) {
        return a.toLowerCase()
        })
    };
var Options = new Class({
    setOptions: function() {
        this.options = $merge.run([this.options].extend(arguments));
        if (!this.addEvent) {
            return this
        }
        for (var b in this.options) {
            if ($type(this.options[b]) != "function" || !(/^on[A-Z]/).test(b)) {
                continue
            }
            this.addEvent(b, this.options[b]);
            delete this.options[b]
            }
        return this
    }
});
var Element = new Native({
    name: "Element",
    legacy: window.Element,
    initialize: function(e, f) {
        var d = Element.Constructors.get(e);
        if (d) {
            return d(f)
            }
        if (typeof e == "string") {
            return document.newElement(e, f)
            }
        return $(e).set(f)
        },
    afterImplement: function(d, c) {
        Element.Prototype[d] = c;
        if (Array[d]) {
            return
        }
        Elements.implement(d, function() {
            var a = [],
            j = true;
            for (var h = 0, b = this.length; h < b; h++) {
                var i = this[h][d].apply(this[h], arguments);
                a.push(i);
                if (j) {
                    j = ($type(i) == "element")
                    }
            }
            return (j) ? new Elements(a) : a
        })
        }
});
Element.Prototype = {
    $family: {
        name: "element"
    }
};
Element.Constructors = new Hash;
var IFrame = new Native({
    name: "IFrame",
    generics: false,
    initialize: function() {
        var f = Array.link(arguments, {
            properties: Object.type,
            iframe: $defined
        });
        var i = f.properties || {};
        var h = $(f.iframe) || false;
        var j = i.onload || $empty;
        delete i.onload;
        i.id = i.name = $pick(i.id, i.name, h.id, h.name, "IFrame_" + $time());
        h = new Element(h || "iframe", i);
        var g = function() {
            var a = $try(function() {
                return h.contentWindow.location.host
            });
            if (a && a == window.location.host) {
                var b = new Window(h.contentWindow);
                new Document(h.contentWindow.document);
                $extend(b.Element.prototype, Element.Prototype)
                }
            j.call(h.contentWindow, h.contentWindow.document)
            }; (window.frames[i.id]) ? g() : h.addListener("load", g);
        return h
    }
});
var Elements = new Native({
    initialize: function(n, j) {
        j = $extend({
            ddup: true,
            cash: true
        }, j);
        n = n || [];
        if (j.ddup || j.cash) {
            var h = {},
            m = [];
            for (var k = 0, i = n.length; k < i; k++) {
                var l = $.element(n[k], !j.cash);
                if (j.ddup) {
                    if (h[l.uid]) {
                        continue
                    }
                    h[l.uid] = true
                }
                m.push(l)
                }
            n = m
        }
        return (j.cash) ? $extend(n, this) : n
    }
});
Elements.implement({
    filter: function(d, c) {
        if (!d) {
            return this
        }
        return new Elements(Array.filter(this, (typeof d == "string") ? function(a) {
            return a.match(d)
            }: d, c))
        }
});
Document.implement({
    newElement: function(d, c) {
        if (Browser.Engine.trident && c) { ["name", "type", "checked"].each(function(a) {
                if (!c[a]) {
                    return
                }
                d += " " + a + '="' + c[a] + '"';
                if (a != "checked") {
                    delete c[a]
                    }
            });
            d = "<" + d + ">"
        }
        return $.element(this.createElement(d)).set(c)
        },
    newTextNode: function(b) {
        return this.createTextNode(b)
        },
    getDocument: function() {
        return this
    },
    getWindow: function() {
        return this.window
    }
});
Window.implement({
    $: function(f, d) {
        if (f && f.$family && f.uid) {
            return f
        }
        var e = $type(f);
        return ($[e]) ? $[e](f, d, this.document) : null
    },
    $$: function(h) {
        if (arguments.length == 1 && typeof h == "string") {
            return this.document.getElements(h)
            }
        var g = [];
        var j = Array.flatten(arguments);
        for (var k = 0, i = j.length; k < i; k++) {
            var l = j[k];
            switch ($type(l)) {
            case "element":
                g.push(l);
                break;
            case "string":
                g.extend(this.document.getElements(l, true))
                }
        }
        return new Elements(g)
        },
    getDocument: function() {
        return this.document
    },
    getWindow: function() {
        return this
    }
});
$.string = function(d, f, e) {
    d = e.getElementById(d);
    return (d) ? $.element(d, f) : null
};
$.element = function(f, e) {
    $uid(f);
    if (!e && !f.$family && !(/^object|embed$/i).test(f.tagName)) {
        var g = Element.Prototype;
        for (var h in g) {
            f[h] = g[h]
            }
    }
    return f
};
$.object = function(f, d, e) {
    if (f.toElement) {
        return $.element(f.toElement(e), d)
        }
    return null
};
$.textnode = $.whitespace = $.window = $.document = $arguments(0);
Native.implement([Element, Document], {
    getElement: function(d, c) {
        return $(this.getElements(d, true)[0] || null, c)
        },
    getElements: function(f, e) {
        f = f.split(",");
        var h = [];
        var g = (f.length > 1);
        f.each(function(a) {
            var b = this.getElementsByTagName(a.trim()); (g) ? h.extend(b) : h = b
        }, this);
        return new Elements(h, {
            ddup: g,
            cash: !e
        })
        }
}); (function() {
    var o = {},
    m = {};
    var p = {
        input: "checked",
        option: "selected",
        textarea: (Browser.Engine.webkit && Browser.Engine.version < 420) ? "innerHTML": "value"
    };
    var u = function(a) {
        return (m[a] || (m[a] = {}))
        };
    var n = function(d, b) {
        if (!d) {
            return
        }
        var c = d.uid;
        if (Browser.Engine.trident) {
            if (d.clearAttributes) {
                var a = b && d.cloneNode(false);
                d.clearAttributes();
                if (a) {
                    d.mergeAttributes(a)
                    }
            } else {
                if (d.removeEvents) {
                    d.removeEvents()
                    }
            }
            if ((/object/i).test(d.tagName)) {
                for (var e in d) {
                    if (typeof d[e] == "function") {
                        d[e] = $empty
                    }
                }
                Element.dispose(d)
                }
        }
        if (!c) {
            return
        }
        o[c] = m[c] = null
    };
    var v = function() {
        Hash.each(o, n);
        if (Browser.Engine.trident) {
            $A(document.getElementsByTagName("object")).each(n)
            }
        if (window.CollectGarbage) {
            CollectGarbage()
            }
        o = m = null
    };
    var q = function(d, b, a, c, f, h) {
        var e = d[a || b];
        var g = [];
        while (e) {
            if (e.nodeType == 1 && (!c || Element.match(e, c))) {
                if (!f) {
                    return $(e, h)
                    }
                g.push(e)
                }
            e = e[b]
            }
        return (f) ? new Elements(g, {
            ddup: false,
            cash: !h
        }) : null
    };
    var l = {
        html: "innerHTML",
        "class": "className",
        "for": "htmlFor",
        text: (Browser.Engine.trident || (Browser.Engine.webkit && Browser.Engine.version < 420)) ? "innerText": "textContent"
    };
    var t = ["compact", "nowrap", "ismap", "declare", "noshade", "checked", "disabled", "readonly", "multiple", "selected", "noresize", "defer"];
    var r = ["value", "accessKey", "cellPadding", "cellSpacing", "colSpan", "frameBorder", "maxLength", "readOnly", "rowSpan", "tabIndex", "useMap"];
    Hash.extend(l, t.associate(t));
    Hash.extend(l, r.associate(r.map(String.toLowerCase)));
    var s = {
        before: function(a, b) {
            if (b.parentNode) {
                b.parentNode.insertBefore(a, b)
                }
        },
        after: function(c, b) {
            if (!b.parentNode) {
                return
            }
            var a = b.nextSibling; (a) ? b.parentNode.insertBefore(c, a) : b.parentNode.appendChild(c)
            },
        bottom: function(a, b) {
            b.appendChild(a)
            },
        top: function(c, b) {
            var a = b.firstChild; (a) ? b.insertBefore(c, a) : b.appendChild(c)
            }
    };
    s.inside = s.bottom;
    Hash.each(s, function(b, a) {
        a = a.capitalize();
        Element.implement("inject" + a, function(c) {
            b(this, $(c, true));
            return this
        });
        Element.implement("grab" + a, function(c) {
            b($(c, true), this);
            return this
        })
        });
    Element.implement({
        set: function(a, c) {
            switch ($type(a)) {
            case "object":
                for (var d in a) {
                    this.set(d, a[d])
                    }
                break;
            case "string":
                var b = Element.Properties.get(a); (b && b.set) ? b.set.apply(this, Array.slice(arguments, 1)) : this.setProperty(a, c)
                }
            return this
        },
        get: function(a) {
            var b = Element.Properties.get(a);
            return (b && b.get) ? b.get.apply(this, Array.slice(arguments, 1)) : this.getProperty(a)
            },
        erase: function(a) {
            var b = Element.Properties.get(a); (b && b.erase) ? b.erase.apply(this) : this.removeProperty(a);
            return this
        },
        setProperty: function(c, a) {
            var b = l[c];
            if (a == undefined) {
                return this.removeProperty(c)
                }
            if (b && t[c]) {
                a = !!a
            } (b) ? this[b] = a: this.setAttribute(c, "" + a);
            return this
        },
        setProperties: function(b) {
            for (var a in b) {
                this.setProperty(a, b[a])
                }
            return this
        },
        getProperty: function(c) {
            var b = l[c];
            var a = (b) ? this[b] : this.getAttribute(c, 2);
            return (t[c]) ? !!a: (b) ? a: a || null
        },
        getProperties: function() {
            var a = $A(arguments);
            return a.map(this.getProperty, this).associate(a)
            },
        removeProperty: function(a) {
            var b = l[a]; (b) ? this[b] = (b && t[a]) ? false: "": this.removeAttribute(a);
            return this
        },
        removeProperties: function() {
            Array.each(arguments, this.removeProperty, this);
            return this
        },
        hasClass: function(a) {
            return this.className.contains(a, " ")
            },
        addClass: function(a) {
            if (!this.hasClass(a)) {
                this.className = (this.className + " " + a).clean()
                }
            return this
        },
        removeClass: function(a) {
            this.className = this.className.replace(new RegExp("(^|\\s)" + a + "(?:\\s|$)"), "$1");
            return this
        },
        toggleClass: function(a) {
            return this.hasClass(a) ? this.removeClass(a) : this.addClass(a)
            },
        adopt: function() {
            Array.flatten(arguments).each(function(a) {
                a = $(a, true);
                if (a) {
                    this.appendChild(a)
                    }
            }, this);
            return this
        },
        appendText: function(a, b) {
            return this.grab(this.getDocument().newTextNode(a), b)
            },
        grab: function(a, b) {
            s[b || "bottom"]($(a, true), this);
            return this
        },
        inject: function(a, b) {
            s[b || "bottom"](this, $(a, true));
            return this
        },
        replaces: function(a) {
            a = $(a, true);
            a.parentNode.replaceChild(this, a);
            return this
        },
        wraps: function(a, b) {
            a = $(a, true);
            return this.replaces(a).grab(a, b)
            },
        getPrevious: function(b, a) {
            return q(this, "previousSibling", null, b, false, a)
            },
        getAllPrevious: function(b, a) {
            return q(this, "previousSibling", null, b, true, a)
            },
        getNext: function(b, a) {
            return q(this, "nextSibling", null, b, false, a)
            },
        getAllNext: function(b, a) {
            return q(this, "nextSibling", null, b, true, a)
            },
        getFirst: function(b, a) {
            return q(this, "nextSibling", "firstChild", b, false, a)
            },
        getLast: function(b, a) {
            return q(this, "previousSibling", "lastChild", b, false, a)
            },
        getParent: function(b, a) {
            return q(this, "parentNode", null, b, false, a)
            },
        getParents: function(b, a) {
            return q(this, "parentNode", null, b, true, a)
            },
        getChildren: function(b, a) {
            return q(this, "nextSibling", "firstChild", b, true, a)
            },
        getWindow: function() {
            return this.ownerDocument.window
        },
        getDocument: function() {
            return this.ownerDocument
        },
        getElementById: function(a, d) {
            var c = this.ownerDocument.getElementById(a);
            if (!c) {
                return null
            }
            for (var b = c.parentNode; b != this; b = b.parentNode) {
                if (!b) {
                    return null
                }
            }
            return $.element(c, d)
            },
        getSelected: function() {
            return new Elements($A(this.options).filter(function(a) {
                return a.selected
            }))
            },
        getComputedStyle: function(a) {
            if (this.currentStyle) {
                return this.currentStyle[a.camelCase()]
                }
            var b = this.getDocument().defaultView.getComputedStyle(this, null);
            return (b) ? b.getPropertyValue([a.hyphenate()]) : null
        },
        toQueryString: function() {
            var a = [];
            this.getElements("input, select, textarea", true).each(function(c) {
                if (!c.name || c.disabled) {
                    return
                }
                var b = (c.tagName.toLowerCase() == "select") ? Element.getSelected(c).map(function(d) {
                    return d.value
                }) : ((c.type == "radio" || c.type == "checkbox") && !c.checked) ? null: c.value;
                $splat(b).each(function(d) {
                    if (typeof d != "undefined") {
                        a.push(c.name + "=" + encodeURIComponent(d))
                        }
                })
                });
            return a.join("&")
            },
        clone: function(e, b) {
            e = e !== false;
            var a = this.cloneNode(e);
            var d = function(y, k) {
                if (!b) {
                    y.removeAttribute("id")
                    }
                if (Browser.Engine.trident) {
                    y.clearAttributes();
                    y.mergeAttributes(k);
                    y.removeAttribute("uid");
                    if (y.options) {
                        var z = y.options,
                        i = k.options;
                        for (var j = z.length; j--;) {
                            z[j].selected = i[j].selected
                        }
                    }
                }
                var h = p[k.tagName.toLowerCase()];
                if (h && k[h]) {
                    y[h] = k[h]
                    }
            };
            if (e) {
                var f = a.getElementsByTagName("*"),
                g = this.getElementsByTagName("*");
                for (var c = f.length; c--;) {
                    d(f[c], g[c])
                    }
            }
            d(a, this);
            return $(a)
            },
        destroy: function() {
            Element.empty(this);
            Element.dispose(this);
            n(this, true);
            return null
        },
        empty: function() {
            $A(this.childNodes).each(function(a) {
                Element.destroy(a)
                });
            return this
        },
        dispose: function() {
            return (this.parentNode) ? this.parentNode.removeChild(this) : this
        },
        hasChild: function(a) {
            a = $(a, true);
            if (!a) {
                return false
            }
            if (Browser.Engine.webkit && Browser.Engine.version < 420) {
                return $A(this.getElementsByTagName(a.tagName)).contains(a)
                }
            return (this.contains) ? (this != a && this.contains(a)) : !!(this.compareDocumentPosition(a) & 16)
            },
        match: function(a) {
            return (!a || (a == this) || (Element.get(this, "tag") == a))
            }
    });
    Native.implement([Element, Window, Document], {
        addListener: function(a, d) {
            if (a == "unload") {
                var b = d,
                c = this;
                d = function() {
                    c.removeListener("unload", d);
                    b()
                    }
            } else {
                o[this.uid] = this
            }
            if (this.addEventListener) {
                this.addEventListener(a, d, false)
                } else {
                this.attachEvent("on" + a, d)
                }
            return this
        },
        removeListener: function(a, b) {
            if (this.removeEventListener) {
                this.removeEventListener(a, b, false)
                } else {
                this.detachEvent("on" + a, b)
                }
            return this
        },
        retrieve: function(c, b) {
            var a = u(this.uid),
            d = a[c];
            if (b != undefined && d == undefined) {
                d = a[c] = b
            }
            return $pick(d)
            },
        store: function(c, b) {
            var a = u(this.uid);
            a[c] = b;
            return this
        },
        eliminate: function(b) {
            var a = u(this.uid);
            delete a[b];
            return this
        }
    });
    window.addListener("unload", v)
    })();
Element.Properties = new Hash;
Element.Properties.style = {
    set: function(b) {
        this.style.cssText = b
    },
    get: function() {
        return this.style.cssText
    },
    erase: function() {
        this.style.cssText = ""
    }
};
Element.Properties.tag = {
    get: function() {
        return this.tagName.toLowerCase()
        }
};
Element.Properties.html = (function() {
    var d = document.createElement("div");
    var e = {
        table: [1, "<table>", "</table>"],
        select: [1, "<select>", "</select>"],
        tbody: [2, "<table><tbody>", "</tbody></table>"],
        tr: [3, "<table><tbody><tr>", "</tr></tbody></table>"]
        };
    e.thead = e.tfoot = e.tbody;
    var f = {
        set: function() {
            var b = Array.flatten(arguments).join("");
            var c = Browser.Engine.trident && e[this.get("tag")];
            if (c) {
                var h = d;
                h.innerHTML = c[1] + b + c[2];
                for (var a = c[0]; a--;) {
                    h = h.firstChild
                }
                this.empty().adopt(h.childNodes)
                } else {
                this.innerHTML = b
            }
        }
    };
    f.erase = f.set;
    return f
})();
if (Browser.Engine.webkit && Browser.Engine.version < 420) {
    Element.Properties.text = {
        get: function() {
            if (this.innerText) {
                return this.innerText
            }
            var d = this.ownerDocument.newElement("div", {
                html: this.innerHTML
            }).inject(this.ownerDocument.body);
            var c = d.innerText;
            d.destroy();
            return c
        }
    }
}
Element.Properties.events = {
    set: function(b) {
        this.addEvents(b)
        }
};
Native.implement([Element, Window, Document], {
    addEvent: function(j, l) {
        var m = this.retrieve("events", {});
        m[j] = m[j] || {
            keys: [],
            values: []
            };
        if (m[j].keys.contains(l)) {
            return this
        }
        m[j].keys.push(l);
        var k = j,
        o = Element.Events.get(j),
        q = l,
        n = this;
        if (o) {
            if (o.onAdd) {
                o.onAdd.call(this, l)
                }
            if (o.condition) {
                q = function(a) {
                    if (o.condition.call(this, a)) {
                        return l.call(this, a)
                        }
                    return true
                }
            }
            k = o.base || k
        }
        var r = function() {
            return l.call(n)
            };
        var p = Element.NativeEvents[k];
        if (p) {
            if (p == 2) {
                r = function(a) {
                    a = new Event(a, n.getWindow());
                    if (q.call(n, a) === false) {
                        a.stop()
                        }
                }
            }
            this.addListener(k, r)
            }
        m[j].values.push(r);
        return this
    },
    removeEvent: function(j, i) {
        var h = this.retrieve("events");
        if (!h || !h[j]) {
            return this
        }
        var g = h[j].keys.indexOf(i);
        if (g == -1) {
            return this
        }
        h[j].keys.splice(g, 1);
        var l = h[j].values.splice(g, 1)[0];
        var k = Element.Events.get(j);
        if (k) {
            if (k.onRemove) {
                k.onRemove.call(this, i)
                }
            j = k.base || j
        }
        return (Element.NativeEvents[j]) ? this.removeListener(j, l) : this
    },
    addEvents: function(d) {
        for (var c in d) {
            this.addEvent(c, d[c])
            }
        return this
    },
    removeEvents: function(e) {
        if ($type(e) == "object") {
            for (var d in e) {
                this.removeEvent(d, e[d])
                }
            return this
        }
        var f = this.retrieve("events");
        if (!f) {
            return this
        }
        if (!e) {
            for (var d in f) {
                this.removeEvents(d)
                }
            this.eliminate("events")
            } else {
            if (f[e]) {
                while (f[e].keys[0]) {
                    this.removeEvent(e, f[e].keys[0])
                    }
                f[e] = null
            }
        }
        return this
    },
    fireEvent: function(e, g, f) {
        var h = this.retrieve("events");
        if (!h || !h[e]) {
            return this
        }
        h[e].keys.each(function(a) {
            a.create({
                bind: this,
                delay: f,
                "arguments": g
            })()
            }, this);
        return this
    },
    cloneEvents: function(e, f) {
        e = $(e);
        var h = e.retrieve("events");
        if (!h) {
            return this
        }
        if (!f) {
            for (var g in h) {
                this.cloneEvents(e, g)
                }
        } else {
            if (h[f]) {
                h[f].keys.each(function(a) {
                    this.addEvent(f, a)
                    }, this)
                }
        }
        return this
    }
});
Element.NativeEvents = {
    click: 2,
    dblclick: 2,
    mouseup: 2,
    mousedown: 2,
    contextmenu: 2,
    mousewheel: 2,
    DOMMouseScroll: 2,
    mouseover: 2,
    mouseout: 2,
    mousemove: 2,
    selectstart: 2,
    selectend: 2,
    keydown: 2,
    keypress: 2,
    keyup: 2,
    focus: 2,
    blur: 2,
    change: 2,
    reset: 2,
    select: 2,
    submit: 2,
    load: 1,
    unload: 1,
    beforeunload: 2,
    resize: 1,
    move: 1,
    DOMContentLoaded: 1,
    readystatechange: 1,
    error: 1,
    abort: 1,
    scroll: 1
}; (function() {
    var b = function(d) {
        var a = d.relatedTarget;
        if (a == undefined) {
            return true
        }
        if (a === false) {
            return false
        }
        return ($type(this) != "document" && a != this && a.prefix != "xul" && !this.hasChild(a))
        };
    Element.Events = new Hash({
        mouseenter: {
            base: "mouseover",
            condition: b
        },
        mouseleave: {
            base: "mouseout",
            condition: b
        },
        mousewheel: {
            base: (Browser.Engine.gecko) ? "DOMMouseScroll": "mousewheel"
        }
    })
    })();
Element.Properties.styles = {
    set: function(b) {
        this.setStyles(b)
        }
};
Element.Properties.opacity = {
    set: function(d, c) {
        if (!c) {
            if (d == 0) {
                if (this.style.visibility != "hidden") {
                    this.style.visibility = "hidden"
                }
            } else {
                if (this.style.visibility != "visible") {
                    this.style.visibility = "visible"
                }
            }
        }
        if (!this.currentStyle || !this.currentStyle.hasLayout) {
            this.style.zoom = 1
        }
        if (Browser.Engine.trident) {
            this.style.filter = (d == 1) ? "": "alpha(opacity=" + d * 100 + ")"
        }
        this.style.opacity = d;
        this.store("opacity", d)
        },
    get: function() {
        return this.retrieve("opacity", 1)
        }
};
Element.implement({
    setOpacity: function(b) {
        return this.set("opacity", b, true)
        },
    getOpacity: function() {
        return this.get("opacity")
        },
    setStyle: function(f, e) {
        switch (f) {
        case "opacity":
            return this.set("opacity", parseFloat(e));
        case "float":
            f = (Browser.Engine.trident) ? "styleFloat": "cssFloat"
        }
        f = f.camelCase();
        if ($type(e) != "string") {
            var d = (Element.Styles.get(f) || "@").split(" ");
            e = $splat(e).map(function(b, a) {
                if (!d[a]) {
                    return ""
                }
                return ($type(b) == "number") ? d[a].replace("@", Math.round(b)) : b
            }).join(" ")
            } else {
            if (e == String(Number(e))) {
                e = Math.round(e)
                }
        }
        this.style[f] = e;
        return this
    },
    getStyle: function(h) {
        switch (h) {
        case "opacity":
            return this.get("opacity");
        case "float":
            h = (Browser.Engine.trident) ? "styleFloat": "cssFloat"
        }
        h = h.camelCase();
        var i = this.style[h];
        if (!$chk(i)) {
            i = [];
            for (var n in Element.ShortStyles) {
                if (h != n) {
                    continue
                }
                for (var m in Element.ShortStyles[n]) {
                    i.push(this.getStyle(m))
                    }
                return i.join(" ")
                }
            i = this.getComputedStyle(h)
            }
        if (i) {
            i = String(i);
            var k = i.match(/rgba?\([\d\s,]+\)/);
            if (k) {
                i = i.replace(k[0], k[0].rgbToHex())
                }
        }
        if (Browser.Engine.presto || (Browser.Engine.trident && !$chk(parseInt(i)))) {
            if (h.test(/^(height|width)$/)) {
                var j = (h == "width") ? ["left", "right"] : ["top", "bottom"],
                l = 0;
                j.each(function(a) {
                    l += this.getStyle("border-" + a + "-width").toInt() + this.getStyle("padding-" + a).toInt()
                    }, this);
                return this["offset" + h.capitalize()] - l + "px"
            }
            if ((Browser.Engine.presto) && String(i).test("px")) {
                return i
            }
            if (h.test(/(border(.+)Width|margin|padding)/)) {
                return "0px"
            }
        }
        return i
    },
    setStyles: function(c) {
        for (var d in c) {
            this.setStyle(d, c[d])
            }
        return this
    },
    getStyles: function() {
        var b = {};
        Array.each(arguments, function(a) {
            b[a] = this.getStyle(a)
            }, this);
        return b
    }
});
Element.Styles = new Hash({
    left: "@px",
    top: "@px",
    bottom: "@px",
    right: "@px",
    width: "@px",
    height: "@px",
    maxWidth: "@px",
    maxHeight: "@px",
    minWidth: "@px",
    minHeight: "@px",
    backgroundColor: "rgb(@, @, @)",
    backgroundPosition: "@px @px",
    color: "rgb(@, @, @)",
    fontSize: "@px",
    letterSpacing: "@px",
    lineHeight: "@px",
    clip: "rect(@px @px @px @px)",
    margin: "@px @px @px @px",
    padding: "@px @px @px @px",
    border: "@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",
    borderWidth: "@px @px @px @px",
    borderStyle: "@ @ @ @",
    borderColor: "rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",
    zIndex: "@",
    zoom: "@",
    fontWeight: "@",
    textIndent: "@px",
    opacity: "@"
});
Element.ShortStyles = {
    margin: {},
    padding: {},
    border: {},
    borderWidth: {},
    borderStyle: {},
    borderColor: {}
}; ["Top", "Right", "Bottom", "Left"].each(function(h) {
    var n = Element.ShortStyles;
    var j = Element.Styles; ["margin", "padding"].each(function(a) {
        var b = a + h;
        n[a][b] = j[b] = "@px"
    });
    var m = "border" + h;
    n.border[m] = j[m] = "@px @ rgb(@, @, @)";
    var l = m + "Width",
    i = m + "Style",
    k = m + "Color";
    n[m] = {};
    n.borderWidth[l] = n[m][l] = j[l] = "@px";
    n.borderStyle[i] = n[m][i] = j[i] = "@";
    n.borderColor[k] = n[m][k] = j[k] = "rgb(@, @, @)"
}); (function() {
    Element.implement({
        scrollTo: function(a, b) {
            if (j(this)) {
                this.getWindow().scrollTo(a, b)
                } else {
                this.scrollLeft = a;
                this.scrollTop = b
            }
            return this
        },
        getSize: function() {
            if (j(this)) {
                return this.getWindow().getSize()
                }
            return {
                x: this.offsetWidth,
                y: this.offsetHeight
            }
        },
        getScrollSize: function() {
            if (j(this)) {
                return this.getWindow().getScrollSize()
                }
            return {
                x: this.scrollWidth,
                y: this.scrollHeight
            }
        },
        getScroll: function() {
            if (j(this)) {
                return this.getWindow().getScroll()
                }
            return {
                x: this.scrollLeft,
                y: this.scrollTop
            }
        },
        getScrolls: function() {
            var b = this,
            a = {
                x: 0,
                y: 0
            };
            while (b && !j(b)) {
                a.x += b.scrollLeft;
                a.y += b.scrollTop;
                b = b.parentNode
            }
            return a
        },
        getOffsetParent: function() {
            var a = this;
            if (j(a)) {
                return null
            }
            if (!Browser.Engine.trident) {
                return a.offsetParent
            }
            while ((a = a.parentNode) && !j(a)) {
                if (l(a, "position") != "static") {
                    return a
                }
            }
            return null
        },
        getOffsets: function() {
            if (Browser.Engine.trident) {
                var e = this.getBoundingClientRect(),
                c = this.getDocument().documentElement;
                return {
                    x: e.left + c.scrollLeft - c.clientLeft,
                    y: e.top + c.scrollTop - c.clientTop
                }
            }
            var b = this,
            a = {
                x: 0,
                y: 0
            };
            if (j(this)) {
                return a
            }
            while (b && !j(b)) {
                a.x += b.offsetLeft;
                a.y += b.offsetTop;
                if (Browser.Engine.gecko) {
                    if (!n(b)) {
                        a.x += k(b);
                        a.y += h(b)
                        }
                    var d = b.parentNode;
                    if (d && l(d, "overflow") != "visible") {
                        a.x += k(d);
                        a.y += h(d)
                        }
                } else {
                    if (b != this && Browser.Engine.webkit) {
                        a.x += k(b);
                        a.y += h(b)
                        }
                }
                b = b.offsetParent
            }
            if (Browser.Engine.gecko && !n(this)) {
                a.x -= k(this);
                a.y -= h(this)
                }
            return a
        },
        getPosition: function(d) {
            if (j(this)) {
                return {
                    x: 0,
                    y: 0
                }
            }
            var e = this.getOffsets(),
            b = this.getScrolls();
            var a = {
                x: e.x - b.x,
                y: e.y - b.y
            };
            var c = (d && (d = $(d))) ? d.getPosition() : {
                x: 0,
                y: 0
            };
            return {
                x: a.x - c.x,
                y: a.y - c.y
            }
        },
        getCoordinates: function(c) {
            if (j(this)) {
                return this.getWindow().getCoordinates()
                }
            var a = this.getPosition(c),
            b = this.getSize();
            var d = {
                left: a.x,
                top: a.y,
                width: b.x,
                height: b.y
            };
            d.right = d.left + d.width;
            d.bottom = d.top + d.height;
            return d
        },
        computePosition: function(a) {
            return {
                left: a.x - m(this, "margin-left"),
                top: a.y - m(this, "margin-top")
                }
        },
        position: function(a) {
            return this.setStyles(this.computePosition(a))
            }
    });
    Native.implement([Document, Window], {
        getSize: function() {
            var b = this.getWindow();
            if (Browser.Engine.presto || Browser.Engine.webkit) {
                return {
                    x: b.innerWidth,
                    y: b.innerHeight
                }
            }
            var a = i(this);
            return {
                x: a.clientWidth,
                y: a.clientHeight
            }
        },
        getScroll: function() {
            var b = this.getWindow();
            var a = i(this);
            return {
                x: b.pageXOffset || a.scrollLeft,
                y: b.pageYOffset || a.scrollTop
            }
        },
        getScrollSize: function() {
            var b = i(this);
            var a = this.getSize();
            return {
                x: Math.max(b.scrollWidth, a.x),
                y: Math.max(b.scrollHeight, a.y)
                }
        },
        getPosition: function() {
            return {
                x: 0,
                y: 0
            }
        },
        getCoordinates: function() {
            var a = this.getSize();
            return {
                top: 0,
                left: 0,
                bottom: a.y,
                right: a.x,
                height: a.y,
                width: a.x
            }
        }
    });
    var l = Element.getComputedStyle;
    function m(a, b) {
        return l(a, b).toInt() || 0
    }
    function n(a) {
        return l(a, "-moz-box-sizing") == "border-box"
    }
    function h(a) {
        return m(a, "border-top-width")
        }
    function k(a) {
        return m(a, "border-left-width")
        }
    function j(a) {
        return (/^(?:body|html)$/i).test(a.tagName)
        }
    function i(a) {
        var b = a.getDocument();
        return (!b.compatMode || b.compatMode == "CSS1Compat") ? b.html: b.body
    }
})();
Native.implement([Window, Document, Element], {
    getHeight: function() {
        return this.getSize().y
    },
    getWidth: function() {
        return this.getSize().x
    },
    getScrollTop: function() {
        return this.getScroll().y
    },
    getScrollLeft: function() {
        return this.getScroll().x
    },
    getScrollHeight: function() {
        return this.getScrollSize().y
    },
    getScrollWidth: function() {
        return this.getScrollSize().x
    },
    getTop: function() {
        return this.getPosition().y
    },
    getLeft: function() {
        return this.getPosition().x
    }
});
Native.implement([Document, Element], {
    getElements: function(i, p) {
        i = i.split(",");
        var l,
        n = {};
        for (var m = 0, k = i.length; m < k; m++) {
            var j = i[m],
            o = Selectors.Utils.search(this, j, n);
            if (m != 0 && o.item) {
                o = $A(o)
                }
            l = (m == 0) ? o: (l.item) ? $A(l).concat(o) : l.concat(o)
            }
        return new Elements(l, {
            ddup: (i.length > 1),
            cash: !p
        })
        }
});
Element.implement({
    match: function(h) {
        if (!h || (h == this)) {
            return true
        }
        var j = Selectors.Utils.parseTagAndID(h);
        var g = j[0],
        f = j[1];
        if (!Selectors.Filters.byID(this, f) || !Selectors.Filters.byTag(this, g)) {
            return false
        }
        var i = Selectors.Utils.parseSelector(h);
        return (i) ? Selectors.Utils.filter(this, i, {}) : true
    }
});
var Selectors = {
    Cache: {
        nth: {},
        parsed: {}
    }
};
Selectors.RegExps = {
    id: (/#([\w-]+)/),
    tag: (/^(\w+|\*)/),
    quick: (/^(\w+|\*)$/),
    splitter: (/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),
    combined: (/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)
    };
Selectors.Utils = {
    chk: function(f, d) {
        if (!d) {
            return true
        }
        var e = $uid(f);
        if (!d[e]) {
            return d[e] = true
        }
        return false
    },
    parseNthArgument: function(g) {
        if (Selectors.Cache.nth[g]) {
            return Selectors.Cache.nth[g]
            }
        var j = g.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);
        if (!j) {
            return false
        }
        var l = parseInt(j[1]);
        var i = (l || l === 0) ? l: 1;
        var k = j[2] || false;
        var h = parseInt(j[3]) || 0;
        if (i != 0) {
            h--;
            while (h < 1) {
                h += i
            }
            while (h >= i) {
                h -= i
            }
        } else {
            i = h;
            k = "index"
        }
        switch (k) {
        case "n":
            j = {
                a: i,
                b: h,
                special: "n"
            };
            break;
        case "odd":
            j = {
                a: 2,
                b: 0,
                special: "n"
            };
            break;
        case "even":
            j = {
                a: 2,
                b: 1,
                special: "n"
            };
            break;
        case "first":
            j = {
                a: 0,
                special: "index"
            };
            break;
        case "last":
            j = {
                special: "last-child"
            };
            break;
        case "only":
            j = {
                special: "only-child"
            };
            break;
        default:
            j = {
                a: (i - 1),
                special: "index"
            }
        }
        return Selectors.Cache.nth[g] = j
    },
    parseSelector: function(k) {
        if (Selectors.Cache.parsed[k]) {
            return Selectors.Cache.parsed[k]
            }
        var t,
        n = {
            classes: [],
            pseudos: [],
            attributes: []
            };
        while ((t = Selectors.RegExps.combined.exec(k))) {
            var o = t[1],
            m = t[2],
            l = t[3],
            r = t[5],
            s = t[6],
            p = t[7];
            if (o) {
                n.classes.push(o)
                } else {
                if (s) {
                    var q = Selectors.Pseudo.get(s);
                    if (q) {
                        n.pseudos.push({
                            parser: q,
                            argument: p
                        })
                        } else {
                        n.attributes.push({
                            name: s,
                            operator: "=",
                            value: p
                        })
                        }
                } else {
                    if (m) {
                        n.attributes.push({
                            name: m,
                            operator: l,
                            value: r
                        })
                        }
                }
            }
        }
        if (!n.classes.length) {
            delete n.classes
        }
        if (!n.attributes.length) {
            delete n.attributes
        }
        if (!n.pseudos.length) {
            delete n.pseudos
        }
        if (!n.classes && !n.attributes && !n.pseudos) {
            n = null
        }
        return Selectors.Cache.parsed[k] = n
    },
    parseTagAndID: function(f) {
        var e = f.match(Selectors.RegExps.tag);
        var d = f.match(Selectors.RegExps.id);
        return [(e) ? e[1] : "*", (d) ? d[1] : false]
        },
    filter: function(n, k, m) {
        var l;
        if (k.classes) {
            for (l = k.classes.length; l--; l) {
                var h = k.classes[l];
                if (!Selectors.Filters.byClass(n, h)) {
                    return false
                }
            }
        }
        if (k.attributes) {
            for (l = k.attributes.length; l--; l) {
                var j = k.attributes[l];
                if (!Selectors.Filters.byAttribute(n, j.name, j.operator, j.value)) {
                    return false
                }
            }
        }
        if (k.pseudos) {
            for (l = k.pseudos.length; l--; l) {
                var i = k.pseudos[l];
                if (!Selectors.Filters.byPseudo(n, i.parser, i.argument, m)) {
                    return false
                }
            }
        }
        return true
    },
    getByTagAndID: function(g, f, e) {
        if (e) {
            var h = (g.getElementById) ? g.getElementById(e, true) : Element.getElementById(g, e, true);
            return (h && Selectors.Filters.byTag(h, f)) ? [h] : []
            } else {
            return g.getElementsByTagName(f)
            }
    },
    search: function(E, D, J) {
        var x = [];
        var y = D.trim().replace(Selectors.RegExps.splitter, function(a, c, b) {
            x.push(c);
            return ":)" + b
        }).split(":)");
        var F,
        A,
        Q;
        for (var P = 0, L = y.length; P < L; P++) {
            var O = y[P];
            if (P == 0 && Selectors.RegExps.quick.test(O)) {
                F = E.getElementsByTagName(O);
                continue
            }
            var w = x[P - 1];
            var G = Selectors.Utils.parseTagAndID(O);
            var R = G[0],
            H = G[1];
            if (P == 0) {
                F = Selectors.Utils.getByTagAndID(E, R, H)
                } else {
                var z = {},
                C = [];
                for (var N = 0, M = F.length; N < M; N++) {
                    C = Selectors.Getters[w](C, F[N], R, H, z)
                    }
                F = C
            }
            var B = Selectors.Utils.parseSelector(O);
            if (B) {
                A = [];
                for (var K = 0, I = F.length; K < I; K++) {
                    Q = F[K];
                    if (Selectors.Utils.filter(Q, B, J)) {
                        A.push(Q)
                        }
                }
                F = A
            }
        }
        return F
    }
};
Selectors.Getters = {
    " ": function(m, l, n, o, j) {
        var r = Selectors.Utils.getByTagAndID(l, n, o);
        for (var q = 0, p = r.length; q < p; q++) {
            var k = r[q];
            if (Selectors.Utils.chk(k, j)) {
                m.push(k)
                }
        }
        return m
    },
    ">": function(m, l, n, o, k) {
        var q = Selectors.Utils.getByTagAndID(l, n, o);
        for (var j = 0, r = q.length; j < r; j++) {
            var p = q[j];
            if (p.parentNode == l && Selectors.Utils.chk(p, k)) {
                m.push(p)
                }
        }
        return m
    },
    "+": function(i, h, g, f, j) {
        while ((h = h.nextSibling)) {
            if (h.nodeType == 1) {
                if (Selectors.Utils.chk(h, j) && Selectors.Filters.byTag(h, g) && Selectors.Filters.byID(h, f)) {
                    i.push(h)
                    }
                break
            }
        }
        return i
    },
    "~": function(i, h, g, f, j) {
        while ((h = h.nextSibling)) {
            if (h.nodeType == 1) {
                if (!Selectors.Utils.chk(h, j)) {
                    break
                }
                if (Selectors.Filters.byTag(h, g) && Selectors.Filters.byID(h, f)) {
                    i.push(h)
                    }
            }
        }
        return i
    }
};
Selectors.Filters = {
    byTag: function(c, d) {
        return (d == "*" || (c.tagName && c.tagName.toLowerCase() == d))
        },
    byID: function(d, c) {
        return (!c || (d.id && d.id == c))
        },
    byClass: function(c, d) {
        return (c.className && c.className.contains(d, " "))
        },
    byPseudo: function(f, e, h, g) {
        return e.call(f, h, g)
        },
    byAttribute: function(i, j, h, f) {
        var g = Element.prototype.getProperty.call(i, j);
        if (!g) {
            return (h == "!=")
            }
        if (!h || f == undefined) {
            return true
        }
        switch (h) {
        case "=":
            return (g == f);
        case "*=":
            return (g.contains(f));
        case "^=":
            return (g.substr(0, f.length) == f);
        case "$=":
            return (g.substr(g.length - f.length) == f);
        case "!=":
            return (g != f);
        case "~=":
            return g.contains(f, " ");
        case "|=":
            return g.contains(f, "-")
            }
        return false
    }
};
Selectors.Pseudo = new Hash({
    checked: function() {
        return this.checked
    },
    empty: function() {
        return ! (this.innerText || this.textContent || "").length
    },
    not: function(b) {
        return ! Element.match(this, b)
        },
    contains: function(b) {
        return (this.innerText || this.textContent || "").contains(b)
        },
    "first-child": function() {
        return Selectors.Pseudo.index.call(this, 0)
        },
    "last-child": function() {
        var b = this;
        while ((b = b.nextSibling)) {
            if (b.nodeType == 1) {
                return false
            }
        }
        return true
    },
    "only-child": function() {
        var c = this;
        while ((c = c.previousSibling)) {
            if (c.nodeType == 1) {
                return false
            }
        }
        var d = this;
        while ((d = d.nextSibling)) {
            if (d.nodeType == 1) {
                return false
            }
        }
        return true
    },
    "nth-child": function(h, m) {
        h = (h == undefined) ? "n": h;
        var k = Selectors.Utils.parseNthArgument(h);
        if (k.special != "n") {
            return Selectors.Pseudo[k.special].call(this, k.a, m)
            }
        var n = 0;
        m.positions = m.positions || {};
        var l = $uid(this);
        if (!m.positions[l]) {
            var j = this;
            while ((j = j.previousSibling)) {
                if (j.nodeType != 1) {
                    continue
                }
                n++;
                var i = m.positions[$uid(j)];
                if (i != undefined) {
                    n = i + n;
                    break
                }
            }
            m.positions[l] = n
        }
        return (m.positions[l] % k.a == k.b)
        },
    index: function(e) {
        var f = this,
        d = 0;
        while ((f = f.previousSibling)) {
            if (f.nodeType == 1 && ++d > e) {
                return false
            }
        }
        return (d == e)
        },
    even: function(c, d) {
        return Selectors.Pseudo["nth-child"].call(this, "2n+1", d)
        },
    odd: function(c, d) {
        return Selectors.Pseudo["nth-child"].call(this, "2n", d)
        }
});
Element.Events.domready = {
    onAdd: function(b) {
        if (Browser.loaded) {
            b.call(this)
            }
    }
}; (function() {
    var c = function() {
        if (Browser.loaded) {
            return
        }
        Browser.loaded = true;
        window.fireEvent("domready");
        document.fireEvent("domready")
        };
    if (Browser.Engine.trident) {
        var d = document.createElement("div"); (function() { ($try(function() {
                d.doScroll("left");
                return $(d).inject(document.body).set("html", "temp").dispose()
                })) ? c() : arguments.callee.delay(50)
            })()
        } else {
        if (Browser.Engine.webkit && Browser.Engine.version < 525) { (function() { (["loaded", "complete"].contains(document.readyState)) ? c() : arguments.callee.delay(50)
                })()
            } else {
            window.addEvent("load", c);
            document.addEvent("DOMContentLoaded", c)
            }
    }
})();
var Fx = new Class({
    Implements: [Chain, Events, Options],
    options: {
        fps: 50,
        unit: false,
        duration: 500,
        link: "ignore"
    },
    initialize: function(d) {
        this.subject = this.subject || this;
        this.setOptions(d);
        this.options.duration = Fx.Durations[this.options.duration] || this.options.duration.toInt();
        var c = this.options.wait;
        if (c === false) {
            this.options.link = "cancel"
        }
    },
    getTransition: function() {
        return function(b) {
            return - (Math.cos(Math.PI * b) - 1) / 2
        }
    },
    step: function() {
        var d = $time();
        if (d < this.time + this.options.duration) {
            var c = this.transition((d - this.time) / this.options.duration);
            this.set(this.compute(this.from, this.to, c))
            } else {
            this.set(this.compute(this.from, this.to, 1));
            this.complete()
            }
    },
    set: function(b) {
        return b
    },
    compute: function(d, f, e) {
        return Fx.compute(d, f, e)
        },
    check: function(b) {
        if (!this.timer) {
            return true
        }
        switch (this.options.link) {
        case "cancel":
            this.cancel();
            return true;
        case "chain":
            this.chain(b.bind(this, Array.slice(arguments, 1)));
            return false
        }
        return false
    },
    start: function(c, d) {
        if (!this.check(arguments.callee, c, d)) {
            return this
        }
        this.from = c;
        this.to = d;
        this.time = 0;
        this.transition = this.getTransition();
        this.startTimer();
        this.onStart();
        return this
    },
    complete: function() {
        if (this.stopTimer()) {
            this.onComplete()
            }
        return this
    },
    cancel: function() {
        if (this.stopTimer()) {
            this.onCancel()
            }
        return this
    },
    onStart: function() {
        this.fireEvent("start", this.subject)
        },
    onComplete: function() {
        this.fireEvent("complete", this.subject);
        if (!this.callChain()) {
            this.fireEvent("chainComplete", this.subject)
            }
    },
    onCancel: function() {
        this.fireEvent("cancel", this.subject).clearChain()
        },
    pause: function() {
        this.stopTimer();
        return this
    },
    resume: function() {
        this.startTimer();
        return this
    },
    stopTimer: function() {
        if (!this.timer) {
            return false
        }
        this.time = $time() - this.time;
        this.timer = $clear(this.timer);
        return true
    },
    startTimer: function() {
        if (this.timer) {
            return false
        }
        this.time = $time() - this.time;
        this.timer = this.step.periodical(Math.round(1000 / this.options.fps), this);
        return true
    }
});
Fx.compute = function(d, f, e) {
    return (f - d) * e + d
};
Fx.Durations = {
    "short": 250,
    normal: 500,
    "long": 1000
};
Fx.CSS = new Class({
    Extends: Fx,
    prepare: function(j, f, h) {
        h = $splat(h);
        var i = h[1];
        if (!$chk(i)) {
            h[1] = h[0];
            h[0] = j.getStyle(f)
            }
        var g = h.map(this.parse);
        return {
            from: g[0],
            to: g[1]
            }
    },
    parse: function(b) {
        b = $lambda(b)();
        b = (typeof b == "string") ? b.split(" ") : $splat(b);
        return b.map(function(a) {
            a = String(a);
            var d = false;
            Fx.CSS.Parsers.each(function(h, g) {
                if (d) {
                    return
                }
                var c = h.parse(a);
                if ($chk(c)) {
                    d = {
                        value: c,
                        parser: h
                    }
                }
            });
            d = d || {
                value: a,
                parser: Fx.CSS.Parsers.String
            };
            return d
        })
        },
    compute: function(e, h, g) {
        var f = []; (Math.min(e.length, h.length)).times(function(a) {
            f.push({
                value: e[a].parser.compute(e[a].value, h[a].value, g),
                parser: e[a].parser
            })
            });
        f.$family = {
            name: "fx:css:value"
        };
        return f
    },
    serve: function(d, f) {
        if ($type(d) != "fx:css:value") {
            d = this.parse(d)
            }
        var e = [];
        d.each(function(a) {
            e = e.concat(a.parser.serve(a.value, f))
            });
        return e
    },
    render: function(f, e, h, g) {
        f.setStyle(e, this.serve(h, g))
        },
    search: function(d) {
        if (Fx.CSS.Cache[d]) {
            return Fx.CSS.Cache[d]
            }
        var c = {};
        Array.each(document.styleSheets, function(g, b) {
            var a = g.href;
            if (a && a.contains("://") && !a.contains(document.domain)) {
                return
            }
            var h = g.rules || g.cssRules;
            Array.each(h, function(j, e) {
                if (!j.style) {
                    return
                }
                var f = (j.selectorText) ? j.selectorText.replace(/^\w+/, function(i) {
                    return i.toLowerCase()
                    }) : null;
                if (!f || !f.test("^" + d + "$")) {
                    return
                }
                Element.Styles.each(function(l, i) {
                    if (!j.style[i] || Element.ShortStyles[i]) {
                        return
                    }
                    l = String(j.style[i]);
                    c[i] = (l.test(/^rgb/)) ? l.rgbToHex() : l
                })
                })
            });
        return Fx.CSS.Cache[d] = c
    }
});
Fx.CSS.Cache = {};
Fx.CSS.Parsers = new Hash({
    Color: {
        parse: function(b) {
            if (b.match(/^#[0-9a-f]{3,6}$/i)) {
                return b.hexToRgb(true)
                }
            return ((b = b.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [b[1], b[2], b[3]] : false
        },
        compute: function(d, f, e) {
            return d.map(function(b, a) {
                return Math.round(Fx.compute(d[a], f[a], e))
                })
            },
        serve: function(b) {
            return b.map(Number)
            }
    },
    Number: {
        parse: parseFloat,
        compute: Fx.compute,
        serve: function(c, d) {
            return (d) ? c + d: c
        }
    },
    String: {
        parse: $lambda(false),
        compute: $arguments(1),
        serve: $arguments(0)
        }
});
Fx.Tween = new Class({
    Extends: Fx.CSS,
    initialize: function(c, d) {
        this.element = this.subject = $(c);
        this.parent(d)
        },
    set: function(c, d) {
        if (arguments.length == 1) {
            d = c;
            c = this.property || this.options.property
        }
        this.render(this.element, c, d, this.options.unit);
        return this
    },
    start: function(i, f, j) {
        if (!this.check(arguments.callee, i, f, j)) {
            return this
        }
        var h = Array.flatten(arguments);
        this.property = this.options.property || h.shift();
        var g = this.prepare(this.element, this.property, h);
        return this.parent(g.from, g.to)
        }
});
Element.Properties.tween = {
    set: function(d) {
        var c = this.retrieve("tween");
        if (c) {
            c.cancel()
            }
        return this.eliminate("tween").store("tween:options", $extend({
            link: "cancel"
        }, d))
        },
    get: function(b) {
        if (b || !this.retrieve("tween")) {
            if (b || !this.retrieve("tween:options")) {
                this.set("tween", b)
                }
            this.store("tween", new Fx.Tween(this, this.retrieve("tween:options")))
            }
        return this.retrieve("tween")
        }
};
Element.implement({
    tween: function(e, d, f) {
        this.get("tween").start(arguments);
        return this
    },
    fade: function(i) {
        var f = this.get("tween"),
        j = "opacity",
        g;
        i = $pick(i, "toggle");
        switch (i) {
        case "in":
            f.start(j, 1);
            break;
        case "out":
            f.start(j, 0);
            break;
        case "show":
            f.set(j, 1);
            break;
        case "hide":
            f.set(j, 0);
            break;
        case "toggle":
            var h = this.retrieve("fade:flag", this.get("opacity") == 1);
            f.start(j, (h) ? 0: 1);
            this.store("fade:flag", !h);
            g = true;
            break;
        default:
            f.start(j, arguments)
            }
        if (!g) {
            this.eliminate("fade:flag")
            }
        return this
    },
    highlight: function(d, e) {
        if (!e) {
            e = this.retrieve("highlight:original", this.getStyle("background-color"));
            e = (e == "transparent") ? "#fff": e
        }
        var f = this.get("tween");
        f.start("background-color", d || "#ffff88", e).chain(function() {
            this.setStyle("background-color", this.retrieve("highlight:original"));
            f.callChain()
            }.bind(this));
        return this
    }
});
Fx.Morph = new Class({
    Extends: Fx.CSS,
    initialize: function(c, d) {
        this.element = this.subject = $(c);
        this.parent(d)
        },
    set: function(d) {
        if (typeof d == "string") {
            d = this.search(d)
            }
        for (var c in d) {
            this.render(this.element, c, d[c], this.options.unit)
            }
        return this
    },
    compute: function(f, j, i) {
        var g = {};
        for (var h in f) {
            g[h] = this.parent(f[h], j[h], i)
            }
        return g
    },
    start: function(h) {
        if (!this.check(arguments.callee, h)) {
            return this
        }
        if (typeof h == "string") {
            h = this.search(h)
            }
        var f = {},
        j = {};
        for (var i in h) {
            var g = this.prepare(this.element, i, h[i]);
            f[i] = g.from;
            j[i] = g.to
        }
        return this.parent(f, j)
        }
});
Element.Properties.morph = {
    set: function(d) {
        var c = this.retrieve("morph");
        if (c) {
            c.cancel()
            }
        return this.eliminate("morph").store("morph:options", $extend({
            link: "cancel"
        }, d))
        },
    get: function(b) {
        if (b || !this.retrieve("morph")) {
            if (b || !this.retrieve("morph:options")) {
                this.set("morph", b)
                }
            this.store("morph", new Fx.Morph(this, this.retrieve("morph:options")))
            }
        return this.retrieve("morph")
        }
};
Element.implement({
    morph: function(b) {
        this.get("morph").start(b);
        return this
    }
});
Fx.implement({
    getTransition: function() {
        var d = this.options.transition || Fx.Transitions.Sine.easeInOut;
        if (typeof d == "string") {
            var c = d.split(":");
            d = Fx.Transitions;
            d = d[c[0]] || d[c[0].capitalize()];
            if (c[1]) {
                d = d["ease" + c[1].capitalize() + (c[2] ? c[2].capitalize() : "")]
                }
        }
        return d
    }
});
Fx.Transition = function(c, d) {
    d = $splat(d);
    return $extend(c, {
        easeIn: function(a) {
            return c(a, d)
            },
        easeOut: function(a) {
            return 1 - c(1 - a, d)
            },
        easeInOut: function(a) {
            return (a <= 0.5) ? c(2 * a, d) / 2: (2 - c(2 * (1 - a), d)) / 2
        }
    })
    };
Fx.Transitions = new Hash({
    linear: $arguments(0)
    });
Fx.Transitions.extend = function(d) {
    for (var c in d) {
        Fx.Transitions[c] = new Fx.Transition(d[c])
        }
};
Fx.Transitions.extend({
    Pow: function(c, d) {
        return Math.pow(c, d[0] || 6)
        },
    Expo: function(b) {
        return Math.pow(2, 8 * (b - 1))
        },
    Circ: function(b) {
        return 1 - Math.sin(Math.acos(b))
        },
    Sine: function(b) {
        return 1 - Math.sin((1 - b) * Math.PI / 2)
        },
    Back: function(c, d) {
        d = d[0] || 1.618;
        return Math.pow(c, 2) * ((d + 1) * c - d)
        },
    Bounce: function(e) {
        var h;
        for (var g = 0, f = 1; 1; g += f, f /= 2) {
            if (e >= (7 - 4 * g) / 11) {
                h = f * f - Math.pow((11 - 6 * g - 11 * e) / 4, 2);
                break
            }
        }
        return h
    },
    Elastic: function(c, d) {
        return Math.pow(2, 10 * --c) * Math.cos(20 * c * Math.PI * (d[0] || 1) / 3)
        }
}); ["Quad", "Cubic", "Quart", "Quint"].each(function(c, d) {
    Fx.Transitions[c] = new Fx.Transition(function(a) {
        return Math.pow(a, [d + 2])
        })
    });
Fx.Elements = new Class({
    Extends: Fx.CSS,
    initialize: function(c, d) {
        this.elements = this.subject = $$(c);
        this.parent(d)
        },
    compute: function(l, m, n) {
        var q = {};
        for (var r in l) {
            var o = l[r],
            j = m[r],
            k = q[r] = {};
            for (var p in o) {
                k[p] = this.parent(o[p], j[p], n)
                }
        }
        return q
    },
    set: function(g) {
        for (var h in g) {
            var f = g[h];
            for (var e in f) {
                this.render(this.elements[h], e, f[e], this.options.unit)
                }
        }
        return this
    },
    start: function(q) {
        if (!this.check(arguments.callee, q)) {
            return this
        }
        var m = {},
        n = {};
        for (var r in q) {
            var k = q[r],
            o = m[r] = {},
            l = n[r] = {};
            for (var p in k) {
                var j = this.prepare(this.elements[r], p, k[p]);
                o[p] = j.from;
                l[p] = j.to
            }
        }
        return this.parent(m, n)
        }
});
var Drag = new Class({
    Implements: [Events, Options],
    options: {
        snap: 6,
        unit: "px",
        grid: false,
        style: true,
        limit: false,
        handle: false,
        invert: false,
        preventDefault: false,
        modifiers: {
            x: "left",
            y: "top"
        }
    },
    initialize: function() {
        var c = Array.link(arguments, {
            options: Object.type,
            element: $defined
        });
        this.element = $(c.element);
        this.document = this.element.getDocument();
        this.setOptions(c.options || {});
        var d = $type(this.options.handle);
        this.handles = (d == "array" || d == "collection") ? $$(this.options.handle) : $(this.options.handle) || this.element;
        this.mouse = {
            now: {},
            pos: {}
        };
        this.value = {
            start: {},
            now: {}
        };
        this.selection = (Browser.Engine.trident) ? "selectstart": "mousedown";
        this.bound = {
            start: this.start.bind(this),
            check: this.check.bind(this),
            drag: this.drag.bind(this),
            stop: this.stop.bind(this),
            cancel: this.cancel.bind(this),
            eventStop: $lambda(false)
            };
        this.attach()
        },
    attach: function() {
        this.handles.addEvent("mousedown", this.bound.start);
        return this
    },
    detach: function() {
        this.handles.removeEvent("mousedown", this.bound.start);
        return this
    },
    start: function(h) {
        if (this.options.preventDefault) {
            h.preventDefault()
            }
        this.fireEvent("beforeStart", this.element);
        this.mouse.start = h.page;
        var f = this.options.limit;
        this.limit = {
            x: [],
            y: []
            };
        for (var e in this.options.modifiers) {
            if (!this.options.modifiers[e]) {
                continue
            }
            if (this.options.style) {
                this.value.now[e] = this.element.getStyle(this.options.modifiers[e]).toInt()
                } else {
                this.value.now[e] = this.element[this.options.modifiers[e]]
                }
            if (this.options.invert) {
                this.value.now[e] *= -1
            }
            this.mouse.pos[e] = h.page[e] - this.value.now[e];
            if (f && f[e]) {
                for (var g = 2; g--; g) {
                    if ($chk(f[e][g])) {
                        this.limit[e][g] = $lambda(f[e][g])()
                        }
                }
            }
        }
        if ($type(this.options.grid) == "number") {
            this.options.grid = {
                x: this.options.grid,
                y: this.options.grid
            }
        }
        this.document.addEvents({
            mousemove: this.bound.check,
            mouseup: this.bound.cancel
        });
        this.document.addEvent(this.selection, this.bound.eventStop)
        },
    check: function(d) {
        if (this.options.preventDefault) {
            d.preventDefault()
            }
        var c = Math.round(Math.sqrt(Math.pow(d.page.x - this.mouse.start.x, 2) + Math.pow(d.page.y - this.mouse.start.y, 2)));
        if (c > this.options.snap) {
            this.cancel();
            this.document.addEvents({
                mousemove: this.bound.drag,
                mouseup: this.bound.stop
            });
            this.fireEvent("start", this.element).fireEvent("snap", this.element)
            }
    },
    drag: function(d) {
        if (this.options.preventDefault) {
            d.preventDefault()
            }
        this.mouse.now = d.page;
        for (var c in this.options.modifiers) {
            if (!this.options.modifiers[c]) {
                continue
            }
            this.value.now[c] = this.mouse.now[c] - this.mouse.pos[c];
            if (this.options.invert) {
                this.value.now[c] *= -1
            }
            if (this.options.limit && this.limit[c]) {
                if ($chk(this.limit[c][1]) && (this.value.now[c] > this.limit[c][1])) {
                    this.value.now[c] = this.limit[c][1]
                    } else {
                    if ($chk(this.limit[c][0]) && (this.value.now[c] < this.limit[c][0])) {
                        this.value.now[c] = this.limit[c][0]
                        }
                }
            }
            if (this.options.grid[c]) {
                this.value.now[c] -= (this.value.now[c] % this.options.grid[c])
                }
            if (this.options.style) {
                this.element.setStyle(this.options.modifiers[c], this.value.now[c] + this.options.unit)
                } else {
                this.element[this.options.modifiers[c]] = this.value.now[c]
                }
        }
        this.fireEvent("drag", this.element)
        },
    cancel: function(b) {
        this.document.removeEvent("mousemove", this.bound.check);
        this.document.removeEvent("mouseup", this.bound.cancel);
        if (b) {
            this.document.removeEvent(this.selection, this.bound.eventStop);
            this.fireEvent("cancel", this.element)
            }
    },
    stop: function(b) {
        this.document.removeEvent(this.selection, this.bound.eventStop);
        this.document.removeEvent("mousemove", this.bound.drag);
        this.document.removeEvent("mouseup", this.bound.stop);
        if (b) {
            this.fireEvent("complete", this.element)
            }
    }
});
Element.implement({
    makeResizable: function(b) {
        return new Drag(this, $merge({
            modifiers: {
                x: "width",
                y: "height"
            }
        }, b))
        }
});
var Asset = new Hash({
    javascript: function(n, l) {
        l = $extend({
            onload: $empty,
            document: document,
            check: $lambda(true)
            }, l);
        var j = new Element("script", {
            src: n,
            type: "text/javascript"
        });
        var m = l.onload.bind(j),
        i = l.check,
        h = l.document;
        delete l.onload;
        delete l.check;
        delete l.document;
        j.addEvents({
            load: m,
            readystatechange: function() {
                if (["loaded", "complete"].contains(this.readyState)) {
                    m()
                    }
            }
        }).setProperties(l);
        if (Browser.Engine.webkit419) {
            var k = (function() {
                if (!$try(i)) {
                    return
                }
                $clear(k);
                m()
                }).periodical(50)
            }
        return j.inject(h.head)
        },
    css: function(c, d) {
        return new Element("link", $merge({
            rel: "stylesheet",
            media: "screen",
            type: "text/css",
            href: c
        }, d)).inject(document.head)
        },
    image: function(h, g) {
        g = $merge({
            onload: $empty,
            onabort: $empty,
            onerror: $empty
        }, g);
        var e = new Image();
        var f = $(e) || new Element("img"); ["load", "abort", "error"].each(function(a) {
            var b = "on" + a;
            var c = g[b];
            delete g[b];
            e[b] = function() {
                if (!e) {
                    return
                }
                if (!f.parentNode) {
                    f.width = e.width;
                    f.height = e.height
                }
                e = e.onload = e.onabort = e.onerror = null;
                c.delay(1, f, f);
                f.fireEvent(a, f, 1)
                }
        });
        e.src = f.src = h;
        if (e && e.complete) {
            e.onload.delay(1)
            }
        return f.setProperties(g)
        },
    images: function(e, h) {
        h = $merge({
            onComplete: $empty,
            onProgress: $empty
        }, h);
        if (!e.push) {
            e = [e]
            }
        var f = [];
        var g = 0;
        e.each(function(b) {
            var a = new Asset.image(b, {
                onload: function() {
                    h.onProgress.call(this, g, e.indexOf(b));
                    g++;
                    if (g == e.length) {
                        h.onComplete()
                        }
                }
            });
            f.push(a)
            });
        return new Elements(f)
        }
});
Slideshow = new Class({
    Implements: [Chain, Events, Options],
    options: {
        captions: false,
        center: true,
        classes: [],
        controller: false,
        delay: 2000,
        duration: 750,
        fast: false,
        height: false,
        href: "",
        hu: "",
        linked: false,
        loop: true,
        match: /\?slide=(\d+)$/,
        overlap: true,
        paused: false,
        properties: ["href", "rel", "rev", "title"],
        random: false,
        replace: [/(\.[^\.]+)$/, "t$1"],
        resize: "width",
        slide: 0,
        thumbnails: false,
        titles: true,
        transition: function(b) {
            return - (Math.cos(Math.PI * b) - 1) / 2
        },
        width: false
    },
    initialize: function(v, s, m) {
        this.setOptions(m);
        this.slideshow = $(v);
        if (!this.slideshow) {
            return
        }
        this.slideshow.set("styles", {
            display: "block",
            position: "relative",
            "z-index": 0
        });
        var q = window.location.href.match(this.options.match);
        this.slide = (this.options.match && q) ? q[1].toInt() : this.options.slide;
        this.counter = this.delay = this.transition = 0;
        this.direction = "left";
        this.paused = false;
        if (!this.options.overlap) {
            this.options.duration *= 2
        }
        var r = this.slideshow.getElement("a") || new Element("a");
        if (!this.options.href) {
            this.options.href = r.get("href") || ""
        }
        if (this.options.hu.length && !this.options.hu.test(/\/$/)) {
            this.options.hu += "/"
        }
        if (this.options.fast === true) {
            this.options.fast = 2
        }
        var n = ["slideshow", "first", "prev", "play", "pause", "next", "last", "images", "captions", "controller", "thumbnails", "hidden", "visible", "inactive", "active", "loader"];
        var o = n.map(function(b, a) {
            return this.options.classes[a] || b
        }, this);
        this.classes = o.associate(n);
        this.classes.get = function() {
            var b = "." + this.slideshow;
            for (var c = 0, a = arguments.length; c < a; c++) {
                b += ("-" + this[arguments[c]])
                }
            return b
        }.bind(this.classes);
        if (!s) {
            this.options.hu = "";
            s = {};
            var u = this.slideshow.getElements(this.classes.get("thumbnails") + " img");
            this.slideshow.getElements(this.classes.get("images") + " img").each(function(g, e) {
                var c = g.get("src");
                var h = $pick(g.get("alt"), g.get("title"), "");
                var d = g.getParent();
                var f = (d.get("tag") == "a") ? d.getProperties: {};
                var a = g.getParent().get("href") || "";
                var b = (u[e]) ? u[e].get("src") : "";
                s[c] = {
                    caption: h,
                    href: a,
                    thumbnail: b
                }
            })
            }
        var t = this.load(s);
        if (!t) {
            return
        }
        this.events = $H({
            keydown: [],
            keyup: [],
            mousemove: []
            });
        var w = function(a) {
            switch (a.key) {
            case "left":
                this.prev(a.shift);
                break;
            case "right":
                this.next(a.shift);
                break;
            case "p":
                this.pause();
                break
            }
        }.bind(this);
        this.events.keyup.push(w);
        document.addEvent("keyup", w);
        var v = this.slideshow.getElement(this.classes.get("images"));
        var p = (v) ? v.empty() : new Element("div", {
            "class": this.classes.get("images").substr(1)
            }).inject(this.slideshow);
        var x = p.getSize();
        this.height = this.options.height || x.y;
        this.width = this.options.width || x.x;
        p.set({
            styles: {
                display: "block",
                height: this.height,
                overflow: "hidden",
                position: "relative",
                width: this.width
            }
        });
        this.slideshow.store("images", p);
        this.a = this.image = this.slideshow.getElement("img") || new Element("img");
        if (Browser.Engine.trident && Browser.Engine.version > 4) {
            this.a.style.msInterpolationMode = "bicubic"
        }
        this.a.set("styles", {
            display: "none",
            position: "absolute",
            zIndex: 1
        });
        this.b = this.a.clone(); [this.a, this.b].each(function(a) {
            r.clone().cloneEvents(r).grab(a).inject(p)
            });
        if (this.options.captions) {
            this._captions()
            }
        if (this.options.controller) {
            this._controller()
            }
        if (this.options.loader) {
            this._loader()
            }
        if (this.options.thumbnails) {
            this._thumbnails()
            }
        this._preload()
        },
    go: function(c, d) {
        if ((this.slide - 1 + this.data.images.length) % this.data.images.length == c || $time() < this.transition) {
            return
        }
        $clear(this.timer);
        this.delay = 0;
        this.direction = (d) ? d: ((c < this.slide) ? "right": "left");
        this.slide = c;
        if (this.preloader) {
            this.preloader = this.preloader.destroy()
            }
        this._preload(this.options.fast == 2 || (this.options.fast == 1 && this.paused))
        },
    first: function() {
        this.prev(true)
        },
    prev: function(d) {
        var c = 0;
        if (!d) {
            if (this.options.random) {
                if (this.showed.i < 2) {
                    return
                }
                this.showed.i -= 2;
                c = this.showed.array[this.showed.i]
                } else {
                c = (this.slide - 2 + this.data.images.length) % this.data.images.length
            }
        }
        this.go(c, "right")
        },
    pause: function(b) {
        if ($chk(b)) {
            this.paused = (b) ? false: true
        }
        if (this.paused) {
            this.paused = false;
            this.delay = this.transition = 0;
            this.timer = this._preload.delay(100, this); [this.a, this.b].each(function(a) { ["morph", "tween"].each(function(d) {
                    if (this.retrieve(d)) {
                        this.get(d).resume()
                        }
                }, a)
                });
            if (this.options.controller) {
                this.slideshow.getElement("." + this.classes.pause).removeClass(this.classes.play)
                }
        } else {
            this.paused = true;
            this.delay = Number.MAX_VALUE;
            this.transition = 0;
            $clear(this.timer); [this.a, this.b].each(function(a) { ["morph", "tween"].each(function(d) {
                    if (this.retrieve(d)) {
                        this.get(d).pause()
                        }
                }, a)
                });
            if (this.options.controller) {
                this.slideshow.getElement("." + this.classes.pause).addClass(this.classes.play)
                }
        }
    },
    next: function(d) {
        var c = (d) ? this.data.images.length - 1: this.slide;
        this.go(c, "left")
        },
    last: function() {
        this.next(true)
        },
    load: function(l) {
        this.firstrun = true;
        this.showed = {
            array: [],
            i: 0
        };
        if ($type(l) == "array") {
            this.options.captions = false;
            l = new Array(l.length).associate(l.map(function(a, b) {
                return a + "?" + b
            }))
            }
        this.data = {
            images: [],
            captions: [],
            hrefs: [],
            thumbnails: []
            };
        for (var j in l) {
            var k = l[j] || {};
            var g = (k.caption) ? k.caption.trim() : "";
            var h = (k.href) ? k.href.trim() : ((this.options.linked) ? this.options.hu + j: this.options.href);
            var i = (k.thumbnail) ? k.thumbnail.trim() : j.replace(this.options.replace[0], this.options.replace[1]);
            this.data.images.push(j);
            this.data.captions.push(g);
            this.data.hrefs.push(h);
            this.data.thumbnails.push(i)
            }
        if (this.options.random) {
            this.slide = $random(0, this.data.images.length - 1)
            }
        if (this.options.thumbnails && this.slideshow.retrieve("thumbnails")) {
            this._thumbnails()
            }
        if (this.slideshow.retrieve("images")) { [this.a, this.b].each(function(a) { ["morph", "tween"].each(function(b) {
                    if (this.retrieve(b)) {
                        this.get(b).cancel()
                        }
                }, a)
                });
            this.slide = this.transition = 0;
            this.go(0)
            }
        return this.data.images.length
    },
    destroy: function(b) {
        this.events.each(function(d, a) {
            d.each(function(c) {
                document.removeEvent(a, c)
                })
            });
        this.pause(1);
        if (this.options.loader) {
            $clear(this.slideshow.retrieve("loader").retrieve("timer"))
            }
        if (this.options.thumbnails) {
            $clear(this.slideshow.retrieve("thumbnails").retrieve("timer"))
            }
        this.slideshow.uid = Native.UID++;
        if (b) {
            this.slideshow[b]()
            }
    },
    _preload: function(e) {
        if (!this.preloader) {
            this.preloader = new Asset.image(this.options.hu + this.data.images[this.slide], {
                onload: function() {
                    this.store("loaded", true)
                    }
            })
            }
        if (this.preloader.retrieve("loaded") && $time() > this.delay && $time() > this.transition) {
            if (this.stopped) {
                if (this.options.captions) {
                    this.slideshow.retrieve("captions").get("morph").cancel().start(this.classes.get("captions", "hidden"))
                    }
                this.pause(1);
                if (this.end) {
                    this.fireEvent("end")
                    }
                this.stopped = this.end = false;
                return
            }
            this.image = (this.counter % 2) ? this.b: this.a;
            this.image.set("styles", {
                display: "block",
                height: "auto",
                visibility: "hidden",
                width: "auto",
                zIndex: this.counter
            }); ["src", "height", "width"].each(function(a) {
                this.image.set(a, this.preloader.get(a))
                }, this);
            this._resize(this.image);
            this._center(this.image);
            var d = this.image.getParent();
            if (this.data.hrefs[this.slide]) {
                d.set("href", this.data.hrefs[this.slide])
                } else {
                d.erase("href")
                }
            var f = (this.data.captions[this.slide]) ? this.data.captions[this.slide].replace(/<.+?>/gm, "").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "'") : "";
            this.image.set("alt", f);
            if (this.options.titles) {
                d.set("title", f)
                }
            if (this.options.loader) {
                this.slideshow.retrieve("loader").fireEvent("hide")
                }
            if (this.options.captions) {
                this.slideshow.retrieve("captions").fireEvent("update", e)
                }
            if (this.options.thumbnails) {
                this.slideshow.retrieve("thumbnails").fireEvent("update", e)
                }
            this._show(e);
            this._loaded()
            } else {
            if ($time() > this.delay && this.options.loader) {
                this.slideshow.retrieve("loader").fireEvent("show")
                }
            this.timer = (this.paused && this.preloader.retrieve("loaded")) ? null: this._preload.delay(100, this, e)
            }
    },
    _show: function(g) {
        if (!this.image.retrieve("morph")) {
            var l = (this.options.overlap) ? {
                duration: this.options.duration,
                link: "cancel"
            }: {
                duration: this.options.duration / 2,
                link: "chain"
            };
            $$(this.a, this.b).set("morph", $merge(l, {
                onStart: this._start.bind(this),
                onComplete: this._complete.bind(this),
                transition: this.options.transition
            }))
            }
        var j = this.classes.get("images", ((this.direction == "left") ? "next": "prev"));
        var i = this.classes.get("images", "visible");
        var h = (this.counter % 2) ? this.a: this.b;
        if (g) {
            h.get("morph").cancel().set(j);
            this.image.get("morph").cancel().set(i)
            } else {
            if (this.options.overlap) {
                h.get("morph").set(i);
                this.image.get("morph").set(j).start(i)
                } else {
                var k = function(b, a) {
                    this.image.get("morph").set(b).start(a)
                    }.pass([j, i], this);
                j = this.classes.get("images", ((this.direction == "left") ? "prev": "next"));
                h.get("morph").set(i).start(j).chain(k)
                }
        }
    },
    _loaded: function() {
        this.counter++;
        this.delay = (this.paused) ? Number.MAX_VALUE: $time() + this.options.duration + this.options.delay;
        this.direction = "left";
        this.transition = (this.options.fast == 2 || (this.options.fast == 1 && this.paused)) ? 0: $time() + this.options.duration;
        if (this.slide + 1 == this.data.images.length && !this.options.loop && !this.options.random) {
            this.stopped = this.end = true
        }
        if (this.options.random) {
            this.showed.i++;
            if (this.showed.i >= this.showed.array.length) {
                var b = this.slide;
                if (this.showed.array.getLast() != b) {
                    this.showed.array.push(b)
                    }
                while (this.slide == b) {
                    this.slide = $random(0, this.data.images.length - 1)
                    }
            } else {
                this.slide = this.showed.array[this.showed.i]
                }
        } else {
            this.slide = (this.slide + 1) % this.data.images.length
        }
        if (this.image.getStyle("visibility") != "visible") { (function() {
                this.image.setStyle("visibility", "visible")
                }).delay(1, this)
            }
        if (this.preloader) {
            this.preloader = this.preloader.destroy()
            }
        this._preload()
        },
    _center: function(d) {
        if (this.options.center) {
            var c = d.getSize();
            d.set("styles", {
                left: (c.x - this.width) / -2,
                top: (c.y - this.height) / -2
            })
            }
    },
    _resize: function(d) {
        if (this.options.resize) {
            var k = this.preloader.get("height"),
            h = this.preloader.get("width");
            var j = this.height / k,
            l = this.width / h,
            i;
            if (this.options.resize == "length") {
                i = (j > l) ? l: j
            } else {
                i = (j > l) ? j: l
            }
            d.set("styles", {
                height: Math.ceil(k * i),
                width: Math.ceil(h * i)
                })
            }
    },
    _start: function() {
        this.fireEvent("start")
        },
    _complete: function() {
        if (this.firstrun && this.options.paused) {
            this.firstrun = false;
            this.pause(1)
            }
        this.fireEvent("complete")
        },
    _captions: function() {
        if (this.options.captions === true) {
            this.options.captions = {}
        }
        var c = this.slideshow.getElement(this.classes.get("captions"));
        var d = (c) ? c.empty() : new Element("div", {
            "class": this.classes.get("captions").substr(1)
            }).inject(this.slideshow);
        d.set({
            events: {
                update: function(i) {
                    var j = this.slideshow.retrieve("captions");
                    var b = (this.data.captions[this.slide] === "");
                    if (i) {
                        var a = (b) ? "hidden": "visible";
                        j.set("html", this.data.captions[this.slide]).get("morph").cancel().set(this.classes.get("captions", a))
                        } else {
                        var h = (b) ? $empty: function(e) {
                            this.slideshow.retrieve("captions").set("html", this.data.captions[e]).morph(this.classes.get("captions", "visible"))
                            }.pass(this.slide, this);
                        j.get("morph").cancel().start(this.classes.get("captions", "hidden")).chain(h)
                        }
                }.bind(this)
                },
            morph: $merge(this.options.captions, {
                link: "chain"
            })
            });
        this.slideshow.store("captions", d)
        },
    _controller: function() {
        if (this.options.controller === true) {
            this.options.controller = {}
        }
        var j = this.slideshow.getElement(this.classes.get("controller"));
        var h = (j) ? j.empty() : new Element("div", {
            "class": this.classes.get("controller").substr(1)
            }).inject(this.slideshow);
        var l = new Element("ul").inject(h);
        $H({
            first: "Shift + Leftwards Arrow",
            prev: "Leftwards Arrow",
            pause: "P",
            next: "Rightwards Arrow",
            last: "Shift + Rightwards Arrow"
        }).each(function(a, b) {
            var d = new Element("li", {
                "class": (b == "pause" && this.options.paused) ? this.classes.play + " " + this.classes[b] : this.classes[b]
                }).inject(l);
            var c = this.slideshow.retrieve(b, new Element("a", {
                title: ((b == "pause") ? this.classes.play.capitalize() + " / ": "") + this.classes[b].capitalize() + " [" + a + "]"
            }).inject(d));
            c.set("events", {
                click: function(e) {
                    this[e]()
                    }.pass(b, this),
                mouseenter: function(e) {
                    this.addClass(e)
                    }.pass(this.classes.active, c),
                mouseleave: function(e) {
                    this.removeClass(e)
                    }.pass(this.classes.active, c)
                })
            }, this);
        h.set({
            events: {
                hide: function(a) {
                    if (!this.retrieve("hidden")) {
                        this.store("hidden", true).morph(a)
                        }
                }.pass(this.classes.get("controller", "hidden"), h),
                show: function(a) {
                    if (this.retrieve("hidden")) {
                        this.store("hidden", false).morph(a)
                        }
                }.pass(this.classes.get("controller", "visible"), h)
                },
            morph: $merge(this.options.controller, {
                link: "cancel"
            })
            }).store("hidden", false);
        var g = function(a) {
            if (["left", "right", "p"].contains(a.key)) {
                var b = this.slideshow.retrieve("controller");
                if (b.retrieve("hidden")) {
                    b.get("morph").set(this.classes.get("controller", "visible"))
                    }
                switch (a.key) {
                case "left":
                    this.slideshow.retrieve((a.shift) ? "first": "prev").fireEvent("mouseenter");
                    break;
                case "right":
                    this.slideshow.retrieve((a.shift) ? "last": "next").fireEvent("mouseenter");
                    break;
                default:
                    this.slideshow.retrieve("pause").fireEvent("mouseenter");
                    break
                }
            }
        }.bind(this);
        this.events.keydown.push(g);
        var i = function(a) {
            if (["left", "right", "p"].contains(a.key)) {
                var b = this.slideshow.retrieve("controller");
                if (b.retrieve("hidden")) {
                    b.store("hidden", false).fireEvent("hide")
                    }
                switch (a.key) {
                case "left":
                    this.slideshow.retrieve((a.shift) ? "first": "prev").fireEvent("mouseleave");
                    break;
                case "right":
                    this.slideshow.retrieve((a.shift) ? "last": "next").fireEvent("mouseleave");
                    break;
                default:
                    this.slideshow.retrieve("pause").fireEvent("mouseleave");
                    break
                }
            }
        }.bind(this);
        this.events.keyup.push(i);
        var k = function(a) {
            var b = this.slideshow.retrieve("images").getCoordinates();
            if (a.page.x > b.left && a.page.x < b.right && a.page.y > b.top && a.page.y < b.bottom) {
                this.slideshow.retrieve("controller").fireEvent("show")
                } else {
                this.slideshow.retrieve("controller").fireEvent("hide")
                }
        }.bind(this);
        this.events.mousemove.push(k);
        document.addEvents({
            keydown: g,
            keyup: i,
            mousemove: k
        });
        this.slideshow.retrieve("controller", h).fireEvent("hide")
        },
    _loader: function() {
        if (this.options.loader === true) {
            this.options.loader = {}
        }
        var d = new Element("div", {
            "class": this.classes.get("loader").substr(1),
            morph: $merge(this.options.loader, {
                link: "cancel"
            })
            }).store("hidden", false).store("i", 1).inject(this.slideshow.retrieve("images"));
        if (this.options.loader.animate) {
            for (var c = 0; c < this.options.loader.animate[1]; c++) {
                img = new Asset.image(this.options.loader.animate[0].replace(/#/, c))
                }
            if (Browser.Engine.trident4 && this.options.loader.animate[0].contains("png")) {
                d.setStyle("backgroundImage", "none")
                }
        }
        d.set("events", {
            animate: function() {
                var f = this.slideshow.retrieve("loader");
                var a = (f.retrieve("i").toInt() + 1) % this.options.loader.animate[1];
                f.store("i", a);
                var b = this.options.loader.animate[0].replace(/#/, a);
                if (Browser.Engine.trident4 && this.options.loader.animate[0].contains("png")) {
                    f.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + b + '", sizingMethod="scale")'
                } else {
                    f.setStyle("backgroundImage", "url(" + b + ")")
                    }
            }.bind(this),
            hide: function() {
                var a = this.slideshow.retrieve("loader");
                if (!a.retrieve("hidden")) {
                    a.store("hidden", true).morph(this.classes.get("loader", "hidden"));
                    if (this.options.loader.animate) {
                        $clear(a.retrieve("timer"))
                        }
                }
            }.bind(this),
            show: function() {
                var a = this.slideshow.retrieve("loader");
                if (a.retrieve("hidden")) {
                    a.store("hidden", false).morph(this.classes.get("loader", "visible"));
                    if (this.options.loader.animate) {
                        a.store("timer", function() {
                            this.fireEvent("animate")
                            }.periodical(50, a))
                        }
                }
            }.bind(this)
            });
        this.slideshow.retrieve("loader", d).fireEvent("hide")
        },
    _thumbnails: function() {
        if (this.options.thumbnails === true) {
            this.options.thumbnails = {}
        }
        var j = this.slideshow.getElement(this.classes.get("thumbnails"));
        var h = (j) ? j.empty() : new Element("div", {
            "class": this.classes.get("thumbnails").substr(1)
            }).inject(this.slideshow);
        h.setStyle("overflow", "hidden");
        var g = new Element("ul", {
            tween: {
                link: "cancel"
            }
        }).inject(h);
        this.data.thumbnails.each(function(a, b) {
            var e = new Element("li").inject(g);
            var d = new Element("a", {
                events: {
                    click: function(k) {
                        this.go(k);
                        return false
                    }.pass(b, this),
                    loaded: function() {
                        this.data.thumbnails.pop();
                        if (!this.data.thumbnails.length) {
                            var r = h.getCoordinates();
                            var k = h.retrieve("props");
                            var q = 0,
                            s = k[1],
                            p = k[2];
                            h.getElements("li").each(function(l) {
                                var l = l.getCoordinates();
                                if (l[s] > q) {
                                    q = l[s]
                                    }
                            }, this);
                            h.store("limit", r[p] + r[k[0]] - q)
                            }
                    }.bind(this)
                    },
                href: this.options.hu + this.data.images[b],
                morph: $merge(this.options.thumbnails, {
                    link: "cancel"
                })
                }).inject(e);
            if (this.data.captions[b] && this.options.titles) {
                d.set("title", this.data.captions[b].replace(/<.+?>/gm, "").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "'"))
                }
            var c = new Asset.image(this.options.hu + a, {
                onload: function() {
                    this.fireEvent("loaded")
                    }.bind(d)
                }).inject(d)
            }, this);
        h.set("events", {
            scroll: function(y, v) {
                var A = this.getCoordinates();
                var n = this.getElement("ul").getPosition();
                var d = this.retrieve("props");
                var x = d[3],
                D,
                c = d[0],
                B = d[2],
                b;
                var C = this.getElement("ul").get("tween", {
                    property: c
                });
                if ($chk(y)) {
                    var a = this.getElements("li")[y].getCoordinates();
                    D = A[c] + (A[B] / 2) - (a[B] / 2) - a[c];
                    b = (n[x] - A[c] + D).limit(this.retrieve("limit"), 0);
                    if (v) {
                        C.set(b)
                        } else {
                        C.start(b)
                        }
                } else {
                    var z = A[d[2]] / 3,
                    e = this.retrieve("page"),
                    w = -0.2;
                    if (e[x] < (A[c] + z)) {
                        D = (e[x] - A[c] - z) * w
                    } else {
                        if (e[x] > (A[c] + A[B] - z)) {
                            D = (e[x] - A[c] - A[B] + z) * w
                        }
                    }
                    if (D) {
                        b = (n[x] - A[c] + D).limit(this.retrieve("limit"), 0);
                        C.set(b)
                        }
                }
            }.bind(h),
            update: function(b) {
                var a = this.slideshow.retrieve("thumbnails");
                a.getElements("a").each(function(m, e) {
                    if (e == this.slide) {
                        if (!m.retrieve("active", false)) {
                            m.store("active", true);
                            var c = this.classes.get("thumbnails", "active");
                            if (b) {
                                m.get("morph").set(c)
                                } else {
                                m.morph(c)
                                }
                        }
                    } else {
                        if (m.retrieve("active", true)) {
                            m.store("active", false);
                            var d = this.classes.get("thumbnails", "inactive");
                            if (b) {
                                m.get("morph").set(d)
                                } else {
                                m.morph(d)
                                }
                        }
                    }
                }, this);
                if (!a.retrieve("mouseover")) {
                    a.fireEvent("scroll", [this.slide, b])
                    }
            }.bind(this)
            });
        var i = h.getCoordinates();
        h.store("props", (i.height > i.width) ? ["top", "bottom", "height", "y"] : ["left", "right", "width", "x"]);
        var f = function(b) {
            var a = this.getCoordinates();
            if (b.page.x > a.left && b.page.x < a.right && b.page.y > a.top && b.page.y < a.bottom) {
                this.store("page", b.page);
                if (!this.retrieve("mouseover")) {
                    this.store("mouseover", true);
                    this.store("timer", function() {
                        this.fireEvent("scroll")
                        }.periodical(50, this))
                    }
            } else {
                if (this.retrieve("mouseover")) {
                    this.store("mouseover", false);
                    $clear(this.retrieve("timer"))
                    }
            }
        }.bind(h);
        this.events.mousemove.push(f);
        document.addEvent("mousemove", f);
        this.slideshow.store("thumbnails", h)
        }
});
Slideshow.KenBurns = new Class({
    Extends: Slideshow,
    options: {
        pan: [100, 100],
        zoom: [50, 50]
        },
    initialize: function(d, f, e) {
        e.overlap = true;
        e.resize = true; ["pan", "zoom"].each(function(a) {
            if ($chk(this[a])) {
                if ($type(this[a]) != "array") {
                    this[a] = [this[a], this[a]]
                    }
                this[a].map(function(b) {
                    return (b.toInt() || 0).limit(0, 100)
                    })
                }
        }, e);
        this.parent(d, f, e)
        },
    _show: function(g) {
        if (!this.image.retrieve("morph")) { ["a", "b"].each(function(a) {
                this[a].set("tween", {
                    duration: this.options.duration,
                    link: "cancel",
                    onStart: this._start.bind(this),
                    onComplete: this._complete.bind(this),
                    property: "opacity"
                }).get("morph", {
                    duration: (this.options.delay + this.options.duration * 2),
                    link: "cancel",
                    transition: $arguments(0)
                    })
                }, this)
            }
        this.image.set("styles", {
            bottom: "auto",
            left: "auto",
            right: "auto",
            top: "auto"
        });
        var k = ["top left", "top right", "bottom left", "bottom right"][this.counter % 4].split(" ");
        k.each(function(a) {
            this.image.setStyle(a, 0)
            }, this);
        dh = this.height / this.preloader.height;
        dw = this.width / this.preloader.width;
        delta = (dw > dh) ? dw: dh;
        var h = {};
        var j = ($random.run(this.options.zoom) / 100) + 1;
        var i = Math.abs(($random.run(this.options.pan) / 100) - 1); ["height", "width"].each(function(a, d) {
            var b = Math.ceil(this.preloader[a] * delta);
            var c = (b * j).toInt();
            h[a] = [c, b];
            if (dw > dh || d) {
                b = (this[a] - this.image[a]);
                c = (b * i).toInt();
                h[k[d]] = [c, b]
                }
        }, this);
        var l = (this.firstrun && this.options.paused);
        if (g || l) {
            this._center(this.image);
            this.image.get("morph").cancel();
            if (l) {
                this.image.get("tween").cancel().set(0).start(1)
                } else {
                this.image.get("tween").cancel().set(1)
                }
        } else {
            this.image.get("morph").start(h);
            this.image.get("tween").set(0).start(1)
            }
    }
});
window.addEvent("domready", function() {
    var b = {
        "pupPho/1.jpg": {
            caption: ""
        },
        "pupPho/2.jpg": {
            caption: ""
        },
        "pupPho/3.jpg": {
            caption: ""
        },
        "pupPho/4.jpg": {
            caption: ""
        },
        "pupPho/5.jpg": {
            caption: ""
        },
        "pupPho/6.jpg": {
            caption: ""
        },
        "pupPho/7.jpg": {
            caption: ""
        },
        "pupPho/8.jpg": {
            caption: ""
        },
        "pupPho/9.jpg": {
            caption: ""
        },
        "pupPho/10.jpg": {
            caption: ""
        },
        "pupPho/11.jpg": {
            caption: ""
        },
        "pupPho/12.jpg": {
            caption: ""
        },
        "pupPho/13.jpg": {
            caption: ""
        },
        "pupPho/14.jpg": {
            caption: ""
        },
        "pupPho/15.jpg": {
            caption: ""
        },
        "pupPho/16.jpg": {
            caption: ""
        },
        "pupPho/17.jpg": {
            caption: ""
        },
        "pupPho/18.jpg": {
            caption: ""
        },
        "pupPho/19.jpg": {
            caption: ""
        },
        "pupPho/20.jpg": {
            caption: ""
        },
        "pupPho/21.jpg": {
            caption: ""
        },
        "pupPho/22.jpg": {
            caption: ""
        },
        "pupPho/23.jpg": {
            caption: ""
        },
        "pupPho/24.jpg": {
            caption: ""
        },
        "pupPho/25.jpg": {
            caption: ""
        },
        "pupPho/26.jpg": {
            caption: ""
        },
        "pupPho/27.jpg": {
            caption: ""
        },
        "pupPho/28.jpg": {
            caption: ""
        },
        "pupPho/29.jpg": {
            caption: ""
        },
        "pupPho/30.jpg": {
            caption: ""
        },
        "pupPho/31.jpg": {
            caption: ""
        },
        "pupPho/32.jpg": {
            caption: ""
        },
        "pupPho/33.jpg": {
            caption: ""
        },
        "pupPho/34.jpg": {
            caption: ""
        },
        "pupPho/35.jpg": {
            caption: ""
        },
        "pupPho/36.jpg": {
            caption: ""
        },
        "pupPho/37.jpg": {
            caption: ""
        },
        "pupPho/38.jpg": {
            caption: ""
        },
        "pupPho/39.jpg": {
            caption: ""
        },
        "pupPho/40.jpg": {
            caption: ""
        },
        "pupPho/41.jpg": {
            caption: ""
        },
        "pupPho/42.jpg": {
            caption: ""
        },
        "pupPho/43.jpg": {
            caption: ""
        },
        "pupPho/44.jpg": {
            caption: ""
        },
        "pupPho/45.jpg": {
            caption: ""
        },
        "pupPho/46.jpg": {
            caption: ""
        },
        "pupPho/47.jpg": {
            caption: ""
        },
        "pupPho/48.jpg": {
            caption: ""
        },
        "pupPho/49.jpg": {
            caption: ""
        },
        "pupPho/50.jpg": {
            caption: ""
        },
        "pupPho/51.jpg": {
            caption: ""
        }
    };
    var a = new Slideshow.KenBurns("show", b, {
        controller: true,
        height: 385,
        hu: "images/",
        thumbnails: true,
        width: 480
    })
    });

