//<![CDATA[ 

var map = null;
var marker = null;

window.onload=function () {
		
}
function closeKarte(tid){
	document.getElementById("dfxMap"+tid).style.visibility='hidden';
	document.getElementById("dfxMapClose"+tid).style.visibility='hidden';
	document.getElementById("dfxMap"+tid).style.height='0px';

}
function showKarte(tid,lg,bg,name){
		if (GBrowserIsCompatible()) {
		document.getElementById("dfxMap"+tid).style.visibility='visible';
	    document.getElementById("dfxMapClose"+tid).style.visibility='visible';
	  	document.getElementById("dfxMap"+tid).style.width='';
		document.getElementById("dfxMap"+tid).style.height='400px';
        map = new GMap2(document.getElementById("dfxMap"+tid));
		map.setCenter(new GLatLng(bg,lg), 14);
		map.addControl(new GLargeMapControl());
					map.addControl(new GOverviewMapControl());
					map.addControl(new GMapTypeControl());
				map.setMapType(G_NORMAL_MAP);
        map.enableDoubleClickZoom();
        map.enableContinuousZoom();
  
      var point = new GLatLng(bg,lg);
	  var icon=G_DEFAULT_ICON;
	  marker = createMarker(point,icon,name);
	  map.addOverlay(marker);
	
	} // ende compatible
 } // ende load()

var XMLHTTP = null;
if (window.XMLHttpRequest) {
  		XMLHTTP = new XMLHttpRequest();
} else if (window.ActiveXObject) {
  	try {
    	XMLHTTP = 
     	 new ActiveXObject("Msxml2.XMLHTTP");
	} catch (ex) {
    try {
      XMLHTTP = 
       new ActiveXObject("Microsoft.XMLHTTP");
	 } catch (ex) {
    }
  }
}
function showProfil(lokal){
    XMLHTTP.open("GET", "ajax_location.php?vst="+lokal);
  	XMLHTTP.onreadystatechange = DatenAusgeben;
	XMLHTTP.send(null);
}
function DatenAusgeben() {
  if (XMLHTTP.readyState == 4) {
     code= XMLHTTP.responseText;
	 marker.openInfoWindowHtml(code);
  }
}

function createMarker(point,icon,titel) {
	 var marker = new GMarker(point,{icon:icon,title:titel});
     GEvent.addListener(marker, "click", function() {
	 	showProfil(titel);
     });
     return marker;
}


//]]> 
