/**
 * ----------------------------------------------------------------------------
 * Copyright notice
 * (c) IN·TAKT Media GmbH
 * All rights reserved
 * http://www.intakt.net/
 * info@intakt.net
 * ----------------------------------------------------------------------------
 */

//alert(document.compatMode);

var maxHeightInit = 0;
var maxHeight = 0;

if (document.getElementById || document.all) addLoadEvent(adjustLayout);
if (document.getElementById || document.all) addResizeEvent(adjustLayout);

function adjustLayout() {
  var h1, h2, h3, h4;
  h1 = xClientHeight() - xHeight('lHeader') - xHeight('lNavTop');
  if (xOp7Up) h1 -= 10;
  if (maxHeightInit == 0)
  {
    h2 = xHeight('lNavMain');
    h3 = xHeight('lContent');
    h4 = xHeight('lMarginal');
    maxHeightInit = Math.max(h2, Math.max(h3, h4));
  }
  maxHeight = Math.max(h1, maxHeightInit);
  xHeight('lNavMain',maxHeight);
  xHeight('lContent',maxHeight);
  xHeight('lMarginal',maxHeight);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') window.onload = func;
  else window.onload = function() { oldonload(); func(); }
}

function addResizeEvent(func) {
  var oldonresize = window.onresize;
  if (typeof window.onresize != 'function') window.onresize = func;
  else window.onresize = function() { oldononresize(); func(); }
}