}
        $output .= $displayRows . $hiddenRows . "</table>";
        if (count($expenditureNms) > 5) {
            $output .= "<div class='nd-more-link'><a href=\"javascript:toggleDisplay('hiddencatnm');changeLinkText('showmorelinkCat','Expense Categories')\"><div id='showmorelinkCat'>Show more Expense Categories &#187;</div></a></div>";
        }
    }
}
if (count($spendingCategories) > 0) {
    $output .= "<table id='spendexpcatfilter' class='narrow-down'>";
    $output .= "<thead><tr><th colspan='3'>By Spending Category</th></thead>";
    $i = 0;
    $displayRows = NULL;
    $hiddenRows = NULL;
    foreach ($spendingCategories as $key => $value) {
        $checked = $reqSpendCatId == $value['category_category'] ? 'checked' : '';
        $spendCategoryName = _break_text_custom2($value['category_category_spending_category_name']);
        if ($i < 5) {
            $displayRows .= "<tr><td><input class='styled' type='checkbox' name='fSpendCategoryId' {$checked}  value='{$value['category_category']}' onClick='javascript:applyTableListFilters();'/></td>  <td>{$spendCategoryName}</td> <td class=\"results\"><span class=\"results\">" . number_format($value['txcount']) . "</span></td> </tr>";
        } else {
            $hiddenRows .= "<tr><td><input class='styled' type='checkbox' name='fSpendCategoryId' {$checked}  value='{$value['category_category']}' onClick='javascript:applyTableListFilters();'/></td>  <td>{$spendCategoryName}</td> <td class=\"results\"><span class=\"results\">" . number_format($value['txcount']) . "</span></td> </tr>";
        }
        $i++;
    }
    if ($displayRows) {
        $displayRows = "<tbody>" . $displayRows . "</tbody>";
    }
    if ($hiddenRows) {
        $hiddenRows = "<tbody id='hiddenspendcat' style='display: none;'>" . $hiddenRows . "</tbody>";
    }
    $output .= $displayRows . $hiddenRows . "</table>";
    if (count($spendingCategories) > 5) {
    echo '</div>';
    $ct++;
}
?>
  </div>
  <div class="options">
    <div class="rows">
    <?php 
$ct = 0;
foreach ($unchecked as $row) {
    $row[0] = str_replace('__', '/', $row[0]);
    $row[1] = str_replace('__', '/', $row[1]);
    $id = $id_filter_name . "_unchecked_" . $ct;
    echo '<div class="row">';
    echo '<div class="checkbox"><input class="styled" id="' . $id . '" name="' . $autocomplete_id . '" type="checkbox" ' . $disabled . 'value="' . urlencode(html_entity_decode($row[0], ENT_QUOTES)) . '" onClick="return applyTableListFilters();"><label for="' . $id . '"></label></div>';
    echo '<div class="name">' . _break_text_custom2($row[1], 15) . '</div>';
    echo '<div class="number"><span>' . number_format($row[2]) . '</span></div>';
    echo '</div>';
    $ct++;
}
?>
    </div>
  </div>
        </div>
  </div>
</div>
<?php 
if ($node->widgetConfig->facetPager == true) {
    $scroll_facet = "var page" . $node->nid . " = 0;\n    \$(this).next().find('.options').mCustomScrollbar('destroy');\n    \$(this).next().find('.options').mCustomScrollbar({\n        horizontalScroll:false,\n        scrollButtons:{\n            enable:false\n        },\n        callbacks:{\n            onTotalScroll: function (){   \n\t\t\t\tvar pages = \$(this).next().find('input.autocomplete').attr('pages');\n\t\t\t\tif(pages == 1) return false;\n\t\t\t\tif(page" . $node->nid . "  >= pages ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tpage" . $node->nid . "++;                      \n                paginateScroll(" . $node->nid . ", page" . $node->nid . ")\n            },\n            onTotalScrollBack: function(){\n                var pages = \$(this).next().find('input.autocomplete').attr('pages');\n                if(pages == 1) return false;\n                if (page" . $node->nid . " > 0){\n                    page" . $node->nid . "--;\n                    paginateScroll(" . $node->nid . ", page" . $node->nid . ");\n                }\n                \n            }\n        },\n        theme:'dark'\n    });";
} elseif ($node->widgetConfig->facetNoPager == true) {
    $scroll_facet = "\n        \$(this).next().find('.options').mCustomScrollbar('destroy');\n        \$(this).next().find('.options').mCustomScrollbar({\n            horizontalScroll:false,\n            scrollButtons:{\n                enable:false\n            },\n            theme:'dark'\n        });\n      ";