function MovePagingTop(status,total,offset,maximum)
{var pagingPos=parseFloat(document.getElementById("PagingPosTop").value);var startPage=1;var endPage=(total/maximum);if((total%maximum)>0)
{endPage++;}
if(endPage>30){endPage=30;}
var startShow=(Math.floor((offset/maximum))+1);startShow=(startShow-(startShow%10));if(pagingPos!=-1)
{startShow=pagingPos;}
var endShow=startShow+9;if(endShow>endPage)
{endShow=endPage;}
if(status=="next"){startShow=startShow+10;endShow=startShow+9;}else if(status=="prev"){startShow=startShow-10;endShow=startShow+9;}
document.getElementById("PagingAreaTop").style.display="inline";for(i=startPage;i<=endPage;i++){var pTop=document.getElementById("PageLinkTop"+i);if((i>=startShow)&&(i<=endShow)){if(pTop){pTop.style.display="inline";}}
else{if(pTop){pTop.style.display="none";}}}
var nt=document.getElementById("btNextTop");var pt=document.getElementById("btPrevTop");if(endShow>=endPage){nt.style.display="none";}
else{nt.style.display="inline";}
if(startShow<=1){pt.style.display="none";}
else{pt.style.display="inline";}
if(startShow<=0){startShow=1}
document.getElementById("PagingPosTop").value=startShow;}
function MovePagingBottom(status,total,offset,maximum)
{var pagingPos=parseFloat(document.getElementById("PagingPosBot").value);var startPage=1;var endPage=(total/maximum);if((total%maximum)>0)
{endPage++;}
if(endPage>51){endPage=51;}
var startShow=(Math.floor((offset/maximum))+1);startShow=(startShow-(startShow%10));if(pagingPos!=-1)
{startShow=pagingPos;}
var endShow=startShow+9;if(endShow>endPage)
{endShow=endPage;}
if(status=="next"){startShow=startShow+10;endShow=startShow+9;}else if(status=="prev"){startShow=startShow-10;endShow=startShow+9;}
document.getElementById("PagingAreaBot").style.display="inline";for(i=startPage;i<=endPage;i++){var pBot=document.getElementById("PageLinkBot"+i);if((i>=startShow)&&(i<=endShow)){if(pBot){pBot.style.display="inline";}}
else{if(pBot){pBot.style.display="none";}}}
var nb=document.getElementById("btNextBot");var pb=document.getElementById("btPrevBot");if(endShow>=endPage){nb.style.display="none";}
else{nb.style.display="inline";}
if(startShow<=1){pb.style.display="none";}
else{pb.style.display="inline";}
if(startShow<=0){startShow=1}
document.getElementById("PagingPosBot").value=startShow;}
