1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

IMAGE imgs/tonge04.gif

Table 1. File types used by VChemLab.

The JavaScript molecule arrays are used for storing basic information; variables such as chemical name, project area, molecular weights, melting points, and safety data are stored within the arrays as strings, integer or floating point variables. Additionally, all entered structures must by default have a 2D structure representation (GIF image) and a set of 3D coordinates; the presence or absence of an experimental IR or NMR spectrum, or a X-ray crystal structure, is indicated from a set of logical switches. All arrays are held in a single JavaScript file as shown in Figure 2 :

function Molecule (ID, Molname, Filename, Project, Formula,
h1nmr, c13nmr, ir, uv, ms, xray,
mp, bp, ri, alpha_d,
safety0, safety1, safety2, safety3) {

this.ID = ID;
this.Molname = Molname;
this.Project = Project;
this.h1nmr = h1nmr;
this.ir= ir;
this.ms= ms;
this.mp = mp;
this.ri= ri;
this.safety0 = safety0;
this.safety2 = safety2;

return this;
}

var Mol = new Array(100); var numMols = Mol.length;

this.Filename = Filename; this.Formula= Formula; this.c13nmr= c13nmr; this.uv= uv;
this.xray= xray; this.bp= bp;
this.alpha_d = alpha_d; this.safety1 = safety1; this.safety3 = safety3;

Mol[0] = new Molecule (0, "benzene",
"benzen", "solvent", "C6H6",
0,0,0,1,0, 5.5,80.0,1.501,0.0,
"LD50 : 52g/kg (rat oral)", "Suspected carcinogen",
"Leukemogen", "Fire hazard");
Mol[1] = new Molecule (1, "styrene oxide",
"styrene_oxide", "NMR", "C8H8O",
1,0,1,0,1, -35.6,194.1,1.53,-22,5,
"Moderately toxic", "Animal carcinogen & Teratogen",
"Skin & eye irritant", "");

Figure 2. Construction of JavaScriptMolecule Data Array Object
(file JavaScriptArray.js)