

		function SMShop_noDataAvailable(args){
		var $SMS = args[0], _id = $SMS.id, _xml = null;
			// no data available during init
			_xml = SMSession.getSession(_id);
			if(_xml==null) _xml = SMSession.xml.createNode(_id);
			if(_xml!=null) $SMS.xml = _xml;
			};

		function SMBasket_noDataAvailable(args){
		var $SMB = args[0], $SMS = $SMB.parent,
				_doc = $SMS.xml.ownerDocument, _id = $SMB.id, _xml = null;
			// no data available during init
			_xml = $SMS.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) $SMB.xml = _xml;
			};

		function SMShipMethodInfo_noDataAvailable(args){
		var _SMShipMethodInfo = args[0], $SMB = _SMShipMethodInfo.parent,
				_doc = $SMB.xml.ownerDocument, _id = _SMShipMethodInfo.id, _xml = null;
			// no data available during init
			_xml = $SMB.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) _SMShipMethodInfo.xml = _xml;
			};

		function SMPayMethodInfo_noDataAvailable(args){
		var _SMPayMethodInfo = args[0], $SMB = _SMPayMethodInfo.parent,
				_doc = $SMB.xml.ownerDocument, _id = _SMPayMethodInfo.id, _xml = null;
			// no data available during init
			_xml = $SMB.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) _SMPayMethodInfo.xml = _xml;
			};

		function SMGDiscounts_noDataAvailable(args){
		var _SMGDiscounts = args[0], $SMB = _SMGDiscounts.parent,
				_doc = $SMB.xml.ownerDocument, _id = _SMGDiscounts.id, _xml = null;
			// no data available during init
			_xml = $SMB.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) _SMGDiscounts.xml = _xml;
			};

		function SMProduct_noDataAvailable(args){
		var $SMP = args[0], $SMS = $SMP.shop, _id = $SMP.id, _xml = null;
			// no data available during init
			_xml = $SMS.xml.ownerDocument.createNode(_id);
			if(_xml!=null){
				$SMP.xml = _xml;
				};
			};

		function SMDiscounts_noDataAvailable(args){
		var _SMDiscounts = args[0], $SMP = _SMDiscounts.parent,
				_doc = $SMP.xml.ownerDocument, _id = _SMDiscounts.id, _xml = null;
			// no data available during init
			_xml = $SMP.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) _SMDiscounts.xml = _xml;
			};

		function SMVariants_noDataAvailable(args){
		var _SMVariants = args[0], $SMP = _SMVariants.parent,
				_doc = $SMP.xml.ownerDocument, _id = _SMVariants.id, _xml = null;
			// no data available during init
			_xml = $SMP.xml.appendChild(_doc.createNode(_id));
			if(_xml!=null) _SMVariants.xml = _xml;
			};

		function SMShop_onAfterUpdate(args){
		var $SMS = args[0], _id = $SMS.id, _xml = $SMS.xml;
			// after shop update update and save session object
			SMSession.setSession(_id, "xmlnode", _xml);
			SMSession.save();
			};

		function SMBasket_onBeforeReset(args){
			// before resetting basket confirm
			return(confirm("Sind Sie sicher, dass Sie Ihren Warenkorb löschen möchten?"));
			};

		function SMBasket_onAfterReset(args){
			// after resetting basket reload
			location.replace(location.href);
			};

		function SMBasket_onBeforeAdd(args){
		var $SMB = args[0], $SMP = args[1], $SMS = $SMB.parent, _frm = null,
				_elem = null, _params = new Array(), _msg = "";
			// before adding a product, check whether another order
			// has been completed earlier
			if($SMS.getAttribute(_SMAOComplete)=="true"){
				$SMS.reinitOrder();
				};
			return(true);
			};

		function SMProduct_onBeforeUpdate(args){
		var $SMP = args[0], _index = 0, _frm = _elem = _params = null;
			_frm = document.forms["PD" + $SMP.getAttribute(_SMAUniqueID) + "variants"];
			if(_frm!=null&&($SMP.variants.xml.childNodes.length()==0||$SMP.getAttribute("s-var")=="1")){
				_params = new Array();
				for(var i=0; i<_frm.elements.length; i++){
					_index = _frm.elements[i].selectedIndex;
					if(_index<0) _index = 0;
					_elem = _frm.elements[i].options[_index];
					_params[_params.length] = _elem.text;
					_params[_params.length] = _elem.value;
					};
				$SMP.variants.newSimpleVariant.apply($SMP.variants, _params);
				};
			return(true);
			};

		function SMProduct_onAfterUpdate(args){
		var $SMP = args[0], $min = $max = $amnt = 0, $update = false;
			$min = parseInt($SMP.getAttribute(_SMAMinAmount));
			$max = parseInt($SMP.getAttribute(_SMAMaxAmount));
			$amnt = parseFloat($SMP.getAttribute(_SMAAmount));
			if($amnt < $min){
				$amnt = $min; $update = true;
				} else if($max > 0 && $amnt > $max){
				$amnt = $max; $update = true;
				};
			if($update){
				$SMP.setAttribute(_SMAAmount, $amnt);
				$SMP.update();
				};
			};

		function SMBasket_onAfterAdd(args){
		var $SMB = args[0], $SMP = args[1];
			location.href = (SMOMAbsoluteBasePath + "pg21.html");
			};

		function SMBasket_onItemExists(args){
		var $SMB = args[0], _SMNewProduct = args[1], _SMExistingProduct = args[2];
			// item exists in basket, return action flag
			// * _eSMReplace	: replace existing item 
			// * _eSMAdd			: add to basket
			// * _eSMCancel		: cancel action
			return(_eSMAdd);
			};

		function SMBasket_onBeforeRemove(args){
		var $SMB = args[0], $SMP = args[1], $msg = "Sind Sie sicher, dass Sie das Produkt '%d' mit der Artikelnummer '%n' aus dem Warenkorb entfernen möchten?";
			// before removing a product confirm
			$msg = $msg.replace("%d", $SMP.name);
			$msg = $msg.replace("%n", $SMP.getAttribute(_SMACode));
			return(confirm($msg));
			};

		function SMBasket_onAfterRemove(args){
			// reload page after deleting a product;
			location.replace("pg21.html");
			};

		function SMShipMethodInfo_onAfterUpdate(args){
			// update SMShop after recalculating the shipment costs
			SMShop.update();
			};

		function SMPayMethodInfo_onAfterUpdate(args){
			// update SMShop after recalculating the payment costs
			SMShop.update();
			};

		function SMShop_variantSelectionChanged(args){
		var $SMP = args[0], _form = args[1], _varset = _vartext = "", _index = 0, _elem = null;
			_elem = document.getElementById("variant_not_found");
			if(_elem!=null) _elem.style.display = "none";
			// update product variant properties after changes occured in
			// the variants html form
			if($SMP.variants.xml.childNodes.length()!=0){
				for(var i=0; i<_form.elements.length; i++){
					_elem = _form.elements[i];
					_index = _elem.options.selectedIndex;
					if(_index<0) _index = 0;
					if(_varset!="") _varset += ";";
					if(_vartext!="") _vartext += ",";
					_varset += _elem.options[_index].value;
					_vartext += (_elem.options[_index].text).replace(/,/g, "&comma;");
					};
				$SMP.variants.activateByValues(_varset, _vartext);
				$SMP.update();
				displayProductProperties($SMP);
				};
			};

		function SMShop_onBasketGUIElemChanged(args){
		var $SMS = args[0], _elem = args[1], index = args[2], _form = null, _name = "", $SMP = null, _uniqueID = "", _variantID = "";
			// update product amount after changes occured in the
			// basket graphical user interface
			if(_elem!=null){
				_name = _elem.id.replace("PD", "");
				_name = _name.replace("Amount", "");
				if(_name.indexOf("-")){
					_uniqueID = _name.split("-")[0];
					_variantID = _name.split("-")[1];
					}
				else _uniqueID = _name;
				if(index>=0){
					$SMP = $SMS.basket.getProductByIndex(index);
					}
				else if(_variantID!=""){
					$SMP = $SMS.basket.getProductById(_uniqueID, _variantID);
					}
				else $SMP = $SMS.basket.getProductById(_uniqueID);
				if($SMP!=null){
					$SMP.setAttribute(_SMAAmount, _elem.value);
					$SMP.update();
					$SMS.basket.update();
					};
				};
			};

		function SMVariants_onAfterActivate(args){
		var _SMVariants = args[0];
			// update form controls, if any
			_SMVariants.refreshFormControls();
			};

		/* sm:broker-ssl begin-edit */
		var useSSLForCheckout = false;
		var sharedSSLURL = "";
		/* sm:broker-ssl end-edit */

		var sPHPSessionUrl = "";
		
		sPHPSessionUrl = (sharedSSLURL==""?SMOMAbsoluteRootURL + "/phpsession.php":"");
		

		var SMFirstInit = false;
		var SMSession = new SXMLSessionManager(sPHPSessionUrl);
		SMFirstInit = SMSession.init("Z016KAO3M4");

		var SMShop = new cSMShop("SMShop");SMShop.init();
		// 5.5.7 Surcharge Calculator Options
		SMShop.calculateSurchargePerAmount = 0; // (0,1)
		//
		with(SMShop){
		// set basic data
			setAttribute(_SMAInGross, 1); // Gross Prices Entered (0,1)
			setAttribute(_SMAOutGross, 1); // Display Gross Prices (0,1)
			setAttribute(_SMARoundTo, 0); // Round Final Amount (100,50,10,5,0)
			setAttribute(_SMAMinAmount, 1);
			regions[0] = new Array(0, "DE", "Deutschland", 0, 0, 0, 0, true, false, 2, "^DE[ ]{0,1}[0-9]{9}$");
			
			};
		// executed on first session init only
		if(SMFirstInit){
			var SMReferrer = SMSession.xml.documentElement.getAttribute("referrer");
			var SMQuery = SMSession.xml.documentElement.getAttribute("query");
			SMShop.setAttribute("id", SMSession.xml.documentElement.getAttribute("id"));
			SMShop.setAttribute("finit", "1");
			SMShop.setAttribute("session-marker", "knVOPTD9m5Xg7aE9A9d2p5NggbQf+vYwXTtXw8jUTi0XQQ==");
			SMShop.setAttribute("build", "5.6.2");
			SMShop.setAttribute("sarurl", SMOMAbsoluteRootURL);
			if(SMReferrer!="") SMShop.setAttribute("referrer", SX_uEsc(SMReferrer));
			if(SMQuery!="") SMShop.setAttribute("query", SX_uEsc(SMQuery));
			SMShop.setAttribute("sid", fnSMRandStr(10));
			
			SMShop.setAttribute("finit", "0");
			};

		
		var SMProviderAddresses = new SXMLDom();with(SMProviderAddresses){documentElement = createNode("SMEmailService");with(documentElement){setAttribute("selfSender", "0");setAttribute("dateFormat", "d.m.Y H:i:s");setAttribute("remoteInfos", "1");setAttribute("referrer", SX_uEsc(SMSession.xml.documentElement.getAttribute("referrer")));setAttribute("adjustServerDate", "0");setAttribute("attachXml", "1");setAttribute("attachSmo", "0");setAttribute("attachOpenTrans", "0");setAttribute("attachOpenTrans", "0");setAttribute("attachLexware", "0");setAttribute("saveOrder", "1");setAttribute("smoEnabled", "0");setAttribute("smoHtmlCopy", "0");with(appendChild(ownerDocument.createNode("SMEmail"))){setAttribute("scope", "order");setAttribute("sender-name", "Augsburgerwurm");text = "augsburgerwurm_SM|AT_web.de";};with(appendChild(ownerDocument.createNode("SMEmail"))){setAttribute("scope", "contact");setAttribute("sender-name", "Augsburgerwurm");text = "augsburgerwurm_SM|AT_web.de";};with(appendChild(ownerDocument.createNode("SMEmail"))){setAttribute("scope", "newsletter");setAttribute("sender-name", "Augsburgerwurm");text = "augsburgerwurm_SM|AT_web.de";};};};
		var SMColors = new SXMLDom();with(SMColors){documentElement = createNode("SMColors");with(documentElement){with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "main");setAttribute("value", "#71939F");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "main.light");setAttribute("value", "#D7E0E3");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "main.dark");setAttribute("value", "#39697A");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "alt");setAttribute("value", "#BEA081");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "alt.light");setAttribute("value", "#E1D3C6");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "alt.dark");setAttribute("value", "#74573D");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "background");setAttribute("value", "#FFFFFF");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "foreground");setAttribute("value", "#4E4E4E");};with(appendChild(ownerDocument.createNode("SMColor"))){setAttribute("key", "hyperlink");setAttribute("value", "#367589");};};};
		var SMFonts = new SXMLDom();with(SMFonts){documentElement = createNode("SMFonts");with(documentElement){with(appendChild(ownerDocument.createNode("SMFont"))){setAttribute("key","small");text="font-family:Tahoma, Helvetica, sans-serif;font-size:10px;font-weight:normal;";};with(appendChild(ownerDocument.createNode("SMFont"))){setAttribute("key","medium");text="font-family:Tahoma, Helvetica, sans-serif;font-size:11px;font-weight:normal;";};with(appendChild(ownerDocument.createNode("SMFont"))){setAttribute("key","large");text="font-family:Arial, Helvetica, sans-serif;font-size:14px;font-weight:bold;";};with(appendChild(ownerDocument.createNode("SMFont"))){setAttribute("key","x-large");text="font-family:Tahoma, Helvetica, sans-serif;font-size:17px;font-weight:bold;";};with(appendChild(ownerDocument.createNode("SMFont"))){setAttribute("key","xx-large");text="font-family:Tahoma, Helvetica, sans-serif;font-size:21px;font-weight:bold;";};};};

		var SMCfgItems = "_3CSMCfgItems_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2account_X5X2bic_22_3ENORSDE71XXX_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2account_X5X2iban_22_3EDE81760260000185331600_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2account_X5X2number_22_3E185_X520331_X520600_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2account_X5X2owner_22_3EMartin_X520Meinrei_X5C3_X59F_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2code_22_3E760_X52026_X520000_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2bank_X5X2name_22_3ENorisbank_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2city_22_3EAugsburg_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2company_X5X2director_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2company_X5X2director_X5X2label_22_3EGesch_X5C3_X5A4ftsf_X5C3_X5BChrer_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2company_X5X2name_22_3EAugsburgerwurm_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2country_X5X2name_22_3EDeutschland_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2fax_X5X2business_22_3E03212_X5X21314612_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2fax_X5X2hotline_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2firstname_22_3EMartin_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2lastname_22_3EMeinrei_X5C3_X59F_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2mail_X5X2contact_22_3EAugsburgerwurm_X5X6web_X5X3de_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2mail_X5X2default_22_3EAugsburgerwurm_X5X6web_X5X3de_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2mail_X5X2orders_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2mail_X5X2support_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2mail_X5X2webmaster_22_3EM_X5X3M_X5X3_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2phone_X5X2business_22_3EUrlaub_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2phone_X5X2hotline_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2phone_X5X2mobile_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2region_22_3EBayern_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2salutation_22_3EHerr_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2shopname_22_3EAugsburgerwurm_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2slogan_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2street_X5X2name_22_3EErstes_X520Quers_X5C3_X5A4chseng_X5C3_X5A4_X5C3_X59Fchen_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2street_X5X2number_22_3E13_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2tax_X5X2number_22_3E101_X5X4567_X5X400237_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2title_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2trade_X5X2number_22_3E_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2url_22_3Ewww_X5X3augsburgerwurm_X5X3de_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2vat_X5X2id_22_3EDE_X520267_X520237_X520921_3C_X4SMCfgItem_3E_3CSMCfgItem_20key=_22provider_X5X2zip_X5X2code_22_3E86152_3C_X4SMCfgItem_3E_3C_X4SMCfgItems_3E";
		var SMBasketXML = null;

		with(SMShop){
			
			deliveryTimes[1] = new Array(1, "Wegen%20Urlaub%20erst%20wieder%20im%20September%20sofort%20lieferbar");
			deliveryTimes[2] = new Array(2, "Wegen%20Urlaub%20erst%20wieder%20im%20September%202-5%20Werktage");
			deliveryTimes[3] = new Array(3, "muss%20f%FCr%20Sie%20bestellt%20werden");
			};

		// listen to window.onLoad & .onUnload events
		window.onload = function(){ SMShop.onLoad(); };
		window.onunload = function(){ SMShop.onUnload(); };

	function SMOMGetQtyControl(){
	var _args = SMOMGetQtyControl.arguments, oProduct = _args[0], raiseEvent = ((_args[1]!=null) ? _args[1] : false), index = ((_args[2]!=null) ? _args[2] : -1);
	if(oProduct==null){return("")};
	var sPkid = "PD" + null2str(oProduct.getAttribute(_SMAUniqueID)), iQtyType = null2int(oProduct.getAttribute(_SMAOQtyType)),
			iQtyMin = null2int(oProduct.getAttribute(_SMAMinAmount)), iQtyStep = null2int(oProduct.getAttribute(_SMAOQtyStep)),
			iQtyMax = null2int(oProduct.getAttribute(_SMAMaxAmount)), iQtyDef = null2int(oProduct.getAttribute(_SMAOQDefValue)),
			iOptCount = null2int(oProduct.getAttribute(_SMAOQDDOptCount)), sQtyUnit = "Stk", sField = "";

		if(oProduct.getAttribute(_SMAVariantID)!=null) sPkid += '-' + oProduct.getAttribute(_SMAVariantID);
		sPkid += "Amount";

		iQtyDef = oProduct.getAttribute(_SMAAmount);
		iQtyDef = iQtyDef>iQtyMin?iQtyDef:iQtyMin;

		sField += "<table class=\"basket-line-qty\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap>";
		switch(iQtyType){
			case 0:
				sField += "<input class=\"addbasket-qtyfield\" id=\"" + sPkid + "\" type=\"text\" size=\"2\" value=\"" + iQtyDef + "\" onchange=\"this.value=fnSMNum(this.value);";
				if(raiseEvent) sField += "SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + ");";
				sField += "\"";
				if(raiseEvent) sField += " onkeydown=\"if(window.event.keyCode==13){ this.value=fnSMNum(this.value); SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + "); };\"";
				sField += "\">";
				break;
			case 1:
				if(raiseEvent) sPkid += "IDX" + index;
				sField += "<input class=\"addbasket-qtyfield\" id=\"" + sPkid + "\" type=\"text\" size=\"2\" value=\"" + iQtyDef + "\" onfocus=\"this.blur()\"";
				if(raiseEvent){
					sField += " onchange=\"SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + ");\"";
					sField += " onkeydown=\"if(window.event.keyCode==13){ this.value=fnSMNum(this.value); SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + "); };\"";
					};
				sField += "></td><td nowrap>";
				sField += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
				sField += "<tr><td style=\"padding-bottom:1px;\"><img src=\"images/button_spinup.gif\" title=\"Bestellmenge erhöhen\" width=\"15\" height=\"8\" border=\"0\" onclick=\"fnSMSpinButtonClick('" + sPkid + "',true," + iQtyMin + "," + iQtyMax + "," + iQtyStep + ", true, " + index + ");\"></td></tr>";
				sField += "<tr><td><img src=\"images/button_spindown.gif\" title=\"Bestellmenge verringern\" width=\"15\" height=\"8\" border=\"0\" onclick=\"fnSMSpinButtonClick('" + sPkid + "',false," + iQtyMin + "," + iQtyMax + "," + iQtyStep + ", true, " + index + ");\"></td></tr>";
				sField += "</table>";
				break;
			case 2:
				sField += "<select id=\"" + sPkid + "\" class=\"addbasket-qtyfield\"";
				if(raiseEvent){
					sField += " onchange=\"SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + ");\"";
					sField += " onkeydown=\"if(window.event.keyCode==13){ this.value=fnSMNum(this.value); SMShop.base.raiseEvent('onBasketGUIElemChanged', false, null, SMShop, this, " + index + "); };\"";
					};
				sField += ">";
				for(var i=iQtyStep; i<=parseInt(iOptCount*iQtyStep);i+=iQtyStep){
					sField += "<option value=\"" + i + "\"";
					if(i==iQtyDef) sField += " selected";
					sField += ">" + i;
				};
				sField += "</select>";
				break;
		};
		sField += "</td></tr></table>";
		return(sField);
		};

	//page:SM_RESERVED_DATA_ENTRY_SHIPMENT

	// cSMShop.getCheckoutStep ( current-page-id, [previous?] )
	function SMGetCheckoutStep(){
	var backwards = arguments[1], returnId = "", usingShipToAddress = bNoCheckoutPage = false;
		usingShipToAddress = (SMShop.getFormElement("BILLTO", "BILLTO_SHIPTO_DIFFERS") != null);
		if(usingShipToAddress){
			usingShipToAddress = cbool(SMShop.getFormValue("BILLTO", "BILLTO_SHIPTO_DIFFERS", true));
			};
		switch(arguments[0]){
			case "SM_RESERVED_BASKET":
				returnId = (backwards) ? "pg21.html" : "pg13.html";
				if(backwards) bNoCheckoutPage = true;
				break;
			case "SM_RESERVED_DATA_ENTRY_BILLTO":
				returnId = (backwards) ? "pg21.html" : (usingShipToAddress) ? "pg14.html" : "pg15.html";
				if(returnId == "pg21.html") bNoCheckoutPage = true;
				break;
			case "SM_RESERVED_DATA_ENTRY_SHIPTO":
				returnId = (backwards) ? "pg13.html" : "pg15.html";
				break;
			case "SM_RESERVED_DATA_ENTRY_SHIPMENT":
				returnId = (backwards) ? (usingShipToAddress) ? "pg14.html" : "pg13.html" : "pg16.html";
				break;
			case "SM_RESERVED_DATA_ENTRY_PAYMENT":
				returnId = (backwards) ? "pg15.html" : "pg17.html";
				break;
			case "SM_RESERVED_DATA_ENTRY_VERIFY":
				returnId = (backwards) ? "pg16.html" : "pg17.html";
				if(returnId == "index.html") bNoCheckoutPage = true;
				break;
			default:
				returnId = (backwards) ? "" : "index.html";
				if(!backwards) bNoCheckoutPage = true;
			};
		// valid for checkout?
		if(returnId!=""){
			var sMsgValidity = "", lValidationCode = SMShop.validateDataForCheckout();
			switch(lValidationCode){
				case 1:
					sMsgValidity = "Ihr Warenkorb enthält keine Einträge, bitte legen Sie mindestens einen Artikel in den Warenkorb.".replace("&nbsp;", " ");
					alert(sMsgValidity);
					returnId = "index.html";
					bNoCheckoutPage = true;
					break;
				case 2:
					sMsgValidity = ("Der Mindestbestellwert wurde unterschritten. Der Mindestbestellwert beträgt " + cprimary.format(SMShop.getAttribute(_SMAMinAmount), SM_CSYMBOL + SM_CGROUP)).replace("&nbsp;", " ");
					alert(sMsgValidity);
					returnId = "pg21.html";
					bNoCheckoutPage = true;
					break;
				};
			}
		else return("");
		// ssl
		if(useSSLForCheckout&&SMOMAbsoluteRootURL.substring(0,7)=="http://"){
			if(sharedSSLURL!=""){
				SMOMAbsoluteRootURL = sharedSSLURL;
				}
			else SMOMAbsoluteRootURL = "https://" + SMOMAbsoluteRootURL.substring(7);
			};
		if(SMOMAbsoluteRootURL.substring(SMOMAbsoluteRootURL.length - 1)=="/") SMOMAbsoluteRootURL = SMOMAbsoluteRootURL.substring(0,SMOMAbsoluteRootURL.length - 1);
		
		if(bNoCheckoutPage && SMShop.getAttribute('sarurl') != ''){
			returnId = SMShop.getAttribute('sarurl') + "/" + returnId;
		} else {
			returnId = SMOMAbsoluteRootURL + "/" + returnId;
		};
		
		return(returnId);
		};

		SMCurrNoOfDecimals = 2;
	var cprimary = new cSMCurrency("EUR", "€", "Euro", ",", "1,1 x", "-1,1 x", 2, ".", 3, 1 );
	var csecondary = new cSMCurrency("USD", "$", "United States Dollars", ",", "1,1 x", "-1,1 x", 2, ".", 3, 1.2094639753 );

	var nprimary = new cSMCurrency("kg", "kg", "kg", ",", "1,1 x", "-1,1 x", 2, "", 3, 1);

	if(SMFirstInit){
		SMShop.basket.setAttribute("p-cur-iso", cprimary.ISO)
		SMShop.basket.setAttribute("p-cur-symbol", cprimary.symbol)
		};	

	function formatProductBasePrice(Product){
	var $basePriceTemplate = "";
		$basePriceTemplate = "Grundpreis: %bp pro %mb %mu";
		if($basePriceTemplate!=""&&(Product.bpAmount!=1||Product.bpBase!=1)){
			$basePriceTemplate = $basePriceTemplate.replace(/%ma/g, Product.bpAmount);
			$basePriceTemplate = $basePriceTemplate.replace(/%mu/g, Product.bpMUnit);
			$basePriceTemplate = $basePriceTemplate.replace(/%qu/g, Product.quantityUnit);
			$basePriceTemplate = $basePriceTemplate.replace(/%bp/g, "<strong class=\"t-em\">" + cprimary.format(Product.getPrice() / Product.bpAmount * Product.bpBase, SM_CGROUP + SM_CSYMBOL) + "</strong>");
			$basePriceTemplate = $basePriceTemplate.replace(/%mb/g, Product.bpBase);
			}
		else $basePriceTemplate = "";
		return($basePriceTemplate);
		};

	function displayProductProperties(Product){
	var $image = null, $elem = null, $basePriceTemplate = "", $fSetData = function(){ var $elem = null; try{ $elem = document.getElementById(arguments[0]); if($elem!=null) $elem.innerHTML = arguments[1]; } catch(e){ }; };
		try{
			$image = new Image();
			$image.src = Product.image;
			}
		catch(e){
			$image = null;
			};
		with(document){
			if($image!=null&&Product.image!=""){
				if(getElementById("product_picture")){
					getElementById("product_picture").src = $image.src;
					};
				};
			$fSetData("product_name", Product.name);
			$fSetData("product_desc", Product.desc);
			$fSetData("product_id", Product.getAttribute(_SMACode));
			$fSetData("product_ean", Product.getAttribute(_SMAEAN));
			$fSetData("product_weight", nprimary.format(Product.getAttribute(_SMAWeight), SM_CGROUP));
			$fSetData("product_original_price", cprimary.format(Product.getOriginalPrice(), SM_CGROUP + SM_CSYMBOL));
			$fSetData("product_difference", cprimary.format(Product.getOriginalPrice() - Product.getPrice(), SM_CGROUP + SM_CSYMBOL));
			$fSetData("product_price", cprimary.format(Product.getPrice(), SM_CGROUP + SM_CSYMBOL));
			$fSetData("product_price_seccur", csecondary.format(Product.getPrice(), SM_CGROUP + SM_CSYMBOL));
			$fSetData("product_discounts", Product.discounts.renderHTML());
			$fSetData("product_base_price", formatProductBasePrice(Product));
			if(Product.deliveryTimeFKID!=0){
				$fSetData("product_delivery_caption", unescape(SMShop.deliveryTimes[Product.deliveryTimeFKID][1]));
				};
			$elem = getElementById("product_delivery_img");
			if($elem&&Product.deliveryTimeFKID!=0){
				try{
					$image = new Image();
					$image.src = $elem.src.replace(/(.+\/[^\d\/]+)\d+(\.[a-z]+)/gi, "$1" + Product.deliveryTimeFKID + "$2");
					}
				catch(e){ $image = null };
				if($image!=null) $elem.src = $image.src;
				};
			};
		};

	/* sm:broker-url begin-edit */
	var SMBrokerURL = "https://www.smartstore.com/services/smbiz_smartbroker.php5"
	/* sm:broker-url end-edit */
