Event.observe( window, "load", function (){
    
    var info;
    var center;
    
    if (GBrowserIsCompatible()) {
        var facility = new GLatLng(35.57043, -77.338536);
        var map = new GMap2($("map"));
        
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(facility, 15);
        
        info = "<p id=\"info\"><strong>St. Timothy&#39;s Episcopal Church</strong><br />107 Louis St.<br>Greenville, NC 27858<br>(252) 355-2125</p>";
        center = map.getCenter();
        
        map.openInfoWindowHtml(center, info);
        map.setMapType( G_MAP_TYPE );
        
        var icon = new GIcon();
        icon.image = "http://www.google.com/mapfiles/marker.png";
        icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        icon.iconSize = new GSize(20, 34);
        icon.shadowSize = new GSize(37, 34);
        icon.iconAnchor = new GPoint(8, 40);
        
        var marker = new GMarker(facility, icon);
        map.addOverlay(marker);
        
        GEvent.addListener(map, "click", function(marker, point) {
            if (marker) map.openInfoWindowHtml(center, info);
        });
    }
} );
