scriptUrl url    -- ^ A link to the different scripts.
jsLogic = [julius|

    window.history.navigationMode = "compatible";

    fs = { };

    updateList = function(e) {
        var name = e.getAttribute("name");
        var opts = e.selectedOptions;

        fs[name] = [];
        for (var i = 0; i < opts.length; i++) {
            fs[name].push(opts[i].getAttribute("value"));
        }

        var xs = document.querySelectorAll(".courses tr");

        for (var i = 0; i < xs.length; i++) {
            xs[i].hidden = !matchesFilters(fs, xs[i]);
        }

        updateHiddenDivs();
    }

    matchesFilters = function(fs, thing) {
        for (var f in fs) {
            if (fs[f] != "any") {
                var m = false;
                for (var i = 0; i < fs[f].length; i++) {
                    if (thing.dataset[f].indexOf(fs[f][i]) > -1) {
                        m = true;
                        break;
                    }
                }
                if (!m) return false;
            }
        }
        return true;
    }

    updateHiddenDivs = function() {
        var xs = document.querySelectorAll(".courses");
        for (var i = 0; i < xs.length; i++) {
            var hidden = true;
            var ts = xs[i].getElementsByTagName("tr");
            for (var j = 0; j < ts.length; j++) {
                if (!ts[j].hidden) {
                    hidden = false;
                    break;
                }
            }
            xs[i].hidden = hidden;
        }
    }

    onload = function(){
        setDefaultSelectedValues();
    }

    setDefaultSelectedValues = function() {
        document.getElementById("select-kieli").value = "any";
        document.getElementById("select-taso").value = "any";
        document.getElementById("select-lukukausi").value = "any";
    }
|]


-- =========
jsLogic :: JavascriptUrl url
jsLogic = [julius|

    window.history.navigationMode = "compatible";

    fs = { };

    updateList = function(e) {
        var name = e.getAttribute("name");
        var opts = e.selectedOptions;

        fs[name] = [];
        for (var i = 0; i < opts.length; i++) {
            fs[name].push(opts[i].getAttribute("value"));
        }

        var xs = document.querySelectorAll(".courses tr");

        for (var i = 0; i < xs.length; i++) {
            xs[i].hidden = !matchesFilters(fs, xs[i]);
        }

        updateHiddenDivs();
    }

    matchesFilters = function(fs, thing) {
        for (var f in fs) {
            if (fs[f] != "any") {
                var m = false;
                for (var i = 0; i < fs[f].length; i++) {
                    if (thing.dataset[f].indexOf(fs[f][i]) > -1) {
                        m = true;
                        break;
                    }
                }
                if (!m) return false;
            }
        }
        return true;
    }

    updateHiddenDivs = function() {
        var xs = document.querySelectorAll(".courses");
        for (var i = 0; i < xs.length; i++) {
            var hidden = true;
            var ts = xs[i].getElementsByTagName("tr");
            for (var j = 0; j < ts.length; j++) {
                if (!ts[j].hidden) {
                    hidden = false;
                    break;
                }
            }
            xs[i].hidden = hidden;
        }
    }

    onload = function(){
        setDefaultSelectedValues();
    }

    setDefaultSelectedValues = function() {
        document.getElementById("select-kieli").value = "any";
        document.getElementById("select-taso").value = "any";
        document.getElementById("select-lukukausi").value = "any";
    }
|]
jsLogic = [julius|

    window.history.navigationMode = "compatible";

    fs = { };

    updateList = function(e) {
        var name = e.getAttribute("name");
        var opts = e.selectedOptions;

        fs[name] = [];
        for (var i = 0; i < opts.length; i++) {
            fs[name].push(opts[i].getAttribute("value"));
        }

        var xs = document.querySelectorAll(".courses tr");

        for (var i = 0; i < xs.length; i++) {
            xs[i].hidden = !matchesFilters(fs, xs[i]);
        }

        updateHiddenDivs();
    }

    matchesFilters = function(fs, thing) {
        for (var f in fs) {
            if (fs[f] != "any") {
                var m = false;
                for (var i = 0; i < fs[f].length; i++) {
                    if (thing.dataset[f].indexOf(fs[f][i]) > -1) {
                        m = true;
                        break;
                    }
                }
                if (!m) return false;
            }
        }
        return true;
    }

    updateHiddenDivs = function() {
        var xs = document.querySelectorAll(".courses");
        for (var i = 0; i < xs.length; i++) {
            var hidden = true;
            var ts = xs[i].getElementsByTagName("tr");
            for (var j = 0; j < ts.length; j++) {
                if (!ts[j].hidden) {
                    hidden = false;
                    break;
                }
            }
            xs[i].hidden = hidden;
        }
    }

    onload = function(){
        setDefaultSelectedValues();
    }

    setDefaultSelectedValues = function() {
        document.getElementById("select-kieli").value = "any";
        document.getElementById("select-taso").value = "any";
        document.getElementById("select-lukukausi").value = "any";
    }
|]