function check() {
	var ns, pk, current;
	with (document.forms['purchase']) {
	var indicator=0;
		if (ltrim(CustomerCode.value)=='') { alert('Customer ID not specified'); return false; }
    if (ltrim(NumSeats.value)=='') { alert('Number of users not specified'); return false; }
	if (NumSeats.value<5) { alert('The number of seats is less than the minimum requirement.\nFive licenses or more are needed.'); return false; }
	//	if (PO.value=='') { alert('Purchase Order # not specified'); return false; }
	// check if any checkbox checked or one of text fields not null
		for(var i=0;i<elements.length;i++) {
			ns=elements[i];
/* 			if (ns.name=='NumSeats') {	
				current=ns; */
/* ProductKey				
				pk=elements[i+1];
 */				
//				if (ns.value!='') { 	
//					indicator=1;
/* ProductKey					
					if (pk.value=='') { alert('Product key not specified'); return false; }
 */					
//				}
//			}
			if ((ns.name=='Buy') && (ns.checked || ns.value=='on')){
/*				if (current.value=='') {
					alert('No product/bundle specified for extensions selected');
					return false;
				} */
				indicator=1;        
			}
		} 
		if (indicator==0) { alert('No product specified'); return false; }
		else return true;
// end of with stmt	
	}
// end of function	
}

function ltrim(str) {
	while (str.charAt(0) == " ")
		str = str.substring(1, str.length);
	return str;
}