Datum = new Date();
Tag = DatTag();
Monat = DatMonat();
Jahr = DatJahr();

function DatTag() {
 var dt = "00";

 dt = Datum.getDate();
 if (dt < 10) {
  dt = "0"+dt;
 }
 return dt;
}

function DatMonat() {
 var dm = "00";

 dm = Datum.getMonth()+1;
 if (dm < 10) {
  dm = "0"+dm;
 }
 return dm;
}

function DatJahr() {
 return Datum.getYear();
}

function Bestell_Form(B_Form) {
 var BestellAngaben = "";
 var BestellAnzahl = parseInt(B_Form.anzahl.value,10);
 var BestellPreis = parseInt(B_Form.produkt.options[B_Form.produkt.selectedIndex].value,10);
 var BestellGesamt = parseInt(B_Form.produkt.options[B_Form.produkt.selectedIndex].value,10);
 var BestellKostenBuch = "inkl. gültige USt, zzgl. Versandkosten (wie DP AG)";
 var BestellKostenVideo = "inkl. gültige USt, zzgl. Versandkosten 2,00 EUR";
 var BestellKosten = BestellKostenBuch;
 var BestellBezahlung = "per Rechnung, Überweisung sofort ohne Abzug auf das Konto des Vereins";
 var txtAbfrage = "Geben Sie bitte einen Wert in das Feld ein: ";
 var BestellEmpfaenger = "Drei-Brüder-Schacht e. V. <bestellung@drei-brueder-schacht.de>";
 var BestellSubject = B_Form.subject.value;
 var BestellTitel = "Hiermit bestelle ich folgendes Produkt beim Förderverein Drei-Brüder-Schacht e. V.";
 var BestellOrt = B_Form.ort.value;
 var BestellDatum = Tag + "." + Monat + "." + Jahr;
 var NZ = "%0A%0D";
 var LZ = "%20%20";

 if (B_Form.anzahl.value < 1 || isNaN(B_Form.anzahl.value)) {
  alert(txtAbfrage + "\"Anzahl\"");
  B_Form.anzahl.focus();
  return (false);
 }

 if (B_Form.produkt.options[B_Form.produkt.selectedIndex].value <= 1) {
  alert(txtAbfrage + "\"Produkt\"");
  B_Form.produkt.focus();
  return (false);
 }

 if (B_Form.name.value == "") {
  alert(txtAbfrage + "\"Name\"");
  B_Form.name.focus();
  return (false);
 }

 if (B_Form.vorname.value == "") {
  alert(txtAbfrage + "\"Vorname\"");
  B_Form.vorname.focus();
  return (false);
 }

 if (B_Form.strasse.value == "") {
  alert(txtAbfrage + "\"Strasse/Nr.\"");
  B_Form.strasse.focus();
  return (false);
 }

 if (B_Form.plz.value == "") {
  alert(txtAbfrage + "\"PLZ\"");
  B_Form.plz.focus();
  return (false);
 }

 if (B_Form.ort.value == "") {
  alert(txtAbfrage + "\"Ort\"");
  B_Form.ort.focus();
  return (false);
 }

 if (B_Form.email.value == "") {
  alert(txtAbfrage + "\"eMail\"");
  B_Form.email.focus();
  return (false);
 }

 BestellGesamt = parseInt(BestellPreis * BestellAnzahl);
 BestellGesamt = BestellGesamt.toFixed(2) + LZ + "EUR";

 if (B_Form.kommentar.value == "") {
  B_Form.kommentar.value = "keine";
 }

 if (B_Form.produkt.options[B_Form.produkt.selectedIndex].value == "20.00") {
  BestellKosten = BestellKostenVideo;
 }

 BestellAngaben = BestellTitel + NZ + NZ
  + "Anzahl:" + LZ + BestellAnzahl + LZ + "Stück" + NZ
  + "Produkt:" + LZ + B_Form.produkt.options[B_Form.produkt.options.selectedIndex].text + NZ
  + "Einzelpreis:" + LZ + BestellPreis.toFixed(2) + LZ + "EUR" + NZ
  + "Gesamtpreis:" + LZ + BestellGesamt + LZ + BestellKosten + NZ
  + "Bezahlung:" + LZ + BestellBezahlung + NZ + NZ
  + "Name:" + LZ + B_Form.name.value + NZ
  + "Vorname:" + LZ + B_Form.vorname.value + NZ
  + "Strasse:" + LZ + B_Form.strasse.value + NZ
  + "PLZ:" + LZ + B_Form.plz.value + NZ
  + "Ort:" + LZ + B_Form.ort.value + NZ
  + "Land:" + LZ + B_Form.land.value + NZ
  + "Tel. priv.:" + LZ + B_Form.telpriv.value + NZ
  + "Tel. dien.:" + LZ + B_Form.teldien.value + NZ
  + "eMail:" + LZ + B_Form.email.value + NZ + NZ
  + "Mitteilung:" + LZ + B_Form.kommentar.value + NZ + NZ + NZ
  + BestellOrt + "," + LZ + BestellDatum;

 window.location.href = "mailto:" + BestellEmpfaenger + "?subject=" + BestellSubject + "&body=" + BestellAngaben;

 return (true);
}

