﻿// JScript 文件

var flag=false; 
    function DrawImage(ImgD,_width,_height){ 
     var image=new Image(); 
     image.src=ImgD.src; 
     if(image.width>0 && image.height>0){ 
      flag=true; 
      if(image.width/image.height>= _width/_height){ 
       if(image.width>_width){
        ImgD.width=_width; 
        ImgD.height=(image.height*_width)/image.width; 
       }else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
       ImgD.alt="点击查看详细信息..."; 
      } 
      else{ 
       if(image.height>_height){
        ImgD.height=_height; 
        ImgD.width=(image.width*_height)/image.height; 
       }else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
       ImgD.alt="点击查看详细信息..."; 
      } 
     }
    }
