function jsUpdateCart(){
	var parameter_string = "";
	allNodes = document.getElementsByClassName("process");
	for(i = 0; i < allNodes.length; i++) {
	var tempid = allNodes[i].id;
	var temp = new Array;
	temp = tempid.split("_");
	var real_id = temp[2];
	var real_value = allNodes[i].value;
	parameter_string += real_id +":"+real_value+",";
	}
	var parameter_flavors = "";
	allNodes2 = document.getElementsByClassName("product_flavors");
	for(i = 0; i < allNodes2.length; i++) {
	var tempid = allNodes2[i].id;
	var temp = new Array;
	temp = tempid.split("_");
	var real_id = temp[2];
	var real_value = allNodes2[i].value;
	parameter_flavors += real_value+",";
	}
	var params = "ids="+parameter_string+"&flavors="+parameter_flavors;
	var ajax = new Ajax.Updater(
	"ajax_msg", "cart/ajax_cart",
	{method:"post",parameters:params,onComplete:showMessage}
	);
}
function showMessage(req){
	$("ajax_msg").innerHTML = req.responseText;
	location.reload(true);
}
function jsRemoveProduct(id,flavor){
	var params = "id="+id+"&flavor="+flavor;
	var ajax = new Ajax.Updater(
	"ajax_msg","cart/ajax_cart_remove",
	{method:"post",parameters:params,onComplete:showMessage}
	);
}

function sameAsBill()
{
	if(document.myForm.chkSAME_BILL.checked)
	{
		document.myForm.ctlDELV_FULLNAME.value = document.myForm.ctlBILL_FULLNAME.value;
		document.myForm.ctlDELV_ADDRESS1.value = document.myForm.ctlBILL_ADDRESS1.value;
		document.myForm.ctlDELV_ADDRESS2.value = document.myForm.ctlBILL_ADDRESS2.value;
		document.myForm.ctlDELV_STATE.value = document.myForm.ctlBILL_STATE.value;
		document.myForm.ctlDELV_CITY.value = document.myForm.ctlBILL_CITY.value;
		document.myForm.ctlDELV_COUNTRY.value = document.myForm.ctlBILL_COUNTRY.value;
		document.myForm.ctlDELV_ZIP.value = document.myForm.ctlBILL_ZIP.value;
		document.myForm.ctlDELV_PHONE1.value = document.myForm.ctlBILL_PHONE1.value;
		document.myForm.ctlDELV_PHONE2.value = document.myForm.ctlBILL_PHONE2.value;
		document.myForm.ctlDELV_PHONE3.value = document.myForm.ctlBILL_PHONE3.value;
	}
	else
	{
		document.myForm.ctlDELV_FULLNAME.value = "";
		document.myForm.ctlDELV_ADDRESS1.value = "";
		document.myForm.ctlDELV_ADDRESS2.value = "";
		document.myForm.ctlDELV_STATE.value = "";
		document.myForm.ctlDELV_CITY.value = "";
		document.myForm.ctlDELV_COUNTRY.value = "";
		document.myForm.ctlDELV_ZIP.value = "";
		document.myForm.ctlDELV_PHONE1.value = "";
		document.myForm.ctlDELV_PHONE2.value = "";
		document.myForm.ctlDELV_PHONE3.value = "";
	}		
}