window.thumbnails = {};
															thumbnails[5307404] = clik.newPhoto({"id":5307404,"src":"birdofparadise_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307404.html","width":130,"caption":"","height":126});
															thumbnails[5307424] = clik.newPhoto({"id":5307424,"src":"flamenco4_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5307424.html","width":130,"caption":"Flamenco 4","height":127});
															thumbnails[5307426] = clik.newPhoto({"id":5307426,"src":"flower013_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307426.html","width":130,"caption":"","height":130});
															thumbnails[5307427] = clik.newPhoto({"id":5307427,"src":"flower014_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307427.html","width":130,"caption":"","height":130});
															thumbnails[5307428] = clik.newPhoto({"id":5307428,"src":"flower015_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307428.html","width":130,"caption":"","height":130});
															thumbnails[5307429] = clik.newPhoto({"id":5307429,"src":"flower021_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307429.html","width":130,"caption":"","height":130});
															thumbnails[5307431] = clik.newPhoto({"id":5307431,"src":"flower032_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307431.html","width":130,"caption":"","height":130});
															thumbnails[5307432] = clik.newPhoto({"id":5307432,"src":"flower033_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307432.html","width":130,"caption":"","height":130});
															thumbnails[5307433] = clik.newPhoto({"id":5307433,"src":"flower0381_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307433.html","width":130,"caption":"","height":130});
															thumbnails[5307435] = clik.newPhoto({"id":5307435,"src":"flower0667_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307435.html","width":130,"caption":"","height":123});
															thumbnails[5307436] = clik.newPhoto({"id":5307436,"src":"flower2785_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307436.html","width":130,"caption":"","height":130});
															thumbnails[5307437] = clik.newPhoto({"id":5307437,"src":"flower3187_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307437.html","width":128,"caption":"","height":130});
															thumbnails[5307438] = clik.newPhoto({"id":5307438,"src":"flower9966_thumb.jpg","galleries_id":298521,"server_id":5,"link":"photo_5307438.html","width":130,"caption":"","height":130});
															thumbnails[5307494] = clik.newPhoto({"id":5307494,"src":"juanmartin_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5307494.html","width":113,"caption":"Juan Martin","height":130});
															thumbnails[5307509] = clik.newPhoto({"id":5307509,"src":"seajay_thumb.jpg","galleries_id":298586,"server_id":5,"link":"photo_5307509.html","width":130,"caption":"Seajay","height":79});
															thumbnails[5307516] = clik.newPhoto({"id":5307516,"src":"skaters_thumb.jpg","galleries_id":298586,"server_id":5,"link":"photo_5307516.html","width":130,"caption":"Skaters","height":130});
															thumbnails[5315304] = clik.newPhoto({"id":5315304,"src":"hippo2_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5315304.html","width":130,"caption":"Hippopotamus","height":77});
															thumbnails[5315308] = clik.newPhoto({"id":5315308,"src":"lion1_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5315308.html","width":90,"caption":"Lion, Serengeti","height":130});
															thumbnails[5315309] = clik.newPhoto({"id":5315309,"src":"sally_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5315309.html","width":130,"caption":"Sally Lightfoot Crab","height":90});
															thumbnails[5315314] = clik.newPhoto({"id":5315314,"src":"harrishawk_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5315314.html","width":130,"caption":"Harris Hawk","height":92});
															thumbnails[5315315] = clik.newPhoto({"id":5315315,"src":"IMG_7626_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5315315.html","width":130,"caption":"Kestrel","height":82});
															thumbnails[5315322] = clik.newPhoto({"id":5315322,"src":"maltesefalcon1_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5315322.html","width":130,"caption":"Maltese Falcon","height":85});
															thumbnails[5315324] = clik.newPhoto({"id":5315324,"src":"palechantinggoshawk1_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5315324.html","width":130,"caption":"Pale Chanting Goshawk","height":82});
															thumbnails[5315409] = clik.newPhoto({"id":5315409,"src":"weaver_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5315409.html","width":83,"caption":"Weaver, Tanzania","height":130});
															thumbnails[5316379] = clik.newPhoto({"id":5316379,"src":"dolphin2_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5316379.html","width":130,"caption":"Dolphin, Galapagos","height":77});
															thumbnails[5316380] = clik.newPhoto({"id":5316380,"src":"dolphinsguernsey_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5316380.html","width":130,"caption":"Bottle-nosed Dolphins","height":62});
															thumbnails[5316381] = clik.newPhoto({"id":5316381,"src":"giraffe5_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5316381.html","width":86,"caption":"Giraffe","height":130});
															thumbnails[5316382] = clik.newPhoto({"id":5316382,"src":"seal_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5316382.html","width":130,"caption":"Atlantic Grey Seal","height":77});
															thumbnails[5316383] = clik.newPhoto({"id":5316383,"src":"sealion_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_5316383.html","width":130,"caption":"Sea lion, Galapagos","height":70});
															thumbnails[5316443] = clik.newPhoto({"id":5316443,"src":"frigate-bird_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5316443.html","width":85,"caption":"Frigate Bird, Galapagos","height":130});
															thumbnails[5316445] = clik.newPhoto({"id":5316445,"src":"kingfisher1_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5316445.html","width":100,"caption":"Kingfisher, Tanzania","height":130});
															thumbnails[5316448] = clik.newPhoto({"id":5316448,"src":"puffin1_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5316448.html","width":89,"caption":"Puffin. Skomer","height":130});
															thumbnails[5316450] = clik.newPhoto({"id":5316450,"src":"refootedbooby_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5316450.html","width":98,"caption":"Red-footed Booby ","height":130});
															thumbnails[5316452] = clik.newPhoto({"id":5316452,"src":"Snowy-Egret-with-fish_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5316452.html","width":130,"caption":"Snowy Egret, Brasil","height":93});
															thumbnails[5316457] = clik.newPhoto({"id":5316457,"src":"harbour_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316457.html","width":130,"caption":"The harbour","height":90});
															thumbnails[5316459] = clik.newPhoto({"id":5316459,"src":"lloydsbank2_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316459.html","width":105,"caption":"Lloyds Bank","height":130});
															thumbnails[5316460] = clik.newPhoto({"id":5316460,"src":"mountdurand1_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316460.html","width":130,"caption":"Mount Durand","height":93});
															thumbnails[5316461] = clik.newPhoto({"id":5316461,"src":"stjulianscourt_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316461.html","width":81,"caption":"St Julian's Court","height":130});
															thumbnails[5316464] = clik.newPhoto({"id":5316464,"src":"hanoissea_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316464.html","width":130,"caption":"Les Hanois","height":82});
															thumbnails[5316465] = clik.newPhoto({"id":5316465,"src":"prosperity_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5316465.html","width":130,"caption":"'Prosperity' engine block","height":87});
															thumbnails[5316466] = clik.newPhoto({"id":5316466,"src":"townchurch_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316466.html","width":71,"caption":"Town Church","height":130});
															thumbnails[5316467] = clik.newPhoto({"id":5316467,"src":"townscape_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5316467.html","width":130,"caption":"St Peter Port","height":76});
															thumbnails[5316639] = clik.newPhoto({"id":5316639,"src":"altar_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316639.html","width":86,"caption":"Looking west","height":130});
															thumbnails[5316743] = clik.newPhoto({"id":5316743,"src":"bell-tower_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316743.html","width":88,"caption":"Bell-tower","height":130});
															thumbnails[5316796] = clik.newPhoto({"id":5316796,"src":"drinking-pals_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316796.html","width":130,"caption":"Part of fresco","height":118});
															thumbnails[5316797] = clik.newPhoto({"id":5316797,"src":"glass_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316797.html","width":87,"caption":"North window","height":130});
															thumbnails[5316799] = clik.newPhoto({"id":5316799,"src":"glassnorth_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316799.html","width":89,"caption":"East window","height":130});
															thumbnails[5316800] = clik.newPhoto({"id":5316800,"src":"stapolline_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316800.html","width":130,"caption":"The Chapel","height":87});
															thumbnails[5316866] = clik.newPhoto({"id":5316866,"src":"yellow-flower_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5316866.html","width":96,"caption":"Fresco detail","height":130});
															thumbnails[5317405] = clik.newPhoto({"id":5317405,"src":"cauliflower-fungus---sparassis-crispa_8756_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317405.html","width":100,"caption":"Cauliflower fungus - sparassis crispa","height":130});
															thumbnails[5317406] = clik.newPhoto({"id":5317406,"src":"clathrus-ruber_1235_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317406.html","width":102,"caption":"Clathrus ruber","height":130});
															thumbnails[5317407] = clik.newPhoto({"id":5317407,"src":"coralfungus_F45F1F95-2219-B5B5-4C7B23EF45E22333_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317407.html","width":130,"caption":"Coral fungus","height":87});
															thumbnails[5317408] = clik.newPhoto({"id":5317408,"src":"dung-mottlegill-paneolus-semiovatus_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317408.html","width":130,"caption":"Dung mottlegill ","height":95});
															thumbnails[5317415] = clik.newPhoto({"id":5317415,"src":"fly-agaric-9324_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317415.html","width":96,"caption":"Fly agaric","height":130});
															thumbnails[5317417] = clik.newPhoto({"id":5317417,"src":"groynes_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5317417.html","width":95,"caption":"Groynes","height":130});
															thumbnails[5317420] = clik.newPhoto({"id":5317420,"src":"groynes-2_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5317420.html","width":106,"caption":"Groynes 2","height":130});
															thumbnails[5317421] = clik.newPhoto({"id":5317421,"src":"jellyear_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317421.html","width":130,"caption":"Jelly Ear","height":100});
															thumbnails[5317423] = clik.newPhoto({"id":5317423,"src":"kingalfred_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317423.html","width":110,"caption":"King Alfred's cakes","height":130});
															thumbnails[5317425] = clik.newPhoto({"id":5317425,"src":"parasol--macrolepiota-procera_0688_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317425.html","width":110,"caption":"Parasol mushroom","height":130});
															thumbnails[5317428] = clik.newPhoto({"id":5317428,"src":"russula-queletii_9432_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317428.html","width":130,"caption":"Russula queletii","height":84});
															thumbnails[5317429] = clik.newPhoto({"id":5317429,"src":"the-juggler_thumb.jpg","galleries_id":298586,"server_id":5,"link":"photo_5317429.html","width":81,"caption":"The juggler","height":130});
															thumbnails[5317431] = clik.newPhoto({"id":5317431,"src":"townscape1_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5317431.html","width":130,"caption":"Townscape","height":76});
															thumbnails[5317433] = clik.newPhoto({"id":5317433,"src":"tremella-mesenterica_9417-small_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317433.html","width":130,"caption":"Tremella mesenterica","height":91});
															thumbnails[5317434] = clik.newPhoto({"id":5317434,"src":"unidentified-1_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317434.html","width":130,"caption":"Unidentified 1","height":98});
															thumbnails[5317435] = clik.newPhoto({"id":5317435,"src":"unidentified-2_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317435.html","width":119,"caption":"Unidentified 2","height":130});
															thumbnails[5317437] = clik.newPhoto({"id":5317437,"src":"unidentified-3_thumb.jpg","galleries_id":298210,"server_id":5,"link":"photo_5317437.html","width":97,"caption":"Unidentified 3","height":130});
															thumbnails[5317529] = clik.newPhoto({"id":5317529,"src":"flower_thumb.jpg","galleries_id":299258,"server_id":5,"link":"photo_5317529.html","width":130,"caption":"Flower fresco","height":113});
															thumbnails[5317530] = clik.newPhoto({"id":5317530,"src":"skater-2_thumb.jpg","galleries_id":298586,"server_id":5,"link":"photo_5317530.html","width":73,"caption":"Skater 2","height":130});
															thumbnails[5317563] = clik.newPhoto({"id":5317563,"src":"southern-lapwing_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5317563.html","width":130,"caption":"Southern lapwing - Brasil","height":89});
															thumbnails[5317573] = clik.newPhoto({"id":5317573,"src":"hanois_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5317573.html","width":130,"caption":"Evening at Les Hanois ","height":100});
															thumbnails[5318105] = clik.newPhoto({"id":5318105,"src":"Flamenco-11_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5318105.html","width":83,"caption":"Flamenco 1","height":130});
															thumbnails[5318109] = clik.newPhoto({"id":5318109,"src":"flamenco-21_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5318109.html","width":94,"caption":"Flamenco 2","height":130});
															thumbnails[5318112] = clik.newPhoto({"id":5318112,"src":"flamenco-31_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5318112.html","width":72,"caption":"Flamenco 3","height":130});
															thumbnails[5318117] = clik.newPhoto({"id":5318117,"src":"guitarrista_thumb.jpg","galleries_id":298209,"server_id":5,"link":"photo_5318117.html","width":130,"caption":"Guitarrista","height":96});
															thumbnails[5318154] = clik.newPhoto({"id":5318154,"src":"skateboarder_thumb.jpg","galleries_id":298586,"server_id":5,"link":"photo_5318154.html","width":130,"caption":"Skateboarder","height":71});
															thumbnails[5318282] = clik.newPhoto({"id":5318282,"src":"marketpharmacy_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5318282.html","width":130,"caption":"Market Pharmacy","height":85});
															thumbnails[5318290] = clik.newPhoto({"id":5318290,"src":"Orion-rescue_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5318290.html","width":130,"caption":"'Orion' rescue 1974","height":89});
															thumbnails[5318302] = clik.newPhoto({"id":5318302,"src":"Sarnia-farewell-1978_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5318302.html","width":130,"caption":"'Sarnia' farewell 1978","height":90});
															thumbnails[5318330] = clik.newPhoto({"id":5318330,"src":"hermharbour_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5318330.html","width":130,"caption":"Herm harbour","height":94});
															thumbnails[5318335] = clik.newPhoto({"id":5318335,"src":"police-patrol_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5318335.html","width":130,"caption":"Police patrol - Herm","height":87});
															thumbnails[5318339] = clik.newPhoto({"id":5318339,"src":"alderney-point_thumb.jpg","galleries_id":298523,"server_id":5,"link":"photo_5318339.html","width":130,"caption":"Alderney Point - Herm","height":80});
															thumbnails[5318427] = clik.newPhoto({"id":5318427,"src":"rbs-house1_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5318427.html","width":105,"caption":"RBS building","height":130});
															thumbnails[5318511] = clik.newPhoto({"id":5318511,"src":"short-eared-owl_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_5318511.html","width":130,"caption":"Short-eared owl","height":87});
															thumbnails[5320652] = clik.newPhoto({"id":5320652,"src":"progress_thumb.jpg","galleries_id":298522,"server_id":5,"link":"photo_5320652.html","width":130,"caption":"Fruit Export development","height":76});
															thumbnails[6302296] = clik.newPhoto({"id":6302296,"src":"male_polar_bear_2_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_6302296.html","width":130,"caption":"Male polar bear","height":89});
															thumbnails[6302301] = clik.newPhoto({"id":6302301,"src":"polar_bear_aggression_2_thumb.jpg","galleries_id":298519,"server_id":5,"link":"photo_6302301.html","width":130,"caption":"Polar bear aggression","height":100});
															thumbnails[6302309] = clik.newPhoto({"id":6302309,"src":"IMG_1214_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_6302309.html","width":127,"caption":"Brunnich's guillemots","height":130});
															thumbnails[6302319] = clik.newPhoto({"id":6302319,"src":"IMG_1236_thumb.jpg","galleries_id":298520,"server_id":5,"link":"photo_6302319.html","width":130,"caption":"Arctic tern","height":97});
															thumbnails[8919577] = clik.newPhoto({"id":8919577,"src":"apocalypse_web_thumb.jpg","galleries_id":469135,"server_id":5,"link":"photo_8919577.html","width":107,"caption":"Apocalypse","height":130});
															thumbnails[8919590] = clik.newPhoto({"id":8919590,"src":"douane_thumb.jpg","galleries_id":469135,"server_id":5,"link":"photo_8919590.html","width":74,"caption":"Douane","height":130});
															thumbnails[8919712] = clik.newPhoto({"id":8919712,"src":"dream_time_thumb.jpg","galleries_id":469135,"server_id":5,"link":"photo_8919712.html","width":130,"caption":"Dream time","height":88});
															thumbnails[8919682] = clik.newPhoto({"id":8919682,"src":"2_renaissance_thumb.jpg","galleries_id":469135,"server_id":5,"link":"photo_8919682.html","width":130,"caption":"Renaissance","height":100});
															thumbnails[8919562] = clik.newPhoto({"id":8919562,"src":"IMG_0707_web_thumb.jpg","galleries_id":469135,"server_id":5,"link":"photo_8919562.html","width":130,"caption":"Stooped","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[298519] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_298519.html","maxRecords":0.0,"photoIDs":[5315304.0,5315308.0,5315309.0,5316379.0,5316380.0,5316381.0,5316382.0,5316383.0,6302296.0,6302301.0],"skipIndex":0,"section_code":"gallery","featured_images":"6302301,6302296,5316383,5316382,5316381,5316380,5316379,5315309,5315308,5315304","id":298519,"singleSection":false});				  						galleries[298520] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds","link":"gallery_298520.html","maxRecords":0.0,"photoIDs":[5315314.0,5315315.0,5315322.0,5315324.0,5315409.0,5316443.0,5316445.0,5316448.0,5316450.0,5316452.0,5317563.0,5318511.0,6302309.0,6302319.0],"skipIndex":0,"section_code":"gallery","featured_images":"5318511,5316448","id":298520,"singleSection":false});				  						galleries[298209] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flamenco","link":"gallery_298209.html","maxRecords":0.0,"photoIDs":[5307424.0,5307494.0,5318105.0,5318109.0,5318112.0,5318117.0],"skipIndex":0,"section_code":"gallery","featured_images":5307494.0,"id":298209,"singleSection":false});				  						galleries[298521] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flowers","link":"gallery_298521.html","maxRecords":0.0,"photoIDs":[5307404.0,5307426.0,5307427.0,5307428.0,5307429.0,5307431.0,5307432.0,5307433.0,5307435.0,5307436.0,5307437.0,5307438.0],"skipIndex":0,"section_code":"gallery","featured_images":5307432.0,"id":298521,"singleSection":false});				  						galleries[298210] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fungi","link":"gallery_298210.html","maxRecords":0.0,"photoIDs":[5317405.0,5317406.0,5317407.0,5317408.0,5317415.0,5317421.0,5317423.0,5317425.0,5317428.0,5317433.0,5317434.0,5317435.0,5317437.0],"skipIndex":0,"section_code":"gallery","featured_images":"5317437,5317435,5317434,5317433,5317428,5317425,5317423,5317421,5317415,5317408","id":298210,"singleSection":false});				  						galleries[298523] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Guernsey & Herm","link":"gallery_298523.html","maxRecords":0.0,"photoIDs":[5316457.0,5316459.0,5316460.0,5316461.0,5316464.0,5316466.0,5316467.0,5317417.0,5317420.0,5317431.0,5317573.0,5318330.0,5318335.0,5318339.0],"skipIndex":0,"section_code":"gallery","featured_images":"5318339,5318335,5318330,5317573,5317431,5317420,5317417,5316467,5316466,5316464","id":298523,"singleSection":false});				  						galleries[298522] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Guernsey History","link":"gallery_298522.html","maxRecords":0.0,"photoIDs":[5316465.0,5318282.0,5318290.0,5318302.0,5318427.0,5320652.0],"skipIndex":0,"section_code":"gallery","featured_images":5318290.0,"id":298522,"singleSection":false});				  						galleries[298586] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Speed","link":"gallery_298586.html","maxRecords":0.0,"photoIDs":[5307509.0,5307516.0,5317429.0,5317530.0,5318154.0],"skipIndex":0,"section_code":"gallery","featured_images":5318154.0,"id":298586,"singleSection":false});				  						galleries[299258] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"St Apolline's Chapel","link":"gallery_299258.html","maxRecords":0.0,"photoIDs":[5316639.0,5316743.0,5316796.0,5316797.0,5316799.0,5316800.0,5316866.0,5317529.0],"skipIndex":0,"section_code":"gallery","featured_images":5316800.0,"id":299258,"singleSection":false});				  						galleries[469135] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Strange","link":"gallery_469135.html","maxRecords":0.0,"photoIDs":[8919577.0,8919590.0,8919712.0,8919682.0,8919562.0],"skipIndex":0,"section_code":"gallery","featured_images":8919577.0,"id":469135,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5317573';
imageSets[2] = '5318511,5318290,5318154,5316800,5316448,5307494,5307432,8919577';
imageSets[3] = '8919590,8919712,8919682';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/willsajjh/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/willsajjh/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Digital Guernsey: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

