Capacity
Generally contracts made with someone in these states will still be valid unless it can be shown that at the time that the contract is made one person is incapable of understanding the nature of the transaction and the other person knows this.
In such circumstances the contract is voidable (ie the party suffering from the lack of capacity can decide whether they want to terminate it).