sergylt,
<form name="form" action="http://">
<fieldset class="checkbox_buy1">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
</fieldset>
<fieldset class="checkbox_buy1">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
<input class="chek" type="checkbox">
</fieldset>
<div class="rezultat"></div>
</form>
<script>
window.addEventListener("DOMContentLoaded", function() {
var a = document.querySelector("form"),
b = document.querySelector(".rezultat");
a.addEventListener("change", function() {
b.innerHTML = "Total: " + [].reduce.call(a.querySelectorAll("fieldset"), function(a,b) {
var c = b.querySelectorAll(":checked").length;
return a + (c > 5 ? (c - 5)*5 + 50 : c * 10)
}, 0)
})
});
</script>