use $.inArray instead of indexOf to support IE8