Use $.inArray instead of indexOf for IE8 compatibility.

Signed-off-by: Alexander Shorin <kxepal@apache.org>