﻿<!--
function Pager()
{
	this.Uri = '?';
	this.RecordCount = 0;
	this.PageCount = 0;
	this.PageSize = 0;
	this.PageNo = 0;
	this.Width = '100%';
	this.Border = 1;
	this.Align = 'center';
	
	this.Show = function()
	{
		var sign = this.Uri.substr(this.Uri.length-1);
		if(sign!='?' && sign!='&') this.Uri += '&';
		this.Uri = this.Uri.replace("'", "%27");
		document.write('<table width="'+this.Width+'" border="'+this.Border+'" cellspacing="1" cellpadding="1" align="'+this.Align+'" style="border-collapse:collapse;">');
		document.write('<tr height="21">');
		document.write('<td>');
		document.write('总数 <strong>'+this.RecordCount+'</strong> &nbsp;');
		document.write('页数 <strong>'+this.PageCount+'</strong> &nbsp;');
		document.write('每页 <strong>'+this.PageSize+'</strong> &nbsp;');
		document.write('</td>');
		document.write('<td width="100" align="right">第 <strong>'+this.PageNo+'</strong> 页</td>');
		document.write('</tr>');
		document.write('<tr height="21">');
		document.write('<td>页次：');

		var M = parseInt((this.PageCount-1) / 10, 10);
		var N = parseInt((this.PageNo-1) / 10, 10);
		var E = 0;

		if(N > 0)
		{
			document.write('<span onclick="window.location=\''+this.Uri+'PageNo=1\'" style="font-family:webdings;cursor:hand;" title="首页">7</span>');
			document.write('&nbsp;<span onclick="window.location=\''+this.Uri+'PageNo='+(N*10)+'\'" style="font-family:webdings;cursor:hand;" title="上十页">3</span>');
		}

		for (var I=1; I<=10; I++)
		{
			E = N * 10 + I;
			if(E > this.PageCount) break;
			if(E == this.PageNo)
			{
				document.write('&nbsp;<B><U>'+E+'</U></B>');
			}
			else
			{
				document.write('&nbsp;<span onclick="window.location=\''+this.Uri+'PageNo='+E+'\'" style="cursor:hand;"><B>'+E+'</B></span>');
			}
		}

		if(N < M)
		{
			document.write('&nbsp;<span onclick="window.location=\''+this.Uri+'PageNo='+(N*10+11)+'\'" style="font-family:webdings;cursor:hand;" title="下十页">4</span>');
			document.write('&nbsp;<span onclick="window.location=\''+this.Uri+'PageNo='+this.PageCount+'\'" style="font-family:webdings;cursor:hand;" title="尾页">8</span>');
		}

		document.write('</td>');
		document.write('<form method="post" onsubmit="window.location=\''+this.Uri+'PageNo=\'+PageNo.value; return false;">');
		document.write('<td align="right" title="回车直接跳转页面">');
		document.write('<strong>GO</strong> <input type="text" name="PageNo" value="'+this.PageNo+'" maxlength="8" onfocus="this.value=\'\';" onblur="if(this.value==\'\')this.value='+this.PageNo+';" style="width:36px;height:16px;border-left:0px;border-right:0px;border-top:0px;border-bottom:1px solid #666666;">');
		document.write('</td>');
		document.write('</form>');
		document.write('</tr>');
		document.write('</table>');
	};
	
	this.toString = function()
	{
		return '[class Vimei.Pager]';
	};
}
//-->
