Source: ajax.js

var fontsize;
var fontsizetimer = 100;

/**
 * Updates the data for the visualisation based on the modified filters
 */
function update() {
    updateYearTable();
    if(filter.yearBegegnung.length > 0) {
        updateBegegnungTable();
    } else {
        document.getElementById("tablebegegnungen").innerHTML = "";
    }
    fontsize = 22;
    updateSizeChangedStepless();
}

function updateSizeChangedStepless() {
    setTimeout(updateSizeChanged, 2000);
}

function updateSizeChanged() {
    /*
    if(fontsize > 16) {
        fontsize--;
        $(".changed").css('fontSize', fontsize + 'px');
        setTimeout(updateSizeChanged, fontsizetimer);
    }
    //*/
    $(".changed").css('fontSize', '16px');
}

/**
 * Updates the data for the year table based on the modified filters
 */
function updateYearTable() {
    var getparameter = "";

    filter.year.forEach(function (element) {
        getparameter += "year[]=" + element + "&"
    });

    getparameter += buildParameterKaempfer();

    console.log("ergebnis.php?" + getparameter);

    $.ajax({
        url: "ergebnis.php?" + getparameter,
        success: function (d) {
            var e = JSON.parse(d);
            datayearsOld = datayears;
            datayears = e;
            document.getElementById('tableyears').innerHTML = "";
            rendertable('tableyears');
        }
    });
}

/**
 * Updates the data for the detail table based on the modified filters
 */
function updateBegegnungTable() {
    if (filter.begegnung.length != 0) {
        var getparameter = "";

        filter.yearBegegnung.forEach(function (element) {
            getparameter += "year[]=" + element + "&"
        });
        filter.begegnung.forEach(function (element) {
            getparameter += "begegnung[]=" + element + "&"
        });

        getparameter += buildParameterKaempfer();

        $.ajax({
            url: "ergebnis.php?" + getparameter,
            success: function (d) {
                var e = JSON.parse(d);
                databegegnungenOld = databegegnungen;
                databegegnungen = e;
                document.getElementById('tablebegegnungen').innerHTML = "";
                rendertable('tablebegegnungen');
            }
        });
    }
}

/**
 * Composes the Get Parameters of the fighter filters
 * @returns {string}
 */
function buildParameterKaempfer() {
    var getparameter = "";
    filter.kaempfer.forEach(function (element) {
        getparameter += "filterKaempfer[]=" + element + "&"
    });
    return getparameter;
}

/**
 * Loads the data for the fighter tooltip box
 * @param clubName club name
 * @param firstYear left year of line in line chart
 * @param secondYear right year of line in line chart
 */
function loadFighters(clubName, firstYear, secondYear) {
    console.log("loadFighters"+clubName);
    var getparameter = "clubname="+clubName+"&year[]="+firstYear+"&year[]="+secondYear+"&";

    getparameter += buildParameterKaempfer();

    $.ajax({
        url: "ergebnisVergleichKaempfer.php?" + getparameter,
        success: function (d) {
            var e = JSON.parse(d);
            console.log(e);
            displayToolTipBoxfighters(e);
        }
    });
}