function rowLabelToIndex(label) {
  var result = parseInt(label, 10);

  if (isNaN(result)) {
    result = -1;
  } else {
    result = Math.max(result - 1, -1);
  }

  return result;
}
Convert row label to index.

@param {String} label Row label (eq. '1', '5')
@returns {Number} Returns -1 if label is not recognized otherwise proper row index.