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));
  
  return false;
}

function skin_grow_message_columns(offset) {
  if($('col1')) {
    var cols = ['col1','col2'];
  } else if($('widecol')) {
    var cols = ['widecol'];
  } else {
    return false;
  }
  try {
    if(typeof(offset) != 'number') { offset = 65; }
    var height = document.viewport.getDimensions().height - offset;
    if($(cols[0])) {
      height -= Position.cumulativeOffset($(cols[0]))[1];
    }
  } catch(err) {}
  cols.each(function(col) {
    try {
      $(col).style.height = '';
      col_height = Element.getDimensions(col).height;
      height = (col_height > height ? col_height : height);
    } catch(err) {}
  });
  try {
    if($('col1')) { $(cols[0]).style.height = height - 5 + 'px'; }
    $('content').style.height = height + 20 + 'px';
  } catch(err) {}
}

function skin_grow_calendar_columns() {
  skin_grow_message_columns(100);
}