var theUndefined;

function CheckForm(f)
{
	with (f)
	{
		var CountUp			= 0;
		var qty 			= 0;

		for (var n = 0; n < productcount.value; n++)
		{
			var qty 		= eval('f.QTY' + n);

			if (qty.value.length > 0)
			{
				if (isNaN(qty.value/2))
				{
					window.alert('One or more of the fields contains invalid characters');
					return false;
				}
			}

			CountUp += (qty.value - 0);

			if (qty.value < 0)
			{
				alert('Surprisingly you cannot purchase a negative number of items');
				return false;
			}
		}
		if (CountUp == 0)
		{
			window.alert('You must select more than 0 items');
			return false;
		}
	}
}
