function Leg( map, marker, points, message, endCallback ) {
  this.map = map;
  this.marker = marker;
  this.points = [this.marker.getPoint()].concat( points );
  this.message = document.getElementById( message );
  this.endCallback = endCallback;

  this.run = function run() {
    this.currentPoint = 0;
    Effect.SlideDown( this.message );
    this.nextLine();
  };

  this.pauseButton = function pauseButton() {
    this.line.pauseButton();
  }
  
  this.nextLine = function nextLine() {
    if ( this.currentPoint+1 < this.points.length ) {
      var self = this;
      this.line = new Line(
        map,
        this.marker,
        this.points[ ++this.currentPoint ],
        0.000015,
        function() { self.nextLine(); }
      );
      this.line.run();
    } else {
      Effect.Fade( this.message );
      this.endCallback();
    }
  }
}

