
function DrawImage(DrawImage,w,h)
{
	var flag=false;
	var image=new Image();
	image=DrawImage;
    flag=true;
    DrawImage.style.display="block";
    if(DrawImage.width!=0 && DrawImage.height!=0)
    {
      if(DrawImage.width>DrawImage.height)
      {
          if(DrawImage.width>w)
          {
            image.width=w;
            image.height = (w/DrawImage.width)*DrawImage.height;
            DrawImage = image;
          }

      }
      else
      {
          if(DrawImage.height>h)
          {
            image.height=h;
            image.width = (h/DrawImage.height)*DrawImage.width;
            DrawImage = image;
          }
      }
   }
}
