

function validateSearch(board)
{
	errmsg = '';
	
	
	var minimumValue = parseInt(StripOutInvalidCharacters(document.search.minimum_cost.value,'0123456789'));
	var maximumValue = parseInt(StripOutInvalidCharacters(document.search.maximum_cost.value,'0123456789'));

	if (!isNaN(maximumValue))
	{
		if (maximumValue > 99999999)	
		{
			errmsg += '- \'High Price\' Value of ('+maximumValue+') is out of range. Please lower value.\n';
		}
	}	
	
	if (!isNaN(minimumValue))
	{
		if (minimumValue > 99999999)	
		{
			errmsg += '- \'Low Price\' Value of ('+minimumValue+') is out of range. Please lower value.\n';
		}

		
		if (!isNaN(minimumValue) && (!isNaN(maximumValue)))
		{
			if (minimumValue > maximumValue)
			{
			errmsg += '- \'Low Price\' must have a lower numeric value than \'High Price\'.\n';
			}
		}
	}
	
	
	
	
//	if (board == 1)
//	{
//		if (document.search.LotSize.value != '' || document.search.minimum_acres.value != '' || document.search.maximum_acres.value != '')
//		{
//			if (document.search.propertyclass.value != "Land" && document.search.propertyclass.value !="land")
//			{
//				errmsg += "You must select 'land' as the property class when searching on acreage\n";
//			}
//		}
//	}
	
		if (isDefined('FriendlyAreaID'))
		{
			ListSelectAll(findObject('FriendlyAreaID'),1);
		}

		if (isDefined('Municipality'))
		{	
			ListSelectAll(findObject('Municipality'),1);
		}

		if (isDefined('Subdivision'))
		{
			ListSelectAll(findObject('Subdivision'),1);
		}

		if (isDefined('City'))
		{
			ListSelectAll(findObject('City'),1);
		}

		if (isDefined('SquareFootage'))
		{
			ListSelectAll(findObject('SquareFootage'),1);
		}

		if (isDefined('EstAgeSearch'))
		{
			ListSelectAll(findObject('EstAgeSearch'),1);
		}
		
		if (isDefined('recElementarySchool'))
		{
			ListSelectAll(findObject('recElementarySchool'),1);
		}
		
		if (isDefined('recMiddleSchool'))
		{
			ListSelectAll(findObject('recMiddleSchool'),1);
		}

		if (isDefined('recHighSchool'))
		{
			ListSelectAll(findObject('recHighSchool'),1);
		}
		
	
	if (errmsg != '')
	{
		alert('Please correct the following errors to continue:\n_____________________________________\n\n' + errmsg + '_____________________________________');
		return false;
	} 
	else 
	{
		var division = findAnyObject('image_loader');
		if (division)
			division.style.display = "block";
		
		division = findAnyObject('image_submit');
		if (division)
			division.style.display = "none";
	
		var division = findAnyObject('image_loader2');
		if (division)
			division.style.display = "block";
		
		division = findAnyObject('image_submit2');
		if (division)
			division.style.display = "none";
	
		return true;
	}

}
