       
	
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 = "";
// Text field
	if (document.forms[0].txtName.value == "") { missing +="\n Your name"; }
//	if (document.forms[0].txtPhone.value == "") { missing +="\n Your phone number"; }
	if (document.forms[0].txtEmail.value == "") { missing +="\n Your email address"; }
	if(document.forms[0].txtWhen.value == "") { missing +="\n Appointment date";}
	if (document.forms[0].txtReason.value == "") { missing +="\n Reason for your appointment"; }
// Radio field
//	for (var i=0; i< document.forms[0].radJournalLocator.length; i++ )
//	   {	
//		if (document.forms[0].radJournalLocator[i].checked)
//		   { var n = 0;
			// if 'No' is selected, do NOT submit form
//			{if (document.forms[0].radJournalLocator[i].value == "No" )
//			 {missing +="\n Please check the Journal Locator first before submitting a request";} }
//   	           break }
//	   	else // a radio button is NOT selected
//		   {n = 1;}
//	   } 	
//	if (n == 1) {missing += "\n\n Did you check the Journal Locator?";}



// Display missing fields to user
if (missing !="")
	{
	 missing = error + "You are missing required information on the form: \n" + missing;
	 alert(missing);
	 return false;
	}
	else if (error !="")
		 {
		 alert(error);
		 return false;
		 }
	else
		 {
		return true;
		 }
}
	
	       