
    var map;
    var geocoder;
	var info;



    function initialize(koordinaten, address, info) {
    this.info = info;
    //53.865486,11.304932



     map = new GMap2(document.getElementById("gmaps"));

     koordinaten = koordinaten.replace(')', '');
     koordinaten = koordinaten.replace('(', '');
     var koordinatenArray = koordinaten.split(',');
     map.setCenter(new GLatLng(Number(koordinatenArray[0]),Number(koordinatenArray[1])), 9);	

      geocoder = new GClientGeocoder();
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      //var address = "Wangels, Alte Landstr. 9";






	if (koordinaten=="53.865486,11.304932"){
      geocoder.getLocations(address, addAddressToMap);
     }else{
	gmapsContainer.style.visibility="visible";
        gmaps.style.height = "400px";            
        point = new GLatLng(Number(koordinatenArray[0]),Number(koordinatenArray[1]));
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(info + '<br>' + address + '<br>'  );
     }

      var mainElem = document.getElementById("gmaps");
      mainElem.style.display = 'block';
      if (mainElem.addEventListener) {
        mainElem.addEventListener('DOMMouseScroll', wheel, false);
      }
	mainElem.onmousewheel = wheel;
	this.map.addControl(new TextualZoomControl());

 



    }

    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        //alert("Sorry, we were unable to geocode that address");                  
        gmaps.style.height = "0px";
      } else {
        gmapsContainer.style.visibility="visible";
        gmaps.style.height = "400px";            
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(info + '<br>' + place.address + '<br>'  );
      }
    }

 

  function zoomGMap(delta) {
    if (delta < 0) {
      map.zoomOut();
    } else {
      map.zoomIn();
    }
  }

  function wheel(event){
    var delta = 0;
    if(!event) {
      event = window.event;
    }
    if(event.wheelDelta) {
      delta = event.wheelDelta/120; 
      if(window.opera) {
        delta = -delta;
      }
    } else if(event.detail) {
    delta = -event.detail/3;
    }
    if(delta) {
      zoomGMap(delta);
    }
    if(event.preventDefault) {
      event.preventDefault();
    }
    event.returnValue = false;
  }




 
function TextualZoomControl() {
}

 
TextualZoomControl.prototype = new GControl();

 
TextualZoomControl.prototype.initialize = function(map) {
  var container = document.createElement("div");
container.style.display = "inline";

container.style.float = "left";
  var zoomInDiv = document.createElement("div");
  this.setButtonStyle_(zoomInDiv);
  zoomInDiv.style.float = "left";
  zoomInDiv.style.display = "inline";
  container.appendChild(zoomInDiv);
  zoomInDiv.appendChild(document.createTextNode("näher ran"));
  GEvent.addDomListener(zoomInDiv, "click", function() {
    map.zoomIn();
  });

  var zoomOutDiv = document.createElement("div");
  this.setButtonStyle_(zoomOutDiv);
  zoomOutDiv.style.float = "left";
  zoomOutDiv.style.display = "inline";
  container.appendChild(zoomOutDiv);
  zoomOutDiv.appendChild(document.createTextNode("weiter weg"));
  GEvent.addDomListener(zoomOutDiv, "click", function() {
    map.zoomOut();
  });

  map.getContainer().appendChild(container);
  return container;
}


TextualZoomControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(300, 10));
}

// Sets the proper CSS for the given button element.
TextualZoomControl.prototype.setButtonStyle_ = function(button) {
  button.style.textDecoration = "none";
  button.style.color = "#000000";
  button.style.backgroundColor = "white";
  button.style.fontFamily = "Arial"; 
  button.style.fontSize = "12px"; 
  button.style.border = "1px solid black";
  button.style.padding = "2px";
  button.style.paddingLeft = "8px";
  button.style.paddingRight = "8px";
  button.style.marginLeft = "5px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "8em";
  button.style.cursor = "pointer";
}
 

