function AddItem(ID, qty)
{
  n = Number(qty);
	if (isNaN(n))
	   alert("Invalid Quantity Entered"); 
  else if (n < 1)
		 alert("No Quantity Specified");
	else if (n.toFixed(0) != n)
	   alert("Quantity must be a whole number.");
	else
	{
		window.location.href = "CartItemSubmit.php?mode=A&productid="+ID+"&qty="+n;
	}
}

function ChangeQty(ID, newqty)
{
  n = Number(newqty);
	if (isNaN(n))
	   alert("Invalid Quantity Entered"); 
	else if (n.toFixed(0) != n)
	   alert("Quantity must be a whole number.");
	else
	{
		window.location.href = "CartItemSubmit.php?mode=C&productid="+ID+"&qty="+n;
	}
}

function EmptyCart()
{
	window.location.href = "CartItemSubmit.php?mode=E";
}

function RemoveItem(ID)
{
	window.location.href = "CartItemSubmit.php?mode=R&productid="+ID;
}

function UsernameLookup(url, username)
{
  window.location.href = url+"username="+username;
}