} else {
                $stats[$counter]['stat-total'] = spKPIdisplayValue($rowtotal, $col);
            }
            if (in_array($col, $hilite_rows)) {
                $forjs_hilite[] = $counter;
            }
            if (in_array($col, $sep_rows)) {
                $forjs_sep[] = $counter;
            }
            if ($col == $totals_rows) {
                $forjs_totals = $counter;
            }
            $counter++;
        }
    }
    $content .= tep_plain_table('stat', $stats);
    $javascript = '
	$(document).ready(function(){
		$(".stat td[class!=stat-label][class!=stat-unit]").addClass("stat-value");
		var hilite = new Array(' . implode(',', $forjs_hilite) . ');
		for (n in hilite) {
			$(".stat tr:eq(" + hilite[n] + ") td").each(function() {
				$(this).addClass("stat-hilite");
				if(hilite[n]==' . $forjs_totals . ') $(this).addClass("stat-total");
			});
		}
		var separator = new Array(' . implode(',', $forjs_sep) . ');
		for (n in separator) $(".stat tr:eq(" + separator[n] + ") td").addClass("stat-sep");
		$(".stat tr:last-child td:first-child").css("text-align", "left");
	});
	';
function tep_draw_table($class, $data, $border = false, $usetotal = false)
{
    $t = '';
    if (is_array($data)) {
        $t = '<div class="draw-table">';
        $t .= tep_plain_table($class, $data, $border, $usetotal);
        $t .= '</div>';
    }
    return $t;
}