use $.isWindow and $.isFunction