indexOf replace with jQuery inArray to avoid issues with older versions of IE