    /*
		This function only allows you to add to an order, it always sets the 
		order quantity to 1
	*/
    function addToOrder(sProdID, sProdDescription, nMinOrdQty)
    {
		var sPreamble = "";
		if (nMinOrdQty > 0)
		{
			sPreamble = "This product has a minimum order quantity of " + nMinOrdQty + "\n\n";
		}
		if (confirm(sPreamble + "Would you like to add the product:\n" + sProdDescription + "\nto your order?"))
		{
			var sCookieVal      = getCookie("order");
			var sCookieOrderVal = getCookie("orderQty");
			if (sCookieVal == false)//then we haven't added anything to the order as yet
			{
				addCookie("order",sProdID);
				addCookie("orderQty",1);
			}
			else
			{
				//only add the cookies if the id doesn't already exist
				var sSearchString = new String(getCookie("order"));
				if (sSearchString.indexOf(sProdID) == -1)
				{
					sCookieVal += "," + sProdID; //add other prod id's comma separated.
					addCookie("order", sCookieVal);
				
					sCookieOrderVal += "," + 1; //add other order quantities comma separated
					addCookie("orderQty", sCookieOrderVal);
				}
			}
			document.location = "shoppingbasket.aspx";
		}
    }//end function addToOrder
    
    function clearOrder()
    {
		deleteCookie("order");
		deleteCookie("orderQty");
		alert("You are ready to start adding new goods to your shopping cart");
    }//end function clearOrder
    
    
    
    //-------------the base cookie functions ------------------
    
    function deleteCookie(name)
    {
		document.cookie = name + "=; expires=Fri, 02-Jan-1970 00:00:00 GMT;"
    }//end function deleteCookie
    
    function addCookie(name,data) 
    {
       var expires = new Date()
       expires.setTime(expires.getTime() + 120*60*1000)//cookie lasts 2 hours
       document.cookie = name + "=" + escape(data) + ";expires=" +expires.toGMTString() +";"
    }//'end function addCookie


    //'gets the data for the passed in cookie 
    function getCookie(name) 
    {
       var result	     = false
       var myCookie 	 =" "+ document.cookie + ";"
       var searchName 	 =" " + name +"="
       var startOfCookie = myCookie.indexOf(searchName)
    	
       if (startOfCookie != -1) 
       {
             startOfCookie  += searchName.length
             var endOfCookie = myCookie.indexOf(";", startOfCookie)
           
             result = unescape(myCookie.substring(startOfCookie, endOfCookie))
       }
       return result
    }//'end function getCookie	