//var centerLatitude = 52.267107;
//var centerLongitude = 13.145485;
var startZoom = 12;
var map;

function addMarker(latitude, longitude, description) {
        var marker = new GMarker(
                new GLatLng(latitude, longitude));

        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.addControl(new GMapTypeControl());
                map.setCenter(new GLatLng(centerLatitude,centerLongitude), startZoom, G_HYBRID_MAP);
                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;
