function PAGER(firstBtn,prevBtn,nextBtn,lastBtn,spacer){
	if(spacer == undefined) spacer = '';	//页码间隔符号
	this.records = 0;
	this.pagesize = 0;

	this.showNum = true;					//是否显示页码
	this.max = 0;
	this.page = 1;							//当前页
	this.NumCount = 10;						//显示页码个数
	this.Qstring = '';						//URL字串
	this.compart_param = 'page';			//URL传递页码字符
	this.context = false;					//是否显示下页上页
	this.ajax = false;					    //是否AJAX分页
	this.cls_current = '';					//当前页的class

	var output = '';
	
	/**
	*	分页导航
	*/
	this.navigation = function() {

		if(this.records > 0) {
			if(this.records % this.pagesize == 0) {
				this.max = this.records / this.pagesize;
			}
			else{
				this.max = parseInt(this.records / this.pagesize) + 1;
			}
		}
//		alert(this.records);
//		var tmpNumeric = "";
		var pc = 0;			//显示当前页前后数字的个数
//		var pageid = this.CurrentPage;
		var starpage = 1;
		var endpage = this.NumCount;

		pc = parseInt(endpage / 2);

//alert(endpage);

		if(this.page > pc) {
			starpage = this.page - pc;
			if(endpage % 2 == 0) {
//				alert('-');
				endpage = parseInt(this.page) + parseInt(pc) + 1;
			}
			else{
				endpage = parseInt(this.page) + parseInt(pc);
			}
		}


		if(this.page > this.max) this.page = this.max;


		output = '<span><a class="records">' +this.records+ '条</a></span>';
			
//alert(starpage+ ' | ' +endpage + '|' +pc+ '|' +this.page);

		//如果当前页>1
		if(this.page > 1 && this.context == false) {
			if(this.ajax == false) {
				output += '<span><a value="1" class="firstBtn" href="?'+this.compart_param+'=1&'+this.Qstring+'">' + firstBtn + '</a></span>';
				output += '<span><a value="' + (this.page-1) + '" class="prevBtn" href="?'+this.compart_param+'=' + (this.page-1) + '&'+this.Qstring+'">' + prevBtn + '</a></span>';
			}else{
				output += '<span><a value="' + (this.page-1) + '" class="firstBtn" href="['+this.Qstring.replace(/\[p\]/ig,1) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,1) +'return false;">' + firstBtn + '</a></span>';
				output += '<span><a value="' + (this.page-1) + '" class="prevBtn" href="['+this.Qstring.replace(/\[p\]/ig,this.page-1) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,this.page-1) +'return false;">' + prevBtn + '</a></span>';
			}
//		output += '<span><a class="number cls_curpage" value="1" href="?'+this.compart_param+'=1&'+this.Qstring+'">1...</a></span>';
		}

		//当前页>=1 且 当前页<=最大页
		for(var i = starpage; i <= endpage; i++) {
			if(i > this.max){ break; }
			if(i == this.page) {
				if(this.ajax == false) {
					output += '<span><a class="number cls_curpage" value="' + i + '" href="?'+this.compart_param+'=' + i + '&'+this.Qstring+'">' + i + '</a></span>' + spacer;
				}
				else {
					output += '<span><a class="number cls_curpage" value="' + i + '" href="['+this.Qstring.replace(/\[p\]/ig,i) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,1) +'return false;">' + i + '</a></span>' + spacer;
				}
			}
			else{
				if(this.ajax == false) {
					output += '<span><a class="number" value="' + i + '" href="?'+this.compart_param+'=' + i + '&'+this.Qstring+'">' + i + '</a></span>' + spacer;
				}
				else{
					output += '<span><a class="number" value="' + i + '" href="['+this.Qstring.replace(/\[p\]/ig,i) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,i) +'return false;">' + i + '</a></span>' + spacer;					
					
				}
			}
		}

		if(this.page < this.max  && this.context == false) {
//		output += '<span><a class="number cls_curpage" value="1" href="?'+this.compart_param+'='+this.max+'&'+this.Qstring+'">'+this.max+'...</a></span>';
			if(this.ajax == false){
			output += '<span><a value="' + (this.page+1) + '" class="nextBtn" href="?'+this.compart_param+'=' + (this.page + 1) + '&'+this.Qstring+'">' + nextBtn + '</a></span>';
			output += '<span><a value="' + this.max + '" class="lastBtn" href="?'+this.compart_param+'=' + (this.max) + '&'+this.Qstring+'">' + lastBtn + '</a></span>';
			}else{
			output += '<span><a class="nextBtn" href="['+this.Qstring.replace(/\[p\]/ig,this.page+1) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,this.page+1) +'return false;">' + nextBtn + '</a></span>';
			output += '<span><a class="lastBtn" href="['+this.Qstring.replace(/\[p\]/ig,this.max) +']" onclick="'+this.Qstring.replace(/\[p\]/ig,this.max) +'return false;">' + lastBtn + '</a></span>';
			}
		}
		output += '<span><a class="records">' +this.max+ '页</a></span>';
		
		if(this.ajax){
			output += '<span><a class="jump_box"><input type="" id="my_js_pager_jumper" size="2" onclick="this.select();" onchange="' +this.Qstring.replace(/\[p\]/ig, 'this.value')+ '" /></a></span>';
		}
		else{
			output += '<span><a class="jump_box"><input type="" size="2" onchange="location=?' +this.compart_param+ 'this.value&' +this.Qstring+ '" /></a></span>';
		}
/*
		if(this.max == 1){
			output='';
		}
*/
		return(output);



	}
}

