Change indexOf to jquery.inArray to properly support IE8