GAME = {
//Randomly generated letters
randLetter: function() {
var arrLetter = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
"X",
"Y", "Z");
//Randomly generated letters
var index = (() * 26);
return arrLetter[index];
},
//Random letter colors
randLetterColor: function() {
var arrLetterColor = new Array("Red", "Green", "#555", "Blue", "Black");
var index = (() * 4);
return arrLetterColor[index];
},
//Random letter size
randLetterSize: function() {
var arrLetterSize = new Array("12px", "16px", "20px", "24px", "28px", "32px", "36px", "40px");
var index = (() * 7);
return arrLetterSize[index];
},
//Create a DIV
divCreate: function(width, height, left, top, value) {
= width;
= height;
= ("div");
= width;
= height;
= left;
= top;
= value;
= ();
= ();
= ;
= "center";
= "bold";
// = "solid red 1px";
= "relative";
("map").appendChild();
return ;
},
// Whereabouts of DIV
divDown: function() {
var divTop = parseInt((0, -2)); //Top of letter squares
var mapHeight = parseInt(("map").(0, -2));
//It disappears
if (divTop < mapHeight - parseInt() + 20) {
= divTop + 30;
//Get the value of the key
= function() {
//Is the letter of the key equal to the value of the div
if (() == ) {
("TextRecord").value = "Correct";
= "none";
clearInterval();
(100, 100, (() * 300), -30, ());
}
else {
("TextRecord").value = "Error";
}
}
}
// When it reaches the bottom line, it disappears, and then create a DIV.
else {
= "none";
(100, 100, (() * 300), -30, ());
}
},
timeCreateID: null,
timeDownID: null,
START: function() {
(100, 100, 200, -40, ());
= setInterval("();", 1000);
('ButtonStart').disabled = 'disabled';
('ButtonStop').disabled = '';
},
STOP: function() {
if ( != null) {
clearInterval();
= "none";
}
('ButtonStart').disabled = '';
('ButtonStop').disabled = 'disabled';
}
}