var geocoder = null;
var map = null;


function load(address) {
	if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map2"));
        //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
         geocoder = new GClientGeocoder();
		showAddress(address);
      }
} 


function showAddress(address) {
	
	
	//alert(geocoder);
	var baseIcon = new GIcon(G_DEFAULT_ICON);
    //baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize(20, 20);
    //baseIcon.shadowSize = new GSize(240, 26);
    baseIcon.iconAnchor = new GPoint(9, 34);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);

      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
			  var letteredIcon = new GIcon(baseIcon);
			  letteredIcon.image = "http://www.proloco-volturara.com/img/2Stem_proloco.gif";
			  markerOptions = { icon:letteredIcon };
              var marker = new GMarker(point,markerOptions);
              map.addOverlay(marker);
			  map.addControl(new GSmallMapControl()); 	
			  map.setZoom(16);  
			
             
            }
          }
        );
      }
    }


