var flag=false; 
function DrawImage(ImgD,wt,ht){ 
//wt:设定图片显示宽度
//ht:设定图片显示高度
    var image=new Image(); 
    var xwidth=wt;
    var xheight=ht;
    var img;

    image.src=ImgD.src; 
    iwidth=image.width;
    iheight=image.height;

    if (image.width>0 && image.height>0){ 
       flag=true; 
       if (iwidth/iheight>= xwidth/xheight){ 
          if (image.width>xwidth){ 
             ImgD.width=xwidth; 
             ImgD.height=(iheight*xwidth/iwidth); 
          }else{ 
             ImgD.width=image.width; 
             ImgD.height=image.height; 
          }             
          ImgD.alt="look big photo"; 
       }else{
         if (image.height>xheight) { 
            ImgD.height=xheight; 
            ImgD.width=(iwidth*xheight/iheight); 
         }else{ 
            ImgD.width=xwidth; 
            ImgD.height=xheight; 
        }
        ImgD.alt="look big photo"; 
       }
    } 
} 
function showImg(event,imgId){
var x = event.clientX;
var y = event.clientY;
document.getElementById(imgId).style.display="block";
document.getElementById(imgId).style.left=x;
document.getElementById(imgId).style.top=y-20;
}
function hiddenImg(imgId){
document.getElementById(imgId).style.display="none";
}