//js分页代码 edit by guoyl 2008-05-06
function createPageHTML(_nPageCount, _nCurrIndex, _sPageName, _sPageExt){
	if(_nPageCount == null || _nPageCount<=1 || _nCurrIndex>=_nPageCount){
	return;
	}
	var nCurrIndex = _nCurrIndex || 0;
	var firstPage = "<a href=\""+_sPageName+"."+_sPageExt+"\" class=s1 target=_self>首 页</a>&nbsp;&nbsp;";
	var nextPage = "<a href=\""+_sPageName+"_"+(nCurrIndex+1)+"."+_sPageExt+"\" class=s1 target=_self>下一页</a>&nbsp;&nbsp;";
	var prePage = "<a href=\""+_sPageName+"."+_sPageExt+"\" class=s1 target=_self>上 页</a>&nbsp;&nbsp;";
	var prePage_1 = "<a href=\""+_sPageName+"_"+(nCurrIndex-1)+"."+_sPageExt+"\" class=s1 target=_self>上一页</a>&nbsp;&nbsp;";
	var lastPage = "<a href=\""+_sPageName+"_" +(_nPageCount-1)+"."+_sPageExt+"\" class=s1 target=_self>尾 页</a>&nbsp;&nbsp;";
	var firstPage_off = "<a href='javascript:void(0)' class=s2>首 页</a>&nbsp;&nbsp;";
	var nextPage_off = "<a href='javascript:void(0)' class=s2>下一页</a>&nbsp;&nbsp;";
	var prePage_off = "<a href='javascript:void(0)' class=s2>上一页</a>&nbsp;&nbsp;";
	var lastPage_off = "<a href='javascript:void(0)' class=s2>尾 页</a>&nbsp;&nbsp;";
	
	document.write("当前第<span class=font_red>"+(nCurrIndex+1)+"</span>页　总共<span class=font_red>"+_nPageCount+"</span>页 ");
	if(nCurrIndex == 0)
	{
		document.write(firstPage_off);
		document.write(prePage_off);
		document.write(nextPage);	
		document.write(lastPage);
		
	}
	else
		if(nCurrIndex==(_nPageCount-1))
		{
			document.write(firstPage);
			if(_nPageCount==2)
			{document.write(prePage);}
			else
			{document.write(prePage_1);}
			document.write(nextPage_off);
			document.write(lastPage_off);
		}
		else
		{
			document.write(firstPage);
				if(nCurrIndex==1)
				{document.write(prePage);}
				else
				{document.write(prePage_1);}
			document.write(nextPage);
			document.write(lastPage);
			
			document.write("<select name=\"select\" style=\"margin-bottom:-3px;\" onchange=\"location.replace(this.value)\">");
			document.write("<option selected >转到</option>");
			for(var i=0; i<_nPageCount; i++)
			{
			if(i==0)
			document.write("<option value=\""+_sPageName+"."+_sPageExt+"\">第1页</option>");
			else
			document.write("<option value=\""+_sPageName+"_" + i + "."+_sPageExt+"\">第"+(i+1)+"页</option>");
			}
			document.write("</select>");
			
	}

	
}
