code: function is_ancestor(node, target)
  {
      while (target.parentNode) {
          target = target.parentNode;
          if (node == target)
              return true;
      }
      return false;
  }
docs: Returns true if a node is an ancestor node of a target node, and false
  otherwise.
  
  @param node    the node being compared to the target node
  @param target  the target node
  @return        true if node is an ancestor node of target, false otherwise.