function trim11 (str) 
{
	// remove ", CA" state typos
	if ( str.indexOf(",") != -1 )
	{
		pos = str.indexOf(",");
		str = str.substr(0, pos);
	}

	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) 
	{
		if (/\S/.test(str.charAt(i))) 
		{
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}

function fixWeirdCity(city)
{
	city = trim11(city);
	
	if ( city.toLowerCase().indexOf("st. ") == 0 )
	{
		return city.toLowerCase().replace(/st. /i, "saint ");
	} 
	else if ( city.toLowerCase().indexOf("st.") == 0 )
	{
		return city.toLowerCase().replace(/st./i, "saint ");
	} 
	else if ( city.toLowerCase().indexOf("st ") == 0 )
	{
		return city.toLowerCase().replace(/st /i, "saint ");
	}
	else if ( city.toLowerCase().indexOf("ft. ") == 0 )
	{
		return city.toLowerCase().replace(/ft. /i, "fort ");
	} 
	else if ( city.toLowerCase().indexOf("ft.") == 0 )
	{
		return city.toLowerCase().replace(/ft./i, "fort ");
	} 
	else if ( city.toLowerCase().indexOf("ft ") == 0 )
	{
		return city.toLowerCase().replace(/st /i, "fort ");
	}
	else if ( city.toLowerCase().indexOf("mt. ") == 0 )
	{
		return city.toLowerCase().replace(/mt. /i, "mount ");
	} 
	else if ( city.toLowerCase().indexOf("mt.") == 0 )
	{
		return city.toLowerCase().replace(/mt./i, "mount ");
	} 
	else if ( city.toLowerCase().indexOf("mt ") == 0 )
	{
		return city.toLowerCase().replace(/mt /i, "mount ");
	}
	else if ( city.toLowerCase().indexOf("n. ") == 0 )
	{
		return city.toLowerCase().replace(/n. /i, "north ");
	} 
	else if ( city.toLowerCase().indexOf("n.") == 0 )
	{
		return city.toLowerCase().replace(/n./i, "north ");
	} 
	else if ( city.toLowerCase().indexOf("n ") == 0 )
	{
		return city.toLowerCase().replace(/n /i, "north ");
	}
	else if ( city.toLowerCase().indexOf("s. ") == 0 )
	{
		return city.toLowerCase().replace(/s. /i, "south ");
	} 
	else if ( city.toLowerCase().indexOf("s.") == 0 )
	{
		return city.toLowerCase().replace(/s./i, "south ");
	} 
	else if ( city.toLowerCase().indexOf("s ") == 0 )
	{
		return city.toLowerCase().replace(/s /i, "south ");
	}
	else
	{
		return city;
	}
}