Variável static : função que retorna o total de checkbox selecionados.
<script type="text/javascript" language="JavaScript">
function soma(valor, check) {
if ( typeof soma.total == 'undefined' ) {
soma.total = 0;
}
if (check.checked == true){
soma.total += valor;
} else {
soma.total -= valor;
}
alert(soma.total);
}
</script>