use jQuery's inArray instead of Array's built-in indexOf