function oneOnly(parm,chr,must) {
	var atPos = parm.indexOf(chr,0);
	if (atPos == -1) {return !must;}
	if (parm.indexOf(chr, atPos + 1) > - 1) {return false;}
	return true; 
}

function allRequired() {
	var allReqOK = true;
	var errMsg = new Array();
	var HTMLString = '';
	if(document.forms[0].fname.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the First Name field.</li>';
	}
	if(document.forms[0].lname.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the Last Name field.</li>';
	}
	if(document.forms[0].address.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the Address field.</li>';
	}
	if(document.forms[0].city.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the City field.</li>';
	}
	if(document.forms[0].state.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the State field.</li>';
	}
	if(document.forms[0].zip.value=='') {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please fill in the Zip Code field.</li>';
	}
	if((document.forms[0].quantity_1.value=='' || document.forms[0].quantity_1.value==0) && (document.forms[0].quantity_2.value=='' || document.forms[0].quantity_2.value==0) && (document.forms[0].quantity_3.value=='' || document.forms[0].quantity_3.value==0) && (document.forms[0].quantity_4.value=='' || document.forms[0].quantity_4.value==0) && (document.forms[0].quantity_5.value=='' || document.forms[0].quantity_5.value==0) && (document.forms[0].quantity_6.value=='' || document.forms[0].quantity_6.value==0) && (document.forms[0].quantity_7.value=='' || document.forms[0].quantity_7.value==0) && (document.forms[0].quantity_8.value=='' || document.forms[0].quantity_8.value==0) && (document.forms[0].quantity_9.value=='' || document.forms[0].quantity_9.value==0) && (document.forms[0].quantity_10.value=='' || document.forms[0].quantity_10.value==0)) {
		allReqOK = false;
		errMsg[errMsg.length] = '<li>Please select a quantity greater than 0 for any item you wish to order.</li>';
	}
	if(allReqOK==false) {
		HTMLString = '<p><b>There was an error with your submission:</b></p><ul>';
		for(var i=0;i<errMsg.length;i++) {
			HTMLString += errMsg[i];
		}
		HTMLString += '</ul>';

		document.getElementById("errMsg").innerHTML = HTMLString;
		document.getElementById("errMsg").style.visibility = 'visible';

		return false;
		
	} else {
		
		return true;

	}

}