   // laesst html-Elemente sanft verschwinden (dimmen)
    function fadeOut(id) {
        _fading(id, 0, 0);
    }

    // laesst html-Elemente sanft einblenden
    function fadeIn(id) {
        _fading(id, 0, 1);
    }

    // blendet ein, wartet 'delay' und blendet wieder aus
    function fadeInOut(id, delay) {
        window.setTimeout("fadeIn('"+id+"');", 1);
        window.setTimeout("fadeOut('"+id+"');", delay+1000);
    }


    var _timeout;

    function _fading(id, counter, direction) {
        var val = counter/10;
        var newVal = counter + 1;
        var item = document.getElementById(id);
        if (item!=null) {
            if (direction==0) {  // fade out
                val = 1-val;
                newVal = counter + 1;
            }
            val = Math.round(val*10)/10;
            if (val<=1 && val>=0) {
                item.style['opacity'] = val;
                item.style['-moz-opacity'] = val;
                item.style['filter'] = "alpha(opacity="+(val*100)+")";
                _timeout = window.setTimeout("_fading('" + id + "', " + newVal + ", " + direction + ");", 40);
            }
        }
    }


    function itemHide(id) {
        var item = document.getElementById(id);
        window.clearTimeout(_timeout);
        item.style['opacity'] = 0;
        item.style['-moz-opacity'] = 0;
        item.style['filter'] = "alpha(opacity=0)";
    }


