window.addEvent ('domready',function() {
	initGMap();
});

function initGMap() {
  if(GBrowserIsCompatible()){
    map_cont = $('gmap');
    /*gIcon = new GIcon();
    gIcon.image = "http://filialen.saftboxen.de/images/frontend/icon.png";
    gIcon.iconSize = new GSize(30, 30);
    gIcon.iconAnchor = new GPoint(0, 0);
    gIcon.infoWindowAnchor = new GPoint(12, 12);*/
    map = new GMap2(map_cont);
    geocoder = new GClientGeocoder();
    map.enableScrollWheelZoom();
    map.enableContinuousZoom();
    map.addControl(new GSmallMapControl());
    startPos = new GLatLng(51.3213, 12.371649);

    /*new Request.JSON({
      async:false,
      url:'/frontend.php/main/map_overlay',
      onSuccess:function(data){
        locs = data;
        geocoder.getLatLng('DE ' + sstring, function(point){
          if(point){
            map.setCenter(point);
          }
          initMarkers();
        });
      }
    }).get();*/
    GEvent.addListener(map, "dragend", initMarkers);
    GEvent.addListener(map, "zoomend", initMarkers);
  }
}


function initMarkers() {

}