// JavaScript Document

//<![CDATA[

    function load(address) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		var geocoder = new GClientGeocoder();
		map.addControl(new GLargeMapControl());
		//map.addControl(new GOverviewMapControl());
		map.addControl(new GMapTypeControl());
        //map.setCenter(new GLatLng(40.8116260533, 9.6542141162), 11);
      }
	  
	  // Creates a marker at the given point with the given number label
		function createMarker(point, infohtml, icon) {
		  var marker = new GMarker(point, icon);
		  GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(infohtml);
		  });
		  return marker;
		}
		
	  // Create our "custom" marker icon
		/*var icon = new GIcon();
		icon.image = "../images/studiovacanze.png";
		icon.shadow = "../images/ombra_studiovacanze.png";
		icon.iconSize = new GSize(70, 25);
		icon.shadowSize = new GSize(94, 25);
		icon.iconAnchor = new GPoint(70, 25);
		icon.infoWindowAnchor = new GPoint(35, 12);*/
		 if (geocoder) {
			geocoder.getLatLng(
			  address,
			  function(point) {
				if (!point) {
				  alert(address + " not found");
				} else {
				map.setCenter(point, 14);
				var infohtml = "<img src='../images/logo2.jpg' width='80' height='59' align='left' style='margin-right:10px;margin-bottom:2px;' /><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; color:#003300; font-size: 11px; line-height: 16px;\"><br>&reg; Al Vecchio frantoio<br>f.lli Bartolomei S.a.s.";
				//var point = new GLatLng(40.7402149934, 9.70780518415);
				var marker = createMarker(point, infohtml);
				map.addOverlay(marker);
				marker.openInfoWindowHtml(infohtml);
				}
			  }
			);
		} // end if geocoder
    }

		
    //]]>
