
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 var g=90; 
 var k=120;
 ik=(image.width*g)/image.height;
 ig=(image.height*k)/image.width;
  if(image.height>g)   
  {
	  
      if(ik>k){
    ImgD.width=k; 
    ImgD.height=(image.height*k)/image.width; 
               }
	          else{ 
                    ImgD.height=g;
                    ImgD.width=(image.width*g)/image.height; 
                   } 
   } 
	
  else { 
  
   if(ik>k){
    ImgD.width=k; 
    ImgD.height=(image.height*g)/image.width; 
            }
	     else{ 
                ImgD.width=image.width;
                ImgD.height=image.height; 
               }  
                         } 
}
