var ursprung=''; var sprung=0; var ziel=''; felder = new Array("document.form.besteller","form.strasse","plz","ort" ); function del() {//WegdaCookie(document.cookie,0,0); } function del_wk() { document.form.B_.value = ""; // document.cookie = "="; WegdaCookie(document.cookie,0,0); } function onload1() { zahlungsarten(); berechne(); } function zahlungsarten () { // *************************************************************** // Zahlungsarten eintragen ist aber nicht wichtig // *************************************************************** if(get_z4()!="") { element = new Option(get_z4(),get_p4(), false, true); document.form.Versand_____.options[3] = element; } if(get_z3()!="") { element = new Option(get_z3(),get_p3(), false, true); document.form.Versand_____.options[2] = element; } if(get_z2()!="") { element = new Option(get_z2(),get_p2(), false, true); document.form.Versand_____.options[1] = element; } if(get_z1()!="") { element = new Option(get_z1(),get_p1(), false, true); document.form.Versand_____.options[0] = element; } } function berechne () { anmerkung = 0; anmerkungg = 0; versand = ""; versand = "2.45"; versandz = 0; // cookie in B_ schreiben c = document.cookie; //if(documern.Name________.value == "debug")alert(c); px1 = 0; px2 = 0; // 1. Test ob Warenkorb brauchbar px1 = c.indexOf('p1r2i'); if (px1<0) c = ""; // Warenkorb hat keine Positionen //if(documern.Name________.value == "debug") alert(c); c = c+";"; l = c.length; document.form.B_.value = ""; // alert(c+" "+l); // alert(l); if ( l > 7 ) { i = 0; w = true; pos = 0; len1 = 0; f = 0; position = 0; pos_gpreis = 0.0; pos_epreis = 0.0; pos_menge = 0.0; spos_gpreis = " "; sum_gpreis = 0.0; rabatt = " "; sum_vpreis = 0.0; ssum_gpreis = " "; while( w == true) { px1 = c.indexOf('p1r2i'); c = c.substr(px1+6,l); // vorne abschneiden px2 = c.indexOf(';'); pos = 1; sub1 = c.substr(0,px2); // eine Position im String c = c.substr(px2+1,l); // Position wird rausgeschnitten len1 = sub1.length; // Länge Positionsstring // alert(c); // alert("sub1: "+sub1); // eine Position ermittelt // alert("|"+sub1+" "+len1); ab1 = 0; ab2 = 0; ab3 = 0; for (f=0;f 49.99) if (sum_gpreis < 100) sum_gpreis = sum_gpreis /100 * 97 ; //if (sum_gpreis > 99.99) if (sum_gpreis < 150) sum_gpreis = sum_gpreis /100 * 96 ; //if (sum_gpreis > 149.99) sum_gpreis = sum_gpreis /100 * 95 ; if (sum_gpreis > 350) if (versand == "5.95") versand = "8.95"; if (sum_gpreis > 150) if (versand == "4.45") versand = "5.95"; //ssum_gpreis = sum_gpreis.toString(); ssum_gpreis = sum_gpreis.toFixed(2); // 2 Nachkommastellen lg = ssum_gpreis.length; if (ssum_gpreis.indexOf('.')== lg-1) ssum_gpreis = ssum_gpreis + ".00"; if (ssum_gpreis.indexOf('.')== lg-2 ) ssum_gpreis = ssum_gpreis +"0"; lx1 = ssum_gpreis.indexOf('.'); ssum_gpreis = ssum_gpreis.substr(0,lx1+3); fixlen = 10; ssum_gpreis = ssum_gpreis.substr(0,fixlen); alen = ssum_gpreis.length; text1 = ""; for(n=0;n 49.99) if (gesammtpreis < 100) rabatt = " vom Warenwert " +gesammtpreis+" Euro wurden 3% Rabatt abgezogen!"; //if (gesammtpreis > 99.99) if (gesammtpreis < 150) rabatt = " vom Warenwert " +gesammtpreis+" Euro wurden 4% Rabatt abgezogen!"; //if (gesammtpreis > 149.99) rabatt = " vom Warenwert " +gesammtpreis+" Euro wurden 5% Rabatt abgezogen!"; text1 = "Warenwert Summe: "+get_waehrung()+ssum_gpreis+rabatt+"\n"; document.form.B_.value = document.form.B_.value + text1; // // vtext = ""; vpreis = ""; if (get_z1() != "") if(document.form.Versand_____.options[0].selected) vtext = get_z1(); if (get_z2() != "") if(document.form.Versand_____.options[1].selected) vtext = get_z2(); if (get_z3() != "") if(document.form.Versand_____.options[2].selected) vtext = get_z3(); if (get_z4() != "") if(document.form.Versand_____.options[3].selected) vtext = get_z4(); if (get_z1() != "") if(document.form.Versand_____.options[0].selected) vpreis = get_p1(); if (get_z2() != "") if(document.form.Versand_____.options[1].selected) vpreis = get_p2(); if (get_z3() != "") if(document.form.Versand_____.options[2].selected) vpreis = get_p3(); if (get_z4() != "") if(document.form.Versand_____.options[3].selected) vpreis = get_p4(); if (vpreis > 0 ) { if (versand > 0) vpreis = versand; //Versand wird erhöht; sum_vpreis = vpreis; sum_gpreis += (sum_vpreis * 1); fixlen = 6; vpreis = vpreis.substr(0,fixlen); alen = vpreis.length; text1 = ""; //for(n=0;n 0 ) { text1 = "Rechnungssumme: "+get_waehrung()+ssum_gpreis+"\n"; document.form.B_.value = document.form.B_.value + text1; mwst = sum_gpreis; // Endpreis übernehmen mwst = mwst/119*19; mwst = mwst.toFixed(2); // 2 Nachkommastellen text1 ="enthält 19% MwSt: "+get_waehrung()+" "+mwst+"\n\n"; document.form.B_.value = document.form.B_.value + text1; if (anmerkung > 0)text1 = "Wir prüfen, ob der gewünschte Sonderposten verfügbar ist. Bestätigung erfolgt per extra Mail!\n\n"; if (anmerkung > 0)document.form.B_.value = document.form.B_.value + text1; if ( versand == "159.00")text1 = "Sie brauchen das Geld für die Maschine nicht gleich überweisen. In den nächsten\n"; if ( versand == "159.00")document.form.B_.value = document.form.B_.value + text1; if ( versand == "159.00")text1 = "Tagen erhalten Sie eine Anzahlungsrechnung, die Sie dann bitte überweisen.\n\n"; if ( versand == "159.00")document.form.B_.value = document.form.B_.value + text1; } // end Vpreis > 0 if (get_text1().length > 0) document.form.B_.value = document.form.B_.value + get_text1()+"\n"; } // end if l > 7 } // end function function CookieSetzen (name, wert, verfall, pfad, domain, sicher) { document.cookie = name + "=" + escape (wert) + ((verfall) ? "; expires=" + verfall.toGMTString() : "") + ((pfad) ? "; path=" + pfad : "") + ((domain) ? "; domain=" + domain : "") + ((sicher) ? "; secure=" + sicher : ""); } function WegdaCookie(name, pfad, domain) { Ehemals = new Date (); Ehemals.setTime (Ehemals.getTime () - (365 * 24 * 60 * 60 * 1000)); CookieSetzen (name, "", Ehemals, pfad, domain); } function d(pos1) { npos1 = 0; zpos1 = 0; len1 = 0; len2 = 0; npos1 = pos1; if(document.form.Name________.value == "debug") alert(document.cookie); else { c = document.cookie; c = c+";"; npos1 = 0; while (true) { px1 = c.indexOf('p1r2i'); c = c.substr(px1,l); // vorne abschneiden px2 = c.indexOf(';'); sub1 = c.substr(0,px2); // eine Position im String c = c.substr(px2+1,l); // Position wird rausgeschnitten len1 = sub1.length; // Länge Positionsstring npos1 = npos1 +1; if (npos1 == pos1) break; } // eine Position ermittelt // alert(sub1); // alert(c); alert("Position "+pos1+" gelöscht !"); WegdaCookie(sub1,0,0); berechne(); } }