if (getCookie('paged') == 'no') addPagingButton('#actions button:last'); else pageIt(); {.$more onload.} selectedChanged(); // darn you ie6! if (!$.browser.msie || $.browser.version > 6) return; $('fieldset').width('250px').after('<br>'); $('#panel').css('margin-right','1.5em'); $('a').css('border-width','0'); });//onload function addPagingButton(where) { $("<button>{.!Paged list.}</button>").insertBefore(where || '#files').click(function(){ $(this).remove(); pageIt(true); delCookie('paged'); }); }//addPagingButton function pageIt(anim) { var rows = $('#files tr'); if (!rows.size()) return; page = 0; // this is global var pages = $("<div id='pages'>{.!Page.} </div>").css('visibility','hidden').insertBefore('#files'); var pageSize = 0; while (!outsideV(rows[pageSize], 100)) if (++pageSize >= rows.size()) return pages.remove(); Npages = Math.ceil(HFS.number / pageSize); if (Npages == 1) return pages.remove(); $('#files').width($('#files').width()); // hold it still var s = ''; for (var i=1; i <= Npages; i++) s += '<span>'+i+'</span> '; s = $(s); s.appendTo(pages).click(function(){ page = Number(this.innerHTML)-1; $('#files tr:gt(0):visible').hide(); $('#files tr:gt('+(page*pageSize)+'):lt('+pageSize+')').show(); pages.find('span').removeClass('selectedPage').filter(':nth('+page+')').addClass('selectedPage'); }); s.last().addClass('selectedPage'); $('#files tr:gt('+((page+1)*pageSize)+')').hide(); pages.append($('<button>{.!No pages.}</button>').click(function(){ pages.slideUp(function(){ pages.remove(); }); $('#files tr:hidden').show(); addPagingButton(); setCookie('paged', 'no'); })); pages.css({'visibility':'', 'display':'none'}); if (anim) pages.slideDown() else pages.show(); }//pageIt