var map = null; var geocoder = null; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 14); geocoder = new GClientGeocoder(); } } function showAddress(address, company) { if (GBrowserIsCompatible()) { geocoder = new GClientGeocoder(); if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { document.getElementById("map_canvas").style.display = "none"; document.getElementById("show_map").style.display = "none"; } else { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(point, 14); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(company); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); // GEvent.addListener(marker, "click", function() // { // marker.openInfoWindowHtml(company); // } ); } }// function(point) ); } // if (geocoder) } // if (GBrowserIsCompatible()) }