<!--
    //<![CDATA[
	var gmarkers = [];
	var htmls = [];
	var to_htmls = [];
	var from_htmls = [];
	var i=0;
	// A function to create the marker and set up the event window
	function createMarker(point,name,html) {
		var marker = new GMarker(point);
		var spacer = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		// The info window version with the "to here" form open
		to_htmls[i] = html + '<br />Directions: <b>To here</b> - ' +
					'<a href="javascript:fromhere(' + i + ')">From here</a><br>Start address:' + 
					'<input style="font-family:Arial;" type="text" SIZE=20 MAXLENGTH=400 name="address" id="address" value="" /><br />' +
					spacer+'<INPUT style="font-family:Arial;font-size:10px;" value="Get Directions" TYPE="SUBMIT" onclick="getDirections(0)">'
		// The info window version with the "to here" form open
		from_htmls[i] = html + '<br />Directions: <a href="javascript:tohere(' + i + ')">To here</a>' +
					' - <b>From here</b><br>End address:<input style="font-family:Arial;" type="text" SIZE=20 MAXLENGTH=400 name="address" id="address" value="" />' + 
					'<br />'+spacer+'<INPUT style="font-family:Arial;font-size:10px;" value="Get Directions" TYPE="SUBMIT" onclick="getDirections(1)">'
		// The inactive version of the direction info
		html = html + '<br />Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>';
		GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
		gmarkers[i] = marker;
		htmls[i] = html;
		i++;
		return marker;
	}
	function getDirections(toOrFrom) {
		var address = document.getElementById("address").value;
		var url;
		if(toOrFrom==1){
			url = 'http://maps.google.com/maps?daddr='+address+'&saddr=27 North Bennett, Geneva, IL 60134';
		}
		if(toOrFrom==0){
			url = 'http://maps.google.com/maps?saddr='+address+'&daddr=27 North Bennett, Geneva, IL 60134';
		}
		openMe(url);
	}
	function openMe(url){
		window.open(url, 'directions', 'top = 100,left = 100,width = 770, height = 600,status = 1, resizable = 1');
	}
	// functions that open the directions forms
	function tohere(i) {
		gmarkers[i].openInfoWindowHtml(to_htmls[i]);
	}
	function fromhere(i) {
		gmarkers[i].openInfoWindowHtml(from_htmls[i]);
	}
	function load() {
	  if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		var html = '<p style="font-family:Arial;font-size:12px;">27 North Bennett<br/>Geneva, IL 60134';
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		
		var point = new GLatLng(41.887556, -88.300146);
		var marker = createMarker(point,'theMarker',html);
		
		map.setCenter(point, 13);
		map.addOverlay(marker);
		gmarkers[0].openInfoWindowHtml(to_htmls[0]);
	  }
	}
	function tohere(i) {
		gmarkers[i].openInfoWindowHtml(to_htmls[i]);
	}
	function fromhere(i) {
		gmarkers[i].openInfoWindowHtml(from_htmls[i]);
	}
    //]]>
