

var map, marker;

function addExtMarker() {
		var point = new GPoint(-89.397791, 43.074125);
		var marker = new GMarker(point);
		map.addOverlay(marker);
		GEvent.addListener(marker, 'click', function() {
			marker.openInfoWindowHtml("<strong>University of Wisconsin-Extension</strong><br />432 N. Lake St.,<br />Madison, WI 53716");
	      });
	}

onload = function() {
	
	map = new GMap(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.disableDragging();
	
	// coordinates, in degrees, from google earth
	map.centerAndZoom(new GPoint(-89.397791, 43.074125), 2);
	
	addExtMarker();
}


function plotMinneapolis() {
	map.clearOverlays();

	var points = [];
	points.push(new GPoint(-89.296072, 43.137439));
	points.push(new GPoint(-89.338744, 43.107263));
	points.push(new GPoint(-89.382305, 43.076118));
	points.push(new GPoint(-89.384313, 43.077478))
	
	//points.push(new GPoint(-89.383243, 43.075439));
	//points.push(new GPoint(-89.381011, 43.073555));
	points.push(new GPoint(-89.386317, 43.076185));
	points.push(new GPoint(-89.388085, 43.077447));
	points.push(new GPoint(-89.394295, 43.073175));
	points.push(new GPoint(-89.397624, 43.073188));
	points.push(new GPoint(-89.397597, 43.074132));
	
	map.addOverlay(new GPolyline(points));
	
	
	addExtMarker();
	
	map.centerAndZoom(new GPoint(-89.375386, 43.081087), 6);
	
	document.getElementById('map').scrollIntoView();
	
	return false;
}

function plotMilwaukee() {
	map.clearOverlays();
	var points = [];
	points.push(new GPoint(-89.285797, 43.104097));
	points.push(new GPoint(-89.305652, 43.106190));
	points.push(new GPoint(-89.339067, 43.107211));
	points.push(new GPoint(-89.382305, 43.076118));
	points.push(new GPoint(-89.384313, 43.077478));
	
	//points.push(new GPoint(-89.383243, 43.075439));
	//points.push(new GPoint(-89.381011, 43.073555));
	points.push(new GPoint(-89.386317, 43.076185));
	points.push(new GPoint(-89.388085, 43.077447));
	points.push(new GPoint(-89.394295, 43.073175));
	points.push(new GPoint(-89.397624, 43.073188));
	points.push(new GPoint(-89.397597, 43.074132));
	
	map.addOverlay(new GPolyline(points));
	
	addExtMarker();
	
	map.centerAndZoom(new GPoint(-89.375386, 43.081087), 6);
	
	document.getElementById('map').scrollIntoView();
	return false;
}

function plotChicago() {
	map.clearOverlays();
	var points = [];
	points.push(new GPoint(-89.276102, 43.047841));
	points.push(new GPoint(-89.370639, 43.043324));
	points.push(new GPoint(-89.393545, 43.037340));
	points.push(new GPoint(-89.392489, 43.052801));
	points.push(new GPoint(-89.398375, 43.062830));
	
	//points.push(new GPoint(-89.383243, 43.075439));
	//points.push(new GPoint(-89.381011, 43.073555));
	points.push(new GPoint(-89.400970, 43.072079));
	points.push(new GPoint(-89.397640, 43.072006));
	points.push(new GPoint(-89.397597, 43.074132));
	
	map.addOverlay(new GPolyline(points));
	
	addExtMarker();
	
	map.centerAndZoom(new GPoint(-89.375386, 43.081087), 6);
	
	document.getElementById('map').scrollIntoView();
	return false;
}

function plotDubuque() {
	map.clearOverlays();
	var points = [];
	points.push(new GPoint(-89.452760, 43.036514));
	points.push(new GPoint(-89.450861, 43.038805));
	points.push(new GPoint(-89.451071, 43.075143));
	points.push(new GPoint(-89.439316, 43.074732));
	points.push(new GPoint(-89.430996, 43.072989));
	
	//points.push(new GPoint(-89.383243, 43.075439));
	//points.push(new GPoint(-89.381011, 43.073555));
	points.push(new GPoint(-89.414369, 43.074165));
	points.push(new GPoint(-89.407532, 43.072175));
	points.push(new GPoint(-89.397644, 43.072004));
	points.push(new GPoint(-89.397597, 43.074132));
	
	map.addOverlay(new GPolyline(points));
	
	addExtMarker();
	
	map.centerAndZoom(new GPoint(-89.375386, 43.081087), 6);
	
	document.getElementById('map').scrollIntoView();
	return false;
}
