	
	function myClick () {
			if (event.button==2) {
				alert ('Sorry, right Mouse button is disabled.')
			}
	}
	function alterError(value) {
		if (value<=0.99) {
			n1 = '0';
		} else {
			n1 = parseInt(value);
		}
		n2 = parseInt((value+.0008 - n1)* 100);
		if (eval(n2) <= 9) n2='0'+n2;
		newString = n1 + '.' + n2;
		return (newString);
	}
	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=/";
			
			newWindow = window.open('add.htm','newWin','toolbar=no,titlebar=no,directories=no,location=no,scrollbars=no,resizable=no,menubar=no,status=no,width=300,height=275') 
			newWindow.focus()
	
	}

	}
function buyItem2(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=/";
		}}
	function resetShoppingBasket() {
		index = document.cookie.indexOf("TheBasket");
		document.cookie="TheBasket=.";
	}
	function showItems() {
		index = document.cookie.indexOf("TheBasket");
		cntStrt = (document.cookie.indexOf("=", index) + 1);
        	cntEnd = document.cookie.indexOf(";", index);
        	if (cntEnd == -1) {
            		cntEnd = document.cookie.length;
        	}
		fulllist = document.cookie.substring(cntStrt, cntEnd);
		totprice = 0;
		document.write('<TABLE BORDER>');
		document.write('<TR><TD><b>Item</b></TD><TD><b>Quantity</b></TD><TD><b>Price Each</b></TD><td><b>Total Price</b><TD><P>&nbsp;</P></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.write('<tr><td>'+theitem+'</td><td align=right>'+thequantity+'</td><td align=right>'+theprice+'</td><td align=right>'+alterError(itemtotal)+'</td><td><a href="javascript:removeItem('+itemlist+')">Remove</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) == '#') {
				theprice = fulllist.substring(itemstart, i);
				itemstart = i+1;
			}
		}
		document.write('<tr><td colspan=3><b>Total</b></td><td align=right>'+alterError(totprice)+'</td><td></td></tr>');
		document.write('</TABLE>');	}

	function checkingOut () {
		newPage="...\/orderform.htm"
		window.location.href =  newPage
	}
	function checkingBasket () {
		newPage="...\/basket.htm"
		window.location.href = newPage
	}

	function checkframes () {

// if frames are not in use? 
		if (parent == null || parent == self)
		{var messageOne=" <FONT FACE='Verdana, Garamond' SIZE=4 COLOR='#000080'><P ALIGN='CENTER'>This site uses frames. If the frame containing the navigation buttons is currently not visible on the left hand side of this document, then please click</FONT><B><FONT FACE='Verdana, Garamond' COLOR='#800000'><A HREF='http://www.cardsbycarolyn.co.uk/main.htm'> here </B></FONT></A><B><FONT FACE='Verdana, Garamond' SIZE=4 COLOR='#000080'> </b>to explore my site</P></FONT>"
		document.write(messageOne)
		}
	}	

function openWindow (newURL) {
		newWindow = window.open(newURL,'newWin','toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=450,height=300') 
		newWindow.focus()
		}
	function writecode (toURL) {
		
		document.writeln('<A HREF="javascript:openWindow(\''+toURL+'\')">')
		}
