    // Hides or shows the category breakdown for affiliate reports
    function changeBreakdownVisibility(_category) {

        var div = document.getElementById(_category);
        var button = document.getElementById(_category + '_button');
        if (div.style.display=='') {
            div.style.display = 'none';
            button.src = '/affiliates/images/button_arrow_down_highlight.gif';

        } else {
            div.style.display = '';
            button.src = '/affiliates/images/button_arrow_up_highlight.gif';
        }
    }

    function highlightButton(_category) {
        var div = document.getElementById(_category);
        var button = document.getElementById(_category + '_button');
        if (div.style.display=='') {
            button.src = '/affiliates/images/button_arrow_up_highlight.gif';

        } else {
            button.src = '/affiliates/images/button_arrow_down_highlight.gif';
        }
    }

    function unhighlightButton(_category) {
        var div = document.getElementById(_category);
        var button = document.getElementById(_category + '_button');
        if (div.style.display=='') {
            button.src = '/affiliates/images/button_arrow_up.gif';

        } else {
            button.src = '/affiliates/images/button_arrow_down.gif';
        }
    }


    function changeReportType(reportLink) {
        document.report_period.action = reportLink;
        document.report_period.submit();
    }
