The alert you can only use AFTER the call to the showResults function, WITHIN the onload eventhandler.
Also the speed variables are to be declared outside the showResults function, otherwise they are not available in the alert.
After those changes, I succeeded in an alert with non zero results.