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

TripPlanner = Class.create({
  initialize : function(waypoints) {
    this.waypoints        = waypoints;
    this.canvas           = $('map_canvas');
    this.directions_panel = $('directions_text');
    this.geocoder         = new GClientGeocoder();
    this.map              = new GMap2(this.canvas);
    this.directions       = new GDirections(this.map, this.directions_panel);
    this.map.setCenter(new google.maps.LatLng(35.625693,-82.5558), 10);
    this.directions.loadFromWaypoints(waypoints);
  },
});

TripPlanner.added = function(link) {
  $(link).removeClassName('add');
  $(link).addClassName('remove');
  $(link).writeAttribute('onclick', $(link).readAttribute('onclick').replace('\/itinerary\/add', '/itinerary/remove').replace('TripPlanner\.added', 'TripPlanner.removed'));
};

TripPlanner.removed = function(link, to_remove) {
  $(link).removeClassName('remove');
  $(link).addClassName('add');
  $(link).writeAttribute('onclick', $(link).readAttribute('onclick').replace('\/itinerary\/remove', '/itinerary/add').replace('TripPlanner\.added', 'TripPlanner.removed'));
  if ($(to_remove)) { Effect.BlindUp(to_remove); }
};