window.thumbnails = {};
															thumbnails[6488751] = clik.newPhoto({"id":6488751,"src":"B-Tarn_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6488751.html","width":160,"caption":"Blea Tarn","height":91});
															thumbnails[7914335] = clik.newPhoto({"id":7914335,"src":"Lanyon_thumb_99CBD5D8-1EC9-DFB6-09BAB62BB4E32FDA.jpg","galleries_id":377048,"server_id":18,"link":"photo_7914335.html","width":160,"caption":"Lanyon Quoit","height":160});
															thumbnails[6956260] = clik.newPhoto({"id":6956260,"src":"Vine_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6956260.html","width":160,"caption":"Vine by the Glass","height":113});
															thumbnails[6956210] = clik.newPhoto({"id":6956210,"src":"USA_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6956210.html","width":160,"caption":"USA Pride","height":120});
															thumbnails[6957597] = clik.newPhoto({"id":6957597,"src":"rollert_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6957597.html","width":160,"caption":"Steaming Up in the Downs","height":240});
															thumbnails[7389145] = clik.newPhoto({"id":7389145,"src":"Teasel_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_7389145.html","width":160,"caption":"Frosty Teasel","height":178});
															thumbnails[7395864] = clik.newPhoto({"id":7395864,"src":"Toadstoola_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_7395864.html","width":160,"caption":"Fly Agaric","height":120});
															thumbnails[6956240] = clik.newPhoto({"id":6956240,"src":"Sydney_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6956240.html","width":160,"caption":"Sydney Harbour Bridge","height":210});
															thumbnails[7464003] = clik.newPhoto({"id":7464003,"src":"Panoramabw_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_7464003.html","width":160,"caption":"Colosseum","height":81});
															thumbnails[6956275] = clik.newPhoto({"id":6956275,"src":"brick_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_6956275.html","width":160,"caption":"Brick and Steel","height":160});
															thumbnails[4372080] = clik.newPhoto({"id":4372080,"src":"Spore_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_4372080.html","width":160,"caption":"Singapore skylight","height":229});
															thumbnails[5200838] = clik.newPhoto({"id":5200838,"src":"London-bus_thumb.jpg","galleries_id":377048,"server_id":18,"link":"photo_5200838.html","width":160,"caption":"London Buses on Waterloo Bridge","height":98});
															thumbnails[8224804] = clik.newPhoto({"id":8224804,"src":"echinops1_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_8224804.html","width":160,"caption":"Echinops","height":166});
															thumbnails[7475339] = clik.newPhoto({"id":7475339,"src":"seeds_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7475339.html","width":160,"caption":"Moss Seed Heads","height":116});
															thumbnails[7535010] = clik.newPhoto({"id":7535010,"src":"Pasque_thumb_99EBB3E1-1EC9-DFB6-098D5B8569A250B4.jpg","galleries_id":255549,"server_id":18,"link":"photo_7535010.html","width":160,"caption":"Pasque Flower","height":160});
															thumbnails[7389146] = clik.newPhoto({"id":7389146,"src":"Dahlia_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7389146.html","width":160,"caption":"Dahlia","height":186});
															thumbnails[4448399] = clik.newPhoto({"id":4448399,"src":"SOLOMONS-SEAL_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_4448399.html","width":160,"caption":"Solomon's seal","height":228});
															thumbnails[4411502] = clik.newPhoto({"id":4411502,"src":"Madeira_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_4411502.html","width":160,"caption":"Hibiscus","height":135});
															thumbnails[7397591] = clik.newPhoto({"id":7397591,"src":"snowdropa_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7397591.html","width":160,"caption":"Snowdrop","height":286});
															thumbnails[7397594] = clik.newPhoto({"id":7397594,"src":"GERBERAa_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7397594.html","width":160,"caption":"Gerbera","height":108});
															thumbnails[4391379] = clik.newPhoto({"id":4391379,"src":"MOUNT-COOK-LILIES_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_4391379.html","width":160,"caption":"Mount Cook Lily","height":197});
															thumbnails[6957673] = clik.newPhoto({"id":6957673,"src":"Flower-stack_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_6957673.html","width":160,"caption":"Flower head","height":147});
															thumbnails[4411510] = clik.newPhoto({"id":4411510,"src":"IN-THE-SHED_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_4411510.html","width":160,"caption":"In the Shed","height":120});
															thumbnails[4440648] = clik.newPhoto({"id":4440648,"src":"Bee_orchid_new_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_4440648.html","width":160,"caption":"Bee orchid","height":164});
															thumbnails[7329641] = clik.newPhoto({"id":7329641,"src":"Agapanthus_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7329641.html","width":160,"caption":"Agapanthus in bud","height":201});
															thumbnails[7329644] = clik.newPhoto({"id":7329644,"src":"ICE-CRYSTALSa_thumb.jpg","galleries_id":255549,"server_id":18,"link":"photo_7329644.html","width":160,"caption":"Ice Crystals on Gorse Flower","height":120});
															thumbnails[6076276] = clik.newPhoto({"id":6076276,"src":"BUTTERFLY-WING_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_6076276.html","width":160,"caption":"Butterfly wing","height":120});
															thumbnails[8224807] = clik.newPhoto({"id":8224807,"src":"physalis_thumb_99B12C73-1EC9-DFB6-09E6826A8590AAA2.jpg","galleries_id":356766,"server_id":18,"link":"photo_8224807.html","width":160,"caption":"Physalis","height":160});
															thumbnails[7389305] = clik.newPhoto({"id":7389305,"src":"WATER-POWER_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_7389305.html","width":160,"caption":"Water Power","height":120});
															thumbnails[8804533] = clik.newPhoto({"id":8804533,"src":"Bee_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_8804533.html","width":160,"caption":"Bee on Flower","height":120});
															thumbnails[4448402] = clik.newPhoto({"id":4448402,"src":"fly-agaric_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_4448402.html","width":160,"caption":"Fly Agaric","height":160});
															thumbnails[6076271] = clik.newPhoto({"id":6076271,"src":"bluebell_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_6076271.html","width":160,"caption":"Bluebell impressions","height":120});
															thumbnails[6076300] = clik.newPhoto({"id":6076300,"src":"Spider_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_6076300.html","width":160,"caption":"Garden spider","height":174});
															thumbnails[4440656] = clik.newPhoto({"id":4440656,"src":"MADEIRAN-FLORA-AND-FAUNA_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_4440656.html","width":160,"caption":"Madeiran Flora and Fauna","height":106});
															thumbnails[4393020] = clik.newPhoto({"id":4393020,"src":"Fox-Glacier_new_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_4393020.html","width":160,"caption":"Fox Glacier","height":107});
															thumbnails[4755319] = clik.newPhoto({"id":4755319,"src":"iceflow_new_thumb.jpg","galleries_id":356766,"server_id":18,"link":"photo_4755319.html","width":160,"caption":"Small Iceberg","height":120});
															thumbnails[5562142] = clik.newPhoto({"id":5562142,"src":"bfly_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_5562142.html","width":160,"caption":"Tree Nymph","height":116});
															thumbnails[8805836] = clik.newPhoto({"id":8805836,"src":"Spider_843CB3E1-1EC9-DFB6-09B5C8CD04EB17B8_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_8805836.html","width":160,"caption":"Caught in the Web","height":120});
															thumbnails[4393000] = clik.newPhoto({"id":4393000,"src":"Azure_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4393000.html","width":160,"caption":"Azure Kingfisher","height":129});
															thumbnails[7390266] = clik.newPhoto({"id":7390266,"src":"Butterfly_0A025214-24E8-5EC4-4FD27F37B49105E9_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_7390266.html","width":160,"caption":"Golden Birdwing Butterfly","height":159});
															thumbnails[7395888] = clik.newPhoto({"id":7395888,"src":"WAXWING_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_7395888.html","width":160,"caption":"Waxwing","height":120});
															thumbnails[4440651] = clik.newPhoto({"id":4440651,"src":"Great_egret_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4440651.html","width":160,"caption":"Great egret","height":107});
															thumbnails[4382449] = clik.newPhoto({"id":4382449,"src":"Stonechat_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4382449.html","width":160,"caption":"Stonechat on Wire","height":122});
															thumbnails[7395848] = clik.newPhoto({"id":7395848,"src":"1002979sm_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_7395848.html","width":160,"caption":"Blue Morpho Butterfly","height":120});
															thumbnails[6474111] = clik.newPhoto({"id":6474111,"src":"puffin_thumb_99F0802D-1EC9-DFB6-09A0A8D719AE576C.jpg","galleries_id":255565,"server_id":18,"link":"photo_6474111.html","width":160,"caption":"Puffin","height":160});
															thumbnails[4382455] = clik.newPhoto({"id":4382455,"src":"Malachite_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4382455.html","width":160,"caption":"Malachite butterfly","height":120});
															thumbnails[4755312] = clik.newPhoto({"id":4755312,"src":"chipmunk_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4755312.html","width":160,"caption":"Least Chipmunk","height":177});
															thumbnails[4440649] = clik.newPhoto({"id":4440649,"src":"Chiffchaff_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4440649.html","width":160,"caption":"Chiffchaff","height":159});
															thumbnails[7398785] = clik.newPhoto({"id":7398785,"src":"Robin_thumb_99B69016-1EC9-DFB6-095A2EBE3DE0B9A3.jpg","galleries_id":255565,"server_id":18,"link":"photo_7398785.html","width":160,"caption":"Robin","height":160});
															thumbnails[4393002] = clik.newPhoto({"id":4393002,"src":"koala_thumb_99BA7EE4-1EC9-DFB6-091E0EA0ED79B3B4.jpg","galleries_id":255565,"server_id":18,"link":"photo_4393002.html","width":160,"caption":"Koala","height":160});
															thumbnails[4440652] = clik.newPhoto({"id":4440652,"src":"Grey-heron_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4440652.html","width":160,"caption":"Grey heron","height":110});
															thumbnails[4766056] = clik.newPhoto({"id":4766056,"src":"Darner_new_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4766056.html","width":160,"caption":"Canada Darner","height":107});
															thumbnails[7398784] = clik.newPhoto({"id":7398784,"src":"Big-Billy_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_7398784.html","width":160,"caption":"Big Billy","height":120});
															thumbnails[4755332] = clik.newPhoto({"id":4755332,"src":"Vapourer-moth-caterpillar_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_4755332.html","width":160,"caption":"The Vapourer","height":240});
															thumbnails[6474142] = clik.newPhoto({"id":6474142,"src":"swallows_thumb.jpg","galleries_id":255565,"server_id":18,"link":"photo_6474142.html","width":160,"caption":"All Together Now","height":129});
															thumbnails[7914234] = clik.newPhoto({"id":7914234,"src":"Boat_thumb_99F572E7-1EC9-DFB6-09282DDFC1C7EB3F.jpg","galleries_id":255548,"server_id":18,"link":"photo_7914234.html","width":160,"caption":"Holy Island boat, Lindisfarne Castle","height":160});
															thumbnails[6956204] = clik.newPhoto({"id":6956204,"src":"mayflower_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_6956204.html","width":160,"caption":"Mayflower II","height":120});
															thumbnails[8729624] = clik.newPhoto({"id":8729624,"src":"sandseasky_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_8729624.html","width":160,"caption":"Sand, Sea and Sky","height":80});
															thumbnails[8804546] = clik.newPhoto({"id":8804546,"src":"Bench_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_8804546.html","width":160,"caption":"Autumn Bench","height":147});
															thumbnails[8804553] = clik.newPhoto({"id":8804553,"src":"Swan_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_8804553.html","width":160,"caption":"Autumn Swan","height":234});
															thumbnails[4411559] = clik.newPhoto({"id":4411559,"src":"Norway-window_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4411559.html","width":160,"caption":"Norway window","height":136});
															thumbnails[4755323] = clik.newPhoto({"id":4755323,"src":"INSIDE-PASSAGE_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4755323.html","width":160,"caption":"The Inside Passage","height":113});
															thumbnails[5200754] = clik.newPhoto({"id":5200754,"src":"sheffield-park_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_5200754.html","width":160,"caption":"Sheffield Park","height":103});
															thumbnails[4342551] = clik.newPhoto({"id":4342551,"src":"Devon_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4342551.html","width":160,"caption":"Devon sunset","height":221});
															thumbnails[4353784] = clik.newPhoto({"id":4353784,"src":"Southern-Alps_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4353784.html","width":160,"caption":"Mount Cook","height":107});
															thumbnails[7391280] = clik.newPhoto({"id":7391280,"src":"church_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_7391280.html","width":160,"caption":"Church with a View","height":69});
															thumbnails[4772294] = clik.newPhoto({"id":4772294,"src":"lake_new_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4772294.html","width":160,"caption":"Mirror Lake","height":212});
															thumbnails[4393039] = clik.newPhoto({"id":4393039,"src":"Mt-Doom_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4393039.html","width":160,"caption":"Mount Ngauruhoe","height":120});
															thumbnails[4342557] = clik.newPhoto({"id":4342557,"src":"Mull_new_thumb.jpg","galleries_id":255548,"server_id":18,"link":"photo_4342557.html","width":160,"caption":"Isle of Mull","height":107});
															thumbnails[7914371] = clik.newPhoto({"id":7914371,"src":"Huts_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_7914371.html","width":160,"caption":"Beach Huts","height":62});
															thumbnails[6488755] = clik.newPhoto({"id":6488755,"src":"hand-on-wall_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_6488755.html","width":160,"caption":"Hand on the Wall","height":240});
															thumbnails[8805823] = clik.newPhoto({"id":8805823,"src":"Dubrovnik_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_8805823.html","width":160,"caption":"Dubrovnik at Dusk","height":120});
															thumbnails[8224803] = clik.newPhoto({"id":8224803,"src":"The-Pearly-King_thumb_99FA4F34-1EC9-DFB6-09472612F440E23A.jpg","galleries_id":341189,"server_id":18,"link":"photo_8224803.html","width":160,"caption":"The Pearly King","height":160});
															thumbnails[6474006] = clik.newPhoto({"id":6474006,"src":"angel_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_6474006.html","width":160,"caption":"At the Foot of The Angel","height":120});
															thumbnails[6956685] = clik.newPhoto({"id":6956685,"src":"fire_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_6956685.html","width":160,"caption":"Plimoth Plantation","height":240});
															thumbnails[6076306] = clik.newPhoto({"id":6076306,"src":"Bubble_thumb.jpg","galleries_id":341189,"server_id":18,"link":"photo_6076306.html","width":160,"caption":"The Bubble","height":148});
															thumbnails[8804572] = clik.newPhoto({"id":8804572,"src":"HELSINKI-CATHEDRAL_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_8804572.html","width":160,"caption":"Helsinki Cathedral in Reflection","height":120});
															thumbnails[7458147] = clik.newPhoto({"id":7458147,"src":"pantheon_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_7458147.html","width":160,"caption":"Pantheon","height":180});
															thumbnails[8804560] = clik.newPhoto({"id":8804560,"src":"BRIDGE-TO-ST-PAULS_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_8804560.html","width":160,"caption":"Millennium Bridge and St. Paul's Cathedral","height":107});
															thumbnails[7389246] = clik.newPhoto({"id":7389246,"src":"Kings_thumb_99FEAA5D-1EC9-DFB6-09C31BB23014D621.jpg","galleries_id":256869,"server_id":18,"link":"photo_7389246.html","width":160,"caption":"King's College, Cambridge","height":160});
															thumbnails[6474015] = clik.newPhoto({"id":6474015,"src":"Newcastle_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_6474015.html","width":160,"caption":"Tyneside at Night","height":106});
															thumbnails[6105569] = clik.newPhoto({"id":6105569,"src":"La-Grande-Arch_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_6105569.html","width":160,"caption":"La Grande Arche","height":209});
															thumbnails[7914336] = clik.newPhoto({"id":7914336,"src":"CharingCross_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_7914336.html","width":160,"caption":"Charing Cross Station and River Thames by night.","height":120});
															thumbnails[5214930] = clik.newPhoto({"id":5214930,"src":"WALKING-IN-THE-SHADOWS_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_5214930.html","width":160,"caption":"Walking in the Shadows","height":237});
															thumbnails[7914482] = clik.newPhoto({"id":7914482,"src":"walkway_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_7914482.html","width":160,"caption":"Overhead walkway","height":107});
															thumbnails[7405951] = clik.newPhoto({"id":7405951,"src":"Kew-Alpine_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_7405951.html","width":160,"caption":"Sunny Day at Kew","height":121});
															thumbnails[6076285] = clik.newPhoto({"id":6076285,"src":"Glass-pyramid_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_6076285.html","width":160,"caption":"Glass pyramid","height":143});
															thumbnails[5538547] = clik.newPhoto({"id":5538547,"src":"WESTMINSTERa_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_5538547.html","width":160,"caption":"Westminster","height":92});
															thumbnails[4372060] = clik.newPhoto({"id":4372060,"src":"Lion_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_4372060.html","width":160,"caption":"The Singapore Lion","height":222});
															thumbnails[4411561] = clik.newPhoto({"id":4411561,"src":"Salisbury_new_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_4411561.html","width":160,"caption":"Salisbury cathedral","height":249});
															thumbnails[5200850] = clik.newPhoto({"id":5200850,"src":"Vancouver_new_thumb.jpg","galleries_id":256869,"server_id":18,"link":"photo_5200850.html","width":160,"caption":"Office Blues","height":195});
															thumbnails[7914480] = clik.newPhoto({"id":7914480,"src":"TIMEPIECES_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_7914480.html","width":160,"caption":"Timepieces","height":120});
															thumbnails[7914475] = clik.newPhoto({"id":7914475,"src":"Choir_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_7914475.html","width":160,"caption":"Choir Practice","height":132});
															thumbnails[8243722] = clik.newPhoto({"id":8243722,"src":"shells_thumb_9A03A5C3-1EC9-DFB6-095E0EB82FE8F909.jpg","galleries_id":256879,"server_id":18,"link":"photo_8243722.html","width":160,"caption":"Shells","height":160});
															thumbnails[5214869] = clik.newPhoto({"id":5214869,"src":"WATERY-EYE_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_5214869.html","width":160,"caption":"Watery Eye","height":103});
															thumbnails[8805834] = clik.newPhoto({"id":8805834,"src":"Firework_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_8805834.html","width":160,"caption":"Firework cluster","height":213});
															thumbnails[8805830] = clik.newPhoto({"id":8805830,"src":"ENERGY-DRINK_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_8805830.html","width":160,"caption":"Energy Drink (Lager Light)","height":176});
															thumbnails[5214865] = clik.newPhoto({"id":5214865,"src":"A-ROUND-TOWN_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_5214865.html","width":160,"caption":"Big Bendy","height":159});
															thumbnails[5197511] = clik.newPhoto({"id":5197511,"src":"pavilion_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_5197511.html","width":160,"caption":"Royal Pavilion, Brighton","height":155});
															thumbnails[5200785] = clik.newPhoto({"id":5200785,"src":"London-lid_thumb.jpg","galleries_id":256879,"server_id":18,"link":"photo_5200785.html","width":160,"caption":"Lifting the Lid on St Paul's","height":209});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[377048] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Monochrome and Toned","link":"gallery_377048.html","maxRecords":0.0,"photoIDs":[6488751.0,7914335.0,6956260.0,6956210.0,6957597.0,7389145.0,7395864.0,6956240.0,7464003.0,6956275.0,4372080.0,5200838.0],"skipIndex":0,"section_code":"gallery","featured_images":7914335.0,"id":377048,"singleSection":false});				  						galleries[255549] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flora","link":"gallery_255549.html","maxRecords":0.0,"photoIDs":[8224804.0,7475339.0,7535010.0,7389146.0,4448399.0,4411502.0,7397591.0,7397594.0,4391379.0,6957673.0,4411510.0,4440648.0,7329641.0,7329644.0],"skipIndex":0,"section_code":"gallery","featured_images":7535010.0,"id":255549,"singleSection":false});				  						galleries[356766] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Natural World","link":"gallery_356766.html","maxRecords":0.0,"photoIDs":[6076276.0,8224807.0,7389305.0,8804533.0,4448402.0,6076271.0,6076300.0,4440656.0,4393020.0,4755319.0],"skipIndex":0,"section_code":"gallery","featured_images":8224807.0,"id":356766,"singleSection":false});				  						galleries[255565] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"gallery_255565.html","maxRecords":0.0,"photoIDs":[5562142.0,8805836.0,4393000.0,7390266.0,7395888.0,4440651.0,4382449.0,7395848.0,6474111.0,4382455.0,4755312.0,4440649.0,7398785.0,4393002.0,4440652.0,4766056.0,7398784.0,4755332.0,6474142.0],"skipIndex":0,"section_code":"gallery","featured_images":4393002.0,"id":255565,"singleSection":false});				  						galleries[255548] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Scenic","link":"gallery_255548.html","maxRecords":0.0,"photoIDs":[7914234.0,6956204.0,8729624.0,8804546.0,8804553.0,4411559.0,4755323.0,5200754.0,4342551.0,4353784.0,7391280.0,4772294.0,4393039.0,4342557.0],"skipIndex":0,"section_code":"gallery","featured_images":7914234.0,"id":255548,"singleSection":false});				  						galleries[341189] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Human Environment","link":"gallery_341189.html","maxRecords":0.0,"photoIDs":[7914371.0,6488755.0,8805823.0,8224803.0,6474006.0,6956685.0,6076306.0],"skipIndex":0,"section_code":"gallery","featured_images":8224803.0,"id":341189,"singleSection":false});				  						galleries[256869] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architectural","link":"gallery_256869.html","maxRecords":0.0,"photoIDs":[8804572.0,7458147.0,8804560.0,7389246.0,6474015.0,6105569.0,7914336.0,5214930.0,7914482.0,7405951.0,6076285.0,5538547.0,4372060.0,4411561.0,5200850.0],"skipIndex":0,"section_code":"gallery","featured_images":7389246.0,"id":256869,"singleSection":false});				  						galleries[256879] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Alternative and Artistic","link":"gallery_256879.html","maxRecords":0.0,"photoIDs":[7914480.0,7914475.0,8243722.0,5214869.0,8805834.0,8805830.0,5214865.0,5197511.0,5200785.0],"skipIndex":0,"section_code":"gallery","featured_images":8243722.0,"id":256879,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7395864,7329644,6474111,7398785,8729624,7914371,6474006,6076285';
imageSets[2] = '7914335,7535010,8224807,4393002,7914234,8224803,7389246,8243722';
imageSets[3] = '6488751,6956260,6956210,6957597,7395864,6956240,7464003,6956275,5200838,7475339,7389146,7397591,7397594,6957673,7329641,7329644,6076276,7389305,6076271,6076300,5562142,7390266,7395888,7395848,6474111,7398784,6474142';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/maford/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/maford/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/maford/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 = 'Ford Images: ' + 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;
	}
}

			

