var map = null;

function loadMap(coords, soort){
	if(GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		var centerpoint = coords.split(",");
		map.setCenter(new GLatLng(centerpoint[0],centerpoint[1]), 16);
		
		var point = new GLatLng(centerpoint[0],centerpoint[1]);
		var marker = create_marker(point, soort);
		map.addOverlay(marker);
	}
}

function create_marker(point, soort) {
	var icon = new GIcon();
	icon.iconSize = new GSize(18,23);
	icon.iconAnchor = new GPoint(9,23);
	icon.infoWindowAnchor = new GPoint(9,0);
	icon.image = "http://www.pinkchristmas.nl/img/icon_" + soort + ".gif";

	var marker = new GMarker(point, icon, {clickable: false});
	return marker;		
}