function LogoRotation(logo_list_id) {
  this.hidden_logos = new Array();
  this.visible_logos = new Array();
  
  this.visible_logos = $$('#' + logo_list_id + ' img');
  
  LogoRotation.prototype.add = function(src, alt) {
    logo = new Image();
    logo.src = src;
    logo.alt = alt;
    this.hidden_logos.push(logo);
  }
  
  LogoRotation.prototype.swap = function(newOne, oldOne) {
    this.hidden_logos[newOne].src = this.visible_logos[oldOne].src;
    this.hidden_logos[newOne].alt = this.visible_logos[oldOne].alt;
  }
  
  LogoRotation.prototype.next = function() {
    var pos_oldLogo = Math.floor(Math.random() * this.visible_logos.length);
    var pos_newLogo = Math.floor(Math.random() * this.hidden_logos.length);
    
    var logo = this.visible_logos[pos_oldLogo];
    
    var new_logo = new Array();
    new_logo['src'] = this.hidden_logos[pos_newLogo].src;
    new_logo['alt'] = this.hidden_logos[pos_newLogo].alt;
    new_logo['width'] = this.hidden_logos[pos_newLogo].width;
    
    this.swap(pos_newLogo,pos_oldLogo);
    
    new Effect.Fade(logo, {afterFinish:
      function() {
        logo.src = new_logo['src'];
        logo.alt = new_logo['alt'];
        logo.width = new_logo['width'];
        new Effect.Appear(logo);
      }
    });
  }
}