function auswahl1(dat)
{
hinzufuegen();
F1 = window.open(dat,"auswahl","width=500,height=550,left=0,top=0,scrollbars=yes");
F1.focus();
}

function auswahl2(dat)
{
F1 = window.open(dat,"auswahl","width=500,height=600,left=0,top=0,scrollbars=yes");
F1.focus();
}

function ueberpruefen(theForm)
{
  var adresse = true;
  var email = true;
  if ((theForm.name.value == "") | (theForm.strasse.value == "") | (theForm.ort.value == "")) adresse = false;
  if (theForm.email.value == "") email = false;
  if (adresse == false & email == false)
    {
      alert ("Sowohl die Adressfelder als auch die Emailadresse \n" +
               "ist nicht vollständig ausgefüllt. Füllen Sie zumindest \n" +
               "die Adressfelder vollständig aus");
      return (false);
    }

  if (adresse == false & email == true)
    {
       alert ("Eines oder mehrere der Adressfelder ist noch leer. \n" +
               "Füllen Sie bitte alle Adressfelder vollständig aus.");
       return (false);
     }
  if (adresse == true & email == false)
    if (confirm("Die Emailadresse ist nicht ausgefüllt. Wenn Sie\n" +
                   "die Email trotzdem absenden wollen, klick Sie auf OK. \n" +
                   "Wenn Sie die Emailadresse noch eingeben \n" +
                   "wollen, klicken Sie auf abbrechen") == false)
    return (false);
  if (theForm.email.value == "") theForm.email.value = "info@wehrpflicht-nein-danke.de";
  return (true);
}

function vorschau(datei)
{
hinzufuegen();
F1 = window.open("vorschau.htm","vorschau","width=600,height=500,left=0,top=0,scrollbars=yes");
}

function vorschau17(datei)
{
hinzufuegen();
F1 = window.open("vorschau17.htm","vorschau","width=600,height=500,left=0,top=0,scrollbars=yes");
}

function adresse_einfuegen()
{
  var pos;
  var adress  = new String (holeCookie("adresse"));

  pos = adress.indexOf(";");
  document.adresse.Name.value = adress.substring(0,pos);
  adress = adress.substring(pos+2,adress.length);

  pos = adress.indexOf(";");
  document.adresse.Strasse.value = adress.substring(0,pos);
  adress = adress.substring(pos+2,adress.length);

  pos = adress.indexOf(";");
  document.adresse.Ort.value = adress.substring(0,pos);
  adress = adress.substring(pos+2,adress.length);

  pos = adress.indexOf(";");
  document.adresse.Telefon.value = adress.substring(0,pos);
  adress = adress.substring(pos+2,adress.length);

  pos = adress.indexOf(";");
  document.adresse.EMail.value = adress.substring(0,pos);
}

function holeCookieWert(position)
{
  var ende = document.cookie.indexOf (";", position);
  if (ende == -1)
    ende = document.cookie.length;
  return unescape(document.cookie.substring(position, ende));
}

function holeCookie(name)
{
  name += "=";
  var laenge = name.length;
  var cookie_laenge = document.cookie.length;

  var i = 0;
  while (i < cookie_laenge) {
    var j = i + laenge;
    if (document.cookie.substring(i, j) == name)
      return holeCookieWert (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)
      break;
  }
  return null;
}

function setzeCookie(name, wert)
  {
  var arg_wert = setzeCookie.arguments;
  var arg_laenge = setzeCookie.arguments.length;
  var expires = (arg_laenge > 2) ? arg_wert[2] : null;
  var path = (arg_laenge > 3) ? arg_wert[3] : null;
  var domain = (arg_laenge > 4) ? arg_wert[4] : null;
  var secure = (arg_laenge > 5) ? arg_wert[5] : false;
  document.cookie = name + "=" + escape (wert) +
    ((expires == null) ? "" : ("; expires=" +  expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
}

function hinzufuegen() {
  var haltbarBis = new Date(2003, 12, 31, 1, 0, 0);
  setzeCookie("adresse",
     document.adresse.Name.value + "; " +
     document.adresse.Strasse.value + "; " +
     document.adresse.Ort.value + "; " +
     document.adresse.Telefon.value + "; " +
     document.adresse.EMail.value + "; " +
     haltbarBis);
  return null;
}
