anchor.diff:        var range_from = max_height;
         var range_to = 0;
         
  +      // Clone Function
  +      function clone(obj) {
  +        if (null == obj || "object" != typeof obj) return obj;
  +        var copy = obj.constructor();
  +        for (var attr in obj) {
  +          if (obj.hasOwnProperty(attr)) copy[attr] = clone(obj[attr]);
  +        }
  +        return copy;
  +      }
  +
         $('#toggle_multi').click(function(e) {
           e.preventDefault();
           $('#single-chart').hide();
  
positive.code: 
        function set_chart_data() {
  
          var dist_data = [];
          var elev_data = [];
          var heights_data = [];
          var h_speed = [];
          var v_speed = [];
          var gr = [];
  
          var avg_h_speed = 0;
          var avg_v_speed = 0;
          var avg_gr = 0;
  
          var min_h_speed = 0;
          var max_h_speed = 0;
  
          var min_v_speed = 0;
          var max_v_speed = 0;
  
          var min_gr = 0;
          var max_gr = 0;
  
          var fl_time = 1;
          var dist = 0;
          var elev = 0;
  
          max_val = typeof range_from !== 'undefined' ? range_from : 100000;
          min_val = typeof range_to !== 'undefined' ? range_to : 0;
  
          for (var index in charts_data) {
  
            if (charts_data[index].elevation < max_val && charts_data[index].elevation > min_val) {
              dist += charts_data[index].distance;
              elev += charts_data[index].elevation_diff;
  
              elev_data.push([fl_time, elev]);
              dist_data.push([fl_time, dist]);
  
              heights_data.push([fl_time, charts_data[index].elevation]);
              h_speed.push([fl_time, charts_data[index].h_speed]);
              v_speed.push([fl_time, charts_data[index].v_speed]);
  
              gr.push([fl_time, charts_data[index].glrat]);
  
              fl_time += charts_data[index].fl_time;
  
              min_h_speed = min_h_speed == 0 || min_h_speed > charts_data[index].h_speed ? charts_data[index].h_speed : min_h_speed;
              max_h_speed = max_h_speed == 0 || max_h_speed < charts_data[index].h_speed ? charts_data[index].h_speed : max_h_speed;
  
              min_v_speed = min_v_speed == 0 || min_v_speed > charts_data[index].v_speed ? charts_data[index].v_speed : min_v_speed;
              max_v_speed = max_v_speed == 0 || max_v_speed < charts_data[index].v_speed ? charts_data[index].v_speed : max_v_speed;
              
              min_gr = min_gr == 0 || min_gr > charts_data[index].glrat ? charts_data[index].glrat : min_gr;
              max_gr = max_gr == 0 || max_gr < charts_data[index].glrat ? charts_data[index].glrat : max_gr;
  
            }
          };
   
          var ed_chart = $('#elevation_distance_chart').highcharts();
          ed_chart.series[0].setData(elev_data);
  
negative.code: 
          $('#p_min_gr').text(min_gr.toFixed(2).toString() + '...');
          $('#p_max_gr').text('...' + max_gr.toFixed(2).toString());
          $('#p_avg_gr').text((dist / elev).toFixed(2).toString());
  
        };
        
  