var map = null;
var geocoder = null;


    function load() {
      if (GBrowserIsCompatible()) {
        
       
map = new GMap2(document.getElementById("map"));
geocoder=new GClientGeocoder();
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(42.24122708941077, -83.6220932006836), 13);
      }
    }

function showAddress(address, hotel) {
  try {
  geocoder.getLatLng(
    address,
    function(point) {
      if (!point) {
        alert(address + " can't find!");
      } else {
        map.setCenter(point, 13);
        var marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(buildMarker(hotel));
        
        
      }
    }
  );
}
catch ( e) {
	
}
}
function buildMarker(hotel) {
	return hotel.name + ","
	+hotel.address + "," 
	+hotel.phone;
}

var request = null; 

 
  function getFullAddress()  {
    return getAddress()+", "+getCity()+", "+getState();
  }

function updateMap()  {
  showAddress(getFullAddress());
  }


    //]]>


 function createRequest()  {
    try {
      request = new XMLHttpRequest();
    } catch (trymicrosoft)   {
      try  {
        request = new ActiveXObject("Msxm12.XMLHTTP");
      } catch (othermicrosoft)  {
        try  {
         request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (failed)  {
          request = null;
        }
      }
     }

if (request == null)
  alert("Error creating request object!");
 }
