JavaScript function prototype (class) for drawing ellipses