﻿function Pager(rc, pn, ps, pc) {
	this.RecordCount = rc;
	this.PageNo = pn;
	this.PageSize = ps;
	this.PageCount = pc;
	
	var me = this;
	
	this.SetPagerInfo = function() {
		var s = me.RecordCount.toString() + ' 个记录中的 ';
		var n = me.PageSize * me.PageNo;
		if(me.PageSize==1) {
			s += '第' + n.toString();
		} else {
			s += (n - me.PageSize + 1).toString() + '-'
			if(n>rc) n = rc;
			s += n.toString() + ' ';
		}
		s += '个';
		document.write(s);
	}
	
	this.putSpec = function(kind, sv) {
		if(kind==null) kind = 'h';
		if(kind=='h') {
			if (me.PageNo > 1) document.write(sv);
		} else {
			if (me.PageNo < me.PageCount)  document.write(sv);
		}
	}
}