/* Javascriptdatei für die Seiten der Freiwilligen Feuerwehr Oyten */
/* Erstellt von Alf Hoheisel */

var fen_hoehe;

function Bildwechsel (Bildname, Bildobjekt) {
  document.getElementById(Bildname).src = Bildobjekt;
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.documentElement.clientHeight) {
    return document.documentElement.clientHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}

function Dynhoehe () {
  var neu_hoehe;

  fen_hoehe = Fensterhoehe();
  neu_hoehe = fen_hoehe - document.getElementById('kopf').offsetHeight - document.getElementById('kopf2').offsetHeight - document.getElementById('fuss').offsetHeight - 25;
  if (neu_hoehe < 200) neu_hoehe = 200;
  neu_hoehe = neu_hoehe + 'px';
  if (document.getElementById('navi')) document.getElementById('navi').style.height = neu_hoehe;
  if (document.getElementById('inhalt')) document.getElementById('inhalt').style.height = neu_hoehe;
  if (document.getElementById('galerie')) document.getElementById('galerie').style.height = neu_hoehe;
}

function neuAufbau () {
  if (fen_hoehe != Fensterhoehe()) {
    location.href = location.href;
//    Dynhoehe();
  }
}

window.onload = function () { if(previousOnload) previousOnload(); addReflections(); Dynhoehe(); }
window.onresize = function () { if(!previousOnresize) neuAufbau(); }
var previousOnresize = window.onresize;
//fen_hoehe = Fensterhoehe ();
