De-jQuery-ified it. No need to have jQuery if it's not necessary. If you don't want the function on the global window, you can attach it to your own variable by giving the closure a different variable.