code: function(haystack, needle) {
              haystack = Y.Dom.get(haystack);
              needle = Y.Dom.get(needle);
              
              var ret = false;
  
              if ( (haystack && needle) && (haystack[NODE_TYPE] && needle[NODE_TYPE]) ) {
                  if (haystack.contains && haystack !== needle) { // contains returns true when equal
                      ret = haystack.contains(needle);
                  }
                  else if (haystack.compareDocumentPosition) { // gecko
                      ret = !!(haystack.compareDocumentPosition(needle) & 16);
                  }
              } else {
                  YAHOO.log('isAncestor failed; invalid input: ' + haystack + ',' + needle, 'error', 'Dom');
              }
              YAHOO.log('isAncestor(' + haystack + ',' + needle + ' returning ' + ret, 'info', 'Dom');
              return ret;
          }
docs: Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy.
  @method isAncestor
  @param {String | HTMLElement} haystack The possible ancestor
  @param {String | HTMLElement} needle The possible descendent
  @return {Boolean} Whether or not the haystack is an ancestor of needle