SCOPING - FUNCTIONS
Functions are more complex. The normal behavior for a function is to search its local variables and parameters first. Next, the local variables and parameters of its parent function are searched. This only applies if the function is nested inside a parent function. All parents are searched if the function is nested several levels deep. Finally, the global variables are searched. Again, the user can modify this behavior using the with statement.
There are several methods for controlling the scope of functions. If you call the function directly using seEval, you can specify additions to the scope chain using the scopestart and scopeend members of the eval parameters structure. This method is rarely used because functions are usually called from within a script.