The quick 1,2,3,4 on creating a .js file is this:
1) Open a text editor, create a new document, and save it as 'whatever'.js
3) Import it into an HTML page like this: <script src="whatever.js"></script>
4) Call the functions you created from your HTML
Now, to the drawArc. I'm not really sure how this could be done. You cannot get a canvas to draw on in DHTML. I would be interested to know what other shapes you can draw. I can only think of how you could draw rectangles and squares.
If you have some .js files that draw other shapes, feel free to send them to me in a private message and I will take a look at them. If I can figure out how they are drawing other shapes, I may be able to figure something out for an arc.