// Set up the map and the local searcher.
var gPoint = null;

function OnLoad()
{
    if (typeof(mapLat) != 'undefined' && typeof(mapLng) != 'undefined')
    {
        // Initialize the map
        var gMap = new GMap2(document.getElementById("map"));
        gMap.addControl(new GSmallMapControl());
        
        // Create the point
        gPoint = new GLatLng(mapLat, mapLng);

        // Center the map
        gMap.setCenter(gPoint, 4);
        
        gMap.enableScrollWheelZoom();
        
        // Create the marker
        var gMgr = new GMarkerManager(gMap);
        var gSmallIcon = new GIcon();
        gSmallIcon.image = "/g/i_mapmarker.png";
        gSmallIcon.shadow = "/g/i_mapmarkershadow.png";
        gSmallIcon.iconSize = new GSize(26, 45);
        gSmallIcon.shadowSize = new GSize(49, 45);
        gSmallIcon.iconAnchor = new GPoint(13, 45);
        gSmallIcon.infoWindowAnchor = new GPoint(5, 1);
        var marker = new GMarker(gPoint, gSmallIcon);
        gMgr.addMarker(marker, 0, 11);
        gMgr.refresh();
    }
}
