STOCK BASED COMPENSATION - Option activity for company's stock incentive plans (Details) - USD ($)
$ / shares in Units, $ in Thousands
12 Months Ended
Jun. 30, 2015
Jun. 30, 2014
Jun. 30, 2013
Jun. 30, 2012
Number of Shares        
Beginning Balance (in shares) 2,657,142 3,614,262 3,347,445  
Granted (in shares)     683,500  
Exercised (in shares) (299,034) (849,635) (266,558)  
Forfeitures and Cancellations (in shares) (56,964) (107,485) (150,125)  
Ending Balance (in shares) 2,301,144 2,657,142 3,614,262 3,347,445
Number of Shares, Vested and expected to vest, ending balance 2,295,811      
Number of Shares, Vested and exercisable, ending balance 2,167,482      
Weighted Average Exercise Price        
Beginning Balance, USD per share $ 2.96 $ 3.07 $ 1.45  
Granted, USD per share     11.29  
Exercised, USD per share 5.64 2.46 2.39  
Forfeitures and Cancellations, USD per share 12.14 10.55 5.68  
Ending Balance, USD per share 2.38 $ 2.96 $ 3.07 $ 1.45
Options, Weighted Average Exercise Price, Vested and expected to vest, USD per share 2.36      
Options, Weighted Average Exercise Price, Vested and exercisable, USD per share $ 1.83      
Options outstanding, Weighted Average Remaining Contractual Term 3 years 9 months 26 days 5 years 1 month 10 days 6 years 2 months 1 day 6 years 7 months 13 days
Options, Remaining Contractual Term, Vested and expected to vest 3 years 9 months 22 days      
Options, Weighted Average Remaining Contractual Term, Vested and exercisable 3 years 7 months 6 days      
Options outstanding, Intrinsic Value $ 67,969 $ 112,215 $ 52,330 $ 42,920
Options, Aggregate Intrinsic Value, Vested and expected to vest 67,860      
Options, Aggregate Intrinsic Value, Vested and exercisable $ 65,224