function validatehomesalesform(thisform) {

thisform.txtBuyerName.value = trimSpaces(thisform.txtBuyerName.value);
thisform.txtZipCode.value = trimSpaces(thisform.txtZipCode.value);

	if  (   (thisform.txtBuyerName.value == "" && thisform.txtZipCode.value == "" )
	 || !isNumeric(thisform.txtZipCode.value) ) 	 
    {
		alert("Please enter an Owner Name and/or a 5-digit ZIP Code");
		return false;
    }		
	
}	


 /* This function removes spaces from the end of a String.
	 */
    function trimEndSpaces(stringValue)
    {
      while( (stringValue.lastIndexOf(" ") == (stringValue.length - 1)) &&
             (stringValue.length != 0) )
      {
        if (stringValue.length == 1)
        {
          stringValue = "";
          break;
        }
        stringValue = stringValue.substring(0, stringValue.length - 1);
      }
      return stringValue;
    }

	/**
	 * This function removes spaces from the beginning of a String.
	 */
    function trimLeadingSpaces(stringValue)
    {
      while(stringValue.charAt(0) == ' ')
      {
        if (stringValue.length == 1)
        {
          stringValue = "";
          break;
        }
        stringValue = stringValue.substring(1, stringValue.length);
      }
      return stringValue;
    }

	/**
	 * This function removes beginning and ending spaces from a String.
	 */
    function trimSpaces(stringValue)
    {
      var tempString = new String(stringValue);
	  tempString = trimLeadingSpaces(tempString);
      tempString = trimEndSpaces(tempString);
      return tempString;
    }