// layout2.js
// Cross-Browser.com & SitePoint.com - Equal Column Height Demo (2 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('sideMenu');
  if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    adjustLayout();
    //xAddEventListener(window, 'resize', adjustLayout, false);
  }
}


function adjustLayout()
{
  // Get content heights
  var pLeftHeight = xHeight('middleHomeLeft');
  var pRightHeight = xHeight('middleHomeRight');
  var pCenterHeight = xHeight('middle');
	
  // Find the maximum height
  var maxHeight = Math.max(pLeftHeight, pCenterHeight, pRightHeight);
  // Assign maximum height to all columns
  
  xHeight('middleHomeLeft', maxHeight);
  xHeight('middleHomeRight', maxHeight);
  xHeight('middle', maxHeight+40);

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