How to Debug java Script Error Using Firebug?
How can I set breakpoints in an external JS script in Firebug
you can put breakpoints in the code, and wait for the execution to hit them. Then you can walk in the code, and use watches to know the values of variables.