// JavaScript Document

	//------------------------------------------------------
	// clearEmail() - clears the email field in form1 once.
	// Always returns true.
	//------------------------------------------------------
	var clearDone = false;
	function clearEmail()
	{
		if (clearDone == false)
		{
			document.form1.email.value  = "";
			clearDone = true;
		}
		return true;
	}

	// --------------------------------------------------------------
	// removeOptions(selectControl) - Removes all of the options
	//     inside the specified Select control.
	// Always returns true.
	// --------------------------------------------------------------
	function removeOptions(selectControl)
	{
		var i;
		for (i=selectControl.length-1; i>=0; i--)
		{
			selectControl.options[i] = null;
		}
		return true;
	} // removeOptions()

	// --------------------------------------------------------------
	// getActsAge(bDay,bMonth,bYear,aDay,aMonth,aYear) - Computes ACTS age.
	//
	// INPUTS: bDay, bMonth, bYear - Day, month, and year of birth
	//         aDay, aMonth, aYear - Day, month, and year of Academic year
	//
	// OUTPUTS: None
	//
	// RETURNS: "ACTS" age of student
	// --------------------------------------------------------------
	function getActsAge(bDay, bMonth, bYear, aDay, aMonth, aYear)
	{
		var adj;
		
		// IF student's birth Month/Day is earlier than the ACTS cut-off Month/Day THEN
		//     Their sYear birthday counts when computing their age.
		// ELSE
		//     Their sYear birthday does NOT count.
		// ENDIF
		// Return student age by subtracting adjusted birth year from the Academic Year
		if ((aMonth  > bMonth) || ((aMonth == bMonth) && (aDay > bDay)))
		{
			adj = bYear;
		}
		else
		{
			adj = bYear + 1;
		}
		return(aYear - adj);
	} // getActsAge()

	// --------------------------------------------------------------
	// This function determines the suffix for a grade number
	// --------------------------------------------------------------
	function getGradeSuffix(grade)
	{
		var suffix;
		
		switch (grade)
		{
			case 1:
				suffix = "st";
				break;
			case 2:
				suffix = "nd";
				break;
			case 3:
				suffix = "rd";
				break;
			default:
				suffix = "th";
				break;
		}
		return(suffix);
	} // getGradeSuffix()



