$(document).ready(function(event){
    var $last_year = $('#archives ul li:last').text();
    $last_year = $last_year.replace('|','');
    $('#archives ul li:last').text($last_year);
    
    $('#archives ul li').click(function(event){
        var $year   = $(this).text().replace('|','').replace(' ','');
        
        $('#archives ul li.current_year').removeClass();
        $(this).addClass('current_year');
        
        $('#archives div blockquote  b.current_month').removeClass();
        $('#archives div blockquote ol.current_month').removeClass();
        
        $('#archives div blockquote[year='+$year+']  b:first').addClass('current_month');
        $('#archives div blockquote[year='+$year+'] ol:first').addClass('current_month');
        
        $('#archives div blockquote.current_year').fadeOut(   
            function(event){ 
                $('#archives div blockquote[year='+$year+']').fadeIn( function(event){ $(this).addClass('current_year'); } );
                $(this).removeClass('current_year');
            }
        );
    });
    
    $('#archives div blockquote b').click(function(event){
        var $header= $(this);
        var $list  = $(this).attr('id')+'_list';
        
        $('#archives div blockquote ol.current_month').fadeOut(
            function(event){
                $('#archives div blockquote b.current_month').removeClass();
            
                $('#archives div blockquote ol[id='+$list+']').fadeIn( function(event){ $(this).addClass('current_month'); } );
            
                $header.addClass('current_month');
                $(this).removeClass('current_month');
            }
        );
    });
        
    $('#press_kit a[image]').mouseover(function(event){
        var $image  = $(this).attr('image');

        $('#press_kit img').hide();
        $('#press_kit img#'+$image).show();
    });
});
