function calcHeight(optContentHeight) {
  var mcw = $('mainContainerWrapper');
  var mc = $('mainContainer');
  var cw = $('contentWrapper');
   
  mcw.setStyle('height', 'auto');
  mc.setStyle('height', '100%');
  cw.setStyle('height', '100%');
  
  var mcwHeight = mcw.getSize().size.y;
  var winHeight = window.getSize().size.y;
    
  if (optContentHeight === undefined) {
    var mcwHeightSafe = new Element('div', {'id':'contentHeight','style':'display:none;'}).setText(mcwHeight).injectAfter(mcw);
  } else {
    mcwHeight = optContentHeight;
  }

  //var myTime = $time(); 
  var minHeight = Math.max(winHeight, 25+eval(mcwHeight));
  document.cookie="des_minheight="+winHeight+"; domain="+desCookieDomain+"; path=/";
  mcw.setStyle('height', minHeight);
  mc.setStyle('height', minHeight);
  cw.setStyle('height', minHeight);
	// fix height of mainMenuWrapper (was only a problem with Opera, but doesn't hurt the other brothers)
  $('mainMenuWrapper').setStyle('height', minHeight-$('contentWrapper').getStyle('padding-top').toInt());
  
  //$('headerImage').setText('Timestamp='+myTime+'\nwinHeight='+winHeight+'\nmcwHeight='+mcwHeight+'\nminHeight='+minHeight) ;
  
  // position relativ bug (kein markieren möglich) vom IE6 => nur position relative wenn fenster schmäler wird
  //if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) <= 4) {
  if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf('MSIE 6') != -1) {
    if (window.getSize().size.x < mcw.getSize().size.x ) {
      mcw.setStyle('position', 'relative');
      mcw.setStyle('margin-left', 0);    
    } else {
      mcw.setStyle('position', 'absolute');
      mcw.setStyle('margin-left', '-496px');    
    }
  }
}  
  
window.addEvent('domready', function() {
  calcHeight();
});
  
window.addEvent('resize', function() {calcHeight($('contentHeight').getText());});
