Anybody know how to write a simple java script?

I am using the Mouse Gesture extension in Firefox and would like to add the gesture to "close all but the active tab. This would have to be entered as a custom gesture so I would need to paste the java script code into the extension. The process is simple enough and most of the gestures I use I had to do just that. The code for those gestures was posted on the extension's site for down loading but the one I want isn't there. Maybe not many people want that gesture but I do. Does anybody here know the code for that gesture?