There is no magic with namespace objects, nor will you necessarily have any issues if you use lots of global variables.
The main reason to use "namespace" objects is to reduce the potential for duplicate global variable names. A second reason is to group similar functions together for convenience, e.g:
// Object example (suggested best practice):
// DOM functions are under myLib.dom
myLib.dom.someDOMFunction0;
myLib.dom.someDOMFunction1;
// Utility functions are under myLib.util
myLib.util.someUtilityFunction0;
myLib.util.someUtilityFunction1;
Note that the above has practically the same chance of duplicates as similarly global variables:
// Global variable example:
myLib_dom_someDOMFunction0;
myLib_dom_someDOMFunction1;
myLib_util_someUtilityFunction0;
myLib_util_someUtilityFunction1;
Of course the former is generally preferred because it seen as easier to work with. I'm not advocating that you adopt the second approach (I use the first), just pointing out that while there is an issue with creating lots of global variables, so–called "global namespace pollution" is greatly overrated as a hazard.