function slideHeaders() {
  var $active = $('#image-rotation img.active');
  if ($active.length == 0 ) {
    $active = $('#image-rotation img:last');
  } 

  // get the next image
  if ($active.next().length) {
    $next = $active.next();
  } else {
    $next = $('#image-rotation img:first');
  } 

  $active.addClass('last-active');
  $next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
      $active.removeClass('active last-active');
    });
    
  return true;
}

$(function() {
  setInterval("slideHeaders()", 5000);
});
