insane

Insane person issuing talaaq

Q: What is the shari'ah law about a person who is mentally I'll. His mood swings every know and then, not wearing cloths properly, arguing with every one include mother and wife and relative's. Don't sleep during Knight, doctors diagnosed him as psychotic patient with severe palpations and he is on medication. During one big argument he became insane what ever he is talking he is not aware of what he is saying. His wife said that he said talaaq repeatedly. What is the rule for it?