﻿// JScript File


    var map = null;
    var geocoder = null;
   
function getGoogle(para){

    UseCallback_google(para);
    
}

function GetGoogleFromServer(TotalStr, context){

}
 
    function initialize() {
 //   alert("0");
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
       // map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl()); 
        
        geocoder = new GClientGeocoder();
       showAddress(); 
      }
    }

    function showAddress() {
         
      if (geocoder) {
        address = document.getElementById("google_address").value
       
       address = address.replace(/#/g, ""); 
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found - the page will refesh");
                        window.location.href=window.location.href  + "&nf=1" 
            } else {
          // alert(point);
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
             GEvent.addListener(marker, "click", function() {
                        marker.openInfoWindowHtml(address);
                      });

                UseCallback_google(point);
            }
          }
        );
      }
    }
