//
function DrawImage(ImgD,height,width){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
    //alert(image.width);
      //flag=true; 
      if(image.width/image.height>= width/height){ 
       if(image.width>width){
        ImgD.width=width; 
        ImgD.height=(image.height*height)/image.width;
       }
       else
       { 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
       /*ImgD.alt="bigpic"  */
      } 
      else{ 
       if(image.height>height){
        ImgD.height=height; 
        ImgD.width=(image.width*height)/image.height; 
       }
       else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
       } 
      } 
    }  
} 

