
// Agent Signup Form Validation Functions

function validateStep1() {
	with (document.Step1) {
		var missing = false;
		var theMsg = "";
		var theMissingFields = "";

		// Make Sure All Required Fields Have Been Filled-In, Selected, or Checked.
		if (companyid.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not selected your company.\n";
		}
		if (firstname.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your first name.\n";
		}
		if (lastname.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your last name.\n";
		}
		if (clienttypeid[0].checked == false & clienttypeid[1].checked == false &clienttypeid[2].checked == false) {
			missing = true;
			theMsg = theMsg + "	You have not selected a client type.\n";
		}
		if (email.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your email address.\n";
		}
		if (voice.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your phone number.\n";
		}
		theMissingFields = theMsg;

		if (missing) {
			var theMsgHeader = "Some required information was not provided. Please note the missing information.\n";
			theMsg = theMsgHeader + "\n\n";
			if (theMissingFields != "") {
				theSectionMsg = theMissingFields;
			}
			theMsg = theMsg + theSectionMsg + "\n\n";
			alert(theMsg);
			return(false);
		}
		return(true);
	}
}

function validateEMAIL() {
	with (document.Step1) {
		var missing = false;
		var theMsg = "";
		var theMissingFields = "";

		// Make Sure All Required Fields Have Been Filled-In, Selected, or Checked.
		if (email.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your email address.\n";
		}
		theMissingFields = theMsg;

		if (missing) {
			var theMsgHeader = "Some required information was not provided. Please note the missing information.\n";
			theMsg = theMsgHeader + "\n\n";
			if (theMissingFields != "") {
				theSectionMsg = theMissingFields;
			}
			theMsg = theMsg + theSectionMsg + "\n\n";
			alert(theMsg);
			return(false);
		}
		return(true);
	}
}

function validateCompany() {
	with (document.NewCompany) {
		var missing = false;
		var theMsg = "";
		var theMissingFields = "";

		// Make Sure All Required Fields Have Been Filled-In, Selected, or Checked.
		if (companyname.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your company's name.\n";
		}
		if (address1.value == "" | city.value == "" | state.value == "" | zipcode.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not completely entered your company's address.\n";
		}
		if (voicelocal.value == "") {
			missing = true;
			theMsg = theMsg + "	You have not entered your company's local phone number.\n";
		}
		theMissingFields = theMsg;

		if (missing) {
			var theMsgHeader = "Some required information was not provided. Please note the missing information.\n";
			theMsg = theMsgHeader + "\n\n";
			if (theMissingFields != "") {
				theSectionMsg = theMissingFields;
			}
			theMsg = theMsg + theSectionMsg + "\n\n";
			alert(theMsg);
			return(false);
		}
		return(true);
	}
}


