code: function selectIndex(idx){
  
      // If another item is currently selected, deselect it
      if(selectedItem) selectedItem.className = selectedItem.className.replace(/\s?selected/,'');
  
      // Grab the search results straight from the DOM
      var r = document.getElementById('searchresults');
      var items = r.childNodes;
  
      // If we actually have no items, there's not much we can do
      if(items.length === 0){
        selectedSearchIndex = -1;
        selectedItem = false;
        return;
      }
  
      // Store the item and its index in helper variables
      selectedSearchIndex = idx;
      var s = selectedItem = items[idx];
  
      // Select the item
      s.className += ' selected';
  
      // Figure out whether or not the item is fully visible inside
      // the scrollable view, and if not, then scroll appropriately
      var o = s.offsetTop - r.offsetTop - r.scrollTop;
      if(o < 0){
        r.scrollTop = s.offsetTop - r.offsetTop;
      }else if(o > r.offsetHeight - s.offsetHeight){
        r.scrollTop = o + r.scrollTop - r.offsetHeight + s.offsetHeight;
      }
    }
docs: ## selectIndex
  
  Selects the search result at the given index in the list,
  and deselcts any currently-selected item
  
  @param {number} idx Index of the item to select