//限制图像宽度
function DrawImages(ImgD,maxSize)
{
      var image=new Image();
      image.src=ImgD.src;
      if(image.width>0 && image.height>0)
      {
             if(image.width>maxSize)
             {
                 ImgD.width=maxSize;
                 ImgD.height=image.height*(maxSize/image.width);
             }
             else
             {
                 ImgD.width=image.width;
                 ImgD.height=image.height;
             }
     }	 
}