		sterlingtodollar=1.99
		sterlingtoeuro=1.33
		function showBasket(currency, discountmultiply, discountamount) {
		index = document.cookie.indexOf("Basket");
		if (index == -1) { SetCookie("Basket", ".", null, "/"); }
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		subtotal = 0;
		document.writeln('<CENTER><FORM NAME="updateform"><span class="HeadingLarge">Shopping Cart</B></span><HR WIDTH=75% size="1" COLOR="#000000">');
		document.writeln('<table width=100% cellpadding="2" cellspacing="1" class="RightNav" border="0">');

document.writeln('<TR><TD BGCOLOR="#E4E0D6"><b>Qty</b></TD><TD BGCOLOR="#E4E0D6"><b>Item No.</b></TD><TD BGCOLOR="#E4E0D6"><b>Item</b></TD><TD BGCOLOR="#E4E0D6"><b>Price '+currency+'</b></TD><td BGCOLOR="#E4E0D6"><b>Total '+currency+'</b><TD BGCOLOR="#E4E0D6"><b><FONT COLOR="#E4E0D6">.</b></TD></TR>');
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
				thisitem = 1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				
				itemlist=itemlist+1;
				document.write('<tr><td BGCOLOR="#faf7f4" class="RightNav"><INPUT TYPE=TEXT NAME="quant'+itemlist+'" VALUE="'+thequantity+'" SIZE=3></td><td BGCOLOR="#faf7f4" class="RightNav"><a href =/shop/item_show.asp?code_no='+thenumber+' class="RightNav">'+thenumber+'</A></td>');
				document.write('<td align=left BGCOLOR="#faf7f4"><a href =item_show.asp?code_no='+thenumber+'>'+theitem+'</A> '+theoption+' '+theoption2+'</td><td align=right BGCOLOR="#faf7f4">');
				if (currency == "£") {
					theprice=theprice
					document.write(theprice);
				}
				else if (currency == "$") {
					theprice = theprice*sterlingtodollar;
					document.write(alterError(theprice));
				}
				else if (currency=="€") {
					theprice = theprice*sterlingtoeuro;
					document.write(alterError(theprice));
				}
				
				document.write('</td><td align=right BGCOLOR="#faf7f4">')
				if (currency == "£") {
					theitemtotal = itemtotal;
				}
				else if (currency == "$") {
					theitemtotal = itemtotal*sterlingtodollar;

				}
				else if (currency=="€") {
					theitemtotal = itemtotal*sterlingtoeuro;
					
				}
				document.write(alterError(theitemtotal));
				subtotal = subtotal + theitemtotal;
				
				document.write('</td><td WIDTH="38" align=right BGCOLOR="#faf7f4"><a href ="javascript:updateItem('+itemlist+',document.updateform.quant'+itemlist+'.value)"><IMG SRC="/corset-images/general/update.gif" WIDTH="13" HEIGHT="15" BORDER="0" ALT="Update"></a><IMG SRC="/corset-images/general/space.gif" WIDTH="3" HEIGHT="2" ALT=""><a href ="javascript:removeItem('+itemlist+')"><IMG SRC="/corset-images/general/remove.gif" WIDTH="13" HEIGHT="15" BORDER="0" ALT="Remove"></a> </td></tr>');
			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
				if (thisitem==3) thenumber = fulllist.substring(itemstart, i);
				if (thisitem==4) theoption = fulllist.substring(itemstart, i);
				if (thisitem==5) theoption2 = fulllist.substring(itemstart, i);
				if (thisitem==6) theweight = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}

        subtotaldiscount=subtotal*discountmultiply
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Product Total '+currency+'</b></td><td align=right BGCOLOR="#faf7f4">'+alterError(subtotal)+'</td><td BGCOLOR="#E4E0D6"><FONT COLOR="#E4E0D6">.</td></tr>');
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Discount %</b></td><td align=right BGCOLOR="#faf7f4">'+discountamount+'</td><td BGCOLOR="#E4E0D6"><FONT COLOR="#E4E0D6">.</td></tr>');
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Product Total inc Discount '+currency+'</b></td><td align=right BGCOLOR="#faf7f4">'+alterError(subtotaldiscount)+'</td><td BGCOLOR="#E4E0D6"><FONT COLOR="#E4E0D6">.</td></tr>');
		document.writeln('</TABLE><CENTER><IMG SRC="/corset-images/general/update.gif" WIDTH="13" HEIGHT="15" BORDER="0" ALT="Update"> = Update  <IMG SRC="/corset-images/general/remove.gif" WIDTH="13" HEIGHT="15" BORDER="0" ALT="Remove"> = Remove</CENTER>');
		document.writeln('</FORM>');
	}
	
	function updateItem(itemno, newquant) {
		newItemList = null;
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				thisitem = 1;
				itemstart = i+1;
				fullstart = i+1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				itemlist=itemlist+1;
				if (itemlist != itemno) {
					newItemList = newItemList+'['+fulllist.substring(fullstart, itemend)+']';
				} else {
					newItemList = newItemList + '['+theitem+'|'+theprice+'|'+thenumber+'|'+theweight+'|'+newquant+']';
				}
			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
				if (thisitem==3) thenumber = fulllist.substring(itemstart, i);
				if (thisitem==4) theweight = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
		index = document.cookie.indexOf("Basket");
		SetCookie("Basket", ".", null, "/", null);
		SetCookie("Basket",getCookie("Basket")+newItemList, null, "/", null);
		self.location = "basket.asp";

	}

	function clearBasket() {
		if (confirm('Clear Shopping Cart?')) {
			SetCookie("Basket", ".", null, "/");
			self.location = "basket_empty.asp";
		}
	}
	
	<!--
var gEBI = (document.getElementById) ? true : false;
var da = (document.all) ? true : false;
var lay = (document.layers) ? true : false;

function Meny(ID)
 {
 	var ktgID = "ktg_" + ID;
 	var imgID = "img_" + ID;
 	
 	if (gEBI)
 	{
 		ktgID = document.getElementById(ktgID);
 		imgID = document.getElementById(imgID);
 		//alert("gEBI");
 	}
 	else
 	{
 		if (da)
 		{
 			ktgID = document.all(ktgID);
 			imgID = document.all(imgID);
 			//alert("da");
 		}
 		else
 		{
 			if (lay)
 			{
 				//alert("lay");
 				//KtgID = document.layers(ktgID);
 				//imgID = document.layers(imgID);
 			}
 			else
 			{
 				alert("Sorry, your browser does not support this page!");
 			}
 		}
 	}
 	if (gEBI || da)
 	{
		if (ktgID.style.display == "none")
 		{
 			ktgID.style.display = "block";
 			imgID.src="/corset-images/general/minus.gif";
 		}
 		else
 		{
 			ktgID.style.display = "none";
 			imgID.src="/corset-images/general/plus.gif";
 		} 	
 	}
 	else
 	{
 		if (document.layers["ktg_"+ID].visibility == "hide")
 		{
 			document.layers["ktg_"+ID].visibility = "show";
 		//	imgID.src = "Corsetsimages/minus.gif";
 		}
 		else
 		{
 			document.layers["ktg_"+ID].visibility = "hide";
 		//	imgID.src = "Corsetsimages/plus.gif"
 		}
 	}

 }


 //-->
 function form_validatorsearch(theForm) {
  if(theForm.searchstring.value == "") {
    alert("Please enter a searchstring!");
    theForm.searchstring.focus();
    return(false);
  }
  return (true);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function alterError(value) {
		if (value<=0.99) {
			newDollar = '0';
		} else {
			newDollar = parseInt(value);
		}
		newCent = parseInt((value+.0008 - newDollar)* 100);
		if (eval(newCent) <= 9) newCent='0'+newCent;
		newString = newDollar + '.' + newCent;
		return (newString);
	}

	//  add item to the Basket

        function addItem(newItem, newPrice, newQuantity, newNumber,  newOption, newOption2, newWeight, currency) {
		if (newQuantity >= 1000) {
			rc = alert('Wrong Quantity!');
		} else {
                if (newQuantity >= 1) {
				window.alert(''+newQuantity+' x '+newItem+' added to Shopping Cart!');
				
                        index = document.cookie.indexOf("Basket");
                        countbegin = (document.cookie.indexOf("=", index) + 1);
                        countend = document.cookie.indexOf(";", index);
                        if (countend == -1) {
                        countend = document.cookie.length;
                        }
		                SetCookie("Basket",getCookie("Basket")+"["+newItem+"|"+newPrice+"|"+newNumber+"|"+newOption+"|"+newOption2+"|"+newWeight+"|"+newQuantity+"]", null, '/');
						showItems(true, currency);
			}
		}
	}

	function resetBasket() {
		index = document.cookie.indexOf("Basket");
		SetCookie("Basket", ".", null, "/", null);
	}
	
		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("Basket");
		SetCookie("Basket", ".", null, "/", null);
		SetCookie("Basket",getCookie("Basket")+newItemList, null, "/", null);
		self.location = "basket.asp";
		
	}

		function SetCookie(name, value, expires, path, domain) 
		{ document.cookie = name + "=" + value + 
		  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
		  ((path == null)    ? "" : "; path=" + path) +
		  ((domain == null)  ? "" : "; domain=" + domain);
		}

		function getCookie(name) { // use: getCookie("name");
			var index = document.cookie.indexOf(name + "=");
			if (index == -1) return null;
			index = document.cookie.indexOf("=", index) + 1; // first character
			var endstr = document.cookie.indexOf(";", index);
			if (endstr == -1) endstr = document.cookie.length; // last character
			return unescape(document.cookie.substring(index, endstr));
		  }

		function showItems(updatevalue, currency) {
		index = document.cookie.indexOf("Basket");
		if (index == -1) { SetCookie("Basket", ".", null, "/"); }
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = getCookie("Basket");
		subtotal = 0;
		itemlist = 0;
		if (fulllist != null) {
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
				thisitem = 1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				
				subtotal = subtotal+itemtotal;
			
				itemlist=itemlist+1;
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
				if (thisitem==3) theoption = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
		}
		if (currency == "£") {
					subtotal = subtotal;
				}
				if (currency == "$") {
					subtotal =subtotal*sterlingtodollar;
				}
				if (currency == "€") {	
					subtotal =subtotal*sterlingtoeuro;
				}
		if (updatevalue == true)
		{
			document.getElementById('totalprice').innerText = alterError(subtotal);
		}
		else
		{
			document.writeln('<b>Total: '+currency+'<div style="display:inline" id="totalprice">'+alterError(subtotal)+'</div>')
		}
	}
	function showItemsall(currency, discountmultiply, discountamount) {
		index = document.cookie.indexOf("Basket");
		if (index == -1) { SetCookie("Basket", ".", null, "/"); }
		countbegin = (document.cookie.indexOf("=", index) + 1);
        	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
            		countend = document.cookie.length;
        	}
		fulllist = document.cookie.substring(countbegin, countend);
		subtotal = 0;
		document.writeln('<CENTER><FORM NAME="updateform">');
		document.writeln('<table width=60% cellpadding="2" cellspacing="1" class="RightNav" border="0">');
		itemlist = 0;
		for (var i = 0; i <= fulllist.length; i++) {
			if (fulllist.substring(i,i+1) == '[') {
				itemstart = i+1;
				thisitem = 1;
			} else if (fulllist.substring(i,i+1) == ']') {
				itemend = i;
				thequantity = fulllist.substring(itemstart, itemend);
				itemtotal = 0;
				itemtotal = (eval(theprice*thequantity));
				temptotal = itemtotal * 100;
				
				itemlist=itemlist+1;		

				if (currency == "£") {
					theitemtotal = itemtotal;
				}
				else if (currency == "$") {
					theitemtotal = itemtotal*sterlingtodollar;
				}
				else if (currency=="€") {
					theitemtotal = itemtotal*sterlingtoeuro;			
				}

				subtotal = subtotal + itemtotal;
				subtotalcurrency = subtotal + theitemtotal;
				
document.writeln('<INPUT TYPE="hidden" NAME="quantity'+itemlist+'" VALUE="'+thequantity+'  x" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="number'+itemlist+'" VALUE="  '+thenumber+'" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="item'+itemlist+'" VALUE="  '+theitem+'" SIZE="80">');
document.writeln('<INPUT TYPE="hidden" NAME="price'+itemlist+'" VALUE="  '+theprice+'" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="size'+itemlist+'" VALUE="  '+theoption+'" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="width'+itemlist+'" VALUE="  '+theoption2+'" SIZE="40">');
document.writeln('<INPUT TYPE="hidden" NAME="totalcost'+itemlist+'" VALUE="'+theitemtotal+'" SIZE="40">');
			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
				if (thisitem==3) thenumber = fulllist.substring(itemstart, i);
				if (thisitem==4) theoption = fulllist.substring(itemstart, i);
				if (thisitem==5) theoption2 = fulllist.substring(itemstart, i);
				if (thisitem==6) theweight = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
		totprice = (Math.round(subtotal*100)/100);
		if (currency == "£") {
		totpricecurrency=totprice
			if (totpricecurrency<=100.00) {
			altershipping = 4.99;
			shipping=4.99;
		} else {
			altershipping = 0.00;
			shipping=0.00;
		}
				}
				else if (currency == "$"){
				totpricecurrency=totprice * sterlingtodollar 
					if (totpricecurrency<=190.00) {
			altershipping = 15.99;
			shipping=15.99 / sterlingtodollar; 
		} else {
			altershipping = 0.00;
			shipping=0.00;
		}
				}
				else if (currency=="€"){
				totpricecurrency=totprice * sterlingtoeuro 
					if (totpricecurrency<=147.00) {
			altershipping = 8.99;
			shipping=8.99 / sterlingtoeuro;
		} else {
			altershipping = 0.00;
			shipping=0.00;
		}			
				}
				
		finalamount=(totpricecurrency*discountmultiply);
		totalcost = (totprice*discountmultiply)+shipping;
		totalcostcurrency = (totpricecurrency*discountmultiply)+altershipping;
            tax = (Math.round(totalcost*0)/100);
			securetradingvalue = (Math.round(altersecure(totalcost)));
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Product Total inc '+discountamount+' discount '+currency+'</b></td><td align=right BGCOLOR="#faf7f4">'+alterError(finalamount)+'</td></tr>');
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Shipping and Handling '+currency+'</b></td><td align=right BGCOLOR="#faf7f4">'+alterError(altershipping)+'</td></tr>');
		document.writeln('<tr><td align=right BGCOLOR="#E4E0D6" colspan=4><b>Grand Total '+currency+'</b></td><td align=right BGCOLOR="#faf7f4">'+alterError(totalcostcurrency)+'</td></tr>');
  		document.writeln('<INPUT TYPE="hidden" NAME="total" VALUE="'+alterError(totalcostcurrency+tax)+'" SIZE="40">');
		document.writeln('</TABLE>');
	}
	
		function altersecure(value) {
		newvalue = (value * 100);
		return (newvalue);
	}
	
		function noaltersecure(value) {
		newvalue = (value * 1);
		return (newvalue);
	}	
	
	
	
	function form_validator(theForm)
{

	if(theForm.email.value == "") {
		 alert("Please enter your e-mail address");
		 theForm.email.focus();
		 return(false);
	}
	
	if(theForm.name.value == "") {
		 alert("Please enter your name");
		 theForm.name.focus();
		 return(false);
	}

	if(theForm.address.value == "") {
		 alert("Please enter your address");
		 theForm.address.focus();
		 return(false);
	}

	if(theForm.town.value == "") {
		 alert("Please enter your city");
		 theForm.town.focus();
		 return(false);
	}
	
	if(theForm.county.value == "") {
		 alert("Please enter your county/state");
		 theForm.county.focus();
		 return(false);
	}
	
	if(theForm.postcode.value == "") {
		 alert("Please enter your zip/postcode code");
		 theForm.postcode.focus();
		 return(false);
	}

	if(theForm.country.value == "") {
		 alert("Please enter your country");
		 theForm.country.focus();
		 return(false);
	}
	return (true);
}