$(document).ready(function(){
    if (location.hash != "" && $("a.nav[href="+location.hash+"]").length != 0) {
        linkTarget = location.hash
    } else {
        linkTarget = 1
    }

    $(".nav").switchTarget({
        linkSelected: linkTarget,
        effect: (function(t, targets, options) {
            if( t.is(":not(:visible)") ) {
                visible = $(targets).filter(":visible")
                if(visible.length > 0) {
                    visible.fadeOut("fast", function(){
                        t.fadeIn("slow").slideDown("slow")
                    });
                } else {
                    t.fadeIn("slow").slideDown("slow")
                }
            }
        })
    })
    
    $.beautyOfCode.init({
        baseUrl: 'scripts/syntaxhighlighting/',
        brushes: ['Ruby'],
        theme: 'ChaosR'
    });
})