//翻页效果<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
function nextpage(n,p,pg,size,url){
	n = parseInt(n);p = parseInt(p);pg = parseInt(pg);size = parseInt(size)
	if( pg > p ) { pg = p }
	document.write("[Total:"+n+"] ["+pg+"/"+p+"] ")
	if( p > ((size + 1) * 2) ) {
		var x = pg - size - 1	//当前页之前的3页
		var y = pg + size	//当前页之后的3页
		var z = 1 - x	//设置差距
		var v = p - y
		if( x < 1 ){
			x = 1
			y = y + z
		} else if ( y > p ){
			y = p
			x = x + v
		}
		if( z < 0 ){
			document.write("<a href=\""+url+"pg=1\">[1]<\/a>... ")
		}
		for(var i=x;i<=y;i++){
			if(i == pg){
			  document.write("<strong>["+i+"]</strong> ")
			} else {
			  document.write("<a href=\""+url+"pg="+i+"\">["+i+"]</a> ")
			}
		}
		if( v > 0 ){
			document.write("...<a href=\""+url+"pg="+p+"\">["+p+"]<\/a>")
		}
	} else if ( p > 1 ) {
	  for(var i=1;i<=p;i++){
		if(i == pg){
		  document.write("<strong>["+i+"]</strong> ")
		} else {
		  document.write("<a href=\""+url+"pg="+i+"\">["+i+"]</a> ")
		}
	  }
	}	
}
function nextpage1(n,p,pg,size,url,id){
	n = parseInt(n);p = parseInt(p);pg = parseInt(pg);size = parseInt(size)
	if( pg > p ) { pg = p }
	document.write("<form action=\""+url+"\" method=\"get\" \/>[Total:"+n+"] ["+pg+"/"+p+"] ")
	if( p > ((size + 1) * 2) ) {
		var x = pg - size - 1	//当前页之前的3页
		var y = pg + size	//当前页之后的3页
		var z = 1 - x	//设置差距
		var v = p - y
		if( x < 1 ){
			x = 1
			y = y + z
		} else if ( y > p ){
			y = p
			x = x + v
		}
		if( z < 0 ){
			document.write("<a href=\""+url+"pg=1\">[1]<\/a>... ")
		}
		for(var i=x;i<=y;i++){
			if(i == pg){
			  document.write("<strong>["+i+"]</strong> ")
			} else {
			  document.write("<a href=\""+url+"pg="+i+"\">["+i+"]</a> ")
			}
		}
		if( v > 0 ){
			document.write("...<a href=\""+url+"pg="+p+"\">["+p+"]<\/a>")
		}
	} else if ( p > 1 ) {
	  for(var i=1;i<=p;i++){
		if(i == pg){
		  document.write("<strong>["+i+"]</strong> ")
		} else {
		  document.write("<a href=\""+url+"pg="+i+"\">["+i+"]</a> ")
		}
	  }
	  document.write("<input type=\"hidden\" name=\"ID\" value=\""+id+"\" \/>")
	  document.write("Goto:<input type=\"text\" name=\"pg\" value=\""+pg+"\" size=\"3\" class=\"np\" \/> <input type=\"submit\" value=\"Go\" class=\"np\" />")
	}
	document.write("<\/form>")
}