//<![CDATA[

    var map;
    var geocoder;

    function load()
    {
      map = new GMap2(document.getElementById("map"));
	  map.addControl(new GSmallMapControl());
	  map.addControl(new GMapTypeControl());
	  map.setCenter(new GLatLng(37.4419, -122.1419), 16);
	  map.setMapType(G_NORMAL_MAP);
 	  geocoder = new GClientGeocoder();
    }

    function routebeschrijving()
	{
		document.forms.route.saddr.value = document.forms.form.postcode.value;
		document.forms.route.submit();
	}

    function addAddressToMap(response)
    {
      map.clearOverlays();
      if (!response || response.Status.code != 200)
      {
        alert("Sorry, we kunnen uw adres helaas niet geocoderen");
      }
      else
      {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
	  	map.setCenter(point, 14);
        marker = new GMarker(point);
        map.addOverlay(marker);
       	marker.openInfoWindowHtml('<div class="route"><b>Leferink</b><br />Vul hieronder uw postcode in om uw route naar<br /> ons pand te berekenen<br /><form action="javascript:routebeschrijving();" name=form><table cellspacing="0" cellpadding="0"><tr><td>Postcode: </td><td>&nbsp;<input type="text" class="postcode" name="postcode" value="" size="5" maxlength="6"></td><td>&nbsp;<input type="button" class="route" name="button" value="Toon Route" onclick="javascript:routebeschrijving();"></td></tr></table></form>');
      }
    }

   // findLocation() is used to enter the sample addresses into the form.
    function findLocation(address)
    {
	  geocoder.getLocations(address, addAddressToMap);
	}

    function rva()
    {
    	load();
    	findLocation("De Biezen 37, Papendrecht, Nederland");
    }
//]]>
