
function createMarker(point)
{
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click",	function() {marker.openInfoWindowHtml("")});
	return marker;
}

function load(titleHTMLStr,x,y)
{
  if (GBrowserIsCompatible())
  {
	var map = new GMap2(document.getElementById("googlemap"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	var point = new GLatLng(x, y);
	map.setCenter(point, 6);
	var marker = createMarker(point);
	map.addOverlay(marker);
	//marker.openInfoWindowHtml("<font color:#000><b>Ets BEAUD</b><br/>Route des Terrettes <br />01710 THOIRY<br /> FRANCE</font>");
	marker.openInfoWindowHtml(titleHTMLStr);
  }
}

/***********************************************************/
var map = null;
var geocoder = null;

function initialize() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("googlemap"));
	map.setCenter(new GLatLng(37.4419, -122.1419), 13);
	geocoder = new GClientGeocoder();
  }
}

function showAddress(address) {
  if (geocoder) {
	geocoder.getLatLng(
	  address,
	  function(point) {
		if (!point) {
		  alert(address + " not found");
		} else {
		  map.setCenter(point, 13);
		  var marker = new GMarker(point);
		  map.addOverlay(marker);
		  marker.openInfoWindowHtml(address);
		}
	  }
	);
  }
}
