// 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>");
  window.onload = winOnLoad;
}
*/

function colAdjustOnLoad()
{  
  var ele = xGetElementById('side');
  if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    adjustLayout();
    xAddEventListener(window, 'resize', winOnResize, false);
  }
}

function spawnColAdjustOnLoad()
{
	setTimeout ("colAdjustOnLoad", 1000);
}

function winOnResize()
{
  adjustLayout();
}
function adjustLayout()
{  
  // Get content heights
  var bHeight = xHeight("banner");
  var cHeight = xHeight("content");  
  var sHeight = xHeight("side"); 
  var tHeight = bHeight + cHeight
  //alert(bHeight)
  //alert(cHeight)
  ////alert(sHeight)
  //alert(tHeight)

  // Find the maximum height
  var maxHeight = Math.max(tHeight, sHeight);

  // Assign maximum height to all columns
  xHeight('side', maxHeight);
  xHeight('content', maxHeight - bHeight);
  
  // Show the footer
  xShow('footer');
}

