﻿<!--
//一般分页
function showpages(total,urladd,CurPage,pernum){
pagenum=Math.ceil(total/pernum);
temp="<table><tbody><tr>";
temp=temp+"<td >&nbsp;共"+total+"条&nbsp;</td>";
temp=temp+"<td >&nbsp;第"+CurPage+"/"+pagenum+"页&nbsp;</td>";
if(CurPage > 1)
{
	temp=temp+"<td align=center><a href='?"+urladd+"&CurPage=1'>首页</a>&nbsp;</td>";
	temp=temp+"<td align=center><a href='?"+urladd+"&CurPage="+(CurPage-1)+"'>上一页&nbsp;</a></td>";
}
else
{
	temp=temp+"<td align=center>首页&nbsp;</td>";
	temp=temp+"<td align=center>上一页&nbsp;</td>";
}
if(CurPage < pagenum)
{
	temp=temp+"<td>&nbsp;<a href='?"+urladd+"&CurPage="+(CurPage+1)+"'>下一页</a>&nbsp;</td>";
	temp=temp+"<td>&nbsp;<a href='?"+urladd+"&CurPage="+pagenum+"'>末页</a></td>";
}
else
{	
	temp=temp+"<td>&nbsp;下一页&nbsp;</td>";
	temp=temp+"<td>&nbsp;末页</td>";
}
temp=temp+"<td>&nbsp;转到第</td><td><select name='PageTo' onchange='GoToPage(this.options[this.selectedIndex].value)'>"; 
for(i=1;i<= pagenum;i++)
{
	if(i==CurPage)
	{
		temp=temp+"<option selected='selected' value='?"+urladd+"&CurPage="+i+"'>"+i+"</option>";
	}
	else
	{
		temp=temp+"<option value='?"+urladd+"&CurPage="+i+"'>"+i+"</option>";
	}
}
temp=temp+"</select></td><td>页</td>";
temp=temp+"</tr></tbody></table>";
document.write(temp);
}

function GoToPage(url)
{
	window.location=url;
}

//通用图片等比缩放
var flagpic=false; 
function ProcessImage(ImgD,iWidth,iHeight)
{
 var image=new Image();
 
 image.src=ImgD.src;
 
 if(image.width>0 && image.height>0)
 {
 
  flagpic=true;
  
  if(image.width/image.height>= iWidth/iHeight)
  {
  
   if(image.width>iWidth)
   {
   
    ImgD.width=iWidth;
    
    ImgD.height=(image.height*iWidth)/image.width; 
    
   }
   else
   {
   
    ImgD.width=image.width;
    
    ImgD.height=image.height;
    
   }
   
   ImgD.alt=image.width+"x"+image.height;
   
  }
  else
  {
  
   if(image.height>iHeight)
   {
   
    ImgD.height=iHeight;
    
    ImgD.width=(image.width*iHeight)/image.height;
    
   }
   else
   {
   
    ImgD.width=image.width;
    
    ImgD.height=image.height;
    
   }
   
   ImgD.alt=image.width+"x"+image.height;
   
  }
  
 }
 
}



// -->

