Loans and allowance for loan losses (Details 4) - USD ($)
$ in Thousands
3 Months Ended
Mar. 31, 2016
Mar. 31, 2015
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment $ 10,793 $ 21,054
Interest Income Recognized 125 260
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 9,796 9,318
Interest Income Recognized 76 76
Total [Abstract]    
Average Recorded Investment 20,589 30,372
Interest Income Recognized 201 336
Construction and Land Development [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 98 3,199
Interest Income Recognized 11 40
Total [Abstract]    
Average Recorded Investment 1,842 3,786
Interest Income Recognized 17 44
Residential [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 0 232
Interest Income Recognized 0 1
Total [Abstract]    
Average Recorded Investment 0 232
Interest Income Recognized 0 1
Commercial [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 98 2,967
Interest Income Recognized 11 39
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 1,743 587
Interest Income Recognized 6 4
Total [Abstract]    
Average Recorded Investment 1,842 3,554
Interest Income Recognized 17 43
Commercial Real Estate [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 3,447 9,225
Interest Income Recognized 48 110
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 5,694 6,699
Interest Income Recognized 62 67
Total [Abstract]    
Average Recorded Investment 9,141 15,924
Interest Income Recognized 110 177
Owner Occupied [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 816 1,680
Interest Income Recognized 14 17
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 5,600 6,597
Interest Income Recognized 57 66
Total [Abstract]    
Average Recorded Investment 6,416 8,277
Interest Income Recognized 71 83
Non-Owner Occupied [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 2,631 6,563
Interest Income Recognized 34 87
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 94 102
Interest Income Recognized 5 1
Total [Abstract]    
Average Recorded Investment 2,725 6,665
Interest Income Recognized 39 88
Multifamily [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 0 968
Interest Income Recognized 0 6
Total [Abstract]    
Average Recorded Investment 0 968
Interest Income Recognized 0 6
Farmland [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 0 14
Interest Income Recognized 0 0
Total [Abstract]    
Average Recorded Investment 0 14
Interest Income Recognized 0 0
Home equity lines [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 1,287 800
Interest Income Recognized 0 4
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 30 0
Interest Income Recognized 0 0
Total [Abstract]    
Average Recorded Investment 1,317 800
Interest Income Recognized 0 4
First Deed of Trust [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 4,092 6,401
Interest Income Recognized 47 90
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 2,042 1,285
Interest Income Recognized 6 0
Total [Abstract]    
Average Recorded Investment 6,134 7,686
Interest Income Recognized 53 90
Second Deed of Trust [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 1,057 1,183
Interest Income Recognized 12 14
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 149 254
Interest Income Recognized 2 0
Total [Abstract]    
Average Recorded Investment 1,206 1,437
Interest Income Recognized 14 14
Consumer Real Estate [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 6,436 8,384
Interest Income Recognized 59 108
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 2,221 1,539
Interest Income Recognized 8 0
Total [Abstract]    
Average Recorded Investment 8,657 9,923
Interest Income Recognized 67 108
Commercial and industrial loans (except those secured by real estate) [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 797 227
Interest Income Recognized 7 2
Impaired Loans With Related Allowance Recorded [Abstract]    
Average Recorded Investment 138 493
Interest Income Recognized 0 5
Total [Abstract]    
Average Recorded Investment 936 720
Interest Income Recognized 7 7
Consumer And Other [Member]    
Impaired Loans With No Related Allowance Recorded [Abstract]    
Average Recorded Investment 15 19
Interest Income Recognized 0 0
Total [Abstract]    
Average Recorded Investment 15 19
Interest Income Recognized $ 0 $ 0