var map = null;
var geocoder = null;
var icon = icon;

function load() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(40.727356,13.909893), 12);
		icon = new GIcon();
        icon.image = "http://www.comuneischia.com/fig/marker.gif";
        icon.iconSize = new GSize(23, 34);
        icon.iconAnchor = new GPoint(6, 20);
       icon.infoWindowAnchor = new GPoint(5, 1);
	//map.setMapType(G_SATELLITE_MAP );
	geocoder = new GClientGeocoder();
  }
}


function showAddress(address) {
  if (geocoder) {
	geocoder.getLatLng(
	  address,
	  function(point) {
		if (!point) {
		  alert(address + " L'indirizzo segnalato per la mappa non è corretto" );
		} else {
		  map.setCenter(point, 12);
		  var marker = new GMarker(point);
		  map.addOverlay(marker);
  		  //marker.openInfoWindowHtml('<table width=\"430\" height=\"90\"><tr><td><img src=http://www.comuneischia.com/fig/banner-mappa.gif align=left></td></tr></table>');
		 		}
	  }
	);
  }
}
