var map = null;
var geocoder = null;
var directions = null;
var directionsPanel = null;

function initialize_map(address) {
  map = new GMap2(document.getElementById("map_canvas"));
  map.addControl(new GSmallMapControl());
  map.addControl(new GMapTypeControl());
  geocoder = new GClientGeocoder();
  directionsPanel = document.getElementById("directions");

  showAddress(address); 
}

function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(address,function(point) {
        if (!point) {
            alert(address + " not found");
        } 
        else {
            map.setCenter(point, 13);
            map.addOverlay(new GMarker(point));
        }
    });
  }
}

function getDirections(start, end) {    		  	
   		map.clearOverlays();  	    	   		
     	directions = new GDirections(map, directionsPanel);      	      	
     	directions.load("from: " + start + " to: " + end);
   }


