Alright I just took a crack at it. I haven't tested it, so there could be a bug in it. I wasn't aware of the mail() method in javascript, but I guess it is just a custom function? Anyways, I think this is what you're looking for.

function whatever() {


for(x = 0; x < document.name_of_form.elements.length; x++) {
if (document.name_of_form.elements[x].type == 'checkbox') {
if (document.name_of_form.elements[x].value == 1) {
mail(document.name_of_form.elements[x].name);
}
}
}