
function validate() {
	if(document.sr.firstName.value != "" && document.sr.lastName.value != "") {
		nameCheck = true;
	}else{
		nameCheck = false; 
	}
	
	if(document.sr.cityAndState.value != "") {
		cityAndStateCheck = true;
	}else{
		cityAndStateCheck = false;
	}
	
	if(document.sr.interestsPromotion.checked == true || document.sr.interestsEmpowerment.checked == true // condition continues...
		|| document.sr.interestsAccess.checked == true || // condition continues...
		(document.sr.interestsOther.checked == true && (document.sr.interestsOtherSpecify.value != "Enter other seminar interests here." && document.sr.interestsOtherSpecify.value != ""))) {
		interestsCheck = true;
	}else{
		interestsCheck = false;
	}

	if ((document.sr.hearR.checked == true && document.sr.hearRecruiter.value !="") || (document.sr.hearO.checked == true && (document.sr.hearOther.value != "Enter another way you heard about the seminar here." && document.sr.hearOther.value != ""))) {
		hearCheck = true;
	}else{
		hearCheck = false;
	}
	
	errorMsg = "";
	if (!nameCheck) {
		errorMsg += "- You left one of the name fields blank.\n";
	}
	
	// -----------------------BEGIN EMAIL CHECK
	email = document.sr.email.value;
	atPos = email.indexOf("@");
	stopPos = email.lastIndexOf(".");
	msg = "";
	if (email == "") {
		msg = "Not a valid Email address" + "\n";
	}
	if (atPos == -1 || stopPos == -1) {
		msg = "Not a valid email address";
	}
	if (stopPos < atPos) {
		msg = "Not a valid email address";
	}
	if (stopPos - atPos == 1) {
		msg = "Not a valid email address";
	}
	if (msg != "") {
		errorMsg += "- You have not entered a valid email address."
	}
	// ----------------------END EMAIL CHECK
	
	if (!cityAndStateCheck) {
		errorMsg += "- You left the city and state field blank.\n";
	}
	if (!interestsCheck) {
		errorMsg += "- You did not indicate your interest in attending the seminar.\n";
	}
	if (!hearCheck) {
		errorMsg += "- Please tell us how you heard about our seminars.";
	}

	if(errorMsg != "") {
		alert("Please correct the following errors in the form: \n\n"+errorMsg);
		return false;
	}else{
		return true;
	}
}


