// This function initiailizes the form when it is loaded.
function Init(){
	var txtLastName = document.form1.txtLastName;
	txtLastName.focus();// sets the form focus on the Student Last Name text form field
	
	
}


function radio_button_checker()
{
// set var radio_choice to false
var radio_choice = false;

// Loop from zero to the one minus the number of radio button selections
for (counter = 0; counter < radio_form.radio_button.length; counter++)
{
// If a radio button has been selected it will return true
// (If not it will return false)
if (radio_form.radio_button[counter].checked)
radio_choice = true; 
}

if (!radio_choice)
{
// If there were no selections made display an alert box 
alert("Please select a letter.")
return (false);
}
return (true);
}


// Script for Drop Down List
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Validates Fields
function chkFields() {
	var txtLastName = document.form1.txtLastName;
	var txtFirstName = document.form1.txtFirstName;
	var txtStudentID = document.form1.txtStudentID;
	
	// validate last name field
	
	if (txtLastName.value == "")
	{
		alert("Please fill out your Last Name.");
		txtLastName.focus(); 
		return false;	
	}
	
	//validate first name field
	
	if (txtFirstName.value == "")
	{
		alert("Please fill out your First Name.");
		txtFirstName.focus();
		return false;
	}
	
	// validate student id field
	
	if (txtStudentID.value == "")
	{
		alert("Please fill out your Student ID.");
		txtStudentID.focus(); 
		return false;	
	}	
}  
//end of chkFields() function

// this function runs before form is reset
function PreReset(form){
	if (confirm("Are you sure you want to clear the form's fields?"))
	{
		Init(); //reset options
		return true;
	}
	else
	{
		return false;
	}
}
