// misst die zum Laden der Seite benötigte Zeit inkl. Anzeige des Seitentitels
loadtimex = new Date()

function loadtime(title) {
  loadtimey = new Date()
  diff = loadtimey.getTime() - loadtimex.getTime()
  newstatus = "Ladezeit: " + diff/1000 + " Sek. [" + title + "]";
  window.defaultStatus = newstatus;
}

// prüft, ob komplettes Frameset geladen ist und lädt es unter Beibehaltung der aktuellen Seite nach
function checkFrameset() {
  if (!parent.nav_left && window.location.hostname == "www.ff-buckenhof.de")
    window.location.href = "http://www.ff-buckenhof.de/index.html?" + window.location.pathname;
}

// Funktion zur Ausführung der Schnellauswahl ("Quickbar")
function Go(select) {
  var val = select.options[select.options.selectedIndex].value;
  var ref = "";

  if (top.parent.frames["mainbody"])
    ref = top.parent.frames["mainbody"];
  else
    ref = top;

  if (val != "nothing") {
    ref.location.href = val;
  }
  select.form.reset();
  ref.focus();
}

// Funktion zum Austauschen von Menübuttons
function ChangeImage(imgSrc, imgNr) {
  document.images[imgNr].src = imgSrc.src;
}

// Funktion zur zentrierten Anzeige eines Bildes in einem neuen Fenster
imgWin = null;

function LoadImage(addr, headline, imgWidth, imgHeight, text) {
  if (!imgWin || imgWin.closed) {
    var posX = (screen.width - imgWidth)/2;
    var posY = (screen.height - imgHeight)/2;

    props = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=" + imgWidth + ",height=" + imgHeight + ",";

    check_for_IE = navigator.appName.indexOf("Microsoft");
    if (check_for_IE == -1)
      props = props + "screenX=" + posX + ",screenY=" + posY;
    else
      props = props + "left=" + posX + ",top=" + posY;

    eval("imgWin = window.open('','imgWin',props);");

    imgWin.focus();
    imgWin.document.open();
    imgWin.document.write('\<html\>\<head\>');
    imgWin.document.write('\<title\>'+headline+'\<\/title\>');
    imgWin.document.write('\<\/head\>');
    imgWin.document.write('\<body text="#000000" bgcolor="#0BA3FD" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" onBlur="self.close()"\>');
    imgWin.document.write('\<a href="JavaScript:self.close()"\>\<img src="'+addr+'" hspace="1" vspace="1" border="0" alt="'+headline+'" title="Zum Schlie&szlig;en ins Bild klicken!"\>\<\/a\>');
    imgWin.document.write('\<div style="font-family:Arial; font-size:12px; text-align:center; background:#C7EBFF; padding:2px;">'+text+'<\/div\>');
    imgWin.document.write('\<\/body\>\<\/html\>');
    imgWin.document.close()
  }
  else {
    imgWin.focus();
  }
}

// schreibt die Fußzeile der FF Buckenhof-Seiten
function writeFooter() {
  document.write('<table border="0" align="center">');
  document.write('<tr>');
  document.write('<td class="navi" align="center">[');
  if(window.location.pathname!="/home_main.html")
    document.write('<a href="' + depth + 'home_main.html">Startseite</a>');
  else
    document.write('Startseite');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/aktuell/index.html")
    document.write('<a href="' + depth + 'aktuell/index.html">Aktualisierungen</a>');
  else
    document.write('Aktualisierungen');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/kalender/index.html")
    document.write('<a href="' + depth + 'kalender/index.html">Termine</a>');
  else
    document.write('Termine');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/fahrzeuge/index.html")
    document.write('<a href="' + depth + 'fahrzeuge/index.html">Fahrzeugshow</a>');
  else
    document.write('Fahrzeugshow');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/veranst/index.html")
    document.write('<a href="' + depth + 'veranst/index.html">Veranstaltungen</a>');
  else
    document.write('Veranstaltungen');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/jugend/index.html")
    document.write('<a href="' + depth + 'jugend/index.html">Jugend</a>');
  else
    document.write('Jugend');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/einsaetze/2010/einsaetze2010.html")
    document.write('<a href="' + depth + 'einsaetze/2010/einsaetze2010.html">Einsätze</a>');
  else
    document.write('Einsätze');
  document.write(']&nbsp; <nobr>[');
  if(window.location.pathname!="/landkreis/index.html")
    document.write('<a href="' + depth + 'landkreis/index.html">JF Landkreis ERH</a>');
  else
    document.write('JF Landkreis ERH');
  document.write(']</nobr>&nbsp; [');
  if(window.location.pathname!="/brand_main.html")
    document.write('<a href="' + depth + 'brand_main.html">Brandschutztipps</a>');
  else
    document.write('Brandschutztipps');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/specials/index.html")
    document.write('<a href="' + depth + 'specials/index.html">Specials</a>');
  else
    document.write('Specials');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/kontakt/index.html")
    document.write('<a href="' + depth + 'kontakt/index.html">Kontakt</a>');
  else
    document.write('Kontakt');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/guestbook/index.html")
    document.write('<a href="' + depth + 'guestbook/index.html">Gästebuch</a>');
  else
    document.write('Gästebuch');
  document.write(']&nbsp; [');
  if(window.location.pathname!="/kontakt/impressum.html")
    document.write('<a href="' + depth + 'kontakt/impressum.html">Impressum</a>');
  else
    document.write('Impressum');
  document.write(']</td>');
  document.write('</tr>');
  document.write('</table>');
}
