var YearPreview = {
   
   init: function(url) {
       
       _url = url
       
       YearPreview.getData()
   },
   
   getData: function() {
       $('#year_preview a').click(function() {
          year_title = $(this).html();
          
          $('#year-small-image').fadeOut('slow', function() {
               $.post(_url, { year: year_title }, YearPreview.setData, 'json')
           })
        
		  $(this).addClass('active').parent().siblings().children('a').removeClass('active')
	   })

   },
   
   setData: function(response) {
        $('#year-big-image').attr('href', response.image_big).attr('title', response.title)
        $('#year-title').html(response.title)
        $('#year-content').html(response.content)
        $('#year-small-image').attr('src', response.image_small).fadeIn('slow')
   }
}
