custom indexof to make up for ie7/ie8