Is that IF statement helping you be cross-browser?

Why not use jQuery for that - it's really helpful in that regard.