window.thumbnails = {};
															thumbnails[1534193] = clik.newPhoto({"id":1534193,"src":"00051_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1536120] = clik.newPhoto({"id":1536120,"src":"00062_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1536226] = clik.newPhoto({"id":1536226,"src":"DPP_0003_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1559575] = clik.newPhoto({"id":1559575,"src":"00021_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1922364] = clik.newPhoto({"id":1922364,"src":"_A8J9333 copy_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1922365] = clik.newPhoto({"id":1922365,"src":"_A8J9344 copy_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1922367] = clik.newPhoto({"id":1922367,"src":"_A8J9344 copy copy_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":210});
															thumbnails[1922369] = clik.newPhoto({"id":1922369,"src":"_A8J9371 copy_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1922382] = clik.newPhoto({"id":1922382,"src":"_A8J9384 copy copy_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[2277637] = clik.newPhoto({"id":2277637,"src":"XA8J0243_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":77});
															thumbnails[2315724] = clik.newPhoto({"id":2315724,"src":"XA8J2593-1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cwrt Bleddyn Hotel","height":87});
															thumbnails[2351457] = clik.newPhoto({"id":2351457,"src":"150_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cwrt Bleddyn Hotel","height":195});
															thumbnails[2477008] = clik.newPhoto({"id":2477008,"src":"-33_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[2570277] = clik.newPhoto({"id":2570277,"src":"DPP_0003_3_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":164});
															thumbnails[2948472] = clik.newPhoto({"id":2948472,"src":"DPP_00011_3_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3415216] = clik.newPhoto({"id":3415216,"src":"-106_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[3415599] = clik.newPhoto({"id":3415599,"src":"-396_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4155900] = clik.newPhoto({"id":4155900,"src":"DPP_10_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"St Mellons Hotel & Country Club","height":87});
															thumbnails[4155911] = clik.newPhoto({"id":4155911,"src":"DPP_27_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4590764] = clik.newPhoto({"id":4590764,"src":"15_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[4590819] = clik.newPhoto({"id":4590819,"src":"21_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[4612359] = clik.newPhoto({"id":4612359,"src":"0003_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[4612360] = clik.newPhoto({"id":4612360,"src":"0126ev1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4612361] = clik.newPhoto({"id":4612361,"src":"0288lb1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":202});
															thumbnails[4612364] = clik.newPhoto({"id":4612364,"src":"DPP_0002_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[4631417] = clik.newPhoto({"id":4631417,"src":"DPP_0012_copy1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Craig y Nos Castle","height":71});
															thumbnails[4863170] = clik.newPhoto({"id":4863170,"src":"270_copy1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"New House, Thornhill","height":87});
															thumbnails[4863173] = clik.newPhoto({"id":4863173,"src":"396_copy1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[5233963] = clik.newPhoto({"id":5233963,"src":"111_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":104});
															thumbnails[5233967] = clik.newPhoto({"id":5233967,"src":"21_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":93});
															thumbnails[5233974] = clik.newPhoto({"id":5233974,"src":"71_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":182});
															thumbnails[5792723] = clik.newPhoto({"id":5792723,"src":"-781_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[5795467] = clik.newPhoto({"id":5795467,"src":"10_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"City Hall, Cardiff","height":195});
															thumbnails[5795469] = clik.newPhoto({"id":5795469,"src":"12_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":100});
															thumbnails[5795470] = clik.newPhoto({"id":5795470,"src":"13_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[5795475] = clik.newPhoto({"id":5795475,"src":"-791_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Coed-Y-Mwstwr","height":87});
															thumbnails[6236431] = clik.newPhoto({"id":6236431,"src":"rich2_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Outside the Bear Hotel, Cowbridge","height":87});
															thumbnails[6282334] = clik.newPhoto({"id":6282334,"src":"-0071-4_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6285641] = clik.newPhoto({"id":6285641,"src":"-3164_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6377585] = clik.newPhoto({"id":6377585,"src":"1_EC82DD1F-24E8-5EC4-4F176D7C60725945_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[6865666] = clik.newPhoto({"id":6865666,"src":"18_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6866149] = clik.newPhoto({"id":6866149,"src":"1481_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[6866150] = clik.newPhoto({"id":6866150,"src":"1641_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6866151] = clik.newPhoto({"id":6866151,"src":"3_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[6866153] = clik.newPhoto({"id":6866153,"src":"312_copy1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":89});
															thumbnails[6914022] = clik.newPhoto({"id":6914022,"src":"--2_copyweb_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7043532] = clik.newPhoto({"id":7043532,"src":"--209_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cathays Park, Cardiff","height":195});
															thumbnails[7043533] = clik.newPhoto({"id":7043533,"src":"--213_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cathays Park, Cardiff","height":87});
															thumbnails[7043534] = clik.newPhoto({"id":7043534,"src":"XA8J3219_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Canada Lodge & Lakes","height":87});
															thumbnails[7349369] = clik.newPhoto({"id":7349369,"src":"DPP_0002_D85D9751-24E8-5EC4-4F3B41BFDE240C70_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Clearwell Castle, Forest of Dean","height":87});
															thumbnails[7421902] = clik.newPhoto({"id":7421902,"src":"XA8J3372copy_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Canada Lodge & Lakes","height":87});
															thumbnails[7421926] = clik.newPhoto({"id":7421926,"src":"XA8J3372_copy2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Canada Lodge and Lakes","height":87});
															thumbnails[7422130] = clik.newPhoto({"id":7422130,"src":"-3441 copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7422131] = clik.newPhoto({"id":7422131,"src":"-5661copy copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7683574] = clik.newPhoto({"id":7683574,"src":"lauren on bed copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7683609] = clik.newPhoto({"id":7683609,"src":"photo-85_copy_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[5934174] = clik.newPhoto({"id":5934174,"src":"-10_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Cardiff Bay","height":195});
															thumbnails[5934175] = clik.newPhoto({"id":5934175,"src":"-12_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[4590766] = clik.newPhoto({"id":4590766,"src":"17_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[5792722] = clik.newPhoto({"id":5792722,"src":"-691_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":177});
															thumbnails[5934181] = clik.newPhoto({"id":5934181,"src":"13_80D9C68E-1D09-001F-99F5532A9FB4F543_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5792726] = clik.newPhoto({"id":5792726,"src":"-921_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1534191] = clik.newPhoto({"id":1534191,"src":"0005_thumb.JPG","galleries_id":334794,"server_id":18,"link":"photo_1534191.html","width":130,"caption":"","height":195});
															thumbnails[1536121] = clik.newPhoto({"id":1536121,"src":"0009_thumb.JPG","galleries_id":104781,"server_id":18,"link":"photo_1536121.html","width":130,"caption":"Angel Hotel, Cardiff","height":195});
															thumbnails[1536131] = clik.newPhoto({"id":1536131,"src":"0014_thumb.JPG","galleries_id":104781,"server_id":18,"link":"photo_1536131.html","width":130,"caption":"","height":219});
															thumbnails[4155893] = clik.newPhoto({"id":4155893,"src":"DPP_8_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4155893.html","width":130,"caption":"The Manor Hotel, Crickhowell","height":87});
															thumbnails[4155902] = clik.newPhoto({"id":4155902,"src":"DPP_12_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4155902.html","width":130,"caption":"","height":195});
															thumbnails[4590765] = clik.newPhoto({"id":4590765,"src":"16_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4590765.html","width":130,"caption":"","height":195});
															thumbnails[4606241] = clik.newPhoto({"id":4606241,"src":"XA8J7743_copy15_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4606241.html","width":130,"caption":"","height":87});
															thumbnails[4606266] = clik.newPhoto({"id":4606266,"src":"NP7J453415_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4606266.html","width":130,"caption":"The Orangery, Margam Park","height":194});
															thumbnails[4607665] = clik.newPhoto({"id":4607665,"src":"DPP_25_copy1_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4607665.html","width":130,"caption":"","height":87});
															thumbnails[4910604] = clik.newPhoto({"id":4910604,"src":"19511_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4910604.html","width":130,"caption":"Canada Lodge","height":87});
															thumbnails[4910605] = clik.newPhoto({"id":4910605,"src":"30_copy1_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4910605.html","width":130,"caption":"Miskin Manor","height":195});
															thumbnails[4910608] = clik.newPhoto({"id":4910608,"src":"XA8J780611_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_4910608.html","width":130,"caption":"","height":206});
															thumbnails[5795474] = clik.newPhoto({"id":5795474,"src":"-581_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_5795474.html","width":130,"caption":"Coed-Y-Mwstwr","height":210});
															thumbnails[5935024] = clik.newPhoto({"id":5935024,"src":"1_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5935024.html","width":130,"caption":"","height":195});
															thumbnails[5935025] = clik.newPhoto({"id":5935025,"src":"43_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5935025.html","width":130,"caption":"","height":87});
															thumbnails[6080186] = clik.newPhoto({"id":6080186,"src":"XA8J2601_copy2_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6080186.html","width":130,"caption":"Manor House, Crickhowell","height":101});
															thumbnails[6236430] = clik.newPhoto({"id":6236430,"src":"rich1_thumb.JPG","galleries_id":104781,"server_id":18,"link":"photo_6236430.html","width":130,"caption":"Bear Hotel, Cowbridge","height":87});
															thumbnails[6282335] = clik.newPhoto({"id":6282335,"src":"__thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6282335.html","width":130,"caption":"Bear Hotel, Cowbridge","height":87});
															thumbnails[6285642] = clik.newPhoto({"id":6285642,"src":"-3223_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_6285642.html","width":130,"caption":"","height":184});
															thumbnails[6285656] = clik.newPhoto({"id":6285656,"src":"-3223_copy1_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6285656.html","width":130,"caption":"","height":184});
															thumbnails[6285715] = clik.newPhoto({"id":6285715,"src":"-0471_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6285715.html","width":130,"caption":"Dyffryn Spring Gardens","height":87});
															thumbnails[6834890] = clik.newPhoto({"id":6834890,"src":"21_697F8CCE-1D09-001F-990DBD3175751088_thumb.JPG","galleries_id":334794,"server_id":18,"link":"photo_6834890.html","width":130,"caption":"","height":87});
															thumbnails[6865416] = clik.newPhoto({"id":6865416,"src":"1_8B15E94A-24E8-5EC4-4FEB22B154C43E4C_thumb.JPG","galleries_id":104781,"server_id":18,"link":"photo_6865416.html","width":130,"caption":"Coed-Y-Mwstwr","height":195});
															thumbnails[6865418] = clik.newPhoto({"id":6865418,"src":"3_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865418.html","width":130,"caption":"Howells School, Cardiff","height":87});
															thumbnails[6865419] = clik.newPhoto({"id":6865419,"src":"4_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865419.html","width":130,"caption":"Coed-Y-Mwstwr","height":195});
															thumbnails[6865420] = clik.newPhoto({"id":6865420,"src":"5_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865420.html","width":130,"caption":"","height":87});
															thumbnails[6865662] = clik.newPhoto({"id":6865662,"src":"-0830_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865662.html","width":130,"caption":"Craig-y-Nos Castle","height":87});
															thumbnails[6865664] = clik.newPhoto({"id":6865664,"src":"0_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865664.html","width":130,"caption":"","height":87});
															thumbnails[6865665] = clik.newPhoto({"id":6865665,"src":"14_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865665.html","width":130,"caption":"The New House Country Hotel, Cardiff","height":87});
															thumbnails[6865667] = clik.newPhoto({"id":6865667,"src":"20_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865667.html","width":130,"caption":"","height":195});
															thumbnails[6865668] = clik.newPhoto({"id":6865668,"src":"NP7J45345_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865668.html","width":130,"caption":"Margam Park","height":194});
															thumbnails[6865669] = clik.newPhoto({"id":6865669,"src":"XA8J7972_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865669.html","width":130,"caption":"","height":195});
															thumbnails[6865670] = clik.newPhoto({"id":6865670,"src":"XA8J80751_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865670.html","width":130,"caption":"Craig-Y-Nos Castle","height":195});
															thumbnails[6865671] = clik.newPhoto({"id":6865671,"src":"XA8J81621_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865671.html","width":130,"caption":"Craig-y-Nos Castle, Crickhowell","height":93});
															thumbnails[6865672] = clik.newPhoto({"id":6865672,"src":"_P7J47041_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6865672.html","width":130,"caption":"","height":195});
															thumbnails[6866148] = clik.newPhoto({"id":6866148,"src":"03871_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6866148.html","width":130,"caption":"","height":195});
															thumbnails[6866152] = clik.newPhoto({"id":6866152,"src":"308_copy1_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_6866152.html","width":130,"caption":"","height":87});
															thumbnails[6895772] = clik.newPhoto({"id":6895772,"src":"--16_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_6895772.html","width":130,"caption":"Caerphilly","height":195});
															thumbnails[6914023] = clik.newPhoto({"id":6914023,"src":"--94_copy_copyweb_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_6914023.html","width":130,"caption":"","height":195});
															thumbnails[7043256] = clik.newPhoto({"id":7043256,"src":"XA8J3347_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7043256.html","width":130,"caption":"Canada Lodge ","height":185});
															thumbnails[7043535] = clik.newPhoto({"id":7043535,"src":"XA8J3280copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7043535.html","width":130,"caption":"","height":87});
															thumbnails[7137544] = clik.newPhoto({"id":7137544,"src":"1_1_of_1_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7137544.html","width":130,"caption":"","height":87});
															thumbnails[7137546] = clik.newPhoto({"id":7137546,"src":"1_1_of_1-2_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7137546.html","width":130,"caption":"","height":87});
															thumbnails[7349367] = clik.newPhoto({"id":7349367,"src":"DPP_0001_thumb.JPG","galleries_id":104781,"server_id":18,"link":"photo_7349367.html","width":130,"caption":"Clearwell Castle, Forest of Dean","height":195});
															thumbnails[7422129] = clik.newPhoto({"id":7422129,"src":"-2401 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7422129.html","width":130,"caption":"Coed-Y-Mwstwr","height":195});
															thumbnails[7422132] = clik.newPhoto({"id":7422132,"src":"0277kq copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7422132.html","width":130,"caption":"","height":87});
															thumbnails[7422187] = clik.newPhoto({"id":7422187,"src":"599 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7422187.html","width":130,"caption":"","height":195});
															thumbnails[7422200] = clik.newPhoto({"id":7422200,"src":"-0265 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7422200.html","width":130,"caption":"St. Catwg's Church, Pentyrch","height":87});
															thumbnails[7422201] = clik.newPhoto({"id":7422201,"src":"XA8J3077 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7422201.html","width":130,"caption":"Physic Gardens, Nr Bear Hotel, Cowbridge","height":87});
															thumbnails[7494066] = clik.newPhoto({"id":7494066,"src":"photo-2 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7494066.html","width":130,"caption":"St Mellons Hotel & Country Club","height":87});
															thumbnails[7494068] = clik.newPhoto({"id":7494068,"src":"photo-8 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7494068.html","width":130,"caption":"St Mellons Hotel & Country Club","height":87});
															thumbnails[7683603] = clik.newPhoto({"id":7683603,"src":"Alex_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7683603.html","width":130,"caption":"","height":195});
															thumbnails[7683607] = clik.newPhoto({"id":7683607,"src":"photo-75_copy_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7683607.html","width":130,"caption":"","height":87});
															thumbnails[7685265] = clik.newPhoto({"id":7685265,"src":"photo-46_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7685265.html","width":130,"caption":"New House Hotel, Cardiff","height":195});
															thumbnails[7685268] = clik.newPhoto({"id":7685268,"src":"photo-255_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7685268.html","width":130,"caption":"","height":197});
															thumbnails[7867691] = clik.newPhoto({"id":7867691,"src":"photo-182_copy_copy_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7867691.html","width":130,"caption":"","height":177});
															thumbnails[7963082] = clik.newPhoto({"id":7963082,"src":"photo-848_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7963082.html","width":130,"caption":"New Cottage Dance Studio, Ystrad Mynach","height":87});
															thumbnails[7969045] = clik.newPhoto({"id":7969045,"src":"photo-403_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7969045.html","width":130,"caption":"The Hollybush, Draethen","height":87});
															thumbnails[7969051] = clik.newPhoto({"id":7969051,"src":"photo-19_copy_copy_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7969051.html","width":130,"caption":"Pre Wedding Photoshoot.","height":87});
															thumbnails[7977736] = clik.newPhoto({"id":7977736,"src":"photo-407_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7977736.html","width":130,"caption":"The Hollybush, Draethen","height":87});
															thumbnails[8015159] = clik.newPhoto({"id":8015159,"src":"photo-19_copy_copy_copy1_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8015159.html","width":130,"caption":"Pre-Wedding photoshoot. New house Hotel, Thornhill, Cardiff.","height":92});
															thumbnails[8015175] = clik.newPhoto({"id":8015175,"src":"photo-166_copy_2_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8015175.html","width":130,"caption":"Cefn Cribwr, Bridgend.","height":98});
															thumbnails[8055623] = clik.newPhoto({"id":8055623,"src":"photo-131_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8055623.html","width":130,"caption":"The Angel Hotel, Abergavenny","height":87});
															thumbnails[8297250] = clik.newPhoto({"id":8297250,"src":"photo-294_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8297250.html","width":130,"caption":"","height":195});
															thumbnails[8297251] = clik.newPhoto({"id":8297251,"src":"photo-334_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8297251.html","width":130,"caption":"Maes Manor, Blackwood.","height":87});
															thumbnails[8297252] = clik.newPhoto({"id":8297252,"src":"photo-345_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8297252.html","width":130,"caption":"Maes Manor, Blackwood.","height":87});
															thumbnails[8706604] = clik.newPhoto({"id":8706604,"src":"photo-1_copy_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8706604.html","width":130,"caption":"","height":195});
															thumbnails[7683578] = clik.newPhoto({"id":7683578,"src":"photo-380 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7683578.html","width":130,"caption":"","height":195});
															thumbnails[7683601] = clik.newPhoto({"id":7683601,"src":"Aaron_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7683601.html","width":130,"caption":"","height":195});
															thumbnails[7685284] = clik.newPhoto({"id":7685284,"src":"alex2_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7685284.html","width":130,"caption":"","height":185});
															thumbnails[7707240] = clik.newPhoto({"id":7707240,"src":"photo-168 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7707240.html","width":130,"caption":"New House Hotel, Thornhill.","height":195});
															thumbnails[7732594] = clik.newPhoto({"id":7732594,"src":"photo-24 copy copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7732594.html","width":130,"caption":"Machen, Caerphilly","height":177});
															thumbnails[7867631] = clik.newPhoto({"id":7867631,"src":"photo-204_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7867631.html","width":130,"caption":"","height":198});
															thumbnails[8668099] = clik.newPhoto({"id":8668099,"src":"photo-4_copy_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_8668099.html","width":130,"caption":"","height":87});
															thumbnails[7732595] = clik.newPhoto({"id":7732595,"src":"photo-5 copy copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_7732595.html","width":130,"caption":"","height":94});
															thumbnails[8664967] = clik.newPhoto({"id":8664967,"src":"photo-2_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8664967.html","width":130,"caption":"","height":195});
															thumbnails[8668100] = clik.newPhoto({"id":8668100,"src":"photo-48_copy_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_8668100.html","width":130,"caption":"","height":87});
															thumbnails[5934176] = clik.newPhoto({"id":5934176,"src":"-14_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934176.html","width":130,"caption":"","height":195});
															thumbnails[7683561] = clik.newPhoto({"id":7683561,"src":"photo-42 copy copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7683561.html","width":130,"caption":"New House Hotel, Cardiff","height":87});
															thumbnails[7683576] = clik.newPhoto({"id":7683576,"src":"lisa & paul at the wenault copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7683576.html","width":130,"caption":"","height":87});
															thumbnails[7707242] = clik.newPhoto({"id":7707242,"src":"photo-210 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7707242.html","width":130,"caption":"New House Hotel.","height":195});
															thumbnails[7867633] = clik.newPhoto({"id":7867633,"src":"photo-741_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7867633.html","width":130,"caption":"New Cottage Dance Centre, Ystrad Mynach","height":87});
															thumbnails[8664968] = clik.newPhoto({"id":8664968,"src":"photo-3_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8664968.html","width":130,"caption":"Margam Park.","height":195});
															thumbnails[5934177] = clik.newPhoto({"id":5934177,"src":"-16_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934177.html","width":130,"caption":"Cardiff Bay","height":99});
															thumbnails[7707243] = clik.newPhoto({"id":7707243,"src":"photo-231 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7707243.html","width":130,"caption":"New House Hotel, Thornhill. Cardiff.","height":87});
															thumbnails[8664969] = clik.newPhoto({"id":8664969,"src":"photo-36_copy_copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_8664969.html","width":130,"caption":"Margam Park.","height":87});
															thumbnails[5934178] = clik.newPhoto({"id":5934178,"src":"-2_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934178.html","width":130,"caption":"","height":87});
															thumbnails[7707244] = clik.newPhoto({"id":7707244,"src":"photo-364 copy_thumb.jpg","galleries_id":104781,"server_id":18,"link":"photo_7707244.html","width":130,"caption":"","height":195});
															thumbnails[5934179] = clik.newPhoto({"id":5934179,"src":"-3_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934179.html","width":130,"caption":"","height":93});
															thumbnails[5934180] = clik.newPhoto({"id":5934180,"src":"-921_80D9C47B-1D09-001F-998750357622A6B2_thumb.JPG","galleries_id":334794,"server_id":18,"link":"photo_5934180.html","width":130,"caption":"","height":195});
															thumbnails[5934183] = clik.newPhoto({"id":5934183,"src":"15_80D9CA96-1D09-001F-99F5D8F708088A84_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934183.html","width":130,"caption":"","height":87});
															thumbnails[5934185] = clik.newPhoto({"id":5934185,"src":"36_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934185.html","width":130,"caption":"","height":87});
															thumbnails[5934184] = clik.newPhoto({"id":5934184,"src":"16a_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934184.html","width":130,"caption":"","height":87});
															thumbnails[5934186] = clik.newPhoto({"id":5934186,"src":"XA8J9186_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934186.html","width":130,"caption":"","height":87});
															thumbnails[5934187] = clik.newPhoto({"id":5934187,"src":"XA8J9187_copy_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934187.html","width":130,"caption":"","height":104});
															thumbnails[5934188] = clik.newPhoto({"id":5934188,"src":"_151_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934188.html","width":130,"caption":"","height":195});
															thumbnails[5934189] = clik.newPhoto({"id":5934189,"src":"_21_thumb.jpg","galleries_id":334794,"server_id":18,"link":"photo_5934189.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[104781] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"weddings","link":"gallery_104781.html","maxRecords":0.0,"photoIDs":[1536121.0,1536131.0,4155893.0,4155902.0,4590765.0,4606241.0,4606266.0,4607665.0,4910604.0,4910605.0,4910608.0,5795474.0,6080186.0,6236430.0,6282335.0,6285656.0,6285715.0,6865416.0,6865418.0,6865419.0,6865420.0,6865662.0,6865664.0,6865665.0,6865667.0,6865668.0,6865669.0,6865670.0,6865671.0,6865672.0,6866148.0,6866152.0,7043256.0,7043535.0,7349367.0,7422129.0,7422132.0,7422187.0,7422200.0,7422201.0,7494066.0,7494068.0,7683603.0,7685265.0,7685268.0,7867691.0,7963082.0,7977736.0,8015159.0,8015175.0,8055623.0,8297250.0,8297251.0,8297252.0,8706604.0,7683578.0,7685284.0,7707240.0,7867631.0,8664967.0,7683561.0,7683576.0,7707242.0,7867633.0,8664968.0,7707243.0,8664969.0,7707244.0],"skipIndex":0,"section_code":"gallery","featured_images":"8706604,8664969,8664968,8664967,8297252,8297251,8055623,8015159,7977736,7963082,7867691,7867633,7867631,7707244,7707243,7707242,7707240,7685284,7685268,7685265,7683603,7683578,7683576,7683561,7494068,7494066,7422201,7422200,7422187,7422132,7422129,7349367,7043535,7043256,6865671,6865670,6865669,6865667,6865665,6865664,6865662,6865420,6865419,6865418,6865416,6285715,6285656,6282335,6236430,6080186,5795474,4590765","id":104781,"singleSection":false});				  						galleries[334794] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_334794.html","maxRecords":0.0,"photoIDs":[1534191.0,5935024.0,5935025.0,6285642.0,6834890.0,6895772.0,6914023.0,7137544.0,7137546.0,7683607.0,7969045.0,7969051.0,7683601.0,7732594.0,8668099.0,7732595.0,8668100.0,5934176.0,5934177.0,5934178.0,5934179.0,5934180.0,5934183.0,5934185.0,5934184.0,5934186.0,5934187.0,5934188.0,5934189.0],"skipIndex":0,"section_code":"gallery","featured_images":"8668100,8668099,7969051,7969045,7732595,7732594,7683607,7683601,7137546,7137544,6914023,6895772,6834890,6285642,1534191","id":334794,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8706604,8297252,8297251,8055623,8015175,8015159,7977736,7969045,7963082,7867691,7685268,7685265,7683607,7683603,7494068,7494066,7422201,7422200,7422187,7422132,7422129,7349369,7137546,7137544,7043535,7043256,6914023,6895772,6865671,6865668,6865665,6865664,6865662,6865420,6865419,6865418,6285715,6285656,6285642,6282335,6282334,6236430,6080186,5795474,5795469,5795467,4910608,4910605,4910604,4607665,4606266,4606241,4155893,2351457,1536131,7867631,7707240,7685284,7683601,7683578,8668100,8664967,8664968,7867633,7707242,7683576,7683561,8664969,7707243,7707244';
imageSets[2] = '8706604,8297252,8297251,8055623,8015159,7977736,7969051,7969045,7963082,7867691,7685268,7685265,7683607,7683603,7494068,7494066,7422201,7422200,7422187,7422132,7422129,7421902,7349369,7349367,7137546,7137544,7043535,7043256,6914023,6914022,6895772,6865671,6865670,6865669,6865667,6865665,6865664,6865662,6865420,6865419,6865418,6865416,6834890,6285715,6285656,6285642,6282335,6282334,6236430,6080186,5795474,5795469,5795467,5233974,5233967,5233963,4590765,1534191,8668099,7867631,7732594,7707240,7685284,7683601,7683578,8668100,8664967,7732595,8664968,7867633,7707242,7683576,7683561,8664969,7707243,7707244';
imageSets[3] = '8706604,8297252,8297251,8297250,8055623,8015159,7977736,7969045,7963082,7867691,7685268,7685265,7683607,7683603,7422201,7422200,7043256,6834890,6285715,6285656,6285642,6282335,6282334,6236430,6080186,5795474,5795469,5795467,4863173,4612364,4607665,4606266,4606241,4590765,4155911,4155902,4155900,4155893,3415216,1536131,8668099,7867631,7707240,7685284,7683578,8664967,8664968,7867633,7707242,7683576,7683561,8664969,7707243,7707244';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/markbutler/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/markbutler/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/markbutler/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 = 'OJ  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> &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.item_price !== '') {
																		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="markbutler3172@fsmail.net">';
					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="markbutler3172@fsmail.net">';
				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;
	}
}

			

