Replace native indexOf for IE8 compat.