function Class(){}
Class.prototype.construct=function(){};Class.__asMethod__=function(func,superClass){return function(){var currentSuperClass=this.$;this.$=superClass;var ret=func.apply(this,arguments);this.$=currentSuperClass;return ret;};};Class.extend=function(def){var classDef=function(){if(arguments[0]!==Class){this.construct.apply(this,arguments);}};var proto=new this(Class);var superClass=this.prototype;for(var n in def){var item=def[n];if(item instanceof Function){item=Class.__asMethod__(item,superClass);}
proto[n]=item;}
proto.$=superClass;classDef.prototype=proto;classDef.extend=this.extend;return classDef;};var PageList=Class.extend({construct:function(pageIndex,totalPage,totalSize,callbackFunction,isScroll){this.pageIndex=pageIndex;this.totalPage=totalPage;this.total=totalSize;this.callbackFunction=callbackFunction;this.isScroll=isScroll;this.tailNumber=8;this.headNumber=8;this.width=3;this.twoend=2;if(this.pageIndex-1>0){this.prev=this.pageIndex-1;}else{this.prev=0;}
if(this.pageIndex<this.totalPage){this.next=this.pageIndex+1;}else{this.next=0;}
this.class_prefix="p";},displayList:function(){var result="";if(this.total==0){}else{if(this.totalPage<=1){result+="<div align='center' class='p_total'><div class='p_bar'>"+page_total+" ("+this.total+")</div></div></div>";}else{result="<div class='"+this.class_prefix+"_bar' align='center'><nobr>";result+=this.getPrevPageNum()+"&nbsp;&nbsp;";if(this.totalPage>(this.twoend*2+this.width*2+1)){result+=this.getHead();result+=this.getCurPageNum(this.pageIndex);result+=this.getTail();}else{for(var i=1;i<=this.totalPage;i++){if(i!=this.pageIndex){result+=this.getPageNum(i);}else{result+=this.getCurPageNum(i);}}}
result+="&nbsp;&nbsp;"+this.getNextPageNum();result+="</nobr>";result+="<div align='center' class='p_total'>"+page_total+" ("+this.total+")</div></div>";}}
return result;},getHead:function(){var result="";if(this.pageIndex-this.headNumber>1){var start=(this.pageIndex-this.width<this.totalPage-this.headNumber?this.pageIndex-this.width:this.totalPage-this.headNumber);for(var i=1;i<=this.twoend;i++){result+=this.getPageNum(i);}
if(start>this.twoend+1){result+="<span class='nolink'>&nbsp;...&nbsp;</span>";}
for(var i=start;i<this.pageIndex;i++){result+=this.getPageNum(i);}}else{for(var i=1;i<this.pageIndex;i++){result+=this.getPageNum(i);}}
return result;},getTail:function(){var result="";if(this.pageIndex+this.tailNumber<this.totalPage){var end=(this.pageIndex+this.width<this.headNumber?this.headNumber:this.pageIndex+this.width);for(var i=this.pageIndex+1;i<=end;i++){result+=this.getPageNum(i);}
if(end<this.totalPage-this.twoend){result+="<span class='nolink'>&nbsp;...&nbsp;</span>";}
for(var i=this.totalPage-this.twoend+1;i<=this.totalPage;i++){result+=this.getPageNum(i);}}else{for(var i=this.pageIndex+1;i<=this.totalPage;i++){result+=this.getPageNum(i);}}
return result;},getPageNum:function(index){var f=this.callbackFunction+"("+index+");";if(this.isScroll){f+="scroll(0,0);";}
return"<a href=\"#\" onclick=\""+f+";addHistory("+index+");return false\" class='"+this.class_prefix+"_num'>"+index+"</a>";},getCurPageNum:function(index){return"<span class='pageon'>"+index+"</span>";},getPrevPageNum:function(){if(this.prev>0){var f=this.callbackFunction+"("+this.prev+");";if(this.isScroll){f+="scroll(0,0);";}
var prev_ten;if(this.pageIndex>10){var prev_ten_num=this.pageIndex-10;var t=this.callbackFunction+"("+prev_ten_num+");";prev_ten="<a href=\"#\" onclick=\""+t+";addHistory("+prev_ten_num+");return false\" class='"+this.class_prefix+"_num'>"+prev_ten_page+"</a>"}else{prev_ten="";}
return"<a href=\"#\" onclick=\""+f+";addHistory("+this.prev+");return false\" class='"+this.class_prefix+"_num'>"+prev_page+"</a>"+prev_ten;}else{return prev_page;}},getNextPageNum:function(){if(this.next>0){var f=this.callbackFunction+"("+this.next+");";if(this.isScroll){f+="scroll(0,0);";}
var next_ten;if(this.totalPage-this.pageIndex>=10){var next_ten_num=this.pageIndex+10;var t=this.callbackFunction+"("+next_ten_num+");";next_ten="<a href=\"#\" onclick=\""+t+";addHistory("+next_ten_num+");return false\" class='"+this.class_prefix+"_num'>"+next_ten_page+"</a>"}else{next_ten="";}
return next_ten+"<a href=\"#\" onclick=\""+f+";addHistory("+this.next+");return false\" class='"+this.class_prefix+"_num'>"+next_page+"</a>";}else{return next_page;}}});var SmallPageList=PageList.extend({construct:function(pageIndex,totalPage,totalSize,callbackFunction){this.pageIndex=pageIndex;this.totalPage=totalPage;this.total=totalSize;this.callbackFunction=callbackFunction;this.tailNumber=1;this.headNumber=1;this.width=1;this.twoend=1;if(this.pageIndex-1>0){this.prev=this.pageIndex-1;}else{this.prev=0;}
if(this.pageIndex<this.totalPage){this.next=this.pageIndex+1;}else{this.next=0;}
this.class_prefix="sp";}});