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, and it includes all parents if it 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 ssetScopeStart and setScopeEnd methods of the SEEvalParams class as described above. This method is rarely used because functions are usually called from within a script.