	var map;
    
    function createMap() {
    	if (GBrowserIsCompatible()) {
	    	map = new GMap2(document.getElementById("map"));
	        map.setCenter(new GLatLng(53.550556, 9.993333), 3);
	        map.addControl(new GLargeMapControl());
	        map.addControl(new GMapTypeControl());
	        map.enableContinuousZoom();
	        // G_HYBRID_MAP, G_PHYSICAL_MAP, G_MOON_ELEVATION_MAP, G_SKY_VISIBLE_MAP
	        map.setMapType(G_PHYSICAL_MAP);
	    }
    }
    
    function createIcon() {
    	var baseIcon = new GIcon();
        baseIcon.iconSize = new GSize(20, 34);
        baseIcon.iconAnchor = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);
        baseIcon.infoShadowAnchor = new GPoint(19, 17); 
        var specializedIcon = new GIcon(baseIcon);
        specializedIcon.image = "assets/akwmarker.png";
        return specializedIcon;
    }
    
    function addNuclearPowerStation(operating,itsName,powerOn,powerOff,lat,lng) {
    	// first add the icon for the nuclear power station
    	markerOptions = { icon:createIcon() };
        point = new GLatLng(lat, lng);
        var marker = new GMarker(point, markerOptions);
        //var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml("<b>"+itsName+"</b><table border='1'><tr><td>Power on:</td><td>"+powerOn+"</td></tr><tr><td>Power off:</td><td>"+powerOff+"</td></tr></table>");
        });
        map.addOverlay(marker);
        // second add a polygon around this marker to show the extent of a possible threat
        var currentLocation = marker;
        var radiusInMiles = 90.25;
        var milesPerLat = 69.047;
        var milesPerLng = 43;
        var func_points = new Array(9);
        var func_newLat = currentLocation.getLatLng().lat() + radiusInMiles/milesPerLat;
        var func_newLng = currentLocation.getLatLng().lng() - ((0.50 * radiusInMiles)/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() + (0.50*radiusInMiles)/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() - (radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() - (0.50*radiusInMiles)/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() - (radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() - radiusInMiles/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() - (0.50*radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() - radiusInMiles/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() + (0.50*radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() - (0.50*radiusInMiles)/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() + (radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() + (0.50*radiusInMiles)/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() + (radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() + radiusInMiles/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() + (0.50*radiusInMiles/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        func_newLat = currentLocation.getLatLng().lat() + radiusInMiles/milesPerLat;
        func_newLng = currentLocation.getLatLng().lng() - ((0.50 * radiusInMiles)/milesPerLng);
        func_points.push(new GLatLng(func_newLat, func_newLng));
        color = "";
        bordercolor = "";
        if (operating=="ja") {
			color = "#ff0000";
			bordercolor = "#f33f00";
		}
		if (operating=="nein") {
			color = "#ff0000";
			bordercolor = "#ffba00";
		}
        polygon = new GPolygon(func_points, bordercolor, 1, 1, color, 0.2);
        map.addOverlay(polygon);
    }
