﻿
function DrawImage(ImgD,imgw,imgh){ 
	var flag=false; 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
	    flag=true; 
	    if(image.width/image.height>= imgw/imgh){ 
	        if(image.width>imgw){
	            ImgD.width=imgw; 
	            ImgD.height=(image.height*imgw)/image.width; 
	        }else{ 
	            ImgD.width=image.width;
	            ImgD.height=image.height; 
	        } 
	        ImgD.alt=image.width+"x"+image.height; 
	    }else{ 
	        if(image.height>imgh){
	            ImgD.height=imgh; 
	            ImgD.width=(image.width*imgh)/image.height; 
	        }else{ 
	            ImgD.width=image.width;
	            ImgD.height=image.height; 
	        } 
//	        ImgD.alt=image.width+"x"+image.height; 
	    } 
	}
}

function DrawImage1(ImgD,imgw){ 
	var flag=false; 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
	    flag=true; 
		if(image.width>imgw){
			ImgD.width=imgw; 
			ImgD.height=(image.height*imgw)/image.width; 
		}else{ 
			ImgD.width=image.width;
			ImgD.height=image.height; 
		} 
//		ImgD.alt=image.width+"x"+image.height; 	    
	}
}


function DrawImage2(ImgD,imgh){ 
	var flag=false; 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
	    flag=true; 
		if(image.height>imgh){
			ImgD.height=imgh; 
			ImgD.width=(image.width*imgh)/image.height; 
		}else{ 
			ImgD.width=image.width;
			ImgD.height=image.height; 
		} 
//		ImgD.alt=image.width+"x"+image.height; 	    
	}
}
//--> 

