PHP rand() equivalent for JavaScript
function rand(min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; }