// JavaScript Document
function DrawImage(ImgD,lid,wid){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= lid/wid){
     if(image.width>lid){  
     ImgD.width=lid;
     ImgD.height=(image.height*lid)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>wid){
     ImgD.height=wid;
     ImgD.width=(image.width*wid)/image.height; 
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
   }
}