  var map;  var geocoder;      // showLocation() is called by the onOpen event    // in the form.  It geocodes the address entered into the form    // and adds a marker to the map at that location.    function showLocation(address) {    //alert ("address = " + address);      geocoder = new GClientGeocoder();      geocoder.getLocations(address, addAddressToMap);    }     // addAddressToMap() is called when the geocoder returns an    // answer.  It adds a marker to the map with an open info window    // showing the nicely formatted version of the address and the country code.    function addAddressToMap(response) {          //alert ("start addAddressToMap");       if (!response || response.Status.code != 200) {         //try only the city and state?        pos = jsAddress.indexOf(",");       var citystate = jsAddress.substring(pos+1,999);       jsAddress = citystate;        window.status="Unable to geocode that address - will try city instead - " + "[" + citystate + "]";              if ((citystate == null) | (citystate ==""))         {window.status= "Address incomplete- unable to find on the map";           return false;           }            geocoder.getLocations(citystate, addAddressToMap);       }       map = new GMap2(document.getElementById("map"));      map.addControl(new GSmallMapControl());      map.addControl(new GMapTypeControl());      map.setCenter(new GLatLng(37.774, -122.397), 10);      map.clearOverlays();      //alert ("map built - b4 response");      if (!response || response.Status.code != 200) {      } else {         //alert ("map built - now set the points");        place = response.Placemark[0];        point = new GLatLng(place.Point.coordinates[1],                            place.Point.coordinates[0]);        marker = new GMarker(point);        map.addOverlay(marker);        map.setZoom(15);        var listInfo  = "<table bgcolor='#ffffff' border='0'><tr><td>&nbsp;</td></tr><tr><td style='color:#000000' >" + place.address  + "</td></tr></table>" ;        marker.openInfoWindowHtml(listInfo );      }    }function createMapWithLatLon(address, lat, lon) {      if (GBrowserIsCompatible()) {        map = new GMap2(document.getElementById("map"));        //map.addControl(new GSmallMapControl());        map.addControl(new GLargeMapControl());        map.addControl(new GMapTypeControl());        map.setCenter(new GLatLng(37.4419, -122.1419), 11);        map.enableDoubleClickZoom();               // Create a base icon for all of our markers that specifies the        // shadow, icon dimensions, etc.        baseIcon = new GIcon();        baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";        baseIcon.iconSize = new GSize(20, 34);        baseIcon.shadowSize = new GSize(37, 34);        baseIcon.iconAnchor = new GPoint(9, 34);        baseIcon.infoWindowAnchor = new GPoint(9, 2);        baseIcon.infoShadowAnchor = new GPoint(18, 25);        var point = new GLatLng( lat, lon);        if (point) {            //alert ("creating marker for " + i);           var markerName = address;                    var marker = new GMarker(point,{title:markerName});                         map.addOverlay (marker);           map.setCenter(point, 11);           var listInfo  = "<table bgcolor='#ffffff' border='0'><tr><td>&nbsp;</td></tr><tr><td >" + address  + "</td></tr></table>" ;           //window.status = "create listInfo";           marker.openInfoWindowHtml(listInfo );            }   //end of IF point       }  //end of IF browser  }