/*
 * jQuery Tools 1.2.3 - The missing UI library for the Web
 * 
 * [scrollable, scrollable.autoscroll, scrollable.navigator, overlay, overlay.apple, toolbox.flashembed, toolbox.mousewheel]
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 * jquery.event.wheel.js - rev 1 
 * Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
 * Liscensed under the MIT License (MIT-LICENSE.txt)
 * http://www.opensource.org/licenses/mit-license.php
 * Created: 2008-07-01 | Updated: 2008-07-14
 * 
 * -----
 * 
 * File generated: Mon Jun 14 18:49:51 GMT 2010
 */
 (function(e) {
    function n(f, c) {
        var a = e(c);
        return a.length < 2 ? a: f.parent().find(c)
    }
    function t(f, c) {
        var a = this,
        l = f.add(a),
        g = f.children(),
        k = 0,
        m = c.vertical;
        j || (j = a);
        if (g.length > 1) g = e(c.items, f);
        e.extend(a, {
            getConf: function() {
                return c
            },
            getIndex: function() {
                return k
            },
            getSize: function() {
                return a.getItems().size()
            },
            getNaviButtons: function() {
                return o.add(p)
            },
            getRoot: function() {
                return f
            },
            getItemWrap: function() {
                return g
            },
            getItems: function() {
                return g.children(c.item).not("." + c.clonedClass)
            },
            move: function(b, d) {
                return a.seekTo(k +
                b, d)
            },
            next: function(b) {
                return a.move(1, b)
            },
            prev: function(b) {
                return a.move( - 1, b)
            },
            begin: function(b) {
                return a.seekTo(0, b)
            },
            end: function(b) {
                return a.seekTo(a.getSize() - 1, b)
            },
            focus: function() {
                return j = a
            },
            addItem: function(b) {
                b = e(b);
                if (c.circular) {
                    e(".cloned:last").before(b);
                    e(".cloned:first").replaceWith(b.clone().addClass(c.clonedClass))
                } else g.append(b);
                l.trigger("onAddItem", [b]);
                return a
            },
            seekTo: function(b, d, h) {
                if (c.circular && b === 0 && k == -1 && d !== 0) return a;
                if (!c.circular && b < 0 || b > a.getSize() || b < -1) return a;
                var i = b;
                if (b.jquery) b = a.getItems().index(b);
                else i = a.getItems().eq(b);
                var q = e.Event("onBeforeSeek");
                if (!h) {
                    l.trigger(q, [b, d]);
                    if (q.isDefaultPrevented() || !i.length) return a
                }
                i = m ? {
                    top: -i.position().top
                }: {
                    left: -i.position().left
                };
                k = b;
                j = a;
                if (d === undefined) d = c.speed;
                g.animate(i, d, c.easing, h ||
                function() {
                    l.trigger("onSeek", [b])
                });
                return a
            }
        });
        e.each(["onBeforeSeek", "onSeek", "onAddItem"],
        function(b, d) {
            e.isFunction(c[d]) && e(a).bind(d, c[d]);
            a[d] = function(h) {
                e(a).bind(d, h);
                return a
            }
        });
        if (c.circular) {
            var r = a.getItems().slice( - 1).clone().prependTo(g),
            s = a.getItems().eq(1).clone().appendTo(g);
            r.add(s).addClass(c.clonedClass);
            a.onBeforeSeek(function(b, d, h) {
                if (!b.isDefaultPrevented()) if (d == -1) {
                    a.seekTo(r, h,
                    function() {
                        a.end(0)
                    });
                    return b.preventDefault()
                } else d == a.getSize() && a.seekTo(s, h,
                function() {
                    a.begin(0)
                })
            });
            a.seekTo(0, 0)
        }
        var o = n(f, c.prev).click(function() {
            a.prev()
        }),
        p = n(f, c.next).click(function() {
            a.next()
        }); ! c.circular && a.getSize() > 1 && a.onBeforeSeek(function(b, d) {
            setTimeout(function() {
                if (!b.isDefaultPrevented()) {
                    o.toggleClass(c.disabledClass,
                    d <= 0);
                    p.toggleClass(c.disabledClass, d >= a.getSize() - 1)
                }
            },
            1)
        });
        c.mousewheel && e.fn.mousewheel && f.mousewheel(function(b, d) {
            if (c.mousewheel) {
                a.move(d < 0 ? 1: -1, c.wheelSpeed || 50);
                return false
            }
        });
        c.keyboard && e(document).bind("keydown.scrollable",
        function(b) {
            if (! (!c.keyboard || b.altKey || b.ctrlKey || e(b.target).is(":input"))) if (! (c.keyboard != "static" && j != a)) {
                var d = b.keyCode;
                if (m && (d == 38 || d == 40)) {
                    a.move(d == 38 ? -1: 1);
                    return b.preventDefault()
                }
                if (!m && (d == 37 || d == 39)) {
                    a.move(d == 37 ? -1: 1);
                    return b.preventDefault()
                }
            }
        });
        e(a).trigger("onBeforeSeek", [c.initialIndex])
    }
    e.tools = e.tools || {
        version: "1.2.3"
    };
    e.tools.scrollable = {
        conf: {
            activeClass: "active",
            circular: false,
            clonedClass: "cloned",
            disabledClass: "disabled",
            easing: "swing",
            initialIndex: 0,
            item: null,
            items: ".items",
            keyboard: true,
            mousewheel: false,
            next: ".next",
            prev: ".prev",
            speed: 400,
            vertical: false,
            wheelSpeed: 0
        }
    };
    var j;
    e.fn.scrollable = function(f) {
        var c = this.data("scrollable");
        if (c) return c;
        f = e.extend({},
        e.tools.scrollable.conf, f);
        this.each(function() {
            c = new t(e(this), f);
            e(this).data("scrollable",
            c)
        });
        return f.api ? c: this
    }
})(jQuery);
 (function(c) {
    var g = c.tools.scrollable;
    g.autoscroll = {
        conf: {
            autoplay: true,
            interval: 3E3,
            autopause: true
        }
    };
    c.fn.autoscroll = function(d) {
        if (typeof d == "number") d = {
            interval: d
        };
        var b = c.extend({},
        g.autoscroll.conf, d),
        h;
        this.each(function() {
            var a = c(this).data("scrollable");
            if (a) h = a;
            var e,
            i,
            f = true;
            a.play = function() {
                if (!e) {
                    f = false;
                    e = setInterval(function() {
                        a.next()
                    },
                    b.interval);
                    a.next()
                }
            };
            a.pause = function() {
                e = clearInterval(e)
            };
            a.stop = function() {
                a.pause();
                f = true
            };
            b.autopause && a.getRoot().add(a.getNaviButtons()).hover(function() {
                a.pause();
                clearInterval(i)
            },
            function() {
                f || (i = setTimeout(a.play, b.interval))
            });
            b.autoplay && setTimeout(a.play, b.interval)
        });
        return b.api ? h: this
    }
})(jQuery);
 (function(d) {
    function p(c, g) {
        var h = d(g);
        return h.length < 2 ? h: c.parent().find(g)
    }
    var m = d.tools.scrollable;
    m.navigator = {
        conf: {
            navi: ".navi",
            naviItem: null,
            activeClass: "active",
            indexed: false,
            idPrefix: null,
            history: false
        }
    };
    d.fn.navigator = function(c) {
        if (typeof c == "string") c = {
            navi: c
        };
        c = d.extend({},
        m.navigator.conf, c);
        var g;
        this.each(function() {
            function h(a, b, i) {
                e.seekTo(b);
                if (j) {
                    if (location.hash) location.hash = a.attr("href").replace("#", "")
                } else return i.preventDefault()
            }
            function f() {
                return k.find(c.naviItem ||
                "> *")
            }
            function n(a) {
                var b = d("<" + (c.naviItem || "a") + "/>").click(function(i) {
                    h(d(this), a, i)
                }).attr("href", "#" + a);
                a === 0 && b.addClass(l);
                c.indexed && b.text(a + 1);
                c.idPrefix && b.attr("id", c.idPrefix + a);
                return b.appendTo(k)
            }
            function o(a, b) {
                a = f().eq(b.replace("#", ""));
                a.length || (a = f().filter("[href=" + b + "]"));
                a.click()
            }
            var e = d(this).data("scrollable"),
            k = p(e.getRoot(), c.navi),
            q = e.getNaviButtons(),
            l = c.activeClass,
            j = c.history && d.fn.history;
            if (e) g = e;
            e.getNaviButtons = function() {
                return q.add(k)
            };
            f().length ? f().each(function(a) {
                d(this).click(function(b) {
                    h(d(this),
                    a, b)
                })
            }) : d.each(e.getItems(),
            function(a) {
                n(a)
            });
            e.onBeforeSeek(function(a, b) {
                setTimeout(function() {
                    if (!a.isDefaultPrevented()) {
                        var i = f().eq(b); ! a.isDefaultPrevented() && i.length && f().removeClass(l).eq(b).addClass(l)
                    }
                },
                1)
            });
            e.onAddItem(function(a, b) {
                b = n(e.getItems().index(b));
                j && b.history(o)
            });
            j && f().history(o)
        });
        return c.api ? g: this
    }
})(jQuery);
 (function(a) {
    function t(d, b) {
        var c = this,
        i = d.add(c),
        o = a(window),
        k,
        f,
        m,
        g = a.tools.expose && (b.mask || b.expose),
        n = Math.random().toString().slice(10);
        if (g) {
            if (typeof g == "string") g = {
                color: g
            };
            g.closeOnClick = g.closeOnEsc = false
        }
        var p = b.target || d.attr("rel");
        f = p ? a(p) : d;
        if (!f.length) throw "Could not find Overlay: " + p;
        d && d.index(f) == -1 && d.click(function(e) {
            c.load(e);
            return e.preventDefault()
        });
        a.extend(c, {
            load: function(e) {
                if (c.isOpened()) return c;
                var h = q[b.effect];
                if (!h) throw 'Overlay: cannot find effect : "' + b.effect +
                '"';
                b.oneInstance && a.each(s,
                function() {
                    this.close(e)
                });
                e = e || a.Event();
                e.type = "onBeforeLoad";
                i.trigger(e);
                if (e.isDefaultPrevented()) return c;
                m = true;
                g && a(f).expose(g);
                var j = b.top,
                r = b.left,
                u = f.outerWidth({
                    margin: true
                }),
                v = f.outerHeight({
                    margin: true
                });
                if (typeof j == "string") j = j == "center" ? Math.max((o.height() - v) / 2, 0) : parseInt(j, 10) / 100 * o.height();
                if (r == "center") r = Math.max((o.width() - u) / 2, 0);
                h[0].call(c, {
                    top: j,
                    left: r
                },
                function() {
                    if (m) {
                        e.type = "onLoad";
                        i.trigger(e)
                    }
                });
                g && b.closeOnClick && a.mask.getMask().one("click",
                c.close);
                b.closeOnClick && a(document).bind("click." + n,
                function(l) {
                    a(l.target).parents(f).length || c.close(l)
                });
                b.closeOnEsc && a(document).bind("keydown." + n,
                function(l) {
                    l.keyCode == 27 && c.close(l)
                });
                return c
            },
            close: function(e) {
                if (!c.isOpened()) return c;
                e = e || a.Event();
                e.type = "onBeforeClose";
                i.trigger(e);
                if (!e.isDefaultPrevented()) {
                    m = false;
                    q[b.effect][1].call(c,
                    function() {
                        e.type = "onClose";
                        i.trigger(e)
                    });
                    a(document).unbind("click." + n).unbind("keydown." + n);
                    g && a.mask.close();
                    return c
                }
            },
            getOverlay: function() {
                return f
            },
            getTrigger: function() {
                return d
            },
            getClosers: function() {
                return k
            },
            isOpened: function() {
                return m
            },
            getConf: function() {
                return b
            }
        });
        a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),
        function(e, h) {
            a.isFunction(b[h]) && a(c).bind(h, b[h]);
            c[h] = function(j) {
                a(c).bind(h, j);
                return c
            }
        });
        k = f.find(b.close || ".close");
        if (!k.length && !b.close) {
            k = a('<a class="close"></a>');
            f.prepend(k)
        }
        k.click(function(e) {
            c.close(e)
        });
        b.load && c.load()
    }
    a.tools = a.tools || {
        version: "1.2.3"
    };
    a.tools.overlay = {
        addEffect: function(d,
        b, c) {
            q[d] = [b, c]
        },
        conf: {
            close: null,
            closeOnClick: true,
            closeOnEsc: true,
            closeSpeed: "fast",
            effect: "default",
            fixed: !a.browser.msie || a.browser.version > 6,
            left: "center",
            load: false,
            mask: null,
            oneInstance: true,
            speed: "normal",
            target: null,
            top: "10%"
        }
    };
    var s = [],
    q = {};
    a.tools.overlay.addEffect("default",
    function(d, b) {
        var c = this.getConf(),
        i = a(window);
        if (!c.fixed) {
            d.top += i.scrollTop();
            d.left += i.scrollLeft()
        }
        d.position = c.fixed ? "fixed": "absolute";
        this.getOverlay().css(d).fadeIn(c.speed, b)
    },
    function(d) {
        this.getOverlay().fadeOut(this.getConf().closeSpeed,
        d)
    });
    a.fn.overlay = function(d) {
        var b = this.data("overlay");
        if (b) return b;
        if (a.isFunction(d)) d = {
            onBeforeLoad: d
        };
        d = a.extend(true, {},
        a.tools.overlay.conf, d);
        this.each(function() {
            b = new t(a(this), d);
            s.push(b);
            a(this).data("overlay", b)
        });
        return d.api ? b: this
    }
})(jQuery);
 (function(i) {
    function j(b) {
        var d = b.offset();
        return {
            top: d.top + b.height() / 2,
            left: d.left + b.width() / 2
        }
    }
    var k = i.tools.overlay,
    f = i(window);
    i.extend(k.conf, {
        start: {
            top: null,
            left: null
        },
        fadeInSpeed: "fast",
        zIndex: 9999
    });
    function n(b, d) {
        var a = this.getOverlay(),
        c = this.getConf(),
        g = this.getTrigger(),
        o = this,
        l = a.outerWidth({
            margin: true
        }),
        h = a.data("img");
        if (!h) {
            var e = a.css("backgroundImage");
            if (!e) throw "background-image CSS property not set for overlay";
            e = e.slice(e.indexOf("(") + 1, e.indexOf(")")).replace(/\"/g, "");
            a.css("backgroundImage", "none");
            h = i('<img src="' + e + '"/>');
            h.css({
                border: 0,
                display: "none"
            }).width(l);
            i("body").append(h);
            a.data("img", h)
        }
        e = c.start.top || Math.round(f.height() / 2);
        var m = c.start.left || Math.round(f.width() / 2);
        if (g) {
            g = j(g);
            e = g.top;
            m = g.left
        }
        h.css({
            position: "absolute",
            top: e,
            left: m,
            width: 0,
            zIndex: c.zIndex
        }).show();
        b.top += f.scrollTop();
        b.left += f.scrollLeft();
        b.position = "absolute";
        a.css(b);
        h.animate({
            top: a.css("top"),
            left: a.css("left"),
            width: l
        },
        c.speed,
        function() {
            if (c.fixed) {
                b.top -= f.scrollTop();
                b.left -= f.scrollLeft();
                b.position = "fixed";
                h.add(a).css(b)
            }
            a.css("zIndex", c.zIndex + 1).fadeIn(c.fadeInSpeed,
            function() {
                o.isOpened() && !i(this).index(a) ? d.call() : a.hide()
            })
        })
    }
    function p(b) {
        var d = this.getOverlay().hide(),
        a = this.getConf(),
        c = this.getTrigger();
        d = d.data("img");
        var g = {
            top: a.start.top,
            left: a.start.left,
            width: 0
        };
        c && i.extend(g, j(c));
        a.fixed && d.css({
            position: "absolute"
        }).animate({
            top: "+=" + f.scrollTop(),
            left: "+=" + f.scrollLeft()
        },
        0);
        d.animate(g, a.closeSpeed, b)
    }
    k.addEffect("apple", n, p)
})(jQuery);
 (function() {
    function f(a, b) {
        if (b) for (key in b) if (b.hasOwnProperty(key)) a[key] = b[key];
        return a
    }
    function l(a, b) {
        var c = [];
        for (var d in a) if (a.hasOwnProperty(d)) c[d] = b(a[d]);
        return c
    }
    function m(a, b, c) {
        if (e.isSupported(b.version)) a.innerHTML = e.getHTML(b, c);
        else if (b.expressInstall && e.isSupported([6, 65])) a.innerHTML = e.getHTML(f(b, {
            src: b.expressInstall
        }), {
            MMredirectURL: location.href,
            MMplayerType: "PlugIn",
            MMdoctitle: document.title
        });
        else {
            if (!a.innerHTML.replace(/\s/g, "")) {
                a.innerHTML = "<h2>Flash version " +
                b.version + " or greater is required</h2><h3>" + (g[0] > 0 ? "Your version is " + g: "You have no flash plugin installed") + "</h3>" + (a.tagName == "A" ? "<p>Click here to download latest version</p>": "<p>Download latest version from <a href='" + k + "'>here</a></p>");
                if (a.tagName == "A") a.onclick = function() {
                    location.href = k
                }
            }
            if (b.onFail) {
                var d = b.onFail.call(this);
                if (typeof d == "string") a.innerHTML = d
            }
        }
        if (h) window[b.id] = document.getElementById(b.id);
        f(this, {
            getRoot: function() {
                return a
            },
            getOptions: function() {
                return b
            },
            getConf: function() {
                return c
            },
            getApi: function() {
                return a.firstChild
            }
        })
    }
    var h = document.all,
    k = "http://www.adobe.com/go/getflashplayer",
    n = typeof jQuery == "function",
    o = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/,
    i = {
        width: "100%",
        height: "100%",
        id: "_" + ("" + Math.random()).slice(9),
        allowfullscreen: true,
        allowscriptaccess: "always",
        quality: "high",
        version: [3, 0],
        onFail: null,
        expressInstall: null,
        w3c: false,
        cachebusting: false
    };
    window.attachEvent && window.attachEvent("onbeforeunload",
    function() {
        __flash_unloadHandler = function() {};
        __flash_savedUnloadHandler = function() {}
    });
    window.flashembed = function(a, b, c) {
        if (typeof a == "string") a = document.getElementById(a.replace("#", ""));
        if (a) {
            if (typeof b == "string") b = {
                src: b
            };
            return new m(a, f(f({},
            i), b), c)
        }
    };
    var e = f(window.flashembed, {
        conf: i,
        getVersion: function() {
            var a;
            try {
                a = navigator.plugins["Shockwave Flash"].description.slice(16)
            } catch(b) {
                try {
                    var c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
                    a = c && c.GetVariable("$version")
                } catch(d) {}
            }
            return (a = o.exec(a)) ? [a[1], a[3]] : [0, 0]
        },
        asString: function(a) {
            if (a === null || a === undefined) return null;
            var b = typeof a;
            if (b == "object" && a.push) b = "array";
            switch (b) {
            case "string":
                a = a.replace(new RegExp('(["\\\\])', "g"), "\\$1");
                a = a.replace(/^\s?(\d+\.?\d+)%/, "$1pct");
                return '"' + a + '"';
            case "array":
                return "[" + l(a,
                function(d) {
                    return e.asString(d)
                }).join(",") + "]";
            case "function":
                return '"function()"';
            case "object":
                b = [];
                for (var c in a) a.hasOwnProperty(c) && b.push('"' + c + '":' + e.asString(a[c]));
                return "{" + b.join(",") + "}"
            }
            return String(a).replace(/\s/g, " ").replace(/\'/g, '"')
        },
        getHTML: function(a, b) {
            a = f({},
            a);
            var c = '<object width="' +
            a.width + '" height="' + a.height + '" id="' + a.id + '" name="' + a.id + '"';
            if (a.cachebusting) a.src += (a.src.indexOf("?") != -1 ? "&": "?") + Math.random();
            c += a.w3c || !h ? ' data="' + a.src + '" type="application/x-shockwave-flash"': ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
            c += ">";
            if (a.w3c || h) c += '<param name="movie" value="' + a.src + '" />';
            a.width = a.height = a.id = a.w3c = a.src = null;
            a.onFail = a.version = a.expressInstall = null;
            for (var d in a) if (a[d]) c += '<param name="' + d + '" value="' + a[d] + '" />';
            a = "";
            if (b) {
                for (var j in b) if (b[j]) {
                    d =
                    b[j];
                    a += j + "=" + (/function|object/.test(typeof d) ? e.asString(d) : d) + "&"
                }
                a = a.slice(0, -1);
                c += '<param name="flashvars" value=\'' + a + "' />"
            }
            c += "</object>";
            return c
        },
        isSupported: function(a) {
            return g[0] > a[0] || g[0] == a[0] && g[1] >= a[1]
        }
    }),
    g = e.getVersion();
    if (n) {
        jQuery.tools = jQuery.tools || {
            version: "1.2.3"
        };
        jQuery.tools.flashembed = {
            conf: i
        };
        jQuery.fn.flashembed = function(a, b) {
            return this.each(function() {
                $(this).data("flashembed", flashembed(this, a, b))
            })
        }
    }
})();
 (function(b) {
    function c(a) {
        switch (a.type) {
        case "mousemove":
            return b.extend(a.data, {
                clientX: a.clientX,
                clientY: a.clientY,
                pageX: a.pageX,
                pageY: a.pageY
            });
        case "DOMMouseScroll":
            b.extend(a, a.data);
            a.delta = -a.detail / 3;
            break;
        case "mousewheel":
            a.delta = a.wheelDelta / 120;
            break
        }
        a.type = "wheel";
        return b.event.handle.call(this, a, a.delta)
    }
    b.fn.mousewheel = function(a) {
        return this[a ? "bind": "trigger"]("wheel", a)
    };
    b.event.special.wheel = {
        setup: function() {
            b.event.add(this, d, c, {})
        },
        teardown: function() {
            b.event.remove(this,
            d, c)
        }
    };
    var d = !b.browser.mozilla ? "mousewheel": "DOMMouseScroll" + (b.browser.version < "1.9" ? " mousemove": "")
})(jQuery);

