function InitialiseMap() {
    var map = new google.maps.Map2(document.getElementById(mapCanvasID));
    if (!map) return;

    if (typeof(maxResolution) != 'undefined' && eval(maxResolution) > -1) {
        RestrictMaximumResolution(maxResolution);
    }
    
    map.addControl(new google.maps.ScaleControl());
    map.addControl(new google.maps.SmallMapControl());

    var point = new google.maps.LatLng(lat, lng);
    map.setCenter(point, zoomLevel);

    var mgr = new google.maps.MarkerManager(map);
    var marker;
    var title = 'Open this location in Google Maps';
    if (typeof (customIcon) == 'undefined') {
        marker = new google.maps.Marker(point, { 'title': title });
    }
    else {
        var icon = new google.maps.Icon();
        icon.image = customIcon.src + customIcon.name + '.png';
        icon.shadow = customIcon.src + 'shadow.png';
        icon.transparent = customIcon.src + 'transparent.png';
        icon.iconSize = customIcon.iconSize;
        icon.shadowSize = customIcon.shadowSize;
        icon.iconAnchor = customIcon.iconAnchor;
        marker = new google.maps.Marker(point, { 'icon': icon, 'title': title });
    }
    google.maps.Event.addListener(marker, "click", function(point) {
        window.open('http://maps.google.co.uk/maps?q=' + point.lat() + ',' + point.lng());
    });
    mgr.addMarker(marker, 0);
    mgr.refresh();
}

function RestrictMaximumResolution(resolution) {
    var mapTypes = G_DEFAULT_MAP_TYPES;
    for (var i = 0; i < mapTypes.length; i++) {
        mapTypes[i].getMaximumResolution = function(latlng) { return resolution; };
    }
}