var Layout = new function()
{
  this.Initialize = function()
  {
    this.ResizeBars();
  };
  
  this.ResizeBars = function()
  {
    var containers = $('div.bars');
    
    for (var i = 0; i < containers.length; i++)
    {
      var bars = $(containers[i]).children('div.bar');
      var height = 0;
      
      for (var c = 0; c < bars.length; c++)
      {
        var bar = $(bars[c]);
        
        if (bar.position().top + bar.height() > height)
          height = bar.position().top + bar.height();
      }
      
      for (var c = 0; c < bars.length; c++)
        $(bars[c]).height(height - $(bars[c]).position().top);
    }
  };
};

$(window).load(
  function()
  {
    Layout.Initialize();
  }
);
