Removed speed type out of php, into JS