Debugging JavaScript can be a huge pain. I have used Firebug and that helps. IE 8 Beta has a JS debugger that is not so great... I believe VS 2008 will have a good one but I have to give that a try.
For a lot of JS work I do now a days I use
JQuery. It really cuts down on how many lines it takes to do stuff.
Good luck