
window.defaultStatus=" ";

function initAlles ()
{
  if (this.frames.Navigator) {
    this.frames.Navigator.initAlles();
  } else {
    alert("verloren");
  }
  sagsMir("I");
}


function sagsMir (wer)
{
  /*
  alert(wer + ": Fenstergröße=" +
        window.innerWidth + "|" + window.innerHeight);
  */
}


function treatResize ()
{
  // alert("treatResize");
  // checkSize(false);
}

function treatLoad () {
  // alert("treatLoad");
  // if (document.layers) {
  if (browserType()==1) {
    frames.Navigator.location="/Navigator-nn.html";
  } else if (browserType()==2) {
    frames.Navigator.location="/Navigator-wx.html";
  } else {
    // alert("Lade Navigation für Mozilla ... ");
    frames.Navigator.location="/Navigator-mz.html";
  }
  // alert("Klassifikation: " + browserType());
  // checkSize(false);
  if (browserType()==0) {
    // alert("Alter Browser ");
    var lhref = "http://nof.RosemarieKoedel.de" + location.pathname;
    // alert("Gehe " + lhref);
    location.href = "http://nof.RosemarieKoedel.de" + location.pathname;
  } else {
    /* alert(
       "Neuer Browser: '" + navigator.appName +
       "'\nVersion: '" + navigator.appVersion + "'"); */
    findeZielSeite();
  }
}


function checkSize (firstTime)
{
  sagsMir("C");
  if (navigator.appName.substring(0,8) == "Netscape") {
    /*
      alert("Oje, Netscape! " + window.outerWidth + " | " + 
      window.outerHeight);
    */
    var zahl = 0;
    for (iGitt=0; iGitt<mv_breiten.length; iGitt++) {
      if (mv_breiten[iGitt]<=window.innerWidth) zahl = iGitt;
    }
    // alert("Breite[" + zahl + "]=" + mv_breiten[zahl]);
    if (window.innerWidth==mv_breiten[zahl]) {
      // alert("Glück gehabt");
    } else {
      /* alert("Verändere Größe: " +
            (window.outerWidth - window.innerWidth + mv_breiten[zahl]) +
            " | " +
            window.outerHeight); */
      resizeTo(window.outerWidth - window.innerWidth + mv_breiten[zahl],
               window.innerHeight);
      firstTime = true;
    }
  }
  if (firstTime) {
    this.frames.Navigator.initAlles();
  }

}

var mv_breiten =
  // die Liste enthält die Fensterbreiten (window.innerWidth), die
  // jeweils optimal sind
  [ 674,  690,  707,
    725,  743,  763,
    783,  805,  828,
    852,  878,  906,
    935,  966, 1000,
   1035, 1074, 1115,
   1160, 1208, 1260];


function findeZielSeite () {
  if ( (top.location.href.indexOf("?thema=") > 0) ) {
    // alert("aktuelles Thema vorgegeben");
    var lv_pfad =
      top.location.href.substr(top.location.href.indexOf("?")+7,
                               top.location.href.length);
    // alert(lv_pfad);
    top.frames.Inhalt.location.href = lv_pfad;
  } else {
    var Anhang0 = top.location.hash;
    // falls nix hinterm # steht, mache nix; früher: ab zur neuen
    // Index-Seite, um diese Abfrage fuerderhin zu sparen
    if ( Anhang0 == "" ) {
      //top.frames.Inhalt.location.href = "./start.html"
    } else if ( ( Anhang0.indexOf("Willkommen") != -1 ) ||
              ( Anhang0.indexOf("willkommen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./start.html"
    } else if ( ( Anhang0.indexOf("AV-Beispiele") != -1 ) ||
              ( Anhang0.indexOf("av-beispiele") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Kapitalbedarf.html"
    } else if ( ( Anhang0.indexOf("AV-Besteuerung") != -1 ) ||
              ( Anhang0.indexOf("av-besteuerung") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Besteuerung.html"
    } else if ( ( Anhang0.indexOf("AV-Direkt-GmbH") != -1 ) ||
              ( Anhang0.indexOf("av-direkt-gmbh") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/GGF-Versorgung/index.html"
    } else if ( ( Anhang0.indexOf("AV-Direkt") != -1 ) ||
              ( Anhang0.indexOf("av-direkt") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Betrieblich/Direkt-Gehalt.html"
    } else if ( ( Anhang0.indexOf("AV-Firma") != -1 ) ||
              ( Anhang0.indexOf("av-firma") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Betrieblich/Direkt-Firma.html"
    } else if ( ( Anhang0.indexOf("AV-Handwerker") != -1 ) ||
              ( Anhang0.indexOf("av-handwerker") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Handwerkerversorgung/Info.html"
    } else if ( ( Anhang0.indexOf("AV-Info") != -1 ) ||
              ( Anhang0.indexOf("av-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Privat.html"
    } else if ( ( Anhang0.indexOf("AV-Kassen") != -1 ) ||
              ( Anhang0.indexOf("av-kassen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Betrieblich/Kassen.html"
    } else if ( ( Anhang0.indexOf("AV-Pension-GmbH") != -1 ) ||
              ( Anhang0.indexOf("av-pension-gmbh") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/GGF-Versorgung/Pensionszusage.html"
    } else if ( ( Anhang0.indexOf("AV-Pension") != -1 ) ||
              ( Anhang0.indexOf("av-pension") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Betrieblich/Pension.html"
    } else if ( ( Anhang0.indexOf("AV-Reformen") != -1 ) ||
              ( Anhang0.indexOf("av-reformen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/Rentenreform.html"
    } else if ( ( Anhang0.indexOf("AV") != -1 ) ||
              ( Anhang0.indexOf("av") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Altersvorsorge/index.html"
    } else if ( ( Anhang0.indexOf("KV-Gesetzlich-Fristen") != -1 ) ||
              ( Anhang0.indexOf("kv-gesetzlich-fristen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/Kuendigung.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Alle") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-alle") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Alle.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Baden-Wuerttemberg") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-baden-wuerttemberg") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Baden-Wuerttemberg.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Bayern") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-bayern") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Bayern.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Berlin") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-berlin") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Berlin.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Brandenburg") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-brandenburg") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Brandenburg.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Bremen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-bremen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Bremen.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Hamburg") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-hamburg") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Hamburg.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Hessen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-hessen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Hessen.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Info") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Landkarte.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Mecklenburg-Vorpommern") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-mecklenburg-vorpommern") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Mecklenburg-Vorpommern.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Niedersachsen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-niedersachsen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Niedersachsen.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Nordrhein-Westfalen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-nordrhein-westfalen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Nordrhein-Westfalen.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Rheinland-Pfalz") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-rheinland-pfalz") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Rheinland-Pfalz.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Saarland") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-saarland") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Saarland.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Sachsen-Anhalt") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-sachsen-anhalt") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Sachsen-Anhalt.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Sachsen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-sachsen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Sachsen.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Schleswig-Holstein") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-schleswig-holstein") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Schleswig-Holstein.html"
    } else if ( ( Anhang0.indexOf("KV-BKK-Thueringen") != -1 ) ||
              ( Anhang0.indexOf("kv-bkk-thueringen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/BKK/Thueringen.html"
    } else if ( ( Anhang0.indexOf("KV-Ersatzkassen") != -1 ) ||
              ( Anhang0.indexOf("kv-ersatzkassen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/Ersatzkassen.html"
    } else if ( ( Anhang0.indexOf("KV-Gesetzlich-Info") != -1 ) ||
              ( Anhang0.indexOf("kv-gesetzlich-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/Moeglichkeiten.html"
    } else if ( ( Anhang0.indexOf("KV-Gesetzlich-Reform") != -1 ) ||
              ( Anhang0.indexOf("kv-gesetzlich-reform") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesundheitsreform.html"
    } else if ( ( Anhang0.indexOf("KV-Student-Info") != -1 ) ||
              ( Anhang0.indexOf("kv-student-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Studenten.html"
    } else if ( ( Anhang0.indexOf("KV-Gesetzlich") != -1 ) ||
              ( Anhang0.indexOf("kv-gesetzlich") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Gesetzlich/index.html"
    } else if ( ( Anhang0.indexOf("KV-Privat-Fristen") != -1 ) ||
              ( Anhang0.indexOf("kv-privat-fristen") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Privat/Kuendigung.html"
    } else if ( ( Anhang0.indexOf("KV-Privat-Gesetz") != -1 ) ||
              ( Anhang0.indexOf("kv-privat-gesetz") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Privat/Gesetz.html"
    } else if ( ( Anhang0.indexOf("KV-Privat-Info") != -1 ) ||
              ( Anhang0.indexOf("kv-privat-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Privat/Gegenueberstellung.html"
    } else if ( ( Anhang0.indexOf("KV-Privat") != -1 ) ||
              ( Anhang0.indexOf("kv-privat") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/Privat/index.html"
    } else if ( ( Anhang0.indexOf("KV") != -1 ) ||
              ( Anhang0.indexOf("kv") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Krankenversicherung/index.html"
    } else if ( ( Anhang0.indexOf("SI-Impressum") != -1 ) ||
              ( Anhang0.indexOf("si-impressum") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./ImpressumEtc/Impressum.html"
    } else if ( ( Anhang0.indexOf("SI-Kontakt") != -1 ) ||
              ( Anhang0.indexOf("si-kontakt") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./ImpressumEtc/Impressum.html"
    } else if ( ( Anhang0.indexOf("SI-Rosemarie") != -1 ) ||
              ( Anhang0.indexOf("si-rosemarie") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./ImpressumEtc/Rosemarie.html"
    } else if ( ( Anhang0.indexOf("SI") != -1 ) ||
              ( Anhang0.indexOf("si") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./ImpressumEtc/Rosemarie.html"
    } else if ( ( Anhang0.indexOf("BU-Info") != -1 ) ||
              ( Anhang0.indexOf("bu-info") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Berufsunfaehigkeit/index.html"
    } else if ( ( Anhang0.indexOf("BU") != -1 ) ||
              ( Anhang0.indexOf("bu") != -1 ) ) {
      top.frames.Inhalt.location.href =
         "./Berufsunfaehigkeit/index.html"
    } else {
      // top.frames.Inhalt.location.href = "./start.html"
    }
  }
}


function isOldieDeprecated () {
  var lv_oldie = false;
  if (document.layers) {
    // Netscape:
    if (parseInt(navigator.appVersion.substring(0,1))>=4) {
      // sollte okay sein
      lv_oldie = false;
    } else {
      // klappt wohl weniger
      lv_oldie = true;
    }
  } else {
    // Winzigweich
    if (parseInt(navigator.appVersion.substring(0,1))>=4) {
      // sollte okay sein
      lv_oldie = false;
    } else {
      // klappt wohl weniger
      lv_oldie = true;
    }
  }
  // alert ("Oldie? "+lv_oldie);
  // und jetzt umleiten:
  return lv_oldie;
}

function browserType () {
   var lv_type = 0;
   // @returns int with following meaning:
   // 0: redirection to nof inevitable
   // 1: netscape version 4
   // 2: microsoft version 4
   // 3: mozilla version 5 or higher
   if (navigator.appName == "Netscape") {
      // Netscape/Mozilla
      if (parseInt(navigator.appVersion.substring(0,1))==4) {
         lv_type = 1;
      } else if (parseInt(navigator.appVersion.substring(0,1))>4) {
         lv_type = 3;
      } else {
         lv_type = 0;
      }
   } else {
      // Winzigweich
      if (parseInt(navigator.appVersion.substring(0,1))>=4) {
         lv_type = 2;
      } else {
         lv_type = 0;
      }
   }
   return lv_type;
}
    
