javascript for drawing