// Copyright 2000 by Peter Weiland - http://go.to/peterspage
var besttext=""; function ShowBestellung(preis_flag) { var anzahl = ReadAnzahl(); besttext=""; focus(); var pfad = GetShopPath(); var akt_date = new Date(); var datum = "" + (akt_date.getMonth() + 1); if (datum.length < 2) datum = "0" + datum; datum = akt_date.getDate() + "." + datum; if (datum.length < 5) datum = "0" + datum; datum = datum + "." + akt_date.getYear(); document.write("<form name=\"listform\">"); document.write("<center><table border=\"2\" cellspacing=\"0\" cellpadding=\"3\" width=\"615\">"); document.write("<tr><td colspan=\"4\" bgcolor=\"#F0E09F\" background=\"b/gelb.jpg\"><center>"); document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"600\"><tr>"); document.write("<td bgcolor=\"#F0E09F\" background=\"b/gelb.jpg\">"); document.write("<font size=\"4\"><strong>Bestellung</strong></font></td>"); document.write("<td bgcolor=\"#F0E09F\" background=\"b/gelb.jpg\" align=\"right\">"); document.write("<font size=\"4\"><strong>" + datum + "</strong></font></td>"); document.write("</table></center></td></tr>"); if (anzahl<0) anzahl=0; if (anzahl == 0) { document.write("<tr><td bgcolor=\"#f0ffff\" background=\"b/blau.jpg\" colspan=\"4\"><center><font size=\"5\">"); document.write("Ihr Warenkorb ist leer.<br>Sie haben bisher noch keinen Artikel ausgew&auml;hlt.</font><br>"); document.write("<br><font color=\"#800000\">Wenn Ihr Browser kein JavaScript oder Cookies unterst&uuml;tzt,<br>k&ouml;nnen Sie uns Ihre Bestellung auch per E-Mail an <a href=\"mailto:halbedel@numismatik.at\" onMouseOver=\"status='Bestellung per E-Mail'; return true;\" onMouseOut=\"status='';\">halbedel@numismatik.at</a> senden.</td></tr>"); document.write("</table></center><br>"); return true; } besttext = besttext + "Datum: " + datum + "\n\n" + "Hiermit bestelle ich folgende Artikel aus Ihrer Preisliste:\n\n"; document.write("<tr><td colspan=\"4\" bgcolor=\"#f0ffff\" background=\"b/blau.jpg\"><font size=\"4\">Hiermit bestelle ich folgende Artikel aus Ihrer Preisliste:"); document.write("</font><br></td></tr>"); document.write("<tr><td width=\"445\"><b>Artikel</b></td>"); document.write("<td width=\"90\" align=\"center\"><b>Preis&nbsp;(Euro)</b></td>"); document.write("<td colspan=\"2\" width=\"80\"><b>Menge</b></td>"); document.write("</tr>"); var p; var p2; var n=0; var txt = ""; var name1; var artikel; var farbe; var artname; var preis = ""; var summe = 0; var x; var x2; var f; for (n=0; n<anzahl; n++) { artikel = ReadArtikel(n); x = artikel.indexOf("#"); if (x>=0) { artikel = artikel.substring(x+1, artikel.length); } x2 = artikel.length; x = artikel.lastIndexOf("#"); artname = "" + artikel.substring(0, x); preis = "" + artikel.substring(x+1, x2); while ((preis.length > 0) && ((preis.charAt(0) > '9') || (preis.charAt(0) < '0'))) { if (preis.length > 1) preis = preis.substring(1, preis.length); else preis ="0,00"; } x = preis.lastIndexOf(","); if (x > 0) txt = preis.charAt(x); else txt="#"; if (txt != ",") txt = preis; else { txt = preis.substring(0, x) + "." + preis.substring(x+1, preis.length); } for (f=0; f<(txt.length - 3); f++) { if (txt.charAt(f) < "0") txt = txt.substring(0, f) + txt.substring(f+1, txt.length); } x = txt.length; if (txt.substring(x-3, x) == ".--") txt = txt.substring(0, x-3) + ".00"; if (txt.substring(x-2, x) == ".-") txt = txt.substring(0, x-2) + ".00"; x2 = summe; x= Math.round(txt * 100); summe = x2 + x; if ((n & 1) == 0) { farbe = "\"#fffff0\"" } else { farbe = "\"#fff8f0\""; } document.write("<tr><td bgcolor=" + farbe + " width=\"445\">"); document.write(artname); document.write("</td>"); document.write("<td bgcolor=" + farbe + " width=\"90\" align=\"right\">"+preis+"</td>"); document.write("<td bgcolor=" + farbe + " width=\"40\" align=\"right\">"); document.write("<input type=\"text\" size=\"4\" maxlength=\"4\" value=\"1\""); document.write(" onMouseOver=\"top.status='Hier die gewünschte Menge eingeben'; return true;\""); document.write(" onMouseOut=\"top.status=''; return true;\""); document.write(" onKeyUp=\"Key_Up(" + n + ", 0);\""); document.write(" onBlur=\"Key_Up(" + n + ", 1);\""); document.write(" title=\"anklicken und Menge eingeben\">"); document.write("</td>"); document.write("<td bgcolor= " + farbe + " width=\"40\"><center>"); document.write("<a href=\"javascript:DeleteArtikel(" + n +", 1);\" onMouseOver=\"Bild('b" + n + "', 1); status='Artikel aus Warenkorb entfernen'; return true;\" onMouseOut=\"Bild('b" + n + "', 0); status='';\" onClick=\"return confirm('Soll der Artikel aus dem Warenkorb entfernt werden?');\"><font size=\"1\">"); document.write("<img src=\"" + pfad + "bilder/weg1.gif\" name=\"b" + n + "\" alt=\"Artikel aus Warenkorb entfernen\" width=\"37\" height=\"20\" border=\"0\">"); document.write("</font></a></center></td>"); document.write("</tr>"); besttext = besttext+artname+", Preis " + preis + " Euro\n"; } x = Math.floor(summe / 100); x2 = Math.round(summe - (x * 100)); txt = x + ","; if (x2 < 10) txt = txt + "0"; txt = txt + x2; if ((txt != "NaN,NaN") && (preis_flag == 1)) { document.write("<tr><td width=\"615\" align=\"right\" colspan=\"4\">"); document.write("<div align=\"right\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"600\"><tr>"); document.write("<td width=\"545\" align=\"right\" valign=\"top\">"); document.write("<font size=\"4\">Summe: </font><font size=\"4\"><input type=\"text\" name=\"summenfeld\" size=\"11\" readonly"); if (navigator.appName.indexOf("Microsoft") >= 0) { document.write(" style=\"background-image:url(b/beige.jpg); font-family:Arial; font-size: 100%; font-weight:bold; color:#802000; border-width:0px; padding-bottom:0px; padding-top:2px; \""); } else { document.write(" onFocus=\"document.listform.elements[0].focus();\""); } document.write("></font><font size=\"4\">Euro</font></td>"); document.write("<td width=\"55\">&nbsp;</td></tr>"); document.write("</table></div>"); document.write("</td></tr>"); besttext = besttext + "\nGesamtsumme: " + txt + " Euro\n\n"; } document.write("</table></center>"); document.write("</form>"); } function deleteuml() { var uml = new Array( "&auml;", "&ouml;", "&uuml;", "&Auml;", "&Ouml;", "&Uuml;", "&szlig;", "&aacute;", "&quot;", "ä" ,     "ö" ,     "ü" ,     "Ä" ,     "Ö" ,     "Ü" ,      "ß" ,    "á"    ,  "'" ); var anzuml = 9; var x, n; var flg = 1; var f; var u = ""; var xend = besttext.length; for (f=0; f<xend; f++) { flg=0; for (n=0; n<anzuml; n++) { x = besttext.indexOf(uml[n]); if (x>=0) { if (n == (anzuml-1)) u ="\""; else u = uml[n+anzuml]; besttext = besttext.substring(0, x) + u + besttext.substring(x+uml[n].length, besttext.length); flg = 1; } } if (flg == 0) break; } } function chkFormular() {
if(document.bestform.agb_akzeptiert.checked == false) { document.bestform.agb_akzeptiert.focus(); alert("Wir können Ihre Bestellung nur bearbeiten, wenn Sie die AGB akzeptieren.\nBitte klicken Sie das Kästchen vor 'Ich erkläre mich durch das Abschicken der Bestellung mit den AGB’s einverstanden.' an."); return false; }
if(document.bestform.Vorname.value == "") { document.bestform.Vorname.focus(); alert("Bitte geben Sie Ihren Vornamen ein."); return false; } if(document.bestform.Nachname.value == "") { document.bestform.Nachname.focus(); alert("Bitte geben Sie Ihren Familiennamen ein."); return false; } if(document.bestform.Staat.value == "") { document.bestform.Staat.focus(); alert("Bitte geben Sie den Staat ein, in dem Sie wohnen."); return false; } if(document.bestform.Plz.value == "") { document.bestform.Plz.focus(); alert("Bitte geben Sie die Postleitzahl Ihres Wohnortes ein."); return false; } if(document.bestform.Ort.value == "") { document.bestform.Ort.focus(); alert("Bitte geben Sie Ihren Wohnort ein."); return false; } if(document.bestform.Strasse.value == "") { document.bestform.Strasse.focus(); alert("Bitte geben Sie Straße und Hausnummer ein."); return false; } if(document.bestform.email.value == "") { document.bestform.email.focus(); alert("Bitte geben Sie Ihre E-Mail-Adresse ein."); return false; } if(document.bestform.email.value.indexOf('@') == -1) { document.bestform.email.focus(); alert("Sie haben keine korrekte E-Mail-Adresse eingegeben.\nWenn Sie keine E-Mail-Adresse haben, geben Sie bitte einfach '@' ein."); return false; } return true; } function SetBesttext(flg) { var anzahl = ReadAnzahl(); var txt = DoBesttext(flg); if (anzahl > 0) { document.bestform.Bestelltext.value=besttext; document.bestform.Bestelltext.defaultValue=besttext; document.bestform.reset(); ShowSumme(txt); } } function DoBesttext(flg) { var anzahl = ReadAnzahl(); besttext=""; var pfad = GetShopPath(); var akt_date = new Date(); var datum = "" + (akt_date.getMonth() + 1); if (datum.length < 2) datum = "0" + datum; datum = akt_date.getDate() + "." + datum; if (datum.length < 5) datum = "0" + datum; datum = datum + "." + akt_date.getYear(); if (anzahl<0) anzahl=0; if (anzahl == 0) return ""; besttext = besttext + "Datum: " + datum + "\n\n" + "Hiermit bestelle ich folgende Artikel aus Ihrer Preisliste:\n\n"; var p; var p2; var n=0; var txt = ""; var name1; var artikel; var farbe; var artname; var preis = ""; var summe = 0; var x; var x2; var f; var menge; for (n=0; n<anzahl; n++) { artikel = ReadArtikel(n); x = artikel.indexOf("#"); if (x>=0) { artikel = artikel.substring(x+1, artikel.length); } x2 = artikel.length; x = artikel.lastIndexOf("#"); artname = "" + artikel.substring(0, x); preis = "" + artikel.substring(x+1, x2); while ((preis.length > 0) && ((preis.charAt(0) > '9') || (preis.charAt(0) < '0'))) { if (preis.length > 1) preis = preis.substring(1, preis.length); else preis ="0,00"; } x = preis.lastIndexOf(","); if (x > 0) txt = preis.charAt(x); else txt="#"; if (txt != ",") txt = preis; else { txt = preis.substring(0, x) + "." + preis.substring(x+1, preis.length); } for (f=0; f<(txt.length - 3); f++) { if (txt.charAt(f) < "0") txt = txt.substring(0, f) + txt.substring(f+1, txt.length); } x = txt.length; if (txt.substring(x-3, x) == ".--") txt = txt.substring(0, x-3) + ".00"; if (txt.substring(x-2, x) == ".-") txt = txt.substring(0, x-2) + ".00"; menge = document.listform.elements[n].value; if (isNaN(menge)) menge = -1; if (menge == "") menge = -1; menge = Math.round(menge); if (menge < 1) { menge = 1; if (flg == 1) document.listform.elements[n].value = menge; } x2 = summe; x= Math.round(txt * 100); summe = x2 + (menge * x); besttext = besttext + menge + " Stück - "; besttext = besttext + artname + ", Preis " + preis + " Euro"; if (menge > 1) besttext = besttext + " (" + menge + " Stück = " + eval(menge * txt) + " Euro)"; besttext = besttext + "\n"; } x = Math.floor(summe / 100); x2 = Math.round(summe - (x * 100)); txt = x + ","; if (x2 < 10) txt = txt + "0"; txt = txt + x2; if (txt != "NaN,NaN") { besttext = besttext + "\nGesamtsumme: " + txt + " Euro\n\n"; } deleteuml(); return txt; } function ShowSumme(txt) { document.listform.summenfeld.value = txt; document.listform.summenfeld.size = txt.length; } function Key_Up(nr, flg) { SetBesttext(flg); } function TestIt() { var txt = SetBesttext(1); alert(document.bestform); } 