<html>

<head>
 

</style>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Fun for Kids of all Ages</title>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var x = "cjcafun/x.jpg";
// Location of where you uploaded your site's x.jpg image

var o = "cjcafun/o.jpg";
// Location of where you uploaded your site's o.jpg image

var blank = "cjcafun/blank.jpg";
// Location of where you uploaded your site's blank.jpg image

var pause = 0;
var all = 0;
var a = 0;
var b = 0;
var c = 0;
var d = 0;
var e = 0;
var f = 0;
var g = 0;
var h = 0;
var i = 0;
var temp="";
var ok = 0;
var cf = 0;
var choice=9;
var aRandomNumber = 0;
var comp = 0; 
var t = 0;
var wn = 0;
var ls = 0;
var ts = 0;
function help() {
alert("Welcome to Tic-Tac-Toe!  You play as Bingo and the computer is Jack.  Select the square you want to put Bingo into by clicking it.  You cannot occupy a square that is already occupied. The first player to get three squares in a row wins.  Good Luck!!")
}
function logicOne() {
if ((a==1)&&(b==1)&&(c==1)) all=1;
if ((a==1)&&(d==1)&&(g==1)) all=1;
if ((a==1)&&(e==1)&&(i==1)) all=1;
if ((b==1)&&(e==1)&&(h==1)) all=1;
if ((d==1)&&(e==1)&&(f==1)) all=1;
if ((g==1)&&(h==1)&&(i==1)) all=1;
if ((c==1)&&(f==1)&&(i==1)) all=1;
if ((g==1)&&(e==1)&&(c==1)) all=1;
if ((a==2)&&(b==2)&&(c==2)) all=2;
if ((a==2)&&(d==2)&&(g==2)) all=2;
if ((a==2)&&(e==2)&&(i==2)) all=2;
if ((b==2)&&(e==2)&&(h==2)) all=2;
if ((d==2)&&(e==2)&&(f==2)) all=2;
if ((g==2)&&(h==2)&&(i==2)) all=2;
if ((c==2)&&(f==2)&&(i==2)) all=2;
if ((g==2)&&(e==2)&&(c==2)) all=2;
if ((a != 0)&&(b != 0)&&(c != 0)&&(d != 0)&&(e != 0)&&(f != 0)&&(g != 0)&&(h != 0)&&(i != 0)&&(all == 0)) all = 3;
} 
function logicTwo() {
if ((a==2)&&(b==2)&&(c== 0)&&(temp=="")) temp="C";
if ((a==2)&&(b== 0)&&(c==2)&&(temp=="")) temp="B";
if ((a== 0)&&(b==2)&&(c==2)&&(temp=="")) temp="A";
if ((a==2)&&(d==2)&&(g== 0)&&(temp=="")) temp="G";
if ((a==2)&&(d== 0)&&(g==2)&&(temp=="")) temp="D";
if ((a== 0)&&(d==2)&&(g==2)&&(temp=="")) temp="A";
if ((a==2)&&(e==2)&&(i== 0)&&(temp=="")) temp="I";
if ((a==2)&&(e== 0)&&(i==2)&&(temp=="")) temp="E";
if ((a== 0)&&(e==2)&&(i==2)&&(temp=="")) temp="A";
if ((b==2)&&(e==2)&&(h== 0)&&(temp=="")) temp="H";
if ((b==2)&&(e== 0)&&(h==2)&&(temp=="")) temp="E";
if ((b== 0)&&(e==2)&&(h==2)&&(temp=="")) temp="B";
if ((d==2)&&(e==2)&&(f== 0)&&(temp=="")) temp="F";
if ((d==2)&&(e== 0)&&(f==2)&&(temp=="")) temp="E";
if ((d== 0)&&(e==2)&&(f==2)&&(temp=="")) temp="D";
if ((g==2)&&(h==2)&&(i== 0)&&(temp=="")) temp="I";
if ((g==2)&&(h== 0)&&(i==2)&&(temp=="")) temp="H";
if ((g== 0)&&(h==2)&&(i==2)&&(temp=="")) temp="G";
if ((c==2)&&(f==2)&&(i== 0)&&(temp=="")) temp="I";
if ((c==2)&&(f== 0)&&(i==2)&&(temp=="")) temp="F";
if ((c== 0)&&(f==2)&&(i==2)&&(temp=="")) temp="C";
if ((g==2)&&(e==2)&&(c== 0)&&(temp=="")) temp="C";
if ((g==2)&&(e== 0)&&(c==2)&&(temp=="")) temp="E";
if ((g== 0)&&(e==2)&&(c==2)&&(temp=="")) temp="G";
}
function logicThree() {
if ((a==1)&&(b==1)&&(c==0)&&(temp=="")) temp="C";
if ((a==1)&&(b==0)&&(c==1)&&(temp=="")) temp="B";
if ((a==0)&&(b==1)&&(c==1)&&(temp=="")) temp="A";
if ((a==1)&&(d==1)&&(g==0)&&(temp=="")) temp="G";
if ((a==1)&&(d==0)&&(g==1)&&(temp=="")) temp="D";
if ((a==0)&&(d==1)&&(g==1)&&(temp=="")) temp="A";
if ((a==1)&&(e==1)&&(i==0)&&(temp=="")) temp="I";
if ((a==1)&&(e==0)&&(i==1)&&(temp=="")) temp="E";
if ((a==0)&&(e==1)&&(i==1)&&(temp=="")) temp="A";
if ((b==1)&&(e==1)&&(h==0)&&(temp=="")) temp="H";
if ((b==1)&&(e==0)&&(h==1)&&(temp=="")) temp="E";
if ((b==0)&&(e==1)&&(h==1)&&(temp=="")) temp="B";
if ((d==1)&&(e==1)&&(f==0)&&(temp=="")) temp="F";
if ((d==1)&&(e==0)&&(f==1)&&(temp=="")) temp="E";
if ((d==0)&&(e==1)&&(f==1)&&(temp=="")) temp="D";
if ((g==1)&&(h==1)&&(i==0)&&(temp=="")) temp="I";
if ((g==1)&&(h==0)&&(i==1)&&(temp=="")) temp="H";
if ((g==0)&&(h==1)&&(i==1)&&(temp=="")) temp="G";
if ((c==1)&&(f==1)&&(i==0)&&(temp=="")) temp="I";
if ((c==1)&&(f==0)&&(i==1)&&(temp=="")) temp="F";
if ((c==0)&&(f==1)&&(i==1)&&(temp=="")) temp="C";
if ((g==1)&&(e==1)&&(c==0)&&(temp=="")) temp="C";
if ((g==1)&&(e==0)&&(c==1)&&(temp=="")) temp="E";
if ((g==0)&&(e==1)&&(c==1)&&(temp=="")) temp="G";
}
function clearOut() {
document.game.you.value="0";
document.game.computer.value="0";
document.game.ties.value="0";
}
function checkSpace() {
if ((temp=="A")&&(a==0)) {
ok=1;
if (cf==0) a=1;
if (cf==1) a=2;
}
if ((temp=="B")&&(b==0)) {
ok=1;
if (cf==0) b=1;
if (cf==1) b=2;
}
if ((temp=="C")&&(c==0)) {
ok=1;
if (cf==0) c=1;
if (cf==1) c=2;
}
if ((temp=="D")&&(d==0)) {
ok=1;
if (cf==0) d=1;
if (cf==1) d=2;
}
if ((temp=="E")&&(e==0)) {
ok=1;
if (cf==0) e=1;
if (cf==1) e=2;
}
if ((temp=="F")&&(f==0)) {
ok=1
if (cf==0) f=1;
if (cf==1) f=2;
}
if ((temp=="G")&&(g==0)) {
ok=1
if (cf==0) g=1;
if (cf==1) g=2;
}
if ((temp=="H")&&(h==0)) {
ok=1;
if (cf==0) h=1;
if (cf==1) h=2;
}
if ((temp=="I")&&(i==0)) {
ok=1;
if (cf==0) i=1; 
if (cf==1) i=2; 
}
}
function yourChoice(chName) {
pause = 0;
if (all!=0) ended();
if (all==0) {
cf = 0;
ok = 0;
temp=chName;
checkSpace();
if (ok==1) {
document.images[chName].src = x;
}
if (ok==0)taken();
process();
if ((all==0)&&(pause==0)) myChoice();
   }
}
function taken() {
alert("That square is already occupied.  Please select another square.")
pause=1;
}
function myChoice() {
temp="";
ok = 0;
cf=1;
logicTwo();
logicThree();
checkSpace();
while(ok==0) {
aRandomNumber=Math.random()
comp=Math.round((choice-1)*aRandomNumber)+1;
if (comp==1) temp="A";
if (comp==2) temp="B";
if (comp==3) temp="C";
if (comp==4) temp="D";
if (comp==5) temp="E";
if (comp==6) temp="F";
if (comp==7) temp="G";
if (comp==8) temp="H";
if (comp==9) temp="I";
checkSpace();
}
document.images[temp].src= o;
process();
}
function ended() {
alert("The game has already ended. To play a new game click the Play Again button.")
}
function process() {
logicOne();
if (all==1){ alert("You won, congratulations!"); wn++; }
if (all==2){ alert("Gotcha!  I win!"); ls++; }
if (all==3){ alert("We tied."); ts++; }
if (all!=0) {
document.game.you.value = wn;
document.game.computer.value = ls;
document.game.ties.value = ts;
   }
}
function playAgain() {
if (all==0) {
if(confirm("This will restart the game and clear all the current scores. OK?")) reset();
}
if (all>0) reset();
}
function reset() {
all = 0;
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
g = 0;
h = 0;
i = 0;
temp="";
ok = 0;
cf = 0;
choice=9;
aRandomNumber = 0;
comp = 0; 
document.images.A.src= blank;
document.images.B.src= blank;
document.images.C.src= blank;
document.images.D.src= blank;
document.images.E.src= blank;
document.images.F.src= blank;
document.images.G.src= blank;
document.images.H.src= blank;
document.images.I.src= blank;
if (t==0) { t=2; myChoice(); }
t--;
}
//  End -->
</script>
</HEAD>

</head>

<body bgcolor="#0099FF" background="cjcafun/stripeslight.JPG">

<CENTER>
<table border="1" width="100%">
  <tr>
    <td bgcolor="#0099FF">
    <p align="center">
		<FONT face="Comic Sans MS" size=1>[&nbsp;
        <a href="http://www.tias.com/mags/cjca">CJCA Home</a></FONT><FONT face=Webdings 
size=1>|</FONT><FONT face="Comic Sans MS" size=1> <a href="aboutcjca.htm">CJCA</a></FONT><FONT face=Webdings 
size=1> |</FONT><FONT face="Comic Sans MS" size=1><a href="cjcahistory.htm">History</a></FONT><FONT 
face=Webdings size=1> |</FONT><FONT face="Comic Sans MS" 
size=1> <a href="collecting.htm">Collecting</a></FONT><FONT face=Webdings size=1>|</FONT><FONT face="Comic Sans MS" size=1><a href="cjcafun.htm">Kids</a></FONT><FONT face=Webdings size=1>|</FONT><FONT 
face="Comic Sans MS" size=1><a href="joincjca.htm">Join&nbsp; 
CJCA</a></FONT><FONT face=Webdings size=1>| </FONT><FONT face="Comic Sans MS" 
size=1><a href="cjcaevents.htm">Events</a></FONT><FONT face=Webdings size=1>|</FONT><FONT 
face="Comic Sans MS" size=1> <a href="cjcaprizes.htm">Prizes</a></FONT><FONT face=Webdings 
size=1> |</FONT><FONT face="Comic Sans MS" size=1><a href="cjcalinks.htm">Links</a> 
| <a href="mailto:rmagnus1@optonline.net">E-mail CJCA</a>]</FONT></td>
  </tr>
  <tr>
    <td bgcolor="#0099FF">
    <p align="center"><font face="Comic Sans MS" color="#FFFFFF" size="5">
    <a name="Top"></a>Cracker
Jack Collectors Association Kids</font></td>
  </tr>
  <tr>
    <td bgcolor="#0099FF">
    <p align="center">Look at the scrambled word.&nbsp; Guess what it is.&nbsp; 
    Check your answer!&nbsp; Play again.<br>
    There are 8 different words.</td>
  </tr>
  <tr>
    <td bgcolor="#0099FF">
    

<p align="center"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<meta name="keywords" content="SPLASH, INTRO, PAGE, JAVASCRIPT, JAVASCRIPTS, SCRIPTS, DHTML, DYNAMIC, KICK, ASS, CODING, PROGRAMMING, PROGRAMMER, DEVELOPMENT, KICK-ASS, EFFECT, EFFECTS, KANEOHE, SCREEN, SCREENS, HAWAII, RHUCKO1, RICHARD, HUCKO, COOL">
<meta name="description" content="Word Scramble! Game JavaScript CROSS-BROWSER, JavaScripts and DHTML Effects - www.DynamicScripts.TK">
<title>Word Scramble JavaScript - CROSS-BROWSER </title>
<script language="JavaScript" type="text/javascript">
<!--
var word=new Array("CRACKERJACK","JACK","BINGO","PRIZE","POPCORN","CARAMEL","RUECKHEIM","PEANUTS");
var letter=new Array();
var rand;
var actual;
window.onload=main;
function main()
{
  getRand();
	scrambleWord();
	creatWord();
}
function scrambleWord()
{
 actual=word[rand];
 Temp=word[rand].length;
  for(var HUCKO=0;HUCKO<Temp+2;HUCKO++)// - Richard Hucko's JavaScript Effects -> www.DynamicScripts.tk
	{
	 RHUCKO1=HUCKO-1;
	  letter[HUCKO]=word[rand].substring(RHUCKO1,RHUCKO1-1)
	}
	letter.sort();
	word[rand]="";
	for(var HUCKO=0;HUCKO<Temp+2;HUCKO++)
	word[rand]+=letter[HUCKO];
}
function getRand()
{
  rand=Math.floor(Math.random()*word.length);
}
function creatWord()
{
 for(var x=0;x<word[rand].length+2;x++)
 {
  RHUCKO1=x-1;
  a=document.createElement('a');
	a.id="aid"+x;
	a.className="scramble";
	a.innerHTML=word[rand].substring(RHUCKO1,RHUCKO1-1);
	a.href="javascript:append('"+x+"');";
	document.getElementById('board').appendChild(a);
 }
}
function creatWord2(x)
{
  RHUCKO1=x-1;
  a=document.createElement('a');
	a.id="aid2"+x;
	a.className="scramble";
	a.innerHTML=word[rand].substring(RHUCKO1,RHUCKO1-1);
	a.href="javascript:retract('"+x+"');";
	document.getElementById('assemble').appendChild(a);

}
function append(RHUCKO1)
{
  document.getElementById('aid'+RHUCKO1).style.visibility="hidden";
	//document.getElementById('assemble').innerHTML+=document.getElementById('aid'+RHUCKO1).innerHTML;
	creatWord2(RHUCKO1);
}
function retract(RHUCKO1)
{
  document.getElementById('aid'+RHUCKO1).style.visibility="visible";
	elem=document.getElementById('aid2'+RHUCKO1);
	document.getElementById('assemble').removeChild(elem);
}
function showWord()
{
  document.getElementById('theWord').innerHTML=actual;
}
//-->
</script>
<style type="text/css">
<!--
body {
		  text-align:center;
		 }
a.scramble {
					   color:black;
						 font-weight:bold;
						 font-size:30;
						 position:relative;
					 }
span#assemble {
						 font-weight:bold;
						 font-size:30;
						 position:relative;
						 }
span#theWord {
						 color:white;
						 background-color:black;
						 font-weight:bold;
						 font-size:30;
						 position:relative;
						 border:2 inset gray;
						 }
a:hover {
				  background-color:black;
					color:white;
				}
-->
</style>

</head>
<body>

  <br />
  <span id="board"></span>
	<br /><br />
	<span id="assemble"></span>
	<br />
	<br />
		<span id="theWord"></span>
	<form>
	<input type="button" value="->See Word" onclick="showWord();" />
   <b style="visibility:hidden">__</b>
	<input type="button" value="Play Again!" onclick="javascript:history.go(0);" />
	<div style="text-align:center;color:black;background-color:transparent;display:none;z-index:1;text-decoration:underline;">&nbsp;</div>
	</form>
	
</body>
</html>



    </td>
  </tr>
  <tr>
    <td bgcolor="#0099FF">
    <p align="center">
<font face="Comic Sans MS" size="5">
    <a href="#Top">Top of Page</a></font><br>
    <a href="http://www.tias.com/mags/cjca">
<img border="0" src="cjcafun/bluecirclehome.jpg" width="100" height="98"></a><br>
    <font size="1">This page can be found at
<a href="http://www.tias.com/mags/cjca/cjcafun.htm">http://www.tias.com/mags/cjca/cjcafun.htm</a>&nbsp; on the World Wide Web.</font></td>
  </tr>
</table>
</CENTER>

</body>

</html>