function createMarker(point, text) {
	var letteredIcon = new GIcon(baseIcon);
	letteredIcon.image = "http://www.google.com/mapfiles/marker.png";

	markerOptions = { icon:letteredIcon };
	var marker = new GMarker(point, markerOptions);

	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml(text + "</b>");
	});
	return marker;
}

var baseIcon;
function gmap_initialize(mapid,zoom) {
	if (GBrowserIsCompatible()) {
		baseIcon = new GIcon();
		baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		baseIcon.iconSize = new GSize(20, 34);
		baseIcon.shadowSize = new GSize(37, 34);
		baseIcon.iconAnchor = new GPoint(9, 34);
		baseIcon.infoWindowAnchor = new GPoint(9, 2);
		baseIcon.infoShadowAnchor = new GPoint(18, 25);

	
		var map = new GMap2(document.getElementById("map_canvas"+mapid));
		map.setCenter(new GLatLng(mapcenter[mapid][0], mapcenter[mapid][1]), zoom);
		var mapTypeControl = new GMapTypeControl();
		var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10));
		var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10));
		map.addControl(mapTypeControl, topRight);
		map.addControl(new GSmallMapControl());
		map.enableScrollWheelZoom();
		
		var point = new GLatLng(points[mapid][0], points[mapid][1]);
		var marker = createMarker(point, points[mapid][2]);
		map.addOverlay(marker);
		marker.openInfoWindowHtml('<font style="color:#000;">'+points[mapid][2]+'</font>');
		
		if(points[mapid][3] != undefined){
			var point2 = new GLatLng(points[mapid][3], points[mapid][4]);
			var marker2 = createMarker(point2, points[mapid][5]);
			map.addOverlay(marker2);
			marker2.openInfoWindowHtml('<font style="color:#000;">'+points[mapid][5]+'</font>');
		}
		if(points[mapid][6] != undefined){
			var point3 = new GLatLng(points[mapid][6], points[mapid][7]);
			var marker3 = createMarker(point3, points[mapid][8]);
			map.addOverlay(marker3);
			marker3.openInfoWindowHtml('<font style="color:#000;">'+points[mapid][8]+'</font>');
		}
	}
}
