if(!window.Paging)Paging={};Paging.first=1;Paging.previous=2;Paging.next=3;Paging.last=4;function initPager(e,p,o,n,k,i,l,j){var a=this;this.CurrentPage=1;this.TotalPages=1;this.ItemsPerPage=p;this.TopPagerInfoBlock=null;this.BottomPagerInfoBlock=null;this.TopNavigators={};this.BottomNavigators={};if(k)this.TopPagerInfoBlock=$get(k);if(i)this.BottomPagerInfoBlock=$get(i);var h,g;if(o)h=$get(o);if(n)g=$get(n);if(h)if(l)d(this.TopNavigators,l,e);else d(this.TopNavigators,h.getElementsByTagName("a"),e);if(g)if(j)d(this.BottomNavigators,j,e);else d(this.BottomNavigators,g.getElementsByTagName("a"),e);this.reset=function(){a.CurrentPage=1;a.TotalPages=1;if(a.TopPagerInfoBlock!=null)a.TopPagerInfoBlock.innerHTML="";if(a.BottomPagerInfoBlock!=null)a.BottomPagerInfoBlock.innerHTML=""};this.updatePager=function(b){totalQuantity=b[0];a.CurrentPage=b[1];a.TotalPages=Math.round(totalQuantity/a.ItemsPerPage);if(a.TotalPages*a.ItemsPerPage<totalQuantity)a.TotalPages++;if(b.length>2){if(this.TopPagerInfoBlock)this.TopPagerInfoBlock.innerHTML=b[2];if(this.BottomPagerInfoBlock)this.BottomPagerInfoBlock.innerHTML=b[2]}m(a.TopNavigators);m(a.BottomNavigators)};function m(c){if(a.CurrentPage==1){b(c.first);b(c.previous)}else{f(c.first);f(c.previous)}if(a.TotalPages==a.CurrentPage){b(c.next);b(c.last)}else{f(c.next);f(c.last)}a.CurrentPage==2&&b(c.first);a.CurrentPage==a.TotalPages-1&&b(c.last)}function d(d,a,e){if(a&&a.length>0){switch(a.length){case 4:a[0].onclick=function(){c(Paging.first);e()};d.first=a[0];a[1].onclick=function(){c(Paging.previous);e()};d.previous=a[1];a[2].onclick=function(){c(Paging.next);e()};d.next=a[2];a[3].onclick=function(){c(Paging.last);e()};d.last=a[3];break;case 2:a[0].onclick=function(){c(Paging.previous);e()};d.previous=a[0];a[1].onclick=function(){c(Paging.next);e()};d.next=a[1]}for(var f=0;f<a.length;f++)b(a[f])}}function c(b){switch(b){case Paging.first:a.CurrentPage=1;break;case Paging.previous:if(a.CurrentPage>1)a.CurrentPage--;break;case Paging.next:if(a.CurrentPage<a.TotalPages)a.CurrentPage++;break;case Paging.last:a.CurrentPage=a.TotalPages}}function b(a){if(a)a.style.display="none"}function f(a){if(a)a.style.display="block"}}
