var map;
var directionsPanel;
var directions;
    function load() {
      if (GBrowserIsCompatible()) {
       map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());  
		directionsPanel = document.getElementById("directionss");

		directions = new GDirections(map, directionsPanel);


        map.setCenter(new GLatLng(40.41562,-90.946069), 13);
		var icon = new GIcon();
icon.image = "lamoine.png";
icon.iconSize = new GSize(30, 26);
icon.iconAnchor = new GPoint(15, 20);
icon.infoWindowAnchor = new GPoint(20, 17);

	var icona = new GIcon();
icona.image = "carthage.png";
icona.iconSize = new GSize(99, 51);
icona.iconAnchor = new GPoint(99, 51);
icona.infoWindowAnchor = new GPoint(99, 51);

var hwy = new GIcon();
hwy.image = "hwy61.png";
hwy.iconSize = new GSize(24, 16);
hwy.iconAnchor = new GPoint(12, 8);
hwy.infoWindowAnchor = new GPoint(24, 16);

var iconb = new GIcon();
iconb.image = "macomb.png";
iconb.iconSize = new GSize(99, 51);
iconb.iconAnchor = new GPoint(45, 51);
iconb.infoWindowAnchor = new GPoint(99, 1);

var iconc = new GIcon();
iconc.image = "uparrow.png";
iconc.iconSize = new GSize(30, 26);
iconc.iconAnchor = new GPoint(10, 26);
iconc.infoWindowAnchor = new GPoint(20, 1);

  var marker = new GMarker(new GLatLng(40.415195,-90.992117), icona);
  var markera = new GMarker(new GLatLng(40.415359,-90.944266), iconb);

  var markerb = new GMarker(new GLatLng(40.430485,-90.973063), icon);
  
    var markerc = new GMarker(new GLatLng(40.41526,-90.983233), iconc);
	
	  var markerhwy = new GMarker(new GLatLng(40.395259,-90.888266), hwy);


GEvent.addListener(markerc, "click", function() {
    markerc.openInfoWindow("Preferred Route - turn here!");
  });

 GEvent.addListener(markerb, "click", function() {
    markerb.openInfoWindowHtml("<img src=\"lamoine_big.png\" align=\"left\" style=\"margin-right: 5px;\"><div style=\"margin-left: 60px;\"><p><strong>LaMoine Christian Camp &amp; Retreat Center</strong><br />2760 E. County Rd 1600<br />Tennesse, IL 62374</p></div>");
  });
  mgr = new GMarkerManager(map);

mgr.addMarker(marker,12);
mgr.addMarker(markera,12);
mgr.addMarker(markerc,12);
mgr.addMarker(markerhwy,12);

map.addOverlay(markerb);
      }
    }


function doDirections() {
      if (GBrowserIsCompatible()) {
  directions.clear()
  directions.load(document.getElementById("start_addr").value+" to 40.430485,-90.973063");
GEvent.addListener(directions, "error", function() {
if(directions.getStatus().code == '602') {
alert('Google could not understand your address');
} else {
alert ('An unknown error has occurred.');
}
  directions.clear();

});

}
return false;
}