window.thumbnails = new Object();
												thumbnails[299483] = new thumbnail(299483,'25337','White anemone','white anemone1_thumb.jpg',130, 133,15,'							photo_299483.html');
												thumbnails[299505] = new thumbnail(299505,'25337','White rose','whiterose7_thumb.jpg',130, 138,15,'							photo_299505.html');
												thumbnails[299506] = new thumbnail(299506,'25337','White heart','whiteheart2_thumb.jpg',130, 145,15,'							photo_299506.html');
												thumbnails[299507] = new thumbnail(299507,'25337','Sycamore','sycamore2_thumb.jpg',130, 86,15,'							photo_299507.html');
												thumbnails[299508] = new thumbnail(299508,'25337','Acer flower','acerflower2_thumb.jpg',130, 143,15,'							photo_299508.html');
												thumbnails[299509] = new thumbnail(299509,'25337','Apple and lichen','appleand lichen2_thumb.jpg',130, 142,15,'							photo_299509.html');
												thumbnails[299510] = new thumbnail(299510,'25337','Honesty','honesty2_thumb.jpg',130, 137,15,'							photo_299510.html');
												thumbnails[299514] = new thumbnail(299514,'25337','white crocuses','crocus_thumb.jpg',130, 98,15,'							photo_299514.html');
												thumbnails[300478] = new thumbnail(300478,'25337','White orchid','white orchid_thumb.jpg',130, 98,15,'							photo_300478.html');
												thumbnails[300479] = new thumbnail(300479,'25337','Wood anemone','wood anemone_thumb.jpg',130, 98,15,'							photo_300479.html');
												thumbnails[302296] = new thumbnail(302296,'26245','Bluebell wood','Bluebell wood 1_thumb.jpg',130, 86,15,'							photo_302296.html');
												thumbnails[304534] = new thumbnail(304534,'26244','Findhorn (1), Moray Coast','Findhorn_a3_thumb.jpg',130, 106,15,'							photo_304534.html');
												thumbnails[304537] = new thumbnail(304537,'26244','Findhorn (2), Moray Coast','Findhorn_c_thumb.jpg',130, 87,15,'							photo_304537.html');
												thumbnails[304538] = new thumbnail(304538,'26244','Findhorn (3), Moray Coast','Findhorn_d1_thumb.jpg',130, 91,15,'							photo_304538.html');
												thumbnails[304548] = new thumbnail(304548,'26244','Speybay (1), Moray Coast','Spey Bay 2_thumb.jpg',130, 96,15,'							photo_304548.html');
												thumbnails[304550] = new thumbnail(304550,'26244','Speybay (2), Moray Coast','Spey Bay 31_thumb.jpg',130, 97,15,'							photo_304550.html');
												thumbnails[304561] = new thumbnail(304561,'26245','Reflected leaves','reflected leaves1_thumb.jpg',130, 103,15,'							photo_304561.html');
												thumbnails[304566] = new thumbnail(304566,'26245','Field gate','field gate_thumb.jpg',130, 94,15,'							photo_304566.html');
												thumbnails[305081] = new thumbnail(305081,'26245','Bluebell bank','Bluebell bank_thumb.jpg',130, 95,15,'							photo_305081.html');
												thumbnails[651163] = new thumbnail(651163,'49627','Snow and gate','snow and gate_thumb.jpg',130, 87,15,'							photo_651163.html');
												thumbnails[651164] = new thumbnail(651164,'49627','Winter sky','winter sky 1_thumb.jpg',130, 82,15,'							photo_651164.html');
												thumbnails[651165] = new thumbnail(651165,'49627','Wind and snow','wind and snow_thumb.jpg',130, 87,15,'							photo_651165.html');
												thumbnails[651166] = new thumbnail(651166,'49627','Shadows','shadows 2_thumb.jpg',130, 160,15,'							photo_651166.html');
												thumbnails[651168] = new thumbnail(651168,'49627','Pond melt','pond melt_thumb.jpg',130, 87,15,'							photo_651168.html');
												thumbnails[651169] = new thumbnail(651169,'49627','Sunset','oyne sunset_thumb.jpg',130, 103,15,'							photo_651169.html');
												thumbnails[651170] = new thumbnail(651170,'49627','Frost and Horses','Oyne horses_thumb.jpg',130, 135,15,'							photo_651170.html');
												thumbnails[651171] = new thumbnail(651171,'49627','Frosty fence','frosty fence_thumb.jpg',130, 168,15,'							photo_651171.html');
												thumbnails[651172] = new thumbnail(651172,'49627','Blackfaces','blackface_thumb.jpg',130, 93,15,'							photo_651172.html');
												thumbnails[651173] = new thumbnail(651173,'49627','Hill snow','Bennachie snow_thumb.jpg',130, 87,15,'							photo_651173.html');
												thumbnails[669256] = new thumbnail(669256,'25337','Blue fly','blue fly_thumb.jpg',130, 150,15,'							photo_669256.html');
												thumbnails[669257] = new thumbnail(669257,'25337','Cornflower','cornflower_thumb.jpg',130, 114,15,'							photo_669257.html');
												thumbnails[669259] = new thumbnail(669259,'25337','Rose Bud','rose pink2_thumb.jpg',130, 93,15,'							photo_669259.html');
												thumbnails[669260] = new thumbnail(669260,'25337','Pink rose','rose pink_thumb.jpg',130, 99,15,'							photo_669260.html');
												thumbnails[669262] = new thumbnail(669262,'25337','Rowan berries','Rowan berries_thumb.jpg',130, 113,15,'							photo_669262.html');
												thumbnails[669263] = new thumbnail(669263,'25337','Sweet peas','sweet peas_thumb.jpg',130, 124,15,'							photo_669263.html');
												thumbnails[669270] = new thumbnail(669270,'49627','Dunnydeer','view west to Dunnydeer_thumb.jpg',130, 60,15,'							photo_669270.html');
												thumbnails[669278] = new thumbnail(669278,'26245','Autumn birch','autumn birch_thumb.jpg',130, 136,15,'							photo_669278.html');
												thumbnails[669279] = new thumbnail(669279,'26245','Trees and bracken','trees and bracken_thumb.jpg',130, 86,15,'							photo_669279.html');
												thumbnails[669282] = new thumbnail(669282,'26245','Woodland path','woody path_thumb.jpg',130, 86,15,'							photo_669282.html');
												thumbnails[669285] = new thumbnail(669285,'26244','Summer Isles (1)','summer isles 1_thumb.jpg',130, 90,15,'							photo_669285.html');
												thumbnails[669288] = new thumbnail(669288,'26244','Summer isles (2)','summer isles_thumb.jpg',130, 108,15,'							photo_669288.html');
												thumbnails[669345] = new thumbnail(669345,'26244','Findhorn (4), Moray Coast','Findhorn_e_thumb.jpg',130, 82,15,'							photo_669345.html');
												thumbnails[669346] = new thumbnail(669346,'26244','Burghead (1), Moray Coast','burghead 1_thumb.jpg',130, 85,15,'							photo_669346.html');
												thumbnails[669347] = new thumbnail(669347,'26244','Burghead (2), Moray Coast','Burghead_2_thumb.jpg',130, 85,15,'							photo_669347.html');
												thumbnails[669380] = new thumbnail(669380,'25337','','mecanopsis1_thumb.jpg',130, 94,15,'							photo_669380.html');
												thumbnails[669383] = new thumbnail(669383,'25337','Mecanopsis','mecanopsis 2_thumb.jpg',130, 134,15,'							photo_669383.html');
												thumbnails[669390] = new thumbnail(669390,'49627','Snow on teasel','snow on teasel_thumb.jpg',130, 166,15,'							photo_669390.html');
												thumbnails[702079] = new thumbnail(702079,'49627','Frost on cow parsley','cow parsley a_thumb.jpg',130, 93,15,'							photo_702079.html');
												thumbnails[702087] = new thumbnail(702087,'49627','frost on leaf','frost on leaf a_thumb.jpg',130, 174,15,'							photo_702087.html');
												thumbnails[702093] = new thumbnail(702093,'49627','Frosted Holly','frosted holly a_thumb.jpg',130, 92,15,'							photo_702093.html');
												thumbnails[702096] = new thumbnail(702096,'49627','Frosted Willow','frosted willow a_thumb.jpg',130, 139,15,'							photo_702096.html');
												thumbnails[702101] = new thumbnail(702101,'49627','Frost on wire','frost on wire a_thumb.jpg',130, 104,15,'							photo_702101.html');
												thumbnails[702104] = new thumbnail(702104,'49627','Frost on Stone','frost on stone a_thumb.jpg',130, 86,15,'							photo_702104.html');
												thumbnails[702117] = new thumbnail(702117,'49627','Frosted seedheads','frosted seedheads a_thumb.jpg',130, 120,15,'							photo_702117.html');
												thumbnails[702119] = new thumbnail(702119,'49627','Frosted Teasel','frosty  teasel a_thumb.jpg',130, 144,15,'							photo_702119.html');
												thumbnails[702122] = new thumbnail(702122,'49627','Frosted oak','frosty oak a_thumb.jpg',130, 177,15,'							photo_702122.html');
												thumbnails[1381343] = new thumbnail(1381343,'25337','Feather and Grass','feather and grass_thumb.jpg',130, 107,15,'							photo_1381343.html');
												thumbnails[1381362] = new thumbnail(1381362,'25337','Foxglove','foxglove1_thumb.jpg',130, 102,15,'							photo_1381362.html');
												thumbnails[1381370] = new thumbnail(1381370,'25337','Heart of Poppy','heart of poppy_thumb.jpg',130, 133,15,'							photo_1381370.html');
												thumbnails[1381375] = new thumbnail(1381375,'26244','Kiltearn 1','Kiltearn_thumb.jpg',130, 86,15,'							photo_1381375.html');
												thumbnails[1381393] = new thumbnail(1381393,'26244','Lossiemouth (1)','Lossiemouth harbour_thumb.jpg',130, 100,15,'							photo_1381393.html');
												thumbnails[1381397] = new thumbnail(1381397,'96363','Moorland Stream','moorland stream_thumb.jpg',130, 86,15,'							photo_1381397.html');
												thumbnails[1381410] = new thumbnail(1381410,'25337','Rose Thorn','rose thorn HDR 2_thumb.jpg',130, 104,15,'							photo_1381410.html');
												thumbnails[1381479] = new thumbnail(1381479,'26244','Lossiemouth (2)','Lossiemouth harbour 21_thumb.jpg',130, 86,15,'							photo_1381479.html');
												thumbnails[1381480] = new thumbnail(1381480,'26245','Larch Light','larch light_thumb.jpg',130, 153,15,'							photo_1381480.html');
												thumbnails[1381482] = new thumbnail(1381482,'26244','Portsoy (3)','Portsoy harbour 3_thumb.jpg',130, 86,15,'							photo_1381482.html');
												thumbnails[1381510] = new thumbnail(1381510,'26244','Kiltearn (2)','resting_thumb.jpg',130, 86,15,'							photo_1381510.html');
												thumbnails[1381512] = new thumbnail(1381512,'26244','Lossiemouth (3)','sand and sky at Lossimouth_thumb.jpg',130, 83,15,'							photo_1381512.html');
												thumbnails[1381515] = new thumbnail(1381515,'96363','White Cottage','white cottage_thumb.jpg',130, 87,15,'							photo_1381515.html');
												thumbnails[1381586] = new thumbnail(1381586,'26245','Oak and Rock','rock and oak1_thumb.jpg',130, 98,15,'							photo_1381586.html');
												thumbnails[1382238] = new thumbnail(1382238,'25337','Butterfly on Lavender','butterfly_thumb.jpg',130, 93,15,'							photo_1382238.html');
												thumbnails[1382243] = new thumbnail(1382243,'25337','Web and Bokeh','web and bokah_thumb.jpg',130, 111,15,'							photo_1382243.html');
												thumbnails[5439738] = new thumbnail(5439738,'212484','cityscape - Paris<br>\r\n','cityscape_thumb.jpg',130, 84,15,'							photo_5439738.html');
												thumbnails[5439742] = new thumbnail(5439742,'212484','Peruzzi - Florence','Perruzi_thumb.jpg',130, 93,15,'							photo_5439742.html');
												thumbnails[5439744] = new thumbnail(5439744,'212484','Ponte','ponte_thumb.jpg',130, 86,15,'							photo_5439744.html');
												thumbnails[5439745] = new thumbnail(5439745,'212484','Street light - Paris','street_light1_thumb.jpg',130, 165,15,'							photo_5439745.html');
												thumbnails[5439749] = new thumbnail(5439749,'308073','She and He','she_and_he_small_1_thumb.jpg',130, 132,15,'							photo_5439749.html');
												thumbnails[5439925] = new thumbnail(5439925,'308073','Bicylist - Paris','paris_1_thumb.jpg',130, 86,15,'							photo_5439925.html');
												thumbnails[5439941] = new thumbnail(5439941,'','She and He','she_and_he_small__thumb.jpg',130, 132,15,'							photo_5439941.html');
												thumbnails[5440188] = new thumbnail(5440188,'308073','Happiness - Paris','happiness_thumb.jpg',130, 112,15,'							photo_5440188.html');
												thumbnails[5440193] = new thumbnail(5440193,'308073','Bird-Play Paris','Paris_bird-play_thumb.jpg',130, 97,15,'							photo_5440193.html');
												thumbnails[5440208] = new thumbnail(5440208,'308073','Lady and Gull - Paris','lady_and_gull123_thumb.jpg',130, 169,15,'							photo_5440208.html');
												thumbnails[5440209] = new thumbnail(5440209,'308073','Living statue - Florence','florence_1_thumb.jpg',130, 103,15,'							photo_5440209.html');
												thumbnails[5440229] = new thumbnail(5440229,'308073','Prego annusate!','Prego_annusate12_thumb.jpg',130, 150,15,'							photo_5440229.html');
												thumbnails[5440366] = new thumbnail(5440366,'308073','Reader - Paris','reader_thumb.jpg',130, 183,15,'							photo_5440366.html');
												thumbnails[5440618] = new thumbnail(5440618,'308073','Market Shade - Florence','shade_thumb.jpg',130, 154,15,'							photo_5440618.html');
												thumbnails[5440622] = new thumbnail(5440622,'308073','Shopping - Paris','shopping_thumb.jpg',130, 195,15,'							photo_5440622.html');
												thumbnails[5440625] = new thumbnail(5440625,'308073','style x2 - Florence','style_x2_thumb.jpg',130, 124,15,'							photo_5440625.html');
												thumbnails[5440627] = new thumbnail(5440627,'308073','waiting - Florence','waiting_thumb.jpg',130, 166,15,'							photo_5440627.html');
												thumbnails[5440665] = new thumbnail(5440665,'308073','Speed - Paris','speed_thumb.jpg',130, 86,15,'							photo_5440665.html');
												thumbnails[5440671] = new thumbnail(5440671,'308078','Backstreet bicycles - Forence','backstreet_bicycles_thumb.jpg',130, 188,15,'							photo_5440671.html');
												thumbnails[5448285] = new thumbnail(5448285,'308059','Advancing Snow','advancing_snow_cloud_thumb.jpg',130, 86,15,'							photo_5448285.html');
												thumbnails[5448288] = new thumbnail(5448288,'308059','','around_sunrise_oyne_thumb.jpg',130, 86,15,'							photo_5448288.html');
												thumbnails[5448291] = new thumbnail(5448291,'308059','Low sun on Bennachie','bennachie_view_thumb.jpg',130, 87,15,'							photo_5448291.html');
												thumbnails[5448292] = new thumbnail(5448292,'308059','Mist and Frost','fog_and_frost_thumb.jpg',130, 64,15,'							photo_5448292.html');
												thumbnails[5448299] = new thumbnail(5448299,'308059','','frost_and_sky_thumb.jpg',130, 86,15,'							photo_5448299.html');
												thumbnails[5448302] = new thumbnail(5448302,'308059','Snow Blue','snow_blue_thumb.jpg',130, 88,15,'							photo_5448302.html');
												thumbnails[5448502] = new thumbnail(5448502,'','','front_page_thumb.jpg',130, 198,15,'							photo_5448502.html');
												thumbnails[5452326] = new thumbnail(5452326,'308073','Citrus shade - Granada','_DSC0321-Edit-Edit_thumb.jpg',130, 126,15,'							photo_5452326.html');
												thumbnails[5452329] = new thumbnail(5452329,'308078','Baltic centre - Gateshead','Baltic_Centre__and_Milennium_bridge_thumb.jpg',130, 158,15,'							photo_5452329.html');
												thumbnails[5452331] = new thumbnail(5452331,'308078','\'Flour Mills\'','Flour_Mills_thumb.jpg',130, 98,15,'							photo_5452331.html');
												thumbnails[5452333] = new thumbnail(5452333,'308078','View from Baltic centre','from_the_Baltic_centre_thumb.jpg',130, 154,15,'							photo_5452333.html');
												thumbnails[5452338] = new thumbnail(5452338,'308073','\"I agree, but...\" - Granada','I_agree_but_-_Granada_thumb.jpg',130, 168,15,'							photo_5452338.html');
												thumbnails[5452415] = new thumbnail(5452415,'308355','Foothold','foothold_thumb.jpg',130, 155,15,'							photo_5452415.html');
												thumbnails[5452417] = new thumbnail(5452417,'308355','Linn of Dee 1','Linn_of_dee_2_thumb.jpg',130, 197,15,'							photo_5452417.html');
												thumbnails[5452418] = new thumbnail(5452418,'308355','Linn of Dee 2','Linn_of_dee_4_thumb.jpg',130, 86,15,'							photo_5452418.html');
												thumbnails[5452421] = new thumbnail(5452421,'308355','Linn of Dee 3','linn_of_dee_thumb.jpg',130, 87,15,'							photo_5452421.html');
												thumbnails[5452424] = new thumbnail(5452424,'308355','Repeated themes','repeats_thumb.jpg',130, 86,15,'							photo_5452424.html');
												thumbnails[5452425] = new thumbnail(5452425,'308355','Rock, sand and river','rock_sand_and_water_thumb.jpg',130, 86,15,'							photo_5452425.html');
												thumbnails[5452431] = new thumbnail(5452431,'308355','Tree shadow','tree_shadow_thumb.jpg',130, 129,15,'							photo_5452431.html');
												thumbnails[5452434] = new thumbnail(5452434,'49627','Pond in winter 1','winter_pond_2_thumb.jpg',130, 195,15,'							photo_5452434.html');
												thumbnails[5452435] = new thumbnail(5452435,'49627','Pond in winter 2','winter_pond_3_thumb.jpg',130, 179,15,'							photo_5452435.html');
												thumbnails[5452437] = new thumbnail(5452437,'49627','Pond in Winter 3','winter_pond_4_thumb.jpg',130, 156,15,'							photo_5452437.html');
												thumbnails[5452439] = new thumbnail(5452439,'49627','Pond in Winter 4','winter_pond_thumb.jpg',130, 87,15,'							photo_5452439.html');
												thumbnails[5452486] = new thumbnail(5452486,'308361','Closed door','closed_door_thumb.jpg',130, 149,15,'							photo_5452486.html');
												thumbnails[5452487] = new thumbnail(5452487,'308361','Dunstanburgh - Northumberland','Dunstanburgh_thumb.jpg',130, 86,15,'							photo_5452487.html');
												thumbnails[5452488] = new thumbnail(5452488,'25337','Teasel and web','teasel_and_web1_thumb.jpg',130, 112,15,'							photo_5452488.html');
												thumbnails[5452694] = new thumbnail(5452694,'308059','Around sunset','around_sunset_oyne_thumb.jpg',130, 87,15,'							photo_5452694.html');
												thumbnails[5908008] = new thumbnail(5908008,'333450','Carnival conversation','CPTPK8569_thumb.jpg',130, 130,15,'							photo_5908008.html');
												thumbnails[5908014] = new thumbnail(5908014,'333450','Blue dress','CPTPK7445_thumb.jpg',130, 169,15,'							photo_5908014.html');
												thumbnails[5908017] = new thumbnail(5908017,'333450',' carnival, blue','CPTPK7798_thumb.jpg',130, 185,15,'							photo_5908017.html');
												thumbnails[5908018] = new thumbnail(5908018,'333450','Carnival costume (2)','CPTPK0349_thumb.jpg',130, 188,15,'							photo_5908018.html');
												thumbnails[5908881] = new thumbnail(5908881,'333450','Carnival black','CATPK3697_thumb.jpg',130, 190,15,'							photo_5908881.html');
												thumbnails[5908887] = new thumbnail(5908887,'333450','Procession performer','CATPK7511a_thumb.jpg',130, 155,15,'							photo_5908887.html');
												thumbnails[5908890] = new thumbnail(5908890,'333450','Carnival costumes (1)','CA7881_thumb.jpg',130, 142,15,'							photo_5908890.html');
												thumbnails[5908893] = new thumbnail(5908893,'333450','Carnival costumes (3)','CA7824_thumb.jpg',130, 141,15,'							photo_5908893.html');
												thumbnails[5908898] = new thumbnail(5908898,'333450','Carnival costume (4)','CATPK2714b_thumb.jpg',130, 147,15,'							photo_5908898.html');
												thumbnails[5908899] = new thumbnail(5908899,'333450','Carnival costume (5)','CATPK6658b_thumb.jpg',130, 134,15,'							photo_5908899.html');
												thumbnails[5908900] = new thumbnail(5908900,'333450','Carnival costumes (6)','CATPK8485_thumb.jpg',130, 166,15,'							photo_5908900.html');
												thumbnails[5908904] = new thumbnail(5908904,'333450','Carnival costume (8)','CATPK8594d_thumb.jpg',130, 155,15,'							photo_5908904.html');
												thumbnails[5908906] = new thumbnail(5908906,'333450','Carnival costumes (9)','CPTPK8518w_thumb.jpg',130, 166,15,'							photo_5908906.html');
												thumbnails[5908909] = new thumbnail(5908909,'333450','Carnival costume (10)','CPTPK1889_thumb.jpg',130, 172,15,'							photo_5908909.html');
												thumbnails[5908988] = new thumbnail(5908988,'333450','Carnival costumes','CA7651_thumb.jpg',130, 99,15,'							photo_5908988.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  	  					galleries[308361] = new gallery(308361,'5452487,5452486','Aged forms','gallery',[5452486,5452487],0, 0, '', '																																																																																																							gallery_308361.html',0,0);
				  	  					galleries[212484] = new gallery(212484,'5439744','At night','gallery',[5439738,5439742,5439744,5439745],0, 0, '307606', '																																																																																																							gallery_212484.html',0,0);
				  	  					galleries[25337] = new gallery(25337,'5452488,1382243,1381370,1381362,669263,669259,669257,299510,299483','Closer','gallery',[299483,299505,299506,299507,299508,299509,299510,299514,300478,300479,669256,669257,669259,669260,669262,669263,669380,669383,1381343,1381362,1381370,1381410,1382238,1382243,5452488],0, 0, '308365', '																																																																																																							gallery_25337.html',0,0);
				  	  					galleries[26244] = new gallery(26244,'669288','Coastal','gallery',[304534,304537,304538,304548,304550,669285,669288,669345,669346,669347,1381375,1381393,1381479,1381482,1381510,1381512],0, 0, '308356', '																																																																																																							gallery_26244.html',0,0);
				  	  					galleries[308355] = new gallery(308355,'5452424,5452418,5452417','Freshwater','gallery',[5452415,5452417,5452418,5452421,5452424,5452425,5452431],0, 0, '308356', '																																																																																																							gallery_308355.html',0,0);
				  	  					galleries[96363] = new gallery(96363,'1381397','Hills and Moorland','gallery',[1381397,1381515],0, 0, '308356', '																																																																																																							gallery_96363.html',0,0);
				  	  					galleries[308059] = new gallery(308059,'5452694,5448302,5448299,5448291,5448288,5448285','Home Sky','gallery',[5448285,5448288,5448291,5448292,5448299,5448302,5452694],0, 0, '', '																																																																																																							gallery_308059.html',0,0);
				  	  					galleries[308356] = new gallery(308356,'5452437,5452424,5452418,5452417,1381397,702093,702079,669288,651173,651169','Land and water forms','gallery',[],0, 0, '', '																																																																																																							gallery_308356.html',0,0);
				  	  					galleries[308365] = new gallery(308365,'5452488,1382243,1381586,1381370,1381362,669263,669259,669257,305081,299510,299483','Life forms','gallery',[],0, 0, '', '																																																																																																							gallery_308365.html',0,0);
				  	  					galleries[308073] = new gallery(308073,'5452338,5452326,5440665,5440627,5440625,5440622,5440618,5440366,5440229,5440209','People','gallery',[5439749,5439925,5440188,5440193,5440208,5440209,5440229,5440366,5440618,5440622,5440625,5440627,5440665,5452326,5452338],0, 0, '307606', '																																																																																																							gallery_308073.html',0,0);
				  	  					galleries[308078] = new gallery(308078,'5452333,5452331,5452329,5440671','Places','gallery',[5440671,5452329,5452331,5452333],0, 0, '307606', '																																																																																																							gallery_308078.html',0,0);
				  	  					galleries[49627] = new gallery(49627,'5452437,702093,702079,651173,651169','Snow and Ice','gallery',[651163,651164,651165,651166,651168,651169,651170,651171,651172,651173,669270,669390,702079,702087,702093,702096,702101,702104,702117,702119,702122,5452434,5452435,5452437,5452439],0, 0, '308356', '																																																																																																							gallery_49627.html',0,0);
				  	  					galleries[307606] = new gallery(307606,'5439744','Town and City','gallery',[],0, 0, '', '																																																																																																							gallery_307606.html',0,0);
				  	  					galleries[333450] = new gallery(333450,'5908988,5908909,5908906,5908904,5908900,5908899,5908898,5908893,5908890,5908887','Venice - Carnival','gallery',[5908008,5908014,5908017,5908018,5908881,5908887,5908890,5908893,5908898,5908899,5908900,5908904,5908906,5908909,5908988],0, 0, '307606', '																																																																																																							gallery_333450.html',0,0);
				  	  					galleries[26245] = new gallery(26245,'1381586,305081','Woodland','gallery',[302296,304561,304566,305081,669278,669279,669282,1381480,1381586],0, 0, '308365', '																																																																																																							gallery_26245.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5439941';
imageSets[2] = '5452694,5452488,5452437,5452424,5452418,5452417,5448302,5448299,5448291,5448288,5448285,5439744,1382243,1381586,1381397,1381370,1381362,702093,702079,669288,669263,669259,669257,651173,651169,305081,299510,299483';
imageSets[3] = '5452488,1382243,1381343,702101,702079,651173';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/DimTim/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/DimTim/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/DimTim/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/DimTim/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/DimTim/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/DimTim/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));		}, 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 = 'Tim King - 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));    }        
    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>';
	}
					
				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>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (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 + '<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;
	}
}

			

