$(function() {
    Tabs.init($('.tabbed_box'));
});

Tabs = {
    init: function(container) {
        var tabs = this;

        this.$contianer = container;
        this.$links = this.$contianer.find('.tabbed_navigation a');
        this.$sections = this.$contianer.find('.tabbed_section');

        this.$links.click(function() {
            var anchor = this.hash.substr(1, this.hash.length);
            tabs.$sections.hide();
            tabs.$sections.filter(':has(a[name=' + anchor + '])').show();
            tabs.$links.removeClass('active');
            $(this).addClass('active');
            return false;
        });

        this.$links.filter('.active').click();
    }
};

