
function GetFormByName(fn,ly)
{
	var f = document.forms[fn];

	if (f==null)
		alert("Could not locate form " + fn + " of layer " + ly);

	return f;
}

function AddToCart(itemName,itemPrice)
{
	var ppf = document.forms["PAYMENT"];

	if (ppf==null)
	{
		alert("Could not locate PAYMENT form");
		return;
	}

	var piname = ppf.elements["item_name"];
	if (piname==null)
	{
		alert("Could not locate item name in PAYMENT form");
		return;
	}

	var piprice = ppf.elements["amount"];
	if (piprice==null)
	{
		alert("Could not locate item price in PAYMENT form");
		return;
	}

	piname.value = itemName;
	piprice.value = itemPrice;
	ppf.submit();
}





