<!--
var flag=false;
function DrawImage(ImgD,width){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 1){
if(image.width>width){ 
ImgD.width=width;
ImgD.height=(image.height*width)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
else{
if(image.height>width){ 
ImgD.height=width;
ImgD.width=(image.width*width)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
}
}
} 

function DrawImagew(ImgD,width){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width>width){ 
ImgD.width=width;
ImgD.height=(image.height*width)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
} 
}

function DrawImageh(ImgD,height){
var image=new Image();
image.src=ImgD.src;
if(image.height>0 && image.width>0){
flag=true;
if(image.height>height){ 
ImgD.height=height;
ImgD.width=(image.width*height)/image.height;
}else{
ImgD.height=image.height; 
ImgD.width=image.width;
}
}
} 

function DrawImagewh(ImgD,width,height){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if (width==0 && height==0) {
	ImgD.width=image.width; 
	ImgD.height=image.height;
	}
	else{
		if (width==0){
			DrawImageh(ImgD,height);
			}
			else{
				if (height==0){
					DrawImagew(ImgD,width);
					}
					else{
						ImgD.width=width; 
						ImgD.height=height;
						}
				}
		}
	}
} 

//-->