function validateJoinForm(f) {
	var bErrorFound = false;
	var strErrorMsg = 'Please correct the following problems:\n'

	if (empty(f.vName)) {
		strErrorMsg = strErrorMsg + '\n - Name is required';
		bErrorFound = true;
	}
	
	if (empty(f.vAddress1)) {
		strErrorMsg = strErrorMsg + '\n - Address, line 1 is required';
		bErrorFound = true;
	}	

	if (empty(f.vCity)) {
		strErrorMsg = strErrorMsg + '\n - City is required';
		bErrorFound = true;
	}

	if (empty(f.vCountry)) {
		strErrorMsg = strErrorMsg + '\n - Country is required';
		bErrorFound = true;
	}

	if (empty(f.vState) && f.vCountry.options[f.vCountry.selectedIndex].value == 'US') {
		strErrorMsg = strErrorMsg + '\n - State is required if in U.S.';
		bErrorFound = true;
	}	

	if (empty(f.vZip) && f.vCountry.options[f.vCountry.selectedIndex].value == 'US') {
		strErrorMsg = strErrorMsg + '\n - Zip is required if in U.S.';
		bErrorFound = true;
	}	

	if (empty(f.vEmail)) {
		strErrorMsg = strErrorMsg + '\n - Email is required';
		bErrorFound = true;
	}
 
	if (!empty(f.vEmail) && !verifyEmail(f.vEmail.value)) {
		strErrorMsg = strErrorMsg + '\n - Email must be a valid e-mail address';
		bErrorFound = true;
	}

	if (empty(f.laMemberCategoryID)) {
		strErrorMsg = strErrorMsg + '\n - Membership category is required';
		bErrorFound = true;
	}

	if (!empty(f.laMemberCategoryID)) {	
		// get selected category
		var selCategory = 0;
		
		for (i=0; i < f.laMemberCategoryID.length; i++) {
			if (f.laMemberCategoryID[i].checked) {
				selCategory = i;
			}
		}
	
		if (selCategory > 0 && empty(f.vShirtSize)) {
			strErrorMsg = strErrorMsg + '\n - T-shirt size is required for this membership category';
			bErrorFound = true;
		}
	}

	if (f.iRenewal[1].checked && empty(f.iMailingList)) {
		strErrorMsg = strErrorMsg + '\n - \'Join mailing list?\' is required for new members';
		bErrorFound = true;
	}	
	
	if (f.iRenewal[1].checked && empty(f.iMemberList)) {
		strErrorMsg = strErrorMsg + '\n - \'Include in membership list?\' is required for new members';
		bErrorFound = true;
	}	

	if (empty(f.vCode)) {
		strErrorMsg = strErrorMsg + '\n - Verification Code is required';
		bErrorFound = true;
	}

	if (bErrorFound == true) {
		alert(strErrorMsg);
		return false;
	} else {		
		return true;	
	}
}

