	var docpage = 25;
	var curpage = 1;
	var maxdoc = 0;
	var maxpage = 0;
	var docs = document.getElementById("articleTbl").rows;
	var selectpage = document.getElementById("selectpage");
	var turnpage = document.getElementById("turnpage");
	

	function initshow() {
		maxdoc = docs.length;
		updatemaxpage();
			initselectpage();
			initturnpage();
		if (maxdoc>0)
		{	showpage(1);		
		}
	}
	
	function initselectpage() {
		var temphtml = "";
		for (var i=0; i<maxpage; i++){
			temphtml += "<option value=\"" + (i+1) + "\">" + (i+1) + "</option>";
		}
		if (maxdoc>0)
		{
		selectpage.innerHTML = "第 <select id='_selectpage' onchange='showpage(this.options[this.selectedIndex].value)'>" + temphtml + "</select> 页 / 共 " + maxpage + " 页";
		selectpage = document.getElementById("_selectpage");
		}
	}
	
	function updateselectpage() {
		if (curpage>0) {
			selectpage.options[curpage-1].selected = true;
		}
	}
	
	function initturnpage() {
		var firststr = "";
		var prevstr = "";
		var nextstr = "";
		var laststr = "";
		firststr = "<span onclick=\"firstpage();\" style=\"cursor:pointer;\">首页</span>";
		prevstr = "<span onclick=\"prevpage();\" style=\"cursor:pointer;\">上页</span>";
		nextstr = "<span onclick=\"nextpage();\" style=\"cursor:pointer;\">下页</span>";
		laststr = "<span onclick=\"lastpage();\" style=\"cursor:pointer;\">末页</span>";
		if (maxdoc>0)
		{
		turnpage.innerHTML = firststr + " &nbsp; " + prevstr + " &nbsp; " + nextstr + " &nbsp; " + laststr;
		}
	}
	
	function updatemaxpage() {
		maxpage = Math.ceil(maxdoc/docpage);
	}
	
	function setcurpage(cp){	
		curpage = cp;		
		if (curpage<1) {
			curpage = 1;
		}
		if (curpage>maxpage) {
			curpage = maxpage;
		}
	}
	
	function hidepage() {
		for (var i=0; i<maxdoc; i++){
			docs[i].style.display = "none";
		}
	}
	
	function firstpage() {
		showpage(1);
	}
	
	function prevpage() {
		showpage(curpage-1);
	}
	
	function nextpage() {
		showpage(curpage+1);
	}
	
	function lastpage() {
		showpage(maxpage);
	}
	
	function showpage(pageno) {
		if (pageno<1) {
			pageno = 1;
		}
		if (pageno>maxpage) {
			pageno = maxpage;
		}
		
		hidepage();
		setcurpage(pageno);	
		if (pageno>0) {
			var startnum = docpage * (curpage - 1);
			for (var i=0; (i<docpage)&&((startnum + i)<maxdoc); i++){
				docs[startnum + i].style.display = "";
			}
		}
		
		updateselectpage();
	}
	
