var options = new Array;
function sumPayment(aPrice,anOption)
{

	var frm = document.forms[0];
	var iTotal = 0;
	var thePrice;
	options[anOption] = aPrice;
	for(theOption in options)
	{
		iTotal += options[theOption];
	}
	
	var amountField = "";
	var paymentField = "";
	for (i=0; i < frm.elements.length; i++)
	{
		if (frm.elements[i].name.indexOf("AmountTextBox") > 0)	
			amountField = frm.elements[i];
	
			
	}
	amountField.value = iTotal;

}

function affirmPurchase()
{
	var iTotal = 0;
	var thePrice;
	for(theOption in options)
	{
		iTotal += options[theOption];
	}

	if (iTotal > 0)
	{
		if (confirm("You are about to make a purchase.\n\nPress \"Ok\" to process your order or \"Cancel\" to cancel."))
			return true;
		else
			return false;
	}
	else
	{
		alert("You have not selected any items to purchase.\n\nPlease select an item and try again.");
		return false;
	}
}


