// The following lines must be in the form
//   <form method=POST onSubmit="return checkForm(); DoctorElements();" name="moreInfoForm" ACTION="../generic_mailForm.asp">
// <input type=HIDDEN name="formName" value="name="moreInfoForm">
//

// <!------------------------------------------------------------------->
// <INPUT type=button value="Clear Form" onClick='javascript:document.forms[0].reset();'>
// &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// <INPUT type=submit value="Submit Application form" name=butSubmitApp onClick="return checkForm();"> 
// <!------------------------------------------------------------------->


function resetForm() {
	document.forms[0].reset();
}


function checkLength (thisField, nextField)
{
	if (document.forms[0].thisField.length >= 3) {
		document.forms[0].eval(nextField).focus();
	}
	return true;
}


function checkForm()
	 {

	 var missing = "";
	 var count = 0;
	 var error = "";
		if (document.forms[0].txtfirstname.value == "") { missing +="\n Your first name"; }
		if (document.forms[0].txtlastname.value == "") { missing +="\n Your last name"; }
		if (document.forms[0].txtstreet.value == "") { missing +="\n Your street address"; }
		if (document.forms[0].txtcity.value == "") { missing +="\n Your city"; }
		if (document.forms[0].txtstate.value == "") { missing +="\n Your state"; }
		if (document.forms[0].txtcountry.value == "") { missing +="\n Your country"; }
		if (document.forms[0].txtzip.value == "") { missing +="\n Your ZIP code"; }
		if (document.forms[0].txtareacode.value == "") { missing +="\n Your areacode"; }
		if (document.forms[0].txtphone.value == "") { missing +="\n Your phone"; }
		if (document.forms[0].txtemail.value == "") { missing +="\n Your email address"; }

		if (document.forms[0].txtHigh_School.value == "") { missing +="\n Your High School"; }
		if (document.forms[0].txtGraduation_Year.value == "") { missing +="\n Your Graduation Year"; }


		if (missing !="")
		{
			 missing = error + "Please enter the following information: \n" + missing;
			 alert(missing);
			 return false;
		}
		else if (error !="")
			 {
			 alert(error);
			 return false;
			 }
		else
			 {
				return true;
			 }

	}