
    var map = null;
    var icon = null;

    /*
     * Creates the map object and calls setCenterAndBounds
     * to instantiate it.
     */
    function load() {
        map = new GMap2(document.getElementById("map"));
        GEvent.addListener(map, "load", function() {updateMap();});    
        map.setCenter(new GLatLng(40.75404,-73.96684),13);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        //map.setMapType(G_HYBRID_MAP);
                
        if (window.attachEvent) window.attachEvent("onresize", function() { map.checkResize()} );
        else if (window.addEventListener) window.addEventListener("resize", function() { map.checkResize()}, false);
		
       
	   
    }

	function updateMap() {
       var _html = '<div class="marker" style="margin:5px 0 0 30px;color:#babc7d;font-size:10px;height:100px;"><img class="businessimage" src="data/images/carlton_logo.jpg"><br /><a href="http://maps.google.com/maps?f=d&source=s_d&saddr=&daddr=88+madison+avenue,+New+York,+NY+10016&hl=en&geocode=&mra=ls&sll=37.0625,-95.677068&sspn=60.635244,106.435547&ie=UTF8&z=17" target="_blank" style="font-size:12px;margin:-5px 0 0 15px;font-weight:bold;">Get Directions</a></div>'
		createMarker(_html, new GLatLng(40.74446,-73.98540), "marker")
        return false;
    }
	
    /*
     * Creates a marker for the given business and point
     */
	var markerCnt=1;
    function createMarker(_html, point, markerNum) {
        var infoWindowHtml = _html
		 // setup our marker icon
        icon = new GIcon();
        icon.image = "data/images/marker_star.png";
		markerCnt++;
        icon.shadow = "data/images/marker_shadow.png";
        icon.iconSize = new GSize(20, 34);
        icon.shadowSize = new GSize(34, 34);
        icon.iconAnchor = new GPoint(10, 34);
        icon.infoWindowAnchor = new GPoint(15, 3);
		
		
        var marker = new GMarker(point, icon);
        map.addOverlay(marker);

        //GEvent.addListener(marker, "click", function() {
			//open window and set bg color on selected item
            marker.openInfoWindowHtml(infoWindowHtml, {maxWidth:400});
        //});
		
    }
