// Initialise page
function initialise(boolRssDisplay, boolMailerDisplay, strFolder, strFile) {
	buildMenus();
	metaDataCentre(boolRssDisplay, boolMailerDisplay, strFolder, strFile);
	currentMenu(strFolder, strFile);
	copyright();
}


// Initialise home page
function initialiseHomePage() {
	buildMenus();
	copyright();
	quotes();
	mailerLink();
}


// Initialise error page
function initialiseErrorPage() {
	buildMenus();
	copyright();
}


// Build menus
function buildMenus() {
	var strHTML;

	// Menu 'greatest_walks'
	strHTML  = '<li><a title="My favourite long-distance walking tales, arranged in their very own Top Ten lists" id="greatest_walks_index" href="../greatest_walks/index.html">Greatest Walks</a></li>\n';
	addSubmenu('greatest_walks', strHTML);

	// Menu 'walking_tips'
	strHTML  = '<li><a title="An index of all my walking tips" id="walking_tips_index" href="../walking_tips/index.html">Walking Tips</a></li>\n';
	strHTML += '<li class="menuItemHeader">Tips for Every Walk</li>\n';
	strHTML += '<li><a title="Tips on planning a walk" id="walking_tips_planning_a_walk" href="../walking_tips/planning_a_walk.html">Planning a Walk</a></li>\n';
	strHTML += '<li><a title="A list of what to take on a typical long-distance walk" id="walking_tips_what_to_take" href="../walking_tips/what_to_take.html">What to Take</a></li>\n';
	strHTML += '<li><a title="Information on the cost of walking" id="walking_tips_costs" href="../walking_tips/costs.html">Costs</a></li>\n';
	addSubmenu('walking_tips', strHTML);

	// Menu 'photo_library'
	strHTML  = '<li><a title="A searchable index of all the photographs on my website" id="photo_library_index" href="../photo_library/index.php">Photo Library</a></li>\n';
	strHTML += '<li><a title="A range of free images that you can use as desktop wallpaper" id="photo_library_desktop_wallpaper" href="../photo_library/desktop_wallpaper.html">Desktop Wallpaper</a></li>\n';
	strHTML += '<li><a title="How you can use my images as your Windows or Mac OS screen saver" id="photo_library_screen_saver" href="../photo_library/screen_saver.html">Screen Saver</a></li>\n';
	addSubmenu('photo_library', strHTML);

	// Menu 'ebooks'
	strHTML  = '<li><a title="An index of all the free eBooks you can download" id="ebooks_index" href="../ebooks/index.html">Free eBooks</a></li>\n';
	addSubmenu('ebooks', strHTML);

	// Menu 'annapurna_circuit'
	strHTML  = '<li><a title="An introduction to the Annapurna Circuit" id="annapurna_circuit_index" href="../annapurna_circuit/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Annapurna Circuit" id="annapurna_circuit_route" href="../annapurna_circuit/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Annapurna Circuit, Preamble" id="annapurna_circuit_preamble" href="../annapurna_circuit/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Annapurna Circuit, Days 1-13" id="annapurna_circuit_day01-13" href="../annapurna_circuit/day01-13.html">1-13: Thorung Phedi</a></li>\n';
	strHTML += '<li><a title="Annapurna Circuit, Days 14-21" id="annapurna_circuit_day14-21" href="../annapurna_circuit/day14-21.html">14-21: Jomsom Trek</a></li>\n';
	strHTML += '<li class="menuItemHeader">Further Information</li>\n';
	strHTML += '<li><a title="The Annapurna Circuit and Acute Mountain Sickness" id="annapurna_circuit_acute_mountain_sickness" href="../annapurna_circuit/acute_mountain_sickness.html">Acute Mountain Sickness</a></li>\n';
	strHTML += '<li><a title="Statistics on the Annapurna Circuit" id="annapurna_circuit_statistics" href="../annapurna_circuit/annapurna_statistics.html">Annapurna Statistics</a></li>\n';
	addSubmenu('annapurna_circuit', strHTML);

	// Menu 'bada_valley'
	strHTML  = '<li><a title="An introduction to the Bada Valley" id="bada_valley_index" href="../bada_valley/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Bada Valley" id="bada_valley_route" href="../bada_valley/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Bada Valley, Preamble" id="bada_valley_preamble" href="../bada_valley/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Bada Valley, Day 1" id="bada_valley_day01" href="../bada_valley/day01.html">1: The Megaliths of Bada</a></li>\n';
	strHTML += '<li><a title="Bada Valley, Day 2" id="bada_valley_day02" href="../bada_valley/day02.html">2: Sungai Lariang</a></li>\n';
	strHTML += '<li><a title="Bada Valley, Day 3" id="bada_valley_day03" href="../bada_valley/day03.html">3: Gimpu</a></li>\n';
	addSubmenu('bada_valley', strHTML);

	// Menu 'capital_ring'
	strHTML  = '<li><a title="An introduction to the Capital Ring" id="capital_ring_index" href="../capital_ring/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Capital Ring" id="capital_ring_route" href="../capital_ring/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 1" id="capital_ring_day01" href="../capital_ring/day01.html">1: Woolwich to Falconwood</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 2" id="capital_ring_day02" href="../capital_ring/day02.html">2: Falconwood to Grove Park</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 3" id="capital_ring_day03" href="../capital_ring/day03.html">3: Grove Park to Crystal Palace</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 4" id="capital_ring_day04" href="../capital_ring/day04.html">4: Crystal Palace to Streatham</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 5" id="capital_ring_day05" href="../capital_ring/day05.html">5: Streatham to Wimbledon Park</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 6" id="capital_ring_day06" href="../capital_ring/day06.html">6: Wimbledon Park to Richmond</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 7" id="capital_ring_day07" href="../capital_ring/day07.html">7: Richmond to Osterley Lock</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 8" id="capital_ring_day08" href="../capital_ring/day08.html">8: Osterley Lock to Greenford</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 9" id="capital_ring_day09" href="../capital_ring/day09.html">9: Greenford to South Kenton</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 10" id="capital_ring_day10" href="../capital_ring/day10.html">10: South Kenton to Hendon Park</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 11" id="capital_ring_day11" href="../capital_ring/day11.html">11: Hendon Park to Highgate</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 12" id="capital_ring_day12" href="../capital_ring/day12.html">12: Highgate to Stoke Newington</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 13" id="capital_ring_day13" href="../capital_ring/day13.html">13: S. New\'ton to Hackney Wick</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 14" id="capital_ring_day14" href="../capital_ring/day14.html">14: Hackney Wick to Beckton Pk</a></li>\n';
	strHTML += '<li><a title="The Capital Ring, Day 15" id="capital_ring_day15" href="../capital_ring/day15.html">15: Beckton Park to Woolwich</a></li>\n';
	addSubmenu('capital_ring', strHTML);

	// Menu 'fraser_island'
	strHTML  = '<li><a title="An Introduction to Fraser Island" id="fraser_island_index" href="../fraser_island/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for Fraser Island" id="fraser_island_route" href="../fraser_island/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Fraser Island, Preamble" id="fraser_island_preamble" href="../fraser_island/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 1" id="fraser_island_day01" href="../fraser_island/day01.html">1: Central Station</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 2" id="fraser_island_day02" href="../fraser_island/day02.html">2: Lake Benaroon</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 3" id="fraser_island_day03" href="../fraser_island/day03.html">3: Perched Lakes</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 4" id="fraser_island_day04" href="../fraser_island/day04.html">4: Beer on the Beach</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 5" id="fraser_island_day05" href="../fraser_island/day05.html">5: Waves, Wrecks and Dunes</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 6" id="fraser_island_day06" href="../fraser_island/day06.html">6: Back Down the Beach</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 7" id="fraser_island_day07" href="../fraser_island/day07.html">7: Inland Lakes and Diana</a></li>\n';
	strHTML += '<li><a title="Fraser Island, Day 8" id="fraser_island_day08" href="../fraser_island/day08.html">8: Back to Hervey Bay</a></li>\n';
	addSubmenu('fraser_island', strHTML);

	// Menu 'gunung_rinjani'
	strHTML  = '<li><a title="An introduction to Gunung Rinjani" id="gunung_rinjani_index" href="../gunung_rinjani/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for Gunung Rinjani" id="gunung_rinjani_route" href="../gunung_rinjani/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Gunung Rinjani, Preamble" id="gunung_rinjani_preamble" href="../gunung_rinjani/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Gunung Rinjani, Day 1" id="gunung_rinjani_day01" href="../gunung_rinjani/day01.html">1: The Crater Rim</a></li>\n';
	strHTML += '<li><a title="Gunung Rinjani, Day 2" id="gunung_rinjani_day02" href="../gunung_rinjani/day02.html">2: Across the Crater</a></li>\n';
	strHTML += '<li><a title="Gunung Rinjani, Day 3" id="gunung_rinjani_day03" href="../gunung_rinjani/day03.html">3: Vicious Monkeys</a></li>\n';
	strHTML += '<li><a title="Gunung Rinjani, Day 4" id="gunung_rinjani_day04" href="../gunung_rinjani/day04.html">4: Back to Senaru</a></li>\n';
	addSubmenu('gunung_rinjani', strHTML);

	// Menu 'hinchinbrook_island'
	strHTML  = '<li><a title="An introduction to Hinchinbrook Island" id="hinchinbrook_island_index" href="../hinchinbrook_island/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for Hinchinbrook Island" id="hinchinbrook_island_route" href="../hinchinbrook_island/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Hinchinbrook Island, Preamble" id="hinchinbrook_island_preamble" href="../hinchinbrook_island/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Hinchinbrook Island, Days 1-4" id="hinchinbrook_island_day01-04" href="../hinchinbrook_island/day01-04.html">1-4: Rats and Rainforest</a></li>\n';
	addSubmenu('hinchinbrook_island', strHTML);

	// Menu 'hollyford-pyke_route'
	strHTML  = '<li><a title="An introduction to the Hollyford-Pyke Route" id="hollyford-pyke_route_index" href="../hollyford-pyke_route/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Hollyford-Pyke Route" id="hollyford-pyke_route_route" href="../hollyford-pyke_route/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Preamble" id="hollyford-pyke_route_preamble" href="../hollyford-pyke_route/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 1" id="hollyford-pyke_route_day01" href="../hollyford-pyke_route/day01.html">1: Lake Alabaster</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 2" id="hollyford-pyke_route_day02" href="../hollyford-pyke_route/day02.html">2: Demon Trail</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 3" id="hollyford-pyke_route_day03" href="../hollyford-pyke_route/day03.html">3: Hokuri Hut</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 4" id="hollyford-pyke_route_day04" href="../hollyford-pyke_route/day04.html">4: Big Bay</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 5" id="hollyford-pyke_route_day05" href="../hollyford-pyke_route/day05.html">5: Into the Wilderness</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 6" id="hollyford-pyke_route_day06" href="../hollyford-pyke_route/day06.html">6: Taking a Break</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 7" id="hollyford-pyke_route_day07" href="../hollyford-pyke_route/day07.html">7: Black Swamp</a></li>\n';
	strHTML += '<li><a title="Hollyford-Pyke Route, Day 8" id="hollyford-pyke_route_day08" href="../hollyford-pyke_route/day08.html">8: Gunn\'s Camp</a></li>\n';
	strHTML += '<li class="menuItemHeader">Further Information</li>\n';
	strHTML += '<li><a title="Bush bastards on the Hollyford-Pyke Route" id="hollyford-pyke_route_bush_bastards" href="../hollyford-pyke_route/bush_bastards.html">Bush Bastards</a></li>\n';
	addSubmenu('hollyford-pyke_route', strHTML);

	// Menu 'kepler_track'
	strHTML  = '<li><a title="An introduction to the Kepler Track" id="kepler_track_index" href="../kepler_track/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Kepler Track" id="kepler_track_route" href="../kepler_track/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Kepler Track, Preamble" id="kepler_track_preamble" href="../kepler_track/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Kepler Track, Day 1" id="kepler_track_day01" href="../kepler_track/day01.html">1: Mt Luxmore</a></li>\n';
	strHTML += '<li><a title="Kepler Track, Day 2" id="kepler_track_day02" href="../kepler_track/day02.html">2: Iris Burn</a></li>\n';
	strHTML += '<li><a title="Kepler Track, Days 3-4" id="kepler_track_day03-04" href="../kepler_track/day03-04.html">3-4: Lake Manapouri</a></li>\n';
	addSubmenu('kepler_track', strHTML);

	// Menu 'lands_end-john_ogroats'
	strHTML  = '<li><a title="An introduction to Land\'s End to John o\'Groats" id="lands_end-john_ogroats_index" href="http://www.landsendjohnogroats.info/">A Complete Guide to <acronym title="Land\'s End to John o\'Groats">LEJOG</acronym></a></li>\n';
	addSubmenu('lands_end-john_ogroats', strHTML);

	// Menu 'london_loop'
	strHTML  = '<li><a title="An introduction to the London Loop" id="london_loop_index" href="../london_loop/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the London Loop" id="london_loop_route" href="../london_loop/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="The London Loop, Day 1" id="london_loop_day01" href="../london_loop/day01.html">1: Erith to Old Bexley</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 2" id="london_loop_day02" href="../london_loop/day02.html">2: Old Bexley to Jubilee Park</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 3" id="london_loop_day03" href="../london_loop/day03.html">3: Jubilee Park to West Wickham</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 4" id="london_loop_day04" href="../london_loop/day04.html">4: W. Wickham to Hamsey Green</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 5" id="london_loop_day05" href="../london_loop/day05.html">5: Hamsey Green to Banstead</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 6" id="london_loop_day06" href="../london_loop/day06.html">6: Banstead to Kingston</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 7" id="london_loop_day07" href="../london_loop/day07.html">7: Kingston to Donkey Wood</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 8" id="london_loop_day08" href="../london_loop/day08.html">8: Donkey Wood to Uxbridge</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 9" id="london_loop_day09" href="../london_loop/day09.html">9: Uxbridge to Moor Park</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 10" id="london_loop_day10" href="../london_loop/day10.html">10: Moor Park to Elstree</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 11" id="london_loop_day11" href="../london_loop/day11.html">11: Elstree to Cockfosters</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 12" id="london_loop_day12" href="../london_loop/day12.html">12: Cockfosters to Enfield Lock</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 13" id="london_loop_day13" href="../london_loop/day13.html">13: Enfield Lock to Chigwell</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 14" id="london_loop_day14" href="../london_loop/day14.html">14: Chigwell to Harold Wood</a></li>\n';
	strHTML += '<li><a title="The London Loop, Day 15" id="london_loop_day15" href="../london_loop/day15.html">15: Harold Wood to Coldharbour</a></li>\n';
	addSubmenu('london_loop', strHTML);

	// Menu 'mt_cook'
	strHTML  = '<li><a title="An introduction to Mt Cook" id="mt_cook_index" href="../mt_cook/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for Mt Cook" id="mt_cook_route" href="../mt_cook/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Mt Cook, Preamble" id="mt_cook_preamble" href="../mt_cook/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Mt Cook, Day 1" id="mt_cook_day01" href="../mt_cook/day01.html">1: Hooker Glacier</a></li>\n';
	strHTML += '<li><a title="Mt Cook, Day 2" id="mt_cook_day02" href="../mt_cook/day02.html">2: Mueller Hut</a></li>\n';
	strHTML += '<li><a title="Mt Cook, Day 3" id="mt_cook_day03" href="../mt_cook/day03.html">3: Sliding Down a Mountain</a></li>\n';
	strHTML += '<li><a title="Mt Cook, Day 4" id="mt_cook_day04" href="../mt_cook/day04.html">4: Ball Shelter</a></li>\n';
	strHTML += '<li><a title="Mt Cook, Day 5" id="mt_cook_day05" href="../mt_cook/day05.html">5: Back to Camp</a></li>\n';
	addSubmenu('mt_cook', strHTML);

	// Menu 'pilbara_bushwalk'
	strHTML  = '<li><a title="An introduction to my Pilbara Bushwalk" id="pilbara_bushwalk_index" href="../pilbara_bushwalk/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for my Pilbara Bushwalk" id="pilbara_bushwalk_route" href="../pilbara_bushwalk/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Preamble" id="pilbara_bushwalk_preamble" href="../pilbara_bushwalk/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 1" id="pilbara_bushwalk_day01" href="../pilbara_bushwalk/day01.html">1: Narrina Creek</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 2" id="pilbara_bushwalk_day02" href="../pilbara_bushwalk/day02.html">2: Sputtering Fire</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 3" id="pilbara_bushwalk_day03" href="../pilbara_bushwalk/day03.html">3: George River</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 4" id="pilbara_bushwalk_day04" href="../pilbara_bushwalk/day04.html">4: Rest by a River</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 5" id="pilbara_bushwalk_day05" href="../pilbara_bushwalk/day05.html">5: Spinifex Scratches</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 6" id="pilbara_bushwalk_day06" href="../pilbara_bushwalk/day06.html">6: Climbing Down Waterfalls</a></li>\n';
	strHTML += '<li><a title="Pilbara Bushwalk, Day 7" id="pilbara_bushwalk_day07" href="../pilbara_bushwalk/day07.html">7: Whim Creek</a></li>\n';
	addSubmenu('pilbara_bushwalk', strHTML);

	// Menu 'routeburn-greenstone_track'
	strHTML  = '<li><a title="An introduction to the Routeburn-Greenstone Track" id="routeburn-greenstone_track_index" href="../routeburn-greenstone_track/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Routeburn-Greenstone Track" id="routeburn-greenstone_track_route" href="../routeburn-greenstone_track/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Routeburn-Greenstone Track, Preamble" id="routeburn-greenstone_track_preamble" href="../routeburn-greenstone_track/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Routeburn-Greenstone Track, Days 1-3" id="routeburn-greenstone_track_day01-03" href="../routeburn-greenstone_track/day01-03.html">1-3: Routeburn Track</a></li>\n';
	strHTML += '<li><a title="Routeburn-Greenstone Track, Days 3-4" id="routeburn-greenstone_track_day03-04" href="../routeburn-greenstone_track/day03-04.html">3-4: Greenstone Track</a></li>\n';
	addSubmenu('routeburn-greenstone_track', strHTML);

	// Menu 'taman_negara'
	strHTML  = '<li><a title="An introduction to Taman Negara" id="taman_negara_index" href="../taman_negara/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for Taman Negara" id="taman_negara_route" href="../taman_negara/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Taman Negara, Preamble" id="taman_negara_preamble" href="../taman_negara/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Taman Negara, Day 1" id="taman_negara_day01" href="../taman_negara/day01.html">1: Into the Jungle</a></li>\n';
	strHTML += '<li><a title="Taman Negara, Day 2" id="taman_negara_day02" href="../taman_negara/day02.html">2: Meeting the Orang Asli</a></li>\n';
	strHTML += '<li><a title="Taman Negara, Days 3-4" id="taman_negara_day03-04" href="../taman_negara/day03-04.html">3-4: The Fishing Lodge</a></li>\n';
	strHTML += '<li><a title="Taman Negara, Day 5" id="taman_negara_day05" href="../taman_negara/day05.html">5: Undone by Flies</a></li>\n';
	strHTML += '<li><a title="Taman Negara, Day 6" id="taman_negara_day06" href="../taman_negara/day06.html">6: Cash Crisis</a></li>\n';
	strHTML += '<li class="menuItemHeader">Further Information</li>\n';
	strHTML += '<li><a title="Interesting statistics on the rainforests of Taman Negara" id="taman_negara_rainforest_statistics" href="../taman_negara/rainforest_statistics.html">Rainforest Statistics</a></li>\n';
	strHTML += '<li><a title="What it\'s like to walk the rainforests of Taman Negara" id="taman_negara_walking_the_rainforest" href="../taman_negara/walking_the_rainforest.html">Walking the Rainforest</a></li>\n';
	addSubmenu('taman_negara', strHTML);

	// Menu 'taranaki_circuit'
	strHTML  = '<li><a title="An introduction to the Taranaki Around the Mountain Circuit" id="taranaki_circuit_index" href="../taranaki_circuit/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Taranaki Around the Mountain Circuit" id="taranaki_circuit_route" href="../taranaki_circuit/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Taranaki Around the Mountain Circuit, Preamble" id="taranaki_circuit_preamble" href="../taranaki_circuit/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Taranaki Around the Mountain Circuit, Day 1" id="taranaki_circuit_day01" href="../taranaki_circuit/day01.html">1: Rain, Rain, Go Away</a></li>\n';
	strHTML += '<li><a title="Taranaki Around the Mountain Circuit, Days 2-3" id="taranaki_circuit_day02-03" href="../taranaki_circuit/day02-03.html">2-3: Waiaua Gorge</a></li>\n';
	strHTML += '<li><a title="Taranaki Around the Mountain Circuit, Day 4" id="taranaki_circuit_day04" href="../taranaki_circuit/day04.html">4: The Volcano\'s Summit</a></li>\n';
	addSubmenu('taranaki_circuit', strHTML);

	// Menu 'tongariro_northern_circuit'
	strHTML  = '<li><a title="An introduction to the Tongariro Northern Circuit" id="tongariro_northern_circuit_index" href="../tongariro_northern_circuit/index.html">Introduction</a></li>\n';
	strHTML += '<li><a title="Route details for the Tongariro Northern Circuit" id="tongariro_northern_circuit_route" href="../tongariro_northern_circuit/route.html">Route</a></li>\n';
	strHTML += '<li class="menuItemHeader">The Walk</li>\n';
	strHTML += '<li><a title="Tongariro Northern Circuit, Preamble" id="tongariro_northern_circuit_preamble" href="../tongariro_northern_circuit/preamble.html">Preamble</a></li>\n';
	strHTML += '<li><a title="Tongariro Northern Circuit, Day 1" id="tongariro_northern_circuit_day01" href="../tongariro_northern_circuit/day01.html">1: Foul Sulphurous Fumes</a></li>\n';
	strHTML += '<li><a title="Tongariro Northern Circuit, Day 2" id="tongariro_northern_circuit_day02" href="../tongariro_northern_circuit/day02.html">2: The Shadow of Ruapehu</a></li>\n';
	strHTML += '<li><a title="Tongariro Northern Circuit, Day 3" id="tongariro_northern_circuit_day03" href="../tongariro_northern_circuit/day03.html">3: Whakapapa</a></li>\n';
	addSubmenu('tongariro_northern_circuit', strHTML);

	// Menu 'about_me'
	strHTML  = '<li><a title="Some general information about me" id="about_me_index" href="../about_me/index.html">About Me</a></li>\n';
	strHTML += '<li><a title="Details of my various walks" id="about_me_my_walks" href="../about_me/my_walks.html">My Walks</a></li>\n';
	strHTML += '<li><a title="A not terribly serious look at why I walk" id="about_me_why_i_walk" href="../about_me/why_i_walk.html">Why I Walk</a></li>\n';
	addSubmenu('about_me', strHTML);

	// Menu 'about_site'
	strHTML  = '<li><a title="Who did what on this site, and with which pieces of software" id="about_site_site_credits" href="../about_site/site_credits.html">Site Credits</a></li>\n';
	strHTML += '<li><a title="For those who want to use my content on their own websites" id="about_site_using_my_content" href="../about_site/using_my_content.html">Using My Content on Your Site</a></li>\n';
	strHTML += '<li><a title="Some helpful tips on using this site" id="about_site_using_this_site" href="../about_site/using_this_site.html">Using this Site</a></li>\n';
	strHTML += '<li><a title="An accessibility statement for this site" id="about_site_accessibility" href="../about_site/accessibility.html">Accessibility Statement</a></li>\n';
	addSubmenu('about_site', strHTML);

	// Menu 'guestbook'
	strHTML  = '<li><a title="Feel free to view my Guestbook" id="guestbook_index" href="../guestbook/viewforum.php?f=1" accesskey="9">View My Guestbook</a></li>\n';
	strHTML += '<li><a title="If you\'d like to sign my Guestbook, I\'d be delighted!" id="guestbook_sign" href="../guestbook/posting.php?mode=newtopic&f=1">Sign My Guestbook</a></li>\n';
	strHTML += '<li><a title="You can send me a private message, if you would prefer" id="guestbook_private" href="../guestbook/posting.php?mode=newtopic&f=2">Send Me a Private Message</a></li>\n';
	strHTML += '<li><a title="Some nice (and nasty) comments taken from my Guestbook" id="guestbook_site_testimonials" href="../guestbook/site_testimonials.html">Site Testimonials</a></li>\n';
	addSubmenu('guestbook', strHTML);

	// Menu 'search'
	strHTML  = '<li><a title="An advanced search engine, so you can find exactly what you\'re after" id="search_index" href="../cgi-bin/search.cgi">Search</a></li>\n';
	strHTML += '<li><a title="An index of every single page on this site" id="search_site_map" href="../search/site_map.html">Site Map</a></li>\n';
	strHTML += '<li><a title="A chronological index of my travel writing" id="search_tales_chronological_order" href="../search/tales_chronological_order.html">Tales in Chronological Order</a></li>\n';
	addSubmenu('search', strHTML);

	// Insert placeholder text
	hideField('searchTerms', 'Enter terms');
	$('#searchTerms').focus(function() { showField('searchTerms', 'Enter terms'); });
	$('#searchTerms').blur(function() { hideField('searchTerms', 'Enter terms'); });

	hideField('searchTerms2', 'Enter terms');
	$('#searchTerms2').focus(function() { showField('searchTerms2', 'Enter terms'); });
	$('#searchTerms2').blur(function() { hideField('searchTerms2', 'Enter terms'); });

	hideField('captionSearch', 'Enter terms');
	$('#captionSearch').focus(function() { showField('captionSearch', 'Enter terms'); });
	$('#captionSearch').blur(function() { hideField('captionSearch', 'Enter terms'); });

	// Prevent empty searches
	$('#mainSearch').submit(function() {
		  return (($('#searchTerms').val().length > 0) && ($('#searchTerms').val() != 'Enter terms'));
	});

	// Move access keys to correct menu items
	$('#about_site > a').removeAttr('accesskey');
	$('#guestbook > a').removeAttr('accesskey');
}


// Add a submenu to the left-hand navigation
function addSubmenu(strMenuId, strHTML) {
	// Create submenu
	$('#' + strMenuId).append('<ul id="submenu_' + strMenuId + '">' + strHTML + '</ul>');

	// Hide submenu in a way that doesn't break in Safari
	$('#submenu_' + strMenuId).css('display','none')

	// Add arrow to menu item
	$('#' + strMenuId).css('background', "url('../images/common/down_arrow.gif') 183px top no-repeat");

	// Add open/close event
	$('#' + strMenuId + ' > a').toggle(openMenu, closeMenu);
}


// Open a submenu
function openMenu(objEvent) {
	var strId = $(this).parent().attr('id');

	// Open menu
	$('#submenu_' + strId).slideDown('slow');

	// Change arrow
	$('#' + strId).css('background-image', "url('../images/common/up_arrow.gif')");

	// Stop default action
	return false;
}


// Close a submenu
function closeMenu(objEvent) {
	var strId = $(this).parent().attr('id');

	// Close menu
	$('#submenu_' + strId).slideUp('slow');

	// Change arrow
	$('#' + strId).css('background-image', "url('../images/common/down_arrow.gif')");

	// Stop default action
	return false;
}


// Open the current menu
function currentMenu(strMenuId, strMenuItem) {
	// Open current submenu
	$('#submenu_' + strMenuId).show();

	// Add open/close event, but other way round
	$('#' + strMenuId + ' > a').unbind('click');
	$('#' + strMenuId + ' > a').toggle(closeMenu, openMenu);

	// Change arrow
	$('#' + strMenuId).css('background-image', "url('../images/common/up_arrow.gif')");

	// Highlight current page and remove link
	strLinkText = $('#' + strMenuId + '_' + strMenuItem).text();
	$('#' + strMenuId + '_' + strMenuItem).parent().text(strLinkText).css('color', '#f00');
}


// Display emailer and/or RSS links
function metaDataCentre(boolRssDisplay, boolMailerDisplay, strFolder, strFile) {
	if (boolRssDisplay || boolMailerDisplay) $('#authorInfo').after('<ul>' + mailerHTML(boolMailerDisplay, strFolder, strFile) + rssHTML(boolRssDisplay) + '</ul>');
}


// Generate HTML for the emailer link
function mailerHTML(boolDisplay, strFolder, strFile) {
	var strHTML = '';
	if (boolDisplay) {
		var title = document.title
		if (title.indexOf(' - A Picture') > 0) title = title.substr(title.indexOf(' - A Picture') + 3);
		var hyphen = title.indexOf(' - ');
		if (hyphen) { title = title.substr(0, hyphen); }
		strHTML  = '<li><a title="Email this page to a friend" href="';
		strHTML += '../cgi-bin/mailer.cgi?url=' + location.pathname + escape_plus(location.search) + '&amp;title=' + escape(title) + '&amp;folder=' + strFolder + '&amp;file=' + strFile;
		strHTML += '">Email to a Friend</a></li>';
	}
	return strHTML;
}


// Generate HTML for the RSS link
function rssHTML(boolDisplay) {
	var strHTML = '';
	if (boolDisplay) strHTML = '<li><a href="http://feeds.moxon.net/traveldigest" rel="alternate" type="application/rss+xml">Subscribe via <abbr title="Really Simple Syndication">RSS</abbr> <img class="rss" src="../images/common/feed-icon9x9.png" width="9" height="9" alt="RSS logo" /></a></li>';
	return strHTML;
}


// Insert year for copyright
function copyright() {
	var strHTML, d = new Date();
	strHTML  = '1995-';
	strHTML += d.getFullYear();
	$('#copyrightYear').html(strHTML);
}


// Display input field and clear placeholder text
function showField(strFieldId, strPlaceholderText) {
	// If field exists
	if ($('#' + strFieldId).length) {
		// Display field fully
		$('#' + strFieldId).css('color', '#000');

		// Remove placeholder text if present
		if ($('#' + strFieldId).val().replace(/(\r\n|\r|\n)/g, '\n') == strPlaceholderText.replace(/(\r\n|\r|\n)/g, '\n')) $('#' + strFieldId).val('');
	}
}


// Hide input field and insert placeholder text (if empty)
function hideField(strFieldId, strPlaceholderText) {
	// If field exists
	if ($('#' + strFieldId).length) {
		if (($('#' + strFieldId).val() == '') || ($('#' + strFieldId).val().replace(/(\r\n|\r|\n)/g, '\n') == strPlaceholderText.replace(/(\r\n|\r|\n)/g, '\n'))) {
			// Grey out terms field
			$('#' + strFieldId).css('color', '#707070');

			// Insert placeholder text
			$('#' + strFieldId).val(strPlaceholderText.replace(/(\r\n|\r|\n)/g, '\n'));
		}
	}
}


// Escape string, including + signs
function escape_plus(strURL) {
	var encoded = new String;
	encoded = escape(strURL);
	var re = /\+/g;
	encoded = encoded.replace(re, '%2B');
	return encoded;
}
