
function testOpt(theOpt,theName) {
	if (theOpt.selectedIndex == 0 && theOpt.options[theOpt.selectedIndex].text.indexOf('Choose')!=-1) {
		alert('Please choose a '+theName);
		return false;
	}
}


function listProductCheckIt(formName, opt1Label, opt2Label, opt3Label, opt4Label, opt5Label, opt6Label)
{
	var	thisForm	= eval('document.' + formName);

	var	prod		= eval('document.' + formName + '.PROD0');
	var	price		= eval('document.' + formName + '.PRICE0');

	var	opt1		= eval('document.' + formName + '.OPT10');
	var	opt2		= eval('document.' + formName + '.OPT20');
	var	opt3		= eval('document.' + formName + '.OPT30');
	var	opt4		= eval('document.' + formName + '.OPT40');
	var	opt5		= eval('document.' + formName + '.OPT50');
	var	opt6		= eval('document.' + formName + '.OPT60');

	var	qty			= eval('document.' + formName + '.QTY0');

	if (prod) {
		if (prod.value == '') {
			alert('Need to set product id in form');
			return false;
		}
	}
	if (price) {
		if (price.value == '') {
			alert('Need to set price in form');
			return false;
		}
	}
	if (opt1) {if (testOpt(opt1,opt1Label)==false) return false;}
	if (opt2) {if (testOpt(opt2,opt2Label)==false) return false;}
	if (opt3) {if (testOpt(opt3,opt3Label)==false) return false;}
	if (opt4) {if (testOpt(opt4,opt4Label)==false) return false;}
	if (opt5) {if (testOpt(opt5,opt5Label)==false) return false;}
	if (opt6) {if (testOpt(opt6,opt6Label)==false) return false;}

	if (qty) {
		if (isNaN(qty.value/2)) {
			alert("Only numbers are allowed in the quantity field"); 
			return false;
		}
		if (qty.value == '' || qty.value == '0') {
			alert('Please indicate how many of this item you wish to purchase');
			return false;
		}
		if (qty.value < 0) {
			alert('Surprisingly you cannot purchase a negative number of items');
			return false;
		}
	}

	return true;
}
