Seems like regex's may be better future versions of IE (note the version numbers for Trident and .NET). But now that I think about it, the code will have to be revised for IE12 anyway whenever that comes out so I can change to use `indexOf`.

I had them on separate lines originally since I was thinking that they needed to be declared first before referencing them in a var chain. But it looks like var chains go from left to right separated by the comma.