﻿    var map = null;
var geocoder = null;
var bounds = null;
function initMap(mapId, coord1, coord2, zoom)
{
				if (GBrowserIsCompatible())
				{
								map = new GMap2(document.getElementById(mapId));
								map.setCenter(new GLatLng(parseFloat(coord1), parseFloat(coord2)));
								map.setUIToDefault();
								map.setZoom(zoom);
				}
};

function showBusiness(lat, lng, locationName, locationUrl, desc)
{
        var location = new GLatLng(lat, lng);
        map.addOverlay(createMarker(location, locationName, locationUrl, desc));
		
}
function createMarker(point, businessName, businessUrl, desc) 
{
  var marker = new GMarker(point);
  
  if(!bounds)
  {
				bounds = new GLatLngBounds();
  }
  bounds.extend(point);

  GEvent.addListener(marker, "click", function() {
  marker.openInfoWindowHtml('<div style="width: 500px"><a href="' + businessUrl + '"><h3 style="font-weight: bold; font-size: medium; margin-bottom: 0em;">' + businessName + '</h3></a>' + desc + "</div>");
  });
  return marker;
}
