candidate: The asylum was established by Edward Long Fox and considered state of the art when it opened in 1806 , having been built on moral treatment ideas pioneered at the York Retreat , which had opened in 1796 .