var q = 0;

function setCode(seed)
	{
	var codeList=new 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")
	seed = seed + 10378;
	var code=codeList[seed % 26];	
	for (var i = 0; i <=10; i++)
		{seed = seed+1123;
		 code = code + codeList[seed % 26]}
	return(code)
	}

function searchtraffic()
{
document.write("<TABLE BORDER=1 WIDTH=120 CELLSPACING=0 CELLPADDING=0 bgcolor=#66cc99>")
document.write("<form target=new action=http://www.searchtraffic.com/search.php3   method=GET>")
document.write("<TR><TD><img src=images/search8.gif width=120 height=46 border=0></TD></tr>")
document.write("<tr><TD VALIGN=bottom height=40 align=center>")
document.write("<input TYPE=hidden VALUE=juliewolf NAME=l>")
document.write("<input type=text size=15 name=term><br></b>")
document.write("<input type=submit value=Search></td></tr>")
document.write("</form></TABLE>")


}

function dealtime()
{
document.write("<IMG SRC=http://service.bfast.com/bfast/serve?bfmid=19187551&siteid=30128430&bfpage=search")
document.write(" BORDER=0 WIDTH=1 HEIGHT=1 NOSAVE >")
document.write("<FORM  target=new ACTION=http://service.bfast.com/bfast/click >")
document.write("<INPUT TYPE=hidden NAME=siteid VALUE=30128430 >")
document.write("<INPUT TYPE=hidden NAME=bfpage VALUE=search>")
document.write("<INPUT TYPE=hidden NAME=bfmid VALUE=19187551 >")
document.write("<INPUT name=nFormID type=hidden value=>")
document.write("<INPUT name=nParentFormID type=hidden value=>")
document.write("<INPUT name=uid type=hidden value=>")
document.write("<INPUT name=Operator type=hidden value=2>")
document.write("<INPUT name=linkin_id type=hidden value=1005940>  ")
document.write("<table cellspacing=0 cellpadding=0 border=0 width=120>")

document.write("<tr><td colspan=2><IMG ")
document.write("SRC=http://www.dealtime.com/dealtime2000/images/banners/Affiliate/120x68-4.gif width=122 height=68></td></tr>")
document.write("<tr><td><input type=IMAGE")
document.write(" SRC=http://www.dealtime.com/dealtime2000/images/banners/Affiliate/120x68Search2.gif width=74 height=23 border=0></a>")
document.write("</td><td align=right><IMG")
document.write(" width=48 height=23 SRC=http://www.dealtime.com/dealtime2000/images/banners/Affiliate/120x68Right.gif></td></tr>")
document.write("<tr bgcolor=#9CCEFF><td align=center><input type=text size=7 name=keyword maxlength=50></td>")
document.write("<td align=right><IMG SRC=http://www.dealtime.com/dealtime2000/images/banners/Affiliate/120x68-1.gif width=35 height=29></td>")
document.write("</tr></table></FORM>")
}

function overture()
{
document.write("<IMG SRC=http://service.bfast.com/bfast/serve?bfmid=253985&bfsiteid=29892987&bfpage=over001")
document.write("BORDER=0 WIDTH=1 HEIGHT=1 NOSAVE >")
document.write("<FORM target=new ACTION=http://service.bfast.com/bfast/click >")
document.write("<INPUT TYPE=hidden NAME=bfsiteid VALUE=29892987 >")
document.write("<INPUT TYPE=hidden NAME=bfpage VALUE=over001>")
document.write("<INPUT TYPE=hidden NAME=bfmid VALUE=253985 >")
document.write("<table width=154 cellpadding=0 cellspacing=0 border=0>")
document.write("<tr><td width=154 bgcolor=#000000><table width=100% cellpadding=0 cellspacing=2 border=0>")
document.write("<tr><td width=46><a href=http://www.overture.com/>")
document.write("<img src=http://www.overture.com/images-affiliates/befree/ologo.gif width=46 height=37 border=0 alt=Overture></a></td>")
document.write("<td width=108 bgcolor=#FFFFFF align=center><font face=verdana,sans-serif size=1><b>Search&nbsp;the&nbsp;Web.</b><br>Type it and go!</td></tr>")
document.write("<tr><td colspan=2 bgcolor=#FFFFFF><table width=100% cellpadding=5 cellspacing=0 border=0><tr><td align=right><input type=text size=12 name=Keywords></td>")
document.write("<td><input type=submit name=Go value=Go>")
document.write("<input type=hidden name=Promo value=befree></td></tr></table></td></tr>")
document.write("</table></td></tr></table></FORM>")
}

function ShowHelp()
	{
	window.open ("help.html","help","toolbar=NO,status=NO,directories=NO,scrollbars=YES,menubar=NO,resizable=YES,width=400,height=250")
	}

function writeCounter()
	{
	document.writeln ("<HR>");
	document.writeln ("<img width=90 height=20 src=../cgi-bin/counter.exe?-t0+-f202020+-w6+p" + q+ ">")
	}

function showHallOfFame()
	{
	window.open ("hof.html","help","toolbar=NO,status=NO,directories=NO,scrollbars=YES,menubar=NO,resizable=YES,width=400,height=250")
	}

function NextPage (x)
	{
	var z = (q+1)+"-" + x.substring(0,23) +".html";
	top.location.href = (q+1)+"-" + x.substring(0,23) +".html";
	}

function setQ(x)
	{
	if (x.lastIndexOf("index.html") >= 0)
	 	{return(-1)}
	else  	{
	x = x.substring(x.lastIndexOf("puzzler/")+8, x.indexOf("-"));
	return(x % 200)
		}
	}


function MakeArray (size)
	{
	this.length = size
	for (var i = 0; i <= size; i++)
		{this[i]=0}
	return this
	}

function showAds()
	{
var n = Math.round(Math.random()*100) % 10;
var choices=5;
var k = Math.round(Math.random()*100) % choices


document.write("<TH rowspan=2 width=180>")




document.write("[<a target=guestbook href=add.html>Sign</a> / <a target=guestbook href=guestbook.html>view</a>]  the guestbook</a>")
document.write("<HR>")
document.write("<a target=hof href=hof.html>hall of geekiness</a>")

document.write("</TH>")


	}


function hallOfFame(m)
	{
	var adr = "20";
	if (m == 40)
		{adr = "forty"}
	else if (m == 60)
		{adr = "spinach_lasagne"}
	else if (m == 80)
		{adr = "language_barrier"}
	else if (m == 100)
		{adr = "effusive_vixen"}
	var aler = "You've made it to level " 
	    aler = aler + m 
	    aler = aler + "! E-mail " 
	    aler = aler + adr;
	    aler = aler + "-puzzle@songweaver.com with the answers to questions "
	    aler = aler + (m-3) 
	    aler = aler + ", " 
	    aler = aler + (m-2) 
	    aler = aler +" and "+ m + " if you want to be listed in the hall of geekiness."
	window.alert (aler) 
	}

function Question(counter)
	{
q = setQ(location.pathname);

var choices = 13;


var x = Math.round(Math.random()*100) % choices;

var congrats = new MakeArray(choices);
congrats[0] = "Congratulations!";
congrats[1] = "Very good!";
congrats[2] = "Excellent!";
congrats[3] = "Way to go!";
congrats[4] = "Outstanding!";
congrats[5] = "Wonderful!";
congrats[6] = "Too cool!";
congrats[7] = "I can't believe it!";
congrats[8] = "You're very smart.";
congrats[9] = "You study a lot, don't you?";
congrats[10] = "That was an easy one.";
congrats[11] = "How did you figure that out?";
congrats[12] = "I'm astounded!";
congrats[13] = "I'm amazed!";




	document.writeln ("<p>");
	if (q >>1)
	{
	document.writeln (congrats[x]);
	document.writeln (" ");

	document.writeln ("You've answered question #");
	document.writeln (q-1 + ".");
	document.writeln ("</p>");
	}
	if ( ( ( (q-1) % 20) == 0)  && (q >= 30) && ( (q-1) % 60 != 0) ) 
		{
		hallOfFame(q-1)
		}
	if (q != "101")
	{
		document.writeln ("<p><h4>Question #");
		document.writeln (q);
		document.writeln ("</h4>")
	}
	else	{document.writeln("<BR><BR>")}
	}


function Question2(counter)
	{
q = setQ(location.pathname);
	if (q == "1")
		{window.alert ("Congratulations!  You've completed Phase II.  To be listed in the hall of fame, please send an e-mail to puzzle-ii-wisdom@songweaver.com with the answers to the final questions of thee of the categories from phase ii.")}
document.writeln ("<p><h4>Phase III:  ");
document.writeln (q);
document.writeln ("</h4>")
	}