function testOpt(theOpt,theName) {
	if (theOpt.selectedIndex == 0 && theOpt.options[theOpt.selectedIndex].text.indexOf('Choose')!=-1) {
		alert('Please choose a '+theName);
		return false;
	}
}
function CheckForm(f)
{
	with (f)
	{
		var CountUp		= 0;
		var qty 		= 0;
		var hasInput	= false;
		var qty 		= eval('f.QTY');
		var	opt1 		= eval('f.OPT10');
		var	opt2 		= eval('f.OPT20');
		var	opt3 		= eval('f.OPT30');
		var	opt4 		= eval('f.OPT40');
		var	opt5 		= eval('f.OPT50');
		var	opt6 		= eval('f.OPT60');
		var	prod 		= eval('f.PROD0');
		var qtyTagType  = document.getElementById("QTY0");
			
		if (opt1) { if (testOpt(opt1, opt10Label.value) == false) return false; }
		if (opt2) { if (testOpt(opt2, opt20Label.value) == false) return false; }
		if (opt3) { if (testOpt(opt3, opt30Label.value) == false) return false; }
		if (opt4) { if (testOpt(opt4, opt40Label.value) == false) return false; }
		if (opt5) { if (testOpt(opt5, opt50Label.value) == false) return false; }
		if (opt6) { if (testOpt(opt6, opt60Label.value) == false) return false; }

		if (qtyTagType)
		{
			if (qtyTagType.tagName == "INPUT")  	qty = eval('f.QTY0');
			if (qtyTagType.tagName == "SELECT")  	qty = eval('f.QTY0.options[f.QTY0.selectedIndex]');
		}

		if (qty.value.length > 0)
		{
			if (isNaN(qty.value/2))
			{
				window.alert('One or more of the fields contains invalid characters');
				return false;
			}
		}
		else
		{
			alert('Please choose a quantity for product ID:'+prod.value);
			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;
	}
}