function fridaySelected(f) {
	if (f.iType[0].checked || f.iType[1].checked || f.iType[3].checked || f.iType[4].checked || f.iType[6].checked || f.iType[7].checked) {
		return true;
	} else {
		return false;
	}
}

function saturdaySelected(f) {
	if (f.iType[0].checked || f.iType[2].checked || f.iType[3].checked || f.iType[5].checked || f.iType[6].checked || f.iType[8].checked) {
		return true;
	} else {
		return false;
	}
}

function validate(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.vEmail) && !verifyEmail(f.vEmail.value)) {
		strErrorMsg = strErrorMsg + '\n - Email must be a valid e-mail address';
		bErrorFound = true;
	}

	// Friday
	
	if (empty(f.vSessionFri1_1) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 1, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSessionFri1_2) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 1, Choice 2 is required';
		bErrorFound = true;
	}		

	if (empty(f.vSessionFri2_1) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 2, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSessionFri2_2) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 2, Choice 2 is required';
		bErrorFound = true;
	}		

	if (empty(f.vSessionFri3_1) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 3, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSessionFri3_2) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 3, Choice 2 is required';
		bErrorFound = true;
	}		

	if (empty(f.vSessionFri4_1) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 4, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSessionFri4_2) && fridaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Friday - Session 4, Choice 2 is required';
		bErrorFound = true;
	}		

	// Saturday
	
	if (empty(f.vSession1_1) && saturdaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Saturday - Session 1, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSession1_2) && saturdaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Saturday - Session 1, Choice 2 is required';
		bErrorFound = true;
	}		

	if (!empty(f.vSession1_1) && !empty(f.vSession1_2)) {
		if (f.vSession1_1.selectedIndex == f.vSession1_2.selectedIndex) {
			strErrorMsg = strErrorMsg + '\n - You cannot select the same Saturday - Session 1 choice more than once';
		bErrorFound = true;		
		}
	}

	if (empty(f.vSession2_1) && saturdaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Saturday - Session 2, Choice 1 is required';
		bErrorFound = true;
	}	
	
	if (empty(f.vSession2_2) && saturdaySelected(f)) {
		strErrorMsg = strErrorMsg + '\n - Saturday - Session 2, Choice 2 is required';
		bErrorFound = true;
	}		

	if (!empty(f.vSession2_1) && !empty(f.vSession2_2)) {
		if (f.vSession2_1.selectedIndex == f.vSession2_2.selectedIndex) {
			strErrorMsg = strErrorMsg + '\n - You cannot select the same Saturday - Session 2 choice more than once';
		bErrorFound = true;		
		}
	}

	if (bErrorFound == true) {
		alert(strErrorMsg);
		return false;
	} else {		
		return true;	
	}
}
