/*
 * jQuery Tools 1.2.3 - The missing UI library for the Web
 * 
 * [toolbox.history]
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 * File generated: Mon Jun 14 03:12:38 GMT 2010
 */
(function(b){
    function h(c){
        if(c){
            var a=d.contentWindow.document;
            a.open().close();
            a.location.hash=c
        }
    }
    var g,d,f,i;
    b.tools=b.tools||{
        version:"1.2.3"
    };

    b.tools.history={
        init:function(c){
            //if(!i){
                if(b.browser.msie&&b.browser.version<"8"){
                    if(!d){
                        d=b("<iframe/>").attr("src","javascript:false;").hide().get(0);
                        b("body").append(d);
                        setInterval(function(){
                            var a=d.contentWindow.document;
                            a=a.location.hash;
                            g!==a&&b.event.trigger("hash",a)
                        },100);
                        h(location.hash||"#")
                    }
                }else setInterval(function(){
                    var a=location.hash;
                    a!==g&&b.event.trigger("hash",a)
                },100);
                f=!f?c:f.add(c);
                c.click(function(a){
                    var e=b(this).attr("href");
                    d&&h(e);
                    if(e.slice(0,1)!="#"){
                        location.href="#"+e;
                        return a.preventDefault()
                    }
                });
                i=true
            }
        //}
    };

    b(window).bind("hash",function(c,a){
        a?f.filter(function(){
            var e=b(this).attr("href");
            return e==a||e==a.replace("#","")
        }).trigger("history",[a]):f.eq(0).trigger("history",[a]);
        g=a;
        //window.location.hash=g
    });
    
    
    b.fn.history=function(c){
        b.tools.history.init(this);
        return this.bind("history",c)
    }
})(jQuery);

