  // Function to validate form information
  function CheckForm()
  {
    var f = window.document.forms["Bid"];		// shortcut names for form
    var fn = f.FullName.value;			//   and names on form
    var fa = f.SiteAddress.value;		 
    var fe = f.Email.value;
    var fdp = f.DayPhone.value;	
    var fep = f.EveningPhone.value;
    var fcp = f.CellPhone.value;
    var ff = f.Fax.value; 

    if (IsBlank(fn))
    {
      alert("You must enter your name.");
      return false;
    }

    if (IsBlank(fa))  
    {
      alert("You must enter your site address.");
      return false;
    }
 
    if  (IsBlank(fe) && IsBlank(fdp) && IsBlank(fep) && IsBlank(fcp) && IsBlank(ff) )  
    {
      alert("You must enter at least one of the following:  one of your telephone numbers, fax or email.");
      return false;
    }

    if (IsBlank(fe))
    {
      return true;
    }
    else
    {
         // check for @ sign in email address
         if (fe.search("@") == -1)
        {
          alert("Your email address is invalid.");
           return false;
         }
    }

    return true;		// submit form
 }


  // Function to check for whether string is blank or not
  function IsBlank(txt)
  {
    var ch="";
    
    // check for null or empty string
    if ((txt==null) || (txt==""))
      return true;
    
    // check for white space
    for (i = 0; i < txt.length; i++)
    {
      ch = txt.charAt(i);
      if((ch != ' ') && (ch != '\n') && (ch != '\t'))
        return false;					// found white space character
     }

     return true;					// all tests passed
  }