function validateSearchForm(theForm)
{
  var city          = theForm.city.value ;
  var state         = theForm.state.value ;
  var zip           = theForm.zip.value ;
  var provider_name = theForm.providername.value ; 
   
  if ((city == "") && (state == "") && (zip == "") && (provider_name == "")) 
  {
    alert('You must enter at least one search item.');
    theForm.city.focus() ;
    return false ;
  }
  if (zip !="")
  {
    if (isNaN(zip)) //Zip must be a number
    {
      alert("Zip Code contains invalid characters. Zip Code should consist of 5 digits, 0-9.");
      theForm.zip.focus() ;
      return false ;
    }
    else if (zip.length < 5) //Zip must be 5 digits
    {
      alert("Invalid Zip Code length. Zip Code should consist of 5 digits, 0-9.") ;
      theForm.zip.focus() ;
      return false ; 
    }
  }

  
  
  return true ;
}

function validateDistanceForm(theForm)
{
  var zip = theForm.zip.value ;   
  if (zip == "")
  {
    alert("Please enter a Zip Code.")
    theForm.zip.focus() ;
    return false ;
  } 
  
  if (zip !="")
  {
    if (isNaN(zip)) //Zip must be a number
    {
      alert("Zip Code contains invalid characters. Zip Code should consist of 5 digits, 0-9.");
      theForm.zip.focus() ;
      return false ;
    }
    else if (zip.length < 5) //Zip must be 5 digits
    {
      alert("Invalid Zip Code length. Zip Code should consist of 5 digits, 0-9.") ;
      theForm.zip.focus() ;
      return false ; 
    }
  }
  
  
  return true ;
}
