function loadOverlays() {
  var pic0 = document.getElementById('p0');
  var pic1 = document.getElementById('p1');
  var pic2 = document.getElementById('p2');
  var pic3 = document.getElementById('p3');
  var pic4 = document.getElementById('p4');
    var fb = document.getElementById('frontBox');
  if(fb != null) {  
    var o0 = document.getElementById('o0');
    var o1 = document.getElementById('o1');
    var o2 = document.getElementById('o2');
    var o3 = document.getElementById('o3');
    var o4 = document.getElementById('o4');
    
    var x0 = getX(pic0);
    var y0 = getY(pic0);
    var x1 = getX(pic1);
    var y1 = getY(pic1);
    var x2 = getX(pic2);
    var y2 = getY(pic2);
    var x3 = getX(pic3);
    var y3 = getY(pic3);
    var x4 = getX(pic4);
    var y4 = getY(pic4);      
   
    o0.style.top = y0 + 6 + 'px';
    o0.style.left = x0 + 'px';
    o0.style.display = 'block';
    o1.style.position = 'absolute';
    o1.style.top = y1 + 6 + 'px';
    o1.style.left = x1 + 'px';
    o1.style.display = 'block';
    o2.style.position = 'absolute';
    o2.style.top = y2 + 6 + 'px';
    o2.style.left = x2 + 'px';
    o2.style.display = 'block';
    o3.style.position = 'absolute';
    o3.style.top = y3 + 6 + 'px';
    o3.style.left = x3 + 'px';
    o3.style.display = 'block';
    o4.style.position = 'absolute';
    o4.style.top = y4 + 6 + 'px';
    o4.style.left = x4 + 'px';
    o4.style.display = 'block';
  }
}

function getX(el) {
    x = el.offsetLeft;
    if (!el.offsetParent) return x;
    else return (x+getX(el.offsetParent));
}

function getY (el) {
    y = el.offsetTop;
    if (!el.offsetParent) return y;
    else return (y+getY(el.offsetParent));
}

function removeOverlay(el) {  
  var fb = document.getElementById('frontBox');
  if(fb != null) {  
    if(typeof el != 'object') {
       document.getElementById(el).style.display = 'none'; 
    } else {
      el.style.display = 'none';
    } 
  }
}
function showOverlay(el) {
  var fb = document.getElementById('frontBox');
  if(fb != null) {  
     if(typeof el != 'object') {
       document.getElementById(el).style.display = 'block'; 
     } else {
       el.style.display = 'block';
     } 
  }
}

function initResizeObserve() {
  if (!window.Weite && document.body && document.body.offsetWidth) {
    window.onresize = neuAufbau;
    Weite = Fensterweite();
    Hoehe = Fensterhoehe();
  } 
}

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;
  }
}

function neuAufbau () {
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
    location.href = location.href;
}

/* Überwachung von Netscape initialisieren */
if (!window.Weite && window.innerWidth) {
  window.onresize = neuAufbau;
  Weite = Fensterweite();
  Hoehe = Fensterhoehe();
}
