Luck draw system in JavaScript