
	// 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 shooping basket
	function buyItem(newItem, newPrice, newQuantity) {
		if (newQuantity <= 0) {
			rc = alert('The quantity entered is incorrect');
		} else {
			if (confirm('Add '+newQuantity+'  '+newItem+' to your cart')) {
				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+"|"+newQuantity+"]";
			}
		}
	}

	// resetShoppingBasket - resets to shopping basket to empty
	function resetShoppingBasket() {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
	}
