function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

/* Überwachung von Netscape initialisieren*/
if (!window.alteWeite && window.innerWidth) {
  window.onresize = neuAufbau;
  Weite = Fensterweite();
  Hoehe = Fensterhoehe();
  DivHeight = Hoehe - 150;
}

function neuAufbau () {
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
    //location.href = location.href;
    //window.location.href = 'main.php?dh=' + screen.width + 'x' + screen.height;
    // window.location.href = location.pathname + '?dh=' + DivHeight + '&n='<?php echo $n; ?>; 
    window.location.href = location.pathname + '?dh=' + DivHeight; 
    }

