if (GBrowserIsCompatible()) {
	// Create the Map
//var map = new GMap2(document.getElementById("map"));
	var map = new GMap(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng( 41.227926,-96.022139), 7);
	
	var icons 			= new Array();						// Global Icons
	setIcons();																// Create Colored Icons for Markers 
		
	var bounds			= new GLatLngBounds();		// Global Bounds
	
	var	aType				= new Array();						// Global Array built from XML
	var	aIcon				= new Array();						// Global Array built from XML
	var	aLat				= new Array();						// Global Array built from XML
	var	aLng				= new Array();						// Global Array built from XML
	var	aLbl				= new Array();						// Global Array built from XML
	var	aInfo				= new Array();						// Global Array built from XML (constructed)

	var aCount			= 0;											// Global Count of XML Array
	var aMarker 		= new Array();						// Global Array of Markers
	
	// Read XML and Load the aMarkers Array
	xmlProcessed 		= getXMLfile("attractions.xml");

	if (xmlProcessed) {											// If XML Process was a Succes
		aCount = aType.length;
		mapAttractions();	
	}
	else {																	// If XML Process was a Failure
		alert("Unable to continue");
	}
//	alert("Done with Script");
}
else {	
	alert("Sorry, your Browser is not compatible with our Mapping Engine.");
}

// ========================================================================================
	function mapAttractions() {
		// Initialize
		SideBar_HTML = "<center><u><b>Click on Item for Details</b></u></center>";																// Reset SideBar_HTML
		srchString = "Hotel";

		if (document.frmCB.cb01.checked) srchString += "Attractions"
		if (document.frmCB.cb02.checked) srchString += "Entertainment"
		if (document.frmCB.cb03.checked) srchString += "Event"
		if (document.frmCB.cb04.checked) srchString += "Golf"
		if (document.frmCB.cb05.checked) srchString += "Park"
		if (document.frmCB.cb06.checked) srchString += "School"
		if (document.frmCB.cb07.checked) srchString += "Shop"
		if (document.frmCB.cb08.checked) srchString += "Theatre"

		map.clearOverlays();

		for (var tm = 0; tm < aCount; tm++) {
			if (srchString.match(aType[tm])) {
				if (isNaN(aLat[tm]) || isNaN(aLng[tm])) {
					alert("bad point for "+aLbl[tm]);
					continue;
				}

				var point = new GLatLng(aLat[tm],aLng[tm]);

				// create the marker
				var marker = createMarker(point,aLbl[tm],aInfo[tm],aIcon[tm]);

				bounds.extend(point);
				map.addOverlay(marker);
			}
		}
		map.centerAndZoomOnBounds(bounds);
		bounds = null; 
		bounds = new GLatLngBounds(); 

		// put the assembled sidebar_html contents into the sidebar div
		document.getElementById("sidebar").innerHTML = SideBar_HTML;
		SideBar_HTML = "";
	}

	function createMarker(fPoint,fLabel,fInfo,fIcon) {
//	alert("createMarker("+fPoint+", "+fLabel+", "+fInfo+", "+fIcon+")");
		var marker;
		if (fIcon) {
			marker = new GMarker(fPoint,getIcon(fIcon));
		} 
		else {
			marker = new GMarker(fPoint);
		}
		var marker_num = aMarker.length;
		marker.marker_num = marker_num;
		aMarker[marker_num] = marker;
        
		GEvent.addListener(aMarker[marker_num], "click", function() {
			marker.openInfoWindowHtml(fInfo);
		});

		// add a line to the sidebar html
		SideBar_HTML += '&#8226;&nbsp;<a class="nav-map" href="javascript:myclick(' + marker_num + ')">' + fLabel + '</a><br>';
	return marker;
	}