| **Acquisitions and Intangible Assets** | 6 Months Ended                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
||
| **Business Combinations [Abstract]**   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Acquisitons and Intangible Assets      | Acquisitions and Intangible AssetsOn October 26, 2012, the Bank completed the purchase of a branch at 63 Union Street in Rockland, Maine, from Camden National Bank that was formerly operated by Bank of America. As part of the transaction, the Bank acquired approximately $32,300,000 in deposits as well as a small volume of loans. On the same date, the Bank completed the purchase of a full-service bank building at 145 Exchange Street in Bangor, Maine, also from Camden National Bank, and opened a full-service branch in this building in the first quarter of 2013. The acquisition allows the Bank to expand its community banking franchise into eastern Maine and expand its presence in Rockland, Maine. The acquisition-date estimated fair values of assets acquired and liabilities assumed in Rockland and Bangor were as follows:Assets Cash$25,297,000Loans224,000Bank premises and equipment3,776,000Accrued interest receivable and other assets24,000Core deposit intangible432,000Goodwill2,121,000Liabilities Deposits$31,858,000Accrued interest and other liabilities16,000The purchase premium of $2,600,000 was allocated to assets acquired and liabilities assumed based on estimates of fair value at the date of acquisition. The fair value of the deposit accounts assumed was compared to the carrying amounts received and the difference of $432,000 was recorded as core deposit intangible. The core deposit intangible is subject to amortization over the estimated ten-year average life of the acquired core deposit base and will be evaluated for impairment periodically. The amortization expense is included in  noninterest expense in the consolidated statements of income and comprehensive income (loss) and is deductible for tax purposes. As of December 31, 2012, the amortization expense related to the core deposit intangible, absent any future impairment, is expected to be as follows:2013$43,000201443,000201543,000201643,000201743,000Thereafter217,000Total$432,000The banking facilities were valued at the most recent tax assessed value, which approximates fair value. The loans acquired were recorded at fair value at the time of acquisition. The estimated fair value of the loans acquired is equal to the carrying value. The excess of the purchase price over the fair value of the assets acquired, liabilities assumed, and the amount allocated for core deposit intangible totaled $2,121,000 and was recorded as goodwill. The goodwill is not amortizable forGAAP but is amortizable for tax purposes. Management periodically assesses qualitative factors to determine whether goodwill is impaired. Management is not aware of any such events or circumstances that would cause it to conclude that the goodwill is impaired.On January 14, 2005, the Company acquired FNB Bankshares (“FNB”) of Bar Harbor, Maine, and its subsidiary, The First National Bank of Bar Harbor. The total value of the transaction was $47,955,000, and all of the voting equity interest of FNB was acquired in the transaction. The transaction was accounted for as a purchase and the excess of purchase price over the fair value of net identifiable assets acquired equaled $27,559,000 and was recorded as goodwill, none of which was deductible for tax purposes. The portion of the purchase price related to the core deposit intangible is being amortized over its expected economic life, and goodwill is evaluated annually for possible impairment under the provisions of FASB ASC Topic 350, “Intangibles – Goodwill and Other”.  As of December 31, 2012, in accordance with Topic 350, the Company completed its annual review of goodwill and determined there has been no impairment. The Bank also carries $125,000 in goodwill for a de minimus transaction in 2001 |

| X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| - Definition
The entire disclosure for a business combination (or series of individually immaterial business combinations) completed during the period, including background, timing, and recognized assets and liabilities. The disclosure may include leverage buyout transactions (as applicable).
+ References
Reference 1: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 30 -Section 50 -Paragraph 2 -URI http://asc.fasb.org/extlink&oid=7488404&loc=d3e6996-128479Reference 2: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 7 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1524-128463Reference 3: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 1 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1383-128463Reference 4: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 30 -Section 50 -Paragraph 3 -URI http://asc.fasb.org/extlink&oid=7488404&loc=d3e7000-128479Reference 5: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Statement of Financial Accounting Standard (FAS) -Number 141R -Paragraph F4 -Subparagraph e -Appendix FReference 6: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 20 -Section 50 -Paragraph 4 -URI http://asc.fasb.org/extlink&oid=6910749&loc=d3e4934-128472Reference 7: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Statement of Financial Accounting Standard (FAS) -Number 141 -Paragraph 51, 52 -LegacyDoc This reference is SUPERSEDED by the Accounting Standards Codification effective for interim and annual periods ending after September 15, 2009.  This reference is included to help users transition from the previous accounting hierarchy and will be removed from future versions of this taxonomy.Reference 8: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 20 -Section 50 -Paragraph 2 -URI http://asc.fasb.org/extlink&oid=6910749&loc=d3e4922-128472Reference 9: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 20 -Section 50 -Paragraph 3 -URI http://asc.fasb.org/extlink&oid=6910749&loc=d3e4926-128472Reference 10: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Statement of Financial Accounting Standard (FAS) -Number 141R -Paragraph 67-73 -LegacyDoc This reference is SUPERSEDED by the Accounting Standards Codification effective for interim and annual periods ending after September 15, 2009.  This reference is included to help users transition from the previous accounting hierarchy and will be removed from future versions of this taxonomy.Reference 11: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Emerging Issues Task Force (EITF) -Number 88-16 -LegacyDoc This reference is SUPERSEDED by the Accounting Standards Codification effective for interim and annual periods ending after September 15, 2009.  This reference is included to help users transition from the previous accounting hierarchy and will be removed from future versions of this taxonomy.Reference 12: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 2 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1392-128463Reference 13: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 3 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1486-128463Reference 14: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 5 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1497-128463Reference 15: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 4 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1490-128463Reference 16: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 30 -Section 50 -Paragraph 4 -URI http://asc.fasb.org/extlink&oid=7488404&loc=d3e7008-128479Reference 17: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 30 -Section 50 -Paragraph 1 -URI http://asc.fasb.org/extlink&oid=7488404&loc=d3e6927-128479Reference 18: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 20 -Section 50 -Paragraph 1 -URI http://asc.fasb.org/extlink&oid=6910749&loc=d3e4845-128472Reference 19: http://www.xbrl.org/2003/role/presentationRef -Publisher FASB -Name Accounting Standards Codification -Topic 805 -SubTopic 10 -Section 50 -Paragraph 6 -URI http://asc.fasb.org/extlink&oid=7659399&loc=d3e1500-128463
+ Details**Name:**us-gaap_BusinessCombinationDisclosureTextBlock**Namespace Prefix:**us-gaap_**Data Type:**nonnum:textBlockItemType**Balance Type:**na**Period Type:**duration |
| X                                                                                                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| - Details**Name:**us-gaap_BusinessCombinationsAbstract**Namespace Prefix:**us-gaap_**Data Type:**xbrli:stringItemType**Balance Type:**na**Period Type:**duration |