code: function handleReSort(link) {
      var classes = link.attr('class').split(/\s+/);
      for (var i=0; i<classes.length; i++) {
        if (classes[i] != 'sort-option') {
  	by = classes[i].substring(2);
        }
      }
      setComparator();
      // Save/update the sortBy cookie.
      var expiration = new Date();
      expiration.setDate(expiration.getDate() + 365);
      document.cookie= 'sortBy=' + escape(by) +
                       ';expires=' + expiration.toUTCString();
      $('ul.comment-ul').each(function(index, ul) {
        var comments = getChildren($(ul), true);
        comments = sortComments(comments);
        appendComments(comments, $(ul).empty());
      });
    }
docs: Handle when the user clicks on a sort by link.