﻿// JScript File


 function createInfoMarker(point, address) 
    {
     var marker = new GMarker(point);
   
     GEvent.addListener
     (
      marker, "click",

        function() 
        {
         marker.openInfoWindowHtml(address);
        }
      );
     return marker;
   }
   
   
   
   function showAddress(address,cityStateCountry) {
	 geocoder = new GClientGeocoder();
	 if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
             showAddress(cityStateCountry,'USA');            
              window.close();
            } else {
             if (GBrowserIsCompatible()) {
            var map = new GMap2(window.document.getElementById("divContent"));
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
			//alert(point);
			//map.setCenter(new GLatLng(37.4419, -122.1419), 13);
              map.setCenter(point, 13);
              
              
              //var marker = new GMarker(point);
             // map.addOverlay(marker);
              
              var marker = createInfoMarker(point, address);
              map.addOverlay(marker);
    
              
              
           
			 }
            }
          }
        );
      }
      //var map = new GMap(document.getElementById("map"));
     // map.centerAndZoom(new GPoint(-83.7, 42.2), 3);
    }
    
    
    
   
