function writeFooter(pageName)
{
	/* Creates the navigation button bar for PTC webpages
	   removes link and applies different style for the button that links to the current page.*/
/*	var footerBGColour = "#99CCFF"; */
	var footerBGColour = "#FFFEF0";
	var footerHTML =  "<TR bgcolor='" + footerBGColour + "' align='center' height='20'>" ;
/*	footerHTML += "<TD></TD>"; */
	footerHTML += "<TD colspan='5'>" + writeButtonBar(pageName) + "</TD>";
/*	footerHTML += "<TD>" + writeButtonBar(pageName) + "</TD>";	 */
/*	footerHTML += "<TD></TD>"; */
	footerHTML += "</TR>";
	document.write(footerHTML);
}

function writeButtonBar(locn)
{	
	var locString = new String(locn);
	var pageName = locString.substring(locString.lastIndexOf("/") + 1, locString.lastIndexOf("."));
	var linkNames = Array("default", "newsletter", "calendar", "SpecialEvents", "RegularDancing", "IntroductoryClasses", "contactus", "aboutus",  "PerthPages001", "Articles", "photos", "movies", "links", "ReciprocalTango", "glossary", "Concessions"); 
	var buttonNames = Array("Home", "Latest News", "Perth Calendar", "Special Events",  "Regular Dancing", "Introductory Classes", "Contact Us", "About Us", "Tango in Perth", "Articles", "Photos", "Movies", "Tango Links", "Reciprocal Tango", "Glossary", "Club Concessions"); 
	
	var buttons="<TABLE border='-1'<TR><TD></TD>";
	var SPACER_CELL_HTML = "<TD width='1'></TD>";
	for(i = 0; i < linkNames.length; i++)
	{
		buttons += createButtonHTML(pageName, (linkNames[i] == pageName), buttonNames[i], linkNames[i]);
		if(i < linkNames.length - 1)
		{
			buttons += SPACER_CELL_HTML;
		}
	}
  buttons +=	"<TD></TD></TR></TABLE>";
	return(buttons);
}			

function createButtonHTML(pageName, currentPage, buttonName, linkName)
{
		var buttonHTML = "<TD class='";
		if(currentPage)
		{
			buttonHTML += "Visited";
		}
	
		buttonHTML += "ButtonCell'>";

		var linkHTML = buttonName; 
		if(!currentPage)
		{
/*			linkHTML = "<a href='" + linkName + ".htm'>" + linkHTML + "</a></TD>"; */
			linkHTML = "<a href='" + linkName + ".htm'>" + "<font face=\"Comic Sans MS\" size=\"-2\">"  + linkHTML + "</a></TD>"; 

		}

		buttonHTML += linkHTML;
		return buttonHTML;	
}
