switched contains to indexof for non-ff browsers.