function switchBanner() {
  var $active = $('#banners .banner:visible');

  var $next =  $active.next('.banner').length ? $active.next('.banner')
      : $('#banners .banner:first');

  $next.fadeIn(1000);
  $active.fadeOut(1000);
}

$(document).ready(function(){

  if ($('#banners .banner').length > 1) {
    setInterval( 'switchBanner()', 8000 );
  }

  $(".images a.corners").fancybox({
   'padding':15,
   'hideOnContentClick': false,
   'overlayOpacity': 0.4,
   'overlayColor': '#000',
   frameWidth: 500,
   frameHeight: 300,
   imageScale: true
  });

  if (($('.rightcol .content').outerHeight()) < $('.leftcol .sidecontent-wrapper').outerHeight()+30) {
    $('.rightcol .content').height($('.leftcol .sidecontent-wrapper').outerHeight()+30);
  }

  $('#archive ul:not(.default)').hide();

  $('#archive h3').click(function(){
    $('#archive ul').hide();
    $(this).next('ul').show();
  });

  $("tr:odd").addClass('odd');
  $("tr.:first-child").addClass('heading');
  $("tr:last-child").addClass('last');
  $('td:last-child').addClass('last-col')
  $("td:nth-child(1), th:nth-child(1)").addClass('col1');
  $("td:nth-child(2), th:nth-child(2)").addClass('col2');
  $("td:nth-child(3), th:nth-child(3)").addClass('col3');
});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-64438-4']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
