function ImageReSize(ImgName,iw,ih){
	var image=new Image();
	image.src=ImgName.src;
	if(image.width>0 && image.height>0){
		if(image.width/image.height>= iw/ih){
			if(image.width>iw){ 
				ImgName.width=iw;
				ImgName.height=(image.height*iw)/image.width;
			}else{
				ImgName.width=image.width; 
				ImgName.height=image.height;
			}
		}else{
			if(image.height>ih){ 
				ImgName.height=ih;
				ImgName.width=(image.width*ih)/image.height; 
			}else{
				ImgName.width=image.width; 
				ImgName.height=image.height;
			}
		}
	}
}