//JS等比缩略图片函数
 <!-- 
function ResizeImage(ImgD,FitWidth,FitHeight){
     var image=new Image();
     image.src=ImgD.src;
	 image.width=ImgD.width;
	 image.height=ImgD.height;
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }    
	 //ImgD.parentNode.style.top = parseInt((FitHeight-ImgD.height)/2)+"px";
 }
  function ResizePosition(ImgD){
     var image=new Image();
     image.src=ImgD.src;
	 ImgD.style.position = "absolute";
	 ImgD.style.left = "50%";
	 ImgD.style.top = "50%";
	 ImgD.style.marginLeft = -parseInt(ImgD.width/2)+'px';
	 ImgD.style.marginTop = -parseInt(ImgD.height/2)+'px';
 }
 //-->