function ClearDistance() { document.locator.distance.value=''; }

function Trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function ValidateForm() {
	if(Trim(document.getElementById("inputCode").value).length < 5 && 
		(Trim(document.getElementById("inputCity").value).length == 0 || Trim(document.getElementById("inputState").value).length == 0)) {
			document.getElementById("errorBox").style.display="block";
			return false;
	}			
	return true;
}

function MiniMap(dealer_div, iconIndex, geoLat, geoLng, brand, type) {
	var map = new GMap2(document.getElementById(dealer_div));
	map.setCenter(new GLatLng(geoLat, geoLng), 15);

	var baseIcon = new GIcon(G_DEFAULT_ICON);
	baseIcon.shadow = "img/fierce/shadow.png";
	baseIcon.iconSize = new GSize(20, 28);
	baseIcon.shadowSize = new GSize(0, 0);
	baseIcon.iconAnchor = new GPoint(10, 28);
	baseIcon.infoWindowAnchor = new GPoint(20, 2);
	function createMarker(point, index) {
		var letter = String.fromCharCode("A".charCodeAt(0) + index);
		var letteredIcon = new GIcon(baseIcon);
		letteredIcon.image = "img/" + brand + type + "/map-pin.png";
		markerOptions = { icon:letteredIcon };
		var marker = new GMarker(point, markerOptions);
		return marker;
	} // createMarker	

	var point = new GLatLng(geoLat,geoLng);
	map.addOverlay(createMarker(point, iconIndex));
}
