Consolidated Statements of Comprehensive Income (Loss) (Unaudited) - USD ($)
$ in Thousands
6 Months Ended
Jun. 30, 2018
Jun. 30, 2017
Statement of Comprehensive Income [Abstract]    
Net income (loss) $ 2,339 $ (1,522)
Change in unrealized gains (losses) on marketable securities:    
Unrealized gains (loss) arising during the period (113) 69
Gains reclassified into net loss (29)
Net change (113) 40
Change in unrealized gains (losses) on cash flow hedges:    
Unrealized gains (loss) arising during the period (121) 390
Gains (loss) reclassified into net income (loss) 24 (369)
Net change (97) 21
Foreign currency translation adjustment (6) 127
Total other comprehensive income (loss) (216) 188
Comprehensive income (loss) $ 2,123 $ (1,334)