That's awesome you spend effort to use JS in as many browsers as possible. Most sites that must work in all browsers usually avoid JS altogether.
Have you thought about creating a library for this? It could be used for progressive enhancement on sites that would normally have no JS.