/*
--------------------------------------------------
Layout:   cryptasMEDIA
Autor:    Roman Scherzer
          CRYPTAS it-Security & Media GmbH
Datei:    shop2date.js
Funktion: JavaScript-Funktionen
Sprache:  Englisch
--------------------------------------------------
*/
//--------------------
// 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

	if(num<0)return num; // für Gutscheine, die "Negativ" sind
	
	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, mycookie) {
	// Einen Cookie setzen
	var expires = new Date();
	expires.setFullYear(expires.getFullYear()+1);
	document.cookie = "s2d" + mycookie + "=" + escape(myvalue) + "; expires=" + expires.toGMTString() + "; path=/";
}

function getCookie(mycookie) {
	// Einen Cookie lesen
	var pos=document.cookie.indexOf("s2d" + mycookie + "=");
		
	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, "m");
}

function getMemo() {
	// Den Array mit dem Merkzettel liefern
	var mymemo = new Array();
	var myvalue = getCookie("m");
		
	if (myvalue != null && myvalue !="") {
		mymemo = myvalue.split("||||");
		for (i = 0; i < mymemo.length; i++) {
			mymemo[i] = mymemo[i].split("|||");
		}
	}
	return mymemo;
}

function clearCookie() {
	// Cookie löschen
	if (confirm("Do you really want to delete your memo?")) {
		setCookie("", "m");
		location.reload()
	}
}

function memoShow() {
	// Den Merkzetteln anzeigen
	var mymemo=getMemo();
	
	if (mymemo.length==0) {
		document.write ("<p>There are no products on your memo.</p>");
	} else {
		document.write ("<table width='100%' cellpadding='2' cellspacing='0' border='0'>");
		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 ("</a></td></tr>");
		}
		document.write ("<tr>");		
		document.write ("<td class='s2d' align='right'><br><a href='#' onclick='clearCookie();return false;'><img src='images/pcs_btn_clearmemo.jpg' name='cs_btn_clearmemo' id='cs_btn_clearmemo' border='0' onmouseover=\"MM_swapImage('cs_btn_clearmemo','','images/pcs_btn_clearmemo_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("</table>");	
		document.write ("<p><br>On the memo you can put products for observation, and you can look at them again at later visits of this shop. Click on an entry to display the product. In order for the memo to work, you need to have Cookies activated.</p>");	
	}
}

function addMemo(myproduct, myurl) {
// Auf den Merkzettel hinzufügen
	var mymessage="The product \"[c]\" has been added to your memo.";
	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("Your chosen option is not deliverable. Please choose a different combination.");
	}
	else {
		// Nicht null!
		if (myquantity <= 0) {
			alert("Please enter a valid number.");
		}
		else {
			message="Do you want to add [n] [u] \"[c]\" to your shopping cart?";
			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="The maximum order quantity of the product \"[c]\" is [n] [u] - the order amount has been adjusted automatically.";
					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="The minimum order quantity of the product \"[c]\" is [n] [u] - the order amount has been adjusted automatically.";
					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() {
	// Warenkorb 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>Your shopping cart is empty</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>Quantity</strong></td>");
		document.write ("<td width='100%' class='s2d'><strong>Item</strong></td>");
					document.write ("<td nowrap class='s2d'><strong>VAT</strong></td>");
				document.write ("<td nowrap align='right' class='s2d'><strong>Unit price</strong></td>");
		document.write ("<td nowrap align='right' class='s2d'><strong>Subtotal</strong></td>");
		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/pcs_trash.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 class='s2d'>"+parent.basket[i].vat+"%</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);
			}
		}
		
		// Leerzeile
		document.write ("<tr>");
					document.write ("<td colspan='7' align='left' class='s2d'>&nbsp;</td>");		
				document.write ("</tr>");
		
		// USt. ausgeben
		vat.sort(sortVat);
		
			//B2B-Shop
			// Netto
			document.write ("<tr>");
			document.write ("<td colspan='5' align='left' class='s2d'>&nbsp;</td>");		
			document.write ("<td align='right' class='s2d'><strong>Net:</strong></td>");
			document.write ("<td nowrap align='right' class='s2d'><strong>"+format(sum)+" EUR</strong></td>");
			document.write ("</tr>");
			document.write ("<tr>");
			document.write ("<td colspan='7' align='left' class='s2d'>&nbsp;</td>");		
			document.write ("</tr>");
			
			// USt
			for (i = 0; i < vat.length; i++) {
				document.write ("<tr>");
				document.write ("<td colspan='6' align='right' class='s2d'>"+vat[i].percent+"% VAT:</td>");
				document.write ("<td nowrap align='right' class='s2d'>"+format(vat[i].amount)+" EUR</td>");
				document.write ("</tr>");
				vatsum = vatsum + vat[i].amount;
			}	
			
			// Brutto
			document.write ("<tr>");
			document.write ("<td colspan='5' align='left' class='s2d'><input type='image' onclick='reCalc();location.reload();return false;' src='images/pcs_btn_basketrecalc.jpg' name='calc' border='0' onmouseover=\"MM_swapImage('calc','','images/pcs_btn_basketrecalc_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></td>");
			document.write ("<td align='right' class='s2d'><strong>Gross:</strong></td>");
			document.write ("<td nowrap align='right' class='s2d'><strong>"+format(sum+vatsum)+" EUR</strong></td>");
			document.write ("</tr>");

				
		document.write ("</table>");
		document.write ("</form>");
		
		// Navigation und Anmerkungen
		document.write ("<table width='100%' cellpadding='2' class='s2d'>");
		document.write ("<tr>");		
		
		// Button "Weiter einkaufen"
		document.write ("<td align='left' class='s2d'><a href='/en/products/index.php'><img src='images/pcs_btn_basketshopmore.jpg' name='cs_btn_basketshopmore' id='cs_btn_basketshopmore' border='0' onmouseover=\"MM_swapImage('cs_btn_basketshopmore','','images/pcs_btn_basketshopmore_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		
		// Button "Jetzt bestellen!"
		document.write ("<td align='right' class='s2d'><a href='s2dship.php' onclick='reCalc();return true;'><img src='images/pcs_btn_basketorder.jpg' name='cs_btn_basketorder' id='cs_btn_basketorder' border='0' onmouseover=\"MM_swapImage('cs_btn_basketorder','','images/pcs_btn_basketorder_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("</tr>");
		
				// Projektanfrage senden
		document.write ("<form action='https://ssl.cryptoshop.com/en/projectenquiry.php' method='post' target='_top' name='projectform' onsubmit='checkProject();return false;'>");
		document.write ("<tr>");
		
		// Warenkorb im Parentfenster als versteckte Felder für die übergabe per Post an das PHP.
		j=0;
		for (i=0;i<parent.basket.length;i++) {
			if (parent.basket[i].quantity!=0) {
				j++;
				document.write ("<input type='hidden' name='PUID"+j+"' value='"+parent.basket[i].uid+"'>");
				document.write ("<input type='hidden' name='PPID"+j+"' value='"+htmlChars(parent.basket[i].id)+"'>");
				document.write ("<input type='hidden' name='PQNT"+j+"' value='"+parent.basket[i].quantity+"'>");
				document.write ("<input type='hidden' name='PUNT"+j+"' value='"+htmlChars(parent.basket[i].unit)+"'>");
				document.write ("<input type='hidden' name='PCAP"+j+"' value='"+htmlChars(parent.basket[i].caption)+"'>");
				document.write ("<input type='hidden' name='PPRI"+j+"' value='"+parent.basket[i].actualpriceone+"'>");
				document.write ("<input type='hidden' name='PVAT"+j+"' value='"+parent.basket[i].vat+"'>");
				document.write ("<input type='hidden' name='PRVA"+j+"' value='"+parent.basket[i].variationa+"'>");
				document.write ("<input type='hidden' name='PRVB"+j+"' value='"+parent.basket[i].variationb+"'>");
			}
		}

		document.write ("<input type='hidden' name='OCUR' value='EUR'>");
		document.write ("<input type='hidden' name='OB2B' value='1'>");
		document.write ("<input type='hidden' name='OTOT' value='"+(sum+vatsum)+"'>");
		document.write ("<input type='hidden' name='OTVT' value='"+vatsum+"'>");
		document.write ("<input type='hidden' name='GVER' value='shop2dateversion10'>"); // nach GVER wird in der projectprice abgefragt, ist sie nicht definiert, kommt eine fehlermeldung (direkter zugriff nicht möglich)
		
		document.write ("<input type='hidden' name='GNEW' value='1'>");
		document.write ("<input type='hidden' name='GTSI' value=''>");
		
		document.write ("<td colspan='2' align='right' class='s2d'><input type='image' src='images/pcs_btn_basketproject.jpg' name='cs_btn_basketproject' id='cs_btn_basketproject' border='0' onmouseover=\"MM_swapImage('cs_btn_basketproject','','images/pcs_btn_basketproject_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></td>");
		document.write ("</tr>");
		document.write ("</form>");

		// Button "Projektanfrage senden"
		//document.write ("<form action='https://ssl.cryptoshop.com/en/projectenquiry.php' method='post' name='projectform' onsubmit='checkProject();return false;'>");
		//document.write ("<tr>");
		//document.write ("<td colspan='2' align='right' class='s2d'><input type='image' src='images/pcs_btn_basketproject.jpg' name='cs_btn_basketproject' id='cs_btn_basketproject' border='0' onmouseover=\"MM_swapImage('cs_btn_basketproject','','images/pcs_btn_basketproject_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></td>");
		//document.write ("</tr>");
		//document.write ("</form>");
		
		// Button "Partnerpreise anfragen"
		//document.write ("<form action='https://ssl.cryptoshop.com/en/partnerenquiry.php' method='post' name='partnerform' onsubmit='checkPartner();return false;'>");
		//document.write ("<tr>");
		//document.write ("<td colspan='2' align='right' class='s2d'><input type='image' src='images/pcs_btn_basketpartner.jpg' name='cs_btn_basketpartner' id='cs_btn_basketpartner' border='0' onmouseover=\"MM_swapImage('cs_btn_basketpartner','','images/pcs_btn_basketpartner_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></td>");
		//document.write ("</tr>");
		//document.write ("</form>");
		
		// Leerzeile
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		
		// Anmerkungen
		document.write ("<tr>");
		document.write ("<td colspan='2' align='left' class='s2d'><strong>Order now</strong><br>You have all items in your shopping cart? Then click on 'Order now!' and choose on the following pages your prefered delivery and payment option! On the last page, we ask you to enter data. There you can enter and check your european VAT ID-number (VIES). If the VAT-ID is valid, no austrian VAT will be settled. In case of Non-EU customers no VAT will be charged. </td>");
//		document.write ("<td colspan='2' align='left' class='s2d'><strong>Order now</strong><br>You have all items in your shopping cart? Then click on 'Order now!' and choose on the following pages your prefered delivery and payment option! </td>");
		document.write ("</tr>");
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		document.write ("<tr>");
		document.write ("<td colspan='2' align='left' class='s2d'><strong>Ask for Project Offer</strong><br>If you need quantities above the price scale on cryptoshop.com resp. the whole sum is is exceeding <strong>EUR 1.999,- excl. VAT</strong>, you have the possibility to get an <strong>individual quotation from cryptoshop.com</strong>! First put all items in the necessary quantity into the shopping cart and click on <a href='javascript:checkProject()'>Ask for Project Offer</a>! You will get a SSL-encrypted page, where you can leave your contact data and a quick project statement. We will send you an individual quotation <strong> by e-mail !</strong></td>");
		//document.write ("</tr>");
		//document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		//document.write ("<tr>");
		//document.write ("<td colspan='2' align='left' class='s2d'><strong>Ask for Partner Offer</strong><br>As registererd <a href='/en/common/menue/partner/index.php'>Cryptoshop Partner</a> you have the possibility to get all Products with special Reseller Prices! Put all products in the necessary quantity into the shopping cart and click on <a href='https://ssl.cryptoshop.com/en/partnerenquiry.php'>Ask for Partner Offer</a>! You will get a SSL-encrypted page, where you can leave the data about your company and your contact data. Within 24 hours we will contact you for further discussions about our partnership!</td>");
		//document.write ("</tr>");
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		document.write ("<tr>");
		document.write ("<td colspan='2' align='left' class='s2d'><strong>Notice</strong><br>The stated gross price is excluding costs of delivery and payment.<br>These costs depend on the net sum, weight, country, delivery and payment options. Details about this on the next pages!</td>");
		document.write ("</tr>");
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		document.write ("<tr>");
		document.write ("<td colspan='2' align='left' class='s2d'><strong>ATTENTION:</strong><br>During the order process - only use the yellow buttons please! - For security reasons the shopping cart is deleted if you press the \"Reload\"-Button of your browser!</font></td>");
		document.write ("</tr>");
		document.write ("</table>");
	}
}

function checkProject() {
	// Projektvoraussetzung Gesamtnettosumme (> EUR 1.999,- excl. VAT) überprüfen
	var i, totalprice;
	
	totalprice = 0;
	updateActualPrice();
	
	for (i = 0; i < parent.basket.length; i++) {
		totalprice += parent.basket[i].actualpriceall;
	}	

	if (totalprice < 2000) {
		var myProjectMessage="For project offer the net sum has to be at least EUR 2.000,- !";
		alert (myProjectMessage);
	}
	else {
		document.projectform.submit();
	}
}

function checkPartner() {
	summaryShowEx(false);
}

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 * rate / 100;
			}
}

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].quantity!=0)) {
				message="The maximum order quantity of the product \"[c]\" is [n] [u] - the order amount has been adjusted automatically.";
				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].quantity!=0)) {
				message="The minimum order quantity of the product \"[c]\" is [n] [u] - the order amount has been adjusted automatically.";
				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 = "Do you really want to delete \"[c]\" from your shopping cart?";
	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="By mail  (only Austria)";
		parent.shippingmethod[1].info="By mail (only Austria)";
		parent.shippingmethod[1].uid="000000943a1210701";
		parent.shippingmethod[1].free=150;
		parent.shippingmethod[1].vat=20;
					parent.shippingmethod[1].price[1]=4.2;				
			parent.shippingmethod[1].weight[1]=2;				
					parent.shippingmethod[1].price[2]=5.2;				
			parent.shippingmethod[1].weight[2]=4;				
					parent.shippingmethod[1].price[3]=6.2;				
			parent.shippingmethod[1].weight[3]=8;				
					parent.shippingmethod[1].price[4]=7.6;				
			parent.shippingmethod[1].weight[4]=12;				
					parent.shippingmethod[1].price[5]=9.6;				
			parent.shippingmethod[1].weight[5]=20;				
					parent.shippingmethod[2] = new classShippingMethod;
		parent.shippingmethod[2].caption="By mail (only Germany)";
		parent.shippingmethod[2].info="By mail (only Germany)";
		parent.shippingmethod[2].uid="50065898af0b7fc05";
		parent.shippingmethod[2].free=200;
		parent.shippingmethod[2].vat=20;
					parent.shippingmethod[2].price[1]=12.95;				
			parent.shippingmethod[2].weight[1]=1;				
					parent.shippingmethod[2].price[2]=13.7;				
			parent.shippingmethod[2].weight[2]=2;				
					parent.shippingmethod[2].price[3]=15.95;				
			parent.shippingmethod[2].weight[3]=5;				
					parent.shippingmethod[2].price[4]=19.7;				
			parent.shippingmethod[2].weight[4]=10;				
					parent.shippingmethod[2].price[5]=27.2;				
			parent.shippingmethod[2].weight[5]=20;				
					parent.shippingmethod[3] = new classShippingMethod;
		parent.shippingmethod[3].caption="By mail (Italy, Czech, Slovakia, Hungary, Slovenia)";
		parent.shippingmethod[3].info="By mail to Austrias  EU-neighbours (Italy, Czech, Slovakia, Hungary, Slovenia)";
		parent.shippingmethod[3].uid="500658950309cc901";
		parent.shippingmethod[3].free=200;
		parent.shippingmethod[3].vat=20;
					parent.shippingmethod[3].price[1]=13.7;				
			parent.shippingmethod[3].weight[1]=1;				
					parent.shippingmethod[3].price[2]=15.2;				
			parent.shippingmethod[3].weight[2]=2;				
					parent.shippingmethod[3].price[3]=19.7;				
			parent.shippingmethod[3].weight[3]=5;				
					parent.shippingmethod[3].price[4]=27.2;				
			parent.shippingmethod[3].weight[4]=10;				
					parent.shippingmethod[3].price[5]=42.2;				
			parent.shippingmethod[3].weight[5]=20;				
					parent.shippingmethod[4] = new classShippingMethod;
		parent.shippingmethod[4].caption="By mail (other EU-countries, Switzerland)";
		parent.shippingmethod[4].info="By Mail (other EU countries incl. Switzerland and Liechtenstein, no outer european regions)";
		parent.shippingmethod[4].uid="50065894f70a57f12";
		parent.shippingmethod[4].free=200;
		parent.shippingmethod[4].vat=20;
					parent.shippingmethod[4].price[1]=14.2;				
			parent.shippingmethod[4].weight[1]=1;				
					parent.shippingmethod[4].price[2]=16.2;				
			parent.shippingmethod[4].weight[2]=2;				
					parent.shippingmethod[4].price[3]=22.2;				
			parent.shippingmethod[4].weight[3]=5;				
					parent.shippingmethod[4].price[4]=32.2;				
			parent.shippingmethod[4].weight[4]=10;				
					parent.shippingmethod[4].price[5]=52.2;				
			parent.shippingmethod[4].weight[5]=20;				
					parent.shippingmethod[5] = new classShippingMethod;
		parent.shippingmethod[5].caption="Customer pickup";
		parent.shippingmethod[5].info="You can pick up your ordered goods in 1030 Vienna and save the dispatching costs.";
		parent.shippingmethod[5].uid="50065894f60f3a018";
		parent.shippingmethod[5].free=0;
		parent.shippingmethod[5].vat=0;
					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="Download - Online";
		parent.shippingmethod[6].info="Online Software and Licence Codes will be delivered online by download or mail - and is of course free of charge";
		parent.shippingmethod[6].uid="500658970b089bc01";
		parent.shippingmethod[6].free=0;
		parent.shippingmethod[6].vat=20;
					parent.shippingmethod[6].price[1]=0;				
			parent.shippingmethod[6].weight[1]=0;				
					parent.shippingmethod[6].price[2]=0;				
			parent.shippingmethod[6].weight[2]=0;				
					parent.shippingmethod[6].price[3]=0;				
			parent.shippingmethod[6].weight[3]=0;				
					parent.shippingmethod[6].price[4]=0;				
			parent.shippingmethod[6].weight[4]=0;				
					parent.shippingmethod[6].price[5]=0;				
			parent.shippingmethod[6].weight[5]=0;				
					parent.shippingmethod[7] = new classShippingMethod;
		parent.shippingmethod[7].caption="UPS Standard IT,FR,BENELUX";
		parent.shippingmethod[7].info="UPS Standard Shipment to Italy, France, Belgium, Netherlands and Luxembourg, Germany (max. 30 kg)";
		parent.shippingmethod[7].uid="5006589bbb0b84e01";
		parent.shippingmethod[7].free=0;
		parent.shippingmethod[7].vat=20;
					parent.shippingmethod[7].price[1]=12.77;				
			parent.shippingmethod[7].weight[1]=2;				
					parent.shippingmethod[7].price[2]=14.03;				
			parent.shippingmethod[7].weight[2]=5;				
					parent.shippingmethod[7].price[3]=15.22;				
			parent.shippingmethod[7].weight[3]=10;				
					parent.shippingmethod[7].price[4]=19.67;				
			parent.shippingmethod[7].weight[4]=20;				
					parent.shippingmethod[7].price[5]=24;				
			parent.shippingmethod[7].weight[5]=30;				
					parent.shippingmethod[8] = new classShippingMethod;
		parent.shippingmethod[8].caption="UPS Standard CZ, SK, HU, PL";
		parent.shippingmethod[8].info="UPS Standard Shipment to Czech Rep. Slovakia, Hungary, Poland (max. 30 kg)";
		parent.shippingmethod[8].uid="5006589bbb0bbe903";
		parent.shippingmethod[8].free=0;
		parent.shippingmethod[8].vat=20;
					parent.shippingmethod[8].price[1]=14.5;				
			parent.shippingmethod[8].weight[1]=2;				
					parent.shippingmethod[8].price[2]=15.81;				
			parent.shippingmethod[8].weight[2]=5;				
					parent.shippingmethod[8].price[3]=16.97;				
			parent.shippingmethod[8].weight[3]=10;				
					parent.shippingmethod[8].price[4]=21.05;				
			parent.shippingmethod[8].weight[4]=20;				
					parent.shippingmethod[8].price[5]=30.29;				
			parent.shippingmethod[8].weight[5]=30;				
					parent.shippingmethod[9] = new classShippingMethod;
		parent.shippingmethod[9].caption="UPS Standard GB, DK";
		parent.shippingmethod[9].info="UPS Standard to Great Britain, Denmark (max. 30 kg)";
		parent.shippingmethod[9].uid="5006589bbb0bc0804";
		parent.shippingmethod[9].free=0;
		parent.shippingmethod[9].vat=20;
					parent.shippingmethod[9].price[1]=15.37;				
			parent.shippingmethod[9].weight[1]=2;				
					parent.shippingmethod[9].price[2]=16.63;				
			parent.shippingmethod[9].weight[2]=5;				
					parent.shippingmethod[9].price[3]=17.79;				
			parent.shippingmethod[9].weight[3]=10;				
					parent.shippingmethod[9].price[4]=22;				
			parent.shippingmethod[9].weight[4]=20;				
					parent.shippingmethod[9].price[5]=31.79;				
			parent.shippingmethod[9].weight[5]=30;				
					parent.shippingmethod[10] = new classShippingMethod;
		parent.shippingmethod[10].caption="UPS Standard SLO, S, FI, ES, PT, IE, EE, LV, LT ";
		parent.shippingmethod[10].info="UPS Standard Shipment to SLovenia, Finnland, Sweden, Spain, Portugal, Ireland, Estonia, Latvia, Lithuania (max. 20kg)";
		parent.shippingmethod[10].uid="5006589bbb0bc4605";
		parent.shippingmethod[10].free=0;
		parent.shippingmethod[10].vat=20;
					parent.shippingmethod[10].price[1]=23.11;				
			parent.shippingmethod[10].weight[1]=1;				
					parent.shippingmethod[10].price[2]=23.73;				
			parent.shippingmethod[10].weight[2]=2;				
					parent.shippingmethod[10].price[3]=25.61;				
			parent.shippingmethod[10].weight[3]=5;				
					parent.shippingmethod[10].price[4]=28.58;				
			parent.shippingmethod[10].weight[4]=10;				
					parent.shippingmethod[10].price[5]=35.26;				
			parent.shippingmethod[10].weight[5]=20;				
					parent.shippingmethod[11] = new classShippingMethod;
		parent.shippingmethod[11].caption="UPS Standard GR, RO, BG";
		parent.shippingmethod[11].info="UPS Standard Shipment to Greece, Romania, Bulgaria (max. 20 kg)";
		parent.shippingmethod[11].uid="5006589bbb0bdaa06";
		parent.shippingmethod[11].free=0;
		parent.shippingmethod[11].vat=20;
					parent.shippingmethod[11].price[1]=32.24;				
			parent.shippingmethod[11].weight[1]=1;				
					parent.shippingmethod[11].price[2]=33.98;				
			parent.shippingmethod[11].weight[2]=2;				
					parent.shippingmethod[11].price[3]=39.17;				
			parent.shippingmethod[11].weight[3]=5;				
					parent.shippingmethod[11].price[4]=47.74;				
			parent.shippingmethod[11].weight[4]=10;				
					parent.shippingmethod[11].price[5]=63.65;				
			parent.shippingmethod[11].weight[5]=20;				
					parent.shippingmethod[12] = new classShippingMethod;
		parent.shippingmethod[12].caption="UPS Standard CH, FL";
		parent.shippingmethod[12].info="UPS Standard Shipment to Switzerland, Liechtenstein (max. 20kg)";
		parent.shippingmethod[12].uid="5006589bbb0bebd07";
		parent.shippingmethod[12].free=0;
		parent.shippingmethod[12].vat=20;
					parent.shippingmethod[12].price[1]=25.71;				
			parent.shippingmethod[12].weight[1]=1;				
					parent.shippingmethod[12].price[2]=27.15;				
			parent.shippingmethod[12].weight[2]=2;				
					parent.shippingmethod[12].price[3]=31.48;				
			parent.shippingmethod[12].weight[3]=5;				
					parent.shippingmethod[12].price[4]=34.5;				
			parent.shippingmethod[12].weight[4]=10;				
					parent.shippingmethod[12].price[5]=60;				
			parent.shippingmethod[12].weight[5]=20;				
					parent.shippingmethod[13] = new classShippingMethod;
		parent.shippingmethod[13].caption="UPS Express Saver IT, BENELUX";
		parent.shippingmethod[13].info="UPS Express Saver Shipment to Italy, BENELUX (max. 10 kg)";
		parent.shippingmethod[13].uid="5006589bbb0b9c402";
		parent.shippingmethod[13].free=0;
		parent.shippingmethod[13].vat=20;
					parent.shippingmethod[13].price[1]=22.27;				
			parent.shippingmethod[13].weight[1]=.5;				
					parent.shippingmethod[13].price[2]=25.39;				
			parent.shippingmethod[13].weight[2]=1;				
					parent.shippingmethod[13].price[3]=31.63;				
			parent.shippingmethod[13].weight[3]=2;				
					parent.shippingmethod[13].price[4]=46.76;				
			parent.shippingmethod[13].weight[4]=5;				
					parent.shippingmethod[13].price[5]=65.58;				
			parent.shippingmethod[13].weight[5]=10;				
					parent.shippingmethod[14] = new classShippingMethod;
		parent.shippingmethod[14].caption="UPS Express Saver FR, GB, DK, S";
		parent.shippingmethod[14].info="UPS Express Saver Shipment to France, Great Britain, Denmark an Sweden (max. 10 kg)";
		parent.shippingmethod[14].uid="5006589bbb0d45c01";
		parent.shippingmethod[14].free=0;
		parent.shippingmethod[14].vat=20;
					parent.shippingmethod[14].price[1]=23.44;				
			parent.shippingmethod[14].weight[1]=.5;				
					parent.shippingmethod[14].price[2]=26.33;				
			parent.shippingmethod[14].weight[2]=1;				
					parent.shippingmethod[14].price[3]=32.06;				
			parent.shippingmethod[14].weight[3]=2;				
					parent.shippingmethod[14].price[4]=49.45;				
			parent.shippingmethod[14].weight[4]=5;				
					parent.shippingmethod[14].price[5]=71;				
			parent.shippingmethod[14].weight[5]=10;				
					parent.shippingmethod[15] = new classShippingMethod;
		parent.shippingmethod[15].caption="UPS Express Saver GR, IE, ES, PT";
		parent.shippingmethod[15].info="UPS Express Saver Shipment to Greece, Ireland, Spain, Portugal (max. 10 kg)";
		parent.shippingmethod[15].uid="5006589bbb0d55b02";
		parent.shippingmethod[15].free=0;
		parent.shippingmethod[15].vat=20;
					parent.shippingmethod[15].price[1]=23.67;				
			parent.shippingmethod[15].weight[1]=.5;				
					parent.shippingmethod[15].price[2]=26.54;				
			parent.shippingmethod[15].weight[2]=1;				
					parent.shippingmethod[15].price[3]=32.29;				
			parent.shippingmethod[15].weight[3]=2;				
					parent.shippingmethod[15].price[4]=49.32;				
			parent.shippingmethod[15].weight[4]=5;				
					parent.shippingmethod[15].price[5]=70.79;				
			parent.shippingmethod[15].weight[5]=10;				
					parent.shippingmethod[16] = new classShippingMethod;
		parent.shippingmethod[16].caption="UPS Express Saver CZ, SK, HU, SLO, PL";
		parent.shippingmethod[16].info="UPS Express Saver Shipment to Czech Republic, Slovakia, Hungary, Slovenia, Poland. (max. 10 kg)";
		parent.shippingmethod[16].uid="5006589bbb0d5ff03";
		parent.shippingmethod[16].free=0;
		parent.shippingmethod[16].vat=20;
					parent.shippingmethod[16].price[1]=28.51;				
			parent.shippingmethod[16].weight[1]=.5;				
					parent.shippingmethod[16].price[2]=31.06;				
			parent.shippingmethod[16].weight[2]=1;				
					parent.shippingmethod[16].price[3]=36.15;				
			parent.shippingmethod[16].weight[3]=2;				
					parent.shippingmethod[16].price[4]=54.23;				
			parent.shippingmethod[16].weight[4]=5;				
					parent.shippingmethod[16].price[5]=75.62;				
			parent.shippingmethod[16].weight[5]=10;				
					parent.shippingmethod[17] = new classShippingMethod;
		parent.shippingmethod[17].caption="UPS Express Saver EE, LV, LT, BG, RO, CY, MT";
		parent.shippingmethod[17].info="UPS Express Saver Shipment to Estonia, Latvia, Lithuania, Bulgaria, Romania, Cyprus and Malta (max. 10 kg)";
		parent.shippingmethod[17].uid="5006589bbb0d68c04";
		parent.shippingmethod[17].free=0;
		parent.shippingmethod[17].vat=20;
					parent.shippingmethod[17].price[1]=30.05;				
			parent.shippingmethod[17].weight[1]=.5;				
					parent.shippingmethod[17].price[2]=32.78;				
			parent.shippingmethod[17].weight[2]=1;				
					parent.shippingmethod[17].price[3]=38.24;				
			parent.shippingmethod[17].weight[3]=2;				
					parent.shippingmethod[17].price[4]=57;				
			parent.shippingmethod[17].weight[4]=5;				
					parent.shippingmethod[17].price[5]=77.77;				
			parent.shippingmethod[17].weight[5]=10;				
					parent.shippingmethod[18] = new classShippingMethod;
		parent.shippingmethod[18].caption="UPS Express Saver CH, FL, N";
		parent.shippingmethod[18].info="Shipment UPS Express Saver to Switzerland, Liechtenstein and Norway (max. 10kg)";
		parent.shippingmethod[18].uid="5006589bbb0c4f208";
		parent.shippingmethod[18].free=0;
		parent.shippingmethod[18].vat=20;
					parent.shippingmethod[18].price[1]=32.78;				
			parent.shippingmethod[18].weight[1]=.5;				
					parent.shippingmethod[18].price[2]=35.74;				
			parent.shippingmethod[18].weight[2]=1;				
					parent.shippingmethod[18].price[3]=41.65;				
			parent.shippingmethod[18].weight[3]=2;				
					parent.shippingmethod[18].price[4]=58.38;				
			parent.shippingmethod[18].weight[4]=5;				
					parent.shippingmethod[18].price[5]=78.96;				
			parent.shippingmethod[18].weight[5]=10;				
					parent.shippingmethod[19] = new classShippingMethod;
		parent.shippingmethod[19].caption="Non EU - Countries (individual arrangement)";
		parent.shippingmethod[19].info="";
		parent.shippingmethod[19].uid="50065895030ab7102";
		parent.shippingmethod[19].free=0;
		parent.shippingmethod[19].vat=20;
					parent.shippingmethod[19].price[1]=0;				
			parent.shippingmethod[19].weight[1]=0;				
					parent.shippingmethod[19].price[2]=0;				
			parent.shippingmethod[19].weight[2]=0;				
					parent.shippingmethod[19].price[3]=0;				
			parent.shippingmethod[19].weight[3]=0;				
					parent.shippingmethod[19].price[4]=0;				
			parent.shippingmethod[19].weight[4]=0;				
					parent.shippingmethod[19].price[5]=0;				
			parent.shippingmethod[19].weight[5]=0;				
					parent.shippingmethod[20] = new classShippingMethod;
		parent.shippingmethod[20].caption="Other mode of dispatch (individal arrangement)";
		parent.shippingmethod[20].info="";
		parent.shippingmethod[20].uid="50065895090a9ac03";
		parent.shippingmethod[20].free=0;
		parent.shippingmethod[20].vat=20;
					parent.shippingmethod[20].price[1]=0;				
			parent.shippingmethod[20].weight[1]=0;				
					parent.shippingmethod[20].price[2]=0;				
			parent.shippingmethod[20].weight[2]=0;				
					parent.shippingmethod[20].price[3]=0;				
			parent.shippingmethod[20].weight[3]=0;				
					parent.shippingmethod[20].price[4]=0;				
			parent.shippingmethod[20].weight[4]=0;				
					parent.shippingmethod[20].price[5]=0;				
			parent.shippingmethod[20].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>Your shopping cart is empty</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;
			}
		}
		
		// GF - ermittlung der Anzahl der möglichen Versandarten, da Fehler im S2D.
		
		var shippingmethodquant = 0;
		for (i=1;i<parent.shippingmethod.length;i++) {
			if (parent.shippingmethod[i].actualprice!=-1) {
			shippingmethodquant++;
			}
		}
		
		
		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 ");
				}
				if (shippingmethodquant==1) {
					document.write("name='method' value='"+i+"'></td>");
					} else {
					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 ("Free of charge");
				} 
				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>Total weight: "+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.php'><img src='images/pcs_btn_basketprev.jpg' name='cs_btn_basketprev' id='cs_btn_basketprev' border='0' onmouseover=\"MM_swapImage('cs_btn_basketprev','','images/pcs_btn_basketprev_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("<td align='right'><a href='s2dpayment.php'><img src='images/pcs_btn_basketnext.jpg' name='cs_btn_basketnext' id='cs_btn_basketnext' border='0' onmouseover=\"MM_swapImage('cs_btn_basketnext','','images/pcs_btn_basketnext_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("</tr>");		
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		document.write ("<tr>");
		document.write ("<td colspan='2' class='s2d' align='left'><strong>ATTENTION:</strong><br>During the order process - only use the yellow buttons please! - For security reasons the shopping cart is deleted if you press the \"Reload\"-Button of your browser!</font></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="payment on pickup / Cash or credit card";
		parent.paymentmethod[1].info="Order online, and pickup the goods at our location (1030 Vienna) and pay cash";
		parent.paymentmethod[1].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[1].postgateway="Thank you. We received your order, and you will receive a confirmation by mail. We will contact you when your goods are ready to pickup, to fix a date.";
		parent.paymentmethod[1].email="Thank you for your order. You can pickup your goods at Franzosengraben 8 / 4th floor , 1030 Wien, AUSTRIA. We'll contact you when your order is ready for pickup, for fixing a date.";
		parent.paymentmethod[1].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065895090a9ac03 50065895030ab7102 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[1].uid="50065894f60f46119";
		parent.paymentmethod[1].price=0;
		parent.paymentmethod[1].vat=20;
		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="eps - online bank transfer";
		parent.paymentmethod[2].info="eps Online Bank transfer, Online Payment Solution of the austrian Banks. During payment process, your online banking pops up - please keep TAN or signature card ready.";
		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 Adress- und Kartendaten 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.";
		parent.paymentmethod[2].email="Thank you for your order! The amount will be transfered from your bank account!";
		parent.paymentmethod[2].noship="50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065895090a9ac03 50065895030ab7102 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[2].uid="50065896df0ad3101";
		parent.paymentmethod[2].price=0;
		parent.paymentmethod[2].vat=20;
		parent.paymentmethod[2].free=0;
		parent.paymentmethod[2].parameter[0]="ccard";
		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="VISA";
		parent.paymentmethod[3].info="Pay comfortable and secure by VISA / Verified by VISA";
		parent.paymentmethod[3].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[3].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. ";
		parent.paymentmethod[3].email="Thank you for your order. The sum will be debited from your credit card.";
		parent.paymentmethod[3].noship="50065895090a9ac03 50065895030ab7102";
		parent.paymentmethod[3].uid="000000943a122a003";
		parent.paymentmethod[3].price=0;
		parent.paymentmethod[3].vat=20;
		parent.paymentmethod[3].free=0;
		parent.paymentmethod[3].parameter[0]="ccard";
		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="Mastercard";
		parent.paymentmethod[4].info="Pay comfortable and secure by Mastercard / Mastercard SecureCode";
		parent.paymentmethod[4].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[4].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. ";
		parent.paymentmethod[4].email="Thank you for your order. The sum will be debited from your credit card.";
		parent.paymentmethod[4].noship="50065895090a9ac03 50065895030ab7102";
		parent.paymentmethod[4].uid="50065894f60f7271a";
		parent.paymentmethod[4].price=0;
		parent.paymentmethod[4].vat=20;
		parent.paymentmethod[4].free=0;
		parent.paymentmethod[4].parameter[0]="ccard";
		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="@Quick";
		parent.paymentmethod[5].info="Pay comfortable with your Quick - card (austrian Electronic Purse). This payment is only with Microsoft Internet Explorer (deactivated Popup-Blocker!!) possible. You need sufficient funds on your card and a smart card reader. If you are paying @Quick the first time, the plugin will be installed automatically. To avoid troubles with browser configuration or card reader configuration (possible with smart card reader without installed PC/SC Treiber - possible with Reiner SCT or Kobil) we recommend to install the plugin beforehand! <a href=\"http://www.pdts.cc/qii/download/\" target=\"_blank\">@Quick-Plugin</a>";
		parent.paymentmethod[5].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 Kartendaten 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[5].postgateway="Vielen Dank. Ihre Bestellung wurde entgegengenommen. Sie erhalten in Kürze eine Bestätigungsmail.";
		parent.paymentmethod[5].email="Vielen Dank für Ihre Bestellung. Der Rechnungsbetrag wird wunschgemäß von Ihrer Kreditkarte abgebucht.";
		parent.paymentmethod[5].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 50065895030ab7102 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[5].uid="50065896df0b39002";
		parent.paymentmethod[5].price=0;
		parent.paymentmethod[5].vat=20;
		parent.paymentmethod[5].free=0;
		parent.paymentmethod[5].parameter[0]="ccard";
		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="Cash on Delivery";
		parent.paymentmethod[6].info="Pay comfortable and secury by Cash on Delivery.";
		parent.paymentmethod[6].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[6].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. ";
		parent.paymentmethod[6].email="Thank you for your order. Please consider, that there are additional costs, when the order is delivered.";
		parent.paymentmethod[6].noship="50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 50065895030ab7102 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[6].uid="000000943a1212c02";
		parent.paymentmethod[6].price=4.5;
		parent.paymentmethod[6].vat=20;
		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="Credit card (Order by mail or fax)";
		parent.paymentmethod[7].info="Fax or mail us your order with your credit card number (MasterCard oder VISA) on the order form. € 2 fee for manual processing of the order.";
		parent.paymentmethod[7].pregateway="The next page contains a print and faxable order form, which we ask you to fill out and sign it - and mail or fax it of course.";
		parent.paymentmethod[7].postgateway="";
		parent.paymentmethod[7].email="Please print this order form and fax it, fill out (block letters) and sign it and mail or send it to us: +43 (1) 798 96 96 99";
		parent.paymentmethod[7].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 50065895030ab7102 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[7].uid="50065895090885b01";
		parent.paymentmethod[7].price=2;
		parent.paymentmethod[7].vat=20;
		parent.paymentmethod[7].free=0;
		parent.paymentmethod[7].parameter[0]="printcreditcard";
		parent.paymentmethod[7].parameter[1]="[&nbsp;&nbsp;] Visa oder [&nbsp;&nbsp;] Mastercard";
		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="Invoice (reg. cryptoshop reseller or existing commercial customers , order online) ";
		parent.paymentmethod[8].info="Existing commercial customers and registered cryptoshop resellers have the possibility to pay after receiving the invoice, of course.";
		parent.paymentmethod[8].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[8].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. ";
		parent.paymentmethod[8].email="Thank you for your order.";
		parent.paymentmethod[8].noship="50065894f60f3a018 50065895030ab7102 50065895090a9ac03";
		parent.paymentmethod[8].uid="50065895090b27c05";
		parent.paymentmethod[8].price=0;
		parent.paymentmethod[8].vat=20;
		parent.paymentmethod[8].free=0;
		parent.paymentmethod[8].parameter[0]="";
		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="Invoice (reg. cryptoshop reseller or existing commercial customer, order by mail / fax)";
		parent.paymentmethod[9].info="Existing commercial customers and registered cryptoshop resellers have the possibility to pay after receiving the invoice, of course. € 2 fee for manual processing of the order.";
		parent.paymentmethod[9].pregateway="The next page contains a print and faxable order form, which we ask you to fill out and sign it - and mail or fax it of course.";
		parent.paymentmethod[9].postgateway="";
		parent.paymentmethod[9].email="Please print this order form and fax it, fill out (block letters) and sign (authorized signatory) it and mail or send it to us: +43 (1) 798 96 96 99";
		parent.paymentmethod[9].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 50065895030ab7102 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[9].uid="5006589509089c602";
		parent.paymentmethod[9].price=2;
		parent.paymentmethod[9].vat=20;
		parent.paymentmethod[9].free=0;
		parent.paymentmethod[9].parameter[0]="printinvoice";
		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="Non EU - individual arrangement (order online)";
		parent.paymentmethod[10].info="For delivery to Non-EU-Countries we negotiate individual conditions for payment and delivery. With this option, the order will be done online, and we contact you for arrange the conditions. The total sum on the following pages will be increased by the negotiated costs. If you want an online-payment with credit card, we will send you a cryptoshop link for processing the online payment.";
		parent.paymentmethod[10].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[10].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. We will contact you for negotiate delivery and payment.";
		parent.paymentmethod[10].email="Thank you for your order, we will contact you for negotiate delivery and payment in brief.";
		parent.paymentmethod[10].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[10].uid="50065895030ad1403";
		parent.paymentmethod[10].price=0;
		parent.paymentmethod[10].vat=20;
		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="Non EU - individual arrangement (order by fax or mail)";
		parent.paymentmethod[11].info="For delivery to Non-EU-Countries we negotiate individual conditions for payment and delivery. With this option, you have to send the order by mail or fax. We contact you for arrange the conditions. The total sum on the following pages will be increased by the negotiated costs. € 2 fee for manual processing of the order.";
		parent.paymentmethod[11].pregateway="The next page contains a print and faxable order form, which we ask you to fill out and sign it - and mail or fax it of course.";
		parent.paymentmethod[11].postgateway="";
		parent.paymentmethod[11].email="Please print this order form and fax it, fill out (block letters) and sign (authorized signatory) it and mail or send it to us: +43 (1) 798 96 96 99";
		parent.paymentmethod[11].noship="000000943a1210701 50065898af0b7fc05 500658950309cc901 50065894f70a57f12 50065894f60f3a018 50065895090a9ac03 50065895030ab7102 500658970b089bc01 5006589bbb0b84e01 5006589bbb0bbe903 5006589bbb0bc0804 5006589bbb0bc4605 5006589bbb0bdaa06 5006589bbb0bebd07 5006589bbb0b9c402 5006589bbb0d45c01 5006589bbb0d55b02 5006589bbb0d5ff03 5006589bbb0d68c04 5006589bbb0c4f208";
		parent.paymentmethod[11].uid="50065895090abfc04";
		parent.paymentmethod[11].price=2;
		parent.paymentmethod[11].vat=20;
		parent.paymentmethod[11].free=0;
		parent.paymentmethod[11].parameter[0]="printinvoice";
		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";
			parent.paymentmethod[12] = new classPaymentMethod;
		parent.paymentmethod[12].caption="Bank Transfer in advance";
		parent.paymentmethod[12].info="Transfer the amount in advance, stating the received order number. We send the order when the amount is credited to our bank account";
		parent.paymentmethod[12].pregateway="Your order was transfered to your shopsystem. We opened a SSL-encrypted page where you can put in your personal data in secure manner. When you filled out and confirmed all necessary data items, the order is complete. Thank you for your visit on cryptoshop.com.";
		parent.paymentmethod[12].postgateway="Thank you. We received your order, and you will receive a confirmation by mail in brief. Please transfer the amount to our account. You find the bank details in the confirmationmail and also on the imprint on cryptoshop.com. ::: Raiffeisenbank Kleinmünchen/Linz  :::  Acc. 335 166  :::  BLZ  34226  :::  IBAN#: AT42 3422 6000 0033 5166  SWIFT/BIC: RZOOAT2L226";
		parent.paymentmethod[12].email="Thank you. We received your order, and you will receive a confirmation by mail in brief. Please transfer the amount to our account. You find the bank details in the confirmationmail and also on the imprint on cryptoshop.com.  ::: Raiffeisenbank Kleinmünchen/Linz  :::  Acc. 335 166  :::  BLZ  34226  :::  IBAN#: AT42 3422 6000 0033 5166  SWIFT/BIC: RZOOAT2L226";
		parent.paymentmethod[12].noship="000000943a1210701 50065894f60f3a018 50065895090a9ac03 50065895030ab7102";
		parent.paymentmethod[12].uid="500658951908aca01";
		parent.paymentmethod[12].price=0;
		parent.paymentmethod[12].vat=20;
		parent.paymentmethod[12].free=0;
		parent.paymentmethod[12].parameter[0]="";
		parent.paymentmethod[12].parameter[1]="";
		parent.paymentmethod[12].parameter[2]="";
		parent.paymentmethod[12].parameter[3]="";
		parent.paymentmethod[12].parameter[4]="";
		parent.paymentmethod[12].parameter[5]="";
		parent.paymentmethod[12].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>Your shopping cart is empty</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 ("Free of charge");
				}
				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.php'><img src='images/pcs_btn_basketprev.jpg' name='cs_btn_basketprev' id='cs_btn_basketprev' border='0' onmouseover=\"MM_swapImage('cs_btn_basketprev','','images/pcs_btn_basketprev_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("<td align='right'><a href='s2dsummary.php'><img src='images/pcs_btn_basketnext.jpg' name='cs_btn_basketnext' id='cs_btn_basketnext' border='0' onmouseover=\"MM_swapImage('cs_btn_basketnext','','images/pcs_btn_basketnext_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
		document.write ("</tr>");		
		document.write ("<tr><td colspan='2' class='s2d'>&nbsp;</td></tr>");
		document.write ("<tr>");
		document.write ("<td colspan='2' class='s2d' align='left'><strong>ATTENTION:</strong><br>During the order process - only use the yellow buttons please! - For security reasons the shopping cart is deleted if you press the \"Reload\"-Button of your browser!</font></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 orderinfo="I am / we are ordering the following items on cryptoshop.com:"
	var contactinfo="If you have further questions, please contact us! We will support you willingly!"
	var shopaddress="<strong>CRYPTOSHOP.COM</strong><br>c/o CRYPTAS it-Security GmbH<br>Franzosengraben 8/4.OG, 1030 Vienna, AUSTRIA<br>Tel: +43 (1) 798 96 96-0, Fax: +43 (1) 798 96 96-99, E-Mail: info@cryptoshop.com";
	
	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>Cryptoshop.com - Order form</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 ("h2.s2d {font-family: Arial, Helvetica, sans-serif; font-size: 16pt; font-weight : bold; margin-top : 0pt; margin-bottom : 0pt;} ");
		mydoc.write ("h3.s2d {font-family: Arial, Helvetica, sans-serif; font-size: 12pt; font-weight : bold; margin-top : 0pt; margin-bottom : 0pt;} ");
		mydoc.write (".small {font-family : Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: #333333;} ");
		mydoc.write ("</style>");
		
		mydoc.write ("<table width='100%' cellpadding='5' cellspacing='3' border='0'>");
		mydoc.write ("<tr><td class='s2d'><h1 class='s2d'>Cryptoshop.com - Order form</h1></td></tr>");
		mydoc.write ("<tr><td><h3 class='s2d'>"+parent.paymentmethod[parent.selectedpaymentmethod].email+"</h3></td></tr>");

		mydoc.write ("<tr><td class='s2d'>"+orderinfo+"<br></td></tr>");
		
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Customer number:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Company:</strong><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>Address:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>ZIP and city:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Land:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Phone number:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Fax:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>E-Mail:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>VAT ID-number:</strong><br></td></tr>");
		mydoc.write ("<tr><td class='small'>(European VAT ID-number (VIES) - please fill in, if known!)</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>Account number:</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Bank code:</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Bank:</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Account holder:</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>Card type (please tick): "+parent.paymentmethod[parent.selectedpaymentmethod].parameter[1]+"</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Card number:</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Cardholder's name:</strong><br></td></tr>");
				mydoc.write ("<tr><td class='s2d' style='border-bottom: 1px solid #000000;' solid;'><strong>Expiration date:</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>Date, City, Signature:</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>Quantity</strong></td>");
	mydoc.write("<td align='left' class='s2d'><strong>Product-ID</strong></td>");
	mydoc.write ("<td width='100%' class='s2d'><strong>Item</strong></td>");
		//B2B Shop
		mydoc.write ("<td nowrap class='s2d'><strong>VAT</strong></td>");
		mydoc.write ("<td nowrap align='right' class='s2d'><strong>Unit price</strong></td>");
	mydoc.write ("<td nowrap align='right' class='s2d'><strong>Subtotal</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 class='s2d'>"+htmlChars(parent.basket[i].id)+"&nbsp;</td>");
			mydoc.write ("<td width='100%' class='s2d'>"+htmlChars(parent.basket[i].caption)+"</td>");
							mydoc.write ("<td class='s2d'>"+parent.basket[i].vat+"%</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='6' 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='6' align='right' class='s2d'>Shipping rates:</td>");
		mydoc.write ("<td nowrap align='right' class='s2d'>"+format(shippingcost)+" EUR</td>");
	mydoc.write ("</tr>");

	// Abstand
	mydoc.write ("<tr>");
			mydoc.write ("<td colspan='7' align='left'></td>");		
		mydoc.write ("</tr>");
	
	// Ust zeigen	
	vat.sort(sortVat);

		//B2B Shop
		mydoc.write ("<tr>");
		mydoc.write ("<td colspan='6' align='right' class='s2d'><strong>Net:</strong></td>");
		mydoc.write ("<td nowrap align='right' class='s2d'><strong>"+format(sum)+" EUR</strong></td>");
		mydoc.write ("</tr>");

		mydoc.write ("<tr>");
		mydoc.write ("<td colspan='7' align='left'></td>");		
		mydoc.write ("</tr>");

		for (i=0;i<vat.length;i++) {
			mydoc.write ("<tr>");
			mydoc.write ("<td colspan='6' align='right' class='s2d'>"+vat[i].percent+"% VAT:</td>");
			mydoc.write ("<td nowrap align='right' class='s2d'>"+format(vat[i].amount)+" EUR</td>");
			mydoc.write ("</tr>");
			vatsum=vatsum+vat[i].amount;
		}	
		
		mydoc.write ("<tr>");
		mydoc.write ("<td colspan='7' align='left'></td>");		
		mydoc.write ("</tr>");
		
		mydoc.write ("<tr>");
		mydoc.write ("<td colspan='6' align='right' class='s2d'><strong>Gross:</strong></td>");
		mydoc.write ("<td nowrap align='right' class='s2d'><strong>"+format(sum+vatsum)+" EUR</strong></td>");
		mydoc.write ("</tr>");

			
	mydoc.write ("</table>");
	mydoc.write ("</form>");
	

	mydoc.write ("<table cellpadding='2'>");
	mydoc.write ("<tr>");
	
	// Gewünschte Versandart
	mydoc.write ("<td nowrap class='s2d'>Delivery type: </td>");
	mydoc.write ("<td nowrap class='s2d'>"+shippingcaption+"</td>");
	mydoc.write ("</tr>");
	
	// Gesamtgewicht
	if (totalweight>0) {
		mydoc.write ("<tr>");
		mydoc.write ("<td nowrap class='s2d'>Total weight: </td>");
		mydoc.write ("<td nowrap class='s2d'>"+formatweight(totalweight)+" kg</td>");
		mydoc.write ("</tr>");
	}

	// Gewünschte Zahlungsweise
	mydoc.write ("<tr>");
	mydoc.write ("<td nowrap class='s2d'>Payment type: </td>");
	mydoc.write ("<td class='s2d'>"+paymentcaption+"</td>");
	mydoc.write ("</tr>");
	
	mydoc.write("<tr>");
	mydoc.write("<td nowrap class='s2d'><strong>Value added tax:</strong></td>");
	mydoc.write("<td class='s2d'><strong>Customers outside Austria and EU</strong> doesn't have to pay austrian VAT! But EU-customers have to enter their valid european VAT-ID (VIES) on the <strong>next page</strong>, then the amounts will be corrected! More about the <a href='http://ec.europa.eu/taxation_customs/vies/vieshome.do' target='_blank'>european VAT-ID</a></td>");
	mydoc.write("</tr>");
	
	mydoc.write ("</table>");

	// Leerzeile
	mydoc.write ("<br>");
	
	// Angaben zum Rechnungsland
/*	mydoc.write ("<table width='100%' class='s2d'>");
	mydoc.write ("<form name='countryform' action='location.reload();return false;'>");
	mydoc.write ("<tr>");
	mydoc.write ("<td nowrap class='s2d' colspan='2'><strong>Please select your country of delivery</strong></td>");
	mydoc.write ("</tr>");
	mydoc.write ("<tr>");
	mydoc.write ("<td class='s2d'><p>Please select your country of delivery in order to adapt the displayed value-added tax (VAT)! Please enter afterwards, if available, your value-added tax number from the european community!</p></td>");
	mydoc.write ("<td class='s2d' align='right'><select name='countrylistbox' class='s2d' onchange='setCookie(mydoc.countryform.countrylistbox.value, 'c');'>");
	fillcountrylistbox();
	mydoc.write ("</select></td>");
	mydoc.write ("</tr>");
	mydoc.write ("</form>");
	mydoc.write ("</table>");
	
	// Eingabefeld für MWSt-Nummer anzeigen
	switch (mydoc.countryform.countrylistbox.value) {
		case "AD,AND,020:Andorra":
		case "BE,BEL,056:Belgium":
		case "DK,DNK,208:Denmark":
		case "EE,EST,233:Estonia":
		case "FO,FRO,234:Färöer-Islands":
		case "FI,FIN,246:Finland":
		case "FR,FRA,250:France":
		case "GR,GRC,300:Greece":
		case "GL,GRL,304:Greenland":
		case "GB,GBR,826:Great Britain (UK)":
		case "IE,IRL,372:Ireland":
		case "IT,ITA,380:Italy":
		case "LV,LVA,428:Latvia":
		case "LT,LTU,440:Lithuania":
		case "LU,LUX,442:Luxemburg":
		case "MT,MLT,470:Malta":
		case "MC,MCO,492:Monaco":
		case "NL,NLD,528:Netherlands":
		case "PL,POL,616:Poland":
		case "PT,PRT,620:Portugal":
		case "SE,SWE,752:Sweden":
		case "SK,SVK,703:Slovakia":
		case "SI,SVN,705:Slovenia":
		case "ES,ESP,724:Spain":
		case "CZ,CZE,203:Czech Republic":
		case "HU,HUN,348:Hungary":
		case "VA,VAT,336:Vatican":
		case "CY,CYP,196:Cyprus":
		case "DE,DEU,276:Deutschland":
			mydoc.write ("<table width='100%' class='s2d'>");
			mydoc.write ("<form name='uidform' onsubmit='verifyUID();location.reload();return false;'>");
			mydoc.write ("<tr>");
			mydoc.write ("<td class='s2d' colspan='2' align='right'>Please enter your european VAT ID-Number (VIES-Number):&nbsp;</td>");
			mydoc.write ("</tr>");
			mydoc.write ("</form>");
			mydoc.write ("</table>");
			break;
			// Textfeld für UID-Nummer anzeigen
			//mydoc.write ("<td nowrap class='s2d'><strong>Angabe Ihrer Mehrwertsteuernummer (UID-Nummer):</strong>&nbsp;&nbsp;&nbsp;<input type='text' class='s2d' size='20' maxlength='15' name='uidnummer'></td>");
			
			// Anmerkungen zur UID-Nummer
			// mydoc.write ("<table width='100%' class='s2d'>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d' colspan='2'><p>F&uuml;r Ihre Bestellungen gelten folgende Mehrwertsteuerverrechnungsarten - ausschlaggebend ist Ihr angegebenes Rechnungsland, das Sie auf der nächst folgenden Bestellseite (SSL) eingeben:</p></td></tr>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>innerhalb der Europ&auml;ische Union (mit Angabe Ihrer UID-Nummer): es wird keine MWSt. verrechnet, der Rechnungsgesamtbetrag ist der Nettogesamtbetrag!</p></td></tr>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>innerhalb der Europ&auml;ische Union (ohne Angabe Ihrer UID-Nummer): es werden 20% MWSt. verrechnet, der Rechnungsgesamtbetrag ist der Bruttogesamtbetrag!</p></td></tr>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>für Drittl&auml;nder au&szlig;erhalb der Europ&auml;ischen Union: es wird keine MWSt. verrechnet, der Rechnungsgesamtbetrag ist der Nettogesamtbetrag!</p></td></tr>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>für &Ouml;sterreich: es werden immer 20% MWSt. verrechnet, der Rechnungsgesamtbetrag ist der Bruttogesamtbetrag!</p></td></tr>");
			// mydoc.write ("<tr><td valign='baseline' class='s2d' colspan='2'><p>ACHTUNG:<br>Bei Angabe einer fremden UID-Nummer machen Sie sich strafbar!</p></td></tr>");
			// mydoc.write ("</table>");

		// Jedenfalls ohne MWST: Schweiz und Drittländer ausserhalb der EU
		case "CH,CHE,756:Schweiz":
			//...
			break;
		
		// sonst normale USt.
		//"AT,AUT,040:Österreich"
		default:
	}
*/	
	//Leerzeile
	mydoc.write ("<br>");
	
	// Gutschein(e) einlösen
/*	mydoc.write ("<table width='100%' class='s2d'>");
	mydoc.write ("<form name='voucherform' onsubmit='verifyVoucher();location.reload();return false;'>");
	mydoc.write ("<tr>");
	mydoc.write ("<td nowrap class='s2d' align='left'><strong>Cash your voucher:</strong></td>");
	mydoc.write ("<td nowrap class='s2d' align='right'><input type='image' src='images/pcs_btn_voucher.jpg' name='cs_btn_voucher' border='0' onmouseover=\"MM_swapImage('cs_btn_voucher','','images/pcs_btn_voucher_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></td>");
	mydoc.write ("</tr>");
	mydoc.write ("</form>");
	mydoc.write ("</table>");
	
	// Anmerkungen zu Gutschein(e) einlösen
	mydoc.write ("<table width='100%' class='s2d'>");
	mydoc.write ("<tr><td class='s2d' colspan='2'><p>Currently you can use up the following vouchers:</p></td></tr>");
	mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>CRYPTOSHOP voucher!</p></td></tr>");
	mydoc.write ("<tr><td valign='baseline' class='s2d'><p>-&nbsp;</p></td><td valign='baseline' class='s2d'><p>Voucher of the special promotion from Europay Austria and the austrian Ministry of Finance (EUR 10,- incl. VAT per promoted smart card reader)</p></td></tr>");
	mydoc.write ("</table>");
*/	
	//Leerzeile
	mydoc.write ("<br>");
	
	if (newwindow) {	// Fenster zum Ausdrucken
		mydoc.write ("<table cellpadding='2' width='100%'><tr><td class='s2d'><br><p class='s2d'>"+contactinfo+"</p></td></tr></table>");
		mydoc.write ("<table cellpadding='2' width='100%'><tr><td class='s2d'><br>"+shopaddress+"</td></tr></table>");
		mydoc.write ("</body>");
		mydoc.write ("</html>");
		mydoc.close();
		mywindow.print();
	}
	else
	{
		// Zusammenfassung anzeigen
		mydoc.write ("<table cellpadding='2' width='100%'>");
		mydoc.write ("<tr><td class='s2d'><p>Please check your entries. You can correct them by clicking \"Back\". When all entries are correct, click \"Continue\".</p>");
					mydoc.write ("<p>As end user you are not bound by your order if you cancel it within 2 weeks of receipt of the goods. Further details regarding the returns policy can be found on the page <a class=s2d href=\"consumerinfo.php\">Consumer notice</a>.</p>");
							mydoc.write ("<p>Our general terms and conditions apply. You can inspect them any time in menu <a class=s2d href=\"agb.php\">Terms and Condtitions</a>.</p>");
				mydoc.write ("</td>");
		mydoc.write ("</tr>");		
		
		// Formular mit AGBs anzeigen
		mydoc.write ("<form name='formagb'>");
		mydoc.write ("<tr>");
		mydoc.write ("<td class='s2d'><input type='checkbox' name='checkagb' value='1'><strong>I have read and accepted your terms and conditions.</strong><br><br></td>");
		mydoc.write ("</tr>");
		mydoc.write ("</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+"::";
							products+=parent.basket[i].actualpriceone*(parent.basket[i].vat/100+1)+"::";
												products+=parent.basket[i].vat+":::";
					}
				}
			
				// Versandart als Produkt
				j++;
				products+=iclearChars("Delivery type "+shippingcaption)+"::";
				products+="::";
				products+="1::";
									products+=shippingcost+"::";
					products+=shippingcost*(parent.shippingmethod[parent.selectedshippingmethod].vat/100+1)+"::";
								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 - Anzeige über SSL Verbindung 
				mydoc.write ("<form name='orderform' action='https://ssl.cryptoshop.com/en/gateway.php' method='post' target='_top'>");
				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='1'>");
				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>");
		}
		
		// Tabelle mit Navigationsbuttons anzeigen
		mydoc.write ("<table width='100%' cellpadding='2'>");
			
			// Buttons zurück und weiter
			mydoc.write ("<tr>");		
			mydoc.write ("<td align='left'><a href='s2dpayment.php'><img src='images/pcs_btn_basketprev.jpg' name='cs_btn_basketprev' id='cs_btn_basketprev' border='0' onmouseover=\"MM_swapImage('cs_btn_basketprev','','images/pcs_btn_basketprev_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
			mydoc.write ("<td align='right'><a href='' onclick='submitOrder();return false;'><img src='images/pcs_btn_basketnext.jpg' name='cs_btn_basketnext' id='cs_btn_basketnext' border='0' onmouseover=\"MM_swapImage('cs_btn_basketnext','','images/pcs_btn_basketnext_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
			mydoc.write ("</tr>");		
			mydoc.write ("<tr>");
			mydoc.write ("<td colspan='2' class='s2d'>&nbsp;</td>");
			mydoc.write ("</tr>");
			
			// Text ausgeben
			mydoc.write ("<tr>");
			mydoc.write ("<td colspan='2' class='s2d' align='left'><strong>Attention:</strong><br><font color='#FF0000'>Please use only the yellow navigation buttons during the entire ordering process! From safety reasons the entire content of your basket will empty itself if you use the function \"Refresh\" of your browser!</font></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 ("<p>Wir bedanken uns f&uuml;r Ihren Auftrag!<br><br>Ihr Cryptoshop Team<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.php'><img src='images/pcs_btn_basketprev.jpg' name='cs_btn_basketprev' id='cs_btn_basketprev' border='0' onmouseover=\"MM_swapImage('cs_btn_basketprev','','images/pcs_btn_basketprev_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
	//document.write ("<td align='right'><a onclick='parent.basket.length=0;return true;' href='./index.php'><img src='images/pcs_btn_basketshopmore.jpg' name='cs_btn_basketshopmore' id='cs_btn_basketshopmore' border='0' onmouseover=\"MM_swapImage('cs_btn_basketshopmore','','images/pcs_btn_basketshopmore_ov.jpg',1);\" onMouseOut=\"MM_swapImgRestore();\"></a></td>");
	//document.write ("<tr>");
	//document.write ("</table>");
}

function submitOrder() {
	// Bestellung absenden
	if (!document.formagb.checkagb.checked) {
		alert("Please read our terms and conditions and tick the field \"I have read and accepted your terms and conditions \" before you continue .")
	}
	else {
		switch (parent.paymentmethod[parent.selectedpaymentmethod].parameter[0]) {
		case "printdebit":
		case "printcod":
		case "printcheque":
		case "printremittance":
		case "printcreditcard":
		case "printinvoice":
			summaryShowEx(true);	
			self.location="s2dcomplete.php";
			break;
		case "iClear":
			// SSL Verbindung zur Dateneingabe in einem neuen Fenster öffnen!!!
			var mywindow=window.open("","orderwindow","left=10,top=10,width=620,height=600,status=yes,scrollbars=yes");
			mywindow.focus();
			document.orderform.submit();
			//Abschlussschirm zeigen
			self.location="s2dcomplete.php";
			break;
		default:
			// SSL Verbindung zur Dateneingabe im selben Fenster öffnen!!!
			document.orderform.submit();
		}
	}
}

function fillcountrylistbox() {
	// Erzeugt ein HTML-Option Feld aus einem Array
	// Verwendnung für Länderauswahl für Rechnungsadresse
	countries = new Array (
		"AT,AUT,040:Österreich",
		"DE,DEU,276:Deutschland",
		"CH,CHE,756:Switzerland",
		"AD,AND,020:Andorra",
		"BE,BEL,056:Belgium",
		"DK,DNK,208:Denmark",
		"EE,EST,233:Estonia",
		"FO,FRO,234:Färöer-Islands",
		"FI,FIN,246:Finland",
		"FR,FRA,250:France",
		"GR,GRC,300:Greece",
		"GL,GRL,304:Greenland",
		"GB,GBR,826:Great Britain (UK)",
		"IE,IRL,372:Ireland",
		"IT,ITA,380:Italy",
		"LV,LVA,428:Latvia",
		"LT,LTU,440:Lithuania",
		"LU,LUX,442:Luxemburg",
		"MT,MLT,470:Malta",
		"MC,MCO,492:Monaco",
		"NL,NLD,528:Netherlands",
		"PL,POL,616:Poland",
		"PT,PRT,620:Portugal",
		"SE,SWE,752:Sweden",
		"SK,SVK,703:Slovakia",
		"SI,SVN,705:Slovenia",
		"ES,ESP,724:Spain",
		"CZ,CZE,203:Czech Republic",
		"HU,HUN,348:Hungary",
		"VA,VAT,336:Vatican",
		"CY,CYP,196:Cyprus");

	// Cookie holen
	var mycountry = getCookie("c");
	//alert("getCookie('c'): mycountry = " + mycountry);
		
	// Listbox füllen
	for (var i = 0; i < countries.length; i++) {
		mydoc.write ("<option value='" + countries[i] + "'");
		if (mycountry != null && mycountry !="") {
			if (mycountry == mycountries[i]) {
				mydoc.write (" selected");
			}
		}
		mydoc.write (">" + countries[i].substr(11, countries[i].length) + "</option>");
	}
}

function verifyUID() {
	alert("UID Button gedrückt!");
}

function verifyVoucher() {
	alert("Gutschein Button gedrückt!");
}