window.thumbnails = new Object();
												thumbnails[650414] = new thumbnail(650414,'','Blaengwynfi 1','Blaengwynfi-_1_thumb.jpg',130, 87,1,'#');
												thumbnails[677545] = new thumbnail(677545,'','Hywel looking for some good light at Mumbles','hywel1_thumb1.jpg',130, 160,1,'#');
												thumbnails[689665] = new thumbnail(689665,'','Hywel on the Cantilever, Glyder Fach (it was not a windy day thankfully).','Cantilever_thumb.jpg',130, 70,1,'#');
												thumbnails[1111899] = new thumbnail(1111899,'','Pumps at Maenclochog','Pumps_at_Maenclochog_thumb.jpg',130, 84,1,'#');
												thumbnails[1275013] = new thumbnail(1275013,'','Swansea Valley Woodland 2','Swansea_Valley_Woodland_2_thumb.jpg',130, 201,1,'#');
												thumbnails[1275019] = new thumbnail(1275019,'','Tywi Valley Tree 2','Tywi_Valley_Tree_2_thumb.jpg',130, 83,1,'#');
												thumbnails[1379150] = new thumbnail(1379150,'','Tywi Valley Trees in Spring','Tywi_Valley_Tree_in_Spring__thumb.jpg',130, 84,1,'#');
												thumbnails[1763468] = new thumbnail(1763468,'','Parkmill Woodland','Parkmill_Woodland_2_thumb.jpg',130, 201,1,'#');
												thumbnails[2162262] = new thumbnail(2162262,'','Cwmorthin 6','Cwmorthin 6_thumb.jpg',130, 87,1,'#');
												thumbnails[2162268] = new thumbnail(2162268,'','Cwmorthin 24','Cwmorthin 24_thumb.jpg',130, 87,1,'#');
												thumbnails[2548671] = new thumbnail(2548671,'','Llyn Cau Cader Idris','Llyn_Cau_Cader_Idris_thumb.jpg',130, 87,1,'#');
												thumbnails[1752591] = new thumbnail(1752591,'','Fuel Crisis','Fuel_Crisis_thumb.jpg',130, 86,1,'#');
												thumbnails[4107702] = new thumbnail(4107702,'','Fuel Crisis toned','Fuel_Crisis_toned_thumb.jpg',130, 86,1,'#');
												thumbnails[1758215] = new thumbnail(1758215,'','Beetle Wreck Talybont','Beetle_Wreck_Talybont_thumb.jpg',130, 189,1,'#');
												thumbnails[3993292] = new thumbnail(3993292,'','Talybont Beetle toned','Talybont_Beetle_toned_thumb.jpg',130, 192,1,'#');
												thumbnails[2874797] = new thumbnail(2874797,'','Beetle 105','Beetle_105_thumb.jpg',130, 194,1,'#');
												thumbnails[649365] = new thumbnail(649365,'49004','Southerndown No 1','Southerndown_No_1_thumb.jpg',130, 87,1,'photo_649365.html');
												thumbnails[649378] = new thumbnail(649378,'49004','Southerndown No 2','Southerndown_No_2_thumb.jpg',130, 87,1,'photo_649378.html');
												thumbnails[650142] = new thumbnail(650142,'49532','Mumbles Head 4','Mumbles_Head_4_thumb.jpg',130, 86,1,'photo_650142.html');
												thumbnails[653385] = new thumbnail(653385,'49493','Cwmtwrch Mine Remains 1','Cwmtwrch_Mine_Remains_1_thumb.jpg',130, 196,1,'photo_653385.html');
												thumbnails[653395] = new thumbnail(653395,'49493','Pen y Fan North Face','Pen_Y_Fan_North_Face_thumb.jpg',130, 87,1,'photo_653395.html');
												thumbnails[653433] = new thumbnail(653433,'49809','Towards Nantgwynant','Towards_Nantgwynant_thumb.jpg',130, 56,1,'photo_653433.html');
												thumbnails[653750] = new thumbnail(653750,'49493','The Beacons in Winter','Beacons_in_Snow_thumb.jpg',130, 57,1,'photo_653750.html');
												thumbnails[653754] = new thumbnail(653754,'49820','Cwmystwyth Remains','Cwmystwyth_Remains_thumb.jpg',130, 83,1,'photo_653754.html');
												thumbnails[653755] = new thumbnail(653755,'49810','Dryslwyn Castle','Dryslwyn_Castle_thumb.jpg',130, 85,1,'photo_653755.html');
												thumbnails[653757] = new thumbnail(653757,'49809','Glyder Fawr','Glyder_Fawr_thumb.jpg',130, 85,1,'photo_653757.html');
												thumbnails[653758] = new thumbnail(653758,'49809','Glyder Fawr 1','Glyder_Fawr_1_thumb.jpg',130, 82,1,'photo_653758.html');
												thumbnails[653759] = new thumbnail(653759,'49550','Human Remains 1','Human_Remains_1_thumb.jpg',130, 91,1,'photo_653759.html');
												thumbnails[653760] = new thumbnail(653760,'49809','Morning Scene Nantgwynant','Morning_Scene_Nantgwynant_thumb.jpg',130, 59,1,'photo_653760.html');
												thumbnails[653764] = new thumbnail(653764,'49550','No 1 Shed Landore','No_1_Shed_Landore_thumb.jpg',130, 80,1,'photo_653764.html');
												thumbnails[653765] = new thumbnail(653765,'49532','Gower Woodland','Gower_Woodland_thumb.jpg',130, 83,1,'photo_653765.html');
												thumbnails[653767] = new thumbnail(653767,'49493','Pen Y Fan and Ponies','Penyfan_and_Ponies_thumb.jpg',130, 87,1,'photo_653767.html');
												thumbnails[653768] = new thumbnail(653768,'49810','Road to Nowhere','Road_to_Nowhere_thumb.jpg',130, 84,1,'photo_653768.html');
												thumbnails[653769] = new thumbnail(653769,'49809','Snowdon Horseshoe','Snowdon_Horseshoe_thumb.jpg',130, 89,1,'photo_653769.html');
												thumbnails[653771] = new thumbnail(653771,'49493','The Black Mountain 1','The_Black_Mountain_1_thumb.jpg',130, 86,1,'photo_653771.html');
												thumbnails[653773] = new thumbnail(653773,'49810','Tywi Valley Tree','Tywi_Valley_Tree_thumb.jpg',130, 87,1,'photo_653773.html');
												thumbnails[654679] = new thumbnail(654679,'49550','Cwmparc Rhondda','Cwmparc_Rhondda_thumb.jpg',130, 83,1,'photo_654679.html');
												thumbnails[654680] = new thumbnail(654680,'49820','Cwmystwyth Remains 1','Cwmystwyth_Remains_1_thumb.jpg',130, 83,1,'photo_654680.html');
												thumbnails[654682] = new thumbnail(654682,'49550','Human Remains 3','Human_Remains_3_thumb.jpg',130, 174,1,'photo_654682.html');
												thumbnails[654683] = new thumbnail(654683,'49550','Human Remains 4','Human_Remains_4_thumb.jpg',130, 92,1,'photo_654683.html');
												thumbnails[654723] = new thumbnail(654723,'49810','Trees Tywi Valley','Tywi_Valley_Trees_thumb.jpg',130, 85,1,'photo_654723.html');
												thumbnails[654812] = new thumbnail(654812,'49810','Swansea Valley Woodland','Woodland_Swansea_Valley_thumb.jpg',130, 82,1,'photo_654812.html');
												thumbnails[662964] = new thumbnail(662964,'49550','Bethesda Chapel Swansea','Bethesda_Chapel_Swansea_thumb.jpg',130, 83,1,'photo_662964.html');
												thumbnails[662966] = new thumbnail(662966,'49810','Cynwyl Elfed Old Station','Cynwyl_Elfed_Old_Station_thumb.jpg',130, 83,1,'photo_662966.html');
												thumbnails[662972] = new thumbnail(662972,'49493','Quarrymen\'s Cottages Penwyllt','Quarrymen\'s_Cottages_Penwyl_thumb.jpg',130, 96,1,'photo_662972.html');
												thumbnails[662979] = new thumbnail(662979,'49809','Towards Glyder Fach','Towards_Glyder_Fach_thumb.jpg',130, 86,1,'photo_662979.html');
												thumbnails[662981] = new thumbnail(662981,'49810','Tree Tywi Valley','Tree_Tywi_Valley_thumb.jpg',130, 93,1,'photo_662981.html');
												thumbnails[662983] = new thumbnail(662983,'49493','View to Black Mountain','Snowstorm,-Black-Mountain_thumb.jpg',130, 69,1,'photo_662983.html');
												thumbnails[679074] = new thumbnail(679074,'49493','Cribyn','CRIBYN_thumb.jpg',130, 77,1,'photo_679074.html');
												thumbnails[690133] = new thumbnail(690133,'49532','Helvetia Wreck 1','Helvetia_Wreck_1_thumb.jpg',130, 86,1,'photo_690133.html');
												thumbnails[690137] = new thumbnail(690137,'49809','Llanberis','Llanberis_thumb.jpg',130, 87,1,'photo_690137.html');
												thumbnails[690140] = new thumbnail(690140,'49493','LLyn Y Fan Fawr 1','Llyn_Fan_Fawr_1_thumb.jpg',130, 84,1,'photo_690140.html');
												thumbnails[690152] = new thumbnail(690152,'49809','Sunlight Glyderau','Sunlight_Glyderau_thumb.jpg',130, 88,1,'photo_690152.html');
												thumbnails[690161] = new thumbnail(690161,'49532','Tree at Clyne ','Tree_at_Clyne_thumb.jpg',130, 211,1,'photo_690161.html');
												thumbnails[694101] = new thumbnail(694101,'49810','Mynydd y Gwair','Mynydd_y_Gwair_thumb.jpg',130, 84,1,'photo_694101.html');
												thumbnails[695519] = new thumbnail(695519,'49809','Llyn Dinas to Cnicht 3','Llyn_Dinas_towards_Cnicht_1_thumb.jpg',130, 83,1,'photo_695519.html');
												thumbnails[704888] = new thumbnail(704888,'49493','Llyn Cwm Llwch','Llyn_Cwm_Llwch_thumb.jpg',130, 83,1,'photo_704888.html');
												thumbnails[730704] = new thumbnail(730704,'49550','Aberavon Seafront','Aberavon_Seafront_thumb.jpg',130, 81,1,'photo_730704.html');
												thumbnails[730715] = new thumbnail(730715,'49810','Neath Abbey','Neath_Abbey_thumb.jpg',130, 179,1,'photo_730715.html');
												thumbnails[734064] = new thumbnail(734064,'49004','Dunraven Bay 3','Dunraven_3_thumb.jpg',130, 194,1,'photo_734064.html');
												thumbnails[734071] = new thumbnail(734071,'49004','Dunraven Bay 11','Dunraven_11_thumb.jpg',130, 87,1,'photo_734071.html');
												thumbnails[745181] = new thumbnail(745181,'49810','Tywi Tree','Tywi_Tree_thumb.jpg',130, 83,1,'photo_745181.html');
												thumbnails[745187] = new thumbnail(745187,'49810','Tywi Valley Trees 1','Tywi_Valley_Trees_1_thumb.jpg',130, 83,1,'photo_745187.html');
												thumbnails[745188] = new thumbnail(745188,'49809','View From Glyderau 1','View_from_Glyderau_1_thumb.jpg',130, 79,1,'photo_745188.html');
												thumbnails[824959] = new thumbnail(824959,'49532','Parkmill Woodland 1','Parkmill_Woodland_1_thumb.jpg',130, 84,1,'photo_824959.html');
												thumbnails[824967] = new thumbnail(824967,'49532','Wood and Sand Whitford','Sand_and_Wood_Whitford_thumb.jpg',130, 83,1,'photo_824967.html');
												thumbnails[824976] = new thumbnail(824976,'49809','Snowdon Horseshoe 1','Snowdon_Horseshoe_1_thumb.jpg',130, 38,1,'photo_824976.html');
												thumbnails[824981] = new thumbnail(824981,'49809','Snowdon Sunset','Snowdon_Sunset_thumb.jpg',130, 46,1,'photo_824981.html');
												thumbnails[824988] = new thumbnail(824988,'49810','Trees Tywi Valley 2','Trees_Tywi_Valley_2_thumb.jpg',130, 71,1,'photo_824988.html');
												thumbnails[832220] = new thumbnail(832220,'49532','Helvetia Wreck 2','Helvetia_Wreck_2_thumb.jpg',130, 82,1,'photo_832220.html');
												thumbnails[849258] = new thumbnail(849258,'49493','Maen Llia 1','Maen_Llia_1_thumb.jpg',130, 87,1,'photo_849258.html');
												thumbnails[957352] = new thumbnail(957352,'49820','Tregaron to Abergwesyn Road','Tregaron_to_Abergwesyn-_Roa_thumb.jpg',130, 87,1,'photo_957352.html');
												thumbnails[1011523] = new thumbnail(1011523,'49810','Bethesda Chapel Swansea 2','Bethesda_Chapel_Swansea2jpg_thumb.jpg',130, 84,1,'photo_1011523.html');
												thumbnails[1011524] = new thumbnail(1011524,'49810','Cynnwyl Elfed Railway','Cynnwyl_Elfed_Railway_thumb.jpg',130, 79,1,'photo_1011524.html');
												thumbnails[1011525] = new thumbnail(1011525,'49810','Cynnwyl Elfed Railway 2','Cynnwyl_Elfed_Railway_2_thumb.jpg',130, 82,1,'photo_1011525.html');
												thumbnails[1011527] = new thumbnail(1011527,'49810','Swansea Dockland Scene','Swansea_Dockland_Scene_thumb.jpg',130, 84,1,'photo_1011527.html');
												thumbnails[1111896] = new thumbnail(1111896,'49810','Cwm Yr Eglwys','Cwm_yr_Eglwys_thumb.jpg',130, 86,1,'photo_1111896.html');
												thumbnails[1275000] = new thumbnail(1275000,'96268','Lifecycle of the Echinacea','Echinacea_Lifecycle_thumb.jpg',130, 63,1,'photo_1275000.html');
												thumbnails[1275008] = new thumbnail(1275008,'49810','Penwyllt Sunrise','Penwyllt_Sunrise_thumb.jpg',130, 84,1,'photo_1275008.html');
												thumbnails[1275009] = new thumbnail(1275009,'96266','River Wye at Chepstow 1','River_Wye_-at_Chepstow_1_thumb.jpg',130, 84,1,'photo_1275009.html');
												thumbnails[1275010] = new thumbnail(1275010,'96266','River Wye at Chepstow 2','River_Wye_at_Chepstow_2_thumb.jpg',130, 83,1,'photo_1275010.html');
												thumbnails[1379129] = new thumbnail(1379129,'49550','Derelict Petrol Station','Derelict_Petrol_Station_thumb.jpg',130, 189,1,'photo_1379129.html');
												thumbnails[1379132] = new thumbnail(1379132,'96268','Leaf Skeleton Black','Leaf_skeleton_black_thumb.jpg',130, 130,1,'photo_1379132.html');
												thumbnails[1379139] = new thumbnail(1379139,'96268','Leaf Skeleton Pair','Leaf_skeleton_pair_thumb.jpg',130, 68,1,'photo_1379139.html');
												thumbnails[1379143] = new thumbnail(1379143,'49810','Maenclochog Pumps Colour','Maenclochog_Pumps_Colour_thumb.jpg',130, 180,1,'photo_1379143.html');
												thumbnails[1379146] = new thumbnail(1379146,'96266','Norwegian Church Cardiff Bay','Norwegian_Church_Cardiff_-B_thumb.jpg',130, 200,1,'photo_1379146.html');
												thumbnails[1379148] = new thumbnail(1379148,'49809','The Tomb Menai Bridge','The_Tomb_Menai_Bridge_thumb.jpg',130, 242,1,'photo_1379148.html');
												thumbnails[1476311] = new thumbnail(1476311,'49493','Araf Slow','Araf_Slow_thumb.jpg',130, 87,1,'photo_1476311.html');
												thumbnails[1735431] = new thumbnail(1735431,'49810','Dinefwr Castle','Dinefwr_Castle_thumb.jpg',130, 87,1,'photo_1735431.html');
												thumbnails[1735438] = new thumbnail(1735438,'49810','Dinefwr Castle 2','Dinefwr_Castle 2_thumb.jpg',130, 194,1,'photo_1735438.html');
												thumbnails[1735444] = new thumbnail(1735444,'49810','Dinefwr Park 2','Dinefwr_Park_2_thumb.jpg',130, 87,1,'photo_1735444.html');
												thumbnails[1735458] = new thumbnail(1735458,'49820','Mother and Child at Home','Mother_and_Child_at_Home_thumb.jpg',130, 87,1,'photo_1735458.html');
												thumbnails[1735524] = new thumbnail(1735524,'49004','Penarth Pier 3','Penarth_Pier_3_thumb.jpg',130, 86,1,'photo_1735524.html');
												thumbnails[1735538] = new thumbnail(1735538,'49004','Penarth Pier 5','Penarth_Pier_5_thumb.jpg',130, 86,1,'photo_1735538.html');
												thumbnails[1752572] = new thumbnail(1752572,'49493','Wellington Bomber XMF 509','Wellington_-XMF509_thumb.jpg',130, 202,1,'photo_1752572.html');
												thumbnails[1752578] = new thumbnail(1752578,'49532','Helvetia Wreck Rhossili','Rhossili_Beach_thumb.jpg',130, 82,1,'photo_1752578.html');
												thumbnails[1752588] = new thumbnail(1752588,'49550','Human Remains 41','Human_Remains_41_thumb.jpg',130, 202,1,'photo_1752588.html');
												thumbnails[1752597] = new thumbnail(1752597,'49810','Urban Space Swansea','Urban_Space_Swansea_1_thumb.jpg',130, 84,1,'photo_1752597.html');
												thumbnails[1752610] = new thumbnail(1752610,'49810','Number 1 Shed','No_1_Shed_Landore_1_1_thumb.jpg',130, 85,1,'photo_1752610.html');
												thumbnails[1752621] = new thumbnail(1752621,'49810','Old Railway Landore','Old_Railway_Landore_1_thumb.jpg',130, 201,1,'photo_1752621.html');
												thumbnails[1752624] = new thumbnail(1752624,'49550','A Different Kind of Strength','A_Different_Kind_Of_Strengt_1_thumb.jpg',130, 82,1,'photo_1752624.html');
												thumbnails[1752629] = new thumbnail(1752629,'49809','Llyn Dinas towards Cnicht','Llyn_Dinas_towards_Cnicht_thumb.jpg',130, 83,1,'photo_1752629.html');
												thumbnails[1752640] = new thumbnail(1752640,'49809','Boathouse Llyn Ogwen','Boathouse_Llyn_Ogwen_1_thumb.jpg',130, 85,1,'photo_1752640.html');
												thumbnails[1752655] = new thumbnail(1752655,'49809','Llyn Cwellyn Storm','Llyn-Cwellyn-Storm_thumb.jpg',130, 83,1,'photo_1752655.html');
												thumbnails[1753710] = new thumbnail(1753710,'49550','Bethesda Chapel Swansea 1','Bethesda_Chapel_Swansea -11_thumb.jpg',130, 216,1,'photo_1753710.html');
												thumbnails[1753715] = new thumbnail(1753715,'49810','Cloudscape Pnotardawe','Cloudscape_Pontardawe_thumb.jpg',130, 76,1,'photo_1753715.html');
												thumbnails[1753717] = new thumbnail(1753717,'49809','Llantisilio Church','Llantisilio_Church_Menai_Br_thumb.jpg',130, 192,1,'photo_1753717.html');
												thumbnails[1753718] = new thumbnail(1753718,'49550','Human Remains 2','Human_Remains_2_thumb.jpg',130, 85,1,'photo_1753718.html');
												thumbnails[1753719] = new thumbnail(1753719,'49810','Clyne Park View','Clyne_Park_View_thumb.jpg',130, 90,1,'photo_1753719.html');
												thumbnails[1753720] = new thumbnail(1753720,'49493','Beacons Sunrise','Beacons_Sunrise_thumb.jpg',130, 83,1,'photo_1753720.html');
												thumbnails[1758200] = new thumbnail(1758200,'49493','Beacons Cloudscape','Beacons_Cloudscape_3_1_thumb.jpg',130, 86,1,'photo_1758200.html');
												thumbnails[1772977] = new thumbnail(1772977,'49532','Whitford Panorama','Whitford_Panorama1_thumb.jpg',130, 41,1,'photo_1772977.html');
												thumbnails[1791218] = new thumbnail(1791218,'49550','Garage Entrance Margam','Garage_Entrance_Margam_thumb.jpg',130, 206,1,'photo_1791218.html');
												thumbnails[1791219] = new thumbnail(1791219,'49809','Glyder Fawr 2','Glyder_Fawr_2_thumb.jpg',130, 196,1,'photo_1791219.html');
												thumbnails[1812093] = new thumbnail(1812093,'121813','Windmill in provence','Windmill_in_Provence_thumb.jpg',130, 85,1,'photo_1812093.html');
												thumbnails[1812095] = new thumbnail(1812095,'121813','Street Scene, Provence','Street_Scene_Provence_thumb.jpg',130, 196,1,'photo_1812095.html');
												thumbnails[1909323] = new thumbnail(1909323,'49810','Amroth 115','DSC_0115 mono_thumb.jpg',130, 87,1,'photo_1909323.html');
												thumbnails[1909325] = new thumbnail(1909325,'49810','Amroth 119','DSC_0119 mono_thumb.jpg',130, 87,1,'photo_1909325.html');
												thumbnails[2162254] = new thumbnail(2162254,'49809','Cwm Idwal Panorama','Cwm Idwal panorama_thumb.jpg',130, 56,1,'photo_2162254.html');
												thumbnails[2162264] = new thumbnail(2162264,'49809','Cwmorthin 11','Cwmorthin 11 split tone_thumb.jpg',130, 87,1,'photo_2162264.html');
												thumbnails[2162267] = new thumbnail(2162267,'49809','Cwmorthin 19','Cwmorthin 19_thumb.jpg',130, 87,1,'photo_2162267.html');
												thumbnails[2162280] = new thumbnail(2162280,'49809','Ogwen Valley panorama','Ogwen Valley  panorama_thumb.jpg',130, 33,1,'photo_2162280.html');
												thumbnails[2162282] = new thumbnail(2162282,'49809','Nant Ffrancon panorama','Nant Ffrancon panorama_thumb.jpg',130, 57,1,'photo_2162282.html');
												thumbnails[2162284] = new thumbnail(2162284,'49809','Pen yr Ole Wen 1','Pen yr Ole Wen 1_thumb.jpg',130, 87,1,'photo_2162284.html');
												thumbnails[2162290] = new thumbnail(2162290,'49809','Pen yr Ole Wen 3','Pen Yr Ole Wen 3_thumb.jpg',130, 87,1,'photo_2162290.html');
												thumbnails[2162513] = new thumbnail(2162513,'49809','Snowdon Horseshoe 2','Snowdon Horseshoe 2_thumb.jpg',130, 87,1,'photo_2162513.html');
												thumbnails[2162514] = new thumbnail(2162514,'49809','Tryfan from Cwm Idwal','Tryfan from Cwm Idwal_thumb.jpg',130, 87,1,'photo_2162514.html');
												thumbnails[2162516] = new thumbnail(2162516,'49809','Tryfan from Cwm Idwal 3','Tryfan from Cwm Idwal 3 _thumb.jpg',130, 87,1,'photo_2162516.html');
												thumbnails[2162517] = new thumbnail(2162517,'49809','Tryfan East Face','Tryfan from the East_thumb.jpg',130, 87,1,'photo_2162517.html');
												thumbnails[2362682] = new thumbnail(2362682,'96268','Leaf Comp 1','Leaf Comp 1_thumb.jpg',130, 130,1,'photo_2362682.html');
												thumbnails[2362684] = new thumbnail(2362684,'96268','Leaf Comp 2','Leaf comp 2_thumb.jpg',130, 130,1,'photo_2362684.html');
												thumbnails[2594915] = new thumbnail(2594915,'49809','Llynnau Cregennen 1','Llynnau Cregennen 1_thumb.jpg',130, 48,1,'photo_2594915.html');
												thumbnails[2594916] = new thumbnail(2594916,'49809','Llynnau Cregennen 2','Llynnau Cregennen 2_thumb.jpg',130, 87,1,'photo_2594916.html');
												thumbnails[2666498] = new thumbnail(2666498,'96268','Lisianthus','Lisianthus_thumb.jpg',130, 194,1,'photo_2666498.html');
												thumbnails[2666501] = new thumbnail(2666501,'96268','Lisianthus 2','Lisianthus 2_thumb.jpg',130, 224,1,'photo_2666501.html');
												thumbnails[2666507] = new thumbnail(2666507,'96268','Lisianthus 3','Lisianthus 3_thumb.jpg',130, 304,1,'photo_2666507.html');
												thumbnails[2666510] = new thumbnail(2666510,'96268','Papyrus 1','Seed Head_thumb.jpg',130, 194,1,'photo_2666510.html');
												thumbnails[2666513] = new thumbnail(2666513,'96268','Papyrus 2','Seed Head 2_thumb.jpg',130, 196,1,'photo_2666513.html');
												thumbnails[2666520] = new thumbnail(2666520,'96268','Sunflower','Sunflower_thumb.jpg',130, 87,1,'photo_2666520.html');
												thumbnails[2717476] = new thumbnail(2717476,'96268','Fern 01','Fern 01_thumb.jpg',130, 206,1,'photo_2717476.html');
												thumbnails[2717520] = new thumbnail(2717520,'96268','Fern 02','Fern 02_thumb.jpg',130, 240,1,'photo_2717520.html');
												thumbnails[2717523] = new thumbnail(2717523,'96268','Fern 05','Fern 05_thumb.jpg',130, 196,1,'photo_2717523.html');
												thumbnails[2719917] = new thumbnail(2719917,'96268','Fern 08','Fern 08_thumb.jpg',130, 198,1,'photo_2719917.html');
												thumbnails[2801784] = new thumbnail(2801784,'49809','Cwmorthin Slate Fence','Cwmorthin Fence_thumb.jpg',130, 79,1,'photo_2801784.html');
												thumbnails[2801785] = new thumbnail(2801785,'96268','Fern 03','Fern 031_thumb.jpg',130, 77,1,'photo_2801785.html');
												thumbnails[3467627] = new thumbnail(3467627,'96268','Fern Design','Fern_Design_thumb.jpg',130, 203,1,'photo_3467627.html');
												thumbnails[3467630] = new thumbnail(3467630,'49004','Dunraven Bay Waterfall','Dunraven_Bay_Waterfall_thumb.jpg',130, 87,1,'photo_3467630.html');
												thumbnails[3467652] = new thumbnail(3467652,'49810','Amroth 1','DSC_0079z mono_thumb.jpg',130, 87,1,'photo_3467652.html');
												thumbnails[3467655] = new thumbnail(3467655,'49810','Amroth 2','DSC_0084x mono_thumb.jpg',130, 85,1,'photo_3467655.html');
												thumbnails[3674845] = new thumbnail(3674845,'49532','Gower Limestone 1','Gower_Limestone_1_thumb.jpg',130, 192,1,'photo_3674845.html');
												thumbnails[3674846] = new thumbnail(3674846,'49532','Gower Limestone 2','Gower_Limestone_2_thumb.jpg',130, 87,1,'photo_3674846.html');
												thumbnails[3674847] = new thumbnail(3674847,'49532','Gower Limestone 3','Gower_Limestone_3_thumb.jpg',130, 194,1,'photo_3674847.html');
												thumbnails[3993103] = new thumbnail(3993103,'49532','Cyclist at Seafront Swansea','Cyclist_at__Seafront_thumb.jpg',130, 201,1,'photo_3993103.html');
												thumbnails[3993545] = new thumbnail(3993545,'49550','Human Remains 3 toned','Human_Remains_3_toned_thumb.jpg',130, 199,1,'photo_3993545.html');
												thumbnails[4122023] = new thumbnail(4122023,'49810','Near Elegug Stacks, Pembrokeshire','Pinnacle_Pembrokeshire_thumb.jpg',130, 197,1,'photo_4122023.html');
												thumbnails[4163637] = new thumbnail(4163637,'248410','Amroth Triptych (3 separate prints)','Trpitych_1_thumb.jpg',130, 95,1,'photo_4163637.html');
												thumbnails[4176595] = new thumbnail(4176595,'248409','Canvas triptych','Wall_Image_2_thumb.jpg',130, 194,1,'photo_4176595.html');
												thumbnails[4176596] = new thumbnail(4176596,'248409','Framed print','Wall_Image_3_thumb.jpg',130, 98,1,'photo_4176596.html');
												thumbnails[4176597] = new thumbnail(4176597,'248409','Canvas print','Wall_Image_4_thumb.jpg',130, 187,1,'photo_4176597.html');
												thumbnails[4176598] = new thumbnail(4176598,'248409','Canvas print','Wall_Image_5_thumb.jpg',130, 94,1,'photo_4176598.html');
												thumbnails[4176600] = new thumbnail(4176600,'248409','Canvas diptych','Wall_Image_6_thumb.jpg',130, 84,1,'photo_4176600.html');
												thumbnails[4176601] = new thumbnail(4176601,'248409','Canvas print','Wall_Image_7_thumb.jpg',130, 102,1,'photo_4176601.html');
												thumbnails[4259024] = new thumbnail(4259024,'251998','Four Bottles Blue','Four_bottles_blue12_thumb.jpg',130, 130,1,'photo_4259024.html');
												thumbnails[4259027] = new thumbnail(4259027,'251998','Four Bottles Green','Four_bottles_green123_thumb.jpg',130, 130,1,'photo_4259027.html');
												thumbnails[4259031] = new thumbnail(4259031,'251998','Four Bottles Omni','Four_bottles_omni123_thumb.jpg',130, 130,1,'photo_4259031.html');
												thumbnails[4274019] = new thumbnail(4274019,'96268','Leaf Green','Leaf_green_thumb.jpg',130, 130,1,'photo_4274019.html');
												thumbnails[4274023] = new thumbnail(4274023,'96268','Leaf Green Three','Leaf_green_three_thumb.jpg',130, 184,1,'photo_4274023.html');
												thumbnails[4295613] = new thumbnail(4295613,'248410','Amroth 2 colour','Flat_Image_thumb.jpg',130, 87,1,'photo_4295613.html');
												thumbnails[4333140] = new thumbnail(4333140,'49550','Petrol Station 1','Petrol_Station_1_toned_thumb.jpg',130, 190,1,'photo_4333140.html');
												thumbnails[4360458] = new thumbnail(4360458,'49810','Paxton\'s Tower','Paxtons_Tower_thumb.jpg',130, 130,1,'photo_4360458.html');
												thumbnails[4360462] = new thumbnail(4360462,'49810','Pinnacle 2 Pembrokeshire','Pinnacle_2_Pembrokeshire_thumb.jpg',130, 83,1,'photo_4360462.html');
												thumbnails[4360467] = new thumbnail(4360467,'49550','Canteen at Landore Works','Canteen_at_Landore_Works_thumb.jpg',130, 85,1,'photo_4360467.html');
												thumbnails[4378141] = new thumbnail(4378141,'49810','Train at Cynnwyl Elfed','Train_at_Cynnwyl_Elfed_thumb.jpg',130, 82,1,'photo_4378141.html');
												thumbnails[4398052] = new thumbnail(4398052,'49550','Old Railway at Landore 2','Old_Railway_at_Landore_2_thumb.jpg',130, 201,1,'photo_4398052.html');
												thumbnails[4514578] = new thumbnail(4514578,'49809','Cwm Idwal 20','Cwm_Idwal_20_thumb.jpg',130, 194,1,'photo_4514578.html');
												thumbnails[6397894] = new thumbnail(6397894,'49810','Cumulo-Nimbus','DSC_0106aaa_thumb.jpg',130, 87,1,'photo_6397894.html');
												thumbnails[6889149] = new thumbnail(6889149,'248410','','Watendlath_Tarn_thumb.jpg',130, 87,1,'photo_6889149.html');
												thumbnails[6889245] = new thumbnail(6889245,'248410','','Grasmere_Morning_colour_thumb.jpg',130, 72,1,'photo_6889245.html');
												thumbnails[6889249] = new thumbnail(6889249,'248410','','Rhosilli_thumb.jpg',130, 87,1,'photo_6889249.html');
												thumbnails[6889251] = new thumbnail(6889251,'248410','','Amroth_7_thumb.jpg',130, 87,1,'photo_6889251.html');
												thumbnails[6889254] = new thumbnail(6889254,'248410','','Llanberis_View_thumb.jpg',130, 87,1,'photo_6889254.html');
												thumbnails[6889257] = new thumbnail(6889257,'248410','','Amroth_8_thumb.jpg',130, 87,1,'photo_6889257.html');
												thumbnails[6894029] = new thumbnail(6894029,'49493','','Cribyn_from_Pen_y_Fan_thumb.jpg',130, 86,1,'photo_6894029.html');
												thumbnails[1758233] = new thumbnail(1758233,'244459','Beetles at Talybont on Usk','Beetles_-Talybont_on_Usk_thumb.jpg',130, 83,1,'photo_1758233.html');
												thumbnails[4107706] = new thumbnail(4107706,'244459','Beetles Talybont on Usk toned','Beetles_-Talybont_on_Usk_toned_thumb.jpg',130, 83,1,'photo_4107706.html');
												thumbnails[3467626] = new thumbnail(3467626,'244459','Talybont Wrecks','Talybont_Wrecks_thumb.jpg',130, 85,1,'photo_3467626.html');
												thumbnails[4107710] = new thumbnail(4107710,'244459','Talybont Wrecks toned','Talybont_Wrecks_toned_thumb.jpg',130, 85,1,'photo_4107710.html');
												thumbnails[1758207] = new thumbnail(1758207,'244459','Beetle at Talybont','Beetle_at_Talybont_1_thumb.jpg',130, 84,1,'photo_1758207.html');
												thumbnails[4174777] = new thumbnail(4174777,'244459','Talybont Beetle 2 toned','Talybont_Beetle_2_toned_thumb.jpg',130, 83,1,'photo_4174777.html');
												thumbnails[4282613] = new thumbnail(4282613,'96268','Agapanthus 11','Agapanthus_11_thumb.jpg',130, 130,1,'photo_4282613.html');
												thumbnails[1735456] = new thumbnail(1735456,'244459','Hillman at Crown Stores','Hillman_at _Crown_Stores_thumb.jpg',130, 90,1,'photo_1735456.html');
												thumbnails[4285067] = new thumbnail(4285067,'244459','Hillman ar Crown Stores toned','Hillman_at_Crown_Stores_toned_thumb.jpg',130, 90,1,'photo_4285067.html');
												thumbnails[4116186] = new thumbnail(4116186,'244459','Beetle and Telegraph Pole toned','Beetle_and_Telegraph_Pole_toned_thumb.jpg',130, 83,1,'photo_4116186.html');
												thumbnails[2874796] = new thumbnail(2874796,'244459','Beetle 104','Beetle_104_thumb.jpg',130, 87,1,'photo_2874796.html');
												thumbnails[1379130] = new thumbnail(1379130,'244459','Fuel Pumps and Shed Talybont','Fuel_Pumps_and_Shed_Talybon_thumb.jpg',130, 199,1,'photo_1379130.html');
												thumbnails[3993104] = new thumbnail(3993104,'244459','Pump 2 at Talybont toned','Pump_2_at__Talybont__toned_thumb.jpg',130, 199,1,'photo_3993104.html');
												thumbnails[730709] = new thumbnail(730709,'244459','Fuel Pump Talybont','Pump_Talybont_thumb.jpg',130, 197,1,'photo_730709.html');
												thumbnails[3993111] = new thumbnail(3993111,'244459','Pump Talybont 2 toned','Pump_Talybont_2_toned_thumb.jpg',130, 197,1,'photo_3993111.html');
												thumbnails[1794980] = new thumbnail(1794980,'244459','Morris Minor 1000','Morris_Minor_1000_thumb.jpg',130, 81,1,'photo_1794980.html');
												thumbnails[4115878] = new thumbnail(4115878,'244459','Talybont Morris Minor toned','Talybont_Morris_Minor_toned_thumb.jpg',130, 81,1,'photo_4115878.html');
												thumbnails[4274015] = new thumbnail(4274015,'96268','Agapanthus 3 Diffuse','Agapanthus_3_diffuse_thumb.jpg',130, 130,1,'photo_4274015.html');
												thumbnails[2874777] = new thumbnail(2874777,'244459','Beetle 101','Beetle_101_thumb.jpg',130, 87,1,'photo_2874777.html');
												thumbnails[2874780] = new thumbnail(2874780,'244459','Beetle 102','Beetle_102_thumb.jpg',130, 87,1,'photo_2874780.html');
												thumbnails[2874800] = new thumbnail(2874800,'244459','Beetle 106','Beetle_106_thumb.jpg',130, 87,1,'photo_2874800.html');
												thumbnails[2874801] = new thumbnail(2874801,'244459','Beetle 107','Beetle_107_thumb.jpg',130, 194,1,'photo_2874801.html');
												thumbnails[4295577] = new thumbnail(4295577,'244459','Beetle 107 toned','DSC_0180aa_thumb.jpg',130, 194,1,'photo_4295577.html');
												thumbnails[2874890] = new thumbnail(2874890,'244459','Beetle 108','Beetle_108_thumb.jpg',130, 194,1,'photo_2874890.html');
												thumbnails[4295579] = new thumbnail(4295579,'244459','Beetle 108 toned','DSC_186aaa_thumb.jpg',130, 194,1,'photo_4295579.html');
												thumbnails[2874794] = new thumbnail(2874794,'244459','Beetle 103','Beetle_103_thumb.jpg',130, 87,1,'photo_2874794.html');
												thumbnails[4274014] = new thumbnail(4274014,'96268','Agapanthus 2 Diffuse','Agapanthus_2_diffuse_thumb.jpg',130, 130,1,'photo_4274014.html');
												thumbnails[1758203] = new thumbnail(1758203,'244459','Beetle and Telegraph Pole','Beetle_and_Telegraph_Pole_1_thumb.jpg',130, 83,1,'photo_1758203.html');
												thumbnails[4274018] = new thumbnail(4274018,'96268','Agapanthus 4','Agapanthus_4_thumb.jpg',130, 194,1,'photo_4274018.html');
												thumbnails[4274012] = new thumbnail(4274012,'96268','Agapanthus 1','Agapanthus_1_thumb.jpg',130, 194,1,'photo_4274012.html');
												thumbnails[1379136] = new thumbnail(1379136,'96268','Leaf Skeleton White','Leaf_skeleton_White_thumb.jpg',130, 130,1,'photo_1379136.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[81560] = new gallery(81560,'','New images gallery','gallery',[],0, 0, '', 'gallery_81560.html',0,0);
				  					galleries[248409] = new gallery(248409,'4176601,4176600,4176598,4176597,4176596,4176595','Images on the Wall','gallery',[4176595,4176596,4176597,4176598,4176600,4176601],0, 0, '', 'gallery_248409.html',0,0);
				  					galleries[49004] = new gallery(49004,'3467630,1735538,1735524,734071,734064,649378,649365','Heritage Coast','gallery',[649365,649378,734064,734071,1735524,1735538,3467630],0, 0, '', 'gallery_49004.html',0,0);
				  					galleries[49493] = new gallery(49493,'6894029,1758200,1753720,1752572,1476311,849258,704888,690140,679074,662983','Brecon Beacons','gallery',[653385,653395,653750,653767,653771,662972,662983,679074,690140,704888,849258,1476311,1752572,1753720,1758200,6894029],0, 0, '', 'gallery_49493.html',0,0);
				  					galleries[49532] = new gallery(49532,'3993103,3674847,3674846,3674845,1772977,1752578,832220,824967,824959,690161','Mumbles and Gower','gallery',[650142,653765,690133,690161,824959,824967,832220,1752578,1772977,3674845,3674846,3674847,3993103],0, 0, '', 'gallery_49532.html',0,0);
				  					galleries[49550] = new gallery(49550,'4398052,4360467,4333140,3993545,1791218,1753718,1753710,1752624,1752588,1379129','Urban Wales','gallery',[653759,653764,654679,654682,654683,662964,730704,1379129,1752588,1752624,1753710,1753718,1791218,3993545,4333140,4360467,4398052],0, 0, '', 'gallery_49550.html',0,0);
				  					galleries[49809] = new gallery(49809,'4514578,2801784,2594916,2594915,2162517,2162516,2162514,2162513,2162290,2162284','Snowdonia','gallery',[653433,653757,653758,653760,653769,662979,690137,690152,695519,745188,824976,824981,1379148,1752629,1752640,1752655,1753717,1791219,2162254,2162264,2162267,2162280,2162282,2162284,2162290,2162513,2162514,2162516,2162517,2594915,2594916,2801784,4514578],0, 0, '', 'gallery_49809.html',0,0);
				  					galleries[49810] = new gallery(49810,'6397894,4378141,4360462,4360458,4122023,3467655,3467652,1909325,1909323,1753719','West Wales','gallery',[653755,653768,653773,654723,654812,662966,662981,694101,730715,745181,745187,824988,1011523,1011524,1011525,1011527,1111896,1275008,1379143,1735431,1735438,1735444,1752597,1752610,1752621,1753715,1753719,1909323,1909325,3467652,3467655,4122023,4360458,4360462,4378141,6397894],0, 0, '', 'gallery_49810.html',0,0);
				  					galleries[49820] = new gallery(49820,'1735458,957352,654680,653754','Mid Wales','gallery',[653754,654680,957352,1735458],0, 0, '', 'gallery_49820.html',0,0);
				  					galleries[96266] = new gallery(96266,'1379146,1275010,1275009','East Wales','gallery',[1275009,1275010,1379146],0, 0, '', 'gallery_96266.html',0,0);
				  					galleries[244459] = new gallery(244459,'4295579,4295577,4285067,4174777,4116186,4115878,4107710,4107706,3993111,3993104','Dead Cars','gallery',[1758233,4107706,3467626,4107710,1758207,4174777,1735456,4285067,4116186,2874796,1379130,3993104,730709,3993111,1794980,4115878,2874777,2874780,2874800,2874801,4295577,2874890,4295579,2874794,1758203],0, 0, '', 'gallery_244459.html',0,0);
				  					galleries[248410] = new gallery(248410,'6889257,6889254,6889251,6889249,6889245,6889149,4295613,4163637','Colour Gallery','gallery',[4163637,4295613,6889149,6889245,6889249,6889251,6889254,6889257],0, 0, '', 'gallery_248410.html',0,0);
				  					galleries[96268] = new gallery(96268,'4282613,4274023,4274019,4274018,4274015,4274014,4274012,3467627,2801785,2719917','Leaves annd Flowers','gallery',[1275000,1379132,1379139,2362682,2362684,2666498,2666501,2666507,2666510,2666513,2666520,2717476,2717520,2717523,2719917,2801785,3467627,4274019,4274023,4282613,4274015,4274014,4274018,4274012,1379136],0, 0, '', 'gallery_96268.html',0,0);
				  					galleries[251998] = new gallery(251998,'4259031,4259027,4259024','Abstract','gallery',[4259024,4259027,4259031],0, 0, '', 'gallery_251998.html',0,0);
				  					galleries[121813] = new gallery(121813,'1812095,1812093','Overseas Images','gallery',[1812093,1812095],0, 0, '', 'gallery_121813.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4398052,4285067,4163637,4107706,4107702,3993545,3993292,3993111,3993104,3993103,3467655,2874796,2666501,2548671,2162516,2162290,2162280,2162268,2162267,2162264,1791218,1753717,1752588,1752578,1476311,1275013,1275008,1275000,957352,824988,824976,730704,662981,653769,653768,653759,653755,650414';
imageSets[3] = '4282613,4274023,4274019,4274018,4274015,4274014,4274012,4259031,4259027,4259024,4176601,4176600,4176598,4176597,4176596,4176595,4174777,4163637,4122023,4116186,4115878,4107710,4107706,4107702,3993545,3993292,3993111,3993104,3993103,3674847,3674846,3467655,3467652,3467630,3467627,3467626,2874890,2874801,2874800';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/HYWEL/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/HYWEL/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 = 'MONOCHROME WALES: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      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 == undefined) {
    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="h.harris30@ntlworld.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="h.harris30@ntlworld.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;
	}
}

			

