//these functions are used by the shopping cart jsp page.

function removeItem( itemIndex ){
	if ( confirm( 'Are you sure you want to delete this item?' ) ) {
		if(!submittedFlag) {
			submittedFlag = true;
			document.ShoppingCartForm.action = partnerPath + "/do/checkout/removeItem";
			document.ShoppingCartForm.itemIndex.value = itemIndex;
			document.ShoppingCartForm.method = "post";			
			document.ShoppingCartForm.submit();
		} else {
			alert('You have already submitted this form please wait for the submission to complete.');
	    	return false;
		}
	}
}

function updateItem( itemIndex, oldQuantity, newQuantity ){
	if ( oldQuantity != newQuantity.value ) {
		if(!submittedFlag) {
			submittedFlag = true;
			document.ShoppingCartForm.action = partnerPath + "/do/checkout/updateItem";
			document.ShoppingCartForm.itemIndex.value = itemIndex;
			document.ShoppingCartForm.itemQuantity.value = newQuantity.value;
			document.ShoppingCartForm.method = "post";
			document.ShoppingCartForm.submit();
		} else {
			alert('You have already submitted this form please wait for the submission to complete.');
		   	return false;	
		}
	}
}

