﻿// JScript File


    var map = null;
    var geocoder = null;
   
   function getGoogle(para){

    UseCallback_google(para);
    
    }

    function GetGoogleFromServer(TotalStr, context){
        alert(TotalStr); 
        if(TotalStr == "20"){
       
                        window.location.href=window.location.href         
       } 

    }
  
    function initialize() {
    
     //   alert("2");
      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) {
       var 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=2"    
            } else {
              map.setCenter(point, 12);
        //     alert(point);
                UseCallback_google(point);
             // var marker = new GMarker(point);
            //  map.addOverlay(marker);
            //  marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }