//<![CDATA[
var map = null;
var geocoder = null;


function load() {

	if (GBrowserIsCompatible()) {

		var WINDOW_HTML1 = '<p><strong>Di Mase Schermature   Solari</strong><br /><br /><strong>Showroom:</strong><br />Via D. Cirillo 137 - 71016   San Severo (FG)<br />Tel./Fax 0882.371841<br />E-mail: <a title="E-mail" href="mailto:info@sunrainsystem.it">info@sunrainsystem.it</a><br /><br /> Amministrazione: <strong>Leonardo Di Mase</strong><br />Ufficio Tecnico: <strong>Angelo e Marcello Di Mase</strong></p>';

		var n=41.68320889852099;
		var e=15.383262634277343;


		map = new GMap2(document.getElementById("map"));
		geocoder = new GClientGeocoder();

		map.setCenter(new GLatLng(n, e), 12);
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		
		var icon = new GIcon();
		icon.image = "/img/ico_sopra.png";
		icon.shadow = "/img/ico_sotto.png";
		icon.iconSize = new GSize(75, 37);
		icon.shadowSize = new GSize(75, 37);
		icon.iconAnchor = new GPoint(15, 30);
		icon.infoWindowAnchor = new GPoint(24, 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, 15);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(address);
      }
    }
  );
}




//]]>
