[code]function rand(max, min) {
    return Math.round(min + Math.random() * (max - min));
}
[/code]