//<![CDATA[
function displayGMap(){
	if (GBrowserIsCompatible()) {
		//-------------------------------------------------- style map container
		document.getElementById('map').style.width = '480px';
		document.getElementById('map').style.height = '550px';
		document.getElementById('map').style.border = '1px solid #999';
		//---------------------------------------------------------------- icons
		var baseIcon = new GIcon();
		baseIcon.iconSize=new GSize(32,32);
		baseIcon.shadowSize=new GSize(56,32);
		baseIcon.iconAnchor=new GPoint(16,32);
		baseIcon.infoWindowAnchor=new GPoint(16,0);
		
		var newCap = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal4/icon58.png", null, null);
		var oldCap = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal4/icon59.png", null, null);
	
		//------------------------------------------------------- marker builder
		function createMarker(point,html,icon) {
			var marker = new GMarker(point,icon);
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(html);
			});
			return marker;
		}
	
		// Display the map, with some controls and set the initial location 
		var map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		//map.addControl(new GOverviewMapControl());
		map.setCenter(new GLatLng(39.802346,-89.651753), 15);
		
		//====================================================== special markers
		//---------------------------------------------------- Dana-Thomas House
		var point = new GLatLng(39.79426,-89.651377);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Dana-Thomas House</strong><br />301 E. Lawrence Avenue<br /><img style="display: block;" src="/img/page_photos/historic_homes/dana_thomas_sm.jpg" alt="" width="210" height="140" /></p><p style="clear: both;"></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//---------------------------------------------------- Executive Mansion
		var point = new GLatLng(39.796667,-89.650154);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Executive Mansion</strong><br />410 E. Jackson Street<br /><br /><img src="/img/page_photos/historic_homes/executive_mansion_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//-------------------------------------------------------- Edwards Place
		var point = new GLatLng(39.808437,-89.649897);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Edwards Place</strong><br />700 N. 4th Street<br /><br /><img src="/img/page_photos/historic_homes/edwards_place_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//------------------------------------------------------- Lincoln's Home
		var point = new GLatLng(39.797483,-89.644704);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Lincoln\'s Home</strong><br />426 S. 7th Street<br /><br /><img src="/img/page_photos/historic_homes/lincolns_home_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//--------------------------------------------------- Vachel Lindsay Home
		var point = new GLatLng(39.79582,-89.64988);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Vachel Lindsay Home</strong><br />603 S. 5th Street<br /><br /><img src="/img/page_photos/historic_homes/vachel_lindsay_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//----------------------------------------------------------- Iles House
		var point = new GLatLng(39.795587,-89.646152);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Iles House</strong><br />628 S 7th Street<br /><br /><img src="/img/page_photos/historic_homes/illes_house_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//----------------------------------------------------------- Brinkerhoff Home
		var point = new GLatLng(39.821293,-89.648781);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Brinkerhoff Home</strong><br />1500 N. 5th Street<br /><br /><img src="/img/page_photos/historic_homes/brinkerhoff_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//------------------------------------------------------- Pasfield House
		var point = new GLatLng(39.797112,-89.658973);
		var markerContent = '<div class="window" style="padding-bottom: 2em;"><strong>Pasfield House Inn</strong><br />525 S. Pasfield Street<br /><img src="/img/page_photos/historic_homes/pasfield_house_sm.jpg" alt="" width="210" height="140" /></div>';
							
		var marker = createMarker(point,markerContent)
		map.addOverlay(marker);
		
		//---------------------------------------------------- Old State Capitol
		var point = new GLatLng(39.800650,-89.64850);
		var markerContent = '<div class="window"><strong>Old State Capitol</strong></div>';
							
		var marker = createMarker(point,markerContent,oldCap)
		map.addOverlay(marker);
		
		//---------------------------------------------------- New State Capitol
		var point = new GLatLng(39.79800,-89.654840);
		var markerContent = '<div class="window"><strong>Illinois State Capitol</strong></div>';
							
		var marker = createMarker(point,markerContent,newCap)
		map.addOverlay(marker);
		
		//------------------------------------------ open info window by default
		marker.openInfoWindowHtml(markerContent);
		
		//----------------------------------------------------------- first loop
		var polyline = new GPolyline([
			new GLatLng(39.796200,-89.653502),//edwards & 2nd
			new GLatLng(39.796271,-89.657933),//edwards & VC
			new GLatLng(39.798505,-89.657933),//capitol & VC
			new GLatLng(39.798500,-89.657385),//capitol & college
			new GLatLng(39.79961,-89.657364),//monroe & college
			new GLatLng(39.800739,-89.656999),//adams & college
			new GLatLng(39.800673,-89.65333),//adams & 2nd
			new GLatLng(39.79950,-89.653330),//monroe & 2nd
			new GLatLng(39.79961,-89.657364),//monroe & college
		], "#0000ff", 5);
		map.addOverlay(polyline);
		
		//---------------------------------------------------------- second loop
		var polyline = new GPolyline([
			new GLatLng(39.79950,-89.653330),//monroe & 2nd
			new GLatLng(39.793947,-89.653502),//lawrence & 2nd
			new GLatLng(39.793864,-89.648050),//lawrence & 6th
			new GLatLng(39.798348,-89.647930),//capitol & 6th
			new GLatLng(39.798348,-89.650760),//capitol & 4th
			new GLatLng(39.8017800,-89.650670),//washington & 4th
			new GLatLng(39.8016350,-89.643560),//washington & 9th
			new GLatLng(39.8005410,-89.643575),//adams & 9th
			new GLatLng(39.800610,-89.647906),//adams & 6th
			new GLatLng(39.816275,-89.647534),//north grand & 6th
			new GLatLng(39.81613,-89.663603),//north grand & David Jones
			new GLatLng(39.819783,-89.663723),//oak ridge & David Jones
			new GLatLng(39.819806,-89.66356),//oak ridge
			new GLatLng(39.820078,-89.662862),//oak ridge
			new GLatLng(39.820214,-89.662672),//oak ridge
			new GLatLng(39.820448,-89.662162),//oak ridge
			new GLatLng(39.820448,-89.662162),//oak ridge
			new GLatLng(39.820959,-89.661376),//oak ridge
			new GLatLng(39.821017,-89.661258),//oak ridge Y
			new GLatLng(39.821075,-89.660915),//oak ridge
			new GLatLng(39.821064,-89.660735),//oak ridge
			new GLatLng(39.820935,-89.659805),//oak ridge
			new GLatLng(39.820933,-89.659595),//oak ridge T
			new GLatLng(39.820945,-89.659252),//oak ridge
			new GLatLng(39.821025,-89.658909),//oak ridge
			new GLatLng(39.821211,-89.658493),//oak ridge y
			new GLatLng(39.821514,-89.658152),//oak ridge
			new GLatLng(39.822072,-89.657865),//oak ridge
			new GLatLng(39.822072,-89.657865),//oak ridge
			new GLatLng(39.822202,-89.657688),//oak ridge
			new GLatLng(39.822263,-89.65742),//oak ridge n
			new GLatLng(39.821579,-89.657037),//oak ridge
			new GLatLng(39.821415,-89.656865),//oak ridge
			new GLatLng(39.821235,-89.656562),//oak ridge
			new GLatLng(39.821046,-89.65576),//oak ridge
			new GLatLng(39.821036,-89.655269),//oak ridge
			new GLatLng(39.820883,-89.654843),//oak ridge
			new GLatLng(39.82072,-89.654722),//oak ridge
			new GLatLng(39.820302,-89.654271),//oak ridge
			new GLatLng(39.820177,-89.654194),//oak ridge & monument
			new GLatLng(39.8162,-89.654169),//north grand & monument
		], "#0000ff", 5);
		map.addOverlay(polyline);
		
		//---------------------------------------------------------- third loop
		var polyline = new GPolyline([
			new GLatLng(39.794975,-89.653502),//cook & 2nd
			new GLatLng(39.794950,-89.649450),//cook & 5th
			new GLatLng(39.797220,-89.649430),//jackson & 5th
			new GLatLng(39.797220,-89.650800),//jackson & 4th
			new GLatLng(39.794950,-89.650875),//cook & 4th
			new GLatLng(39.794900,-89.646640),//cook & 7th
			new GLatLng(39.803935,-89.646302),//madison & 7th
			new GLatLng(39.804005,-89.649242),//madison & 5th
			new GLatLng(39.816262,-89.649226),//north grand & 5th
		], "#0000ff", 5);
		map.addOverlay(polyline);
		
		
		/*
		directions = new GDirections(map);
		directions.load("39.797054,-89.658608 to 39.794919,-89.645927");
		*/
	
	} else {
		//------------------------- just allow the html location info to display
	}
}
addEvent(window,'load',displayGMap);
addEvent(window,'unload',GUnload);
//]]>
