// function checkFSSearchForm()
// for the directory search form 
// modifications:
// 7-21-03 Mike Mertsock mjm2@alfred.edu - total redo so it makes sure at least one criteria was entered.
// 9-17-04 Kevin Ashton kda1@alfred.edu - modified from Mike's version to work with the Facutly/Staff form.
function checkSearchForm() {
	var f = document.directorySearch;
	
	var textFields = [ "firstname", "lastname", "email"];
	var thisField = null;
	
	// dataCount is the way we check if anything was entered/chosen in the form. you do this 
	// by adding up the number of characters entered in each text field (done in the loop 
	// below) and added the option number selected for each select (b/c 0 means nothing was selected)
	var dataCount = 0;
	
	// do this for all the text fields
	for ( fieldNumber = 0; fieldNumber < textFields.length; fieldNumber++ )	{
		thisField = eval( "f." + textFields[fieldNumber] );
		thisField.value = trim( thisField.value ); //get rid of extra spaces
		dataCount += thisField.value.length; //add to datacount (see explaination above)
	}
	
	if ( dataCount == 0 ) {
		alert( "Please type and/or select some criteria for searching, or use the browse links below." );
		f.firstname.focus();
		return false;
	} else {
		return true;
	}
	
}