	var map;
	var eduicon;
	var markers = new Array();
	
	function init(items, mapid, startPoint, startDistance){
		if (GBrowserIsCompatible()) {
			
			eduicon = new GIcon(G_DEFAULT_ICON);
			eduicon.image = "../maps/images/edu-marker.png";
			eduicon.shadow = "../maps/images/edu-marker-shadow.png";
			eduicon.iconSize = new GSize(25, 25);
			map = new GMap2(document.getElementById(mapid));
			map.addControl(new GMapTypeControl());
			map.addControl(new GLargeMapControl());
			map.setCenter(startPoint, startDistance);
			map.addMapType(G_PHYSICAL_MAP);
			map.removeMapType(G_HYBRID_MAP);
			map.setMapType(G_PHYSICAL_MAP);

			for (i = 0; i < items.length; i++)
			{
				items[i].point = new GLatLng(items[i].lat, items[i].lang);
				
				var content = '<ul><li class="title">' + items[i].title + '</li><li>Project: ' + items[i].project + '</li><li>Children Reached: ' + items[i].reached + '</li><li>Founded: ' + items[i].date + '</li></ul>';
				var contentRace = '<ul><li class="title">' + items[i].title + '</li><li>Distance: ' + items[i].distance + '</li><li>Race Date: ' + items[i].racedate + '</li></ul>';
				var contentFinRace = '<ul><li class="title">' + items[i].title + '</li><li>Distance: ' + items[i].distance + '</li><li>Race Date: ' + items[i].racedate + '</li><li>Finish Time: ' + items[i].finishtime + '</li><li>Placement: ' + items[i].placement + '</li></ul>';

				var contentB4B = '<ul><li class="title">' + items[i].title + '</li><li>Address: ' + items[i].address + '</li></ul>';
				
				if (items[i].type == 'library')
					content = wrapContent(content);
				else if(items[i].type == 'textbook')
					content = wrapContentTextbook(content);
				else if (items[i].type == 'race')
					content = wrapContentRace(contentRace);
				else if (items[i].type == 'race2')
					content = wrapContentFinRace(contentFinRace);

				else if (items[i].type == 'b4b')
					content = wrapContentFinRace(contentB4B);
				
				var marker = createMarker(items[i].point, content);
				map.addOverlay(marker);
				markers[items[i].id] = marker;
			}
		}
	}

	function showMarker(id){
		GEvent.trigger(markers[id], "click");
	}
	
	function wrapContent(html)
	{
		var htmlwraptop = '<div class="info-wrapper"><div class="info-header"><a href="javascript:;" onclick="closeWindow();" class="close">x</a></div><div class="info-container">';
		var htmlwrapbottom = '</div><div class="info-footer"><div class="more-info"><a href="http://www.edurelief.org/programs/school-libraries" target="_blank">More Info</a>/<a href="http://www.edurelief.org/involved/donate" target="_blank">Donate</a></div><img src="../maps/images/er2.png" class="logo" alt="edurelief" /></div></div>'; 
		return htmlwraptop + html + htmlwrapbottom;
	}
	function wrapContentTextbook(html)
	{
		var htmlwraptop = '<div class="info-wrapper"><div class="info-header"><a href="javascript:;" onclick="closeWindow();" class="close">x</a></div><div class="info-container">';
		var htmlwrapbottom = '</div><div class="info-footer"><div class="more-info"><a href="http://www.edurelief.org/programs/textbook-program">More Info</a>/<a href="http://www.edurelief.org/involved/donate" target="_blank">Donate</a></div><img src="../maps/images/er2.png" class="logo" alt="edurelief" /></div></div>';
		return htmlwraptop + html + htmlwrapbottom;
	}
	function wrapContentRace(html)
	{
		var htmlwraptop = '<div class="info-wrapper"><div class="info-header"><a href="javascript:;" onclick="closeWindow();" class="close">x</a></div><div class="info-container">';
		var htmlwrapbottom = '</div><img src="../maps/images/er2.png" class="logo" alt="edurelief" /></div></div>';
		return htmlwraptop + html + htmlwrapbottom;
	}
	function wrapContentFinRace(html)
	{
		var htmlwraptop = '<div class="info-wrapper"><div class="info-header"><a href="javascript:;" onclick="closeWindow();" class="close">x</a></div><div class="info-container">';
		var htmlwrapbottom = '</div><img src="../maps/images/er2.png" class="logo" alt="edurelief" /></div></div>';
		return htmlwraptop + html + htmlwrapbottom;
	}
	
	function closeWindow(){
		map.closeExtInfoWindow();
	}
	
	function createMarker(point, message) {
		markerOptions = { icon:eduicon };
		var marker = new GMarker(point, markerOptions);
		GEvent.addListener(marker, "click", function() {
			marker.openExtInfoWindow(map,"mw",message,{beakOffset: -3});
		});
		return marker;
	}
	