Use jQuery inarray for safer indexOf