var address = address_line_1 + ", " + address_line_2 + ", " + city + ", " + state + " " + zip;


function load() {
  if (GBrowserIsCompatible()) {
    var mapDiv = document.getElementById("map_canvas");
    var map = new GMap2(mapDiv);
    map.setCenter(new GLatLng(32.920, -96.470), 13);
    map.addControl(new GSmallZoomControl3D());
    map.addControl(new GMenuMapTypeControl());
    map.addMapType(G_PHYSICAL_MAP);

         var icon = new GIcon();
        icon.image = "http://planetrockwall.com/css/images/mapnoletters.png";
        icon.shadow = "http://planetrockwall.com/css/images/shadow50.png";
        icon.iconSize = new GSize(20, 34);
        icon.shadowSize = new GSize(37, 34);
        icon.iconAnchor = new GPoint(10, 37);
        icon.infoWindowAnchor = new GPoint(10, 0);
        icon.infoShadowAnchor = new GPoint(23, 13);    

    
  }
  if ((lat!="")&&(lng!="")) {
    var point = new GLatLng(lat, lng);
    decorateMap(point);
  }
  else {
    
    showAddress(address);
  }
  function showAddress(address) {
      geocoder = new GClientGeocoder();
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              mapDiv.style.display = "none";
            } else {
              decorateMap(point);
            }
          }
        );
      }
    }
  function decorateMap(point) {
    map.setCenter(point, 13);
    var marker = new GMarker(point, {icon:icon});
    map.addOverlay(marker);
    //marker.openInfoWindowHtml("<strong>" + title + "</strong><br />" + address_line_1 + "<br/>" + city + ", " + state + " " + zip);
     // Create the click listener
 
  }
  
}
