function jsHandleError(e,f,ln) // error, file, line
{
	document.display.box.value = "JavaScript Error: " + e + " (" + ln + ")";
	return true;
}

window.onerror = jsHandleError; // tell javaScript about error handler

var progHash = new Array;
	progHash["header"] = "This statement calls for the inclusion of a header file in your program. A header file contains predefined functions and variables that you may wish to use in more than one program, or that contain resources that are to be shared between parts of a program.";
progHash["namespace"] = "This statement disables the C++ namespace feature. As you acquire more C++ experience, you may wish to use namespaces, but for these tutorial programs the feature is disabled.";
	progHash["{"] = "This is an opening brace. Opening \"{\" and closing \"}\" braces enclose program statements that are to be executed as a group. There may be any number of such groups, and groups may be placed within other groups -- this is called \"nesting\".";
	progHash["}"] = "This is a closing brace. Opening \"{\" and closing \"}\" braces enclose program statements that are to be executed as a group. There may be any number of such groups, and groups may be placed within other groups -- this is called \"nesting\".";
	progHash["intvar"] = "This statement defines an integer numeric variable. An integer variable has a name, and contains a number. It can contain only whole numbers, and its value must lie within a specific range of values.";
	progHash["doublevar"] = "This statement defines a \"double\" numeric variable. A \"double\" variable has a name and contains a floating-point number, a number that can contain a fractional part. In a floating-point variable, 1/3 would be represented as 0.33333...";
	progHash["="] = "This is the assignment operator in C++. It means \"assign the value on the right to the variable on the left.\" It is very important to distinguish between the C++ assignment \"=\" and equality-comparison \"==\" operators. This is often a source of great confusion, and not just among students.";
	progHash["while"] = "The \"while ()\" statement repeatedly tests the condition within the parentheses \"()\" to the right, and if it is \"true\", executes the following statement(s) until the tested condition is no longer true.";
	progHash["functdef"] = "This is the first line of a a function definition. It specifies the type of variable to be returned by the function (if there is to be a returned value, \"void\" appears here if not), and within the parentheses \"()\", specifies any argument variables to be provided to the function when it is called. In the special case of the function named \"main()\", there are only a few acceptable ways it can be defined, and an integer value must be returned.";
	progHash["lessthan"] = "This (\"<\") is the \"less-than\" comparison operator. It is \"true\" if the value on the left is less than the value on the right.";
progHash["greaterthan"] = "This (\">\") is the \"greater-than\" comparison operator. It is \"true\" if the value on the left is greater than the value on the right.";
	progHash["numconst"] = "This is called a numeric constant. A numeric constant is used when a specific numeric value is known when the program is being written.";
	progHash["functcall"] = "This is a function call. The called function may accept a value or variable from the calling process, and may return a value or variable, which may be used as part of a statement in the calling code.";
	progHash["stream"] = "This is the name of a C++ stream (a way to handle input and output). It is usually the beginning of a statement in which objects are added to, or removed from, the stream.";
	progHash["insertop"] = "This (\"<<\") is the stream insertion operator. It places the variable at the right into the stream named at the beginning of the current line of code.";
progHash["extractop"] = "This (\">>\") is the stream extraction operator. It gives the variable at the right a value from the stream named at the beginning of the current line of code.";
	progHash["stringconst"] = "This is a \"string constant\", a series of characters that does not change, one that is compiled into your program.";
	progHash["streamop"] = "This is a stream operator. Stream operators are reserved words that cause a stream to act in specific ways.";
	progHash["x++"] = "This (++), when following a variable name, is called the post-increment operator. It is shorthand for n = n + 1, except that, if the variable is being tested, the variable's value is tested before the addition takes place.";
progHash["++x"] = "This (++), when preceding a variable name, is called the pre-increment operator. It is shorthand for n = n + 1, except that, if the variable is being tested, the variable's value is tested after the addition takes place.";
	progHash["return"] = "This is the function return statement. It returns a variable or value to the process that called this function. If a function is defined as returning void, no return statement should be present. The type of variable or value returned must agree with the type specified in the function definition.";
	progHash["streamvar"] = "The appearance of this variable name in this context causes its value to be inserted into the stream. C++ streams treat each variable type differently -- an integer variable, a double variable and a string variable all have different properties, and the stream knows how to deal with the differences.";
progHash["vartest"] = "This variable or number appears in this context to make it available for comparison with another variable or number. Typically, two such values are compared with a boolean comparison operator such as \"<\", \">\", or one of many other such operators.";

function showDesc(x)
{
	document.display.box.value = progHash[x];
}

function erase()
{
	document.display.box.value = "(point at an item in the code above)";
}

