function textlist()
{
	this.current_message=0;
	this.current_message_pos=0;
	this.message=new Array;
	this.max_message_number=textlist.arguments.length;
	for (counter=0; counter<this.max_message_number; counter++ )
		this.message[counter]=textlist.arguments[counter];
}

var messages=new textlist
(
	"Welcome to the BCR Motorsport Website",
	"Winner 2001 Mighty Minis \"Best Improved Driver\"",
	"Winner 2004 Mighty Minis Spirit of the Championship",
	"Winner 2005 Mighty Minis \"Most Entertaining Driver\"",
	"BCR-Motorsport is sponsored by the Mini Spares Centre",
	"Next Race - 7th-8th October, Silverstone"
);

function tick()
{
	// Get the length of the current message
	var message_length=messages.message[messages.current_message].length;
	
	//Get the first n characters of the current message and print it in the form
	document.tickform.textfield.value=messages.message[messages.current_message].substring(0,messages.current_message_pos)+"-_";
	// Increment the message counter
	messages.current_message_pos++;
	// If this is the last character of the current message, then reset the counters and print the message for a long while:
	if (messages.current_message_pos==message_length)
	{
		document.tickform.textfield.value=messages.message[messages.current_message].substring(0,messages.current_message_pos)+"  ";
		messages.current_message_pos=0;
		messages.current_message++;
		// If this is the final message, then reset the message counter back to 0
		if(messages.current_message==messages.max_message_number)
		{
			messages.current_message=0;
		}
		setTimeout("tick()", 2000);
	}
	else
	{
		setTimeout("tick()", 50);
	}
}

function generate_visitors()
{
	//Read in the file with a visitor list

	list="286";
 	num_digits=list.length;
	document.write("<img src=\"images/left.gif\" alt=\"\" border=\"0\">");
	for (counter=0; counter<num_digits; counter++ )
	{
		digit=list.substr(counter, 1);
		switch (digit)
		{
			case "0":
				document.write("<img src=\"images/0.gif\" alt=\"0\" border=\"0\">");
				break;
			case "1":
				document.write("<img src=\"images/1.gif\" alt=\"1\" border=\"0\">");
				break;
			case "2":
				document.write("<img src=\"images/2.gif\" alt=\"2\" border=\"0\">");
				break;	
			case "3":
				document.write("<img src=\"images/3.gif\" alt=\"3\" border=\"0\">");
				break;
			case "4":
				document.write("<img src=\"images/4.gif\" alt=\"4\" border=\"0\">");
				break;
			case "5":
				document.write("<img src=\"images/5.gif\" alt=\"5\" border=\"0\">");
				break;
			case "6":
				document.write("<img src=\"images/6.gif\" alt=\"6\" border=\"0\">");
				break;
			case "7":
				document.write("<img src=\"images/7.gif\" alt=\"7\" border=\"0\">");
				break;
			case "8":
				document.write("<img src=\"images/8.gif\" alt=\"8\" border=\"0\">");
				break;
			case "9":
				document.write("9");
				break;
			default:
				document.write("");
		}
	}
	document.write("<img src=\"images/right.gif\" alt=\"\" border=\"0\">");
}

function bcr_furniture_top()
{
	document.write("<table>");
	document.write("	<tr>");
//	document.write("		<td><img src=\"images/logo.gif\" alt=\"\" border=\"0\"></td>");
	document.write("		<td></td>");
	document.write("		<td>");
	document.write("			<table>");
	document.write("				<tr>");
	document.write("					<td>");
	document.write("						<table>");
	document.write("							<tr><td>");
	document.write("								<img src=\"images/topbanner.gif\" alt=\"\" border=\"0\">");
	document.write("							</td></tr>");
	document.write("							<tr><td>");
	document.write("								<form name=\"tickform\" class=\"ticker\">");
	document.write("									<input type=\"text\" name=\"textfield\" size=\"80\" class=\"ticker\">");
	document.write("								</form>");
	tick();
	document.write("							</td>");
	document.write("						</tr>");
	document.write("					</table>");
	document.write("				</td>");
	document.write("				<td>");
//	document.write("					<a href=\"http://www.minispares.com\" target=\"_blank\">");
//	document.write("					<img src=\"images/minispares_banner.gif\" border=\"0\">");
//	document.write("					</a>");
	document.write("				</td>");
	document.write("			</tr></table>");
	document.write("		</td>");
	document.write("	</tr>");
	document.write("	<tr class=\"menu\">");
	document.write("		<td></td>");
	document.write("		<td>");
	document.write("			<table>");
	document.write("				<tr class=\"menu\">");
	document.write("					<th><a class=\"menu\" href=\"joinmailinglist.html\">mailing list</a> |</th>");
	document.write("					<th><a class=\"menu\" href=\"http://www.candfracing.co.uk/pitlane/\" target=\"_blank\">forum</a> |</th>");
	document.write("					<th><a class=\"menu\" href=\"contacts.html\">contact</a> |	</th>");
//	document.write("					<th>history |</th>");
//	document.write("					<th>downloads | </th>");
	document.write("					<th><a class=\"menu\" href=\"press.html\">press</a> | </th>");
	document.write("					<th><a class=\"menu\" href=\"links.html\">links</a> |</th>");
	document.write("					<th><a class=\"menu\" href=\"sitecredits.html\">credits</a></th>");
	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td>");
	document.write("			<table>");
	document.write("				<tr><td><a href=\"index.html\"><img src=\"images/button-home.gif\" alt=\"\" border=\"0\"></a></td></tr>");
	document.write("				<tr><td><a href=\"mighty_minis.html\"><img src=\"images/button-mm.gif\" alt=\"\" border=\"0\"></a></td></tr>");
	document.write("				<tr><td><a href=\"sponsorship.html\"><img src=\"images/button-sponsorship.gif\" alt=\"\" border=\"0\"></a></td></tr>");
//	document.write("				<tr><a href=\"team-bcr.html\"><img src=\"images/button-team.gif\" width=\"68\" height=\"35\" alt=\"\" border=\"0\"></a></tr>");
	document.write("				<tr><td><a href=\"calendar_2006.html\"><img src=\"images/button-calendar.gif\" alt=\"\" border=\"0\"></a></td></tr>");
	document.write("				<tr><td><a href=\"racereports.html\"><img src=\"images/button-racereports.gif\" alt=\"\" border=\"0\"></a></td></tr>");
//	document.write("				<tr><a href=\"history.html\"><img src=\"images/button-history.gif\" width=\"90\" height=\"36\" alt=\"\" border=\"0\"></a></tr>");
	document.write("				<tr><td><a href=\"gallery.html\"><img src=\"images/button-gallery.gif\" alt=\"\" border=\"0\"></a></td></tr>");
//	document.write("				<tr><a href=\"links.html\"><img src=\"images/button-links.gif\" width=\"58\" height=\"23\" alt=\"\" border=\"0\"></tr></a>");
	document.write("				<tr><td><a href=\"http://www.mightyminis.co.uk\"><img src=\"images/mighty_minis_logo_small.gif\" alt=\"\" border=\"0\"></a></td></tr>");
//	document.write("				<tr><th>visitors so far</th></tr>");
//	document.write("				<tr>");
//	document.write("					<td>");
//	document.write("						<img src=\"/cgi/counter.pl\" alt=\"counter\">");
//	document.write("					</td>");
//	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("		<td>");
}

function bcr_furniture_end()
{
	document.write("		</td>");
	document.write("	</tr>");
	document.write("</table>");
}

function draw_pic(pic_name, thumb_name, caption)
{
	document.write("<table class=gallery>");
	document.write("<tr><th>");
	document.write("<a href=\""+pic_name+"\" target=\"_blank\">");
	document.write("<img src=\""+thumb_name+"\" alt=\""+caption+"\" border=\"0\"></a>");
	document.write("</th></tr>");
	document.write("<tr><td>");
	document.write("<caption>"+caption+"</caption>");
	document.write("</td></tr>");
	document.write("</table>");	
}

function inline_pic(year, event, pic_num, align, caption)
{
	var path = "gallery/"+year+"/"+event;
	var pic = path+"/"+pic_num+".jpg";
	var thumb = path+"/tn_"+pic_num+".jpg";
	document.write("<a href=\""+pic+"\" target=\"_blank\">");
	document.write("<img src=\""+thumb+"\" alt=\""+caption+"\" border=\"0\"> align=\""+align+"\">");
	document.write("</a>");
}