<!--

function checkdata()
{
var i = 0;         //word count - 'cwnumwords' words in crossword
var j = 0;         //letter count
var wlength = 0;
var wordscorrect = 0;         //counts number of correct answers

for ( i = 0; i < cwnumwords; i++)
  {

    if ( i < lasthorizontal )          //test horizontal words 
      {
        wlength = wordlength[i];
        xpos = xcord[i];
        ypos = ycord[i];
        var wordstring = '';
        for ( j = 0; j < wlength; j++)
         {
           if ( j < wlength -1 ) 
             wordstring = wordstring+'document.crosswordform.row'+ypos+'col'+xpos+'txt.value+';
           else
             wordstring = wordstring+'document.crosswordform.row'+ypos+'col'+xpos+'txt.value';
           xpos = xpos + 1;
         }
        var checkword = eval(wordstring);
        if ((checkword == uppercasewords[i]) || (checkword == lowercasewords[i]))
            wordscorrect++;
        else
         { 
          if (confirm('Would you like the correct answer to column '+xcord[i]+',row '+ycord[i]+', across?'))
            alert(lowercasewords[i]);
         }
      }
    else           //test vertical words 
      {
        wlength = wordlength[i];
        xpos = xcord[i];
        ypos = ycord[i];
        var wordstring = '';
        for ( j = 0; j < wlength; j++)
         {
           if ( j < wlength -1 ) 
             wordstring = wordstring+'document.crosswordform.row'+ypos+'col'+xpos+'txt.value+';
           else
             wordstring = wordstring+'document.crosswordform.row'+ypos+'col'+xpos+'txt.value';
           ypos = ypos + 1;
         }
        var checkword = eval(wordstring);
        if ((checkword == uppercasewords[i]) || (checkword == lowercasewords[i]))
            wordscorrect++;
        else
         { 
          if (confirm('Would you like the correct answer to column '+xcord[i]+',row '+ycord[i]+', down?'))
            alert(lowercasewords[i]);
         }
      }
}
document.crosswordform.answertxt.value = wordscorrect;
if (wordscorrect == cwnumwords )
  alert('Congratulations you have completed the entire crossword puzzle correctly!!!!!!');

}



function displayquestion(wordcount)
{
var questwindow = open('','questionwindow','height=200,width=400,scrollbars=no,toolbar=no,titlebar=no,resizable=no,hotkeys=no,directories=no,status=no,location=no,menubar=no,left=250,top=200,screenx=300,screeny=200');
questwindow.document.writeln('<p align=center>'+questionarray[wordcount]+'<p>');
questwindow.document.writeln('<table width="90%" align="center" border="0">');
questwindow.document.writeln('<tr>');
questwindow.document.writeln('<td width="50%" align="center"><input type="button" name="btnclose" value="Close" onclick="window.close()"></td>');
questwindow.document.writeln('</tr>');
questwindow.document.writeln('</table>');
questwindow.document.writeln('<br>');
questwindow.document.close();
questwindow.focus();
}


function displayquestion2(j,i)
{
var   questiontxt = j;

var questwindow = open('','questionwindow','height=200,width=400,scrollbars=no,toolbar=no,titlebar=no,resizable=no,hotkeys=no,directories=no,status=no,location=no,menubar=no,left=250,top=200,screenx=300,screeny=200');
questwindow.document.writeln('<p align=center>'+questiontxt+'<p>');
questwindow.document.writeln('<table width="90%" align="center" border="0">');
questwindow.document.writeln('<tr>');
questwindow.document.writeln('<td width="50%" align="center"><input type="button" name="btnclose" value="Close" onclick="window.close()"></td>');
questwindow.document.writeln('</tr>');
questwindow.document.writeln('</table>');
questwindow.document.writeln('<br>');
questwindow.document.close();
questwindow.focus();
}

//-->

