You should be able to just have one function handle all of the checkboxes if they are all basically doing the same thing but affecting a different layer.
Inside of your event handler function, the this keyword will be pointing to the checkbox that was clicked. You can use that to access the attributes of the checkbox (HTML input element). You can have a data-layer-id attribute, for example.