//**************************************************************************************************************************************************
// paint methode (for the address fields);
// used in the basket/order.html
// d = delivery
// b = billing
// using the array[] basketAddressFields this is defined at the preferences.js
//**************************************************************************************************************************************************/



function paintAddressFields0(windowReference, alterable) {
	var _readonly = belenusHome.ipartsRunsAs == "cd" ? "" : "readonly";
	if(belenusHome.belenusBasket[0].length > 0 && !belenusHome.oci_interface) {
		var d = windowReference.document;
		d.write('<form>');
		d.write('<table border="0" width="550" align="left" cellspacing="1" cellpadding="0" class="jagT">');
		d.write('<tr><td colspan="3">&nbsp;</td></tr>');
		d.write('<tr><td colspan="2"><b id="'+belenusHome.addLKey("_"+Math.random(),windowReference,"","orderer")+'">'+belenusHome.ld['orderer']+'</b>');
		d.write('</td><td><input type="button" id="'+belenusHome.addLKey("_"+Math.random(),windowReference,"value","jag_001")+'" ');
		d.write('value="'+belenusHome.ld['chooseOrderer']+'" style="width:185px; border:1px solid black; color:darkblue; margin-top:1px; margin-right:1px;" onclick="belenusHome.eventHandler(\'SetOrdererAddress\')"</td></tr>');
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("oo_ansprechpartner_label",windowReference,"","tdLabel_ansprechpartner")+'">'+belenusHome.ld['tdLabel_ansprechpartner']+'</td>');
			d.write('<td rowspan="4" width="40">&nbsp;</td>');
			d.write('<td width="310"><input type="text" id="oo_ansprechpartner" size="30" value="'+belenusHome.getUserData('oo_ansprechpartner')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("oo_phone_label",windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td><input type="text" id="oo_phone" size="30" value="'+belenusHome.getUserData('oo_phone')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("oo_fax_label",windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td><input type="text" id="oo_fax" size="30" value="'+belenusHome.getUserData('oo_fax')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("oo_email_label",windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td><input type="text" id="oo_email" size="30" value="'+belenusHome.getUserData('oo_email')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');

		d.write('<tr><td colspan="2"><b id="'+belenusHome.addLKey("a17"+Math.random(),windowReference,"","b_delivery_address")+'">'+belenusHome.ld['b_delivery_address']+'</b></td><td><input type="button" id="'+belenusHome.addLKey("a117"+Math.random(),windowReference,"value","jag_001")+'" value="'+belenusHome.ld['chooseDeliverer']+'" style="width:185px; border:1px solid black; color:darkblue; margin-top:1px; margin-right:1px;" onclick="belenusHome.eventHandler(\'SetDeliveryAddress\')"</td></tr>');
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("d_betreiber_label",windowReference,"","tdLabel_firm")+'">'+belenusHome.ld['tdLabel_firm']+'</td>');
			d.write('<td rowspan="8" width="40">&nbsp;</td>');
			d.write('<td width="310"><input type="text" id="d_betreiber" size="30" value="'+belenusHome.getUserData('d_betreiber')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("d_street_label",windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td><input type="text" id="d_street" size="30" value="'+belenusHome.getUserData('d_street')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("d_country_label",windowReference,"","jag_008")+'">'+belenusHome.ld['jag_008']+'</span> / <span id="'+belenusHome.addLKey("d_zipcode_label",windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span> / <span id="'+belenusHome.addLKey("d_city_label",windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td><input type="text" id="d_country" size="3" style="width:24px" maxlength="3" value="'+belenusHome.getUserData('d_country')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">')
			d.write('&nbsp;<input type="text" id="d_zipcode" size="5" maxlength="5" value="'+belenusHome.getUserData('d_zipcode')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">');
			d.write('&nbsp;<input type="text" id="d_city" size="12" value="'+belenusHome.getUserData('d_city')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("d_ansprechpartner_label",windowReference,"","tdLabel_ansprechpartner")+'">'+belenusHome.ld['tdLabel_ansprechpartner']+'</td>');
			d.write('<td><input type="text" id="d_ansprechpartner" size="30" value="'+belenusHome.getUserData('d_ansprechpartner')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("d_phone_label",windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td><input type="text" id="d_phone" size="30" value="'+belenusHome.getUserData('d_phone')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');


		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("d_email_label",windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td><input type="text" id="d_email" size="30" value="'+belenusHome.getUserData('d_email')+'" '+_readonly+' onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;</td>');
		d.write('</tr>');
		d.write('<tr><td colspan="3">&nbsp;</td></tr>');
		d.write('<tr><td colspan="3"><b id="'+belenusHome.addLKey("a24"+Math.random(),windowReference,"","b_billing_address")+'">'+belenusHome.ld['b_billing_address']+'</b></td></tr>');
		d.write('<tr>');

			d.write('<td id="'+belenusHome.addLKey("b_name_label",windowReference,"","tdLabel_firm")+'">'+belenusHome.ld['tdLabel_firm']+'</td>');
			d.write('<td rowspan="6" width="40">&nbsp;</td>');
			d.write('<td><input type="text" id="b_name" size="30" value="'+belenusHome.getUserData('b_name')+'" onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;*</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("b_street_label",windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td><input type="text" id="b_street" size="30" value="'+belenusHome.getUserData('b_street')+'" onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;*</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("b_country_label",windowReference,"","jag_008")+'">'+belenusHome.ld['jag_008']+'</span>/<span id="'+belenusHome.addLKey("b_zipcode_label",windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span>/<span id="'+belenusHome.addLKey("b_city_label",windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td><input type="text" id="b_country" size="3" style="width:22px" maxlength="3" value="'+belenusHome.getUserData('b_country')+'" onchange="belenusHome.setUserData(this.id, this.value)">')
			d.write('&nbsp;<input type="text" id="b_zipcode" size="5" maxlength="5" value="'+belenusHome.getUserData('b_zipcode')+'" onchange="belenusHome.setUserData(this.id, this.value)">');
			d.write('&nbsp;<input type="text" id="b_city" size="12" value="'+belenusHome.getUserData('b_city')+'" onchange="belenusHome.setUserData(this.id, this.value)">&nbsp;*</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("b_phone_label",windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td><input type="text" id="b_phone" size="30" value="'+belenusHome.getUserData('b_phone')+'" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("b_fax_label",windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td><input type="text" id="b_fax" size="30" value="'+belenusHome.getUserData('b_fax')+'" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("b_email_label",windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td><input type="text" id="b_email" size="30" value="'+belenusHome.getUserData('b_email')+'" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');
		d.write('<tr><td colspan="3">&nbsp;</td></tr>');
		d.write('<tr><td colspan="3"><b id="'+belenusHome.addLKey("a24"+Math.random(),windowReference,"","b_order_address")+'">'+belenusHome.ld['b_order_address']+'</b></td></tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_name_label",windowReference,"","tdLabel_firm")+'">'+belenusHome.ld['tdLabel_firm']+'</td>');
			d.write('<td rowspan="6" width="40">&nbsp;</td>');
			d.write('<td><input type="text" id="o_name" size="30" value="'+belenusHome.getUserData('o_name')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_street_label",windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td><input type="text" id="o_street" size="30" value="'+belenusHome.getUserData('o_street')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("o_country_label",windowReference,"","jag_008")+'">'+belenusHome.ld['jag_008']+'</span>/<span id="'+belenusHome.addLKey("o_zipcode_label",windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span>/<span id="'+belenusHome.addLKey("o_city_label",windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td><input type="text" id="o_country" size="3" style="width:24px" maxlength="3" value="'+belenusHome.getUserData('o_country')+'" readonly>')
			d.write('&nbsp;<input type="text" id="o_zipcode" size="5" maxlength="5" value="'+belenusHome.getUserData('o_zipcode')+'" readonly>');
			d.write('&nbsp;<input type="text" id="o_city" size="12" value="'+belenusHome.getUserData('o_city')+'" readonly></td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_phone_label",windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td><input type="text" id="o_phone" size="30" value="'+belenusHome.getUserData('o_phone')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_fax_label",windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td><input type="text" id="o_fax" size="30" value="'+belenusHome.getUserData('o_fax')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_email_label",windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td><input type="text" id="o_email" size="30" value="'+belenusHome.getUserData('o_email')+'" readonly>');
//			if(belenusHome.ipartsRunsAs == "web") d.write("&nbsp;*");
			d.write('</td>');
		d.write('</tr>');
		d.write('</table>');
		d.write('</form>');
	}

}

function jagX(windowReference, alterable) {
	if(belenusHome.belenusBasket[0].length > 0) {
	var d = windowReference.document;
		d.write('<table border="0" width="550" align="left" cellspacing="1" cellpadding="0" style="display:block" class="jagT">');
		d.write('<tr>');
		d.write('<td colspan="3"><br></td>');
		d.write('</tr>');
		if(alterable) {
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("o_customerOrderNumber",windowReference,"","customerOrderNumber")+'">'+belenusHome.ld['customerOrderNumber']+'</td>');
			d.write('<td rowspan="5" width="40">&nbsp;</td>');
			d.write('<td width="310"><input type="text" id="customerOrderNumber" size="30" value="'+belenusHome.getUserData('customerOrderNumber')+'" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("o_despatchDate",windowReference,"","tdLabel_despatchDate")+'">'+belenusHome.ld['tdLabel_despatchDate']+'</td>');
			d.write('<td width="310"><input type="text" id="despatchDate" size="30" value="'+belenusHome.getUserData('despatchDate')+'" onchange="belenusHome.setUserData(this.id, this.value)"></td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("o_despatchTypes",windowReference,"","despatchTypes_header")+'">'+belenusHome.ld['despatchTypes_header']+'</td>');
			d.write('<td>');
		      if(belenusHome.despatchTypes[1].length > 0) {
		        var selected = "selected";
		        if(belenusHome.getUserData(belenusHome.despatchTypes[0]) == "") belenusHome.setUserData(belenusHome.despatchTypes[0],belenusHome.despatchTypes[1][0]);
		        d.write('<select id="'+belenusHome.despatchTypes[0]+'" onclick="belenusHome.setUserData(this.id, this.options[this.selectedIndex].value)">');
		        for(jxx in belenusHome.despatchTypes[1]) {

		          if(belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") {
		            selected = (belenusHome.getUserData(belenusHome.despatchTypes[0]) == belenusHome.despatchTypes[1][jxx]) ? "selected" : "";
		            d.write('<option '+selected+' value="'+belenusHome.despatchTypes[1][jxx]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'despatchTypes_'+belenusHome.despatchTypes[1][jxx])+'">'+belenusHome.ld['despatchTypes_'+belenusHome.despatchTypes[1][jxx]]+'</option>');
		          } else {
		            d.write('<option '+selected+' value="'+belenusHome.despatchTypes[1][jxx]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'despatchTypes_'+belenusHome.despatchTypes[1][jxx])+'">'+belenusHome.ld['despatchTypes_'+belenusHome.despatchTypes[1][jxx]]+'</option>');
		            selected = "";
		          }
		        }
		        d.write('</select>');
		      }
		      d.write('</td>');
		d.write('</tr>');
		} else {
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("o_customerOrderNumber",windowReference,"","customerOrderNumber")+'">'+belenusHome.ld['customerOrderNumber']+'</td>');
			d.write('<td rowspan="5" width="40">&nbsp;</td>');
			d.write('<td width="310"><input type="text" size="30" id="o_desZ" value="'+belenusHome.getUserData('customerOrderNumber')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("o_despatchDate",windowReference,"","tdLabel_despatchDate")+'">'+belenusHome.ld['tdLabel_despatchDate']+'</td>');
			d.write('<td width="310"><input type="text" size="30" id="o_desY" value="'+belenusHome.getUserData('despatchDate')+'" readonly></td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td width="200" id="'+belenusHome.addLKey("o_despatchTypes_header",windowReference,"","despatchTypes_header")+'">'+belenusHome.ld['despatchTypes_header']+'</td>');
			var value0 = ""
        	if(belenusHome.despatchTypes[1].length > 0 && belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") {
          		value0 = belenusHome.ld['despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0])];
	        }
			d.write('<td width="310"><input type="text" size="30" value="'+value0+'" readonly id="'+belenusHome.addLKey('o_desX',windowReference,"",'despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0]))+'"></td>');
        d.write('</tr>');
		}
		d.write('</table>');
	}
}

function paintAddressFields1(windowReference, alterable) {
	if(belenusHome.belenusBasket[0].length > 0 && !belenusHome.oci_interface) {
		var d = windowReference.document;
		d.write('<form>');
			d.write('<table border="0" width="100%" align="left" cellspacing="1" cellpadding="0" class="jagT">');
			d.write('<tr><td colspan="3">&nbsp;</td></tr>');
		d.write('<tr><td colspan="3"><b id="'+belenusHome.addLKey("a24"+Math.random(),windowReference,"","b_order_address")+'">'+belenusHome.ld['b_order_address']+'</b></td></tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a25"+Math.random(),windowReference,"","tdLabel_name")+'">'+belenusHome.ld['tdLabel_name']+'</td>');
			d.write('<td rowspan="6" width="40">&nbsp;</td>');
			d.write('<td>'+belenusHome.getUserData('o_name')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a27"+Math.random(),windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td>'+belenusHome.getUserData('o_street')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("a28"+Math.random(),windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span>/<span id="'+belenusHome.addLKey("a29"+Math.random(),windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td>'+belenusHome.getUserData('o_zipcode')+'&nbsp;/');
			d.write('&nbsp;'+belenusHome.getUserData('o_city')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a26"+Math.random(),windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td>'+belenusHome.getUserData('o_phone')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a26"+Math.random(),windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td>'+belenusHome.getUserData('o_fax')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a30"+Math.random(),windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td>'+belenusHome.getUserData('o_email')+'</td>');
		d.write('</tr>');

		d.write('<tr><td colspan="3">&nbsp;</td></tr>');

		d.write('<tr><td colspan="3"><b id="'+belenusHome.addLKey("a24"+Math.random(),windowReference,"","b_billing_address")+'">'+belenusHome.ld['b_billing_address']+'</b></td></tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a25"+Math.random(),windowReference,"","tdLabel_name")+'">'+belenusHome.ld['tdLabel_name']+'</td>');
			d.write('<td rowspan="6" width="40">&nbsp;</td>');
			d.write('<td>'+belenusHome.getUserData('b_name')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a27"+Math.random(),windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td>'+belenusHome.getUserData('b_street')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("a28"+Math.random(),windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span>/<span id="'+belenusHome.addLKey("a29"+Math.random(),windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td>'+belenusHome.getUserData('b_zipcode')+'&nbsp;/');
			d.write('&nbsp;'+belenusHome.getUserData('b_city')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a26"+Math.random(),windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td>'+belenusHome.getUserData('b_phone')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a26"+Math.random(),windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td>'+belenusHome.getUserData('b_fax')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a30"+Math.random(),windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td>'+belenusHome.getUserData('b_email')+'</td>');
		d.write('</tr>');

		d.write('<tr><td colspan="3">&nbsp;</td></tr>');

		d.write('<tr><td colspan="3"><b id="'+belenusHome.addLKey("a17"+Math.random(),windowReference,"","b_delivery_address")+'">'+belenusHome.ld['b_delivery_address']+'</b></td></tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a18"+Math.random(),windowReference,"","tdLabel_betreiber")+'">'+belenusHome.ld['tdLabel_betreiber']+'</td>');
			d.write('<td rowspan="8" width="40">&nbsp;</td>');
			d.write('<td>'+belenusHome.getUserData('d_betreiber')+'</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a20"+Math.random(),windowReference,"","tdLabel_street")+'">'+belenusHome.ld['tdLabel_street']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_street')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td><span id="'+belenusHome.addLKey("a21"+Math.random(),windowReference,"","tdLabel_zipcode")+'">'+belenusHome.ld['tdLabel_zipcode']+'</span>/<span id="'+belenusHome.addLKey("a22"+Math.random(),windowReference,"","tdLabel_city")+'">'+belenusHome.ld['tdLabel_city']+'</span></td>');
			d.write('<td>'+belenusHome.getUserData('d_zipcode')+'&nbsp;/');
			d.write('&nbsp;'+belenusHome.getUserData('d_city')+'</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey(Math.random(),windowReference,"","jag_008")+'">'+belenusHome.ld['jag_008']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_country')+'</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a19"+Math.random(),windowReference,"","tdLabel_phone")+'">'+belenusHome.ld['tdLabel_phone']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_phone')+'</td>');
		d.write('</tr>');
		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a19"+Math.random(),windowReference,"","tdLabel_fax")+'">'+belenusHome.ld['tdLabel_fax']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_fax')+'</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a19"+Math.random(),windowReference,"","tdLabel_ansprechpartner")+'">'+belenusHome.ld['tdLabel_ansprechpartner']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_ansprechpartner')+'</td>');
		d.write('</tr>');

		d.write('<tr>');
			d.write('<td id="'+belenusHome.addLKey("a23"+Math.random(),windowReference,"","tdLabel_email")+'">'+belenusHome.ld['tdLabel_email']+'</td>');
			d.write('<td>'+belenusHome.getUserData('d_email')+'</td>');
		d.write('</tr>');
			d.write('<tr><td colspan="3"><br>&nbsp;<br></td></tr>');

		d.write('</table></form>');
	}

}


function paintNoteField(windowReference, alterable) {
	if(belenusHome.belenusBasket[0].length > 0 && belenusHome.displayNoteInBasket) {
		var d = windowReference.document;

		d.write('<form><table border="0" width="550" cellspacing="1" cellpadding="0">');
		if(alterable) {
			d.write('<tr><td width="240" valign="top" style="background-color:#e8e8e8"><b id="'+belenusHome.addLKey("Note_label",windowReference,"","tdLabel_cartNote")+'" style="font-weight:bold;font-size:14px; color:#000000">'+belenusHome.ld['tdLabel_cartNote']+'</b></td>');
		}
		d.write('<td width="310" style="background-color:#e8e8e8;color:#000000">');
		if(alterable) {
			d.write('<textarea id="Note" rows="4" cols="50" style="width:310px" onchange="belenusHome.setUserData(this.id, this.value)">'+belenusHome.getUserData('Note')+'</textarea>');
		} else {
//			var borderColor = ""; belenusHome.getWebColor(belenusHome.getCSSProperty(belenusHome.document, 'body', 'borderColor'));
//			if (borderColor == null) { borderColor = "#000000";}
			d.write('<div style="width:100%;">');
			d.write('<b id="'+belenusHome.addLKey("a31"+Math.random(),windowReference,"","tdLabel_cartNote")+'">'+belenusHome.ld['tdLabel_cartNote']+'</b><br>');
			d.write(belenusHome.getUserData('Note').replace(/\n/g,"<br>"));
			d.write('</div>');
		}
		d.write('</td></tr>');
		d.write('</table></form>');
	}
}

function paintDetailSettings(windowReference, alterable) {
	if(belenusHome.belenusBasket[0].length > 0 && belenusHome.displayNoteInBasket) {
    var d = windowReference.document;

    if(alterable) {
      d.write('<form><table border="0" width="100%" cellpadding="0" cellspacing="1">');
      d.write('<tr><td><b><span id="'+belenusHome.addLKey(belenusHome.requestTypes[0]+"_label",windowReference,"","requestTypes_header")+'">');
      if(belenusHome.requestTypes[1].length > 0) {
        d.write(belenusHome.ld['requestTypes_header']);
      } else d.write('&nbsp;');
      d.write('</span></b></td><td><b><span id="'+belenusHome.addLKey(belenusHome.despatchTypes[0]+'_label',windowReference,"","despatchTypes_header")+'">');
      if(belenusHome.despatchTypes[1].length > 0) {
        d.write(belenusHome.ld['despatchTypes_header']);
      } else d.write('&nbsp;');
      d.write('</span></b></td></tr>');
      d.write('<tr>');
      d.write('<td>');
      if(belenusHome.requestTypes[1].length > 0) {
        var selected = "selected";
        if(belenusHome.getUserData(belenusHome.requestTypes[0]) == "") belenusHome.setUserData(belenusHome.requestTypes[0],belenusHome.requestTypes[1][0]); // set default value
        d.write('<select id="'+belenusHome.requestTypes[0]+'" onclick="belenusHome.setUserData(this.id, this.options[this.selectedIndex].value)">');
        for(k in belenusHome.requestTypes[1]) {
          if(belenusHome.getUserData(belenusHome.requestTypes[0]) != "") {
            selected = (belenusHome.getUserData(belenusHome.requestTypes[0]) == belenusHome.requestTypes[1][k]) ? "selected" : "";
            d.write('<option '+selected+' value="'+belenusHome.requestTypes[1][k]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'requestTypes_'+belenusHome.requestTypes[1][k])+'">'+belenusHome.ld['requestTypes_'+belenusHome.requestTypes[1][k]]+'</option>');
          } else {
            d.write('<option '+selected+' value="'+belenusHome.requestTypes[1][k]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'requestTypes_'+belenusHome.requestTypes[1][k])+'">'+belenusHome.ld['requestTypes_'+belenusHome.requestTypes[1][k]]+'</option>');
            selected = "";
          }

        }
        d.write('</select>');
      }
      d.write('</td><td>');
      if(belenusHome.despatchTypes[1].length > 0) {
        var selected = "selected";
        if(belenusHome.getUserData(belenusHome.despatchTypes[0]) == "") belenusHome.setUserData(belenusHome.despatchTypes[0],belenusHome.despatchTypes[1][0]);
        d.write('<select id="'+belenusHome.despatchTypes[0]+'" onclick="belenusHome.setUserData(this.id, this.options[this.selectedIndex].value)">');
        for(jxx in belenusHome.despatchTypes[1]) {

          if(belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") {
            selected = (belenusHome.getUserData(belenusHome.despatchTypes[0]) == belenusHome.despatchTypes[1][jxx]) ? "selected" : "";
            d.write('<option '+selected+' value="'+belenusHome.despatchTypes[1][jxx]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'despatchTypes_'+belenusHome.despatchTypes[1][jxx])+'">'+belenusHome.ld['despatchTypes_'+belenusHome.despatchTypes[1][jxx]]+'</option>');
          } else {
            d.write('<option '+selected+' value="'+belenusHome.despatchTypes[1][jxx]+'" id="'+belenusHome.addLKey("b"+Math.random(),windowReference,"",'despatchTypes_'+belenusHome.despatchTypes[1][jxx])+'">'+belenusHome.ld['despatchTypes_'+belenusHome.despatchTypes[1][jxx]]+'</option>');
            selected = "";
          }
        }
        d.write('</select>');
      }
      d.write('</td></tr>');
      d.write('</table></form>');

    } else { //unalterable
    	var borderColor = belenusHome.getWebColor(belenusHome.getCSSProperty(belenusHome.document, 'body', 'borderColor'));
    	if (borderColor == null) { borderColor = "#000000";}
    	d.write('<div style="width:100%;border-color:'+borderColor+';border-width:1px;border-style:solid;">');
        d.write('<table border="0" width="100%" cellpadding="0" cellspacing="1">');
        d.write('<tr><td><b id="'+belenusHome.addLKey("a33"+Math.random(),windowReference,"","requestTypes_header")+'">');
        if(belenusHome.requestTypes[1].length > 0) {
          d.write(belenusHome.ld['requestTypes_header']);
        }
        d.write('</b></td><td><b id="'+belenusHome.addLKey("a34"+Math.random(),windowReference,"","despatchTypes_header")+'">');
        if(belenusHome.despatchTypes[1].length > 0) {
          d.write(belenusHome.ld['despatchTypes_header']);
        }
        d.write('</b></td></tr>');
        d.write('<tr>');
        d.write('<td id="'+belenusHome.addLKey("a35"+Math.random(),windowReference,"",'requestTypes_'+belenusHome.getUserData(belenusHome.requestTypes[0]))+'">');
        if(belenusHome.requestTypes[1].length > 0 && belenusHome.getUserData(belenusHome.requestTypes[0]) != "") {
          d.write(belenusHome.ld['requestTypes_'+belenusHome.getUserData(belenusHome.requestTypes[0])]);
        }
        d.write('</td><td id="'+belenusHome.addLKey("a36"+Math.random(),windowReference,"",'despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0]))+'">');
        if(belenusHome.despatchTypes[1].length > 0 && belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") {
          d.write(belenusHome.ld['despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0])]);
        }
        d.write('</td></tr>');
        d.write('</table></form>');
    	d.write('</div>');
    }
  }
}

var doWhat="";
function doAfter() {
	setTimeout(doWhat,1);
	doWhat="";
}

function paintGhostlyLayer(windowReference) {
	var d = windowReference.document;//visibility:hidden;
	var backC = belenusHome.getWebColor(belenusHome.getCSSProperty(belenusHome.document, 'body', 'backgroundColor'));
	if(backC == null) backC = "silver";
	var borderColor = belenusHome.getWebColor(belenusHome.getCSSProperty(belenusHome.document, 'body', 'borderColor'));
	if (borderColor == null) { borderColor = "#000000";}

	d.write('<div id="GhostlyLayer" align="center" style="position:absolute;background-color:'+backC+';visibility:visible;top:0px;left:0px;width:100%;height:100%;z-index:10;">');
	d.write('<center>');
	d.write('<div style="position:relative;left:3px;top:3;width:400px;height:99%;z-index:100;');
	d.write('background-color:'+backC+';border-color:'+borderColor);
	d.write(';border-top-width:2px;border-left-width:2px;border-right-width:2px;border-bottom-width:2px;border-style:solid">');
	d.write('<table width="10" border="0" cellpadding="0" cellspacing="8"><tr><td>');
	paintAddressFields(windowReference, true);
	d.write('</td></tr><tr><td>');
	paintNoteField(windowReference, true);
  d.write('</td></tr><tr><td>');
  paintDetailSettings(windowReference, true);
	d.write('</td></tr></table>');
	d.write('<div style="');
	d.write('position:absolute;left:0px;width:396px;height:20px;bottom:0px;border-style:solid;');
	d.write('background-image:url(../../images/basket_ghostly_background.gif);border-color:'+borderColor+';');
	d.write('border-top-width:2px;border-left-width:0px;border-right-width:0px;border-bottom-width:0px;">');
	d.write('<table width="100%" border="0">');
	d.write('<tr><td width="100%">&nbsp;</td><td align="right"><table border="0" cellpadding="0" cellspacing="0" class="tab">');
	d.write('				<tr>');
	d.write('					<td nowrap>');
	d.write('					<img src="../custom/images/i.gif" height="10" width="4">');
	d.write('					<a href="javas'+'cript:belenusHome.checkUserInput(self); if(belenusHome.checkInput.length == 0) { if(!belenusHome.includedOrPopupBasket) {void(belenusHome.WM.getWindowReference(\'basket\').frames[\'theBasket\'].location.href=\'order.html\')} else void(belenusHome.WM.getWindowReference(belenusHome.basketWinName+\'Extra\').frames[\'theBasket\'].location.href=\'order.html\')}"  id="'+belenusHome.addLKey("a37"+Math.random(),windowReference,"","nextStepForm")+'">');
	d.write(            belenusHome.ld['nextStepForm']);
	d.write('					</a>');
	d.write('					<img src="../custom/images/i.gif" height="10" width="8"></td>');
	d.write('			</tr>');
	d.write('		</table>');
	d.write('	</td></tr>');
	d.write('</table>');
	d.write('</div>');
	d.write('</div>');
	d.write('</center>');
	d.write('</div>');
}

function isTheGhostVisible(windowReference,switchTo) {
	if(switchTo == "yes" && belenusHome.belenusBasket[0].length > 0) {
		windowReference.document.getElementById("GhostlyLayer").style.visibility = "visible";
		windowReference.document.getElementById("GhostlyLayer").style.display = "block";
	}
	else {
		windowReference.document.getElementById("GhostlyLayer").style.visibility = "hidden";
		windowReference.document.getElementById("GhostlyLayer").style.display = "none";
	}

}


//**************************************************************************************************************************************************
// -submit basket &-paint submit fields methodes
//**************************************************************************************************************************************************/

function createStandardBasketForm4ServerSubmit(windowReference) {
  var d = windowReference.document;
  if(belenusHome.sendBasketTo.indexOf("mailto:") == -1) {
    d.write('<form name="standardBasketForm4ServerSubmit" id="standardBasketForm4ServerSubmit" action="'+unescape(belenusHome.sendBasketTo)+'" method="post" target="'+belenusHome.name+'">');
  } else {
    d.write('<form name="standardBasketForm4ServerSubmit" id="standardBasketForm4ServerSubmit" action="'+unescape(belenusHome.sendBasketTo)+'" method="post" enctype="text/plain" onsubmit="top.close()">');
  }
  for(i in belenusHome.belenusBasket[0]) {
    var itemValue = "";
    for(k in belenusHome.basketServerSendAwayFields) {
      var dash = (belenusHome.basketServerSendAwayFields.length-1 == k) ? "" : "|";
      itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,belenusHome.basketServerSendAwayFields[k])][i];
      itemValue += dash;
    }
    var pos = (parseInt(i)+1);
    if(parseInt(pos) < 10) {
      pos = "00".concat(pos)
    } else if(parseInt(pos) < 100) {
      pos = "0".concat(pos);
    }
    d.write('<input type="hidden" name="pos'+i+'" value="'+itemValue+'"></input>');
  }
  if(belenusHome.basketExtraInfo) {
    for(j in belenusHome.basketAddressFields) {
      d.write('<input type="hidden" name="'+belenusHome.basketAddressFields[j]+'" value="'+getUserData(belenusHome.basketAddressFields[j])+'"></input>');
    }
  }
  d.write('</form>');
}

function createStandardBasketForm4EmailSubmit(refId)  {

  belenusHome.whereIsTheForm=belenusHome.frames.mrhidden2;
  var d = belenusHome.frames.mrhidden2.document;

  var bodyText = "\n";
  bodyText += ((belenusHome.jagOrderStatus=="jag_price_req") ? belenusHome.ld['basketEmail_requestTxt'] : belenusHome.ld['basketEmail_orderTxt'] )+" / " +((belenusHome.jagOrderStatus=="jag_price_req") ? "Request: " : "Order: " ) + refId+"\n\n--------------------------------------------------------\n";
  if(belenusHome.ipartsRunsAs == "web") {
	bodyText += belenusHome.ld['customerOrderNumber'] + " / my ordernumber: " + belenusHome.getUserData('customerOrderNumber') + "\n\n--------------------------------------------------------\n\n";
  }  else { bodyText+= "\n--------------------------------------------------------\n\n"; }

  bodyText += belenusHome.ld["tdLabel_date"] + " / Date: " + belenusHome.writeDate() + "\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld["b_order_address"] + " / Order address:\n\n";
  bodyText += getUserData("o_name")+"\n";
  bodyText += getUserData("o_street")+"\n";
  bodyText += getUserData("o_country") + " " + getUserData("o_zipcode") + " "+ getUserData("o_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + "; / Phone: " + getUserData("o_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("o_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("o_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld["b_billing_address"] + " / Billing address:\n\n";
  bodyText += getUserData("b_name")+"\n";
  bodyText += getUserData("b_street")+"\n";
  bodyText += getUserData("b_country") + " " + getUserData("b_zipcode") + " "+ getUserData("b_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + ": / Phone: " + getUserData("b_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("b_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("b_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld['orderer'] + " / orderer:\n\n";
  bodyText += getUserData('oo_ansprechpartner')+"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + "; / Phone: " + getUserData("oo_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("oo_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("oo_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld["b_delivery_address"] + " / Delivery address:\n\n";
  bodyText += getUserData("d_betreiber")+"\n";
  bodyText += getUserData("d_street")+"\n";
  bodyText += getUserData("d_country") + " " + getUserData("d_zipcode") + " "+ getUserData("d_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_ansprechpartner'] + ": / Contact persons: " + getUserData("d_ansprechpartner")+"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + ": / Phone: " + getUserData("d_phone")+"\n\n--------------------------------------------------------\n\n";

  bodyText += belenusHome.ld['tdLabel_cartNote']+": / Note:\n\n";
  bodyText += getUserData("Note")+"\n\n--------------------------------------------------------\n\n\n";

  for(i in belenusHome.belenusBasket[0]) {
    var itemValue = "";

    var pos = (parseInt(i)+1);
    if(parseInt(pos) < 10) {
      pos = "00".concat(pos)
    } else if(parseInt(pos) < 100) {
      pos = "0".concat(pos);
    }
    itemValue += pos+")....";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,quantityField)][i] + " ";
    itemValue += belenusHome.ld['jag_piece'] + " / piece: ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,partnoField)][i] + "....(";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"remarks")][i] +" / ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"devicenr")][i] +" / ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"motornr")][i] +")....";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,descriptionField)][i]+"\n\n"

    bodyText += itemValue;
  }
  bodyText += "--------------------------------------------------------\n\n";
  bodyText += belenusHome.ld['tdLabel_despatchDate'] + ": / Shipment date: "+ belenusHome.getUserData('despatchDate')+"\n";
  bodyText += belenusHome.ld['despatchTypes_header'] + ": / Dispatch method: ";
  bodyText += (belenusHome.despatchTypes[1].length > 0 && belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") ? belenusHome.ld['despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0])] : "";
  var emailSubject = "SPATSL "+ ((belenusHome.jagOrderStatus=="jag_price_req") ? belenusHome.ld['basketEmail_requestTxt'] : belenusHome.ld['basketEmail_orderTxt'] )+" / " +((belenusHome.jagOrderStatus=="jag_price_req") ? "Request: " : "Order: " ) + refId;
  var emailReceiver = (getUserData('o_email') != "") ? getUserData('o_email') : "";

	d.open();
	d.write('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body onload="document.getElementById(\'standardBasketForm4EmailSubmit\').submit()"><form accept-charset="UTF-8" name="standardBasketForm4EmailSubmit" method="post" id="standardBasketForm4EmailSubmit" enctype="application/x-www-form-urlencoded" action="'+belenusHome.email_forwarder_url+'">');
	d.write('<textarea name="body">'+bodyText+'</textarea>');
	d.write('<input type="hidden" name="to" value="'+emailReceiver+'">');
	d.write('<input type="hidden" name="cc" value="'+getUserData("d_email")+'">');
	d.write('<input type="hidden" name="subject" value="'+emailSubject+'">');
	d.write('</form></body></html>');
	d.close();

  belenusHome.currentCustNum = "";
}

function basketSaveAs(refId)  {

  belenusHome.whereIsTheForm=belenusHome.frames.mrhidden2;
  var d = belenusHome.frames.mrhidden2.document;

  var bodyText = "\n";
  bodyText += belenusHome.ld["b_order_address"] + " / Order address:\n\n";
  bodyText += getUserData("o_name")+"\n";
  bodyText += getUserData("o_street")+"\n";
  bodyText += getUserData("o_country") + " " + getUserData("o_zipcode") + " "+ getUserData("o_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + "; / Phone: " + getUserData("o_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("o_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("o_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld["b_billing_address"] + " / Billing address:\n\n";
  bodyText += getUserData("b_name")+"\n";
  bodyText += getUserData("b_street")+"\n";
  bodyText += getUserData("b_country") + " " + getUserData("b_zipcode") + " "+ getUserData("b_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + ": / Phone: " + getUserData("b_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("b_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("b_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld['orderer'] + " / orderer:\n\n";
  bodyText += getUserData('oo_ansprechpartner')+"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + "; / Phone: " + getUserData("oo_phone")+"\n";
  bodyText += belenusHome.ld['tdLabel_fax'] + ": / Fax: " + getUserData("oo_fax")+"\n";
  bodyText += belenusHome.ld['orderFormEmail'] + ": / E-mail: " + getUserData("oo_email")+"\n\n--------------------------------------------------------\n";

  bodyText += belenusHome.ld["b_delivery_address"] + " / Delivery address:\n\n";
  bodyText += getUserData("d_betreiber")+"\n";
  bodyText += getUserData("d_street")+"\n";
  bodyText += getUserData("d_country") + " " + getUserData("d_zipcode") + " "+ getUserData("d_city") +"\n";
  bodyText += belenusHome.ld['tdLabel_ansprechpartner'] + ": / Contact persons: " + getUserData("d_ansprechpartner")+"\n";
  bodyText += belenusHome.ld['tdLabel_phone'] + ": / Phone: " + getUserData("d_phone")+"\n\n--------------------------------------------------------\n\n";

  bodyText += belenusHome.ld['tdLabel_cartNote']+": / Note:\n\n";
  bodyText += getUserData("Note")+"\n\n--------------------------------------------------------\n\n\n";

  for(i in belenusHome.belenusBasket[0]) {
    var itemValue = "";

    var pos = (parseInt(i)+1);
    if(parseInt(pos) < 10) {
      pos = "00".concat(pos)
    } else if(parseInt(pos) < 100) {
      pos = "0".concat(pos);
    }
    itemValue += pos+")....";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,quantityField)][i] + " ";
    itemValue += belenusHome.ld['basketHeader_quantity'] + " / piece: ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,partnoField)][i] + "....(";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"remarks")][i] +" / ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"devicenr")][i] +" / ";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,"motornr")][i] +")....";
    itemValue += belenusHome.belenusBasket[getFieldPos(belenusHome.basketFields,descriptionField)][i]+"\n\n"

    bodyText += itemValue;
  }
  bodyText += "--------------------------------------------------------\n\n";
  bodyText += belenusHome.ld['tdLabel_despatchDate'] + ": / Shipment date: "+ belenusHome.getUserData('despatchDate')+"\n";
  bodyText += belenusHome.ld['despatchTypes_header'] + ": / Dispatch method: ";
  bodyText += (belenusHome.despatchTypes[1].length > 0 && belenusHome.getUserData(belenusHome.despatchTypes[0]) != "") ? belenusHome.ld['despatchTypes_'+belenusHome.getUserData(belenusHome.despatchTypes[0])] : "";

  var fileName = "SPATSL-" + refId + "-" +writeDate();

	d.open("application/rtf");
	d.write(bodyText);
	d.close();
	d.execCommand('SaveAs',false, 'C:\\temp\\'+fileName+'.rtf');
  //d.getElementById("formPlaceholder").innerHTML ='<form name="standardBasketForm4EmailSubmit" method="post" id="standardBasketForm4EmailSubmit" enctype="text/plain" action="mailto:'+unescape(belenusHome.sendBasketByEmail)+'?subject='+emailSubject+'&body='+escape(bodyText)+'"></form>';
}