var map;
var gdir;
var geocoder = null;
var addressMarker;

function initialize() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map_canvas2"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.enableScrollWheelZoom();
    map.setCenter(new GLatLng(52.0930076, 5.1652221), 7);
  }
}

function setLocatie(locAddress) {
  GetAddFrame(locAddress);
  geocoder = new GClientGeocoder();
  geocoder.getLatLng(
  locAddress + " nl",
  function(point) {
    if (!point) {
      alert("Adress kan niet gevonden worden. De oorzaak kan zijn dat het adres nieuw is, of dat het adres niet correct is.");
    } else {
      mapfound = 1;
      map.setCenter(point, 15);
      var marker = new GMarker(point);
      map.addOverlay(marker);
    }
  }
  );
}

function addressinfo() {
  alert('Vul het adres zo compleet mogelijk in. Bijvoorbeeld\n\nSpuistraat 10, 1012TS Amsterdam');
}
