Lucky draw system in JavaScript