About the JavaScript used in this simulation
by Anthony Francis Cernosek 11/12/2003
Building the "starfield" display includes....
* Capturing (form) input to set "initial assumption" variables.
* Using a link to force a page reload ( The browser retains
the input values in the form fields, which avoids
posting to the server and speeds up the response.)
* Generating a 10 by 10 array of randomly selected images
as the page loads (or reloads). This
eliminates a lot of unnecessary coding.
* Detecting image onClick events to generate "results"
of the simulation run.
Generating results includes......
* Using the initial assumption variables in combination with
randomly generated numbers (based on real science) to calculate
specific planetary conditions.
* Converting those conditions from numeric values into
user-friendly text
* Displaying the text in a form textfield via "value = text".
* Displaying user selected graphics via a link,
into a new window.
Also .......
* Images are pre loaded as a single pixel ( invisible to user ),
in case the user did not come from the Home page (where the
images are also pre loaded into user's computer cache.)
Please view the code and Email suggestions to....
TCernosek (at) EarthLink.Net