
function pager(url, page, maxpage)
{
	var s;
	s = ("<font style='font-family:Courier New;font-size:12px;'>");
	if (page == 1) {
		s += ("首页 上页 <b>");
	} else {
		s += ("<a href='" + url + "page=1'>首页</a> ");
		s += ("<a href='" + url + "page=" + (page-1) + "'>上页</a> <b>");
	}
	var j = (page-4<1) ? 1 : page-4;
	var k = (page+4>maxpage) ? maxpage : page+4;
	if (j > 1) {
		s += " <a href='" + url + "page=1'>1</a> ... ";
	}
	var i;
	for(i=j; i<k+1; i++) {
		if (page == i) {
			s += ("<span style='color:#ff6600'>" + i + "</span> ");
		} else {
			s += ("<a href='" + url + "page=" + i + "'>" + i + "</a> ");
		}
	}
	if (maxpage > k) {
		s += " ... <a href='" + url + "page=" + maxpage + "'>" + maxpage + "</a> ";
	}
	if (page == maxpage) {
		s += ("</b>下页 末页");
	} else {
		s += ("</b><a href='" + url + "page=" + (page+1) + "'>下页</a> ");
		s += ("<a href='" + url + "page=" + maxpage + "'>末页</a>");
	}
	document.write(s);
}