
//Description: Search criteria is passed in, along with a list box to search for a Item. As search criteria is passed in, this function scans the list box for a matching option, it then selects the first match. If search criteria is empty then the function unselects all options. This works like the any help menu
//Precondition: field be a valued select box
//Postcondition: First match of the search criteria in 'field' is selected
function Find_Term(search,field)
{
	var pattern

	if (search.value == "") 
	{
		field.options.selectedIndex = -1;
		return;
	}
	//Use "i" to make search not case-sensitive
	pattern = new RegExp("^" + search.value, "i");

	for(var x=0; x < field.options.length; x++)
	{
		
		if (pattern.test(field.options[x].text) == true)
		{
			
			field.options[x].selected = true
			break;
			
		}
	}

}

