IMHO all the variables and functions should be wrapped in the document.ready to prevent polluting global.
IMHO all the variables and functions should be wrapped in the document.ready to prevent polluting global.