code: function updateSortFunction() {
    switch(sortBy.value) {
      case '0': // receiverId increasing
        sortFunction = function(tr1, tr2) {
          if(tr1.getElementsByTagName('td')[0].textContent <
             tr2.getElementsByTagName('td')[0].textContent) {
            return -1;
          };
          return 1;
        }
        break;
      case '1': // receiverId decreasing
        sortFunction = function(tr1, tr2) {
          if(tr1.getElementsByTagName('td')[0].textContent >
             tr2.getElementsByTagName('td')[0].textContent) {
            return -1;
          };
          return 1;
        }
        break;
    }
    sortReceiversAndHighlight();
  }
docs: Update the sort function based on the user selection