function geopress_setmap() {
	var myPoint = new LatLonPoint(30,-90);
	geo_map.setCenterAndZoom(myPoint, 8);
	var marker = new Marker(myPoint);
	marker.setInfoBubble("@ Pointed");
	geo_map.addMarker(marker);
}

// @todo - make this use a Mapstraction geocoder or geocoder independent
 var geocoder = new GClientGeocoder();

// addPointToMap() adds a marker at a specific point from either 
// a geocoder response or the user clicking on the map. 
// @todo handle drawing polylines
function addPointToMap(point) {
	marker = new Marker(point);
	geo_map.setCenterAndZoom(point,10);
	marker.setInfoBubble(point.toString());
	geo_map.addMarker(marker);
}
 // addAddressToMap() is called when the geocoder returns an
 // answer.  It adds a marker to the map with an open info window
 // showing the nicely formatted version of the address and the country code.
function addAddressToMap(response) {
//   map.clearOverlays();
  if (!response || response.Status.code != 200) {
    alert("Sorry, we were unable to geocode that address");
  } else {
    place = response.Placemark[0];
    point = new LatLonPoint(place.Point.coordinates[1],
                        place.Point.coordinates[0]);
    addPointToMap(point);
  }
}

 // showLocation() is called when you click on the Search button
 // in the form.  It geocodes the address entered into the form
 // and adds a marker to the map at that location.
function showLocation() {
	var address = document.forms[0].addr.value;
	if(address) {
		// If the 'address' is just points, map them
   		if(matches = address.match(/\[(.+),[ ]?(.+)\]/)) {
			setMapPoint(new LatLonPoint(matches[1], matches[2]));
		} else {
			geocoder.getLocations(address, addAddressToMap);
		}
	}
}

function geocode() {
	document.forms[0].locname.value = "";
	showLocation();   
}
// findLocation() is used to enter the sample addresses into the form.
function findLocation(address) {
	document.forms[0].addr.value = address;
	showLocation();
}
var gPoint;
// setMapPoint() handles a user clicking on a map
function setMapPoint(point) {
	document.forms[0].addr.value = "[" + point + "]";
	geo_map.removeAllMarkers();
	addPointToMap(point);
}

function resetMap() {
	geo_map.setCenterAndZoom(new LatLonPoint(0,0),1);
}