// JavaScript Document
// if required to combine functions in an onsubmit use: onsubmit="return ( 1st_function_name(this) && 2nd_function_name() );" 
function validate_form(theForm)

{

  if (theForm.search.value == "")

  {

    alert("Please enter a keyword or phrase to search.");

    theForm.search.focus();

    return (false);

  }
  

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789- ";

  var checkStr = theForm.search.value;

  var allValid = true;

  for (i = 0;  i < checkStr.length;  i++)

  {

    ch = checkStr.charAt(i);

    for (j = 0;  j < checkOK.length;  j++)

      if (ch == checkOK.charAt(j))

        break;

    if (j == checkOK.length)

    {

      allValid = false;

      break;

    }

  }

  if (!allValid)

  {

    alert("Please enter only letter or digit in the search field.");

    theForm.search.focus();

    return (false);

  }
  
  
return (true);

}