// JavaScript Document

// Create a directions object and register a map and DIV to hold the 
// resulting computed directions

    var map;
    var directionsPanel;
    var directions;

    function initialize() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(42.47199403157166, -71.74572765827179), 15);
	  map.openInfoWindow(map.getCenter(), "<style type=\"text/css\">.style1 {font-family: Verdana;}.style2 { text-align: center;margin-top: 3px;margin-bottom: 0;}.style3 {float: left; margin-top: 0;margin-bottom: 0;text-align: center;}.style5 {font-size: 10px;}.style6 {font-size: 10px;color: #0000FF;}.style7 {color: #0000FF;}.style8 {font-size: 15px;color: #0000FF;}</style><p style=\"width: 177px\" class=\"style3\"><span class=\"style1\"><span class=\"style8\"><strong>Peak Manufacturing</strong></span><p style=\"width: 177px\" class=\"style2\"><span class=\"style1\"><span class=\"style5\"><span class=\"style7\">271 Leominster Rd.<br></span></span><span class=\"style6\">Sterling, MA 01564</span></span><br></p>");
        map.addControl(new GLargeMapControl());
        var mapControl = new GMapTypeControl();
        map.addControl(mapControl);

    }
	function loadDirections(form) {
		directionsPanel = document.getElementById("route");
    	directions = new GDirections(map, directionsPanel);
    	directions.load("from: "+form.address.value+", "+form.city.value+", "+form.state.value+" "+form.zip.value+" to: 271 Leominster Rd, Sterling, MA 01564");
		directionsPanel2 = document.getElementById("route_print");
    	directions2 = new GDirections(map, directionsPanel2);
    	directions2.load("from: "+form.address.value+", "+form.city.value+", "+form.state.value+" "+form.zip.value+" to: 271 Leominster Rd, Sterling, MA 01564");
		document.getElementById("printer").style.visibility = "visible";
	}