function trim(str)
{
   return str.replace(/^\s*|\s*$/g, "");
}

function createMarker(point, icon, balloonText)
{
	var marker = new GMarker(point, icon);
	
	GEvent.addListener(marker, "click", function()
	{
		marker.openInfoWindowHtml(balloonText, {maxWidth:400});
	});
	
	return marker;
}

var focusNext = function()
{
	var el			= $(this);
	var setFocus	= false;
	var elFocus;
	
	$("input").each(function()
	{
		if (!setFocus)
		{
			setFocus = ($(this).attr("id") == el.attr("id"));
		}
		else
		{
			elFocus		= $(this);
			setFocus	= false;
			
			setTimeout(function()
			{
				elFocus.focus();
			}, 200);
		}
	});
}

var onAutocompleteResult = function()
{
	$("#search").focus();
}

