modulus=714025;
gain=4096;
offset=150889;
seed=(new Date()).getTime()%modulus;

SitesListPreNo=1+Math.floor(SiteMax*random());
SitesListPredict=su[SitesListPreNo];

start=11+document.cookie.indexOf('ringaction=');
end=start+4;
ringaction=document.cookie.substring(start,end);

start=10+document.cookie.indexOf('sitecount=');
if (start==-1)
	{
	document.cookie("sitecount=1");
	sitecount=1;
	start=10+document.cookie.indexOf('sitecount=');
	}

end=document.cookie.indexOf(';',start);
if (end==-1) end=document.cookie.length;
sitecount=document.cookie.substring(start,end);

if (ringaction=="list"||ringaction=="alph")
	{
	document.write("<HTML>");
	document.write("<HEAD>");
	document.write("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">");
	document.write("<META NAME=\"GENERATOR\" CONTENT=\"Joe Tozer [Ring Manager]\">");
	document.write("</HEAD>");
	document.write("<BODY>");
	document.write("<TABLE CELLPADDING=24 WIDTH=\"100%\" >");
	document.write("<TR>");
	document.write("<TD WIDTH=\"15%\"></TD>");
	document.write("<TD WIDTH=\"70%\" BGCOLOR=\"#FFFFCC\"><FONT FACE=\"Arial,Helvetica\"><H2><A HREF=\"index.html\">Basingstoke Roundabout</A></H2>");
	if (ringaction=="list") document.write("<P>Following is a categorised listing of the "+SiteMax+" member sites in the WebRing.<br>Click here for an <b><a href =\"alph.html\">alphabetic listing</a></b>.<p>");
	if (ringaction=="alph") document.write("<P>Following is a alphabetic listing of the "+SiteMax+" member sites in the WebRing.<br>Click here for a <b><a href =\"list.html\">categorised listing</a></b>.<p>");
	document.write("");
	document.write("");
	document.write("");
	if (ringaction=="list")
		{
		for (r=1;r<=CatsMax;r++)
			{
			for (q=1;q<=SiteMax;q++)
				{
				if (q==1) document.write("<b><p>"+sc[r]+"<br>");
				DisplaySite = sg[q].indexOf(r);
				if (DisplaySite != -1)
					{
					document.write("<a href = http://"+su[q]+">"+sn[q]+"</a><br>");
					if (sd[q] != "") document.write("<font size=-1> "+sd[q]+"</font><br><br>");
					}
				if (q==1) document.write("</b>");
				}
			}
		}
	if (ringaction=="alph")
		{
		for (q=1;q<=SiteMax;q++)
			{
			if (q==1) document.write("<b>");
			if (q<10) document.write("0");
			document.write(q+". "+"<a href = http://"+su[q]+">"+sn[q]+"</a><br>");
			if (sd[q] != "") document.write("<font size=-1> "+sd[q]+"</font><br><br>");
			if (q==1) document.write("</b>");
			}
		}
	document.write("</FONT>");
	document.write("<TD WIDTH=\"15%\"></TD>");
	document.write("</TR>");
	document.write("</TABLE>");
	document.write("</BODY>");
	document.write("</HTML>");
	document.write("");
	}

if (ringaction=="prev"||ringaction=="next")
	{
	if (ringaction=="prev") sitecount--;
	if (ringaction=="next") sitecount++;
	if (sitecount<1) sitecount=SiteMax;
	if (sitecount>SiteMax) sitecount=1;
	document.cookie="sitecount="+sitecount;
	if (isNaN(sitecount))
		{
		sitecount=SitesListPreNo;
		document.cookie="sitecount="+SitesListPreNo;
		}
	location.replace("http://"+su[sitecount]);
	}

if (ringaction=="rand")
	{
	document.cookie="sitecount="+SitesListPreNo;
	location.replace("http://"+SitesListPredict);
	}

function random()
	{
	seed=(seed*gain+offset)%modulus;
	return seed/modulus;
	}

// end hide -->