var geocoder = new GClientGeocoder();

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

function createGMap(elId, address, markerhtml){
	var map = new GMap2(document.getElementById(elId));
	map.addControl(new GSmallMapControl());
	showAddress(map, address, markerhtml);
}
