var centerLatitude =42.326062;
var centerLongitude = -83.047028;
var description='Downtown Detroit';
var startZoom=12;
var coder=new GClientGeocoder()


var map;

function panToLatLng(ll){
	map.panTo(ll)
}

function panToName(form){
	coder.getLatLng(form.zipentry.value, panToLatLng)

}


function addMarker(latitude, longitude, description){
			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("gmap"));
        map.addControl(new GSmallMapControl());
        map.setCenter(new GLatLng(centerLatitude, centerLongitude), startZoom);
        for(id in markers){
        	addMarker(markers[id].latitude, markers[id].longitude, markers[id].description);
        }
      }
    }

window.onload=init;
window.onunload=GUnload;