function RSApp_Validator(theForm)	//rewritten 10/19/05 and 8/14/07 JRN
{
	
// COMPUTATIONS
	
	theForm.F0023.value = theForm.homephone1.value + theForm.homephone2.value;
	theForm.F0041.value = theForm.workphone1.value + theForm.workphone2.value;
	if (theForm.workphone3.value) theForm.F0041.value += theForm.workphone3.value;
	theForm.F0143.value = theForm.cellphone1.value + theForm.cellphone2.value;
	
	//theForm.F0024.value = "S";
	//if (!theForm.contact[0].checked)
	//{
	//	if (theForm.contact[1].checked || theForm.contact[2].checked) theForm.F0024.value = "B";
	//}
	//theForm.F0042.value = "N";
	//if (!theForm.contact[1].checked)
	//{
	//	if (theForm.contact[0].checked || theForm.contact[2].checked) theForm.F0042.value = "P";
	//}
	//theForm.F0137.value = "F";
	//if (!theForm.contact[2].checked)
	//{
	//	if (theForm.contact[0].checked || theForm.contact[1].checked) theForm.F0137.value = "T";
	//}

	theForm.F0115.value = ""; //work start
	if (theForm.F68b.value)
	{
		if (theForm.F68A.options[1].selected)
		{
			var arrive = Number(theForm.F68b.value);
			arrive += 12;
			theForm.F0115.value = arrive + theForm.F68c.value;
		}
		else
		{
			if (theForm.F68b.value < 10) theForm.F0115.value = 0 + theForm.F68b.value;
			else theForm.F0115.value = theForm.F68b.value;
			theForm.F0115.value += theForm.F68c.value;
		}
	}
	
	theForm.F0116.value = ""; //work end
	if (theForm.F69b.value)
	{
		if (theForm.F69A.options[1].selected)
		{
			var depart = Number(theForm.F69b.value);
			depart += 12;
			theForm.F0116.value = depart + theForm.F69c.value;
		}
		else
		{
			if (theForm.F69b.value < 10) theForm.F0116.value = 0 + theForm.F69b.value;
			else theForm.F0116.value = theForm.F69b.value;
			theForm.F0116.value += theForm.F69c.value;
		}
	}
	
	//theForm.F0118.value = "T";
	//if (theForm.F0119.selectedIndex == 4) theForm.F0118.value = "F";
		
	theForm.F0144.value = "F";
	if (theForm.noCell.checked) theForm.F0144.value = "T";

	//theForm.F0108.value = "F";
	//if (theForm.x108[0].checked) theForm.F0108.value = "T";
	//theForm.F0088.value = "F";			//can be overriden at F0071 (see below)
	//if (theForm.carpool.checked) theForm.F0088.value = "T";
	//theForm.F0091.value = "F";
	//if (theForm.vanpool.checked) theForm.F0091.value = "T";
	//theForm.F0092.value = "F";
	//if (theForm.transit.checked) theForm.F0092.value = "T";
	//theForm.F0093.value = "F";
	//if (theForm.park.checked) theForm.F0093.value = "T";
	//theForm.F0095.value = "F";			//can be overriden at F0072 (see below)
	//if (theForm.daycare.checked) theForm.F0095.value = "T";
	
	for(j=0; j<3; j++) //carpool interest
	{
		if (!theForm.x106[j].checked)
		{
			theForm.F0071.value = "NONE";
		}
		else
		{
			theForm.F0071.value = theForm.x106[j].value;
			//theForm.F0088.value = "T";	//this overrides checkbox: "Are you interested..." (see above)
			break;
		}
	}
	
	//for(j=0; j<3; j++) //vanpool interest
	//{
	//	if (!theForm.x107[j].checked)
	//	{
	//		theForm.F0072.value = "NONE";
	//	}
	//	else
	//	{
	//		theForm.F0072.value = theForm.x107[j].value;
	//		theForm.F0095.value = "T";	//this overrides checkbox: "Are you interested..." (see above)
	//		break;
	//	}
	//}
	//for(j=0; j<3; j++)
	//{
	//	if (!theForm.x87[j].checked)
	//	{
	//		theForm.F0087.value = "HOME";	//this can be set below if there is a valid email
	//	}
	//	else
	//	{
	//		theForm.F0087.value = theForm.x87[j].value;
	//		break;
	//	}
	//}

	if (theForm.Emergency.checked) theForm.F0157.value = "ENROLL ME in Emergency Ride Home - ";	
	if (theForm.student.checked) theForm.F0157.value = "I am a Student - ";
	theForm.F0157.value += theForm.x0157.value;


// VALIDATIONS

	var numReg = /^[0-9]+$/;
	var emReg = /^[^\@]+\@[\w\.]+\.\w+$/;
	if (theForm.F0002.value.length < 2)
	{
		alert("Please enter a value for \"Last Name\"");
		theForm.F0002.focus();
		return (false);
	}
	if (theForm.F0003.value.length < 1)
	{
		alert("Please enter a value for \"First Name\"");
		theForm.F0003.focus();
		return (false);
	}
	if (theForm.F0009.value.length < 1)
	{
		alert("Please enter a value for \"Street Number\"");
		theForm.F0009.focus();
		return (false);
	}
	if (theForm.F0010.value.length < 1)
	{
		alert("Please enter a value for \"Street Name\"");
		theForm.F0010.focus();
		return (false);
	}
	if (theForm.F0012.value.length < 2)
	{
		alert("Please enter a value for \"City\"");
		theForm.F0012.focus();
		return (false);
	}
	if (theForm.F0013.value.length < 1)
	{
		alert("Please enter a value for \"State\"");
		theForm.F0013.focus();
		return (false);
	}
	if (theForm.F0014.value.length < 1)
	{
		alert("Please enter a value for \"Zip\"");
		theForm.F0014.focus();
		return (false);
	}
	if (theForm.F0014.value.length < 5)
	{
		alert("Please use 5 digits for \"Zip\"");
		theForm.F0014.focus();
		return (false);
	}
	if (!theForm.F0014.value.match(numReg))
	{
		alert("Please enter only digits for \"Zip Code\"");
		theForm.F0014.focus();
		return (false);
	}
	if ((theForm.F0022.value)&&(!theForm.F0022.value.match(numReg)))
	{
		alert("Please enter only digits for \"Home Area Code\"");
		theForm.F0022.focus();
		return (false);
	}
	if ((theForm.F0022.value)&&(theForm.F0022.value.length < 3))
	{
	 alert("Please make sure to use 3 digits for \"Home Area Code\"");
		theForm.F0022.focus();
		return (false);
	}
	if ((theForm.homephone1.value)&&(!theForm.homephone1.value.match(numReg)))
	{
		alert("Please enter only digits for \"Home Phone\"");
		theForm.homephone1.focus();
		return (false);
	}
	if ((theForm.homephone2.value)&&(!theForm.homephone2.value.match(numReg)))
	{
		alert("Please enter only digits for \"Home Phone\"");
		theForm.homephone2.focus();
		return (false);
	}
	if ((theForm.F0040.value)&&(!theForm.F0040.value.match(numReg)))
	{
		alert("Please use only digits for \"Work Area Code\"");
		theForm.F0040.focus();
		return (false);
	}
	if ((theForm.workphone1.value)&&(!theForm.workphone1.value.match(numReg)))
	{
		alert("Please enter only digits for \"Work Phone\"");
		theForm.workphone1.focus();
		return (false);
	}
	if ((theForm.workphone2.value)&&(!theForm.workphone2.value.match(numReg)))
	{
		alert("Please enter only digits for \"Work Phone\"");
		theForm.workphone2.focus();
		return (false);
	}
	if ((theForm.F0142.value)&&(!theForm.F0142.value.match(numReg)))
	{
		alert("Please use only digits for \"Cell Area Code\"");
		theForm.F0139.focus();
		return (false);
	}
	if ((theForm.cellphone1.value)&&(!theForm.cellphone1.value.match(numReg)))
	{
		alert("Please enter only digits for \"Cell Phone\"");
		theForm.cellphone1.focus();
		return (false);
	}
	if ((theForm.cellphone2.value)&&(!theForm.cellphone2.value.match(numReg)))
	{
		alert("Please enter only digits for \"Cell Phone\"");
		theForm.cellphone2.focus();
		return (false);
	}
	if (((theForm.homephone2.value) <1)&&((theForm.workphone2.value) <1)&&((theForm.cellphone2.value) <1)&&(!theForm.F0065.value))
	{
		alert("Please provide at least one means of contact so we may keep data current.");
		theForm.F0022.focus();
		return (false);
	}
	if (theForm.F0026.value.length < 2)
	{
		alert("Please enter a value for \"Employer\"");
		theForm.F0026.focus();
		return (false);
	}
	if (theForm.F0027.value.length < 1)
	{
		alert("Please enter a value for \"Employer Street Number\"");
		theForm.F0027.focus();
		return (false);
	}
	if (theForm.F0028.value.length < 1)
	{
		alert("Please enter a value for \"Employer Street Name\"");
		theForm.F0028.focus();
		return (false);
	}
	if (theForm.F0030.value.length < 2)
	{
		alert("Please enter a value for \"Employer City\"");
		theForm.F0030.focus();
		return (false);
	}
	if (theForm.F0031.value.length < 1)
	{
		alert("Please enter a value for \"Employer State\"");
		theForm.F0031.focus();
		return (false);
	}
	if (theForm.F0032.value.length < 1)
	{
		alert("Please enter a value for \"Employer Zip\"");
		theForm.F0032.focus();
		return (false);
	}
	if (!theForm.F0032.value.match(numReg))
	{
		alert("Please enter only digits for \"Employer Zip \"");
		theForm.F0032.focus();
		return (false);
	}
	if (theForm.F0065.value)
	{
		if (!theForm.F0065.value.match(emReg))
		{
			alert("Please enter a valid email address");
			theForm.F0065.focus();
			return (false);
		}
		//if (theForm.F0087.value = "NONE") theForm.F0087.value = "HOME";
	}
	if (theForm.F68b.value.length < 1)
	{
		alert("Please enter a value for \"arrive at work time\"");
		theForm.F68b.focus();
		return (false);
	}
	if (theForm.F69b.value.length < 1)
	{
		alert("Please enter a value for \"leave work time\"");
		theForm.F69b.focus();
		return (false);
	}
	if (!theForm.disclosure.checked)
	{
		alert("Please agree to the disclosure before submitting.");
		theForm.disclosure.focus();
		return (false);
	}
}

