// JavaScript Document

function toggleDisplay(obj, value){	
		if(obj.checked){		
			for (var i = 0; i < gSearchParams[value][0].length; i++) {
				gMap.addOverlay(gSearchParams[value][0][i].marker());
			}			
		} else {
			for (var i = 0; i < gSearchParams[value][0].length; i++) {
				gMap.removeOverlay(gSearchParams[value][0][i].marker());
			}
		}
	}
	
	      // A function to create the marker and set up the event window
      function createMarker(point,name,html,icontype) {
        // === create a marker with the requested icon ===
        var marker = new GMarker(point, gicons[icontype]);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
        htmls[i] = html;
        i++;
        return marker;
      }
	  
	  function toggleGroup(icontype) {
      for (var i = 0; i < markerGroups[icontype].length; i++) {
        var marker = markerGroups[icontype][i];
        if (marker.isHidden()) {
          marker.show();
        } else {
          marker.hide();
        }
      } 
    }
	
	

      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }