// layout3.js
// Cross-Browser.com & SitePoint.com - Equal Column Height Demo (3 Column)

if (document.getElementById || document.all) { // minimum dhtml support required
  document.write("<"+"style type='text/css'>#footer{visibility:hidden;}<"+"/style>");
  xAddEventListener(window, 'load', winOnLoad, false);
}
function winOnLoad()
{
  var ele = xGetElementById('left_col');
  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('center_Content');
  var lHeight = xHeight('left_Content');
  var rHeight = xHeight('right_Content');
  
  

  // Find the maximum height
  var maxHeight = Math.max(cHeight, Math.max(lHeight, rHeight));
  
  if (maxHeight < 400) {
  	maxHeight = 400;
  }

  // Assign maximum height to all columns
  xHeight('left_col', maxHeight);
  xHeight('center_3col', maxHeight);
  xHeight('right_3col', maxHeight);

  // Show the footer
  xGetElementById('footer').style.visibility = 'visible';
}
