window.thumbnails = {};
															thumbnails[737049] = clik.newPhoto({"id":737049,"src":"Wine_Chablis_1 copy 31_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_737049.html","width":130,"caption":"Chablis","height":196});
															thumbnails[6880021] = clik.newPhoto({"id":6880021,"src":"Daves_Portrait_Flyers_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6880021.html","width":120,"caption":"","height":62});
															thumbnails[5699404] = clik.newPhoto({"id":5699404,"src":"Cardiff_Bay_View_011_copy1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_5699404.html","width":120,"caption":"","height":60});
															thumbnails[6991063] = clik.newPhoto({"id":6991063,"src":"Harrods_Fashion_P_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_6991063.html","width":120,"caption":"Harrods","height":176});
															thumbnails[6991272] = clik.newPhoto({"id":6991272,"src":"Herts_15_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991272.html","width":120,"caption":"Bespoke Kitchens","height":76});
															thumbnails[6991394] = clik.newPhoto({"id":6991394,"src":"DCS_Goldcliff_Sun_1_copy1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991394.html","width":120,"caption":"","height":180});
															thumbnails[6991068] = clik.newPhoto({"id":6991068,"src":"Harrods_Cheese_P_Soft_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_6991068.html","width":120,"caption":"Harrods","height":180});
															thumbnails[6990901] = clik.newPhoto({"id":6990901,"src":"Young_18x123__thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990901.html","width":120,"caption":"","height":80});
															thumbnails[6991070] = clik.newPhoto({"id":6991070,"src":"Harrods_Toys_P_copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_6991070.html","width":120,"caption":"Harrods","height":174});
															thumbnails[6991278] = clik.newPhoto({"id":6991278,"src":"Dan-Y-Coed_-10_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991278.html","width":120,"caption":"Bespoke Kitchens","height":77});
															thumbnails[6991402] = clik.newPhoto({"id":6991402,"src":"Skull_-5_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991402.html","width":120,"caption":"","height":180});
															thumbnails[2017605] = clik.newPhoto({"id":2017605,"src":"Bespoke_DiningOut_270x210 copy_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_2017605.html","width":120,"caption":"Bespoke Kitchens","height":152});
															thumbnails[6991410] = clik.newPhoto({"id":6991410,"src":"Goldcliff_-6_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991410.html","width":120,"caption":"","height":180});
															thumbnails[6688862] = clik.newPhoto({"id":6688862,"src":"Burnt_Church_Gate_12_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688862.html","width":120,"caption":"","height":180});
															thumbnails[6990906] = clik.newPhoto({"id":6990906,"src":"Mareverwa_12x8__copy_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990906.html","width":120,"caption":"","height":80});
															thumbnails[6991283] = clik.newPhoto({"id":6991283,"src":"Kitchen_1-20_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991283.html","width":120,"caption":"Bespoke Kitchens","height":78});
															thumbnails[6991413] = clik.newPhoto({"id":6991413,"src":"Skull_-2_copy_1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991413.html","width":120,"caption":"","height":180});
															thumbnails[5701668] = clik.newPhoto({"id":5701668,"src":"SPA_Facial__30_copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_5701668.html","width":120,"caption":"Spa facial","height":180});
															thumbnails[6991441] = clik.newPhoto({"id":6991441,"src":"DCS_Staircase_3_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991441.html","width":120,"caption":"","height":180});
															thumbnails[2204018] = clik.newPhoto({"id":2204018,"src":"Talybont_Waterfalls_10 copy_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_2204018.html","width":120,"caption":"Waterfalls","height":80});
															thumbnails[5701393] = clik.newPhoto({"id":5701393,"src":"Prostrengh_0_copy_1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_5701393.html","width":120,"caption":"Nathan Robertson","height":180});
															thumbnails[6991286] = clik.newPhoto({"id":6991286,"src":"Bespoke_Wotton_-11_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991286.html","width":120,"caption":"Bespoke Kitchens","height":161});
															thumbnails[5701388] = clik.newPhoto({"id":5701388,"src":"Nathan_Prostrength_copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_5701388.html","width":120,"caption":"Nathan Robertson","height":189});
															thumbnails[745260] = clik.newPhoto({"id":745260,"src":"Steel_Knife_1 copy1_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_745260.html","width":120,"caption":"Knife","height":180});
															thumbnails[745500] = clik.newPhoto({"id":745500,"src":"Garlic_Bulbs_In_Bowl_2 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_745500.html","width":120,"caption":"Garlic","height":119});
															thumbnails[746332] = clik.newPhoto({"id":746332,"src":"Chocolate_Cake_3 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_746332.html","width":120,"caption":"Chocolate Pudding","height":120});
															thumbnails[748429] = clik.newPhoto({"id":748429,"src":"Wine_M&S_1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_748429.html","width":120,"caption":"M&S Wine","height":181});
															thumbnails[748432] = clik.newPhoto({"id":748432,"src":"Wine_Cover_65 copy 2_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748432.html","width":120,"caption":"Sunday Times","height":169});
															thumbnails[932849] = clik.newPhoto({"id":932849,"src":"Longhorn_1 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932849.html","width":120,"caption":"Longhorn","height":80});
															thumbnails[5701673] = clik.newPhoto({"id":5701673,"src":"SPA_Facial__52_copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_5701673.html","width":120,"caption":"Spa facial","height":80});
															thumbnails[6688423] = clik.newPhoto({"id":6688423,"src":"Dave_Curtis_1_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688423.html","width":120,"caption":"","height":158});
															thumbnails[6990802] = clik.newPhoto({"id":6990802,"src":"Leslie_16_12x81_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990802.html","width":120,"caption":"","height":80});
															thumbnails[6991288] = clik.newPhoto({"id":6991288,"src":"Kitchen_1-15_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991288.html","width":120,"caption":"Bespoke Kitchens","height":175});
															thumbnails[748235] = clik.newPhoto({"id":748235,"src":"champagne d 1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_748235.html","width":120,"caption":"Champagne","height":181});
															thumbnails[748475] = clik.newPhoto({"id":748475,"src":"Barclaycard_Gold_London2 copy1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_748475.html","width":120,"caption":"business","height":74});
															thumbnails[748483] = clik.newPhoto({"id":748483,"src":"Barclays_Hairdressers_Context_1 copy 1_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748483.html","width":120,"caption":"Barclaycard","height":165});
															thumbnails[6688439] = clik.newPhoto({"id":6688439,"src":"Dave_Curtis_5_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688439.html","width":120,"caption":"","height":172});
															thumbnails[736933] = clik.newPhoto({"id":736933,"src":"Wine1_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_736933.html","width":130,"caption":"Monsalud Red Wine ","height":155});
															thumbnails[932935] = clik.newPhoto({"id":932935,"src":"Sheep_13 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932935.html","width":120,"caption":"Landscape","height":84});
															thumbnails[1624241] = clik.newPhoto({"id":1624241,"src":"Couch_4_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_1624241.html","width":120,"caption":"PR y3s","height":76});
															thumbnails[3892456] = clik.newPhoto({"id":3892456,"src":"Saundersfoot_Beach_-4_copy_1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_3892456.html","width":120,"caption":"Saundersfoot beach","height":80});
															thumbnails[6991308] = clik.newPhoto({"id":6991308,"src":"Herts_22_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991308.html","width":120,"caption":"Bespoke Kitchens","height":156});
															thumbnails[6991790] = clik.newPhoto({"id":6991790,"src":"DCS_Ruperra_Doll_2_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6991790.html","width":120,"caption":"","height":180});
															thumbnails[6991332] = clik.newPhoto({"id":6991332,"src":"Kitchen_Main1_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991332.html","width":120,"caption":"Bespoke Kitchens","height":74});
															thumbnails[932829] = clik.newPhoto({"id":932829,"src":"jamie_2-3 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_932829.html","width":120,"caption":"Jamie Baulch","height":82});
															thumbnails[2017485] = clik.newPhoto({"id":2017485,"src":"Cuba cars-2 copy_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_2017485.html","width":120,"caption":"Vintage American cars","height":80});
															thumbnails[6991337] = clik.newPhoto({"id":6991337,"src":"Bespoke_Wotton_-4_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991337.html","width":120,"caption":"Bespoke Kitchens","height":80});
															thumbnails[745264] = clik.newPhoto({"id":745264,"src":"Studio Lamp_3 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_745264.html","width":120,"caption":"Studio Lamp","height":192});
															thumbnails[748477] = clik.newPhoto({"id":748477,"src":"Flys_Covers_3 copy 1_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_748477.html","width":120,"caption":"Sportfish Cover","height":180});
															thumbnails[6990704] = clik.newPhoto({"id":6990704,"src":"Leslie_48_7x5_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990704.html","width":120,"caption":"","height":86});
															thumbnails[6991339] = clik.newPhoto({"id":6991339,"src":"Kitchen_View_A_006_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991339.html","width":120,"caption":"Bespoke Kitchens","height":86});
															thumbnails[745394] = clik.newPhoto({"id":745394,"src":"Imoney_Tony_1 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_745394.html","width":120,"caption":"Tony","height":80});
															thumbnails[746283] = clik.newPhoto({"id":746283,"src":"Fruit_Smoothies_1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_746283.html","width":120,"caption":"Fruit Smoothie","height":125});
															thumbnails[748125] = clik.newPhoto({"id":748125,"src":"Pumpkin_Soup_1 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748125.html","width":120,"caption":"Pumpkin Soup","height":119});
															thumbnails[6688472] = clik.newPhoto({"id":6688472,"src":"Dave_Curtis_28_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688472.html","width":120,"caption":"","height":180});
															thumbnails[6991340] = clik.newPhoto({"id":6991340,"src":"Dan-Y-Coed_-12_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991340.html","width":120,"caption":"Bespoke Kitchens","height":163});
															thumbnails[746279] = clik.newPhoto({"id":746279,"src":"Watch on Black_1 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_746279.html","width":120,"caption":"Watch","height":180});
															thumbnails[748120] = clik.newPhoto({"id":748120,"src":"Stew_1 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748120.html","width":120,"caption":"Beef Strogonoff","height":120});
															thumbnails[748492] = clik.newPhoto({"id":748492,"src":"Emma_lobster_2 copy 1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_748492.html","width":120,"caption":"Emma","height":80});
															thumbnails[6991343] = clik.newPhoto({"id":6991343,"src":"Kitchen_Main2_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991343.html","width":120,"caption":"Bespoke Kitchens","height":162});
															thumbnails[6991349] = clik.newPhoto({"id":6991349,"src":"WICK_Litt_8_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_6991349.html","width":120,"caption":"Bespoke Kitchens","height":149});
															thumbnails[737269] = clik.newPhoto({"id":737269,"src":"Twm_Barlwm_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_737269.html","width":120,"caption":"Frosty Morning","height":80});
															thumbnails[737250] = clik.newPhoto({"id":737250,"src":"Newgale copy1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_737250.html","width":120,"caption":"Incoming Tide","height":73});
															thumbnails[745452] = clik.newPhoto({"id":745452,"src":"Penalta Park_Egg_4 copy_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_745452.html","width":120,"caption":"Penalta Park","height":182});
															thumbnails[748433] = clik.newPhoto({"id":748433,"src":"Walktall_Cover_Building_Karl copy 2_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748433.html","width":120,"caption":"Walktall Cover","height":170});
															thumbnails[932855] = clik.newPhoto({"id":932855,"src":"Sheep_15 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932855.html","width":120,"caption":"Wiltshire Sheep","height":82});
															thumbnails[2017489] = clik.newPhoto({"id":2017489,"src":"Band_1 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_2017489.html","width":120,"caption":"Double Bass","height":171});
															thumbnails[6688477] = clik.newPhoto({"id":6688477,"src":"Dave_Curtis_16_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688477.html","width":120,"caption":"","height":180});
															thumbnails[6990808] = clik.newPhoto({"id":6990808,"src":"Leslie_23_12x8_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990808.html","width":120,"caption":"","height":75});
															thumbnails[745397] = clik.newPhoto({"id":745397,"src":"Mel_Fruit4 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_745397.html","width":120,"caption":"Mel","height":180});
															thumbnails[748440] = clik.newPhoto({"id":748440,"src":"IceCream_Honey+Nut_1 copy 1_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748440.html","width":120,"caption":"Honey Nut Ice Cream","height":148});
															thumbnails[748188] = clik.newPhoto({"id":748188,"src":"chitol-Bhuna_starter_ copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748188.html","width":120,"caption":"Chitol Bhuna","height":80});
															thumbnails[748482] = clik.newPhoto({"id":748482,"src":"Colin_Jackson_Chair1 copy 1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_748482.html","width":120,"caption":"Colin Jackson","height":176});
															thumbnails[5699453] = clik.newPhoto({"id":5699453,"src":"Hotel_Room_010_copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_5699453.html","width":120,"caption":"Deluxe suite","height":80});
															thumbnails[6688502] = clik.newPhoto({"id":6688502,"src":"Dave_Curtis_36_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688502.html","width":120,"caption":"","height":180});
															thumbnails[745483] = clik.newPhoto({"id":745483,"src":"Coffee_Sepia_1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_745483.html","width":120,"caption":"Coffee","height":96});
															thumbnails[2204009] = clik.newPhoto({"id":2204009,"src":"Talybont_Waterfalls_7 copy1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_2204009.html","width":120,"caption":"Waterfalls","height":180});
															thumbnails[6990911] = clik.newPhoto({"id":6990911,"src":"Tuson_12x8__thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990911.html","width":120,"caption":"","height":84});
															thumbnails[746197] = clik.newPhoto({"id":746197,"src":"Grace_Apple_5 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_746197.html","width":120,"caption":"Grace","height":179});
															thumbnails[746221] = clik.newPhoto({"id":746221,"src":"Direct Wine Group_1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_746221.html","width":120,"caption":"Direct Wines","height":102});
															thumbnails[932882] = clik.newPhoto({"id":932882,"src":"Pig_01_4 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932882.html","width":120,"caption":"Pig","height":180});
															thumbnails[2204012] = clik.newPhoto({"id":2204012,"src":"Talybont_Waterfalls_8 copy_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_2204012.html","width":120,"caption":"Waterfalls","height":180});
															thumbnails[748191] = clik.newPhoto({"id":748191,"src":"Indianspicy tiger kng prawn-3 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748191.html","width":120,"caption":"Tiger King Prawn","height":79});
															thumbnails[748489] = clik.newPhoto({"id":748489,"src":"RNLI_Models_Beach_28 copy 1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_748489.html","width":120,"caption":"Clothing","height":160});
															thumbnails[5701872] = clik.newPhoto({"id":5701872,"src":"Tides_Restaurant_010_copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_5701872.html","width":120,"caption":"Tides Restaurant","height":58});
															thumbnails[6688697] = clik.newPhoto({"id":6688697,"src":"Dave_Curtis_39_copy_EC093135-1EC9-D45B-1CD64A87026F226D_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688697.html","width":120,"caption":"","height":161});
															thumbnails[748444] = clik.newPhoto({"id":748444,"src":"Storage_Cover jpeg copy 11_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748444.html","width":120,"caption":"Storage Cover","height":171});
															thumbnails[932804] = clik.newPhoto({"id":932804,"src":"London_eye_2 copy 1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_932804.html","width":120,"caption":"London Eye","height":80});
															thumbnails[932866] = clik.newPhoto({"id":932866,"src":"Sheep_4 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932866.html","width":120,"caption":"Lamb","height":129});
															thumbnails[1624248] = clik.newPhoto({"id":1624248,"src":"joe_A3_Print copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_1624248.html","width":120,"caption":"Joe Calzaghe","height":132});
															thumbnails[3892440] = clik.newPhoto({"id":3892440,"src":"Husky_33_copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_3892440.html","width":120,"caption":"Siberian Husky","height":190});
															thumbnails[6990916] = clik.newPhoto({"id":6990916,"src":"Tuson_7x5_-2_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990916.html","width":120,"caption":"","height":86});
															thumbnails[745491] = clik.newPhoto({"id":745491,"src":"Ruby +mill lipstick 01 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_745491.html","width":120,"caption":"Ruby+Millie","height":180});
															thumbnails[748443] = clik.newPhoto({"id":748443,"src":"Skateboarder copy 1_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_748443.html","width":120,"caption":"Skateboarder","height":76});
															thumbnails[5701886] = clik.newPhoto({"id":5701886,"src":"Tides_Restaurant_05_copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_5701886.html","width":120,"caption":"Tides Bar","height":80});
															thumbnails[6688837] = clik.newPhoto({"id":6688837,"src":"Dave_Curtis_6_copy_EC0C1B4D-1EC9-D45B-1CC4E777CDBE6C4F_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688837.html","width":120,"caption":"","height":180});
															thumbnails[745512] = clik.newPhoto({"id":745512,"src":"Glass_Candle1 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_745512.html","width":120,"caption":"Glass Candle","height":175});
															thumbnails[745519] = clik.newPhoto({"id":745519,"src":"Callcentre_12 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_745519.html","width":120,"caption":"Callcentre","height":89});
															thumbnails[746278] = clik.newPhoto({"id":746278,"src":"Cafe_Coffee1 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_746278.html","width":120,"caption":"Cafe,Coffee","height":96});
															thumbnails[746290] = clik.newPhoto({"id":746290,"src":"Cover_Peg_5 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_746290.html","width":120,"caption":"Pegs","height":170});
															thumbnails[748456] = clik.newPhoto({"id":748456,"src":"langstone_-3 copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_748456.html","width":120,"caption":"CK Kitchens","height":75});
															thumbnails[932868] = clik.newPhoto({"id":932868,"src":"Peacock_3 copy_thumb.jpg","galleries_id":56841,"server_id":1,"link":"photo_932868.html","width":120,"caption":"Peacock","height":75});
															thumbnails[5701374] = clik.newPhoto({"id":5701374,"src":"Hotel_Bedroom_Dark_02_copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_5701374.html","width":120,"caption":"Deluxe bedroom.","height":78});
															thumbnails[6688851] = clik.newPhoto({"id":6688851,"src":"Dave_Curtis_14_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688851.html","width":120,"caption":"","height":160});
															thumbnails[746223] = clik.newPhoto({"id":746223,"src":"Body Scrubs_1 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_746223.html","width":120,"caption":"Body Scrub","height":120});
															thumbnails[6990919] = clik.newPhoto({"id":6990919,"src":"Nyakwhua_12x8__thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990919.html","width":120,"caption":"","height":84});
															thumbnails[748459] = clik.newPhoto({"id":748459,"src":"langstone_-4 copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_748459.html","width":120,"caption":"CK Kitchens","height":73});
															thumbnails[4597437] = clik.newPhoto({"id":4597437,"src":"Stairs1_copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_4597437.html","width":120,"caption":"Y3S","height":93});
															thumbnails[6688863] = clik.newPhoto({"id":6688863,"src":"Dave_Curtis_31_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688863.html","width":120,"caption":"","height":145});
															thumbnails[6688866] = clik.newPhoto({"id":6688866,"src":"Scary_Fish_1_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688866.html","width":120,"caption":"","height":94});
															thumbnails[748129] = clik.newPhoto({"id":748129,"src":"Kitchen_Stir_Fry_3 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_748129.html","width":120,"caption":"Stir Fry","height":70});
															thumbnails[6688919] = clik.newPhoto({"id":6688919,"src":"Trelech_01_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_6688919.html","width":120,"caption":"","height":180});
															thumbnails[4597678] = clik.newPhoto({"id":4597678,"src":"Saundersfoot_Beach_-7_copy_1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4597678.html","width":120,"caption":"","height":80});
															thumbnails[748435] = clik.newPhoto({"id":748435,"src":"Printware_Covers1 copy 1_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748435.html","width":120,"caption":"Printware Cover","height":168});
															thumbnails[748436] = clik.newPhoto({"id":748436,"src":"Log_1 copy 1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_748436.html","width":120,"caption":"Log by sea","height":80});
															thumbnails[4597703] = clik.newPhoto({"id":4597703,"src":"Horses_1_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4597703.html","width":120,"caption":"St Davids","height":80});
															thumbnails[6990925] = clik.newPhoto({"id":6990925,"src":"Noel_7x5_Toned__copy_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990925.html","width":120,"caption":"","height":83});
															thumbnails[748149] = clik.newPhoto({"id":748149,"src":"Coffee_Machine_57 copy_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_748149.html","width":120,"caption":"Coffee Machine","height":137});
															thumbnails[4629354] = clik.newPhoto({"id":4629354,"src":"Meadow_2_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629354.html","width":120,"caption":"","height":86});
															thumbnails[746188] = clik.newPhoto({"id":746188,"src":"Wine_Case_2 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_746188.html","width":120,"caption":"Wine Case","height":61});
															thumbnails[6990930] = clik.newPhoto({"id":6990930,"src":"Nyakwhua_7x5__thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990930.html","width":120,"caption":"","height":86});
															thumbnails[745232] = clik.newPhoto({"id":745232,"src":"Bamboo White Tea Composite_1 copy1_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_745232.html","width":120,"caption":"Bamboo+White Tea","height":80});
															thumbnails[746280] = clik.newPhoto({"id":746280,"src":"Imoney_Sharon_1 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_746280.html","width":120,"caption":"Sharon","height":154});
															thumbnails[748446] = clik.newPhoto({"id":748446,"src":"Cover_Silver1 copy_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_748446.html","width":120,"caption":"Cover","height":121});
															thumbnails[1089202] = clik.newPhoto({"id":1089202,"src":"Park_Club_Wine_Evening_5 copy_thumb.jpg","galleries_id":56876,"server_id":1,"link":"photo_1089202.html","width":120,"caption":"Wine Tasting ","height":74});
															thumbnails[4629349] = clik.newPhoto({"id":4629349,"src":"lighthouse-2_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629349.html","width":120,"caption":"","height":81});
															thumbnails[6990934] = clik.newPhoto({"id":6990934,"src":"Cotterell_7x5_Framed-2_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990934.html","width":120,"caption":"","height":86});
															thumbnails[6990964] = clik.newPhoto({"id":6990964,"src":"Gwyne_7x5_-21_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990964.html","width":120,"caption":"","height":168});
															thumbnails[738805] = clik.newPhoto({"id":738805,"src":"Indian_egg_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_738805.html","width":120,"caption":"Madras","height":80});
															thumbnails[1088998] = clik.newPhoto({"id":1088998,"src":"_MG_7139 copy2_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_1088998.html","width":120,"caption":"Summer Ball","height":168});
															thumbnails[1624260] = clik.newPhoto({"id":1624260,"src":"Shot_18_B copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_1624260.html","width":120,"caption":"Ellingham house","height":79});
															thumbnails[4629351] = clik.newPhoto({"id":4629351,"src":"Sarah_copy_1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629351.html","width":120,"caption":"","height":83});
															thumbnails[6990969] = clik.newPhoto({"id":6990969,"src":"Mareverwa_7x5_-2_copy1_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990969.html","width":120,"caption":"","height":168});
															thumbnails[932815] = clik.newPhoto({"id":932815,"src":"Door Handle_4 copy 1_thumb.jpg","galleries_id":56894,"server_id":1,"link":"photo_932815.html","width":120,"caption":"Door Handle\/Keys","height":89});
															thumbnails[4629370] = clik.newPhoto({"id":4629370,"src":"Dave_Curtis_23_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629370.html","width":120,"caption":"","height":65});
															thumbnails[6990944] = clik.newPhoto({"id":6990944,"src":"Jessop_12x8xpro_1_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990944.html","width":120,"caption":"","height":180});
															thumbnails[745386] = clik.newPhoto({"id":745386,"src":"Amanda Robbins_6 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_745386.html","width":120,"caption":"Amanda Robbins","height":181});
															thumbnails[4629372] = clik.newPhoto({"id":4629372,"src":"Dave_Curtis_6_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629372.html","width":120,"caption":"","height":180});
															thumbnails[6990996] = clik.newPhoto({"id":6990996,"src":"Hopkins_12x8_-2_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6990996.html","width":120,"caption":"","height":180});
															thumbnails[5699413] = clik.newPhoto({"id":5699413,"src":"Bedroom_A_04_copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_5699413.html","width":120,"caption":"Hotel room","height":81});
															thumbnails[2017591] = clik.newPhoto({"id":2017591,"src":"Untitled-1_thumb.jpg","galleries_id":57707,"server_id":1,"link":"photo_2017591.html","width":120,"caption":"Bespoke Ads","height":90});
															thumbnails[4629366] = clik.newPhoto({"id":4629366,"src":"Dave_Curtis_39_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629366.html","width":120,"caption":"","height":176});
															thumbnails[6991016] = clik.newPhoto({"id":6991016,"src":"Young_7x53_1_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6991016.html","width":120,"caption":"","height":168});
															thumbnails[745405] = clik.newPhoto({"id":745405,"src":"Emma+Andy_Hilltop_4 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_745405.html","width":120,"caption":"Clifftop","height":175});
															thumbnails[4629363] = clik.newPhoto({"id":4629363,"src":"Shack_C_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629363.html","width":120,"caption":"","height":188});
															thumbnails[6991017] = clik.newPhoto({"id":6991017,"src":"Hopkins_7x521_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6991017.html","width":120,"caption":"","height":168});
															thumbnails[932779] = clik.newPhoto({"id":932779,"src":"Cooks Kitchen Portugese blue copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_932779.html","width":120,"caption":"Cooks Kitchen","height":80});
															thumbnails[4629431] = clik.newPhoto({"id":4629431,"src":"Church_Grave_copy_1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629431.html","width":120,"caption":"","height":168});
															thumbnails[6991030] = clik.newPhoto({"id":6991030,"src":"Jessop_12x8_Frame__thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6991030.html","width":120,"caption":"","height":85});
															thumbnails[1088977] = clik.newPhoto({"id":1088977,"src":"Band_28 copy_thumb.jpg","galleries_id":56895,"server_id":1,"link":"photo_1088977.html","width":120,"caption":"","height":165});
															thumbnails[4629432] = clik.newPhoto({"id":4629432,"src":"flake-2_copy_1_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629432.html","width":120,"caption":"","height":178});
															thumbnails[6991031] = clik.newPhoto({"id":6991031,"src":"Young_30x20_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6991031.html","width":120,"caption":"","height":75});
															thumbnails[4629435] = clik.newPhoto({"id":4629435,"src":"Shed_copy_thumb.jpg","galleries_id":266074,"server_id":1,"link":"photo_4629435.html","width":120,"caption":"","height":177});
															thumbnails[6991033] = clik.newPhoto({"id":6991033,"src":"Millership_12x8-2_thumb.jpg","galleries_id":373451,"server_id":1,"link":"photo_6991033.html","width":120,"caption":"","height":80});
															thumbnails[1089169] = clik.newPhoto({"id":1089169,"src":"Vanilla room_2 copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_1089169.html","width":120,"caption":"Vanilla Room","height":180});
															thumbnails[738770] = clik.newPhoto({"id":738770,"src":"Twm_Barlwm1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_738770.html","width":120,"caption":"Blue Pond","height":80});
															thumbnails[932785] = clik.newPhoto({"id":932785,"src":"Indian_chicken bombay-3 copy_thumb.jpg","galleries_id":57083,"server_id":1,"link":"photo_932785.html","width":120,"caption":"Chicken Bombay","height":180});
															thumbnails[1624254] = clik.newPhoto({"id":1624254,"src":"Bespoke_25BK_300x230_v3 copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_1624254.html","width":120,"caption":"Ellingham house","height":155});
															thumbnails[745427] = clik.newPhoto({"id":745427,"src":"Bathroom_12 copy_thumb.jpg","galleries_id":57522,"server_id":1,"link":"photo_745427.html","width":120,"caption":"Real Homes ","height":185});
															thumbnails[932802] = clik.newPhoto({"id":932802,"src":"Big Ben_4 copy 1_thumb.jpg","galleries_id":56901,"server_id":1,"link":"photo_932802.html","width":120,"caption":"Big Ben","height":180});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[373451] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_373451.html","maxRecords":0.0,"photoIDs":[6880021.0,6990901.0,6990906.0,6990802.0,6990704.0,6990808.0,6990911.0,6990916.0,6990919.0,6990925.0,6990930.0,6990934.0,6990964.0,6990969.0,6990944.0,6990996.0,6991016.0,6991017.0,6991030.0,6991031.0,6991033.0],"skipIndex":0,"section_code":"gallery","featured_images":"6990808,6880021","id":373451,"singleSection":false});				  						galleries[56841] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_56841.html","maxRecords":0.0,"photoIDs":[932849.0,932935.0,932855.0,932882.0,932866.0,3892440.0,932868.0],"skipIndex":0,"section_code":"gallery","featured_images":932849.0,"id":56841,"singleSection":false});				  						galleries[56894] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Products","link":"gallery_56894.html","maxRecords":0.0,"photoIDs":[745260.0,745264.0,748477.0,746279.0,745491.0,745512.0,746290.0,746223.0,748149.0,745232.0,932815.0],"skipIndex":0,"section_code":"gallery","featured_images":932815.0,"id":56894,"singleSection":false});				  						galleries[56901] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Locations","link":"gallery_56901.html","maxRecords":0.0,"photoIDs":[5699404.0,2204018.0,3892456.0,2017485.0,737269.0,737250.0,745452.0,2204009.0,2204012.0,932804.0,748436.0,738770.0,932802.0],"skipIndex":0,"section_code":"gallery","featured_images":932804.0,"id":56901,"singleSection":false});				  						galleries[57522] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Interiors","link":"gallery_57522.html","maxRecords":0.0,"photoIDs":[6991272.0,6991278.0,6991283.0,6991286.0,6991288.0,6991308.0,6991332.0,6991337.0,6991339.0,6991340.0,6991343.0,6991349.0,5699453.0,5701872.0,5701886.0,748456.0,5701374.0,748459.0,1624260.0,5699413.0,932779.0,1089169.0,1624254.0,745427.0],"skipIndex":0,"section_code":"gallery","featured_images":"6991339,6991283,5699413","id":57522,"singleSection":false});				  						galleries[56876] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Drinks","link":"gallery_56876.html","maxRecords":0.0,"photoIDs":[737049.0,748429.0,748235.0,736933.0,746283.0,745483.0,746221.0,746278.0,746188.0,1089202.0],"skipIndex":0,"section_code":"gallery","featured_images":"746278,745483,736933","id":56876,"singleSection":false});				  						galleries[56895] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_56895.html","maxRecords":0.0,"photoIDs":[6991063.0,6991068.0,6991070.0,5701668.0,5701393.0,5701388.0,5701673.0,748475.0,1624241.0,932829.0,745394.0,748492.0,2017489.0,745397.0,748482.0,746197.0,748489.0,1624248.0,748443.0,745519.0,4597437.0,746280.0,1088998.0,745386.0,745405.0,1088977.0],"skipIndex":0,"section_code":"gallery","featured_images":"5701393,1624248","id":56895,"singleSection":false});				  						galleries[57083] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Food","link":"gallery_57083.html","maxRecords":0.0,"photoIDs":[745500.0,746332.0,748125.0,748120.0,748440.0,748188.0,748191.0,748129.0,738805.0,932785.0],"skipIndex":0,"section_code":"gallery","featured_images":932785.0,"id":57083,"singleSection":false});				  						galleries[57707] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"In Print","link":"gallery_57707.html","maxRecords":0.0,"photoIDs":[2017605.0,748432.0,748483.0,748433.0,748444.0,748435.0,748446.0,2017591.0],"skipIndex":0,"section_code":"gallery","featured_images":748432.0,"id":57707,"singleSection":false});				  						galleries[266074] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Personal Work","link":"gallery_266074.html","maxRecords":0.0,"photoIDs":[6991394.0,6991402.0,6991410.0,6688862.0,6991413.0,6991441.0,6688423.0,6688439.0,6991790.0,6688472.0,6688477.0,6688502.0,6688697.0,6688837.0,6688851.0,6688863.0,6688866.0,6688919.0,4597678.0,4597703.0,4629354.0,4629349.0,4629351.0,4629370.0,4629372.0,4629366.0,4629363.0,4629431.0,4629432.0,4629435.0],"skipIndex":0,"section_code":"gallery","featured_images":"4629366,4597678","id":266074,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6991394,5699404,6991402,6991410,5701673,736933,6990808,5699453,5701872,4597437';
imageSets[2] = '6880021,6991283,5701393,932849,748432,736933,6991339,6990808,745483,1624248,932804,746278,4597678,932815,5699413,4629366,932785';
imageSets[3] = '2017605,2204018,932849,932935,2017489,932855,5699453,2204009,2204012,1624248,4597437,4597678,4597703,4629354,4629349,4629351,1088998,4629370,4629372,5699413,1088977';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Davecurtis/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Davecurtis/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 = 'Dave Curtis 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>';
	}
				
				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;
	}
}

			

