function PageList(pageCount,currentPage,parameter){
	//var fun = (goPageFun==null?'gotoPage':goPageFun);
	if(pageCount<1)pageCount=1;
    var strHtml = "";
    var ini_PageList_Step = 5;
    var ini_PageList_Start = currentPage - ini_PageList_Step;
    var ini_PageList_End = currentPage + ini_PageList_Step;
    if((currentPage - ini_PageList_Step)<=0){
        ini_PageList_End = ini_PageList_End -  (currentPage - ini_PageList_Step) + 1;
    }
    if((pageCount - currentPage) <= ini_PageList_Step){
        ini_PageList_Start = ini_PageList_Start - (ini_PageList_Step - (pageCount - currentPage)) - 1;
    }
    ini_PageList_Start = ini_PageList_Start <= 0?1:ini_PageList_Start;
    ini_PageList_End = ini_PageList_End < pageCount?ini_PageList_End:pageCount;
    if(pageCount <= 1){
        strHtml = "1";
    }else{
        for(i=ini_PageList_Start; i<=ini_PageList_End; i++){
            if(currentPage == i){
                strHtml += "<b>" + i + "</b>";
                if(i != (ini_PageList_End)){
                    strHtml += ' <font color="#c44b7e">|</font> ';
                }
            }else{
                strHtml += '<a href="?currpage=' + i + parameter +'">' + i + '</a>';
                if(i != (ini_PageList_End)){
                    strHtml += ' <font color="#c44b7e">|</font> ';
                }
            }
        }
    }
    if(currentPage<=1)
    	strHtml='<a href="?currpage=1'+ parameter +'">上一页</a>&nbsp;&nbsp;'+strHtml;
    else
    	strHtml='<a href="?currpage='+(currentPage-1)+parameter+'">上一页</a>&nbsp;&nbsp;'+strHtml;
	strHtml='<a href="?currpage=1'+ parameter +'">首页</a>&nbsp;&nbsp;'+strHtml;
	if(currentPage>=pageCount)
		strHtml+='&nbsp;&nbsp;<a href="?currpage='+(currentPage)+ parameter +'">下一页</a>';
	else
		strHtml+='&nbsp;&nbsp;<a href="?currpage='+(currentPage+1)+parameter +'">下一页</a>';
	strHtml+='&nbsp;&nbsp;<a href="?currpage='+pageCount+parameter +'">末页</a>';
    return strHtml;
}

String.prototype.trim=function()
{return this.replace(/(^[\s]*)|([\s]*$)/g,"");}
String.prototype.lTrim=function()
{return this.replace(/(^[\s]*)/g,"");}
String.prototype.rTrim=function()
{return this.replace(/([\s]*$)/g,"");}

Function.prototype.bind = function()  {   
	var __method   =   this;
	var arg   =   arguments;
	return  function(){
		__method.apply(window,   arg);
	}
}



