chkall=new Array(numxrefs)
for (i=1;i<=numxrefs; i++){chkall[i]=" "}
$okbox='
'
//********************
alph="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
re = / /gi;
//str = "Apples are round, and apples are juicy.";
newstr=str.replace(re, "");
var characterCode //literal character code will be stored in this variable
var x
var y
var wnum
var cnum
function checkEnter(e,wnum,cnum){ //e is event object passed from function invocation
if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}
findxy(wnum,cnum)
document.forms['frm'].elements[x].value=String.fromCharCode(characterCode).toUpperCase()
document.forms['frm'].elements[y].value=String.fromCharCode(characterCode).toUpperCase()
element=document.forms['frm'].elements[x]
element.style.backgroundColor='beige'
element=document.forms['frm'].elements[y]
element.style.backgroundColor='beige'
// check to see if the first letter of a word
if (cnum==1 || (!cnum && x.substring(1,3) == 1)) {
if (cnum==1) {
var asciiValue = wnum.charCodeAt(0); // asciiValue
}
else {
asciiValue = (x.substring(0,1)).charCodeAt(0)
}
tmp=asciiValue-64
tmpa="IN"+tmp.toString()
chrx=String.fromCharCode(characterCode)
chry=chrx.toUpperCase()
document.getElementById(tmpa).innerHTML=chry //String.fromCharCode(characterCode).toUpperCase()
}
return true
}
//find the cross-ref between word and quotation, return actual element number
function findxy(a,b) {
if (b)
{nnum=a+b.toString()
for (i=1; i<=numxrefs; i++){
if (nnum==xref[i]) {
x=i-1
break
}
}
for (i=numxrefs; i<=numxrefs*2; i++) {
if (document.forms['frm'].elements[i].name==nnum){
y=i
break
}
}
}
else {
x=xref[a]
y=a-1
}
}
function foc(n,m,p) {
clr=new Array('lime','beige','gray');
findxy(n,m)
element=document.forms['frm'].elements[x]
element.style.backgroundColor=clr[p]
element=document.forms['frm'].elements[y]
element.style.backgroundColor=clr[p]
return true
}
function solution() {
ls0='<'+'SCRIPT language="javascript">function key(){if (document.f.ky.value=="solve")'
+'{self.close();document.open("printversion.html","solution","width=30,height=30,top=100,left=700")}else {alert("Sorry, not the right key.")}}'+'script>'
ls00=''
ls1='<'+'/HEAD>'+'<'+'BODY>'
ls2=''
pop=window.open("","","width=200,height=200,scrollbars=no,left=500,top=150");
pop.document.write(ls0);
pop.document.write(ls00)
pop.document.write(ls1);
pop.document.write(ls2);
}
function print() {
document.open("printversion.html","print","width=30,height=30,top=100,left=701")
}
//***************
function check() {
for (i=1; i<=numxrefs; i++) {
if (document.forms['frm'].elements[xref[i]].value != newstr.substring(i-1,i).toUpperCase()) {
alert("Not completed correctly");return false
}
}
alert("Congratulations! Completed correctly.")
return true
}
//***********************
var vis=1
function msg(mnum) {
switch(mnum) {
case 0: document.getElementById("instr").style.visibility="hidden"
break;
case 1:
case 2:
case 3:
case 4:
document.getElementById("instr").style.visibility="visible"
document.getElementById("instr").innerHTML=eval("msg"+mnum)
break;
//if (vis==1) {
// document.getElementById("instr").style.visibility="hidden"
// document.getElementById("verdiv").innerHTML="HELP"
// vis=0
// }
//else {
// document.getElementById("instr").style.visibility="visible"
// document.getElementById("instr").innerHTML=msg4
// document.getElementById("verdiv").innerHTML="HIDE"
// vis=1
// }
}
}