JavaScript, and web browsers in general have never really made drawing vector graphics easy, although HTML5is beginning to change that.

The problem is that browsers still implement things differently.

Here Raphael steps in. It implements vector graphics in a cross bbrowser and easy manner.

The site also has some good examples on how to use it.