function processform(form, newlocation) {
	cookieString = "cgiCookieInput=action=" + form;
	quantities = "";
	for (i=0;i<document.forms[form].elements.length;i++) {
		if ((document.forms[form].elements[i].type == 'checkbox') || (document.forms[form].elements[i].type == 'radio')) {
			if (document.forms[form].elements[i].checked) {
				cookieString += "&" + document.forms[form].elements[i].name + "=" + escape(document.forms[form].elements[i].value);
			}
		} else {
			if ((document.layers) && (document.forms[form].elements[i].type == 'select-one')) {
				cookieString += "&" + document.forms[form].elements[i].name + "=" + escape(document.forms[form].elements[i].options[document.forms[form].elements[i].selectedIndex].value);
			} else {
				if (document.forms[form].elements[i].name == 'cartlinequantity') {
					quantity = document.forms[form].elements[i].value;
					while ( quantity.length < 5) {
					quantity = "0" + quantity;
				}
				quantities = quantities + quantity;
				} else {
					if (document.forms[form].elements[i].value != "")
						cookieString += "&" + document.forms[form].elements[i].name + "=" + escape(document.forms[form].elements[i].value);
				}
			}
		}
	}
	if (quantities != "") {
		cookieString += "&updatequantities=" + quantities;
	}
	document.cookie = cookieString;
	if (newlocation == null) newlocation = location.href;
	location.replace(newlocation);
	return false;
}

