Custom JavaScript function

What is the best way to add a custom function, that can be used from different sections? I tried adding functions, but they don't seem to be available outside of the section.
I can edit the manually, but it seems wrong and will turn the debugging into torture.

I have found some kind of a solution.
Using the window object seems to work just fine.

I tend to forget about Javascripts rule that everything is mutable.

Is there a better way?

I think we were talking about this on an earlier thread (how to place your functions so they are available for all sections. Tell me if this helps:

This topic is now closed. Topics are closed after 60 days of inactivity.