// JavaScript Document

<!--
var dominio = 'clienti.bitnet.bit/pompilio-spose';
function showAddress() {
	if (GBrowserIsCompatible()){
		var map = new GMap2(document.getElementById("mappa"));
		map.addControl(new TextualZoomControl());
		
		var geocoder = new GClientGeocoder();
		var address='Via Monte Della Capanna, 141 - Roma';  
		geocoder.getLatLng(address,
			function(point){
				if(!point) {
					alert(address + " not found");
				}else {     
					map.setCenter(point, 14);  // Zoom (+ è alto, maggiore è lo zoom)
					
					var icon = new GIcon();
					icon.image = "http://"+ dominio +"/images/GoogleMaps/google.png";
					icon.iconSize = new GSize(20, 20);   // Dimensioni Icona del Focus
					icon.iconAnchor = new GPoint(10, 10); // Posizione Icona del Focus
					icon.infoWindowAnchor = new GPoint(30, 1); // Posizione Fumetto
					var marker = new GMarker(point,icon);
					map.addOverlay(marker);
					map.panDirection(0, 0); // Centramento Mappa
					marker.openInfoWindowHtml("<span><img src=\"images/GoogleMaps/logo-google.jpg\" alt=\"Centro Sposi Pompilio\" title=\"Centro Sposi Pompilio\" /> <br /> <small>Via Monte Della Capanna, 141 <br /> 00168 - Roma</small></span>");
				}
			}
		);
	}
}
	function TextualZoomControl() {
    }
    TextualZoomControl.prototype = new GControl();

    // Creates a one DIV for each of the buttons and places them in a container
    // DIV which is returned as our control element. We add the control to
    // to the map container and return the element for the map class to
    // position properly.
    TextualZoomControl.prototype.initialize = function(map) {
      var container = document.createElement("div");

      var zoomInDiv = document.createElement("div");
      this.setButtonStyleIn_(zoomInDiv);
      container.appendChild(zoomInDiv);
      zoomInDiv.appendChild(document.createTextNode(""));
      GEvent.addDomListener(zoomInDiv, "click", function() {
        map.zoomIn();
      });

      var zoomOutDiv = document.createElement("div");
      this.setButtonStyleOut_(zoomOutDiv);
      container.appendChild(zoomOutDiv);
      zoomOutDiv.appendChild(document.createTextNode(""));
      GEvent.addDomListener(zoomOutDiv, "click", function() {
        map.zoomOut();
      });
      
      var mapTypeSat = document.createElement("div");
      this.setButtonStyleSat_(mapTypeSat);
      container.appendChild(mapTypeSat);
      mapTypeSat.appendChild(document.createTextNode(""));
      GEvent.addDomListener(mapTypeSat, "click", function() {
        map.setMapType(G_SATELLITE_MAP);
      });
      
      var mapTypeNor = document.createElement("div");
      this.setButtonStyleNor_(mapTypeNor);
      container.appendChild(mapTypeNor);
      mapTypeNor.appendChild(document.createTextNode(""));
      GEvent.addDomListener(mapTypeNor, "click", function() {
        map.setMapType(G_NORMAL_MAP);
      });

      map.getContainer().appendChild(container);
      return container;
    }

    // By default, the control will appear in the top left corner of the
    // map with 7 pixels of padding.
    TextualZoomControl.prototype.getDefaultPosition = function() {
      return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10, 10));  // Distanza Bottoni dal bordo
    }

    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyleIn_ = function(button) {
      button.style.backgroundImage		= "url('http://"+ dominio +"/images/GoogleMaps/piu.png')";
      button.style.marginBottom			= "3px";
      button.style.width				= "25px";
      button.style.height				= "25px";
      button.style.cursor				= "pointer";
	}   
	
    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyleOut_ = function(button) {
      button.style.backgroundImage		= "url('http://"+ dominio +"/images/GoogleMaps/meno.png')";
      button.style.marginBottom			= "3px";
      button.style.width				= "25px";
      button.style.height				= "25px";
      button.style.cursor				= "pointer";
    }
    
    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyleSat_ = function(button) {
      button.style.backgroundImage		= "url('http://"+ dominio +"/images/GoogleMaps/sat.png')";
      button.style.marginBottom			= "3px";
      button.style.width				= "25px";
      button.style.height				= "25px";
      button.style.cursor				= "pointer";
	}   
	
    // Sets the proper CSS for the given button element.
    TextualZoomControl.prototype.setButtonStyleNor_ = function(button) {
      button.style.backgroundImage		= "url('http://"+ dominio +"/images/GoogleMaps/map.png')";
      button.style.marginBottom			= "3px";
      button.style.width				= "25px";
      button.style.height				= "25px";
      button.style.cursor				= "pointer";
    }
    
//-->
