public function getFootnoteForFact( $fact, $lang = null, $linkrole = null, $arcrole = null, $footnoterole = null )
	{
		if ( ! is_array( $fact ) ) return false;
		if ( ! isset( $fact['id'] ) ) return false;

		$href = "#{$fact['id']}";
		if ( ! isset( $this->footnotes['arcs'][ $href ] ) ) return false;

		if ( ! $lang ) $lang = $this->getInstanceTaxonomy()->getDefaultLanguage();
		if ( ! isset( $this->footnotes[ XBRL_Constants::$footnote ][ $lang ] ) )
		{
			if ( ( $pos = strpos( $lang, '-' ) ) ) $lang = substr( $lang, 0, $pos );
		if ( ! isset( $this->footnotes[ XBRL_Constants::$footnote ][ $lang ] ) ) return false;
		}

		if ( is_null( $linkrole ) ) $linkrole = XBRL_Constants::$defaultLinkRole;
		if ( is_null( $arcrole ) ) $arcrole = XBRL_Constants::$arcRoleFactFootnote;
		if ( is_null( $footnoterole ) ) $footnoterole = XBRL_Constants::$footnote;

		// The role implied by $arcrole must be valid (contain arcs that use the arcrole)
		if ( ! isset( $this->footnotes['arcroles'][ $arcrole ] ) || ! in_array( $linkrole, $this->footnotes['arcroles'][ $arcrole ] ) )
		{
			return array();
		}

		// Based on the linkrole, workout the valid footnotes to include
		$footnoteIds = $this->footnotes['arcs'][ $href ][ $linkrole ]['footnote'];
		// Use the footnote ids to select the label text
		$footnotes = array();
		foreach ( $footnoteIds as $footnodeId )
		{
			if ( ! isset( $this->footnotes[ $footnoterole ][ $lang ][ $footnodeId ][ $linkrole ] ) )
			{
				continue;
			}
			$footnotes[] = $this->footnotes[ $footnoterole ][ $lang ][ $footnodeId ][ $linkrole ];
		}

		return $footnotes;
	}