Thanks, Jan, that will be a great help. Especially when you have more than a couple hundred lines of code.
One problem with JavaScript is that everything outside a function is a global. So as web pages use more and more js (especially if you use outside libraries), it becomes important to "namespace" scripts to prevent conflicts. You can do that by putting all of your code into a single global variable with a name that is unlikely to be used by anyone else. By using a closure and returning the inner function, you can also mimic private and public methods and properties, which aren't part of the language. -- <http://forum.pspad.com/read.php?2,46586,46608> PSPad freeware editor http://www.pspad.com
