context:   OSC.changeYZoom = function(direction, curr_scale, send_changes) {        // Output 1/2 signals do not have zoom    if($.inArray(OSC.state.sel_sig_name, ['ch1', 'ch2', 'math']) < 0) {      return;    }        var curr_scale = (curr_scale === undefined ? OSC.params.orig['OSC_' + OSC.state.sel_sig_name.toUpperCase() + '_SCALE'].value : curr_scale);    var new_scale;        for(var i=0; i < OSC.voltage_steps.length - 1; i++) {            if(OSC.state.fine && (curr_scale == OSC.voltage_steps[i]           || (curr_scale > OSC.voltage_steps[i] && curr_scale < OSC.voltage_steps[i + 1])          || (curr_scale == OSC.voltage_steps[i + 1] && direction == '-'))) {                new_scale = curr_scale + (OSC.voltage_steps[i + 1] / 100) * (direction == '-' ? -1 : 1);                // Do not allow values smaller than the lowest possible one        if(new_scale < OSC.voltage_steps[0]) {          new_scale = OSC.voltage_steps[0];        }                break;      }            if(!OSC.state.fine && curr_scale == OSC.voltage_steps[i]) {        new_scale = OSC.voltage_steps[direction == '-' ? (i > 0 ? i - 1 : 0) : i + 1];        break;      }      else if(!OSC.state.fine && ((curr_scale > OSC.voltage_steps[i] && curr_scale < OSC.voltage_steps[i + 1]) || (curr_scale == OSC.voltage_steps[i + 1] && i == OSC.voltage_steps.length - 2))) {        new_scale = OSC.voltage_steps[direction == '-' ? i : i + 1];        break;      }    }        if(new_scale !== undefined && new_scale > 0 && new_scale != curr_scale) {            // Fix float length      new_scale = parseFloat(new_scale.toFixed(OSC.state.fine ? 5 : 3));            if(send_changes !== false) {        OSC.params.local['OSC_' + OSC.state.sel_sig_name.toUpperCase() + '_SCALE'] = { value: new_scale };        OSC.sendParams();      }      return new_scale;    }        return null;  };
meta: 746	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/746/c17858188b9be66845a662a1df071f137ddaf272/scope.js/buggy/Applications/scope-new/js/scope.js