//Í¼Æ¬µÈ±ÈÀýËõÍ¼
var picwidth=101
var picheight=100
flag=false
function DrawImage(ImgD)
{ 
   var image=new Image(); 
   image.src=ImgD.src; 
   image.alt=ImgD.alt;
   if(image.width>0 && image.height>0){ 
      flag=true; 
      if(image.width/image.height>= picwidth/picheight){ 
         if(image.width>picwidth){ 
            ImgD.width=picwidth; 
            ImgD.height=(image.height*picwidth)/image.width; 
         }else{ 
            ImgD.width=image.width; 
            ImgD.height=image.height; 
         } 
           //ImgD.alt=image.alt+"\n[³ß´ç] "+image.width+"x"+image.height+" ÏñËØ"; 
      }else{ 
         if(image.height>picheight){ 
           ImgD.height=picheight; 
           ImgD.width=(image.width*picheight)/image.height; 
         }else{ 
           ImgD.width=image.width; 
           ImgD.height=image.height; 
         }
		// var lens=image.length;//È¡³¤¶È
        // var extname=strs.substring(lens-4,lens);//È¡Ö¸¶¨Î»ÖÃµÄ×Ó×Ö·û´®
		//if(extname==".jpg")
        // {
        //  ImgD.alt=image.alt+"\n[³ß´ç] "+image.width+"x"+image.height+" ÏñËØ"; 
        // }
      } 
   } 
} 

