Source: checkboxen.js

/**
 * Handles the event of check status changes of the year checkboxes
 * @param e element that triggered the event
 */
function changeYear(e) {
    if (e.target.checked) {
        filter.year.push(parseInt(e.target.value));
    } else {
        var index = filter.year.indexOf(parseInt(e.target.value));
        if (index > -1) {
            filter.year.splice(index, 1);
        }
    }
    filter.year.sort();
    updateYearTable();
}

/**
 * Handles the event of check status changes of the Begegnung checkboxes
 * @param e element that triggered the event
 */
function changeBegegnung(e) {
    if (e.target.checked == false && filter.begegnung.length == 1) {
        filter.begegnung = [];
        document.getElementById('tablebegegnungen').innerHTML = "";
    } else {
        if (e.target.checked) {
            filter.begegnung.push(parseInt(e.target.value));
        } else {
            var index = filter.begegnung.indexOf(parseInt(e.target.value));
            if (index > -1) {
                filter.begegnung.splice(index, 1);
            }
        }
        filter.begegnung.sort();
        updateBegegnungTable();
    }
}

/**
 * Handles the event of check status changes of the fighter checkboxes
 * @param e element that triggered the event
 */
function changeKaempferFilter(e) {
    if (e.target.checked == false &&
        $('#filterKaempfer1')[0].checked == false && $('#filterKaempfer2')[0].checked == false &&
        $('#filterKaempfer3')[0].checked == false && $('#filterKaempfer4')[0].checked == false &&
        $('#filterKaempfer5')[0].checked == false && $('#filterKaempfer6')[0].checked == false) {
        e.target.checked = true;
        alert("Zumindest eine Kämpfergruppe muss ausgewählt sein.");
    } else {
        if (e.target.checked) {
            filter.kaempfer.push(e.target.value);
        } else {
            var index = filter.kaempfer.indexOf(e.target.value);
            if (index > -1) {
                filter.kaempfer.splice(index, 1);
            }
        }
        update();
        /*
        var lizenz = e.target.value.indexOf("Lizenz");
        var arrayvalue;
        if (lizenz < 0) {
            arrayvalue = 0;
        } else {
            arrayvalue = 1;
        }

        var heim = e.target.value.indexOf("Eigen");
        if (heim < 0) {
            if (e.target.checked) {
                filter.kaempferAuswaerts.push(arrayvalue);
            } else {
                var index = filter.kaempferAuswaerts.indexOf(arrayvalue);
                if (index > -1) {
                    filter.kaempferAuswaerts.splice(index, 1);
                }
            }
        } else {
            if (e.target.checked) {
                filter.kaempferHeim.push(arrayvalue);
            } else {
                var index = filter.kaempferHeim.indexOf(arrayvalue);
                if (index > -1) {
                    filter.kaempferHeim.splice(index, 1);
                }
            }
        }
        */
    }
}