// JavaScript Document
function updatePrice()
{
number = document.cart.number.value;
document.cart.amount.value = 0;
document.cart.item_name.value = "";
document.cart.item_price.value = "";
for (i=0; i<=number; i++)
{
	if (document.cart.check[i].checked) { 
	
		price=parseInt(document.cart.amount.value)+parseInt(document.cart.price[i].value);
		document.cart.amount.value = price.toFixed(2);
		document.cart.item_name.value +=  document.cart.product[i].value 
		document.cart.item_price.value +=  document.cart.price[i].value 
		if (i!=number) {
			document.cart.item_price.value += ", ";
			document.cart.item_name.value += ", ";
		}
	}
}
}


function formSubmit() {
	if (parseInt(document.cart.amount.value)>0) {
		document.cart.submit();
	} else {
		alert("Your Cart is Empty.");
	}
}

function confirmation(URL) {
	var agree=confirm("Are you sure you wish to delete this product?");
	if (agree)
		 window.location=URL;
}
