Lunacy:
The origin of the word refers to intermittent periods of insanity, such as were believed to be triggered by the moon's cycle.
In later legal use it meant any unsoundness of mind sufficient to render one incapable of civil transactions or management of one's affairs.