    var map;
    var gdir;
    var geocoder = null;
    var addressMarker;

    function initialize() {
      if (GBrowserIsCompatible()) {      
        var map2 = new GMap2(document.getElementById('mapbox'))
        map2.setCenter(new GLatLng(50.954644, -0.143063), 14);
        map2.addControl(new GSmallMapControl());
        map2.addControl(new GMapTypeControl());

		
		
		// This icon is a different shape, so we need our own settings       
		var previewIcon = new GIcon();
		previewIcon.image = '/style/images/maplink.png';
		previewIcon.shadow = '';
		previewIcon.iconSize = new GSize(165, 65);
		previewIcon.shadowSize = new GSize(36, 34);
		previewIcon.iconAnchor = new GPoint(15, 65);
		previewIcon.infoWindowAnchor = new GPoint(5, 2);
		previewIcon.infoShadowAnchor = new GPoint(14, 25);
		previewIcon.transparent = 'previewtran.png';
		previewIcon.printImage = 'previewie.gif';
		previewIcon.mozPrintImage = 'previewff.gif';		
		

		var location2 = new GLatLng(50.954642, -0.143061);
		var marker2 = new GMarker(location2, previewIcon);
		map2.addOverlay(marker2);
	
		
        gdir = new GDirections(map, document.getElementById('directions'));
        GEvent.addListener(gdir, 'load', onGDirectionsLoad);
        //GEvent.addListener(gdir, 'error', handleErrors);

        setDirections('', 'Burgess Hill', 'en_GB');
      }
    }
    
    function setDirections(fromAddress, toAddress, locale) {
      gdir.load('from: ' + fromAddress + ' to: ' + toAddress,
                { 'locale': locale });
    }


	function onGDirectionsLoad(){ 
      // Use this function to access information about the latest load()
      // results.

      // e.g.
      // document.getElementById('getStatus').innerHTML = gdir.getStatus().code;
	  // and yada yada yada...
	}
