function AddToOrder(item, description, price, custom, quantity, relPath) {
	
	var TheCookText = ""
	var TheCookValues = ""
	var Sep = "!"
	var WhenCooked = new Date()
	var CookExpires = new Date()
	var AllTheCookieData = ""
	var AllCookies = new Array()
	var theDescription = RemoveStuff(description)
	var customized = ""
	
	if (validateNumber(quantity) == 0) {
		
		if (custom != "0") {
			if (custom == true) {
				customized = "*"
			}
		}
		
		TheCookType = item + "="
		
		TheCookText = customized + theDescription + Sep
		TheCookText += "X" + Sep
		TheCookText += "X" + Sep
		TheCookText += "X" + Sep
		TheCookText += "X" + Sep
		TheCookText += "Qty" + Sep
		TheCookText += relPath + "?"
	
		TheCookValues = price + Sep
		TheCookValues += "0" + Sep
		TheCookValues += "0" + Sep
		TheCookValues += "0" + Sep
		TheCookValues += "0" + Sep
		TheCookValues += quantity + Sep
		TheCookValues += "-1"
			
		CookExpires.setMonth(WhenCooked.getMonth()+1)
		
		AllTheCookieData = TheCookType + TheCookText + TheCookValues
		AllTheCookieData += ";expires=" + CookExpires.toGMTString()
	
		document.cookie = AllTheCookieData
		
		AllCookies = document.cookie.split("; ")
		for (var j = 0; j < AllCookies.length; j++) {
			if (AllCookies[j].split("=")[0] == "Shipping") {
				document.cookie = "Shipping=0;expires="+WhenCooked.toGMTString()
			}
		}
		
		window.location="shoppingcart.html"
	}
}

function RemoveStuff(TheString) {
	var TestChar = ""
	var ChangedString = ""
	for (var i = 0; i < TheString.length; i++) {
		TestChar = TheString.charAt(i)
		if (TestChar == "," || TestChar == "/" || TestChar == ":" || TestChar == "." || TestChar == "-") {
			TestChar = ""
		}
		ChangedString += TestChar
	}
	return ChangedString
}
			
function validateNumber(n) {
	var j = 0
	var k = 0
	var theNumbers = "0123456789"
	var theCheck = ""
	var theResult = new Array()
	var theTotalResult = 0

	for (j = 0; j < n.length; j++) {
		theCheck = n.charAt(j)
		theResult[j] = 1
		for (k = 0; k < theNumbers.length; k++) {
			if (theCheck == theNumbers.charAt(k)) {
				theResult[j] = 0
			}
		}
	}
	for (j = 0; j < n.length; j++) {
		theTotalResult = theTotalResult + theResult[j]
	}
	if (theTotalResult > 0) {
		alert("Please enter a valid quantity.")
		document.forms[0].QUANTITY.value = "1"
		return 1
	}
	else {
		return 0
	}
}