var end=0;
var ten=10;
var bannercurrent=0;
var accepttype;
var add;
var del;
var local;
var frontstrlenth="";
var backstrlenth="";

//获取地址栏参数;
local=(location.pathname+location.search);
if(local.indexOf("page")<0)
{
	 if(local.indexOf("?")<0)
	 {
	 frontstrlenth=local+"?"
	 }
	 else
	 {
	 frontstrlenth=local+"&"
	 }
}
else
{
   frontlenth=local.indexOf("page")
   backlenth=local.indexOf("&",frontlenth)              
   frontstrlenth=local.substring(0,frontlenth)          //前方的参数值   "/index.asp?typ=10&"
   if(backlenth=="-1")
    {
    backstrlenth="";
	}
	else
	{
	backstrlenth=local.substring(backlenth);            //后方的参数值    "&uu=142"
	}
}

//判断分页数
function setpage(bannercurrent,pagecurrent,pagecount,bannerboor,accepttype) 
{ 
var str="";
star=1;
	star+=bannercurrent
	end=(bannercurrent+ten)

			if (pagecount<=end)
			{
				//alert(bannercurrent)
				for(i=star;i<=pagecount;i++)
				{ 		
					str=forpage(i,pagecurrent,frontstrlenth,backstrlenth);
				}					
			}
			else
			{		
				for(i=star;i<=end;i++)
				{
					str=forpage(i,pagecurrent,frontstrlenth,backstrlenth);				
				}				
			}

			bannercurrent=end
			str = banner(bannercurrent,pagecurrent,pagecount,"del",accepttype) + str + banner(bannercurrent,pagecurrent,pagecount,"add",accepttype);

function forpage(i,pagecurrent,frontstrlenth,backstrlenth)
{

	if(pagecurrent==i)
	{
	str += "<font color='red' size='2'>" + i + "</font>&nbsp";
	}
	else
	{
	str += "<a href=" + frontstrlenth + "page="+ i + backstrlenth + ">" + i + "</a>&nbsp";
	}	
	return str;
}

function banner(bannercurrent,pagecurrent,pagecount,bannerboor,accepttype)
{
	if(bannerboor=="add")
	{ 	    
	//alert(pagecount)
	      if(pagecount <= ten || pagecount <= bannercurrent)
	      { 
			return "";
		  }
		  else
		  {
			return "<a style='CURSOR: hand;' onClick=javascript:setpage(" + bannercurrent + "," + pagecurrent + "," + pagecount + ",'" + bannerboor + "','" + accepttype + "');>>></a>";
		  }
	}
	else        //此时是del
	{	
	     if(pagecount <= ten || bannercurrent==ten)
	     { 
			return "";
		 }
		 else
		 {
			return "<a style='CURSOR: hand;' onClick=javascript:setpage(" + (bannercurrent-ten*2) + "," + pagecurrent + "," + pagecount + ",'" + bannerboor + "','" + accepttype + "');><<</a>&nbsp";
		 }
	}
}	
	shownetbank1.innerHTML=str; 
} 
