indexOf polyfill for <= IE8