Added function called firstAncestorOfType() to get parent recursively(ancestor) of a given type.
p4#: 21416