


/*                GetRandomURL
                  Written by Jerry Åman, Optima System, May 19, 1996.
*/
function GetRandomURL()

{
var locationlist = new URLList (

"http://www.hpmuseum.org/",

"http://www.hpcalc.org/",

"http://www.eportateis.com.br/hpclub/",

"http://www.hpcc.org/",

"http://www.areahp.tk",

"http://www.engr.uvic.ca/~aschoorl",

"http://www.holyjoe.org",

"http://www.hp.com/calculators",

"http://www.chotkeh.com/",

"http://www.cynox.de/",

"http://www.dvtg.com/",

"http://www.ramss.com/",

"http://www.smi.com/",

"http://www.tdsway.com/",

"http://www.wholesaleproducts.com/hpcalcs.html",

"http://www.wholesaleproducts.com/",

"http://www.yellow.de/",


"http://groups.google.com/groups?q=comp.sys.hp48"


 );

        num = Math.round ( ( rand.next() * (locationlist.count-1)) );
 return locationlist.list[num];

}


function URLList () {

  var argv = URLList.arguments;
  var argc = argv.length;
  this.list = new Object();

  for (var i = 0; i < argc; i++)
  this.list[i] = argv[i];
 this.count = argc;
  return this;

}


//*********************************************

// Park-Miller Pseudo-Random Number Generator

// JavaScript implementation by David N. Smith

// of IBM's T J Watson Research Center

//*********************************************

function NextRandomNumber()  {
  var hi   = this.seed / this.Q;
  var lo   = this.seed % this.Q;
  var test = this.A * lo - this.R * hi;
  if (test > 0)
    this.seed = test;
  else
    this.seed = test + this.M;
  return (this.seed * this.oneOverM);
}

function RandomNumberGenerator() {
  var d = new Date();
  this.seed = 2345678901 +

    (d.getSeconds() * 0xFFFFFF) +
    (d.getMinutes() * 0xFFFF);
  this.A = 48271;
  this.M = 2147483647;
  this.Q = this.M / this.A;
  this.R = this.M % this.A;
  this.oneOverM = 1.0 / this.M;
  this.next = NextRandomNumber;
  return this;

}

var rand = new RandomNumberGenerator();


