var centerLatitude = 52.362345;
var centerLongtitude = 4.879668;
var startZoom = 13;
var map;

function addMarker(latitude, longtitude, description, icon) {
	var markerIcon = new GIcon();
	markerIcon.image = icon;
	markerIcon.iconSize = new GSize(20, 30);
	markerIcon.iconAnchor = new GPoint(15, 15);
	markerIcon.infoWindowAnchor = new GPoint(10, 20);
	
	var marker = new GMarker(new GLatLng(latitude, longtitude), markerIcon);
	GEvent.addListener(marker, 'click', function () {
		marker.openInfoWindowHtml(description, { maxWidth:400 });
	});
	
	map.addOverlay(marker);
}

function init() {
	map = new GMap2(document.getElementById('map'));
	map.addControl(new GLargeMapControl3D());
	map.setCenter(new GLatLng(centerLatitude, centerLongtitude), startZoom);
	
	// for(id in markers) {
	for (id=0;id<markers.length-1;id++) { 
		addMarker(markers[id].latitude, markers[id].longtitude, '<div class="info_wrap" style="height: 180px !important;">' + markers[id].description + '</div>', markers[id].icon);
	}
}

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