var submitDone = false;

function processForm(theForm) {

	var why = "";
	why += checkFirstname(theForm.First_Name.value);
	why += checkLastname(theForm.Last_Name.value);
	why += checkEmail(theForm.Email.value);
	why += checkCity(theForm.City.value);
	why += checkState(theForm.State.selectedIndex);
	why += checkZip(theForm.Zip.value);

	if (why != "") {
		alert(why);
		return false;
	}

	if (theForm.groups_KEY51331_checkbox.checked || theForm.groups_KEY40989_checkbox.checked) {
		theForm.Receive_Email.value = 1;
	} else {
		theForm.Receive_Email.value = 0;
	}

	if (theForm.groups_KEY51331_checkbox.checked && theForm.groups_KEY40989_checkbox.checked) {
		theForm.email_trigger_KEYS.value = "0,2883";
	} else if (theForm.groups_KEY51331_checkbox.checked) {
		theForm.email_trigger_KEYS.value = "0,2881";
	} else if (theForm.groups_KEY40989_checkbox.checked) {
		theForm.email_trigger_KEYS.value = "0,2882";
	}

	theForm.redirect.value = "http://www.racefortheoceans.org/join_taf?Email=" + theForm.Email.value + "&fName=" + theForm.First_Name.value + "&lName=" + theForm.Last_Name.value + "&Street=" + theForm.Street.value + "&Street2=" + theForm.Street_2.value + "&City=" + theForm.City.value + "&State=" + theForm.State.value + "&Zip=" + theForm.Zip.value;

	if (!submitDone) {
		submitDone = true;
		return true;
	} else {
		alert ("Already submitted, please wait!");
		return false;
	}
}