	  var map = null;
      var geocoder = null;

      // this variable will collect the html which will eventualkly be placed in the side_bar
      var side_bar_html = "Show: ";
    
      // arrays to hold copies of the markers and html used by the side_bar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var htmls = [];
	  // ===== Start with an empty GLatLngBounds object =====     
      var bounds = new GLatLngBounds();

function setMultipleMarkers(lats, lons, info) {
		map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		for (var i = 0; i<lons.length; ++i) {
			createMarker(i, lats[i], lons[i], info[i]);
		};
		
		
	// put the assembled side_bar_html contents into the side_bar div
      document.getElementById("side_bar").innerHTML = side_bar_html;
      
      // ===== determine the zoom level from the bounds =====
          map.setZoom(map.getBoundsZoomLevel(bounds));

          // ===== determine the centre from the bounds ======
          var clat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2;
          var clng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2;
          map.setCenter(new GLatLng(clat,clng));
    }
    


function createMarker(num, lat, lon, info) {
		var point = new GLatLng(lat,lon);
        map.setCenter(point, 13);
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(info);
			});
        // ==== Each time a point is found, extent the bounds ato include it =====
            bounds.extend(point);        
        
        // save the info we need to use later for the side_bar
        gmarkers[num] = marker;
        htmls[num] = info;
        // add to the show list
        if (side_bar_html != "Show: ") {
			side_bar_html += ", "
			}
        side_bar_html += '<a href="javascript:myclick(' + num + ')">#' + (num+1) + '</a>';
       
        map.addOverlay(marker);
        }
       
       
      //listens for sidebar click 
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }