//Positioniert Teamer DIV
function posTeamerDiv(teamer){
  //document.getElementById("teamer"+teamer).style.top=(getElementCoords(document.getElementById("A"+teamer),"y"))+"px";
  //document.getElementById("teamer"+teamer).style.left=(getElementCoords(document.getElementById("A"+teamer),"x")-300)+"px";
}

//Zeigt Teamer DIV
function showTeamer(teamer){
  //posTeamerDiv(teamer);
  //document.getElementById("teamer_"+teamer).style.visibility="visible";
}
  
//Versteckt Teamer DIV
function hideTeamer(teamer){
  //document.getElementById("teamer_"+teamer).style.visibility="hidden";
}

// X/Y Koordinaten eines Elements ermitteln
function getElementCoords(eo,what){
  if(eo){
		var coords = {x: 0, y: 0};
		var i = 0;
 		var eo_original = eo;
 		do {
 			i++;
 			if(eo.currentStyle){
 				if(eo.currentStyle.position!='relative'){
 					coords.x += eo.offsetLeft;
 					coords.y += eo.offsetTop;
 				}
 			} else {
 				coords.x += eo.offsetLeft;
 				coords.y += eo.offsetTop;
 			}
 			eo = eo.offsetParent;
 		} while(eo);
 		
 		if(what=="x")
 		  return coords.x;
 		else if(what=="y")
 		  return coords.y;
 		  
 	} else {
 		return null;
  }
}

function setMenuBuffer(menuWidth,countPoints,delimiterWidth){
  //var width=delimiterWidth;
  var width=0;
  for(var i=0;i<countPoints;i++){
    width+=document.getElementById("menuPoint_"+i).offsetWidth;
    //width+=delimiterWidth;
  }
  var bufferWidth=menuWidth-width;
  document.getElementById("menuBuffer").style.width=bufferWidth+"px";
}

function reConfContent(id,string,strColor,strLength){
  if(!strLength){
    if(document.getElementById(id).value==""){
      document.getElementById(id).value=string;
      document.getElementById(id).style.color="#"+strColor;
    }
  } else {
    if(document.getElementById(id).value.slice(0,strLength)==string){
      document.getElementById(id).value="";
      document.getElementById(id).style.color="#"+strColor;
    }
  }
}

function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(50.6545, 6.7743), 14);
        
        GEvent.addListener(map,"click", function(overlay,latlng) {     
          if (latlng) {   
            //var myHtml = "The GLatLng value is: " + map.fromLatLngToDivPixel(latlng) + " at zoom level " + map.getZoom();
            var output=map.getCenter();
            //map.openInfoWindow(latlng, myHtml);
          }
        });
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

      
        function createMarker(point, text) {          
          var marker=new GMarker(point);
          GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(text);
          });
          return marker;
        }

        var ozPoint= new GLatLng(50.6545,6.7743);
        var ozText="Hier findet die<br> Offene Zeltstadt statt.";
         
        map.addOverlay(createMarker(ozPoint,ozText));
      
      }
}