function getLocations()
{
	document.getElementById("selectedregion").value = document.getElementById("regions").value;
	document.getElementById("searchform").submit();
}

function propertySearch(newlocation)
{
	errstr = "";
	if(document.getElementById("minprice").value == "")
	{
		document.getElementById("minprice").value = 0;
	}
	if(document.getElementById("maxprice").value == "")
	{
		document.getElementById("maxprice").value = 0;
	}
	if(document.getElementById("minprice").value != "")
	{
		min = isNumeric(document.getElementById("minprice").value)
		if(!min)
		{
			errstr += "You can only enter numeric characters in the min price box\n";
		}
	}
	if(document.getElementById("maxprice").value != "")
	{
		max = isNumeric(document.getElementById("maxprice").value)
		if(!max)
		{
			errstr += "You can only enter numeric characters in the max price box\n";
		}
	}
	if(errstr == "")
	{
		document.getElementById("searchform").action = newlocation;
		document.getElementById("searchform").submit();
	}
	else
	{
		alert(errstr);
	}
}

function isNumeric(input)
{
	var ValidChars = "0123456789"; 
	var Char;
	for (i = 0; i < input.length; i++)
	{
		Char = input.charAt(i);
		if (ValidChars.indexOf(Char) == -1)
		{
			return false;
		}
	}
	return true;
}