﻿// JavaScript Document
var flag=false;
function DrawImage(ImgD,int_width,int_height){
	var image=new Image();
//	var int_width=166;
//	var int_height=92;
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= int_width/int_height){
			if(image.width>int_width){ 
				ImgD.width=int_width;
				ImgD.height=(image.height*int_width)/image.width;
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
			//ImgD.alt=image.width+"×"+image.height;
		}
		else{
			if(image.height>int_height){ 
				ImgD.height=int_height;
				ImgD.width=(image.width*int_height)/image.height; 
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
			//ImgD.alt=image.width+"×"+image.height;
		}
	}
} 
