$(function(){
	$('#tweets').tweetable({username: 'abyssjudge', time: false, limit: 1, replies: true, position: 'append'});
});

$(function() {

    var newHash      = "",
        $mainContent = $("#main-content"),
        $el;
        
    
    $("nav").delegate("a", "click", function() {
        window.location.hash = $(this).attr("href");
        return false;
    });
    
    $(window).bind('hashchange', function(){
    
        newHash = window.location.hash.substring(1);
        
        if (newHash) {
            $mainContent
                .find("#guts")
                .fadeOut(200, function() {
                    $mainContent.hide().load(newHash + " #guts", function() {
                        $mainContent.fadeIn(200, function() {
                        Shadowbox.init({ skipSetup: true }); Shadowbox.setup();   
						$('#tweets').tweetable({username: 'abyssjudge', time: false, limit: 1, replies: true, position: 'append'});
                        });
                        $("nav a").removeClass("current");
                        $("nav a[href="+newHash+"]").addClass("current");
                    });
                });
        
		
		};
        
    });
    
    $(window).trigger('hashchange');
	

});
