            
function danceArray(length)
{
	var i = 0;
	this.length2 = length;
	for (i=0; i<length; i++)
	{
		this[i] = 0;
	}
	return this;
}

function addDance(title,shtml,author,formation,difficulty,music)
{
	this.title = title;
	this.shtml = shtml;
	this.author = author;
	this.formation = formation;
	this.difficulty = difficulty;
	this.music = music;
	return this;
}


var totDances = 0;
var dance = danceArray(totDances);

//dance[totDances++] = new addDance("", "", "", "", "", "");
//
dance[totDances++] = new addDance("Title", "SHTML File", "Author", "Formation", "Difficulty", "Music");
dance[totDances++] = new addDance("Chocolate Swirls", "chocolate_swirls.shtml", "Dale Rempert", "improper", "intermediate", "");
dance[totDances++] = new addDance("Dancing Ants", "ants.shtml", "Sharon Rempert", "improper", "easy", "");
dance[totDances++] = new addDance("The Devil's Backbone", "devilsbkbn.shtml", "William Watson", "four face four", "advanced", "");
dance[totDances++] = new addDance("Dzzydncr", "dzzydncr.shtml", "Katherine Kuykendall", "proper", "intermediate", "");
dance[totDances++] = new addDance("Feet in Flight", "ftflight.shtml", "Dale Rempert", "improper", "intermediate", "Gypsy Bride");
dance[totDances++] = new addDance("Foregone Conclusions", "foreconcl.shtml", "Dale Rempert", "becket", "intermediate-advanced", "Smooth Reels");
dance[totDances++] = new addDance("Okay Bayou Circle", "bayou_circle.shtml", "Dale Rempert", "sicilian circle", "easy", "");
dance[totDances++] = new addDance("Springtime in January", "springtime.shtml", "Sharon Rempert", "duple improper", "easy", "");
dance[totDances++] = new addDance("Sunshine Meltdown", "sunshine_meltdown.shtml", "Sharon Rempert", "duple improper", "easy, but with advanced moves", "");
dance[totDances++] = new addDance("Surprise Day", "surprise_day.shtml", "Marc Airhart", "duple improper", "easy", "");
dance[totDances++] = new addDance("Weave Me the Sunshine", "sunshine.shtml", "Dale Rempert", "becket - dbl. progression", "intermediate", "");

function danceTable()
{
	document.write('<table border="1" width="600">');
	for (x=0; x<totDances; x++)
	{
		document.write('<tr>');
		if (dance[x].title != 'Title')
		{
			document.write('<td><a href =' + dance[x].shtml + '>' + dance[x].title + '</a></td>');
		}
		else
		{		
			document.write('<td>' + dance[x].title + '</td>');
		}

		//document.write('<td><a href =' + dance[x].shtml + '</td>');
		document.write('<td>' + dance[x].author + '</td>');
		document.write('<td>' + dance[x].formation + '</td>');
		document.write('<td>' + dance[x].difficulty + '</td>');
		if (dance[x].music == "")
		{
			document.write('<td>\ </td>');
		}
		else
		{
			document.write('<td>' + dance[x].music + '</td>');
		}
		document.write('</tr>');
	}
	document.write('</table>');
}

function footer(i)
{
	for(y=1; y<totDances; y++)
	{
		if(dance[y].title==i)
		{
			x=y;
		}
	}


	document.write('<hr width="80%" size="3" color="#9134DB">');
	document.write('<table><tr><td><a href="./index.shtml"><img src="../graphics/barrow.gif" width="50" height="50" border="0" /></a></td>');
	document.write('<td colspan="2"><a href="./index.shtml">Dance Index</a></td></tr>');

	if(x==1)
	{
		nextDance(x);
	}
	else if (x == (totDances-1))
	{		
		previousDance(x);
	}
	else
	{
		previousDance(x);
		nextDance(x);
	}

	document.write('</table>');
//abd index
	document.write('<a href="../index.shtml"><img src="../graphics/abd_20pt.gif" width="290" height="30" border="0" /></a>');
	document.write('<img src="../graphics/homepage18pt.gif" width="133" height="30" /><hr size="3" />');
	
}

function previousDance(x)
{
	document.write('<tr><td><a href="./' + dance[x-1].shtml + '"><img src="../graphics/barrow.gif" width="50" height="50" border="0" /></a></td>');
	document.write('<td><a href="./' + dance[x-1].shtml + '">Previous Dance</a></td>');
	document.write('<td>(<a href="./' + dance[x-1].shtml + '">' + dance[x-1].title + '</a> by ' + dance[x-1].author + ')</td></tr>');
}

function nextDance(x)
{
	document.write('<tr><td><a href="./' + dance[x+1].shtml + '"><img src="../graphics/farrow.gif" width="50" height="50" border="0" /></a></td>');
	document.write('<td><a href="./' + dance[x+1].shtml + '">Next Dance</a></td>');
	document.write('<td>(<a href="./' + dance[x+1].shtml + '">' + dance[x+1].title + '</a> by ' + dance[x+1].author + ')</td></tr>');
}


function indexPage()
{
	authors = new Array();	
	a=0;
	for(t=1; t<totDances; t++)
	{
		tot=0;
		while (tot < a+1)	
		{
			if((authors[tot]== "") || (authors[tot] == null))
			{
				authors[tot]= dance[t].author;
				tot = a+1;
				a=0;
			}
			else if (dance[t].author == authors[tot])
			{
				tot = a+1;
				a=0;
			}
			else
			{
				tot++;
				a++;
			}
		}
	}
	authors.sort();
	document.write('<table align="center"><tr><td align="left"><dl>');
	for(a = 0; a < authors.length; a++)
	{
		document.write('<dt><b>' + authors[a] + '</b></dt>');
		for(b=0; b<totDances; b++)
		{
			if(dance[b].author == authors[a])
			{				
				document.write('<dd><a href="./' + dance[b].shtml + '">'+ dance[b].title + '</a></dd>');
			}
		}		
	}
	document.write('</dl></td></tr></table>');
}



