code: function (nodeA, nodeB) {
              var ancestors = listAncestor(nodeA);
              for (var n = nodeB; n; n = n.parentNode) {
                  if ($.inArray(n, ancestors) > -1) { return n; }
              }
              return null; // difference document area
          }
docs: returns common ancestor node between two nodes.
  
  @param {Node} nodeA
  @param {Node} nodeB