use a closure to fix $ in global scope not always being jquery