function countSummType() { var summType = 0; for (var i = 0; i < 12; i++) { var oneType = document.getElementById('summa_0_'+i); summType += +oneType.value || 0; }; return summType }