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

if (document.getElementById || document.all) { // minimum dhtml support required
  window.onload = winOnLoad;
}
function winOnLoad()
{
  var ele = xGetElementById('levo_sadrzaj');
  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('sredina_sadrzaj');
  var lHeight = xHeight('levo_sadrzaj');
  var rHeight = xHeight('desno_sadrzaj');

  // Find the maximum height
  var maxHeight = Math.max(cHeight, Math.max(lHeight, rHeight));
  
  // Test
  // window.alert(maxHeight);

  // Assign maximum height to all columns
  xHeight('levo', maxHeight);
  xHeight('sredina', maxHeight);
  xHeight('desno', maxHeight);

}

