// layout2.js
// Cross-Browser.com & SitePoint.com - Equal Column Height

if (document.getElementById || document.all) { // minimum dhtml support required
  document.write("<"+"script type='text/javascript' src='../javascript/x_core.js'><"+"/script>");
  document.write("<"+"script type='text/javascript' src='../javascript/x_event.js'><"+"/script>");
  document.write("<"+"style type='text/css'>#thinline-footer{visibility:hidden;}<"+"/style>");
  window.onload = winOnLoad;
}

function winOnLoad()
{
  var ele = xGetElementById('navigation');
  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 nHeight = xHeight('navigationContent');
  var cHeight = xHeight('contentContent');
  var rHeight = xHeight('rightColumnContent');

  // Find the maximum height
  var maxHeight = Math.max(nHeight, cHeight);

  // Assign maximum height to all columns
  xHeight('navigation', maxHeight);
  xHeight('content', maxHeight);
  xHeight('rightColumn', maxHeight);

  // Show the footer
  xShow('thinline-footer');
}

