
// Add the GUnload call to the window.unload to avoid browser memory leaks
window.unload = GUnload();

// Create a base icon
var baseIcon = new GIcon();
baseIcon.image = "http://www.google.com/mapfiles/marker.png";
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
baseIcon.infoShadowAnchor = new GPoint(18, 25);

// Function for Marker Creation
function AHSGoogleMapControl_CreateMarker(latitude, longitude, iconUrl, map)
{
    var point = new GLatLng(latitude,longitude);
    
    if (iconUrl.length >  0)
    {
        var icon = new GIcon(baseIcon);
        icon.image = iconUrl;
        var marker = new GMarker(point, icon);
    }
    else
    {
        var marker = new GMarker(point);
    }
    
    map.addOverlay(marker);
    
}
