I have a XML file that is styled by XSLT and output to HTML. Everthing works fine accept getting the JavaScript file that reads the rows and records in my table so that the user select the next or prev link to see the next set of records..js file\[code\]<pre><code><script type="text/javascript"> function Pager(tableName, itemsPerPage) { this.tableName = tableName; this.itemsPerPage = itemsPerPage; this.currentPage = 1; this.pages = 0; this.inited = false; this.showRecords = function (from, to) { var rows = document.getElementById(tableName).rows; // i starts from 1 to skip table header row for (var i = 1; i < rows.length; i++) { if (i < from || i > to) rows.style.display = 'none'; else rows.style.display = ''; } } this.showPage = function (pageNumber) { if (!this.inited) { alert("not inited"); return; } var oldPageAnchor = document.getElementById('pg' + this.currentPage); oldPageAnchor.className = 'pg-normal'; this.currentPage = pageNumber; var newPageAnchor = document.getElementById('pg' + this.currentPage); newPageAnchor.className = 'pg-selected'; var from = (pageNumber - 1) * itemsPerPage + 1; var to = from + itemsPerPage - 1; this.showRecords(from, to); } this.prev = function () { if (this.currentPage > 1) this.showPage(this.currentPage - 1); } this.next = function () { if (this.currentPage < this.pages) { this.showPage(this.currentPage + 1); } } this.init = function () { var rows = document.getElementById(tableName).rows; var records = (rows.length - 1); this.pages = Math.ceil(records / itemsPerPage); this.inited = true; } this.showPageNav = function (pagerName, positionId) { if (!this.inited) { alert("not inited"); return; } var element = document.getElementById(positionId); var pagerHtml = '<a onclick="' + pagerName + '.prev();" class="pg-normal">Prev </a> '; for (var page = 1; page <= this.pages; page++) pagerHtml += '<a id="pg' + page + '" class="pg-normal" onclick="' + pagerName + '.showPage(' + page + ');">' + page + '</a> '; pagerHtml += ' <a onclick="' + pagerName + '.next();" class="pg-normal"> Next </a>'; element.innerHTML = pagerHtml; } } </script>\[/code\]XMLfile\[code\]<audits> <reports> <title>Audit Reports</title> <rsslink>http://www.sigar.mil/rss/audit-reports.xml</rsslink> <item> <title>Test 0</title> <description>Audit Test0</description> <link>../pdf/audits/2012-09-10audit-12-14.pdf</link> <pubdate>Monday, September 10, 2012</pubdate> </item> <item> <title>Test 1</title> <description>Audit Test1</description> <link>../pdf/audits/2012-07-30audit-12-13Revised.pdf</link> <pubdate>Monday, July 30, 2012</pubdate> </item> <item> <title>Test 2</title> <description>Audit Test2</description> <link>../pdf/audits/2012-07-30audit-12-12Revised.pdf</link> <pubdate>Monday, July 30, 2012</pubdate> </item> <item> <title>Test 3</title> <description>Audit Test3</description> <link>../pdf/audits/2012-06-29audit-12-11.pdf</link> <pubdate>Saturday, June 30, 2012</pubdate> </item> \[/code\] HTML file\[code\]\[code\] var pager = new Pager('results', 5); pager.init(); pager.showPageNav('pager', 'pageNavPosition'); pager.showPage(1); \[/code\]\[/code\]