<?php
$numletters = 3;
$nplus = 4;
$goes = 0;

$popletter=array("e","s","t","n","r");

  $w6a = "";
  $w6d = "";
  $w5a = "";
  $w5d = "";
  $w4a = "";
  $w4d = "";
  $w3a = "";
  $w3d = "";

  $w2a = "";
  $w2d = "";

  $w1a = "";
  $w1d = "";

  $zero1 = "0";
  $zero2 = "0";
  $zero3 = "0";
  
  
   $rnhuh = rand(0,4);
   $rzero1 = $popletter[$rnhuh];
   $rnhuh = rand(0,4);
   $rzero2 = $popletter[$rnhuh];
   $rnhuh = rand(0,4);
   $rzero3 = $popletter[$rnhuh];


function aword($wdis) {
  return strtolower(substr(($wdis . ' '),0,(strpos(($wdis . ' '),' '))));
}

function cluewords($wdis) {
  $awordis = substr(($wdis . ' '),0,(strpos(($wdis . ' '),' '))) . " ";
  if (strlen($wdis > $awordis)) {
    return substr($wdis, strlen($awordis));
  } 
  return "";
}

function howmany() { 
global $numletters, $nplus;
if (isset($_GET['numletters'])) {
  $numletters = $_GET['numletters'];
} else if (isset($_POST['numletters'])) {
  $numletters = $_POST['numletters'];
}
if ($numletters < 3) $numletters = 3;
if ($numletters > 6) $numletters = 6;
$nplus = $numletters + 1;
}

howmany();

if ($numletters == 6) {
 $w1d = "false";
 while ($w1d == "false") {
  $goes = $goes + 1;
  if (($goes % 7) == 0) {
    $zero1 = $rzero1;
    $zero2 = $rzero2;
    $zero3 = $rzero3;
  } else {
    $zero1 = "0";
    $zero2 = "0";
    $zero3 = "0";
  }
//file_put_contents(dirname(__FILE__) . "/xxx.xxx", "start");
  $w6a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0" . $zero2 . "0" . $zero3 . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", $w6a);
  $w6d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0" . $zero2 . "0" . substr($w6a,5,1) . "&youllneverfindthis=y");
  $w5a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00000" . substr($w6d,4,1) . "&youllneverfindthis=y");
  $w5d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0000" . substr($w5a,4,1) . substr($w6a,4,1) . "&youllneverfindthis=y");
  $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0000" . substr($w5d,3,1) . substr($w6d,3,1) . "&youllneverfindthis=y");
  $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=000" . substr($w4a,3,1) . substr($w5a,3,1) . substr($w6a,3,1) . "&youllneverfindthis=y");
  $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=000" . substr($w4d,2,1) . substr($w5d,2,1) . substr($w6d,2,1) . "&youllneverfindthis=y");
  $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3a,2,1) . substr($w4a,2,1) . substr($w5a,2,1) . substr($w6a,2,1) . "&youllneverfindthis=y");

  $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3d,1,1) . substr($w4d,1,1) . substr($w5d,1,1) . substr($w6d,1,1) . "&youllneverfindthis=y");
  $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2a,1,1) . substr($w3a,1,1) . substr($w4a,1,1) . substr($w5a,1,1) . substr($w6a,1,1) . "&youllneverfindthis=y");

  $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2d,0,1) . substr($w3d,0,1) . substr($w4d,0,1) . substr($w5d,0,1) . substr($w6d,0,1) . "&youllneverfindthis=y");
  $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?huh=" . substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1) . substr($w5a,0,1) . substr($w6a,0,1) . "&youllneverfindthis=y");
  if ($w1d == "true") $w1d = substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1) . substr($w5a,0,1) . substr($w6a,0,1);
  howmany();
 }
 $w6a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w6a . "&needclue=y&youllneverfindthis=y");
 $w6d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w6d . "&needclue=y&youllneverfindthis=y");
 $w5a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w5a . "&needclue=y&youllneverfindthis=y");
 $w5d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w5d . "&needclue=y&youllneverfindthis=y");
 $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4a . "&needclue=y&youllneverfindthis=y");
 $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4d . "&needclue=y&youllneverfindthis=y");
 $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3a . "&needclue=y&youllneverfindthis=y");
 $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3d . "&needclue=y&youllneverfindthis=y");

 $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2a . "&needclue=y&youllneverfindthis=y");
 $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2d . "&needclue=y&youllneverfindthis=y");

 $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1a . "&needclue=y&youllneverfindthis=y");
 $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1d . "&needclue=y&youllneverfindthis=y");
 howmany();

} else if ($numletters == 5) { 
 $w1d = "false";
//file_put_contents(dirname(__FILE__) . "/xxx.xxx", "start at 5");
 while ($w1d == "false") {
  $goes = $goes + 1;
  if (($goes % 7) == 0) {
    $zero1 = $rzero1;
    $zero2 = $rzero2;
    $zero3 = $rzero3;
  } else {
    $zero1 = "0";
    $zero2 = "0";
    $zero3 = "0";
  }
  $w5a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0" . $zero2 . "0&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w5a=" . $w5a);
  if ($w5a != "") {
  $w5d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $zero1 . "0" . $zero2 . "0" . substr($w5a,4,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w5d=" . $w5d);
  if ($w5d != "") {
  $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0000" . substr($w5d,3,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w4a=" . $w4a);
  if ($w4a != "") {
  $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=000" . substr($w4a,3,1) . substr($w5a,3,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w4d=" . $w4d);
  if ($w4d != "") {
  $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=000" . substr($w4d,2,1) . substr($w5d,2,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w3a=" . $w3a);
  if ($w3a != "") {
  $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3a,2,1) . substr($w4a,2,1) . substr($w5a,2,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w3d=" . $w3d);

  if ($w3d != "") {
  $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3d,1,1) . substr($w4d,1,1) . substr($w5d,1,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w2a=" . $w2a);
  if ($w2a != "") {
  $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2a,1,1) . substr($w3a,1,1) . substr($w4a,1,1) . substr($w5a,1,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w2d=" . $w2d);

  if ($w2d != "") {
  $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2d,0,1) . substr($w3d,0,1) . substr($w4d,0,1) . substr($w5d,0,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xx.xx", "w1a=" . $w1a);
  if ($w1a != "") {
  $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?huh=" . substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1) . substr($w5a,0,1) . "&youllneverfindthis=y");
//file_put_contents(dirname(__FILE__) . "/xxxx.xxxx", "w1d=" . $w1d);
  if ($w1d == "true") $w1d = substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1) . substr($w5a,0,1);
  }
  }
  }
  }
  }
  }
  }
  }
  }
  howmany();
 }
 $w5a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w5a . "&needclue=y&youllneverfindthis=y");
 $w5d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w5d . "&needclue=y&youllneverfindthis=y");
 $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4a . "&needclue=y&youllneverfindthis=y");
 $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4d . "&needclue=y&youllneverfindthis=y");
 $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3a . "&needclue=y&youllneverfindthis=y");
 $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3d . "&needclue=y&youllneverfindthis=y");

 $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2a . "&needclue=y&youllneverfindthis=y");
 $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2d . "&needclue=y&youllneverfindthis=y");

 $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1a . "&needclue=y&youllneverfindthis=y");
 $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1d . "&needclue=y&youllneverfindthis=y");
 howmany();
} else if ($numletters == 4) { 
 $w1d = "false";
//file_put_contents(dirname(__FILE__) . "/xxx.xxx", "start at 4");
 while ($w1d == "false") {
  $goes = $goes + 1;
  if (($goes % 7) == 0) {
    $zero1 = $rzero1;
    $zero2 = $rzero2;
    $zero3 = $rzero3;
  } else {
    $zero1 = "0";
    $zero2 = "0";
    $zero3 = "0";
  }
  $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0" . $zero2 . "&youllneverfindthis=y");
  if ($w4a != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w4a=" . $w4a);
  $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0" . substr($w4a,3,1) . "&youllneverfindthis=y");
  if ($w4d != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w4d=" . $w4d);
  $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=000" . substr($w4d,2,1) . "&youllneverfindthis=y");
  if ($w3a != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w3a=" . $w3a);
  $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3a,2,1) . substr($w4a,2,1) . "&youllneverfindthis=y");
  if ($w3d != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w3d=" . $w3d);

  $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3d,1,1) . substr($w4d,1,1) . "&youllneverfindthis=y");
  if ($w2a != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w2a=" . $w2a);
  $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2a,1,1) . substr($w3a,1,1) . substr($w4a,1,1) . "&youllneverfindthis=y");

  if ($w2d != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "4 w2d=" . $w2d);
  $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2d,0,1) . substr($w3d,0,1) . substr($w4d,0,1) . "&youllneverfindthis=y");
  if ($w1a != "") {
  $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?huh=" . substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1) . "&youllneverfindthis=y");
  if ($w1d == "true") $w1d = substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . substr($w4a,0,1);
  }
  }
  }
  }
  }
  }
  }
 howmany();
 }
 $w4a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4a . "&needclue=y&youllneverfindthis=y");
 $w4d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w4d . "&needclue=y&youllneverfindthis=y");
 $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3a . "&needclue=y&youllneverfindthis=y");
 $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3d . "&needclue=y&youllneverfindthis=y");

 $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2a . "&needclue=y&youllneverfindthis=y");
 $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2d . "&needclue=y&youllneverfindthis=y");

 $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1a . "&needclue=y&youllneverfindthis=y");
 $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1d . "&needclue=y&youllneverfindthis=y");
 howmany();

} else if ($numletters == 3) { 
 $w1d = "false";
 $rn = rand(1,4);
//file_put_contents(dirname(__FILE__) . "/xxx.xxx", "start at 3");
 while ($w1d == "false") {
  $goes = $goes + 1;
  if (($goes % 7) == 0) {
    $zero1 = $rzero1;
    $zero2 = $rzero2;
    $zero3 = $rzero3;
  } else {
    $zero1 = "0";
    $zero2 = "0";
    $zero3 = "0";
  }
  if (isset($_GET['test'])) {
  if ($rn == 1) $w3a = "sty";
  if ($rn == 2) $w3a = "dev";
  if ($rn == 3) $w3a = "raj";
  if ($rn > 3) $w3a = "wee";
  } else {
  $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . $zero1 . "0&youllneverfindthis=y");
  }
  if ($w3a != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "3 w3a=" . $w3a);
  if (isset($_GET['test'])) {
  if ($rn == 1) $w3d = "try"; 
  if ($rn == 2) $w3d = "dev";
  if ($rn == 3) $w3d = "raj";
  if ($rn > 3) $w3d = "che";
  } else {
  $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3a,2,1) . "&youllneverfindthis=y");
  }
  if ($w3d != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "3 w3d=" . $w3d);
  if (isset($_GET['test'])) {
  if ($rn == 1) $w2a = "ser"; 
  if ($rn == 2) $w2a = "eve";
  if ($rn == 3) $w2a = "ada";
  if ($rn > 3) $w2a = "edh";
  } else {
  $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=00" . substr($w3d,1,1) . "&youllneverfindthis=y");
  }
  if ($w2a != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "3 w2a=" . $w2a);
  if (isset($_GET['test'])) {
  if ($rn == 1) $w2d = "met"; 
  if ($rn == 2) $w2d = "ave";
  if ($rn == 3) $w2d = "ada";
  if ($rn > 3) $w2d = "ade";
  } else {
  $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2a,1,1) . substr($w3a,1,1) . "&youllneverfindthis=y");
  }

  if ($w2d != "") {
//file_put_contents(dirname(__FILE__) . "/xx.xx", "3 w2d=" . $w2d);
  if (isset($_GET['test'])) {
  if ($rn == 1) $w1a = "amt"; 
  if ($rn == 2) $w1a = "fad";
  if ($rn == 3) $w1a = "war";
  if ($rn > 3) $w1a = "sac";
  } else {
  $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=0" . substr($w2d,0,1) . substr($w3d,0,1) . "&youllneverfindthis=y");
  }
  if ($w1a != "") {
  $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?huh=" . substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1) . "&youllneverfindthis=y");
  if ($w1d == "true") $w1d = substr($w1a,0,1) . substr($w2a,0,1) . substr($w3a,0,1);
  }
  }
  }
  }
  }
 howmany();
 }
 $w3a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3a . "&needclue=y&youllneverfindthis=y");
 $w3d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w3d . "&needclue=y&youllneverfindthis=y");

 $w2a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2a . "&needclue=y&youllneverfindthis=y");
 $w2d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w2d . "&needclue=y&youllneverfindthis=y");

 $w1a = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1a . "&needclue=y&youllneverfindthis=y");
 $w1d = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . str_replace("~","",str_replace(":443~","",str_replace(":80~","",(":" . $_SERVER['SERVER_PORT'] . "~")))) . "/PHP/surprise.php?min=" . $nplus . "&max=" . $nplus . "&hastobe=" . $w1d . "&needclue=y&youllneverfindthis=y");
 howmany();


}

?>
<html>
<head>
<title>Three to Six Letter Word Game - RJM Programming - 2014</title>


<style>
td {
  width: 20px;
  height: 20px;
  border: 1px solid black;
  background-color: ochre;
}

.space {
  background-color: yellow;
}

</style>

<script type="text/javascript">

var score = <?php if (isset($_GET['score'])) { echo $_GET['score']; } else { echo "0"; } ?>;
var outof = <?php if (isset($_GET['outof'])) { echo $_GET['outof']; } else { echo "0"; } ?>;
var w1a="<?php echo aword($w1a); ?>";
var w2a="<?php echo aword($w2a); ?>";
var w3a="<?php echo aword($w3a); ?>";
var w4a="<?php echo aword($w4a); ?>";
var w5a="<?php echo aword($w5a); ?>";
var w6a="<?php echo aword($w6a); ?>";
var w1d="<?php echo aword($w1d); ?>";
var w2d="<?php echo aword($w2d); ?>";
var w3d="<?php echo aword($w3d); ?>";
var w4d="<?php echo aword($w4d); ?>";
var w5d="<?php echo aword($w5d); ?>";
var w6d="<?php echo aword($w6d); ?>";
var filledoutwords=" ";


function checksquare(osqtd) {
 if (osqtd.style.backgroundColor != 'lightgreen' && osqtd.style.backgroundColor != 'lightblue') {
  var goodletter="";
  var things=osqtd.id.split("_");
  var tnum=things[0].replace("c","w").split("-");
  eval("goodletter = " + tnum[0] + ".substring((tnum[1]-1),tnum[1])");
  var lis=prompt("What letter goes here?  If you are wrong it will not be added.", "");
  if (lis != null) {
    if (lis != "") { 
      if (lis.toLowerCase().substring(0,1) == goodletter.toLowerCase()) {
       osqtd.style.backgroundColor = 'lightgreen';
       if (osqtd.innerHTML.indexOf("</sup>") != -1) {
        osqtd.innerHTML = osqtd.innerHTML.substring(0,(osqtd.innerHTML.indexOf("</sup>") + 6)) + "&nbsp;" + lis.toUpperCase().substring(0,1);
       } else {
        osqtd.innerHTML = "&nbsp;" + lis.toUpperCase().substring(0,1);
       }


         //alert(98);
       var items = document.getElementsByClassName('aletter');
       var alldone = 1;
       var elem;
       //alert("ail=" + items.length);
       for(var i=0; i<items.length; i++){
            elem = items[i];
            if (elem.style.backgroundColor != 'lightgreen' && elem.style.backgroundColor != 'lightblue' && elem.style.display != 'none') alldone = 0;
       }
       
         //alert(96);
       if (alldone == 1) {
         //alert(99);
         score = score + 1;
         outof = outof + 1;
         document.getElementById("score").innerHTML = "Score: " + score + " / " + outof;
         outof = outof - 1;
         document.getElementById("idea").innerHTML = document.getElementById("idea").innerHTML + " ... Congratulations!";
       }

      }
    }
  }
 } else if (osqtd.style.backgroundColor == 'lightblue') {
  var incoid=osqtd.id + "-";
  var thewordis="";
  if (incoid.indexOf("-") != -1) {
               var wtnum=incoid.split("-");
               eval("thewordis = " + wtnum[0].replace("c","w"));
               if (iswordfilledout(wtnum[0])) {
               window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");
               } else {
               //alert(filledoutwords + " " + incoid);
               if (filledoutwords.indexOf(" " + thewordis.toLowerCase() + " ") == -1 && wtnum.length > 2) {
                var wtnum2=incoid.split("_");
                wtnum=wtnum2[1].split("-");
                eval("thewordis = " + wtnum[0].replace("c","w"));                  
               }
                              if (iswordfilledout(wtnum[0])) {
                                window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");
							  } else {
               if (filledoutwords.indexOf(" " + thewordis.toLowerCase() + " ") != -1) window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");               
							  }
               }
   }
 } else if (osqtd.style.backgroundColor == 'lightgreen') {
  var incoid=osqtd.id + "-";
  var thewordis="";
  if (incoid.indexOf("-") != -1) {
               var wtnum=incoid.split("-");
               eval("thewordis = " + wtnum[0].replace("c","w"));
               if (iswordfilledout(wtnum[0])) {
               window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");
               } else {
               //alert(filledoutwords + " " + incoid);
               if (filledoutwords.indexOf(" " + thewordis.toLowerCase() + " ") == -1 && wtnum.length > 2) {
                var wtnum2=incoid.split("_");
                wtnum=wtnum2[1].split("-");
                eval("thewordis = " + wtnum[0].replace("c","w"));                  
               }
                              if (iswordfilledout(wtnum[0])) {
                                window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");
							  } else {
               if (filledoutwords.indexOf(" " + thewordis.toLowerCase() + " ") != -1) window.open("http://www.thefreedictionary.com/" + thewordis, thewordis, " height=600,width=900,top=30,left=400 ");               
							  }
               }
   }
}
}

function iswordfilledout(theidis) {
       var retval = true;
       var items = document.getElementsByClassName('aletter');
       var alldone = 0;
       var elem, elemidis;
       //alert("bil=" + items.length);
       for(var i=0; i<items.length; i++){
            if (i == 0) alldone = 1;
            elem = items[i];
            elemidis = elem.id + "-";
            if (elemidis.indexOf(theidis + "-") != -1) {
             if (elem.style.backgroundColor != 'lightgreen' && elem.style.backgroundColor != 'lightblue' && elem.style.display != 'none') alldone = 0;
            }
       }
       if (alldone == 0) retval = false;  
       return retval;
}

function checksquareis(osqtd, lis) {
 if (osqtd.style.backgroundColor != 'lightgreen' && osqtd.style.backgroundColor != 'lightblue') {
  var goodletter="";
  var things=osqtd.id.split("_");
  var tnum=things[0].replace("c","w").split("-");
  eval("goodletter = " + tnum[0] + ".substring((tnum[1]-1),tnum[1])");
  //var lis=prompt("What letter goes here?  If you are wrong it will not be added.", "");
  if (lis != null) {
    if (lis != "") {
      if (lis.toLowerCase().substring(0,1) == goodletter.toLowerCase()) {
       osqtd.style.backgroundColor = 'lightblue';
       if (osqtd.innerHTML.indexOf("</sup>") != -1) {
        osqtd.innerHTML = osqtd.innerHTML.substring(0,(osqtd.innerHTML.indexOf("</sup>") + 6)) + "&nbsp;" + lis.toUpperCase().substring(0,1);
       } else {
        osqtd.innerHTML = "&nbsp;" + lis.toUpperCase().substring(0,1);
       }
       filledoutwords = filledoutwords + lis.toLowerCase();


         //alert(98);
       var items = document.getElementsByClassName('aletter');
       var alldone = 1;
       var elem;
       //alert("cil=" + items.length);
       for(var i=0; i<items.length; i++){
            elem = items[i];
            if (elem.style.backgroundColor != 'lightgreen' && elem.style.display != 'none') alldone = 0;
       }
       
         //alert(96);
       if (alldone == 1) {
         //alert(99);
         score = score + 1;
         outof = outof + 1;
         document.getElementById("score").innerHTML = "Score: " + score + " / " + outof;
         outof = outof - 1;
         document.getElementById("idea").innerHTML = document.getElementById("idea").innerHTML + " ... Congratulations!";
       }

      }
    }
  }
 }
}

function checkcluewords(incoid) {
  var j=0, k=0;
  var thewordis="";
  var oclue=document.getElementById(incoid);
  if (oclue.innerHTML.length <= 3) {
       var items = document.getElementsByTagName('td');
       var alldone = 1;
       var elem, elemid="";
       for(var i=0; i<items.length; i++){
            elem = items[i];
            elemid = elem.id + "_";
            if (elemid.indexOf((incoid + "-")) != -1) {
               var wtnum=incoid.split("-");
               eval("thewordis = " + incoid.replace("c","w"));
               checksquareis(elem, thewordis.substring(k,(k+1)));
               k = k + 1;
            }
       }
  	   filledoutwords = filledoutwords + " ";
  }
}

</script>

<style>

.aletter {
  background-color: white;
}

</style>

</head>
<?php
if (isset($_GET['test'])) {
 echo '<body align="center" style="background-color:yellow;">';
 echo "<h1 id=\"idea\" align=\"center\">Easier Test Three Letter Game ... <input type='button' id='mybut' value='New Three Letter Game' onclick=' outof=outof + 1; location.href=\"./threetosixword.php?numletters=3&score=\" + score + \"&outof=\" + outof; '></input></h1>";
} else {
 echo '<body align="center" style="background-color:orange;">';
 echo "<h1 id=\"idea\" align=\"center\">Three to Six Letter Game ... <input type='button' id='mybut' value='New Three Letter Game' onclick=' outof=outof + 1; location.href=\"./threetosixword.php?numletters=3&score=\" + score + \"&outof=\" + outof; '></input><input type='button' id='mybut4' value='4' onclick=' outof=outof + 1; location.href=\"./threetosixword.php?numletters=4&score=\" + score + \"&outof=\" + outof; '></input><input type='button' id='mybut5' value='5' onclick=' outof=outof + 1; location.href=\"./threetosixword.php?numletters=5&score=\" + score + \"&outof=\" + outof; '></input><input type='button' id='mybut6' value='6' onclick=' outof=outof + 1; location.href=\"./threetosixword.php?numletters=6&score=\" + score + \"&outof=\" + outof; '></input></h1>";
}
?>
<h2 id="score" align="center">Score: <?php if (isset($_GET['score'])) { echo $_GET['score']; } else { echo "0"; } ?> / <?php if (isset($_GET['outof'])) { echo $_GET['outof']; } else { echo "0"; } ?></h2>
<table style="width:100%; background-color:white;"><tr><td align="center" style="border: 2px green sold;  background-color:lightblue;">
<table style="width:75%;background-color: white;">
<tr>
<td id="c1a-1_c1d-1" class="aletter" onclick="checksquare(this);"><sup>1</sup></td>
<td id="c1a-2_c1d-2" class="aletter" onclick="checksquare(this);"><sup>2</sup></td>
<td id="c1a-3_c1d-3" class="aletter" onclick="checksquare(this);"><sup>3</sup></td>
<?php if ($numletters >= 4) echo '<td id="c1a-4_c1d-4" class="aletter" onclick="checksquare(this);"><sup>4</sup></td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c1a-5_c1d-5" class="aletter" onclick="checksquare(this);"><sup>5</sup></td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c1a-6_c1d-6" class="aletter" onclick="checksquare(this);"><sup>6</sup></td>'; ?>
</tr>

<tr>
<td id="c2a-1_c1d-2" class="aletter" onclick="checksquare(this);"><sup>2</sup></td>
<td id="c2a-2_c2d-2" class="aletter" onclick="checksquare(this);">&nbsp;</td>
<td id="c2a-3_c3d-2" class="aletter" onclick="checksquare(this);">&nbsp;</td>
<?php if ($numletters >= 4) echo '<td id="c2a-4_c4d-2" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c2a-5_c5d-2" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c2a-6_c6d-2" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
</tr>
<tr>
<td id="c3a-1_c1d-3" class="aletter" onclick="checksquare(this);"><sup>3</sup></td>
<td id="c3a-2_c2d-3" class="aletter" onclick="checksquare(this);">&nbsp;</td>
<td id="c3a-3_c3d-3" class="aletter" onclick="checksquare(this);">&nbsp;</td>
<?php if ($numletters >= 4) echo '<td id="c3a-4_c4d-3" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c3a-5_c5d-3" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c3a-6_c6d-3" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
</tr>
<?php if ($numletters >= 4) echo '<tr>'; ?>
<?php if ($numletters >= 4) echo '<td id="c4a-1_c1d-4" class="aletter" onclick="checksquare(this);"><sup>4</sup></td>'; ?>
<?php if ($numletters >= 4) echo '<td id="c4a-2_c2d-4" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 4) echo '<td id="c4a-3_c3d-4" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 4) echo '<td id="c4a-4_c4d-4" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c4a-5_c5d-4" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c4a-6_c6d-4" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 4) echo '</tr>'; ?>
<?php if ($numletters >= 5) echo '<tr>'; ?>
<?php if ($numletters >= 5) echo '<td id="c5a-1_c1d-5" class="aletter" onclick="checksquare(this);"><sup>5</sup></td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c5a-2_c2d-5" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c5a-3_c3d-5" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 4) echo '<td id="c5a-4_c4d-5" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c5a-5_c5d-5" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c5a-6_c6d-5" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '</tr>'; ?>
<?php if ($numletters >= 6) echo '<tr>'; ?>
<?php if ($numletters >= 6) echo '<td id="c6a-1_c1d-6" class="aletter" onclick="checksquare(this);"><sup>6</sup></td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c6a-2_c2d-6" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c6a-3_c3d-6" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 4) echo '<td id="c6a-4_c4d-6" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 5) echo '<td id="c6a-5_c5d-6" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '<td id="c6a-6_c6d-6" class="aletter" onclick="checksquare(this);">&nbsp;</td>'; ?>
<?php if ($numletters >= 6) echo '</tr>'; ?>

</table></td><td style="width:65%; padding: 5 5 5 5;margin-top:0px;">   
<table style="width:100%; border: 0;"><tr><td colspan=2 style="border: 0;">Click squares to fill in the word grid to the left.</td></tr><tr><td style="width:50%; border: 0;"><b><i><u>Clues Across</u></i></b></td><td style="width:50%; border: 0;"><b><i><u>Clues Down</u></i></b></td></tr>
<tr><td onclick="checksquare(this);" style=" padding: 4 4 4 4; background-color: lightgray; ">
<p id="c1a">1 <?php echo cluewords($w1a); ?></p><p id="c2a">2 <?php echo cluewords($w2a); ?></p><p id="c3a">3 <?php echo cluewords($w3a); ?></p><p id="c4a"><?php if ($w4a != "") echo "4 " . cluewords($w4a); ?></p><p id="c5a"><?php if ($w5a != "") echo "5 " . cluewords($w5a); ?></p><p id="c6a"><?php  if ($w6a != "") echo "6 " . cluewords($w6a); ?></p>
</td><td style="width:50%; padding: 4 4 4 4;  background-color: lightgray;  ">
<p id="c1d">1 <?php echo cluewords($w1d); ?></p><p id="c2d">2 <?php echo cluewords($w2d); ?></p><p id="c3d">3 <?php echo cluewords($w3d); ?></p><p id="c4d"><?php if ($w4d != "") echo "4 " . cluewords($w4d); ?></p><p id="c5d"><?php if ($w5d != "") echo "5 " . cluewords($w5d); ?></p><p id="c6d"><?php  if ($w6d != "") echo "6 " . cluewords($w6d); ?></p>
</td></tr></table>
</td></tr></table>

<script type="text/javascript">
checkcluewords("c1a");
checkcluewords("c2a");
checkcluewords("c3a");
checkcluewords("c4a");
checkcluewords("c5a");
checkcluewords("c6a");
checkcluewords("c1d");
checkcluewords("c2d");
checkcluewords("c3d");
checkcluewords("c4d");
checkcluewords("c5d");
checkcluewords("c6d");
</script>

</body>
</html>
