
var search_error_message='Please enter a valid 5 digit zip code, the name of a city, or select a state'

function search_okay()
{
var category_select=document.getElementById("category_select")
if( category_select.value.length == 0 || category_select.value == 'Select a Category' ) {
  alert( 'Please select a category.' )
  category_select.focus()
  return false
}

var zip_text=document.getElementById("zip_text")
var city_text=document.getElementById("city_text")
var state_text=document.getElementById("state_text")

if( zip_text.value.length == 0 && city_text.value.length == 0 && state_text.value == 'State' ) {
  alert( 'Please enter a zip code or city, or select a state.' );
  zip_text.focus();
  return false;
}

str=zip_text.value+city_text.value+state_text.value
if (str.length>0) 
  str=str.replace(/^\s+|\s+$/, '')
if (str.length == 0)
{
  alert(search_error_message)
  city_text.focus()
  return false
}
else
  return true
}


