function skin_grow_cms_page_columns(num_columns, col_ids) {
  var setHeight = function(el, val) { el.style.height = val ? val + 'px' : ''; },
    absOffY = function(el) { return el.absoluteOffset()[1]; },
    contentEl = $('content'),
    col1El = $('col1'),
    innerColEls = col_ids.collect(function(c) { return $('col_'+num_columns+'_'+c); });
  
  if(innerColEls.include(null))
    innerColEls = [];
  
  setHeight(col1El);
  setHeight(contentEl);
  innerColEls.each(function(c) { setHeight(c); });
  
  if(innerColEls.length > 0) {
    var height = innerColEls.collect(function(c) { return c.getHeight(); }).max();
    innerColEls.each(function(c) { setHeight(c, height); });
  }
  
  var bodyHeight = $(document.body).getHeight(),
    viewportHeight = document.viewport.getHeight(),
    col1Height = col1El.getHeight();
  
  if(viewportHeight >= bodyHeight || viewportHeight < col1Height + absOffY(col1El)) {
    var contentHeight = contentEl.getHeight(),
      pad = bodyHeight - contentHeight;
    setHeight(contentEl, [col1Height, viewportHeight - pad, contentHeight].max());
  }
  setHeight(col1El, contentEl.getHeight() + absOffY(contentEl) - absOffY(col1El) - 60);
  
  return false;
}

function skin_grow_message_columns(offset) {
  if(Prototype.Browser.IE)
    $('frame_top').style.height = '200px';
  
  var col1_el = $('col1');
  if(col1_el) {
    var cols = [col1_el,$('col2')];
  } else if($('widecol')) {
    var cols = [$('widecol')];
  } else {
    return false;
  }
  var height = 0;
  cols.each(function(col) {
    try {
      col.style.height = '';
      col_height = col.getHeight();
      height = (col_height > height ? col_height : height);
    } catch(err) {}
  });
  if(Object.isNumber(offset))
    height = height + offset;
  try {
    if(col1_el)
      $(cols[0]).style.height = height - 35 + 'px';
   $('frame_bottom').style.height = height + 150 + 'px';
  } catch(err) {}
  
  if(Prototype.Browser.IE && Prototype.BrowserVersion < 7)
    $$('ul.subtabmenu').invoke('setStyle', {margin:'-10px 5px 5px'});
}

function skin_grow_calendar_columns() {
  skin_grow_message_columns(-40);
}
