var albumArray = new Array();
var albumID = 0;		var description = 1;	var numPhotos = 2;		var albumDate = 3;			// general info
var albumYear = 4;		var season = 5;																// calendar info
var thumbHeight = 6;	var thumbWidth = 7;															// thumbnail info
var firstCategory = 8;																				// category info
	var chTrips = 8;	var otherEuropeTrips = 9;	var nAmericaTrips = 10;	var friends = 11;	 var events = 12;	var sports = 13;	var biking = 14;	var hiking = 15;	var skiing = 16;	var otherActivities = 17;	
var lastCategory = 17;
var mapNumber = 18;	var locationName = 19;	var mapX = 20;	var mapY = 21;							// map info
var numAlbums = 0;																					// album counter
// fall 2009
// summer 2009
albumArray[ numAlbums++ ] = [ "italyAustriaCycling", "Cycling in Italy and Austria", 10, "August 25th - 31st, 2009", "2009","Summer", 60, 80, false, true, false, true, false, false, true, false, false, false, 1, "Rovereto", 372, 366 ];
albumArray[ numAlbums++ ] = [ "summer09", "Summer 2009", 20, "July - September, 2009", "2009","Summer", 53, 80, true, false, false, true, true, false, true, true, false, false, 2, "Col du Sanetsch", 192, 323 ];
albumArray[ numAlbums++ ] = [ "goldenHorseshoe", "Trip Around the 'Golden Horseshoe' of Lake Ontario", 16, "August 6th - 11th, 2009", "2009","Summer", 80, 60, false, false, true, true, true, false, false, false, false, false, 4, "Niagara", 118, 263 ];
albumArray[ numAlbums++ ] = [ "capeBreton09", "Visiting Cape Breton", 20, "July 15th - August 3rd, 2009", "2009","Summer", 60, 80, false, false, true, true, false, false, true, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "maratonaRadmarathon", "Mass Bicycle Rides: Maratona & Engadin Radmarathon", 20, "July 5th & 12th, 2009", "2009","Summer", 60, 80, true, true, false, true, false, false, true, false, false, false, 1, "Dolomites", 375, 350 ];
albumArray[ numAlbums++ ] = [ "EFalpineAdventure09", "EF Alpine Adventure '09", 20, "June 24 - 27th, 2009", "2009","Summer", 53, 80, true, false, false, true, false, false, true, false, false, false, 2, "Andermatt", 371, 258 ];
albumArray[ numAlbums++ ] = [ "whitesLauterbrunnen", "Chris' Parents Visit '09: Lauterbrunnen", 19, "June 13 - 15th, 2009", "2009","Summer", 60, 80, true, false, false, true, false, false, false, true, false, true, 2, "Jungfrau Region", 285, 270 ];
albumArray[ numAlbums++ ] = [ "whitesLausanne09", "Chris' Parents Visit '09: Around Lausanne", 7, "June 9 - 10th, 2009", "2009","Summer", 60, 80, true, false, false, true, false, false, true, false, false, false, 3, "Lausanne", 291, 225 ];
// spring 2009
albumArray[ numAlbums++ ] = [ "cyclotour09", "CycloTour du Leman 2009", 20, "May 31st, 2009", "2009","Spring", 53, 80, true, false, false, true, false, false, true, false, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "spring09", "Spring, 2009", 18, "April & May, 2009", "2009", "Spring", 60, 80, true, true, false, true, false, true, true, false, false, false, 3, "Aigle", 455, 375 ];
albumArray[ numAlbums++ ] = [ "mallorca1", "Spring Bike Tour in Mallorca, Spain, pt. 1", 11, "March 21st - 29th, 2009", "2009", "Spring", 60, 80, false, true, false, false, false, false, true, false, false, false, 1, "Mallorca", 230, 515 ];
albumArray[ numAlbums++ ] = [ "mallorca2", "Spring Bike Tour in Mallorca, Spain, pt. 2", 18, "March 21st - 29th, 2009", "2009", "Spring", 60, 80, false, true, false, false, false, false, true, true, false, false, 1, "Mallorca", 230, 515 ];
// winter 2009
albumArray[ numAlbums++ ] = [ "skiing09", "Skiing 2009", 20, "January - March, 2009", "2009","Winter", 53, 79, true, true, false, true, false, true, false, false, true, false, 2, "St Moritz", 535, 295 ];
albumArray[ numAlbums++ ] = [ "xmas08winter09", "Christmas 2008 and Winter 2009", 16, "December, 2008 - February, 2009", "2009", "Winter", 53, 79, true, true, false, true, false, false, true, false, false, false, 1, "Essex", 195, 208 ];
// fall 2008
albumArray[ numAlbums++ ] = [ "chicagoMissouri", "Chris' trip to Chicago & Missouri", 17, "November 13th - 22nd, 2008", "2008", "Fall", 79, 53, false, false, true, true, false, false, false, false, false, false, 4, "Chicago",-60, 300 ];
albumArray[ numAlbums++ ] = [ "monaco", "Murrays' Visit: Monaco & Aosta", 16, "November 1st - 2nd, 2009", "2008", "Fall", 53, 79, false, true, false, true, false, false, false, false, false, false, 1, "Monaco",305, 424 ];
albumArray[ numAlbums++ ] = [ "coteDazur", "Murrays' Visit: Cote d'Azur / French Riviera", 20, "October 30th - November 1st, 2008", "2008", "Fall", 36, 80, false, true, false, true, false, false, false, false, false, false, 1, "Provence", 280, 412 ];
albumArray[ numAlbums++ ] = [ "murraysFall08", "Murrays' Visit: Switzerland, Massif Central, & Rhone Valley", 15, "October 25th - 30th, 2008", "2008", "Fall", 53, 79, true, true, false, true, false, false, false, false, false, false, 1, "Puy-en-Velay", 250, 390 ];
albumArray[ numAlbums++ ] = [ "boksbergerMueller", "Patricia & Lukas' Wedding", 20, "October, 2008", "2008", "Fall", 53, 79, false, false, false, true, true, false, false, false, false, false, 2, "Langenthal", 262, 140 ];
albumArray[ numAlbums++ ] = [ "fall08", "Fall 2008", 16, "September - November, 2008", "2008", "Fall", 80, 53, true, false, false, true, false, false, true, true, false, false, 3, "Leysin", 490, 346 ];
albumArray[ numAlbums++ ] = [ "blonay", "Blonay-Chamby Railway Museum", 9, "September 14th, 2008", "2008", "Fall", 53, 80, true, false, false, false, false, false, false, false, false, false, 3, "Blonay", 426, 263 ];
// summer 2008
albumArray[ numAlbums++ ] = [ "eurobike08", "Eurobike 2008", 12, "September 7th, 2008", "2008", "Summer", 53, 80, false, false, false, false, false, false, true, false, false, false, 2, "Friedrickshafen", 478, 58 ];
albumArray[ numAlbums++ ] = [ "danielLausanneGruyere", "Daniel's Visit: Around Lausanne & Gruyere Cycling Tour", 18, "August 25th - 30th, 2008", "2008", "Summer", 60, 80, true, false, false, true, false, false, true, false, false, false, 3, "Bulle & Gruyere", 510, 170 ];
albumArray[ numAlbums++ ] = [ "danielMaggia", "Daniel's Visit: Valle Maggia", 16, "August 19th - 22nd, 2008", "2008", "Summer", 60, 80, true, false, false, true, false, false, true, true, false, false, 2, "Valle Maggia", 374, 325 ];
albumArray[ numAlbums++ ] = [ "danielLauterbrunnen", "Daniel's Visit: Lauterbrunnen", 20, "August 15th - 18th, 2008", "2008", "Summer", 53, 80, true, false, false, true, false, false, true, true, false, false, 2, "Jungfrau Region", 285, 270 ];
albumArray[ numAlbums++ ] = [ "summer08", "Summer 2008", 15, "July - September, 2008", "2008", "Summer", 80, 53, true, true, false, true, false, true, true, true, false, false, 2, "Napf", 278, 187 ];
albumArray[ numAlbums++ ] = [ "EFalpineAdventure", "Cycling Over the Mountain Passes in Central Switzerland", 19, "July 15th - 16th, 2008", "2008", "Summer", 53, 80, true, false, false, true, false, false, true, false, false, false, 2, "Andermatt", 371, 258 ];
albumArray[ numAlbums++ ] = [ "tourDeSuisse", "Tour de Suisse, Time Trial Up the Klausen Pass", 11, "June 21st, 2008", "2008", "Summer", 80, 60, true, false, false, true, false, true, true, false, false, false, 2, "Klausen Pass", 395, 212 ];
albumArray[ numAlbums++ ] = [ "provence", "Provence", 20, "May 31st - June 8th, 2008", "2008", "Summer", 53, 80, false, true, false, false, false, false, true, false, false, false, 1, "Provence", 280, 412 ];
// spring 2008
albumArray[ numAlbums++ ] = [ "ukraine2", "Heather Visits the Ukraine (Album 2 of 2)", 20, "April 30th - May 6th, 2008", "2008", "Spring", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Ukraine", 625, 256 ];
albumArray[ numAlbums++ ] = [ "ukraine", "Heather Visits the Ukraine (Album 1 of 2)", 20, "April 30th - May 6th, 2008", "2008", "Spring", 80, 53, false, true, false, true, false, false, false, false, false, false, 1, "Ukraine", 625, 256 ];
albumArray[ numAlbums++ ] = [ "luzernCERN", "Lake Luzern & CERN", 20, "March 30th & April 19th, 2008", "2008", "Spring", 80, 53, true, false, false, false, false, false, false, false, false, false, 2, "Luzern", 334, 174 ];
// winter 2008
albumArray[ numAlbums++ ] = [ "winter08", "Winter 2008", 12, "January - March, 2008", "2008", "Winter", 60, 80, true, false, false, true, false, false, false, true, true, true, 2, "Arosa", 522, 235 ];
albumArray[ numAlbums++ ] = [ "newYork", "New York City", 14, "January 2nd - 7th, 2008", "2008", "Winter", 55, 80, false, false, true, true, false, false, false, false, false, false, 4, "New York", 253, 338 ];
albumArray[ numAlbums++ ] = [ "xmas07", "Christmas in Cape Breton", 18, "December 21st, 2007 - January 1st, 2008", "2008", "Winter", 53, 80, false, false, true, false, false, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
// fall 2007
albumArray[ numAlbums++ ] = [ "paestumCapri", "Trip to Italy: Capri & Paestum", 20, "November 8th & 9th, 2007", "2007", "Fall", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Capri", 416, 493 ];
albumArray[ numAlbums++ ] = [ "napoli", "Trip to Italy: Pompeii, Sorrento, Napoli, & Cassino", 20, "November 6th, 8th, & 10th, 2007", "2007", "Fall", 60, 80, false, true, false, true, false, false, false, false, false, false, 1, "Nappoli", 415, 478 ];
albumArray[ numAlbums++ ] = [ "amalfiRoma", "Trip to Italy: Amalfi Coast & Rome", 20, "November 5th & 7th, 2007", "2007", "Fall", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Rome", 394, 460 ];
albumArray[ numAlbums++ ] = [ "autumn07", "Autumn around Lausanne", 16, "September - November, 2007", "2007", "Fall", 53, 80, true, false, false, true, false, false, true, false, false, false, 3, "Vevey", 410, 273 ];
albumArray[ numAlbums++ ] = [ "jungfraujoch", "Bernese Oberland: Jungfraujoch & Faulhorn", 13, "October 13th & 14th, 2007", "2007", "Fall", 53, 80, true, false, false, false, false, false, false, true, false, false, 2, "Jungfrau Region", 285, 270 ];
// summer 2007
albumArray[ numAlbums++ ] = [ "maggia", "Ticino: Maggia Valley", 8, "September 7th - 9th, 2007", "2007", "Summer", 53, 80, true, false, false, false, true, false, false, false, false, false, 2, "Valle Maggia", 374, 325 ];
albumArray[ numAlbums++ ] = [ "bex", "Bex Air Show", 9, "September 2nd, 2007", "2007", "Summer", 53, 80, true, false, false, false, true, false, false, false, false, false, 3, "Bex", 483, 417 ];
albumArray[ numAlbums++ ] = [ "zermattFolklore", "Zermatt Folklore Festival", 10, "August 12th, 2007", "2007", "Summer", 80, 53, true, false, false, false, false, false, false, false, false, false, 2, "Zermatt", 253, 384 ];
albumArray[ numAlbums++ ] = [ "daniel", "Daniel's Visit", 20, "August 6th - 28th, 2007", "2007", "Summer", 60, 80, true, false, false, true, false, false, true, false, false, false, 3, "Bulle & Gruyere", 510, 170 ];
albumArray[ numAlbums++ ] = [ "englandWales", "Holiday in England and Wales", 20, "July 28th - August 5th, 2007", "2007", "Summer", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Wales", 120, 185 ];
albumArray[ numAlbums++ ] = [ "jungfrau", "Jungfrau Region", 12, "June 23rd - 24th, 2007", "2007", "Summer", 53, 80, true, false, false, false, false, true, false, true, false, false, 2, "Jungfrau Region", 285, 270 ];
albumArray[ numAlbums++ ] = [ "loetschbergGornergrat", "Loetschberg Base Tunnel, Gornergrat, & Matterhorn", 11, "June 16th, 2007", "2007", "Summer", 53, 80, true, false, false, false, false, false, false, false, false, false, 2, "Zermatt", 253, 384 ];
albumArray[ numAlbums++ ] = [ "swissSteam", "Swiss Steam Park", 15, "June 3rd, 2007", "2007", "Summer", 53, 80, true, false, false, false, false, false, false, false, false, false, 3, "Le Bouveret", 408, 325 ];
// spring 2007
albumArray[ numAlbums++ ] = [ "southernFrance", "Travelling Through Southern France", 15, "May 28th - 30th, 2007", "2007", "Spring", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Provence", 280, 412 ];
albumArray[ numAlbums++ ] = [ "nolwennAdrien", "Nolwenn & Adrien's Wedding", 12, "May 26th & 27th, 2007", "2007", "Spring", 80, 53, false, true, false, true, true, false, false, false, false, false, 1, "Toulouse", 208, 423 ];
albumArray[ numAlbums++ ] = [ "ticino07", "Ticino: Castles, Miniatures, and Trains", 17, "May 12th & 13th, 2007", "2007", "Spring", 53, 80, true, false, false, true, false, false, false, false, false, false, 2, "Bellinzona", 432, 342 ];
albumArray[ numAlbums++ ] = [ "tourDeRomandie07", "Tour de Romandie 2007", 10, "May 6th, 2007", "2007", "Spring", 53, 80, false, false, false, false, false, true, false, false, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "cdv_vn_hikes", "Hiking: Creux du Van in the Jura Mountains and Vanil Noir in the Alps", 15, "April 15th & 28th, 2007", "2007", "Spring", 53, 80, true, false, false, true, false, false, false, true, false, false, 3, "Vanil Noir", 550, 220 ];
albumArray[ numAlbums++ ] = [ "april07", "Birthdays, Boats, and Bicycles", 12, "April, 2007", "2007", "Spring", 53, 80, true, false, false, true, false, false, false, false, false, false, 3, "Montreux", 437, 292 ];
albumArray[ numAlbums++ ] = [ "stephenGermany", "Visiting Stephen on a German Farm", 19, "April 6th - 9th, 2007", "2007", "Spring", 80, 53, false, true, false, true, false, false, false, false, false, false, 1, "Burgwenden", 375, 232 ];
albumArray[ numAlbums++ ] = [ "march07", "Trains, Boats, and Hikes in March", 11, "March 17th - 31st, 2007", "2007", "Spring", 52, 80, true, true, false, false, false, false, false, true, false, false, 2, "Chamonix", 136, 405 ];
// winter 2006-7
albumArray[ numAlbums++ ] = [ "camille_Damien", "Camille & Damien's Wedding", 12, "February 28th & March 3rd - 4th, 2007", "2007", "Winter", 80, 53, false, false, true, true, true, true, false, false, false, false, 4, "Soulanges", 225, 182 ];
albumArray[ numAlbums++ ] = [ "keski07", "Keskinada Loppet 2007 - Cross-Country Ski Race", 11, "February 17th - 18th, 2007", "2007", "Winter", 53, 80, false, false, true, true, false, true, false, false, true, false, 4, "Gatineau", 202, 165 ];
albumArray[ numAlbums++ ] = [ "ON_NS_NE_ON", "Trip to Ontario, Nova Scotia, and New England", 18, "February 16th - March 4th, 2007", "2007", "Winter", 53, 80, false, false, true, true, false, false, false, false, true, false, 4, "Halifax", 512, 209 ];
albumArray[ numAlbums++ ] = [ "davos_klosters", "World Cup Cross-Country Skiing in Davos", 19, "February 3rd - 4th, 2007", "2007", "Winter", 53, 80, true, false, false, false, false, true, false, false, true, false, 2, "Davos-Klosters", 550, 213 ];
albumArray[ numAlbums++ ] = [ "jan07", "Visit to a Tiny Country, Some Hiking, and Some Snow at Last", 14, "January, 2007", "2007", "Winter", 54, 80, true, true, false, true, false, false, false, true, true, false, 2, "Liechtenstein", 505, 165 ];
albumArray[ numAlbums++ ] = [ "bestOf06", "Best Of 2006", 20, "January - December, 2006", "2007", "Winter", 45, 80, false, false, false, false, false, false, false, false, false, false, 0, "", 0, 0 ];
albumArray[ numAlbums++ ] = [ "goms_zermatt", "Hiking & Skiing in the Goms Region & Train Ride to Zermatt", 18, "December 26th - 28th, 2006", "2007", "Winter", 53, 80, true, false, false, true, false, false, false, true, true, false, 2, "Goms", 326, 290 ];
albumArray[ numAlbums++ ] = [ "xmas06Fribourg", "Christmas Day in Lausanne & Trip to Fribourg", 10, "December 25th and 30th, 2006", "2007", "Winter", 60, 80, true, false, false, true, false, false, false, false, false, false, 2, "Fribourg", 173, 232 ];
albumArray[ numAlbums++ ] = [ "xmasCard", "A Christmas Card from Lausanne", 7, "December 14th, 2006", "2007", "Winter", 53, 80, true, false, false, false, false, false, false, false, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "escalade", "Geneva: Course de l'Escalade", 9, "December 2nd, 2006", "2007", "Winter", 80, 79, true, false, false, false, false, false, false, false, false, true, 3, "Geneva", 53, 446 ];
// fall 2006
albumArray[ numAlbums++ ] = [ "unil", "University of Lausanne", 8, "November, 2006", "2006", "Fall", 53, 80, true, false, false, false, false, false, false, false, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "luzern_train", "The Track Less Travelled to Langenthal", 9, "November 4th, 2006", "2006", "Fall", 53, 80, true, false, false, false, false, false, false, false, false, false, 2, "Langenthal", 262, 140 ];
albumArray[ numAlbums++ ] = [ "berlin", "Visit to Berlin", 12, "October 11th - 13th, 2006", "2006", "Fall", 53, 80, false, true, false, false, false, false, false, false, false, false, 1, "Berlin", 410, 183 ];
albumArray[ numAlbums++ ] = [ "holland", "Stopover in Holland", 7, "October 9th - 10th, 2006", "2006", "Fall", 53, 80, false, true, false, false, false, false, false, false, false, false, 1, "Holland", 264, 198 ];
albumArray[ numAlbums++ ] = [ "essex_Fall06", "Visit to Essex", 8, "October 6th - 8th, 2006", "2006", "Fall", 53, 80, false, true, false, true, false, false, false, false, false, false, 1, "Essex", 195, 208 ];
// summer 2006
albumArray[ numAlbums++ ] = [ "kempten", "Working Holiday in Kempten, Bavaria", 9, "September 11th - 18th, 2006", "2006", "Summer", 60, 80, false, true, false, false, false, false, false, false, false, false, 1, "Kempten", 360, 310 ];
albumArray[ numAlbums++ ] = [ "highland_Games", "Swiss Highland Games", 10, "August 26th - 27th, 2006", "2006", "Summer", 74, 80, false, false, false, false, false, true, false, false, false, false, 2, "Fribourg", 173, 232 ];
albumArray[ numAlbums++ ] = [ "brandon_Lori", "Brandon & Lori's Visit", 10, "August 22nd - 25th, 2006", "2006", "Summer", 60, 80, true, false, false, true, false, false, true, false, false, false, 3, "Leysin", 490, 346 ];
albumArray[ numAlbums++ ] = [ "engadine", "Bike Tour Across Southern Switzerland", 18, "July 20th - August 1st, 2006", "2006", "Summer", 53, 80, true, false, false, false, false, false, true, false, false, false, 2, "Engadine", 549, 281 ];
albumArray[ numAlbums++ ] = [ "climbing", "Climbing with the Boksbergers", 8, "July 22nd & 23rd, 2006", "2006", "Summer", 53, 80, true, false, false, true, false, false, false, false, false, true, 2, "Champex", 160, 388 ];
albumArray[ numAlbums++ ] = [ "tdf06", "Tour de France", 15, "July 20th & 21st, 2006", "2006", "Summer", 53, 80, false, true, false, false, false, true, true, false, false, false, 3, "La Tour", 200, 503 ];
albumArray[ numAlbums++ ] = [ "athletissima", "Athletissima '06 - Track & Field Event", 8, "July 11th, 2006", "2006", "Summer", 53, 80, false, false, false, false, false, true, false, false, false, false, 3, "Lausanne", 291, 235 ];
albumArray[ numAlbums++ ] = [ "paris", "Trip to Paris", 14, "July 4th - 9th, 2006", "2006", "Summer", 80, 60, false, true, false, false, false, false, false, false, false, false, 1, "Paris", 233, 286 ];
albumArray[ numAlbums++ ] = [ "c_Parents_Jun06", "Chris' Parents' Visit", 20, "June 20th - July 2nd, 2006", "2006", "Summer", 60, 80, true, false, false, true, false, false, false, true, false, false, 2, "Locarno", 398, 356 ];
albumArray[ numAlbums++ ] = [ "lausanne_Luzern", "Bike Tour from Lausanne to Luzern", 10, "June 17th & 18th, 2006", "2006", "Summer", 60, 80, true, false, false, false, false, false, true, false, false, false, 2, "Luzern", 334, 174 ];
// spring 2006
albumArray[ numAlbums++ ] = [ "cyclotour06", "Cyclotour 2006 - Circuit of Lake Geneva", 8, "June 4th, 2006", "2006", "Spring", 53, 80, true, false, false, false, false, false, true, false, false, false, 3, "Evian", 270, 313 ];
albumArray[ numAlbums++ ] = [ "h_Parents_May06", "Heather's Parents' (plus Alex & Karen's) Visit", 20, "May 23rd - June 13th, 2006", "2006", "Spring", 53, 80, true, false, false, true, false, false, false, true, false, false, 2, "Langenthal", 262, 140 ];
albumArray[ numAlbums++ ] = [ "combats_de_Reines", "Cow Fighting", 11, "May 15th, 2006", "2006", "Spring", 56, 80, true, false, false, false, false, true, false, false, false, false, 2, "Sion", 195, 345 ];
albumArray[ numAlbums++ ] = [ "col_de_Mosses", "Cycling over the Col de Mosses", 9, "May 11th, 2006", "2006", "Spring", 60, 80, true, false, false, false, false, false, true, false, false, false, 3, "Col de Mosses", 530, 308 ];
albumArray[ numAlbums++ ] = [ "le_Chasseron", "Hike Over Le Chasseron", 6, "April 30th, 2006", "2006", "Spring", 53, 80, true, false, false, true, false, false, false, true, false, false, 2, "Le Chasseron", 89, 216 ];
albumArray[ numAlbums++ ] = [ "tour_de_Romandie_06", "Tour de Romandie", 13, "April 28th & 30th, 2006", "2006", "Spring", 60, 80, false, false, false, false, false, true, true, false, false, false, 3, "Leysin", 490, 346 ];
albumArray[ numAlbums++ ] = [ "chillon", "Hike from Lausanne to the Chateau de Chillon", 9, "April 22nd, 2006", "2006", "Spring", 53, 80, true, false, false, false, false, false, false, true, false, false, 3, "Montreux", 435, 288 ];
albumArray[ numAlbums++ ] = [ "april06", "Around Lausanne: Cycling, Hiking, & Drinking", 8, "April, 2006", "2006", "Spring", 60, 80, true, false, false, true, false, false, true, true, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "grandmas_80th", "Chris' Grandma's 80th Birthday Party", 12, "April 1st, 2006", "2006", "Spring", 60, 80, false, false, false, true, true, false, false, false, false, false, 1, "Essex", 195, 208 ];
albumArray[ numAlbums++ ] = [ "spring_is_here", "Spring is Here!", 8, "March 18th - 26th, 2006", "2006", "Spring", 60, 80, true, false, false, false, false, false, true, true, false, false, 3, "Les Pleiades", 437, 251 ];
// winter 2005-6
albumArray[ numAlbums++ ] = [ "jura_parents", "Chris' Parents' Visit: Jura Mountains", 8, "March 6th & 8th, 2006", "2006", "Winter", 60, 80, true, false, false, true, false, false, false, false, true, false, 3, "Col de la Givrine", 35, 268 ];
albumArray[ numAlbums++ ] = [ "boksbergers_Mar06", "Chris' Parents' Visit: Snow at the Boksbergers", 14, "March 5th, 2006", "2006", "Winter", 60, 80, true, false, false, true, false, false, false, true, false, false, 2, "Oberboezberg", 310, 88 ];
albumArray[ numAlbums++ ] = [ "bern_Mar06", "Chris' Parents' Visit: Trip to Bern", 4, "March 4th, 2006", "2006", "Winter", 60, 80, true, false, false, false, false, false, false, false, false, false, 2, "Bern", 215, 195 ];
albumArray[ numAlbums++ ] = [ "lausanne_Mar06", "Chris' Parents' Visit: Around Lausanne", 9, "March 2nd & 3rd, 2006", "2006", "Winter", 60, 80, true, false, false, true, false, true, false, true, false, false, 3, "Lausanne", 291, 225 ];
albumArray[ numAlbums++ ] = [ "cc_skiing_curling", "Winter Olympics: Cross-Country Skiing & Curling", 17, "February 22nd, 2006", "2006", "Winter", 80, 60, false, false, false, false, false, true, false, false, true, false, 1, "Torino", 315, 373 ];
albumArray[ numAlbums++ ] = [ "biathlon_bobsled", "Winter Olympics: Biathlon, Cesana, & Bob-sled", 15, "February 21st, 2006", "2006", "Winter", 60, 80, false, true, false, false, false, true, false, false, true, false, 1, "Torino", 315, 373 ];
albumArray[ numAlbums++ ] = [ "savoie", "Winter Olympics: The Savoie Region of France and Italy", 13, "February 17th - 23rd, 2006", "2006", "Winter", 80, 60, false, true, false, false, false, false, false, false, true, false, 1, "Torino", 315, 373 ];
albumArray[ numAlbums++ ] = [ "pdS_06", "Skiing & Snowboarding, Portes du Soleil", 16, "February 4th - 5th, 2006 & March 11th, 2006", "2006", "Winter", 60, 80, true, false, false, true, false, false, false, false, true, false, 3, "Portes du Soleil", 380, 478 ];
albumArray[ numAlbums++ ] = [ "bern_Jan06", "Visit to Bern", 4, "January 21st, 2006", "2006", "Winter", 60, 80, true, false, false, false, false, false, false, false, false, false, 2, "Bern", 215, 195 ];
albumArray[ numAlbums++ ] = [ "back_to_CH", "Back to Switzerland", 8, "January 5th - 7th, 2006", "2006", "Winter", 60, 80, true, false, false, false, false, false, false, true, true, false, 3, "Col de la Givrine", 35, 268 ];
albumArray[ numAlbums++ ] = [ "glasgow", "Glasgow for New Year's", 8, "December 30th, 2005 - January 2nd, 2006", "2006", "Winter", 60, 80, false, true, false, true, true, false, false, false, false, false, 1, "Glasgow", 105, 88 ];
albumArray[ numAlbums++ ] = [ "yorkshire_Dec05", "Visiting Chris' Aunt in Yorkshire", 7, "December 27th - 30th, 2005", "2006", "Winter", 60, 80, false, true, false, true, false, false, false, false, false, false, 1, "Yorkshire", 162, 138 ];
albumArray[ numAlbums++ ] = [ "essex_Dec05", "Essex for Christmas", 5, "December 22nd - 27th, 2005", "2006", "Winter", 80, 65, false, true, false, true, true, false, false, false, false, false, 1, "Essex", 195, 208 ];
albumArray[ numAlbums++ ] = [ "cully", "Hike Along the Lake to Cully", 8, "December 18th, 2005", "2006", "Winter", 60, 80, true, false, false, false, false, false, false, true, false, false, 3, "Cully", 340, 253 ];
albumArray[ numAlbums++ ] = [ "boksbergers_Dec05", "Trip to the Boksbergers", 8, "December 9th - 11th, 2005", "2006", "Winter", 60, 80, true, false, false, true, false, false, false, false, false, false, 2, "Oberboezberg", 310, 88 ];
albumArray[ numAlbums++ ] = [ "valais_Nov05", "Train Ride to Brig and Zermatt", 10, "November 26th, 2005", "2006", "Winter", 80, 65, true, false, false, false, false, false, false, false, false, false, 2, "Zermatt", 253, 384 ];
// fall 2005
albumArray[ numAlbums++ ] = [ "fallHikes05", "Fall Hikes: Zweisimmen-Gstaad, Mt Tendre, & Aigle-Leysin", 14, "October 29th - November 20, 2005", "2005", "Fall", 60, 80, true, false, false, false, false, false, false, true, false, false, 3, "Mt Tendre", 135, 170 ];
albumArray[ numAlbums++ ] = [ "ride_Oct05", "Cycling: Lausanne - Bex, in the Rhone valley", 4, "October 16th, 2005", "2005", "Fall", 60, 80, true, false, false, false, false, false, true, false, false, false, 3, "Bex", 483, 417 ];
albumArray[ numAlbums++ ] = [ "wedding_UK", "Wedding Reception in England", 9, "October 9th, 2005", "2005", "Fall", 60, 80, false, true, false, true, true, false, false, false, false, false, 1, "Essex", 195, 208 ];
albumArray[ numAlbums++ ] = [ "st_Gallen", "Trip to St. Gallen and Hiking up Ebenalp", 9, "October 1st, 2005", "2005", "Fall", 60, 80, true, false, false, false, false, false, false, true, false, false, 2, "St Gallen", 480, 100 ];
albumArray[ numAlbums++ ] = [ "lausanne_Fall05", "Shots from Around Lausanne", 18, "September - October, 2005", "2005", "Fall", 60, 80, true, false, false, false, false, false, false, false, false, false, 3, "Lausanne", 291, 235 ];
albumArray[ numAlbums++ ] = [ "yvoire_Sep05", "Across Lake Geneva to Yvoire, France", 7, "September 24th, 2005", "2005", "Fall", 60, 80, false, true, false, false, false, false, false, false, false, false, 3, "Yvoire", 150, 343 ];
albumArray[ numAlbums++ ] = [ "parents_Sep05", "Arrival in Switzerland & Chris' Parents' Visit", 16, "September 2nd - 10th, 2005", "2005", "Fall", 60, 80, true, false, false, true, false, false, false, false, false, false, 3, "Montreux", 435, 288 ];
// summer 2005
albumArray[ numAlbums++ ] = [ "dodsJeff_wed", "Dods and Jeff's Wedding", 9, "August 19th, 2005", "2005", "Summer", 80, 60, false, false, false, true, true, false, false, false, false, false, 4, "Fergus", 92, 225 ];
albumArray[ numAlbums++ ] = [ "fergus_HG", "Fergus Highland Games", 4, "August 14th, 2005", "2005", "Summer", 80, 58, false, false, true, false, false, true, false, false, false, false, 4, "Fergus", 92, 225 ];
albumArray[ numAlbums++ ] = [ "sum05_CB", "Trip to Cape Breton", 20, "July 18th - August 2nd, 2005", "2005", "Summer", 60, 80, false, false, true, true, false, false, true, true, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "montreal", "Montreal Jazz Festival", 6, "July 1st - 4th, 2005", "2005", "Summer", 60, 80, false, false, true, true, false, false, false, false, false, false, 4, "Montreal", 256, 172 ];
albumArray[ numAlbums++ ] = [ "gatherings_Sum05", "Gatherings and People", 9, "May - August, 2005", "2005", "Summer", 60, 80, false, false, false, true, false, false, false, false, false, false, 4, "Waterloo", 83, 241 ];
albumArray[ numAlbums++ ] = [ "biking_Sum05", "Biking Around Waterloo", 7, "May - August, 2005", "2005", "Summer", 60, 80, false, false, true, false, false, false, true, false, false, false, 4, "Waterloo", 83, 241 ];
// winter/spring 2004-5
albumArray[ numAlbums++ ] = [ "grand_River", "The Grand River", 4, "January & May, 2005", "2005", "Winter", 80, 60, false, false, true, false, false, false, false, true, false, false, 4, "Waterloo", 83, 241 ];
albumArray[ numAlbums++ ] = [ "gatherings_Winter05", "Gatherings and People", 6, "December, 2004 - April, 2005", "2005", "Winter", 53, 80, false, false, false, true, false, false, false, false, false, false, 4, "Waterloo", 83, 241 ];
albumArray[ numAlbums++ ] = [ "xmas04_CB", "Christmas in Cape Breton", 4, "December 22nd, 2004 - January 2nd, 2005", "2005", "Winter", 60, 80, false, false, true, true, true, false, false, false, true, false, 4, "Cape Breton", 592, 126 ];
// fall 2004
albumArray[ numAlbums++ ] = [ "wedding_CrHo", "Wedding Cruise & Honeymoon", 14, "October 8th - 16th, 2004", "2004", "Fall", 53, 80, false, false, true, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "wedding_Dance", "Our Wedding: Dance", 19, "October 9th, 2004", "2004", "Fall", 80, 60, false, false, false, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "wedding_Dinner", "Our Wedding: Dinner", 12, "October 9th, 2004", "2004", "Fall", 80, 60, false, false, false, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "wedding_Photos", "Our Wedding: Photo Session", 15, "October 9th, 2004", "2004", "Fall", 54, 80, false, false, false, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "wedding_Ceremony", "Our Wedding: Ceremony", 20, "October 9th, 2004", "2004", "Fall", 53, 80, false, false, false, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "wedding_Pre", "Our Wedding: Preparations", 13, "October 2nd - 9th, 2004", "2004", "Fall", 80, 60, false, false, false, true, true, false, false, false, false, false, 4, "Cape Breton", 592, 126 ];
albumArray[ numAlbums++ ] = [ "gatherings_Fall04", "Gatherings and People", 19, "September - December, 2004", "2004", "Fall", 60, 80, false, false, false, true, false, false, false, false, false, false, 4, "Waterloo", 83, 241 ];
albumArray[ numAlbums++ ] = [ "waterloo_Fall04", "Shots from Around Waterloo", 5, "September - October, 2004", "2004", "Fall", 60, 80, false, false, true, false, false, false, false, false, false, false, 4, "Waterloo", 83, 241 ];
albumArray[ numAlbums++ ] = [ "niagara", "Trip to Niagara Falls & Vineyards", 8, "September 19th, 2004", "2004", "Fall", 60, 80, false, false, true, false, false, false, false, false, false, false, 4, "Niagara", 118, 263 ];

for( var albumNum=0; albumNum<numAlbums; albumNum++ )					// add number of photos to album description
	{albumArray[ albumNum ][ description ] += " (" + albumArray[ albumNum ][ numPhotos ] + " photos)";}

var NUM_RECENT_ALBUMS_TO_DISPLAY = 15;

// season info
var winter = 1;	var spring = 2;	var summer = 3;	var fall = 4;
var seasonStr = [ "", "Winter", "Spring", "Summer", "Fall" ];
var seasonArray = new Array();
var firstYear = 2004;	var lastYear = 2009;
for( var yearNum=firstYear; yearNum<=lastYear; yearNum++ )
	{seasonArray[ yearNum ] = new Array();}
var seasonThumbHeight = 0;		var seasonThumbWidth = 1;		var seasonUsed = 2;		var seasonExpanded = 3;
seasonArray[ 2004 ][ winter ] = [ 0, 0, 0, false ];
seasonArray[ 2004 ][ spring ] = [ 0, 0, 0, false ];
seasonArray[ 2004 ][ summer ] = [ 0, 0, 0, false ];
seasonArray[ 2004 ][ fall ] = [ 54, 80, 1, false ];
seasonArray[ 2005 ][ winter ] = [ 60, 80, 1, false ];
seasonArray[ 2005 ][ spring ] = [ 0, 0, 0, false ];
seasonArray[ 2005 ][ summer ] = [ 60, 80, 1, false ];
seasonArray[ 2005 ][ fall ] = [ 80, 62, 1, false ];
seasonArray[ 2006 ][ winter ] = [ 60, 80, 1, false ];
seasonArray[ 2006 ][ spring ] = [ 60, 80, 1, false ];
seasonArray[ 2006 ][ summer ] = [ 60, 80, 1, false ];
seasonArray[ 2006 ][ fall ] = [ 80, 53, 1, false ];
seasonArray[ 2007 ][ winter ] = [ 53, 80, 1, false ];
seasonArray[ 2007 ][ spring ] = [ 80, 53, 1, false ];
seasonArray[ 2007 ][ summer ] = [ 53, 80, 1, false ];
seasonArray[ 2007 ][ fall ] = [ 53, 80, 1, false ];
seasonArray[ 2008 ][ winter ] = [ 53, 80, 1, false ];
seasonArray[ 2008 ][ spring ] = [ 80, 53, 1, false ];
seasonArray[ 2008 ][ summer ] = [ 53, 80, 1, false ];
seasonArray[ 2008 ][ fall ] = [ 53, 80, 1, false ];
seasonArray[ 2009 ][ winter ] = [ 53, 79, 1, false ];
seasonArray[ 2009 ][ spring ] = [ 60, 80, 1, false ];
seasonArray[ 2009 ][ summer ] = [ 60, 80, 1, false ];
seasonArray[ 2009 ][ fall ] = [ 0, 0, 0, false ];

// category info
var categoryStr = [ "", "", "", "", "", "", "", "", "chTrips", "otherEuropeTrips", "nAmericaTrips", "friends", "events", "sports", "biking", "hiking", "skiing", "otherActivities" ];
var categoryArray = new Array();
var categoryDescription = 0;	var categoryThumbHeight = 1;	var categoryThumbWidth = 2;		var categoryExpanded = 3;
categoryArray[ chTrips ] = [ "Places: General Switzerland", 80, 69, false ];
categoryArray[ otherEuropeTrips ] = [ "Places: Other Parts of Europe", 80, 60, false ];
categoryArray[ nAmericaTrips ] = [ "Places: North America", 60, 80, false ];
categoryArray[ friends ] = [ "Friends and Family", 60, 80, false ];
categoryArray[ events ] = [ "Events: Celebrations (Weddings, Birthdays, Christmas, etc.)", 54, 80, false ];
categoryArray[ sports ] = [ "Events: Sports (Tour de France, Highland Games, etc.)", 80, 60, false ];
categoryArray[ biking ] = [ "Activities: Cycling", 60, 80, false ];
categoryArray[ hiking ] = [ "Activities: Hiking", 60, 80, false ];
categoryArray[ skiing ] = [ "Activities: Skiing", 60, 80, false ];
categoryArray[ otherActivities ] = [ "Activities: Other (Climbing, Running, etc.)", 53, 80, false ];

// map info
var europeMap = 1;		var switzerlandMap = 2;		var switzerlandSWmap = 3;		var canadaEmap = 4;
var mapStr = ["", "europeMap", "switzerlandMap", "switzerlandSWmap", "canadaEmap" ]
var mapArray = new Array();
var mapDescription = 0;		var mapThumbHeight = 1;		var mapThumbWidth = 2;	 var mapHeight = 3;		var mapWidth = 4;	
var mapExpanded = 5;		var mapOffsetY = 6;
var numMaps = 4;
mapArray[ europeMap ] = ["Europe", 73, 80, 594, 650, false, 80 ];
mapArray[ switzerlandMap ] = ["Switzerland",  56, 80, 452, 650, false, 146 ];
mapArray[ switzerlandSWmap ] = ["Lausanne & Lake Geneva Region",  64, 80, 517, 650, false, 219 ];
mapArray[ canadaEmap ] = ["Eastern Canada & NE USA", 47, 80, 379, 650, false, 277 ];
var mapOffsetX = 113;			
var multiLocation = new Array();
var multiLocationName = 0;		var multiLocationAdded = 1;
var numMultipleLocations = 0;
multiLocation[ numMultipleLocations++ ] = [ "Provence", false ];
multiLocation[ numMultipleLocations++ ] = [ "Ukraine", false ];
multiLocation[ numMultipleLocations++ ] = [ "Jungfrau Region", false ];
multiLocation[ numMultipleLocations++ ] = [ "Waterloo", false ];
multiLocation[ numMultipleLocations++ ] = [ "Cape Breton", false ];
multiLocation[ numMultipleLocations++ ] = [ "Fergus", false ];
multiLocation[ numMultipleLocations++ ] = [ "Essex", false ];
multiLocation[ numMultipleLocations++ ] = [ "Torino", false ];
multiLocation[ numMultipleLocations++ ] = [ "Langenthal", false ];
multiLocation[ numMultipleLocations++ ] = [ "Bern", false ];
multiLocation[ numMultipleLocations++ ] = [ "Oberboezberg", false ];
multiLocation[ numMultipleLocations++ ] = [ "Lausanne", false ];
multiLocation[ numMultipleLocations++ ] = [ "Leysin", false ];
multiLocation[ numMultipleLocations++ ] = [ "Montreux", false ];
multiLocation[ numMultipleLocations++ ] = [ "Col de la Givrine", false ];
multiLocation[ numMultipleLocations++ ] = [ "Fribourg", false ];
multiLocation[ numMultipleLocations++ ] = [ "Zermatt", false ];
multiLocation[ numMultipleLocations++ ] = [ "Bex", false ];
multiLocation[ numMultipleLocations++ ] = [ "Luzern", false ];
multiLocation[ numMultipleLocations++ ] = [ "Valle Maggia", false ];
multiLocation[ numMultipleLocations++ ] = [ "Bulle & Gruyere", false ];
multiLocation[ numMultipleLocations++ ] = [ "Mallorca", false ];
multiLocation[ numMultipleLocations++ ] = [ "Andermatt", false ];
multiLocation[ numMultipleLocations++ ] = [ "Niagara", false ];

var importedView = readCookie( "viewFormat" );
var currentView = "";

var randAlbum = Math.round( (numAlbums-1) * Math.random() );
var randomImgPath = albumArray[ randAlbum ][ albumYear ] + "/" + albumArray[ randAlbum ][ season ] + "/" + albumArray[ randAlbum ][ albumID ] + "/";
document.write( "<script language='javascript' src='" + randomImgPath + "data.js' type='text/javascript'></script>" );

var vehicleDiv = new Array;
var innerTable;
var table;
var mapCell;

function addAlbums() {
	var importedYear = readCookie( "year" );
	var importedShelf = readCookie( "shelf" );

	if( importedView == "byDate" ) {
		addDatedAlbums();
		clickSeasonShelf( importedYear, importedShelf );
	}
	else if( importedView == "byCategory" ) {
		addCategorizedAlbums();
		clickCategoryShelf( importedShelf );
	}
	else if( importedView == "byLocation" ) {
		addMappedAlbums();
		clickMapShelf( importedShelf );
	}
	else
		{addRecentAlbums();}
	AddRandomPhoto();
}

function addRecentAlbums() {
	if( currentView != "mostRecent" ) {											// ignore action if already using this viewing format
		setSidebar( "mostRecent" );												// clear album table and adjust sidebar highlighting
		innerTable = document.getElementById("albumTable");						// access album table
		addSpacingRow( 1, "", "" );												// add spacing row with room for one column of thumbnails

		var lastAlbum = NUM_RECENT_ALBUMS_TO_DISPLAY;
		if( numAlbums < NUM_RECENT_ALBUMS_TO_DISPLAY )
			{lastAlbum = numAlbums};
		for( var albumNum=0; albumNum<lastAlbum; albumNum++ )					// iterate through the most recent albums
			{addLine( 2, albumNum, 0 );}										// add album link
	}
}
function addDatedAlbums() {
	if( currentView != "byDate" ) {												// ignore action if already using this viewing format
		setSidebar( "byDate" );													// adjust sidebar highlighting
		table = document.getElementById("albumTable");							// access album table
		for( var yearNum=lastYear; yearNum>=firstYear; yearNum-- ) {			// iterate through all relevant years
			for( var seasonNum=fall; seasonNum>=winter; seasonNum-- ) {			// iterate through all seasons
				if( seasonArray[ yearNum ][ seasonNum ][ seasonUsed ] == 1 )	// check whether season contains any albums
					{addLine( 0, yearNum, seasonNum );}							// add shelf expand / collapse button
			}
		}
	}
}
function addCategorizedAlbums() {	
	if( currentView != "byCategory" ) {													// ignore action if already using this viewing format
		setSidebar( "byCategory" );														// adjust sidebar highlighting
		table = document.getElementById("albumTable");									// access album table
		for( var categoryNum=firstCategory; categoryNum<=lastCategory; categoryNum++ )	// iterate through all categories
			{addLine( 0, categoryNum, 0 );}												// add shelf expand / collapse button
	}
}

function clickSeasonShelf( yearNum, seasonNum ) {
	for( var yearNumTemp=firstYear; yearNumTemp<=lastYear; yearNumTemp++ ) {			// collapse any other expanded seasons
		for( var seasonNumTemp=winter; seasonNumTemp<=fall; seasonNumTemp++ ) {
			if( yearNumTemp == yearNum && seasonNumTemp == seasonNum )	{}
			else if( seasonArray[ yearNumTemp ][ seasonNumTemp ][ seasonExpanded ] == true ) 
				{collapseShelf( yearNumTemp, seasonNumTemp );}
		}
	}
	if( seasonArray[ yearNum ][ seasonNum ][ seasonExpanded ] == false ) {					// expand season if it is currently collapsed
		writeCookie( "year", yearNum );														// record which shelf is now being viewed so that PhotoPage can jump back
		writeCookie( "shelf", seasonNum );
		seasonArray[ yearNum ][ seasonNum ][ seasonExpanded ] = true;						// record that season is expanded
		innerTable = document.getElementById( seasonStr[ seasonNum ] + yearNum + "Table");	// access season shelf
		for( var albumNum=0; albumNum<numAlbums; albumNum++ ) {								// iterate through all albums
			if( albumArray[ albumNum ][ albumYear ] == yearNum && albumArray[ albumNum ][ season ] == seasonStr[ seasonNum ] )	// is album in season?
				{addLine( 1, albumNum, 0 );}												// add album link
		}
		lastRow = innerTable.lastChild;														// change branch image of final album in season to be an ending branch
		lastBranch = lastRow.firstChild;
		lastBranchImg = lastBranch.firstChild;
		lastBranchImg.src = "Graphics/tree_end.gif";
		
		window.location = "#" + seasonStr[ seasonNum ] + yearNum;							// jump to top of clicked season so that it is in view
	}
	else																					// collapse season if it is currently expanded
		{collapseShelf( yearNum, seasonNum );}
}
function clickCategoryShelf( categoryNum ) {
	for( var categoryNumTemp=firstCategory; categoryNumTemp<=lastCategory; categoryNumTemp++ ) {	// collapse any other expanded categories
		if( categoryNumTemp != categoryNum && categoryArray[ categoryNumTemp ][ categoryExpanded ] == true ) 
			{collapseShelf( categoryNumTemp, 0 );}
	}
	if( categoryArray[ categoryNum ][ categoryExpanded ] == false ) {								// expand category if it is currently collapsed
		writeCookie( "shelf", categoryNum );														// record which shelf is now being viewed so that PhotoPage can jump back
		categoryArray[ categoryNum ][ categoryExpanded ] = true;									// record that category is expanded
		innerTable = document.getElementById( categoryStr[ categoryNum ] + "Table");				// access category shelf
		for( var albumNum=0; albumNum<numAlbums; albumNum++ ) {										// iterate through all albums
			if( albumArray[ albumNum ][ categoryNum ] == true )										// check whether album belongs in this category
				{addLine( 1, albumNum, 0 );}														// add album link
		}
		lastRow = innerTable.lastChild;																// change branch image of final album in season to be an ending branch
		lastBranch = lastRow.firstChild;
		lastBranchImg = lastBranch.firstChild;
		lastBranchImg.src = "Graphics/tree_end.gif";

		window.location = "#" + categoryStr[ categoryNum ];											// jump to top of clicked category so that it is in view
	}
	else																							// collapse category if it is currently expanded
		{collapseShelf( categoryNum, 0 );}
}
function collapseShelf( shelfNum, seasonNum )	{
	if( currentView == "byDate" ) {
		seasonArray[ shelfNum ][ seasonNum ][ seasonExpanded ] = false;						// record that season is collapsed
		var innerTable = document.getElementById( seasonStr[ seasonNum ] + shelfNum + "Table");	// access season shelf
	}
	else if( currentView == "byCategory" ) {
		categoryArray[ shelfNum ][ categoryExpanded ] = false;								// record that category is collapsed
		var innerTable = document.getElementById( categoryStr[ shelfNum ] + "Table");		// access category shelf
	}
	else if( currentView == "byLocation" ) {
		for( var locationNum=0; locationNum<numMultipleLocations; locationNum++ )
			{multiLocation[ locationNum ][ multiLocationAdded ] = false;}					// reset multiple locations
		mapArray[ shelfNum ][ mapExpanded ] = false;										// record that map is collapsed
		var innerTable = document.getElementById( mapStr[ shelfNum ] + "Table");			// access map shelf
	}
	while( innerTable.childNodes[2] )														// wipe shelf contents clean; use childNodes[ 2 ] because node 0 is spacing row
		{innerTable.removeChild(innerTable.childNodes[2]);}									// and node 1 is thumbnail row, both of which we want to leave
}

function addLine( branchSolo, shelfYrAlbumNum, seasonNum ) {
	var linkDestination = "";
	var thumbnailWidth = 0;
	var thumbnailHeight = 0;
	if( branchSolo == 0 ) {																	// ADD EXPAND / COLLAPSE BUTTON FOR THIS SHELF (only if adding shelf)
		innerTable = document.createElement( "tbody" );										// create new table body for this shelf
		table.appendChild(innerTable);
		innerTable.setAttribute("className","subTable");	
		innerTable.setAttribute("class","subTable");	
			addSpacingRow( 2, shelfYrAlbumNum, seasonNum );									// ADD SPACING ROW with room for two columns of thumbnails 
		if( currentView == "byDate" ) 
			{innerTable.setAttribute("id", seasonStr[ seasonNum ] + shelfYrAlbumNum + "Table");}// either name table with season and year ...
		else if( currentView == "byCategory" )
			{innerTable.setAttribute("id", categoryStr[ shelfYrAlbumNum ] + "Table");}		// ... or name table with category
		else if( currentView == "byLocation" )
			{innerTable.setAttribute("id", mapStr[ shelfYrAlbumNum ] + "Table");}			// ... or name table with map
	}
			var row = document.createElement("tr");											// ADD ROW
			innerTable.appendChild(row);
			if( branchSolo == 1 ) {															// ADD BRANCH (only if adding album to shelf)
				var branchCell = document.createElement("td");
				row.appendChild(branchCell);
					var branchImg = document.createElement("img");
					branchCell.appendChild(branchImg);
					var branchSize = "";
					if( albumArray[ shelfYrAlbumNum ][ thumbHeight ] <= 60 )				// use either small ...
						{branchSize = "60";}					
					else																	// ... or large branch image
						{branchSize = "80";}
					branchImg.src = "Graphics/tree_mid_" + branchSize + ".gif";
					branchImg.setAttribute("width","80");
					branchImg.setAttribute("height",albumArray[ shelfYrAlbumNum ][ thumbHeight ]+8);
					branchImg.setAttribute("alt","");
			}

				var thumbnailCell = document.createElement("td");				// ADD THUMBNAIL, first do general stuff then do conditional stuff
				row.appendChild(thumbnailCell);
				//thumbnailCell.setAttribute("class","posRelative");
				var link = document.createElement("a");
					thumbnailCell.appendChild(link);
						var thumbnail = document.createElement("img");
						link.appendChild(thumbnail);
						thumbnail.setAttribute("alt","thumbnail");
						thumbnail.setAttribute("border","0");
			if( branchSolo == 0 ) {												// if adding shelf then set button action and thumbnail appropriately
				if( currentView == "byDate" ) {
					linkDestination = "javascript:clickSeasonShelf(" + shelfYrAlbumNum + "," + seasonNum + ");";
					link.href = linkDestination;
						thumbnail.setAttribute("src", shelfYrAlbumNum + "/" + seasonStr[ seasonNum ] + "/thumbnail.gif");
						thumbnailWidth = seasonArray[ shelfYrAlbumNum ][ seasonNum ][ seasonThumbWidth ];
						thumbnailHeight = seasonArray[ shelfYrAlbumNum ][ seasonNum ][ seasonThumbHeight ];
				}
				else if( currentView == "byCategory" ) {	
					linkDestination = "javascript:clickCategoryShelf(" + shelfYrAlbumNum + ");";
					link.href = linkDestination;
						thumbnail.setAttribute("src", "Graphics/category_thumbnails/" + categoryStr[ shelfYrAlbumNum ] + ".gif");
						thumbnailWidth = categoryArray[ shelfYrAlbumNum ][ categoryThumbWidth ];
						thumbnailHeight = categoryArray[ shelfYrAlbumNum ][ categoryThumbHeight ];
				}
				else if( currentView == "byLocation" ) {	
					linkDestination = "javascript:clickMapShelf(" + shelfYrAlbumNum + ");";
					link.href = linkDestination;
						thumbnail.setAttribute("src", "Graphics/Maps/" + mapStr[ shelfYrAlbumNum ] + "_thumb.gif");
						thumbnailWidth = mapArray[ shelfYrAlbumNum ][ mapThumbWidth ];
						thumbnailHeight = mapArray[ shelfYrAlbumNum ][ mapThumbHeight ];
				}
			}
			else {																// if adding album then set target location and thumbnail appropriately
					if( albumArray[ shelfYrAlbumNum ][ albumID ] != "announcement" )
						{linkDestination = "PhotoPage.html?" + albumArray[ shelfYrAlbumNum ][ albumYear ] + "&" + albumArray[ shelfYrAlbumNum ][ season ] + "&" + albumArray[ shelfYrAlbumNum ][ albumID ];}
					else
						{linkDestination = "Panorama.html";}
					link.href = linkDestination;
						if( albumArray[ shelfYrAlbumNum ][ albumID ] != "announcement" )
							{thumbnail.setAttribute("src", albumArray[ shelfYrAlbumNum ][ albumYear ] + "/" + albumArray[ shelfYrAlbumNum ][ season ] + "/" + albumArray[ shelfYrAlbumNum ][ albumID ] + "/thumbnails/thumbnail.gif");}
						else
							{thumbnail.setAttribute("src", "Graphics/panorama.gif");}

						thumbnailWidth = albumArray[ shelfYrAlbumNum ][ thumbWidth ];
						thumbnailHeight = albumArray[ shelfYrAlbumNum ][ thumbHeight ];
			}
						thumbnail.setAttribute("width",thumbnailWidth);
						thumbnail.setAttribute("height",thumbnailHeight);

				var desctiptionCell = document.createElement("td");				// ADD DESCRIPTION, first do general stuff then do conditional stuff
				row.appendChild(desctiptionCell);
					var link = document.createElement("a");
					desctiptionCell.appendChild(link);
					link.href = linkDestination;
		if( branchSolo == 0 ) {													// if adding shelf then set button action and description appropriately
				desctiptionCell.setAttribute("colSpan","3");
			if( currentView == "byDate" ) {
				if( seasonNum == winter )
					{link.appendChild(document.createTextNode(seasonStr[ seasonNum ] + " " + (shelfYrAlbumNum-1) + "-" + (shelfYrAlbumNum%2000)));}
				else
					{link.appendChild(document.createTextNode(seasonStr[ seasonNum ] + " " + shelfYrAlbumNum));}
					link.setAttribute("className","branch");
					link.setAttribute("class","branch");
				}
			else if( currentView == "byCategory" ) {
					link.appendChild(document.createTextNode(categoryArray[ shelfYrAlbumNum ][ categoryDescription ]));
					link.setAttribute("className","branch");
					link.setAttribute("class","branch");
			}
			else if( currentView == "byLocation" ) {
					link.appendChild(document.createTextNode(mapArray[ shelfYrAlbumNum ][ mapDescription ]));
					link.setAttribute("className","branch");
					link.setAttribute("class","branch");
			}
		}
		else {																// if adding album then set target location and description appropriately
					link.appendChild(document.createTextNode(albumArray[ shelfYrAlbumNum ][ description ]));
					link.setAttribute("className","album");
					link.setAttribute("class","album");
		}

				var blankCell = document.createElement("td");					// ADD BLANK CELL that separates description from date
				row.appendChild(blankCell);
		if( branchSolo == 0 ) {													// set cell height so that there are 4 pixels above and below thumbnail
			if( currentView == "byDate" )
				{blankCell.setAttribute("height",seasonArray[ shelfYrAlbumNum ][ seasonNum ][ seasonThumbHeight ]+8);}
			else if( currentView == "byCategory" )
				{blankCell.setAttribute("height",categoryArray[ shelfYrAlbumNum ][ categoryThumbHeight ]+8);}
			else if( currentView == "byLocation" )
				{blankCell.setAttribute("height",mapArray[ shelfYrAlbumNum ][ mapThumbHeight ]+8);}
		}
		else {
				blankCell.setAttribute("height",albumArray[ shelfYrAlbumNum ][ thumbHeight ]+8);

				var dateCell = document.createElement("td");					// ADD DATE (only if adding an album)
				row.appendChild(dateCell);
				dateCell.appendChild(document.createTextNode(albumArray[ shelfYrAlbumNum ][ albumDate ]));
		}
}

function addSpacingRow( numThumbnails, shelfYrAlbumNum, seasonNum )	{
	var row = document.createElement("tr");										// add current row
	innerTable.appendChild(row);
	for( var thumbnailNum=0; thumbnailNum<numThumbnails; thumbnailNum++ ) {		// add thumbnail columns, width = 100
		var blankCell = document.createElement("td");
		row.appendChild(blankCell);
		blankCell.setAttribute("width","100");
		blankCell.setAttribute("class","spacingCell");							// need to do this so that cell widths expand with size of shelf descriptions
		blankCell.setAttribute("className","spacingCell");
	}			
		var blankCell = document.createElement("td");							// add description cell
		row.appendChild(blankCell);
		blankCell.setAttribute("class","spacingCell");
		blankCell.setAttribute("className","spacingCell");

		var pageJump = document.createElement( "a" );							// add marker showing where on the page to jump to if opening a new shelf
		blankCell.appendChild(pageJump);
		if( currentView == "byDate" ) 
			{pageJump.setAttribute("name",seasonStr[ seasonNum ] + shelfYrAlbumNum);}
		else if( currentView == "byCategory" ) 
			{pageJump.setAttribute("name",categoryStr[ shelfYrAlbumNum ]);}
		else if( currentView == "byLocation" ) 
			{pageJump.setAttribute("name",mapStr[ shelfYrAlbumNum ]);}
		
		var blankCell = document.createElement("td");							// add spacing cell between description and date, width = 50
		row.appendChild(blankCell);
		blankCell.setAttribute("width","50");
		blankCell.setAttribute("class","spacingCell");
		blankCell.setAttribute("className","spacingCell");
}

function addMappedAlbums()
{
	if( currentView != "byLocation" ) {											// ignore action if already using this viewing format
		setSidebar( "byLocation" );												// adjust sidebar highlighting
		table = document.getElementById("albumTable");							// access album table

		for( var mapNum=1; mapNum<=numMaps; mapNum++ )							// iterate through all maps
			{addLine( 0, mapNum, 0 );}											// add shelf expand / collapse button
	}
}
function clickMapShelf( mapNum ) {
	for( var mapNumTemp=1; mapNumTemp<=numMaps; mapNumTemp++ ) {				// collapse any other expanded maps
		if( mapNumTemp != mapNum && mapArray[ mapNumTemp ][ mapExpanded ] == true ) 
			{collapseShelf( mapNumTemp, 0 );}
	}
	if( mapArray[ mapNum ][ mapExpanded ] == false ) {								// expand map if it is currently collapsed
		writeCookie( "shelf", mapNum );												// record which shelf is now being viewed so that PhotoPage can jump back
		mapArray[ mapNum ][ mapExpanded ] = true;									// record that map is now expanded
		innerTable = document.getElementById( mapStr[ mapNum ] + "Table");			// access map shelf
			var row = document.createElement("tr");										
			innerTable.appendChild(row);
				var cell = document.createElement("td");							// skip thumbnail cell (could put branch image here, but it doesn't look good
				row.appendChild(cell);
				mapCell = document.createElement("td");							
				row.appendChild(mapCell);
					var mapImg = document.createElement("img");						// ADD MAP
					mapCell.appendChild(mapImg);
					mapImg.src="Graphics/Maps/" + mapStr[ mapNum ] + ".jpg";
					mapImg.setAttribute("width",mapArray[ mapNum ][ mapWidth ]);
					mapImg.setAttribute("height",mapArray[ mapNum ][ mapHeight ]);

		if( mapNum == europeMap || mapNum == switzerlandMap ) {
					var link = document.createElement("a");							// ADD ZOOM IMAGE and LINK
					mapCell.appendChild(link);
						link.setAttribute("id","mapDiv");
						link.setAttribute("id","mapDiv");
						link.href = "javascript:clickMapShelf(" + (mapNum+1) + ");";
							var zoomImg = document.createElement("img");					
							link.appendChild(zoomImg);
							zoomImg.setAttribute("border", 0);
			if( mapNum == europeMap ) {
							zoomImg.src="Graphics/Maps/zoom_CH.png";
							zoomImg.setAttribute("width", 86);
							zoomImg.setAttribute("height", 50);
						link.style.left = "377px";
						link.style.top = "408px";
			}
			else {
							zoomImg.src="Graphics/Maps/zoom_CH-SW.png";
							zoomImg.setAttribute("width", 160);
							zoomImg.setAttribute("height", 150);
						link.style.left = "105px";
						link.style.top = "375px";
			}
		}

		for( var albumNum=0; albumNum<numAlbums; albumNum++ ) {						// iterate through all albums
			var albumHandled = false;
			if( albumArray[ albumNum ][ mapNumber ] == mapNum ) {					// check whether album belongs on this map
				for( var locationNum=0; locationNum<numMultipleLocations; locationNum++ ) {
					if( albumArray[ albumNum ][ locationName ] == multiLocation[ locationNum ][ multiLocationName ] ) {
						albumHandled = true;
						if( multiLocation[ locationNum ][ multiLocationAdded ] == false ) {
							addLocation( albumNum, mapNum, true, locationNum );		// add map marker for first instance of multiple-album location
							multiLocation[ locationNum ][ multiLocationAdded ] = true;
						}
					}
				}
				if( albumHandled == false )
					{addLocation( albumNum, mapNum, false, 0 );}					// add map marker for individual location
			}
		}
	}
	else																			// collapse map if it is currently expanded
		{collapseShelf( mapNum, 0 );}
}

function addLocation( albumNum, mapNum, multiple, locationNum ) {
	link = document.createElement("a");
	mapCell.appendChild(link);
		link.setAttribute("id","mapDiv");
		link.style.left = ( albumArray[ albumNum ][ mapX ] + mapOffsetX ) + "px";
		link.style.top = ( albumArray[ albumNum ][ mapY ] + mapArray[ mapNum ][ mapOffsetY ] ) + "px";
		link.appendChild(document.createTextNode( "+  " + albumArray[ albumNum ][ locationName ] ));
	if( multiple == true ) {
		link.href = "javascript:addLocationDropDown(" + albumNum + "," + mapNum + "," + locationNum + ");";
		link.setAttribute("onMouseOver","javascript:addAlbumDescription(" + albumNum + "," + mapNum + ", 1 );");
		link.setAttribute("onMouseOut","javascript:removeAlbumDescription(" + albumNum + ");");
	}
	else {
		link.href = "PhotoPage.html?" + albumArray[ albumNum ][ albumYear ] + "&" + albumArray[ albumNum ][ season ] + "&" + albumArray[ albumNum ][ albumID ];
		link.setAttribute("onMouseOver","javascript:addAlbumDescription(" + albumNum + "," + mapNum + ", 0 );");
		link.setAttribute("onMouseOut","javascript:removeAlbumDescription(" + albumNum + ");");
	}
}
function addLocationDropDown( albumNum, mapNum, locationNum ) {
	div = document.createElement("div");
	mapCell.appendChild(div);
	div.setAttribute("id",albumArray[ albumNum ][ locationName ] + "dropDown");
	div.setAttribute("class","mapDropDownDiv");
	div.setAttribute("className","mapDropDownDiv");
	div.style.left = (albumArray[ albumNum ][ mapX ] + mapOffsetX + 5) + "px";
	div.style.top = (albumArray[ albumNum ][ mapY ] + mapArray[ mapNum ][ mapOffsetY ] + 21) + "px";

	for( var newAlbumNum=0; newAlbumNum<numAlbums; newAlbumNum++ ) {
		if( albumArray[ newAlbumNum ][ locationName ] == multiLocation[ locationNum ][ multiLocationName ] ) {
		linkDiv = document.createElement("div");								// use this extra div so that it makes a new line for each album
		div.appendChild(linkDiv);
			link = document.createElement("a");
			linkDiv.appendChild(link);
			link.setAttribute("class","mapDropDownDivText");
			link.setAttribute("className","mapDropDownDivText");
			link.href = "PhotoPage.html?" + albumArray[ newAlbumNum ][ albumYear ] + "&" + albumArray[ newAlbumNum ][ season ] + "&" + albumArray[ newAlbumNum ][ albumID ];
				link.appendChild(document.createTextNode( albumArray[ newAlbumNum ][ description ] + " (" + albumArray[ newAlbumNum ][ season ] + " " + albumArray[ newAlbumNum ][ albumYear ] + ")" ));
		}
	}

	closeDiv = document.createElement("div");
	closeDiv.setAttribute("class","mapDropDownDivClose");
	closeDiv.setAttribute("className","mapDropDownDivClose");
	div.appendChild(closeDiv);
		link = document.createElement("a");
		closeDiv.appendChild(link);
		link.href = "javascript:closeLocationDropDown(" + albumNum + "," + locationNum + ");";
			link.appendChild(document.createTextNode( "close" ));
}
function closeLocationDropDown( albumNum, locationNum ) {
	mapCell.removeChild(document.getElementById(albumArray[ albumNum ][ locationName ] + "dropDown"));
}

function addAlbumDescription( albumNum, mapNum, multiple ) {
	div = document.createElement("div");
	mapCell.appendChild(div);
	div.setAttribute("id",albumArray[ albumNum ][ locationName ] + "description" );
	div.setAttribute("class","mapDropDownDiv");
	div.setAttribute("className","mapDropDownDiv");
	div.style.left = (albumArray[ albumNum ][ mapX ] + mapOffsetX + 5) + "px";
	div.style.top = (albumArray[ albumNum ][ mapY ] + mapArray[ mapNum ][ mapOffsetY ] + 21) + "px";
	if( multiple == true )
		{text = document.createTextNode( "Mutliple albums; click place-name to expand." );}
	else
		{text = document.createTextNode( albumArray[ albumNum ][ description ] + " (" + albumArray[ albumNum ][ season ] + " " + albumArray[ albumNum ][ albumYear ] + ")" );}
		div.appendChild(text);
}
function removeAlbumDescription( albumNum ) {
	mapCell.removeChild(document.getElementById(albumArray[ albumNum ][ locationName ] + "description"));
}

function setSidebar( viewID ) {
	if( currentView == "byDate" ) {												// reset expanded tags
		for( var yearNum=firstYear; yearNum<=lastYear; yearNum++ ) {			
			for( var seasonNum=winter; seasonNum<=fall; seasonNum++ ) 
				{seasonArray[ yearNum ][ seasonNum ][ seasonExpanded ] = false;}
		}
	}
	else if( currentView == "byCategory" ) {
		for( var categoryNum=firstCategory; categoryNum<=lastCategory; categoryNum++ )
			{categoryArray[ categoryNum ][ categoryExpanded ] = false;}				
	}
	else if( currentView == "byLocation" ) {
		for( var mapNum=1; mapNum<=numMaps; mapNum++ )				
			{mapArray[ mapNum ][ mapExpanded ] = false;}									
	}	

	writeCookie( "viewFormat", viewID );										// record current viewing format so that PhotoPage can jump back

	table = document.getElementById("albumTable");								// clear album table
	while( table.firstChild )
		{table.removeChild(table.firstChild);}
	if( currentView != "" )
		{changeHighlight(currentView, "no_outline");}							// clear highlight of old viewing format
	currentView = viewID;														// record new viewing format
	changeHighlight(currentView, "outline");									// highlight new viewing format
}

function changeHighlight( cellID, status ) {
	var highlightCell = document.getElementById(cellID);						
	highlightCell.setAttribute("className",status);
	highlightCell.setAttribute("class",status);
}

function writeCookie( cookieName, cookieValue ) {
	document.cookie = cookieName + "=" + cookieValue + "; path=/";
}
function readCookie( cookieName ) {
	var cookieContents = new Array();
	cookieContents = document.cookie.split(';');
	cookieName += "=";
	for( var i=0; i<cookieContents.length; i++ ) {
		while (cookieContents[ i ].charAt( 0 ) == " ") cookieContents[ i ] = cookieContents[ i ].substring( 1, cookieContents[ i ].length );
		if( cookieContents[ i ].indexOf( cookieName ) == 0 )											// if cookie name matches then ...
			{return cookieContents[ i ].substring( cookieName.length, cookieContents[ i ].length );}	// ... return cookie value
	}
	return null;																						// return nothing if cookie not found	
}
function AddRandomPhoto() {
	var numPages = image.length - 1;	
	var randPage = Math.floor( 1.0 + numPages * Math.random() );
	var randomImg = document.getElementById( "randomImg" );
	randomImg.src = randomImgPath + image[ randPage ];
	randomImg.style.width = "200px";
	var randomImgLink = document.getElementById( "randomImgLink" );
	randomImgLink.href = "PhotoPage.html?" + albumArray[ randAlbum ][ albumYear ] + "&" + albumArray[ randAlbum ][ season ] + "&" + albumArray[ randAlbum ][ albumID ] + "&" + randPage;
}