// layout.js
// Cross-Browser.com & SitePoint.com - Equal Column Height Demo

if (document.getElementById || document.all) { // minimum dhtml support required
  window.onload = winOnLoad;
}

function winOnLoad()
{
  var ele = xGetElementById('leftmenu-design');
  if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    adjustLayout();
    xAddEventListener(window, 'resize', winOnResize, false);
  }
}
function winOnResize()
{
  adjustLayout();
}
function adjustLayout()
{
  // Get content heights
  var cHeight = xHeight('maincontent-design');
  var lHeight = xHeight('leftmenu-design');
  var rHeight = xHeight('rightmenu');

  // Find the maximum height
  var maxHeight = Math.max(cHeight, Math.max(lHeight, rHeight));

  // Assign maximum height to all columns
  xHeight('leftmenu-design', maxHeight);
  xHeight('rightmenu', maxHeight);
  xHeight('maincontent-design', maxHeight);


  // Show the footer
  xShow('footer');
}

window.onload = winOnLoad;