// ************************* Do Not Modify ****************************** //var qs = document.location.search;qs = qs.substring(1, qs.length);pairs = new Array();getvar = new Array();names = new Array();values = new Array();var retval = parseOpts();if (retval) {		// A specific term was specified	if (values["term"] != null) {		if (Gloss[values["term"]] != null) {			document.writeln(startTable);			showItem("<b>" + values["term"] + "</b>", Gloss[values["term"]], values["term"]);			document.writeln(endTable);		} else {			notFound(values["term"]);		}	// Search for a term	} else if (values["search"] != null && values["search"] != "") {		var tablestarted = false;		var found = false;		var s = values["search"].toLowerCase();		for (var i in Gloss) {			if (i.toLowerCase().indexOf(s) != -1 ||					Gloss[i].toLowerCase().indexOf(s) != -1) {				found = true;				if (!tablestarted) {					document.writeln(startTable);					tablestarted = true;				}								// Highlight the search term				var item = i;				var def = Gloss[i];								var ind = i.toLowerCase().indexOf(s);				if (ind != -1) {					var slen = s.length;					item = i.substring(0, ind) + "<b>";					item += i.substring(ind, ind + slen) + "</b>";					item += i.substring(ind + slen, i.length);				}								ind = Gloss[i].toLowerCase().indexOf(s);				if (ind != -1) {					var slen = s.length;										// Check to make sure this is not in a tag					var tagCheck = Gloss[i].substring(0, ind);					var lastGT = tagCheck.lastIndexOf(">");					var lastLT = tagCheck.lastIndexOf("<");										if (lastLT == -1 || lastGT > lastLT) {						// Not in tag						def2 = Gloss[i].substring(0, ind) + "<b>";						def2 += Gloss[i].substring(ind, ind + slen) + "</b>";						def2 += Gloss[i].substring(ind + slen , Gloss[i].length);						ind = def2.toLowerCase().indexOf(s, ind + slen + 7);					} else {						def2 = Gloss[i];						ind = def2.toLowerCase().indexOf(s, ind + slen);					}					while(ind != -1) {						tagCheck = def2.substring(0, ind);						lastGT = tagCheck.lastIndexOf(">");						lastLT = tagCheck.lastIndexOf("<");												if (lastLT == -1 || lastGT > lastLT) {							// Not in tag							def = def2.substring(0, ind) + "<b>";							def += def2.substring(ind, ind + slen) + "</b>";							def += def2.substring(ind + slen , def2.length);							ind = def.toLowerCase().indexOf(s, ind + slen + 7);							def2 = def;						} else {							ind = def2.toLowerCase().indexOf(s, ind + slen);						}					}					def = def2;				}								showItem(item, def, i);			}		}		if (tablestarted) {			document.writeln(endTable);		}				if (! found){			document.writeln("Your search term was not found.");		}		// Show all terms	} else if (values["showall"] != null) {		document.writeln(startTable);		for (var i in Gloss) {			showItem("<b>" + i + "</b>", Gloss[i], i);		}		document.writeln(endTable);			// Nothing specified	} else {		document.writeln("No search terms were specified.");	}	} else {	document.writeln("No search terms were specified.");}function showItem(term, def, key) {	document.writeln(startRow + startCell + term + endCell);	document.writeln(startCell + def + endCell + endRow);		if (GlossImg[key] != null) {		document.write(startRow + startCell2 + GlossImg[key]);		document.writeln(endCell + endRow);	}}function notFound(term) {	document.writeln("The term you are looking for: " + term);	document.writeln(" was not found in the glossary.");}function parseOpts() {	if (qs.indexOf('&') != -1) {		pairs = qs.split('&');		pairs.sort();	} else {		if (qs != "") {			pairs[0] = qs;		} else {			// No query specified.			return(0);		}	}	for (i=0; i < pairs.length; i++) {		getvar = pairs[i].split("=");		var ind = getvar[0].substr(1, getvar[0].length);		names[ind] = getvar[0];		values[getvar[0]] = getvar[1];	}	return(1);}
