var centerLatitude = 43.640;
var centerLongitude = -84.225;
var startZoom = 12;
var map;

function addMarker(latitude , longitude, description, icon ) {
	var ssmarker = new GIcon();
	ssmarker.image = icon;
	ssmarker.iconSize = new GSize(17, 15);
	ssmarker.iconAnchor = new GPoint(14, 14);
	ssmarker.infoWindowAnchor = new GPoint(9, 9);
    var marker = new GMarker(new GLatLng(latitude, longitude));
    GEvent.addListener(marker, 'click',
        function() {
            marker.openInfoWindowHtml(description);
        }
    );
    map.addOverlay(marker);
}

function init()
{
    if (GBrowserIsCompatible()) {
         map = new GMap2(document.getElementById("map"));
		 map.addControl(new GSmallMapControl());
         var location = new GLatLng(centerLatitude, centerLongitude);
         map.setCenter(location, startZoom);
		 for(id in markers) 
		 {
			addMarker(markers[id].latitude , markers[id].longitude, markers[id].description);
		}

    }
}
function get_dd(start,end)
{
	var myurl = "http://maps.google.com/maps?f=d&hl=en&saddr=" + start + "&daddr=" + end +"&om=1";
	ddwin = window.open(myurl)
	ddwin.focus();
}
window.onload = init;
window.onunload = GUnload;
