var g__map
function load_gmap(ip,latitude,longitude,country_name,region,city) 
{
    if (GBrowserIsCompatible()) 
    {
        var infoWindowText;
    
        if (latitude != 0 && longitude != 0)
        {
            infoWindowText = "<div class='main_article'><b>IP Address:</b><br /><span class='indent'>" + ip + "</span><br /><b>Geographic Location:</b><br /><div class='indent'>Latitude = " + latitude + "<br /> Longitude = " + longitude + "<br />" + country_name + "- " + city + ", " + region + "</div></div>";
            
            g__map = new GMap2(document.getElementById("map"));
            g__map.addControl(new GSmallMapControl());
            g__map.addControl(new GMapTypeControl());
            g__map.setCenter(new GLatLng(latitude,longitude), 8);
            var icon = new GIcon();
            icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
            icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
            icon.iconSize = new GSize(20, 30);
            icon.shadowSize = new GSize(0, 0);
            icon.iconAnchor = new GPoint(0, 0);
            icon.infoWindowAnchor = new GPoint(0, 0);

            // Creates a marker at the given point with the given number label
            function createMarker(point, number) 
            {
                var marker = new GMarker(point);
                GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(number); } );
                return marker;
            }
            
            var point = createMarker(new GLatLng(latitude,longitude),icon);
            g__map.addOverlay(point); 
            point.openInfoWindowHtml(infoWindowText);
        }
    }
}
    