function ansCheck(str, ansArray, count)
{  str = str.toLowerCase();
   count = 1*count;
   for (var i=0; i < ansArray.length; i++) 
   {  if ( compAns(str, ansArray[i].toLowerCase(), count ) )
      {  alert("Fantastic!\nYou got it!");  return true;   }
   }
   alert("No, that is not it.\nYou may try agian.");
   return false;
}

function compAns(str, ans, count)
{   words = str.split(" ");
    found = -1;
    for (var i=0; i < words.length; i++)
    {   w = words[i]; 
        if ( w == "" ) continue;
        pos = ans.indexOf(w);
        if ( pos > found ) 
	{  found = pos; count--;  }
	else return false;
    }
    return (count == 0);
}


function logout()
{   if  ( navigator.userAgent.match(/MSIE/) )
    {  if (window.opener && !window.opener.closed)
         window.opener.close();
       window.close();
    }
    else
       window.confirm("Please close your browser to logout.\n Do this by the Quit option on the File menu.");
}

