function  ValidateForm1(thisForm)
{	
	if  (!hasValue(thisForm.state_code, "SELECT" ))
	{
		if  (!onError(thisForm.state_code, "You must select a state."))
		{
			return false;
		}
	}
	return true;
}

function  ValidateForm2(thisForm)
{	
/*	if  (!hasValue(thisForm.state_code, "SELECT" ))
	{
		if  (!onError(thisForm.state_code, "You must select a state."))
		{
			return false;
		}
	}
*/	
	if  (!hasValue(thisForm.zip, "TEXT" ))
	{
		if  (!onError(thisForm.zip, "Please enter a ZIP code."))
		{
			return false;
		}
	}

	if  (!checkzip(thisForm.zip.value))
	{
		if  (!onError(thisForm.zip, "Please enter a valid ZIP code."))
		{
			return false;
		}
	}
	return true;
}

function  ValidateForm5(thisForm)
{	
	if  (!hasValue(thisForm.city, "TEXT" ))
	{
		if  (!onError(thisForm.city, "You must enter a value for city name."))
		{
			return false;
		}
	}
    
    if  (!hasValue(thisForm.state_code, "TEXT" ))
	{
		if  (!onError(thisForm.state_code, "You must choose a state."))
		{
			return false;
		}
	}
    
	return true;
}

function  ValidateForm6(thisForm)
{	
	if  (!hasValue(thisForm.zip, "TEXT" ))
	{
		if  (!onError(thisForm.zip, "Please enter a ZIP code."))
		{
			return false;
		}
	}

	if  (!checkzip(thisForm.zip.value))
	{
		if  (!onError(thisForm.zip, "Please enter a valid ZIP code."))
		{
			return false;
		}
	}
	return true;
}

function  ValidateForm3(thisForm)
{	

	if  (!checkinteger(thisForm.listing_number.value))
	{
		if  (!onError(thisForm.listing_number, "Please enter a valid listing number (8 digits )."))
		{
			return false;
		}
	}
	if  (!numberrange(thisForm.listing_number.value,1,99999999))
	{
		if  (!onError(thisForm.listing_number, "Please enter a valid listing number (8 digits )."))
		{
			return false;
		}
	}
	
	return true;
}

function  ValidateForm4(thisForm)
{	
	if  (hasValue(thisForm.zip, "TEXT" ))
	{
		if  (!checkzip(thisForm.zip.value))
		{
			if  (!onError(thisForm.zip, "Please enter a valid ZIP code."))
			{
				return false;
			}
		}
		else return true;
	}


	if  (!hasValue(thisForm.state_code, "SELECT" ))
	{
		if  (!onError(thisForm.state_code, "You must select a state."))
		{
			return false;
		}
	}
/*	
	if  (!hasValue(thisForm.city, "TEXT" ))
	{
		if  (!onError(thisForm.city, "Please enter a city name."))
		{
			return false;
		}
	}
*/
	return true;
}

function validateSPSearch1()
{
    var result  = true;
    var zip_obj = document.getElementById("zip_code");
    var cat_obj = document.getElementById("business_category_bdid1");
    if (zip_obj != null && cat_obj != null) {
        if  (zip_obj.value.length == 0) {
            if  (!onError(zip_obj, "Please enter the ZIP code.")) {
				result = false;
			} //end if
        } else if  (!checkzip(zip_obj.value)) {
			if  (!onError(zip_obj, "Please enter a valid ZIP code.")) {
				result = false;
			} //end if
		} else if  (cat_obj.value.length == 0) {
			if  (!onError(cat_obj, "Please select the Type of Service.")) {
				result = false;
			} //end if
		} //end if
        
    } //end if
    
    return result;
} //end function validateSPSearch1

function validateSPSearch2()
{
    var result  = true;
    var zip_obj = document.getElementById("city");
    var cat_obj = document.getElementById("business_category_bdid2");
    if (zip_obj != null && cat_obj != null) {
        if  (zip_obj.value.length == 0) {
            if  (!onError(zip_obj, "Please enter the City.")) {
				result = false;
			} //end if
		} else if  (cat_obj.value.length == 0) {
			if  (!onError(cat_obj, "Please select the Type of Service.")) {
				result = false;
			} //end if
		} //end if
        
    } //end if
    
    return result;
} //end function validateSPSearch2

function  validateHISearch()
{
    var result  = true;
    var zip_obj = document.getElementById("zip_code");
    var cat_obj = document.getElementById("business_category_bdid");
    if (zip_obj != null && cat_obj != null) {
        
        if  (cat_obj.value.length == 0) {
			if  (!onError(cat_obj, "Please select the Type of Service.")) {
				result = false;
			} //end if
		} else if  (zip_obj.value.length == 0) {
            if  (!onError(zip_obj, "Please enter the ZIP code.")) {
				result = false;
			} //end if
        } else if  (!checkzip(zip_obj.value)) {
			if  (!onError(zip_obj, "Please enter a valid ZIP code.")) {
				result = false;
			} //end if
		} //end if
        
    } //end if
    
    return result;
}

