
function subst() {
var vars = {};
var x = document.location.search.substring(1).split('&');
for (var i in x) { var z = x[i].split('=', 2); vars[z[0]] = unescape(z[1]); }
// Get the total number of pages
var totalPages = parseInt(vars['topage']);
// Iterate through each page
for (var currentPage = 1; currentPage <= totalPages; currentPage++) {
// Select the last <tr> on the current page
var lastTr = document.querySelector('.page' + currentPage + ' tr:last-child');
// Apply bottom border to the last <tr> on the current page
if (lastTr) {
lastTr.style.borderBottom = '1px solid black';
}
}
// Hide the element with id "lastpage" if there's more than one page
if (totalPages > 1) {
document.getElementById("lastpage").style.display = 'none';
}
}