EDITABLE CODE:
LiveDemo: HTML5 Canvas Bezier Curve