<?php
// anagrams.php
// Ask for scrambled word anagrams
// RJM Programming
// February, 2021
// Based on NetBeans Anagrams http://www.rjmprogramming.com.au/ITblog/netbeans-java-swing-anagrams-tutorial/


  $theword = array("");
  $topopt="";
  $lsel='<select onchange=lit(this); id=mylang>' . $topopt . '<option value="en">English</option><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select>&nbsp;';
  $simpleword="";
  $restis="";
  $lang="en";
  if (isset($_GET['lang'])) {
    $lang=str_replace("+", " ", urldecode($_GET['lang']));
    if (strpos(strtolower($lsel), 'value="' . strtolower($lang) . '">') !== false) {
    $topopt="<option value='" . strtoupper($lang) . "'>" . explode("<", explode('value="' . strtolower($lang) . '">', $lsel)[1])[0] . "</option>";
  $lsel='<select onchange=lit(this); id=mylang>' . $topopt . '<option value="en">English</option><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select>&nbsp;';
    }
  } else if (isset($_POST['lang'])) {
    $lang=str_replace("+", " ", urldecode($_POST['lang']));
    if (strpos(strtolower($lsel), 'value="' . strtolower($lang) . '">') !== false) {
    $topopt="<option value='" . strtoupper($lang) . "'>" . explode("<", explode('value="' . strtolower($lang) . '">', $lsel)[1])[0] . "</option>";
  $lsel='<select onchange=lit(this); id=mylang>' . $topopt . '<option value="en">English</option><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select>&nbsp;';
    }
  }
  
  function intoout($outt) {
    global $simpleword, $restis, $theword;
    if ($restis != "") {
    //file_put_contents("zzq.zzq", file_get_contents("zzq.zzq") . "\n" . "simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt . " and theword[0]=" . $theword[0]);
      $eqsbits=explode("=", $restis);
      $ilk=strlen($outt);
      for ($ieq=(-1 + $ilk); $ieq>=0; $ieq--) {
      for ($jeq=(-1 + sizeof($eqsbits)); $jeq>=1; $jeq--) {
    //file_put_contents("zzqq.zzqq", file_get_contents("zzqq.zzqq") . "\n-" . $jeq . " was=" . $outt . " simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
        if (substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1) == substr($outt, $ieq, 1)) {
    //file_put_contents("zzqq.zzqq", file_get_contents("zzqq.zzqq") . "\n+" . $jeq . " was=" . $outt . " simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
        if ($ieq <= 1) {
        $afters=substr($outt, (1 + $ieq));
        $outt="" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        } else {
        $afters=substr($outt, (1 + $ieq));
        $outt=substr($outt, 0, (-1 + $ieq)) . "" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        }
        }
      }   
      }   
    //file_put_contents("zzqq.zzqq", file_get_contents("zzqq.zzqq") . "\n" . " becomes=" . $outt . " simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
    }
    return $outt;
  }

  function reorder($tw) {
    global $simpleword, $restis;
    // restis=0=&#x03b5;1=&#x03bd;2=&#x03bf;3=&#x03c7;4=&#x03bb;5=&#x03b7;6=&#x03c4;7=&#x03b9;8=&#x03ba;9=&#x03ac;
    //file_put_contents("zq.zq", file_get_contents("zq.zq") . "\n" . "simpleword=" . $simpleword . " and restis=" . $restis);
    $outt="";
    $sofar=",";
    for ($ii=0; $ii<strlen($simpleword); $ii++) {
      $jj=rand(0, (-1 + strlen($simpleword)));
      while (strpos($sofar, "," . $jj . ",") !== false) {
        $jj=rand(0, (-1 + strlen($simpleword)));
      }
      $sofar.='' . $jj . ',';
      $outt.=substr($simpleword, $jj, 1);
    }
    if ($simpleword != $tw || $restis != "") {
      //intoout($outt);
    //} else if (1 == 2) {
      $eqsbits=explode("=", $restis);
      $ilk=strlen($outt);
      for ($ieq=(-1 + $ilk); $ieq>=0; $ieq--) {
      for ($jeq=(-1 + sizeof($eqsbits)); $jeq>=1; $jeq--) {
    //file_put_contents("zqq.zqq", file_get_contents("zqq.zqq") . "\n" . $jeq . " was=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
        if (substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1) == substr($outt, $ieq, 1)) {
        if ($ieq <= 1) {
        $afters=substr($outt, (1 + $ieq));
        $outt="" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        } else {
        $afters=substr($outt, (1 + $ieq));
        $outt=substr($outt, 0, (-1 + $ieq)) . "" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        }
        }
      }   
      }   
    //file_put_contents("zqq.zqq", file_get_contents("zqq.zqq") . "\n" . " becomes=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
    }
    return $outt;
  }

  $theg = "w";
  $tablehtml = "<table style='display:none;' cellpadding='5'>";
  $numtoguess = 0;
  $score = "0";
  $outof = "0";
  $eleven="11";
  $thirteen="13";
  
 if (isset($_GET['level'])) {
 
 if ($_GET['level'] == 'easiest') {
  $eleven="3";
  $thirteen="5";
 } else if ($_GET['level'] == 'easy') {
  $eleven="5";
  $thirteen="8";
 } else if ($_GET['level'] == 'hard') {
  $eleven="8";
  $thirteen="11";
 } else if ($_GET['level'] == 'difficult') {
  $eleven="11";
  $thirteen="13";
 } else {
  $eleven="11";
  $thirteen="13";
 }
  
 } else if (isset($_GET['easiest'])) {
  $eleven="3";
  $thirteen="5";
 } else if (isset($_GET['easy'])) {
  $eleven="5";
  $thirteen="8";
 } else if (isset($_GET['hard'])) {
  $eleven="8";
  $thirteen="11";
 } else if (isset($_GET['difficult'])) {
  $eleven="11";
  $thirteen="13";
 } else {
  $eleven="11";
  $thirteen="13";
 }

  //$theword = "";
  $theunderline = array("","","","");
  $inorder = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
  $outoforder = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
  $sparewsarray = array("", // "01F311", "0026F3", "0026BD", "00263C", "00263D", "00263E", "01F311", "0026F3", "0026BD", "0026f5", 
  "F09F91A0", "F09F9193", "F09F9098", "F09F9092", "F09F8E89",
  "F09F8DB0", "F09F8DA9", "F09F8DA8", "F09F8DA7", "F09F8DA3",
  "F09F8DB1", "F09F8E88", "F09F8EA7", "F09F8EA8", "F09F8EB5",
  "F09F8F88", "F09F9099", "F09F909E", "F09F90B6", "F09F90BC",
  "F09F90BE", "F09F938A", "F09F93A2", "F09F91BC", "F09F90AB",
  "F09F90A8", "F09F9097", "F09F8F80", "F09F8EB7", "F09F8EA9",
  "F09F8DAE", "F09F8D92", "F09F8F80", "F09F8C88", "F09F9AB2",
  "F09F9AA2", "F09F9A99", "F09F9A87", "F09F9A8F", "F09F9AA7",
  "F09F9AAA", "F09F9A83", "F09F9A87", "F09F9881", "F09F9882",
  "F09F98B8", "F09F9A92", "F09F9A87", "F09F9B80", "F09F8CB4",
  "F09F8CB5", "F09F8CB7", "F09F8C9F", "F09F8CBD", "F09F8CBE",
  "F09F8D84", "F09F8DB7", "F09F8D8F", "F09F8D9F", "F09F8DB5",
  "F09F8C89", "F09F8C8A", "F09F8C8B", "F09F8C87", "F09F8C86",
  "F09F8C81", "F09F8C82", "F09F8C82", "F09F8C83", "F09F8C84",
  "E29BAA", "E29BB2", "E29BBA", "E29B83", "F09F9A80",
  "F09F97BB", "F09F97BC", "F09F97BD", "F09F97BF", "F09F90A7",
  "F09F998B", "F09F9988", "F09F9989", "F09F998C", "F09F9896"); 
  $wsarray = array("", // "01F311", "0026F3", "0026BD", "00263C", "00263D", "00263E", "01F311", "0026F3", "0026BD", "0026f5", 
  "\xF0\x9F\x91\xA0", "\xF0\x9F\x91\x93", "\xF0\x9F\x90\x98", "\xF0\x9F\x90\x92", "\xF0\x9F\x8E\x89",
  "\xF0\x9F\x8D\xB0", "\xF0\x9F\x8D\xA9", "\xF0\x9F\x8D\xA8", "\xF0\x9F\x8D\xA7", "\xF0\x9F\x8D\xA3",
  "\xF0\x9F\x8D\xB1", "\xF0\x9F\x8E\x88", "\xF0\x9F\x8E\xA7", "\xF0\x9F\x8E\xA8", "\xF0\x9F\x8E\xB5",
  "\xF0\x9F\x8F\x88", "\xF0\x9F\x90\x99", "\xF0\x9F\x90\x9E", "\xF0\x9F\x90\xB6", "\xF0\x9F\x90\xBC",
  "\xF0\x9F\x90\xBE", "\xF0\x9F\x93\x8A", "\xF0\x9F\x93\xA2", "\xF0\x9F\x91\xBC", "\xF0\x9F\x90\xAB",
  "\xF0\x9F\x90\xA8", "\xF0\x9F\x90\x97", "\xF0\x9F\x8F\x80", "\xF0\x9F\x8E\xB7", "\xF0\x9F\x8E\xA9",
  "\xF0\x9F\x8D\xAE", "\xF0\x9F\x8D\x92", "\xF0\x9F\x8F\x80", "\xF0\x9F\x8C\x88", "\xF0\x9F\x9A\xB2",
  "\xF0\x9F\x9A\xA2", "\xF0\x9F\x9A\x99", "\xF0\x9F\x9A\x87", "\xF0\x9F\x9A\x8F", "\xF0\x9F\x9A\xA7",
  "\xF0\x9F\x9A\xAA", "\xF0\x9F\x9A\x83", "\xF0\x9F\x9A\x87", "\xF0\x9F\x98\x81", "\xF0\x9F\x98\x82",
  "\xF0\x9F\x98\xB8", "\xF0\x9F\x9A\x92", "\xF0\x9F\x9A\x87", "\xF0\x9F\x9B\x80", "\xF0\x9F\x8C\xB4",
  "\xF0\x9F\x8C\xB5", "\xF0\x9F\x8C\xB7", "\xF0\x9F\x8C\x9F", "\xF0\x9F\x8C\xBD", "\xF0\x9F\x8C\xBE",
  "\xF0\x9F\x8D\x84", "\xF0\x9F\x8D\xB7", "\xF0\x9F\x8D\x8F", "\xF0\x9F\x8D\x9F", "\xF0\x9F\x8D\xB5",
  "\xF0\x9F\x8C\x89", "\xF0\x9F\x8C\x8A", "\xF0\x9F\x8C\x8B", "\xF0\x9F\x8C\x87", "\xF0\x9F\x8C\x86",
  "\xF0\x9F\x8C\x81", "\xF0\x9F\x8C\x82", "\xF0\x9F\x8C\x82", "\xF0\x9F\x8C\x83", "\xF0\x9F\x8C\x84",
  "\xE2\x9B\xAA", "\xE2\x9B\xB2", "\xE2\x9B\xBA", "\xE2\x9B\x83", "\xF0\x9F\x9A\x80",
  "\xF0\x9F\x97\xBB", "\xF0\x9F\x97\xBC", "\xF0\x9F\x97\xBD", "\xF0\x9F\x97\xBF", "\xF0\x9F\x90\xA7",
  "\xF0\x9F\x99\x8B", "\xF0\x9F\x99\x88", "\xF0\x9F\x99\x89", "\xF0\x9F\x99\x8C", "\xF0\x9F\x98\x96"); 
  $azorder = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
  $eazorder = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
  $zazorder = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
  $wssofar = ";";
  $ws = rand(1, (sizeof($wsarray) - 2));
  for ($itr=0; $itr<sizeof($eazorder); $itr++) {
    while (strpos($wssofar, ";" . $ws . ";") !== false || $ws == 0) {
      $ws = rand(1, (sizeof($wsarray) - 2));
    }
    $eazorder[$itr] = $wsarray[$ws];
    $zazorder[$itr] = $sparewsarray[$ws];
    $wssofar .= ($ws . ";");
  }
  $donottouch = rand(0,25);
  if (isset($_POST['word1of6'])) {
    $theword[0] = $_POST['word1of6'];
    //$theword[1] = $_POST['word2of6'];
    //$theword[2] = $_POST['word3of6'];
    //$theword[3] = $_POST['word4of6'];
    //$theword[4] = $_POST['word5of6'];
    //$theword[5] = $_POST['word6of6'];
  } else if (isset($_GET['huhlarge'])) {
    if (strpos($_GET['huhlarge'], "~") !== false) {
    $theword = explode("~", $_GET['huhlarge']);
    } else {
    $theword[0] = $_GET['huhlarge'];
    }
  } else {
    $xxx="";
    if (isset($_GET['score'])) { $xxx="x"; }
    $theword[0] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=" . $eleven . "&max=" . $thirteen . "&com" . $xxx . "mon=tou" . $xxx . str_replace("&translateto=en", "", "ch&youllneverfindthis=y&translateto=" . substr($lang,0,2))));
    if (strpos($theword[0], "&#") !== false && strpos($theword[0], "/") !== false) {
      $restis=explode("/", $theword[0])[1];
      $simpleword=explode("/", $theword[0])[0];
      $eqsbits=explode("=", $restis);

      $theword[0]=$simpleword;

      if (1 == 5) {

      if ($restis == "") {
      $theword[0]=$simpleword;
      } else {
      $theword[0]=$simpleword;
      //file_put_contents("bzzqq.bzzqq", $theword[0]);
      $eqsbits=explode("=", $restis);
      $ilk=strlen($theword[0]);
      for ($ieq=(-1 + $ilk); $ieq>=0; $ieq--) {
      for ($jeq=(-1 + sizeof($eqsbits)); $jeq>=1; $jeq--) {
    //file_put_contents("zzqq.zzqq", file_get_contents("zzqq.zzqq") . "\n-" . $jeq . " was=" . $outt . " simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
        if (substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1) == substr($theword[0], $ieq, 1)) {
    //file_put_contents("zzqq.zzqq", file_get_contents("zzqq.zzqq") . "\n+" . $jeq . " was=" . $outt . " simpleword=" . $simpleword . " and restis=" . $restis . " and outt=" . $outt); // . $outt . " and becomes=" . str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "&#" . explode($eqsbits[0 + $jeq], ";")[0] . ";", $outt));
        if ($ieq <= 1) {
        $afters=substr($theword[0], (1 + $ieq));
        $theword[0]="" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        } else {
        $afters=substr($theword[0], (1 + $ieq));
        $theword[0]=substr($theword[0], 0, (-1 + $ieq)) . "" . explode(";", $eqsbits[0 + $jeq])[0] . ";" . $afters;
        }
        }
      }   
      }   
      }
      
      }
      
      //for ($jeq=1; $jeq<sizeof($eqsbits); $jeq++) {
      //  $theword[0]=str_replace(substr($eqsbits[-1 + $jeq], (-1 + strlen($eqsbits[-1 + $jeq])), 1), "" . explode(";", $eqsbits[0 + $jeq])[0] . ";", $theword[0]);
      //}
    } else {
      $simpleword=trim($theword[0]);
    }
    if ($theword[0] != trim($theword[0])) {
      $theword[0] = trim($theword[0]);
    } else {
    }
    $tablehtml = "<p>Scrambled Word: " . reorder($theword[0]) . "</p><br>Your Guess: <input id=myguess type=text value=''></input><br><br><input id=theguess data-correct=" . $theword[0] . " onclick=\"checkorder(this, document.getElementById('myguess'));\" type=button value=Guess></input>&nbsp;<input onclick=goagain(0); type=button value='New Word'></input>&nbsp;<input type=button onclick='goagain(8000);' value='Please Show'></input><br><table style='display:none;' cellpadding='5'>";
    //$theword[1] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=11&max=13&common=touch&youllneverfindthis=y"));
    //$theword[2] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=11&max=13&common=touch&youllneverfindthis=y"));
    //$theword[3] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=11&max=13&common=touch&youllneverfindthis=y"));
    //$theword[4] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=11&max=13&common=touch&youllneverfindthis=y"));
    //$theword[5] = strtolower(file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . "/PHP/surprise.php?min=11&max=13&common=touch&youllneverfindthis=y"));
  }
  
  if (isset($_GET['okguesslist'])) {
    if (strpos($_GET['okguesslist'], "~") !== false) {
    $okguesslist = explode("~", $_GET['okguesslist']);
    } else {
    $okguesslist = array($_GET['okguesslist']);
    }
  } else {
    $okguesslist = array($azorder[$donottouch]);
  }
  

  
  for ($m=0; $m<26; $m++) {
    $asis = 0;
    for ($k=0; $k<sizeof($okguesslist); $k++) {
          $proposed = $k;
          if (strtolower($azorder[$m]) == strtolower($okguesslist[$k])) {
            $azorder[$m] = strtolower($azorder[$m]);
            $asis = 1;
            $outoforder[$m] = $inorder[$m];
          }
    }
    if ($asis == 0) {
          if (1 == 1) {
            $ok = 0;
            while ($ok == 0) {
             $ok = 1;
             $proposed = rand(0,25);
             if ($proposed == $m) $ok = 0;
             for ($kk=0; $kk<sizeof($okguesslist); $kk++) {
               if (strtolower($azorder[$proposed]) == strtolower($okguesslist[$kk])) $ok = 0;
             }
             for ($kk=0; $kk<$m; $kk++) {
               if ($outoforder[$kk] == $proposed) $ok = 0;
             }
            }
            $outoforder[$m] = $proposed;  
          }
    }
  }
  
  for ($j=0; $j<(6 - 5*1); $j++) {
   $tablehtml .= "<tr>";
   for ($i=0; $i<strlen($theword[$j]); $i++) {
    $asis = 0;
    for ($k=0; $k<sizeof($okguesslist); $k++) {
          if (strtolower(substr($theword[$j], $i, 1)) == strtolower($okguesslist[$k])) {
            $asis = 1;
          }
    }
    $tablehtml .= "<td id='" . ($j + 1) . ($i + 1) . "' align='center' style='background-color:pink;'>";
    if ($asis == 1) {
          $theunderline[$j] .= strtolower(substr($theword[$j], $i, 1));
          $tablehtml .= "<span style='color:red; font-size:20px;'><b><i>" . strtolower(substr($theword[$j], $i, 1)) . "</i></b></span>";
    } else {
          $numtoguess = $numtoguess + 1; 
          $kk = 0;
          for ($m=0; $m<26; $m++) {
             if (strtolower(substr($theword[$j], $i, 1)) == strtolower($azorder[$m])) $kk = $m;
          }
          $theunderline[$j] .= strtoupper($azorder[$outoforder[$kk]]);
          $tablehtml .= '<select id="guess' . ($j + 1) . ($i + 1) . '" name="guess' . ($j + 1) . ($i + 1) . '" onchange=" guessmade(this,' . ($j + 1) . ',' . ($i + 1) . ',1); " style=" visibility:hidden; text-align:center; font-size:20px; background-color: yellow; ">';
          $ztablehtml = "<option value=''>Letters</option>"; // 
          $ztablehtml .= '<option value="a">a</option>';
          $ztablehtml .= '<option value="b">b</option>';
          $ztablehtml .= '<option value="c">c</option>';
          $ztablehtml .= '<option value="d">d</option>';
          $ztablehtml .= '<option value="e">e</option>';
          $ztablehtml .= '<option value="f">f</option>';
          $ztablehtml .= '<option value="g">g</option>';
          $ztablehtml .= '<option value="h">h</option>';
          $ztablehtml .= '<option value="i">i</option>';
          $ztablehtml .= '<option value="j">j</option>';
          $ztablehtml .= '<option value="k">k</option>';
          $ztablehtml .= '<option value="l">l</option>';
          $ztablehtml .= '<option value="m">m</option>';
          $ztablehtml .= '<option value="n">n</option>';
          $ztablehtml .= '<option value="o">o</option>';
          $ztablehtml .= '<option value="p">p</option>';
          $ztablehtml .= '<option value="q">q</option>';
          $ztablehtml .= '<option value="r">r</option>';
          $ztablehtml .= '<option value="s">s</option>';
          $ztablehtml .= '<option value="t">t</option>';
          $ztablehtml .= '<option value="u">u</option>';
          $ztablehtml .= '<option value="v">v</option>';
          $ztablehtml .= '<option value="w">w</option>';
          $ztablehtml .= '<option value="x">x</option>';
          $ztablehtml .= '<option value="y">y</option>';
          $ztablehtml .= '<option value="z">z</option>';
          if (1 == 1) {
          //$ztablehtml = str_replace("'>Letters", $zazorder[$outoforder[$kk]] . "'>" . $eazorder[$outoforder[$kk]], $ztablehtml);
          $ztablehtml = str_replace("Letters", $eazorder[$outoforder[$kk]], $ztablehtml);
          } else {
          $ztablehtml = str_replace('"' . strtolower($azorder[$outoforder[$kk]]) . '">', '"' . strtolower($azorder[$outoforder[$kk]]) . '" selected="selected">', $ztablehtml);
          }
          $ztablehtml = str_replace('"' . strtolower(substr($theword[$j], $i, 1)) . '"', '"' . strtoupper(substr($theword[$j], $i, 1)) . '"', $ztablehtml);
          $tablehtml .= $ztablehtml;
          //$tablehtml .= '</select><input type="hidden" id="ih' . ($j + 1) . ($i + 1) . '" value="' . strtolower($azorder[$outoforder[$kk]]) . '"></input>';
          $tablehtml .= '</select><input title=' . $theword[0] . ' type="text" id="ih' . ($j + 1) . ($i + 1) . '" value="' . strtolower(substr($theword[0],$kk,1)) . '"></input>';
    }
    $tablehtml .= "</td>";
   }
   $tablehtml .= "</tr>";
  }
  $tablehtml .= "</table>";
  if (isset($_GET['score'])) {
    $score=$_GET['score'];
  }
  if (isset($_GET['outof'])) {
    $outof=$_GET['outof'];
  }
  if (isset($_POST['score'])) {
    $score=$_POST['score'];
  }
  if (isset($_POST['outof'])) {
    $outof=$_POST['outof'];
  }
echo "\n" . '<!doctype html>' . "\n";
echo "\n" . '<html>' . "\n";
echo "\n" . '<head>' . "\n";
echo "\n" . '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . "\n";
echo "\n" . '<link href="//www.rjmprogramming.com.au/PHP/emboss_h1.css" rel="stylesheet" type="text/css">' . "\n";
echo "\n" .  '<title>Anagrams - RJM Programming - February, 2021 ... thanks to NetBeans Anagrams</title>' . "\n";
echo "\n" . '<script src="../HTMLCSS/multipurpose_buttons.js" rel="stylesheet" type="text/javascript"></script>' . "\n";
echo "\n" . '<script type="text/javascript">' . "\n";
echo "\n" . 'var overgoes=0;' . "\n";
echo "\n" . 'var score=0;' . "\n";
echo "\n" . 'var outof=0;' . "\n";
echo "\n var goes=0, zhr=null, zform=null, ajitone='', ajittwo=''; \n";
echo "\n" . 'var guess="";' . "\n";
echo "\n" . 'var ajurl="' . 'http://' . $_SERVER['SERVER_NAME'] . str_replace("::",":",":" . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~"))))) . '/PHP/surprise.php";' . "\n";
echo "\n" . 'var lettersdone="";' . "\n";
echo "\n numguess = " . $numtoguess . "; \n";

  $huhl = "\n var ooo = '";
  for ($m=0; $m<26; $m++) {
    $huhl .= " " . $outoforder[$m];
  }
  $huhl .= "'; \n";
  //echo $huhl;
  if (isset($_GET['score'])) {
    echo "\n score=" . $_GET['score'] . "; \n";
  }
  if (isset($_GET['outof'])) {
    echo "\n outof=" . $_GET['outof'] . "; \n";
  }
?>
 

function golater() {
    location.href = ("./anagrams.php?lang=<?php  global $lang;  echo substr($lang,0,2); ?>&<?php echo $eleven; ?>=&score=" + score + "&outof=" + outof).replace('&11=', '&level=difficult').replace('&8=', '&level=hard').replace('&5=', '&level=easy').replace('&3=', '&level=easiest');
}

function goagain(pshow) {
    outof = outof + 1;
    if (pshow != 0) {
      document.getElementById('w0of6').style.display = 'block';
      document.getElementById(document.getElementById('doubleu').value + '1of6').style.display = 'block';
      //document.getElementById('w2of6').style.display = 'block';
      //document.getElementById('w3of6').style.display = 'block';
      //document.getElementById('w4of6').style.display = 'block';
      //document.getElementById('w5of6').style.display = 'block';
      //document.getElementById('w6of6').style.display = 'block';
      document.body.style.cursor='progress';
      setInterval(golater, pshow);
    } else {
      document.body.style.cursor='progress';
      location.href = ("./anagrams.php?<?php echo $eleven; ?>=&score=" + score + "&outof=" + outof).replace('?11=', '?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&level=difficult').replace('?8=', '?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&level=hard').replace('?5=', '?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&level=easy').replace('?3=', '?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&level=easiest');
    }
 }

  function showStuff() {
  if (zhr != null) {
  if (zhr.readyState == 4) {
    if (zhr.status == 200) {
      if ((zhr.responseText.indexOf('</p>') != -1 && zhr.responseText.indexOf('></p>') == -1) || zhr.responseText.trim() != '') {
      document.getElementById('myguess').setAttribute('data-correct', ajitone);
      score = score + 1;
      ajitone='';
      ajittwo='';
      goagain(0);
      } else {
      ajitone='';
      ajittwo='';
      alert('Try again.' + zhr.responseText + '!');
      }
    }
  }
  }
  }
  
  function checkit(iois) {
  var idhtml='';
  if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
     if (aconto.document) { aconto = aconto.document; }
     if (aconto.body != null) {
       idhtml=aconto.body.innerHTML.replace('<p>','').replace('</p>','');
     }
    }
  }
  if (iois.src.indexOf('?') != -1) {
  if (idhtml != '') {
      document.getElementById('myguess').setAttribute('data-correct', ajitone);
      score = score + 1;
      ajitone='';
      ajittwo='';
      goagain(0);
  } else {
      ajitone='';
      ajittwo='';
      alert('Try again.');
  }
  }
  }

  function ajit(ansis, anaof) {
  // http://localhost:8888/PHP/surprise.php?iswordthere=late&anagramof=teal&youllneverfindthis=y
  ajitone=ansis;
  ajittwo=anaof;
  if (1 == 1) {
  //alert(ajurl + '?iswordthere=' + ansis + '&anagramof=' + anaof + '&youllneverfindthis=y');
  if (anaof.trim() == '') {
  document.getElementById('ifhuh').src=document.getElementById('ifhuh').src.split('?')[0] + '?iswordthere=' + ansis + '&youllneverfindthis=y';
  } else { 
  document.getElementById('ifhuh').src=document.getElementById('ifhuh').src.split('?')[0] + '?iswordthere=' + ansis + '&anagramof=' + anaof + '&youllneverfindthis=y';
  }
  } else {
  zhr = new XMLHttpRequest();
  zform = new FormData();
  zform.append('iswordthere', ansis);
  if (anaof.trim() != '') { zform.append('anagramof', anaof);  }
  zform.append('youllneverfindthis', 'y');
   zhr.open('get', ajurl, true);
  zhr.onreadystatechange = showStuff;
  zhr.send(zform);
  }
  }

  function checkorder(twoo, tval) {
    var isleft=tval.value.toLowerCase();
    if (window.htmlentities.mapencode(tval.value.toLowerCase()) == window.htmlentities.mapencode(twoo.getAttribute('data-correct').toLowerCase())) {
      score = score + 1;
      goagain(0);
    } else if (tval.value.toLowerCase().length == twoo.getAttribute('data-correct').toLowerCase().length) {
      for (var iuty=0; iuty < eval('' + tval.value.length); iuty++) {
        isleft=isleft.replace(twoo.getAttribute('data-correct').toLowerCase().substring(iuty, eval(1 + iuty)), '');
      }
      if (isleft == '') {
      ajit(tval.value.toLowerCase(), twoo.getAttribute('data-correct').toLowerCase());
      }
    } else {
      alert('Try again.');
    }
  }

function guessmade(thiso, wordi, posi, firstcall) {
  if (thiso.style.backgroundColor == 'red') {
    var ddah = "word" + wordi + "of6";
    var dodah = document.getElementById(ddah);
    var dodahv = dodah.value;
    //alert('here ' + dodah.value);
    //alert(thiso.value + " vs " + dodahv.substring((posi-1),posi).toUpperCase());
    thiso.value = dodahv.substring((posi-1),posi).toUpperCase();
  } else if (thiso.value == "") {
    thiso.value = document.getElementById("ih" + wordi + posi).value;
  } else if (thiso.value == thiso.value.toUpperCase()) {
    if (thiso.style.backgroundColor != 'red') {
       numguess = numguess - 1;
       //alert("numguess=" + numguess);
       thiso.style.backgroundColor = 'red';
       if (firstcall == 1) {
       var ii, jj, kk, sval;
       var origval = document.getElementById("ih" + wordi + posi).value;
       //alert("origval.substring((kk-1),kk)=" + origval);
       for (ii=1; ii<=6; ii++) {
         jj = document.getElementById("word" + ii + "of6").value.length;
       //alert("jj=" + jj);
         for (kk=1; kk<=jj; kk++) {
            sval = document.getElementById("guess" + ii + kk);
       //alert("sval.value=" + sval.value + " for guess" + ii + kk);
            if (sval != null) {
            if (sval.value == origval && sval.style.backgroundColor != 'red') {
       //alert("candidate=" + thiso.value + " for guess" + ii + kk);
              sval.value = thiso.value;
              guessmade(sval, ii, kk, 0);
            }
            }
         } 
       }
       }
    }
    if (numguess == 0) {
      score = score + 1;
      if (1 == 1) {
        goagain(9000);
      } else {
        outof = outof + 1;
        location.href = ("./anagrams.php?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&<?php echo $eleven; ?>=&score=" + score + "&outof=" + outof).replace('&11=', '&level=difficult').replace('&8=', '&level=hard').replace('&5=', '&level=easy').replace('&3=', '&level=easiest');
      }
    }
  } else {
    thiso.value = document.getElementById("ih" + wordi + posi).value;
  }
  
}

function lit(sois) {
  location.href=(document.URL.split('?')[0].split('#')[0] + '?lang=' + sois.value.toLowerCase() + "&<?php echo $eleven; ?>=&score=" + score + "&outof=" + outof).replace('&11=', '&level=difficult').replace('&8=', '&level=hard').replace('&5=', '&level=easy').replace('&3=', '&level=easiest');
}

function changelevel(sois) {
  location.href=(document.URL.split('?')[0].split('#')[0] + '?lang=<?php   global $lang;  echo substr($lang,0,2); ?>&level=' + sois.value + '&score=<?php echo $score; ?>' + '&outof=<?php echo $outof; ?>').replace('&score=0&outof=0','');
}
</script>
</head>
<?php

 if (isset($_GET['badluck'])) {
  echo "\n <body style=\"background-color: cyan;\"> \n";
 } else {
  echo "\n <body style=\"background-color: cyan;\"> \n";
 }
 echo "<div align=\"center\">";
 if (isset($_GET['level'])) {
 
 if ($_GET['level'] == 'easiest') {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if ($_GET['level'] == 'easy') {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy selected>Easy</option><option value=hard>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if ($_GET['level'] == 'hard') {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard selected>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if ($_GET['level'] == 'difficult') {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult selected>Difficult</option></select> Anagrams</h1>";
 } else {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult selected>Difficult</option></select> Anagrams</h1>";
 }
  
 } else if (isset($_GET['easiest'])) {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if (isset($_GET['easy'])) {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy selected>Easy</option><option value=hard>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if (isset($_GET['hard'])) {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard selected>Hard</option><option value=difficult>Difficult</option></select> Anagrams</h1>";
 } else if (isset($_GET['difficult'])) {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult selected>Difficult</option></select> Anagrams</h1>";
 } else {
 echo "<h1 id=\"gamename\">" . $lsel . "<select id=level onchange=changelevel(this);><option value=easiest>Easiest</option><option value=easy>Easy</option><option value=hard>Hard</option><option value=difficult selected>Difficult</option></select> Anagrams</h1>";
 }
 
  global $score, $outof;
  if ($outof < $score) {
    $outof = $score;
  }
  echo "\n <h2 id='scoreis'>Score: " . $score . " / " . $outof . "</h2> \n";
  echo "\n" . '<form id="gform" method="POST" action="http://' . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . '/PHP/surprise.php">' . "\n";
?>
<input type="hidden" id="sword" name="sword" value="<?php echo $theword[0]; ?>" />
<input type="hidden" id="word1of6" name="word1of6" value="<?php echo $theword[0]; ?>" />
<!--input type="hidden" id="word2of6" name="word2of6" value="<?php echo $theword[1]; ?>" />
<input type="hidden" id="word3of6" name="word3of6" value="<?php echo $theword[2]; ?>" />
<input type="hidden" id="word4of6" name="word4of6" value="<?php echo $theword[3]; ?>" />
<input type="hidden" id="word5of6" name="word5of6" value="<?php echo $theword[4]; ?>" />
<input type="hidden" id="word6of6" name="word6of6" value="<?php echo $theword[5]; ?>" /-->
<input type="hidden" name="comXmon" value="touXch"></input>
<input type="hidden" name="translateto" value="<?php   global $lang;  echo substr($lang,0,2); ?>" />
<input type="hidden" id="score" name="score" value="<?php echo $score; ?>" />
<input type="hidden" id="outof" name="outof" value="<?php echo $outof; ?>" />
<input type="text" onclick=" window.open('http://www.google.com/search?q=<?php echo urlencode($theword[0]); ?>','<?php echo intoout($theword[0]); ?>',' height=560,width=900,top=370,left=400 '); " style="display:none;" id="g1of6" name="g1of6" value="<?php echo intoout($theword[0]); ?>" />
<input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo intoout($theword[0]); ?>','<?php echo intoout($theword[0]); ?>',' height=560,width=900,top=370,left=400 '); " style="display:none;" id="w1of6" name="w1of6" value="<?php echo intoout($theword[0]); ?>" />
<!--input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo $theword[1]; ?>','<?php echo $theword[1]; ?>',' height=560,width=900,top=170,left=400 '); "  style="display:none;" id="w2of6" name="w2of6" value="<?php echo $theword[1]; ?>" />
<input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo $theword[2]; ?>','<?php echo $theword[2]; ?>',' height=560,width=900,top=170,left=400 '); "  style="display:none;" id="w3of6" name="w3of6" value="<?php echo $theword[2]; ?>" />
<input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo $theword[3]; ?>','<?php echo $theword[3]; ?>',' height=560,width=900,top=170,left=400 '); "  style="display:none;" id="w4of6" name="w4of6" value="<?php echo $theword[3]; ?>" />
<input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo $theword[4]; ?>','<?php echo $theword[4]; ?>',' height=560,width=900,top=170,left=400 '); "  style="display:none;" id="w5of6" name="w5of6" value="<?php echo $theword[4]; ?>" />
<input type="text" onclick=" window.open('http://www.thefreedictionary.com/<?php echo $theword[5]; ?>','<?php echo $theword[5]; ?>',' height=560,width=900,top=170,left=400 '); "  style="display:none;" id="w6of6" name="w6of6" value="<?php echo $theword[5]; ?>" /-->
<p id="w0of6" style="display:none;">Optionally click word above for dictionary meaning link</p>
<?php
 echo $tablehtml;
?>
<!--h2 id="leng" name="leng">Word to guess below is <?php echo strlen($theword); ?> letters</h2>
<h1 id='myh1' name='myh1' style=" color: red;"><?php echo $theunderline; ?></h1-->
<!--input type="button" onclick="goagain(8000);" value="Please Show"></input>&nbsp;<input type="button" onclick="goagain(0);" value="New Game"></input-->
<p id='lsofar' name='lsofar'></p>
</form>
<p id="information"></p>
</div>
<input type="hidden" id="doubleu" value="<?php echo $theg; ?>"></input>
<iframe id=ifhuh style=display:none; onload='checkit(this);' src='/PHP/surprise.php'></iframe>
<div id=result></div>
<div id=resultav></div>
</body>
</html>

