// Basic zero-based random number generator
// i.e. returned value is an integer in the range of
// zero (0) to one less than the passed value of 'upper'

function get_random(upper)
{
    var ranNum= Math.floor(Math.random()*upper);
    return ranNum;
}