 function DrawImage(ImgD ,iWW ,iHH){
	if (iHH==""){
		iHH=245;
	}
	if (iWW==""){
		iWW=300
	}
	
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
    	flag=true;
		
		if(image.width/image.height>= iWW/iHH){
		    if(image.width>iWW){  
			    ImgD.width=iWW;
			    ImgD.height=(image.height*iWW)/image.width;
			}else{
			     ImgD.width=image.width;  
			     ImgD.height=image.height;
		    }
	    }
    	else{
    		if(image.height>iHH){  
		    	ImgD.height=iHH;
				ImgD.width=(image.width*iHH)/image.height;     
			}else{
			    ImgD.width=image.width;  
		    	ImgD.height=image.height;
		    }
    	}
    }
} 
