function loadMap() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("showmap"));
    map.setCenter(new GLatLng(centerlat,centerlng),level);
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    baseIcon = new GIcon(G_DEFAULT_ICON);
    baseIcon.shadow = iconPath + "map.png";
    baseIcon.iconSize = new GSize(16, 16);
    baseIcon.shadowSize = new GSize(16, 16);
    baseIcon.iconAnchor = new GPoint(8, 8);
    loadMarker();
  }
}

function showLinkMarker(lat,lng,icon,link,content) {
  var point = new GLatLng(lat,lng);
  var hpmIcon = new GIcon(baseIcon);
  hpmIcon.image = iconPath + icon + ".png";
  var markerOptions = { icon:hpmIcon };
  var marker = new GMarker(point,markerOptions);
  map.addOverlay(marker);
  if (link != "") {
    GEvent.addListener(marker,"click",function() { document.location.href = link; });  
  }
}

function showMarker(lat,lng,icon,content) {
  var point = new GLatLng(lat,lng);
  var hpmIcon = new GIcon(baseIcon);
  hpmIcon.image = iconPath + icon + ".png";
  var markerOptions = { icon:hpmIcon };
  var marker = new GMarker(point,markerOptions);
  map.addOverlay(marker);
  if (content != "") {
    GEvent.addListener(marker,"click",function() { map.openInfoWindowHtml(point,"<div style=\'font-family:arial,helvetica,sans-serif; font-size:11px; color:#666666;\'><div style=\'width:240px; height:75px; overflow:auto;\'>"+content+"</div><div style=\'width:240px; text-align:right; line-height:13px; padding-top:5px;\'><a href=\"javascript:zoomIn("+lat+","+lng+");\" style=\"color:#666666; text-decoration:none;\"><img src=\"" + iconPath + "lupe.png\" border=\"0\" alt=\"\" /> Heranzoomen</a></div></div>"); });  
  }
}

function zoomIn(lat,lng) {
  map.closeInfoWindow();
  map.setCenter(new GLatLng(lat,lng),16);
}
