Janaazah

The laws pertaining to a person in the final stages of his life

Q: Could you explain to me the various masaa'il that pertain to a person in the last stages of his life? I have heard that the one who is in the last stages of his life cannot deal in his wealth freely. Therefore, I wish to find out that if a person in this state gifts something to a relative or a non-relative, will his gifting be valid? From which point will one regard a person to be in the final stages of his life?