var flag=false;
function DrawImage1(ImgD){
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
 flag=true;
 if(image.width/image.height>=230/220){
 if(image.width>230){ 
 ImgD.width=230;
 ImgD.height=(image.height*220)/image.width;
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 else{
 if(image.height>220){ 
 ImgD.height=220;
 ImgD.width=(image.width*220)/image.height; 
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 }
} 

var flag=false;
function DrawImage2(ImgD){
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
 flag=true;
 if(image.width/image.height>=170/160){
 if(image.width>170){ 
 ImgD.width=170;
 ImgD.height=(image.height*170)/image.width;
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 else{
 if(image.height>160){ 
 ImgD.height=160;
 ImgD.width=(image.width*160)/image.height; 
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 }
} 


var flag=false;
function DrawImage3(ImgD){
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
 flag=true;
 if(image.width/image.height>=400/300){
 if(image.width>400){ 
 ImgD.width=400;
 ImgD.height=(image.height*400)/image.width;
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 else{
 if(image.height>300){ 
 ImgD.height=300;
 ImgD.width=(image.width*300)/image.height; 
 }else{
 ImgD.width=image.width; 
 ImgD.height=image.height;
 }
 }
 }
} 









