cleaner isJquery check. fixes a bug in IE8, where the alternate (second) definition was always used
cleanup