window.thumbnails = {};
															thumbnails[8177386] = clik.newPhoto({"id":8177386,"src":"HomeNew2_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[8179740] = clik.newPhoto({"id":8179740,"src":"2_23_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8179740.html","width":130,"caption":"","height":87});
															thumbnails[8179606] = clik.newPhoto({"id":8179606,"src":"clikpic_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8179606.html","width":130,"caption":"","height":87});
															thumbnails[8883632] = clik.newPhoto({"id":8883632,"src":"2_8_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8883632.html","width":130,"caption":"","height":87});
															thumbnails[8180085] = clik.newPhoto({"id":8180085,"src":"1_46_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180085.html","width":87,"caption":"","height":130});
															thumbnails[8883633] = clik.newPhoto({"id":8883633,"src":"1_18_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8883633.html","width":84,"caption":"","height":130});
															thumbnails[8180283] = clik.newPhoto({"id":8180283,"src":"1_30_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180283.html","width":130,"caption":"","height":87});
															thumbnails[8180449] = clik.newPhoto({"id":8180449,"src":"2_1_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180449.html","width":87,"caption":"","height":130});
															thumbnails[8180451] = clik.newPhoto({"id":8180451,"src":"5_4E16AA51-24E8-5EC4-4FA57CFDE0618C23_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180451.html","width":130,"caption":"","height":87});
															thumbnails[8180511] = clik.newPhoto({"id":8180511,"src":"_DSC0074_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180511.html","width":130,"caption":"","height":87});
															thumbnails[8180508] = clik.newPhoto({"id":8180508,"src":"_DSC0147_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180508.html","width":87,"caption":"","height":130});
															thumbnails[8799047] = clik.newPhoto({"id":8799047,"src":"AG_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799047.html","width":130,"caption":"","height":87});
															thumbnails[8180694] = clik.newPhoto({"id":8180694,"src":"Carla1_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180694.html","width":130,"caption":"","height":87});
															thumbnails[8180696] = clik.newPhoto({"id":8180696,"src":"1_253_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180696.html","width":130,"caption":"","height":86});
															thumbnails[8180705] = clik.newPhoto({"id":8180705,"src":"1_249_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8180705.html","width":130,"caption":"","height":86});
															thumbnails[8357966] = clik.newPhoto({"id":8357966,"src":"AA_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8357966.html","width":130,"caption":"","height":87});
															thumbnails[8357969] = clik.newPhoto({"id":8357969,"src":"AA3_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8357969.html","width":130,"caption":"","height":87});
															thumbnails[8357970] = clik.newPhoto({"id":8357970,"src":"AA2_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8357970.html","width":87,"caption":"","height":130});
															thumbnails[8357971] = clik.newPhoto({"id":8357971,"src":"AA4_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8357971.html","width":130,"caption":"","height":87});
															thumbnails[8799022] = clik.newPhoto({"id":8799022,"src":"Kitley_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799022.html","width":130,"caption":"","height":87});
															thumbnails[8799029] = clik.newPhoto({"id":8799029,"src":"Final1_2BC4E871-1E4F-37DC-7131394F311F34F5_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799029.html","width":130,"caption":"","height":87});
															thumbnails[8799031] = clik.newPhoto({"id":8799031,"src":"LN2_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799031.html","width":87,"caption":"","height":130});
															thumbnails[8799062] = clik.newPhoto({"id":8799062,"src":"LN3_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799062.html","width":130,"caption":"","height":87});
															thumbnails[8799033] = clik.newPhoto({"id":8799033,"src":"Neal1_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799033.html","width":130,"caption":"","height":87});
															thumbnails[8799035] = clik.newPhoto({"id":8799035,"src":"Neal2_thumb.jpg","galleries_id":358267,"server_id":15,"link":"photo_8799035.html","width":130,"caption":"","height":87});
															thumbnails[6922843] = clik.newPhoto({"id":6922843,"src":"FootAnstey_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_6922843.html","width":130,"caption":"","height":194});
															thumbnails[4021907] = clik.newPhoto({"id":4021907,"src":"Babas1_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_4021907.html","width":130,"caption":"","height":87});
															thumbnails[4022051] = clik.newPhoto({"id":4022051,"src":"_DSC0025_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_4022051.html","width":130,"caption":"","height":87});
															thumbnails[7556705] = clik.newPhoto({"id":7556705,"src":"Clikpic3_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_7556705.html","width":130,"caption":"","height":87});
															thumbnails[8033421] = clik.newPhoto({"id":8033421,"src":"Clikpic4_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_8033421.html","width":87,"caption":"","height":130});
															thumbnails[7486229] = clik.newPhoto({"id":7486229,"src":"Em1_copy1_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_7486229.html","width":130,"caption":"","height":87});
															thumbnails[7486226] = clik.newPhoto({"id":7486226,"src":"Em2_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_7486226.html","width":130,"caption":"","height":87});
															thumbnails[3747961] = clik.newPhoto({"id":3747961,"src":"MOD2_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_3747961.html","width":130,"caption":"","height":87});
															thumbnails[2407789] = clik.newPhoto({"id":2407789,"src":"4_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_2407789.html","width":130,"caption":"","height":194});
															thumbnails[2407786] = clik.newPhoto({"id":2407786,"src":"3_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_2407786.html","width":130,"caption":"","height":87});
															thumbnails[2407784] = clik.newPhoto({"id":2407784,"src":"1_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_2407784.html","width":130,"caption":"","height":87});
															thumbnails[8162905] = clik.newPhoto({"id":8162905,"src":"rebeccaColor2_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_8162905.html","width":130,"caption":"","height":87});
															thumbnails[8162975] = clik.newPhoto({"id":8162975,"src":"RebeccaBW2_thumb.jpg","galleries_id":414113,"server_id":15,"link":"photo_8162975.html","width":87,"caption":"","height":130});
															thumbnails[7888778] = clik.newPhoto({"id":7888778,"src":"SP2_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_7888778.html","width":130,"caption":"Spring Flow","height":87});
															thumbnails[8040613] = clik.newPhoto({"id":8040613,"src":"Clikpic11_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_8040613.html","width":130,"caption":"Rising Tide","height":87});
															thumbnails[1077757] = clik.newPhoto({"id":1077757,"src":"SunShade_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1077757.html","width":130,"caption":"Necker Island","height":195});
															thumbnails[1433538] = clik.newPhoto({"id":1433538,"src":"27_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433538.html","width":130,"caption":"Rushing gulley","height":195});
															thumbnails[1433562] = clik.newPhoto({"id":1433562,"src":"Image61_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433562.html","width":130,"caption":"Hope Surf","height":195});
															thumbnails[3372146] = clik.newPhoto({"id":3372146,"src":"Droskyn Point_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3372146.html","width":130,"caption":"Droskyn Point","height":88});
															thumbnails[3564834] = clik.newPhoto({"id":3564834,"src":"Bantham1_tonemapped2_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_3564834.html","width":130,"caption":"Bigbury Sunrise","height":87});
															thumbnails[5868840] = clik.newPhoto({"id":5868840,"src":"Dartmoorfinal1_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5868840.html","width":130,"caption":"The Meavy","height":86});
															thumbnails[8040598] = clik.newPhoto({"id":8040598,"src":"Clikpic21_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_8040598.html","width":130,"caption":"Heybrook Point","height":87});
															thumbnails[1077803] = clik.newPhoto({"id":1077803,"src":"Balilo2_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1077803.html","width":130,"caption":"Bali Hi","height":195});
															thumbnails[1433540] = clik.newPhoto({"id":1433540,"src":"35pro_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433540.html","width":130,"caption":"Rock Pool Sunset","height":195});
															thumbnails[1433564] = clik.newPhoto({"id":1433564,"src":"Image1_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433564.html","width":130,"caption":"Rocky Cove","height":195});
															thumbnails[5868843] = clik.newPhoto({"id":5868843,"src":"BelliverBW_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_5868843.html","width":130,"caption":"Bellever","height":87});
															thumbnails[9092061] = clik.newPhoto({"id":9092061,"src":"Clikpic1_1_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_9092061.html","width":130,"caption":"Hope Low Tide","height":87});
															thumbnails[1125753] = clik.newPhoto({"id":1125753,"src":"41_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1125753.html","width":130,"caption":"Bovi Reef","height":195});
															thumbnails[1433575] = clik.newPhoto({"id":1433575,"src":"Image4_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433575.html","width":130,"caption":"Hope Reef","height":195});
															thumbnails[3904420] = clik.newPhoto({"id":3904420,"src":"_DSC0032__1__2_tonemapped_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3904420.html","width":130,"caption":"Ray of Light","height":87});
															thumbnails[7452254] = clik.newPhoto({"id":7452254,"src":"Pier1_copy_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_7452254.html","width":130,"caption":"Brighton Pier","height":87});
															thumbnails[1077813] = clik.newPhoto({"id":1077813,"src":"Cactuses_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1077813.html","width":130,"caption":"Necker Cacti","height":87});
															thumbnails[1123394] = clik.newPhoto({"id":1123394,"src":"11_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1123394.html","width":130,"caption":"Shoreline","height":87});
															thumbnails[1433547] = clik.newPhoto({"id":1433547,"src":"12_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433547.html","width":130,"caption":"Sunset Cove","height":195});
															thumbnails[1433576] = clik.newPhoto({"id":1433576,"src":"32_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433576.html","width":130,"caption":"Misty Rock Pool","height":195});
															thumbnails[5868975] = clik.newPhoto({"id":5868975,"src":"_DSC5422_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5868975.html","width":130,"caption":"Freathy Sunset","height":86});
															thumbnails[5868983] = clik.newPhoto({"id":5868983,"src":"Whitsand1Final_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_5868983.html","width":130,"caption":"Freathy Black & White","height":85});
															thumbnails[5869069] = clik.newPhoto({"id":5869069,"src":"PolzyHDR2_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5869069.html","width":130,"caption":"Polzeath Surf","height":87});
															thumbnails[1089971] = clik.newPhoto({"id":1089971,"src":"beach_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1089971.html","width":130,"caption":"Dnieper Flats","height":87});
															thumbnails[1433577] = clik.newPhoto({"id":1433577,"src":"26_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433577.html","width":130,"caption":"White Water","height":195});
															thumbnails[5868705] = clik.newPhoto({"id":5868705,"src":"WharfHDR_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5868705.html","width":130,"caption":"Canary Wharf","height":88});
															thumbnails[1433553] = clik.newPhoto({"id":1433553,"src":"20_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433553.html","width":130,"caption":"Deep Gulley","height":195});
															thumbnails[1433578] = clik.newPhoto({"id":1433578,"src":"40pro_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433578.html","width":130,"caption":"Rock Pool Sunset 2","height":195});
															thumbnails[4383276] = clik.newPhoto({"id":4383276,"src":"couple_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_4383276.html","width":130,"caption":"Kiev Couple","height":87});
															thumbnails[5868719] = clik.newPhoto({"id":5868719,"src":"Eye_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_5868719.html","width":130,"caption":"The Eye","height":87});
															thumbnails[1433522] = clik.newPhoto({"id":1433522,"src":"36nat_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433522.html","width":130,"caption":"Rock Pool Swirl","height":87});
															thumbnails[3564780] = clik.newPhoto({"id":3564780,"src":"Cornfield_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3564780.html","width":130,"caption":"Summer Cornfield","height":194});
															thumbnails[5869022] = clik.newPhoto({"id":5869022,"src":"Hope1_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5869022.html","width":130,"caption":"Outer Hope","height":86});
															thumbnails[9092066] = clik.newPhoto({"id":9092066,"src":"Clikpic21_1_thumb.jpg","galleries_id":479754,"server_id":15,"link":"photo_9092066.html","width":130,"caption":"Inner Hope","height":87});
															thumbnails[1089972] = clik.newPhoto({"id":1089972,"src":"lads_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1089972.html","width":130,"caption":"River Dnieper","height":87});
															thumbnails[1433527] = clik.newPhoto({"id":1433527,"src":"25_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433527.html","width":130,"caption":"Light Water","height":87});
															thumbnails[1433593] = clik.newPhoto({"id":1433593,"src":"44pro_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433593.html","width":130,"caption":"Abstract Rock Pool","height":87});
															thumbnails[3603264] = clik.newPhoto({"id":3603264,"src":"Lan1new_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3603264.html","width":130,"caption":"Lannacombe ","height":194});
															thumbnails[1433533] = clik.newPhoto({"id":1433533,"src":"43pro_thumb.jpg","galleries_id":82201,"server_id":15,"link":"photo_1433533.html","width":130,"caption":"Sunlit Rock","height":87});
															thumbnails[3372172] = clik.newPhoto({"id":3372172,"src":"The Sound_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3372172.html","width":130,"caption":"The Sound","height":192});
															thumbnails[4383416] = clik.newPhoto({"id":4383416,"src":"OldChurch_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_4383416.html","width":130,"caption":"Old Church Kiev","height":194});
															thumbnails[5868992] = clik.newPhoto({"id":5868992,"src":"Final1_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_5868992.html","width":130,"caption":"Freathy Rocks","height":86});
															thumbnails[1089969] = clik.newPhoto({"id":1089969,"src":"Granny_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1089969.html","width":130,"caption":"Village Lady","height":195});
															thumbnails[3564789] = clik.newPhoto({"id":3564789,"src":"Dmoor2_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3564789.html","width":130,"caption":"Shaugh Prior","height":87});
															thumbnails[3367232] = clik.newPhoto({"id":3367232,"src":"jenkinstoned1_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_3367232.html","width":130,"caption":"Jenkins Quay","height":130});
															thumbnails[993778] = clik.newPhoto({"id":993778,"src":"thai1 copy_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_993778.html","width":130,"caption":"Kho Phangan Sunset","height":88});
															thumbnails[6569313] = clik.newPhoto({"id":6569313,"src":"1_8C3B2D16-24E8-5EC4-4F8D876F67CE9F48_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_6569313.html","width":130,"caption":"The Mewstone","height":87});
															thumbnails[7033421] = clik.newPhoto({"id":7033421,"src":"3_3272500C-24E8-5EC4-4F7FC5946F663BAA_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_7033421.html","width":130,"caption":"The Barbican","height":87});
															thumbnails[1000063] = clik.newPhoto({"id":1000063,"src":"1 (21) copy_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1000063.html","width":130,"caption":"Thong Sala","height":88});
															thumbnails[996975] = clik.newPhoto({"id":996975,"src":"thai7 copy1_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_996975.html","width":130,"caption":"Emerald Buddha Temple ","height":87});
															thumbnails[996982] = clik.newPhoto({"id":996982,"src":"thai6 copy_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_996982.html","width":130,"caption":"Kinnari Buddha","height":196});
															thumbnails[996989] = clik.newPhoto({"id":996989,"src":"thai2 copy_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_996989.html","width":130,"caption":"Old Wooden Sea Craft","height":196});
															thumbnails[1135438] = clik.newPhoto({"id":1135438,"src":"new year_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1135438.html","width":130,"caption":"Chinese New Year","height":87});
															thumbnails[1135523] = clik.newPhoto({"id":1135523,"src":"prayer sticks_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1135523.html","width":130,"caption":"Taipei Prayer","height":87});
															thumbnails[1090041] = clik.newPhoto({"id":1090041,"src":"Carved Buddhas_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1090041.html","width":130,"caption":"Carved Buddhas","height":85});
															thumbnails[1135544] = clik.newPhoto({"id":1135544,"src":"festival figure1_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1135544.html","width":130,"caption":"New Year Festival","height":87});
															thumbnails[992611] = clik.newPhoto({"id":992611,"src":"Bud_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_992611.html","width":130,"caption":"Taiwanese Buddha","height":169});
															thumbnails[1135317] = clik.newPhoto({"id":1135317,"src":"Dragotemple_thumb.jpg","galleries_id":79741,"server_id":15,"link":"photo_1135317.html","width":130,"caption":"Dragon Temple","height":195});
															thumbnails[9030969] = clik.newPhoto({"id":9030969,"src":"FinalNight_thumb.jpg","galleries_id":205646,"server_id":15,"link":"photo_9030969.html","width":130,"caption":"Palace Pier","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[358267] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Weddings","link":"section426991.html","maxRecords":0.0,"photoIDs":[8179740.0,8179606.0,8883632.0,8180085.0,8883633.0,8180283.0,8180449.0,8180451.0,8180511.0,8180508.0,8799047.0,8180694.0,8180696.0,8180705.0,8357966.0,8357969.0,8357970.0,8357971.0,8799022.0,8799029.0,8799031.0,8799062.0,8799033.0,8799035.0],"skipIndex":0,"section_code":"section426991","featured_images":8179740.0,"id":358267,"singleSection":true});				  						galleries[82201] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"'Watervisions'","link":"gallery_82201.html","maxRecords":0.0,"photoIDs":[1433538.0,1433562.0,1433540.0,1433564.0,1125753.0,1433575.0,1123394.0,1433547.0,1433576.0,1433577.0,1433553.0,1433578.0,1433522.0,1433527.0,1433593.0,1433533.0],"skipIndex":0,"section_code":"gallery","featured_images":"1433578,1433538,1125753","id":82201,"singleSection":false});				  						galleries[205646] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Digital & HDR","link":"gallery_205646.html","maxRecords":0.0,"photoIDs":[7888778.0,8040613.0,3372146.0,5868840.0,8040598.0,3904420.0,5868975.0,5869069.0,5868705.0,3564780.0,5869022.0,3603264.0,3372172.0,5868992.0,3564789.0,3367232.0,6569313.0,7033421.0,9030969.0],"skipIndex":0,"section_code":"gallery","featured_images":"8040598,3564780","id":205646,"singleSection":false});				  						galleries[79741] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Travel","link":"gallery_79741.html","maxRecords":0.0,"photoIDs":[1077757.0,1077803.0,1077813.0,1089971.0,4383276.0,1089972.0,4383416.0,1089969.0,993778.0,1000063.0,996975.0,996982.0,996989.0,1135438.0,1135523.0,1090041.0,1135544.0,992611.0,1135317.0],"skipIndex":0,"section_code":"gallery","featured_images":"1089969,1077757,996989,992611","id":79741,"singleSection":false});				  						galleries[479754] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Digital Black & White","link":"gallery_479754.html","maxRecords":0.0,"photoIDs":[3564834.0,5868843.0,9092061.0,7452254.0,5868983.0,5868719.0,9092066.0],"skipIndex":0,"section_code":"gallery","featured_images":5868719.0,"id":479754,"singleSection":false});				  						galleries[414113] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Commercial & Portrait","link":"section495529.html","maxRecords":0.0,"photoIDs":[6922843.0,4021907.0,4022051.0,7556705.0,8033421.0,7486229.0,7486226.0,3747961.0,2407789.0,2407786.0,2407784.0,8162905.0,8162975.0],"skipIndex":0,"section_code":"section495529","featured_images":"6922843,3747961,2407786","id":414113,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8177386';
imageSets[2] = '8179740,8040598,6922843,1433538,1077757,1125753,5868719,1433578,3564780,3747961,2407786,1089969,996989,992611';
imageSets[3] = '9092066,9092061,9030969,8883633,8883632,8799062,8799047,8799035,8799033,8799031,8799029,8799022,8357971,8357970,8357969,8357966,8180705,8180696,8180694,8180511,8180508,8180451,8180449,8180283,8180085,8179740,8179606,8177386,8162975,8162905,8040613,8040598,8033421,7888778,7556705,7486229,7486226,7452254,7033421,6922843,6569313,5869069,5869022,5868992,5868983,5868975,5868843,5868840,5868719,5868705';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/tloates/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tloates/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/tloates/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 += 'section426991.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 && 'section426991' != '') {
					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 = 'Tobie Loates Photography: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			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 += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="tloates@pcad.ac.uk">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="tloates@pcad.ac.uk">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

