code: function _isDescendant(elm, ancestor)
      {
          while ((elm = elm.parentNode) && elm != ancestor) { }
          return elm !== null;
      }
docs: determines if the passed element is a descentand of anthor element