Grid selector. ideas?

I’ve attached a grid that I want to build. I want to be able to select each tiny block, and submit the selected results to the server via POST/jQuery.

I want to be able to click each mini block individually, or click the yellow circle and it selects all 16 mini blocks around it, or click a blue circle and it selects the 4 mini blocks around it.

Any ideas on how to go about building this?

I would send the x/y coords of where is clicked on the image, so that the server can handle mapping that to whichever section was clicked on.