Javascript script for calculating numbers for lottery games