var centerLatitude = 52.4786;
var centerLongitude = 13.3538;
var startZoom = 8;
var map;


var thermelogo = new GIcon();
thermelogo.image = 'http://www.karte24.net/logokarte24.png';
thermelogo.shadow = 'http://www.karte24.net/logokarte24schadow.png';
thermelogo.iconSize = new GSize(26, 25);
thermelogo.shadowSize = new GSize(50, 22);
thermelogo.iconAnchor = new GPoint(13, 25);
thermelogo.infoWindowAnchor = new GPoint(13, 1);
thermelogo.infoShadowAnchor = new GPoint(26, 13);


function addMarker(latitude, longitude, description) {
  var marker = new GMarker(new GLatLng(latitude,
                                       longitude), {icon:thermelogo});

  GEvent.addListener(marker, 'click',
    function() {
      marker.openInfoWindowHtml(description);
    }
  );

  map.addOverlay(marker);
}

function init()
{
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng(centerLatitude,
                      centerLongitude), startZoom);

    for(id in markers) {
       addMarker(markers[id].latitude,
         markers[id].longitude, markers[id].name);
    }
  }
}

window.onload = init;
window.onunload = GUnload;