    //<![CDATA[

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(49.4248, 8.4155), 16);
	
		// Place a marker in the center of the map and open the info window
		// automatically
		var marker = new GMarker(map.getCenter());
		GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml("Evangelisch-Freikirchliche Gemeinde<br>Benzstra&szlig;e 3<br>67141 Neuhofen");
		});
		map.addOverlay(marker);
		
//		var marker1 = new GMarker(new GLatLng(49.491737,8.435451));
//		GEvent.addListener(marker1, "click", function() {
//            marker1.openInfoWindowHtml("Evangelisch-Freikirchliche Gemeinde<br>B&ouml;hlstra&szlig;e 5<br>67063 Ludwigshafen");
//		});
//      map.addOverlay(marker1);
	  }
	}

    function loadMap(coord1, coord2, zValue, pointerText) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(parseFloat(coord1), parseFloat(coord2)), parseFloat(zValue));
	
		// Place a marker in the center of the map and open the info window
		// automatically
		var marker = new GMarker(map.getCenter());
		GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(pointerText);
		});
		map.addOverlay(marker);
	  }
	}
	
	var showMap = true;
	var showLayer = true;
	
	function setIframe () {
	    document.getElementById('ifGoogleMap').src = '/weg/googleMap.php?mapCoord1=49.4248&mapCoord2=8.4145&zValue=16&mapLabel=test from johnny';
		document.getElementById('ifGoogleMap').style.visibility="visible";
	}
	
	function showLocation(coordinate1, coordinate2, zValue, label){
		if(showMap){
			//loadMap(coordinate1, coordinate2, zValues, label);
			document.getElementById('ifGoogleMap').src = '/weg/googleMap.php?mapCoord1=' + coordinate1
														   + '&mapCoord2=' + coordinate2
														   + '&mapLabel=' + label
														   + '&zValue=' + zValue;
		    //document.getElementById('ifGoogleMap').style.visibility="visible";
			document.getElementById('mapLayer').style.visibility="visible";
			//document.getElementById('map').style.visibility="visible";
			document.getElementById('mapLink').firstChild.nodeValue="Karte Verstecken";
			showMap = false;
		} else {
			//document.getElementById('map').style.visibility="hidden";
			//document.getElementById('ifGoogleMap').style.visibility="hidden";
			document.getElementById('mapLayer').style.visibility="hidden";
			document.getElementById('mapLink').firstChild.nodeValue="Karte Anschauen";
			showMap = true;
		}
    }
	
	function displayLayer(){
		if(showLayer){
			document.getElementById('mapLayer').style.visibility="visible";
			document.getElementById('mapLink').firstChild.nodeValue="Karte Verstecken";
			showLayer = false;
		} else {
			document.getElementById('mapLayer').style.visibility="hidden";
			document.getElementById('mapLink').firstChild.nodeValue="Karte Anschauen";
			showLayer = true;
		}
    }
	
	//Loads normal map by default
	function loadQuerystring() {
		  if (GBrowserIsCompatible()) {
			qs() ;
			var map = new GMap2(document.getElementById("map"));
			//var coords [] = qsParm["mapCoords"].split("," 2);
			var coords1 = parseFloat(qsParm["mapCoord1"]);
			var coords2 = parseFloat(qsParm["mapCoord2"]);
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(coords1, coords2), parseInt(qsParm["zValue"]));
			if (qsParm["startView"] == 'satellite'){
                map.setMapType(G_SATELLITE_MAP);
			}

		
			// Place a marker in the center of the map and open the info window
			// automatically
			var marker = new GMarker(map.getCenter());
			var mapPointerTxt = qsParm["mapLabel"];
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(unescape(mapPointerTxt));
			});
			map.addOverlay(marker);
			//t=h
		  }
	}
	
	var qsParm = new Array();
	function qs() {
		var query = window.location.search.substring(1);
		var parms = query.split('&');
		for (var i=0; i<parms.length; i++) {
			var pos = parms[i].indexOf('=');
			if (pos > 0) {
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			qsParm[key] = val;
		}
	}
	}
//]]>
