// buyItemOffer
	//MODIFIED 06/NOV/2007 SR
	//ADDS ITEMS TO BASKET FOR MUTIPLE OFFERS
	//SCANS BASKET FOR PARTNUMBER AND CHANGES QTY
	//REFRESHES PAGE
	function buyItemOffer(newItem, newPrice, newPart, newQuantity) {
		displaypart=newPart.replace("qq","-");
		displaypart=displaypart.replace(new RegExp(/qq/g),"-");
		displaypart=displaypart.replace(new RegExp(/zz/g),".");
		displaypart=displaypart.replace(new RegExp(/xx/g),"/");
		newPrice=newPrice.replace(",","");
		if (newQuantity <= 0) {
			rc = alert('The quantity entered is incorrect');
			
			return false;
			
		}

		if (confirm('Add '+newQuantity+' x '+displaypart+' - to your basket (OFFER)')) {
			index = document.cookie.indexOf("TheBasket");
			countbegin = (document.cookie.indexOf("=", index) + 1);
        		countend = document.cookie.indexOf(";", index);
	        	if (countend == -1) {
        	    		countend = document.cookie.length;
        		}
				fulllist = document.cookie.substring(countbegin, countend);
				//CHECK TO SEE IF PARTNUMBER IS ALREADY IN THE BASKET
				partpos=fulllist.search("#"+newPart+"!")
				if (partpos == -1) {
				//IF THE PART NUMBER ISNT IN THE BASKET ADD TO THE BASKET
	                document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"#"+newPart+"!"+newQuantity+"]";
				} else {
				// IF THE PARTNUMBER IS ALREADY IN THE BASKET
						//FIND THE POSITION OF THE QTY
						startofqty=fulllist.indexOf("!",partpos)+1;
						endofqty=fulllist.indexOf("]",partpos);
						//EXTRACT THE QTY
						thisqty=fulllist.substring(startofqty,endofqty);
						//CALCULATE THE NEW QTY
						newqty=eval(thisqty)+eval(newQuantity);
						//REPLACE THE PARTNUMER AND QTY
						oldpartqty="#"+newPart+"!"+thisqty;
						newpartqty="#"+newPart+"!"+newqty;
						newbasket=document.cookie.substring(countbegin, countend);
						newbasket=newbasket.replace(oldpartqty,newpartqty);
					document.cookie="TheBasket="+newbasket;
					}
		}
		// Refresh the page
		parent.frames.location=location.href;
		return true;
		
		
	}
	
	
	// buyItem
	//MODIFIED 10/OCT/2007 SR
	//ADDS ITEMS TO BASKET
	//SCANS BASKET FOR PARTNUMBER AND CHANGES QTY
	function buyItem(newItem, newPrice, newPart, newQuantity) {
		displaypart=newPart.replace("qq","-");
		displaypart=displaypart.replace(new RegExp(/qq/g),"-");
		displaypart=displaypart.replace(new RegExp(/zz/g),".");
		displaypart=displaypart.replace(new RegExp(/xx/g),"/");
		newPrice=newPrice.replace(",","");
		if (newQuantity <= 0) {
			rc = alert('The quantity entered is incorrect');
			
			return false;
			
		}

		if (confirm('Add '+newQuantity+' x '+displaypart+' - to your basket')) {
			index = document.cookie.indexOf("TheBasket");
			countbegin = (document.cookie.indexOf("=", index) + 1);
        		countend = document.cookie.indexOf(";", index);
	        	if (countend == -1) {
        	    		countend = document.cookie.length;
        		}
				fulllist = document.cookie.substring(countbegin, countend);
				//CHECK TO SEE IF PARTNUMBER IS ALREADY IN THE BASKET
				partpos=fulllist.search("#"+newPart+"!")
				if (partpos == -1) {
				//IF THE PART NUMBER ISNT IN THE BASKET ADD TO THE BASKET
	                document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"#"+newPart+"!"+newQuantity+"]";
				} else {
				// IF THE PARTNUMBER IS ALREADY IN THE BASKET
						//FIND THE POSITION OF THE QTY
						startofqty=fulllist.indexOf("!",partpos)+1;
						endofqty=fulllist.indexOf("]",partpos);
						//EXTRACT THE QTY
						thisqty=fulllist.substring(startofqty,endofqty);
						//CALCULATE THE NEW QTY
						newqty=eval(thisqty)+eval(newQuantity);
						//REPLACE THE PARTNUMER AND QTY
						oldpartqty="#"+newPart+"!"+thisqty;
						newpartqty="#"+newPart+"!"+newqty;
						newbasket=document.cookie.substring(countbegin, countend);
						newbasket=newbasket.replace(oldpartqty,newpartqty);
					document.cookie="TheBasket="+newbasket;
					}
		}
		


		return true;
		
	}

	// alterError - fixes a rounding bug in Netscape 2
	function alterError(value) {
		if (value<=0.99) {
			newPounds = '0';
		} else {
			newPounds = parseInt(value);
		}
		newPence = parseInt((value+.0008 - newPounds)* 100);
		if (eval(newPence) <= 9) newPence='0'+newPence;
		newString = newPounds + '.' + newPence;
		return (newString);
	}

	
	// buyItem - adds an item to the shopping basket
	function buyItemNew(newItem, newPrice, newPart, newQuantity) {
		if (newQuantity > 0) {
			index = document.cookie.indexOf("TheBasket");
			countbegin = (document.cookie.indexOf("=", index) + 1);
        		countend = document.cookie.indexOf(";", index);
	        	if (countend == -1) {
        	    		countend = document.cookie.length;
        		}
	                document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"#"+newPart+"!"+newQuantity+"]";
		}
		return true;
	}
// resetShoppingBasket - resets to shopping basket to empty
	function resetShoppingBasket() {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
	}
	
	// logout - resets to shopping basket to empty then logs out
	function logout() {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
		parent.frames.location="login2.asp?logout=true";
	}
	
	
	// showItems() - displays shopping basket in a table
	function showItems() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		document.writeln('<TABLE width="570">');

document.writeln('<tr id="basketheading">');
document.writeln('<TD valign="top"><b>Description</b></TD>');
document.writeln('<TD valign="top"><b>Part No.&nbsp;</b></TD>');
document.writeln('<TD valign="top" align="center"><b>Qty</b></TD>');
document.writeln('<TD valign="top" align="center"><b>Cost Each</b></TD>');
document.writeln('<td valign="top" align="center"><b>Total Cost</b></td>');
document.writeln('<TD valign="top"><b>Action</b></TD>');
document.writeln('</TR>');
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				totprice = totprice + itemtotal;
				itemlist=itemlist+1;
document.writeln('<tr class="products">');
document.writeln('<td valign="top">'+theitem+'</td>');
document.writeln('<td valign="top">'+displaypart+'</td>');
document.writeln('<td align="center" valign="top">'+thequantity+'</td>');
document.writeln('<td align="center" valign="top">'+theprice+'</td>');
document.writeln('<td align="center" valign="top">'+alterError(itemtotal)+'</td>');
document.writeln('<td valign="top"><input type="image" src="graphics/general/remove.gif" value="Remove" onClick="javascript:removeItem('+itemlist+')" class="button"></td>');
document.writeln('</tr>');
//old remove item code
//<a href="javascript:removeItem('+itemlist+')">Remove</a>
			} else if (fulllist.substring(i,i+1) == '|') {
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			
		} else if (fulllist.substring(i,i+1) == '!') {
				thepart = fulllist.substring(itemstart, i);
				itemstart = i+1;
				// Function to replace changed characters
				displaypart = thepart.replace("qq","-");
				displaypart = displaypart.replace(new RegExp(/qq/g),"-");				
				displaypart = displaypart.replace(new RegExp(/zz/g),".");
				displaypart = displaypart.replace(new RegExp(/xx/g),"/");
			
			}
		}
		document.writeln ('<tr><td colspan="6"><hr></td></tr>')
		document.writeln('<tr><td colspan="4" class="option1"><b>Total (excl. Delivery and VAT)</b></td><td class="option1" align="center">'+alterError(totprice)+'</td><td class="option1">&nbsp;</td></tr>');
		document.writeln('</TABLE>');
	}

	function removeItem(itemno) {
		newItemList = null;
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				theitem = fulllist.substring(itemstart, itemend);
				itemlist=itemlist+1;
				if (itemlist != itemno) {
					newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']';
				}
			}
		}
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket="+newItemList;
		location = "bbasket.asp";
	}

	// clearBasket() - removes all items from the basket
	function clearBasket() {
		if (confirm('Are you sure you wish to clear the basket')) {
			index = document.cookie.indexOf("TheBasket");
			document.cookie="TheBasket=.";
			location = "bbasket.asp";
		}
	}
	// Used for bbuy.asp
	function showOrder() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		document.writeln('<FORM method="POST" action="bbuy.asp" name="OrderForm">');
		document.writeln('<TABLE width="570">');
		document.writeln('<tr id="basketheading">');
		document.writeln('<TD valign="top"><b>Description</b></TD>');
		document.writeln('<TD valign="top"><b>Part No.&nbsp;</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Qty</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Cost Each</b></TD>');
		document.writeln('<td valign="top" align="center"><b>Total Cost</b></td>');
		document.writeln('</TR>');
		
		
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				totprice = totprice + itemtotal;
				// FREE DELIVERY ORDERS OVER 200
				if (totprice > 200)
					{
						delivery = 0
					}
				else
					{
						delivery = 17
					}
				// END OF FREE DELIVERY CODE
				vatprice = ((totprice + delivery)  * 20)/100;
				finalprice = totprice + vatprice + delivery;
				itemlist=itemlist+1;
				document.writeln('<tr class="products">');
				document.writeln('<td valign="top">'+theitem+'</td>');
				document.writeln('<td valign="top">'+displaypart+'</td>');
				document.writeln('<td align="center" valign="top">'+thequantity+'</td>');
				document.writeln('<td align="center" valign="top">'+theprice+'</td>');
				document.writeln('<td align="center" valign="top">'+alterError(itemtotal)+'</td>');
				document.writeln('</TR>');
				document.writeln('<INPUT TYPE="hidden" NAME="item'+itemlist+'" VALUE="'+theitem+'" SIZE="40">');
				//document.writeln('item'+itemlist+' VALUE="'+theitem+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="part'+itemlist+'" VALUE="'+displaypart+'" SIZE="40">');
				//document.writeln('part'+itemlist+' VALUE="'+thepart+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="quantity'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">');
				//document.writeln('quantity'+itemlist+' VALUE="'+thequantity+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="priceeach'+itemlist+'" VALUE="'+theprice+'" SIZE="40">');
				//document.writeln('priceeach'+itemlist+' VALUE="'+theprice+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="line_total'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">');
				//document.writeln('line_total'+itemlist+' VALUE="'+alterError(itemtotal)+'"');

			} else if (fulllist.substring(i,i+1) == '|') {
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '!') {
				thepart = fulllist.substring(itemstart, i);
				itemstart = i+1;
				// Function to replace changed characters
				displaypart = thepart.replace("qq","-");
				displaypart = displaypart.replace(new RegExp(/qq/g),"-");
				displaypart = displaypart.replace(new RegExp(/zz/g),".");
				displaypart = displaypart.replace(new RegExp(/xx/g),"/");
			}
		}
		document.writeln('<tr class="products"><td colspan=4>Sub Total</td><td align="center">'+alterError(totprice)+'</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>Delivery</td><td align="center">' + alterError(delivery) + '</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>VAT</td><td align="center">'+alterError(vatprice)+'</td></tr>');
		document.writeln ('<tr><td colspan="5"><hr></td></tr>')
		document.writeln('<tr><td colspan=4><b>Total £ (Sterling)</b></td><td align=center>'+alterError(finalprice)+'</td></tr>');
		document.writeln('<INPUT TYPE="hidden" NAME="SubTotal" VALUE="'+alterError(totprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="VAT" VALUE="'+alterError(vatprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="delivery" VALUE="' + alterError(delivery) + '" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="Order_Total" VALUE="'+alterError(finalprice)+'" SIZE="40">');
		document.writeln('</TABLE>');

	}
	
	// Used for email_bbuy.asp
	function EmailshowOrder() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		document.writeln('<FORM method="POST" action="email_bbuy.asp" name="EmailOrderForm">');
		document.writeln('<TABLE width="570">');
		document.writeln('<tr id="basketheading">');
		document.writeln('<TD valign="top"><b>Description</b></TD>');
		document.writeln('<TD valign="top"><b>Part No.&nbsp;</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Qty</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Cost Each</b></TD>');
		document.writeln('<td valign="top" align="center"><b>Total Cost</b></td>');
		document.writeln('</TR>');
		
		
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				totprice = totprice + itemtotal;
				// FREE DELIVERY ORDERS OVER 200
				if (totprice > 200)
					{
						delivery = 0
					}
				else
					{
						delivery = 17
					}
				// END OF FREE DELIVERY CODE

				vatprice = ((totprice + delivery)  * 20)/100;
				finalprice = totprice + vatprice + delivery
				itemlist=itemlist+1;
				document.writeln('<tr class="products">');
				document.writeln('<td valign="top">'+theitem+'</td>');
				document.writeln('<td valign="top">'+displaypart+'</td>');
				document.writeln('<td align="center" valign="top">'+thequantity+'</td>');
				document.writeln('<td align="center" valign="top">'+theprice+'</td>');
				document.writeln('<td align="center" valign="top">'+alterError(itemtotal)+'</td>');
				document.writeln('</TR>');
				document.writeln('<INPUT TYPE="hidden" NAME="item'+itemlist+'" VALUE="'+theitem+'" SIZE="40">');
				//document.writeln('item'+itemlist+' VALUE="'+theitem+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="part'+itemlist+'" VALUE="'+displaypart+'" SIZE="40">');
				//document.writeln('part'+itemlist+' VALUE="'+thepart+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="quantity'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">');
				//document.writeln('quantity'+itemlist+' VALUE="'+thequantity+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="priceeach'+itemlist+'" VALUE="'+theprice+'" SIZE="40">');
				//document.writeln('priceeach'+itemlist+' VALUE="'+theprice+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="line_total'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">');
				//document.writeln('line_total'+itemlist+' VALUE="'+alterError(itemtotal)+'"');

			} else if (fulllist.substring(i,i+1) == '|') {
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '!') {
				thepart = fulllist.substring(itemstart, i);
				itemstart = i+1;
				// Function to replace changed characters
				displaypart = thepart.replace("qq","-");
				displaypart = displaypart.replace(new RegExp(/qq/g),"-");
				displaypart = displaypart.replace(new RegExp(/zz/g),".");
				displaypart = displaypart.replace(new RegExp(/xx/g),"/");
			}
		}
		document.writeln('<tr class="products"><td colspan=4>Sub Total</td><td align="center">'+alterError(totprice)+'</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>Delivery</td><td align="center">'+alterError(delivery)+'</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>VAT</td><td align="center">'+alterError(vatprice)+'</td></tr>');
		document.writeln ('<tr><td colspan="5"><hr></td></tr>')
		document.writeln('<tr><td colspan=4><b>Total £ (Sterling)</b></td><td align=center>'+alterError(finalprice)+'</td></tr>');
		document.writeln('<INPUT TYPE="hidden" NAME="SubTotal" VALUE="'+alterError(totprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="VAT" VALUE="'+alterError(vatprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="delivery" VALUE="+alterError(delivery)+" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="Order_Total" VALUE="'+alterError(finalprice)+'" SIZE="40">');
		document.writeln('</TABLE>');

	}
	
function saveOrder() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		totprice = 0;
		document.writeln('<FORM method="POST" action="save_order.asp" name="SaveOrder">');
		document.writeln('<TABLE width="570">');
		document.writeln('<tr id="basketheading">');
		document.writeln('<TD valign="top"><b>Description</b></TD>');
		document.writeln('<TD valign="top"><b>Part No.&nbsp;</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Qty</b></TD>');
		document.writeln('<TD valign="top" align="center"><b>Cost Each</b></TD>');
		document.writeln('<td valign="top" align="center"><b>Total Cost</b></td>');
		document.writeln('</TR>');
		
		
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				totprice = totprice + itemtotal;
				vatprice = ((totprice +17)  * 20)/100;
				finalprice = totprice + vatprice + 17
				itemlist=itemlist+1;
				document.writeln('<tr class="products">');
				document.writeln('<td valign="top">'+theitem+'</td>');
				document.writeln('<td valign="top">'+displaypart+'</td>');
				document.writeln('<td align="center" valign="top">'+thequantity+'</td>');
				document.writeln('<td align="center" valign="top">'+theprice+'</td>');
				document.writeln('<td align="center" valign="top">'+alterError(itemtotal)+'</td>');
				document.writeln('</TR>');
				document.writeln('<INPUT TYPE="hidden" NAME="item'+itemlist+'" VALUE="'+theitem+'" SIZE="40">');
				//document.writeln('item'+itemlist+' VALUE="'+theitem+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="part'+itemlist+'" VALUE="'+displaypart+'" SIZE="40">');
				//document.writeln('part'+itemlist+' VALUE="'+thepart+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="quantity'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">');
				//document.writeln('quantity'+itemlist+' VALUE="'+thequantity+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="priceeach'+itemlist+'" VALUE="'+theprice+'" SIZE="40">');
				//document.writeln('priceeach'+itemlist+' VALUE="'+theprice+'"');
				document.writeln('<INPUT TYPE="hidden" NAME="line_total'+itemlist+'" VALUE="'+alterError(itemtotal)+'" SIZE="40">');
				//document.writeln('line_total'+itemlist+' VALUE="'+alterError(itemtotal)+'"');

			} else if (fulllist.substring(i,i+1) == '|') {
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			} else if (fulllist.substring(i,i+1) == '!') {
				thepart = fulllist.substring(itemstart, i);
				itemstart = i+1;
				// Function to replace changed characters
				displaypart = thepart.replace("qq","-");
				// modified to replace all occurances in one go
				displaypart = displaypart.replace(new RegExp(/qq/g),"-");
				displaypart = displaypart.replace(new RegExp(/zz/g),".");
				displaypart = displaypart.replace(new RegExp(/xx/g),"/");
			}
		}
		document.writeln('<tr class="products"><td colspan=4>Sub Total</td><td align="center">'+alterError(totprice)+'</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>Delivery</td><td align="center">17.00</td></tr>');
		document.writeln('<tr class="products"><td colspan=4>VAT</td><td align="center">'+alterError(vatprice)+'</td></tr>');
		document.writeln('<tr><td colspan=4><b>Total £ (Sterling)</b></td><td align=center>'+alterError(finalprice)+'</td></tr>');
		document.writeln('<INPUT TYPE="hidden" NAME="SubTotal" VALUE="'+alterError(totprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="VAT" VALUE="'+alterError(vatprice)+'" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="delivery" VALUE="17" SIZE="40">');
		document.writeln('<INPUT TYPE="hidden" NAME="Order_Total" VALUE="'+alterError(finalprice)+'" SIZE="40">');
		document.writeln('</TABLE>');

	}


