window.thumbnails = new Object();
												thumbnails[5939060] = new thumbnail(5939060,'229249','','avian_thumb.jpg',130, 86,32,'photo_5939060.html');
												thumbnails[5939061] = new thumbnail(5939061,'286745','','dance_thumb.jpg',130, 84,32,'photo_5939061.html');
												thumbnails[5939066] = new thumbnail(5939066,'243280','','equestrian_thumb.jpg',130, 93,32,'photo_5939066.html');
												thumbnails[5939067] = new thumbnail(5939067,'203412','','human_thumb.jpg',130, 89,32,'photo_5939067.html');
												thumbnails[5939068] = new thumbnail(5939068,'203409','','landscape_thumb.jpg',130, 86,32,'photo_5939068.html');
												thumbnails[5939069] = new thumbnail(5939069,'334457','','pets_thumb.jpg',130, 191,32,'photo_5939069.html');
												thumbnails[5939071] = new thumbnail(5939071,'203411','','wildlife_thumb.jpg',130, 86,32,'photo_5939071.html');
												thumbnails[6900723] = new thumbnail(6900723,'286745','JooN Dance','TPU_thumb.jpg',130, 89,32,'photo_6900723.html');
												thumbnails[6900727] = new thumbnail(6900727,'286745','JooN Dance','TPU_2_thumb.jpg',130, 98,32,'photo_6900727.html');
												thumbnails[7053944] = new thumbnail(7053944,'229249','','DSC_3581-2_thumb.jpg',130, 182,32,'photo_7053944.html');
												thumbnails[7053947] = new thumbnail(7053947,'229249','','5_in_a_Bed_thumb.jpg',130, 86,32,'photo_7053947.html');
												thumbnails[7053948] = new thumbnail(7053948,'229249','','DSC_9927_copuy_thumb.jpg',130, 96,32,'photo_7053948.html');
												thumbnails[7053949] = new thumbnail(7053949,'229249','','DSC_9929_copy_thumb.jpg',130, 95,32,'photo_7053949.html');
												thumbnails[7053951] = new thumbnail(7053951,'229249','','DSC_9942_copy_thumb.jpg',130, 88,32,'photo_7053951.html');
												thumbnails[7053953] = new thumbnail(7053953,'229249','','DSC_9946_copy_thumb.jpg',130, 87,32,'photo_7053953.html');
												thumbnails[7053956] = new thumbnail(7053956,'229249','','Flight_of_Fancy_thumb.jpg',130, 86,32,'photo_7053956.html');
												thumbnails[7053957] = new thumbnail(7053957,'229249','','Skokholm_Puffin_thumb.jpg',130, 74,32,'photo_7053957.html');
												thumbnails[7053959] = new thumbnail(7053959,'229249','','Skokholm_Seagull_thumb.jpg',130, 69,32,'photo_7053959.html');
												thumbnails[7053965] = new thumbnail(7053965,'229249','','Wave_of_Gulls_thumb.jpg',130, 18,32,'photo_7053965.html');
												thumbnails[7054021] = new thumbnail(7054021,'381865','','DSC_0989_thumb.jpg',130, 40,32,'photo_7054021.html');
												thumbnails[7054023] = new thumbnail(7054023,'381865','','DSC_0991_thumb.jpg',130, 68,32,'photo_7054023.html');
												thumbnails[7054027] = new thumbnail(7054027,'381865','','DSC_1030_thumb.jpg',130, 248,32,'photo_7054027.html');
												thumbnails[7054028] = new thumbnail(7054028,'381865','','DSC_1062_thumb.jpg',130, 54,32,'photo_7054028.html');
												thumbnails[7054037] = new thumbnail(7054037,'243280','','a_thumb.jpg',130, 47,32,'photo_7054037.html');
												thumbnails[7054042] = new thumbnail(7054042,'243280','','blush_stirrup_thumb.jpg',130, 375,32,'photo_7054042.html');
												thumbnails[7054043] = new thumbnail(7054043,'243280','','Blushing_thumb.jpg',130, 82,32,'photo_7054043.html');
												thumbnails[7054046] = new thumbnail(7054046,'243280','','Blushportrait_thumb.jpg',130, 93,32,'photo_7054046.html');
												thumbnails[7054049] = new thumbnail(7054049,'243280','','DSC_5227-2_thumb.jpg',130, 93,32,'photo_7054049.html');
												thumbnails[7054063] = new thumbnail(7054063,'243280','','DSC_8011-2_thumb.jpg',130, 93,32,'photo_7054063.html');
												thumbnails[7054067] = new thumbnail(7054067,'243280','','TO_PUT_UP_thumb.jpg',130, 87,32,'photo_7054067.html');
												thumbnails[7054070] = new thumbnail(7054070,'243280','','TPU_3_thumb.jpg',130, 93,32,'photo_7054070.html');
												thumbnails[7054073] = new thumbnail(7054073,'243280','','TPU_4_thumb.jpg',130, 182,32,'photo_7054073.html');
												thumbnails[7054075] = new thumbnail(7054075,'243280','','TPU_5_thumb.jpg',130, 182,32,'photo_7054075.html');
												thumbnails[7054077] = new thumbnail(7054077,'243280','','TPU_7_thumb.jpg',130, 93,32,'photo_7054077.html');
												thumbnails[7054079] = new thumbnail(7054079,'243280','','TPU_71_thumb.jpg',130, 93,32,'photo_7054079.html');
												thumbnails[7054084] = new thumbnail(7054084,'243280','','TPU_8_thumb.jpg',130, 182,32,'photo_7054084.html');
												thumbnails[7054087] = new thumbnail(7054087,'243280','','TPU_9_thumb.jpg',130, 182,32,'photo_7054087.html');
												thumbnails[7054090] = new thumbnail(7054090,'243280','','TPU_10_thumb.jpg',130, 182,32,'photo_7054090.html');
												thumbnails[7054098] = new thumbnail(7054098,'243280','','TPU_11_thumb.jpg',130, 182,32,'photo_7054098.html');
												thumbnails[7054103] = new thumbnail(7054103,'243280','','TPU_12_thumb.jpg',130, 93,32,'photo_7054103.html');
												thumbnails[7054106] = new thumbnail(7054106,'243280','','TPU_14_thumb.jpg',130, 99,32,'photo_7054106.html');
												thumbnails[7054128] = new thumbnail(7054128,'334457','','DSC_7679-2_thumb.jpg',130, 207,32,'photo_7054128.html');
												thumbnails[7054137] = new thumbnail(7054137,'334457','','DSC_7697_thumb.jpg',130, 76,32,'photo_7054137.html');
												thumbnails[7473928] = new thumbnail(7473928,'203411','Cows on Haroldston','Cows_on_Haroldston_thumb.jpg',130, 79,32,'photo_7473928.html');
												thumbnails[7473931] = new thumbnail(7473931,'203411','Spot the Difference','DSC_0594_thumb.jpg',130, 84,32,'photo_7473931.html');
												thumbnails[7473934] = new thumbnail(7473934,'203411','Lemur','DSC_0656_thumb.jpg',130, 105,32,'photo_7473934.html');
												thumbnails[7682705] = new thumbnail(7682705,'203409','Langland Storms','DSC_0906_thumb.jpg',130, 86,32,'photo_7682705.html');
												thumbnails[7682708] = new thumbnail(7682708,'203409','','DSC_0981_thumb.jpg',130, 86,32,'photo_7682708.html');
												thumbnails[7682711] = new thumbnail(7682711,'203409','','DSC_1002_thumb.jpg',130, 86,32,'photo_7682711.html');
												thumbnails[7682712] = new thumbnail(7682712,'203409','Langland Waves II','DSC_1001_thumb.jpg',130, 86,32,'photo_7682712.html');
												thumbnails[7682713] = new thumbnail(7682713,'203409','Langland Sunset','DSC_1047_thumb.jpg',130, 86,32,'photo_7682713.html');
												thumbnails[7682714] = new thumbnail(7682714,'203409','Sunset Huts','DSC_1144_thumb.jpg',130, 86,32,'photo_7682714.html');
												thumbnails[7682718] = new thumbnail(7682718,'203409','Snow Trees','DSC_1509_thumb.jpg',130, 85,32,'photo_7682718.html');
												thumbnails[7682719] = new thumbnail(7682719,'203409','Snow Rays','DSC_1510_thumb.jpg',130, 86,32,'photo_7682719.html');
												thumbnails[7682721] = new thumbnail(7682721,'203409','Over Mumbles Snow','DSC_1511_thumb.jpg',130, 86,32,'photo_7682721.html');
												thumbnails[7682722] = new thumbnail(7682722,'203409','Golden Snow','DSC_1517_thumb.jpg',130, 86,32,'photo_7682722.html');
												thumbnails[7682724] = new thumbnail(7682724,'203409','Mumbles Lighthouse','DSC_1621_thumb.jpg',130, 86,32,'photo_7682724.html');
												thumbnails[7682726] = new thumbnail(7682726,'203409','Reflections','DSC_1645_thumb.jpg',130, 86,32,'photo_7682726.html');
												thumbnails[7682727] = new thumbnail(7682727,'203409','Monochrome Snow','DSC_1665_thumb.jpg',130, 86,32,'photo_7682727.html');
												thumbnails[7682728] = new thumbnail(7682728,'203409','Tranquility','Screen_shot_2011-04-21_at_121.16_thumb.jpg',130, 26,32,'photo_7682728.html');
												thumbnails[7682730] = new thumbnail(7682730,'203409','Tranquility','Tranquility_thumb.jpg',130, 26,32,'photo_7682730.html');
												thumbnails[7682743] = new thumbnail(7682743,'203409','Tranquility','Tranquility1_thumb.jpg',130, 26,32,'photo_7682743.html');
												thumbnails[7682771] = new thumbnail(7682771,'334457','Pi','DSC_8031_thumb.jpg',130, 195,32,'photo_7682771.html');
												thumbnails[7682772] = new thumbnail(7682772,'334457','Pi II','DSC_8046_thumb.jpg',130, 86,32,'photo_7682772.html');
												thumbnails[7682773] = new thumbnail(7682773,'334457','','DSC_8049_thumb.jpg',130, 138,32,'photo_7682773.html');
												thumbnails[7682775] = new thumbnail(7682775,'334457','Silas','DSC_8226-2_thumb.jpg',130, 179,32,'photo_7682775.html');
												thumbnails[7682777] = new thumbnail(7682777,'334457','Fern','DSC_8232_thumb.jpg',130, 191,32,'photo_7682777.html');
												thumbnails[7682790] = new thumbnail(7682790,'203411','Piggy Pillow','Piggy_Pillow_thumb.jpg',130, 56,32,'photo_7682790.html');
												thumbnails[7682795] = new thumbnail(7682795,'203411','Melting the Ice','DSC_1410_thumb.jpg',130, 169,32,'photo_7682795.html');
												thumbnails[7682796] = new thumbnail(7682796,'203411','Frosted Leaves','DSC_1413_thumb.jpg',130, 62,32,'photo_7682796.html');
												thumbnails[7708019] = new thumbnail(7708019,'286745','','DSC_1958wtmk1_thumb.jpg',130, 86,32,'photo_7708019.html');
												thumbnails[7708021] = new thumbnail(7708021,'286745','','DSC_1960wtmk1_thumb.jpg',130, 89,32,'photo_7708021.html');
												thumbnails[7708024] = new thumbnail(7708024,'286745','','DSC_1964wtmk1_thumb.jpg',130, 75,32,'photo_7708024.html');
												thumbnails[7708026] = new thumbnail(7708026,'286745','','DSC_1967wtmk1_thumb.jpg',130, 84,32,'photo_7708026.html');
												thumbnails[7708027] = new thumbnail(7708027,'286745','','DSC_1969wtmk1_thumb.jpg',130, 81,32,'photo_7708027.html');
												thumbnails[7708031] = new thumbnail(7708031,'286745','','DSC_1989wtmk1_thumb.jpg',130, 87,32,'photo_7708031.html');
												thumbnails[7708034] = new thumbnail(7708034,'286745','','DSC_2000wtmk1_thumb.jpg',130, 37,32,'photo_7708034.html');
												thumbnails[7708038] = new thumbnail(7708038,'286745','','DSC_2002wtmk1_thumb.jpg',130, 46,32,'photo_7708038.html');
												thumbnails[7708041] = new thumbnail(7708041,'286745','','DSC_2003wtmk1_thumb.jpg',130, 86,32,'photo_7708041.html');
												thumbnails[7708045] = new thumbnail(7708045,'286745','','DSC_2004wtmk1_thumb.jpg',130, 190,32,'photo_7708045.html');
												thumbnails[7708077] = new thumbnail(7708077,'286745','','DSC_2009wtmk1_thumb.jpg',130, 191,32,'photo_7708077.html');
												thumbnails[7708080] = new thumbnail(7708080,'286745','','DSC_2016wtmk1_thumb.jpg',130, 200,32,'photo_7708080.html');
												thumbnails[7708081] = new thumbnail(7708081,'286745','','DSC_2017wtmk1_thumb.jpg',130, 205,32,'photo_7708081.html');
												thumbnails[7708083] = new thumbnail(7708083,'286745','','DSC_2018wtmk_thumb.jpg',130, 73,32,'photo_7708083.html');
												thumbnails[7708084] = new thumbnail(7708084,'286745','','DSC_2019wtmk_thumb.jpg',130, 86,32,'photo_7708084.html');
												thumbnails[7708086] = new thumbnail(7708086,'286745','','DSC_2023wtmk1_thumb.jpg',130, 63,32,'photo_7708086.html');
												thumbnails[7708087] = new thumbnail(7708087,'286745','','DSC_2031wtmk1_thumb.jpg',130, 206,32,'photo_7708087.html');
												thumbnails[7708088] = new thumbnail(7708088,'286745','','DSC_2040wtmk1_thumb.jpg',130, 76,32,'photo_7708088.html');
												thumbnails[7708090] = new thumbnail(7708090,'286745','','DSC_2042wtmk_thumb.jpg',130, 163,32,'photo_7708090.html');
												thumbnails[7708091] = new thumbnail(7708091,'286745','','DSC_2049_2wtmk1_thumb.jpg',130, 184,32,'photo_7708091.html');
												thumbnails[7708092] = new thumbnail(7708092,'286745','','DSC_2054_2wtmk1_thumb.jpg',130, 194,32,'photo_7708092.html');
												thumbnails[7708094] = new thumbnail(7708094,'286745','','DSC_2059_2wtmk1_thumb.jpg',130, 67,32,'photo_7708094.html');
												thumbnails[7708096] = new thumbnail(7708096,'286745','','DSC_2062wtmk1_thumb.jpg',130, 53,32,'photo_7708096.html');
												thumbnails[7708098] = new thumbnail(7708098,'203412','','DSC_1975wtmk1_thumb.jpg',130, 86,32,'photo_7708098.html');
												thumbnails[7708101] = new thumbnail(7708101,'203412','','DSC_1979wtmk_thumb.jpg',130, 86,32,'photo_7708101.html');
												thumbnails[7708104] = new thumbnail(7708104,'203412','','DSC_1983wtmk1_thumb.jpg',130, 86,32,'photo_7708104.html');
												thumbnails[4035836] = new thumbnail(4035836,'203412','Dance at Dusk','Dance_at_Dusk_thumb.jpg',130, 89,32,'photo_4035836.html');
												thumbnails[5068325] = new thumbnail(5068325,'286745','','DSC_8505-2_thumb.jpg',130, 84,32,'photo_5068325.html');
												thumbnails[5937120] = new thumbnail(5937120,'203409','Hilton Court','DSC_8168_thumb.jpg',130, 86,32,'photo_5937120.html');
												thumbnails[5068324] = new thumbnail(5068324,'286745','','DSC_8492-2_thumb.jpg',130, 81,32,'photo_5068324.html');
												thumbnails[5544986] = new thumbnail(5544986,'203412','','DSC_7566_small_small_thumb.jpg',130, 142,32,'photo_5544986.html');
												thumbnails[5937206] = new thumbnail(5937206,'203409','Hilton Lake 3','DSC_8177_thumb.jpg',130, 86,32,'photo_5937206.html');
												thumbnails[5068321] = new thumbnail(5068321,'286745','','DSC_8477-2_thumb.jpg',130, 86,32,'photo_5068321.html');
												thumbnails[5544963] = new thumbnail(5544963,'203412','','DSC_7562-2_small_small_thumb.jpg',130, 166,32,'photo_5544963.html');
												thumbnails[5937152] = new thumbnail(5937152,'203409','Hilton Court 2','DSC_8171_thumb.jpg',130, 86,32,'photo_5937152.html');
												thumbnails[5068320] = new thumbnail(5068320,'286745','','DSC_8423-2_thumb.jpg',130, 91,32,'photo_5068320.html');
												thumbnails[5926612] = new thumbnail(5926612,'203412','Babyfaced','DSC_7550_thumb.jpg',130, 86,32,'photo_5926612.html');
												thumbnails[5937203] = new thumbnail(5937203,'203409','Hilton Lake 2','DSC_8179_thumb.jpg',130, 200,32,'photo_5937203.html');
												thumbnails[4035839] = new thumbnail(4035839,'203412','Smelling the Roses','Profile_7_thumb.jpg',130, 86,32,'photo_4035839.html');
												thumbnails[5068319] = new thumbnail(5068319,'286745','','DSC_8419-2-2_thumb.jpg',130, 95,32,'photo_5068319.html');
												thumbnails[5937161] = new thumbnail(5937161,'203409','Hilton Lake','DSC_8186_thumb.jpg',130, 195,32,'photo_5937161.html');
												thumbnails[5068318] = new thumbnail(5068318,'286745','','DSC_8418-2-2_thumb.jpg',130, 102,32,'photo_5068318.html');
												thumbnails[5544953] = new thumbnail(5544953,'203412','','DSC_7582_small_small_thumb.jpg',130, 86,32,'photo_5544953.html');
												thumbnails[4035724] = new thumbnail(4035724,'203409','View from Haroldston','View_from_Haroldston_thumb.jpg',130, 195,32,'photo_4035724.html');
												thumbnails[4035840] = new thumbnail(4035840,'203412','Cherub','Profile_8_thumb.jpg',130, 86,32,'photo_4035840.html');
												thumbnails[5068322] = new thumbnail(5068322,'286745','','DSC_8480-2-2_thumb.jpg',130, 86,32,'photo_5068322.html');
												thumbnails[4035707] = new thumbnail(4035707,'203409','Overlooking Druidstone','Overlooking_Druidston_thumb.jpg',130, 78,32,'photo_4035707.html');
												thumbnails[4035841] = new thumbnail(4035841,'203412','Modelled by Gareth Ogden','Profile_9_thumb.jpg',130, 86,32,'photo_4035841.html');
												thumbnails[5068337] = new thumbnail(5068337,'286745','','DSC_8740-2-2_thumb.jpg',130, 82,32,'photo_5068337.html');
												thumbnails[4035704] = new thumbnail(4035704,'203409','From Wooltack Point','From_Wooltack_Point_thumb.jpg',130, 86,32,'photo_4035704.html');
												thumbnails[5068136] = new thumbnail(5068136,'286745','','DSC_8716-2_thumb.jpg',130, 58,32,'photo_5068136.html');
												thumbnails[5068763] = new thumbnail(5068763,'203412','Danni Monroe - The Dirty Youth','DSC_7856-2_thumb.jpg',130, 86,32,'photo_5068763.html');
												thumbnails[4035705] = new thumbnail(4035705,'203409','A Portrait of Wooltack Point','From_Wooltack_Point_-_a_Portrait_thumb.jpg',130, 195,32,'photo_4035705.html');
												thumbnails[5068332] = new thumbnail(5068332,'286745','','DSC_8666-2_thumb.jpg',130, 153,32,'photo_5068332.html');
												thumbnails[5926616] = new thumbnail(5926616,'203412','Danni - The Dirty Youth','DSC_8004_thumb.jpg',130, 97,32,'photo_5926616.html');
												thumbnails[4035682] = new thumbnail(4035682,'203409','From Broad Haven','From_Broad_Haven_thumb.jpg',130, 86,32,'photo_4035682.html');
												thumbnails[5068331] = new thumbnail(5068331,'286745','','DSC_8664-2_thumb.jpg',130, 99,32,'photo_5068331.html');
												thumbnails[5926614] = new thumbnail(5926614,'203412','Danni - The Dirty Youth','DSC_7817_thumb.jpg',130, 194,32,'photo_5926614.html');
												thumbnails[4035702] = new thumbnail(4035702,'203409','From Druidstone','From_Druidstone_thumb.jpg',130, 74,32,'photo_4035702.html');
												thumbnails[5068326] = new thumbnail(5068326,'286745','','DSC_8600-2_thumb.jpg',130, 86,32,'photo_5068326.html');
												thumbnails[4035715] = new thumbnail(4035715,'203409','Sunlit Waves','Sunlit_Waves_thumb.jpg',130, 49,32,'photo_4035715.html');
												thumbnails[4035670] = new thumbnail(4035670,'203409','Druidstone Stones','Druidstone_Stones_thumb.jpg',130, 86,32,'photo_4035670.html');
												thumbnails[4035732] = new thumbnail(4035732,'203409','Waves at Nolton Haven','Waves_on_Nolton_Haven_thumb.jpg',130, 72,32,'photo_4035732.html');
												thumbnails[4035668] = new thumbnail(4035668,'203409','Broad Haven Waves','Broad_Haven_Waves_thumb.jpg',130, 69,32,'photo_4035668.html');
												thumbnails[4035727] = new thumbnail(4035727,'203409','Waves at Whitesands','Waves_at_Whitesands_thumb.jpg',130, 80,32,'photo_4035727.html');
												thumbnails[4035672] = new thumbnail(4035672,'203409','A Broad Haven View','A_Broad_Haven_View_thumb.jpg',130, 86,32,'photo_4035672.html');
												thumbnails[4035843] = new thumbnail(4035843,'203409','A Rocky Road','A_Rocky_Road_thumb.jpg',130, 287,32,'photo_4035843.html');
												thumbnails[4035706] = new thumbnail(4035706,'203409','Houses of Skokholm','Houses_of_Skokholm_thumb.jpg',130, 65,32,'photo_4035706.html');
												thumbnails[7473926] = new thumbnail(7473926,'203411',' Haroldston Bee','Bee_on_Haroldston_thumb.jpg',130, 78,32,'photo_7473926.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[229249] = new gallery(229249,'5939060','Avian','gallery',[5939060,7053944,7053947,7053948,7053949,7053951,7053953,7053956,7053957,7053959,7053965],0, 0, '', 'gallery_229249.html',0,0);
				  					galleries[381865] = new gallery(381865,'7054028,7054027,7054023,7054021','Surfing','gallery',[7054021,7054023,7054027,7054028],0, 0, '', 'gallery_381865.html',0,0);
				  					galleries[243280] = new gallery(243280,'5939066','Equestrian','gallery',[5939066,7054037,7054042,7054043,7054046,7054049,7054063,7054067,7054070,7054073,7054075,7054077,7054079,7054084,7054087,7054090,7054098,7054103,7054106],0, 0, '', 'gallery_243280.html',0,0);
				  					galleries[334457] = new gallery(334457,'5939069','Pets','gallery',[5939069,7054128,7054137,7682771,7682772,7682773,7682775,7682777],0, 0, '', 'gallery_334457.html',0,0);
				  					galleries[203411] = new gallery(203411,'5939071','Wildlife','gallery',[5939071,7473928,7473931,7473934,7682790,7682795,7682796,7473926],0, 0, '', 'gallery_203411.html',0,0);
				  					galleries[203412] = new gallery(203412,'5939067','Human','gallery',[5939067,7708098,7708101,7708104,4035836,5544986,5544963,5926612,4035839,5544953,4035840,4035841,5068763,5926616,5926614],0, 0, '', 'gallery_203412.html',0,0);
				  					galleries[286745] = new gallery(286745,'5939061','Dance','gallery',[5939061,6900723,6900727,7708019,7708021,7708024,7708026,7708027,7708031,7708034,7708038,7708041,7708045,7708077,7708080,7708081,7708083,7708084,7708086,7708087,7708088,7708090,7708091,7708092,7708094,7708096,5068325,5068324,5068321,5068320,5068319,5068318,5068322,5068337,5068136,5068332,5068331,5068326],0, 0, '', 'gallery_286745.html',0,0);
				  					galleries[203409] = new gallery(203409,'5939068','Landscape','gallery',[5939068,7682705,7682708,7682711,7682712,7682713,7682714,7682718,7682719,7682721,7682722,7682724,7682726,7682727,7682728,7682730,7682743,5937120,5937206,5937152,5937203,5937161,4035724,4035707,4035704,4035705,4035682,4035702,4035715,4035670,4035732,4035668,4035727,4035672,4035843,4035706],0, 0, '', 'gallery_203409.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5937120,5068325,4035836';
imageSets[2] = '5939071,5939069,5939068,5939067,5939066,5939061,5939060';
imageSets[3] = '5937120,5068325,5068324,4035839,4035836,4035702';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/abbiejebsonphotography/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Abbie Jebson Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																				temp = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="minijebo@hotmail.com">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="minijebo@hotmail.com">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

