var UniformHeightAdjuster = Class.create();
UniformHeightAdjuster.prototype =
{
  initialize: function (opts)
  {
    this._opts =
    {
      elements: []
    };

    Object.extend(this._opts, opts || {});

    $(this._opts.elements);
    this._adjust();
  },

  _adjust: function ()
  {
    var els       = this._opts.elements;
    var elCount   = els.size();
    var maxHeight = this._getMaximumHeight();

    els.each(function (el)
    {
      el.style.minHeight = maxHeight + 'px';

      // a hack for ie, because it doesn't understand min-height
      if (el.offsetHeight < maxHeight)
        el.style.height = maxHeight + 'px';
    });
  },

  _getMaximumHeight: function ()
  {
    var els       = this._opts.elements;
    var elCount   = els.size();
    var maxHeight = 0;

    els.each(function (el)
    {
      var height = el.offsetHeight;

      if (height > maxHeight)
        maxHeight = height;
    });

    return maxHeight;
  }
};

