+ g_state.last = g_state.first + g_state.pageSize - 1;
+ if (g_state.last >= g_state.count) {
+ g_state.last = g_state.count - 1;
+ }
+
+ document.getElementById('slider').value = setting;
+
+ refreshData();
+}
+
+function bookHtml(book) {
+ var result = '<div class="book">'
+ + '<table>'
+ + '<tr>'
+ + '<td><a href="/book/' + book.Id + '">';
+ if (0 == book.CoverId) {
+ result += '(No cover available)'
+ } else {
+ result += '<img class="cover-thumb" src="/download/' + book.CoverId + '"/>'
+ }
+ result += '</a></td>'
+ + '<td onclick="displayDetails(' + book.Id + ');" '
+ + ' onmouseout="stopTooltipTimer(); hideDetails();" '
+ + ' onmouseover="startTooltipTimer(' + book.Id + ');">'
+ + '<p><b>' + book.Title + '</b></p>'
+ + '<p>'
+ + '<i>' + book.AuthorReading + '</i>';
+ if (typeof(book.SeriesName) !== 'undefined' && book.SeriesName.length > 0) {
+ result += '<br/><i>' + book.SeriesName + ' ' + book.Volume + '</i>';
+ }
+ result += '</p>'
+ + '</td>'
+ + '</tr>'
+ + '</table>'
+ + '</div>';
+ return result;
+}
+
+//ce(s): "clear if empty()"
+//return s, unless it's undefined, in which case return an empty ("clear") string
+function ce(s) {
+ if (typeof s !== 'undefined') {
+ return s;
+ }
+ return '';