/*
 * jQuery hashchange event - v1.3 - 7/21/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,e,b){
    var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);
    function a(j){
        j=j||location.href;
        return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")
        }
        $.fn[c]=function(j){
        return j?this.bind(c,j):this.trigger(c)
        };
        
    $.fn[c].delay=50;
    g[c]=$.extend(g[c],{
        setup:function(){
            if(d){
                return false
                }
                $(f.start)
            },
        teardown:function(){
            if(d){
                return false
                }
                $(f.stop)
            }
        });
f=(function(){
    var j={},p,m=a(),k=function(q){
        return q
        },l=k,o=k;
    j.start=function(){
        p||n()
        };
        
    j.stop=function(){
        p&&clearTimeout(p);
        p=b
        };
        
    function n(){
        var r=a(),q=o(m);
        if(r!==m){
            l(m=r,q);
            $(e).trigger(c)
            }else{
            if(q!==m){
                location.href=location.href.replace(/#.*/,"")+q
                }
            }
        p=setTimeout(n,$.fn[c].delay)
    }
    $.browser.msie&&!d&&(function(){
    var q,r;
    j.start=function(){
        if(!q){
            r=$.fn[c].src;
            r=r&&r+a();
            q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){
                r||l(a());
                n()
                }).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;
            h.onpropertychange=function(){
                try{
                    if(event.propertyName==="title"){
                        q.document.title=h.title
                        }
                    }catch(s){}
        }
    }
};

j.stop=k;
o=function(){
    return a(q.location.href)
    };
    
l=function(w,s){
    var v=q.document,u=$.fn[c].domain;
    if(w!==s){
        v.title=h.title;
        v.open();
        u&&v.write('<script>document.domain="'+u+'"<\/script>');
        v.close();
        q.location.hash=w
        }
    }
})();
return j
})()
})(jQuery,this);
jQuery.cookie=function(d,e,b){
    if(arguments.length>1&&String(e)!=="[object Object]"){
        b=jQuery.extend({},b);
        if(e===null||e===undefined){
            b.expires=-1
            }
            if(typeof b.expires==="number"){
            var g=b.expires,c=b.expires=new Date();
            c.setDate(c.getDate()+g)
            }
            e=String(e);
        return(document.cookie=[encodeURIComponent(d),"=",b.raw?e:encodeURIComponent(e),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))
        }
        b=e||{};
    
    var a,f=b.raw?function(h){
        return h
        }:decodeURIComponent;
    return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null
    };
