/*
--------------------------------------------------
shop to date

Autor:    Thomas Müller
          MultiMüller GmbH
Datei:    shop2date.js
Funktion: JavaScript-Funktionen
--------------------------------------------------
*/

// Klassen

function classProduct() {
	this.uid="";
	this.id="";
	this.quantity=0;
	this.caption="";
	this.price=0;
	this.originalprice=-1;
	this.vat=0;
	this.url="";
	this.unit="";
	this.noship="";
	this.weight=0;
	this.actualpriceone=0;
	this.actualpriceall=0;
	this.rebatefrom=new Array;
	this.rebateprice=new Array;
	this.status=0;
	this.minimum=0;
	this.maximum=0;
	this.variationa="";
	this.variationb="";
}

function classVariation() {
	this.id="";
	this.price=0;
	this.originalprice=-1;
	this.weight=0;
	this.rebatefrom=new Array;
	this.rebateprice=new Array;
	this.status=0;
}

function classShippingMethod() {
	this.uid="";
	this.caption="";
	this.info="";
	this.vat=0;
	this.free=0;
	this.price=new Array;
	this.weight=new Array;
	this.actualprice=0;
}

function classPaymentMethod() {
	this.uid="";
	this.caption="";
	this.info="";
	this.pregateway="";
	this.postgateway="";
	this.email="";
	this.price=0;
	this.vat=0;
	this.free=0;
	this.actualprice=0;
	this.noship=0;
	this.parameter=new Array;
	this.version=0;
}
	

function classVat() {
	this.percent=0;
	this.amount=0;
}

// Funktionen

function sortVat(a,b) {	
// Sortier-Funktion für Prozent
	
	return a.percent-b.percent;
}

function toInt(value) {
// Einen Strin in Null umwandel, NaN umgehen

	if (isNaN(value)) {
		return 0;
	}
	else {
		return parseInt(value);
	}
}

function format(num) {
// Als Währung formatieren
	
	num = Math.round(num*100);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+"."+num.substring(num.length-(4*i+3));
	return (num + "," + cents);
}

function formatweight(num) {
// Als Gewicht formatieren
	
	num = Math.round(num*1000);
	cents = num%1000;
	num = Math.floor(num/1000).toString();
	cents="000"+cents.toString();
	cents=cents.substr(cents.length-3,cents.length);
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+"."+num.substring(num.length-(4*i+3));
	return (num + "," + cents);
}

function htmlChars(myText) {
// Entfernt böse HTML-Zeichen

	myText=myText.replace(/&/g,"&amp;");
	myText=myText.replace(/"/g,"&quot;");
	myText=myText.replace(/'/g,"&#039;");
	myText=myText.replace(/</g,"&lt;");
	myText=myText.replace(/>/g,"&gt;");
	return myText;
}

function iclearChars(myText) {
// Entfernt böse Zeichen für iClear

	myText=myText.replace(/&/g," ");
	myText=myText.replace(/"/g," ");
	myText=myText.replace(/'/g," ");
	myText=myText.replace(/:/g," ");
	myText=myText.replace(/#/g," ");
	myText=myText.replace(/%/g," ");
	return myText;
}


function setCookie(myvalue) {
// Einen Cookie setzen
	var expires= new Date();
	expires.setFullYear(expires.getFullYear()+1);
	document.cookie="s2dm="+escape(myvalue)+"; expires="+expires.toGMTString()+"; path=/";
}

function getCookie() {
// Einen Cookie lesen
	var pos=document.cookie.indexOf("s2dm=");
		
	if (pos != -1) {
		var start=pos+5;
		var ende=document.cookie.indexOf(";", start);

		if (ende == -1) ende = document.cookie.length;
		var myvalue=document.cookie.substring(start, ende);
	
		myvalue=unescape(myvalue)
		return myvalue;
	} 
}

function setMemo(mycaption, myurl) {
// Dem Merkzetteln einen Eintrag hinzufügen
	
	var myvalue=new String();
	var mymemo=getMemo();
	var mymax;
		
	myvalue=myurl+"|||"+mycaption;
	
	mymax=mymemo.length;
	if (mymax>9) mymax=9;
	
	for (i=0;i<mymax;i++) {
		if (mymemo[i][0]!=myurl) {
			myvalue+="||||"+mymemo[i][0]+"|||";
			myvalue+=mymemo[i][1];
		}
	}
			
	setCookie(myvalue);
}

function getMemo() {
// Den Array mit dem Merkzettel liefern

	var mymemo = new Array();
	var myvalue = getCookie();
		
	if (myvalue != null && myvalue !="") {
		mymemo=myvalue.split("||||");
		for (i=0;i<mymemo.length;i++) {
			mymemo[i]=mymemo[i].split("|||");
		}
	}
	return mymemo;
}

function clearCookie() {
	
	if (confirm("Wollen Sie Ihren Merkzettel wirklich löschen?")) {
		setCookie("");
		location.reload()
	}

}

function memoShow() {
// Den Merkzetteln anzeigen

	var mymemo=getMemo();
	
	if (mymemo.length==0) {
		document.write("<p>Es befinden sich keine Produkte auf Ihrem Merkzettel.</p>");
	} else {
		document.write("<table width='100%' cellpadding='2'>");
		for (i=0;i<mymemo.length;i++) {
			document.write("<tr><td align='left' class='s2d'>");
			document.write("<a class='s2d' href='"+mymemo[i][0]+"'>");
			document.write(mymemo[i][1]);
			document.write("</td></tr>");
		}
		document.write("<tr>");		
		document.write("<td class='s2d' align='right'><br><a href='#' onclick='clearCookie();return false;'><img src='images/pbclmemo.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("</table>");	
		document.write("<p><br>Auf dem Merkzettel können Sie Artikel unverbindlich vormerken, um sich diese bei einem späteren Besuch des Shops nochmals anzusehen. Klicken Sie auf einen Eintrag, um ihn anzuzeigen. Damit der Merkzettel funktioniert, müssen Sie Cookies aktiviert haben.</p>");	
	}
}

function addMemo(myproduct, myurl) {
// Merken

	var mymessage="Das Produkt \"[c]\" wurde auf Ihrem Merkzettel eingetragen.";
	mymessage=mymessage.replace(/\[c\]/g,myproduct);
	alert(mymessage);
	setMemo(myproduct, myurl);
}

function basketPut(myproduct, myquantity) {
// Ins Körbchen legen
	
	var found;
	var i;
	var message;
	
	myquantity=toInt(myquantity);
	
	// Lieferbar?
	
	if (myproduct.status==0) {
		alert("Die von Ihnen gewählte Variante ist nicht lieferbar. Bitte wählen Sie eine andere Kombination von Eigenschaften.");
	}
	else {
		// Nicht null!
		if (myquantity<=0) {
			alert("Bitte geben Sie eine gültige Anzahl ein.");
		}
		else {
			message="Wollen Sie [n] [u] \"[c]\" in den Warenkorb legen?";
			message=message.replace(/\[n\]/,myquantity);
			message=message.replace(/\[u\]/,myproduct.unit);
			message=message.replace(/\[c\]/,myproduct.caption);
	
			if (confirm(message)) {
				found=-1
				for (var i=0; i<parent.basket.length; i++) {
					if ((parent.basket[i].uid==myproduct.uid) && (parent.basket[i].variationa==myproduct.variationa) && (parent.basket[i].variationb==myproduct.variationb)) {
						found=i;
					}
				}
				if (found==-1) {
					found=parent.basket.length;
					parent.basket[found]=new classProduct;
				}
				parent.basket[found].quantity+=parseFloat(myquantity);
				parent.basket[found].uid=myproduct.uid;
				parent.basket[found].id=myproduct.id;
				parent.basket[found].unit=myproduct.unit;
				parent.basket[found].caption=myproduct.caption;
				parent.basket[found].price=myproduct.price;
				parent.basket[found].vat=myproduct.vat;
				parent.basket[found].weight=myproduct.weight;
				parent.basket[found].url=myproduct.url;
				parent.basket[found].noship=myproduct.noship;
				parent.basket[found].minimum=myproduct.minimum;
				parent.basket[found].maximum=myproduct.maximum;
				parent.basket[found].variationa=myproduct.variationa;
				parent.basket[found].variationb=myproduct.variationb;
			
				for (var i=1;i<=5;i++) {
					parent.basket[found].rebatefrom[i]=myproduct.rebatefrom[i];
					parent.basket[found].rebateprice[i]=myproduct.rebateprice[i];
				}
			
				// Maximum und Minumum checken
				if ((parent.basket[found].quantity>parent.basket[found].maximum) && (parent.basket[found].maximum!=0)) {
					message="Die Höchstbestellmenge des Produktes \"[c]\" beträgt [n] [u] - die Bestellmenge wurde automatisch angepasst.";
					message=message.replace(/\[n\]/,parent.basket[found].maximum);
					message=message.replace(/\[u\]/,parent.basket[found].unit);
					message=message.replace(/\[c\]/,parent.basket[found].caption);
					alert(message);
					parent.basket[found].quantity=parent.basket[found].maximum;
				}
				if ((parent.basket[found].quantity<parent.basket[found].minimum) && (parent.basket[found].minimum!=0)) {
					message="Die Mindestbestellmenge des Produktes \"[c]\" beträgt [n] [u] - die Bestellmenge wurde automatisch angepasst.";
					message=message.replace(/\[n\]/,parent.basket[found].minimum);
					message=message.replace(/\[u\]/,parent.basket[found].unit);
					message=message.replace(/\[c\]/,parent.basket[found].caption);
					alert(message);
					parent.basket[found].quantity=parent.basket[found].minimum;
				}
			}
		}
	}
}
	
function basketShow() {
// Körbchen anzeigen

	var sum,i,j,found,vatsum;
	var vat = new Array;
	
	sum=0;
	vatsum=0;
		
	for (i=0;i<parent.basket.length;i++) {
		sum+=parent.basket[i].quantity;
	}
	
	updateActualPrice();
	
	if (sum==0)	{
		// leer
		
		document.write("<p>Der Warenkorb ist leer</p>");
	}
	else {
		// Überschrift zeigen
	
		sum=0;
		document.write("<form name='basketform' onsubmit='reCalc();location.reload();return false;'>");
		document.write("<table width='100%' cellpadding='2'>");
		document.write("<tr>");
		document.write("<td align='left' colspan='3' class='s2d'><strong>Anzahl</strong></td>");
		document.write("<td width='100%' class='s2d'><strong>Bezeichnung</strong></td>");
				document.write("<td nowrap align='right' class='s2d'><strong>Einzelpreis</strong></td>");
		document.write("<td nowrap align='right' class='s2d'><strong>Gesamtpreis</strong></td>");
		document.write("</tr>");
		document.write("<tr>");
		
		// Positionen
		
		for (i=0;i<parent.basket.length;i++) {
			if (parent.basket[i].quantity!=0) {
				document.write("<tr>");
				document.write("<td><a href='#' onclick='deleteItem("+i+");return false;'><img src='images/ptrsh.gif' width='12' height='16' alt='' border='0'></a></td>");
				document.write("<td><input type='text' class='s2d' size='3' maxlength='5' value='"+parent.basket[i].quantity+"' name="+i+"></td>");
				document.write("<td class='s2d'>"+htmlChars(parent.basket[i].unit)+"&nbsp;</td>");
				document.write("<td width='100%' class='s2d'><a class='s2d' href='"+parent.basket[i].url+"'>"+htmlChars(parent.basket[i].caption)+"</a></td>");
								document.write("<td nowrap align='right' class='s2d'>"+format(parent.basket[i].actualpriceone)+" EUR</td>");
				document.write("<td nowrap align='right' class='s2d'>"+format(parent.basket[i].actualpriceall)+" EUR</td>");
				document.write("</tr>");
				sum+=parent.basket[i].actualpriceall;
				
				// Ust rechnen
				
				addVat(vat,parent.basket[i].vat,parent.basket[i].actualpriceall);
				
			}
		}
		
		// Abstand
		document.write("<tr>");
					document.write("<td colspan='6' align='left' class='s2d'></td>");		
				document.write("</tr>");
		
		// USt. ausgeben
		vat.sort(sortVat);
		
					
			// Ust
		
			for (i=0;i<vat.length;i++) {
				document.write("<tr>");
				document.write("<td colspan='5' align='right' class='s2d'>"+vat[i].percent+"% USt.:</td>");
				document.write("<td nowrap align='right' class='s2d'>"+format(vat[i].amount)+" EUR</td>");
				document.write("</tr>");
			}	
			
			// Endbetrag
			
			document.write("<tr>");
			document.write("<td colspan='4' align='left' class='s2d'><input type='image' name='calc' src='images/prcb.gif' border='0' onclick='reCalc();location.reload();return false;'></td>");
			document.write("<td align='right' class='s2d'><strong>Endsumme:</strong></td>");
			document.write("<td nowrap align='right' class='s2d'><strong>"+format(sum)+" EUR</strong></td>");
			document.write("</tr>");
				
		// Navigation
		
		document.write("</table>");
		document.write("</form>");
	
		document.write("<table width='100%' cellpadding='2'>");
		document.write("<tr>");		
		document.write("<td align='left'><a href='./index.html'><img src='images/psmb.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("<td align='right'><a onclick='reCalc();return true;' href='s2dship.html'><img src='images/pcob.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("</tr>");		
		document.write("</table>");	
	}
}

function addVat(vat,rate,price) {
// USt addieren
	
	var j,found;
	
	if ((rate!=0) && (price!=0)) {

		found=-1;
		for (j=0;j<vat.length;j++) {
			if (vat[j].percent==rate) {
				found=j;
			}
		}
					
		if (found==-1) {
			found=vat.length;
			vat[found]=new classVat;
			vat[found].percent=rate;
			vat[found].amount=0;
		}				
					vat[found].amount+=price/(100+rate)*rate;
			}
}

function updateActualPrice() {
// Tatsächliche Preise im Korb aktualisieren

	for (var i=0;i<parent.basket.length;i++) {
		parent.basket[i].actualpriceone=parent.basket[i].price;
		
		// Rabattstaffel erreicht?
		
		for (var j=0;j<=5;j++) {
			if (parent.basket[i].rebatefrom[j]!=0) {
				if ((parent.basket[i].quantity)>=(parent.basket[i].rebatefrom[j])) {
					parent.basket[i].actualpriceone=parent.basket[i].rebateprice[j];
				}
			}
		}
		
		parent.basket[i].actualpriceall=parent.basket[i].actualpriceone*parent.basket[i].quantity;
	}
	
}

function reCalc() {
// Korb anhand Formular aktualisieren

	var j,i,message;

	for (i=0;i<document.basketform.elements.length;i++) {
		if (document.basketform.elements[i].type=="text") {
			j=parseInt(document.basketform.elements[i].name);
			parent.basket[j].quantity=Math.abs(toInt(document.basketform.elements[i].value));
			
			// Minumum und Maximum
			if ((parent.basket[j].quantity>parent.basket[j].maximum) && (parent.basket[j].maximum!=0) && (parent.basket[j].qunatity!=0)) {
				message="Die Höchstbestellmenge des Produktes \"[c]\" beträgt [n] [u] - die Bestellmenge wurde automatisch angepasst.";
				message=message.replace(/\[n\]/,parent.basket[j].maximum);
				message=message.replace(/\[u\]/,parent.basket[j].unit);
				message=message.replace(/\[c\]/,parent.basket[j].caption);
				alert(message);
				parent.basket[j].quantity=parent.basket[j].maximum;
			}
			if ((parent.basket[j].quantity<parent.basket[j].minimum) && (parent.basket[j].minimum!=0) && (parent.basket[j].qunatity!=0)) {
				message="Die Mindestbestellmenge des Produktes \"[c]\" beträgt [n] [u] - die Bestellmenge wurde automatisch angepasst.";
				message=message.replace(/\[n\]/,parent.basket[j].minimum);
				message=message.replace(/\[u\]/,parent.basket[j].unit);
				message=message.replace(/\[c\]/,parent.basket[j].caption);
				alert(message);
				parent.basket[j].quantity=parent.basket[j].minimum;
			}

		}
	}
}

function deleteItem(id) {
// Element aus Korb entfernen

	var message;
	
	message="Wollen Sie das Produkt \"[c]\" wirklich aus dem Warenkorb löschen?";
	message=message.replace(/\[c\]/,parent.basket[id].caption);

	if (confirm(message)) { 
		parent.basket[id].quantity=0;
		location.reload();
	}
}

function defineShippingMethods() {
// Versand-Methoden definieren

	if (parent.shippingmethod.length==0)
	{
			parent.shippingmethod[1] = new classShippingMethod;
		parent.shippingmethod[1].caption="Paketdienst";
		parent.shippingmethod[1].info="Gurtmaß (Umfang+Länge)= max. 300 cm Länge= max. 175 cm Gewicht= max. 31,5 Kg; Inselzuschlag: 15,00 €";
		parent.shippingmethod[1].uid="501264941a1362d1e";
		parent.shippingmethod[1].free=0;
		parent.shippingmethod[1].vat=19;
					parent.shippingmethod[1].price[1]=7;				
			parent.shippingmethod[1].weight[1]=6;				
					parent.shippingmethod[1].price[2]=8.55;				
			parent.shippingmethod[1].weight[2]=14;				
					parent.shippingmethod[1].price[3]=13;				
			parent.shippingmethod[1].weight[3]=24;				
					parent.shippingmethod[1].price[4]=14.9;				
			parent.shippingmethod[1].weight[4]=28;				
					parent.shippingmethod[1].price[5]=36;				
			parent.shippingmethod[1].weight[5]=31.5;				
					parent.shippingmethod[2] = new classShippingMethod;
		parent.shippingmethod[2].caption="DHL-Paket";
		parent.shippingmethod[2].info="DHL-Paket versichert, Haftung bis 500,00 EUR (Quaderform: Mindestmaße 15 x 11 x 1 cm; Höchstmaße 120 x 60 x 60 cm)(Rollenform: Mindestmaße Länge 15 cm, ø 5 cm; Höchstmaße Länge 120 cm, ø 15 cm) ";
		parent.shippingmethod[2].uid="501264941c070f001";
		parent.shippingmethod[2].free=0;
		parent.shippingmethod[2].vat=19;
					parent.shippingmethod[2].price[1]=8;				
			parent.shippingmethod[2].weight[1]=5;				
					parent.shippingmethod[2].price[2]=11.5;				
			parent.shippingmethod[2].weight[2]=10;				
					parent.shippingmethod[2].price[3]=15;				
			parent.shippingmethod[2].weight[3]=20;				
					parent.shippingmethod[2].price[4]=0;				
			parent.shippingmethod[2].weight[4]=0;				
					parent.shippingmethod[2].price[5]=0;				
			parent.shippingmethod[2].weight[5]=0;				
					parent.shippingmethod[3] = new classShippingMethod;
		parent.shippingmethod[3].caption="Kurierdienst";
		parent.shippingmethod[3].info="Gurtmaß (Umfang+Länge)= max. 300 cm; Länge= max. 120 cm; Höhe= max. 80 cm; Gewicht= max. 30 Kg; Inselzuschlag: 15,00 €";
		parent.shippingmethod[3].uid="501264941c0724f02";
		parent.shippingmethod[3].free=0;
		parent.shippingmethod[3].vat=19;
					parent.shippingmethod[3].price[1]=5.5;				
			parent.shippingmethod[3].weight[1]=2;				
					parent.shippingmethod[3].price[2]=6.3;				
			parent.shippingmethod[3].weight[2]=5;				
					parent.shippingmethod[3].price[3]=7.9;				
			parent.shippingmethod[3].weight[3]=10;				
					parent.shippingmethod[3].price[4]=12.5;				
			parent.shippingmethod[3].weight[4]=20;				
					parent.shippingmethod[3].price[5]=15.5;				
			parent.shippingmethod[3].weight[5]=30;				
					parent.shippingmethod[4] = new classShippingMethod;
		parent.shippingmethod[4].caption="Päckchen";
		parent.shippingmethod[4].info="DHL-Päckchen bis 2 Kg unversichert (Quaderform: Mindestmaße 15 x 11 x 1 cm; Höchstmaße 60 x 30 x 15 cm oder L + B + H max. 90 cm, dabei keine Seite länger als 60 cm.)(Rollenform: Mindestmaße Länge 15 cm, ø 5 cm; Höchstmaße Länge 90 cm, ø 15 cm)  ";
		parent.shippingmethod[4].uid="501264941c13dcc01";
		parent.shippingmethod[4].free=0;
		parent.shippingmethod[4].vat=19;
					parent.shippingmethod[4].price[1]=4.9;				
			parent.shippingmethod[4].weight[1]=2;				
					parent.shippingmethod[4].price[2]=0;				
			parent.shippingmethod[4].weight[2]=0;				
					parent.shippingmethod[4].price[3]=0;				
			parent.shippingmethod[4].weight[3]=0;				
					parent.shippingmethod[4].price[4]=0;				
			parent.shippingmethod[4].weight[4]=0;				
					parent.shippingmethod[4].price[5]=0;				
			parent.shippingmethod[4].weight[5]=0;				
					parent.shippingmethod[5] = new classShippingMethod;
		parent.shippingmethod[5].caption="Abholung";
		parent.shippingmethod[5].info="Holen Sie die Ware nach Absprache direkt in unserem Shop in 97616 Bad Neustadt/S., Meininger Str. 24 ab. Das spart Ihnen die Versandkosten!";
		parent.shippingmethod[5].uid="501264941e0686f32";
		parent.shippingmethod[5].free=0;
		parent.shippingmethod[5].vat=19;
					parent.shippingmethod[5].price[1]=0;				
			parent.shippingmethod[5].weight[1]=0;				
					parent.shippingmethod[5].price[2]=0;				
			parent.shippingmethod[5].weight[2]=0;				
					parent.shippingmethod[5].price[3]=0;				
			parent.shippingmethod[5].weight[3]=0;				
					parent.shippingmethod[5].price[4]=0;				
			parent.shippingmethod[5].weight[4]=0;				
					parent.shippingmethod[5].price[5]=0;				
			parent.shippingmethod[5].weight[5]=0;				
					parent.shippingmethod[6] = new classShippingMethod;
		parent.shippingmethod[6].caption="Sperrgut";
		parent.shippingmethod[6].info="Die von Ihnen bestellte Ware muß wegen ihrer Beschaffenheit als Stückgut/Sperrgut versandt werden. Bei Lieferung auf Inseln oder ins Ausland erfolgt ein Zuschlag, den wir Ihnen sofort nach der Kalkulation mitteilen.";
		parent.shippingmethod[6].uid="501264941e0e3c401";
		parent.shippingmethod[6].free=0;
		parent.shippingmethod[6].vat=19;
					parent.shippingmethod[6].price[1]=60;				
			parent.shippingmethod[6].weight[1]=100;				
					parent.shippingmethod[6].price[2]=100;				
			parent.shippingmethod[6].weight[2]=150;				
					parent.shippingmethod[6].price[3]=150;				
			parent.shippingmethod[6].weight[3]=200;				
					parent.shippingmethod[6].price[4]=200;				
			parent.shippingmethod[6].weight[4]=300;				
					parent.shippingmethod[6].price[5]=300;				
			parent.shippingmethod[6].weight[5]=500;				
					parent.shippingmethod[7] = new classShippingMethod;
		parent.shippingmethod[7].caption="DHL-Paket Ausland Zone1";
		parent.shippingmethod[7].info="Versand nach Belgien, Dänemark, Finnland, Frankreich, Griechenland, Großbritannien, Isle of Man, Irland, Italien, Luxemburg, Niederlande, Österreich, Polen, Portugal, Schweden, Schweiz, Slowakei, Spanien, Tschechische Republik";
		parent.shippingmethod[7].uid="501264981b0788c01";
		parent.shippingmethod[7].free=0;
		parent.shippingmethod[7].vat=19;
					parent.shippingmethod[7].price[1]=18;				
			parent.shippingmethod[7].weight[1]=5;				
					parent.shippingmethod[7].price[2]=23;				
			parent.shippingmethod[7].weight[2]=10;				
					parent.shippingmethod[7].price[3]=33;				
			parent.shippingmethod[7].weight[3]=20;				
					parent.shippingmethod[7].price[4]=0;				
			parent.shippingmethod[7].weight[4]=0;				
					parent.shippingmethod[7].price[5]=0;				
			parent.shippingmethod[7].weight[5]=0;				
					parent.shippingmethod[8] = new classShippingMethod;
		parent.shippingmethod[8].caption="DHL-Paket Ausland Zone2";
		parent.shippingmethod[8].info="Versand nach Rest Europa";
		parent.shippingmethod[8].uid="501264981b078c402";
		parent.shippingmethod[8].free=0;
		parent.shippingmethod[8].vat=19;
					parent.shippingmethod[8].price[1]=31;				
			parent.shippingmethod[8].weight[1]=5;				
					parent.shippingmethod[8].price[2]=36;				
			parent.shippingmethod[8].weight[2]=10;				
					parent.shippingmethod[8].price[3]=46;				
			parent.shippingmethod[8].weight[3]=20;				
					parent.shippingmethod[8].price[4]=0;				
			parent.shippingmethod[8].weight[4]=0;				
					parent.shippingmethod[8].price[5]=0;				
			parent.shippingmethod[8].weight[5]=0;				
					parent.shippingmethod[9] = new classShippingMethod;
		parent.shippingmethod[9].caption="DHL-Paket Ausland Zone3";
		parent.shippingmethod[9].info="Versand nach Nordamerika, Nordafrika, Naher Osten (Welt Zone1)";
		parent.shippingmethod[9].uid="501264981b078eb03";
		parent.shippingmethod[9].free=0;
		parent.shippingmethod[9].vat=19;
					parent.shippingmethod[9].price[1]=33;				
			parent.shippingmethod[9].weight[1]=5;				
					parent.shippingmethod[9].price[2]=43;				
			parent.shippingmethod[9].weight[2]=10;				
					parent.shippingmethod[9].price[3]=63;				
			parent.shippingmethod[9].weight[3]=20;				
					parent.shippingmethod[9].price[4]=0;				
			parent.shippingmethod[9].weight[4]=0;				
					parent.shippingmethod[9].price[5]=0;				
			parent.shippingmethod[9].weight[5]=0;				
					parent.shippingmethod[10] = new classShippingMethod;
		parent.shippingmethod[10].caption="DHL Paket Ausland Zone4";
		parent.shippingmethod[10].info="Versand nach Rest Welt (Welt Zone2)";
		parent.shippingmethod[10].uid="501264981b0791c04";
		parent.shippingmethod[10].free=0;
		parent.shippingmethod[10].vat=19;
					parent.shippingmethod[10].price[1]=38;				
			parent.shippingmethod[10].weight[1]=5;				
					parent.shippingmethod[10].price[2]=53;				
			parent.shippingmethod[10].weight[2]=10;				
					parent.shippingmethod[10].price[3]=83;				
			parent.shippingmethod[10].weight[3]=20;				
					parent.shippingmethod[10].price[4]=0;				
			parent.shippingmethod[10].weight[4]=0;				
					parent.shippingmethod[10].price[5]=0;				
			parent.shippingmethod[10].weight[5]=0;				
				}
}

function shippingShow() {
// Versand-Methoden anzeigen

	var i,j,sum,totalweight, totalprice;
	
	defineShippingMethods();
	updateActualPrice();
	
	sum=0;
	totalweight=0;
	totalprice=0;
	
	for (i=0;i<parent.basket.length;i++) {
		sum+=parent.basket[i].quantity;
		totalweight+=parent.basket[i].weight*parent.basket[i].quantity;
		totalprice+=parent.basket[i].actualpriceall;
	}	
	
	if (sum==0)	{
		document.write("<p>Der Warenkorb ist leer</p>");
	}
	else {
		document.write("<form name='shippingform'>");
		document.write("<table width='100%' cellpadding='2'>");
		for (i=1;i<parent.shippingmethod.length;i++) {
			
			parent.shippingmethod[i].actualprice=-1;
						
			if (parent.shippingmethod[i].weight[1]==0) {
				// Nur ein Preis
				parent.shippingmethod[i].actualprice=parent.shippingmethod[i].price[1];
			}
			else {
				// Preis nach Gewicht
				for (j=parent.shippingmethod[i].weight.length;j>0;j--) {
					if (parent.shippingmethod[i].weight[j]!=0) {
						if (totalweight<=parent.shippingmethod[i].weight[j]) {
							parent.shippingmethod[i].actualprice=parent.shippingmethod[i].price[j];
						}
					}
				}
			}
			// Versandkostenfrei?
			if ((totalprice>=parent.shippingmethod[i].free) && (parent.shippingmethod[i].free!=0) && (parent.shippingmethod[i].actualprice!=-1)) {
				parent.shippingmethod[i].actualprice=0;
			}
			
			// Nicht erlaubte Methode?			
			for (j=0;j<parent.basket.length;j++) {
				if (parent.basket[j].quantity!=0) {
					if (parent.basket[j].noship.indexOf(parent.shippingmethod[i].uid)!=-1)
  					parent.shippingmethod[i].actualprice=-1;
				}
			}
			// GGf Auswahl löschen
			if ((parent.shippingmethod[i].actualprice==-1) && (i==parent.selectedshippingmethod)) {
				parent.selectedshippingmethod=-1;
			}
		}
		for (i=1;i<parent.shippingmethod.length;i++) {		
			// Anzeigen
			if (parent.shippingmethod[i].actualprice!=-1) {
				// Wenn nichts gewählt, erstes wählen
				if (parent.selectedshippingmethod==-1) {
					parent.selectedshippingmethod=i
				}
				document.write("<tr>");
				document.write("<td class='s2d'><input type='radio' ")
				if (i==parent.selectedshippingmethod) {
					document.write("checked ");
				}
				document.write("onclick='setShipping();' name='method' value='"+i+"'></td>");
				document.write("<td class='s2d' width='100%'><strong>"+parent.shippingmethod[i].caption+"</strong><br></td>");
				document.write("<td align='right' nowrap class='s2d'><strong>")
				if (parent.shippingmethod[i].actualprice!=0) {
					document.write(format(parent.shippingmethod[i].actualprice)+" EUR");
				} else {
					document.write("kostenlos");
				} 
				document.write("</strong></td>");
				document.write("</tr>");
				if (parent.shippingmethod[i].info!="") {
					document.write("<tr>");
					document.write("<td></td>");
					document.write("<td class='s2d' width='100%'>"+parent.shippingmethod[i].info+"<br><br></td>");
					document.write("<td></td>");
					document.write("</tr>");
				}
			}
		}
		
		// Gewicht zeigen
		
		if (totalweight>0) {
			document.write("<tr>");
			document.write("<td></td>");
			document.write("<td class='s2d'><br>Gesamtgewicht: "+formatweight(totalweight)+" kg<br><br></td>");
			document.write("<td></td>");
			document.write("</tr>");
		}
		
		// Navigation unten
		document.write("</table>");
		document.write("</form>");		
	
		document.write("<table width='100%' cellpadding='2'>");
		document.write("<tr>");		
		document.write("<td align='left'><a href='s2dbskt.html'><img src='images/pbskt.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("<td align='right'><a href='s2dpayment.html'><img src='images/pcob.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("</tr>");		
		document.write("</table>");
	}
}

function setShipping() {
// Versand-Methode einstellen

	var i;
	parent.selectedshippingmethod=-1;
	for (i=0;i<document.shippingform.method.length;i++) {
		if (document.shippingform.method[i].checked) {
			parent.selectedshippingmethod=document.shippingform.method[i].value;
		}
	}
}

function definePaymentMethods() {
// Bezahl-Methoden definieren

	if (parent.paymentmethod.length==0)
	{
			parent.paymentmethod[1] = new classPaymentMethod;
		parent.paymentmethod[1].caption="Barzahlung";
		parent.paymentmethod[1].info="Bestellen Sie per Internet, holen Sie die Ware in unserem Shop ab und bezahlen Sie bar.";
		parent.paymentmethod[1].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adressdaten eintragen können. Sobald Sie diese eingegeben und bestätigt haben, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[1].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail. Bitte rufen Sie uns an, um einen Abholtermin für Ihre Bestellung zu vereinbaren.";
		parent.paymentmethod[1].email="Vielen Dank für Ihre Bestellung. Sie können die Ware in unserem Ladengeschäft abholen. Unsere Adresse finden Sie am Fuß dieses Schreibens und auf unserer Homepage.";
		parent.paymentmethod[1].noship="501264941a1362d1e 501264941c070f001 501264941c0724f02 501264941c13dcc01 501264941e0e3c401";
		parent.paymentmethod[1].uid="501264941a1329518";
		parent.paymentmethod[1].price=0;
		parent.paymentmethod[1].vat=16;
		parent.paymentmethod[1].free=0;
		parent.paymentmethod[1].parameter[0]="";
		parent.paymentmethod[1].parameter[1]="";
		parent.paymentmethod[1].parameter[2]="";
		parent.paymentmethod[1].parameter[3]="";
		parent.paymentmethod[1].parameter[4]="";
		parent.paymentmethod[1].parameter[5]="";
		parent.paymentmethod[1].version="shop2dateversion10";
			parent.paymentmethod[2] = new classPaymentMethod;
		parent.paymentmethod[2].caption="Überweisung";
		parent.paymentmethod[2].info="Überweisen Sie den Rechnungsbetrag auf unser Konto.";
		parent.paymentmethod[2].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adressdaten eintragen können. Sobald diese eingegeben und bestätigt wurden, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[2].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto 600 036 bei der Flessabank Bad Neustadt/S., BLZ 793 301 11, Kontoinhaber Bock e.K. Die Bankdaten werden Ihnen nochmals mit der Bestätigungsmail gesandt.";
		parent.paymentmethod[2].email="Vielen Dank für Ihre Bestellung. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto 600 036 bei der Flessabank Bad Neustadt/S., BLZ 793 301 11, Kontoinhaber Bock e.K. Die Ware wird nach festgestelltem Zahlungseingang so bald als möglich an Sie versandt, bzw. zur Abholung freigegeben.";
		parent.paymentmethod[2].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[2].uid="501264941a1351a1d";
		parent.paymentmethod[2].price=0;
		parent.paymentmethod[2].vat=16;
		parent.paymentmethod[2].free=0;
		parent.paymentmethod[2].parameter[0]="";
		parent.paymentmethod[2].parameter[1]="";
		parent.paymentmethod[2].parameter[2]="";
		parent.paymentmethod[2].parameter[3]="";
		parent.paymentmethod[2].parameter[4]="";
		parent.paymentmethod[2].parameter[5]="";
		parent.paymentmethod[2].version="shop2dateversion10";
			parent.paymentmethod[3] = new classPaymentMethod;
		parent.paymentmethod[3].caption="Überweisung (Schriftliche Bestellung)";
		parent.paymentmethod[3].info="Bestellen Sie per Brief oder Fax und überweisen Sie den Rechnungsbetrag auf unser Konto.";
		parent.paymentmethod[3].pregateway="Ihre Bestellung wurde verarbeitet. Das sich öffnende Fenster enthält ein Bestellformular, das Sie bitte ausdrucken, ausfüllen und uns zusenden.";
		parent.paymentmethod[3].postgateway="";
		parent.paymentmethod[3].email="Bitte drucken Sie dieses Formular, füllen Sie es aus und senden Sie es unterschrieben an unsere Faxnummer oder die unten angegebene Adresse. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto 600 036 bei der Flessabank Bad Neustadt/S., BLZ 793 301 11, Kontoinhaber Bock e.K. Die Ware wird nach festgestelltem Zahlungseingang so bald als möglich an Sie versandt, bzw. zur Abholung freigegeben.";
		parent.paymentmethod[3].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[3].uid="501264941a134031c";
		parent.paymentmethod[3].price=0;
		parent.paymentmethod[3].vat=16;
		parent.paymentmethod[3].free=0;
		parent.paymentmethod[3].parameter[0]="printremittance";
		parent.paymentmethod[3].parameter[1]="";
		parent.paymentmethod[3].parameter[2]="";
		parent.paymentmethod[3].parameter[3]="";
		parent.paymentmethod[3].parameter[4]="";
		parent.paymentmethod[3].parameter[5]="";
		parent.paymentmethod[3].version="shop2dateversion10";
			parent.paymentmethod[4] = new classPaymentMethod;
		parent.paymentmethod[4].caption="Lastschrift";
		parent.paymentmethod[4].info="Bezahlen Sie bequem und ohne Risiko per Lastschrifteinzug von Ihrem Konto.";
		parent.paymentmethod[4].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adress- und Zahlungsdaten eintragen können. Sobald Sie diese eingegeben und bestätigt haben, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[4].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail.";
		parent.paymentmethod[4].email="Vielen Dank für Ihre Bestellung. Der Rechnungsbetrag wird wunschgemäß bequem und ohne Risiko von Ihrem Konto abgebucht. Hinweis:  Sie ermächtigen uns hiermit widerruflich, die von Ihnen zu entrichtende Zahlung bei Fälligkeit zu Lasten Ihres Kontos mittels Lastschrift einzuziehen. Damit ist auch Ihre Bank ermächtigt, die Lastschrift einzulösen, wobei keine Verpflichtung zur Einlösung besteht, insbesondere dann, wenn Ihr Konto die erforderliche Deckung nicht aufweist. Sie haben das Recht, innerhalb von 42 Kalendertagen ab Abbuchungstag ohne Angabe von Gründen die Rückbuchung bei Ihrer Bank zu veranlassen. ";
		parent.paymentmethod[4].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[4].uid="501264941a133551a";
		parent.paymentmethod[4].price=0;
		parent.paymentmethod[4].vat=16;
		parent.paymentmethod[4].free=0;
		parent.paymentmethod[4].parameter[0]="debit";
		parent.paymentmethod[4].parameter[1]="";
		parent.paymentmethod[4].parameter[2]="";
		parent.paymentmethod[4].parameter[3]="";
		parent.paymentmethod[4].parameter[4]="";
		parent.paymentmethod[4].parameter[5]="";
		parent.paymentmethod[4].version="shop2dateversion10";
			parent.paymentmethod[5] = new classPaymentMethod;
		parent.paymentmethod[5].caption="Lastschrift (Schriftliche Bestellung)";
		parent.paymentmethod[5].info="Faxen oder schicken Sie uns Ihre schriftliche Bestellung und zahlen Sie per Lastschrift.";
		parent.paymentmethod[5].pregateway="Ihre Bestellung wurde verarbeitet. Das sich öffnende Fenster enthält ein ausdruckbares Bestellformular, das Sie bitte ausfüllen und uns zufaxen oder zusenden.";
		parent.paymentmethod[5].postgateway="";
		parent.paymentmethod[5].email="Vielen Dank für Ihre Bestellung. Der Rechnungsbetrag wird wunschgemäß bequem und ohne Risiko von Ihrem Konto abgebucht. Hinweis:  Sie ermächtigen uns hiermit widerruflich, die von Ihnen zu entrichtende Zahlung bei Fälligkeit zu Lasten Ihres Kontos mittels Lastschrift einzuziehen. Damit ist auch Ihre Bank ermächtigt, die Lastschrift einzulösen, wobei keine Verpflichtung zur Einlösung besteht, insbesondere dann, wenn Ihr Konto die erforderliche Deckung nicht aufweist. Sie haben das Recht, innerhalb von 42 Kalendertagen ab Abbuchungstag ohne Angabe von Gründen die Rückbuchung bei Ihrer Bank zu veranlassen.   Bitte drucken Sie dieses Formular, füllen Sie es aus und senden Sie es unterschrieben an unsere Faxnummer oder die unten angegebene Adresse.";
		parent.paymentmethod[5].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[5].uid="501264941a1331719";
		parent.paymentmethod[5].price=0;
		parent.paymentmethod[5].vat=16;
		parent.paymentmethod[5].free=0;
		parent.paymentmethod[5].parameter[0]="printdebit";
		parent.paymentmethod[5].parameter[1]="";
		parent.paymentmethod[5].parameter[2]="";
		parent.paymentmethod[5].parameter[3]="";
		parent.paymentmethod[5].parameter[4]="";
		parent.paymentmethod[5].parameter[5]="";
		parent.paymentmethod[5].version="shop2dateversion10";
			parent.paymentmethod[6] = new classPaymentMethod;
		parent.paymentmethod[6].caption="Rechnung (Bei Neukunden nicht möglich!)";
		parent.paymentmethod[6].info="Bestellen Sie bequem per Rechnung und zahlen Sie nach Erhalt der Ware.  Bitte beachten Sie, daß diese Zahlungsweise bei Neukunden nicht möglich ist.";
		parent.paymentmethod[6].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adressdaten eintragen können. Sobald diese eingegeben und bestätigt wurden, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[6].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail.";
		parent.paymentmethod[6].email="Vielen Dank für Ihre Bestellung.";
		parent.paymentmethod[6].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[6].uid="50126494fc0f8d701";
		parent.paymentmethod[6].price=0;
		parent.paymentmethod[6].vat=16;
		parent.paymentmethod[6].free=0;
		parent.paymentmethod[6].parameter[0]="";
		parent.paymentmethod[6].parameter[1]="";
		parent.paymentmethod[6].parameter[2]="";
		parent.paymentmethod[6].parameter[3]="";
		parent.paymentmethod[6].parameter[4]="";
		parent.paymentmethod[6].parameter[5]="";
		parent.paymentmethod[6].version="shop2dateversion10";
			parent.paymentmethod[7] = new classPaymentMethod;
		parent.paymentmethod[7].caption="Rechnung (Schriftliche Bestellung)(Bei Neukunden leider nicht möglich!)";
		parent.paymentmethod[7].info="Bestellung Sie per Brief oder Fax und bezahlen Sie die Ware bequem nach Erhalt per Rechnung.  Bitte beachten Sie, daß diese Zahlungsweise bei Neukunden nicht möglich ist und auf gegenseitiges Vertrauen beruht.";
		parent.paymentmethod[7].pregateway="Ihre Bestellung wurde verarbeitet. Das sich öffnende Fenster enthält ein Bestellformular, das Sie bitte ausdrucken, ausfüllen und uns zusenden.";
		parent.paymentmethod[7].postgateway="";
		parent.paymentmethod[7].email="Bitte drucken Sie dieses Formular, füllen Sie es aus und senden Sie es unterschrieben an unsere Faxnummer oder die unten angegebene Adresse.";
		parent.paymentmethod[7].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[7].uid="50126494fc0f95902";
		parent.paymentmethod[7].price=0;
		parent.paymentmethod[7].vat=16;
		parent.paymentmethod[7].free=0;
		parent.paymentmethod[7].parameter[0]="printinvoice";
		parent.paymentmethod[7].parameter[1]="";
		parent.paymentmethod[7].parameter[2]="";
		parent.paymentmethod[7].parameter[3]="";
		parent.paymentmethod[7].parameter[4]="";
		parent.paymentmethod[7].parameter[5]="";
		parent.paymentmethod[7].version="shop2dateversion10";
			parent.paymentmethod[8] = new classPaymentMethod;
		parent.paymentmethod[8].caption="Online bestellen und Scheck schicken";
		parent.paymentmethod[8].info="Senden Sie uns einen Verrechnungsscheck.";
		parent.paymentmethod[8].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adressdaten eintragen können. Sobald Sie diese eingegeben und bestätigt haben, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[8].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail. Bitte denken Sie daran, uns einen Scheck über den Rechnungsbetrag zu senden. Die Adresse finden Sie auf unserer Homepage und in der Bestätigungsmail.";
		parent.paymentmethod[8].email="Vielen Dank für Ihre Bestellung. Bitte schicken Sie uns einen Verrechnungsscheck an die unten angegebene Adresse. Sobald der Scheck gutgeschrieben wurde, versenden wir die Ware an Sie oder geben Sie zur Abholung frei.";
		parent.paymentmethod[8].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[8].uid="50126494fc0fa2d03";
		parent.paymentmethod[8].price=6;
		parent.paymentmethod[8].vat=16;
		parent.paymentmethod[8].free=1000;
		parent.paymentmethod[8].parameter[0]="cheque";
		parent.paymentmethod[8].parameter[1]="";
		parent.paymentmethod[8].parameter[2]="";
		parent.paymentmethod[8].parameter[3]="";
		parent.paymentmethod[8].parameter[4]="";
		parent.paymentmethod[8].parameter[5]="";
		parent.paymentmethod[8].version="shop2dateversion10";
			parent.paymentmethod[9] = new classPaymentMethod;
		parent.paymentmethod[9].caption="Scheck (Schriftliche Bestellung)";
		parent.paymentmethod[9].info="Drucken Sie die Bestellung aus und schicken Sie sie uns zusammen mit einem Verrechnungsscheck zu.";
		parent.paymentmethod[9].pregateway="Ihre Bestellung wurde verarbeitet. Das sich öffnende Fenster enthält ein Bestellformular, das Sie bitte ausdrucken, ausfüllen und uns zusammen mit einem Verrechnungsscheck zusenden.";
		parent.paymentmethod[9].postgateway="";
		parent.paymentmethod[9].email="Bitte drucken Sie dieses Formular, füllen Sie es aus und senden Sie es uns unterschrieben zusammen mit einem Verrechnungsscheck an die unten angegebene Adresse zu. Sobald der Scheck gutgeschrieben wurde, versenden wir die Ware an Sie oder geben Sie zur Abholung frei.";
		parent.paymentmethod[9].noship="501264981b0788c01 501264981b078c402 501264981b078eb03 501264981b0791c04";
		parent.paymentmethod[9].uid="50126494fc0fa8f04";
		parent.paymentmethod[9].price=6;
		parent.paymentmethod[9].vat=16;
		parent.paymentmethod[9].free=1000;
		parent.paymentmethod[9].parameter[0]="printcheque";
		parent.paymentmethod[9].parameter[1]="";
		parent.paymentmethod[9].parameter[2]="";
		parent.paymentmethod[9].parameter[3]="";
		parent.paymentmethod[9].parameter[4]="";
		parent.paymentmethod[9].parameter[5]="";
		parent.paymentmethod[9].version="shop2dateversion10";
			parent.paymentmethod[10] = new classPaymentMethod;
		parent.paymentmethod[10].caption="Überweisung Ausland";
		parent.paymentmethod[10].info="Überweisen Sie den Rechnungsbetrag auf unser Konto.";
		parent.paymentmethod[10].pregateway="Ihre Bestellung wurde in unser Shopsystem übermittelt. Wir haben zu Ihrer Sicherheit ein verschlüsselt übertragenes Fenster geöffnet, in das Sie Ihre Adressdaten eintragen können. Sobald diese eingegeben und bestätigt wurden, ist die Bestellung abgeschlossen. Vielen Dank für Ihren Besuch in unserem Shop.";
		parent.paymentmethod[10].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto bei der Flessabank Bad Neustadt/S., IBAN: DE87 7933 0111 0000 6000 36, BIC: FLESDEMM, Kontoinhaber Bock e.K. Die Bankdaten werden Ihnen nochmals mit der Bestätigungsmail gesandt.";
		parent.paymentmethod[10].email="Vielen Dank für Ihre Bestellung. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto bei der Flessabank Bad Neustadt/S., IBAN: DE87 7933 0111 0000 6000 36, BIC: FLESDEMM, Kontoinhaber Bock e.K. Die Ware wird nach festgestelltem Zahlungseingang so bald als möglich an Sie versandt, bzw. zur Abholung freigegeben.";
		parent.paymentmethod[10].noship="501264941a1362d1e 501264941c070f001 501264941c0724f02 501264941c13dcc01";
		parent.paymentmethod[10].uid="501264981b0794605";
		parent.paymentmethod[10].price=0;
		parent.paymentmethod[10].vat=16;
		parent.paymentmethod[10].free=0;
		parent.paymentmethod[10].parameter[0]="";
		parent.paymentmethod[10].parameter[1]="";
		parent.paymentmethod[10].parameter[2]="";
		parent.paymentmethod[10].parameter[3]="";
		parent.paymentmethod[10].parameter[4]="";
		parent.paymentmethod[10].parameter[5]="";
		parent.paymentmethod[10].version="shop2dateversion10";
			parent.paymentmethod[11] = new classPaymentMethod;
		parent.paymentmethod[11].caption="Überweisung Ausland (Schriftliche Bestellung)";
		parent.paymentmethod[11].info="Bestellen Sie per Brief oder Fax und überweisen Sie den Rechnungsbetrag auf unser Konto.";
		parent.paymentmethod[11].pregateway="Ihre Bestellung wurde verarbeitet. Das sich öffnende Fenster enthält ein Bestellformular, das Sie bitte ausdrucken, ausfüllen und uns zusenden.";
		parent.paymentmethod[11].postgateway="";
		parent.paymentmethod[11].email="Bitte drucken Sie dieses Formular, füllen Sie es aus und senden Sie es unterschrieben an unsere Faxnummer oder die unten angegebene Adresse. Bitte überweisen Sie den Rechnungsbetrag auf unser Konto bei der Flessabank Bad Neustadt/S., IBAN: DE87 7933 0111 0000 6000 36, BIC: FLESDEMM, Kontoinhaber Bock e.K. Die Ware wird nach festgestelltem Zahlungseingang so bald als möglich an Sie versandt, bzw. zur Abholung freigegeben.";
		parent.paymentmethod[11].noship="501264941a1362d1e 501264941c070f001 501264941c0724f02 501264941c13dcc01";
		parent.paymentmethod[11].uid="501264981b07bf506";
		parent.paymentmethod[11].price=0;
		parent.paymentmethod[11].vat=16;
		parent.paymentmethod[11].free=0;
		parent.paymentmethod[11].parameter[0]="printremittance";
		parent.paymentmethod[11].parameter[1]="";
		parent.paymentmethod[11].parameter[2]="";
		parent.paymentmethod[11].parameter[3]="";
		parent.paymentmethod[11].parameter[4]="";
		parent.paymentmethod[11].parameter[5]="";
		parent.paymentmethod[11].version="shop2dateversion10";
		}
}


function paymentShow() {
// Bezahl-Methoden anzeigen

	var i,j, totalprice;
	
	definePaymentMethods();
	updateActualPrice();
	
	sum=0;
	totalprice=0;
	
	for (i=0;i<parent.basket.length;i++) {
		sum+=parent.basket[i].quantity;
		totalprice+=parent.basket[i].actualpriceall;
	}	
	
	if (sum==0)	{
		document.write("<p>Der Warenkorb ist leer</p>");
	}
	else {
		document.write("<form name='paymentform'>");
		document.write("<table width='100%' cellpadding='2'>");
		for (i=1;i<parent.paymentmethod.length;i++) {
			
			parent.paymentmethod[i].actualprice=parent.paymentmethod[i].price;
						
			// Versandkostenfrei?
			if ((totalprice>=parent.paymentmethod[i].free) && (parent.paymentmethod[i].free!=0)) {
				parent.paymentmethod[i].actualprice=0;
			}
			
			// Nicht erlaubte Methode?			
			if (parent.selectedshippingmethod!=-1) {
				if (parent.paymentmethod[i].noship.indexOf(parent.shippingmethod[parent.selectedshippingmethod].uid)!=-1) {
  					parent.paymentmethod[i].actualprice=-1;
				}
			}
			
			// GGf Auswahl löschen
			if ((parent.paymentmethod[i].actualprice==-1) && (i==parent.selectedpaymentmethod)) {
				parent.selectedpaymentmethod=-1;
			}
		}
		for (i=1;i<parent.paymentmethod.length;i++) {		
			// Anzeigen
			if (parent.paymentmethod[i].actualprice!=-1) {
				// Wenn nichts gewählt, erstes wählen
				if (parent.selectedpaymentmethod==-1) {
					parent.selectedpaymentmethod=i;
				}
				document.write("<tr>");
				document.write("<td class='s2d'><input type='radio' ")
				if (i==parent.selectedpaymentmethod) {
					document.write("checked ");
				}
				document.write("onclick='setPayment();' name='method' value='"+i+"'></td>");
				document.write("<td class='s2d' width='100%'><strong>"+parent.paymentmethod[i].caption+"</strong><br></td>");
				document.write("<td align='right' nowrap class='s2d'><strong>");
				if (parent.paymentmethod[i].actualprice!=0) {
					document.write(format(parent.paymentmethod[i].actualprice)+" EUR");
				} else {
					document.write("kostenlos");
				}
				document.write("</strong></td>");
				document.write("</tr>");
				if (parent.paymentmethod[i].info!="") {
					document.write("<tr>");
					document.write("<td></td>");
					document.write("<td class='s2d' width='100%'>"+parent.paymentmethod[i].info+"<br><br></td>");
					document.write("<td></td>");
					document.write("</tr>");
				}
			}
		}
		
		// Navigation unten
		document.write("</table>");
		document.write("</form>");		
	
		document.write("<table width='100%' cellpadding='2'>");
		document.write("<tr>");		
		document.write("<td align='left'><a href='s2dship.html'><img src='images/pbskt.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("<td align='right'><a href='s2dsummary.html'><img src='images/pcob.gif' width='180' height='25' alt='' border='0'></a></td>");
		document.write("</tr>");		
		document.write("</table>");		
	}
}

function setPayment() {
// Bezahl-Methode einstellen

	var i;
	parent.selectedpaymentmethod=-1;
	for (i=0;i<document.paymentform.method.length;i++) {
		if (document.paymentform.method[i].checked) {
			parent.selectedpaymentmethod=document.paymentform.method[i].value;
		}
	}
}

function summaryShow() {
// Zusammenfassung zeigen
	summaryShowEx(false);
}

function summaryShowEx(newwindow) {
// Zusammenfassung oder Bestellformular zeigen

	var sum, i, j, found, vatsum, shippingcost, totalweight;
	var vat = new Array;

	var shippingcaption="";
	var paymentcaption="";
	
	var shopaddress="Bock e.K.  -  Handel + Handwerk<br>Meininger Str. 24  -  D-97616 Bad Neustadt/S.<br>Postfach 1147  -  D-97601 Bad Neustadt/S.<br>Fon: +49 97 71 - 23 84  -  Fax: +49 97 71 - 9 72 78<br>Internet: http://www.bock-ek.com  -  E-Mail: mail@bock-ek.com <br>======================================<br>CityEL-Activcenter Rhön-Saale  <br>Meininger Str. 24  -  D-97616 Bad Neustadt/S.<br>Postfach 1147  -  D-97601 Bad Neustadt/S.<br>Fon: +49 97 71 - 89 68  -  Fax: +49 97 71 - 9 72 78<br>Internet: http://www.cityel.info  -  E-Mail: mail@cityel.info <br><br>Ihr Ansprechpartner: Matthias Bock<br><br>HRA 5419 Schweinfurt  -  Ust.-IDNr. DE 205 074 056<br><br>Konto 600 036<br>Flessabank Bad Neustadt - BLZ 793 301 11<br>IBAN: DE87 7933 0111 0000 6000 36<br>BIC: FLESDEMM<br>Kontoinhaber Bock e.K.";
	
	sum=0;
	vatsum=0;
	shippingcost=0;
	totalweight=0;
	
	if (newwindow) {
		// Neues Fenster zum Ausdrucken
	
		mywindow=open("","printwindow","left=10,top=10,width=600,height=550,status=yes,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes");
		mydoc=mywindow.document;
		
		mydoc.write("<html><head><title>Bestellformular</title></head></html>");
		mydoc.write("<body>");

		mydoc.write("<style>");
		mydoc.write("td.s2d {font-size:10pt; font-family : Arial, Helvetica, sans-serif;} ");
		mydoc.write("h1.s2d {font-family: Arial, Helvetica, sans-serif; font-size: 20pt; font-weight : bold; margin-top : 0pt; margin-bottom : 0pt;} ");
		mydoc.write("</style>");
		
		mydoc.write("<table width='100%' cellpadding='5' cellspacing='3' border='0'>");
		mydoc.write("<tr><td class='s2d'><h1 class='s2d'>Bestellformular</h1></td></tr>");
		mydoc.write("<tr><td class='s2d'>"+parent.paymentmethod[parent.selectedpaymentmethod].email+"<br></td></tr>");

		mydoc.write("<tr><td class='s2d'><br></td></tr>");
		mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Name:</strong><br></td></tr>");
		mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Adresse:</strong><br></td></tr>");
		mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>PLZ und Ort:</strong><br></td></tr>");
		mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Telefonnummer:</strong><br></td></tr>");

		mydoc.write("<tr><td class='s2d'><br></td></tr>");
		
		switch (parent.paymentmethod[parent.selectedpaymentmethod].parameter[0]) {
			case "printdebit":
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kontonummer:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Bankleitzahl:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kreditinstitut:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kontoinhaber:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d'><br></td></tr>");
				break;
			case "printcreditcard":
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kartentyp (bitte ankreuzen): "+parent.paymentmethod[parent.selectedpaymentmethod].parameter[1]+"</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kartennummer:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Karteninhaber:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Gültig bis:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d'><br></td></tr>");
				break;
			case "printcreditcardcvc":
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kartentyp (bitte ankreuzen): "+parent.paymentmethod[parent.selectedpaymentmethod].parameter[1]+"</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Kartennummer:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>CVV/CVC-Nummer:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Karteninhaber:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Gültig bis:</strong><br></td></tr>");
				mydoc.write("<tr><td class='s2d'><br></td></tr>");
				break;
		}

		mydoc.write("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Datum, Ort, Unterschrift:</strong><br></td></tr>");		
		mydoc.write("<tr><td class='s2d'><br></td></tr>");

		mydoc.write("</table>");
	}
	else {
		mydoc=document;
	}
	
	// Überschrift

	mydoc.write("<table width='100%' cellpadding='2'>");
	mydoc.write("<tr>");
	mydoc.write("<td align='left' colspan='2' class='s2d'><strong>Anzahl</strong></td>");
	mydoc.write("<td width='100%' class='s2d'><strong>Bezeichnung</strong></td>");
		mydoc.write("<td nowrap align='right' class='s2d'><strong>Einzelpreis</strong></td>");
	mydoc.write("<td nowrap align='right' class='s2d'><strong>Gesamtpreis</strong></td>");
	mydoc.write("</tr>");
	mydoc.write("<tr>");
	
	// Positionen
	
	for (i=0;i<parent.basket.length;i++) {
		if (parent.basket[i].quantity!=0) {
			mydoc.write("<tr>");
			mydoc.write("<td class='s2d'>"+parent.basket[i].quantity+"</td>");
			mydoc.write("<td class='s2d'>"+htmlChars(parent.basket[i].unit)+"&nbsp;</td>");
			mydoc.write("<td width='100%' class='s2d'>"+htmlChars(parent.basket[i].caption));
						mydoc.write("</td>");
						mydoc.write("<td nowrap align='right' class='s2d'>"+format(parent.basket[i].actualpriceone)+" EUR</td>");
			mydoc.write("<td nowrap align='right' class='s2d'>"+format(parent.basket[i].actualpriceall)+" EUR</td>");
			mydoc.write("</tr>");
			
			sum+=parent.basket[i].actualpriceall;
			totalweight+=parent.basket[i].weight*parent.basket[i].quantity;

			// Ust rechnen
			addVat(vat,parent.basket[i].vat,parent.basket[i].actualpriceall);
		}
	}
	
	// Abstand

	mydoc.write("<tr>");
			mydoc.write("<td colspan='5' align='left' class='s2d'></td>");		
		mydoc.write("</tr>");
	
	// Versandkosten
	
	i=parent.selectedshippingmethod;
	if (i!=-1) {
		shippingcaption=parent.shippingmethod[i].caption;
		if (parent.shippingmethod[i].actualprice!=0) {
			shippingcost=parent.shippingmethod[i].actualprice;
			addVat(vat, parent.shippingmethod[i].vat, parent.shippingmethod[i].actualprice);
		}
	}	

	i=parent.selectedpaymentmethod;
	if (i!=-1) {
		paymentcaption=parent.paymentmethod[i].caption;
		if (parent.paymentmethod[i].price!=0) {
			shippingcost+=parent.paymentmethod[i].actualprice;
			addVat(vat, parent.paymentmethod[i].vat, parent.paymentmethod[i].actualprice);
		}
	}	
	
	sum+=shippingcost;
		
	mydoc.write("<tr>");
			mydoc.write("<td colspan='4' align='right' class='s2d'>Versandkosten:</td>");
		mydoc.write("<td nowrap align='right' class='s2d'>"+format(shippingcost)+" EUR</td>");
	mydoc.write("</tr>");

	// Abstand

	mydoc.write("<tr>");
			mydoc.write("<td colspan='5' align='left'></td>");		
		mydoc.write("</tr>");
	
	
	// Ust zeigen	
	vat.sort(sortVat);

			for (i=0;i<vat.length;i++) {
			mydoc.write("<tr>");
			mydoc.write("<td colspan='4' align='right' class='s2d'>"+vat[i].percent+"% USt.:</td>");
			mydoc.write("<td nowrap align='right' class='s2d'>"+format(vat[i].amount)+" EUR</td>");
			mydoc.write("</tr>");
		}	

		mydoc.write("<tr>");
		mydoc.write("<td colspan='6' align='left'></td>");		
		mydoc.write("</tr>");

		mydoc.write("<tr>");
		mydoc.write("<td colspan='4' align='right' class='s2d'><strong>Endsumme:</strong></td>");
		mydoc.write("<td nowrap align='right' class='s2d'><strong>"+format(sum)+" EUR</strong></td>");
		mydoc.write("</tr>");
			
	mydoc.write("</table>");
	mydoc.write("</form>");
	
	mydoc.write("<table cellpadding='2'>");

	mydoc.write("<tr>");
	mydoc.write("<td nowrap class='s2d'>Gewünschte Versandart: </td>");
	mydoc.write("<td nowrap class='s2d'>"+shippingcaption+"</td>");
	mydoc.write("</tr>");
	
	if (totalweight>0) {
		mydoc.write("<tr>");
		mydoc.write("<td nowrap class='s2d'>Gesamtgewicht: </td>");
		mydoc.write("<td nowrap class='s2d'>"+formatweight(totalweight)+" kg</td>");
		mydoc.write("</tr>");
	}

	mydoc.write("<tr>");
	mydoc.write("<td nowrap class='s2d'>Gewünschte Zahlungsweise: </td>");
	mydoc.write("<td nowrap class='s2d'>"+paymentcaption+"</td>");
	mydoc.write("</tr>");
	
	mydoc.write("<tr>");
	mydoc.write("<td nowrap class='s2d' colspan='2'><br></td>");
	mydoc.write("</tr>");

	mydoc.write("</table>");	
		
	if (newwindow) {
		mydoc.write("<table cellpadding='2' width='100%'><tr><td class='s2d' align='center'><br>"+shopaddress+"</td></tr></table>");
		mydoc.write("</body>");
		mydoc.write("</html>");
		mydoc.close();
	}
	else {
		mydoc.write("<table cellpadding='2' width='100%'>");
		mydoc.write("<tr><td class='s2d'><p>Bitte überprüfen Sie Ihre Eingaben. Sie können diese durch Klicken auf \"Zurück\" korrigieren. Wenn alle Eingaben richtig sind, klicken Sie auf \"Weiter\".</p>");
						mydoc.write("</td></tr>");		
		mydoc.write("<form name='formagb'><tr><td class='s2d'><input type='checkbox' name='checkagb' value='1'><strong>Ich habe die AGB zur Kenntnis genommen.</strong><br><br></td></tr></form>");
		mydoc.write("</table>");

		// Jetzt das versteckte Transfer-Formular
		
		switch (parent.paymentmethod[parent.selectedpaymentmethod].parameter[0]) {
			case "iclear":
				// iClear-Modus
		
				mydoc.write("<form name='orderform' action='https://www.iclear.de/servlets/GenBuyTool' method='post' target='orderwindow'>");
				mydoc.write("<input type='hidden' name='ShopID' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[1]+"'>");
				mydoc.write("<input type='hidden' name='BasketID' value='shop to date order'>");
				mydoc.write("<input type='hidden' name='Currency' value='EUR'>");
				j=0;
				
				var products="";
			
				// Produkt-Schleife
			
				for (i=0;i<parent.basket.length;i++) {
					if (parent.basket[i].quantity!=0) {
						j++;
						products+=iclearChars(parent.basket[i].caption)+"::";
						products+=iclearChars(parent.basket[i].id)+"::";
						products+=parent.basket[i].quantity+"::";
													products+=parent.basket[i].actualpriceone/(parent.basket[i].vat/100+1)+"::";
 							products+=parent.basket[i].actualpriceone+"::";
												products+=parent.basket[i].vat+":::";
					}
				}
			
				// Versandart als Produkt

				j++;
				products+=iclearChars("Gewünschte Versandart "+shippingcaption)+"::";
				products+="::";
				products+="1::";
									products+=shippingcost/(parent.shippingmethod[parent.selectedshippingmethod].vat/100+1)+"::";
					products+=shippingcost+"::";
								products+=parent.shippingmethod[parent.selectedshippingmethod].vat+":::";

				mydoc.write("<input type='hidden' name='Products' value='"+products+"'>");
				mydoc.write("<input type='hidden' name='ProductIndex' value='"+j+"'>");
				mydoc.write("</form>");
				break;

			default:
				// Normal-Modus
		
				mydoc.write("<form name='orderform' action='http://www.bock-ek.com/gateway.php' method='post' target='orderwindow'>");
				j=0;
				for (i=0;i<parent.basket.length;i++) {
					if (parent.basket[i].quantity!=0) {
						j++;
						mydoc.write("<input type='hidden' name='PUID"+j+"' value='"+parent.basket[i].uid+"'>");
						mydoc.write("<input type='hidden' name='PPID"+j+"' value='"+htmlChars(parent.basket[i].id)+"'>");
						mydoc.write("<input type='hidden' name='PQNT"+j+"' value='"+parent.basket[i].quantity+"'>");
						mydoc.write("<input type='hidden' name='PUNT"+j+"' value='"+htmlChars(parent.basket[i].unit)+"'>");
						mydoc.write("<input type='hidden' name='PCAP"+j+"' value='"+htmlChars(parent.basket[i].caption)+"'>");
						mydoc.write("<input type='hidden' name='PPRI"+j+"' value='"+parent.basket[i].actualpriceone+"'>");
						mydoc.write("<input type='hidden' name='PVAT"+j+"' value='"+parent.basket[i].vat+"'>");
						mydoc.write("<input type='hidden' name='PRVA"+j+"' value='"+parent.basket[i].variationa+"'>");
						mydoc.write("<input type='hidden' name='PRVB"+j+"' value='"+parent.basket[i].variationb+"'>");
					}
				}
				mydoc.write("<input type='hidden' name='OPAY' value='"+htmlChars(paymentcaption)+"'>");
				mydoc.write("<input type='hidden' name='OSHP' value='"+htmlChars(shippingcaption)+"'>");
				mydoc.write("<input type='hidden' name='OCUR' value='EUR'>");
				mydoc.write("<input type='hidden' name='OB2B' value=''>");
				mydoc.write("<input type='hidden' name='OSPR' value='"+shippingcost+"'>");
				mydoc.write("<input type='hidden' name='OSPV' value='"+parent.shippingmethod[parent.selectedshippingmethod].vat+"'>");
				mydoc.write("<input type='hidden' name='OWGT' value='"+totalweight+"'>");
				mydoc.write("<input type='hidden' name='OTOT' value='"+(sum+vatsum)+"'>");
				mydoc.write("<input type='hidden' name='OTVT' value='"+vatsum+"'>");
				mydoc.write("<input type='hidden' name='GVER' value='"+parent.paymentmethod[parent.selectedpaymentmethod].version+"'>");
				mydoc.write("<input type='hidden' name='GPR0' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[0]+"'>");
				mydoc.write("<input type='hidden' name='GPR1' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[1]+"'>");
				mydoc.write("<input type='hidden' name='GPR2' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[2]+"'>");
				mydoc.write("<input type='hidden' name='GPR3' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[3]+"'>");
				mydoc.write("<input type='hidden' name='GPR4' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[4]+"'>");
				mydoc.write("<input type='hidden' name='GPR5' value='"+parent.paymentmethod[parent.selectedpaymentmethod].parameter[5]+"'>");
				mydoc.write("<input type='hidden' name='GMSP' value='"+htmlChars(parent.paymentmethod[parent.selectedpaymentmethod].postgateway)+"'>");
				mydoc.write("<input type='hidden' name='GMSE' value='"+htmlChars(parent.paymentmethod[parent.selectedpaymentmethod].email)+"'>");
				mydoc.write("<input type='hidden' name='GSAD' value='"+htmlChars(shopaddress)+"'>");
				mydoc.write("<input type='hidden' name='GNEW' value='1'>");
				mydoc.write("<input type='hidden' name='GTSI' value=''>");
				mydoc.write("</form>");
		}
		mydoc.write("<table width='100%' cellpadding='2'>");
		mydoc.write("<tr>");		
		mydoc.write("<td align='left'><a href='s2dpayment.html'><img src='images/pbskt.gif' width='180' height='25' alt='' border='0'></a></td>");
		mydoc.write("<td align='right'><a href='' onclick='submitOrder();return false;'><img src='images/pcob.gif' width='180' height='25' alt='' border='0'></a></td>");
		mydoc.write("</tr>");		
		mydoc.write("</table>");

	}
}

function completeShow() {
	
	// Abschlußscreen zeigen

	document.write("<p>"+parent.paymentmethod[parent.selectedpaymentmethod].pregateway+"<br><br><br></p>");
	document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>");
	document.write("<td align='left'><a href='s2dsummary.html'><img src='images/pbskt.gif' width='180' height='25' alt='' border='0'></a></td>");
	document.write("<td align='right'><a onclick='parent.basket.length=0;return true;' href='./index.html'><img src='images/psmb.gif' width='180' height='25' alt='' border='0'></a></td>");
	document.write("<tr>");
	document.write("</table>");
}

function submitOrder() {

	// Bestellung absenden
	
	if (!document.formagb.checkagb.checked) {
		alert("Bitte lesen Sie unsere AGB und markieren Sie das Feld \"Ich habe die AGB zur Kenntnis genommen\", bevor Sie fortfahren.")
	}
	else {

		switch (parent.paymentmethod[parent.selectedpaymentmethod].parameter[0]) {
		case "printdebit":
		case "printcod":
		case "printcheque":
		case "printremittance":
		case "printcreditcard":
		case "printcreditcardcvc":
		case "printinvoice":
			summaryShowEx(true);	
			self.location="s2dcomplete.html";
			break;
		default:
			var mywindow=window.open("","orderwindow","left=10,top=10,width=600,height=550,status=yes,scrollbars=yes");
			mywindow.focus();
			document.orderform.submit();
			self.location="s2dcomplete.html";
		}
	}
}

