function getRand($min, $max) { var rand = Math.random(); return Math.round($min + rand*($max - $min)); }