var map;

var iconMOG = new GIcon(); iconMOG.image = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_r_20.png"; iconMOG.iconSize = new GSize(12, 20); iconMOG.iconAnchor = new GPoint(6, 20); iconMOG.infoWindowAnchor = new GPoint(7, 6); iconMOG.shadow = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_10_s.png"; iconMOG.shadowSize = new GSize(22, 20);

var iconMOGlight = new GIcon();	iconMOGlight.image = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_rl_10.png"; iconMOGlight.iconSize = new GSize(6, 10); iconMOGlight.iconAnchor = new GPoint(3, 10); iconMOGlight.infoWindowAnchor = new GPoint(4, 3); iconMOGlight.shadow = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_10_s.png"; iconMOGlight.shadowSize = new GSize(11, 10);

var iconMO = new GIcon(); iconMO.image = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_y_20.png"; iconMO.iconSize = new GSize(12, 20); iconMO.iconAnchor = new GPoint(6, 20); iconMO.infoWindowAnchor = new GPoint(7, 6); iconMO.shadow = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_20_s.png"; iconMO.shadowSize = new GSize(22, 20);

var iconMOlight = new GIcon(); iconMOlight.image = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_yl_10.png"; iconMOlight.iconSize = new GSize(6, 10); iconMOlight.iconAnchor = new GPoint(3, 10); iconMOlight.infoWindowAnchor = new GPoint(4, 3); iconMOlight.shadow = "http://www.urlaub-in-boltenhagen.de/images/lagekarte_mm_10_s.png"; iconMOlight.shadowSize = new GSize(11, 10);

function createMarkerObjGroup(point, info, highlight, active)
{
// Create our "tiny" marker icon
if (highlight)
{
	var marker = new GMarker(point, iconMOG);
} else {
	var marker = new GMarker(point, iconMOGlight);
}

// Show this markers index in the info window when it is clicked
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(info);});
if (active) { marker.openInfoWindowHtml(info); }
return marker;
};

function createMarkerObj(point, info, highlight, active)
{
// Create our "tiny" marker icon
if (highlight)
{
	var marker = new GMarker(point, iconMO);
} else {
	var marker = new GMarker(point, iconMOlight);
}

// Show this markers index in the info window when it is clicked
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(info);});
if (active) { marker.openInfoWindowHtml(info); }
return marker;
}


function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl(1));
        map.setCenter(new GLatLng(53.992454, 11.195839), 12);
		
		map.enableContinuousZoom();
		map.enableDoubleClickZoom();
		  for (var i = 0; i < markerdata.length; ++i) {
//			alert(markerdata[i].kind+' | '+markerdata[i].lat+' | '+markerdata[i].lng+' | '+markerdata[i].url+' | '+markerdata[i].high);
			if (markerdata[i].kind == 0)
			{
				map.addOverlay(createMarkerObjGroup(new GLatLng(markerdata[i].lat, markerdata[i].lng), "<iframe frameborder='0' src='"+markerdata[i].url+"'></iframe>", markerdata[i].high, markerdata[i].active ));
			} else if (markerdata[i].kind == 1)
			{
				map.addOverlay(createMarkerObj(new GLatLng(markerdata[i].lat, markerdata[i].lng), "<iframe frameborder='0' src='"+markerdata[i].url+"'></iframe>", markerdata[i].high, markerdata[i].active ));
			}
		  }
      }
    }

window.onload=load;