Added indexOf support for all browsers, and changed behaviour to properly use the new method.