We can start in the nineteenth century: the Mad Hatter from Through the Looking Glass was a caricature of a victim of mercury poisoning. Hat-makers used a lot of felt, and felt was manufactured with mercury, and so "mad as a hatter" was a very common - and thoroughly appropriate - simile at the time...