Wrapped JS in anonymous function call, to prevent namespace clutter.