code: function(newNode) {
          // If the node is known to the indexer, remove it so we can
          // recalculate where it should go.
          if (this.exists(newNode)) {
              this.remove(newNode);
          }
          
          var nodeId = newNode.id;
          
          this.determineZIndex(newNode);       
  
          var leftIndex = -1;
          var rightIndex = this.order.length;
          var middle;
  
          while (rightIndex - leftIndex > 1) {
              middle = parseInt((leftIndex + rightIndex) / 2);
              
              var placement = this.compare(this, newNode,
                  OpenLayers.Util.getElement(this.order[middle]));
              
              if (placement > 0) {
                  leftIndex = middle;
              } else {
                  rightIndex = middle;
              } 
          }
          
          this.order.splice(rightIndex, 0, nodeId);
          this.indices[nodeId] = this.getZIndex(newNode);
          
          // If the new node should be before another in the index
          // order, return the node before which we have to insert the new one;
          // else, return null to indicate that the new node can be appended.
          return this.getNextElement(rightIndex);
      }
docs: APIMethod: insert
  Insert a new node into the indexer. In order to find the correct
  positioning for the node to be inserted, this method uses a binary
  search. This makes inserting O(log(n)).
  
  Parameters:
  newNode - {DOMElement} The new node to be inserted.
  
  Returns
  {DOMElement} the node before which we should insert our newNode, or
  null if newNode can just be appended.