function DrawImage(ImgD,numW,numH)
{ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0)
  { 
	flag=true; 
	if(numW>0)
	{
		if(image.width>numW)
		{ 
			ImgD.width=numW; 
			ImgD.height=(image.height*numW)/image.width; 
		}
		else
		{ 
			ImgD.width=image.width; 
			ImgD.height=image.height; 
		}
	}
	else if(numH>0)
	{
		if(image.height>numH)
		{ 
			ImgD.height=numH; 
			ImgD.width=(image.width*numH)/image.height; 
		}
		else
		{ 
			ImgD.width=image.width; 
			ImgD.height=image.height; 
		} 
	}
  } 
}
