// JScript source code
// this file contains all of the js needed in nj-home-search.asp
function searchregion (pRegion) { document.location = 'default.asp?p=findahome.asp&page=search&selected=map&regionid=' + pRegion; }

function validateform_city (pForm)
{
	var strCity = trimString(pForm.city.value);
	
	if (strCity.length < 2)
	{
		alert("Please enter at least 2 characters to search for City.");
		pForm.city.focus( );
		return false;
	}
	
	pForm.city.value = strCity;
	return true;
}

function trimString (str) {
	while (str.charAt(0) == ' ')
	str = str.substring(1);
	while (str.charAt(str.length - 1) == ' ')
	str = str.substring(0, str.length - 1);
	return str;
}

