//<![CDATA[
var map = null;
var geocoder = null;


function load() {

	if (GBrowserIsCompatible()) {

		var WINDOW_HTML1 = '<div style="width: 204px; color:000; padding-right: 10px; font-family:Arial, Helvetica, sans-serif; font-size:11px;"><b>Centra SrL</b><br />Viale Aldo Moro, 2<br />71013 - San Giovanni Rotondo (FG)<br />Tel. +39.0882.457910 <br />Fax +39.0882.459106 <br /> email:<a href="mailto:autosercentra@libero.it">autosercentra@libero.it</a></div>';

		var n=41.708003270984065;	
		var e=15.729761123657226;

		map = new GMap2(document.getElementById("map"));
		geocoder = new GClientGeocoder();

		map.setCenter(new GLatLng(n, e), 16);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		var icon = new GIcon();
		icon.image = "http://www.autolineecentra.it/img/ico_sopra.png";
		icon.shadow = "http://www.autolineecentra.it/img/ico_sotto.png";
		icon.iconSize = new GSize(75, 37);
		icon.shadowSize = new GSize(75, 37);
		icon.iconAnchor = new GPoint(30, 10);
		icon.infoWindowAnchor = new GPoint(17, 0);

		var marker1 = new GMarker(new GLatLng(n, e ),icon);
		map.addOverlay(marker1);

		GEvent.addListener(marker1, "click", function() {
			marker1.openInfoWindowHtml(WINDOW_HTML1); 
		});
		
		marker1.openInfoWindowHtml(WINDOW_HTML1); 
		
		GEvent.addListener(map, "moveend", function() {
		  var center = map.getCenter();
		  document.getElementById("message").innerHTML = center.toString();

		  
});

	}
}


function showAddress(address) {
  geocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        alert(address + " not found");
      } else {
        map.setCenter(point, 10);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(address);
      }
    }
  );
}




//]]>