      var baseIcon = new GIcon();
          baseIcon.iconSize=new GSize(20,18);
          baseIcon.shadowSize=new GSize(20,18);
          baseIcon.iconAnchor=new GPoint(18,20);
          baseIcon.infoWindowAnchor=new GPoint(16,0);

      var martini = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal2/icon27.png", null, "http://maps.google.com/mapfiles/kml/pal2/icon27s.png");
      var plane   = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal2/icon56.png", null, "http://maps.google.com/mapfiles/kml/pal2/icon56s.png");
      var pin = new GIcon(baseIcon, "http://www.mobidigger.com/pin.png", null, "http://www.mobidigger.com/pin.png");


    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("content"));
        var request = GXmlHttp.create();
        
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        //map.setCenter(new GLatLng(51.158678, 9.931640), 5);
        map.setCenter(new GLatLng(lat,lng), 3);


      request.open("GET", "diggs.xml.php", true);
      //request.open("GET", "demo.xml", true);
      request.onreadystatechange = function()  {
        if (request.readyState == 4) {
          //alert(request.responseText);
          var xmlDoc = GXml.parse(request.responseText);
          // obtain the array of markers and loop through it
          var markers = xmlDoc.documentElement.getElementsByTagName("marker");

          for (var i = 0; i < markers.length; i++) {
            // obtain the attribues of each marker
            var lat = parseFloat(markers[i].getAttribute("lat"));
            var lng = parseFloat(markers[i].getAttribute("lng"));
            var img = markers[i].getAttribute("img");
            var dig = markers[i].getAttribute("diggernr");

            var point = new GLatLng(lat,lng);
            var html = "<div class='infow' style='width:150px;font-size:0.8em;'><img src='"+img+"' border=0 style='float: left; margin-right: 2px;height:50; width:40'>" + markers[i].getAttribute("html") + "</div>";
             var label = markers[i].getAttribute("label");
            // create the marker
            var marker = createMarker(point,label,html,dig);
            map.addOverlay(marker);
          }
          // put the assembled side_bar_html contents into the side_bar div
          //document.getElementById("side_bar").innerHTML = side_bar_html;
        }
      }
      request.send(null);
    }
    else
      {
        document.getElementById(targetDIV).innerHTML = 'Browser funktion fehlerhaft';
      }

      }

    if (GBrowserIsCompatible()) {
      // this variable will collect the html which will eventualkly be placed in the side_bar
      var side_bar_html = "";

      // arrays to hold copies of the markers used by the side_bar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var i = 0;
      // A function to create the marker and set up the event window
      function createMarker(point,name,html,dig) {
        //var marker = new GMarker(point,pin);
        var marker = new GMarker(point);
       // alert(dig);
        GEvent.addListener(marker, "mouseover", function() {
          marker.openInfoWindowHtml(html);
        });
        GEvent.addListener(marker, "mouseout", function()
               {
                  //map.disableInfoWindow();
                  //map.enableInfoWindow();
               });
        GEvent.addListener(marker, "click", function()
          {
              GoToDigger(dig);
          });

        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
        // add a line to the side_bar html
        side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
        i++;
        return marker;
      }


      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        GEvent.trigger(gmarkers[i], "click");
      }

}

