// ------------------------------------------------------------------------------------------------------------
//	galleryNavListItems
// ------------------------------------------------------------------------------------------------------------
function galleryNavListItems(includeContact)
{
	/* galleryNavString() returns a string in the form:
				
			<li><a href="javascript:showFoto(0, 0)">name of first gallery	</a></li>
			<li><a href="javascript:showFoto(1, 0)">name of second gallery	</a></li>
			<li><a href="javascript:showFoto(2, 0)" id="current">name of third gallery	</a></li> // <- this is the current gallery
			<li><a href="javascript:showFoto(3, 0)">name of fourth gallery	</a></li>
	*/
	
	// the galleries nav
	
	var galleryNavListItems = "";
	
	var galleryCount = document.toc.galleries.length
	for (var g = 0; g < galleryCount; g++) 
	{
		var linkText = '<span>' + document.toc.galleries[g].name + '</span>'
		
		var liOpenTag = '<li>';
		
		if (g == galleryCount - 1)
		{
			liOpenTag = '<li class="last">'
		}
		
		var actionText = 'javascript:showFoto(' + g + ', 0)'
		if (g == document.galleryIndex)
		{
			linkText = liOpenTag + '<a href="' + actionText + '" id="current">' + linkText + '</a></li>'
		}
		else
		{
			
			linkText = liOpenTag + '<a href="' + actionText + '">' + linkText + '</a></li>'
		}
		
		galleryNavListItems += linkText
	}

	return galleryNavListItems
}

// ------------------------------------------------------------------------------------------------------------
//	contactStringForGalleryNav
// ------------------------------------------------------------------------------------------------------------
function contactStringForGalleryNav()
{
	// Contact info is a "pseudo gallery" with index = -1
	if (document.galleryIndex == -1)
	{
		return '<li class="contactItem"><a id="current" href="javascript:showContactInfo()">Contact	</a></li>'
	}
	else
	{
		return '<li class="contactItem"><a href="javascript:showContactInfo()">Contact	</a></li>'
	}
}


// ------------------------------------------------------------------------------------------------------------
//	writeGalleryNav
// ------------------------------------------------------------------------------------------------------------
function writeGalleryNav()
{
	/* writeGalleryNav() writes an unordered list of links in the form:
			
		<ul id="gallery_list">
			<li><a href="javascript:showFoto(0, 0)">name of first gallery	</a></li>
			<li><a href="javascript:showFoto(1, 0)">name of second gallery	</a></li>
			<li><a href="javascript:showFoto(2, 0)" id="current">name of third gallery	</a></li> // <- this is the current gallery
			<li><a href="javascript:showFoto(3, 0)">name of fourth gallery	</a></li>
		</ul>
	*/

	document.write('<ul id="gallery_list">' + galleryNavListItems() + '</ul>')
}

// ------------------------------------------------------------------------------------------------------------
//	writeGalleryNavAndContact
// ------------------------------------------------------------------------------------------------------------
function writeGalleryNavAndContact()
{
	/* writeGalleryNavAndContact() writes an unordered list of links in the form:
			
		<ul id="gallery_list">
			<li><a href="javascript:showFoto(0, 0)">name of first gallery	</a></li>
			<li><a href="javascript:showFoto(1, 0)">name of second gallery	</a></li>
			<li><a href="javascript:showFoto(2, 0)" id="current">name of third gallery	</a></li> // <- this is the current gallery
			<li><a href="javascript:showFoto(3, 0)">name of fourth gallery	</a></li>
			<li><a href="javascript:showContactInfo()">Contact	</a></li>
		</ul>
	*/

	document.write('<ul id="gallery_list">' + galleryNavListItems() + contactStringForGalleryNav() + '</ul>')
}

// ------------------------------------------------------------------------------------------------------------
//	writePreviousNext
// ------------------------------------------------------------------------------------------------------------
function writePreviousNext()
{
	/* writePreviousNext() writes an unordered list of links in the form:
			
			<ul>
				<!-- "previous" -->
				<li class="fotonav-previous"><a href="javascript:showPreviousFoto()"><span>&lt;</span></a></li> 

				<!-- "next" -->
				<li class="fotonav-next"><a href="javascript:showNextFoto()" alt="next >"><span>&gt;</span></a></li> 
			</ul>
	*/

	document.write('<ul>\n');
	document.write('<!-- "previous" -->\n<li id="previous"><a href="javascript:showPreviousFoto()"><span>&lt;</span></a></li>\n\n');
	document.write('\n<!-- "next" --><li id="next"><a href="javascript:showNextFoto()"><span>&gt;</span></a></li>\n\n');
	document.write('</ul>\n');
}


// ------------------------------------------------------------------------------------------------------------
//	fotoNavNumbers
// ------------------------------------------------------------------------------------------------------------
function fotoNavNumbers()
{
	/* fotoNavNumbers() returns an unordered list of links in the form:
			
			<li><a href="javascript:showFoto(currentGalleryIndex, 0)">00</a></li>
			<li><a href="javascript:showFoto(currentGalleryIndex, 1)">01</a></li>
			<li><a href="javascript:showFoto(currentGalleryIndex, 2) id="current">02</a></li> // this is the current photo
			<li><a href="javascript:showFoto(currentGalleryIndex, 3)">03</a></li>

	*/

	// the fotos nav
	
	var fotonavString = '';
	
	var fotoCount = document.toc.galleries[document.galleryIndex].entries.length
	for (var f = 0; f < fotoCount; f++) 
	{
		var linkText = String(f)

		if (f < 10)
		{
			linkText = "0" + linkText
		}
	
		linkText = '<span>' + linkText + '</span>';
		
		var liOpenTag = '<li>';
		
		if (f == fotoCount - 1)
		{
			liOpenTag = '<li class="last">'
		}
	
		var actionText = 'javascript:showFoto(' + document.galleryIndex + ', ' + f + ')'
		if (f == document.fotoIndex)
		{
			linkText = liOpenTag + '<a href="' + actionText + '" id="current">' + linkText + '</a></li>\n'
		}
		else
		{
			linkText = liOpenTag + '<a href="' + actionText + '">' + linkText + '</a></li>\n'
		}
		
		fotonavString += linkText
 	}
		
	return fotonavString
}

// ------------------------------------------------------------------------------------------------------------
//	writeFotoNavNumbers
// ------------------------------------------------------------------------------------------------------------
function writeFotoNavNumbers()
{
	/* writeFotoNavNumbers() writes an unordered list of links in the form:
			
			<ul id="foto_list">
				<!-- "previous" -->
				<li class="fotonav-previous"><a href="javascript:showPreviousFoto()"><span>&lt;</span></a></li> 

				<li><a href="javascript:showFoto(currentGalleryIndex, 0)">00</a></li>
				<li><a href="javascript:showFoto(currentGalleryIndex, 1)">01</a></li>
				<li><a href="javascript:showFoto(currentGalleryIndex, 2) id="current">02</a></li> // this is the current photo
				<li><a href="javascript:showFoto(currentGalleryIndex, 3)">03</a></li>

				<!-- "next" -->
				<li class="fotonav-next"><a href="javascript:showNextFoto()"><span>&gt;</span></a></li> 
			</ul>
	*/

	document.write('<ul id="foto_list">\n');
	document.write('<!-- "previous" -->\n<li id="previous"><a href="javascript:showPreviousFoto()"><span>&lt;</span></a></li>\n\n');
	document.write(fotoNavNumbers())
	document.write('\n<!-- "next" --><li id="next"><a href="javascript:showNextFoto()"><span>&gt;</span></a></li>\n\n');
	document.write('</ul>\n');
}

// ------------------------------------------------------------------------------------------------------------
//	writeBannerText
// ------------------------------------------------------------------------------------------------------------
function writeBannerText()
{
	if (!document.siteDetails)
	{
		document.siteDetails = new SiteDetails()
	}
	
	document.write('<span>' + document.siteDetails.banner + '</span>')
}

// ------------------------------------------------------------------------------------------------------------
//	writeContactInfo
// ------------------------------------------------------------------------------------------------------------
function writeContactInfo()
{
	if (!document.siteDetails)
	{
		document.siteDetails = new SiteDetails()
	}
	
	document.write('<span>' + document.siteDetails.contact + '</span>')
}

// ------------------------------------------------------------------------------------------------------------
//	writeCopyrightInfo
// ------------------------------------------------------------------------------------------------------------
function writeCopyrightInfo()
{
	if (!document.siteDetails)
	{
		document.siteDetails = new SiteDetails()
	}

	document.write('<span>' + document.siteDetails.copyright + '</span>')
}

// ------------------------------------------------------------------------------------------------------------
//	writePageTitle
// ------------------------------------------------------------------------------------------------------------
function writePageTitle()
{
	if (!document.siteDetails)
	{
		document.siteDetails = new SiteDetails()
	}

	document.write(document.siteDetails.pageTitle)
}

