function isDOMElement(obj) { return !!(obj && typeof window !== 'undefined' && (obj === window || obj.nodeType)); }