/*!
 * escpro google maps locate - design for kindergarten bad abbach v1.4.2
 * http://escpro.de/
 */
    var map;
    var geocoder;

    function initialize() {
      map = new GMap2(document.getElementById("main2"));
      map.setCenter(new GLatLng(48.93330, 12.05000), 12);
      geocoder = new GClientGeocoder();
    }

    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
    map.clearOverlays();
    if (response && response.Status.code != 200) {
      alert("Unable to locate " + decodeURIComponent(response.name));
    } else {
      var place = response.Placemark[0];
      var point = new GLatLng(place.Point.coordinates[1],
                              place.Point.coordinates[0]);
      map.setCenter(point, 15);
      map.openInfoWindowHtml(point, "" + place.address
       + "<br><b>Kontakt:</b> " + place.population);
    }
  }


    // showLocation() is called when you click on the Search button
    // in the form.  It geocodes the address entered into the form
    // and adds a marker to the map at that location.
    function showLocation() {
      var address = document.forms[0].q.value;
      geocoder.getLocations(address, addAddressToMap);
    }

   // findLocation() is used to enter the sample addresses into the form.
    function findLocation(address) {
      document.forms[0].q.value = address;
      showLocation();
    }
