(function($){
    $ && $(function () {
        var articles = $("article")
                .slice(1)

            menu = $("nav")
                .find("a")
                    .click(function (event) {
                        var self = $(this).blur();

                        articles
                            .not($(self.attr("href")).slideDown())
                                .slideUp();
                        
                        menu
                            .not(self.addClass("active"))
                                .removeClass("active");
                    });
        
        menu
            .filter("[href=" + (window.location.hash || "#about") +"]")
                .click();
        
        // fix the current year
        (function (dates) {
            dates.html(dates.html().replace(/\d+$/, (new Date).getFullYear()));
        }($("#copyright_date")));
    });
})(jQuery);
