In my first .js file I have a global var with name
Aside from that, consider scoping your variables. For example, pass them as function parameters or if you really need, attach them to ONE global object or the DOM (e.g. as attribute to
document). A common approach is also storing data at the objects in question on the DOM. Consider the data() technique, which is a standard and well supported by jQuery.