/**
 * @author Andrey Tamura
 */

    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(-23.547779, -46.639366), 16);
		map.addControl(new GMapTypeControl());
        geocoder = new GClientGeocoder();
      }
    }

    function showAddress(loja,address,fone) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 16);
			  var letteredIcon = new GIcon(G_DEFAULT_ICON);
          	  letteredIcon.image = "http://maps.google.com/mapfiles/kml/pushpin/blue-pushpin.png";
			  markerOptions = { icon:letteredIcon };
              var marker = new GMarker(point,markerOptions);
              map.addOverlay(marker);
              GEvent.addListener(marker, "click", function() {
            		marker.openInfoWindowHtml('<strong style="color:#00659B">'+loja+'</strong><br/>'+address+'<br/>'+fone);
          		});

            }
          }
        );
      }
    }