      
    var map;
    var mapname;
    var map1 = new GGeoXml("http://www.lmsd.org/media/maps/es.kml");
    var map2 = new GGeoXml("http://www.lmsd.org/media/maps/ms.kml");
    var map3 = new GGeoXml("http://www.lmsd.org/media/maps/hs.kml");
	var map4 = new GGeoXml("http://www.lmsd.org/media/maps/buildings.kml");
	
	function initialize() {
	  if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas")); 
		map.setCenter(new GLatLng(40.00904,-75.28300), 13); 
		map.addControl(new GSmallMapControl());
		//map.addControl(new GMapTypeControl());
		geocoder = new GClientGeocoder();
		map.addOverlay(map4);
	  }	
	  return true;
	} 

function removeSchoolMaps(){

// remove all school overlays
  map.removeOverlay(map1);
  map.removeOverlay(map2);
  map.removeOverlay(map3);

return false;

}

function toggleMyKml(mapname) {

removeSchoolMaps();

// evaluate browser for hiding div layers
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}

  
// hide all key div layers
 
  
  // add selected overlay and display associated key
  var newMap = document.MapChoice.selectMap.selectedIndex
  
  if (newMap == 0) {   
    map.addOverlay(map4);
    return true;
  }
  
  if (newMap == 1) {
    map.addOverlay(map1);
	map.addOverlay(map4);
    return true;
  }
  
  if (newMap == 2) {
    map.addOverlay(map2);
	map.addOverlay(map4);
    return true;
  }
  
  if (newMap == 3) {
    map.addOverlay(map3);
	map.addOverlay(map4);
    return true;
  }
  
}

function changeAddress() {
var theStreet = document.findAdd.address.value
document.findAdd.address.value = theStreet
}

function showAddress() {
      
      changeAddress();
      var theStreet = document.findAdd.address.value
      var theAddress = theStreet
      
      // geocode address
      if (geocoder) {
        geocoder.getLatLng(
          theAddress,
          function(point) {
            if (!point) {
              alert("Your entry of: " + theAddress + " was not found, please double check the address or try the external map links below.");
            } else {
              map.setCenter(point, 12);
              var marker = new GMarker(point);
              GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml("Your Address: " + theAddress);
  });
              map.addOverlay(marker);
              marker.openInfoWindowHtml("Your Address: " + theAddress);
            }
          }
        );
      }
    }
    
function launchGoogle(theMap) {
	if (document.findAdd.address.value == null | document.findAdd.address.value == "") {
	var theAddress = ""
	}else{
      var theStreet = document.findAdd.address.value
      var theAddress = theStreet
      }
      var theURL = theMap + "&q=" + theAddress
      window.open(theURL,'Google')
      return false;
}
    
//-->

