function validateReferralClose(aForm) {
	// alert('validate referral closure');
	if (aForm.complete_type.options[aForm.complete_type.selectedIndex].value == 1) {
		// style, color & qty must be filled in
		if ( (trim(aForm.stylenum.value) == '') ||  (trim(aForm.color.value) == '') ||  (trim(aForm.qty.value) == '')) {
			alert('If you made a sale, please enter the Style, Color & Quantity');
			if (trim(aForm.stylenum.value) == '') { 
				aForm.stylenum.focus(); 
				return false;
			}
			if (trim(aForm.color.value) == '') {
				aForm.color.focus();
				return false;
			}
			if  (trim(aForm.qty.value) == '') {
				aForm.qty.focus();
				return false;
			}
		} // end if any required field is blank
		
			if (! isPositiveInteger(aForm.qty.value)) {
				alert('Quantity must be a number greater than 0');
				aForm.qty.focus();
				return false;
			}

	}
	else {
		if (aForm.complete_type.options[aForm.complete_type.selectedIndex].value == 3) {
			if  (trim(aForm.designer.value) == '') {
				alert('If you sold a competitor\'s style, please enter designer name.');
				aForm.designer.focus();
				return false;
			}
		}
		// alert('close type = '+aForm.complete_type.options[aForm.complete_type.selectedIndex].value);
	}
	return true;
}

