random numbers should not use the random method and instead should rely on a user-defined function like the following one:
function UnixMachine() {
  if (navigator.appVersion.lastIndexOf('Unix') != -1)
     return true
  else
     return false
}

function randomNumber() {
  if (UnixMachine()) {
     num = Math.random() }
  else {
     num = Math.abs(Math.sin(Date.getTime())); }
  return num;
}

This generates a number between 0 and 1, and works well for applications needing random numbers every few seconds. If random numbers are needed with greater frequency, you need to add more variation into the equation, such as a different computation (cos, tan, log) every third division of time or something similar.

For more information, see:

Date and Math objects
random method
function and return statements



Chapter 26 -- JavaScript Internet Resources

Chapter 26

JavaScript Internet Resources


CONTENTS


Because of JavaScript's very specific platform base (it's currently only recognized by Netscape Navigator), the number of "official" online resources that directly address it are few and far between. However, the "unofficial" resources (put up by experimental souls who wish to share their discoveries in this new technology) are growing at a rapid rate.

The World Wide Web

Since JavaScript is for the Web, it's only appropriate that the best sources of information on its use are found on the Web. As with most other Internet-based sources, the bulk of Java/Script sites are primarily Java-oriented, with JavaScript covered as a subsection.

The following list is by no means comprehensive. To keep up on new offerings on the Web, your best bet is to take advantage of the Other Hot Links pages that many of the sites have.

Navigator was the first browser that supported JavaScript, making Netscape's home site a good place to check periodically, especially for updates/additions to the JavaScript language specification.

Netscape also has its own Development Partners Program, providing subscribers with extended technical and programming support, information on upcoming products, extensions, plug-ins, and access to pre-beta releases of new browsers, servers, and plug-ins.

Also be sure to check out the Netscape ColorCenter at http://www.hidaho.com/colorcenter/. This is a handy place to compare the values of colors against their appearance on the screen.

UseNet

Several UseNet newsgroups have sprung up to provide channels for developers looking for guidance with Java, JavaScript, and Web programming in general. These are as
follows.

Mailing Lists

For those who prefer the thrill of receiving e-mail until their inboxes burst, there are mailing lists dedicated to JavaScript that offer similar information to the UseNet newsgroups.

Keep in mind, however, that mailing lists are a lot like a telephone party line and can get rather chatty (the downside being that you have to wade through all the flotsam in your inbox to figure out what you can use).

If you plan to use mailing lists heavily, you might want to look into an e-mail program that enables threading, or linking together messages that share the same subject to help keep the volume organized.

A word about mailing lists. Although you post your questions and comments to the list's address (for rebroadcast to the rest of the list's readers), subscribing to and unsubscribing from the list are done through a separate e-mail address, specifically the address of the listserver.

The lists discussed below mention both the list address and the listserver address, and sending subscribe requests to the list address (so everyone on the list knows you don't know what you're doing) is a guaranteed way to get branded a "newbie."

If you want more information on how to communicate with the listserver (or on other possible lists of a particular server), you can send a message to the listserver address with "help" in the message body.