/* ******************************************************************

randomNumber.js

Script written by Travis Saling - http://www.rainyside.com

Generates a pseudorandom number between the specified minimum and
maximum values. If option is set to 1 then the returned value will be
rounded to the nearest integer; otherwise it can be any real number
within the indicated range.

Because JavaScript's randomizing function depends on the real-time
clock, don't count on the ranges being inclusive unless you are using
the integer-only option (option=1).

****************************************************************** */

function randomNumber(minvalue,maxvalue,option)
  {
  var base_random = Math.random();
  var range = maxvalue - minvalue;
  var random_value = minvalue + base_random * range;
  if (option == 1) random_value = Math.round(random_value);
  return random_value;
  }

