Income Taxes-Reconciliation to federal statutory rate (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2015
Dec. 31, 2014
Dec. 31, 2013
Income tax provision reconciliation to federal statutory rate      
Federal statutory income tax rate 35.00%    
Federal income taxes at statutory rate $ (11,121) $ 20,961 $ 28,385
State income taxes, net of federal benefit 1,872 1,975 988
Goodwill impairment 15,824 0 0
Foreign taxes 3,804 1,544 (778)
Change in valuation allowance 3,643 3,023 2,479
Research and development credits (1,912) (266) (1,909)
Foreign tax credits (651) (1,043) (3,542)
Nondeductible meals and entertainment 1,441 1,662 1,102
Tax rate changes 412 1,002 1,749
Other 520 (78) 1,292
Provision for income taxes 13,832 $ 28,780 $ 29,766
Undistributed earnings of foreign subsidiaries $ 139,396