window.thumbnails = new Object();
												thumbnails[18518] = new thumbnail(18518,'','Dead tree.','tree-2_thumb.jpg',130, 87,18,'#');
												thumbnails[1068296] = new thumbnail(1068296,'','','London_Eye_thumb.jpg',130, 89,18,'#');
												thumbnails[1068299] = new thumbnail(1068299,'','','SS_Kilmartin_1_thumb.jpg',130, 87,18,'#');
												thumbnails[1068302] = new thumbnail(1068302,'','','Scot_Flag_thumb.jpg',130, 87,18,'#');
												thumbnails[1071235] = new thumbnail(1071235,'','','dead_seal_thumb.jpg',130, 85,18,'#');
												thumbnails[18405] = new thumbnail(18405,'2247','Salmon smolt','Smolt-Head_thumb.jpg',130, 85,18,'photo_18405.html');
												thumbnails[18406] = new thumbnail(18406,'2247','Hatchery','PER-1_thumb.jpg',130, 86,18,'photo_18406.html');
												thumbnails[18410] = new thumbnail(18410,'2247','Fish farm worker and boat.','ally&boat_thumb.jpg',130, 85,18,'photo_18410.html');
												thumbnails[18411] = new thumbnail(18411,'2247','Process worker and salmon.','shona_thumb.jpg',130, 87,18,'photo_18411.html');
												thumbnails[18412] = new thumbnail(18412,'2247','Turbot larvae ','turbot-larvae-feeding_thumb.jpg',130, 91,18,'photo_18412.html');
												thumbnails[18413] = new thumbnail(18413,'2248','Auracarian trees','Auracano_thumb.jpg',130, 86,18,'photo_18413.html');
												thumbnails[18416] = new thumbnail(18416,'2249','Ray','ray-2_thumb.jpg',130, 87,18,'photo_18416.html');
												thumbnails[18417] = new thumbnail(18417,'2248','Standing stone','stan-stone-shet_thumb.jpg',130, 86,18,'photo_18417.html');
												thumbnails[18420] = new thumbnail(18420,'2248','Young tree & volcano','tenacity_thumb.jpg',130, 87,18,'photo_18420.html');
												thumbnails[18421] = new thumbnail(18421,'2249','Red deer','yvonne-18_thumb.jpg',130, 86,18,'photo_18421.html');
												thumbnails[18426] = new thumbnail(18426,'2251','Downhill mountain biker in action. (1)','action-1_thumb.jpg',130, 87,18,'photo_18426.html');
												thumbnails[18427] = new thumbnail(18427,'2251','','action-2_thumb.jpg',130, 87,18,'photo_18427.html');
												thumbnails[18428] = new thumbnail(18428,'2252','Hannah','facecomp-hannah_thumb.jpg',130, 87,18,'photo_18428.html');
												thumbnails[18429] = new thumbnail(18429,'2254','Fish farm worker in boat.','ally&boat1_thumb.jpg',130, 85,18,'photo_18429.html');
												thumbnails[18510] = new thumbnail(18510,'2250','Human genome project','Nowgen-HGP_thumb.jpg',130, 87,18,'photo_18510.html');
												thumbnails[18519] = new thumbnail(18519,'2250','Gull mess.','car-gulls-mess_thumb.jpg',130, 87,18,'photo_18519.html');
												thumbnails[18520] = new thumbnail(18520,'2249','Poplar trees','poplars_thumb.jpg',130, 87,18,'photo_18520.html');
												thumbnails[18521] = new thumbnail(18521,'2249','Polar trees ','poplars-2_thumb.jpg',130, 86,18,'photo_18521.html');
												thumbnails[18522] = new thumbnail(18522,'2250','Single track.','DSCF3846_thumb.jpg',130, 87,18,'photo_18522.html');
												thumbnails[18606] = new thumbnail(18606,'2254','Hauling nets.','3_thumb.jpg',130, 86,18,'photo_18606.html');
												thumbnails[18607] = new thumbnail(18607,'2254','Salmon in harvest bin.','4_thumb.jpg',130, 85,18,'photo_18607.html');
												thumbnails[18609] = new thumbnail(18609,'2254','Waiting for fish.','sticks_thumb.jpg',130, 86,18,'photo_18609.html');
												thumbnails[18610] = new thumbnail(18610,'2254','The harvest.','table_thumb.jpg',130, 86,18,'photo_18610.html');
												thumbnails[18612] = new thumbnail(18612,'2250','Wind.','windsock_thumb.jpg',130, 88,18,'photo_18612.html');
												thumbnails[18613] = new thumbnail(18613,'2250','Snow.','weather-1_thumb.jpg',130, 86,18,'photo_18613.html');
												thumbnails[18614] = new thumbnail(18614,'2250','Pears','pears-2_thumb.jpg',130, 95,18,'photo_18614.html');
												thumbnails[18620] = new thumbnail(18620,'2247','Bagging farmed mussels.','arrival1_thumb.jpg',130, 86,18,'photo_18620.html');
												thumbnails[18621] = new thumbnail(18621,'2247','Bagging shellfish.','bagging1_thumb.jpg',130, 86,18,'photo_18621.html');
												thumbnails[18622] = new thumbnail(18622,'2247','Freshwater cage site.','chapofeeding1_thumb.jpg',130, 88,18,'photo_18622.html');
												thumbnails[18623] = new thumbnail(18623,'2247','Salmon steaks','SASTEAK6_thumb.jpg',130, 94,18,'photo_18623.html');
												thumbnails[18626] = new thumbnail(18626,'2254','Vaccinating fish.','comp-3_thumb.jpg',130, 85,18,'photo_18626.html');
												thumbnails[18632] = new thumbnail(18632,'2248','Mountain at night','admiral-night-colour_thumb.jpg',130, 85,18,'photo_18632.html');
												thumbnails[18634] = new thumbnail(18634,'2250','Bannana leaf','bannanaleaf-2_thumb.jpg',130, 87,18,'photo_18634.html');
												thumbnails[18635] = new thumbnail(18635,'2250','Nuts','dh1_thumb.jpg',130, 87,18,'photo_18635.html');
												thumbnails[18707] = new thumbnail(18707,'2247','Farmed abalone','abalone-adult_thumb.jpg',130, 88,18,'photo_18707.html');
												thumbnails[18708] = new thumbnail(18708,'2247','Genetic unit','PER-101_thumb.jpg',130, 85,18,'photo_18708.html');
												thumbnails[19196] = new thumbnail(19196,'2252','','alison-snorkel_thumb.jpg',130, 85,18,'photo_19196.html');
												thumbnails[19197] = new thumbnail(19197,'2252','','alex-2_thumb.jpg',130, 87,18,'photo_19197.html');
												thumbnails[19198] = new thumbnail(19198,'2248','Cuernos at night','cuernos&stars-1_thumb.jpg',130, 86,18,'photo_19198.html');
												thumbnails[19199] = new thumbnail(19199,'2247','Atlantic salmon parr','DSCF2136_thumb.jpg',130, 87,18,'photo_19199.html');
												thumbnails[19200] = new thumbnail(19200,'2247','Processing worker & fish','DSCF2400_thumb.jpg',130, 87,18,'photo_19200.html');
												thumbnails[19202] = new thumbnail(19202,'2247','X-ray of salmon spines','DSCF2855_thumb.jpg',130, 87,18,'photo_19202.html');
												thumbnails[19203] = new thumbnail(19203,'2247','Filleting salmon','shonacolour_thumb.jpg',130, 87,18,'photo_19203.html');
												thumbnails[19233] = new thumbnail(19233,'2247','Spawning atlantic salmon','DSCF2565_thumb.jpg',130, 87,18,'photo_19233.html');
												thumbnails[19236] = new thumbnail(19236,'2252','','face-comp-alison_thumb.jpg',130, 87,18,'photo_19236.html');
												thumbnails[19239] = new thumbnail(19239,'2247','Checking fillet colour','filletcolour_thumb.jpg',130, 88,18,'photo_19239.html');
												thumbnails[19241] = new thumbnail(19241,'2247','Fish farm worker and salmon','forbruce_thumb.jpg',130, 89,18,'photo_19241.html');
												thumbnails[19297] = new thumbnail(19297,'2247','Smoked salmon','smoked-salmon-jpeg_thumb.jpg',130, 85,18,'photo_19297.html');
												thumbnails[19300] = new thumbnail(19300,'2250','Horizon','KIF_0039_thumb.jpg',130, 98,18,'photo_19300.html');
												thumbnails[19408] = new thumbnail(19408,'2252','','a-1_thumb.jpg',130, 86,18,'photo_19408.html');
												thumbnails[19409] = new thumbnail(19409,'2252','','andydive-2_thumb.jpg',130, 85,18,'photo_19409.html');
												thumbnails[19410] = new thumbnail(19410,'2251','','ard_thumb.jpg',130, 85,18,'photo_19410.html');
												thumbnails[19411] = new thumbnail(19411,'2254','','comp-42_thumb.jpg',130, 85,18,'photo_19411.html');
												thumbnails[19413] = new thumbnail(19413,'2252','','DSCF0092_thumb.jpg',130, 87,18,'photo_19413.html');
												thumbnails[19414] = new thumbnail(19414,'2252','','DSCF1295_thumb.jpg',130, 87,18,'photo_19414.html');
												thumbnails[19415] = new thumbnail(19415,'2252','','DSCF1458_thumb.jpg',130, 87,18,'photo_19415.html');
												thumbnails[19417] = new thumbnail(19417,'2249','Shoal of fish','mal-8_thumb.jpg',130, 86,18,'photo_19417.html');
												thumbnails[19543] = new thumbnail(19543,'2252','','3roasters_thumb.jpg',130, 89,18,'photo_19543.html');
												thumbnails[19545] = new thumbnail(19545,'2247','Freshwater cage.','chapofeeding2_thumb.jpg',130, 86,18,'photo_19545.html');
												thumbnails[19547] = new thumbnail(19547,'2254','','comp-41_thumb.jpg',130, 85,18,'photo_19547.html');
												thumbnails[19548] = new thumbnail(19548,'2252','','DSCF0171_thumb.jpg',130, 87,18,'photo_19548.html');
												thumbnails[19549] = new thumbnail(19549,'2248','Faroes town','DSCF0398_thumb.jpg',130, 87,18,'photo_19549.html');
												thumbnails[19550] = new thumbnail(19550,'2252','','DSCF0697_thumb.jpg',130, 87,18,'photo_19550.html');
												thumbnails[19551] = new thumbnail(19551,'2251','','DSCF0770_thumb.jpg',130, 87,18,'photo_19551.html');
												thumbnails[19552] = new thumbnail(19552,'2251','','DSCF0772_thumb.jpg',130, 87,18,'photo_19552.html');
												thumbnails[19553] = new thumbnail(19553,'2252','','DSCF1260_thumb.jpg',130, 87,18,'photo_19553.html');
												thumbnails[19554] = new thumbnail(19554,'2251','','felipe&freddy_thumb.jpg',130, 87,18,'photo_19554.html');
												thumbnails[19556] = new thumbnail(19556,'2251','','Jan-BBC_thumb.jpg',130, 85,18,'photo_19556.html');
												thumbnails[19558] = new thumbnail(19558,'2252','','sarah-2_thumb.jpg',130, 86,18,'photo_19558.html');
												thumbnails[19559] = new thumbnail(19559,'2248','Lone sheep','sheepwood-frame_thumb.jpg',130, 86,18,'photo_19559.html');
												thumbnails[19560] = new thumbnail(19560,'2252','','steve_thumb.jpg',130, 104,18,'photo_19560.html');
												thumbnails[19561] = new thumbnail(19561,'2247','Turbot','turbot&petri_thumb.jpg',130, 85,18,'photo_19561.html');
												thumbnails[19562] = new thumbnail(19562,'2247','Smolt transport','Untitled-1_thumb.jpg',130, 85,18,'photo_19562.html');
												thumbnails[19563] = new thumbnail(19563,'2252','','wasso_thumb.jpg',130, 89,18,'photo_19563.html');
												thumbnails[19564] = new thumbnail(19564,'2252','','wassos_thumb.jpg',130, 88,18,'photo_19564.html');
												thumbnails[19566] = new thumbnail(19566,'2247','Seafood products','working_thumb.jpg',130, 90,18,'photo_19566.html');
												thumbnails[19567] = new thumbnail(19567,'2247','Helicopter transport','Untitled-21_thumb.jpg',130, 85,18,'photo_19567.html');
												thumbnails[19770] = new thumbnail(19770,'2247','Gutting line','gutting8_thumb.jpg',130, 85,18,'photo_19770.html');
												thumbnails[19771] = new thumbnail(19771,'2249','Hooded crows feeding','hoodies&salmon_thumb.jpg',130, 86,18,'photo_19771.html');
												thumbnails[19779] = new thumbnail(19779,'2250','Cuttlefish bone','cuttlefish-21_thumb.jpg',130, 87,18,'photo_19779.html');
												thumbnails[19780] = new thumbnail(19780,'2251','The spider','spider1_thumb.jpg',130, 85,18,'photo_19780.html');
												thumbnails[19781] = new thumbnail(19781,'2250','Star trails','star-trails-11_thumb.jpg',130, 86,18,'photo_19781.html');
												thumbnails[19783] = new thumbnail(19783,'2249','Toads mating','toads_thumb.jpg',130, 83,18,'photo_19783.html');
												thumbnails[24213] = new thumbnail(24213,'2254','','diver_thumb.jpg',130, 86,18,'photo_24213.html');
												thumbnails[24215] = new thumbnail(24215,'2254','','Untitled-3_thumb.jpg',130, 86,18,'photo_24215.html');
												thumbnails[24430] = new thumbnail(24430,'2254','','otherdier1_thumb.jpg',130, 86,18,'photo_24430.html');
												thumbnails[24432] = new thumbnail(24432,'2254','','Untitled-6_thumb.jpg',130, 86,18,'photo_24432.html');
												thumbnails[24434] = new thumbnail(24434,'2254','','Untitled-9_thumb.jpg',130, 86,18,'photo_24434.html');
												thumbnails[24436] = new thumbnail(24436,'2254','','Untitled-15_thumb.jpg',130, 88,18,'photo_24436.html');
												thumbnails[26668] = new thumbnail(26668,'2254','','scallop-41_thumb.jpg',130, 85,18,'photo_26668.html');
												thumbnails[26670] = new thumbnail(26670,'2254','','Untitled-5_thumb.jpg',130, 86,18,'photo_26670.html');
												thumbnails[26673] = new thumbnail(26673,'2254','','Untitled-111_thumb.jpg',130, 84,18,'photo_26673.html');
												thumbnails[26674] = new thumbnail(26674,'2254','','Untitled-71_thumb.jpg',130, 86,18,'photo_26674.html');
												thumbnails[29024] = new thumbnail(29024,'2249','Otter underwater','otter-tiff_thumb.jpg',130, 87,18,'photo_29024.html');
												thumbnails[36431] = new thumbnail(36431,'3854','Faslane/G8','DSCF4803-test_thumb.jpg',130, 86,18,'photo_36431.html');
												thumbnails[36434] = new thumbnail(36434,'3854','Gleneagles/G8','DSCF4882_thumb.jpg',130, 86,18,'photo_36434.html');
												thumbnails[36438] = new thumbnail(36438,'3854','Faslane/G8','Peacefull at Faslane_thumb.jpg',130, 86,18,'photo_36438.html');
												thumbnails[36440] = new thumbnail(36440,'3854','Gleneagles/G8','Peacefull at Gleneagles_thumb.jpg',130, 87,18,'photo_36440.html');
												thumbnails[44086] = new thumbnail(44086,'3854','','DSCF4919_thumb.jpg',130, 87,18,'photo_44086.html');
												thumbnails[44087] = new thumbnail(44087,'3854','','DSCF4921_thumb.jpg',130, 87,18,'photo_44087.html');
												thumbnails[83593] = new thumbnail(83593,'2247','Ongrowers feeding.','Maria-2_thumb.jpg',130, 87,18,'photo_83593.html');
												thumbnails[132582] = new thumbnail(132582,'2247','','bluealevins_thumb.jpg',130, 86,18,'photo_132582.html');
												thumbnails[132586] = new thumbnail(132586,'2250','','lichens_thumb.jpg',130, 86,18,'photo_132586.html');
												thumbnails[132590] = new thumbnail(132590,'2247','','paul_thumb.jpg',130, 86,18,'photo_132590.html');
												thumbnails[132597] = new thumbnail(132597,'2247','','smoltinhand_thumb.jpg',130, 86,18,'photo_132597.html');
												thumbnails[132601] = new thumbnail(132601,'3854','','tonyblair_thumb.jpg',130, 87,18,'photo_132601.html');
												thumbnails[238590] = new thumbnail(238590,'2252','','600_thumb.jpg',130, 87,18,'photo_238590.html');
												thumbnails[1071116] = new thumbnail(1071116,'3854','','Faslane_Girl_thumb.jpg',130, 87,18,'photo_1071116.html');
												thumbnails[1669328] = new thumbnail(1669328,'2249','','guanaco_cueros2_thumb.jpg',130, 87,18,'photo_1669328.html');
												thumbnails[1669329] = new thumbnail(1669329,'2251','','bingbong2_thumb.jpg',130, 87,18,'photo_1669329.html');
												thumbnails[1669347] = new thumbnail(1669347,'2249','','fish_sand2_thumb.jpg',130, 87,18,'photo_1669347.html');
												thumbnails[1669349] = new thumbnail(1669349,'2248','','glacier2_thumb.jpg',130, 87,18,'photo_1669349.html');
												thumbnails[1669357] = new thumbnail(1669357,'2250','','h2o2_thumb.jpg',130, 87,18,'photo_1669357.html');
												thumbnails[1669358] = new thumbnail(1669358,'2248','','icecave2_thumb.jpg',130, 87,18,'photo_1669358.html');
												thumbnails[1669361] = new thumbnail(1669361,'2249','','lizard2_thumb.jpg',130, 87,18,'photo_1669361.html');
												thumbnails[1669364] = new thumbnail(1669364,'2249','','nalca2_thumb.jpg',130, 87,18,'photo_1669364.html');
												thumbnails[1669367] = new thumbnail(1669367,'2248','','Osorno_evening2_thumb.jpg',130, 87,18,'photo_1669367.html');
												thumbnails[1669369] = new thumbnail(1669369,'2248','','osorno_night2_thumb.jpg',130, 87,18,'photo_1669369.html');
												thumbnails[1669371] = new thumbnail(1669371,'2249','','starlings_salmon2_thumb.jpg',130, 87,18,'photo_1669371.html');
												thumbnails[1669373] = new thumbnail(1669373,'2248','','unst_stone2_thumb.jpg',130, 87,18,'photo_1669373.html');
												thumbnails[1669414] = new thumbnail(1669414,'2251','','bikeshadow_thumb.jpg',130, 87,18,'photo_1669414.html');
												thumbnails[1669415] = new thumbnail(1669415,'2247','','Duggie_Strome_7_thumb.jpg',130, 87,18,'photo_1669415.html');
												thumbnails[1669417] = new thumbnail(1669417,'2254','','owen_thumb.jpg',130, 87,18,'photo_1669417.html');
												thumbnails[1669418] = new thumbnail(1669418,'2252','','Steve_Col_thumb.jpg',130, 87,18,'photo_1669418.html');
												thumbnails[1669419] = new thumbnail(1669419,'2250','','thermometer_thumb.jpg',130, 87,18,'photo_1669419.html');
												thumbnails[1691434] = new thumbnail(1691434,'2247','','DSCF5820_500_thumb.jpg',130, 87,18,'photo_1691434.html');
												thumbnails[1697514] = new thumbnail(1697514,'114188','','_DSC1271_thumb.jpg',130, 87,18,'photo_1697514.html');
												thumbnails[1697518] = new thumbnail(1697518,'114188','','_DSC1351_thumb.jpg',130, 87,18,'photo_1697518.html');
												thumbnails[1703376] = new thumbnail(1703376,'114188','','_DSC1519_thumb.jpg',130, 87,18,'photo_1703376.html');
												thumbnails[1728089] = new thumbnail(1728089,'2252','','alan_CP_thumb.jpg',130, 87,18,'photo_1728089.html');
												thumbnails[1728090] = new thumbnail(1728090,'2252','','davey_CP_thumb.jpg',130, 87,18,'photo_1728090.html');
												thumbnails[1804009] = new thumbnail(1804009,'2251','','trees_thumb.jpg',130, 87,18,'photo_1804009.html');
												thumbnails[1804029] = new thumbnail(1804029,'2247','','aird_thumb.jpg',130, 87,18,'photo_1804029.html');
												thumbnails[1804030] = new thumbnail(1804030,'2254','','ally_thumb.jpg',130, 87,18,'photo_1804030.html');
												thumbnails[1804031] = new thumbnail(1804031,'2247','','bluealevins_1_thumb.jpg',130, 87,18,'photo_1804031.html');
												thumbnails[1804032] = new thumbnail(1804032,'2247','','chapo_cages_thumb.jpg',130, 87,18,'photo_1804032.html');
												thumbnails[1804033] = new thumbnail(1804033,'2254','','davey_thumb.jpg',130, 87,18,'photo_1804033.html');
												thumbnails[1804034] = new thumbnail(1804034,'2254','','diver_1_thumb.jpg',130, 87,18,'photo_1804034.html');
												thumbnails[1804036] = new thumbnail(1804036,'2254','','Owen1_thumb.jpg',130, 87,18,'photo_1804036.html');
												thumbnails[1804037] = new thumbnail(1804037,'2249','','starlings_thumb.jpg',130, 87,18,'photo_1804037.html');
												thumbnails[1935842] = new thumbnail(1935842,'2247','','xrayplayweb_thumb.jpg',130, 87,18,'photo_1935842.html');
												thumbnails[3741013] = new thumbnail(3741013,'228351','','20090416-_DSC4966_thumb.jpg',130, 86,18,'photo_3741013.html');
												thumbnails[3741068] = new thumbnail(3741068,'228351','','20090416-_DSC5018_thumb.jpg',130, 91,18,'photo_3741068.html');
												thumbnails[3741072] = new thumbnail(3741072,'228351','','20090416-_DSC5021_thumb.jpg',130, 95,18,'photo_3741072.html');
												thumbnails[3741118] = new thumbnail(3741118,'228351','','20090416-_DSC5084_thumb.jpg',130, 60,18,'photo_3741118.html');
												thumbnails[3741119] = new thumbnail(3741119,'228351','','20090416-_DSC5085_thumb.jpg',130, 86,18,'photo_3741119.html');
												thumbnails[3741189] = new thumbnail(3741189,'228351','','20090416-_DSC5096_thumb.jpg',130, 67,18,'photo_3741189.html');
												thumbnails[3741329] = new thumbnail(3741329,'228351','','20090416-_DSC5122_thumb.jpg',130, 122,18,'photo_3741329.html');
												thumbnails[5116069] = new thumbnail(5116069,'2247','','forsu_thumb.jpg',130, 79,18,'photo_5116069.html');
												thumbnails[5116079] = new thumbnail(5116079,'2247','','1010_thumb.JPG',130, 98,18,'photo_5116079.html');
												thumbnails[5233540] = new thumbnail(5233540,'2248','','ELRCP_thumb.jpg',130, 87,18,'photo_5233540.html');
												thumbnails[18404] = new thumbnail(18404,'2247','Salmon alevins','alevins_thumb.jpg',130, 87,18,'photo_18404.html');
												thumbnails[18403] = new thumbnail(18403,'2247','Salmon eggs','eggs_thumb.jpg',130, 91,18,'photo_18403.html');
												thumbnails[18629] = new thumbnail(18629,'2248','Riverpool.','pool_thumb.jpg',130, 195,18,'photo_18629.html');
												thumbnails[18628] = new thumbnail(18628,'2248','Waterfall.','waterfall_thumb.jpg',130, 202,18,'photo_18628.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[2247] = new gallery(2247,'18404','Aquaculture','gallery',[18405,18406,18410,18411,18412,18620,18621,18622,18623,18707,18708,19199,19200,19202,19203,19233,19239,19241,19297,19545,19561,19562,19566,19567,19770,83593,132582,132590,132597,1669415,1691434,1804029,1804031,1804032,1935842,5116069,5116079,18404,18403],0, 0, '', 'gallery_2247.html',0,0);
				  					galleries[2248] = new gallery(2248,'1669349','Travel','gallery',[18413,18417,18420,18632,19198,19549,19559,1669349,1669358,1669367,1669369,1669373,5233540,18629,18628],0, 0, '', 'gallery_2248.html',0,0);
				  					galleries[2249] = new gallery(2249,'1669361','Nature','gallery',[18416,18421,18520,18521,19417,19771,19783,29024,1669328,1669347,1669361,1669364,1669371,1804037],0, 0, '', 'gallery_2249.html',0,0);
				  					galleries[2250] = new gallery(2250,'1669419','Concept','gallery',[18510,18519,18522,18612,18613,18614,18634,18635,19300,19779,19781,132586,1669357,1669419],0, 0, '', 'gallery_2250.html',0,0);
				  					galleries[2251] = new gallery(2251,'1669329,18426','General','gallery',[18426,18427,19410,19551,19552,19554,19556,19780,1669329,1669414,1804009],0, 0, '', 'gallery_2251.html',0,0);
				  					galleries[2252] = new gallery(2252,'1669418,19408','People','gallery',[18428,19196,19197,19236,19408,19409,19413,19414,19415,19543,19548,19550,19553,19558,19560,19563,19564,238590,1669418,1728089,1728090],0, 0, '', 'gallery_2252.html',0,0);
				  					galleries[2254] = new gallery(2254,'1804030,18429','Project','gallery',[18429,18606,18607,18609,18610,18626,19411,19547,24213,24215,24430,24432,24434,24436,26668,26670,26673,26674,1669417,1804030,1804033,1804034,1804036],0, 0, '', 'gallery_2254.html',0,0);
				  					galleries[3854] = new gallery(3854,'1071116,36431','Photojournalism','gallery',[36431,36434,36438,36440,44086,44087,132601,1071116],0, 0, '', 'gallery_3854.html',0,0);
				  					galleries[114188] = new gallery(114188,'1703376','LHC','gallery',[1697514,1697518,1703376],0, 0, '114550', 'gallery_114188.html',0,0);
				  					galleries[228351] = new gallery(228351,'3741329,3741189,3741119,3741118,3741072,3741068,3741013','Consolidated','gallery',[3741013,3741068,3741072,3741118,3741119,3741189,3741329],0, 0, '114550', 'gallery_228351.html',0,0);
				  					galleries[404083] = new gallery(404083,'','SSC','gallery',[],0, 0, '114550', 'gallery_404083.html',0,0);
				  					galleries[114550] = new gallery(114550,'1703376','CLIENT','gallery',[],0, 0, '', 'gallery_114550.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '1935842,1728090,1728089,1669419,1669418,1669417,1669415,1669414,1669373,1669371,1669361,1669349,1669329';
imageSets[2] = '1804030,1703376,1669419,1669418,1669361,1669349,1669329,1071116,1068302,1068299,1068296,36431,19408,18518,18429,18426,18404';
imageSets[3] = '5233540,5116079,5116069,3741329,3741189,3741119,3741118,3741072,3741068,3741013,1935842,1804037,1804036,1804034,1804033,1804032,1804031,1804030,1804029,1804009,1728090,1728089,1703376,1697518,1697514,1691434,1669419,1669418,1669417,1669415,1669414,1669373,1669371,1669369,1669367,1669364,1669361,1669358,1669357,1669349,1669347,1669329,1669328,1071235,1071116,1068302,1068299,1068296,238590,132601';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/alandykes/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/alandykes/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/alandykes/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/alandykes/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/alandykes/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/alandykes/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 = 'Alan Dykes Photography: ' + 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>';
	}
					
				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> &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="alandykes@btinternet.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="alandykes@btinternet.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;
	}
}

			

