function rand(topnumber) 
{
return Math.floor(Math.random() * topnumber)+ 1;
}

function callgame(affid,hexcolor)
{
document.writeln('<table width="80%" cellspacing="12" border=0 bgcolor="#'+hexcolor+'" cellpadding="0" align="CENTER"><tr><td>');
document.writeln('<a href="http://surfnetkids.com/cgi-bin/affiliates/cu.cgi?id=' +affid+ '"><img src="http://how2add.com/images/howtoadd.gif" border=0 width=95 height=118></a></td><td>');
document.writeln('<font face="Arial" size="4" color="Black"><B>Attract kids and teens to your organization\'s Website with games like this one that you create in minutes using the low-cost tools revealed in "<a href="http://surfnetkids.com/cgi-bin/affiliates/cu.cgi?id=' +affid+ '">How to Add Games to Your Site</a>."</font></B>');
document.writeln(' </td></tr><tr><td colspan=2><center>');

gamenumber = rand(7);

if (gamenumber == 1)
{
document.writeln('<APPLET code="Colorbook" codebase="http://www.surfnetkids.com/games/"  width="340" height="475">');
document.writeln('<param name="image1" value="http://www.surfnetkids.com/games/veggies.gif"> ');
document.writeln('      <param name="image2" value="http://www.surfnetkids.com/games/planting.gif">');
document.writeln('	<param name="image3" value="http://www.surfnetkids.com/games/tulips_bee.gif">');
document.writeln('     <param name="image4" value="http://www.surfnetkids.com/games/gardengirl.gif"> ');
document.writeln('');
document.writeln('           <param name="preload" value="4">');
document.writeln('     <param name="palette2" value="BDFF8C,7BBD8C,408080,CC6600,BD9CDE,BD63FF,FF9C9C,FF7B7B,FF0000,FF0080,FF8000,FFB510,0080FF,FFFF00,FFFF80,DEDEDE">');
document.writeln('       <param name="palette3" value="BDFF8C,7BBD8C,408080,CC6600,BD9CDE,BD63FF,FF9C9C,FF7B7B,FF0000,FF0080,FF8000,FFB510,0080FF,FFFF00,FFFF80,DEDEDE">');
document.writeln('<param name="palette4" value="BDBD7B,BDFFBD,7BFFBD,39FF39,BDDEDE,BDDEFF,399CFF,39399C,FFFFBD,FFFF00,FFBD7B,FF0000,FF7BB5,BD7B7B,804000,FFFFFF">');
document.writeln('  </APPLET>');
}

if (gamenumber == 2)
{
document.writeln('<applet code="Scrambler" codebase="http://www.surfnetkids.com/games/scrambler/" height="420" width="300">');
document.writeln('<PARAM name="image" value="http://www.surfnetkids.com/images/wolf20.jpg">');
document.writeln('<PARAM name="selectioncolor" value="0000ff">');
document.writeln('<PARAM name="bgcolor" value="'+hexcolor+'">');
document.writeln('<PARAM name="rows" value="4">');
document.writeln('<PARAM name="cols" value="3">');
document.writeln('</APPLET>');
}

if (gamenumber == 3)
{
document.writeln('<center><applet code=MazeApplet3ech.class width=318 height=228 codebase=http://www.surfnetkids.com/games/ archive=MazeApplet3.jar>');
document.writeln('<param name=AUTHOR value="Eric Harshbarger, http://www.ericharshbarger.org">');
document.writeln('<param name=COPYRIGHT value="MazeApplet applet, Copyright 1998, Eric Harshbarger">');
document.writeln('<param name=ROWS value=25>');
document.writeln('<param name=COLUMNS value=35></center>');
document.writeln('<param name=CELLSIZE value=9>');
document.writeln('<param name=START.POINT value="0,0">');
document.writeln('<param name=FINISH.POINT value="62,24">');
document.writeln('</applet>');
}
if (gamenumber == 4)
{
document.writeln('<center><applet code=SeekAWord3ech.class width=450 height=350 codebase=http://www.surfnetkids.com/games/seek/ archive=SeekAWord3.jar>');
document.writeln('<param name=AUTHOR value="Eric Harshbarger, http://www.ericharshbarger.org">');
document.writeln('<param name=COPYRIGHT value="SeekAWord applet, Copyright 1998, Eric Harshbarger">');
document.writeln('<param name=WORDLIST value="games puzzles jigsaw scramble words search seek find play fun crossword maze tetris arcade kids slider">');
document.writeln('<param name=FOUND.SOUND value=http://www.surfnetkids.com/images/glissant1.au>');
document.writeln('<param name=CANVAS.BGCOLOR value="255,255,192">');
document.writeln('</applet>');
}

if (gamenumber == 5)
{
document.writeln('<applet code=BreakAway1ech.class width=340 height=360 codebase=http://surfnetkids.com/games/ archive=BreakAway1.jar>');
document.writeln('<param name=COPYRIGHT value="BreakAway applet, Copyright 1999, Eric Harshbarger">');
document.writeln('<param name=AUTHOR value="Eric Harshbarger, http://www.ericharshbarger.org">');
document.writeln('<param name=BACKGROUND value="http://surfnetkids.com/images/v-mouse.jpg">');
document.writeln('<param name=BGCOLOR value="0,0,0">');
document.writeln('<param name=FGCOLOR value="255,255,255">');
document.writeln('<param name=SPEED value="20">');
document.writeln('<param name=BALL.COUNT value="4">');
document.writeln('<param name=PADDLE.WIDTH value="60">');
document.writeln('<param name=BRICK.WIDTH value="30">');
document.writeln('<param name=BRICK.HEIGHT value="22">');
document.writeln('<param name=TOP.ROW.START value="30">');
document.writeln('<param name=ROW.COLORS value="49,255,156 | 0,0,255 | 49,255,156 | 0,0,255 | 49,255,156 | 0,0,255">');
document.writeln('<param name=SOUND.WALL value="http://surfnetkids.com/images/ip.au">');
document.writeln('<param name=SOUND.BRICK value="http://surfnetkids.com/images/ip.au">');
document.writeln('<param name=SOUND.WIN value="http://surfnetkids.com/images/fanfare.au">');
document.writeln('<param name=SOUND.MISS value="http://surfnetkids.com/images/bonk.au">');
document.writeln('</applet>');
}
if (gamenumber == 6)
{
document.writeln('<APPLET code="Solitaire" codebase="http://surfnetkids.com/games/" width="475" height="410">');
document.writeln('<PARAM name="bgcolor" value="'+hexcolor+'">');
document.writeln('<PARAM name="topscorecolor" value="0000ff">');
document.writeln('<PARAM name="scorecolor" value="0000ff">');
document.writeln('<PARAM name="gameovercolor" value="ff00ff">');
document.writeln('<PARAM name="bonuscolor" value="ff0000">');
document.writeln('</APPLET>');
}

if (gamenumber == 7)
{
document.writeln('<applet code="Scrambler" codebase="http://surfnetkids.com/games/scrambler/" height="478" width="435">');
document.writeln('<PARAM name="image" value="http://surfnetkids.com/images/railroadtrack.jpg">');
document.writeln('<PARAM name="selectioncolor" value="0000ff">');
document.writeln('<PARAM name="rows" value="4">');
document.writeln('<PARAM name="cols" value="3">');
document.writeln('</APPLET>');
}

document.writeln('<br><br><b><a href="http://surfnetkids.com/cgi-bin/affiliates/cu.cgi?id=' + affid);
document.writeln('">Click here to learn how to make games for your organization\'s Web site.</a>');
document.writeln('<br><br><font size=-1><a href="http://surfnetkids.com/cgi-bin/affiliates/cu.cgi?id='+affid+'&page=http://how2add.com/cgi-bin/pl/pl.cgi?su">Click here to earn money putting this game page on your site.</a><br><br>Want more? Use browser refresh to try a different game.</font></center></td></tr></table>');
}

callgame("inhouse","FFFFFF");