
    //<![CDATA[
  if (GBrowserIsCompatible()) {
    
      var vactik_icon = new GIcon(); 
		  vactik_icon.iconSize 	= new GSize(72, 40);
		  vactik_icon.iconAnchor = new GPoint(31, 3);
		  vactik_icon.infoWindowAnchor = new GPoint(5, 1);
		  
	 // var info_icon = new GIcon();
       //   info_icon.iconSize=new GSize(71,29);
      //    info_icon.iconAnchor=new GPoint(33,23);
       //   info_icon.infoWindowAnchor=new GPoint(16,0);
	  
          
      var vactik = new GIcon(vactik_icon, "http://www.vactik.nl/img/google.png", null, null);
      //var infobalie   = new GIcon(info_icon, "http://www.vactik.nl/img/google_infobalie.png", null, null);
      function createMarker(point,html,icon) {
        var marker = new GMarker(point,icon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        return marker;
      }

      // Display the map, with some controls and set the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(52.14173246893049, 5.031791925430298), 15);
    	  map.setMapType(G_HYBRID_MAP); 
	    	
	
      // Set up three markers with info windows 
      var point = new GLatLng(52.14149543000338, 5.031652450561523);
      //var marker = createMarker(point,'<center><img src="img/google_gatewayc.jpg"></center>', vactik)
	  var marker = createMarker(point,null, vactik)
      map.addOverlay(marker);

      //var point = new GLatLng(52.23608,5.172257);
      //var marker = createMarker(point,'<center><img src="img/google_infobalie.jpg"></center>', infobalie)
      //map.addOverlay(marker);

 ///
   // ===== opvragen route =====
      function getDirections() {
        var saddr = document.getElementById("saddr").value
        var daddr = document.getElementById("daddr").value
        gdir.load("from: "+saddr+" to: "+daddr);
		 
      }


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

      // functions that open the directions forms
      function tohere(i) {
        gmarkers[i].openInfoWindowHtml(to_htmls[i]);
      }
      function fromhere(i) {

        gmarkers[i].openInfoWindowHtml(from_htmls[i]);
      }

	  

      // === create a GDirections Object ===
      var gdir=new GDirections(map, document.getElementById("directions"));

      // === Array for decoding the failure codes ===
      var reasons=[];
      reasons[G_GEO_SUCCESS]            = "Success";
      reasons[G_GEO_MISSING_ADDRESS]    = "Geen adres: Er is geen adres ingevoerd.";
      reasons[G_GEO_UNKNOWN_ADDRESS]    = "Onbekend adres:  Het adres kon niet gevonden worden";
      reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";
      reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
      reasons[G_GEO_TOO_MANY_QUERIES]   = "Too Many Queries: The daily geocoding quota for this site has been exceeded.";
      reasons[G_GEO_SERVER_ERROR]       = "Server error: The geocoding request could not be successfully processed.";
      reasons[G_GEO_BAD_REQUEST]        = "A directions request could not be successfully parsed.";
      reasons[G_GEO_MISSING_QUERY]      = "No query was specified in the input.";
      reasons[G_GEO_UNKNOWN_DIRECTIONS] = "De routeberekening kan om technische redenen niet worden uitgevoerd";

      // === catch Directions errors ===
      GEvent.addListener(gdir, "error", function() {
        var code = gdir.getStatus().code;
        var reason="Code "+code;
        if (reasons[code]) {
          reason = reasons[code]
        } 

        alert("De route is niet berekend. "+reason);
		
      });


 ///

    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }


    //]]>
