$(document).ready(function() {
  /**
   * Determine the height of the largest banner and set the container to
   * be that height plus a little padding.
   */
  var $slideshow = $('#homebanners ul'),
    max_height = 0, padding = 10;

  $slideshow.find('img').one('load', function() {
    var height = $(this).attr('height') || $(this).height();

    if (height > max_height) {
      $slideshow.css('height', ((max_height = height) + padding)+'px !important');
    }
  }).each(function() {
    if (this.complete) {
      $(this).trigger('load');
    }
  });

  $slideshow.cycle();
});
