
// $VER: global.js WIBOND 1.02 (15.03.2001) Copyright (c) 1997-2001 netminds. All rights reserved.

var Fenster  = false;
var VFenster = false;



function ShowAusland(Sprache, Land)
{
  if (Land != "")
    ShowPage("../partner/" + Sprache + "/land_" + Land + ".html");
}



function ShowInland(Sprache)
{
  var PLZ = document.deutschland.PLZ.value;

  if (CheckInput(Sprache, PLZ))
  {
    var Seite = "../partner/" + Sprache + "/plz_";

    if ((PLZ >= 1000 && PLZ <= 9999) || (PLZ >= 98000 && PLZ <= 99999))
      Seite += "01000";
    else
    {
      if (PLZ >= 20000 && PLZ <= 29999)
        Seite += "wibond";
      else
      {
        if ((PLZ >= 30000 && PLZ <= 34999) || (PLZ >= 37000 && PLZ <= 39999))
          Seite += "wibond";
        else
        {
          if ((PLZ >= 35000 && PLZ <= 36999) || (PLZ >= 55000 && PLZ <= 55999) || (PLZ >= 60000 && PLZ <= 69999))
            Seite += "wibond";
          else
          {
            //if ((PLZ >= 40000 && PLZ <= 47999) || (PLZ >= 50000 && PLZ <= 54999) || (PLZ >= 56000 && PLZ <= 59999))
            if ((PLZ >= 40000 && PLZ <= 54999) || (PLZ >= 56000 && PLZ <= 59999))
              Seite += "40000";
            else
            {
              if ((PLZ >= 70000 && PLZ <= 79999) || (PLZ >= 87000 && PLZ <= 89999))
                Seite += "70000";
              else
              {
                if (PLZ >= 80000 && PLZ <= 86999)
                  Seite += "80000";
                else
                {
                  if (PLZ >= 90000 && PLZ <= 97999)
                    Seite += "90000";
                  else
                    Seite += "wibond";
                }
              }
            }
          }
        }
      }
    }


    Seite += ".html";

    ShowPage(Seite);
  }

  return false;
}



function CheckInput(Sprache, PLZ)
{
  if (PLZ == "" || PLZ == 0 || isNaN(PLZ))
  {
    if (Sprache == "d")
      alert ("Bitte geben Sie eine Zahl zwischen 1 und 99999 ein.");
    else
    {
      if (Sprache == "e")
        alert ("Please enter a number between 1 and 99999.");
    }

    document.deutschland.PLZ.focus();
    return false;
  }
  else
    return true;
}



function CheckLand(Sprache)
{
  var dummy = "";
  var fehler = false;

  var Land = document.anfrage.Land.value;

  for (i=0; i < Land.length; i++)
  {
    dummy = Land.substring(i, i + 1);
    if (!isNaN(dummy)) fehler = true;
  }

  if (fehler)
  {
    if (Sprache == "d")
      alert ("Bitte geben Sie im Feld 'Land' Ihre Länderkennung in Buchstaben ein.");
    else
    {
      if (Sprache == "e")
        alert ("Please enter the code for your country (e.g. GB) in letters only.");
    }

    document.anfrage.Land.focus();
  }

  return !fehler;
}



function ShowFunktion(Sprache, Funktion)
{
  if (Funktion != "")
    ShowPartner(Sprache, "funktion_" + Funktion + ".html");
}



function ShowPerson(Sprache, Person)
{
  if (Person != "")
    ShowPartner(Sprache, "wibond_" + Person + ".html");
}



function ShowPartner(Sprache, Partner)
{
  if (Partner != "")
  {
    if (Sprache.indexOf("../") < 0)
      ShowPage("../partner/" + Sprache + "/" + Partner);
    else
    {
      Woerter = Sprache.split("../");
      ShowPage("../../partner/" + Woerter[1] + "/" + Partner);
    }
  }
}



function ShowVision(Sprache, Vision)
{
  if (Vision != "")
  {
    if (Sprache.indexOf("../") < 0)
      ShowVPage("visions/" + Sprache + "/" + Vision + ".html");
    else
    {
      //Sonderbehandlung da nur von Suche aus angesprochen
      Woerter = Sprache.split("../");
      ShowVPage("../../anwendungen/visions/" + Woerter[1] + "/" + Vision);
    }
  }
}



function ShowAnzeigetechnik(Sprache, Vision)
{
  if (Vision != "")
    ShowVPage("http://www.wibond.de/anwendungen/visions/" + Sprache + "/" + Vision + ".html");
}



function ShowImg(Sprache, Bild)
{
  if (Bild != "")
    ShowPage(Bild + ".html");
}



function ShowSearch(Sprache)
{
  ShowPage(Sprache + "_suche.html");
}



function ShowZertifikat(Sprache, Bild)
{
  if (Bild != "")
  {
    Seite = Sprache + "_" + Bild + ".html";

    if (!Fenster || Fenster.closed)
    {
      Fenster = window.open(Seite, "WibondWin", "width=400,height=550,screenX=15,screenY=140,scrollbars=yes,resizable=yes,hotkeys=yes",dependent="yes");

      if (Fenster) Fenster.moveTo(15, 140);
    }
    else
      Fenster.location.href = Seite;

    if (Fenster) Fenster.focus();
  }
}



function ShowPage(Seite)
{
  if (!Fenster || Fenster.closed)
  {
    Fenster = window.open(Seite, "WibondWin", "width=520,height=550,screenX=15,screenY=140,scrollbars=yes,resizable=yes,hotkeys=yes",dependent="yes");

    if (Fenster) Fenster.moveTo(15, 140);
  }
  else
    Fenster.location.href = Seite;

  if (Fenster) Fenster.focus();
}



function ShowVPage(Seite)
{
  if (!VFenster || VFenster.closed)
  {
    VFenster = window.open(Seite, "WibondWin", "width=740,height=350,screenX=15,screenY=140,scrollbars=yes,resizable=yes,hotkeys=yes",dependent="yes");

    if (VFenster) VFenster.moveTo(15, 140);
  }
  else
    VFenster.location.href = Seite;

  if (VFenster)
    VFenster.focus();
}


