<!-- 
//	create Tom Lewis Tour Schedule
//	author: David Shapiro
//	date: 2005-02-05 16:39:13
//
var tourschedule=new Array();	// array of gig entries
var totalGig=0;				// total number of gigs listed
var display='';				// to hold the HTML that the script will write
var rowclass='';			// background color class for rows
//	build one raw gig entry
function rawtourscheduleLine (date, town, club, email, website) {
	this.date = date;
	this.town = town;
	this.club = club;
	this.email = email;
	this.website = website;
}
//	build the array of inventory entries, tracking the total count
function gigline (allinfo) {
//	parse fields delimited by | from allinfo
	delim1 = allinfo.indexOf("|", 0);
	delim2 = allinfo.indexOf("|", delim1+1);
	delim3 = allinfo.indexOf("|", delim2+1);
	delim4 = allinfo.indexOf("|", delim3+1);
		date = allinfo.substring(0, delim1);
		town = allinfo.substring(delim1+1, delim2);
		club = allinfo.substring(delim2+1, delim3);
	   email = allinfo.substring(delim3+1, delim4);
	 website = allinfo.substring(delim4+1, allinfo.length);
	tourschedule[totalGig] = new rawtourscheduleLine(date, town, club, email, website);
	totalGig++;
}
function showGigs()	{
	var outcount = 0;	// count output rows
//	Display the Gig listings
	with (document) {
		write('<table border="0" cellspacing="0" cellpadding="3">');
		for (var i = 0; i < totalGig; i++) {
			with (tourschedule[i]) {
				display = '';	// reset row output buffer
//	Decide whether a row is a Header
				if (date=="head") {
					rowclass="headrow";
					display += '<tr class="'+rowclass+' valign="middle">';
					display += '<td colspan="3"><strong class="big">'+town+'</strong></td>';	// actually the Title
					display += '</tr>';
				}
				else {
					outcount++;	// count the row
					rowclass=((outcount%2)==0)?"oddrow":"evenrow";	// toggle row background colour
					display += '<tr class="'+rowclass+' valign="middle">';
					display += '<td width="80">'+date+'</td>';
					display += '<td><strong>'+town+'</strong></td>';
					display += '<td><table border="0" cellpadding="0"><tr>';
					display += '<td>'+club+'</td>';
					display += '<td>&nbsp;&nbsp;</td>';
					display += '<td class="small">';
					display += (email)?'<a href="mailto:'+email+'">'+email+'</a>':'';
					display += (email&&website)?'<br>':'';
					showsite = (website.length>=30)?website.substring(0,27)+"...":website;
					display += (website)?'<a href="http://'+website+'" target="_blank">'+showsite+'</a>':'';
					display += '</td></tr></table></td>';
					display += '</tr>';
				}
				write(display);
			}
		}
		write('</table>\n');
	}
	return;
}
// -->