Simple drawing script using javascript