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