function onLoad(getfile) {

  if (!GBrowserIsCompatible()) {
    return;
  }

  function createHTML(name, lng, lat, hosts) {
    var html = name + ': '+hosts+' hosts';
    //var html = '<table border=0><tr><td><b><font color="blue">Country</font></b><br>';
    //html = html + 'Latitude<br>Longitude<br>Hosts</td><td>&nbsp; &nbsp;</td><td><b><font color="blue">'+name+'</font></b><br>';
    //html = html + lat + '<br>' + lng + '<br>' + hosts + '</td></tr></table>'
    return html;
  }

  var baseIcon  = new GIcon ();
  baseIcon.iconSize = new GSize (12, 12);
  baseIcon.iconAnchor = new GPoint (2, 2);
  baseIcon.infoWindowAnchor = new GPoint (10, 2);

  function createIcon (hosts) {
    var icon = new GIcon (baseIcon);
    color = 'black';
    if (!isNaN (hosts)) {
      hosts = parseInt (hosts);
      if (hosts > 1000000)
	  color = 'red';
      else if (hosts > 250000)
	  color = 'orange';
      else if (hosts > 100000)
	  color = 'yellow';
      else if (hosts > 50000)
	  color = 'green';
      else if (hosts > 10000)
	  color = 'blue';
      else if (hosts > 5000)
	  color = 'purple';
      else if (hosts > 1000)
	  color = 'black';
      else if (hosts > 250)
	  color = 'brown';
      else if (hosts > 50)
	  color = 'gray';
      else if (hosts >= 0)
	  color = 'white';
    }
    icon.image = "/imgs/maps/"+color+".png";
    return icon;
  }

  function createMarker(point, icon, html, tip) {
    var marker = new PdMarker (point, icon);
    marker.setTooltip(tip);
    marker.setDetailWinHTML(html);
    //marker.setHoverImage("http://www.google.com/mapfiles/dd-start.png");
    //GEvent.addListener (marker, "click", 
    //function() { marker.openInfoWindowHtml(tip); });
    return marker;
  }

  var map = new GMap2(document.getElementById("map"));
  map.addControl(new GSmallMapControl());

  if (getfile.indexOf ("/maps/") != 0)
      return;
  if (getfile.indexOf ("..") >= 0)
      return;

  if (getfile.indexOf ("world-all.php") >= 0) {
      map.setCenter(new GLatLng (25, 10), 2);
      map.addControl(new GMapTypeControl());
  }
  else
      map.setCenter(new GLatLng (25, 10), 1);

  var request = GXmlHttp.create();
  request.open("GET", getfile, true);

  request.onreadystatechange = function() {

    if (request.readyState == 4) {
      var xmlDoc = request.responseXML;
      var markers = xmlDoc.documentElement.getElementsByTagName("marker");
      for (var i=0; i < markers.length; i++) {
        var name  = markers[i].getAttribute("name");
	if (name.length) {
          var lat  = markers[i].getAttribute("lat");
          var lng  = markers[i].getAttribute("lng");
          var hosts = markers[i].getAttribute("hosts");

          var tip = name;
          if (hosts.length)
	      tip = tip + ': ' + hosts + ' hosts';

          var point  = new GLatLng (lat,lng);
	  var icon   = createIcon (hosts);
	  var html   = createHTML (name, lng, lat, hosts);
          var marker = createMarker (point, icon, html, tip);

          map.addOverlay(marker);
        }
      }
    }
  }
  request.send(null);
}
