<!-- Hide script from older browsers
	function move_in(img_name,img_src) {
		document[img_name].src=img_src;
	}

	function move_out(img_name,img_src) {
		document[img_name].src=img_src;
	}

	function preload() {
		imageBackButn = new Image();
		imageBackButn.src = "images/butnFooterBag_back_hl.jpg";

		imageBooksButn = new Image();
		imageBooksButn.src = "images/butnFooterBag_books_hl.jpg";

		imageGemsButn = new Image();
		imageGemsButn.src = "images/butnFooterBag_gems_hl.jpg";

		imageInstituteButn = new Image();
		imageInstituteButn.src = "images/butnFooterBag_institute_hl.jpg";

		imageInfoButn = new Image();
		imageInfoButn.src = "images/butnFooterBag_info_hl.jpg";

		imageEmailButn = new Image();
		imageEmailButn.src = "images/butnFooterBag_email_hl.jpg";
	}

	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 cellspacing="0" cellpadding="0" width="620" border="0">');
			//document.writeln('<tr><td align="center" background="images/bcgdBagRemoveColumn.jpg" width="316"><em>Item</em></td><td align="center" background="images/bcgdBagRemoveColumn.jpg" width="65"><em>Quantity</em></td><td align="center" background="images/bcgdBagRemoveColumn.jpg" width="86" valign="middle" height="50"><em>Cost Each<br>In U.S. $s</em></td><td align="center" background="images/bcgdBagRemoveColumn.jpg" width="92" valign="middle" height="50"><em>Total Cost<br>In U.S. $s</em></td><td align="center" background="images/bcgdBagRemoveColumn.jpg" width="67" valign="middle" height="50"><em>Action</em></td></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><td align="left" width="302" valign="middle" background="images/bcgdBagTable.jpg"><p style="margin-left: 11px; margin-top: 6px; margin-bottom: 5px"><font size="2"><b>'+theitem+'</b><br>'+thesize+'</font></p></td><td align="center" width="73" valign="middle" background="images/bcgdBagTable.jpg"><font size="2">'+thequantity+'</font></td>');
				if (theprice >='0') {
					document.writeln('<td align="right" background="images/bcgdBagTable.jpg" width="86" valign="middle"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2">$'+theprice+'</font></p></td><td align="right" background="images/bcgdBagTable.jpg" width="92" valign="middle"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2">$'+alterError(itemtotal)+'</font></td><td background="images/bcgdBagRemoveColumn.jpg" width="67" align="center" valign="middle"><a href="javascript:removeItem('+itemlist+')"><img src="images/butnBagRemove.jpg" border="0"></a></td></tr>');
				}
				else {
					coupon = (eval(theprice*-1));
					document.writeln('<td align="right" background="images/bcgdBagTable.jpg" width="86" valign="middle"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2"><b>$'+coupon+' off</b></font></p></td><td align="right" background="images/bcgdBagTable.jpg" width="92" valign="middle"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2"><b>$'+coupon+' off</b></font></td><td background="images/bcgdBagRemoveColumn.jpg" width="67" align="center" valign="middle"><a href="javascript:removeItem('+itemlist+')"><img src="images/butnBagRemove.jpg" border="0"></a></td></tr>');
				}
			}
			else if (fulllist.substring(i,i+1) == ',') {
				theitem = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == '*') {
				thesize = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
			else if (fulllist.substring(i,i+1) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
		}
		if (totprice >'-1') {
			document.writeln('<tr><td background="images/bcgdBagTableLineTotal.jpg" valign="middle" colspan="3"><p style="margin-left: 11px; margin-top: 7px; margin-bottom: 5px"><b>Total</b></td><td align="right" background="images/bcgdBagTableLineTotal.jpg"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2"><b>$'+top.alterError(totprice)+'</b></td><td background="images/bcgdBagRemoveColumn.jpg"></td></tr>');
		}
		else {
			coupon = (eval(totprice*-1));
			document.writeln('<tr><td background="images/bcgdBagTableLineTotal.jpg" valign="middle" colspan="3"><p style="margin-left: 11px; margin-top: 7px; margin-bottom: 5px"><b>Total</b></td><td align="right" background="images/bcgdBagTableLineTotal.jpg"><p style="margin-right: 11px; margin-top: 0; margin-bottom: 0"><font size="2"><b>$'+coupon+' off</b></td><td background="images/bcgdBagRemoveColumn.jpg"></td></tr>');
		}
		document.writeln('<tr><td height="11" background="images/bcgdBagTableLineTotal.jpg" colspan="5"></td></tr></table>');
	}

	// removeItem() - removes an item from the bag
	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)+']';
				}
			}
		}
		expireDate = new Date
		expireDate.setMonth(expireDate.getMonth()+6)
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket="+newItemList+ ";expires=" + expireDate.toGMTString() +"; path=/";
		top.location = "shopBag.htm";
	}

	// clearBasket() - removes all items from the bag- not used at this time
	function clearBasket() {
		if (confirm('Are you sure you want to empty your shopping bag?')) {
			index = document.cookie.indexOf("TheBasket");
			document.cookie="TheBasket=.";
			top.location = "shopBag.htm";
		}
	}

	// 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 bag
	function buyItem(newItem, newPrice, newQuantity) {
		if (newQuantity <= 0) {
			rc = alert('The quantity entered is incorrect');
			return false;
		}
		if (confirm('Add '+newQuantity+' x '+newItem+' to basket')) {
			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+"]; path=/" ;
		}
		return true;
	}

	// resetShoppingBasket - resets to shopping bag to empty
	function resetShoppingBasket() {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
	}

// End hiding script -->