using $.inArray for IE compatibility