
//variables
var map = null;
var geocoder = null;
var geoXML = null;
var cutLevel = 16;
var servicePolys = [];
var csoPoly = [];
//var separationPolys = [];

//load google map v2
function load() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    //SeparationAreas = new GGeoXml("http://mudpuddle.hdrinnovation.com/omaha/kml/Separation.kml");
    ServiceArea = new GGeoXml('http://mudpuddle.hdrinnovation.com/omaha/kml/Service_Simp.kml');
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(41.271702,-95.9701), 11);
    
    
    //map.addOverlay(ServiceArea);
    //map.addOverlay(SeparationAreas);
    loadCSO();
    loadService();
    //loadSeparation();
    
    geocoder = new GClientGeocoder();
	
  }
}

//geocoding function v2
function locate(address) {
  if (geocoder) {
    geocoder.getLatLng(
      address + " omaha, nebraska",
      function(point) {
        if (!point) {
          alert(address + " not found");
        } else {
          map.setCenter(point, 15);
        }
      }
    );
  }
}
  
//function for creating the marker v2
function createMarker(point, title, desc) {
    var marker = new GMarker(point, {title:title, icon:icon}); //'http://www.obdp.org/files/dashboard/locator/med_cone.png'});
    GEvent.addListener(marker, "click", function(){var myHtml = desc;map.openInfoWindow(point, myHtml);});
    
    return marker;
}

