function DrawImage(ImgD,FitWidth,FitHeight){
    DrawImage(ImgD,FitWidth,FitHeight,true)
}
function DrawImage(ImgD,FitWidth,FitHeight,flag){
    var image=new Image();

    image.src=ImgD.src;
    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;
                if(flag){
                    function (){
                        window.open(ImgD.src)
                    }
                }
                ImgD.onmouseover = function (){
                this.style.cursor = "hand";
                }
            }else{
               ImgD.width=image.width;
               ImgD.height=image.height;
            }
            ImgD.alt="点击查看大图";
        }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.alt="点击查看大图";
        }
    }
    image.delect
}

