Stock-based compensation (Details 2) (USD $)
3 Months Ended 9 Months Ended 3 Months Ended 6 Months Ended 9 Months Ended 12 Months Ended 3 Months Ended 9 Months Ended 3 Months Ended 9 Months Ended 3 Months Ended 9 Months Ended 3 Months Ended 9 Months Ended
Sep. 30, 2012
Sep. 30, 2011
Sep. 30, 2012
Sep. 30, 2011
Sep. 30, 2012
Stock options
Sep. 30, 2011
Stock options
Sep. 30, 2012
Stock options
Dec. 31, 2011
Stock options
Sep. 30, 2012
Stock options
Maximum
Sep. 30, 2012
Stock options
Maximum
Sep. 30, 2012
Stock options
Minimum
Sep. 30, 2012
Stock options
Minimum
Sep. 30, 2012
Stock options
Employees
Sep. 30, 2011
Stock options
Employees
Sep. 30, 2012
Stock options
Employees
Sep. 30, 2011
Stock options
Employees
Sep. 30, 2012
Stock options
Non-employees
Sep. 30, 2011
Stock options
Non-employees
Sep. 30, 2012
Stock options
Non-employees
Sep. 30, 2011
Stock options
Non-employees
Sep. 30, 2012
Restricted stock
Shares                                          
Outstanding at the beginning of the period (in shares)             617,633                            
Granted (in shares)           307,462 308,275           141,000   274,840       33,435    
Forfeited (in shares)             (98,366)                            
Outstanding at the end of the period (in shares)         827,542   827,542 617,633                          
Exercisable at the end of the period (in shares)         115,784   115,784                            
Vested and expected to vest at the end of the period (in shares)         761,507   761,507                            
Weighted average price per share                                          
Outstanding at the beginning of the period (in dollars per share)             $ 0.04                            
Granted (in dollars per share)             $ 4.84           $ 5.48   $ 4.91       $ 4.25    
Forfeited (in dollars per share)             $ 0.29                            
Outstanding at the end of period (in dollars per share)         $ 1.80   $ 1.80 $ 0.04                          
Exercisable at the end of the period (in dollars per share)         $ 0.34   $ 0.34                            
Vested and expected to vest at the end of the period (in dollars per share)         $ 1.78   $ 1.78                            
Weighted average remaining contractual term                                          
Outstanding at the end of the period             9 years 3 months 14 days 9 years 9 months 18 days                          
Exercisable at the end of the period             9 years 14 days                            
Vested and expected to vest at the end of the period             9 years 14 days                            
Aggregate intrinsic value                                          
Outstanding at the end of period         $ 3,046,000   $ 3,046,000 $ 2,162,000                          
Exercisable at the end of period         595,000   595,000                            
Vested and expected to vest at the end of the period         2,817,000   2,817,000                            
Shares                                          
Outstanding at the beginning of the period (in shares)                                         2,319,646
Vested (in shares)                                         (509,990)
Outstanding at the end of the period (in shares)                                         1,809,656
Weighted-average purchase price per share                                          
Outstanding at the beginning of the period (in dollars per share)                                         $ 0.002
Vested (in dollars per share)                                         $ 0.002
Outstanding at the end of the period (in dollars per share)                                         $ 0.002
Assumptions used to estimate fair value of each stock-based award on the grant date using the Black-Scholes option pricing model                                          
Risk free interest rate (as a percent)         0.90%         1.20%   0.80%                  
Volatility (as a percent)                 87.00% 87.00% 86.00% 79.00%                  
Expected term                 6 years 1 month 6 days 6 years 1 month 6 days 6 years 5 years 1 month 6 days                  
Additional disclosures                                          
Weighted average grant-date fair value of options granted (in dollars per share)                         $ 3.95   $ 3.52            
Stock-based compensation expense (in dollars) 300,000 30,000 859,000 38,500                 79,000 418,000 196,000 418,000 221,000 30,000 662,000 38,500  
Total unrecognized compensation cost related to non-vested stock options and restricted stock (in dollars)         $ 3,391,000   $ 3,391,000                            
Weighted average period for recognition of compensation cost related to unvested stock awards             2 years 10 months 24 days