function checkValues() {
var line = "_______________________________________________________________________________";
		
if ((document.f.Specialty.value == "" && document.f.CompanyName.value == "") && (document.f.Commodity.selectedIndex == -1)) {	
	alert(line + "\r\r\r\rEnter a term to search for in the Supplier Name, Specialty or Commodity field.\r\r\r\r" + line + "\r\r");

} else {

	if ((document.f.Specialty.value == "" && document.f.CompanyName.value == "") && (document.f.Commodity.selectedIndex >= 0)) {
		var idx = document.f.Commodity.selectedIndex;
		document.f.dbField.value = "Commodity";
			//alert(idx);
		document.f.dbValue.value = eval("document.f.Commodity.options[" + idx + "].value");
			//alert(document.f.dbValue.value);

		document.f.submit();
	} else {
		if ((document.f.Commodity.selectedIndex == -1 && document.f.CompanyName.value == "") && (document.f.Specialty.value != "")) {		
			document.f.dbField.value = "Specialty";
			document.f.dbValue.value = document.f.Specialty.value;
			document.f.submit();
		} else {
			if ((document.f.Commodity.selectedIndex == -1 || document.f.CompanyName.value != "") && (document.f.Specialty.value == "") ) {
				document.f.dbField.value = "CompanyName";
				document.f.dbValue.value = document.f.CompanyName.value;
				document.f.submit();
			} else {
				alert(line + "\r\r\r\rOnly one field (Company Name, Specialty or Commodity can be searched at a time.\r\r\r\r" + line + "\r\r")						
				document.f.Specialty.value = "";
				document.f.CompanyName.value = "";
				document.f.Commodity.selectedIndex = -1;
			}
		}
	}
	
}

}




function clearOthers(who) {
	var line = "_______________________________________________________________________________";
	if (who == "Commodity") {
		if (document.f.Specialty.value != "" || document.f.CompanyName.value != "")  {
			//alert(line + "\r\r\r\rOnly one field (Company Name, Specialty or Commodity can be searched at a time.\r\r\r\r" + line + "\r\r")
			document.f.Specialty.value = "";
			document.f.CompanyName.value = "";
			document.f.Commodity.selectedIndex = -1;
		}
	} 
	if (who == "Specialty") {
		if (document.f.Commodity.selectedIndex >= 0 || document.f.CompanyName.value != "")  {
			//alert(line + "\r\r\r\rOnly one field (Company Name, Specialty or Commodity can be searched at a time.\r\r\r\r" + line + "\r\r")	
			document.f.Specialty.value = "";
			document.f.CompanyName.value = "";
			document.f.Commodity.selectedIndex = -1;
		}
	}
	if (who == "CompanyName") {
		if (document.f.Commodity.selectedIndex >= 0 || document.f.Specialty.value != "")  {
			//alert(line + "\r\r\r\rOnly one field [ Company Name, Specialty or Commodity ] can be searched at a time.\r\r\r\r" + line + "\r\r")
			document.f.Specialty.value = "";
			document.f.CompanyName.value = "";
			document.f.Commodity.selectedIndex = -1;
		}
	}

}
