	var currentSet,CutFlag,TotalByte,PageCount,key,tempText,tempPage;
	key="";
	currentSet=0;
	TotalByte=Text.length;
	PageCount=Math.round(TotalByte/PageSize);
		if(parseFloat("0."+TotalByte%PageSize)>0){
		if(parseFloat("0."+TotalByte%PageSize)<0.5){			
			PageCount=PageCount+1;
			}
		}
	var PageNum=new Array(PageCount+1);
	PageNum[0]=0; 
	
	var sDrv1,sDrv2,sDrv3,sDrv4,sFlag;
	var sDrvL,sTemL;
	var sTem1,sTem2,k;
	sFlag=0;
	
	for(j=1;j<PageCount+1;j++){
	PageNum[j]=PageNum[j-1]+PageSize;
	sDrv1="<br>";
	sDrv2="<BR>";
	sDrv3="<Br>";
	sDrv4="<bR>";
	sDrvL=sDrv1.length;
	for(k=PageNum[j];k<=TotalByte;k++){
		sTem1=Text.substring(PageNum[j]-sDrvL,k);
		sTemL=sTem1.length;
		sTem2=sTem1.substring(sTemL-sDrvL,sTemL)		
		if (sTem2==sDrv1 || sTem2==sDrv2 || sTem2==sDrv3 || sTem2==sDrv4)
		{
		sFlag=sFlag+1;
		PageNum[j]=k;
		break;
		}
	}
} 

PageCount=sFlag+1;


	function text_pagination(Page){
		var Output,Byte;		
		Output="";
		Output=Output+"<a name='top'></a>";
				Output=Output+"<table width=100% height=30 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=1 background=Images/DotLine.gif> </td></tr><tr><td align=center bgcolor=#f0faff >";
		if(Page==null){Page=1;}	
		if (Page==0){		
			Output=Output+"<div align=right><input type=text name=keys class=iptA onchange=key=this.value>  <input type=button class=btnA name=search value=查找 onclick=searchkey();>&nbsp;&nbsp;&nbsp;&nbsp; 当前是<font color=red>全文显示</font> 分页：" ;				
		}
			else{
			if(TotalByte>PageSize){Byte=PageNum[Page]-PageNum[Page-1]}else{Byte=TotalByte};
			Output=Output+"<div align=right><input type=text name=keys class=iptA onchange=key=this.value>  <input type=button class=btnA name=search value=查找 onclick=searchkey();>&nbsp;&nbsp;&nbsp;&nbsp; 当前是第<font color=red>"+Page+"</font>页 分页：";
		}
		
		
		temp="";		
		//temp=temp+"<a name='top'></a>";
		tempPage=Page;
		if(TotalByte>PageSize){		
		if (Page-4<=1){
		temp=temp+"<font face=webdings color=#999999>9</font>";
		if (Page<=1){temp=temp+"<font face=webdings color=#999999>7</font>";}else{temp=temp+"<a href=javascript:text_pagination("+(Page-1)+")><font face=webdings>7</font></a>";}
			if (PageCount>10){
				for(i=1;i<8;i++){
					if (i==Page){			
					temp=temp+"<font color=red>"+i+"</font> ";
					}else{
					temp=temp+"<a href=javascript:text_pagination("+i+") >"+i+"</a>"+" ";
					}
				}
				temp=temp+" ...";
				}
			else{			
				for(i=1;i<PageCount+1;i++){
					if (i==Page){			
					temp=temp+"<font color=red>"+i+"</font> ";
					}else{
					temp=temp+"<a href=javascript:text_pagination("+i+") >"+i+"</a>"+" ";
					}
				}
			}
		if (Page==PageCount){temp=temp+"<font face=webdings color=#999999>8</font>";}else{temp=temp+"<a href=javascript:text_pagination("+(Page+1)+")><font face=webdings>8</font></a>";}
		if(PageCount<10){temp=temp+"<font face=webdings color=#999999>:</font>";}else{temp=temp+"<a href=javascript:text_pagination("+PageCount+")><font face=webdings>:</font></a>";}

		}else if(Page+4<=PageCount){
		temp=temp+"<a href=javascript:text_pagination(1)><font face=webdings>9</font></a>";
		temp=temp+"<a href=javascript:text_pagination("+(Page-1)+")><font face=webdings>7</font></a>";
			if (PageCount>10){
				temp=temp+"..";
				for(i=Page-4;i<Page+4;i++){
					if (i==Page){			
					temp=temp+"<font color=red>"+i+"</font> ";
					}else{
					temp=temp+"<a href=javascript:text_pagination("+i+") >"+i+"</a>"+" ";
					}
				}
				temp=temp+" ..";
				}
			else{
				for(i=1;i<PageCount+1;i++){
					if (i==Page){			
					temp=temp+"<font color=red>"+i+"</font> ";
					}else{
					temp=temp+"<a href=javascript:text_pagination("+i+") >"+i+"</a>"+" ";
					}
				}
			}
		
		if (Page==PageCount){temp=temp+"<font face=webdings color=#999999>8</font>";}else{temp=temp+"<a href=javascript:text_pagination("+(Page+1)+")><font face=webdings>8</font></a>";}
		temp=temp+"<a href=javascript:text_pagination("+PageCount+")><font face=webdings>:</font></a>";

		}else{
		temp=temp+"<a href=javascript:text_pagination(1)><font face=webdings>9</font></a>";
		temp=temp+"<a href=javascript:text_pagination("+(Page-1)+")><font face=webdings>7</font></a>";
			temp=temp+".."
			for(i=Page-2;i<PageCount+1;i++){
					if (i==Page){			
					temp=temp+"<font color=red>"+i+"</font> ";
					}else{
					temp=temp+"<a href=javascript:text_pagination("+i+") >"+i+"</a>"+" ";
					}
				}
		if (Page==PageCount){temp=temp+"<font face=webdings color=#999999>8</font>";}else{temp=temp+"<a href=javascript:text_pagination("+(Page+1)+")><font face=webdings>8</font></a>";}
		temp=temp+"<font face=webdings color=#999999>:</font>";
		}
		}else{
		temp=temp+"<font color=red>1</font> ";
		}
		
		temp=temp+" <a href=javascript:text_pagination(0)>显示全部</a> &nbsp;&nbsp;"
		temp=temp+"</td></tr><tr><td height=1 background=Images/DotLine.gif> </td></tr></table>";
		Output=Output+temp;
		if(Page==0)	{
			tempText=Text;
			}else{
			tempText=Text.substring(PageNum[Page-1],PageNum[Page]);			
		}
		
		
		Output=Output+"<div id=world>";
		
		if(TotalByte>PageSize){if(Page!=0){if(Page!=1){Output=Output+"<font color=red>（......前续第<a href='#foot' onclick=javascript:text_pagination("+(Page-1)+")>["+(Page-1)+"]</a>页）</font><br>";}}}
		Output=Output+tempText;
		Output=Output+"<a name='foot'></a>";
		if(TotalByte>PageSize){if(Page!=0){if(Page!=PageCount){Output=Output+"<font color=red>（后续第<a href='#top' onclick=javascript:text_pagination("+(Page+1)+")>["+(Page+1)+"]</a>页......）</font>";}}}
		Output=Output+"</div>";
		
		article.innerHTML = Output;
		eval(document.all.keys).value=key;
		if (key!=""){searchkey();}
	}
	
	function searchkey(){
		h="<font class=keyworld>";
		f="</font>";
		keyset=new Array();		
		key=document.all.keys.value;
		if (key==""){
			alert("请输入关键字！");
			return;
		}
		else{
		keyset[0]=tempText.indexOf(key,0);
		
			if (keyset[0]<0){
					return;
			}else
				temp=tempText.substring(0,keyset[0]);
				if(tempPage!=0){if(TotalByte>PageSize){if(tempPage!=1){temp="<font color=red>（......前续第<a href='#foot' onclick=javascript:text_pagination("+(tempPage-1)+")>["+(tempPage-1)+"]</a>页）</font><br>"+temp;}}}
				temp=temp+h+key+f;
				temp2=tempText.substring(keyset[0]+key.length,tempText.length);
				for (i=1;i<tempText.length;i++)	{
					keyset[i]=tempText.indexOf(key,keyset[i-1]+key.length);
					if(keyset[i]<0){
					temp=temp+tempText.substring(keyset[i-1]+key.length,tempText.length);
					break;
					}else{
					temp=temp+tempText.substring(keyset[i-1]+key.length,keyset[i])+h+key+f;
					}
				}
				if(tempPage!=0){if(TotalByte>PageSize){if(tempPage!=PageCount){temp=temp+"<font color=red>（后续第<a href='#top' onclick=javascript:text_pagination("+(tempPage+1)+")>["+(tempPage+1)+"]</a>页......）</font>";}}}
					world.innerHTML = temp;
			}
			
		}
	
	
