HTML5 Canvas
Basic example - loading an image using canvas
Drawing using mousedown-mousemove-mouseup
Drawing and maintaining rectangles
As above, PLUS storing into a DB using Ajax