function ImageCarouselManager ()
{
  var manager = this;
  this.current = -1;
  this.images = new Array();
  $('div.image-carousel a').each(function () {
    this.manager = manager;
    $(this).hide();
    manager.images.push(this);
  })
  this.nextImage();
}
ImageCarouselManager.prototype.nextImage = function ()
{
  if (this.current != -1)
  {
    $(this.images[this.current]).fadeOut();
  }
  this.current = (this.current + 1) % this.images.length;
  $(this.images[this.current]).fadeIn();
  if (this.images.length > 1)
  {
    var t = setTimeout('document.carouselManager.nextImage()', 5000);
  }
}
$(document).ready(function(){
   document.carouselManager = new ImageCarouselManager();
});

